Tuesday, June 26, 2018

The Moden C++ Challenge - good book to improve programming with general stuff


Book link in pactpub.com - https://www.packtpub.com/mapt/book/application_development/9781788993869

Blogpost about the book by a C++ expert:
http://scottmeyers.blogspot.com/2018/06/interesting-book-modern-c-challenge.html
All in all, there are 100 problems in a variety of areas, including string processing, dates and time, concurrency, cryptography, and networking.

Sunday, May 27, 2018

An Important Gap in Software Development Process: How to improve what already exists

Current Focus of most Processes is on getting things done (i.e. productivity) and not on encouraging/generating/collecting/discussing Ideas (i.e. innovation?).

Below post is on one of the problematic side-effects of such a focus, and a trivially simple, but powerful solution to deal with that problem.

In Software Development, when Tasks are created in Project Management tools like Jira, they are usually:
  • Bugs to fix
    • existing stuff is not working as intended
  • Feature Improvement
    • client wants to make changes/additions to the existing stuff
    • OR client asks for a brand new feature
Bugs & Feature Improvements have one thing in common - the Point of Initiation of Work is a very clear business need. If all work is initiated like the above, we will end up with one Big Gap in our product development process - existing stuff never improves.

A Big Gap

Above categories miss one area - improving what already exists & works

Example:
  • Let's take one webpage in our web-application where things are working as intended (i.e. no complaints/change-requests have come from clients/users)
  • But there are aspects about it, like UI/Performance/UX, that different members of the team/company feel, can be improved.
    • Currently there is no way for anyone to initiate work on that webpage 
    • and that is the Big Gap i am referring to - there is no way to initiate work on existing stuff
    • And this Big Gap continues to exist indefinitely, because there are always going to be tasks with higher priorities that need attending to, than discussing, for example, about some minor UX/UI improvement on a webpage that is seemingly working fine.
A Solution

How do we improve what already exists and works?

I have realized that when a team identifies a problem and discusses it, it generally tends to make a good decision about the solution.
Simply put, if a topic is brought up on the agenda, it gets addressed/resolved.
The converse is unfortunately true as well - if an issue does not reach the agenda, it never gets addressed/resolved.

So we need to somehow bring tasks related to 'improving Existing Stuff' onto the Agenda.

How do such tasks come into existence, so that they can be added to the Agenda?

We need ideas, in fact a lot of ideas, big and small, to improve what already exists.

In order to do this, in my opinion, we need to create/implement a new Category of tasks, perhaps called Suggestion For Discussion, or Discussion Task, or something like that.

  • Creating a new category should be a trivial thing to do in tools like Jira

What is a 'Suggestion For Discussion / Discussion Task' ?
  • if ANYONE in the team/company has a suggestion/idea, they create a Suggestion For Discussion /Discussion Task in the Project Management Tool (e.g. Jira)
Who is it assigned to?
  • this is assigned to whoever is in charge of that specific area (a Project Manager or Product Owner, etc)
What is the Goal of such a task?
  • The goal of such a task is to make sure a Discussion happens around the Suggestion given
How is such a task completed?
  • the team can meet periodically (once a week, biweekly, monthly etc) to discuss such Suggestions
  • the Agenda for such a meeting could be the set of Suggestions that PM/Product Owner has received recently. This is a very important aspect because
    • having a very clear list of things to talk about is very different from adhoc-brainstorming-sessions
    • ensures a sustainable way for doing the meetings
      • People often stop going to meetings that are haphazard, and suddenly such meetings stop happening
  • a decision is made to accept a Suggestion, not-accept a Suggestion, or to revisit the Suggestion later on, and this is how such a task is 'resolved'.
How will these tasks help in improving what already exists?

