Java – From a PHP programmers perspective

Java has one heck of a complex “Hello World”, intimidating many away from it. However as I had no choice but to learn it as it was the language of 7/8 weeks of my summer programming class at K-State I had to start using it.

I do not see the “Hello World” that intimidating anymore, for the single reason is that I know what and why all those words are there at the beginning of the file, and the best way for you to get into it is to understand it.

public class HelloWorld {

    public static void main(String[] args) {

        System.out.println("Hello World");

    }

}

The first line is public class HelloWorld. public simply means that from anywhere and by anybody this class can be called. The class simply means that it is a class, as all beginning files in Java will be. The HelloWorld I think should be pretty easy to understand. The second line, public static void main(String[] args)... is a bit more complicated. The public meaning that this method can be called from outside this class. static means that this method can be called without initializing the whole class as an object. void simply means that it returns no value, as methods in the future might, like int or boolean. The next part, main means that this method should be run whenever this program is run, for any Java program to run, there must be a main method. String[] args is probably the strangest part, String is a line of characters, like a word, sentence, anything really. In Java, this [] mean an array, so String[] args means that for it’s parameters it takes an array of Strings. However you won’t deal with this for a while in your Java career. System.out.println... breaks down to System, which is a package (a folder full of classes) and out is a class within the package that deals with output. Finally println is a method (function) which prints the line.

Read more

Ubuntu Tips/Useful things for new Linux people

Reduce all that typing, use the * and ~ command.

As most of you know * is a wildcard, the cool thing is it can be applied virtually anywhere in the Linux Shell. It’s great for being lazy when you don’t want to complete a whole file name.

