background preloader

PHP: a fractal of bad design - fuzzy notepad

PHP: a fractal of bad design - fuzzy notepad
(This article has been translated into Spanish (PDF, with some additions) by Jorge Amado Soria Ramirez — thanks!) Preface I’m cranky. I complain about a lot of things. This is not the same. PHP is the lone exception. PHP is an embarrassment, a blight upon my craft. But I’ve got to get this out of my system. An analogy I just blurted this out to Mel to explain my frustration and she insisted that I reproduce it here. I can’t even say what’s wrong with PHP, because— okay. Stance I assert that the following qualities are important for making a language productive and useful, and PHP violates them with wild abandon. A language must be predictable. My position is thus: PHP is full of surprises: mysql_real_escape_string, E_ALLPHP is inconsistent: strpos, str_rot13PHP requires boilerplate: error-checking around C API calls, ===PHP is flaky: ==, foreach ($foo as &$bar)PHP is opaque: no stack traces by default or for fatals, complex error reporting I’ve been in PHP arguments a lot. Core language Text

The Julia Language Open CourseWare for Linux Geeks: 50+ Resources The Open CourseWare movement is centered on freedom of information, so it's only natural that Open CourseWare offers education on an open format such as Linux. Whether you're just getting started or are an advanced developer, there's something out there for you to learn. Here, we've highlighted more than 50 of the best Linux courses you can take. Introduction If you know nothing about Linux, take some time to get familiarized with these courses. An Introduction to Linux: Visit this course to get an introductory look at Linux and find out why you might want to run Linux. Use In these courses, you'll learn all out great ways to get the most out of Linux. Free Software for Busy People: In this resource, you'll learn about switching to Open Office and other free Internet tools. Administration Are you a network administrator? Linux Network Administration: In this course, you'll cover all the details you need to know about for Linux network administration. Business Novell Concepts Development

Dynamic State Machines I was talking with my coworkers Jeff and Randy yesterday about some work Randy was doing implementing a finite state machine in django, and I was reminded of a pattern I've previously used to implement state machines using Python's dynamic typing to do it. In more static languages, an object is forever bound to its type, and implementing state-dependent behavior often requires using supporting classes which can be switched out to implement the variable behavior of different states. Python's dynamic nature makes this much simpler. Implementing state with dynamic typing In python, an object's type is determined simply by looking at the value of it's __class__ attribute. Conveniently, but also rather frighteningly, this attribute is mutable. This pattern is very powerful, and could easily be abused, but it expresses what is happening clearly and effectively, and matches the problem domain straightforwardly. A Blue morpho butterfly (Morpho menelaus) The life-cycle of a Butterfly Happy coding!

10 operating systems you've never heard of: 6-10: Compact code to DOS compatibility 6. KolibriOS Goal: Extreme performance and compact code size Web: www.kolibrios.org Without a doubt, KolibriOS wins the award for the most ambitious project in this feature. It's a fully fledged OS written entirely in assembly language. The KolibriOS team has managed to squeeze pre-emptive multitasking, a graphical desktop, TCP/IP networking, USB support, media playback and many other features onto a 1.44MB floppy disk. Booting 'kolibri.img' brings you to the desktop in just a couple of seconds. It's all tremendously impressive, and while KolibriOS will never challenge the main OS trio's desktop supremacy, it shows what can be achieved with careful coding, especially as we're so used to bloatware nowadays. 7. After Unix had flown out of the Bell Labs nest in the 1970s, the developers kick-started a new research project to scratch their programming itches. Ultimately, Plan 9 hasn't achieved anywhere near the same level of success as Unix. 8. 9. 10. First published in PC Plus Issue 288

Дерево ван Эмде Боаса / Алгоритмы Всем доброго времени суток! Сегодня я расскажу вам об одной интересной структуре данных, про которую слышали лишь немногие и про которую очень незаслуженно мало написано в рунете, да и в англоязычном информации, в общем-то, тоже негусто. Решено было исправить ситуацию и поделиться с общественностью в доступной форме этой достаточно экзотической структурой данных. Дерево ван Эмде Боаса (van Emde Boas tree) — ассоциативный массив, который позволяет хранить целые числа в диапазоне [0; U), где U = 2k, проще говоря, числа, состоящие не более чем из k бит. Главная особенность этой структуры — выполнение всех операций за время O(log(log(U))) независимо от количества хранящихся в ней элементов. Собственно, вот небольшой список поддерживающихся операций: Итак, приступим к построению нашей структуры, причем строить ее будем рекурсивно. Пусть k-дерево будет хранить числа в интервале [0; 2k), то есть, состоящие из k бит. Теперь построим k-дерево. Оценим асимптотически время работы этих функций.

