Sunday, November 6, 2016

The Difference Between Throttling and Debouncing

https://css-tricks.com/the-difference-between-throttling-and-debouncing/

Above link shows a nice demo of how many Scroll Events are generated when using Nothing vs Throttling vs Debouncing


Saturday, September 17, 2016

Process & People, Minimum & Maximum

Below is a thought about Process vs People.

A company has People and Processes.

A Process can only ensure a Minimum.
However, reaching the Maximum, probably depends on how talented the People are, and other such X factors.

So, i think that it is very important to remember that efforts spent in improving our Processes will only move our Minimum higher. Not that that is bad, but it might not be enough.

If our goal is to achieve a great quality product, we have to invest in great People, and acknowledge that it is X factors that ultimately make the difference between achieving a Minimum and a Maximum.

web2web - Server-less & domain-less websites updatable via torrents and bitcoin blockchain

Thursday, September 15, 2016

Distributed Caching with Apache Ignite

Article talks in simple terms about how we can improve Output Caching in the scenrario where we have a Web Farm (i.e. multiple web servers)

https://ptupitsyn.github.io/Asp-Net-Distributed-Output-Cache/)

Thursday, September 1, 2016

Express vs Rails: Framework Comparison using a Simple Game API

The way to get more information is to iterate

From http://blog.launchdarkly.com/secrets-of-netflixs-engineering-culture/
 If you’re constantly testing ideas, even without having enough data, you’re quicker to get into the right path.
As Kris Gale, co-founder and CTO of Yammer said, “You will always make better decisions with more information, and you will always have more information in the future.” But the way to get more information is to iterate. 

Friday, August 12, 2016

Monday, August 8, 2016

Monday, August 1, 2016

Sebastian Markbage: Minimal API Surface Area | JSConf EU 2014

This is a talk that goes slightly against general 'standard' practices...
It's very important to keep coming back to this talk from time to time..


Friday, July 29, 2016

MySQL - instr

http://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_instr

instr - if substring is present, it returns a +ve number, else it returns a 0
Note: if not present, it returns a 0 and not a negative number (like -1)

Monday, July 25, 2016

Saturday, July 23, 2016

Thursday, July 21, 2016

Book - High Performance Browser Networking

https://hpbn.co/

Excerpt:
"Performance is a feature. This book provides a hands-on overview of what every web developer needs to know about the various types of networks (WiFi, 3G/4G), transport protocols (UDP, TCP, and TLS), application protocols (HTTP/1.1, HTTP/2), and APIs available in the browser (XHR, WebSocket, WebRTC, and more) to deliver the best—fast, reliable, and resilient—user experience."

AWS Lambda related - Building Serverless Apps

Monday, July 11, 2016

Saturday, July 9, 2016

Monday, July 4, 2016

Mongodb - getting started

1) mongo
-  to launch mongo shell

2) db.adminCommand( { listDatabases: 1 } )
- to list the databases

3) use abc
- assuming 'abc' is one of the databases listed by command 2

4) db.getCollectionNames()
- to list all the collections
- i think we have to run our queries on Collections just like we would run queries on Tables in a Sql database

5) db.users.findOne()
- assuming 'users' is a collection

Friday, June 24, 2016

Discussions

Reminder to myself since i am guilty as hell of the below sin - As a developer, discussions should be about how to do things, rather than about how to improve Process, self-improvement etc.

Do - what is the best language/framework to implement ABC application ?
Don't - how can we find time to learn that language/framework

Friday, June 17, 2016

Understanding of underlying software systems

This seems to be an awesome blog for learning the basics of how systems work: https://ruslanspivak.com/
Hi! I’m Ruslan Spivak, a 36 year old Software Team Lead from Canada, and if you’ve ever asked yourself:
  • “How do I create my own programming language?”
  • “How does an interpreter, compiler, or VM work and how do I create one?”
  • “How do I implement my own database and a small operating system?”
  • “How do I code my own web server?”
  • “How do I write my own web framework?”
