Saturday, March 31, 2012

Starting off in Minecraft

For a quick change from the seriously themes posts of this blog I will take the time to write an in-depth guide to the first few days of minecraft and beyond. This will be a work in progress, so check back for updates. Information on installing minecraft or working with mods cannot be found here, so for help on those subjects consult other documentation. This is simply a guide to playing the game, and having fun.

Day 0
This is your first day of a new world (in survival, we will assume this entire tutorial is in survival mode on normal difficulty). If you spawn in an ocean, delete the level and reseed. Daytime lasts about 10 minutes, so you don't have much time to make the crucial few decisions that will govern the rest of your life in this level. Here are what those decisions should be:

What playing style do I want? If you are the type that prefers much scenery, try going for an extreme hills biome. If you prefer a solid building environment, seek out a desert. If you like to live underground, go anywhere but a desert or swamp. It is up to you to make the decision, as moving your house will be harder than just moving the blocks as you will read later on.

What resources do I need? If you like building with wood, your biome of choice should be a forest. In contrast, if you prefer a harsher living style like an igloo, seek tundra. Availability to wood is a must, but it is up to you to decide how much you will really need; 128 blocks should be all you need to start off.

Once you are decided on what playing style and resources you need, go to that area. Your first objective: punch trees.

Trees will provide you with wood, which you can drag into your 2X2 crafting square to create wooden planks. Fill the 2X2 crafting square with 1 wooden plank in each square to create a crafting table. This will give you a 3X3 crafting space. Set the table down on the ground. In case you did not know, this is called placing a block.

Now, turn half of your wooden planks into sticks by right clicking your pile and left clicking a crafting grid pile. Next, right click the sticks in the crafting grid and left click in the crafting box under the sticks. You should have nearly half-and-half. Now, hold shift and click the sticks. You will use these to craft your second item.

If you can't tell, crafting grids are confusing. From now on, I will refer to them in a battleship-esque format. The left row, reading up will be a, b, c. The bottom row reading right will be 1, 2, 3. The creation box will be referred to as 'e'.

To craft your first pickaxe, place a wooden stick at a1 and b2. Then, place wooden planks at c1, c2, and c3. Collect  the pickaxe from E and place it in your inventory. If you have no already found out, you can use a scroll wheel to scroll through your items on your hotbar. With the pickaxe, mine through the first layers of dirt (may vary depending on biome) until you encounter a gray stone. This is called stone. Mine this with the wooden plank. When mined, this block is known as cobblestone. You can hold 64 cobblestone and 64 stone, but the two do not stack with one another despite coming from the same block. Collect 3 cobblestone and return to your crafting table.

Now, use the same formula from above but replace the wooden planks with cobblestone. This will create a stone pickaxe. Stone pickaxes are what many miners prefer to use, since items will break and stone is plentiful. It is recommended that you build more tools, so go mine quite a bit more cobblestone.

Follow the formulas below to manufacture all the tools you will need.

Shovel: stick at a2 and b2, cobblestone at c2.

Sword: stick at a2, cobblestone at b2 and c2.

Axe: Stick at a2 and b2, cobblestone at c2, c1, and b1.

Shovels are used on dirt, gravel, and sand.

Swords are used on most blocks for double durability and mobs.

Axes are used on Wood, wooden planks, crafting tables, fences, beds, jukeboxes, note blocks, pistons, and anything made of wood.

Now that you can the items, mine up some of the most plentiful resource around (usually dirt) to create a makeshift home. Right click to place the blocks in a 3x3 square around you with the middle hollow. Build the walls. This will become your home for the night, unless you are experienced enough to fight. Fighting will earn you experience in both senses of the word, but is also risky and may result it death. Do it only if you have already made a sword. Wait out the 7 minute night in the dirt hut, watching the enemies walk by and slapping any spiders that ascend the walls. The hardest has past, now the real game can begin. Wait until morning when all of the mobs burn off. Fun fact: The reason that mobs burn in sunlight is the amount of light is powerful enough to do so. In theory, a strong enough artificial light could provide the same result.


