Archive Page 2

25
Jan
12

Benchmarking GoGrid Servers New 8 core 2.67 server

    1 Geekbench 2.2.6 : http://www.primatelabs.ca/geekbench/
    2 
    3 System Information
    4   Operating System      Linux 2.6.18-274.7.1.el5 x86_64
    5   Model                 Xen HVM domU
    6   Motherboard            
    7   Processor             Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz @ 2.67 GHz
    8                         1 Processor, 8 Threads
    9   Processor ID          GenuineIntel Family 6 Model 44 Stepping 2
   10   L1 Instruction Cache  32.0 KB x 8
   11   L1 Data Cache         32.0 KB x 8
   12   L2 Cache              256 KB x 8
   13   L3 Cache              12.0 MB x 8
   14   Memory                7.81 GB 
   15   BIOS                  Xen 3.1.2-164.11.1.el5
   16 
   17 Integer
   18   Blowfish
   19     single-threaded scalar   1800 |||||||
   20     multi-threaded scalar   13754 ||||||||||||||||||||||||||||||||||||||||
   21   Text Compress
   22     single-threaded scalar   2200 ||||||||
   23     multi-threaded scalar   14993 ||||||||||||||||||||||||||||||||||||||||
   24   Text Decompress
   25     single-threaded scalar   2433 |||||||||
   26     multi-threaded scalar   16283 ||||||||||||||||||||||||||||||||||||||||
   27   Image Compress
   28     single-threaded scalar   1997 |||||||
   29     multi-threaded scalar    9861 |||||||||||||||||||||||||||||||||||||||
   30   Image Decompress
   31     single-threaded scalar   2239 ||||||||
   32     multi-threaded scalar    8465 |||||||||||||||||||||||||||||||||
   33   Lua
   34     single-threaded scalar   4210 ||||||||||||||||
   35     multi-threaded scalar   27226 ||||||||||||||||||||||||||||||||||||||||
   36 
   37 Floating Point
   38   Mandelbrot
   39     single-threaded scalar   2223 ||||||||
   40     multi-threaded scalar   15518 ||||||||||||||||||||||||||||||||||||||||
   41   Dot Product
   42     single-threaded scalar   2923 |||||||||||
   43     multi-threaded scalar   21016 ||||||||||||||||||||||||||||||||||||||||
   44     single-threaded vector   3547 ||||||||||||||
   45     multi-threaded vector   27470 ||||||||||||||||||||||||||||||||||||||||
   46   LU Decomposition
   47     single-threaded scalar   1998 |||||||
   48     multi-threaded scalar   11009 ||||||||||||||||||||||||||||||||||||||||
   49   Primality Test
   50     single-threaded scalar   4276 |||||||||||||||||
   51     multi-threaded scalar   23493 ||||||||||||||||||||||||||||||||||||||||
   52   Sharpen Image
   53     single-threaded scalar   6097 ||||||||||||||||||||||||
   54     multi-threaded scalar   24567 ||||||||||||||||||||||||||||||||||||||||
   55   Blur Image
   56     single-threaded scalar   2117 ||||||||
   57     multi-threaded scalar   16269 ||||||||||||||||||||||||||||||||||||||||
   58 
   59 Memory
   60   Read Sequential
   61     single-threaded scalar   3553 ||||||||||||||
   62   Write Sequential
   63     single-threaded scalar   4808 |||||||||||||||||||
   64   Stdlib Allocate
   65     single-threaded scalar   3886 |||||||||||||||
   66   Stdlib Write
   67     single-threaded scalar   2191 ||||||||
   68   Stdlib Copy
   69     single-threaded scalar   4324 |||||||||||||||||
   70 
   71 Stream
   72   Stream Copy
   73     single-threaded scalar   2939 |||||||||||
   74     single-threaded vector   3639 ||||||||||||||
   75   Stream Scale
   76     single-threaded scalar   2848 |||||||||||
   77     single-threaded vector   3267 |||||||||||||
   78   Stream Add
   79     single-threaded scalar   2721 ||||||||||
   80     single-threaded vector   3698 ||||||||||||||
   81   Stream Triad
   82     single-threaded scalar   2957 |||||||||||
   83     single-threaded vector   2711 ||||||||||
   84 
   85 Benchmark Summary
   86   Integer Score              8788 |||||||||||||||||||||||||||||||||||
   87   Floating Point Score      11608 ||||||||||||||||||||||||||||||||||||||||
   88   Memory Score               3752 |||||||||||||||
   89   Stream Score               3097 ||||||||||||
   90 
   91   Geekbench Score            8198 ||||||||||||||||||||||||||||||||
   92 
   93 