sudo nano /etc/apache2/sites-enabled/*

That command would edit the sites-enabled file, it is named ( at least on my server ) something strange like “000-default” and instead of remembering that, just put part of it. And a even more known thing is to use a ~ for your home directory, cool thing is you don’t even need to keep it in /home for it to find it.

cd ~/Pictures/May*9

That command would change directory into Pictures in your home directory and go to the folder that starts with May and ends with 9, such as May 2009


Don’t wait for a command to finish, just list them all at once with &&

sudo apt-get update && sudo apt-get upgrade

The command right there is a great command that simplifies Ubuntu updates to just one line, instead of updating ( finding out what needs to be upgraded ) and acctually upgrading the packages. These commands can really be piled on, like yesterday I used the following:

wget http://localhost:8080/ && cat index.html && rm index.html

I would download a file, print it out, and delete it. All in one command. && is great.

sudo mkdir /media/Data && sudo mount /dev/sdc1 /media/Data


Read more

63 Reasons to Love Ubuntu, Linux, and Unix

Intro: Started as 10,20,30 reasons and would add up to 50. There are just too many great things about Ubuntu / Linux / Unix. Look, I sat down to write 50 and Ubuntu ( and Linux ( and Unix )) are so amazing I couldn’t stop until I got to 63 reasons why it is amazing.

11 Reasons to Love Ubuntu:

  • Ubuntuforums.org
  • Simple website, setup, all around simple
  • Apt-get
  • Apt-get
  • Ubuntu Wiki
  • The Ubuntu community
  • Most programs have a special install for it, or at least have specific instructions for Ubuntu.
  • Wonderful built in software
  • 2 Updates a year
  • LTS updates
  • Ubuntu chartroom is great for instant support

Read more

WordPress Update 3.0

I just finished upgrades on the site to 3.0. I have not seen much changes, but it’s always good to be up to date. Just thought I would in form everyone of that.

Just an update

I haven’t posted in a while, so here is an update on what I have been doing:

  • I have installed a gigabit switch and patch panel. It rocks.
  • I have got a server up and running beautifully that my family uses for backups and media streaming
  • I am in the middle of setting up a git server on my server.
  • I have been messing around with RSA and DSA and PGP keys.
  • Finishing up school
  • Prepping for taking CIS 200 at K-State. College class at 15 :D ( Software Design Fundamentals )
  • I have become an avid Ubuntu addict.
  • Can’t wait to get a Macbook.

ObamaCare – Before, During, and After the Fight

What is in this bill?

“We have to pass the bill so that you can find out what is in it.” Speaker of the House, Nancy Pelosi ( D – California )

Now that we have “passed the bill” we can finally “what is in it.” What’s in it? Good question, we have secret deals for Nebraska and other states, we have $500 billion in cuts to Medicare, $52 billion in Social Security cuts, and taking over the loan industry.

Now those first ones are easy to believe, but that last one “taking over the loan industry?” Yes, sadly it is true. According to a March 22 article of USA Today “The government will shut down private lenders, sell expensive loans to 19 million college students and use the profits to finance ObamaCare.”

This bill is loaded with unfair, important-industry-cutting, profiting crap. After just knowing what is in this wretched bill, it should be enough to show you this bill is not right.

Yes, there are some good effects, but it is how we get there. Just like we can quickly solve the middle east problem with a nuke, it’s an unacceptable way of getting there.

How do the American people feel about this bill?

60% disapprove of this bill! And 57% are disgusted at the Democrats way of getting this past, the secret deals, the close door meetings, etc. Since Obama has been pushing this, Obama has hit his lowest rating ever.  These three statistics clearly show most Americans don’t want this, yet Democrats are using crude and rude tactics to get this in. A final, resounding statistic is 11% currently agree with  congress right now. If that doesn’t make something ring in your head, well… nothing will.

Read more

Wiring a gigabit network out of phone lines.

img_3175
img_3166So this morning I got up at 4 a.m. ( yes on a saturday ) and I was ready to go. I have been wanting to get quad-monitors but I had no spots PCI-E or PCI to put in another graphics card. I however had a PCI wireless card that if I could get rid of, I could replace with a dual-headed graphics card.
I was willing to do anything to get a Ethernet line to my room, my dad and I had a plan, it involved going through the unfinished base boards and running Ethernet that way from the heater room. When I was looking for a phone jack to plug the modem into ( for digital telephone, our modem does cable, internet, and telephone all from coaxial ) and I found this wiring that looked like a phone line but it had extra wires. It kept me perplexed for about an hour until I found a website that said most new houses had Cat5E wiring in them for telephone and I knew my house was only about 3 years old so I wondered… I went back and looked at the wire and sure enough it said Cat5E!!

So this is my “make shift gigabit switch and phone switch” as the real 8 gigabit switch and connector pieces are en route. It is connecting my room line and the line to the router as everyone else is yet to get on the bandwagon.

Read more

Dropbox, lots of uses, lots of greatness.

I have decided that dropbox is so cool, it deserves a blog post! The uses for this is endless! I have seen people who keep their application data in here to keep applications synced or people who keep their keedb databases in here to keep them synced too. A really creative idea is to use it to start downloads on your home computer through uTorrent.

The things I use it for are more simple and normal however Dropbox still does a great job at it! Mostly I use it to keep my school papers synced between my desktop, laptop, and my iPod touch so I can work on them anywhere. Also it is extremely valuable with it’s version control system to use it for my code. I just use the free 2 gb version ( but they give out free upgrades and I am up to 2.5 gb ) but 2 gb holds a lot if your not storying videos or music. Also on the iPhone/iPod touch you can have “favorites” which are basically saved locally used for offline situations.

Written from the iPhone/iPod touch WordPress application during first hour at school.

Linux Terminal Twitter Client

Today I was bored so I decided to write a Twitter client centered in Terminal. It’s not a super-client, it’s just plain and simple. It was more of a test of myself. Anyways be looking for versions in more languages, hopefully in Python or Bash in a few days, maybe in Perl someday.

  1. Download & Unzip
  2. Put it into /home/youruser/scripts ( so tweet and twitter and etc. are in that directory )
  3. sudo bash install.sh ( it will try to install php5-curl if you don’t have it, you need this )
  4. . ~/.bashrc ( include the period at the beginning )
  5. setupTwitter twitterusername twitterpassword
  6. You may now use twitter to view the 5 latest tweets or tweet “YOUR Text here to tweet something

Download [tar.gz]

Download [zip]

Download [tar]

Why do people need so much space?

I have been browsing Lifehackers Flickr group, and some people have ridiculous amounts of external hard drives and file servers! They’ll have 6-12 tb. just at their home office! There is no way one person can use that much space.

Example person:

  • 25 gb. of music
  • 25 gb. of power points, word docs, etc.
  • 100 gb. of programs and settings
  • 50 gb. of movies
  • 15 gb. of pictures

Thats more than generous on each part but that only comes out to 215 gb! In my room I have 990 gb and that is more than I could ever use. On my main desktop I only use 200 gb and that includes my game/dvd ripping project and backups!

Holy cow people I don’t see how you need that much space!