Day 1
This is the first true day of minecraft. Destroy your makeshift hut and begin building your true home. Leave room for addition, however, because later in the game you will need a good amount of room. You can start by building the walls (larger, 10X10 is a good start) out of dirt, and replace it later. Your focus for this day is getting the frame of the building up.

Use your shovel to mine dirt and place it along the perimeter that you want to build on. Being at the same height is recommended, and if it is not you can destroy the higher areas inside the building later. At this time, all you need to do is make a 2 block high wall. You have more important things to worry about.

Using your shovel, dig down through dirt somewhere and into the cobblestone layer a few blocks. Now, mine the blocks with your pickaxe until you find a block with red spots in it. This is iron ore and it usually occurs in veins, so mine all of the nearby blocks and build out of the hole with the extra dirt you have, as you will need the cobblestone to build a forge.

To build a forge, you need at least 9 blocks of cobblestone and a crafting table. Place the cobblestone along the perimeter of the crafting grid to create a furnace. This should go right by your crafting table for convenience when smelting minerals. Place wood, not wooden planks, in the block below the fire symbol and the iron ore in the top to supply yourself with iron ingots. You must have at least two. Now, place them diagonal to one another on a crafting grid to create a new tool, called shears.

Shears: Leaves, wool, and harvesting wool.

Now, you must find sheep to harvest wool from. Right click the sheep with the shears to harvest wool. You will need this wool to create a bed to pass the night by.

 Personal fact: During my first few hours in the game, I thought the sheep were gorillas.

Now, head back to your home and go to your crafting table. Place the wooden planks on a1, a2, and a3 and you wool on b1, b2, and b3. Take your bed from E. You can deploy this bed in a safe place so that at night you can sleep. If you don't have a wall at least 2 blocks high, build another small hut within your home and place your bed inside of it, since monsters can jump over the 1 block high walls.

It should be nearly nighttime by now, so prepare to use your bed. If it's not, the best way to pass your time is to build the walls on your home.

The two hardest days of the game have passed. Tomorrow you will begin looking for a cave system, learn to identify minerals, and continue construction of your home. You will also learn about the different types of mobs and traps located throughout the underbelly of the world.

Day 2

From this point on, how you build you home is your own judgment. However, you will want it to be bright and have a roof or overhang. The reason is the mob mechanics, which I will talk about in this chapter.

There are 3 core mobs, zombies, skeletons, and creepers. In addition, there are endermen, ghasts, blazes, snowmen, octopi, silverfish, and slimes, but they play a lesser role.

 The zombie is the most common mob and recently underwent a large makeover in terms of artificial intelligence and difficulty to destroy. It can break wooden doors, evade dangers, and of course attack. Its attack is short ranged and you must make contact with the zombie to be attacked. The point is to attack it BEFORE it attacks you.   

Skeletons are the hardest mob and, in my opinion, they're unrealistically accurate with their bow. They launch long range attacks, so having a bow with some arrows is recommended. To make a bow, place wood at a2, b1, and c2. Now, place string from spiders at a3, b3, and c3. Arrows are made using feathers at b1, sticks at b2, and flint from granite at b3. The best strategy for besting a skeleton is to use the bow, but using a block to block attacks is also an acceptable method.

Creepers are arguably the most famous of the mobs. They blow up when you get close and WILL destroy their surroundings, so do not fight them near any of your creations or near a narrow ledge (they will destroy the ground under you, causing you to fall to your death.) Use either a bow or a running sword strike to knock them back. You can never be too careful with a creeper.

At first I thought mobs only came out at night, but that is incorrect and can sometimes become a costly mistake. Mobs spawn in darkness, so you must make your home and yard as bright as possible to prevent spawning. There have been many instances where I will walk into the main section of my home only to be met by a zombie or skeleton fire.

