At a glance Main Projects Tutorials Resume

Messenger



Tag Cloud


Twitter


The Motorola i265 and what it has to do with the Maker Movement

Fri, 11 May 2012 10:13:41 EST

The relic Motorola i265.
Ever since I got my first plan based mobile phone, I have had the exact same handset; the Motorola i265 which predates flip phones. This phone has been a constant joke when I pull it out because of the high technology nature of the work I do (I use an Android phone and ipad for development, but not for calls). Why would I use such a relic phone? During the course of regular usage, I dropped this phone on cement and the microphone stopped working. In response to that, I purchased a specialized screwdriver especially for the phone; took it apart, and fixed the microphone.

The i265 and Husky hex type screwdriver.
Why would I do this when the nomenclature of current US society says; "Take it to the phone store and they'll get you a new phone"? Well, honestly I managed to achieve an unprecedented low rate on my mobile phone service, and didn't want to jeopardize the low rate I was paying or my "contract" with the mobile carrier.

So along with my trusty screwdriver I managed to utilize this phone up until May 2012 saving literally thousands of dollars in the process when amortized over the years. The lithium ion battery swelled a little, but never saw decreased performance because I normally kept the battery topped off; which is an excellent testament to Motorola's engineering capability several years ago.

The i265 dissasembled.
Why did I mention the Maker Movement in the title? The mentality I had about this phone is directly in line with a movement in the United States, and around the world known as the Maker Movement. In my own words I think the Maker Movement is in response to ever increasing rapid change in technology and the pressure forced upon people to understand and utilize it. The results of the Maker Movement so far have been astounding and inspiring. I would selfishly consider myself an avid member of the Maker Movement. Being able to understand, and teach how things are built in the world around us allows people to benefit from understanding how to take advantage of technology.

In this rare example, simply by demonstrating the maker mentality, I was able to:
  1. Save a lot of money on phone payment plans.
  2. Save a minimal amount of money, not ever having to purchase a new battery.
  3. Learn a small amount about mobile phone technology (the microphone has a neat touch contact, assembly and is not soldered).
  4. Have an object that's a fun conversation starter.

Comments:0

Drupal 7 Services 3 REST Server C Sharp Example

Fri, 4 May 2012 10:13:40 EST

An image of the the drupal services 3 tool.
I have been doing a lot of work lateley in the Windows Presentation Foundation(wpf) in my favorite .NET language, c#. As with many projects, I like to incorporate the Drupal content management system. With Services 3 you have to throw your knowledge of previous Drupal Services out the window. There is no service browser and several paradigms have changed. After examining REST vs the XMLRPC server I decided to focus on REST because it is just like POSTing and GETing data to/from web forms, in combination with specific url schemes. I've created a demo application that will allow people to test out the REST server....at the time of writing anyway. Here are a couple of points about services 3.

Login

In Services 3 logged in state is determined by a cookie that the login method returns if valid credentials are provided. There is no system.connect needed. People used to legacy Drupal Services will probably find this really annoying...I kind of did. However it conforms to the same behavior as other popular API's like Facebook and Twitter. This is a POST request.

In this example, by default there is no cookie management when using the HttpWebRequest so we utilize a CookieContainer.

Logout

Logout is also handled by a POST. You can call it as many times as you want, but it will only return a valid result if you currently have a valid cookie.

The example was created using using Visual C# 2010 Express and compiled for an x86 target. Take a close look at the source code and you may happen to stumble uppon several other examples. If you have any questions, please use the comments and I'll be happy to help.

Example Download

Download the Executable Sample

Download the C# Project

Comments:2

Persistent and Session Cookies in Windows and Adobe AIR

Fri, 30 Mar 2012 1:45:40 EST

Posting some media to Facebook from a kiosk.
In this article I am going to save you the trouble of researching how Windows XP, Vista, and 7 handle cookies in Internet Explorer and how those rules are delegated to Adobe AIR. You need to know some of the fundamentals before we can jump in. I had to learn all of this to be able to create a kiosk framework with a colleague that safely allows visitors to post to social media sites such as Twitter and Facebook from public kiosks. In my experience, social media sites cannot be trusted to provide proper logout methods for their API's, so our framework took a nuke all cookies and trust no one approach, which lead to several difficulties.

Adobe AIR on Windows Shares Internet Explorer Settings

As far as network timeouts, proxy settings, and cookies go; Adobe AIR shares those settings with IE on Windows. So set a proxy in IE, and AIR will obey the proxy. Set a network timeout in the registry for IE, and AIR will obey that too. The critical item here is that AIR shares Internet Explorers cookies and cookie behavior.

What are Persistent and Session Cookies?

A persistent cookie is a cookie that exists on a computer after a user has visited a site in a web browser. It is written as a small text file onto the computers hard drive. These small files are often used to keep visitors logged into a website after they have left the site and not explicitly logged out. The contents of the cookie differ greatly, and are usually just a bunch of random gibberish that servers use to uniquely identify a visitor or restore state.

A session cookie is a cookie that is only valid until the user leaves the website or closes the web browser. In the case of Internet Explorer, session cookies are held in memory until Internet Explorer is closed, or conversely the Adobe AIR application is closed.

Persistent Cookie Storage Location

In Windows Vista and 7, cookies for IE and AIR are stored at:
C:\Users\logged in user name\AppData\Roaming\Microsoft\Windows\Cookies
and
C:\Users\logged in user name\AppData\Roaming\Microsoft\Windows\Cookies\Low

The Challenge With Session Cookies, Windows, and Untrustworthy Social Networking Sites

Because session cookies are stored in memory, even when programming in native Windows applications; session cookies are in protected memory for the application that created them. In an Adobe AIR application this means the ONLY WAY to destroy a session cookie for good is to kill the application. As all of the official IE documentation states; session cookies are only destroyed when Internet Explorer is closed. This behavior is part of AIR on Windows as well.

What about persistent cookies?

On a public kiosk persistent cookies have no business existing in the first place. It is important that for untrustworthy social media sites (all of them). That persistent cookies be purged. Windows, for obvious reasons usually doesn't allow a persistent cookie to be deleted if it is in active use by the application. The solution is to delete all persistent cookies after the offending native exe or air application is closed.

For kiosk applications made in Adobe AIR or native Windows applications this means that programmers need to plan on killing the process for whatever part of the application interacted with the social media site. Maybe other kiosk vendors were so far on top of this in 2011 when I tackled it that it wasn't funny; but honestly I doubt it.

Comments:0