This simple idea/tool can help with the following:
  • Provide a path in the process: This will give an official path for an idea/suggestion, however small or big, to reach fruition
    • This is the main contribution of this idea/tool.
  • Everyone thinks: Instead of Devs only writing code or QA only spotting issues, everyone will get a chance to think about how to contribute via Ideas/Suggestions as well
  • Prevent Ideas from being forgotten: A person who has thought of an idea can create a Suggestions-for-Discussion task at that moment - this will prevent ideas from being lost
  • Short-term effect: immediatley get to the job of improving existing stuff
  • Long-term effect: foster a culture of innovation
  • Maximize potential of existing team & Reduce burden on Superstars: Innovation/Ideas/Suggestions will not depend on just a few key individuals in the company, but will be the domain/responsibility of everyone. Superstars (i.e extremely talented individuals) like to work in stimulating & engaging environments where everyone is contributing, otherwise they also get fatigued.
    • In cases where teams do not have Superstars, they can at least perform to the best of their collective potential.
  • No Barrier for Contributing: New Employees Or Junior Team-members Or even Experienced team-members who are Not so Social, i.e anyone, can contribute ideas/suggestions without depending on what kind of personality they have OR what kind of personal rapport they have with a PM/Product Owner.
  • Improved job satisfaction when ideas/suggestions are accepted

Why can't the person who has a Suggestion, just go and talk to the Product Owner/PM, OR discuss the idea in one of the meetings?

The reason why Discussing-with-PM-or-in-Meetings will not work is - 
  • Things that are not urgent are better handled in an Asynchronous manner
    • e.g. we stick a PostIt note or add a ToDo item somewhere to remember to do stuff that we have to do later.
    • The very reason we use ToDo lists or PostIt notes, or even Project Management tools like Jira is because we cannot do all the things that need to be done at the same time.
    • By this argument, Ideas/Suggestions for Discussion need to be treated in the same way.
  • People might not feel comfortable suggesting minor improvements in a meeting-setting
    • Consider the scenario of a Dev/QA who has thought of, not major improvements, but just a couple of minor UX improvements
    • They might not feel comfortable speaking about such minor suggestions in meetings
Limit this idea to Existing Stuff ?

This simple tool/technique is actually about gathering ideas from everyone, and hence can be used to gather ideas about Existing Stuff as well as for New Features.

So the question is - is it better to limit this tool to gathering ideas about Existing Stuff? 

I am not sure about this. My current opinion is - 
  • Initially i.e. until everyone gets used to it, it is probably better to limit this tool only to suggestions related to Existing Stuff
    • This is needed because, it is important for everyone to understand that it is OK (and in fact, desirable) to contribute minor changes as well.
    • If brand new Feature Improvements also are allowed to use this tool - this tool might get hijacked by the new & shiny stuff (and people might not feel comfortable contributing 'small' ideas).
  • Perhaps we could have 2 separate categories, one for Existing Stuff and one for New Stuff.

Alternative Implementation

UserVoice is a widely used tool whose purpose is to collect ideas like I have discussed above.
However UserVoice is being used to collect feedback mostly from Clients/Users and not from Developers/QA/PMs. 

Perhaps Devs/QA/PMs can use something like UserVoice for the exact same purpose too.

However I feel it is easier & better to treat Discussion of Suggestions/Ideas as Tasks and hence use the same Project Management tool that is used for Bugs and Feature Improvements.

Final words

Current Focus of most Processes is on getting things done (i.e. productivity) and not on encouraging/generating/collecting/discussing Ideas (i.e. innovation?).

Suggestions/Ideas, however minor, are very important and hence need to be handled in the same process that is used for Bugs/Feature Improvements.

Saturday, April 28, 2018

Track

iOS - 10
https://docs.microsoft.com/en-gb/xamarin/ios/get-started/hello-ios-multiscreen/hello-ios-multiscreen-quickstart?tabs=vsmac

Ruby, RoR - 0.5

React -

Vue - 4
https://www.vuemastery.com/courses/intro-to-vue-js/vue-instance

Electron - 4
- have to check how notifications are shown (which are notifications and which are just toastr messages; where is notification manager?)
- faye code to show notifications?
- rules engine
- how to submit an Electron app to Windows Store & Mac App Store
  -- can we submit a sample app
- prevent session timeout so that user stays logged-in
--- if user stays logged-in, then things that happen at login time (like Login Interrupts) need to be triggered when user launches app
- can we write code to distinguish whether user is using browser or Electron app ?
- look at Google Analytics for different clients to see usage on Windows and MacOS
- on Macs we can show Notifications that stay on the screen; can we do the same on Windows? 

Monday, April 16, 2018

