Idle Hands

16. September 2012

I attended Oklahoma Christian University (often shortened to OC). I originally majored in Computer Engineering because I mistook it for Software Engineering. The denial held out for a year and a half before I finally switched over to Computer Science to do what I really wanted to do: learn to program. I could go on about academic intentions, but that's boring in comparison to the stories I'm going to tell you today! I'm going to drop a few details that will probably piss the university off, but I'm no longer a student there and really couldn't care less.

More...

Case Study, Computer Security, Philosophy

Back to Basics: AND vs. OR vs. XOR

19. August 2011

We often think of computers as working with numbers, and in the purest sense we are, but those numbers are simply 1s and 0s. Normally these bits can be grouped together to represent much larger numbers but as a developer, you'll often times need to use them as bits and you forego addition and division for "bitwise" (sometimes referred to as Logical) operations. Bitwise simply means that you're dealing with individual bits and not the number as a whole, the representation of the bits working together to make a larger number.

More...

C#, Computer Security, Design Pattern, Development, Misc

Your Google Profile

10. May 2011

If you've ever read anything about getting a job in a technical field, you've probably heard about potential employers looking you up on Google or through various social networks. You put yourself out there, so don't be surprised when they hunt down that information. Now, gearing a Facebook or a Twitter account to show off your skills and play the part of a digitial resume is pretty easy, yet there's still Google and all the things that it could dig up that you may not have put on the resume. It's much harder to control what comes up in a Google search, but not entirely impossible. Here, I'm going to talk about ways to craft your "Google Profile," the first few pages of what shows up when somebody searches your name (with or without quotes).

More...

Advice , , ,

In My Own Defense...

25. February 2011

In case you don't know, I've been developing a new encryption for six years now. Timeshift has been my pride and joy. It has outlived friendships, high school, even an engagement. It's my brain child, along with my buddy Karl. As development for it progressed, it became clear that I either need a lot of time to expand my knowledge, or aid from those who have. Over the 6 years, I've found both. Early on, I discovered Bruce Schneier's site. He seemed to be a big man in the industry so I was surprised his email was listed on the site, even more surprised when I received a response. I sent him an email saying that I was having problems explaining an aspect of my cipher and I was wondering if I could have some of his insight. I received the shortest email ever as a response:

More...

Computer Security, Misc ,

Alternative User Interfaces

3. January 2011

For decades now, the mouse, keyboard, and monitor layout has been the primary interaction with a computer, and although it has worked well for us in the past, I think it's time we start seeking out alternative interaction schemes. People have experimented with replacing the ol' mouse and keyboard ranging from multi finger touch screens to a wave of your hand. Let's take a quick look at a few of these UI schemes and take some pros and cons.

More...

Development , , , , , , , , , ,

Why The New Redesign

20. December 2010

So the new design, which I hope you all like, came out of the blue. Even I hadn't planned on the change for more than an hour or two. It was brought to my attention when I received an email from an attentive reader who emailed the address in the binding entry that there is no contact page. I had remembered fiddling with the outgoing email settings for the site so I knew that somewhere there was a page. Well, I found it after messing around with the design I had chosen. In case I haven't mentioned this before, I cannot come up with a decent design to save my life. I'm certified in web development and everything but I'm just not creative. I know when a layout and design works, but I have to work really hard to make it work. So I borrow freely available designs for my BlogEngine.net setup I have here. The design I had previously picked turned out to be hiding quite a few things from you guys. So, just a real quick run through of what is available to you.

More...

Misc

Brainfuck: Enough Said

1. December 2010

Earlier today I put up a page explaining how a particular esoteric programming language works, as well as my interpreter for it. Brainfuck is not simply a name, but also an accurate description of what it takes to fully understand what the code is trying to accomplish. Given only eight symbols, this language is turing complete. This means that the language can accurately simulate any turing machine... i.e. executing under a defined set of rules, any computer algorithm can be completed. I've messed around with the language a bit and it is as its name suggests. In order to add two numbers together and display the result, you need to go through a command along the lines of "[->+<]>." where the number you started on was one cell to the left of the number you added it to. It proceeds by subtracting one from the left number and adding one to the right number until the left number is zero. If addition takes six commands, imagine what multiplication would take, nevertheless exponents or square roots. However complicated these commands might be, this language is capable.

I have yet to think of a good application for this language as opposed to other languages. I found myself asking why it was even created. To borrow a line from Wikipedia, it was designed to be a turing machine with the smallest possible compiler. Some people have been as efficient as to write a compiler that is only 200 bytes in size! Attached to the page is my version of an interpreter for this language. Although not nearly as small as 200 bytes, my interpreter comes with a few extra features than simply running the commands. As best as I can find, mine is the only one to let you type in a numerical byte instead of just a character off the keyboard. I hope I'm not the only one who finds this a good idea... Regardless, I also added in some switches to output particular information to files; information such as routing all output to a file and a memory dump of the stream that the command generated while it was being run. Source code and all is available in the article.

