.

Kindle + Plus Audible - So Close…..

The Kindle apparently support audible now :offer here

I was kind of excited about this since I have a bunch of audible books from back in the day, and from time to time I add a new one. The only problem I run into is I have to book into Windows to get access to them (via either audible manager or itunes).

Amazon acquired Audible earlier this year (details). So it makes sense that they would get audible to support their new audio product.

Once on the audible site, I logged in and started downloaded the 3mb instruction file on how to use Audible content from the Kindle. I figured it was going to be cool since I didn’t see any dedicated software to download for my Kindle.

It turns out - you have to use the Audible Manager (I don’t think iTunes is an option). Bummer! It seems silly that they didn’t make audio book purchasing on the kindle as easy and addictive as books :(

I’m going to hope that this is just some intermediate step to getting that kind of integration and not the “right - we’re done it’s good enough step - time to move on never to return” kind of thing.


Anyone Heard Of Varnish?

I was doing some research on caching reverse proxies - related to some REST stuff. I figured I’d end up at Squid - since it seems like the standard for this sort of thing. Then I hit an article that got me to

Vanish:

Varnish was written from the ground up to be a high performance caching reverse proxy. Squid is a forward proxy that can be configured as a reverse proxy. Besides - Squid is rather old and designed like computer programs where supposed to be designed in 1980. Please see ArchitectNotes for details.

I have no idea how well it works but two things: The first was funny - the second interesting

From the FAQ:

Does Varnish require the system to have a C compiler?

Yes. The VCL compiler generates C source as output, and uses the systems C-compiler to compile that into a shared library. If there is no C compiler, Varnish will not work.

.. Isn’t that security problem?

The days when you could prevent people from running non-approved programs by removing the C compiler from your system ended roughly with the VAX 11/780 computer.

The second was a discussion about how Squid’s basic architecture is simply wrong for the problem it is trying to solve.

Take Squid for instance, a 1975 program if I ever saw one: You tell it how much RAM it can use and how much disk it can use. It will then spend inordinate amounts of time keeping track of what HTTP objects are in RAM and which are on disk and it will move them forth and back depending on traffic patterns.

Well, today computers really only have one kind of storage, and it is usually some sort of disk, the operating system and the virtual memory management hardware has converted the RAM to a cache for the disk storage.

So what happens with squids elaborate memory management is that it gets into fights with the kernels elaborate memory management, and like any civil war, that never gets anything done.

When I have more time looks like something i’m going to have to try out…


Sometimes the simple way is best

Testing flash.now with RSpec - Xavier Shay’s Blog

This turned out to be the simplest way I could find to easily test flash.now - my only addition was a simple helper method


def keep_flash_now
@controller.instance_eval { flash.extend(DisableFlashSweeping) }
end

It makes it easier to understand what is going on in thest.


Jake to the Rescue

Ok so I’ve been dealing with an old app for the last two weeks. It is woefully out of date (several libraries are behind - not the least of which being rails). And it looks like at some point I threw discipline out the window and added some stuff without writing tests (before or after adding in the code).

On top of all of that, I’m back in the guts of it because I need to add a pretty major new feature - and the state of the code has me running for the hills.

I got all the tests to pass last week - but doing some coverage analysis I found that there are big sections of the code that are not tested at all. (Yes I know 100% coverage doesn’t mean 100% bug free - but it will generally alert you to the obvious bugs).

In the process, I was trying to get Rcov to sort some of the results for me so I can focus on the worst offenders. In the process of figuring out how to do that I stumbled on Metric Fu.

Metric_fu is a set of rake tasks that make it easy to generate metrics reports. It uses Saikuro, Flog, Rcov, and Rails built-in stats task to create a series of reports. It’s designed to integrate easily with CruiseControl.rb by placing files in the Custom Build Artifacts folder.

It’s really cool - basically it not only made it seriously easy to sort out the coverage stuff and works well with Rspec. It also showed me some new tools for finding other code smells. It alerted me to a particularly nasty controller method that is apparently doing a hell of a lot more than a controller method should do.

The coolest part of this is that not only is it a neat tool - but I actually know this guy. We worked together on a project a year and a half a ago. Small world I guess.


Clear For Take Off

Thanks to Cory’s tip about looking for Iframes and changing my passwords - it looks like google no longer considers me a threat to the universe….


Still Owned On Google

From the search in the google…..

Economy Size Geek
This site may harm your computer.
www.economysizegeek.com/ - Similar pages - Note this

Bummer… I’ve scheduled a review - but still waiting them to clear me.


Git Patch Example

Michael Ivey / Contributing to Merb (Part 1) (git, merb)

This is an intro to submitting code to the Merb project. That isn’t what caught my eye. What is really nice about this short write up is it shows you how you can branch off to do your own thing, and still keep up with the main trunk you branched off of. For those times when it takes you a little bit longer than you thought to get your feature wrapped up so it can be merged back onto the head.


Minor Kindle Komplaint

Ok so I’m a little annoyed - more so because I figure my complaint is unlikely to be fixed. You see I own a kindle. So far I haven’t met any others - not entirely surprising - I was the only person I knew with a PSP for a while too.

I had both a Kindle and a Sony Reader. I read a lot and wanted to figure out which was the best one. I sold off the reader - the kindle is awesome. So far I’ve finished 6 novels, a mix of short stories, and a couple of reads through some serious tech pdfs I had laying around.

Enough with the gushing - the complaint - the whispernet doesn’t work outside of the US! I haven’t tested Canada, but I didn’t have connectivity in London or Mexico. I wasn’t entirely surprised about London. I thought it would be unlikely to work. Mexico, on the other hand, was a bit of a surprise. I was even more annoyed because I was actually on vacation and reading like a fiend and I finished book 2 of a 4 book series and really needed book 3 - which I couldn’t have. I hadn’t bought it was because I wasn’t sure a) book 2 would be as good as book 1 and b) I didn’t think I’d finish book 2 on the trip. (Which is another cool thing about the kindle my reading speed on it is seriously faster than my normal paper speed.)