One of the darkest places on the world of minecraft are caves, naturally occurring underground structures where ores and other minerals are common. There are a few kinds of caves, including ravines and mining shafts, but they all pose similar threats.

Caves
You should look for an opening to a cave, which is a dark mass of stone where shadows appear at the back. This is a good place for a sub-base with mining carts and chests, but some just prefer to walk to their caves or build tunnels from their home to the cave. One of the hardest features of the caves are the sub-caves that branch into more subsystems. It is INCREDIBLY easy to get lost, so there are some strategies for navigating them.

I always place torches (which are vital, sick at a1 and coal at a2) on the right side of the cave so I know which way I came. Still, this can be confusing and I sometimes find myself walking in circles. Much like on Earth ores will deplete from mining, so after a branch has been mined dry, close it off with cobblestone completely to reduce the amount of branches from the main mine. This simplifies things greatly. Placing signs along the way is the best way to navigate, but it is incredibly costly. If you have the wood to spare, making directories is truly the best option.

The types of minerals available differ depending on your depth. When you hit f3, the y: variable will tell you your depth, with 64 being ground level and 0 being bedrock. Diamonds normally occur at about y:12, so one strategy is to try and stay that deep at all times. Iron should be your primary concern when mining, and that can occur at nearly any depth. (I've seen veins at ground level, although that's extremely uncommon.)

"Never dig straight down" is a saying in minecraft that means what it states, and I can back it up; don't do it. Digging into the unknown has lead to many costly deaths, ones where I had an abundance of diamonds that the lava or cave I fell into and died in took from me. Always dig using two blocks, using one to stand on. Also note, you will need an iron pickaxe to mine diamond and diamond to mine obsidian. Obsidian won't be important for a while.

The two structures of caves I mentioned earlier, the mining shafts and ravines, are important. Ravines are a somewhat new addition to minecraft (beta 1.8, The adventure update) and an extremely useful one. They are large gaps, sometimes up to 1000 square blocks large with two levels, stocked with minerals and subsystems. Mining shafts are structures that have an increased chance for having minerals and are the only way to find railroads naturally. They can occur within one another, and finding them is a wonderful thing so momentous that you may consider moving your home to move closer to it. In my most recent level, Sanctum, I use a single ravine as my entire mining base and I was lucky enough to find what I call a supersystem. They are common, but mastering them is an extremely lucrative practice. Supersystems are simply interconnecting ravines, mining shafts, and caves that create a large mining area. In my supersystem, I have two intersecting ravines with a mining shaft moving along the top, and EXTREMELY rare and helpful structure.

The last structures are dungeons and strongholds. A dungeon is a room made of cobblestone and mossy cobblestone. This is the only place where mossy cobblestone occurs, so mining the floor from dungeons is useful. In the center, there will be a cage with a rotating mob inside of it, and it will spawn whatever mob is shown inside of it. You CAN place torches on the spawner, and doing so is recommended since it can reduce the amount of mobs that can spawn there. Strongholds are enormous structures that contain a portal to the end, as you will read about in day 3.

When leaving a cave, you can either trace back your steps or build a staircase out of the stone. Be careful when building a staircase, though, and if you have a sign, ladder, or door place it at the bottom to stop any water you may find. Resurfacing in foreigns territory is common, which is another reason why lighting your home or building large towers is good practice.

Now that you have explored caves, it is time to worry about the rest of your life in minecraft: eating, advanced building, and interesting little tricks.

Day 3 - The last day before the rest of your lives
I have left a few things out of this guide, and day 3 is where you will worry about them. You may have discovered them yourself already, but now is when I will officially introduce them. I will talk about eating, the Nether, the End, and little building tricks.

To eat, you have to find food and hold the right mouse button, similar to drawing an arrow of a bow. Common food includes bread, fish, and mushroom soup, but I prefer fish since it's a fast-paced food for farming.

 To make bread, you must first have a hoe (sticks at b1 and b2, iron at b2 and a1) to prepare dirt and seeds from destroyed grass. Till the ground with the hoe by right clicking it, then place the seeds. This will create a wheat plant. After a few days, the wheat will be ready for harvesting (it will turn amber), so left click it and harvest the additional seeds and wheat. Bread is made using 3 wheats in one row of a crafting table.

