Archive for October, 2015

With iOS9 jailbreak out, there are many tweaks which are not compatible with this version of iOS and if you are one of those who still dared to install the tweaks, chances are you screwed up, the phone is not restarting in safe mode, cydia is crashing and you are out of options.

So, here’s simplest way to do this.

Method 1:

Step 1. Download iFunBox.

Step 2. Open your phone under the “File Browser” tab.

Step 3. Now under your device in the side bar, navigate “Raw File System” to /Library/MobileSubstrate/DynamicLibraries/ and delete the corresponding .plist and .dylib files.

Step 4. Restart your Phone.

Step 5. Profit.

But Oh wait, did your iFunBox said that your iphone is jailed?

Here’s the solution:

Method 2:

1. Reboot (unless your phone already is) by holding down the top button until the “Slide to power off” message appears.

2. Slide to power off.

3. Power on by holding down the top button again.

4. As soon as the Apple icon appears, hold down the volume up button. Hold until phone has fully rebooted.

5a. At this point you will be in safe mode and you can go to Cydia and remove the offending package. Note: All Cydia packages should be inactive at this point, though we’ve seen a few that continue to load anyway. Now here you can uninstall the tweak that’s messing with your phone. Also install these two packages “afc2add” and “Apple File Conduit 2”. This will make your phone jailbroken for iFuxBox. Now that you have iFunBox which is not jailed. Follow the first method and uninstall the tweak (incase the tweak was not listed in cydia using method 2).

5b. You can also install iFIle on your iphone and follow the same steps as of 5a. No need for pc/ iFunxbox then.

6. The next time you reboot without holding down the volume up button, you will be out of safe mode and your Cydia packages will load.

The Micromax Canvas Lapbook L1161 has the best of all the worlds: a sleek and lightweight design with a heavy-duty 11 hour battery backup and pre-installed Windows 10. The Intel Quad Core Processor (up to 1.83GHz) along with the Dual Speakers and 29.46cm (11.6) HD IPS display makes for a delightful everyday computing experience.

Available for: Rs. 13999/-

Premium Look

The aesthetically crafted Canvas Lapbook comes with a metallic finish, streamlined edges and sleek body, giving it an ultra-premium look and feel.

Ultra-Thin & Lightweight design

With its portable design, the Lapbook is wired to tackle whatever you bring its way, minus the hassle of cables.
Thickness: ~19mm

Weight: 1.3 Kg

Pre-Installed Intelligent Windows 10

The Canvas Lapbook comes with pre-installed genuine Windows 10 which has an improved UI experience. Now, get fast start-ups, web browsing and app switching plus smooth multi-tasking. It also conserves power automatically, so that you can work longer and play harder.

Full-Day Battery Backup

The Canvas Lapbook’s marathon backup enables 11 Hours* of non-stop usage, allowing you to carry it anywhere and be your productive best without running out of power wherever you go.

Seamless Connectivity

The in-built Wi-Fi and Bluetooth 4.0 ensure hassle-free access to the internet and convenient data sharing. Connecting with your favourite peripherals and other devices will be easy with 2 USB 2.0 Slots and HDMI port, enabling a great multimedia experience.

Speakers Power Play

The Canvas Lapbook’s powerful Dual Speakers, pumped up with Realtek ALC5645 Audio Codec, enable a great entertainment experience. Now, watch movies, videos and listen to music like never before!

Powerful Performance

The Lapbook is powered by the Intel Quad Core Processor (up to 1.83GHz) & 2GB DDR3 RAM for seamless multi-tasking, smoother productivity and a faster experience. Now, switch between many tasks without the fear of your computer crashing.

Stellar Camera

The Lapbook has a 640×480 front camera, which means you can now participate in video conferences for work and enjoy video chatting by connecting with loved ones.

Immersive High-Res Display

The Canvas Lapbook’s 29.46cm (11.6) HD IPS Display and whopping 1366×768 resolution let you sit back and enjoy crisp, sharp display while watching movies & videos, without straining your eyes. The images, too, are sharper and clearer on the Lapbook.

Massive Storage

With a 32GB inbuilt memory, you can easily store and enjoy movies, videos, presentations and other official data with ease. For extra storage flexibility, you can use the expandable storage of up to 64GB via the card slot.

Post-Sales Support

