Desert Bunker

Writing your first C# program

There are many programming languages in the world of software development that savvy individuals wish to educate their knowledge hungry minds with. Getting your feet wet with some of them can be a daunting task at best. However, C# (pronounced see-sharp) is intended to be clear, understandable, yet cutting-edge and functional with an emphasis in object-oriented practice. It’s for this reason that I believe C# to be one of the languages of choice for the budding programmer.

Let’s jump right in an start off with a simple ‘Hello World’-esque example. We’ll break from the monotonous trend and introduce not just printing a simple text phrase, but also the concept of a ‘loop’. Our goal of this needless program is to print a phrase to your screen and repeat it as many times as you wish, without actually having to repeat the same line of code over and over again to do so.

Copy the following block of code in to your favorite IDE or text editor, compile it, and run it.

using System;
namespace LoopMyText
class TextLoop
static void Main()
int count = 0;
while (count < 20)
Console.WriteLine(“Press any key to exit.”);

In this example I’m sure you’ll notice that the line we write to the console prints itself 20 times, no more, no less. Without getting in to too much detail right now, let’s focus on the function Main().

First, we create an integer using ‘int count = 0;’ (the shorthand ‘int’ representing an Integer in C#) and name it ‘count’. For now, it’s equal to 0. Next, we create the loop by invoking ‘while (count < 20)’. The condition we set within the expression determines whether or not the loop will continue to execute the statement. Our condition translates to: If the value of the Integer named ‘count’ is less than 20, execute all statements within the block surrounded by ‘{ }’. Each time the block of code is run, ‘while’ will check to see if ‘(count < 20)’ is still true.

The first statement we execute ‘Console.WriteLine(“1..2..3..BOOM!”);’ prints text to a Windows console window. We then increment the value of ‘count’ by using the increment operator ‘++’. In other words, each time we loop through our statements, ‘count’ will be equal to a value that is one more than the last time the block of code was executed, thus bringing us closer to making the expression ‘(count < 20)’ untrue. Once this occurs, we escape from the loop and finish the program. If you are having a hard time grasping the idea of how it works, try changing the initial value of ‘count’ from 0 to something else, and see what happens. Conversely, try changing the expression within ‘while’ to a value other than 20 and monitor the effects it has on your result.

Thanks for reading and I hope you enjoyed this crash course.

Samsung Galaxy Note II Announced? Shut up and take my money.

While we can’t say it was a shock, Samsung’s latest superphone has arrived — and it’s got a new stylus. The Galaxy Note II pushes the screen frontier to 5.5 inches wide, with another HD Super AMOLED display, this time at 1,280 x 720. Despite that expansion the phone is a mere 9.4mm thick, while it now houses a larger capacity (faster charging) 3,100mAh battery and a quad-core Exynos processor clocked at 1.6GHz. As the Galaxy Note was to the Galaxy S II, so the Note II takes some design riffs from the Galaxy S III, with the same rounded edges, glossy finish and extra software piled atop its Android base. There’s also Samsung’s reliable 8-megapixel camera sensor on the back, capable of 1080p video-recording.

The great news is that the Galaxy Note II will be launching on Jelly Bean — no laborious waiting for those over-the-air updates for Google’s very latest. Software additions are understandably heavily weighted towards the phablet’s S Pen advances. The stylus itself now has a rubber nib, which Samsung reckons will offer an experience closer to pen and paper. User can add “Quick Commands” to their stylus gestures, while “Air View” allows you to peruse galleries and folders by floating the stylus just above the screen. Samsung’s also added an Easy Clip ability to crop and share from anything beaming out from the Note II’s 16:9 screen. Stylus functionality has been gifted to the calendar (S Planner) and the native email app, while the S Pen itself will now notify your phone if it’s left behind. The device will launch in Titanium Grey and Marble White, arriving internationally before the end of the year. We’ve just managed to handle both the Galaxy Note II and that reformed stylus — check out our hands-on here.

Source: Engadget

PS Jailbreak: Backed up games and unsigned code now possible on the PS3

The PS3 is now capable of running backed up games from either the internal HDD or an external drive with the use of a USB device that puts the PS3 into developer/debug mode. It doesn’t appear to be an exploit.

News of the device first hit, at first with many users claiming it to be fake. But after several test units began being sent to well-respected scene members, it was confirmed that this magic little device is the real deal.

Here’s a video of the USB dongle in action, loading a game supposedly already backed up on the drive:

Not only will you be able to back up your games to a hard drive, but it is now possible to run unsigned homebrew code on your console, so one can only imagine what sorts of exciting things will be developed.

Oh, and for those of you with PS3s and an extra $120, you can purchase this device right now from these guys:

Clones are apparently already being made, after a few have identified the guts of the goods. The dongle was identified to have the Atmel ATMEGA32U4 micro-controller. Expect a few good copycats and possible malicious attempts to make a quick buck from the uninitiated buyer.

As for Sony, they haven’t commented on the situation. But I’m pretty sure they must be throwing a fit over this, especially since the PS3 is just beginning to make money and outsell the competition. Many fear that Sony may further cripple the PS3 and decide to do something drastic, such as disable USB functionality altogether. Although it’s unlikely that Sony would do such an injustice to users, Sony’s been known to take desperate measures for even the slightest signs of a weakness in their flagship video game console.

Update: Based on the information here, the PSJailbreak ATMEGA chip is NOT updatable. Replacing the hardware is the only way to update the device, if at all. They also go in to detail about how the PSJailbreak works:

We can confirm that PSJailbreak is in fact no simple clone of Sony´s “Jig” modul, instead it´s an honest, self developed exploit. The Chip inside is no PIC18F444 but an ATMega with USB-software. That means that the chip is capable of internal USB emulation. PSJailbreak mainly emulates a 6-port USB-hub to that several USB-devices get connected and disconnected in a speciffic sequence. One of these devices has the ID of Sony´s “Jig” modul, so that means that the “Jig” played a certain role during the development of PSJailbreak.

But first things first: When switching the PS3 on, a device is connected within the USB-emulation, which has a too large configuration descriptor. This discriptor overwrites the stack with contained PowerPC-code that is executed. Now various other devices get connected within the emulation. One device has a 0xAD large descriptor that is part of the exploit and contains static data. Short time later (we´re talking about milliseconds here) the “Jig” gets connected and encrypted data is sent to the “Jig”.
An eternity later (in milliseconds that is) the “Jig” answers with 64Bytes of static data, all USB-devices get disconnected, a new device is connected and the PS3 restarts in a new look.

Brought to you by: DesertBunker

Life Points Calculator for Android

Using the Calculator included with Android is a pain in the ass when you’re likely to only use subtraction for a card game. The Yu-Gi-Oh trading card game is one such game that requires one to keep track of their life points to determine the victor in a ‘duel.’ Still, many players with Android phones seem content with using their Calculator along with the decimal trick to track both players’ LP. I find this to be annoying and unreliable; one wrong click and next thing you know you’re both unsure of each others’ life points. With this in mind, and the dissatisfying lack of options for such an open platform as Android, I built my own life points calculator.

Read the rest of this entry »

VibeStreamer: Remotely stream your music library

There’s many different solutions out there that give you the ability to access and share your collection of music over the net. Many of them of work, sort of. It really depends on how you want to present your music to the user and how much functionality you’re willing to give access to. In this case, I’ve found a fairly self-contained music streaming server that gives you access to your music through web based flash player, with a login system to boot.

Read the rest of this entry »

Is it down for everyone, or just me?

Been busy for a while, but I’m definitely not going to let the site rot. So here’s an update for those who have been waiting.

Ever try to visit one of your favorite websites for your daily dosage of internet vegetation, only to be disappointed by a 404 Error? I found a fairly useful tool I’ve been using for quite some time now that will allow you to see if, in fact, a website is up and running.

Read the rest of this entry »