Fish is farmed using a fishing rod (sticks at a3, b2, and c1. String at a1 and a2.) Right click it near water, and it will bob when a fish finds it. When it is raining, the chance to catch fish is increased, so make good use of the bad weather. After you catch raw fish, you should cook it on a furnace to make cooked fish.

Mushroom soup requires wooden bowls (wooden planks at a2, b1, and c2). You can harvest the juice from mooshrooms (a special type of cow found on mushroom isles) or use a crafting table to add a brown and red mushroom to the bowl. The mushrooms are found deep underground in low levels of light, but can be farmed in low-lighted areas.

There exists a special place called The Nether. Here, lava and the devilish netherrack is common. Ghasts fly in the air and launch explosive attacks against any intruders that enter the territory. Building the portal there is not straightforward, however. Using a diamond pickaxe, you need to have about 13 obsidian and a flint&steal(flint at a2, steel at b1). Place the obsidian in a 4X5 frame and light the inside on fire. When done correctly, it will begin to sparkle. Step inside and you will be transported to The Nether. In the Nether, there is an easy-to-mine rock called Netherack that will retain fire forever, so it is common in decoration. There are also nether fortresses for experience, and gold can be found here by killing the mobs.

Interesting Fact: If you make another Nether Portal in the Nether and exit through that, you will appear 8 times the distance from the original portal to the new portal in the overworld. For instance, if you made a portal at 0 in the overworld, and walked 4 feet in the nether, you will appear at 32 in the overworld.

The End is the end of the game. It involves fighting a Nether Dragon on a comet in outer space. You must collect eyes of ender from enderman to reach this place, and you must find a nether portal inside of a stronghold. Strongholds spawn a good distance from the spawn point of the level.

Various Tips - A work in Progress
These are tips that I find useful for Minecraft. I will add more to this section periodically, so check back. This part is not a tutorial, so experience is implied.

1) An automated cobblestone machine can be made using lava, water, and a flip-flop such as a rail. It will generate strings of 16 cobblestone.

2) Stairs can be placed upside-down for decoration.

3) Light penetrates stairs, but mobs cannot.

4) Grass, wood, and stone all affect the way a note block plays.

5) Velocity is not lost due to spider webs, so once you leave you will exit at the same speed you entered. (think: portals)

6) A fishing lure that bounces off of something can still catch fish. What some people do is have a "bumper box", a block of wood in the water near shore to decelerate their lure, making it land closer to them.

Sunday, March 25, 2012

10 must-have programs for gnu/linux

I have used GNU/Linux for over a year on various distributions. I have done everything from edit text, programming, gaming, emulating, and modifying the look and feel of the desktop environment. To do so, I used a variety of useful tools which I will list below.

1 - GNU C Compiler

The GNU C Compiler, or GCC for short, allows you to compile programs written in the C programming language with gcc and C++ programming languages with g++. Non-programmers will also benefit from having gcc on their system, since a lot of the software mentioned will not come in a compiled package, so you must do it yourself.

sudo apt/yum/equo install gcc

2 - Firefox

Although not specific to gnu/linux, firefox is arguably the best web browser available. Firefox is free and open source, so anybody can edit and modify it to their needs. Firefox is also built on top of the second best plugin framework around (first being Eclipse), so it is highly extensible.

sudo apt/yum/equo install firefox

3 - Terminator

sudo apt/yum/equo install terminator

On most distros, xterm is the default terminal emulator. Terminator is a new terminal emulator with much added functionality, such as terminal groups and broadcasting.

4 - The Libreoffice suite

The Libreoffice suite can be seen as the open-source version of the Microsoft office suite, allowing the user to create presentations, documents, spreadsheets, databases, and drawings. Downloads are available at their website.