The Micromax service does not just end at the product purchase. For any assistance on the Canvas Lapbook after purchase, you can reach us any time of the day, all seven days of the week.

1 year product warranty, and free pick-up and drop to home in 120 cities across India.

Brand/Model Micromax Canvas Lapbook L1161 Asus X205TA Eeebook- FD027BS Nexian Chromebook HP Stream 11- do23TU
OS Windows 10 Windows 8.1 Chrome Operating System Windows 8.1
Processor Intel Quad Core (Intel Atom 4th Gen) Intel Quad Core (Intel Atom 4th Gen) Cortex – A17 Processor Quad Core Celeron Dual Core N2840
Flash Storage Drive YES 32GB eMMC YES 32GB eMMC 16GB eMMC YES 32GB eMMC
Battery Life 11 Hrs* ~11 Hrs* 9 Hrs* 10 Hrs*
Weight 1.3 Kg < 1 Kg 1.5 Kg 1.27 Kg
Thickness ~19mm 18mm 21 mm 19.7 mm
Screen Resolution 1366×768 1366×768 1366×768 1366×768
Ports 3(2 USB, 1 HDMI) 3(2 USB, 1 HDMI) 3(2 USB, 1 HDMI) 3(2 USB, 1 HDMI)
Price 13,999(MOP) 15,399 12,499 18,975

Article Image

The first version of this article was written over four years ago, so as we approach the end of 2015 I thought it would be useful to revisit this topic.

1. Developer Tools

Firstly, IE8, IE9, IE10 and IE11 all have developer tools that you can access by pressing F12 whilst in Internet Explorer. These allow you to change your document and browser mode to go back to older rendering engines, which you can find on the emulation tab in the tools. If you are using Microsoft Edge, you will notice that it doesn’t have different browser modes that you can use, as this feature is only available in IE9, IE10 and IE11. It should be noted that these tools are not the same as the rendering engines used in the original browsers, so whilst they are useful if you are trying to reproduce a reported bug, they should not be used to confirm that your site is working correctly or looking pixel perfect in an older browser. To learn more about the developer tools, head over to MSDN.

2. Virtual Machines

For the most accurate results you will want to use Virtual Machines so that you can run the browsers in a real-world environment. This is by far and away the most popular way to do browser testing in my experience. The good folk at Modern.ie have produced VMs for all browsers and operating system combinations (IE6-IE11 and Edge on Windows 10). These VMs run on Windows, Linux and Mac and in numerous virtualisation flavours including Parallels, VMWare, HyperV and VirtualBox. You can download the virtual machines from modern.ie.

3. Hosted Virtual Machines

BrowserStack is a paid service that allows you to test IE6-11 and Edge (and every other major browser like Chrome, Opera, Safari, Firefox as well as iOS and Android emulators) inside your browser. There are also browser plugins available for Chrome and Firefox which make launching BrowserStack even easier.

With BrowserStack you can simply start up a new virtual machine in the cloud, running practically any OS, and then test your website in that environment.

4. Modern.ie Scanner

The Modern.ie scanner uses a node.js service (which is available on GitHub) to go fetch a website and interrogate it to locate common problems. It then provides a report which details what you may need to do to fix you website so that it works well in IE and also other standards-based browsers.

Article Image

Software development is a tricky business. We spend most of our day breaking down complex problems into smaller tasks and then we write machine code. We often have to analyse code that someone else has written. We need to read so much documentation in order to get acquainted with a new API. Every day is an uphill battle against a new framework, language or library. In the end, we write our own code, solve the problem and move on to the next task.

Writing clean, concise code is a lot harder than it sounds. It requires experience and a good understanding of how code hangs together. The larger the system, the bigger the challenge. As a developer, there is nothing worse than having to support and troubleshoot badly written code. Sometimes, it’s us that write that code. I can attest that I have produced some code ‘gems’, and I’m sure I’ve written some awful code that’s still running on a server in a basement somewhere. I’ve worked hard, learnt from my mistakes and I hope that I’ve come a long way since those darker days. I also understand that I have a long road ahead of me, and I strive to learn and improve my coding skills every day.

Over the years I’ve picked up some good practices, tools and standards to help me become a “Clean Coder”. By the way, the principles of clean code have been thoroughly covered by Robert C Martin (also known as Uncle Bob) in his two homonymous and highly recommended books:

In this post I’ll try to touch upon some of the basic Clean Code principles and show you how to write clean, readable and easily maintainable code. Your future self, your colleagues and successors will be certainly grateful for it!

Naming things

Lots of things have been written on the subject of naming in programming, but there’s nothing that captures this better than this quote by Phil Carlton:

“There are only two hard things in Computer Science: cache invalidation and naming things.”

Working with badly named code can seriously affect your productivity and your ability to fix bugs or add features. All code should be self-describing with meaningful and easy to understand naming. There’s a big difference between:

var x = 3; and
var maximumLoginAttempts = 3;

The larger the scope, the more important to get the name right. Don’t concatenate your variable and function names, you’re not going to run out of bytes! But self-describing code is just about understanding the intent. It’s also about refactoring and improving your code flow. Imagine if you did a standard “Search & Replace” for all references of variable “x” or even worse “a” or “b“. A world of fun awaits as you undo your changes and revert to manually changing all instances of that variable.

Naming consistency

Camel-case, Pascal-case, any case. If you chose a method, you’ll have to stick with it. Having consistency across you code makes things predictable and easier to understand. When you work alone, this can be easy to enforce. However, this is a much bigger challenge in the context of a bigger team. Fortunately, there are tools that can help enforce consistency. I use different tools such as StyleCop, JSHint, JSLint, JSCS (all open-source and free) and they work great. Make sure that the whole team arrives at a consensus on which rules work, or you’ll just end up back where you started. StyleCop for example tends to be overly eager (aggressive) in the way that your code should look, and some of the rules don’t make sense. Feel free to run through many trial-and-errors until you’ve refined the config enough to meet your needs. Again, it’s important to discuss this with the rest of the team. Other IDEs will have similar tools but if there’s none that can support your technology stack, just write them down somewhere and try to enforce them during code reviews or pull request (PR) acceptances.

Code comments

Code comments tend to be a sensitive subject and I’ve seen people defending both sides. I’m with Uncle Bob on this one. Unless your comments are treated as active code (with reviews, PRs etc) then they should be avoided. Code comments add noise to your code, distract you from your task and, in most cases, tend to be unrelated and out-of-date. Describing what the code does is the responsibility of the code itself. As the code evolves, the comments go stale and developers rarely go back to fix inconsistencies. Apology comments of the style: “//TODO: hacky workaround, will fix later – CM”, are all too common and they sound more like an apology than a valid comment. If someone took time to write the comment, they could have taken a bit longer to come up with a proper fix. Finally, there are always exceptions to every rule and for me comments are useful when used to document public APIs. If you’re interested in reading more about code comments, have a read here.

Readability

Your code should read like a well-written story. The code should have a natural flow (a bit like Behaviour-Driven Developer) where each method describes an operation that has an entry and exit point. Each method should add to the overall story and written in such a way that it would make sense even to non-programmers. Some people believe that methods that describe a “story” should be clustered together, but this may come in conflict with some tools (Resharper, StyleCop) or design patterns (the scissors rule). You just need to decide what works better for you, but in my experience when working through code to trace an issue, it’s much easier when I have everything closely together rather than having to jump in random places in the code to follow the workflow.

S.O.L.I.D. is your friend

I won’t try to explain or redefine what S.O.L.I.D. is, as you can read about it here. The important thing is that by applying the S.O.L.I.D. principles, you’re also working towards Clean Code nirvana. Building upon the rules and best practices described by S.O.L.I.D., your code and the overall system become easy to maintain and extend over time. The guidelines will help you reduce or eliminate code smells and make code refactoring easier.

Size matters

Following S.O.L.I.D., the next item on the agenda is size. Class size and method size both matter. Would you prefer a 3000-line class over a 250, and respectively a 150-line method over a 15-line one? Uncle Bob has this to say when it comes to method lengths:

“The first rule of functions is that they should be small. The second rule of functions is that they should be smaller than that. Functions should not be 100 lines long. Functions should hardly ever be 20 lines long.”

Some may claim that this promotes fragmentation and can lead to large projects with lots of files, but this is usually an issue for younger, inexperienced developers. With experience, the fear of oversized, overcomplicated projects is replaced by the understanding of how one can leverage the S.O.L.I.D. architecture to create both a testable and maintainable solution.