15
May
11

Using ruby to parse .bex files from Billings Pro

#!/usr/bin/env ruby
# bex_parser.rb

# If you are a Ruby Programmer, this script may be interesting to you.

require 'rubygems'
require 'hpricot'
require 'mysql'
require 'time'

# Set the File to read from the slips that were exported.
doc = Hpricot::XML(File.read("Desktop/slips.bex"))
# Loop through the top element, silly since there is only one, but needed
(doc/'plist').each do |sx|

  # Loop through all the time slips that were exported and exist in the .bex file.
  (sx/'dict array dict').each do |sm|

    # Loop through each component of time slip
    (sm/'array').each do |st|
  
      # Setting the billing comment from the position, may be in 1 or 2 [0][1]
      ((st.parent/'key')[1].inner_html == 'comment') ? @billing_comment = (st.parent/'string')[0].inner_html : @billing_comment = ''
      ((st.parent/'key')[2].inner_html == 'comment') ? @billing_comment = (st.parent/'string')[1].inner_html : @billing_comment = ''

      # Setting the category from the position, may be in 1 or 2 [0][1] 
      ((st.parent/'key')[1].inner_html == 'category.name') ? @billing_category = (st.parent/'string')[0].inner_html : @billing_category = ''
  
      if ((st.parent/'string')[2].inner_html == 'Billings')
        @billing_description = ((st.parent/'string')[2].inner_html == 'Billings' ? (st.parent/'string')[3].inner_html : (st.parent/'string')[2].inner_html)
        @billing_worker = ((st.parent/'string')[2].inner_html == 'Billings' ? (st.parent/'string')[4].inner_html : (st.parent/'string')[3].inner_html)
      else
        @billing_description = ((st.parent/'string')[4].inner_html == 'Billings' ? (st.parent/'string')[5].inner_html : (st.parent/'string')[4].inner_html)
        @billing_worker = ((st.parent/'string')[4].inner_html == 'Billings' ? (st.parent/'string')[6].inner_html : (st.parent/'string')[5].inner_html)
      end

      # Look through each time entry for each timeslip.
      (st/'dict').each do |sz|
        @time_uuid = (sz/'string')[1].inner_html
        @time_start = (sz/'date')[2].inner_html
        @time_end = (sz/'date')[1].inner_html
        @time_duration = (Time.parse(@time_end) - Time.parse(@time_start)) / 3600 

        begin
          db = Mysql.real_connect("localhost", "username", "password", "dbname")
          sth = db.prepare(
                            "INSERT INTO timeslips 
                              (uuid, begin, end, title, duration, worker, description, category)
                            VALUES
                              (?,?,?,?,?,?,?,?) 
                            ON DUPLICATE KEY UPDATE 
                              count=count + 1, begin=?, end=?, title=?, duration=?, worker=?, description=?, category=?"
                            )
          sth.execute(@time_uuid, @time_start, @time_end, @billing_description, @time_duration, @billing_worker, @billing_comment, @billing_category, @time_start, @time_end, @billing_description, @time_duration, @billing_worker, @billing_comment, @billing_category)
          
        # puts "Number of rows inserted: #{db.affected_rows}"
        rescue Mysql::Error => e
          puts "Error code: #{e.errno}"
          puts "Error message: #{e.error}"
          puts "Error SQLSTATE: #{e.sqlstate}" if e.respond_to?("sqlstate")
         
        ensure
          db.close if db
        end
      end # Ends (st/'dict').each
    end # Ends (sm/'array').each
  end # Ends (sx/'dict array dict').each
end # (doc/'plist').each
28
Jun
10

Uninitialized constant MysqlCompat::MysqlRes when running rake tasks in Rails.

Having just recently upgraded my Rails install to 2.3.8 from 2.0.something, I started to set up a redmine site when I ran into the following error when trying to run the rake task:

rake db:migrate

This was frustrating!

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9): no suitable image found. Did find:
/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle: mach-o, but wrong architecture - /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle

Looks like I was going to have to dig around and see what was broken. The message told me that the gem for MySQL connectivity was not bundled anymore in Rails so I was going to have to install it on my own.

I issued:

sudo gem install mysql

and it looked like it was installed correctly but when I tried to run the rake task again I got the same error along with a whole string of errors for missing documentation in rDoc (which I could care less about but if you are reading this you an flag for no rDoc on the gem install so don’t let a bunch of errors freak you out)

I decided to uninstall the gem and install again – and for those of you asking, I use sudo so that these all end up in the /Library, not the ~Library