Project, Source Code ,

I've (re)Discovered Project Euler

29. November 2010

I've heard about ProjectEuler.net over a year ago and it quickly slipped my mind. Last week I rediscovered the site and finally registered with them. Project Euler (according to Wikipedia, pronounced "Oiler") is a site of over 300 mathematical problems with the intent of them being solved through creating an efficient algorithm and programming it out to get the result, read their about section here. Once you register, it'll keep track of which questions you've completed and what the answers for those problems were. Upon completing a problem, you can also access a forum thread about that problem. There, you can see how other people solved the problem. Usually other users will post their code or explain their approaches.

I have created a solution in Visual Studio that all my projects for every problem is going into and I'm taking on the challange of getting as many done as possible. At this time of posting, there's 311 problems and I've completed the first 18. I'm slowly working my way through them and I'll keep you all posted. They're constantly adding new problems so reaching 100% will be short lived if it happens.

I highly recommend this site to developers looking to stay on their mathematical game or mathematicians who are looking to learn how to program. Regardless which you are, you're going to better learn to develop algorithms. I know I've learned quite a few ways to interact with numbers. The biggest surprise for me was how to count the number of divisors a number has when you know it's prime factors. Anyway, have fun with this site.

Advice, Code Optimization, Misc , , ,

Threads: Doing Them Right w/GUI

28. November 2010

I did an article over threads in a command line project. In a command line project, there are less complications than it's GUI alternative. Here, I hope to go into enough detail to put to rest the confusion that threads can introduce to a GUI application. The big hurdle is around the limitation that the only thread to interact with a control is the thread that created the control. In the beginning, I saw this as a silly rule, one not worthy of throwing an exception.  The more and more I use threads, the more obvious it becomes that this is less of a suggestion and more of a golden rule. So, the question begs, how do we create a thread to do something that we need a result back from? How do we get any information from a thread that's been started, such as progress, or state of operation? With callbacks, events, and the Invoke method! If we take some of the concepts I discussed in threaded CLR projects, like a payload struct, and use them here, than this will be an easy concept for you.

To start, I'll say that there is a long-named boolean variable we can set to false in the constructor of a form called "CheckForIllegalCrossThreadCalls." When set to false, is does just what you think, it will not check for illegal cross thread calls. To break down what that means, when true it will check to see if a thread tries to access a control it did not create, and when false, it will allow it. In simple applications this may be all you need, but any amount of complexity and it quickly becomes a bad idea. The problem with threads is their unpredictability. Should two threads happen to be editing the same control, things become unstable. From unintended outputs to crashing programs, it's not something you want to test, it's just better to do it right the first time, and every time. This variable, CheckForIllegalCrossThreadCalls, should remain true, by default it is.

For my little example here, the UI will consist of two progress bars and a button. Upon clicking the button, one thread starts per progress bar and they will update the progress bar they're associated with over time. This will leave the GUI thread to do nothing, at least until each thread calls their invokes. In addition to these controls, the form will have two delegates, two events, and a list of all the running threads. The events and delegates are paired. One pair is to update a progress bar, the other pair is for when a thread completes. There is also a struct to act as the payload for the threads, as defined here:

More...

Advice, C#, Development, Source Code , , ,

Android vs. iPhone: Day One Development

5. November 2010

These are exciting times! As an assignment at school, we are writing an iPhone game. It's a simple number guessing game. You know how it goes... Generate a random number, get the user's guess at the number, tell them "too high" or "too low." When the user guesses it right, you tell them how many guesses it took. It's actually one of the most boring games you can play, but it's a great beginning for learning a framework (and in the iPhone's case, a language, too). It has all the great aspects of a first app: input from the user, output to the user, and simple processing with a nice added bonus of learning how to randomly generate a number. I worked hard to do things right. I wanted it to rotate properly, stay centered, respond well to all input, the usual goals. I wanted a market worthy app, even though it'll never make it to the App Store or the Android Marketplace. All the specifications my teacher inparted on us for the iPhone app, I continued to uphold for my own Android project. I'm going to do my best to explain my experiences with both platforms. I have the same experience with both of them. About a month ago I wrote a Hello World app for each of them. School got in the way of looking into either of them deeper, until this assignment. I may seem pre-determined to be better at Android considering my Java history, but I'm accounting for it by saying that I haven't worked in java for years and that I'm currently getting three hours a week being taught iPhone dev and Obj-C. It evens out enough for me! This article will not be as much a walkthrough as it will be a comparison between my two experiences.

More...

Advice, Android, Case Study, Development, iPhone , , , , ,