System languages should include Webapps

I was reading an FAQ today about some subtle C++ point and I came across a comment that explicitly excludes the beginning language-learner. By the way, it confuses most novice C++ programmers that private virtuals can be overridden… However the private virtual approach is now common enough that confusion of novices is less of a concern. This left me frustrated that a language that has been core to my personal success so flippantly brushed aside its future user.

4 Simple Steps to Run D Language in Azure Websites

I shameless stole these steps from 4 Simple Steps to Run Go Language in Azure Websites. This post is simply a transliteration to D. Thank you very much to Wade Wegner for the original post. 4 Simple Steps Create your Azure Website in Azure Portal. Configure FTP deployment 2. Run dub init vibed_hello_world --type=vibe.d and change the default app.d to read the port from an environment variable. Docs import vibe.d; shared static this() { import std.process; import std.conv; immutable port = environment["HTTP_PLATFORM_PORT"]; //Use the port IIS tells us to.

Property Driven Design: MinMax

I wrote an article on Property Testing about a year ago. Isocpp.org even linked to it which was pretty cool. Recently, I uncovered a fantastic talk by Jessica Kerr about property testing. Kerr’s talk reinvigorated my languid research effort toward generated testing. Kerr presented the idea (novel to me) that properties aren’t rigid. Properties don’t need to exclude all possible incorrect results for a given function. Properties simply must reduce the size of the incorrect space. This may seem like semantics, but it is easier to exclude a wild-ass-guess that verify it is correct. Additionally, some domains may not have a solidly defined answer,a nd the result my be probabilistic in nature. This post will focus on deterministic problems for the moment, but realize that property testing is vastly more general than mundane example testing. How properties reduce the size of the problem space makes me imagine this Figure.

sometimes_code_gives_you_a_wtf

Following Kerr’s references, I found a set of projects from a predicate-logic course. This course provides 20 separate projects excellently cast for a property-driven-design tutorial. These projects are unique since besides the typical requirements they enumerate the predicate functions each requirement typifies. Predicate functions are to a predicate-logician as properties are to a computer scientist. These enumerated properties (predicates) clarified many points I misunderstood about property testing.

This post will step through the design of the first project minmax using C++. My primary goal for this article is to address a concern raised by a colleague, “Does pulling in more complexity — a fancy test generator — actually increase quality?”

Recasting how I blog

I wrote my first article for codestrokes in February 2011 - right as I was accepted to graduate school. My goal was to improve my writing in preparation for writing a thesis. While through grad school I started with more traditional writing tool. I started to learn to write, and I found my writing style: Simplicity. I started writing with a big fancy word processor. I blogged with a massive database backed blogging engine. By the time I finished my thesis, I was writing in vim. I used a makefile to check spelling and check for simple grammatical rules. The process was much simpler to manage. This motivated me to convert my blog to a static site. This post describes my process on simplifying my writing process.

Introduction to Pointers

Please see my introduction to pointers at https://www.youtube.com/watch?v=mkYBz5Db-Ok.

Property Testing in C++

Currently, I'm on a testing kick. One might say tests are shiny. I don't know if they are really shiny as much as I found another cool use for uniform_int_distribution<>. A use which, as a side effect, might make me appear to be a better software developer. (This assumes a negative bug rate is proportional to better software). I've started playing with Property Testing. Property Testing is a form of unit testing where the programmers defines properties, or invariants about the code. A framework library (ok, seriously its a framework because it calls your code) generates random constrained inputs and calls your test functions. It's pretty cool, and while I was playing around with the framework, I found a real bug, related to my ignorance of C++'s auto type deduction.

What is a Unit Test?

I’m taking a Software Testing and Verification course as part of my Master’s work. Our first assignment was to write a short paper describing a unit test, then implement selection sort and test it under that philosophy. Sarcastically, I commented to my colleagues the triviality of this question. The first response was, “Wow, I don’t think that is such an easy question.” A technical discussion ensued. This is that log. <!– more –> Definition 1: Given a function in the mathematical sense, i.e.

Hello Project Euler, Sorry I doubted you

Project Euler returns with full functionality including new problems! Thank you Project Euler for not giving up on this awesome project. http://projecteuler.net/news

Goodbye Project Euler

A group of friends and I have been working on project euler for about a year now. I learned a great deal from this fantastic project, and it was the first time I was able to get a real handle on Haskell. Project Euler taught me make. It taught me better performance reporting techniques, honed my octave, and got me over that initial mind bending hump of Haskell. Thank you Project Euler, you will be missed.

Design for Testability via Security

I was discussing bootloader design with a colleague of mine the other day. We were attempting to load new a third-party hardware component. The device has a poor protocol, and a useless verification step. This discussion got me thinking however how the concepts used to build a strong self-enforcing security protocol, also apply to building a testable, and reliable communication protocol. Thus, security helps us build better products not because they are secure, but because they are verifiable.

Massively Intelligent Non-Deterministic Luminating Effortless Super Solver

I worked the title of this article several times before I finally settled on the subtly epic heading you see above. Hopefully this title will funnel people off google into my blog (delicious SEO). I wanted to push the A.I. component of my solution because A.I. is awesome and mysterious, and cool (and can like solve jeopardy). I was quickly disillusioned however. Really, A.I. isn’t magic, rather it’s just the same thing computers have been doing for a long time: computing. Sadly this realization took several months in an A.I. class before I was sufficiently crestfallen. A.I. patterns including the hill climbing algorithm used here are indeed “intelligent” but really it a reflecting of the algorithm designer, not the entity executing the algorithm. So I built a substitution cipher solver in C++. It’s fast it uses random numbers i.e. non-deterministic, it uses an A.I. algorithm i.e. Intelligent, it uses threads i.e. Massively, it deciphers i.e. luminates the text and it solves super stuff therefore the title is completely justified. I give you my Massively Intelligent Non-Deterministic Luminating Effortless Super Solver (MINDLESS). If none of that interests you then please stick around and follow the side quest of looking for emotionally charged parenthesis.

Sean Parent: No Raw Loops

A group of colleagues and I watched Sean Parent’s Going Native Talk on “C++ Seasoning”. Parent takes some extreme views on how to use C++, but his examples for using the STL to simplify code are phenomenal. For a recent AI project I decided to apply Parent’s goal of “no raw loops”, I was blown away by the transformation… err std::transformation this had on my code. In this post I indented to demonstrate several complex code blocks, or overly specific code blocks what were replaced by some STL magic.

rand() Considered Harmful

Stephan T Lavavej (STL) is a tactical speaker. In a short amount of time he convey’s essential accurate information which is immediately applicable. In this talk at Going Native 2013, STL takes 20 minutes to teach us how to properly use random numbers in our programs: http://channel9.msdn.com/Events/GoingNative/2013/rand-Considered-Harmful

Simplicity Does Matter!

I’m been sitting this draft for too long, but before I started my research experiment with Haskell I was looking for a language. I was approaching an AI class for my graduate work, and thought I’d learn Lisp, or at least a lisp. Clojure was hot, and new (read shiny), so I dove into learning about it’s virtues. It’s virtues are embodied in its creator, Rich Hickey, who while being a great programmer is a fantastic speaker.

A Thunk on Laziness

I originally approached Haskell excited, and wide-eyed mystified by the type theory. Type became my golden hammer. In my C programs I typedef’d everything so it’d have a “unique” type. I was cautious with my casting. I was hooked. I had an intuitive understanding of laziness, as implemented by Haskell, that would allow one to write”streaming” algorithms. That is programs that deal with data in an online way to process data as it streams through.

Idiomatic Learning

When learning a new language I find it helpful to study a languages idioms. Idioms exist in a language for a specific reason. Sometimes that reason is to further the principles of the language, other times it’s to mask, or otherwise deal with some underlying design decision of the language. Currently, I am studying Haskell, and currently I am struggle to clarify the idioms of the language. The syntax is still very new and awkward, currently with a total authoring in Haskell of 713 lines.

"Smaller" Reviews are More Effective

I was reviewing a new software module for work today, and discovered that when the class fit on a single screen my comments were more meaningful, than when the class was larger. My comments for spatially larger classes were mostly focused on syntactic, and idiomatic details. It was an interesting self-observation, but this certainly isn’t new information. I’ve heard the adage that smaller reviews are more effective than larger ones. At a conference I attended hosted by Atlassian: The JIRA team noted several instances where the time per file decreased with the number of files in the review.

The Itanium Flop

I wake up in the morning with ideas that please me, and some of those ideas actually please me also later in the day when I’ve entered them into my computer. - Donald Knuth I’m on a bit of a Knuth kick right now, and I’ve been procrastinating studying, and homework to find interviews, and papers by the master himself. I currently have a list of microfiche references to check out as soon as I get to the basement of my university’s library: Woot, computational necromancy!

Linux User's Group CTF 2013

This past weekend we held another capture the flag event at the Arizona State University’s Linux User’s Group. It had more of a system admin focus than security cracking exploits, but it was fun an nontheless a diverse learning experience for all those involved. However, almost immediately, I realized the number one rule in CTF, nothing is off limits! <!– more –> The game was organized into two parts, a game server which collected the the scores and displayed the point totals of all teams in real-time, and the virtual servers (hosted on Amazon EC2) which contained the actual games.

My First Logic Program

This semester, I’m taking an introduction to artificial intelligence, and despite this being the second week, I’ve learned a great deal. Our second assignment was to implement a program in clingo (clasp on gringo) which is a derivative of Prologue. This is my first experience with a logical programming language, and I am intrigued to the possibilities. <!– more –> Immediately I was intrigued by the freeform expressiveness of the language.

Artifical Intelligence Impact on Medicine

Dr. Andrew Weil of the Arizona Center for Integrative Medicine states, “If we can make the correct diagnosis, the healing can begin. If we can’t, both our personal health and our economy are doomed. [1]” Accurate, traceable, and informed diagnosis are paramount to the health of patients. Medicine, within the United States, is an enormous $2.5 Trillion opportunity and with the proliferation of research over many decades new medical findings are being published than could ever be grokked, unassisted, by a doctor [2].

Interesting article about Monads

I found an interesting blog today with some clear and interesting discussion on Haskell, and Monads: http://intoverflow.wordpress.com/2010/07/20/i-come-from-java-and-want-to-know-what-monads-are-in-haskell/

My Haskell Environment for Project Euler

For the last several months I’ve been working on Project Euler in Haskell. My intent has been to learn Haskell, and grasp the functional concepts. While working on several problems it’s important to have a workflow that allows for a fast cycle time. I spent some time with Cabal, attempting to build a scheme that works efficiently, but was unable to do so. Instead I setup a mix of cabal-dev, and make to build a fast workflow that allow for compiling, testing, common code libraries, and benchmarks.

How to Write a Thesis

My family purchased this book for me, as a motivator to start thinking about the thesis component of my master’s degree. “It must be substantial…” said a colleague of mine. “It must be original work…” Original, substantial, all words that left me with uneasiness about how to start. This book however was an easy read, and gave some very pragmatic advice on how to start, yet the most important quote I drew from the book was, “What are the questions in your field?” Oh, that’s a much easier way to look at it.

Is Monolithic Code Faster?

As a software engineer I have a vested interest in disproving this statement. Bjarne Stroustroup says C++ is designed to create efficient abstractions. A software engineer’s job is to create simple abstractions to complex systems. State machines form a large part of many systems. The other day, a co-worker came to me, and asked, “Is it better to make straight line code for each case statement, even if it repeats, or is it better to abstraction into functions and make the code ‘cleaner’.” Is “cleaner” code faster?

Patterns are evidence of a language's lacking

A coworker of mine stated something interesting, “…a pattern is evidence of missing feature in the language…”. At first I struggled with this statement. How can you design a language general enough to be widely used, and simultaneously cover all the desirable idioms such that patterns are built in? At first this seemed silly to me, until I heard Erik Meijer state in a Haskell lecture, “..this is why we implemented LINQ as a pattern instead of a language feature…” It’s an interesting concept that a language is responsible for reducing patterns into the language itself.

Haskell a Few Problems Later

Well, the Haskell honeymoon is over for me. I spent some time working on a few Project Euler problems this weekend, and my initial assumptions formed from toy problems were dashed. While I was able to solve 3 problems fairly quickly, I faced a number of non trivial bugs, and memory issues. On the other side of my naïve passion, I’m finding a functional thought process, and it’s exciting. My problems were really centered around a naïve belief that Haskell could convert my inefficient algorithms to some “mathematically pure” representation.

Haskell Day 1 (Again)

I’ve restarted my haskell programming education. Here is my implementation of FizzBuzz <!– more –> fizzbuzz x | x `mod` 15 == 0 = "FIZZBUZZ" | x `mod` 3 == 0 = "FIZZ" | x `mod` 5 == 0 = "BUZZ" | otherwise = show x main = print (map fizzbuzz [1..100]) [suffusion-adsense client=‘ca-pub-6284398857369558’ slot=‘1495369305’ width=‘728’ height=‘90’]

Latex Walkthrough

Latex Walkthrough from Jeremy Wright on Vimeo.

Beagle Board Cluster Demo'd at ASU

We presented our Beagle Board Cluster at the Engineering Career Fair. Look out for a design writeup soon! http://asulug.org/2013/03/engineering-open-house/ <!– more –> [suffusion-adsense client=‘ca-pub-6284398857369558’ slot=‘1495369305’ width=‘728’ height=‘90’]

Duplicating SD Cards for Beagleboard

The ASU Linux User’s group is building a Beagleboard cluster. This requires each compute node to have an identical system image, with the exception of the hostname and ipaddress. The easiest way, I found to do this, is to configure one compute node, then duplicate the SD cards across the other nodes. Here is how I did that. Save the partitions to an image file using part image partimage save /dev/sdb1 beagle-cluster-boot.000 beagleboard-cluster-boot.000 partimage save /dev/sdb2 beagle-cluster-boot.000 beagleboard-cluster-rootfs.000 Save the partitions table to a file sudo sfdisk -d /dev/sdb > beagleboard-cluster-partitions.sfdisk Eject the card, and put in a blank card.

Text Processing for Programmers

I was reading a blog about coding interviews, and one comment made near the bottom struck me, “…“Um… grep?” then they’re probably OK…” As I read that comment, I realized I’d never answer that way, and I agreed with the author that was a problem. That began my dabble in grep, awk and sed, and these tools will change your workflow and even how you think about profiling code. Grep has even become a verb in my daily life, “Is this greppable?” is my mantra.

Short Valgrind Video Tutorial

I made a short video tutorial on valgrind. Enjoy Valgrind Demonstration from Jeremy Wright on Vimeo.

ASULUG Talk: Django Web Framework

ASU Linux User’s Group (ASULUG) — LUG Talks Sat 6 Oct 1:30pm — BYENG 210 The Django Web Framework Jeremy Wright Abstract Django: Awesome Jazz Musician, Awesome Web Framework. Django is a web framework similar to the popular Ruby on RAILS, but leveraging the Python programming language. Born out of the newspaper industry, Django is touted as the “web framework for perfectionists with deadlines.” Django is a powerful tool for any size web project: Web Services, Storefronts, CMS’s—Django conquers all.

Abstraction in Plain English

Abstraction is an interesting concept. For me personally, abstraction was never clearly explained. I left school and entered my first job knowing I should abstract things, but I realize now my understanding of abstraction amounted to obscurity. Abstraction to me meant, “Don’t use that thing directly, abstract it and use some interface instead.” “That’s what good programmers do,” I told myself. I taught myself a lot about function pointers, and advanced OO techniques using pure virtual classes all to avoid using something directly.

Open Source CTF Game Server

I am releasing under Creative Commons Attribution-ShareAlike 3.0 Unported License. my django game server for running Capture the Flag events. This server does have some known bugs which I enumerated in the issue tracker. I developed this first version for the Fall 2012 ASULUG hacking competition. I hope people can get involved and make this a fantastic game server! Please feel free to contact me, or simply fork the repository. I look forward to seeing everyone’s interesting pull requests!

The Turbulent History of Managed Code

Managed Code is a fascinating technology; Just-In-Time compilation provides advanced run-time optimization and strong type safety can render the hardware MMU obsolete. However the managed code renaissance is again in decline, and interestingly more than technology, business is changing the managed/native landscape. More than any other other metric, managed code is about maximizing programmer productivity. In 1977, Infocom released Zork. Zork was an innovative game. Its sophisticated linguistics made for an immersive experience for its adventurers.

Know Its Name

Programming is at it’s heart an struggle in communication. Source code is the communication medium with the processor; Comment the medium to other coders, and UML the medium to higher-level communication. Computer Scientists have the stereotype of being poor communicators, but in our own mediums, we’re phenomenal. This fact is no where more apparent, than trying to explain source code to someone else. How does one read source code? I’m currently, learning Haskell, and my first goal is to understand this question.

The Importance of System Design

For the small programs we tend to implement as part of a semester project, or the simple “one-off/get-it-done” programs at work, system design rarely plays a part. However, even in the smallest problems a top-level system design is critical for consistency and ease of use. Class components, regardless of how precise and accurate they are in their own internal design, if they aren’t externally consistent with other objects, the system will be brittle, and difficult to use.

Building an Interpreter

When I started programming, I thought that compilers where these magic behemoths; Oracles which consumed your source code, and prophesied the resulting program. I thought that the compiler was an integral part of the “system”. I was excited to realize that the compiler is simply another program. A program you can write yourself. You can write a compiler, for your very own language. Go ahead, make up a language, I’ll wait… Seriously though, making your own language is a very difficult task, and implementing a language useful enough for non-trivial problems is even more difficult.

Anderson Smart-Pointer Idiom Updated!

C++11 provides us with a ton of new tools for expressing complex ideas in an efficient way. C++11 is unique among modern languages in that it provides a productive syntax, while also generating exceptionally fast code. For the first time ever, software engineers are responsible for increasing the performance of software systems. For decades we’ve been standing on the shoulders of hardware engineers. Hardware engineers have been increasing the clock speeds of our processors, but we’ve hit a physical limit.

Capture the Flag - Running a Hacking Competition

Black-Hat hacking in an controlled environment, like this, is an important skill for software developers. The Art of War describes knowing one’s enemy, and with the prevalence of internet-enabled applications today, it has never been more critical to know how the “enemy” can take down a system. While capture-the-flag is a fun, and exciting intellectual game, it is serious training for software engineers of all types, and skill levels. I recently setup a small capture the flag event for the Arizona Linux User’s Group, and it was very fun.

Copyright - The Anti-Innovator

The French government dismantled and destroyed the Mona Lisa, along with a number of other masterpiece paintings today after courts decided that paintbrushes are copyrighted. Furthermore their derivative works, i.e. items creating using paintbrushes, are subject to copyright infringement. This of course is a fabrication, but this is exactly the point Oracle is trying to make when trying to copyright programming languages. Programming languages are tools for programmers to create the world we live in.

Talk at SoDA

SoDA Meeting: Embedded Scripting for Games from SoDA @ ASU on Vimeo.

Multicast Delegates in C++11

C# has a wonderfully flexible delegate system capable of multicast events. This simple tool makes event driven software easier to write, and reduces coupling between objects. In 2003 Herb Sutter implemented a general form of the Observer pattern [1]. He called this the multi_function. It uses a mixture of TR1 and boost components to build a multi-cast delegate similar to C#’s. Fast-forward 9 years, and we now have variadic-templates thanks to C++11.

Abstract Syntax Trees: Introduction to Flex

Bison is an incredibly powerful parser generator tool. However most of the examples, and tutorials demonstrate Bison’s parsing ability, using on-the-fly computation instead of building a Syntax Tree. Bison is fully capable to generate the front-end of a simple compiler, but to do so, we have to build a syntax tree. Come to find out, building a syntax tree with Bison isn’t that difficult, and the key is how one leverages the semantic actions.

Branching with Mercurial

Mercurial supports two separate methods for branching. The first is built into how distributed version control functions, in that every clone is a branch itself. This is the branching method Joel Sposky recommends on hginit.com. The second method is called local branches. Initially I liked the local branch method; I liked it for the fact that I felt smart for using it. It did not improve productivity. There is a simple reason for this, with local branches it is difficult to diff the branch to the main branch of development e.g.

Compile-Time Polymorphism

Polymorphism is a tool in object orientation, which allows us to model behavior, while simultaneously leverage existing code. Polymorphism allows is behavior reuse. In C++ polymorphism, comes in 2 flavors, the standard runtime variant, and a curious compile time variant. Runtime polymorphism, like Java, leverages virtual functions to dynamically bind[1. With virtual functions the compiler doesn’t know which method to call until runtime. In C++ this is implemented with the virtual method table] a method at the call site.

Modern C++

I found an awesome talk on how the new changes of C++11 are modernizing, an already fantastically powerful language. http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-835T. In this talk, Herb Sutter does two things I feel are quite admirable. Firstly, despite this being a Microsoft conference, he talks only about standard, portable C++ until the final minutes. Secondly, he very clearly, compares idioms we currently use, to the new C++11 idioms. This made it very easy for me to see the value of what C++11 provides.

Abusing RAM

My system has 16GB of RAM, but since I run Linux I rarely use more than about 3GB. So how do I justify such a extreme amounts of memory? Ramdisks. I run Lubuntu1, but hopefully this works for you too. Basically, I create a ramdisk and mount it in /mnt/ramdisk, then I setup the login/logout scripts to transfer to and from the ramdisk. Step 1: Create a ramdisk Add this line to your fstab: none /mnt/ramdisk tmpfs defaults 0 0 By default a tmpfs will initialize to half of the total system RAM.

Parallel Binary Buddy: The Friendly Memory Manager

Fragmentation, the allocator’s sin. Each byte A buddy, A friend Introduction Memory management is pervasive in all forms of software, not just operating systems. Embedded Systems, when dynamic memory is acceptable, tend to use memory pools to the heap. Standard desktop applications use the platform’s std::new or malloc. However, when a system is more complex, a memory manager may be used. Memory managers allow the programmer to strictly control application memory, in a way that flows with the rest of the system’s design.

Making C++ like Python: The Anderson Smart Pointer Pattern

Choosing to use C++ brings the additional complexity of memory management. Dennis Ritchie once stated: The C Programming Language — A language which combines the flexibility of assembly language with the power of assembly language. C++ inherits much of that _flexibility, _however, this incidental complexity, can be relegated to a single class, leaving you with the high-level elegance of Python. RAII help with this additional complexity, however without a pattern for guidance implementing RAII consistently can be difficult, defeating the safety it provides.

Parallel Game-of-Life

Conway’s Game of Life is a dramatic illustration of emmergent behavior; that a seemingly complex system, such as cell mitosis can be governed by a set of simple rules. OpenMP is a fantastic set of language extensions which allows one to add dramatic parallelism without complex thread management. As a demonstration of OpenMP’s simplicity I implemented the Game of Life. The code and all analysis is available on bitbucket.org. In a real program, it common to have swathes of code which cannot be made parallel.

The $1,000,000 Compile

Hitting the compile and run button costs $1,000,000. How would such a cost affect your test strategy? As extreme as that sounds, its a harsh reality for ASIC designers. The start-up costs for an ASIC design are extreme, as a result ASIC verification is very important. Especially since you can’t just update a buggy ASIC. In software engineering, we design increasingly complex systems requiring more and more elegant test strategies. I propose ASIC verification is in a more mature state, and software engineers could learn a lot from the translation of these techniques.

Good Tools, Excellent Results

This semester for the C++ practicum we are building a clone of Zork. Like many games of the genre, Zork is driven by a database. Our implementation is a JSON database. I chose JSON for a few reasons, but most importantly because its a human readable format that’s simple to understand. I started by editing JSON files by hand in a text editor, however I found very quickly that investigating in a quick tool greatly improved my quality.

Why do some tutorials use std::cout and others use just cout?

<!– more –>Many tutorials start “Hello World” like so: #include <iostream> using namespace std; int main() { cout << "Hello World" << endl; return 0; } However sometimes, and in my opinion the more correct version is written: #include <iostream> int main() { std::cout << "Hello World" << std::endl; return 0; } The difference between the 2 programs is the double colon (::). This is called the namespace resolution operator. C++ has a wonderful concept called namespaces.

Hijacking System Programs

Let’s say for a moment that you are a graduate student, with shell access to your schools server. The server maintains a number of tools you need for classes, and research. All is well, except the stock editor on the server is wicked old. Like an eternity old. Well that happened to me. I am fully addicted to my custom vim configuration, but it requires vim7.3. My school’s server only has 7.0.

Version Control More Than Collaboration

I’ve used version control in some form or another since I was a freshman in college, however I’m quite the anomaly. I will use a tool fully knowing that its more than I need, just to learn something new. Initially, this is how I approached version control. Except for a few unique situations version control of my homework, seemed like more work than it was worth. I used to think version control was merely a collaboration tool for teams of people.

Game Framework for C++ Practicum

For this year’s C++ practicum, we are going to build a small game engine. I’m keeping the code on bitbucket: http://bitbucket.org/jwright/gamecomponents Join us, or fork the code and make your own design. I look forward to seeing how this progresses.

We Need a -1 Button

I really like all the little social media button on blogs. I hit the +1 and I feel like I contribute in some way. When I post here to my personal blog, wordpress automatically posts to my Facebook. Its entirely unoriginal, but I like it. However I think we need a -1 button for some articles. I read this: http://mashable.com/2011/06/22/arizona-social-media-day/ and thought to myself, “Wow, that’s dumb. I am embarrassed for my state.“ I wanted to hit a -1 button.

Being Truely Productive

Productivity is an elusive mistress. I approach productivity much like any design problem. I lay out my requirements, and I iterate until I am happy with the outcome. Over the last few years I have spent a lot time laying out my design process. Along the way I found a number of tools that were helpful. This is my personal process and while I think it’s a great process. It’s important to refactor for yourself.

Overview of Upcoming Articles

I’ve been putting quite a bit of time into this semester’s upcoming C++ Practicum at ASU. I’m currently working on an article on Skip-Lists in D, and a few other C++ orientated articles. Expect a new post Sunday night. ‘til then, thank you for your patience, cheers.

Type-Safe Variable Argument Lists

Type-safety is a popular topic. Perceived as a panacea for bad software, the Department of Defense implemented Ada. The original thought was restriction synonymous with robustness. From this, opponents claim type safe languages place the programmer’s hands in handcuffs, thereby thwarting generic code. Modern languages, such as D, and Java leverage a statically checked type system with a focus on consistency, not restriction. Modern type systems abet generic code, without sacrificing robustness.

Parallelism in D

Parallelism, it sounds like a religion, and in some sense it is. Like many facets of software engineering, writing good parallel code is more of an art than a science. I come from a FPGA background where parallelism is part of the language; part of the culture! The tools are designed to find deadlocks, analyze timing and the language itself is fully aware of parallelism. The hardware world understands parallelism, yet writing parallel software is still difficult.

Bucket Sort

D Source Code Sorting is a very important operation in computer programs. Knuth devotes an entire chapter to sorting and search. Sorting algorithms, like most algorithms, use the Big O notation to compare computational complexity. Bucket sort is one such sorting algorithm. however bucket sort typically doesn’t actually sort the array. In the normal case, bucket sort is used to partition the data set into groups, or buckets. Each bucket is then sorted using a separate algorithm such as quicksort, or insertion sort.

D for the C++ Programmer

As a comparative study, I am porting a Red-Black Tree from C++ to the D programming language (Part 1, Part 2). Overall D is an easy, practical transition for the C++ programmer. D provides a number of features for implementing correct code, however it is D’s simplicity that makes it truly enticing as a replacement. While D retains _C Style Syntax, _it is considerably simpler than C++, especially in the presence of exceptions.

Class Invariants

This week, I started porting my C++ implementation of the Red-Black tree to D. I am trying to pay special attention to the features of D, intended to make writing correct code easier. While on that vane, I was reading an excellent article, discussing invariants, and I was pleased to find such a useful implementation of the class invariant in the D language. Invariants come from the same “design-by-contract” idiom, famous for pre- and post- conditions.

The Red-Black Tree

C++ Source Code D Source Code D provides a number of features that simplify designing software, especially in the embedded environment. I will show in this 2 part comparison, between C++ and D, that D helps one write correct code. Correct code is something Andrei Alexandrescu, stresses heavily as a prominent feature of D. I use the Red-Black Tree for such a comparison since its complicated enough to make memory management difficult, while retaining real-world application.

Java 4K Contest

Crazy challenging game contest: http://javaunlimited.net/contests/java4k.php Reminds me of the winners of a 96KB contest: http://en.wikipedia.org/wiki/.kkrieger

Thing a Week: Algorithm Edition

In homage to Jonathan Coulton, this summer I intend to explore a series of algorithms in an effort to both learn the D programming language, as well as deepen my computer science background. First up, the Red-Black Tree.

Welcome to Code Strokes

Welcome to Code Strokes. Our focus here is about elegant software design. We attempt to meld the worlds of deeply embedded real-time software, with modern software design principles. Take a look at our features. If you have any feedback leave a comment. Thank you, and welcome.