Feed on
Posts
Comments

Job hunt update

Wow, have the last couple weeks been exhausting! Interview after interview after interview. Programming questions, algorithm questions, character questions, even a few “extreme estimation” questions. Now, don’t get me wrong, I love interviews (it’s fun to get pushed a little!), but 20 hours of work a week, 18 credit hours of classes, a home to keep up, and interviews every other day? Phew!

As readers of my blog know, I got interviews (and interview offers) with a lot of great companies (Google, Apple, Amazon, ATG). I even had a company contact me out of the blue recently as well (Quantcast). So, whats the verdict? Where am I with my job hunting progress? Three delightful words: on site interviews. I was given on site interviews with everyone. Google and Quantcast this week, Apple in 2 weeks, Amazon next month. Plane rides, hotels, rental cars, and tour groups here I come! After all, what could be more exciting than visiting a every one of the companies I applied to?

Oh yea, the next step – getting an offer. I was going to write more, but something tells me in a week or two, I will probably have a bit more to say about offers. Talk to you then!

The Fall career fair at RIT has come and gone… what fun it was! I got to meet the guys from Scribd, speak with members of different government groups, and spread my resume like wildfire. So, who ended up giving me an interview?

Yea, that feels good!

Looking for my résumé?

With the Fall career fair at Rochester Institute of Technology approaching, I thought it would be useful to post a copy of my resume here for any potential employers to access.

Resume for Adam Risi

If you are a recruiter, and you were looking for my resume, you might also be interested in the rest of my blog posts, or my open source coding profile on github.com. As always, please feel free to contact me by phone or email at your convenience. My contact information can be found at the top of my resume.

Thank you!

Alright, if you read my blog regularly, you are probably getting tired of my “FSM engine this, FSM engine that” – well, sorry, but I’ve got some more FSM stuff for you today!

As one of the examples provided with the FSM engine, I provide a date parser for the 3 different valid http date formats: asctime, rfc850, and rfc1123. The HTTP standard provides a great EBNF form description of parsing these dates (section 3.3), so writing the code was actually pretty trivial. After writing the code, and as part of the documentation of the project, I have generated some images to make the parsing process a little clearer.

(Click to enlarge)

The source for this feat of parsing is included in the examples folder of the FSM library. Enjoy!

Many of my recent posts have been about my Finite State Machine engine, and what it can (and does) do. As one of the examples provided with the engine, I provide a parser for bencode format, the data formatting style used in torrent files, torrent trackers, etc. It makes a great example as its easy to understand, from a novice perspective, and it parses well (heck, its isometric!).

As part of the FSM examples, I am generating visualizations for the included FSMs via dot, a utility part of the GraphViz collection. It’s a great tool for generating digraphs. I just finished the visualizations for bencode format, so I thought I would share! As always, if you have a question, leave a comment or send me an email: adam@adamrisi.com.


Entry points are always node “0″, and the example’s entry point is the bencode_fsm node 0. Pretty neat, eh? It’s a perfect translation of the bencode standard into a working FSM.

Recently, I was working on a Finite State Machine library in C for a couple of complex parsing tasks. Trying to come up with examples, I decided that a URI parser (following the standardized URI format found in RFC 3986) would be a good test, as well as an easy test for other people to try out. Try entering a URI below, and see what happens!

All of the FSM code as well as the different examples (uri parsing, date parsing, etc) are all available at the GitHub project page. Below, you can test the URI parser and take a look at the output. If you notice a bug, please, leave a comment!

This code is memory-leak free (tested via valgrind). I haven’t licensed it yet, so send me an email if you want to use any piece of my FSM project in your own code.

This has got to be some of the strangest code I have ever written. I was recently working on my implementation of a Finite State Machine engine in C, when I decided that I really wanted a way to pass both a function pointer (easy), and a list of arguments that could be passed to that function (more difficult), as part of a table (really just an array) describing what functions, and what arguments to pass (really hard).

I toyed with ideas like variadic macros (or functions), abusing some sort of global stack of void pointers to various types of structs, and a bunch of other ideas. Finally, I came up with the following code (an example of the technique):

#include <stdio.h>

struct threeint_args {
  int a;
  int b;
  int c;
};

