Saturday, December 10, 2011

Mr. Tech Reviews the iPad

I've always been kind of a sideways fan of Apple. Ever since they adopted Berkely Unix as part of their Base Operating System, I thought it was a good alternative to Windows. I'm pretty much a died in the wool Open Source guy, I run Linux on my desktops and have been even know to run a copy of FreeBSD now and then.

The reason I've chosen this route, is twofold. One I get every ounce or CPU and Memory I paid for. It uses all of it. Second, I don't have to worry about constant upates to protect me from malware and other nasty threats. I update every once in awhile, but most updates are not "life threatening"

It's always been my opinion that Mac's are nice, if you have wads of cash to waste on looks. There is no performance advantage in buying a Mac. There are some security advantages in using an *nix based operating system over Windows, so Mac's score points there.

But I digress a bit. The iPad is not a Berkely Unix based operating system, it's Apples iOS 5. So it loses a few points there.

No Flash Support

One of the biggest glaring gaps are It doesn't support Flash. Now I've never been a big fan of Flash, but but there are a lot of sites that use it. I'm not a big fan of Javascript either, but since so many sites use it, browsers have to support it. Steve Jobs was pretty smug when he said "iPad users aren’t missing much video", in April of 2010. Here my short list of things I can't do on the iPad, because of lack of support for flash.
  • Daily Show with John Stewart Full Episodes
  • Grooveshark
  • South Park
  • Colbert Report
  • Any Flash Games
I'm not a big Facebook fan, but lots of people like to play those games and there's just lots and lots of Flash content out there and it's quite a big hole in the iPad to not support Flash. Almost every other manufaturer of tablets has Flash pre-installed. The iPad not only doesn't have it pre-installed, you cannot install it. If you go to the Adobe website it says it's not available "because of restrictions that Apple has put in place." So what I'm gathering is that even if Adobe had a version of Flash that would install on my iPad Apple won't let them do it? Why?

Music is a hassle

Next up on the list. My music. I've got lots and lots of MP3's, OGG's, WAV's and other audio formats, and I would like to be able to copy said files from the desktop of my choice to my tablet. Not so with the iPad. To get music into your iPad you have to install a 300mb applications, (The iTune store), then load all of your music into iTunes, which now makes another copy of your music, taking up twice the disk space, in Apples proprietary format. It was the same thing with the iPods, just a lot of back bending to get a music file from point A to point B. I've had a G1 phone for years and all I've ever had to do, to move music, video, or other files to and from my device is plug it in to any machine, Mac, Windows or Linux and drag and drop. It looks like a thumb drive to whatever machine I plug it into, no additional software is required. iPads on the other hand force you to install a large application and sign up for an account, verify your e-mail address, etc. Just to put your music files into your device. I'm sorry I just don't feel it's necessary for me to have to reveal my personal information to Apple, just so I can put my music on my device. I also now get regular spam from the iTunes store, and I assume I can opt out, but I'll have to log into their site to do it.

No Java

There are a lot of mobile devices that don't support Java. But the iPad is not a phone. It touts itself as being a crossover device between a phone and a desktop. I kind of expect that it will run my desktop applications. I've got quite a few applications that depend on Java applets loaded on the web, and my favorite IDE Eclipse

What it does well

So let's talk for a minute about what it does well. I have to say it looks very nice. It's a very sexy piece of technology. The included E-mail application is nice and the Safari Web browser seems to work well. The UI is snappy and has a nice feel to it. And I have been able to find a couple of useful free applications.

iPad Applications

