Flash Player 10 Mobile for iPhone?

Posted by Daniel Wanja Wed, 27 Aug 2008 21:58:00 GMT

I was viewing the video of the Day 1 Keynote by Mark Anders at 360Flex where he made a reference to a mobile Flash application build in Flex. Mark just skinned a desktop app which turned in into a very iPhone like application which just happen to have the iPhone screen dimensions and behavior. It's 56 minutes in the presentation. Check it out and let me know what you think. I've included a video extract here after (without the sound): That's when he changed the skin:
20080827_flexiphoneskin.png
That would be cool if we could soon start coding in Flex for the iPhone. Enjoy! Daniel.

What are all the Rails Date Formats? 3

Posted by Lee Marlow Wed, 20 Aug 2008 22:54:00 GMT

Ever forget what all the Rails defined Date/DateTime/Time#strftime formats are? Or forget what ones you added to the project yourself?

Ala rake routes comes rake date_formats:

Sample output from a Rails 2.1 app:
Date
====
            db:'%Y-%m-%d'   2008-08-20
  long_ordinal:'&proc'      August 20th, 2008
          long:'%B %e, %Y'  August 20, 2008
        rfc822:'%e %b %Y'   20 Aug 2008
        number:'%Y%m%d'     20080820
         short:'%e %b'      20 Aug

DateTime
========
            db:'%Y-%m-%d'   2008-08-20 16:56:21
  long_ordinal:'&proc'      August 20th, 2008 16:56
          long:'%B %e, %Y'  August 20, 2008 16:56
        rfc822:'%e %b %Y'   Wed, 20 Aug 2008 16:56:21 -0600
        number:'%Y%m%d'     20080820165621
         short:'%e %b'      20 Aug 16:56

Time
====
            db:'%Y-%m-%d %H:%M:%S'         2008-08-20 16:56:21
  long_ordinal:'&proc'                     August 20th, 2008 16:56
          long:'%B %d, %Y %H:%M'           August 20, 2008 16:56
        rfc822:'%a, %d %b %Y %H:%M:%S %z'  Wed, 20 Aug 2008 16:56:21 -0600
         short:'%d %b %H:%M'               20 Aug 16:56
        number:'%Y%m%d%H%M%S'              20080820165621
          time:'%H:%M'                     16:56

360Flex sessions video - Day one

Posted by Daniel Wanja Tue, 19 Aug 2008 19:18:54 GMT

Sessions Posted:

  • TicketMaster Kiosk by Kevin Fauth
  • Flex Accessibility by Giorgio Natili
  • Reading the Flex source code by Jonathan Branam
  • Project Workflow by Axel Jensen
  • Creating Reusable Components by Ben Clinkbeard

From Ted’s blog.

Nested to_xml for awesome_nested_set

Posted by Daniel Wanja Tue, 19 Aug 2008 14:47:04 GMT

I was updating an example build using the better_nested_set to use the awesome_nested_set. One thing that I didn’t find in awesome_nested_set are some helper methods that are returning a full tree of the nested set as one XML document. With better nested set I could do

Category.result_to_attributes_xml(Category.root.ancestors)

So I have added the following full_xml method to my nested active record to recurse all the children. Note that the full_method calls the full_method on the children passing along the xml builder that is created by the to_xml method and passed as the xml variable to block, thus building a nested XML document.

class Category < ActiveRecord::Base
  belongs_to :parent, :class_name => "Category"
  acts_as_nested_set     

  def full_xml(builder=nil)     
    to_xml(:builder => builder, :skip_instruct => true) do |xml|
      children.each { |child| child.full_xml(xml) }
    end
  end

end    

Obviously it would be nice that the awesome_nested_set provides such a method.

So let’s assume I create the following nested structure:

Category.transaction do
  root = Category.create(:name => "Main Category")

  cameras = Category.create(:name => "Cameras & Photo")  
  cameras.move_to_child_of(root)
  Category.create(:name => "Bags", :qty_in_stock => 2).move_to_child_of(cameras)
  Category.create(:name => "Accessories", :qty_in_stock => 12).move_to_child_of(cameras)
  Category.create(:name => "Analog Cameras", :qty_in_stock => 0).move_to_child_of(cameras)
  Category.create(:name => "Digital Cameras", :qty_in_stock => 5).move_to_child_of(cameras)

  phones = Category.create(:name => "Cell Phones")
  phones.move_to_child_of(root) 
  Category.create(:name => "Accessories", :qty_in_stock => 8).move_to_child_of(phones)
  Category.create(:name => "Phones", :qty_in_stock => 20).move_to_child_of(phones)
  Category.create(:name => "Prepaid Cards", :qty_in_stock => 3).move_to_child_of(phones)

  dvds = Category.create(:name => "Dvds")
  dvds.move_to_child_of(root) 
  Category.create(:name => "Blueray", :qty_in_stock => 10).move_to_child_of(dvds)
  Category.create(:name => "HD DVD", :qty_in_stock => 0).move_to_child_of(dvds)
  Category.create(:name => "DVD", :qty_in_stock => 100).move_to_child_of(dvds)

