• 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

    Functional Handler — A Pattern in Ruby

    Mike Farmer

    By Mike Farmer
    January 22, 2014

    First, a disclaimer. Naming things in the world of programming is always a challenge. Naming this blog post was also difficult. There are all sorts of implications that come up when you claim something is “functional” or that something is a “pattern”. I don’t claim to be an expert on either of these topics, but what I want to describe is a pattern that I’ve seen develop in my code lately and it involves functions, or anonymous functions to be more precise. So please forgive me if I don’t hold to all the constraints of both of these loaded terms.

    A pattern

    The pattern that I’ve seen lately is that I need to accomplish of myriad of steps, all in sequence, and I need to only proceed to the next step if my current step succeeds. This is common in the world of Rails controllers. For example:

    def update
      @order = Order.find params[:id]
    
      if @order.update_attributes(params[:order])
        @order.calculate_tax!
        @order.calculate_shipping!
        @order.send_invoice!  if @order.complete?
        flash[:notice] = "Order saved"
        redirect_to :index
      else
        render :edit
      end
    
    end
    

    What I’m really trying to accomplish here is that I want to perform the following steps:

    • Find my order …

    functional-programming ruby rails

    Unbalanced HTML considered harmful for jQuery

    Jeff Boes

    By Jeff Boes
    January 20, 2014

    This isn’t earth-shattering news, but it’s one of those things that someone new to jQuery might trip over so I thought I’d share.

    I had a bad experience recently adding jQuery to an existing page that had less than stellar HTML construction, and I didn’t have time nor budget to clean up the HTML before starting work. Thus, I was working with something much more complex than, but equally broken as what follows:

    <table><tr><td>
    <form>
    </td></tr>
    <tr><td>
    <input type="text">
    </form>
    </td></tr></table>
    

    The jQuery I added did something like this:

    $('form input').css('background-color: red');
    

    and of course, I was quite puzzled when it didn’t work. The pitfall here is that jQuery may or may not be able to handle misconstructed or unbalanced HTML, at least not as well as your average browser, which will shift things around internally until something makes sense to it. The minimal solution is to move the opening and closing “form” tags outside the table.


    javascript jquery

    Using Google Maps and jQuery for Location Search

    Steph Skardal

    By Steph Skardal
    January 16, 2014


    Example of Google maps showing Paper Source locations.

    A few months ago, I built out functionality to display physical store locations within a search radius for Paper Source on an interactive map. There are a few map tools out there to help accomplish this goal, but I chose Google Maps because of my familiarity and past success using it. Here I’ll go through some of the steps to implement this functionality.

    Google Maps API Key

    Before you start this work, you’ll want to get a Google Maps API key. Learn more here.

    Geocoder Object

    At the core of our functionality is the use of the google.maps.Geocoder object. The Geocoder converts a search point or search string to into geographic coordinates. The most basic use of the geocoder might look like this:

    var geocoder = new google.maps.Geocoder();
    //search is a string, input by user
    geocoder.geocode({ 'address' : search }, function(results, status) {
      if(status == "ZERO_RESULTS") {
        //Indicate to user no location has been found
      } else {
        //Do something with resulting location(s)
      }
    }
    

    Rendering a Map from the Results

    After a geocoder results set is acquired, a map and locations might be displayed. A simple and …


    maps javascript jquery

    End Point’s New Tennessee Office

    Benjamin Goldstein

    By Benjamin Goldstein
    January 14, 2014

    This position has been filled. See our active job listings here.

    End Point has opened a new office for our Liquid Galaxy business in Bluff City, Tennessee. Bluff City is in the Tri-Cities region in the eastern corner of Tennessee. Our new place is 3500+ square feet and has ample office and warehouse space for our growing Liquid Galaxy business.

    From our start back in 1995, End Point has always been a “distributed company” with a modest headquarters in Manhattan. (The headquarters was especially modest in our early days.) The majority of End Point’s employees work from their home offices. Our work focusing on development with Open Source software and providing remote systems support requires relatively little space, so our distributed office arrangement has been a cost-effective and wonderful way to work.

    However, over the last four years our work with Liquid Galaxy systems has presented us with some old-fashioned physical-world challenges. Our space requirements have steadily increased as we’ve tested more and more components and built several generations of Liquid Galaxies, and as we’ve prepped and packed increasing numbers of systems going out for permanent installations and events. We’ve well outstripped the space of our Manhattan …


    jobs-closed visionport company

    News of FreeOTP, RHEL/CentOS, Ruby, Docker, HTTP

    Jon Jensen

    By Jon Jensen
    January 13, 2014

    I’ve had interesting tech news items piling up lately and it’s time to mention some of those that relate to our work at End Point. In no particular order:

    • FreeOTP is a relatively new open source 2-factor auth app for Android by Red Hat. It can be used instead of Google Authenticator which last year became proprietary as noted in this Reddit thread. The Google Authenticator open source project now states: “This open source project allows you to download the code that powered version 2.21 of the application. Subsequent versions contain Google-specific workflows that are not part of the project.” Whatever the reason for that change was, it seems unnecessary to go along with it, and to sweeten the deal, FreeOTP is quite a bit smaller. It’s been working well for me over the past month or more.
    • Perl 5.18.2 was released.
    • Ruby 2.1.0 was released.
    • Ruby 1.9.3 end of life set for February 2015, and the formerly end-of-life Ruby 1.8.7 & 1.9.2 have had their maintenance extended for security updates until June 2014 (thanks, Heroku!).
    • Red Hat and CentOS have joined forces, in an unexpected but exciting move. Several CentOS board members will be working for Red Hat, but not in the Red Hat …

    containers docker open-source perl redhat ruby

    Copy Data Between MySQL Databases with Sequel Pro

    Greg Davidson

    By Greg Davidson
    January 10, 2014

    Sequel Pro

    Sequel pro

    I often use Sequel Pro when I’m getting up to speed on the data model for a project or when I just want to debug in a more visual way than with the mysql command-line client. It’s a free OS X application that lets you inspect and manage MySQL databases. I also find it very useful for making small changes to the data while I develop and test web apps.

    Quickly Copy Data Between Databases

    I recently needed a way to copy a few dozen records from one camp to another. I tried using the “SELECT…INTO OUTFILE” method but ran into a permissions issue with that approach. Using mysqldump was another option but that seemed like overkill in this case—​I only needed to copy a few records from a single table. At this point I found a really neat and helpful feature in Sequel Pro: Copy as SQL INSERT

    Copy as sql insert

    I simply selected the records I wanted to copy and used the “Copy as SQL INSERT” feature. The SQL insert statement I needed was now copied to the system clipboard and easily copied over to the other camp and imported via the mysql command-line client.

    Bundles

    The Sequel Pro website describes Bundles which extend the functionality in various ways—​including copying data as …


    database environment mysql tools

    IPTables: All quotes are not created equal

    Richard Templet

    By Richard Templet
    January 7, 2014

    We have been working on adding comments to our iptables rules to makes it a lot easier to know what each rule is for when reviewing the output of /sbin/iptables -L. The comment ability in iptables is pretty straightforward to use. You just add this to an existing or new rule:

    -m comment --comment "testing 1 2 3"
    

    I had the displeasure of learning this weekend, while updating a system, that though it is a pretty easy addition to make, the quotes you use do make a difference. As you can see in the example above, it uses double quotes. The culprit of my displeasure was the dreaded single quote.

    When the server rebooted I noticed that iptables didn’t start as expected so I tried to start it using service iptables start and was greeted with this error:

    iptables: Applying firewall rules: Bad argument `1'
    Error occurred at line: 30
    

    I loaded up the /etc/sysconfig/iptables file in vim and started to try to figure out what had changed on line 30. I reviewed the rule and it looked pretty straightforward.

    -A INPUT -s 1.2.3.4 -p tcp -m multiport --dports 22,80 -j ACCEPT -m comment --comment 'testing 1 2 3'
    

    Why was it freaking out over the 1 in the comment? I knew we had done …


    iptables security sysadmin

    Spot On Cost Effective Performance Testing

    Josh Williams

    By Josh Williams
    January 6, 2014

    AWS is, in my humble opinion, pricey. However, they provide a nice alternative to the on-demand EC2 instances most people are familiar with: Spot instances. In essence, spot instances allow you to bid on otherwise compute idle time. Recent changes to the web console seem to highlight spot instances a bit more than they used to, but I still don’t see them mentioned often.

    The advantage is you get the same selection of instance sizes, and they perform the same as a normal on-demand instance for (usually) a fraction of the price. The downside is that they may disappear at a moment’s notice if there’s not enough spare capacity when someone else spins up a normal on-demand instance, or simply outbids you. It certainly happened to us on occasion, but not as frequently as I originally expected. They also take a couple minutes to evaluate the bid price when you put in a request, which can be a bit of a surprise if you’re used to the almost-instantaneous on-demand instance provision time.

    We made extensive use of spot instances in some of the software cluster testing we recently did. For our purposes those caveats were no big deal. If we got outbid, the test could always be restarted in a …


    automation linux python testing cassandra mongodb
    Previous page • Page 105 of 219 • Next page