30 Days of Geek – Day 4 – Greatest application written to date.

I thought about this one for awhile. Since I’m not exactly the programming type I don’t exactly have one killer application. Really I have several applications/hacks that get the job done, for both home and work uses. Some examples:

  • Dokuwiki hacks
  • Mapping of Cisco work nodes and links onto a Google Earth overlay
  • Network configuration collection scripts, usually with a SVN back end
  • Import of multiple spreadsheets (200+) into one
  • Radio man down to email pager system
  • RSS to gopher script (I used to use this with inetd to provide my blog in gopher form)
  • Various Ti-83 foolery
  • Various Excel to Database conversions (one day people will wake up to them selves and realize that Excel isn’t designed for storing rows of data, but is actually designed for computing and displaying them)

While this isn’t a complete list of all the things I hack up, it gives you an idea of the sort of applications I make. I’d have to say I’m most proud about taking the topology information from Cisco Works and rendering it on Google Earth is my favorite because you can actually the size of the network you manage and looks really impressive. The best part was seeing how many switches and routers you can remember the exact location of.

30 Days of Geek – Day 2 – Preferred programming language?

While I’m far from a “programmer” I do like to hack up solutions to problems. Mostly my code is far from neat and elegant (however sometimes I stand back and go “Wow, I accidentally made that code really elegant and efficient”), but it gets the job done.

In most cases I use python, mainly because it’s really easy to quickly whip something up, and making use of arrays and dictionaries is so god dawn easy. I learn’t python in a short 1 week course at NCSS.

Since most of my programming/hacking work revolves around importing and exporting data in different file types in one time batches, python allows me to quickly whip something up within a few hours with hassle.

While I use python for hacking around, I still prefer to get the right programming language for the software. C and C++ are my favorites for server applications (I always found JAVA and python clunky on servers), and PHP for web apps. I really do wish people programming had more understanding of assembly.

My pet hate is Mono / Silverlight, which Gnome seems to be loving at the moment, along with platform dependent code.

I would like to see a world where everything is programmed solely in Brainfuck, however I don’t think that’s going to happen anytime soon.

Truths

So deep down I’ve wanted to increase my leet points by learning the legendary ASM. While I have learnt a lot of commands and how they work previously, it was mainly for the purpose of working out how a program works and/or breaking it (mmm ASM hacking).

With NASM installed, and a fairly large ebook downloaded, I was ready to go on the journey to increase my leet points. I read A few chapters, about how stuff works, and the basic principals of how computers and memory works, which I already knew was a big part of ASM programming.

I had always wondered how Inputs and Outputs happen in assembly, and I thought this first example was going to show me. To my horror I got (indirect quoting) “It’s to hard to Input/Output in ASM, so we just use a C function that we interface with.”

My instant response was, why should I bother learning ASM, if it’s too hard to interface with Input and Output and requires me to use C anyway. I may as well re teach myself C than ASM.

I’m sure ASM is useful for smaller projects like PIC type of stuff, but I don’t have the hardware for that, so I find no point in learning ASM. I might catch up on some C in the near future though.

Why Linux isn't all around us

Linux has been used in mainly places, used on many server and has tones of advantages, the main one is it’s free. Linux has a fatal flaw though.

It was designed for tech savvy 15 year old boys with no life (trust me, I was one of them). It was never designed to be a user friendly operating system. Linux didn’t just wake up one day and say lets use this on my mums computer. Slowly projects are popping up trying to solvet his flaw and making Linux a popular alternative to OS X and Windows, however it still has some work to do.

Being that the programming for the main programs on linux is decentralized making something that’s going to come together and be good is hard. A lot of forks in code bases occur, where coolprogram become gCoolprogram (or Gnome Program) and kCoolprogram.

With the forking becomes more forking, and even remerging of code, things get sloppy and/or broken. Every single program has a different GUI and look and feel, every Distro has a different command set. Linux was just never made with a home user in mind, it’s targeted at power users. People that don’t call their computer a “hard drive”.

Ps, this is an awesome picture, Peace, Love and Linux.

VB .net

I was helping a friend out with his IPT assignment, which involved creating a educational game in Visual Basic .net 2005. He decided that he wanted to create a simple hangman game, which I thought was a good choice. Oh how wrong I was.

