Archive for October, 2008

Small organization …

From The Lines | Posted by attriel October 30th, 2008

So, small organizations, teams, groups, what-have-you, have some things going for them.

  • Easy communication
  • Easy to identify who to contact
  • Quick collaboration

Of course, there are some problems

  • Low overlap of work
  • Hard to pass work over for vacations
  • Easy to miss communicate something

See, it’s nice that we have 2.5 devs on our team.  Technically two, but there’s a third dev in our “group” who sometimes helps even though he’s technically part of a different project.  They just only have something for him ~25% of the time, so he fills in some downtime with working with us.  When a task comes in, whichever of us has the most detailed knowledge of the area of code involved gets that task, or at least balanced against their workload.  If they have a big or time-sensitive issue, then it may slide to the other dev, who then becomes that expert for the next task.

But, going on vacation?  Yeah, that’s complicated.  Because when asked “Does anyone else know this code?” the answer is, quite frankly, “No.”  Not that they can’t figure it out or understand it, but they haven’t before now.  Because they were working on their tasks.

If we had 5 or 6 devs, then there might be two of us working on any given task, so when one goes out, the other has general familiarity and may just be missing out the details of this small piece where they weren’t primary. 

For instance, I had three big code projects finishing up as I left.  One is deploying after I get back, one can wait because it still has to go through acceptance with the customer .. and the other deploys the day before we fly in … AWKWARD.

Of course, that’s nothing compared to the call I got at 3pm on my last day asking if we could deploy another project, that had been waiting on feedback for 3 or 4 months now, ASAP.  They wanted “before you leave on vacation” but THAT wasn’t happening.  It simply wasn’t on the schedule to deploy, and we have a 1-week advance policy.  But it can’t wait until I get back apparently, they promised the customer it’d be out by the end of the month … Yeah, oops, sucks to be you?

So I put together a deployment request and the release files … and told my boss about it and said “you all have fun now, y’hear? ”  Because I garauntee I’m not cancelling international flights because they’re morons :o

Digital Encryption Screwup

Crypts, Demonstration | Posted by attriel October 28th, 2008

So, I screwed up the DES example somewhere I think.  I’m fairly sure, anyway.  Yeah.

Somewhere in:

First 8 iterations of DES Example

First 8 iterations of DES Example

I made a mistake.  I’m fairly sure the setup was correct:

 

Initial DES Setup Steps

Initial DES Setup Steps

And the first few iterations:

 

DES Iteration 1

DES Iteration 1

 

DES Iteration 2

DES Iteration 2

DES Iteration 3

DES Iteration 3

You can see where I botched R’(2) by shifting the wrong values around.

Then F(3), K(4), R’(4), C(6), K(6), F(5), R(5), R(8), D(9), K(9), F(8), R(9) …

 

DES Iteration 4

DES Iteration 4

DES Iteration 5

DES Iteration 5

DES Iteration 6-7

DES Iteration 6-7

DES Iteration 8

DES Iteration 8

Those are the errors I found while I was working.

I’m also fairly sure that at some point I started getting R and L confused, in F most likely, when I’m XOR’ing.  And I just didn’t have the … energy to go through it all to find the issue.  I may work it after thanksgiving, or I may restart it in a more structured manner that will force me o keep track of the C D L R in proper manners.

OTOH, If I ever get this done properly and find a good way of displaying it, this is basically what I started this blog for.  Showing the process, so that it’s easier to grasp, rather than just the mathematics and the sometimes hard-to-follow standards definitions.  Not that I’m looking forward to MD5, RSA or Blowfish, for example :o

Cocktail Coding

Uncategorized | Posted by attriel October 23rd, 2008

In college, one of the tenets I lived by, when I was redeveloping the electronic course management software we were using and in my classes, was that any block of code (function, procedure, etc) should fit on a cocktail napkin.

To be fair, part of this logic was that me and one of the people I hung out with, co-dev on the project, used to go to TGIF for dinner with friends a bunch, or we’d go out for lunch somewhere.  And since we both drank, we tended to go to places that had cocktail napkins.  It got to the point where we would sit down, order drinks, and ask for a stack of napkins.  Because we would both start coding and writing notes.

Most people never much liked the theory, because “a napkin is too small to put any real code onto!”  Most of those complaints were from people like those who wrote v1, with 800-line functions … yeah, that’s useless!

