Posts

Showing posts from 2019

Collapsible Tree using D3 for large number of nodes

Image
A beautiful collapsible tree built using D3. Clicking on the a node will collapse a tree. This is a great way to navigate a tree with large number of nodes

JSON Web Token

JWT or JSON Web Tokens can be used for securely transferring data between two apps. You can use this to build a lightweight Single Signon functionality within your webapps. An Introduction to JSON Web Tokens in Plain English

Chart Nested Labeling

Image
A Nice example of a Chart with Nested Labeling from Working in the Service Sector in Boston Another way to do this is by using Hierarchy Labeling from Oracle JET

FlightAware Misery Map

Image
Flight Aware has a great visualization for show flight delay across the USA. They call this the Misery Map It also has a timeline that you can play across the last three days

Learning UI Design and Data Palette Picker

I was listening to the Basics of UI Design for Engineers episode on the Programming Throwdown podcast where the interview Erik Kennedy. He has a great blog at Learn UI Design Blog . I have designed a color palette selector which can be applied to charts, maps and tables. A good description is in the Picking Colors Blog entry. He also has a great Data Color Picker tool for understanding palettes.

Linux Finding Directory with large number of files

I recently ran into an issue where there was some new software running which was writing a lot of trace files which was causing my disk space to be full. I was not sure which directory it was writing it in so I googled for a script and found this https://unix.stackexchange.com/questions/122854/find-the-top-50-directories-containing-the-most-files-directories-in-their-first I ran the following command and it found the offending directory in 2 mins. du --inodes -S | sort -rh | sed -n \ '1,50{/^.\{71\}/s/^\(.\{30\}\).*\(.\{37\}\)$/\1...\2/;p}'

Guided Tour Hopscotch Javascript Library

When a user sees a new application for the first time they have a tough time figuring out what part of the application to focus on. Hopscotch is a framework to make it easy for developers to add product tours to their pages. Hopscotch accepts a tour JSON object as input and provides an API for the developer to control rendering the tour display and managing the tour progress.

IDE One (Java equivalent of JSFiddle)

I had a Java and programming newbie ask me for some Java code to sum up a 2D array. I wanted to make sure that I can show him the entire working source code for doing this. So I searched for a Java equivalent of JSFiddle and found IDEOne . It supports 60 languages and is great for trying out small functions. It even has a very nice full screen mode.

Mustache Logicless Template Engine

I worked on a project a few years back where I worked on a UI which allowed the user to generate a bunch of predefined named formulas. I created a templating engine that allowed the user to define new templates where they could specify what calculation to generate and how to name the calculation. The user could also specify the inputs to the calculation and the application would dynamically generate the UI for specifying the calculation expressions. I had templates for generating the UI "Moving total (sum) of {1} in the {2} dimension and {3} hierarchy. Include {4} preceding and {5} following members within {6}."}, I had template for generating the name "{measure_name} || '_RANK_' || is_selected({hierarchy_level}, {hierarchy _level_name}, {dimension_name} || '_' || {rank_within_name})" I needed to do something similar for another project that I was working on but I needed the template to work in Java and Javascript. Mustache is a logic l...

Data Science

Kaggle is a great resource for Data Scientist as it has course on learning Data Science using Python . Also it has kernels/ notebooks that shows analysis of different datasets creating by users. It also has a lot of datasets that can be used for analysis.

curl to Javascript JQuery code using Postman

Image
I was looking for a tool that given a Curl Command can generate Javascript JQuery AJAX code. Postman does this where you can test your REST API and also generate the Javascript code. You can import the Curl command by clicking Import and pasting the curl command in Paste Raw Text You can then generate the code by clicking on Code (next to Cookies) and then selecting the language

Oracle Database Scripts

oracle-base.com  is one of the best websites that has SQL scripts that are very easy to run. It describes step by step how to try out different features in the database from 8i to 19c. 

Insomnia REST Tool

Image
I was having problems figuring out why authentication is not working for a REST Endpoint that I have exposing using Oracle ORDS. I was doing my testing using curl which is not very helpful and then I discovered Insomnia REST . It is a Windows and Linux based tool that quickly lets you try out your REST API calls.

Visualizations

ECharts Oracle JET Mike Bostock D3

Learn Data Science and Python for Free

Hear is a great video on how you can learn Data Science and Python for Free  The description has a long list of links on all the topics you can study for Data Science.

Debugging Node.js in Visual Studio Code

Visual Studio Code is fast turning into my default IDE for most of my web based development. It is very fast and snappy and just seems to do the right thing. I am architecting a new product and I wanted to write a prototype for processing some JSON and I decided to this all in Node.js. I was able to setup a fast coding and debugging environment by turning on Node Debug in Settings and then just running node --inspect-brk foo.js  in Terminal. Make sure that you set a breakpoint before running.

Trade And Globalization (Our World in Data)

I am always on the lookout for good public data sets. I ran into this great one about Trade and Globalization . The data starts at 1800 and shows how trade has grown 4000% in the last century and most of the trade increase has been post 1950. This data is hosted on Our World in Data . They cover a lot of economic topics such as Energy, Military Spending, Poverty and so on.

API Gateway

We need to write our business logic independent of other concerns such as authentication, authorization, UI, logging etc. An API Gateway is a layer between all your client requests and a server that has the business logic. This is like a Java Servlet Filter. API Gateway by Chris Richardson at Microservices.io API Gateway 10 minute video  

Docker Cheat Sheet

Here is a good Docker Cheat Sheet I was looking at Google Cloud Data Analytics Video  and they mentioned that the Google Cloud Data Fusion is based on CDAP which Google bought. I downloaded and ran the image. docker pull docker pull caskdata/cdap-sandbox docker run -p 11011:11011 -d caskdata/cdap-sandbox

Markup Languages

I was looking into Swagger YAML and saw that it had a very simplified markup using just colons and indentation for describing hierarchical information. The evolution from XML -> JSON -> YAML shows that transition from more formal and explicit XML to more informal looking YAML. servers:   - url: http://api.example.com/v1     description: Optional server description, e.g. Main (production) server   - url: http://staging-api.example.com     description: Optional server description, e.g. Internal staging server for testing YAML vs XML vs JSON

Algorithmic Complexity and Big O Notation

I was listening to the Algorithmic Complexity on Coding Block and they were talking about the dangers of O(n 2 ) .  When I am doing a lot of metadata related coding I will quite often do O(n  2 ). But when I started going over any data collections I have to be a lot more careful of my loops and make sure that the performance is more linear. Big O notation is an approximation so O(n/2) gets simplified to O(n). See Big O Cheat Sheet that was mentioned in the blog.

Browser Request Header Referer

I was helping one of our product managers build a prototype website that was linking to all kinds of URLs using Javascript window.open. This worked fine with localhost but when we tried to access it from another machine we were getting a 403 error on one of the URLs. I then looked at the request headers in Chrome, which you can do by bringing up the Network tab in the Debugger and refreshing the page and then clicking on the URL and the click on the Headers. When we typed the actual hostname vs localhost a 'referer' was being set which was causing the 403 error. The fix for this was to add or do the following before your window.open ... var meta = document.createElement('meta'); meta.name = "referrer"; meta.content = "no-referrer"; document.getElementsByTagName('head')[0].appendChild(meta);

Java Jackson JSON serialize and deserialize

Best list of example for serializing and serializing JSON using Jackson

Learn X in Y Minutes

I used create very good notes when I learnt a new programming language or API. But with work keeping me very busy I haven't had time do that. I recently bumped into this great website which is very handy when you are trying out something basic in a new language or environment and you just want a quick example. I also love the website name. Learn X in Y Minutes