Sunday, March 27, 2011

It’s Social Time

Announcement time!
Item 1: I’ve begun to “follow” some other blogs. I’ve used them (will use them) in future blog posts, so I’ve decided to give credit where credit’s due above and beyond just linking to them. If you have a blog on blogger and I use you in a post I will “follow” you.
Mind you, I don’t necessary agree with the other blogs on all of their content and I can’t be held accountable for what they post (I’m looking at you Linux Hater’s Blog), but there must be something of value that they posted for me to have “followed” them.
Item 2: I’m going to try to hunt down a free web host to host some source code for the programming tutorials I post.
Item 3: I’m considering doing some news round-ups in the future. Not just technology related news, but any article that I find interesting. I have to decide if I want to do.

Friday, March 25, 2011

Compiling on the Wii: a Lesson in Makefile

Makefiles are files used to make compiling easier on Unix like systems.
Now I know what you’re saying. You’re saying, “Centraldogma, what does the Wii have to do with Make files?”. Well, because I learned it through trying to make some Wii homebrews, so that’s how I’m teaching it. Sure I learned some basics in college, but not the level you’ll see in Open Source.
But, let’s start with the basics. Here is a basic makefile:
all: hello

hello: main.o factorial.o hello.o
        gcc main.o hello.o -o hello

main.o: main.c
        gcc -c main.c

hello.o: hello.c
        gcc -c hello.c

clean:
        rm -rf *o hello

Each has word with a colon after is a rule. all is a default rule, if you create a file called makefile and say “make” the all rule will be executed.
Immediately after the colon is the requirement for the rule to be used, if these are other rules, those other rules will be executed. In this case all requires hello. hello requires main.o and factorial.o. For main.o a file called main.c must exist in the current directory and must be compileable. The same for hello.o and hello.c.
So, all you have to do is have your main.c and hello.c with your make file and type “make” and you get the hello binary. If you want to just make an intermediary, say main.o, you would say “make main.o”.
But lets say your all done, but you want to tar everything up and send it to your friend/partnet/employer/anyone-who-will-look-at-your-code. You have all these nasty binaries and intermediaries all over your directory! Well, we have this other rule, clean, which removes any file that ends with .o and the hello binary. Just say “make clean” and it’s done.

Well, that’s the basics, on to the advanced stuff. That’s where the guys at CodeMii come in, I’ll let them explain it:
A makefile is usually found that the root directory of the source code you have. Take the gamecube template source code example (C:\devkitPro\examples\gamecube\template). In that directory you will see a file name “Makefile”. If you open it up with notepad, you’ll be able to see the different parts of a makefile.
The important parts of a makefile for this tutorial are the following lines:
1.include $(DEVKITPPC)/gamecube_rules
By specificing “gamecube_rules” we are telling our compiler that the source code we want to compile will be run on the gamecube. You would use “wii_rules” to compile for the Wii.
By changing between these two, you are changing which libraries will be used when compiling the source code. Libraries are a bunch of files which we use in our source code to interact with the gamecube or Wii system.
1.SOURCES        :=    source
2.DATA        :=    data
3.INCLUDES    :=
These lines tell the compiler which files should be compiled. Most of the time you can leave this alone as our source code will be in /source and our additional files like images, music, etc will be in /data.
1.LIBS    :=    -logc –lm
This is a very important line as it tells the compiler which additional libraries we wish to use. Say we want to play an mp3 and have the relevant code in our source to do so. If we were to compile our source with the above line, the compiler would complain and say that it can’t find the functions we are using to play an mp3 file. For playing mp3 files, you need to include the “lmad” library.
The LIBS line when we add the lmad library looks like:
1.LIBS    :=    -lmad -logc –lm
The order of how you include your libraries is also important as some libraries may reference other libraries and if you haven’t got them in the right order, the compiler will complain about it.

Tuesday, March 22, 2011

Where I get my Video Games News?

First and foremost, I get my video game news (and more widely, my tech news) from Neowin.net. They’re a small site compared to others, but their good at aggregating. Even if the miss something on the front page, someone in the forums will usually make a post about it.

Next is Neogaf, slightly more opinionated since it’s forum only, but you still can get some news from it.

I usually read Penny Arcade whenever a comic is released and will also read the accompanying blog post. Not a lot of people know about Penny Arcade’s forums, but it’s actually a really good forum for off topic discussions. Read some of their topics on politics and prepare to be blown away.