www.libreoffice.com

5 -  zsh

Zsh, the Z-shell, is a replacement for BASH, the shell that is commonly found on Linux systems. Zsh brings multiple improvements to batch, especially with its advanced tab completion. Some of the attractions to zsh are its portability (since it doesn't rely on external programs), its backwards-compatibility with BASH, and the way it handles tab completion.

sudo apt/yum/equo install zsh

6 - GIMP

GIMP, the GNU Image Manipulation Program, is a photo editing program much like Photoshop. A debate continues to this day over which is better, but the fact that there is even question over which is superior is a telltale sign of GIMP's functionality. In the next major release, GIMP will become much easier to use and add additional features. That version of GIMP is available on Github right now.

sudo apt/yum/equo install gimp

7 - Avast Antivirus

Avast offers a free (gratis) antivirus program that can scan Linux systems for viruses. Although Linux is a very secure operating system, it has it's security holes. The primary usage for avast isn't for scanning your own system, but for scanning files you are planning on giving to another person.

www.avast.com

8 - vim

Vim is a text editor that runs from the command line. It is a vast improvement over its predecessor, vi, in multiple ways. It supports plugins, has syntax highlighting right out of the box, and has a more logical (and less painful) command system than emacs.

sudo apt/yum/equo install vim

8 - tint2

This program may seem trivial, but if you are using another dock such as gnome-panel or cairo-dock you may want to check this out. I used to use docky, but it was heavyweight and requires composting. Tint2, in contrast, is lightweight, simple, and attractive. It could also save you some time. Right clicking on a window will close it instead of bringing up a menu.

sudo apt/yum/equo install tint2


9 - mplayer2

Whenever I'm not doing something that requires too much concentration, I listen to music. Although, I found myself wondering why I needed a GUI to do so. mplayer2 allows you to play music and watch videos from the command line. It also supports playlists and streaming.

sudo apt/yum/equo install mplayer2 


10 - Links2

While we're still on the theme of command line applications, I must mention links2. Links2 is an improvement over links and lynx, and allows the browsing of the web through the command line. In addition to browsing, links can also handle the downloading of files. With links2 there is also an extremely fast, graphical browser that supports pictures.

sudo apt/yum/equo install links2

There are programs  I have not mentioned that I use every day, such as picasa and code::blocks, but I did not mention them since they wouldn't appeal to everybody.



 

 

Saturday, March 17, 2012

Sabayon GNU/Linux

Gentoo, one of the most powerful Linux distributions around, has a reputation for being extremely hard to install and use. Sabayon makes it easy, coming with graphics by default and the Anaconda installer. Sabayon retains the functionality of Gentoo and portage, but also introduces some new features, the most noticeable being the Entropy package manager. Note that all the below information pertains to Sabayon 7

Entropy
Entropy is the binary package manager for Sabayon. It installs binary packages that the sabayon build server compiles from the portage tree, much like yum or apt could. Gentoo is a source-only distro, so this is a vast improvement if you have little knowledge of compiling packages. To invoke Entropy use the command equo. Equo has a beautiful command lines displays which are fully colorized for quick interpretation. Equo automatically handles dependencies, so installing a package is as easy as invoking equo.

Sulfur is the graphical interface to equo. It is not install by default, so you must use equo install sulfur as root to install it first. Then, you can use the sulfur command to start the package manager or use the "Entropy Store" link on your desktop. I would highly recommend the advanced mode that sulfur comes with as the non-advanced is a bit simplistic.

Remember, Sabayon is based on Gentoo, so you can still use portage. Just use the emerge command. Be warned, however, as mixing Entropy and Portage can severely damage your system. Pick one to carry out activities.

There is one thing to note, however, and that is that equo update updates the repositories, not the system. To update the system use equo upgrade. Updating the system will scan configuration files and replace them when it does and you allow it, so upgrading may fix breakage.

Graphics
Sabayon comes with a range of desktop environments (you can choose which .iso to download), but they are all installable via Entropy.  Gnome 3 is the desktop environment that I chose, and I noticed something right away; sane defaults!

Gnome 3 comes with an icon-less desktop and only a close button, but in Sabayon it comes configured the way a normal person would use their windows. Gnome-tweak-tool is also installed by default, so if you prefer to use GNOME a different way you are free to. I have also tried e17 and rather enjoyed it, but a graphics problem disallowed me to continue using it. Whether or not it was a problem with the e17 package or my computer I never found out.

Aesthetics
This is one of the most noticeable things in Sabayon. The GRUB splash screen is both readable and pretty, as well as the boot. The boot process has probably the best display out of any Linux distribution I have used thus far. It shows a progress bar, text readout, and explains how to enter verbose mode. Even in verbose mode, the output is contained within the splash.

The terminal is even prettified. The default color scheme in the terminal has a great default color scheme: black background, green prompt, white text.

Stance on Freedom
Sabayon is not as freedom-heavy as other distros, but instead includes nonfree software from the get-go and has the nonfree repositories enabled by default. This means there is a great option of having driver support right out of the box, and if not, having it easily installable.

Preinstalled Software
You may have heard of The Arch Way, the arch linux philosophy on computing. Their ideal operating system is a bare-bones system where the user determines how it will be structured. Sabayon is exactly the opposite. Sabayon's goal is to create a distribution that includes all of the software you will need in their default installation. Personally, I loved the software that was installed (Chromium, GIMP, Libreoffice) but others feel that it adds unnecessary "bloat" to the system. On modern computers, a few extra hundred megabytes of information isn't too bad of a thing; and if it is, you can uninstall it with Equo.

Overall
Sabayon has quickly becoming my primary operating system. I choose Sabayon because package availability is great, it is based on Gentoo and has portage capabilities, the aesthetics are great, and the original installation will be enough for most users in terms of preincluded software. In all of my previous distributions I have had to put up with some minor error, and I usually end up breaking everything trying to fix it. In Sabayon, I have come across a few errors, but nothing that an update won't fix. Sabayon is also a bleeding edge, rolling distro, so I may never have to reinstall it. I would highly recommend it to a distro-hopper or someone looking to try something different and useful.
                              My Sabayon Linux (names crossed out)

Monday, February 27, 2012

My opinions on *BSD

BSD, the Berkley Software Distribution, is one of the least-used variety of Operating System in the world. BSD has been around for a very long time, even before the times of Linux. It is a version of Unix, the grandfather of most Operating Systems. Technically, Mac OS X is a fork of BSD, which is what allows OS X to be POSIX compliant.

There are a few choices to choose from with your distribution of BSD. Like with GNU/Linux, hundreds of them exist. The more popular ones are FreeBSD, OpenBSD, and PC-BSD. PC-BSD is the only one of the bunch that comes with a graphical desktop environment installed by default, so it is considered the "newbie" BSD. Debian is creating a variant of their OS with the BSD kernel and intends to turn it into a major project, but it is still in early development.

FreeBSD is know for its speed. Speed and performance are the two major selling points for BSD; it even claims to run more efficiently than Linux. FreeBSD is not for the feint of heart, however, because it will take some expertise to get it running properly and to install graphics if that is what you wish to do. You will also have to deal with some outdated repositories, since porting them to BSD takes time.

OpenBSD is focused on providing an extremely secure operating system. I can't vouch for its security personally because I never used it on a server, but it seems to be the choice for companies or individuals who want a secure desktop or server.

PC-BSD is the most user friendly version of BSD. It is criticized for coming with a lot of "bloat" preinstalled. Other lightweight versions of BSD do not come with a lot of features installed, usually just a compiler, a text editor, and a few other tools that can be used from the command line. PC-BSD on the other hand comes with X, a graphical desktop environment, and a few graphical tools that other versions do not have preinstalled. If you are new to BSD, I would greatly recommend PC-BSD as a starting point.

Above are my opinions on some of the various distributions of BSD, but I feel differently towards BSD as a whole. I feel that BSD is far behind Linux in terms of support, package updating, and user-friendliness. The first kernel panic I ever experienced was actually in the LiveCD of PC-BSD. Also, the BSD license allows others to edit the source and turn it into proprietary software, which I don't support morally.

In conclusion, *BSD is great for heavy server use, but for practical desktop usage you should go with another alternative, like GNU/Linux.

Saturday, February 25, 2012

Explaining Obfuscation

Obfuscation is the act of making computer programs more efficient by running through less processes. In this article I will explain how to obfuscate your computer programs. My code snippets are written in the Java programming language, but a lot of the functions are language agnostic.

1. Avoid variables
Variables are used to store information in RAM. RAM is very limited in how much it can hold, so making a lot of variables to store information is a bad idea. Below are two examples of avoiding variables.

boolean stopLooping=false;
bad
for(index=0; stopLooping==true; index++)
{
System.out.println(index);
if(index==5)
   stopLooping=true;
}
Your Computer Science professor will tell you that loops are controlled by the state of a boolean, so you might be tempted to do something like the above example. Instead, do something like this:
good
for(int index=0; index<5; index++)
System.out.println(index);
The above example still uses a boolean, but doesn't waste a variable on it. You could also use and if statement with a break, but since for contains functionality to do so it would waste processor resources.

2. Use centralized variables
 Imagine that you are looking at somebody's code and then have 5 variables.
int x, y, a, b, c;
now, you come across this:
bad
x=4;
System.out.println(x);
y=4;
System.out.println(y);
a=5;
System.out,println(a);
b=9 ;
System.out.println(b);
c=2;
System.out.println(c);
You will be deciphering this for a while, so you should use a centralized variable. A centralized variables provides one place to store information, and then it is overwritten after it has been used.
good
int temp;
temp=4;
System.out.println(temp);
System.out.println(temp);
temp=5;
System.out.println(5);
temp=9;
System.out.println(9);
temp=2;
System.out.println(temp);
In the above example, I could have just used System.out.println() with the number I wanted to display, but the point remains. It's better than initializing a bunch of variables to hold the information.
3) if-then-else cleanup
The last thing I will talk about is the reservation of using if-then statements. Let's say that you want to return true if x==4, or else return false.
bad
if(x==4)
 return true;