Mongodb related

1) Export
mongodump
Above command will export everything (all databases) into a folder called 'dump'

2) Import
mongorestore dump

Sunday, April 8, 2018

Rails: How to chain scope queries with OR instead of AND?

Internal Side Projects

I wrote the below comment in reddit.com/r/programming in response to a medium.com post about Hype Driven Development

There is a solution in my opinion: Internal-Side-Projects.

The only way, for a team to choose/decide in an informed manner, is to do some Internal-Side-Projects using the said framework/stack. Internal-side-projects = something non-critical but useful that everyone can work on, and should work on.

At the minimum, all senior-developers in the team/company should do be indulging in this. If we do this, when the time comes to make a decision, the team will actually have meaningful discussions. Sometimes decisions become obvious when people actually know what they are talking about. (The happy side-effect is that developers remain happy as they get to learn new things.)

However, for this to be practically possible, the company's culture should plan for & encourage such internal-side-projects.

This is absolutely essential for a company/team to remain competitive in the long-run.

Saturday, March 24, 2018

Rails: Full-Text Search related

Pg_Search & SearchKick are gems 

Pg_Search vs SearchKick
https://www.webascender.com/blog/rails-search-gems-searchkick-vs-pg_search/

Pg_Search

One of the best features of Postgres is the built-in, full-text search capabilities. The pg_search gem helps maximize these capabilities by providing a powerful, yet simple, search capability. pg_search is great for a basic search that will search multiple models, associations, and is able to hook into advanced Postgres features in the optional contrib package. This contrib package allows fuzzy and trigram searching.

ElasticSearch & SearchKick in Depth
https://www.webascender.com/blog/rails-elasticsearch-searchkick-depth/

SearchKick:
Github: https://github.com/ankane/searchkick
GoRails video: https://gorails.com/episodes/elasticsearch-with-searckick
DriftingRuby video: https://www.driftingruby.com/episodes/searchkick-and-elasticsearch

Other videos related to Search:
- Ruby on Rails - Railscasts #278 Search With Sunspot - https://www.youtube.com/watch?v=6ub9OYNvHZk
- Ruby on Rails - Railscasts PRO #343 Full-Text Search in PostgreSQL (pro) - https://www.youtube.com/watch?v=n41F29Qln5E
- RailsConf 2016 - Multi-table Full Text Search with Postgres By Caleb Thompson - https://www.youtube.com/watch?v=OzHhJPlgZaw


Rails: Best practices for running Rails in production

ActiveRecord related: marginalia gem - for adding comments to ActiveRecord queries

https://signalvnoise.com/posts/3130-tech-note-mysql-query-comments-in-rails
From https://github.com/basecamp/marginalia:
Attach comments to your ActiveRecord queries. By default, it adds the application, controller, and action names as a comment at the end of each query.
This helps when searching log files for queries, and seeing where slow queries came from.
For example, once enabled, your logs will look like:
Account Load (0.3ms)  SELECT `accounts`.* FROM `accounts` 
WHERE `accounts`.`queenbee_id` = 1234567890 
LIMIT 1 
/*application:BCX,controller:project_imports,action:show*/
You can also use these query comments along with a tool like pt-query-digest to automate identification of controllers and actions that are hotspots for slow queries.
......
.......
Marginalia ships with :application, :controller, and :action enabled by default. In addition, implementation is provided for:
  • :line (for file and line number calling query). :line supports a configuration by setting a regexp in Marginalia::Comment.lines_to_ignore to exclude parts of the stacktrace from inclusion in the line comment.
  • :controller_with_namespace to include the full classname (including namespace) of the controller.
  • :job to include the classname of the ActiveJob being performed.
  • :hostname to include Socket.gethostname.
  • :pid to include current process id.

Sunday, February 25, 2018

Turbolinks related: InstantClick

InstantClick library -
http://instantclick.io/click-test 

Discussion in Turbolinks related to idea established in InstantClick library:
Prefetch Loading - https://github.com/turbolinks/turbolinks/issues/84
turbolinks "instantclick" - https://github.com/turbolinks/turbolinks/issues/313 

