Monday, August 23, 2010

creating a binary packet file (windows)

Step 1: fire up wireshark and start sniffing

Step 2: find a suitable packet to modify, right click -> copy -> Bytes (Hex Stream)

Step 3: use a hex editor to create a new binary file, and paste the hex stream into a new file. (I used XVI32)








and there you go! a fresh new binary file you can use for transmission as a frame. you can edit the package using the hex editor; with a little experimentation and hex calculation, there is the potential for lots of fun! :-)

Tuesday, August 17, 2010

Netlogo olympic logo

Just a little olympic netlogo-ing to de-stress
:P

to setup
clear-all
ask patches[
set pcolor white
]
create-turtles 5[
set ycor 0
]

ask turtle 0[
set xcor -12
set ycor 3
set heading 180
set color blue
]
ask turtle 1[
set xcor 0
set ycor 0
set heading 0
set color yellow
]
ask turtle 2[
set xcor -3
set ycor 3
set heading 180
set color black
]
ask turtle 3[
set xcor 9
set ycor 0
set heading 0
set color green
]
ask turtle 4[
set xcor 6
set ycor 3
set heading 180
set color red
]
ask turtles [set pen-mode "down"]
end

to move-turtles
;call forever
ask turtles[
lt 16
fd 1
]
end

Wednesday, June 16, 2010

trying to bake on windows, but unseralize being wierd?

Notice (8): unserialize() [function.unserialize]: Error at offset 0 of 1519 bytes [CORE\cake\libs\cache\file.php, line 178]
Notice (8): unserialize() [function.unserialize]: Error at offset 0 of 28 bytes [CORE\cake\libs\cache\file.php, line 178]
Notice (8): unserialize() [function.unserialize]: Error at offset 0 of 5 bytes [CORE\cake\libs\cache\file.php, line 178]


modify cake\libs\cache\file.php, trim $data before serialize and unserialize functions:

$data = trim($data);

at line 177 and line 135



Monday, March 15, 2010

Study:Money

I recently spoke to a very good friend of mine, who introduced a concept i found difficult to grasp: the study to money ratio. He more or less justified his academic pursuits on the potential monetary return for the particular field/subject/course. This approach does indeed make alot of sense, particularly in an environment which nurtures the "money making" side of life. Without a doubt, money is important, and more of it implies a more comfortable life, however I am never in agreement whenever someone makes an academic decision based on profitability.
The do what you love vs do what makes money discussion is one i've often made a fuss about
. essentially, everyone has a decision to either do primarily what they love, or to primarily do what makes money.
Recently I was looking at a Harvard CPL video (http://www.youtube.com/watch?v=y5I_cnpP99U), in which Michael Porter provided some interesting insights on the nature of profitability. Apparently, it has nothing to do which field you decide to compete in. He went on to say what does make a region competitive and profitable is not what it does, but how productive it is. He noted that if a region is highly productive, it is prosperous, and it does not matter what field it competes in. Productivity breeds expertize! if a region produces large amounts of a product, chances are it would have come across and solved alot of problems related to producing that particular product. (a good example is Trinidad carnival, truuust me, the guys in charge know how to organize an event)
I've learned that with some concepts, the macro level can be applied to the micro level. Let's say the macro level in this case is a region as Michael Porter is speaking about it in the video. The micro level might be each individual. He does indeed mention that if your employees are highly productive, and provide greater value on the dollar, you can obviously afford to pay them better. going just a little further, it only makes sense that if you spend every day of your life knitting sweaters, after 10 years you'll be one hell of a skilled sweater knitter. but what kind of nut would spend 10 years knitting sweaters?? the nut that likes it! that particular nut will have to have some deep passion for knitting sweaters that allows them to do so continuously for this length of time. very few other persons will be as good as they are when it comes to knitting sweaters, and they would have a high-quality product which is hard to reproduce, meaning they can sell their sweater for big $$ (if they wanted to)
so let's re-examine what we know so far, being profitable is directly linked to being productive, regardless of the field; if you're going to be very productive in a particular field, it helps if you have some passion for the field.

In summary, do what you love, and profit will follow. :-)

Tuesday, February 16, 2010

idea!!

some new kind of tag that tells you what questions are answered on a specific webpage, at what points in a video etc..

people are always asking questions, so if tags are formed in that way it might be easier for people to find answers

Saturday, February 6, 2010

c++ to java

you know, every time I tell someone that I'm converting a c++ application into java, I usually get lectured about java being invented to solve all of the shortcomings of c++, yet i still find great difficulty in expressing certain c++ concepts in java. For example, I can't make an unsigned int in java, and when i see code like this:

typedef unsigned int a

typedef unsigned char c;

unsigned char *B;

B=(c*)calloc(a, 1);

I practically soil myself. not only do i not have unsigned ints in java, so in order to match the max value i have to use a long. So instead of a 32-bit variable, i'm using a 64-bit variable. The code above presents another problem; i can't exactly give a java array a long index.

Not kool! Just thought I'd vent about that for a bit. If anyone has any ideas about how to convert this to java, let me know!