• 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

    XOR ROX

    Jeff Boes

    By Jeff Boes
    April 13, 2012

    Recently a co-worker posed an interesting issue:

    Given a non-zero integer $delta,

    an array of structures with two key/value pairs,

    { flag => boolean, quantity => non-zero value }

    Sort the array so that the first structures are those where either

    flag is true and (sign of $delta and sign of $quantity are different)

    or

    flag is false and (sign of $delta and sign of $quantity are the same)

    Secondarily, sort on the absolute value of $quantity.

    A solution fairly leaped out at me, but I’m not claiming incredible programming skill: in fact, the solution suggested an XOR operation, which was the second time in about as many weeks that I’d gotten to use XOR in Perl code. (It’s one of those things that you can literally write tens of thousands of lines of code without ever needing, so a second opportunity within the same decade was pretty pleasing in a code-geek kind of way.)

    The key to recognizing XOR in your problem solution is a pattern like:

    A AND (B != C) or ~A AND (B == C)

    or more simply:

    (A AND ~B) or (~A AND B)

    which is nothing more complex than the expanded equivalent of (A XOR B), from your college symbolic-logic class. The daunting sort problem becomes:

    @sorted = sort {( …

    perl

    Make your code search-friendly

    Jeff Boes

    By Jeff Boes
    April 12, 2012

    Here’s something about coding style that you may not have considered: is your code “search-friendly”? That is, does the format of your code help or hinder someone who might be searching it for context while debugging, extending, or just learning how it works?

    Seriously Contrived Example (from Perl):

    my $string = q{Your transaction could not be} .
       q{ processed due to a charge} .
       q{ card error.};
    return $string;
    

    Now someone’s going to experience this error and wonder where it occurs. So armed with grep, or ack, or git-grep, they set off into the wilderness:

    $ git grep 'could not be processed'
    $ git grep 'charge card error'
    $ git grep -e 'transaction.*charge.*error'
    $ alsdkjgalkghkf
    

    (The last simulates pounding the keyboard with both fists.) I would suggest humbly that “strings you emit as a line should appear as a line in your code”, if for no other reason than that it makes it so much easier for you or others to find them. Thus:

    my $string = <<'MSG';
    Your transaction could not be processed due to a charge card error.
    MSG
    return $string;
    

    perl search

    Tips for job applicants

    Jon Jensen

    By Jon Jensen
    April 12, 2012

    This a public service announcement for job applicants, a list of assorted suggestions I’ve collected over the years based on my own observations and conversations I’ve had with others who were hiring.

    General

    • When you apply for a job, make sure you actually have time to pursue it. It’s rude to say you’re too busy to interview except late in the evening or for 15 minutes on your cell phone in the parking lot outside work. Finding a job takes some investment and you shouldn’t waste potential employers’ time if you’re not ready to put some of your vacation time on the line.

    • This is old advice, but important as always: Don’t claim to have abilities or experience that you don’t! Be honest about your strengths and if directly asked, admit what you lack. We will find out anyway, and it’s pretty embarrassing to all of us to have to see you’re dishonest and clueless about something you claimed as a skill.

    Code samples and technical evaluation

    • If you’re applying for a programming job, be prepared to show recent code samples. Saying that all your work is under NDA with employers may be true, but doesn’t help us see what your code is like. If you can’t show any code from work, assemble …


    tips

    Three Things: Photography, Facebook on WordPress, and the watch command

    Steph Skardal

    By Steph Skardal
    April 11, 2012

    1. Photography News

    There’s been some recent news in the photography space. Adobe announced Photoshop CS6, and Lightroom 4, and Adobe Photoshop Touch recently. The Lytro Light Field camera has picked up recognition lately. The new Nikon D4 recently became available, as well as the Canon 5D MK III, both high end DSLRs.

    2. Facebook Comments for WordPress

    Last week, I was working on WordPress development for The Best Game Apps, and I came across a strange Facebook integration error about compatibility mode, show in the screen below:

    The site uses the WordPress plugin Facebook Comments for WordPress. After some research, I decided to dig into the Facebook documentation and the code to make the following change myself to specify the post URL as the href attribute in the facebook markup:

    219c219
    -    echo "\t<fb:comments xid='$xid' url='$postUrl' $siteisdark ",
    +    echo "\t<fb:comments xid='$xid' href='$postUrl' url='$postUrl' $siteisdark ",
    

    In the context of:

    219                     echo "\t<fb:comments xid='$xid' href='$postUrl' url='$postUrl' $siteisdark ",
    220 …

    tips

    Guide to Ubuntu 11.10 on a Samsung Netbook

    Brian Buchalter

    By Brian Buchalter
    April 8, 2012

    12.04 UPDATE: Unsurprisingly, after installing 12.04 which includes the 3.2.x kernel, brightness controls work perfectly out of the box. Sadly, it’s still necessary to tweak modprobe to get wireless working after a suspend/​resume. Also, don’t forget to reboot after making the changes!


    After reading a few too many reviews about netbook hardware and its compatibility with Linux, I settled on a Samsung NF310 netbook. However, like all things worth doing, it wasn’t nearly as easy as I’d hoped. This post highlights some of the lessons learned from my first days with Linux on my Samsung netbook.

    Pre-Installation

    I had been eagerly awaiting the arrival of my new hardware and had already gotten a fresh copy of Fedora 16 ready. The crippled Windows 7 Starter Edition was going to be off that netbook as a first order of business, as a matter of principle. If I had it to do over again, I would have installed the Windows-only BIOS update for the Netbook first. I’m working through using BartPE, but the installation onto the USB drive hasn’t gone well. Best to do these kinds of Windows-only activities while Windows is still easily available.

    Additionally, I would have used YUMI multiboot USB …


    linux tips hardware

    Custom Apache log to only show HTML requests

    Ron Phipps

    By Ron Phipps
    April 6, 2012

    Today while working on an AJAX issue for CollegeDistrict.com I came across a need to only see HTML requests to Apache while leaving out all of the many requests for images, CSS, and JavaScript files. This would make it quite easy to see when AJAX requests were making it through properly.

    I found a solution which worked well and used these settings in our development httpd.conf:

    SetEnvIf Request_URI "(\.html|\.shtml)$" html
    CustomLog logs/html.log common env=html
    

    apache sysadmin

    MWRC Highlights Part 2 of 2

    Brian Gadoury

    By Brian Gadoury
    April 6, 2012

    This is Part 2 of my 2012 Mountain West Ruby Conference Highlights article I posted the week of the conference. To date, I still have a ton of TODO reading from the conference. Here are some of the things mentioned during Day 2 of the conference that are on that list.

    Rollout: a gem that enables/disables sets of features for certain conditions, users, etc.

    • Rollout is a very slick way to activate or deactivate features within your web app programmatically. Perhaps you want to deploy a new feature in production, but only for internal IP addresses, or certain @users, or a percentage of your @users. Perhaps you do and that feature blows up in production, but it’s no big deal because with Rollout it only takes one line of code to turn that feature off for everyone. Perhaps it doesn’t “blow up” as much as “melt down” and you’d like your app to turn off that feature automagically before you get an angry call from your CTO? Check out the Degrade gem for that, Rollout’s awesome superhero sidekick.
    • By James Golick
    • Get it: https://github.com/jamesgolick/rollout
    • Mentioned by: Matt White in his “Continuous Deployment” talk

    Vagrant: an open source tool that manages virtual machines and their …


    conference ruby rails

    Stateful IPv6 tracking in RHEL 5: Fail

    Josh Williams

    By Josh Williams
    April 5, 2012

    Are you a RHEL 5 user? Or CentOS or Scientific Linux, for that matter? Have you started deploying IPv6 on RHEL 5? If you’re using ip6tables as a firewall in this environment, you may want to double check its configuration.

    The short version: The 2.6.18 kernel RHEL 5 ships doesn’t have a working conntrack module for IPv6. The conntrack module is what ip6tables uses for stateful packet tracking. You may already be familiar with it from the IPv4 version of iptables, looking something like this in your firewall config:

    -m state --state ESTABLISHED,RELATED -j ACCEPT
    

    ip6tables will accept that as well, it just doesn’t do much. The rule is effectively skipped, and the processing eventually gets down to where ip6tables is set to drop or reject, unless it matches something else along the way. Thus it appears that outgoing connections are blocked for most servers, but maybe not everywhere, even if you don’t have any rules in your OUTPUT chain.

    Incoming connections will of course work fine, as those don’t rely on the state match (at least initially) and instead match explicitly defined rules for public ports, specific source addresses, etc. RHEL 6 is also fine, as the more recent kernel has …


    ipv6 redhat
    Previous page • Page 146 of 219 • Next page