• 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

    Ecommerce on Sinatra: A Shopping Cart Story

    Steph Skardal

    By Steph Skardal
    March 4, 2011

    In a couple recent articles, I wrote about the first steps for developing an ecommerce site in Ruby on Sinatra. Or, here’s a visual summary of the articles:

    In the first article, a single table data model existed with a couple of Sinatra methods defined. In the second article, users and products were introduced to the data model. The Sinatra app still has minimal customer-facing routes (get "/", post "/") defined, but also introduces backend admin management to view orders and manage products.

    In this article, I introduce a shopping cart. With this change, I modify the data model to tie in orderlines, where orderlines has a belongs_to relationship with orders and products. I’ll make the assumption that for now, a cart is a set of items and their corresponding quantities.

    The new data model with tables orderlines, products, orders, and users.

    An Important Tangent

    First, let’s discuss cart storage options, which is an important topic for an ecommerce system. Several cart storage methods are described below:

    • Conventional SQL database models: Conventional SQL (MySQL, PostgreSQL, etc.) tables can be set up to store shopping cart items, …


    ecommerce ruby sinatra

    API gaps: an Android MediaPlayer example

    Jon Jensen

    By Jon Jensen
    March 2, 2011

    Many programming library APIs come with several levels of functionality, including the low-level but flexible way, and the high-level and simpler but limited way. I recently came across a textbook case of this in Android’s Java audio API, in the MediaPlayer class.

    We needed to play one of several custom Ogg Vorbis audio files in the Locate Express Android app to alert the user to various situations.

    Getting this going initially was fairly straightforward:

    In this simplified version of our PlaySound class we pass in the app resource ID of the sound file, and using the MediaPlayer.create() method is about as simple as can be.

    We keep a map of playing sound files so that external events can stop all playing sounds at once in a single call.

    We set an OnCompletionListener to clean up after ourselves if the sound plays to its end without interruption.

    Everything worked fine. Except for a pesky volume problem in real-world use. MediaPlayer uses Android’s default audio stream, which seemed to be STREAM_MUSIC. That plays the audio files fine, but has an interesting consequence during the actual playing: You can’t turn the volume down or up because the volume control outside of any specific …


    android java mobile api audio

    SSH: piping data in reverse

    David Christensen

    By David Christensen
    March 1, 2011

    I found myself ssh’d several hops away and needing to copy output from a script back to localhost. Essentially what I wanted was a way to get the data in question piped backwards from my SSH connection so I could capture it locally. Since I utilize .ssh/config extensively, I could connect to the server in question from localhost with a single ssh command, however bringing the data back the other way would make it a multi-step process of saving a temporary file, copying it to a commonly accessible location which had the permissions/authentication setup or intermediately sshing to each node along the path—​in short it exceeded my laziness threshold. So instead, I did the following:

    [me@localhost]$ ssh user@remote nc -l 11235 > output.file  # long, complicated connection hidden behind .ssh/config + ProxyCommand
    
    [me@remotehost]$ perl -ne 'print if /startpat/ .. /endpat/' file/to/be/extracted | nc localhost 11235
    

    I ended up choosing an arbitrary port and ran a remote listen process via ssh to pass on any output directed to the specific remote port and capturing as STDOUT on my local machine. There are a couple reasons I think this setup is nicer when compared to just running …


    sysadmin tips

    Ecommerce Solutions: What are the Options?

    Steph Skardal

    By Steph Skardal
    February 28, 2011

    Lately, I’ve been evaluating ecommerce options for use on a side hobby/business. I’m obviously a developer, so in theory I could use one of End Point’s supported ecommerce frameworks or just write my own framework. But, my bottom line is that I don’t need the feature set offered by some of the ecommerce options out there and I don’t necessarily have the resources to develop a custom solution.

    In addition to personal interest, End Pointers constantly encounter potential clients who aim to get a better understanding of the cost of using open source, our preferred ecommerce solution. I put together two infographics on ecommerce options, ongoing cost, feature sets, and the ability to customize. Before anyone flips out about the infographics, note that they represent my broad generalizations regarding the ongoing cost, feature sets and ability to customize. I’m intimately familiar with some of these options and less familiar with a couple of them.

    Feature Set versus Ongoing Cost of Ecommerce Solutions

    Ability to Customize versus Ongoing Cost of Ecommerce Solutions

    Some notes on on the ecommerce solutions shown in the infographics:

    • Online payment service (Paypal): An online payment …

    ecommerce interchange open-source spree cms magento

    What’s the difference?

    Josh Tolley

    By Josh Tolley
    February 27, 2011

    Not long ago a software vendor we work with delivered a patch for a bug we’d been having. I was curious to know the difference between the patch, a .tgz file, and the files it was replacing. I came up with this:

    ( \
      for i in `( \
          find new -type f | sed "s/new\///" ; \
          find old -type f | sed "s/old\///" ) | \
          sort | uniq`; do \
        md5sum old/$i new/$i 2>&1; \
      done \
    ) | uniq -u  -c -w 32
    

    Assuming the original .tgz file was unpacked into a directory called “old”, and the new one into “new”, this tells me which files exist in one directory and not other, and which files exist in both in different forms. Here’s an example using a few random files in two directories:

    josh@eddie:~/tmp/transient$ ls -l old new
    new:
    total 16
    -rw-r--r-- 1 josh josh 15 2011-03-01 10:15 1
    -rw-r--r-- 1 josh josh 12 2011-03-01 10:14 2
    -rw-r--r-- 1 josh josh 13 2011-03-01 10:15 3
    -rw-r--r-- 1 josh josh 12 2011-03-01 10:16 4
    
    old:
    total 16
    -rw-r--r-- 1 josh josh 15 2011-03-01 10:15 1
    -rw-r--r-- 1 josh josh  5 2011-03-01 10:06 2
    -rw-r--r-- 1 josh josh 13 2011-03-01 10:15 3
    -rw-r--r-- 1 josh josh 20 2011-03-01 10:18 5
    
    josh@eddie:~/tmp/transient$ ( \
    >   for i in `( …

    tips

    YUI Extensions and Post Initialization

    Brian J. Miller

    By Brian J. Miller
    February 26, 2011

    When using YUI3’s provided extension mechanism to enhance (composite, mix in, role, whatever you like to call it) a Y.Base inherited base class, it is often helpful to have “post initialization” code run after the attributes’ values have been set. The following code provides an easy way to hook onto a Y.Base provided attribute change event to run any post initialization code easily.


    javascript

    Debugging PHP extensions with the dynamic linker

    Jason Dixon

    By Jason Dixon
    February 25, 2011

    If you’ve ever had to track down a missing dependency or incompatible libraries, chances are good that you were assisted by the ldd command. This helpful utility reports the list of shared library dependencies required by a binary executable. Or in the typical use case, it will tell you which libraries are missing that your application needs to run.

    Fortunately most Linux and BSD distributions do a decent job of enforcing dependencies with their respective package managers. But inevitably, there’s the occasional proprietary, closed-binary third-party application or built-from-source utility that skirts the convenience of mainstream distributions. If you’re lucky, the vendor accurately details which software is required, including specific versions theirs was built against. If you’re not, well, you might have to resort to tools like ldd, or even process tracers like strace (Linux), ktrace (OpenBSD) and truss (Solaris).

    I recently had the misfortune of troubleshooting a PHP application that was unable to load imagick.so, a native PHP extension to create and modify images using the ImageMagick API. The problem manifested itself innocently enough:

    PHP Warning:  PHP Startup: Unable to …

    linux php tools

    Google Earth KML Tour Development Challenges on Liquid Galaxy

    Adam Vollrath

    By Adam Vollrath
    February 24, 2011

    Because Liquid Galaxy runs Google Earth, it can easily visualize an organization’s GIS data. End Point also develops tours within Google Earth to better present this data. A Liquid Galaxy’s networked multi-system architecture presents unique technical challenges to these tours.

    Many Google Earth tours incorporate animations and dynamic updates using the <gx:AnimatedUpdate> element. KML features in the Earth environment can be modified, changed, or created during a tour, including the size, style, and location of placemarks, the addition of ground overlays, geometry, and more.

    However, these updates are only executed on the Liquid Galaxy master system running the tour, not sent to its slaves. Liquid Galaxy nodes communicate primarily via ViewSync UDP datagrams. These datagrams contain only the master’s position in space and time. This means we cannot use <gx:AnimatedUpdate> to animate features across all Liquid Galaxy systems, sharply limiting its utility.

    But tours can also use chronological elements to display, animate, and hide features. Using <gx:TimeSpan> or <gx:TimeStamp> within an tour stop enables flying to a specific location in space and time. All …


    google-earth visionport kml
    Previous page • Page 167 of 220 • Next page