#120 Thinking Sphinx

If you need a full text search engine, Thinking Sphinx is a great solution. See why in this episode.

#120 Thinking Sphinx

If you need a full text search engine, Thinking Sphinx is a great solution. See why in this episode.

Contrast and XLCRS – Ruby on Rails Podcast

Consulting firm Contrast talks about their upcoming app, Exceptional. Mike Gilbert of XLCRS talks about using Rails to solve everyday problems.
From Dublin, Ireland.

Sponsor

Contrast and XLCRS – Ruby on Rails Podcast

Consulting firm Contrast talks about their upcoming app, Exceptional. Mike Gilbert of XLCRS talks about using Rails to solve everyday problems.
From Dublin, Ireland.

Sponsor

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

20080722_IphoneEveryWhere.png

From hasiphone.com July 22nd 2pm.

4 stores out of 188 has iPhones 3G

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 now with US map

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

#119 Session Based Model

If you have a lot of logic associated with the data inside a session, you’ll need some central location to put this logic. See how to create a session based model in this episode.

#119 Session Based Model

If you have a lot of logic associated with the data inside a session, you’ll need some central location to put this logic. See how to create a session based model in this episode.

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

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.

#118 Liquid

Liquid is a safe way to provide a powerful template language to the site’s users. See how in this episode.

#118 Liquid

Liquid is a safe way to provide a powerful template language to the site’s users. See how in this episode.

RailsConf Portland 2008: Apricado, New Relic, Phusion – Ruby on Rails Podcast

Interviews with the developers of Apricado, New Relic RPM and Phusion Passenger.

Sponsor

RailsConf Portland 2008: Apricado, New Relic, Phusion – Ruby on Rails Podcast

Interviews with the developers of Apricado, New Relic RPM and Phusion Passenger.

Sponsor

[PLUGIN RELEASE] ActsAsOverflowable

acts_as_overflowable

Written by Nicholas Lega

== DESCRIPTION:

Allows a column to overflow data into a secondary column if the data size exceeds the character limit. This is useful for fast indexing.

Instead of trying to index text blobs, you can specify a varchar column to be used for indexing. Any characters that do not fit into the base column will be automatically saved into or retrieved from an overflow field.

== SYNOPSIS:

Create overflow column migration:


class CreateOverflowModels < ActiveRecord::Migration
def self.up
create_table :overflows do |t|
t.integer :overflowable_id
t.string :overflowable_type
t.string :overflow
t.timestamps
end

add_column(:my_class_that_uses_overflows,
:has_overflow,
:boolean)

add_column(:my_class_that_uses_overflows,
:overflowable_text,
:string,
:limit => 255)
end

def self.down
drop_table :overflows

remove_column(:my_class_that_uses_overflows,
:has_overflow)

remove_column(:my_class_that_uses_overflows,
:overflowable_text)
end
end

Add to model:


class MyClassThatUsesOverflow < ActiveRecord::Base
acts_as_overflowable :overflow_column => :overflowable_text,
:overflow_limit => 255,
:overflow_indicator => :has_overflow,
:overflow_table => :overflows
end

To get and set the value of the “overflowable_text” field as described in

Continue reading “[PLUGIN RELEASE] ActsAsOverflowable”

[PLUGIN RELEASE] ActsAsOverflowable

acts_as_overflowable

Written by Nicholas Lega

== DESCRIPTION:

Allows a column to overflow data into a secondary column if the data size exceeds the character limit. This is useful for fast indexing.

Instead of trying to index text blobs, you can specify a varchar column to be used for indexing. Any characters that do not fit into the base column will be automatically saved into or retrieved from an overflow field.

== SYNOPSIS:

Create overflow column migration:


class CreateOverflowModels < ActiveRecord::Migration
def self.up
create_table :overflows do |t|
t.integer :overflowable_id
t.string :overflowable_type
t.string :overflow
t.timestamps
end

add_column(:my_class_that_uses_overflows,
:has_overflow,
:boolean)

add_column(:my_class_that_uses_overflows,
:overflowable_text,
:string,
:limit => 255)
end

def self.down
drop_table :overflows

remove_column(:my_class_that_uses_overflows,
:has_overflow)

remove_column(:my_class_that_uses_overflows,
:overflowable_text)
end
end

Add to model:


class MyClassThatUsesOverflow < ActiveRecord::Base
acts_as_overflowable :overflow_column => :overflowable_text,
:overflow_limit => 255,
:overflow_indicator => :has_overflow,
:overflow_table => :overflows
end

To get and set the value of the “overflowable_text” field as described in the test model, use:


# #{my_field_name_here}_with_overflow is the method name
long_text = overflowable_obj.overflowable_text_with_overflow

overflowable_obj.overflowable_text_with_overflow = very_long_text

Simply using the getters and setters for “overflowable_text” without appending “_with_overflow” to the method name will return the fragment of the text contained in the base column.

== INSTALL:

sudo gem install revolutionhealth-acts_as_overflowable -s http://gems.github.com

== SOURCE:

http://github.com/revolutionhealth/acts_as_overflowable/tree/master

== FEATURES/PROBLEMS:

* Only tested on mysql and sqlite3

iPhone 3G or not?

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 🙂

#117 Semi-Static Pages

Static pages can sometimes be a little awkward to add to a Rails app. See a couple different solutions to this problem in this episode.

#117 Semi-Static Pages

Static pages can sometimes be a little awkward to add to a Rails app. See a couple different solutions to this problem in this episode.

Geoffrey Grosenbach – Ruby on Rails Podcast

Adam Keys interviews Geoffrey Grosenbach about his blog, PeepCode, and the bass.
We also introduce the term for 2008: show the whale.

Sponsor