Barba.js - barba.js is a small (4.4kb minified and gzipped), flexible and dependency free library that helps you creating fluid and smooth transitions between your website's pages.
http://barbajs.org/index.html
https://www.smashingmagazine.com/2016/07/improving-user-flow-through-page-transitions/

Other related links:
https://news.ycombinator.com/item?id=12481969
https://github.com/Easyfood/pageAccelerator

https://caniuse.com/#feat=link-rel-preload
https://css-tricks.com/prefetching-preloading-prebrowsing/ 

Sunday, February 4, 2018

Ruby Metaprogramming related

Instance Methods, Class Methods, Singleton Methods.......
https://stackoverflow.com/questions/212407/what-exactly-is-the-singleton-class-in-ruby

Great video on Ruby Metaprogramming - multiple viewings essential
https://youtu.be/7D9wwPniszY

Saturday, February 3, 2018

Difference between Couchbase & Mongo

 https://blog.couchbase.com/data-modeling-nosql-documents-mongodb-vs-couchbase-server/
The referred documents in Couchbase can be joined in a single server side operation through N1QL rather than forcing the application layer to take care of it.
 ......
.......

The core differences come in regards to how you query the documents. It is much easier to query for data in Couchbase through N1QL and the other query strategies, regardless how you’ve chosen to model your documents.
If you’re interested in seeing a modeling and querying video I recorded, check it out here.


Monday, January 15, 2018

Sunday, October 22, 2017

headless-chrome - getting started in ruby

headless-chrome

- Install Chrome 59 or later from google.com/chrome

- download chromedriver and put in a new folder called 'chromedriver'; so the path to the binary is similar to - /home/sai/chromedriver/chromedriver

- now we have to add the above binary's path to PATH 
-- Open the below file in nano editor
nano ~/.bash_profile
-- add the below line
PATH=$PATH:/home/sai/chromedriver export PATH

- gem install selenium-webdriver

- gem install chromedriver-helper

- Now we can start executing the scripts found in -  https://readysteadycode.com/howto-scrape-websites-with-ruby-and-headless-chrome

Wednesday, September 27, 2017

Git related: DeepGit - tool to investigate the history of source code

https://www.syntevo.com/deepgit/

DeepGit is a tool to investigate the history of source code. It is based on git blame and makes it easy to trace changes to a line or block of code. DeepGit will detect code movements, even if lines are not identical.

Thursday, September 7, 2017

Rails debugging related

Use sth similar to below alongwith binding.pry

caller.select{|c| c.include? "rails-project-folder-name"}

This will give the list of callers (methods) that are your code.


Wednesday, August 30, 2017

Try Ruby in the browser

The software engineering rule of 3

https://erikbern.com/amp/2017/08/29/the-software-engineering-rule-of-3.html

Excerpts:
 first rule of 3. Don’t worry so much about code duplication if you only have two classes or two functions or whatever. When you see a pattern in three different places, it’s worth thinking about how to factor it out.
...
...
 second rule of 3 — you’re not going to get the system design right until the third time you build it. 

Sunday, August 27, 2017

Kibana related: Searching in Kibana

https://lucene.apache.org/core/2_9_4/queryparsersyntax.html

Search for 2 strings using AND operator:
"15-0001" AND "10-0005"

Choosing a frontend JS framework

https://medium.com/front-end-hacking/how-it-feels-to-learn-javascript-in-2017-a934b801fbe

Excerpt:
Interesting. Which one should I use? The big ones are React, Angular and Ember, right?
-They’re all good. If you want to write your front-end logic in Handlebars use Ember. If you want to write your front-end logic with HTML attributes use Angular or Vue. If you want to write your front-end logic with JavaScript use React, Mithril or Inferno.

Tuesday, July 25, 2017

redbus move to .Net Core & their blog

imba.io

Imba is a new programming language for the web that compiles to highly performant and readable JavaScript. It has language level support for defining, extending, subclassing, instantiating and rendering dom nodes. For a simple application like TodoMVC, it is more than 10 times faster than React with less code, and a much smaller library.


Saturday, July 22, 2017

Blockchain related: A hacker stole $31M of Ether—how it happened and what it means for Ethereum

Advice from Claude Shannon

