background preloader

Programming

Facebook Twitter

Free Compiler Construction Tools: Lexers, Parser Generators, Opt. If you are thinking of creating your own programming language, writing a compiler or interpreter, or a scripting facility for your application, or even creating a documentation parsing facility, the tools on this page are designed to (hopefully) ease your task. These compiler construction kits, parser generators, lexical analyzer / analyser (lexers) generators, code optimzers (optimizer generators), provide the facility where you define your language and allow the compiler creation tools to generate the source code for your software. If you want a (printed) book on compiler construction, you might want to check out the famous Compilers: Principles, Techniques, and Tools by Aho, Sethi and Ullman. The "Dragon book", as it is affectionately called by some, is regarded by many as the standard book on writing compilers. AdaGOOP JS/CC LALR(1) Parser and Lexical Analyzer Generator Quex - A Mode Oriented Directly Coded Lexical Analyzer Generator Gardens Point Scanner Generator re2c Grammatica Eli.

Reference. Emulators. Bash by example, Part 3. Popular RFC Title Index 1. How to Design Programs. Programming Texts/Tutorials. Biggus Biggus is a pure-Python library for handling very large (i.e. too large for system memory) n-dimensional arrays. It has two main components: Representation, lazy indexing, and conversion to persistent files and NumPy arrays; andLazy calculation. At the core of Biggus is the Array which provides a simple, consistent, NumPy-esque interface to n-dimensional data which avoids reading data until explicitly requested by user code. Commonly these Array objects are created by wrapping "concrete" data sources such as HDF5 variables, netCDF4 variables, or even just NumPy arrays. Once created, Array objects can be concatenated and stacked to form new Array objects, which can themselves be concatenated and stacked as required.

In this way it is possible to construct virtual arrays of arbitrary size, spanning multiple data sources. In addition, all Array objects can be indexed to extract subsets. User code may request any Array object be saved to a "concrete" data form (e.g. Linkers and Loaders. These are the manuscript chapters for my Linkers and Loaders, published by Morgan-Kaufman. See the book's web site for ordering information. The text in these files is the unedited original manuscript. M-K has fine copy editors, who have fixed all the minor typos, spelling, and grammar errors in the printed book, but if you come across factual errors I'd still appreciate help getting all the details of linking and loading as complete and correct as possible.

I will collect errata and fix them in subsequent printings. The figures here are scans of hand-drawn sketches which have been redrawn for the book. You don't need to tell me I'm a lousy artist. I already know that. Please send comments and questions to johnl-linker@iecc.com. Thanks! Chapters are available in an excessive variety of formats. Postscript versions of these files are available, including the figure sketches. ASM. Bash by example, Part 3. Reverse Engineering. C.

Algorithms. Java. Algorytmy i Struktury Danych. Algorytmy i struktury danych. Sortowanie. Sortowanie – jeden z podstawowych problemów informatyki. Polega na uporządkowaniu zbioru danych względem pewnych cech charakterystycznych każdego elementu tego zbioru. Szczególnym przypadkiem jest sortowanie względem wartości każdego elementu, np. sortowanie liczb, słów itp. Algorytmy sortowania są stosowane w celu uporządkowania danych, umożliwienia stosowania wydajniejszych algorytmów (np. wyszukiwania) i prezentacji danych w sposób czytelniejszy dla człowieka.

Jeśli jest konieczne posortowanie zbioru większego niż wielkość dostępnej pamięci, stosuje się algorytmy sortowania zewnętrznego. Klasyfikacja[edytuj | edytuj kod] Algorytmy sortowania są zazwyczaj klasyfikowane według: złożoności (pesymistyczna, oczekiwana) – zależność liczby wykonanych operacji w stosunku od liczebności sortowanego zbioru (n). Kiedy elementy o tym samym kluczu są nierozróżnialne, stabilność nie jest istotna. Przykład: (para liczb całkowitych sortowana względem pierwszej wartości) W losowym rozmieszczeniu n elemetów. The Improved Sorting Algorithm Demo. Algorytmy Sortujące - Sortowanie Głupie. Sortowanie głupie jest również bardzo złym algorytmem sortującym, lecz, w przeciwieństwie do opisanego w poprzednim rozdziale sortowania zwariowanego, daje zawsze poprawne wyniki. Zasada działania jest bardzo prosta: Przeglądamy kolejne pary sąsiednich elementów sortowanego zbioru.

Jeśli bieżąco przeglądana para elementów jest w złej kolejności, elementy pary zamieniamy miejscami i całą operację rozpoczynamy od początku zbioru. Jeśli przeglądniemy wszystkie pary, zbiór będzie posortowany. Naiwność (lub, jak wolą niektórzy, głupota) algorytmu wyraża się tym, iż po napotkaniu nieposortowanych elementów algorytm zamienia je miejscami, a następnie rozpoczyna całą pracę od początku zbioru. Algorytm sortowania głupiego występuje w dwóch wersjach - rekurencyjnej oraz iteracyjnej. Rozpoczynamy przeglądanie zbioru od pierwszego elementu - indeks i przyjmuje wartość 1. W celach badawczych testujemy czas wykonania algorytmu sortowania głupiego w środowisku opisanym we wstępie.

Six ways to write more comprehensible code. I learned to write, clear, maintainable code the hard way. For the last twelve years, I've made my living writing computer games and selling them over the Net using the marketing technique that was once charmingly known as shareware. What this means is that I start with a blank screen, start coding, and, a few tens of thousands of lines of code later, I have something to sell. This means that, if I make a stinky mess, I'm doing it in my own nest. When I'm chasing down a bug at 3 a.m., staring at a nightmare cloud of spaghetti code, and I say, "Dear God, what idiot child of married cousins wrote this garbage? ", the answer to that question is "Me.

" So I have been well rewarded by learning about good, sane programming techniques. Some of these practices are described in this article. But there are many who, like me, stumbled into programming in an unexpected or unusual way and never had anyone drill this stuff into them. The example case Figure 1. Killing an alien gives you some points. Oh? Courses - Google Code University - Google Code.