• Home

  • Custom Ecommerce
  • Application Development
  • Database Consulting
  • Cloud Hosting
  • Systems Integration
  • Legacy Business Systems
  • Security & Compliance
  • GIS

  • Expertise

  • About Us
  • Our Team
  • Clients
  • Blog
  • Careers

  • VisionPort

  • Contact
  • CouchDB pagination with couchdb-python

    Miguel Alatorre

    By Miguel Alatorre
    July 2, 2013

    I’ve been working with couchdb-python v0.8 to meet some of a project’s CouchDB needs and ran into an unfortunate shortcoming.

    Retrieving database rows is as easy as:

    for row in db.view(mapping_function):
        print row.key

    However, all the rows will be loaded into memory. Now, for small databases this is not a problem but lucky me is dealing with a 2.5 million+ document database. Long story short: kaboom!

    There is an excellent blog post by Marcus Brinkmann that details the memory issue and also provides a pagination solution. However, couchdb-python v0.9 (released 2013-04-25) does provide its own solution: the iterview method. If you’ve been able to manage small databases with v0.8 but are anticipating larger and larger databases, be sure to upgrade!


    couchdb python

    WAVE: Evaluating Web Accessibility

    Steph Skardal

    By Steph Skardal
    July 1, 2013

    It’s been far too long since I wrote a blog article! I’ve been a bit preoccupied:

    My [cute] preoccupation.

    I thought I’d start with a short blog article to get back into it. Recently, the H2O project has been keeping me busy. One interesting resource I’ve been using for the project is WAVE. WAVE is a free web accessibility evaluation tool, which in our case helps us evaluate the H2O web application for it’s use in an academic setting for those users with disabilities. The tool helps to evaluate accessibility against Section 508, WCAG, and more.

    To use the tool, you simply visit https://wave.webaim.org/ and type in the URL that you want evaluated:

    WAVE homepage

    The results show warnings and alerts, as well as feedback regarding other structural markup overlayed on the page. The results are meant to serve as a resource to make decisions regarding accessibility. Some web application developers may be more inclined to follow the guidelines than others.

    Example WAVE output, analysis of End Point’s home page.


    accessibility user-interface

    Rails transposing day and month after upgrading Ruby 1.8.7

    Brian Buchalter

    By Brian Buchalter
    June 26, 2013

    If you’re wondering why your month and day are being transposed when saved in your database, you’re likely:

    • Using a text field input for dates (likely with some JavaScript date picker)
    • Using American style date formatting (mm/dd/YYYY)
    • Upgrading from Ruby 1.8.7

    If you meet these criteria you’ll find that American style dates get parsed incorrectly in Ruby 1.9+ because of Ruby 1.9.x’s new date parsing strategy. Unbelievably, this change effectively does away with American style date parsing in Ruby 1.9.x and Rails has happily followed suit!

    american_date to the rescue!

    After trying and failing to restore American style date parsing using timeliness, delocalize, and i18n_alchemy, I found american_date. If you look at the implementation, it is straight forward and restores backwards compatibility by simply adding a line to your Gemfile. Enjoy the return to sanity!

    With Ruby 1.8.7 going EOL this month, and Rails 2.3.x and older losing support for even sevre security issues, it’s time to bust out your upgrade-foo for those old Rails apps. Of course, this is a tried and true topic, with many resources, most notibly Railscast #225. Good luck with your upgrades!


    rails

    Custom 500 error page while using nginx proxying

    Richard Templet

    By Richard Templet
    June 21, 2013

    I was working with our customer Paper Source to setup a 500 error page that looked like the rest of the site when I ran into something interesting. I went through the nginx configuration and added this line to allow for a custom 500 error page just like I had done for the custom 404 error page.

    error_page   500  =  /cgi-bin/paper/500.html;

    What I noticed when I forced the site to create an Internal Server Error was that I was still getting the ugly normal Apache version of the 500 error page. It seemed like nginx was ignoring the error_page directive. I did some searching and found out that you have to use the proxy_intercept_errors directive.

    proxy_intercept_errors on;

    This directive allows nginx to recognize the 500 error code being returned from Apache and run its own directives to display the right page.


    nginx sysadmin

    Debugging obscure Postgres problems with strace

    Greg Sabino Mullane

    By Greg Sabino Mullane
    June 20, 2013

    One of the nice things about being a Postgres consultant is the sheer variety of interesting problems you get to solve. Here’s one that recently popped up, and a walkthrough of how I solved it. One of our clients had this strange error pop up when they were trying to start Postgres:

    FATAL:  too many private dirs demanded

    This is a very rare and esoteric error. A peek at the source code showed that this error only appears in src/backend/storage/file/fd.c, like so:

    DIR *
    AllocateDir(const char *dirname)
    {
        DIR        *dir;
    
        DO_DB(elog(LOG, "AllocateDir: Allocated %d (%s)",
                   numAllocatedDescs, dirname));
    
        /*
         * The test against MAX_ALLOCATED_DESCS prevents us from overflowing
         * allocatedDescs[]; the test against max_safe_fds prevents AllocateDir
         * from hogging every one of the available FDs, which’d lead to infinite
         * looping.
         */
        if (numAllocatedDescs >= MAX_ALLOCATED_DESCS ||
            numAllocatedDescs >= max_safe_fds - 1)
            elog(ERROR, "too many private dirs demanded");

    So it appeared as if we ran into some sort of safety valve that was meant to bail out …


    postgres sysadmin

    Spree’s New Release Policy

    Brian Buchalter

    By Brian Buchalter
    June 17, 2013

    Spree has recently updated its documentation regarding contributions and has included (maybe for the first time?) an official Release Policy. This is an important step forward for the Spree community so that developers can communicate to clients the potential costs and benefits when upgrading Spree, understand how well Spree supports older releases, and gauge the overall speed of the “upgrade treadmill”.

    Deprecation Warnings

    Deprecation warnings are to be added in patch releases (i.e. 2.0.2) and the code being deprecated will only be removed in minor versions. For example, if a deprecation warning is added in 2.0.2, 2.0.3 will still contain the same deprecation warning but in 2.1.0 the deprecation warning and the code will be gone.

    Deprecation warnings are very helpful for developers, but without a robust test suite exercising your application, it’s easy for deprecation warnings to go unnoticed. A strong test suite coupled with deprecation warnings helps you manage your client’s expectations about how upgrades can affect your Spree customizations and extensions.

    Master Branch Receives All Patches

    Master branch receives all patches, including new features and breaking API changes …


    ecommerce spree

    Making use of a Unix Pipe

    Mike Farmer

    By Mike Farmer
    June 13, 2013

    Developing in a Unix-based environment has many wonderful advantages. Thanks to Gary Bernhardt of DestroyAllSoftware Screencasts, I’ve recently discovered a new use for the Unix pipe. A pipe in Unix does exactly what you might think it would do by its name. Send something in one side and watch it come out the other. If you’ve done much in the shell, you’ve probably used pipes before where you’ve probably piped some output from one command to another. Here’s an example:

    $ cat foo.txt | grep bar

    This command simply says take the output of cat and sends it to the input of grep. Pipes used in this way can yield very powerful commands in the shell.

    There is another pipe in Unix and this is a named pipe. A named pipe, or a FIFO (First In, First Out), works similarly to command line pipe. You put stuff in one end and it comes out the other. To create a named pipe, you use the mkfifo command.

    $ mkfifo my_fifo
    $ ls -l
    ...
    prw-rw-r--  1 mikefarmer mikefarmer      0 Jun  5 21:22 my_fifo

    Notice the “p” at the beginning of the file list. The “p” designates this file as a named pipe to the system. To try out our pipe, we will, in one terminal, listen for anything coming out of the pipe. Then …


    rails ruby shell

    Railsbridge NYC

    Bianca Rodrigues

    By Bianca Rodrigues
    June 13, 2013

    Last week I attended a Ruby on Rails workshop hosted by Railsbridge NYC. The organization promotes diversity in tech by introducing web development concepts to a community of technology professionals and enthusiasts. It’s geared towards women, but open to all.

    Installfest

    As the website describes, the workshop consists of an Installfest (about a 2 hour event), followed by a full day of learning the following day. The Installfest is a series of step-by-step instructions to install Ruby, Rails and other tools you would need for your particular OS. The detailed instructions helped make the entire process effortless, and most students were able to install all the tools without major issues.

    An Introduction to Ruby and Rails

    The next day was the actual workshop, beginning promptly at 9am. The skill level of the women in attendance varied; some were programmers proficient in other languages, while others, like myself, were new to programming. After a short welcome presentation, the organizers divided the group into two, with the “more advanced” students heading off to their own room for a slightly more quick-paced session.

    I remained in the beginner group, which was significantly larger. …


    conference ruby rails
    Previous page • Page 120 of 223 • Next page