sudo gem uninstall mysql
Select gem to uninstall:
1. mysql-2.7
2. mysql-2.8.1
3. All versions

I selected 3 and uninstalled all the MySQL gems from my whole system.

The problem here isn’t that Rails or MySQL is broken, it’s that Rails can’t talk to MySQL because the gem can be needing different configurations for different architectures. I also stumbled through a MySQL install which upgraded me from MySQL 5.1.42 to 5.1.48 that I didn’t need and also tried this: (with the flags for no docs so I don’t get all the command line errors.

sudo gem install --no-rdoc --no-ri mysql -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config

But I was still getting the abort errors on the rake task. That was until I stumbled across this post:

Basically this shows how to install the mysql gem with environment and architecture specific flags. I ran through the gem uninstall and then reinstalled it again with:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Once this was done I attempted to run the rake task again and was rewarded with the full redmine install of all MySQL databases, and a minute later had my redmine install up and running.

24
Jun
10

CodeIgniter and switch from Subversion to Mercurial

Recently CodeIgniter, a product form Ellis Labs, switched their version control system from subverison to mercurial. After reading several forums where users were finding this out a little late and were disappointed about it I decided to investigate further. What I found surprised me.

As I mentioned in the my talks on version control at the Lasso Developers conference, there’s a major divide in the version control world, viz. centralized vs. decentralized version control systems. Subversion, perforce, cvs etc are all centralized version control systems, while git and hg (mercurial) are distributed. Check this link for more info.

Previous to the move, many users of CodeIgniter used svn externals to link to the latest CodeIgniter build across many of their websites. When Ellis Labs switched to Mercurial they didn’t realize that many users had linked to their libraries this way. In fact, it broke a lot on installations and many users setups for their sites when they went to update them again.

There’s a forum thread over at the CodeIgniter website about the switch and you can see why a lot of people aren’t happy. Basically, mercurial doesn’t support externals at all. This is pretty sucky. Maybe I’ll put CodeIgniter under version control at github so that instead of having to download the zip files all the time now that I can just use git submodules instead.

13
Jun
10

The Rest of WWDC

Wow, the next few days of the conference have flown by. It’s amazing how super saturated my brain feels. I hardly know where to start with the updates but I will start with the picture below.

During WWDC we’ve heard a lot about the application store and how many apps are downloading at any given time. This is a matrix of 30 displays that was on the second floor of the Moscone center. The icons that you see falling represent app purchases in the store. Every time on app is purchased on icon falls to the bottom of the screen.

wwdc_istore_app.jpg

What’s interesting about this is that the screen will fill up and refresh every few minutes. The bottom falls out like the old “Connect-4” game and all the apps start to slide out the bottom and then fill up again until the monitors fill up.

The display is actually powered by 30 Mac Pro computers behind this wall that each render a portion of the video and the respective icons. The whole application, which runs in Objective-C and takes advantage of OpenGL to render the icons and distribute the workflow across the machines.

MOSCONE_CENTER_APPLE_ICON.JPGAs far as the sessions go here was an interesting phenomenon. There were no sessions that were based on the Mac, OS X Server or pretty much anything except iPhone and iPad. For iPhone developers that’s great, but for anyone else who came to the conference looking for help with threading on OS X Server, they were not going to find much here. The much Ballyhooed 1000 Apple engineers turned out to be about 200 different engineers each day. There was nothing visible about Mac Pro’s, Final Cut, xSan or any of that other good stuff.

There are some rumors that Apple is considering separate WWDC events for Mac and iPad/iPhone. Looks like there is just too much to cover anymore.

The big news from the WWDC is the iPhone 4 and developing for the iOS4 (formerly iPhone OS 4). Apparently Apple has now licensed the term iOS from Cisco for the iPhone operating system as they previously did for the iPhone trademark.

xCode4 was also announced and we got to see it crash during one of the presenters demonstrations, he made a calm recovery though that was a little slicker than Job’s iPhone fail. The presenter smoothly transitioned, “As I was saying, with the Developer Preview of xCode 4…”.

Apple is putting a lot of effort into the webstandards ring. WWDC saw the release of Safari 5 which has some extended debugging features and also support for more of the HTML 5 specification. It’s not perfect but it’s getting there. The biggest is Apple’s push for a new standard they are touting called WebGL. In a nutshell it uses the Canvas object in HTML5 to render 3D graphics. This is going to be big, and looks to be a huge part of why Apple has distanced themselves from Flash technology. Stay tuned here for sure.




Tweets

del.icio.us motion