Archive for the Uncategorized Category

[ REVIEW ] PACKT Publishing’s Video courses on “Building Your First Application with Go”

Posted in Uncategorized with tags , , , , , , on April 25, 2014 by abhishekkr

Recently I was asked to review PACKT Publishing‘s Video courses on “Building Your First Application with Go” from Rostyslav Dzinko. I’ll accept I thought it would be just beginner’s stuff looking at the title, but designer of course has managed to bring in an interesting flow and some good practice points along the flow.

~Review~

The course structure is very broad, let not the course title make you take a narrow view. It covers from the mere basics of downloading and installing Golang compiler. Then slowly moves on to teach how to build a full working web application for image effects with some good dev practices.

What would you gain from it?

It’s formed of 8 fine sections which gradually make you familiar with different constructs of Golang internals.

The first section covers getting your workspace ready to try out Golang programming and strcture of a Golang program. It introduces to tools provided by Golang for seeking help, checking respective environment variables, lint formatting the code, running/building/installing Golang program. Shows example of a program taking input, processing the value and sending it to standard output. Then it ends with single line and multi-line style of commenting and quickly ends with introduction to Godoc way of Golang Code Documentation.

The second section starts with basic definitions of variable and constants, scope availability and then discusses the type inference capability. It details out all the important data types and example usages of each. In the end Narrator points to “strings” packages for learners to go and explore, which is good in a way not to serve everything on a platter. While giving intro to maps the Narrator also gives a taste of easy serialization/deserialization of data in Golang using example of “encoding/json” module.

The third section focuses on Control Structures. Covering if-else and switch-case for conditional logic, few variations of for for loop. It also talks of handling error and comma-ok notation returned.

The fourth section is about structuring the code with package and functions. Examples are given of functions, anonymous functions, packages, init functionality in packages and usability of deferred execution.

The fifth section familiarizes learners with the example of practicing Object Oriented Programming using Golang constructs. Narrator starts with insight on use of Structures in Golang with some examples and how can behaviors be added to Structures. A very good work has been done at explaining interfaces with gradual examples. It’s one of the philosophically misunderstood thus hated feature of Golang ad the Narrator has done a good job in averting that for beginners.

The sixth section is dedicated to one of the forte of Golang, concurrent system programming. Narrator shows some neat easy examples around usage of Goroutines and then brings in a better usable approach with “runtime” and “sync” package features. Then he explains well on role of Channels with good usecase examples. He showcases use of buffered channels, fan-in pattern, fan-out pattern also in a very simple but clear way.

The seventh section is their to make learners familiar with Golangs built-in package power for web application development. There are examples here for running a web server, handling routing, using HTTP GET request parameters. Narrator also gives a quick demo on using “Gorilla Web Framewoek“‘s routing and query param capabilities giving a sample Golang being ready for advanced web-app development. HTML Templating library is also covered in a decent manner. It ends with intro to panic and recover feature of Golang, which are not specific to web programming but specific to any good Golang project.

The eigth and final section is all about using what all has been covered so far and turning it into a real world web application capable of uplaoding an image; then performing color inversion and rotation on it. Narrator uses Golang’s “image” package for image transformations and the upload files are just kept in memory map of image filenames to file-data blobs. Then in the end he refactors the grown messy code into independent packages with real scenario implementation on interfaces. He also introduces a smal test case showing how code can be tested in Golang while introducing httptest library.

Occassional mentions of few philosophical decision is also there.

What could have been better?

(There is a fair possibility that I missed Narrator doing it but if I didn’t miss it.)

  • In third section Narrator doesn’t cover for-range usage, though uses it in fourth section and further later. Range brings a very widely implemented practically used power to for control structures.
  • Narrator forgot new behaviors can be added to any local type, not just structures. An example on this would have eased up how behaviors can be added to a local type declared on string (or other).
  • In Section 8, when Narrator starts to use “image” package for Image Upload and other actions… in certain functions (like HandleUpload) identifier of “image” name has been used. When “image” package is already imported, no identifier should have been named so. It doesn’t error out because “image” is not used in that function scope as a package, but it’s still not a good practice and can result into error as function get changed over time in real scenarios.
  • Some of the important philosophies that learners of this course shall look at after completing are, to have better understanding of certain things in Golang
  • Would have preferred if he did demo of “hello world” on play.golang.org and then moved to system installation with editor driven coding. It gives learners a very easy taste of it first and also show how easy is it to tryout Golang. Also play.golang.org can be projected as a starter place to browse through examples for more understanding of good and bad code.
  • One thing could have been improved on showmanship of course, that is showing build result of code in Editor windows’s pane. Almost all good editors today have addons for Golang providing this and lot more. Since Narrator was using “Sublime Text“, he could have used plugin “GoSublime“.

Overall

It’s a lot more hands-on than theory which is great. Though out of 8 sections, first 7 sections are mainly focussed towards beginners in Golang who want have a complete understanding of it and are preapred well for it (they are like covering Effective Go in a video). Still the last 8th section can be utilized by even intermediate level Golang developers who understand the constructs of it but face hard time bringing in good development practices they have been using in other programming languages. I felt some bits missing here and there which I’ve already mentined in “What could have been better?” para above.

