• 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

    Python Imports

    Miguel Alatorre

    By Miguel Alatorre
    July 24, 2014

    For a Python project I’m working on, I wrote a parent class with multiple child classes, each of which made use of various modules that were imported in the parent class. A quick solution to making these modules available in the child classes would be to use wildcard imports in the child classes:

    from package.parent import *
    

    however, PEP8 warns against this stating “they make it unclear which names are present in the namespace, confusing both readers and many automated tools.”

    For example, suppose we have three files:

    # a.py
    import module1
    class A(object):
        def __init__():
            pass
    
    # b.py
    import module2
    class B(A):
        def __init__():
            super(B, self).__init__()
    
    # c.py
    class C(B):
        def __init__():
            super(C, self).__init__()
    

    To someone reading just b.py or c.py, it is unknown that module1 is present in the namespace of B and that both module1 and module2 are present in the namespace of C. So, following PEP8, I just explicitly imported any module needed in each child class. Because in my case there were many imports and because it seemed repetitive to have all those imports duplicated in each of the many child classes, I wanted to find out if there was a better …


    python

    Python Subprocess Wrapping with sh

    Kirk Harr

    By Kirk Harr
    July 24, 2014

    When working with shell scripts written in bash/csh/etc. one of the primary tools you have to rely on is a simple method of piping output and input from subprocesses called by the script to create complex logic to accomplish the goal of the script. When working with python, this same method of calling subprocesses to redirect the input/output is available, but the overhead of using this method in python would be so cumbersome as to make python a less desirable scripting language. In effect you were implementing large parts of the I/O facilities, and potentially even writing replacements for the existing shell utilities that would perform the same work. Recently, python developers attempted to solve this problem, by updating an existing python subprocess wrapper library called pbs, into an easier to use library called sh.

    Sh can be installed using pip, and the author has posted some documentation for the library here: http://amoffat.github.io/sh/

    Using the sh library

    After installing the library into your version of python, there will be two ways to call any existing shell command available to the system, firstly you can import the command as though it was itself a python library: …


    shell python

    Creating a Symbol Web Font

    Zed Jensen

    By Zed Jensen
    July 17, 2014

    Creating a custom font that only includes a few characters can be very useful. I was looking for a good way to display left and right arrows for navigating between clients and also between team members on our site and after doing some research, creating a custom font seemed like a good way that would be small and that would support all kinds of screens and browsers. So, here I’ll show how to create a web font with a few custom characters in it that you can use on your website.

    You’ll need to get the free, open source vector graphics editor Inkscape and familiarize yourself with its drawing tools.

    To start, open Inkscape and open the SVG font editor by clicking Text -> SVG Font Editor. Under the font column, click “New” and then name your new font.

    Now you can start adding characters. Begin by adding as many glyphs as you need and choosing letters for your character to be represented by. Only use characters that you can find on a standard QWERTY keyboard, as FontSquirrel (which we’ll use to convert this to a web font) won’t work with, for instance, Unicode special characters.

    Now, for each symbol, draw it using Inkscape’s tools and make sure that its dimensions are …


    graphics

    Runaway Rewrite Rule

    Jeff Boes

    By Jeff Boes
    July 16, 2014

    I am not an expert in Apache configuration. When I have to delve into a *.conf file for more than five minutes, I come out needing an aspirin, or at least a nerve-soothing cupcake. But necessity is the mother of contention, or something like that.

    My application recently had added some new URLs, which were being parsed by your typical MVC route handler (although in Perl, because that’s how I roll, and not in Dancer, because … well, I don’t think it had been invented yet when this application first drew breath). 99.9% of the URLs worked just fine:

    /browse/:brand/:category (the pattern)
    /browse/acme/widget
    /browse/ben-n-jerry/ice-cream
    

    and so on. Suddenly a report reached me that one particular brand was failing:

    /browse/unseen-images/stuff
    

    (“unseen-images” has been changed to protect the innocent. The key here is the word “images”; put a pin in that and hang on.)

    /browse/unseen-images
    

    worked just fine. What’s worse, instrumenting the route handler code proved that it wasn’t even being called for /browse/unseen-images/foo or any of its siblings, whether :category was valid or not.

    Making sure my bottle of aspirin was at hand, I dove into the Apache configuration. I added –

    RewriteLog …

    apache

    Interactive Highlighting and Annotations with Annotator

    Steph Skardal

    By Steph Skardal
    July 15, 2014

    Over a year ago, I wrote about JavaScript-driven interactive highlighting that emulates the behavior of physical highlighting and annotating text. It’s interesting how much technology can change in a short time. This spring, I’ve been busy at work for on a major upgrade of both Rails (2.3 to 4.1) and of the annotation capabilities for H2O. As I explained in the original post, this highlighting functionality is one of the most interesting and core features of the platform. Here I’ll go through a brief history and the latest round of changes.


    Example digital highlighting of sample content.

    History

    My original post explains the challenges associated with highlighting content on a per-word basis, as well as determining color combinations for those highlights. In the past implementations, each word was wrapped in a single DOM element and that element would have its own background color based on the highlighting (or a white background for no highlighting). In the first iteration of the project, we didn’t do allow for color combinations at all – instead we tracked history of highlights per word and always highlighted with the most recent color if it applied. In the second iteration of …


    javascript ruby rails

    Liquid Galaxy installation at Sparkassen-Finanzportal Forum 2014

    Szymon Lipiński

    By Szymon Lipiński
    July 11, 2014

    In May, End Point and Google organized a Liquid Galaxy installation at Sparkassen-Finanzportal Forum 2014 in Düsseldorf, Germany.

    For this event End Point installed the Liquid Galaxy and also prepared custom tours for the Liquid Galaxy showing different Sparkasse localizations across Germany.

    We arrived at Düsseldorf a day before the event, and assembled the whole Liquid Galaxy without any problems. The system consists of 7 displays and 6 computers, so the potential for issues is pretty great, but we’ve done this a number of times, and have worked out a good stable build. After assembly, the system worked pretty well. Our US-based team then finalized the custom tours and uploaded the most recent software and content.

    The next morning when we arrived at the event place, everything was working great, and the system was ready for people to explore and discover. As per usual, people were interested not only in the prepared tours, but also were looking for the places they know (usually, their house!). The overall user experience is great, especially when people were able to see places they hadn’t seen for quite a long time, like the places where they grew up.

    This is another successful …


    visionport

    Facebook, Twitter, Google+ sharing with the URL

    Marina Lohova

    By Marina Lohova
    July 10, 2014

    This blog post is intended for the folks who spent way more time displaying social sharing buttons on their websites than originally planned. My buttons were supposed to bring up the Share Dialog for Facebook, Twitter and Google+ platforms. I had the requirement to display a custom logo and a custom description. It seemed easy… until it turned out to be rather difficult.

    The appropriate format for Twitter is:

    <a href="http://twitter.com/share?text=<%= desc %>&url=<%= url %>">Twitter</a>
    

    Note that Twitter dialog does not include the picture, only the description.

    Trouble started with Facebook when I learned that custom parameters in Facebook’s sharer.php url are officially not supported anymore: https://developers.facebook.com/bugs/357750474364812. I tried the format widely suggested on forums, and while custom image was successfully displayed, neither title, not description showed.

    <a href="http://www.facebook.com/sharer.php?u=<%= url %>&p[images][0]=<%= img  %>&description=<%= desc %>">Facebook</a>
    

    Facebook documentation hinted that addition of the OpenGraph Protocol standard tags to the of …


    social-networks api

    Interchange 5.8.2 Release with Bcrypt Encryption Support

    Mark Johnson

    By Mark Johnson
    July 9, 2014

    The most recent release of Interchange contains support for adding encryption to user passwords with bcrypt. This provides for a significant improvement over the previously supported encryption options. Whether you are starting with a new user table, or have a long-established user table with any of the other supported encryption types, you can take advantage of this enhancement to Vend::UserDB.

    In order to utilize bcrypt, you will need to have successfully installed the Digest::Bcrypt and Crypt::Random modules. Once installed, it is recommended (though not required, ironically) you add these as Required modules to interchange.cfg to ensure Interchange can find them and will report back immediately if not:

    Require module Digest::Bcrypt
    Require module Crypt::Random
    

    To use bcrypt, configure your UserDB directive with the following options:

    • bcrypt—​set to 1
    • cost—​desired cost between 1 and 31 (optional; current default is 13)
    • bcrypt_pepper—​random string used to apply a unique padding pattern (also optional, but strongly recommended)

    To encourage adoption of bcrypt, there are two mechanisms available that allow a user table already using another encryption type to convert to using …


    bcrypt ecommerce interchange security sysadmin
    Previous page • Page 93 of 220 • Next page