background preloader

Learning to program

Learning to program

Asynchronous Socket Programming What is 'asynchronous socket programming'? a.k.a. event-driven programming or select()-based multiplexing, it's a solution to a network programming problem: How do I talk to bunch of different network connections at once, all within one process/thread? Let's say you're writing a database server that accepts requests via a tcp connection. If you expect to have many simultaneous requests coming in, you might look at the following options: synchronous: you handle one request at a time, each in turn. pros: simple cons: any one request can hold up all the other requests fork: you start a new process to handle each request. pros: easy cons: does not scale well, hundreds of connections means hundreds of processes. fork() is the Unix programmer's hammer.

How to Think Like a Computer Scientist Learning with Python by Allen Downey, Jeff Elkner and Chris Meyers. This book is now available for sale at Hardcopies are no longer available from Green Tea Press. Understanding JavaScript Closures In JavaScript, a closure is a function to which the variables of the surrounding context are bound by reference. Every JavaScript function forms a closure on creation. In a moment I’ll explain why and walk through the process by which closures are created. Then I’ll address some common misconceptions and finish with some practical applications. But first a brief word from our sponsors: JavaScript closures are brought to you by lexical scope and the VariableEnvironment…

(the eff-bot guide to) The Standard Python Library Overviews (15) Core Modules [core-modules-index]Data Representation [data-representation-index]Data Storage [data-storage-index]File Formats [file-formats-index]Implementation Support Modules [implementation-support-modules-index]Internationalization [internationalization-index]Mail and News Message Processing [mail-and-news-message-processing-index]More Standard Modules [more-standard-modules-index]Multimedia Modules [multimedia-modules-index]Network Protocols [network-protocols-index]Other Modules [other-modules-index]Platform Specific Modules [platform-specific-modules-index]Preface [preface-index]Threads and Processes [threads-and-processes-index]Tools and Utilities [tools-and-utilities-index] Articles (249)

Think Python: How to Think Like a Computer Scientist How to Think Like a Computer Scientist by Allen B. Downey This is the first edition of Think Python, which uses Python 2. If you are using Python 3, you might want to use the second edition, which is here. Buy this book at Constraints HomeContents In this part of the SQLite tutorial, we will work with constraints. Constraints are placed on columns. They limit the data, that can be inserted into tables. We have the following constraints: NOT NULL constraint

50 Useful Coding Techniques (CSS Layouts, Visual Effects and Forms) - Smashing Magazine Advertisement Although CSS is generally considered a simple and straightforward language, sometimes it requires creativity, skill and a bit of experimentation. The good news is that designers and developers worldwide often face similar problems and choose to share their insights and workarounds with the wider community. Joe's Blog: An intro to modern OpenGL. Chapter 1: The Graphics Pipeline An intro to modern OpenGL. Chapter 1: The Graphics Pipeline updated April 5, 2010 17:12:05 PDT Table of Contents | Chapter 2 » OpenGL has been around a long time, and from reading all the accumulated layers of documentation out there on the Internet, it's not always clear what parts are historic and what parts are still useful and supported on modern graphics hardware.