Here's a short list of free iPad apps that I've really liked so far.
  • ABC Player - Since iPad doesn't support Flash, you'll need this if you want to watch streaming video from ABC. There's an NBC player and a PBS player as well. You'll need these extra apps if you want streaming video. Comedy central has a player, but you have to pay for it. If you have flash, watching full episodes is Free.
  • Flipboard - a cool way to read the news, allows you to change pages like flipping the pages of a book.
  • PivotalTracker - I've been using this Agile task management system in Eclipse and on the Web, I've very stoked that there's an iPad client because Safari seems to have problems with the Pivotal web interface.
  • MetalStorm - A fun, free basic flying a jet and shooting down other planes game. I've been laying off the games as of late (much too much work), but this one is a fun quick distraction.
  • UYH - Use Your Hand, a very cool little notepad app, that lets you use your finger to write like a pen. It doesn't to OCR, which would be ultra cool, but it's works pretty well if you want to write instead of type.
  • Skype - This has been a very cool app for a long time and the iPad app is no different, it made me fall in love with tablet computing. With the front and back camera's in the iPad you can do "see what I see types of calls"
For every cool application there are probably about 1000 that are just junk, much like the Android app ecosystem. Either they are a rip off of the original that doesn't work quite as well, or they are just overpriced for what they offer. For example having to pay for an application to watch streaming video that will also have commercials inserted. I can see paying money for a really robust application, but most of the things that are being charged for just aren't worth it. That being said, iPads, and Macs in general have always been targeted at those who don't mind spending a few extra bucks on something that looks sexy and stylish. If you don't really care about the looks, these are all things I was doing years ago with my G1 phone. The tablet glued a bigger screen to the whole affair, and voila!, a Tablet. So really what I have here, is a nice big sexy smart phone that won't do Flash, won't easily store my music and won't make phone calls, although there is a Skype client and several other VOIP clients. That being said, this was given to me as a gift. Because of that fact alone, I love it dearly. There are quite a few things that it does well, but I'm rather reticent to support a company that mucks around with likes of patent trolls. This type of behavior has seriously tarnished my impression of a company that at least had the 'nads to put a Unix based OS on their desktops. DISCLAIMER: My opinions are strictly my own and do not reflect the opinions of anyone I have worked for, currently work for or may work for in the future. They also do not reflect the opinion of my cat, my next door neighbor, or the guy that hangs out down at the beach and talks to himself. My final opinion is to follow my geeky heart and gravitate towards, Open Source and Android. If I'm going to do a tablet. It's just got to be Android. The main reason, is that if I chose a set of applications and I get to like them. If I stop liking the hardware. Or the hardware vendor starts providing crappy customer service, or I stop liking the hardware vendor for any other reason. I can buy hardware from any other number of vendors that my application will run on. Locking yourself into a single hardware/software solution has never been a good idea, no matter how many dancing monkeys, or dolphins jumping through flaming hoops you get along with the deal, being able to choose is always a good thing.

All that being said, at the end of the day, I have to support a company that is going to further my chosen profession, as a creator of technology solutions, and I have to avoid supporting companies that indirectly hurt my profession, in the blind pursuit of profit, no matter how cool it would be to have a dolphin, ride a flaming monkey shot from a cannon, through a big letter A.

Thursday, October 13, 2011

The day I met Dennis Ritchie

I know I haven't posted in awhile, and I'm sorry, but you know I've been real busy, working on new projects and finishing old ones. I just had to post a little something though as a tribute to our fearless leader and geek of all geeks. I only met him once but I got to speak with him for a full hour and ask him all the questions I ever wanted, well maybe not all, but most of them.

First I have to say that Jeong Kim, president of Alcatel-Lucent Bell Labs, described him best as a "humble and gracious man". In the tech industry, when people get to a certain level of knowledge, they tend to go one of two ways. Either they share the wealth and are happy to tell you what they know, or the get all "Ivory Tower" and become aloof and uncaring. Dennis Ritchie definitely went the "share the wealth route". Most people have no idea how much this man contributed to computing, and how what we do is only possible because we stand squarely on his shoulders.

I met Dennis Ritchie over 10 years ago. I have to qualify my story, with, it was 10 years ago, and I may not get every detail right (In case the story police happen by :p). At the time, I was producing and hosting a talk radio show called RadioNet. We broadcast on the AM radio on KSCO in Santa Cruz, California and we also streamed our show on the Internet using RealAudio and TrueSpeech. We interviewed the stars of technology and talked about this great "new" thing the Internet. The RadioNet crew, packed up the show and took it to Networld/Interop, which was THE big networking show of the day. Dennis Ritchie was there with his new operating system he called "Plan 9", named after the science fiction movie.

