background preloader

Programming

Facebook Twitter

Lockpicking LG #150. By Aurelian Melinte "When two trains approach each other at a crossing, both shall come to a full stop and neither shall start up again until the other has gone.

Lockpicking LG #150

" -- old Kansas statute Overview The dynamic linker allows us to override functions exported by the shared objects that are used by programs. In this article, we will use this interposition functionality and build a library that wraps around the 'pthreads' library to diagnose mutex-related problems, including the well-known deadlock. Deadlocks and how to avoid them Simply put, a deadlock is a run-time condition where threads are waiting for resources in a circular chain. To keep things simple for our debugging library, let's assume the resources that threads are competing for are all mutexes. With pthreads, a thread can also self-deadlock if it attempts to lock a mutex it already owns. As type PTHREAD_MUTEX_ERRORCHECK. Library interposition Hooking pthreads. Design Patterns and Refactoring.

Singleton Pattern. Motivation Sometimes it's important to have only one instance for a class.

Singleton Pattern

For example, in a system there should be only one window manager (or only a file system or only a print spooler). Usually singletons are used for centralized management of internal or external resources and they provide a global point of access to themselves. The singleton pattern is one of the simplest design patterns: it involves only one class which is responsible to instantiate itself, to make sure it creates not more than one instance; in the same time it provides a global point of access to that instance. In this case the same instance can be used from everywhere, being impossible to invoke directly the constructor each time. Intent. Android Development, Part 5a: Starting Activities. This is Part 5a of an ongoing series. The rest of the series is always viewable and up to date at .

If you're just checking in, the archives are worth a look. I took a week off, but I'm back with more details on user interfaces. Again, I'm not a designer, nor will I ever claim to be, but I have had a bit of experience with getting a few screens running in the application I'm writing for Pay It Square . Singleton Pattern - Web Tutorials - avajava.com. Singleton Pattern Author: Deron Eriksson Description: This Java tutorial describes the singleton pattern, a popular creational design pattern.

Singleton Pattern - Web Tutorials - avajava.com

Tutorial created using: Windows Vista || JDK 1.6.0_11 || Eclipse JEE Ganymede SR1 (Eclipse 3.4.1) A singleton is a class that is instantiated only once. This is typically accomplished by creating a static field in the class representing the class. The SingletonExample class is an example of a typical singleton class. Signs that you're a bad programmer - Software Engineering Tips. Why was this written?

Signs that you're a bad programmer - Software Engineering Tips

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. Scripting Languages: PHP, Perl, Python, Ruby, Smalltalk. A side-by-side reference sheet sheet one: version | grammar and execution | variables and expressions | arithmetic and logic | strings | regexes | dates and time | arrays | dictionaries | functions | execution control | exceptions | threads sheet two: streams | asynchronous events | files | file formats | directories | processes and environment | option parsing | libraries and namespaces | objects | inheritance and polymorphism | reflection | net and web | gui | databases | unit tests | logging | debugging sheet two: streams | asynchronous events | files | directories | processes and environment | option parsing | libraries and namespaces | objects | inheritance and polymorphism | reflection | net and web | gui | databases | unit tests | logging | debugging version used The versions used for testing code in the reference sheet. show version.

Scripting Languages: PHP, Perl, Python, Ruby, Smalltalk

IPC:Sockets. Subsections Sockets provide point-to-point, two-way communication between two processes.

IPC:Sockets

Linux Howtos: C/C++ -> Sockets Tutorial. You are here: Programming->C/C++This is a simple tutorial on using sockets for interprocess communication.

Linux Howtos: C/C++ -> Sockets Tutorial

The client server model Most interprocess communication uses the client server model. These terms refer to the two processes which will be communicating with each other. One of the two processes, the client, connects to the other process, the server, typically to make a request for information. A good analogy is a person who makes a phone call to another person. Notice that the client needs to know of the existence of and the address of the server, but the server does not need to know the address of (or even the existence of) the client prior to the connection being established. Notice also that once a connection is established, both sides can send and receive information. The system calls for establishing a connection are somewhat different for the client and the server, but both involve the basic construct of a socket.A socket is one end of an interprocess communication channel.

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.

50 Places You Can Learn to Code (for Free) 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. C++ Exception Handling. Install Tutorial for NetBeans and Qt on Windows.

Install Tutorial for Netbeans and Qt on Windows 1.

Install Tutorial for NetBeans and Qt on Windows

Install NetBeans IDE and the C/C++ plugin module. Click here to download NetBeans C/C++ 7.0.1 2. Download and install MSYS-1.0.10.exe in the default location. The C Library Reference Guide.