The last time I programmed in Visual Basics was about 3 years ago, and it was in VB 6. This was a big shock to me. The first step was to load a word list, and select a word randomly. Don’t get me wrong there are lots of information on the net about VB .net, but when your searching, it’s easy to pickup bits of information from VB 6. They changed Open filepath #1 as blah to FileOpen(1,filepath, blah) or something, why make the stupidest change.

Next was arrays, I wanted to put every line of the file, as a word in an array. Simple create an array, load the file by line, and append each line to the array. Not so simple, you first have to make a dynamic array, then tell it to resize to the size 0, then add an item, resize it one larger, add another line ect… Just silly, wheres the append function?

Ok, now we can make an control array of labels to display each letter. Oh, no control arrays. A bit of googling says everything is done in code now, and it’s better. Actually for me it was worse. I didn’t want to dynamically create controls, I just wanted 20 label boxes as an array. Now the websites were correct saying it was easy, but it wasn’t easier, and they neglected to say how to make the array. It took me several minutes to find the information required to make them.

The problems just kept coming and hangman took several hours to get to a very light version (no hangman yet).

So here I am thinking, I’m struggling, how is anyone else in this class gonna get this assignment done?

Silly VB .net, there is a really good reason I use python.

Honney I’m Home

Came back from my holiday today :>. Pretty good, I would upload photo’s but I have too many and their to large. I bought a Western Digital 320gb External Hard Drive, which is pretty sweet, and I’m about to catch up with some mates tonight for a LAN. It’s good to see that my server, modem, ISP, UPS, Power, or any cables didn’t pop it while I was gone. I made some pretty useless python scripts while I board in the car too. Here’s the output of one.

‘ ‘ ‘ ‘ ‘
”””””
.’.’.’.’.’
……….
.-.-.-.-.-
———-
-/-/-/-/-/
//////////
/////
\\\\\
]]]]]
]]]]]]]]]]
[][][][][]
[[[[[[[[[[
}[}[}[}[}[
}}}}}}}}}}
}{}{}{}{}{
{{{{{{{{{{
And the code

lol = [” “,”‘”, “.”, “-”,”/”,”\\”,”]”,”[”,”}”,”{”]
line =”
width = int(raw_input(”Size?”))
import random
for a in range(1, len(lol)):
for z in range(1,width/3):
for x in range(1,width + 1):
if x in range(0, width + 1, z):
line = line + lol[a-1]
else:
line = line + lol[a]
u = random.randint(0,len(line))

print line[u:]+line[:u]
line = ”
print lol[-1]*width

Awsome Service Checker

Basic php script that checks ports on your server and reports back to the user. Fairly Simple, havn’t really made the code friendly so it isn’t recommend for people that don’t know php. Here it is. Feel free to do anything you want with it, although a small note to the author (me) would be nice. If you wanna see a demo of it working check out [dead link] . Also you might wanna grab the stylesheet - [dead link] . And here is the sauce/source - [dead link].

I bring you snake for Ti-83

Well, kinda. This is more like the opposite of snake for Ti-83. The idea of the game is to dodge all the blocks that appear and your own tail which is never ending… The code is fairly alright although it was programed over sevral classes so it could be a little bit buggy. Most of the code is spent building the wars and detecting keystrokes, if anyone has a better way to do it please tell me. I find it hard to code clean on these things as  you can’t alot of code and it’s annoying to edit it. No copy and pasta on these things. Anyway here it is, I’ll proberly realse the pretyped up version inwhich you can upload using a link cable later tonight. Oh and same notation as snake, [sto] are the little arrow button and watch out for negatives and subractions.

ClrDraw
ClrTable
AxesOff
For(B,1,94)
Pxl-On(0,B)
End
For(C,1,61)
Pxl-On(C,94)
End
For(D,94,1,-1)
Pxl-On(62,0)
End
For(A,62,1,-1)
Pxl-On(A,1)
End
randInt(61,1)[sto]X
randInt(93,1)[sto]Y
0[sto]S
2[sto]D
26[sto]K
While 1
getKey[sto]K
If K=34
3[sto]D
If K=26
2[sto]D
If K=24
4[sto]D
If K=25
1[sto]D
If D=2
Y+1[sto]Y
If D=3
X+1[sto]X
If D=4
Y-1[sto]Y
If D=1
X-1[sto]X
S+1[sto]S
If pxl-Test(X,Y)=1
Then
AxesOn
ClrDraw
ClrHome
Disp “YOUR SCORE WAS”
Disp S
Stop
End
Pxl-On(X,Y)
Pxl-On(randInt(61,1),randInt(93,1))
End