Thursday, December 23, 2010

Share your programming knowledge; don't retain it

A while back, I sought some information about writing emulators. I thought up a general idea of how an emulator would work just to get my brain thinking in that mode. Once I had a plan, I searched the web for forums, articles, and people to correspond with about emulators. (After all, part of the whole programmer/hacker ethic is not reinventing the wheel.)
Finally, I had found a forum. Good and bad came from that. The good was that the forum and discussion confirmed my general plan (I was happy that I had thought of emulating systems the same way that others do); the bad was that some user completely disregarded the let's-not-reinvent-the-wheel idea. Basically, he or she wrote that anyone that has to look up how to write an emulator is not smart enough - and will never be able to - write an emulator.
This bothered me for a multitude of reasons:
  1. His or her statement meant that he believed in reinventing the wheel. After all, if you cannot ask for help, you are your only resources and must, as a result, reinvent the wheel.
  2. He or she clearly either do not know how to write one themselves - otherwise, they would have at least posted something more helpful - or they are just ignorant, or both.
Quite frankly, I believe that information about programming should be spread. I do not mean just give away code for people to copy; I mean prompt them, have them learn on their own, but help them as soon as they hit a bump. There truly is no point to postpone their acquisition of knowledge. Think of postponing that acquisition as slowing down the general advancement of tech knowledge.

On a final - and unrelated - note: if anyone is interested in writing an emulator with me, comment and we could possibly set up some repository for the code. Nevertheless, I'll finish up my emulator, regardless of whether I have any takers.


Proxy Server

General Information:
Essentially, a proxy server is a server that connects a computer to another server. They are usually used to get access to a blocked website server.

Let me explain - as the previous definition can be confusing without an example. To open a web page, a computer must connect to a server. (Think of a server as another computer that stores a website in a file; picture the file as an object.) With that said, when you want to load a website, the computer you are using connects to that website server and downloads the file. Now, in a school - or work - setting, the administrators (the people that control the computer system) can block access to a server; and thus, block access to a webpage file.

To bypass that, someone can connect to a proxy server, which is NOT blocked, as long as the administrators do not know about it. This server can ask the computer what site the computer wants to connect to. Then, the proxy server can download the appropriate website server's web page data/file and send it back to the computer that could not previously access it.

Basically, the proxy server downloads the webpage file from the blocked server and saves the webpage file on the proxy server so that any computer can access it. That way, your computer can get the same webpage that they wanted to get from the blocked website, without ever actually connecting to that site's server.
As you can see, someone can access a blocked website through a proxy server.

Mind you that proxy servers can be blocked by administrators - they aren't impervious - because once the server is used, the administrators can block it.

Real life example:
Let me, now, give you a real life example. Say I am at school and want to go to "".
Now, let's pretend my school blocks "". What I would do is go to the webpage of a proxy server - just like I would with any other website. I would type in the "". The proxy server would go to "", download the webpage, and send it back to me. Now, I have the "" webpage, which was blocked; and I didn't have to actually visit "".

Simplified definition:
In sum, a proxy server duplicates the website that you want by copying the websites files; and then, it sends the files back to the user.


Of course, in real life, proxy servers are more complex: they have to write an interface for the user; they have to interact with other servers; and, they have to adjust links and functions in the page so all interactions are directed through the proxy server (trying to direct links and functions through the blocked website would not work, because the blocked website is blocked). However, the above examples, etc, should be enough to give someone a general understanding of proxy servers.

Here I just want to write some of the extra considerations and specifics of running a proxy server.
It seems that the programmer of the proxy server would have to adjust all of the links on the webpage. Such functionality can be achieved by simply removing the domain name of the original, blocked website from the links, which tells the browser to apply all links to the end of the current - proxy - domain name. Mind you that advanced websites won't include the domain name in their website, because it is implied that the domain name that the website's links apply to should be the active website, unless explicitly specified otherwise.
Also, the proxy server would have to crawl the website to download all of the necessary files. This would only be hard if the website's robot file prevented crawling, and, as a result, prevent finding and downloading the necessary files.

This article may or may not be updated in the future. If I decide to make my own proxy server for experience purposes, I will most likely provide an update that will include my experiences, lessons I've learned, etc.

Thursday, November 25, 2010

Multi-tasking In 4.0: Clever

Apple claims that iOS 4's multitasking is "[m]ultitasking done the right way." And to be quite frank, I couldn't agree more; Apple's implementation is multitasking done the right way - for mobile devices at least. Essentially, Apple's implementation gives the programmer sufficient access to allow programmers to implement multitasking functionality throughout his or her program - without draining as much battery as a traditional multitasking system.