else
  return false;
This is actually a very common approach, but here is how it should be done:
good
return x==4;
This approach overall shortens up the code and makes it ever so slightly more efficient. You could also use a conditional operator, but this would be a much better way of doing it.

Saturday, December 24, 2011

Technological ideas for Christmas

If you have someone in mind that may appreciate a technologically related gift here are a few good ideas that I have considered giving out to my family on this Christmas. This list is hardware inclusive.

1. Gnu/Linux - Software
Gnu/Linux is a free software operating system similar to Windows in a lot of ways, but completely amalgamated, giving the user full customizability over his/ her system. Hundreds of Gnu/Linux distributions are available for download on the internet, or you can opt to pay for a CD with the Operating System already burnt onto it.

2. Intel core 15 processor - Hardware
The first gift from the hardware category is intel's core i5 desktop processor. A part of Intel's newest line of processors, the sandy bridge series, it provides speeds in upwards of 3.4Ghz, 4 cores, and integrated graphics for about 100 bucks cheaper than the top-of-the-market i7. Buyers beware, Intel's next line of processor, the Ivy bridge, will be released in 2012, but for the time being the i5 is the choice to go with for reasonably priced power.

3. GIMP 2.7 - Software
The Gnu Image Manipulation Program, GIMP, has it's next version, 2.7, available for compilation. It is still a beta release, but it is offering some exciting features that older versions of gimp did not include; the one that most users notice right away is a static toolbox that remains in the main window. GIMP 2.7 includes all the features of older versions and adds a few new features while remaining relatively lightweight with few dependencies. GIMP can easily rival commercial software such as Adobe Photoshop. GIMP is also open-source, so users can edit it at their will.

