GCC Hacks
A small list of GCC Hacks g++ -o helloworld helloworld.cc produces helloworld binary from helloworld.cc C++ file. use -Wall switch turns on all warnings(potential errors) in the code (like unused...
View ArticleProgramming in Linux for newbies
This is meant to be a small guide (though not exhaustive) for students beginning to program on Linux system. Particularly for those, who have done extensive C/C++ programming in Windows, using the...
View ArticleBasic GDB Tutorial
So, you believe there are bugs in your C/C++ code or you have encountered SEGFAULT while executing your code. What will you do? write a lot of printf statements at various places in your code under...
View ArticleAnalysis of Facebook Rotating Images worm
If you are looking for how to avoid/recover : read this one instead. In past few weeks, a lot of facebook users have received following (or similar) messages posted by their friends Hi Friends see...
View ArticleFOSS (Free and Open Source Code) Licensing FAQ
There are two choices while writing on this topic, to write a detailed (and accurate) or to write a concise (but avoid all details) post, I preferred latter and have added appropriate links to dig...
View ArticleFile size should always be of “long” type
int getTextFileSize(String fileName) { return (int) (new File(BASE_DIR, fileName).length(); // WRONG } A 32-bit signed int can deal with ~2GB worth of data. And if your code is not going to deal with...
View ArticleTabs vs spaces for code indentation
One argument which some people might give in favor of using tabs is that it allows the viewer to decide how the code should appear to them. And hence, it separates the logic (indentation) from its...
View ArticleFloating point in user-facing strings
Incorrect floating representation of 507.45 %f in user-facing strings is dangerous. Depending on the architecture, programming language involved, version of that language and compiler optimization...
View ArticleGoogle I/O 2017: Android Notes
Infrastructure – Architecture & Performance Android Vitals – More visibility in Google Play dev console on battery drain, wakelocks being held for too long, ANRs, crashes, dropped frames, and...
View ArticleJava Musings – initializing a final variable with an uninitialized final...
Java has fewer quirks compared to C++, but sometimes I do come across surprises. A code like following will fail to compile since you are trying to initialize a variable with an uninitialized...
View ArticleHow to speed up HTML5 videos
Some video streaming websites like YouTube provides an option for speeding up/slowing down videos; some don’t. The trick is simple, find out the Video object viadocument.querySelector("video")and then...
View ArticleTesting resumable uploads
The core idea behind resumable upload is straightforward if you are uploading a big file, then you are going to encounter users in the network conditions where they cannot upload the file in a single...
View ArticleAndroid: Handling JPEG images with Exif orientation flags
A JPEG file can have Exif metadata which can provide the rotation/translation field information for a raw JPEG image. So, a landscape raw JPEG image could actually be a portrait because it’s EXIF...
View ArticleAndroid: Fragment related pitfalls and how to avoid them
Don’t use platform fragments (android.app.Fragment), they have been deprecated and can trigger version-specific bugs. Use the support library fragments (android.support.v4.app.Fragment) instead. A...
View ArticleStanford CS251: Cryptocurrencies, blockchains, and smart contracts
Lectures Introduction Creating a Digital currency Bitcoin Overview Bitcoin Blockchain Bitcoin Mining Bitcoin Miner interactions and Game Theory Cryptocurrencies: Community, Economics, and Politics...
View ArticleKeep your dotfiles bug-free with Continuous Integration
Just like many software engineers, I maintain my config files for GNU/Linux and Mac OS in a git repository. Given that, I wrote a fair bit of them in interpreted code, notably, Bash, it is a bit hard...
View ArticleThe first two statements of your BASH script should be…
#!/usr/bin/env bash set -euo pipefailThe first statement is a Mac, GNU/Linux, and BSD portable way of finding the location of the bash interpreter. The second statement combines “set -e” which ensures...
View ArticleConsoles by Google
A single developer has to sometimes deal with 7 different consoles by the same company… Google Analytics console – to see website analytics Google Cloud console – to access Google Cloud Platform Google...
View ArticleDocker 101: A basic web-server displaying hello world
A basic webserver Docker containers are small OS images in themselves which one can deploy and run without worrying about dependencies or interoperability. All the dependencies are packed in the same...
View ArticleHow to deploy side projects as web services for free
In 2020, the web is still the most accessible permission-less platform. For the past few months, I have been playing and building side-projects to simplify my life. I started with a Calendar Bot for...
View Article
More Pages to Explore .....