## Archive for the ‘**Visualization**’ Category

## Favorite material design button with or without JS

I am having fun creating things at Codepen.io.

I have created a toggle button with JS and without using JS.

For the non-JS version I used the radio-button hack technique with stacked radio buttons.

**Without JS**

**With JS**

## Being creative – Making logos with css

My latest hobby is to find logos as images and re-create them with css and responsive design.

I have added mouse over effects to make the logos dynamic.

You can resize the width of the browser window and you should see the logos adapts to the screen width.

Build for modern browsers, tested with latest Chrome and Firefox

(I don’t want to spend too much time with browser-testing in my leisure time).

Here are some of the results.

## Lego Kaizen at work

I have been working a couple of years now using agile methodologies (Scrum).

I started in a new team recently where they use the Scrum methodology.

The team works in the spirit of agile mindset and is constantly finding small improvements. Besides the daily scrum tasks we have the flexibility to take upon Kaizen tasks with the purpose of improving the daily workflow which are not necessarily related to the user stories.

The next thing recently just introduced are the ability to flag your current mode at your desk.

- Green – Available if you have questions or want help
- Yellow – Only contact me if it is important
- Red – Busy at the moment

You take a lego piece and display your current mode.

With this hopefully the team can be more effective where communications is directed at those available and the busy ones have ability to flag that they want to be left alone to complete their tasks without being disturbed.

## K-nearest neighbor in 2D dimension space

## K-nearest neighbor

There are miscellaneous algorithms for searching nearest neighbors.

An alternative method is to use grid indexing strategy.

Slowly expand the grid boxes from the center to find the k-nearest neighbors.

The grid is used as a filtering mechanism to reduce the search space.

This works fast for distributed data across the space and is a good alternative algorithm for dynamic data that changes position frequently.

### Reference links:

Project implemented in C# is available at Github:

A survey of techniques for fixed radius near neighbor searching:

The origin is in ring 0.

The origin can anywhere in the box and the distance to test on first iteration must be at least 1 x grid distance. The first iteration starts with data from ring 0 and 1.

**The algorithm goes like this:**

i = 0 Point origin list currRing = empty list nextRing = empty list temp while all rings not explored i = i + 1 temp = empty for all point in nextRing test distance between origin and point if distance is within i * grid put it in currRing else put it in temp nextRing = empty Add all from temp to nextRing temp = empty if(i==1) temp = points from ring 0 and ring 1 else temp = points from ring i For all point in temp test distance between origin and point if distance is within i * grid put it in currRing else put it in nextRing If there are at least k points in currRing then exit while loop end while loop if currRing count is < k then add all from nextRing to currRing sort currRing by distance take first k from currRing

**Grid version algorithm:**

Apply algorithm described above.

Searching: `O(n * m)`

where m is grid cells and k << n.

**Naive version algorithm:**

For origin point check the distance to every other point.

Take k first items sorted by distance.

Searching: `O(n log n)`