4. Windows 8 - Software
This is the perfect gift for hardcore Microsoft fans.Windows 8 is still technically in development, but Microsoft is allowing people to download it at a highly reduced price for testing. Windows 8 is a fully rethought Windows, giving the optimal experience for tablet computers.

5. USB 2.0 Wireless Adapter - Hardware
One of the most recent great additions to my computer is a wireless adapter that connects right into a USB port to provide access to wireless networks. Since most computers come with a wireless card, this is a great gift for those with older computers that were released before the popularization of wireless networks.

   5.1 - Wireless router
   You wireless adapter won't be doing much without a wireless network. With a wireless router you can spread connection throughout all parts of your house. Wireless routers provide access to the internet if you have it connected to an internet connection and also allow local connection if you do not want internet connectivity.

6 - Libreoffice suite - software
Libreoffice is a suite designed for creating presentations, documents, spreadsheets, and databases. It is more-or-less designed to clone the functionality of Microsoft Office, and it does a great job of doing so. Libreoffice evolved from Openoffice, which was abandoned.

7 - LED lit keyboard - hardware
For the first two years of my computers life I used a keyboard that Dell sent with the prebuilt. It was a standard keyboard with letters painted on. About half a year ago I bought a 20 dollar keyboard with the ability to illuminate the letters with blue LED lights. I have never been a fan of LED lights on computer hardware, but it actually does serve a purpose at night when you are searching for an unfamiliar key.

