About TheJoey.Net

TheJoey.Net is the weblog of Joe Casabona, a web developer who attends the University of Scranton, now for Graduate Studies. He is real bad at writing these about pages and hates writing in the 3rd person...more

**The layout is new and there might be some bugs. If you see any, please email me at Joe@Casabona.org

Archive for the 'Code' Category

Facebook

For all the people out there with Facebook, an online social site for college and now high school students all across America, it got some new features. CollegeV2 has an extensive write up on it here, but I wanted to add my 2 cents in.

First is the Facebook API. An API is an “Application Programming Interface,” which basically amounts to developers being able to use some of facebook’s programming to make their own 3rd party applications. What it means is (probably) a bunch of new websites and resources for those of us who have a facebook account. And if you are a programmer, you get the opportunity to create some of that 3rd party software and be recognized on the site. If anyone has any ideas, I’d love to help.

Joseph Casabona's Facebook profile

What you see to the left is a facebook badge. It is a little add on you can put on your website, blog (live journal, blogger, xanga, etc.), or even your myspace, and it displays whatever information you choose to display from your facebook profile. Mine will be added to the about page, and probably won’t change much. It also links directly to your profile.

Finally, Facebook Notes. It’s kind of like a blog, but they aren’t calling it that. You can write notes for yourself, about your friends (linking your friends in the note), add pictures, and import your blog, which I did. It seems like a pretty cool idea, and looks A LOT nicer than the MySpace blog.

That’s all I got! Let me know if you find anything new, or what your thoughts are on the aforementioned in the comments! Later!


After dabbling in PHP for some time, and writing an image upload script about 8 months ago, I would like to post it here, with a short tutorial. I have recently reused the script and a friend of mine asked how he would go about doing such a thing. My upload script, to begin, is a function in PHP that returns the path of the image file, which I then add to a database.

The first thing you must do is set the form up correctly. along with the form name and method (for this, method="post"), you have to specify that you are uploading more than text. Simply add enctype="multipart/form-data" in the form tag. Second, you have to set the permissions on your server to allow uploads. You have to set the Permissions to “777″ or Read, Write, Execute for Owner, Group and Public (or World).

Permissions Image

Now onto the function. While processing the form, all you do is add something like $image= upload_pic($picName);. This calls the function upload_pic(), passing the argument $picName. The following is an image with well documented code explaining what is going on. For some reason, WordPress doesn’t like it when I code right in the post. At the bottom of the post is a .txt file with all of the code in this post.

Upload Image Image

Here is the .txt file with all of the code shown above. If you have any questions, or feel I missed something, be sure to comment on it! Later.


Apr 21

OMG MySpace!?

OMFG

As many of you might know, I was a big hater of MySpace. This was because of all the emo, 12 going on 20 year olds that infest its system, as well as the horribly (HORRIBLY) done layouts. I mean, they break every rule in the “Book on Good Design,” that is- picture as background, a million animated GIFs, embedded music, super wide layout, no color scheme. It’s all wrong!

So, I was going to make it my undertaking to fix it up, and learn how to make it look awesome. However, Mike D. of Mike Industries beat me to the punch. Much thanks to Mike D. for the time he spent making it “web developer friendly,” if MySpace could be such a thing. What I hope to accomplish when I get some time (Lord knows when that will be…) is to make it real cool and add some of my own things to build on top of what Mike did.

What I like about MySpace, after you get through lines and lines of CSS to make it look nice, is the social networking aspect of it that Facebook has. I figure it’s a good way to put my name out there. We will see what comes of it. You can check it out Here. Let me know what you think. Later!


I am not a huge proponent of Javascript. However, I recognize that it is becoming more and more powerful and used, especially since AJAX has become more popular. With a new redesign of one of my sites, I wanted to do something different and cool- so I looked to 24 Ways. There I found a nice tutorial on using the effects from Script.aculo.us. Using that tutorial and some extra programming, I was able to create fading “pages”, which are actually divs we fade in and out.

First of all, you must follow the 24 Ways tutorial. I have made all of the javascript from that tutorial available in this post, and then my modified combo.js. All of my changes occur in that. Once you read that 24 Ways Tutorial, come back here.

So by now, you are familiar with all of the files, and the main functions provided in the combo.js. I took combo.js and modified it a little here:

JS Code

Notice I added a few lines at the top of the function. On top of that I added this to my main page:

JS Small

These codes create and check cookies, which is what I used to check what “pages” were open. When a page is open (when the page is first loaded, it is welcome), a cookie created with the name of that page. When a new page is clicked on, my code checks the cookie to see what is currently open, then closes it. After that, the cookie is rewritten with the new page open. The cookie functions are included in my combo.js. When it is all said and done, we have this. Later!


This semester I am taking a class called Machine Organization and Assembly Language. What this amounts to is learning how to program on lower levels than Java and C++. Instead I am [currently] programing right to the hardware, or one level higher. It’s interesting and in some ways more difficult. While there is a lot to know in higher levels like Java, there is more you have to keep track of in Machine and Assembly. Right now we are using a pseudo architecture called “Pep/8″ which is a simple ‘machine/OS’. It is not actually used, but servers on an academic level to illustrate.

Below is some code at first machine level and then assembler in Pep/8. The program reads in 2 single digit numbers and outputs a single digit answer. For example: 2+2 wouls yield 4, which 8+4 would yield 2. Achieve this, I checked to see if the sum was greater than 9, if so, subtract
10.

04 00 0B 00 00 00 00 00 00 00 0A 31 00 03 31 00 05 C1 00 03 71 00 05 E1 00 07 B1 00 09 08 00 29 C1 00 07 81 00 09 E1 00 07 39 00 07 00 zz

…What that results to in Assembly is:

pep8 assmbly

To give some perspective, in Java, it would look something like this…

{
//read in 2 ints, I and j
int sum= i + j;
if(sum >= 10){
sum= sum - 10;
}
System.out.print (sum);
}

…Later