Tuesday, January 26, 2010

LISP, why bother with parentheses?


Mostly because it's fun, and it will make recursion your best friend!

I just started learning R5RS Scheme and it's kind of awesome, I started noticing all the little things in my program, started using recursion and made a little pow function -.-


(define  loopow
  (lambda (count x n xpow)
    (if (< count (- n 1) )
     (loopow (+ count 1) x n (* x xpow))
     (abs xpow))
     )
   )
(define (pow x n) (loopow 0 x n x))


Having to call the function from another function was a shock for me, I'm not used for it in C, but the complete product is pretty awesome and I'm proud of myself being able to write it.

Recursion FTW!

Saturday, January 23, 2010

List?!



I've got some people coming to me and asking about lists, they have a certain difficulty to
 understand lists when all they got was the theory and some weird-looking illustrations.

before you continue reading, if you are totally clueless about what a List is you can check out these sources-

A.) in case you know Hebrew as your mother-language you should check out this blog post->
Snir David's Blog, Data Structure Explained (Hebrew)

B.)or go to good ol' wikipedia and check out what a list is directly->
Wikipedia, List(computing) (English)



not really helping is it? ?! O_O
well I'm here to make things a bit clearer.
for all of you not-computer-scientists/software-engineers out there, the list illustrated above is a doubly-linked list, the same as the one I will be showing you if you keep on reading...

So what do we have thar?
harr, harr, harr
No, really...
The first node to the left(box with an x on it-  [X])  is the left endpoint of the list, you can see it is an endpoint by it having only one connector, connecting from the node to it's right.
the endpoint does not contain any value, and is just there because every node in the list can be described as

Monday, January 11, 2010

Winsock Wrapper


A little winsock wrapper library I made, you can get all the files (static lib, VS project and .cpp/.h )
right->here<- including a "how to implement" file called "a.cpp".
Two different versions (get both the SauceCoed.cpp file that weighs the most and headher.h file that weigh the least in KBs)
 

Sunday, January 3, 2010

C++ killed the file I\O star.

I am currently working on a big C/++ PDF tutorial for some stuff including writing a kernel in C, File I/O, and basic binary encryption.

So prepare to be amazed!

(about the header, ifstream>>shit vs FILE *;  get it? huh? well you will if you don't by now, by reading my upcoming paper about C/++ and why I just prefer the C way of getting shit done).