Categories
Other

PC to Mac Transition (Developer’s View)

For the longest time I’ve been a PC user.  My very first computer related memory was playing video games on a 286 with some version of MS-DOS on it (4.?).  After that, my family graduated to Windows 3.1, then 95,98, XP, Vista, and then Windows 7.  Needless to say, I have been using using PCs for the better part of my entire life.  I’ve been using PCs with Windows for most of that time as well.  However, not exclusively.

When I started college, I found that REAL programmers used Linux.  So, I installed Ubuntu 4.10, and went from there.  From that point on, I have been using Linux (Ubuntu) as my development environment for all applications.  I’ve done my level best to stay away from Macs because I feel they are overpriced, overhyped, and have a generally pretentious user base (not true for all Mac people, just the types I encounter).  I also figured knowing 2 operating systems well was probably good enough.  Turns out that it wasn’t as soon as I started working for DDM.

DDM is a company filled with graphic designers.  It’s also a fairly progressive place, with nice perks, a fun office layout.  Due to the abundance of graphic designers, DDM is an all Mac shop.  I would argue that the graphic designers can have their Macs and I can have my PC, but alas, that is not possible.  So, with great hesitation, I accepted by brand new 17inch Macbook Pro.

Firstly, the specs on this machine aren’t spectacular, but they aren’t bad either.   It has a 2.8Ghz Core 2 Due in it, with 4 GB of DDR3 memory.  It has some type of Nvidia card in it as well, but I can’t seem to find out what type.  Either way, good, but not amazing or anything.

The display is probably the high point of the laptop.  It has a nice matte finish (per my request), and some ridiculously high resolution.  Problem for me is that the resolution is so high that it makes it hard to read text.  That’s okay though, because I’ve learned the zoom shortcut keys for all of my favorite applications.

Coding on a Mac works much the same as it does anywhere else.  I tried to use a port of Gedit as my default editor, but I ran into problems with it saving backups when I didn’t want them.  I ended up switching to Textmate, which so far seems like a nice package.  My only real gripe with Textmate is that it changed the default behavior for the “End” key.  It says “Oh, you want to go to the end of the line?  I don’t!  Lets go to the end of the document instead!”.  Turns out, you need to press CMD+Arrow to get to the end of the line, which I find extremely annoying.  Actually, CMD + anything is annoying.  The ctrl key works fine for everyone else, but Apple just has to go an ruin it for everyone.

Aside from that, life goes on much as it always has.  Code works much the same no matter where you are, it’s just a matter of how comfortable you are in that environment.

Categories
Other

Tether a Blackberry on Alltel

I cannot even describe to you the overwhelming feeling of accomplishment that I have now that I have finally tethered my Blackberry Curve (Alltel) to BOTH my laptops.  On Windows 7, it was fairly simple:  pair the phone, then set up a com port.  On the Mac, is was pair the device, set up the DUN for Generic & CDMA.  After that, the phone number, user name, and password are: #777, <your 10 digit phone number>, alltel.

It took me over a year to find that information on the internet.  I don’t know if people just don’t use Alltel or what, but it was exceedingly hard to find.

Down speeds are around 280kb/s, with uploads coming it at about 90kb/s.  Latency is around 330ms.  Not great, but not bad either.  I can easily work on those speeds, so long as I don’t need to do any heavy uploading/downloading.

If you need help tethering, leave a comment and I’ll see if I can help.

Categories
Other

Back

It’s been awhile since I’ve posted here, so I thought that I’d write a quick blurb about what has been going on in my life.  So far this year, I have:

  • Quit grad school.
  • Got a job as a PHP + MySQL developer for DDM Marketing and Communications in Grand Rapids, MI.
  • Become far better at PHP that I used to be.
  • Commuted over 5000 miles.
  • Bought a new car.
  • Went to Arizona to visit my sister.
  • Moved to Grand Rapids.
  • Ate at some excellent new food places.
  • …and FINALLY learned how to tether my Blackberry Curve (Alltel) to my computer via Bluetooth.

Overall, it’s been a fairly exciting couple of months.  I get married at the end of July, and look forward to that above all else.

Thanks for being patient.  New posts on the way.

Categories
Other

2001 VW Passat

For Sale! SOLD

2001 VW Passat – V6 – 5spd
167,800 Miles

Categories
PHP Programming

Disabling Internet Explorer Cross Site Scripting Filter (XSS)

A client of mine recently tasked me with figuring out why the newer versions of IE were throwing a Cross Site Scripting (XSS) error.  For the life of me,  couldn’t figure out why.  Maybe it was because they were submitting a form to another server?  Or perhaps because the Javascript was closing the window when it was done?  I don’t know.  But, I did find a nice little trick that allows you to disable the Cross Site Scripting(XSS) filter in IE.

All that you need to do is add “X-XSS-Protection: 0” to the response header.  For instance, to disable the Cross Site Scripting(XSS) filter all you do is:

header(“X-XSS-Protection: 0”);

That’s it.  Usually that will resolve any XSS errors you have.  It may not be the best solution from a security stand point, but it’ll work in a pinch,

Categories
Other

Discovering a Cross Site Scripting Attack