end   

I can now get the whole nested structure in one go:

Category.roots.first.full_xml

And get the following XML in return.

<category>
  <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
  <description nil="true"></description>
  <id type="integer">1</id>
  <lft type="integer">1</lft>
  <name>Main Category</name>
  <parent-id type="integer" nil="true"></parent-id>
  <qty-in-stock type="integer" nil="true"></qty-in-stock>
  <rgt type="integer">28</rgt>
  <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
  <category>
    <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
    <description nil="true"></description>
    <id type="integer">11</id>
    <lft type="integer">2</lft>
    <name>Dvds</name>
    <parent-id type="integer">1</parent-id>
    <qty-in-stock type="integer" nil="true"></qty-in-stock>
    <rgt type="integer">9</rgt>
    <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    <category>
      <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
      <description nil="true"></description>
      <id type="integer">14</id>
      <lft type="integer">3</lft>
      <name>DVD</name>
      <parent-id type="integer">11</parent-id>
      <qty-in-stock type="integer">100</qty-in-stock>
      <rgt type="integer">4</rgt>
      <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    </category>
    <category>
      <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
      <description nil="true"></description>
      <id type="integer">13</id>
      <lft type="integer">5</lft>
      <name>HD DVD</name>
      <parent-id type="integer">11</parent-id>
      <qty-in-stock type="integer">0</qty-in-stock>
      <rgt type="integer">6</rgt>
      <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    </category>
    <category>
      <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
      <description nil="true"></description>
      <id type="integer">12</id>
      <lft type="integer">7</lft>
      <name>Blueray</name>
      <parent-id type="integer">11</parent-id>
      <qty-in-stock type="integer">10</qty-in-stock>
      <rgt type="integer">8</rgt>
      <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    </category>
  </category>
  <category>
    <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
    <description nil="true"></description>
    <id type="integer">7</id>
    <lft type="integer">10</lft>
    <name>Cell Phones</name>
    <parent-id type="integer">1</parent-id>
    <qty-in-stock type="integer" nil="true"></qty-in-stock>
    <rgt type="integer">17</rgt>
    <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    <category>
      <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
      <description nil="true"></description>
      <id type="integer">10</id>
      <lft type="integer">11</lft>
      <name>Prepaid Cards</name>
      <parent-id type="integer">7</parent-id>
      <qty-in-stock type="integer">3</qty-in-stock>
      <rgt type="integer">12</rgt>
      <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    </category>
    <category>
      <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
      <description nil="true"></description>
      <id type="integer">9</id>
      <lft type="integer">13</lft>
      <name>Phones</name>
      <parent-id type="integer">7</parent-id>
      <qty-in-stock type="integer">20</qty-in-stock>
      <rgt type="integer">14</rgt>
      <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    </category>
    <category>
      <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
      <description nil="true"></description>
      <id type="integer">8</id>
      <lft type="integer">15</lft>
      <name>Accessories</name>
      <parent-id type="integer">7</parent-id>
      <qty-in-stock type="integer">8</qty-in-stock>
      <rgt type="integer">16</rgt>
      <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    </category>
  </category>
  <category>
    <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
    <description nil="true"></description>
    <id type="integer">2</id>
    <lft type="integer">18</lft>
    <name>Cameras &amp; Photo</name>
    <parent-id type="integer">1</parent-id>
    <qty-in-stock type="integer" nil="true"></qty-in-stock>
    <rgt type="integer">27</rgt>
    <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    <category>
      <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
      <description nil="true"></description>
      <id type="integer">6</id>
      <lft type="integer">19</lft>
      <name>Digital Cameras</name>
      <parent-id type="integer">2</parent-id>
      <qty-in-stock type="integer">5</qty-in-stock>
      <rgt type="integer">20</rgt>
      <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    </category>
    <category>
      <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
      <description nil="true"></description>
      <id type="integer">5</id>
      <lft type="integer">21</lft>
      <name>Analog Cameras</name>
      <parent-id type="integer">2</parent-id>
      <qty-in-stock type="integer">0</qty-in-stock>
      <rgt type="integer">22</rgt>
      <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    </category>
    <category>
      <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
      <description nil="true"></description>
      <id type="integer">4</id>
      <lft type="integer">23</lft>
      <name>Accessories</name>
      <parent-id type="integer">2</parent-id>
      <qty-in-stock type="integer">12</qty-in-stock>
      <rgt type="integer">24</rgt>
      <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    </category>
    <category>
      <created-at type="datetime">2008-08-18T14:46:07Z</created-at>
      <description nil="true"></description>
      <id type="integer">3</id>
      <lft type="integer">25</lft>
      <name>Bags</name>
      <parent-id type="integer">2</parent-id>
      <qty-in-stock type="integer">2</qty-in-stock>
      <rgt type="integer">26</rgt>
      <updated-at type="datetime">2008-08-18T14:46:07Z</updated-at>
    </category>
  </category>
