Thursday, March 25, 2010

New Ruby on Rails Setup on Windows XP

Ruby on Rails(2.3.5) Setup on Windows XP

I followed the directions on rubyonrails.org

I installed rubyinstaller-1.8.7-p249-rc2.exe

Then I updated the gems.
-------------------------------------------------
update ruby gem
   C:\>gem update --system                 
install rails
   C:\>gem install rails                   
-------------------------------------------------
Let's see what's installed.

C:\>gem list --local                       
                                                                     
*** LOCAL GEMS ***                         
                                                                     
actionmailer (2.3.5)                       
actionpack (2.3.5)                         
activerecord (2.3.5)                       
activeresource (2.3.5)                     
activesupport (2.3.5)                      
rack (1.0.1)                               
rails (2.3.5)                              
rake (0.8.7)                               
rubygems-update (1.3.6)                    
-------------------------------------------------

Install the mongrel gem
    C:\>gem install mongrel 
-------------------------------------------------
Let's see what's installed.

C:\>gem list --local                       
                                                                     
*** LOCAL GEMS ***                         
                                                                     
actionmailer (2.3.5)                       
actionpack (2.3.5)                         
activerecord (2.3.5)                       
activeresource (2.3.5)                     
activesupport (2.3.5)                      
cgi_multipart_eof_fix (2.5.0)              
gem_plugin (0.2.3)                         
mongrel (1.1.5)                            
rack (1.0.1)                               
rails (2.3.5)                              
rake (0.8.7)                               
rubygems-update (1.3.6)                    
win32-service (0.5.2)                      


-------------------------------------------------

Install mongrel_service for mswin32
    C:\>gem install mongrel_service --platform=mswin32 
-------------------------------------------------
Let's see what's installed.

C:\>gem list --local                       
                                                                     
*** LOCAL GEMS ***                         
                                                                     
actionmailer (2.3.5)                       
actionpack (2.3.5)                         
activerecord (2.3.5)                       
activeresource (2.3.5)                     
activesupport (2.3.5)                      
cgi_multipart_eof_fix (2.5.0)              
gem_plugin (0.2.3)                         
mongrel (1.1.5)                            
mongrel_service (0.3.4)                    
rack (1.0.1)                               
rails (2.3.5)                              
rake (0.8.7)                               
rubygems-update (1.3.6)                    
win32-service (0.5.2)                      
-------------------------------------------------
install gem for mySql
    C:\>gem install mysql 
-------------------------------------------------
Let's see what's installed.

C:\>gem list --local                       
                                                                     
*** LOCAL GEMS ***                         
                                                                     
actionmailer (2.3.5)                       
actionpack (2.3.5)                         
activerecord (2.3.5)                       
activeresource (2.3.5)                     
activesupport (2.3.5)                      
cgi_multipart_eof_fix (2.5.0)              
gem_plugin (0.2.3)                         
mongrel (1.1.5)                            
mongrel_service (0.3.4)                    
mysql (2.8.1)                              
rack (1.0.1)                               
rails (2.3.5)                              
rake (0.8.7)                               
rubygems-update (1.3.6)                    
win32-service (0.5.2)                      
-------------------------------------------------
install sqlite gem
    C:\>gem install sqlite3-ruby 
-------------------------------------------------
Let's see what's installed.

C:\>gem list --local                       
                                                                     
*** LOCAL GEMS ***                         
                                                                     
actionmailer (2.3.5)                       
actionpack (2.3.5)                         
activerecord (2.3.5)                       
activeresource (2.3.5)                     
activesupport (2.3.5)                      
cgi_multipart_eof_fix (2.5.0)              
gem_plugin (0.2.3)                         
mongrel (1.1.5)                            
mongrel_service (0.3.4)                    
mysql (2.8.1)                              
rack (1.0.1)                               
rails (2.3.5)                              
rake (0.8.7)                               
rubygems-update (1.3.6)                    
sqlite3-ruby (1.2.5)                       
win32-service (0.5.2)                      
-------------------------------------------------

It now works with slqite3 and mysql.

Lets add MS SQL server

