• 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
  • Our Blog

    Ongoing observations by End Point Dev people

    Travis build log doesn’t display

    Brian Gadoury

    By Brian Gadoury
    May 23, 2013

    Remember when “clear your cookies and try it again” was the first suggestion when a webpage was behaving badly? I remember that time of darkness, that time of early Internet Explorer, well, existing. I remember it being the only browser allowed in some offices and even being mandatory for some major websites. Remember that? Pepperidge Farm remembers.

    But we’ve evolved. These are brighter days. Around these parts, “Did you clear your cookies?” is typically only said in jest. So, imagine my surprise when I accidentally discovered that clearing my cookies was exactly what resolved my issue with our Travis-CI.org build logs failing to display. Seriously. Imagine it. Go ahead, I’ll wait.

    On March 21st 2013, the beautiful and talented Travis CI service deployed a bad build of their own app. It contained a bug that caused build logs to fail to display. You could still see the builds and statuses under the Build History tab, but never any logs. This was right about the same time I had pushed a big refactor that used a new config file format for our app. It passed all our tests locally, but it was driving me nuts that I couldn’t find out why it was failing on Travis. It was also displaying …


    browsers tips

    Isolation Test Helper for Rails Development

    Mike Farmer

    By Mike Farmer
    May 22, 2013

    Lately I’ve been inspired to test drive my development as much as possible. One thing that is absolutely critical for test driven development is fast feedback from your tests. Because of this, I try to remove the “Rails” dependency as often as possible from my tests so I don’t have to wait for Rails to load for my tests to run. Sure, I could use spork or zeus to pre-load Rails, but I find that those tools don’t always reload the files I’m working on. Besides, I believe that much of your application should be plain old ruby objects that are well designed.

    One of the things I continually bump against with isolated tests is that there are a few things that I always have to do to get my isolated tests to work. Since we are accustomed to requiring spec_helper.rb or test_helper.rb for tests dependent on Rails, I decided to build a helper for when I run isolated tests to just load some niceties that make running them a little easier.

    So, here’s the full code from my isolation helper (this one works with RSpec).

    # spec/isolation_helper.rb
    DO_ISOLATION = ! defined?(Rails)
    
    def isolate_from_rails(&block)
      return unless DO_ISOLATION
      block.call
    end
    
    isolate_from_rails do
      require …

    ruby rails testing

    Making Python Code a Little Bit Cleaner

    Szymon Lipiński

    By Szymon Lipiński
    May 21, 2013

    When you develop a program in a group of programmers, it is really important to have some standards. Especially helpful are standards of naming things and formatting code. If all team members format the code in the same way and use consistent names, then it is much easier to read the code. This also means that the team works faster.

    The same rules apply when you develop software in Python.

    For Python there is a document which describes some of the most desirable style features for Python code Style Guide for Python Code. However there are some problems with that, as even the standard Python library has some libraries which are not consistent. This shouldn’t be an excuse for your team to be inconsistent as well. Ensuring that the code is nice and readable is worth working for a moment on that.

    In Python there are two tools which I use for writing code in Python—​Python style guide checker and Python code static checker.

    pep8

    Program pep8 is a simple tool checking Python code against some of the style conventions in PEP 8 document.

    Installation

    You can install it within your virtual environment with simple:

    pip install pep8
    

    Usage

    Let’s test the pep8 command on such an ugly Python …


    python

    Adventures with using Ruby 2.0 and libreadline

    Kamil Ciemniewski

    By Kamil Ciemniewski
    May 17, 2013

    I was asked to develop a prototype app for one of our clients lately. The basis for this app was an old Rails app:

    • Rails 3.2.8
    • RailsAdmin
    • MySQL
    • rbenv + ruby-build

    I wanted to upgrade the stack to work with latest toys all cool kids are so thrilled about. I also didn’t have Rails console facility at my disposal since the Ruby version installed on the development machine hadn’t been compiled against libreadline.

    Not having root or sudo access on the machine I embarked on a sligthly hacky journey to make myself a better working environment.

    Ruby 2.0

    After reading Mike Farmer’s blog post about Ruby 2.0 and tons of other material about it on the Internet, I wanted to get a feeling of how faster & greater the new Ruby is. It’s always great also to stay up-to-date with latest technologies. It’s great for me as a developer, and more importantly—​it’s great for our clients.

    Importance of libreadline in development with Ruby

    To be productive developing any Rails-based application, we have to have Rails-console available at any moment. It serves a multitude of purposes. It’s also a great scratch-pad when developing methods.

    While you don’t need your Ruby to support libreadline for basic …


    shell environment ruby rails

    Breaking Up Your Asset Pipeline

    Mike Farmer

    By Mike Farmer
    May 15, 2013

    The Rails Asset Pipeline to me is kind of like Bundler. At first I was very nervous about it and thought that it would be very troublesome. But after a while of using it, I realized the wisdom behind it and my life got a lot easier. The asset pipeline is fabulous for putting all your assets into a single file, compressing them, and serving them in your site without cluttering everything up. Remember these days?

    <%= javascript_include_tag 'jquery.validate.min.js','jquery.watermark.min.js','jquery.address-1.4.min','jquery.ba-resize.min','postmessage','jquery.cookie','jquery.tmpl.min','underscore','rails','knockout-1.3.0beta','knockout.mapping-latest' %>
    

    A basic component of the Asset Pipeline is the manifest file. A manifest looks something like this

    // Rails asset pipeline manifest file
    // app/assets/javascript/application.js
    
    //= require jquery
    //= require jquery_ujs
    //= require_tree .
    

    For a quick rundown on how the Asset Pipeline works, I highly recommend taking a few minutes to watch Railscast episode 279. But there are a few things that I’d like to point out here.

    First, notice that the …


    javascript rails

    Selenium Testing File Uploads in Django Admin

    Adam Vollrath

    By Adam Vollrath
    May 15, 2013

    The Django framework version 1.4 added much better integration with Selenium for in-browser functional testing. This made Test-Driven Development an even more obvious decision for our new Liquid Galaxy Content Management System. This went very well until we needed to test file uploads in the Django admin interface.

    A browser’s file upload control has some unique security concerns that prevent JavaScript from setting its value. Trying to do so may raise INVALID_STATE_ERR: DOM Exception 11. Selenium’s WebDriver may sometimes send keystrokes directly into the input element, but this did not work for me within Django’s admin interface.

    To work around this limitation, Ryan Kelly developed a Middleware to emulate successful file uploads for automated testing. This middleware inserts additional hidden fields into any forms sent to the client. Setting their value causes a file upload to happen locally on the server. (I used a slightly newer version of this Middleware from another project.)

    However, Selenium intentionally will not interact with hidden elements. To work around this, we must send JavaScript to be executed directly in the browser using WebDriver’s execute_script method. …


    django testing

    Foreign Data Wrappers

    Josh Tolley

    By Josh Tolley
    May 13, 2013

    Original images from Flickr user jenniferwilliams

    One of our clients, for various historical reasons, runs both MySQL and PostgreSQL to support their website. Information for user login lives in one database, but their customer activity lives in the other. The eventual plan is to consolidate these databases, but thus far, other concerns have been more pressing. So when they needed a report combining user account information and customer activity, the involvement of two separate databases became a significant complicating factor.

    In similar situations in the past, using earlier versions of PostgreSQL, we’ve written scripts to pull data from MySQL and dump it into PostgreSQL. This works well enough, but we’ve updated PostgreSQL fairly recently, and can use the SQL/MED features added in version 9.1. SQL/MED (“MED” stands for “Management of External Data”) is a decade-old standard designed to allow databases to make external data sources, such as text files, web services, and even other databases look like normal database tables, and access them with the usual SQL commands. PostgreSQL has supported some of the SQL/MED standard since version 9.1, with a feature called Foreign Data …


    database mysql open-source postgres sql tools

    Lanyrd: Finding conferences for the busy or travel-weary developer

    Jeff Boes

    By Jeff Boes
    May 10, 2013

    Recently I had planned to attend a nearby technical conference on a weekend, but my plans fell through. As a result, my supervisor encouraged me to find a replacement, but having been out of the “free T-shirt and all the presentations you can stay awake through” circuit for many years, I didn’t have any ideas of where to start.

    I wanted to filter the conferences by topic: no sense attending a Web Development conference if all the presentations were far afield from what I do; I’m not a Ruby developer at present, and have no immediate plans to become one, so not much point in attending a deep exploration of that topic.

    I also wanted to stay local: if there’s something I can get to by car in a day, I’d prefer it.

    I stumbled upon Lanyrd.com almost by accident: it’s a sharp, well-engineered central point for data about upcoming conferences on a dizzying array of topics. Not just software: library science, economics, photography, water management, social media, and medicine were represented in just the one day on which I wrote this post.

    I subscribed to about a dozen topics, limiting each to the USA, and Lanyrd immediately suggested 46 events in which I might be interested.

    You can …


    community conference
    Previous page • Page 119 of 219 • Next page