The multitasking now built in to iOS offers 7 services: background audio, Voice over IP (VoIP), background location, push notifications, local notifications, fast app switching, and task completion. Those 7 services pretty much solve all previous multitasking problems. With each service addition, the roadblock that prevented thousands of applications from providing the ultimate user experience is being suspended higher and higher.

  1. The background audio now allows applications like Pandora to play music, while the user works with different applications. (Notice the plural; because, now the user can do more than one thing.)
  2. Voice over IP now allows phone calls over the internet. Applications like Skype can now utilize this so that users can make phone calls outside of the Phone app, while multitasking.
  3. The background location service means that an iOS device's location can be found without using a lot of GPS data. It is cleverly implemented as well. The phone gives the application an updated location, when the device switches between networks. As a result, the phone does not drain as much battery as a flat-out, frequently-updating GPS system does. (This follows the same philosophy of push notifications: use a signal that has to be used regardless, the phone network connection, to help perform other services.)
  4. Push notifications were already offered, but now the services have expanded to offer the following service: local notifications.
  5. Local notifications allow applications to generate their own alerts. The usefulness in this is best found in timers and task completion alerts. When a timer is finished or items have finished uploading, the application can alert the user.
  6. Task completion was also added. The task completion service allows an iOS application to complete whatever process it was doing even after the user has left that app. Then, when the task is complete, the phone won't continue to allocate resources that won't be used to the application. Such a feature will be useful for applications like the flickr app that previously required the application to be in the foreground for picture uploads to be completed.
  7. Lastly, fast app switching is more of a UI interface adjustment; however, it is just as crucial. The fast app switching interface is basically the bar on the bottom of the screen that springs up when the home button is double-clicked. Swipe to the left and you have audio controls and orientation lock; swipe to the right and you have access to your previously opened applications. This is useful, because now a user can copy information from Safari, switch to the Mail app - without having to click the home button, search for the application, and repeat - and paste.
All of these services are necessary and extremely useful. They all perform the tasks that are crucial to the usability of many applications without draining as much battery or slowing down the device as traditional multitasking does. The phone retains the functionality of a multitasking device without draining resources.

What may seem like limitations to others, is really just the same efficient innovation that Apple has supplied for years. It is Apple's redefinition of multitasking. (Sometimes in technology, it is better to redefine or make a new service that does the job of an old one than to tweak an old one.) This is their take on multitasking. They got the job done, and, in a way that no other company could have. Apple has done multitasking the right way.

Tuesday, November 23, 2010

iOS 4.2 Release


On Monday, November 22, 2010, Apple released the 401-megabyte iOS 4.2 update. This update contains security updates, simple tweaks, and more wireless integration (AirPrint and AirPlay.) All of the updates are effectively making the iOS devices less mobile; they are slowly bridging the gap between computers and mobile devices - and may even usurp small computers' dominance in word processing and the like.

In regard to security updates, the iOS has followed a general theme: removal of arbitrary code execution vulnerabilities. (Such vulnerabilities are found in parts of the iOS system that are crucial to the operation of the most basic components.) Essentially, Apple fixed the faulty code [of the programs that receive input and produce output] to block attackers from taking over a phone whose user is simply viewing a picture. Apple accomplished this by correcting vulnerabilities in CoreGraphics, FreeType and WebKit. Since all of the aforementioned pieces of software are components of the web browser (although they are not limited to that use) the user will now be more protected on the web, when dealing with images (CoreGraphics) and plain old - javascript or non-javascript inclusive - HTML pages (WebKit and FreeType.)
(Click here for a description of WebKit, FreeType, and CoreGraphics)

Apple added some nice features that revolve around wireless interaction of devices, giving the user more control. Put simply, the the addition of AirPlay and AirPrint makes the user's iOS device more interactive with other devices. The AirPlay technology allows users to stream music throughout their entire house, assuming they have other devices such as an iMac or an AppleTV. For example, you can stream music directly from your iPod/iPhone/iPad to an AppleTV or other AirPlay-enabled devices. The Printing technology is pretty self-explanatory. Essentially, now you can print files from Mail, Safari, and Photos. (NOTE: Only some printers are automatically AirPrint-enabled; click for instructions on how to enable AirPrint for almost any printer connected to your Mac. You can type the URL into Google translate if you don't speak German.)