Of the X number of Kindle owners (Amazon has not mentioned sales numbers as far as I’m aware - just shortages) - I wonder what percentage travel outside the US? Even if it is a big number I’m willing to bet they aren’t going to fix it - guess I’m just stuck stocking up before I hop on my next international flight.


Autotest

I haven’t run Autotest in a while (i’ve been knee deep in JavaScript code lately). While I was away they’ve release a new version of the system. Last time I used it - I was only doing RSpec testing. Now that I’m working on a project that has Test Unit (Haven’t migrated the app yet) - autotest doesn’t work.

Below is a new .autotest file which handles figuring out which kind of testing you are doing and handle it accordingly.

require 'pp'
require 'autotest/timestamp'

require "#{ENV['HOME']}/autotest/sound/sound.rb”
Autotest::Sound.sound_path = “#{ENV['HOME']}/autotest/sound/sound_fx/”
require ‘rnotify’
require ‘gtk2′

module Autotest::RNotify
  class Notification
    attr_accessor :verbose, :image_root, :tray_icon, :notification,
                  :image_pass, :image_pending, :image_fail

    def initialize(timeout = 5000,
                   image_root = “#{ENV['HOME']}/autotest/images” ,
                   verbose = false)
      self.verbose = verbose
      self.image_root = image_root

      puts ‘Autotest Hook: loading Notify’ if verbose
      Notify.init(’Autotest’) || raise(’Failed to initialize Notify’)

      puts ‘Autotest Hook: initializing tray icon’ if verbose
      self.tray_icon = Gtk::StatusIcon.new
      tray_icon.icon_name = ‘face-monkey’
      tray_icon.tooltip = ‘RSpec Autotest’

      puts ‘Autotest Hook: Creating Notifier’ if verbose
      self.notification = Notify::Notification.new(’X', nil, nil, tray_icon)
      notification.timeout = timeout

      Thread.new { Gtk.main }
      sleep 1
      tray_icon.embedded? || raise(’Failed to set up tray icon’)
    end

    def notify(icon, tray, title, message)
      notification.update(title, message, nil)
      notification.pixbuf_icon = icon
      tray_icon.tooltip = “Last Result: #{message}”
      #tray_icon.icon_name = tray
      tray_icon.pixbuf = icon
      notification.show
    end

    def passed(title, message)
      self.image_pass ||= Gdk::Pixbuf.new(”#{image_root}/pass.png”, 48,48)
      notify(image_pass, ‘face-smile’, title, message)
    end

    def pending(title, message)
      self.image_pending ||= Gdk::Pixbuf.new(”#{image_root}/pending.png”,48,48)
      notify(image_pending, ‘face-plain’, title, message)
    end

    def failed(title, message)
      self.image_fail ||= Gdk::Pixbuf.new(”#{image_root}/fail.png”, 48,48)
      notify(image_fail, ‘face-sad’, title, message)
    end

    def quit
      puts ‘Autotest Hook: Shutting Down…’ if verbose
      #Notify.uninit
      Gtk.main_quit
    end
  end

  Autotest.add_hook :initialize do |at|
    @notify = Notification.new
    %w{.hg .git .svn stories
           tmtags Rakefile
           Capfile README spec/spec.opts
           spec/rcov.opts vendor vendor/gems autotest
           svn-commit .DS_Store }.each {|exception|at.add_exception(exception)}
    at.add_exception(/^\.\/vendor/)
  end

  Autotest.add_hook :ran_command do |at|

    results = at.results.flatten.join(”\n”)

    tests = 0
    assertions = 0
    failures = 0
    errors = 0
    pending = 0
    unless results.nil?
      rspec_tests = results.match(/(\d+)\sexample[s]?,/)
      if rspec_tests
        #Test unit
       if (results.match(/(\d+)\sexample[s]?,\s(\d+)\sfailure[s]?,\s(\d+)\spending/))
         test_results = results.match(/(\d+)\sexample[s]?,\s(\d+)\sfailure[s]?,\s(\d+)\spending/)[0]
         results.scan(/(\d+)sexample[s]?,\s (\d+)failures[s]?,\s(\d+)\spending/) do |t, f, p |
             tests += t.to_i
             failures += f.to_i
             pending += pending.to_i
          end
       else
         test_results = results.match(/(\d+)\sexample[s]?,\s(\d+)\sfailure[s]?/)[0]
         results.scan(/(\d+)sexample[s]?,\s (\d+)failures[s]?/) do |t, f |
             tests += t.to_i
             failures += f.to_i
          end
       end
      else
        #Test unit
       test_results = results.match(/^\d+ tests, \d+ assertions, \d+ failures, \d+ errors/)[0]
       results.scan(/(\d+) tests, (\d+) assertions, (\d+) failures, (\d+) errors/) do |t, a, f, e|
           tests += t.to_i
           assertions += a.to_i
           failures += f.to_i
           errors += e.to_i
        end
      end

      if failures > 0
        @notify.failed(”Tests Failed”, test_results)
      elsif errors > 0
        @notify.failed(”Tests Errors”, test_results)
      elsif pending > 0
        @notify.pending(”Tests Pending”, test_results)
      else
        unless at.tainted
          @notify.passed(”All Tests Passed”, test_results)
        else
          @notify.passed(”Tests Passed”, test_results)
        end
      end
    end
  end

  Autotest.add_hook :quit do |at|
    puts “Goodbye”
    @notify.quit
  end
end

Today’s Productivity Killer

BoomsticK - the game @ itch.com


    You are currently browsing the Economy Size Geek weblog archives for the 'General' category.
    Previous Entries » Next Entries »
    Categories
    Archives

    .