Of course I asked him about C and Unix. First came C. The need there I was told was a result of the old programmers adage, "Laziness is a virtue". They had some code on a PDP-11 that they wanted to run on a different piece of hardware, maybe it was the other way around, but back then, if you wanted to write a program that did X on one machine, you'd have to write a whole new program to to X on a machine from a different hardware vendor.

The Answer was C. You could write one program, and with a "quick" compile you could run the same set of code on multiple machines, Brilliant!!! Lazy :) C is still the language of choice if you want something ultra fast and tight, and a large number of Internet Servers out there are written in C. It's not the easiest programming language to write in, but it's certainly one of the fastest and most widely used.

I also asked him about Unix. I was told by the master, that there were 3 main things they did with Unix. First was the whole idea of files and directories in a hierarchical structure. It wasn't until Windoze, that the whole drive letter thing and backslash got introduced to confuse things.

The second idea behind Unix was no matter where you read and write from whether it be a file on the disk, a screen or a printer, you do it the same. Everything you could ever want to read or write to is represented by a file you can open and read and write. Want to write a text file, open and write, want to print something on the screen, open the file that represents the screen and write to it.

The last thing and in my opinion the most brilliant thing was the ability to take the output of one program and make it the input of another program. This functionality allows me to do really groovy things like "find . -print | xargs grep foo". I won't explain what that means here, that's fodder for another article, suffice to say, I use input/output redirection at least once a day and have done so for the last 20 or so years.

No offense to Mr. Jobs, it sucks that anyone should die, but it saddens me to think that Steve is lauded as a hero an a pioneer, when all he really did was take existing technology and made it really slick and sexy. All this, while a titan, who invented the operating system that Apples run on today (BSD Unix), goes largely unsung.

You will be missed by all who knew you and all who know who your are. Fare the well my gentle giant.

Monday, June 27, 2011

LulzSec, Anonymous, who will it be next?

LulzSec and Anonymous are on everyones lips these days. They've practically become a household word. It never ceases to amaze me how the media can sensationalize something to the point of making people believe something is totally new. They never came right out and said it, but from reading the articles about these guys, it would make one think that organized groups breaking into peoples systems is totally unbelievable and unheard of. The reality is, that as long as the Internet has been around, there have been organized groups of "hackers" on both sides of this battle.

Now I first have to digress about the work "hacker". Just because someone is a "hacker" does not mean they break into computers. A "hacker" is someone who likes to take things apart and see how they work. Hacking does not imply malicious intent, it describes the action of pulling something apart to see how it works, then putting it back together in a new way that changes the way the original thing worked. For example, someone who takes the engine out of a car and puts a new engine in the car and modifies the car to fit the engine is a car hacker. Mostlty the term is applied to computers, as in, "I just hacked my Playstation and got it to run Linux".

"Cracking" on the other hand is the act of breaking into something by avoiding or breaking, the security mechanisms put in place, to protect computers from unwanted intruders. There are many "Cracker" programs that are easily downloadable on the Internet, that will unencrtypt files and recover passwords. There are programs avaialble to crack the passwords on anything from the spreadsheet you password protected, to your wireless network.

Encryption is entirely dependent on the assumption that there isn't enough computing power available to try all the possible combinations in a reasonable amount of time and break the encryption. The amount of computing power over the last 10 years has increased so much, that encryption that was used 10 years ago can easily be broken by the computers of today. The problem is, that many programs still in use today use those old encryption methods that are easily breakable.

The only real way to protect yourself, from cracking type attacks, is to use the strongest encryption methods available and employ things like public and private keys. Biometrics, Key fobs and other security devices can also be employed to reduce the likliehood that your network or computer will be compromised by a cracking attack.