I bring this up because the other day when we were cleaning some, I found some of those old TGIF napkins.  Psuedo-coded, not sure where the real-code is.  These were from when we were still deciding between Perl and Java (in ’99)

You can see in the last image that we actually had a note for typing up the napkins, and a note for explaining to “durga” ABOUT napkins.  IIRC, durga was one of the ones where that went over … not at all.

More Euler projects

Externally Sourced, Site Maintenance | Posted by attriel October 21st, 2008

So, I’m thinking of doing some more of the Project Euler stuff.  Not sure how precisely to handle them, since for the most part they’re algorithmic rather than “solve the equation” things …

But it’s a thought for getting more bits.  Because as proven by the DES example that I’ve been working on FOREVER, doing the demonstrations for cryptography by hand is slow :o

Bad Data Design

Code Follies, From The Lines | Posted by attriel October 17th, 2008

Today I was working on some changes that had been requested to a system we manage.  Technically, they’d been requested through another group, passed to a third group, and they’d talked to me about it a month or so ago, I explained how it needed to process to update into our system so that the person asking could actually see the result, but we decided that, because it’s a legacy process that translates into our database, they’d get the system figured out and then we’d figure out how to pass the updates piecemeal.  Since until the flags are set for each record, they can update the source all they want and nothing happens.

Today I got a forward of a forward of the tail end of a conversation between two people that had been passed to a third.  Yeah, does that sound confusing?  me too!  End result being that the guy that requested the original change was wondering why he’d been told it was done but it wasn’t showing up.

Somewhere along the way, the flags were never updated.  Oops.  Turns out, upon further inspection, that they updated table A, we process from view B, which gets that data from C.  C has no relation to A.  So even if they’d updated the flags, we never would have gotten anything :o  So after some discussion I processed their updates directly into our dev environment so we can make sure that they do what everyone wants they should do.  I don’t actually know if the source data will ever get updated :o

On an entirely unrelated note …. What do you call a design that has two unique keys for every entry?

Now … what do you call it when it turns out one of them is not garaunteed to be unique?

OK … And what about when the other one is garaunteed to be unique EXCEPT WHEN IT ISN’T???

*sigh* Literally, I found a set of records where A and B shared key 1, then B and C shared key 2.  There is no unique way of identifying these without using (a) both keys, or (b) information that exists only inside the database

Of course, I will never get an explanation as to who’s dumb idea this design was, because that person is probably one of the guys that’s gone by now.  Just like all the other design idiocy decisions that vex me (us) daily.

Soundex Example 3

Codes, Demonstration | Posted by attriel October 14th, 2008

As a third example we can encode the word BLACKGUARD.  Largely because it demonstrates rule 5, as well as lets us see rule 3 a little better.

Step 1, B-LACKGUARD

Then we encode the letters

L:4

C:2

K:2

G:2

R:6

D:3

Step 2: B-4a222ua63

Step 3, collapsing adjacent identical digits, returns : B-4a2ua63

Step 4 removes all non-encoded letters, B-4263

Step 5 truncates to 3-digits, leaving us B-426

The SNDX value for BLACKGUARD is B-426 (BLKR)

Project Euler Problem

Externally Sourced, Project Euler | Posted by attriel October 8th, 2008

So, from a post on another blog (Out of All the Possible Answers), I followed a link to Project Euler … 

And then I read it to Kiir.  The problem is to find the smallest number evenly divisble by all the numbers from 1-20.  We decided that it didn’t mean at the same time, since that’s factorial :o

And then … *sigh* I felt compelled to find the answer.  My answer and logic after the break

Read the rest of this entry »

DES Erroer!!!

Crypts, Demonstration | Posted by attriel October 6th, 2008

So, as I was finishing iteration 9 (yeah, this is taking longer than anticipated, because frankly it’s a bit tedious and requires that I have some decent space on the train) I found myself making an error in structure.  I was XORing R(i-1) with F(i) to get R(i) , and it should be L(i-1) …

 

Which means I need to go back and review iterations 1-8 and make sure I didn’t make this mistake earlier.  And if I did, I have to restart from that point, because the math will propogate :/

It may be a few more weeks before this gets posted.  And I still need to figure out a good mechanism for displaying it rather than just table after table.  I may look into some kind of graphical table or something  ; I’d like to do some kind of overlaying of grids to the numbers to show, but that might take some fancy flash and I don’t have flash :o