Then there’s 4chan’s /v/. What can you say? It’s not a particularly good place. It updates quickly, but that’s about 4chan’s only good quality.

Last, but certainly not least, there’s Giant Bomb. Endless entertainment. Their bombcast is good listening. Their Quicklooks, especially their Kinect Quicklooks, provided near daily entertainment. If you have a week or so to kill, watch their Endurance Run. The thing about Giant Bomb isn’t just that they talk about interesting things, it’s that their good at conversations. It’s 4 guys hanging out and talking about video games. Hell, they don’t even need to be talking about video games, they could be talking about dinnerware and it would be just as entertaining because of their chemistry.
Years ago I used to read Ctrl-Alt-Del. But overtime Buckley made less and less comics about actual video games and it became more and more a chore to read his comics. One day, after a particularly bad comic, I replaced the link to CAD in my favorites with a link to the CAD Mock Thread at Somethingawful (it was one of the first links that appears when you google “ctrl-alt-del sucks”). However, due to their extreme advertising (everything from intext ads to pop-ups to blinking banners to embedded ads with video to interstitial ads) that link has likewise become unused.

Friday, March 18, 2011

SSH and Linux


SSH and Linux

Meant to put this up yesterday, but better late than never.

I guess this is my first technical post about programming. Well, not really programming… whatever.

My first experience with Linux went something like this: install whatever the popular distro of the day was, get any additional hardware working right, play around with it for one or two day, then format and install Windows. Because OS that you use really isn’t all that important as long as your familiar with it.

When I went off to college, I got much more rigorous training in Linux (and all Unix based systems) trying to compile code on the lab machines through CLI.  Was like a whole different experience. And I am going to impart some of the wisdom I gained to you my loyal reader (lucky you!).

Something important about Linux: Everything in Linux is a file. Also, see the picture for the breakdown of the directories.
If the place you’re working at supports SSH, your weapons of choice will be PuTTY (for general CLI) and Webdrive (for SFTP file transfer). PuTTY is free but Webdrive will cost you money. There are free software that does Webdrive’s job, but in my opinion, not as well. PuTTY can also be used for tunneling, which can be useful in … circumstances.
ls = list files in a in a directory. Use “ls –a” for detailed info. In case you don’t know –a is an argument to the program ls, you can pass multiple augments to a program as such “ls –a –rf” ect.
pwd = gives your current directory
cd = change your current directory. “cd ..” will move you to your parent directory as “..” represents to the parent directory
. = at is a way to denote the current directory. Say you need your current directory to run your program “a.out”, you’re going to want to say “./a.out
mkdir = create a directory. To create a directory called foo say “mkdir foo”. You can also use –m to specify a mode.
rm = remove a file. You can’t use rm to remove a directory unless you use “rm -rf” to recursively go into each folder, remove it’s condense and remove the folder.
more = print out the contense of a file
emacs = emacs is a popular text editor. Hit Ctrl-X and Ctrl-C to close emacs.
top = displays all the processes running. Like a task manager but CLI.
gcc = C++ comiler. –o tell it what to name the compiled file. –Wall gives you more warnings, but those are just warnings, it won’t break your program. –pedantic –ansi holds the program to stricter standards. –g compiles for debugging with gdb (I never used gdb, though it has some interesting features, I stuck to printf’s and getf’s to debug when I couldn’t use a proper IDE).  So the whole thing would look like “gcc-o hello hello.c –Wall –pedantic –ansi –g
tar = –cvf creates the archive as such: “tar -cvf file.tar file1 file2 file3” tars file1, file2, and file3 into file.tar.  –xvf untars a tar file.
scp and sftp – in certain cases, you won’t be able to use Webdrive or your SFTP client of choice. Use scp to send files, sftp to get.

Monday, March 14, 2011

My Favorite Anime

I was going to post this a little later, but given current event this feels like the best time to post this. Here is a list of members of the Anime community that have checked in. Now, on to the post:
People have the incorrect assumption that anime is a genre. Even some people who consider themselves anime connoisseurs sometimes hold that anime is fundamentally better then other media. This is simply not true. Anime is a form of media, not genre.
I don’t like crime dramas, therefore I don’t watch the Ghost in the Shell series. Although I do like the movies.
Anyway, onto the minireviews.

