Skip to main content

Posts

5 common myths about batteries

First, the list:

1.Keeping laptop/phone on charge overnight reduces battery life 2.Batteries should be drained to 0 and recharged to full 3.Batteries can swell or even explode due to overcharging 4.My power bank, equal to battery in terms of capacity should fully charge my phone 5.X type is better than Y type Yes, these are all myths and we’ll bust them one by one. But first, keep a few terms in mind. We’ll be using them frequently in this article: Battery life: the time from first use to last run before recycling/discardingRuntime: the running time of battery in a single complete charge before dischargingCycles: number of times the battery can be recharged from fully drained to maximumOvercharge: providing more voltage than required to charge the batteryStandby time: the capacity of battery to hold charge in storage or when not in use
Keeping laptop/phone on charge overnight reduces battery lifeThere’s some merit in this one, because about 2 decades ago, the chargers…
Recent posts

Story of a code review

To whom it may concern

کل جو بیٹھے Junior کا Code Review کرنے ہم۔ قہر بن کر ہم پہ ٹوٹی وہ بلائے شامِ غم۔
کھول کر دیکھا جو I.D.E پہ اس عفریت کو۔ یعنی بے ہنگم سی Lines of code کے سنگیت کو۔
بھک سے سارا اُڑ گیا Experience مثلِ غبار۔ سر سے Leadership کا زائل ہوگیا سارا خمار۔
Spaghetti Code ہے، بریانی ہے، یا Soup ہے؟ ہم کہیں کھچڑی جسے۔۔۔ اُس کے مطابق OOP ہے۔
View اور Model میں کوئی ربط تک دکھتا نہیں۔ ایسے Java Bean مسٹر بین بھی لکھتا نہیں۔
گاہے گاہے گر Design change ہی مقصود تھا۔ نام Project کا عزیزم کیوں نہ پھر گرگٹ رکھا؟
Task میں لکھا کہیں بھی فائلیں بھرنا نہ تھا۔ کیوں لکھے بے کار Method کال جب کرنا نہ تھا؟
ایک گھنٹہ پی گیا Function جو اک بہروپ تھا۔ ہم Recurrence سمجھے بیٹھے۔ Nested وہ Loop تھا۔
ہر جگہ پر ٹھونسنا Maven کی Nature کفر ہے۔ شرع پروگرامنگ میں ایسا Architecture کفر ہے۔
اک منٹ! یہ کیا کہا میں نے۔۔۔ کہاں ہے کفر ادھر؟ کفر ہی ہوتا مگر ہے Architecture ہی کدھر؟
Role جس کا Guest تھا Access دیا سارا اُسے۔ تھا جسے Encrypt کرنا، Hash کر مارا اُسے۔
جانے کیسے سانس لے گا Live Server زیر بار۔ ایک Package، دو Classe…

Titanic: A case study for predictive analysis on R (Final)

Our previous attempt to accurately predict whether a passenger is likely to survive, a competition from Kaggle.com. We used some statistics and machine learning models to classify the passengers.

In our final part, we will push our limits using advanced machine learning models, including Random Forests, Neural Networks, Support Vector Machines and other algorithms, and see how long we can torture our data before it confesses.

Let's resume from where we left. We are applying an implementation of Random forest method of classification. Shortly, this model grows many decision trees and then uses a voting system to decide which trees to pick. This way, the common issue with decision trees, over fitting is mitigated (learn more here).

> library(randomForest)
> formula <- as.factor(Survived) ~ Sex + Pclass + FareGroup + SibSp + Parch + Embarked + HasCabin + AgePredicted + AgeGroup 
> set.seed(seed)
> rf_fit <- randomForest(formula, data=dataset[dataset$Dataset == 'train&…

Do's and don'ts for Team Leaders - 1

7 do's for Team Leaders
Say you've just got promoted to a team lead position and have no clue, or received no training from your prior leader in this regard. Well, here's a little something for you. This is, by no means a thorough guide, but rather a kick starter. These 7 points below are an extract of what I've experienced as a Team leader of smart and versatile software engineers.

1. Be friendly and supportive:
Simplest and most general rule that fits everywhere. Hard to achieve though.
Friendliness requires openness and transparency. Try to make work fun without compromising on your company's mandate.

Dine with your team, talk about stuff other than work. Share jokes and inspirational quotes/videos. Make your presence comfortable. A good leader knows his players' interests, current goals, future plans, daily activities, pet names, favorite pizza toppings... you get the point.

Being supportive means you should always be available, set examples by doing and be the e…

Playing in Amazon's Clouds - Introduction to Elastic Computing Cloud - Part 2

Connecting to Cloud
Previously, we looked at how to configure an EC2 instance on AWS. If you're not sure what this sentence was about, click here.

In this post, we'll look at some ways to connect to your EC2 instance and try out an example. I'm assuming you already know how to get to the EC2 console page from AWS home.



ٖFrom here, you should go to the Running Instances link to check your instances. You should see something like this:



Right now, we only have one instance of t2.micro configuration, running on public IP address defined under Public IP. We will first create an alarm to make sure we do not hit our cap when experimenting.

Click the Alarm icon under Alarm Status. You should see a pop up to configure an alarm. We are interested in making sure that the CPU usage is under certain limits. Let's create an alarm.

We want to generate an email alert whenever our instance is consuming over 90% of processing power for 1 hour or more.



We just created a new warning notification…