install gem activerecord sqlserver adapter (http://github.com/rails-sqlserver/2000-2005-adapter)
    C:\> gem install activerecord-sqlserver-adapter 
I ran into a problem that it could install the gem so I have to dowdload devkit so it would "make" it has instruction on how to install.

installed devkit: unzipped rubyforge.org/frs/download.php/66888/devkit-3.4.5r3-20091110.7z 
into c:\ruby to get ruby-odbc to build
    C:\>gem install ruby-odbc  
        -- which built and installed v. 0.999



-------------------------------------------------
Let's see what's installed.

C:\>gem list --local                       
                                                                     
*** LOCAL GEMS ***                         
                                                                     
actionmailer (2.3.5)                       
actionpack (2.3.5)                         
activerecord (2.3.5)                       
activerecord-sqlserver-adapter (2.3.4)     
activeresource (2.3.5)                     
activesupport (2.3.5)                      
cgi_multipart_eof_fix (2.5.0)              
gem_plugin (0.2.3)                         
mongrel (1.1.5)                            
mongrel_service (0.3.4)                    
mysql (2.8.1)                              
rack (1.0.1)                               
rails (2.3.5)                              
rake (0.8.7)                               
ruby-odbc (0.9999)                         
rubygems-update (1.3.6)                    
sqlite3-ruby (1.2.5)                       
win32-service (0.5.2)                      
-------------------------------------------------

create a database on your SQL Server

Open your SQL Server client tool and create a database called sqlserverapp

Add a user with SQL Server authentication called user with secret as password to the database you just created.

Create an ODBC link name sqlserverapp to connect to this database.

Then you have to edit your database configuration file to tell rails to use SQL Server and your new database.

Create an ODBC link name sqlserverapp to connect to this database.

Edit the database.yml file.

Change the section under development with the following :

    development:
    adapter: sqlserver
    mode: odbc
    dsn: sqlserverapp 
    username: user
    password: secret
    host: mycomputer


Note : replace mycomputer with the name of your instance of SQL Server (in most cases, locahost should do the job).


You should be god to go.

Please see Rails 2 and SQL Server 2008 on Windows made simple for more information on connecting to the MS Sequel Server.

Friday, March 19, 2010

84

I rode a whopping 84 miles this week. I should be ready for the MS150 in may. I'm still looking for donations.

Wednesday, February 24, 2010

I rode with the Parker College guys today. We had a blast, but they hurt me today.
conditions: 40°F Partly Cloudy Wind: N at 10 mph Humidity: 43%

Tuesday, February 23, 2010

ride for 2010-02-23

I had a nice ride today. I felt like I had a lot of energy today. Always nice to ride with someone, although I think I might have hurt him.
38°F Cloudy Wind: N at 15 mph Humidity: 55% Windchill: 32°F

Data from my ride.

Wednesday, January 13, 2010

Friday, September 04, 2009

I Fell Off My Bicycle.

On Monday (2009-08-31) I was riding down the hill/bridge when I turned the corner to get off of NW Highway I hit a spot of water, that I didn't see, and the next thing I knew I was sliding across the road. Luckily there was a guy in a pickup truck that was at the stop sign and made sure I was OK and gave me a ride back to the office. Mike Owens got a bunch of First Aid stuff to patch me up. I didn't hit my head.

My bike doesn’t seem too bad. The brakes a rubbing and I need to adjust my rear derailleur. It’s clicking when I pedal. I’m going to take it to the shop to have them look at it. Also get it tuned up since it’s been a few years since I’ve done that.

Here are some pictures.
Shortly after it happened

The next day.

Wednesday, August 26, 2009

creating PDF and fonts





ColdFusion - Creating PDFs and CSS


original code.

<cfoutput>

<cfdocument format="PDF" bookmark="yes">

<style>

<!---
td{border-bottom: 1px solid ##cccccc; font-size: 10pt;}

-->
</style>

<cfloop query="GetRemotes">

 <cfdocumentsection name="#remoteLocationsMailingAddressRet.name#">

        <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
            <tr valign="bottom">
                <td>#remoteLocationsMailingAddressRet.name#</td>
            </tr>
        </table>
 </cfdocumentsection>

</cfloop>

</cfdocument>

</cfoutput>


I noticed that when I commented out the <cfdocumentsection> tag the
CSS would be there. 


So I moved my <style> inside the <cfdocumentsection> tag and it uses
the CSS. :-)

go figure. 


so I now have 

------------------------------------
<cfoutput>

<cfdocument format="PDF" bookmark="yes">

<cfloop query="GetRemotes">

 <cfdocumentsection name="#remoteLocationsMailingAddressRet.name#">

<style>


<!---
td{border-bottom: 1px solid ##cccccc; font-size: 10pt;}


-->

</style>

 <cfdocumentsection name="#remoteLocationsMailingAddressRet.name#">

        <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
            <tr valign="bottom">
                <td>#remoteLocationsMailingAddressRet.name#</td>
            </tr>
        </table>
 </cfdocumentsection>

</cfloop>

</cfdocument>

</cfoutput>



Smashing!

Wednesday, July 08, 2009

Wednesday, February 18, 2009

The Official AMBER Alert for iPhone

AMBER Alert is the official iPhone AMBER Alert notification tool for AMBERalert.com. AMBER Alerts are issued whenever a missing child case is granted AMBER status and has been used to aide in the recovery of missing children. The iPhone application provides a real-time feed of recent alerts including victim photos and information, suspect photos and descriptions, vehicle photos and descriptions, and a reporting mechanism allowing you to report a sighting.

Tuesday, February 17, 2009

Secure your ColdFusion application against SQL injection attacks

Adobe - Developer Center : Secure your ColdFusion application against SQL injection attacks

I'm rewriting a CF app and it's scary how vulnerable this app was. I wish tutorials would start off with security. I know it's not fun or sexy but it's needed.

Tuesday, January 13, 2009

Cycling Weight Loss - bicycling.com

Cycling Weight Loss - bicycling.com
These cyclists each lost 100 pounds or more. Here are their stories--and advice on launching your own breakthrough season. FTW!

Thursday, November 20, 2008

Google's AJAX Libraries API

for those that use YUI:
http://yuiblog.com/blog/2008/11/19/yui-google/

googles info:
http://code.google.com/apis/ajaxlibs/documentation/

The AJAX Libraries API is a content distribution network and loading architecture for the most popular open source JavaScript libraries. By using the google.load() method, your application has high speed, globally available access to a growing list of the most popular JavaScript open source libraries.

They also host

  • jQuery
  • jQuery UI
  • Prototype
  • script_aculo_us
  • MooTools
  • Dojo
  • SWFObjectNew!
They also list what versions they host.

Wednesday, October 29, 2008

Adobe - Developer Center : Using Ajax to retrieve data from ColdFusion

Adobe - Developer Center : Using Ajax to retrieve data from ColdFusion

Adobe Platform Evangelist Adam Lehman demonstrates how easy it is to populate drop-down lists in a simple application with data from ColdFusion.