There two good things about this course that I want to highlight: * Usage of examples and then building over them for coming part of course showcases how to finely grow a spiked Golang code. * Cleverly covering few good developer practices by hugely improving upon the mess of code written for “First Application (WIMP)”. The coding practice worried me in intial part of the section but when Narrator refactored it, the intention was clear.

Overall, it’s a good course for anyone trying to get started in learning Golang or are in their early stages.

Advertisements

[a.Bionic] Mayan Confusion Comic of 21 Dec 2012 World End

Posted in Uncategorized with tags , , , , on December 23, 2012 by abhishekkr

abionic.blogspot.in [22/Dec/2012]

http://abionic.blogspot.in/2012/12/timeline-from-mayan-calendar.html

Mayan Confusion Comic

…..original blogpost

[techie.bond] FSF Richard Stallman reports Spying Ubuntu; Canonical getting offensive

Posted in AbhishekKr, Uncategorized with tags , , , , , , , , on December 11, 2012 by abhishekkr

techiebond.wordpress.com [10/Dec/2012]

http://techiebond.wordpress.com/2012/12/11/fsf-rsm-reports-spying-ubuntu-offensive/

One of the most (the most for some years) popular Debian-based Linux Distro, Ubuntu has been found to be using a user behavior analyzing feature to serve more user need accurate advertisements.

RSM did compared it to a proprietary malware product doing user surveillance for self-profit. As in selling out there users for money which trusted the software because of it’s promotion by various OpenSource promoters and users (at least me and people I know) tried/use it  under the pretenses of it being on the guidelines of Free Software.

…..

There have been a reply to it by few people, one being from Jon Bacon (some Ubuntu Community Manager) which came to my notice from HackerNews Top List.

He calls RSM being Childish on his stand…..

…..click here to read full post

[tek.walk] Varnish sometimes fails but doesn’t tell

Posted in Uncategorized with tags , , , , , , , , , , , on October 22, 2012 by abhishekkr

tekwalk.blogspot.in [22/Oct/2012]

http://tekwalk.blogspot.in/2012/10/varnish-sometimes-fails-but-dont-tell.html

… round-robin” configuration. It was creating names that way to avoid name collision for same service running on different nodes load-balanced by Varnish-Cache.

We checked for the configuration correctness

varnishd -C -f /my/varnish/config/file

It passed.

We started the Varnish service

/etc/init.d/varnish start

It started.

We tried accessing the services via Varnish.

It failed saying there no http service running at Varnish machine:port.

 
…..
So, the length of backend name there does effect but the VCL gives no error when starting Varnish-Cache.

BTW, from the checks performed… the maximum character backend name working for the configuration was 44 Character long.

…..click here to read full post

[a.Bionic] Dream Automation

Posted in Uncategorized on September 1, 2012 by abhishekkr

abionic.blogspot.in [30/July/2012]

http://abionic.blogspot.in/2012/07/dream-automation.html

Dream Automation from 502 to 200

…..click here for original post

[god4evil] why do you have to do what you have to do

Posted in Uncategorized with tags , , on September 1, 2012 by abhishekkr

god4evil.blogspot.in [24/July/2012]

http://god4evil.blogspot.in/2012/07/why-do-you-have-to-do-what-you-have-to.html

/psych-o-philosophy/

anyone you meet… everyone has a plan…..
for today, tomorrow, the day after, week after, after fortnight, month and some even an year or more… some have freakin’ whole life planned out…
some have an after plan for their next plan and others have an alternate in-case-of failure plan set for the plan before…
what the heck, why… why… why…

first of all and the most basic of all….. how did you concluded what you have to do something that you plan to do…

what you plan gets mainly intercepts what you are, where you are and when you are there

…..

…..click here to read full post

[just.few.tuts] DevOps AND 12FactorApp ~ some obsolete & much valid

Posted in Uncategorized with tags , , , , , , , , , , , , , , , , , on August 21, 2012 by abhishekkr

justfewtuts.blogspot.in [28/July/2012]

http://justfewtuts.blogspot.in/2012/07/devops-and-12factorapp-some-obsolete.html

What?

Actually what 12FactorApp is… it is a good set of ideas around basic set of concerns. The concerns are right, the solutions suggested are situational and the situation is the default/basic setup. With the teams following good DevOps-y practices, they don’t turn out to be exactly same.

…..

What @12FactorApp doesn’t suit at all for DevOps-y Solutions

  1. ~
  2. Dependencies
    [+] Obsolete: ‘If the app needs to shell out to a system tool, that tool should be vendored into the app.’
    Changed-to: Make your automation configuration management system handle it.

…..

Cumulative Correct Concerns 3C@12FactorApp and DevOps-y Solutions

Overall aiming to achieve a easy-to-setup, clean-to-configure, quick-to-scaleand smooth-to-update software development ambiance.
The 12 Concerns+Solutions:

  1. Problem: Maintaining Application Source Code
    Solution:
    a.
     Using Version Control Mechanism, if possible Distributed VCS like git. Private hosted (at least private account) code repository.
    b. Unique application

…..

…..click here to read full post