"Exploiting" is another method that is used in breaking into someones system. An exploit is usually a bug in the software that allows an outside attacker to run programs on the machine that has the bug. A hole for an exploit can also be caused by a mis-configuration, or more commonly lack of configuration. There are many things you can do to protect yourself from these types of attacks. First make sure your software is always up to date and configured properly, out of the box, default configurations are seldom the most secure. Second, Firewalls and Intrusion Detection software are a must if you have a network that has computers that allow connections from the outside world. I could write many articles on the different ways to secure your network, and even more articles about the different ways people can get into your network, in short, make sure you hire a computer professional, that knows more about security than anti-virus programs, but I'll get back to my main rant.

The number one reason networks are broken into, is because the people making the decisions, don't listen to the people they hire to be their experts. Being secure on the Internet is expensive and takes time. For most companies, security is an afterthought and is often overlooked for the sake of cost or time savings. In the computer business, there's an old saying: "Good, Fast, Cheap.... Pick any two".

It's kind of like taking your car to a sports stadium. Do you leave your car unlocked when you park it there? Well imagine that this parking lot has some of the most sophisticated car thiefs with all of the latest in locksmith technology and that given enough time they can break into almost any car in the lot. In this parking lot, even if you lock your car, the only thing that's protecting you is the fact that there are more cars than car thiefs. That's how it is on the Internet. When you plug your computer into the Internet, it's like parking your car in that giant parking lot and if you don't have the latest in alarms and protection, eventually, they will get around to you.

LulzSec and Anonymous are just the ones that made it in the news. There are literally thousands more like them all over the world, and anything that you have, that's plugged into the Internet is available to them to have a go at. Once in, they can get at anything that you have stored on your computer and record anything that you type. You have to remember, the Internet is a public network and as such, anyone is allowed.

So as long as people "cheap out" on security and ignore the warnings of their technology people groups like LulzSec and Anonymous will have it easy. With more and more people getting "wired", pickings for these guys are pretty fat these days. The only reason a larger numbers of people have not been broken in to, is because the bad guys just haven't got around to them yet. Thar be monsters out there, are you travelling the jungle in a rickshaw or an armored tank? If you want to continue to navigate the jungle in a rickshaw, eventually, you will become the lions dinner.

Monday, April 4, 2011

Using regex on a Drupal RSS Feed

A brief intro on regex

regex or "Regular Expressions" are used just about everywhere. When you do a search on google, you are using a form of regular expression. When you do a find in a document, you are also using a form of regular expression.
What is a regular expression, for the un-initiated? Simply put, a regular expression is a way to write a concise definition that matches characters, words, and pattern in strings of text and documents. I won't go into a tutorial about "regex" - pronounced "rej-ex", you can read up about it at Wikipedia if you want to know more.

Testing your expressions

I've used regex for many years and many forms, and I've always struggled with it. It's kind of obtuse, and I've seen regular expressions, for verifying a valid e-mail address, that are hundreds of charachters long. It can get really complicate really quickly. In experimenting with using Regex as a parser in the Drupal Feed Importer stack, I ran across a very awesome tool that allows you to test out your regular expressions. It's RegExr at gskinner.com, and it's one of the best regex testing tools I've found. It even shows you your grouping matches, does multiline, and lots of other neat stuff.

Install Drupal Modules

To use regex on a news feed import in drupal, you'll first need the Feeds Module. This module allows you to import news feed items and elements into drupal nodes. Next you'll need the Feeds Regex Parser. This little module is great if you have a news feed that doesn't have the field parsed out all nice for you. In my case, I had a long address in one string and I need to pull the street address, city and state out. With the Feeds Regex Parser, you can import pieces from pattern matches using groupings.
For example, say I have a news feed that looks something like this:
<feed>
<item>
<address>123 Anystreet, Yourtown, CA</address>
</item>
<item>
<address>234 Anotherstreed, Anothertown, MI</address>
</item>
</feed>
And I want to pull out the address part of this without the town and state, and make it the title of the node I create from the feed.

Add New News Feed Importer

First create a new feed in Administer->Site Building->Feed Importers.
Give the feed a name and a description, then set up the feed on this screen:

Click on the basic settings and make sure you have the content type set as "Use standalone form" and that the Minmum refresh period is "Never". You can change the refresh period to your liking once it's all tested and working.