10,000 Hours With Claude Shannon: How A Genius Thinks, Works, and Lives:
https://medium.com/the-mission/10-000-hours-with-claude-shannon-12-lessons-on-life-and-learning-from-a-genius-e8b9297bee8f

Excerpts from the above article:

1) Cull your inputs.
2) Big picture first. Details later.
3) Don’t just find a mentor. Allow yourself to be mentored.
4) You don’t have to ship everything you make.
Vannevar Bush left his imprint on Shannon in another way: he defended the value of generalizing over specializing. As he told a group of MIT professors:
“In these days, when there is a tendency to specialize so closely, it is well for us to be reminded that the possibilities of being at once broad and deep did not pass with Leonardo da Vinci or even Benjamin Franklin. Men of our profession — we teachers — are bound to be impressed with the tendency of youths of strikingly capable minds to become interested in one small corner of science and uninterested in the rest of the world. . . . It is unfortunate when a brilliant and creative mind insists upon living in a modern monastic cell.”
Bush encouraged Shannon to avoid cells of all kinds
5) Chaos is okay.
6) Time is the soil in which great ideas grow.
7) Consider the the content of your friendships.
8) Put money in its place.
9) Fancy is easy. Simple is hard.
“Almost every problem that you come across is befuddled with all kinds of extraneous data of one sort or another,” Shannon said, “and if you can bring this problem down into the main issues, you can see more clearly what you’re trying to do.”
10) The less marketing you need, the better your idea or product probably is.
11) Value freedom over status.
12) Don’t look for inspiration. Look for irritation.
Shannon’s most evocative formulation of that elusive quality put it like this: it was “a slight irritation when things don’t look quite right,” or a “constructive dissatisfaction.” In the end, Shannon’s account of genius was a refreshingly unsentimental one: A genius is simply someone who is usefully irritated. 
 

Wednesday, July 19, 2017

http client - Requester


Steps for developing a React app from scratch

Excerpt from the book FullStack React (Chapter 2 - Components)

In fact, this follows from a handy framework for developing a React app from scratch:
1. Break the app into components
2. Build a static version of the app  
3. Determine what should be stateful
4. Determine in which component each piece of state should live
5. Hard-code initial states
6. Add inverse data flow
7. Add server communication

Chrome Dev Tools related

Sunday, July 9, 2017

Jonathan Blow talk - shares some hard-earned wisdom about programming & projects



His talk is about 38 minutes long.

Alexander Pope: A little learning is a dangerous thing

From http://norvig.com/21-days.html
Above link is already part of a previous blogpost, but the below quote is worth a new blogpost by itself.
As Alexander Pope said, a little learning is a dangerous thing.

Peter Norving: Teach Yourself Programming in Ten Years

Peter Norvig is a director of research at Google Inc.

He wrote way back in 2001 - Teach Yourself Programming in Ten Years -
http://norvig.com/21-days.html

Peter Norvig: Being good at programming competitions correlates negatively with being good on the job

Peter Norvig is a director of research at Google Inc.

http://www.catonmat.net/blog/programming-competitions-work-performance/
"Being good at programming competitions correlates negatively with being good on the job"


Broad generalizations will not stand up in a court of law, but they do point towards things to ponder.

My takeaway from the above video - Trying to get things done quickly, all the time, can be a Negative thing.

Thursday, June 29, 2017

Java EE -- The Competitive Advantage For Startups


From Adam Bien's blog:
"At the infoshare.pl 2017 conference in Gdansk I got 30 minutes time to explain why Java EE is happily used by startups with live hacking. Deployment to Amazon Cloud (AWS) included:"
Java EE -- The Competitive Advantage For Startups
http://adambien.blog/roller/abien/entry/java_ee_the_competitive_advantage

Friday, June 16, 2017

Instagram Makes a Smooth Move to Python 3

https://thenewstack.io/instagram-makes-smooth-move-python-3
By all reports, things went really smoothly — how did the team make it happen so seamlessly?
Guo: An important factor was, if you look at how we were migrating, we would constantly check in small changes into the master branch, so we were never merging major diffs. Getting the most bugs fixed, with a smaller audience iterating in small steps: that was the key approach to maintaining stability while still moving quickly.

Followers

Blog Archive