Do You Use Linux? The RIAA and MPAA Don’t Want You To Use This Program | fsckin w/ linux Have you ever used PeerGuardian for Windows? Well good news my friend, there’s a Linux alternative available. PeerGuardian is a program that blocks companies such as the RIAA and their affiliates (such as Media Defender) from connecting to your computer when you are running P2P software. This is not foolproof by any means, but certainly a step in the right direction. When I used Windows, one of the programs I used to protect my online privacy was PeerGuardian. A quick google search found that PeerGuardian actually has a Linux client, but the installation is far more difficult than another program I found called MoBlock. Ok, now I know we’re looking at the rest of this document and saying, “Sh! It’s actually really easy if you follow it step by step, and if you have any questions, feel free to comment and I’ll do my best to help you out. Deep breath, here we go. First, we edit sources.list to add a repository: gksu gedit /etc/apt/sources.list Paste these two lines at the end:

Interpreted Languages: PHP, Perl, Python, Ruby (Sheet One) - Hyperpolyglot 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 How to get the version. php: The function phpversion() will return the version number as a string. python: import platform platform.python_version() ruby: <? pad

vi tips and tricks: Ten cool commands sure to impress your friends When coming to grips with the vi editor—either for the first time or as a regular user—most people tend to have a grasp of the core command set that allows them to perform those functions they use most regularly: navigating or saving a file; inserting, updating, deleting, or searching for data; or quitting without saving changes. However, the vi editor is extremely powerful and rich in features and functionality. Even after many years of use, you can still uncover new commands that you didn't realize existed. The commands covered in this article are amongst those less well known, but they can help you to work smarter by short-cutting existing methods you may use or allowing you to do something that you never realized you could do with vi. Before we start just a recap on the two modes of vi: command and insert. Turn line numbering on and off The vi editor has a number of options that determine the look and feel of an editing session. Listing 1. Listing 2. Back to top Auto-indentation #! #! #!

6 Steps to Becoming a Software Developer Deciding to become a software developer is a great initial step, congrats! The job opportunities are growing quickly and in just about every industry that you can imagine. The best part is that you do not necessarily have to go to a four year university to become a great software developer to lock down one of these jobs. The web has all the resources you'll need to interact, learn, get support and finally find a job as a software developer. Let's go through some of them! 0. Codecademy - JavaScript coursesCode School - Rails, jQuery, CoffeeScriptTryRuby - Really fun way to spend 15 minutes learning some RubyTreehouse - Web design (CSS, CSS3, HTML, HTML5, Responsive Design), web development (HTML5, JavaScript, and Intro to Programming), and iOS (build iPhone and iPad apps) 1. University CoursesNon-University Resources Books 2. 3. 4. [Bonus] 5. Hacker School - once you're quite good at what you do, the next level is to attend hacker school and become even better at it!

10 Papers Every Programmer Should Read (At Least Twice) I spent most of yesterday afternoon working on a paper I’m co-writing. It was one of those days when the writing came easy. I was moving from topic to topic, but then I realized that I was reaching too far backward – I was explaining things which I shouldn’t have had to explain to the audience I was trying to reach. When I first started writing, one of the pieces of advice that I heard was that you should always imagine that you are writing to a particular person. It gets your juices going – you’re automatically in an explanatory state of mind and you know what you can expect from your audience. The problem I was experiencing is only getting worse. So, I was thinking about this and trying to not to get too glum. We’ve taken an interesting turn in the industry over the past ten years. Here’s the original list. Most are easy to read but some are rough going – they drop off into math after the first few pages. On the criteria to be used in decomposing systems into modules – David Parnas

Arnon Rotem-Gal-Oz's Cirrus Minor - 10 Papers Every Software Architect Should Read (At Least Twice) Papers software architects should read at least twice Earlier today I read a post by Michael Feathers Called "10 Papers Every Developer Should Read At Least Twice. I knew some of the articles mentioned there and learnt about few interesting ones.I liked the idea so much, I thought I'd compile a similar list for software architects - based on some of the papers I read over the years: The Byzantine Generals Problem (1982) by Leslie Lamport, Robert Shostak and Marshall Pease - The problem with distributed consensus Go To statements considered harmfull (1968) - by Edsger W. I could come up with quite a few more articles not to mention books that aren't in this list - maybe I'll add more later

Related: