background preloader

Programming

Facebook Twitter

Low Level Bit Hacks You Absolutely Must Know. I decided to write an article about a thing that is second nature to embedded systems programmers - low level bit hacks. Bit hacks are ingenious little programming tricks that manipulate integers in a smart and efficient manner. Instead of performing some operation (such as counting the 1 bits in an integer) by looping over individual bits, these programming nuggets do the same with one or two carefully chosen bitwise operations. To get things going I'll assume that you know what the two's complement binary representation of an integer is and also that you know all the the bitwise operations.

I'll use the following notation for bitwise operations in the article: & - bitwise and | - bitwise or ^ - bitwise xor ~ - bitwise not << - bitwise shift left >> - bitwise shift right The numbers in the article are 8 bit signed integers (though the operations work on arbitrary length signed integers) that are represented as two's complement and they are usually named 'x'. The result is usually 'y'. 1. 50 Places You Can Learn to Code (for Free) Online. If you’re curious about learning a programming language then you’re in luck: there’s no shortage of resources for learning how to code online. University-level courses, tutorials, cheat sheets, and coding communities all offer excellent ways to pick up a new language, and maybe even a new job, too. Read on, and you’ll discover 50 great places to learn how to code, for free, online. University Many big names in education including MIT and Stanford offer programming courses, absolutely free.

General If you’re just dipping your toes into programming, or you want to find a variety of resources, these sites offer several different ways to learn how to code. Community Learn how to code on these sites with a heavy community influence ready to offer help to newbs. Language Specific Drill down to the language you really want on these sites, offering expansive learning in one or two specific languages. How to Break Into a Windows PC (and Prevent It from Happening to You) 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. SS64 | Command line reference. The Basics of C Programming". The previous discussion becomes a little clearer if you understand how memory addresses work in a computer's hardware. If you have not read it already, now would be a good time to read How Bits and Bytes Work to fully understand bits, bytes and words. All computers have memory, also known as RAM (random access memory). For example, your computer might have 16 or 32 or 64 megabytes of RAM installed right now. RAM holds the programs that your computer is currently running along with the data they are currently manipulating (their variables and data structures).

Float f; This statement says, "Declare a location named f that can hold one floating point value. " While you think of the variable f, the computer thinks of a specific address in memory (for example, 248,440). F = 3.14; The compiler might translate that into, "Load the value 3.14 into memory location 248,440. " There are, by the way, several interesting side effects to the way your computer treats memory. S:t 1:5 2:2 3:3 4:4 5:5 u = 5. Become a Programmer, Motherfucker. If you don't know how to code, then you can learn even if you think you can't.

Thousands of people have learned programming from these fine books: Learn Python The Hard Way Learn Ruby The Hard Way Learn Code The Hard Way I'm also working on a whole series of programming education books at learncodethehardway.org. These are works in progress, and feedback is welcome. Learn C The Hard Way Learn SQL The Hard Way Graphics Programming Language Agnostic NerdDinner Walkthrough Assembly Language Bash Clojure Clojure Programming ColdFusion CFML In 100 Minutes Delphi / Pascal Django Djangobook.com Erlang Learn You Some Erlang For Great Good Flex Getting started with Adobe Flex (PDF) Forth Git Grails Getting Start with Grails Haskell Java JavaScript JavaScript (Node.js specific) Latex The Not So Short Introduction to LATEX (perfect for beginners) Linux Advanced Linux Programming Lisp Lua Maven Mercurial Nemerle Nemerle NoSQL Oberon Programming in Oberon (PDF) Objective-C The Objective-C Programming Language OCaml Oracle Server Oracle PL/SQL Vim.