</category>

How do you deal with that situation?

iPhone in nearly every state. 147 out of 188 stores. 8

Posted by Daniel Wanja Tue, 22 Jul 2008 20:15:11 GMT

20080722_IphoneEveryWhere.png

From hasiphone.com July 22nd 2pm.

hasiphone.com now with US map

Posted by Daniel Wanja Mon, 21 Jul 2008 19:17:17 GMT

Thanks to the Degrafa library I was able to add a “US Map of iPhone 3G” Availability in an hour to the hasiphone.com application.

20080721_hasiphoneusmap.png

Also I automated the extraction part of the data and check every hour if new data is there. I was assuming that the data changes only once a day and therefore all the delta (the + and – next to the availability) are based on previous day. This morning there were only four stores with iPhones, and hour ago 76 and now 78. So it seems that the data is updated more frequently or I have a bug in my extraction routing. Whatever the situation I am leaving on vacations for the next two weeks and won’t take my notebook with me, so hopefully the data is correct. My good friend Sol will keep an eye on the extraction process to see that we get some daily data. Thanks Sol, ya da man.

Enjoy! Daniel.

is cool

4 stores out of 188 has iPhones 3G 5

Posted by Daniel Wanja Mon, 21 Jul 2008 14:10:58 GMT

20080721_ModelByStores.png

The phones are going faster than they are coming, only one store in each of these states are listed as having one type of the models: Florida, New Hampshire, California and Michigan. So if you take into account that some store list phones that didn’t work out of the box as available, the Apples Stores may well be out of stock today.

20080721_4stores.png

Data from: Apple.com and visualized by hasiphone.com

hasiphone.com - Statistics and Overview of iPhone availability at US Apple Stores 8

Posted by Daniel Wanja Fri, 18 Jul 2008 05:56:27 GMT

As part of the iPhone 3G mania I checked out Apple iPhone 3G availability website and that’s how I found where to buy my iPhone in Denver. I was however also wondering how many Apple store still had the iPhone in the US, so I wrote http://hasiphone.com that provides an overview of the availability of the iPhone 3G in the US based on the data provided by Apple website.

20080717_hasiphone.png

On the server an AIR application checks once a day the new availability data, crunches it up and saves it a a serialized datastructure to a ByteArray. The Hasiphone Flex application reads this data and visualizes it. Well, I spend 4 hours (which I didn’t really have before my vacations) on it, so their may be some glitches here and there. Leave comment on this blog if you find any issues.

Also a note of caution on the data. Like Apple’s site mentions it’s updated only once a day in the evening. One of the sales guy also mentioned to me that any iPhone that has an issue and cannot be sold but still is in stock may appear as available, thus their are stores that don’t have any 3G to sell but still show up on the list.

iPhone 3G or not? 12

Posted by Daniel Wanja Tue, 08 Jul 2008 03:29:47 GMT

Since they announced the iPhone 3G I am pretty convinced that there isn’t much new over my current iPhone. Camera is still 2Mega pixels, the plastic case is not so nice, gps is cool, but I have one in my car, 16Gb over 8 could be useful, form factor changed slightly so it may not fit in my car cradle. So it’s basically the same phone with slightly faster internet. But I’m such a sucker when it comes to gadgets and I was just reading this article on How to replace an original iPhone with an iPhone 3G. Now if only my wife didn’t want my current iPhone, I wouldn’t have to buy the new one :-)

Compassionate Communications. A different kind of Rails application. 3

Posted by Daniel Wanja Thu, 19 Jun 2008 04:29:00 GMT

I have been working with Sean and Lee on Compassionate Communications a Ruby on Rails website. My role was small thanks to the ActiveMerchant plugin, I helped with the online payment but my part was done in no time. The site launched just before Rails Conference and I wanted to write about what the site is. It's about giving, reaching out, helping...but I didn't find the right words to describe it. The team at Compassionate Communications made the following video that captures the essence of what they want to achieve way better I could describe..so go check it out.

Older posts: 1 2 3 ... 18