One of my favorite pieces of media is FLCL. It is pretty mainstream and you will see pieces of it from time to time on Adult Swim. But, if you ever have time to sit down and marathon it all the way through, it is a totally different experience. One of the things that makes it so amazing is just how Gainax chose to animate the OVA. They chose to use FLCL as a kind of test bed for their animating techniques.

Studio Ghibli films are always amazing. I could list them all. The scenery is always amazing and the stories manage to hold their own. But my favorite would probably be Castle in the Sky. Nausicaa (made before the studio’s founding) is also great, and you can’t help seeing the similarity with Avatar after seeing it.

Next is Now and Then, Here and There. This one is extremely depressing anime. That’s not a bad thing; it tries to be depressing, and it succeeds at it. If you have any emotion in you, this will get to you. From what I recall, the art was very nice in this one. But I watched it years ago, so don’t take my word on that. This anime explores the horrors of war, it has some sci-fi aspects, but that’s not the focus of this anime.
If you are interested in anime I would suggest you check out Anime News Network’s anncast. Although they do have a habit of going off on long rants about piracy’s effect on Anime.
I could post some more reviews of anime, or any form of media, if you would like, just let me know.

Friday, March 11, 2011

Quick Announcement

Quick announcement and a bit of insight into my writing:
Ads should now be turned on. Like I said I’m unemployed, so every dollar matters.
As to my writing style, when I write formally, which I’ve been told I’m quite proficient at, I write in phases. Phase 1: Thesis sentence; Phase 2: Topic sentence for each paragraph; Phase 3: fill in the introductory paragraph, add thoughts or evidence to the topic paragraphs (one or 2 sentences per thought), add concluding paragraph; Phase 4: if I’m writing to fill a certain number of pages or make a certain number of words, I’ll go over the paper and add new thought based off of old and make sentences longer; Phase 5: proofread
But in this blog, I won’t be writing formally. I won’t have a thesis or topic sentences. And I certainly won’t be doing Phase 4, as I don’t want you all to fall asleep. But I do have some 1 or 2 word thoughts I jot down prior to writing out my posts.
Finally, here’s some future posts I plan to make:
SSH and Linux
Where I get my Video Games News
Compiling on the Wii: a Lesson in Makefiles
My Favorite Animes
Why US TV Sucks?
Creating a DLL

Thursday, March 10, 2011

What's in a Name?

I guess the first thing I want to post is to explain my name, Central Dogma.
The nerdy among you will recognize it from the anime Neon Genesis Evangelion. Central Dogma is Nerv’s headquarters in the GeoFront. Neon Genesis Evangelion is an often misunderstood anime. People go in expecting an action packed mech adventure. And you do get some of that for the first few episodes, but the series is really about the mental state of people under mental stress. That’s why people come away unsatisfied after the last 2 episodes.
But that’s not why I chose Central Dogma. Anyone who’s taken a biology class will also know the term Central Dogma. It describes the transfer of genetic information from DNA to RNA to Protein and how DNA can be replicated.

I’ve always been interested in genetics and I could go on for pages about the intricacies of how the tiny little machines in each of our cells works and the neat probabilities they cause to occur. About how it fits together and “Just Works”.
And besides Central Dogma is probably the coolest name biologists came up with, well second coolest.

Wednesday, March 9, 2011

The Wordsmith Cometh

Hello everyone. This is my first blog. I used to have an old Geocities site. And like all Geocities sites, it was awful. I also have a Facebook, but I rarely make post on it and it was never built for long, thoughtful posts like I plan on making.
I guess I should explain who I am. I’m a recent college graduate (read: unemployed). I majored in computer science and minored in biology. I like to think I have acquired a good amount of knowledge in those fields. But my studies also touch on other subjects: environmental science, sociology, and the arts.
What is this blog about? Well, I’m honestly not sure. I could impart some of the knowledge I have acquired through my studies: programming tips and intricacies of the human body. Maybe I will share with you my views on things that I’m admittedly a novice in, but still have an interest: politics, economy, society, physics. Or how about something more light hearted: my favorite TV shows, anime, movies and video games.
So, tell me what you would like. I am your open book. But, I don’t imagine I’ll get many comments since this is my first post, but that’s alright. I’ll just improvise.