Blog
Java Life Rap Song
This is a pretty funny and yet kinda good rap song about Java (the programming language of course š ):
All blog posts on the front page.
This is a pretty funny and yet kinda good rap song about Java (the programming language of course š ):
I was writing two HTAs (HTML Applications) today and for the first one, I needed to create a VBArray with the number five in it. Fortunately, I remembered that I wrote a page about this prior to my blog. Therefore, here is the snippet which I plan on including in Read more…
Yesterday, I posted about creating String.prototype.indexOfIter() which basically returned a function which would act as an iterator function, indicating the indices of the specified substring. What I neglected to include was how to write this solution using JavaScript 1.7 in FireFox. Today, I bring to you the equivalent using a Read more…
One of the cool things about JavaScript 1.7 is the fact that it supports generator functions. Unfortunately, not all browsers support generator functions yet. Therefore, when creating iterators we can look to an interesting alternative: closures. For example, if our goal was to make a String prototype function which would Read more…
One of the things I think is amazing about VBA is the fact that it is so incomplete in some ways. For instance, did you know that there is no native way to get the local timezone offset. Yesterday I was working on a VBA SOAP plugin for Excel and Read more…
Recently, I have been interested in creating a quick one-way encryption method. After playing around with a lot of different variations, I settled on the following: One nice thing about this function is the fact that you can restrict the encrypted message to a certain length. Another interesting thing is Read more…
Did you know that the bitwise operators always return 32-bit (signed) integers? If you don’t believe me, test out the following examples for yourself:
Recently, I had to create a PostgreSQL equivalent of the Java hashCode() function. In order to do this, I needed a way to make sure that numbers that exceed the INTEGER representation (ranging from -2^31 to 2^31-1) will be wrapped. In JavaScript, this is as simple as using the logical Read more…
The following is a function which returns the chainable version of a function: Here is an example of how to define a pseudo-class which uses this chaining method: Here is an example which shows that the chaining works as intended:
The following prototype function mimics the hashCode() function of java.lang.String in Java: Depending on the version of Java that you are running, what is returned from this function may not be the same thing that is returned in Java. On the other hand, this implementation is computationally equivalent to the Read more…