Posts

Showing posts from May, 2018

JSON Beautify

Valid JSON requires that the keys be quoted e.g {"a": 10}. The problem is that if you have a large JSON text that you want the user to view and edit. The quotes makes the text verbose and hard to read. You can use JSON_mod2 to beatuify your JSON with the following call. var indent = 2; var dropQuotesOnKeys = true; JSON2_mod.stringify(jsonObj, null, indent, dropQuotesOnKeys);

Animated Condegram

One of the problems with a vertical or horizontal bar chart is that when you have a large set of values you waste a lot of empty space above the bar chart and you either end up with small bar widths or with a bigger bar width and a scroll bar. An alternative to this is to render the bar chart in a spiral.

JSON Schema Generator Validator

I am developing an Analytics Application where I want the user to be able to import and export various features of the application to JSON. The export is not a problem as I am constructing it in my code. The problem is on an import I need to validate the JSON schema. I found the following library that does a comprehensive job on the JSON schema validation. Another JSON schema validator JSON schema generator

Geospatial Problems

Other geo spatial probelms that I am working on is give a data set of locations how to show the correct map e.g if the data is for cities in France we dont want to see the Europe Map. So I build an index of locations to maps and I search the index with the narrowest match and show the other maps as an option that the user can select. Yet another problem I have to solve is to given a GeoJSON map display the label in the right location. The Mapping library I am using just places the label in a centered location based on a rectangle that covers all the polygons that define a region. This is a problem first for a country liked United States as it encompasses disparate states like Alaska, Hawaii. Since United States is a MulitPolygon in GeoJSON we can compute the area for all the polygons and then pick the largest polygon for labeling the region. Labeling a region is easy for a state like Colorado as it is a large square. It is a problem for a state like New Hampshire and Florida as th...

Spark Geospatial Analytics

Software Engineering Daily had a great podcast performing Geospatial Analytics using Magellan on Apache Spark which is a distribute Big Data Analytics engine. One of the common problems in geospatial is given a longitude and latitude how to find which zip code in the United states is this point is located in. So if you have a set of polygons that define the region for all the zip codes in the United States. Then this is basically a point in a polygon geometry problem. Since this is an expensive operation it does not make sense to check for say a location in Florida by checking all the zip code polygons in the US. They way Magellan solves this problem is by dividing the Earth into a recursive set of squares and then checking first if a point belongs in a square. We then have an index of all the zip codes in that square. Once we recursively descend down the squares we can start checking against a set of polygons that are in the square. Spark Geospatial Analytics podcast

Kubernetes Cloud Native Computing Foundation

Since my work commute has grown longer, it has given me an opportunity to listen to a lot more podcasts. I was listening to the Cloud Native Computing Foundation on Software Engineering Daily The Cloud Native Computing Foundation manages Kubernetes which is the open source container orchestration tool. The podcast was primarily about how the foundation manages the project. An interesting fact I picked up from the podcast was that Kubernetes is become the second most popular open source project after Linux. They display the test results against all the major cloud providers at their CI dashboard site

Computer Science in a Year

I head this on the Code Newbie Podcast. Vaidehi Joshi has blogged about her experience of trying to learn all the computer science basics in a year .