As for some simple tweaks, Apple changed around some icons (Voice Memos), allowed for different fonts in "Notes," and added a search-in-web-page function to Safari, amongst other things. The productivity just keeps on increasing at a rate, at which the adoption rate is not overwhelming.

The iPad update also received some long-awaited updates: Folders and Multi-tasking. Now apps can be grouped together into folders that can contain 12 applications each. The folder's are automatically named based on the category of the applications within it; however, the name can always be modified. The iPad has also received multi-tasking, allowing multiple applications to run at the same time. (Since the multitasking is implemented differently to cope with limited resources, please read my article in order to better understanding it's implementation.) The gap is bridging as productivity increases and limitations decrease.

Added to all iOS devices were keyboard and dictionary enhancements, as well as keyboards, languages, and more-advanced dictionaries. Better input equates to higher productivity for all devices.

In sum, the iOS 4.2 update furthers the transformation of the previous iOS devices into a device with capabilities closer to those of a desktop. The security updates protects your data (suitable for business world); AirPlay and Printing improves interaction among devices (suitable for students who have to complete assignments); the keyboard tweaks improve input on the devices (more efficient input for all); the iPad updates eradicate many of the iPad users biggest qualms; and, the Safari update makes finding and working with data easier (everyone). It is very possible that sometime in the near future, more people will be integrating their iOS devices into their lives and homes as they use it to write reports, take notes, research, and receive entertainment.

Tuesday, August 17, 2010

Disable Geo-tagging On The IPhone

1.Open the Settings application on your iPhone.

2.Scroll down until you see the “General” settings option and select it

3.Scroll down to the “Location Services” option and select it

4.Find the Camera option in the table and toggle the switcher - the on and off switch next to its associated application - to “OFF”.

Friday, August 13, 2010

ooVoo: Unfreeze Video Feed

1. Go to the top left of the video window

2. Press the Video Resolution drop down/button

a. Select a new resolution

3. After the new resolution refreshes the video feed you can change your resolution again to whatever you had it as before

NOTE: A very high resolution trying to work with low bandwidth could be the reason the video feed froze in the first place

Tuesday, August 10, 2010

Readability on MobileSafari

1. Go to: ""

2. Then, bookmark that page (in MobileSafari) and rename it to "Readability".

3. Now, at the link you just visited in step 1, you should see a box with text that looks like code in it. Copy that by using the iPhone's copying function.
This is the code you will be copying:

4. Visit the bookmark that you just named readability, and click edit at the bottom of the screen. Arrows should appear to the right of all the bookmarks that are displayed on the screen. Click the "Readability" bookmark.

5. In the second field - the one below the name field that displays the name Readability - paste the code that you just copied.

6. Click done.

7. Visit any article. When you want to view it using Readability, just click the readability bookmark.

Thank you for reading! I hope this helps!

Thursday, June 17, 2010

Safari 5

I recently downloaded Safari 5 and I am impressed. I want to go over some things: Safari Extensions, Readability, UI changes. Those alone make this update worth the download.

I will start off with UI changes. There are a few things that the user will notice. First, the brought back the blue loading bar. Another UI change can be seen in the History and Bookmarks window. They changed the style of the buttons and the color. Anyway, since these UI changes were more for show than for functionality and accessibility, I will move on to the next two things I want to talk about.

Readability. This is a great feature that analyzes the active webpage. It breaks it down utilizing DOM's functionality. After parsing appropriately, it reformats for easy reading, what is most likely the main article in the page. It is much easier to use than the old Arc90 bookmarklet. I bet the code is essentially the same, but by putting it into the Objective-C language, it runs faster.

Finally, Safari extensions. Now any developer can create extensions to add functionality to the Safari Web Browser. One example is an extension that allows the user to download the current YouTube video.
I find it nice that an extension can really get a high level of interaction with a web page (UI Interaction and WebPage injection). Soon, I will post a tutorial on how to make Safari extensions.

In sum, Safari 5 is loaded with some killer features. Safari Extensions, and Readability, along with algorithmic optimization makes this browser REALLY impressive. It is something everyone MUST download.

Programming Tip: Be Care With Quote Syntax

The other day, I was writing a program. It has to display a "\". So obviously, my first instinct was to write that. What I did not remember was that a slash there usually is waiting for some letter to come after it to denote a return or something similar. So, it was taking a quote as that letter. However, a ' " \" ' doesn't actually mean anything so the debugger was getting stuck there. So when you want to write a back slash, you have to click it twice.