As any good free-lance web developer does, I was browsing my competition’s portfolio earlier this evening.  I was curious as to how the layout was done on one of their client’s web pages, so I opened the source.  Near the bottom, there were probably 100 links injected into the page.  It turns out that they were the victim of a cross-site scripting attack.

I immediately notified the owner, but I’m still pretty excited that I made a discovery like this.  You hear about cross-site scripting attacks all the time, but I’ve never actually discovered one.

For those interested, the site in question is:  http://www.skydivecms.com/

Categories
IPhone App Development

iPhone and iPod Touch Development: Starting Out

Beginning iPhone 3 Development Book CoverLast Christmas I graduated from college.  One of my graduation gifts was a 2nd generation iPod Touch!  At the time, the iPod Touch was one of the coolest things I had ever got.  I immediately started to play with it, and was impressed with it’s ability to know the orientation of the device.  It’s multi-touch support was also impressive.  Probably the coolest part of owning an iPod Touch was that “there’s an app for that” attitude.  The sheer volume of available apps was mind blowing.

After graduation I started grad school, so I didn’t have much time to play on the technical side of iPod Touch and iPhone development.  However, I now have the time, and what follows is my journey on the road to iPod Touch and iPhone development enlightenment.

Getting Started

iPod Touch on top of "Beginning iPhone 3 Development"
The iPod Touch. A little banged up, but still amazing.

Before I even got started with iPhone development, I already ran into a problem:  I don’t own a Mac, nor do I want to own one.  It’s not that I don’t like them.  They’re beautiful machines with top of the line hardware and software, it’s just they’re a little outside my

price range.  So, how does one go about developing for the iPod Touch and iPhone on a Windows machine?  Well, there are a few different options.  Some revolve around Cygwin, while others around VMWare.  There is a good thread going on over at Stack Overflow (here) about it.  Depending on your situation, you may want to just pony up the cash for a Mac Mini, but to each their own.  In my case, I went with one of the methods listed above.

About the Book

The book I’ll be using for this adventure is “Beginning iPhone 3 Development:  Exploring the iPhone SDK” by Dave Mark and Jeff LaMarche.  It was reasonably priced, well reviewed, and had a grapefruit on the cover.  How could I possibly go wrong with this?  While I’ve only read the back cover at this point, the only problem I have with it is that it fails to mention the need for a Mac.  Some people might say “Duh!  Of course you need a Mac for iPhone and iPod Touch development!”, but it’s not always obvious to everyone.

Requirements

As with most development projects, there are a few things you need before you get started.  In the case of iPhone & iPod Touch development, you need the iPhone SDK (also, from this point forward I’m going to start referring to “iPhone & iPod Touch development” as “iPhone development”).  To get at the iPhone SDK, you need to visit http://developer.apple.com/iphone/ and sign up to be an iPhone developer.  It’s free (or has free options), so that’s a relief.

The sign up process seemed fairly painless.  While I’m not a huge fan of having to register and give out personal information, they control the SDK, so I suppose I must do as they say.  Nothing too suprising once you’re through the registration though, except the download is 2.5 GB!!! The worst part is that I have no idea why.  I always thought Netbeans with the JDK/JRE was huge, but this thing blows it out of the water.

Hello World

It’s a programming tradition to learn any new programming language with a simple “Hello World” program.  Even when not programming, some programmers still use “Hello World” to break the ice.  Hardly one to break with tradition, I’m going to be starting with a “Hello World” too, except this time for an entire platform, instead of just a programming language.

After much fumbling around, here are the steps to getting a “Hello World” program started.

  1. Open XCode and select New Project… from the File menu.
  2. Select View-based Application.
  3. Name your project Hello World.
  4. In the Groups and Files window, open the Resources group.
  5. Double Click the file Hello_WorldViewController.xib
  6. With the view now open, browse down the library until you find Label.
  7. Drag the label to the view.
  8. Double Click the label, and type “Hello world!”.
  9. Now go to File, then Save.
  10. Go back to Xcode and select Build, then Build and Run.

Honestly, I expected it to be a bit harder than this.  Next time I’m hoping to make it though chapter 3, where I get to learn how to handle basic user interaction!  As always, any feedback is welcome.

Categories
Other Programming

Using HTTPService to get XML results from a server

I’m not a Flex developer, but I’m quickly becoming one.  Recently I was tasked with creating a Flex form, sending it to the server, waiting for a response, and handling things accordingly.  My problem was that I couldn’t figure out how to use my result set that I received from the server.  Turns out, I needed to import a EventResult library, which was the turning point.

The Actionscript

import mx.rpc.events.ResultEvent;

private function thanks(evt:ResultEvent):void{
var dataFromServer:XML = XML(evt.result);
mx.controls.Alert.show(dataFromServer.toXMLString());
}

The Flex

<mx:HTTPService
id=”srv” useProxy=”false”
url=”http://localhost/form.php” method=”POST”
contentType=”application/x-www-form-urlencoded”
resultFormat=”xml” result=”thanks(event); “>
<mx:request>
<name>
{ bname.text }
</name>
<address>
{ baddress.text }

</address>
</mx:request>
</mx:HTTPService>

What happens here is that the HTTPService sends my data to the server, then some new data is returned in XML format.  Important things to remember are the ResultEvent that is passed to the event handler.  Just passing a normal event didn’t do much for me.