The fetcher should default to "HTTP Fetcher", so you don't need to make any changes here.
Next click change next to parser, then click "Select" next to the Regex Parser entry:

Once you've chosen the regex parser you can move on to the node processor settings, since the regex parser doesn't have any settings. Pick the content type you want to create with each feed item. I have chosen page, but if you choose feed, or feed item, your post will get created as part of an individual feed that has multiple nodes. I just want one page with no attachments, per news feed item, so I have chosen content type of "Page".

You can of course flavor the above to taste. Next is creating your mapping, which is pretty simple. You just select the only choice from the pulldown on the left, then select the field you want to load it into. Create as many entries as you need. We only need to pull the street address, so we'll create one.
We also need a unique identifier for this item, so we don't keep creating a new document every time we see it in the news feed. I'm using GUID. Notice I've checked the box on the GUID line to make it my unique target after I added it.

Import Your Data

You're almost there. Next you click on the top level menu item "Import", then click on the name of the importer you created. You can now enter your regular expressions. I've over simplified mine, and these most definately could be better in terms of construction, but I'm not here to discuss elegant regex writing. What I want to demonstrate below, is that your context, is your "Record Context", i.e. in what context will all of your record chopping regex occur?
So in the example below, my context shows <item></item> and then I am free to parse out my fields below that.
Lastly, enter the URL for your feed, then hit the import button and you are good to go!!
Anything that is specified in your grouping (In between the parenthesis) will be loaded into the field you specified in your mapping.

Caveats and Patch

You can use preg_match_all switches below, but I was not able to get them to work as expected. Also you can only have one group so a regex like the following won't work:
/$(.*),(.*)/
It will take whatever is in the first group.
I did write a small patch that concantenates the groups into one string for loading
In the FeedsREGEXParser.inc file in the module. Modify the following:
if (isset($matches[1])) {
return $matches[1];
} else {
return $matches[0];
}
}
To Be:
if (isset($matches[1])) {
$retval = "";
for ( $i = 1; $i < count($matches); $i++ ) {
$retval .= $matches[$i];
}
return $retval;
/* return $matches[1]; */
} else {
return $matches[0];
}
}
I'll submit this patch to the creator of the module for possible future inclussion, but in the meantime, it can help you strip comma's out of numbers and the like. So for example, something like:
/\$(.*),(.*)/
When applied to a string of "$100,000"
Will result in the number:
100000
Which can then be happily loaded into any numeric field.
-MT

Wednesday, February 16, 2011

How to sell your digital photography online

With the advent of digital camera's and sites to sell your work on, it's never been easiers to make a little extra income by selling your digital photo's online.

I've been putting some time into assembling a stock photo library and have been putting some of my photos up on the various sites that sell stock photography. I'm at about a 25% to 50% acceptance rate depending on the site. These sites have editors that review the photo's and only post photos for sale that meet their standards. I've commented below on what I've found on each one. Some of them take up to a week to approve your photos for sale.

Sites I've found so far that you can easily sell your images on, are:

http://www.fotolia.com - Accepted the largest number of my photos (the Walmart of stock photos), can queue up largest number of photos for approval.

http://www.dreamtime.com - More picky than fotolia, but they also allow you to submit the raw file in addition to your JPG. they also allows you to queue up a large number of photos for approval.

http://www.bigstockphoto.com - about as picky as dreamscape but they only allow you to queue up 15 photos at a time until your approval rating gets to a certain point.

http://istockphoto.com - The pickiest of the bunch, and before you can submit anything you have to submit your 10 best images and if you don't get at least 7 out of 10 approved you have to wait 30 days before you can submit another 10.

I've also been playing around with High Dynamic Range Pictures and as soon as I get things uploaded and organized I'll post some of the links up here, one thing I have to say about that is Bracketing Rocks!!!.

Here's an example of a shot I took on a recent road trip that I applied the HDR stuff too using exposure bracketing on my Cannon Rebel.

In a future article, I'll talk about how I did it. It's become much easier with The Gimp