Essentially, by doing so you tell the javascript engine that the \ is not denoting a symbol to realize that the \ isn't actually waiting for something like "\n". Alternatively, you could use the special characters ampersand format for a slash: "&#92".

Slow Boot up Macintosh Snow Leopard

NOTE: This probably applies to Leopard too.

Over a month ago, I had a problem with start up on my mac. I think it was because I had a partition that was the main one for boot up, but after I deleted it Snow Leopard did not know what HDD to boot from. So, it would first check for network volumes. However, none could be found. We all know that loosely-connected or nonexistent network devices will cause problems, because they cannot be found. Anyway, that was my problem. It was increasing boot times between the bootloader and the Apple Logo up to 25 seconds.

Lesson to take away: If there is an unusually large delay in the time it takes to switch from the bootloader to the Apple Logo, the problem could possibly be remedied by going to "Apple Logo --> System Preferences --> Startup disk", and selecting a startup disk. (There is no need to click any apply buttons, because when you select the disk, the OS basically just automatically applies it.

Sunday, April 18, 2010


I think that if Google Chrome cannot find a search on a website, then when you type in a website and click tab to search that website it should just create a google search with the "site:" parameter. I'll submit my code for that soon.

Sunday, April 4, 2010


I am back into Hackintosh mode.

Basically, I will just install OS X onto a flash drive with a bootloader so that it can start on a pc, HOWEVER, when it crashes I will run it in verbose mode. Therefore, I can see what went wrong.

That is just a quick idea.

No Third-Party Application Multi-Tasking

I will get straight to the point.

1. The processor on the iPhone isn't strong enough just yet and an algorithm that would try to give more power to the primary process would likely end up using the rest of the power and become inefficient.
1a. It isn't seen on the iPad, because that would mean a rewrite of the iPad kernel (which I believe is shared with the iPhone. They would be better off waiting until they rewrite the iPhone's kernel.

2. This would lower battery life, which is still a struggle to improve.

3. Also, malicious code could run in the background and steal passwords when the malicious code and the App Store are running. To prevent this Apple would then need more professionals who TRULY analyze code, which would take more time and cost more money consequently making applications and the device cost more.

4. Lastly, I read in an article that the biggest (non-trivial) complaint about Android OS is the multi-tasking. (I am not attacking Android it is just an example.)

If you are really not worried about any security risks, you can jailbreak it. At least Apple gives you the option to keep it locked up safe, unless you chose otherwise.

iPad closes the gap

Some people might say that I am just being another fanboy and avidly supporting any new Apple product. However, I will hopefully convince you, with this article, that the iPad is TRULY closing the gap between an iPhone and a MacBook.

First, I would like to point out that the iPad keyboard, when in landscape mode, is AMAZING to type on. Unfortunately, the portrait keyboard feels a little cramped. Nevertheless, the typing, input, and text-manipulation experience, is wonderful.

Second, in the new applications you see "pop-ups" or other windows and palettes, which are only really found on computers, because of the ample screen space.

Third, I see certain functionality that can't be found on small devices, BUT they can be found on the iPad. For example, on a mac, you can put your mouse over any word and receive its definition by clicking Control - Command - D. This dictionary technology is implemented in a fashion much more similar to a computer, than an iPod/iPhone. This might seem like something unimportant, HOWEVER this is online one instance where I see the gap closing. Also, in the iWork app, the user can now manipulate document margins. Things like that are only seen on computers, and are much harder to implement on small iPhone-sized devices.

In sum, the iPad is not given justice by being considered a "bigger iPod Touch." It truly does narrow the gap between an iPhone/iPod and a MacBook. It allows for more computer-like functionality.

Wednesday, March 17, 2010

Fixed My Computers Log Off Problem

I had reformatted my backup drives to optimize the system for a new computer that was added to my network. 

Basically, I backed up on a separate drive the most recent sparsebundles of my computer. I, then, erased and made 4 partitions (1 for each computer.) However, after that I had to stop. What I noticed was that once I turned off Time Machine on my MacBook, until I could get around to setting it up the computer started logging off quickly again.

I figure that the computer was probably looking to connect with an inactive drive; and, we all know that it's not good when a computer is trying to interact with something it can't find.

To confirm this I will look over logging off logs in console, but I think that was the problem.

Now, when I have five minutes to spare I will set up Time Machine for my MacBook again.

Monday, March 15, 2010

New Program

So, me and my fellow nerds are building a really nice program (at least we think it is nice.)

Basically, it will use a linked-list data structure to basically parse and convert the actual binary code of a certain type of language to assembly. Basically, it will be a disassembler. Then, the assembler can be translated to any higher language (the only problem is that the variables will have different names; and I'm not really sure how I will get the same variables to retain their name and not just get a different one.) Anyway, from that higher language it will compile.

In theory, this could be used to convert programs from one system to another, assuming that we have the appropriate linked-list data structure.

Wednesday, February 3, 2010

Verbose Mode

Verbose Mode is so helpful!

My computer recently got a bit slower. After looking around through the command line to check out my disks. I realized three things: (1) items had improper permissions, (2) things were out of place, (3) and I had 2% of open HDD space. [Btw, the last thing will be hard to fix seeing that two expand a partition it requires deleting the partition below it, which is a partition that I need to keep]

Anyway, I figured that there must also be a problem on start up, because there was a 9 second delay between the bootloader and the OS initializing. When, I booted into verbose mode I saw a 9 second delay. It slowed down on a command that said "Convert to launchd." I assume that this conversion is not happening or it takes time to do. So, I will tell you what happens when I pre-convert them. This will cut 9 seconds off my 32 second boot time. That just happens to be 23 seconds, which to a high majority of computers, is extremely fast.

Wish me luck! :)

Sunday, January 17, 2010

Microsoft Windows

So, I was trying to find some equivalent software between Mac and PC. I notice that there is virtually never a directly equivalent application, but I came to determine that Device Manager and System Profiler.

Anyway, I feel that I get more information from the Mac application and with less annoying dialog boxes. However, one can disable devices right from there on the PC. I think that apple gives you enough information to remove the appropriate KeXT's but Windows should not allow you to disable the processor, etc. It can get very dangerous. So, I am going to have to side with the System Profiler but I do give Windows 7 Device Manager its honorary mention. However, I do like how it can let you view the devices of other computers, and scan for hardware changes. But, then again Mac has console for that. I guess if you put System Profiler with Console then you get the same functionality.

This is why I don't like debating OS's for each bit of software, because there is rarely one software that has a functional equivalent so note that I am not comparing OS's, but rather comparing two similar (although not equivalent) pieces of software.

Monday, January 11, 2010

Little Trick

Let's say that you cannot find your mouse. What do you do?

The easiest thing to do is to just push your mouse or trackpad all of the way to the top left. After one or two strokes, depending on the size of your monitor, the mouse will be at the top left where it is fully visible.

Windows 7: File Manipulation Dislikes

I think that when you are using Windows Explorer in Windows 7 there is a problem with the overall idea. They give you too much information that is not necessary at the time when you are performing and action, particularly copying and pasting files.

This is proof to my theory that one of the major problems of Windows Explorer in Windows 7 is a lack of an intuitive system. It just doesn't know what to show you when. The only time it does is when it simply modifies the bar below the menu bar that gives you options. Even then, the location of items in the "organize" menu is not intuitive.

If Microsoft wants to get going they are going to have to make more intuitive products.

Friday, January 8, 2010

Data Encryption

So, I was contemplating some security ideas.

I thought this might be safe:
1. User 1 has his file and adjusts the binary on a side determined by his private key and reversible by his public key
2. This side is modified/locked
3. User 2 modifies/locks his side. It is important to know that 1 at each end of the halves must not be modified.
4. User 1 unlocks his side
5. User 2 unlocks his side

However, after contemplation I realized it is still not safe.
If user 2 used some form of redundancy to recover what he locked he must be protected from Mallory otherwise his lock can be found.

Also, Mallory only needs to accept the proper amount of data packets. If she knew both halves after User 1 initially sent it she could then notice what changes were made by User 2. This meant that Mallory could deduce what User 2 encrypted. Now, all she has to do is note what was decrypted by user 1 and now she has both halves.

I don't think data can be TRULY 100% always secured. What do you think?

Then, one could say that the users should be able to modify anything, even modify what was modified by the other user. So, let's say that happens. Well, in order for user 1 to decrypt their side they might would have to put it back in order. For example, let's say I sent YOU 10101. I encrypt it to 11101. Then you, not aware of what I corrected, encrypt it to 10001. I couldn't simply undo my actions because that means I change it to 11101 and send it to you. You would then undo your corrections and get 10001, which is obviously not 10101. This is lossy and lousy. Anyway, so then, I would use a redundant/error-checking system. Now, if Mallory could crack my computer they would have that. Thus, the message is not secure.

In sum, you can only have a secure setting if compression, and encryption are used to the fullest extent AND Mallory can not get into your computer.

Search This Blog