void mult(void *args)
{
  struct threeint_args *ma = (struct threeint_args*)args;
  printf("%d * %d * %d = %d\n",
    ma->a, ma->b, ma->c,
    ma->a * ma->b * ma->c);
}

void add(void *args)
{
  struct threeint_args *aa = (struct threeint_args*)args;
  printf("%d + %d + %d = %d\n",
  aa->a, aa->b, aa->c,
  aa->a + aa->b + aa->c);
}

struct generic_func {
  void(*func)(void*);
  void *args;
};

void run_generics(struct generic_func gfs[])
{
  struct generic_func *gf = gfs;
  while(gf->func != NULL) {
    gf->func(gf->args);
    gf++;
  }
}

int main(int argc, char **argv)
{
  struct generic_func examples[] =
    {
      {mult, (void*)&(struct threeint_args){1, 2, 3}},
      {add, (void*)&(struct threeint_args){1, 2, 3}},

      {mult, (void*)&(struct threeint_args){4, 5, 6}},
      {add, (void*)&(struct threeint_args){4, 5, 6}},

      {mult, (void*)&(struct threeint_args){7, 8, 9}},
      {add, (void*)&(struct threeint_args){7, 8, 9}},

      {NULL}
    };

  run_generics(examples);
}

“Alright”, I thought to myself, “this little program probably will throw a fit if I try to compile it, but lets try anyway.”

$ gcc -ggdb -o test test.c
$

“Now wait a minute – no complaints? Certainly, if I try to run it, there will be some sort of segfault, or bug, or something. This can’t be right…”

$ valgrind ./test
==16546== Memcheck, a memory error detector
==16546== Copyright (C) 2002-2009, and GNU GPLd, by Julian Seward et al.
==16546== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info
==16546== Command: ./test
==16546==
1 * 2 * 3 = 6
1 + 2 + 3 = 6
4 * 5 * 6 = 120
4 + 5 + 6 = 15
7 * 8 * 9 = 504
7 + 8 + 9 = 24
==16546==
==16546== HEAP SUMMARY:
==16546==     in use at exit: 0 bytes in 0 blocks
==16546==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==16546==
==16546== All heap blocks were freed -- no leaks are possible
==16546==
==16546== For counts of detected and suppressed errors, rerun with: -v
==16546== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)

Holy s**t. That just worked.

I don’t often get surprised by code that I write. After all, if I am writing it, it means I understand it (most of the time). This example; however, completely flabbergasted me. Being able to store the pointer to a function, and a pointer to the arguments to the function in an array means I can do all sorts of things. I could develop a signals and slots mechanism, I can pass table-local contexts to function pointers, hell, I could rule the world. I couldn’t find anything else like this on the web – so I thought I would share!

The Cricket A600 is a cheap, little broadband USB device – but it has been the source of major headaches for some people. Especially those trying to set it up under linux. Well, after trying many things, and failing many times, I have found an elegant and command based way of getting on the web.

First, get this file: Cricket flip-flopper Compile it up (or use the precompiled 32 bit binaries), and install it. Keep the extracted files handy.

Drop in the A600, and wait for it to show up as a CDROM drive. In the previously extracted files, run “sudo ./flipflop.sh”. Let it finish.

Check dmesg to make sure you saw “ttyACM0″ go by at some point. Grep is good for this.

Lastly, install wvdial, and use the following in your /etc/wvdial.conf :


Modem = /dev/ttyACM0
Phone = #777

Exec sudo wvdial, and off you go!

As I program more, I discover the true value of a repository is very, very high. So, I decided to move picodns, my little DNS server project, over to github, where it will be preserved for anyone just in case my server goes down. PicoDNS also features extensive user documentation.

Not to mention github is awesome.

git clone git://github.com/ajrisi/picodns.git

lsif goes v2.0

The software I contributed, and blogged about a while ago has gone v2.0. The newly modified source code now compiles and works on a larger variety of linux systems.

The purpose of the software is essentially to list the network interfaces, their IP address, and whatever their IP address resolves into. It’s just a single file of delicious C code, and it works like a charm. Check it out!

git clone git://github.com/ajrisi/lsif.git

Older Posts »