Skip to main content

Posts

Showing posts from 2017

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/discarding Runtime: the running time of battery in a single complete charge before discharging Cycles: number of times the battery can be recharged from fully drained to maximum Overcharge: providing more voltage than required to charge the battery Standby time: the capacity of battery to hold charge in storage or when not in use Keeping laptop/phone on charge overnight reduces battery life T

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 دیا سارا اُسے۔ تھا جسے Enc