Results tagged “javascript” from SweetFriday

For a course I was taking part-time at Ryerson University, I had to use the Processing language to create a 2d animation. I wasn't keen on Processing at first because the language looks like Java but it isn't that bad because Processing lets you avoid the Java stuff by supplying its own functions to use.

JavaScript, jQuery and DNA

|

For the past few days I have been fixing up a website that my cousin found. He was working on some biology/technology homework and was tired of writing out DNA sequences, manually converting them to RNA and then searching through a table to find the amino acids that each trio of letter corresponds to.

Using jQuery and JavaScript magic, I came up with this. It converts DNA to RNA and then finds the amino acids in the sequence. The conversion between RNA and DNA takes place while you type, but you have to click to get the amino acids.

The whole thing is a single HTML file with 3 JavaScript files and a stylesheet. The JavaScript is divided into three categories; data, logic, and views. The data.js file contains information on amino acids. The logic.js file has code that deals with the conversions, and the views.js file has code for displaying the results. The amazing thing is that all of this works in Internet Explorer 6, Firefox 3, Safari, etc. Note: there are other JavaScript files included but they are for the fancy effects in the views.js file, they aren't part of the core logic of tool. The advantage is that the whole package is self-contained and you can copy the folder over to a USB thumbdrive and use the tool on any computer that has a web browser installed. You don't even need a web serrver.

The code is available at GitHub and is licensed under the MIT License.

Today is ShoesFest and I am going to be trying to learn more about Ruby and Shoes but at the same time I will be hacking away at JavaScript and Java, improving Sandals.

That's the big surprise: Sandals. Sandals is going to be a clone of the Shoes toolkit except it will use a Java back-end named BeachHouse. The primary reason for this is because I need to practice my Java'ing, and the secondary reason is that I hope to eventually have JRuby and Jython using BeachHouse. So BeachHouse can be found in the beachhouse/ sub-directory of the Sandals source code package.

Unfortunately, Sandals uses Java's Swing components for some parts but I'm going to try and code up my own drawing methods for the tricky things that Shoes can do. We'll see how that goes later on today.

Happy Shoes hackin'

Links:

Squeak Break

|

I have taken the last two days off as a break from writing Java and JavaScript, and finally took a proper look at Squeak. It is impressive, and similar to working in Emacs in some ways (though much cooler).

The greatest feature of Squeak, and Emacs (and Lisps), is that the documentation for the language and environment is always around and accessible. If I don't know how a function works in Emacs or which methods an object has in Squeak, I can look it up while working in them. This has saved me from asking many stupid questions on the #emacs and #squeak IRC channels, heh.

Anyway, the break was needed because JavaScript reminded me of Scheme, and I had forgotten how horrible coding in Java can be (e.g. RedundantType x = new RedundantType...). Squeak's user interfaces may inspire Sandals in some ways, we shall see.

Check out the Squeak Language Reference

Lying on the Beach

|

Lying on the beach,
Sun cooking my bacon,
Putting on sandals, sifting sand,
I'm building a beach house today.

Oh, the ocean glows.
Can you see it now?
Guitars, surf boards, dancing people!
Party time on Java island!

Find recent content on the main index or look in the archives to find all content.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by Movable Type 4.1