background preloader

Programming

Facebook Twitter

Effectively managing memory at Gmail scale. Introduction While JavaScript employs garbage collection for automatic memory management, it is not a substitute for effective memory management in applications. JavaScript applications suffer from the same memory related problems that native applications do, such as memory leaks and bloat, yet they must also deal with garbage collection pauses. Large-scale applications like Gmail encounter the same problems facing your smaller applications. Read on to learn how the Gmail team used Chrome DevTools to identify, isolate, and fix their memory problems. Google I/O 2013 Session We presented this material at Google I/O 2013. Gmail, we have a problem... The Gmail team was facing a serious problem. Memory Management Basics Before you can effectively manage memory in JavaScript you must understand the fundamentals.

Primitive Types JavaScript has three primitive types: Number (e.g. 4, 3.14159) Boolean (true or false) String (“Hello World”) These primitive types cannot reference any other values. Email. Big-O Algorithm Complexity Cheat Sheet. 50 Coolest Gifts for Guys Under $25 | Dodo Burd. You don’t have to spend a lot to get a cool gift for your guy friends and family members. In fact, some of the coolest gifts you can get him are under $25. No matter what his likes and interests are, you can find the perfect gift for any occasion without breaking the bank. Whiskey Stones A set of whiskey stones makes an elegant gift for any guy who enjoys the occasional nightcap.

Nine grey whiskey stones are made from natural soapstone, making them as elegant as they are functional. LifeStraw Personal Water Purifier When camping, hiking, kayaking canoeing, and embarking on all manner of outdoor sports, having access to clean water is a constant concern. Stanley Classic Flask Whether he’s on a camping trip or enjoying a celebration, he can sneak a drink with the rugged Stanley Classic Flask. Black Playing Cards Pick Punch You can never have too many guitar picks, and with the pick punch, you’ll never have to worry about running out.

Scratch Map Itching to take a vacation? Grime Writer Geek Soap. How to Hunt Elephants. MATHEMATICIANS hunt elephants by going to Africa, throwing out everything that is not an elephant, and catching one of whatever is left. EXPERIENCED MATHEMATICIANS will attempt to prove the existence of at least one unique elephant before proceeding to step 1 as a subordinate exercise. PROFESSORS OF MATHEMATICS will prove the existence of at least one unique elephant and then leave the detection and capture of an actual elephant as an exercise for their graduate students. COMPUTER SCIENTISTS hunt elephants by exercising Algorithm A: Go to Africa. Start at the Cape of Good hope. Work northward in an orderly manner, traversing the continent alternately east and west. During each traverse pass, Catch each animal seen. EXPERIENCED COMPUTER PROGRAMMERS modify Algorithm A by placing a known elephant in Cairo to ensure that the algorithm will terminate. ASSEMBLY LANGUAGE PROGRAMMERS prefer to execute Algorithm A on their hands and knees.

Return to Jim Huggins' Humor Page. The Evolution of a Programmer. High School/Jr.High First year in College program Hello(input, output) begin writeln('Hello World') end. Senior year in College (defun hello (print (cons 'Hello (list 'World)))) New professional #include <stdio.h> void main(void) { char *message[] = {"Hello ", "World"}; int i; for(i = 0; i < 2; ++i) printf("%s", message[i]); printf("\n"); } Seasoned professional Master Programmer Apprentice Hacker Experienced Hacker Seasoned Hacker % cc -o a.out ~/src/misc/hw/hw.c % a.out Guru Hacker New Manager Middle Manager mail -s "Hello, world.

" bob@b12 Bob, could you please write me a program that prints "Hello, world. "? Senior Manager % zmail jim I need a "Hello, world. " program by this afternoon. Chief Executive % letter letter: Command not found. % mail To: ^X ^F ^C % help mail help: Command not found. % damn! Anonymous If you enjoyed this, you might like: Humor - How to Shoot Yourself In the Foot Using Any Programming Language. The proliferation of modern programming languages (all of which seem to have stolen countless features from one another) sometimes makes it difficult to remember what language you're currently using. This guide is offered as a public service to help programmers who find themselves in such dilemmas. 370 JCL You send your foot down to MIS with a 4000-page document explaining how you want it to be shot. Three years later, your foot comes back deep-fried.

Ada After correctly packaging your foot, you attempt to concurrently load the gun, pull the trigger, scream, and shoot yourself in the foot. When you try, however, you discover that your foot is of the wrong type. APL You shoot yourself in the foot, then spend all day figuring out how to do it in fewer characters. ASP.NET Find a gun, it falls apart. Assembly You try to shoot yourself in the foot only to discover you must first reinvent the gun, the bullet, and your foot. BASIC Shoot yourself in the foot with a water pistol. What every computer science major should know. Portfolio versus resume Having emerged from engineering and mathematics, computer science programs take a resume-based approach to hiring off their graduates. A resume says nothing of a programmer's ability.

Every computer science major should build a portfolio. A portfolio could be as simple as a personal blog, with a post for each project or accomplishment. A better portfolio would include per-project pages, and publicly browsable code (hosted perhaps on github or Google code). Contributions to open source should be linked and documented. A code portfolio allows employers to directly judge ability. GPAs and resumes do not. Professors should design course projects to impress on portfolios, and students, at the conclusion of each course, should take time to update them.

Examples Technical communication Lone wolves in computer science are an endangered species. Modern computer scientists must practice persuasively and clearly communicating their ideas to non-programmers. Specific recommendations Java. Signs that you're a bad programmer - Software Engineering Tips. Why was this written?

Most of these faults were discovered the hard way by the author himself, either because he committed them himself or saw them in the work of others. This paper is not meant for grading programmers, it was intended to be read by programmers who trust their ability to judge when something is a sign of bad practice, and when it's a consequence of special circumstances. This paper was written to force its author to think, and published because he thinks you lot would probably get a kick out of it, too. 1. Inability to reason about code Reasoning about code means being able to follow the execution path ("running the program in your head") while knowing what the goal of the code is. Symptoms Remedies To get over this deficiency a programmer can practice by using the IDE's own debugger as an aide, if it has the ability to step through the code one line at a time. 2. Object Oriented Programming is an example of a language model, as is Functional or Declarative programming. 3. 4.

Hack This Site!

Resources

Blogs.