Sitting All Day is Bad

sitting-is-killing-you (compliments of LifeHacker)

If you a developer, programmer or IT geek in general, sometimes we get caught ‘trying to solve a problem’ that can leave us bound to our desks for a period longer than we would like. Occasionally I find myself developing for up to 3 hours at a time. But this is bad, how bad?

Read the article below:

http://lifehacker.com/5879536/how-sitting-all-day-is-damaging-your-body-and-how-you-can-counteract-it

PS. I’ve downloaded WorkRave and going to start implementing a one-hour schedule.

Don't be shellfish...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrEmail this to someone

[ Does RandomAccessFile cause Lock? ]

This may appear a silly question, but I wanted to know if I opened a file using the RandomAccessFile implementation found within Java would cause an Access Violation if a program externally accessed or edited this file

Logic in my head dictated ‘NO’ it wouldn’t. So I put it too the test, attached below:

1RAF

Here I’m basically spawning a 4 threads to open a file and start getting information from the file.he Thread class implementation:2RAF.png

After running this, and even making an edit to the file via NOTEPAD, this is the result:

1RAF.png

As you can see now ACCESS VIOLATION within my PROGRAM, and even alterations outside the program do not affect the END RESULT, as all the above RandomAccessFile constructs were initialized at more or less similar moment in time, with a snapshot of the ‘textfile’, thus it does not reflect new changes I have made, since the ‘initialization’.

RandomAccessFile fileHandler = new RandomAccessFile(file, “r”);

Ok, enuff said!

Don't be shellfish...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrEmail this to someone

Securing a Mac

I’ve just only started dipping my feet into the world of Mac OS X.

Not too far from grasping all the concepts around the OS, as it’s based on BSD, and yes down to console when trying to secure it, I found the old ‘ipfw’.

A great GUI for Mac OS X is “WaterRoof”, I had great fun in using it, and it’s dead simple – not to mention the handy little tools it has built in.

*rant rant rant – get it*

http://www.hanynet.com/waterroof/

Don't be shellfish...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrEmail this to someone

Different between RegisterClientScriptBlock and RegisterStartupScript

 

RegisterClientScriptBlock Output

    <form name=”form1″ method=”post” action=”Default.aspx” id=”form1″>

<div>

<input type=”hidden” name=”__VIEWSTATE” id=”__VIEWSTATE” value=”/wEPDwUJMjgzMDgzOTgzZGQfI8LfDKmcT0TXZj8jwrxqI6TOIA==” />

</div>

<script type=text/javascript>alert(‘hi’)</script>

 

In the above html snippet, we can see the script embedded before the page controls but after form open tag.

 

RegisterStartupScript Output

<script type=”text/javascript”>

<!–

alert(document.getElementById(‘txtName’).value)// –>

</script>

</form>

</body>

 In the above html snippet, we can see the script embedded after the page controls but before form close tag thus making the script able to access the page controls as I said earlier.

 

Don't be shellfish...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrEmail this to someone