The content in this post is public property
That is all on my list for now, sorry that I got it up just a day before Christmas. 

How to install Minecraft on Fedora 19 and under

Minecraft is the only game which I still play on my computer. Minecraft is unique since it is made in a platform-independent programming language called Java. To install it on Fedora 15, you need to get a bit more involved than normal. Reading my previous post about BASH shell scripts may help you out a bit.

First, install sun's java runtime environment here (http://www.java.com/en/download/manual.jsp) Go to the Linux section and download the RPM. When it is finished it can be installed with the software install tool or rpm. That's have the challenge down. Now go to www.minecraft.net and download minecraft.jar. You will notice that when you try to run this .jar file it opens with the archive manager instead. Here is when the slightly harder part comes in.

Go to the directory you have minecraft.jar saved in and make a new document called "Minecraft.sh". In the next few commands replace [path] with the path to Minecraft.jar. Open Minecraft.sh and enter the following:
#! /bin/bash
java -jar [path]
save and close the file. Now make it executable by right clicking it and going to permissions, or using chmod +x from the command line. Double click the file and click "open in terminal". If the terminal opens and closes with quick succession, minecraft threw an exception. To find out what went wrong drag the Minecraft.sh file into a terminal that is already open and run it from there. Google the resulting text.

If everything did go according to plan, minecraft should start normally. If you enjoy mods, then you need to go back to step one and install jre 7 instead of jre 6. The reason I provided the jre 6 link is that it's considered the best option since most java developers are still using it to write their programs / mods.

Alternate Route
There is an alternate, slightly more advanced route to launching minecraft. Go to your desktop and make the text document "minecraft" or whatever you want to name it. Now, copy this information but, once again, change [path] to where your minecraft is located. USER_NAME should be replaced with your username. That entire string should be replaced with a path to the picture.


[Desktop Entry]
Version=1.0
Type=Application
Name=Minecraft
Comment=A game about moving blocks and killing monsters.
Exec=java -jar [path]
Icon=/home/USER_NAME/Pictures/Icons/Applications/Minecraft Icon.png
Path=
Terminal=false

Categories=Games
StartupNotify=false

  When you are done, give the file a ".desktop" extension. This will directly launch the program with a double-click rather than asking you to run it. If you have permission to become root, you can copy this to /usr/share/applications or ~.local/share/applications. Now you can access it from programs like the gnome menu or any type of launcher for even quicker access.
The content in this post is public property
Happy mining