Writing “clever” code

There’s usually more than one way to solve a problem. The same idea is valid for writing a routine, method or function. Some people enjoy making their lives and the lives of those working with them difficult by writing “clever” code. Yes, it works, and yes, they’ve managed to compress 10 lines of code into 2 by using short variable names and nested Lamda expressions inside an anonymous function. Unfortunately, this will not be as testable as you may think. Whenever I’m presented with a similar dilemma, simple always wins, hands down. I believe that Brian Kernigham’s words capture this better than me:

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” Keep your code simple and easy to read and maintain.

Test-driven Development (TDD) or testing in general

TDD and testing are not directly related to clean code. Even the act of making your code testable will force you to think about the design and patterns to follow. TDD, on its own, is a subject that the development community can be particularly passionate about. However, the overall moral of the story is this: no software can be considered resilient, adaptable and manageable if there are no tests to cover it. It doesn’t really matter if you practice TDD religiously or if you write your tests (unit and integration) after the fact. Testing is an invaluable discipline and will ensure that the code functions in a predictable way and generates the expected output. There have been lots of books, posts and articles written about the importance of testing so I hope that your code has the right test coverage.

Summary

Some of the things I’ve written about are common sense and readily available knowledge. Some of you may have learned the hard way, and some may have escaped you until now. It’s never too late to start writing clean code and it should be your goal to improve every single day. If you find yourself writing the same code you did a year ago, or even 6 months ago, then you should definitely consider changing your priorities and look at how you can improve. There are many resources available to help you improve and the community is there to support you, so join me in this quest to rid the world of technical debt and write beautiful, functional code.

Resources

Have you ever had a reference book that you HAD to keep near you? This list of must-have books are required reading and should always be within your reach.

Top 10 Books Every .NET Developer Should Own

Everyone at one time or another reached for that specific book to find out how that one design pattern works or just needed it as a refresher on how to do that one routine better.

When you grow in your career, you start to notice that tutorial books don’t line your bookshelf anymore. Nor do you own “how to code in ASP.NET in 5 minutes.” Coding becomes easier. As I’ve said before, a language is a language is a language.

These books are a testament to the authors experience. It just goes to show you that these books I list below are exceptional in every way and have stood the test of time in the lines of development and design.

My post about What Books are Within Your Reach? was dated in 2010 and you know what?

To this day, a majority of those books are still within my reach and quite valuable. They never accumulate dust.

Now I know what some people are saying. You have the Internet at your fingertips, why not use that? While the Internet is a great resource, there is something to be said for a solid book that I KNOW has the answers (and sometimes more) within arms reach. I’m not saying all material on the Internet is bad, but it does take time to research that topic. When I’ve gone through these books and trust the material, I would feel more comfortable reaching for one of these following books/authors.

My preference of book publishers are Wesley-Addison Signature Series, APress, and O’Reilly. In That Order.

