background preloader

Coding

Facebook Twitter

Peering Behind the Browser - Pentadactyl. This one is a little fun for a Friday: implementing Conway’s Game of Life in SQL Anywhere 12. The game of life is a simple zero-player game where an infinite plane of cellular automatons live and die according to some simple rules. In this post, we will create a full version of this game (with GUI), in a single SQL statement. Taken from Wikipedia , the rules of Conway’s Game of Life are: The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, live or dead. Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. It is unlikely that SQL would be your first choice for building an instance of the game of life. The first thing to do is create a table to hold the state of the world. Additionally, we will create a simple helper procedure to insert live cells into the world.

Joel on Software. Date. Most spreadsheet programs have a rather nice little built-in function called NETWORKDAYS to calculate the number of business days (i.e.

date

Monday-Friday, excluding holidays) between any two given dates. I couldn't find a simple way to do that in PHP, so I threw this together. It replicates the functionality of OpenOffice's NETWORKDAYS function - you give it a start date, an end date, and an array of any holidays you want skipped, and it'll tell you the number of business days (inclusive of the start and end days!) Between them. I've tested it pretty strenuously but date arithmetic is complicated and there's always the possibility I missed something, so please feel free to check my math. Date_default_timezone_set. Эмуляция отправки формы при помощи XMLHttpRequest. The Nature of Lisp. Monday, May 8, 2006 Introduction When I first stumbled into Lisp advocacy on various corners of the web I was already an experienced programmer.

The Nature of Lisp

At that point I had grokked what seemed at the time a wide range of programming languages. I was proud to have the usual suspects (C++, Java, C#, etc.) on my service record and was under impression that I knew everything there is to know about programming languages. I couldn't have possibly been more wrong. My initial attempt to learn Lisp came to a crashing halt as soon as I saw some sample code. The moment I regained my sight I communicated my frustrations to some members of the Lisp sect.

For many months the Lisp advocates pressed on. The enlightenment came instantaneously. That very second I became a member of the Lisp cult. I gave the matter careful thought. I shared my ideas with fellow Lispers. XML Reloaded A thousand mile journey starts with a single step. <todo name="housework"><item priority="high">Clean the house. So, where are we? Structure and Interpretation of Computer Programs. This book is one of a series of texts written by faculty of the Electrical Engineering and Computer Science Department at the Massachusetts Institute of Technology.

Structure and Interpretation of Computer Programs

It was edited and produced by The MIT Press under a joint production-distribution arrangement with the McGraw-Hill Book Company. Ordering Information: North America Text orders should be addressed to the McGraw-Hill Book Company. All other orders should be addressed to The MIT Press. Outside North America All orders should be addressed to The MIT Press or its local distributor. © 1996 by The Massachusetts Institute of Technology Second edition All rights reserved. This work is licensed under a Creative Commons Attribution-Noncommercial 3.0 Unported License. This book was set by the authors using the LATEX typesetting system and was printed and bound in the United States of America. Library of Congress Cataloging-in-Publication Data Fourth printing, 1999.