Entries Tagged ‘Programming’:

What every programmer should know about security

There’s an excellent thread going on over at stackoverflow.com about suggestions for what every programmer should know about security. Some of the more interesting highlights: Never trust user input! Validate input from all untrusted sources – use whitelists not blacklists Plan for security from the start – it’s not something you can bolt on at [...]

Tags: , ,

Leave a Comment

Simple Perl Client/Server Sockets Example

Here is a very simple client/server example coded in Perl. This is an extremely basic application – the goal was merely for me to learn how to use sockets in Perl. You can check out the code on github here: github.com/darkmuck/SimplePerlSockets. After you’ve downloaded the client and server files follow these instructions to test it [...]

Tags: , , , ,

Leave a Comment

Never Throw Away Old Code

source: Things You Should Never Do, Part I (joelonsoftware.com) For many reasons, it is almost never a good idea to throw away old code. It may seem like a good idea to start from fresh if the existing code base is bloated, slow, hard to maintain, etc. However, by starting from fresh you are losing [...]

Tags: , ,

Leave a Comment

10 Papers Every Programmer Should Read

On the criteria to be used in decomposing systems into modules – David Parnas A Note On Distributed Computing – Jim Waldo, Geoff Wyant, Ann Wollrath, Sam Kendall The Next 700 Programming Languages – P. J. Landin Can Programming Be Liberated from the von Neumann Style? – John Backus Reflections on Trusting Trust – Ken [...]

Tags: , ,

Leave a Comment

How to iterate through a result set with SQL

Method 1: Using a cursor declare cursor1 cursor local for select * from tablename open cursor1 fetch next from cursor1 into #temptable while @@fetch_status = 0 begin if exists (select column from tablename where id = (select id from #temptable)) begin  /* do stuff here */  end else begin /* do other stuff here */ [...]

Tags: , , , , , , , , ,

Leave a Comment

How to iterate through a result set with SQL

Method 1: Using a cursor declare cursor1 cursor local for select * from tablename open cursor1 fetch next from cursor1 into #temptable while @@fetch_status = 0 begin if exists (select column from tablename where id = (select id from #temptable)) begin  /* do stuff here */  end else begin /* do other stuff here */ [...]

Tags: , , , , , , , , , , ,

Leave a Comment

Understanding JavaScript OOP

“JavaScript is an object oriented (OO) language, with its roots in the Self programming language, although it’s (sadly) designed to look like Java. This makes the language’s really powerful and sweet features stay covered by some pretty ugly and counter-intuitive work-arounds. One such affected feature is the implementation of prototypical inheritance. The concepts are simple [...]

Tags: , , , , ,

Leave a Comment

The Development of the C Language

“The C programming language was devised in the early 1970s as a system implementation language for the nascent Unix operating system. Derived from the typeless language BCPL, it evolved a type structure; created on a tiny machine as a tool to improve a meager programming environment, it has become one of the dominant languages of [...]

Tags: , , ,

Leave a Comment

What every programmer should know about memory

“In the early days computers were much simpler. The various components of a system, such as the CPU, memory, mass storage, and network interfaces, were developed together and, as a result, were quite balanced in their performance. For example, the memory and network interfaces were not (much) faster than the CPU at providing data. This [...]

Tags: , , ,

Leave a Comment

Why is 1 loop so much slower than 2 loops?

A really interesting in-depth question was posted over at stackoverflow.com asking why 1 loop seems to be so much slower than 2 loops. The discussion on the page goes into great and interesting detail on what’s going on behind the scenes and why there is such a decrease in speed between 1 and 2+ loops. [...]

Tags: , , , ,

Leave a Comment