On with the list!

  1. Patterns of Enterprise Application Architecture By Martin Fowler

    It’s true that this book is a little pricey, but Mr. Fowler has put his experience and knowledge into enterprise application development and this book is an exceptional mark of that programming experience.

    On the inside cover of the book, they provide you with a list of programming thoughts and then provide you with a pattern to apply to that thought. It’s kind of like trying to remember the name of that song and all you have is a lyric.

    A quarter of the book gives an intro on layering, organizing domain logic, sessions, concurrency, and mapping to databases. During each of these sections they discuss a topic and use a number to refer to the pattern used in the book. These pattern numbers are in the remaining 3/4 of the book and I’ve used this strictly as reference when needed.

    Most of the Wesley-Addison Signature series books have this format which I absolutely love. This is what sets Wesley-Addison Signature Series apart from the other publishers. The book provides you with an intro, a description of a pattern, and a reference number to the pattern in the book. When finished reading it, you have the black tabs on the book to use when you have a particular pattern in question.

    A number of patterns are listed in the inside front cover. Most of the patterns are used today in the corporate world. On the back inside cover is a cheat sheet that helps with picking the right pattern for your particular approach.

  2. Refactoring: Improving the Design of Existing Code By Martin Fowler, Kent Beck, John Brant, Williams Opdyke, and Don Roberts

    The functionality of ReSharper is based on this book. For those not knowing about ReSharper, it’s a Visual Studio extension that gives developers a significant boost in productivity by assisting with refactoring their code with confidence.

    Just like Patterns of Enterprise Application Architecture, this book goes over the basics of taking your code from spaghetti to lasagna (wait…is that better?). The first part of the book discusses “bad code smells”, how to identify bad code, and ways to fix it. Such refactorings include Long Methods, Large Class, Long Parameter List, Duplicated Code, and Switch statements to name a few.

    The code examples in the book are either Java or .NET or both and are extremely clear to understand each refactoring concept.

  3. Refactoring to Patterns By Joshua Kerievsky

    After you read the two books above, make sure you add this one to the list as well. If you thought both books were extremely valuable, then I highly recommend this book because it combines enterprise patterns with refactoring.

    For example, let’s say you have a huge if..then..else from hell. One refactoring called Replace Conditional Logic with Strategy Pattern takes the if..then..else and makes classes out of them while creating an abstract pattern to handle the heavy lifting.

    This is just one of the many great refactorings in this book.

  4. The Design of Sites: Patterns for Creating Winning Web Sites (2nd Edition) by Douglas K. van Duyne, James A. Landay, and Jason I. Hong

    You may be wondering why I’m recommending this “design” book to developers. I’ve always been of the mindset that designers are developers and vice-versa. You always need a good understanding of CSS and JavaScript/jQuery/Angular to build websites along with knowing what happens on the backend when someone clicks Submit.

    This book provides a catalog of “design patterns” for building websites. If you are looking for an ecommerce site, here are the components you need to make it successful to your audience.

    It’s basically a catalog of website standards that I use as a basic checklist for building sites from scratch and I also use it as a reference for evaluating the design of existing websites.

  5. Microsoft .NET – Architecting Applications for the Enterprise (2nd Edition) (Developer Reference) BY Dino Esposito and Andrea Saltarello

    I know I’ve discussed enterprise patterns with the Patterns of Enterprise Application Architecture book above, but this is geared more towards a .NET readership.

    The book is broken down into the following categories: Design Patterns and what is a design pattern; The Business Layer; The Service Layer; The Data Access Layer; and the Presentation Layer.

    If you’ve been coding with .NET in a corporate environment for a while, this may be the only book in the list that I suggest you pass on and purchase any one of the other books.

  6. Don’t Make Me Think, Revisited: A Common Sense Approach to Web Usability (3rd Edition) (Voices That Matter) By Steve Krug

    This is another design book that every developer should read. It includes a number of different ways of look at things when it comes to usability. When I was reading this book, each chapter gave me a different perspective of how to design a web page to get the most efficient use for my audience.

    Also, the book is doing extremely well because they are on the 3rd edition.

  7. Information Dashboard Design: The Effective Visual Communication of Data By Stephen Few

    If you’ve ever built dashboards in your experience, you’ll find this book very helpful. I’ve used it to develop 3 dashboards in my career and they seem to be getting easier and easier. 😉

    If you would like a better review of this book, check the post titled Book Review: Information Dashboard Design.

  8. Design Patterns in C# By Steven John Metsker

    Just as the Design Patterns book from the gang of four was a masterpiece, this book focuses on design patterns from the viewpoint of C# developers. It covers the original 23 patterns including Singleton, Strategy, Flyweight, Factory, and others.

    This is one of those fundamental books that should be used in colleges.

  9. Any O’Reilly Pocket References

    The O’Reilly Pocket References books provide a lot of critical information in one small package. I currently have and use the following pocket reference books: jQuery, JavaScript, SQL Pocket Guide, and Regular Expression.

    The funny thing about these pocket references is that I’ve had web professionals come over and borrow them for a couple of days when the Internet was at their fingertips.

    That tells me how much these pocket references are worth.

  10. The Clean Coder: A Code of Conduct for Professional Programmers (Robert C. Martin Series)By Robert C. Martin

    Everyone knows “Uncle Bob.” His coding experience is also apparent in this book. He covers Saying Yes, Saying No, TDD, Professionalism, Tooling, Craftsmanship, Mentoring, and Pressure just to mention a couple of chapters.

    It’s more of a combination of programming philosophies, how to handle your programming career, and how to write code properly.