Skip to main content

Posts

Showing posts from 2009

Building Wireshark on Win32

It was a tedious process, but here's how I got it done. I first tried to follow the:
http://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html

However, it's not as straightforward as it seems. Here's the lowdown on how I got the source to build:

First, I tried building using the following environment:
- Microsoft Visual Studio .NET 2003
- Cygwin 1.6 with unzip, bison, flex, perl, patch, wget
- Python 3.1
- Subversion 1.6.6-4
- TortoiseSVN 1.6.6

One of the source files, epan/dissectors/packet-dcerpc-netlogon.c, uses a variadic macro, which is only supported in MSVC 2005 and later. Wasn't interested in commenting out the code only to find more problems, so I abandoned this idea.

I then tried to come up with an environment that was probably more supported by Wireshark:
- Microsoft Visual Studio C++ 2008 Express Edition
- Cygwin 1.7 with unzip, bison, flex, perl, patch, wget
- Python 2.6.4
- Subversion 1.6.6-4
- TortoiseSVN 1.6.6

Things went well except a couple things:
- libssp…

The C++ Standard Library: Recap

The final 7 sections of The C++ Standard Library by Josuttis required lots of attention, but I am glad to have read this book cover to cover.

This book is worth purchasing for Chapter 8 alone in its description of the function objects. The concept of stateful function objects is a powerful idea and can be used in conjunction with the standard library algorithms to produce some powerful behavior.

Function objects provide a great introduction to the algorithms section in that many of the algorithms require function pointers or objects as arguments to execute on the item. Items in a container are typically modified using beginning and end iterators, or even pointers to contiguous arrays of memory.

After the algorithms section, a special containers section described the bitset container. This is a container that will come in handy during protocol development at some point, but whether operations on the bitset are faster than simple C binary operations would be interesting to test.

In the n…

C++ Development Environment

Trolling through some forums today, I found some great resources for C++, so I expanded on it and inserted some annotations.

Categories are Integrated Development Environment (IDE), UML Interface, Team Collaboration, Coding Standards, Bug Tracking, Version Control, Unit Test Library, and Performance Testing. A bracket sits next to the resource which contains a W for Windows support, L for Linux, and M for Mac. A $ indicates that a standard version of the software will require a purchased license.

IDE:

Eclipse CDT (eclipse.org) [WLM]
Visual SlickEdit (slickedit.com) [WLM$]


UML:

Eclipse MDT (eclipse.org) [WLM]


Team Collaboration:

Skype [WLM]
Zoho [WLM]
Sharepoint [W$]
SourceForge [WLM]


Coding Standards (Platform Agnostic):

The Lockheed Martin Joint Strike Fighter C++ coding standards (att.com)
The MISRA C++ coding standards [$] (misra-cpp.org)


Bug Tracking:

Bugzilla (bugzilla.org) [WLM]
Unfuddle (unfuddle.com) [WLM]


Version Control:

mercurial
subversion
mercurial
git
cvs


Version Control Gui:

Tortoise (tigris.…

The C++ Standard Library: First 8 Sections

"At some point you have to stop introducing features and focus on the details. Otherwise, you never finish the work."
- Nicolai Josuttis

Key points throughout these sections:
- The C++ standard template library containers were designed with value semantics in mind. It is also not possible to store auto_ptrs in the containers due to the effect of the assignment operator. For reference semantics, the Boost pointer array should come in handy.
- The STL was also designed for performance rather than safety. There are some containers that throw exceptions, but not many. The burden of safety falls on the code that uses the STL.
- There are sequential containers and associative containers. Which container to use depends on the behavior of the software because containers behavior differently.
- Associative containers are represented internally by binary (Red-Black) trees.
- Container traversal must be done through iterators. Iterators have their own hierarchy of traits: input, …

Effective C++, Third Edition

"...much as in real life, friends are often more trouble than they're worth."
- Scott Meyers

The C++ type definition that declares an external function of a class as one that can access private or protected data members also defines an individual in which one confides. But are programming books less trouble than friends? I'd like to think so.

This book opened my eyes to angles of C++ that I had not considered in the past. In a summarized list, here were the parts I found most useful:

RAII (Resource Acquisition Is Initialization), defined in Item 13, states that it is easier to allocate resources simply by allowing their critical work to occur in the constructor/destructor rather than their functions. The example is the Mutex class, which is defined at the top of critical section functions, and that's it. It's easier than a call to it's lock() function and will clean itself up when the function completes.

Smart pointers, like std::auto_ptr or tr1::shared_…

Robots!

I finally managed to get my Google Wave Robot up:

http://rabidrunner.appspot.com

Of course, this is just the hello world example written in Python. I am trying to come up with less trivial examples, but first I want to use this application to try out a database access, a file upload, a headline capture (RSS reader), and some other nifty little tricks that will prove to be useful.

Google Wave still looks like it has a way to go. Using the sandbox build, it still is a bit slow, but that may be due to the massive amount of posting and replying that is going on. I kind of wish there was an easier way to filter out certain waves instead of loading the most recent.

I'm also anxiously looking forward to these items once the real build comes out:
- Google Wave server
- Robots from places other than AppEngine
- Integration with other databases besides GQL
- Security features

Effective C++ - First 5 Items

In my copious free time, I am tackling "Effective C++, Third Edition" by Scott Meyers. The book is organized into 55 items which detail ways in which C++ code can be more effectively written. Through the first five items, there are two glaring deficiencies I've noticed with my own code: lack of use of const, and functions returning references to objects. This is one of those books that is starting to look like a fantastic collection of years of C++ and object-oriented experiences from many different engineers and reviewers, all mashed into one book. Could this book be a keeper?

Also on deck: "Effective Java, Second Edition" by Joshua Bloch.

Google App Engine

I have become quite interested in how this whole cloud computing thing is going, so I'm giving Google App Engine a shot. I guess the major support right now is in Python, with Java support now coming online. Of interest is how App Engine can provide all the same functions as Java EE without the need of hosting and with the ability to swap out components where needed. Ultimately, what will probably happen is that development could be restricted to what is provided on the App Engine server; for example, App Engine's database, certificates, and API's.

Another reason to use App Engine is that currently Google Wave can only communicate to robots created from App Engine. I'm sure that any Wave protocol implementation can act as a robot, but it would require detailed development to the standards. Of course, none of this can be tested until I get my sandbox account!

Best SVN Linux GUI?

I've been searching for a good SVN front end for Linux to replace the command line check in. I want the capability to choose a subset of modified files from which to commit, rather than having to check in the entire directory structure each time by doing a "svn commit .". This feature comes standard with Tortoise, but Tortoise is Windows-only.

I first tried out RapidSVN. This is a GTK front end that stores bookmarks on working directories. However, it did not have what I wanted.

I also tried eSVN. This is a front end built on qt. Initially, I tried "File -> Open Working Directory..." and this hung. I ran the esvn binary from the directory containing my svn checkout and I was finally able to select a working directory. The GUI also allowed a selectable subset of files!

I understand there is a subversion plugin for Eclipse. I will give this a try on my Ubuntu box.

All of these attempts were made on a RHEL 5.0 machine.

Google Wave for collaboration

This is probably going to be a hit. A real-time (yes, an actual real-time) collaborative environment where users can chat and stuff shows up as typing commences. There is so much more, though. Dragging and dropping pics, multiple edits on a single buffer, internal/external extensions, and playback of all activity that occurred in a wave (or wavelet?).

I have signed up for the API. Will let you know how it goes!

The OO Design Pyramid

A great article on what Gene Shadrin calls the OO Design Pyramid: [sys-con.com]

The references of this articles might not be enough to infer Shadrin's concept of the OO Design Pyramid, and I'm not sure where he obtained his data for Figure 3 (Design Time vs. Design Flaw), but on the surface I believe this is a fantastic representation of Object Oriented Design in an easy to understand, structured form.

Shadrin present a number of plausible ideas here. Using basic concepts without patterns will probably cause an architect to eventually design to patterns, which takes much longer. Designing with patterns but without the basic concepts typically leads to confusion and no "glue" between the patterns. I have read the Gang of Four books, several Fowler books, and others, and have seen them demonstrate the necessity of lower layer concepts with design patterns, but not the other way around. I really feel Shadrin has something here.

Mythical Man Month - Recap

Even after almost 35 years in print, and with such sweeping changes in the software industry, I still find the lessons and observations in this book relevant in today's development environment. The Man-Month is truly mythical; software projects work best with a very few, sharp developers. When a project becomes late, throwing more people at it makes it later, and communication/synchronization between parties is key. Touching on such topics as unit testing, regression testing, project hierarchies, and niche languages, MM-M predicted long in advance very common, important practices found in today's projects. Brooks even touches on his excitement of object-oriented programming, his skepticism of the benefits of artificial intelligence, and the potential benefits of shrink-wrapped software. Even though they were presented in 1975, these are all correct assertions in 2009.

Being the 20th anniversary edition, Brooks adds new chapters to reflect on the thoughts of the first editi…

Fun with MySQL + PHP

Lately, I've been getting a lot of requests to build websites driven by lots of data, so I've been reading heavily into MySQL and PHP. I've been relying "Beginning PHP and MySQL: From Novice to Professional, Third Edition" by W. Jason Gilmore. I was concerned with his use of connecting to MySQL with a plaintext user name and password, so I went through a few tutorials online:

[hvassing.com]

[studiolounge.net]

and the SQL reference manual: [dev.mysql.com]

Of course, they did the same thing. I'm working on trying to implement an SSL solution to login, but unfortunately I think it'll require an X.509 certificate.

Nagios

I installed Nagios at home and configured a Windows client with an agent. So far, it looks promising; I can look at availability, CPU+Memory Usage, and other useful stats. Although the dashboard is really ugly and there is a 3D View link in the menu to a VRML MIME object (which, I understand, nobody supports these days), I will still try some additional tweaks to see what else I can do. Maybe I can upload some screen shots of a better looking dashboard!

[nagios.org]

I love LAMP

A close colleague of mine recently spoke of his desire to create a website driven with a database. I told him he wanted LAMP:
Linux
Apache
MySQL
PHP

I have Ubuntu 8.04 installed at home, so I referred to this guide:
[ubuntu.com]

There are others as well:
[lamphowto.com]
[redhat.com]

Now, about integrating the code for the website into version control and a bug tracker...

Rehashing C++ With Smart Pointers

Though I have seldom cared about using smart pointers these past three years (primarily because I work mostly with C, which can't support truly encapsulating smart pointers), I have tried to rehash my knowledge with Andrei Alexandrescu's tutorial here:[informit.com]

I am absolutely astounded by the attention to detail in this article for something so simple as a single class with overloaded operators. C++ is a language that is not for the faint at heart, so this sort of article helps to navigate through the memory management limitations of C++.

I should consider buying Andrei's book with the Eckel book to go with my Stroustroup and Musser books! Where's my amazon wish list...

Programming Language Trends

Just found this link to tiobe.com programming languages, their use, and their trends.

I guess the metrics are gathered using popular internet search engines (Google, Yahoo, MSN).

Java taking the #1 spot is probably attributed to the explosion of web services over the last few years, coupled with its built-in cross platform UI and other APIs. C is at #2 probably because of the Linux kernel, popularity in embedded software, and the *nix utilities and ubiquity of open source projects. At #3 is C++, which with C# and VB make up the languages made popular by Microsoft in Visual Studio.

All the others can pretty much be isolated to either niche environments (MATLAB, Objective C), the web (Javascript, Ruby) or as utilities (Perl, BASH, Python), so they won't have as much exposure.

Goals for next three years

I have decided that if I can accomplish one of the following things within the next three years, I have done something special:
- Author a whitepaper
- Start an open-source project with other contributors
- Speak at a (somewhat important) conference on software

I plan to accomplish this by doing a few different things:
- Read and write a lot of code!
- Read and study online and printed software novels, particularly the Head-First, Fowler, or O'Reilly series of materials
- Subscribe and receive emails of tech articles (I already subscribe to TechRepublic)
- Active use of Twitter and Linkedin
- Making use of software community message boards

Of course, additional suggestions/comments are all welcome.

Mythical Man Month

I'm an avid but slow reader, so as a reward for finally getting through the heavy "Guns, Germs, and Steel" by Jared Diamond on Monday night, I am rewarding myself by picking up "The Mythical Man-Month" by Fred Brooks. I guess this is the quintessential software project management book, but as a developer I still am concerned with the software process because I like to be cognizant of the time constraints of my work.

I probably bought this book about four years ago, so I regret not reading it through the first time due to its heavy material. I'm a little more patient now, so maybe this time around it will be easier.

Other geeky stuff I've read:
"Just for Fun" - Linux Torvalds
"Hacker Culture" - Douglas Thomas
"The Art of Unix Programming" - Eric Raymond
"Domain Driven Design" - Eric Evans

Experiments with Valgrind

Lately, I have been experimenting with using Valgrind in my OPNET Discrete Event Simulations. So far, I've noticed that every time Valgrind runs the runsim executable, the models are recompiled, and I have been using full-stack IP models, so I need to start smaller.

Free stuff I can't live without

The top 10 free tools I can't live without, Windows Edition:vim - to  code stuffputty - to log in and browse...WinSCP - ...and then transfer filesWireshark - to go deepCygwin - because nothing beats grepRealVNC - for  graphical remote sessionsTortoiseSVN - easy, fast version control with a GUIVMware - when I run out of hardware and want to check out Linux distrosprocexp - another awesome tool from sysinternalsfirefox - which could be chrome when the bugs are ironed out
Linux Edition:
vim - who knew!fluxbox - simplicity is blissxmms - like I  mentioned aboveoperaWireshark/tcpdumpsvn - to host and serve the Windows subversion clientsgcc - to build all these neat programscifs - to mount the Windows shareswodim - makes CD/DVD burning that much easiermysql - for my running log entries!

Why have this blog...

...when I'm a seemingly reclusive software engineer just trying to get work done?  Well, maybe I might be able to convey some of my experiences to help others, or maybe others can find what I've done and give me hints on what I could do better.
In either case, it's therapeutic, and if nothing else, provides an external outlet for thoughts on issues I encounter in the area where data networks and software collide.  Enjoy!