Or if you’ve just wanted to know more about software development in general and how to become a better developer - then you are in the right place!
Here’s the deal:
I believe to become a better developer you MUST get a better understanding of the underlying software systems you use on a daily basis and that includes programming languages, compilers and interpreters, databases and operating systems, web servers and web frameworks. And to get a better and deeper understanding of those systems you MUST re-build them from scratch.

Serverless

http://martinfowler.com/articles/serverless.html
https://github.com/serverless/serverless

What is Serverless?

Like many trends in software there’s no one clear view of what ‘Serverless’ is, and that isn't helped by it really coming to mean two different but overlapping areas:
  1. Serverless was first used to describe applications that significantly or fully depend on 3rd party applications / services (‘in the cloud’) to manage server-side logic and state. These are typically ‘rich client’ applications (think single page web apps, or mobile apps) that use the vast ecosystem of cloud accessible databases (like Parse, Firebase), authentication services (Auth0, AWS Cognito), etc. These types of services have been previously described as ‘(Mobile) Backend as a Service’, and I’ll be using‘BaaS’ as a shorthand in the rest of this article.
  2. Serverless can also mean applications where some amount of server-side logic is still written by the application developer but unlike traditional architectures is run in stateless compute containers that are event-triggered, ephemeral (may only last for one invocation), and fully managed by a 3rd party. (Thanks to ThoughtWorks for their definition in their most recent Tech Radar.) One way to think of this is ‘Functions as a service / FaaS’ . AWS Lambda is one of the most popular implementations of FaaS at present, but there are others. I’ll be using ‘FaaS’ as a shorthand for this meaning of Serverless throughout the rest of this article.

System Design - Design a Key-Value Store

App Servers benchmarked for: Ruby, Node, Elixir, GO, Java, Crystal

https://github.com/costajob/app-servers

Excerpt: 

Results
Here are the benchmarks results ordered by increasing throughput.
App ServerThroughput (req/s)Latency in ms (avg/stdev/max)
Rack29208.813.13/0.348/13.28
JRuby-Rack32331.470.99/0.598/44.34
Plug33583.073.35/7.62/145.87
Node Cluster47576.682.51/3.40/120.02
Jetty52398.881.90/0.432/22.45
ServeMux58359.971.70/0.315/18.63
Crystal HTTP75159.451.33/0.270/6.02

Linux: how to find out which processes are attached to which ports

Saturday, April 16, 2016

Topics/Concepts for a person who wants to learn programming

This post is a work-in-progress. 

I spoke to a couple of friends (at different times) who wanted to know what programming was all about. The below points/concepts came to my mind during both those times, so I wanted to write a blogpost to save those points. (Better examples are needed perhaps for the below concepts).

1. Strings, Strings, Strings - alphabets, number, special characters etc.
Knowing how to do String manipulation in any language is a must - being able to create the required string, being able to split a string (parse a string) etc

HTTP protocol is just a bunch of rules that a browser (client) and server follow to exchange strings (messages) between one another.
Browser - i will send you this particular string if I want this
Server - I will send you this particular string if I have what you want

2. Object Oriented Programming (OOP), functions etc are just ways of Organizing your code... organizing your code in the same file or in different files etc
It is important to note that -
a) writing code to accomplish something is the 1st step;
b) the 2nd step is to organize it (using OOP, MVC etc) to make it easier to find it and modify later on.

3. Abstractions
Abstractions are everywhere in computers.
Lets say we have to work with something called A.
Lets say that it is really difficult to write programs for A.
What typically happens is that a genius (or a team of them) comes along and creates a layer called B that is easier to work with, but translates our programs to A.
Now if some people feel that B also is difficult for them, then a layer called C is created, and so on.

B & C are then called layers of abstraction over A.
B is a layer of abstraction over A.
C is a layer of abstraction over B.
Each layer's goal is hide the complexity of the layer beneath it and at the same time be useful to people.

As complexity of tasks increases, programmers tend to find themselves working with (in) lower and lower levels of abstractions.

Perhaps we should always try to spot the layers of abstraction in anything that we encounter in our software world.

Below are some Real-life examples of abstractions:

CPUs understand only 1s and 0s.
Assembly Language is an abstraction over 1s and 0s.
High-level languages are abstraction over Assembly Languages.

jquery is an abstraction over Javascript
bootstrap is an abstraction over CSS
ruby is an abstraction over C

4. API - Application Programming Interfaces
From wikipedia - A good API makes it easier to develop a program by providing all the building blocks, which are then put together by the programmer.

Best is an example - we want to get data from some company, say weather data from accuweather.com

So, to successfully get data from accuweather.com and display it in our application, we need 2 things:
a) first, we should check if accuweather provides an API to access its data
b) we should then look at that API's documentation - how to access the API, which functions/methods it provides etc.
We cannot guess how an API will work. We would need documentation of how it is supposed to behave - this should be given by the people who make the API.
We would need Documentation before we would be able to use any API.

5. Documentation
Take anything that has been built by Someone Else.
In order to use it properly, we would need its Documentation.

E.g. 1 accuweather.com's people built their API. They have to put up their Documentation on their website if they want people outside their company to be able to use.

E.g. 2. Java was initially created by Sun Microsystems, and now is being owned & worked on by Oracle.

When we work with Java or Accuweather's API, we have access to the below types of documentation:
a) verbal info from peers, or already existing code in your application
b) books, online tutorials, blogs, videos
c) documentation created by people who created Java or Accuweather.com's API

As the complexity of what you are trying to do increases, programmers typically shift from 'a' to 'b' to 'c'.

Friday, April 8, 2016

Monday, March 14, 2016

Wednesday, March 2, 2016

Unix Philosophy

http://homepage.cs.uri.edu/~thenry/resources/unix_art/ch01s06.html

Excerpt:
Doug McIlroy, the inventor of Unix pipes and one of the founders of the Unix tradition, had this to say at the time [McIlroy78]:
(i) Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new features. 
(ii) Expect the output of every program to become the input to another, as yet unknown, program. Don't clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don't insist on interactive input. 
(iii) Design and build software, even operating systems, to be tried early, ideally within weeks. Don't hesitate to throw away the clumsy parts and rebuild them. 
(iv) Use tools in preference to unskilled help to lighten a programming task, even if you have to detour to build the tools and expect to throw some of them out after you've finished using them.

Monday, February 29, 2016

Rails and 422 HTTP error message

http://blog.ethanvizitei.com/2008/04/wtf-is-422.html

Excerpt:
422 is returned by the Rails ActionController by default when a POST comes from another website outside your own web application. It's a security feature built in to prevent Cross-Site Request Forgery attacks.

Monday, January 4, 2016

Electron

Electron - Cross Platform Development for Desktop apps

Excerpt from : http://electron.atom.io/docs/latest/tutorial/quick-start/

Electron enables you to create desktop applications with pure JavaScript by providing a runtime with rich native (operating system) APIs. You could see it as a variant of the Node.js runtime that is focused on desktop applications instead of web servers.
This doesn't mean Electron is a JavaScript binding to graphical user interface (GUI) libraries. Instead, Electron uses web pages as its GUI, so you could also see it as a minimal Chromium browser, controlled by JavaScript.



Sunday, January 3, 2016

Clear test db while running rspecs

If we end up in a situation where we find out that the 'test db' is not being cleared properly, we can do the following:
http://stackoverflow.com/questions/25877734/rails-4-resetting-test-database

bundle exec rake db:reset RAILS_ENV=test

List Columns in table (in Rails Console)

From rails console, how to list columns in a particular table:
http://stackoverflow.com/questions/5575970/activerecord-list-columns-in-table-from-console

Model.column_names
e.g. User.column_names

Followers

Blog Archive