Press "Enter" to skip to content

Category: Computers

Everything computer related

Setting up Debian on a BeagleBone Black

This post is about installing Debian (BeagleBone Black – 2GB eMMC) 2014-03-27 and Flashing the eMMC using a Mac running OSX 10.9 Mavericks.

I decided to get a head start on using Debian with the BBB which is soon to tbe the default OS installed on them.

These are the steps I used today to get up and running:

  1. Download image from http://beagleboard.org/latest-images
     – BBB-eMMC-flasher-debian-7.4-2014-03-27-2gb.img.xz
  2. Use Unarchiver to extract disk image
     – BBB-eMMC-flasher-debian-7.4-2014-03-27-2gb.img
  3. Download PiFiller to copy the disk image to the SD card
     – http://ivanx.com/raspberrypi/
    WARNING: Do not insert the SD card yet, PiFiller will tell you when
  4. Run PiFiller and follow the directions
    1. Choose the disk image
    2. Insert the SD card
    3. Verify that PiFiller has found the correct device
    4. Some more verifying, click OK a couple of times
    5. Now wait awhile, it took about 20 minutes on my MacBook Pro
      Holy Cow! The dialog box opening and closing gets really annoying to watch!
    6. All set when you get the “Your SD card is ready” message
  5. Eject the SD from the Mac OS then remove it from the computer
  6. With the BBB unplugged, no network, USB, video, power cables, insert the SD card into the BBB
    WARNING: The SD card pokes out of the back of the BBB enough that it is easy to bump it and cause it to eject. Especially when plugging in a USB or HDML cable. It pays to be slow and patient when manipulating the BBB with an SD card in place.
  7. Get ready: When plugging in the BBB you will need to hold down the Boot button until all 4 USR lights turn on
     – While holding down the Boot button insert a 5V 2A power supply, release the Boot button when all 4 USR lights turn on
  8. Now the USR buttons should start blinking in a seemingly random pattern, this should go on for 20 to 60 minutes depending on the OS and SD card
  9. When the USR lights all light-up again the eMMC has been flashed with Debian
  10. Remove the power adapter
  11. Remove the SD card

You are now ready to plug-in the devices you want to work with and enjoy Debian

More information about installing operating systems on the BeagleBone Black:
http://beagleboard.org/Getting%20Started#update
http://learn.adafruit.com/beaglebone-black-installing-operating-systems/overview

ComputersElectronics

BeagleBone Black Microcontroller

Boris, the BeagleBoard Logo MascotI recently bought a BeagleBone Black (BBB) and am having a great time with it.

From the website beaglebord.org:

BeagleBone Black is a $45 MSRP community-supported development platform for developers and hobbyists. Boot Linux in under 10 seconds and get started on development in less than 5 minutes with just a single USB cable.

What I Bought

I bought my BBB from Makershed as a part of a kit which included the book Getting Started with BeagleBone by Matt Richardson and a handful of electronic components. The kit is not bad, but I feel like it is overpriced, especially for someone who has a lot of components already.

I recommend the book as a good starting point, it does a great job of introducing the basics of the board and using Python and JavaScript to program it. There aren’t many other books out there, but I am not sure there needs to be.

I also bought a power supply, a very cool case, and a wi-fi dongle from Amazon.

The power supply is very basic one that provides the 2 amps necessary to power the BBB with a Wi-Fi dongle attached. Power Adapter DC 5V, 2A, 10W for BeagleBone Black at Amazon

I don’t have much to say about the Wi-Fi dongle yet as I haven’t tried to use it, I will write more about it when I do. It is small and was only $10 so I happy with it so far. Edimax EW-7811Un 150 Mbps Wireless 11n Nano Size USB Adapter with EZmax Setup Wizard

The case is pretty awesome. It is very well made and lets you see right into the board with risers for the buttons that make it much easier to press them. The BegaleBone Black should ship with a case like this. It looks like Laser Goodies has pulled their products from Amazon, or maybe they are just out of stock, here is the page on their website Beaglebone Black Slim Case – Clear

Laser Goodies Beaglebone Black Slim Case - Clear
Laser Goodies Beaglebone Black Slim Case – Clear

Why I Bought It

I regularly attend the wonderful Atlanta JavaScript Meetup group and a couple of weeks ago Tim Kadom of Thoughtworks showed us his Telepresence robot built with a BeagleBone black and an iPhone. All of the code was written on the BBB with the Cloud9 IDE in JavaScript. I was seriously intrigued.

I have been playing with Ardunio microcontrollers for awhile now and really like them. But they require that you program in their own C like language which I can muddle through but don’t really like. And it is not easy getting an Ardunio on a network, the code to make Ethernet, Wi-Fi, or Bluetooth to work doesn’t leave much space for your own ideas.

The Rasberry Pi on the other hand just doesn’t speak to me. I am more interested in them now that I have spent some time with a BeagleBoard, but I still don’t think I have much of a use for a Rasberry Pi right now.

With the BeagleBone it appears that I get all of the inputs and outputs of an Arduino while having all of the network abilities of a Rasberry Pi that I can program using JavaScript. That really gets me excited!

In the coming weeks I will be posting more about the BeagleBone Black and the project I am working towards.

ComputersElectronics

Getting Started with BeagleBone by Matt Richardson

After seeing a really cool telepresence robot using a BeagleBone at an Atlanta JavaScript Meetup I just had to get one.

I ended up buying a Beagle Bone Black (BBB) from MakerShed in a kit that included some components and a paperback of Getting Started with BeagleBone.

While waiting for the BBB to arrive I started reading the book on Safari Books Online and ended up never reading more than a couple of pages from the printed book. I was more comfortable reading the book on an iPad using the Safari Books Online app.

This is a very good “Getting Started” book. Its purpose is to build familiarity and confidence for someone who has not used a BBB before, and it does that very well. So well that even before I was done with it I had a ton of plans for my BBB including updating the OS from Angstrom to Debian, adding an NTP server, and a lot more.

Now I am planning on creating a remote home automation system for our garage doors.

From the publisher:

Many people think of Linux as a computer operating system, running on users’ desktops and powering servers. But Linux can also be found inside many consumer electronics devices. Whether they’re the brains of a cell phone, cable box, or exercise bike, embedded Linux systems blur the distinction between computer and device.

Many makers love microcontroller platforms such as Arduino, but as the complexity increases in their projects, they need more power for applications, such as computer vision. The BeagleBone is an embedded Linux board for makers. It’s got built-in networking, many inputs and outputs, and a fast processor to handle demanding tasks. This book introduces you to both the original BeagleBone and the BeagleBone Black and gets you started with projects that take advantage of the board’s processing power and its ability to interface with the outside world.

I rate Getting Started with BeagleBone a 10 out of 10 and recommend it to anyone as a first exposure to the BBB.

BooksComputersNon-Fiction

Metro: Last Light by 4A Games

I played the first Metro game, Metro 2033, and thought it was pretty good so when I saw Metro: Last light on sale at Steam I decided to give it a try.

The Metro games are based on books written by Dmitry Glukhovsky; which I have not read. After playing both of these video games I will probably not read them… It is not my kind of story. I am not really a big fan of the Horror-Survival genre but somehow I have found myself playing a few of them.

Metro: Last Light was ok but nothing great, I am surprised that it received Gamespot’s Editor’s Choice Award in 2013. I guess there weren’t that many good games in 2013.

In both of the games I was seriously annoyed by all of the cut-scenes and times that I was not in control of the character. It felt like there was very little time spent playing with a lot of time just watching, BORING!

To top it off there were no guns in the game that really excited me, they were mostly ok, but nothing special at all.

In 9 hours I played through the entire game at Normal settings and I really do feel like I spent as much time passively watching cut-scenes as I spent playing.

The graphics are gorgeous though, I played it on a Late 2013 27" iMac with very high settings and it was smooth and beautiful throughout.

From the publisher:

It Is the Year 2034.

Beneath the ruins of post-apocalyptic Moscow, in the tunnels of the Metro, the remnants of mankind are besieged by deadly threats from outside – and within. Mutants stalk the catacombs beneath the desolate surface, and hunt amidst the poisoned skies above.

But rather than stand united, the station-cities of the Metro are locked in a struggle for the ultimate power, a doomsday device from the military vaults of D6. A civil war is stirring that could wipe humanity from the face of the earth forever.

As Artyom, burdened by guilt but driven by hope, you hold the key to our survival – the last light in our darkest hour…

I rate this game a 6 out of 10 and only recommend it to the desperate.

ComputersGames

Delicious Library 3

Delicious Library 3 WebsiteMy wife and I read a lot of books. Now that our son has gotten a little older and needs less attention, I go through more than a book a week on average, Bobbie doesn’t go through as many books in number, but she is reading much larger non-fiction books and taking copious amounts of notes.

Many years ago I bought Delicious Library 2 (DL2) as a part of a bundle deal. Bobbie and I used it to catalog all of our fiction and collectable books. It worked well enough and with some simple PHP and YUI coding I built a simple web page we could use on our phones to check our library while out and about.

Then disaster struck, I reformatted/re-installed all of our computers and updated them to the latest version of the Mac OS. I thought I had backed everything up, but apparently Delicious Library’s database was not.

Lately Bobbie has been asking me about how to update the Library page with the new books we have purchased. I did another round of research for library software and came to the decision to buy and use Delicious Library 3 (DL3).

I bought it from the Apple App Store, which means it can run on all of our machines and it will stay up-to-date via the App Store app.

The great news is that even though I had lost the DL2 database, DL3 was able to import the CSV file I was using on our website and retrieve the information for the 450+ plus books that were in it from Amazon. That was pretty amazing and made me very happy.

Also, the iPhone app Delicious Scanner worked great for me successfully scanning about 75% of the books that had barcodes in our library. I was kind of surprised how well it worked, DL2 was not nearly as successful using the iSight camera on a laptop. I was also surprised by how many books we have that do not have any kind of bar code or even an ISBN code, a lot of Bobbie’s antique books predate ISBN.

The good news is that scanning the rest of the books went faster than I expected and DL3 did a good job of finding the books on Amazon with a little bit of manual help. DL3 is not fully automatic; I don’t think any book library app could be, there is always going to be manual work involved. Adding the meta-data that is important to us like the name of the Series that a book is a part of, the book’s number in the series, and the character name’s that appear in the book is always going to be manual because what is important to us is not going to be important to everyone.

The bad news is the DL3 is still burying its database in a proprietary format in a deeply hidden corner of your computer. There is still no way for multiple people to collaborate on a single library, you can export/import libraries but it is very klunky and if every book does not have an associated ISBN or Amazon code you are bound to have duplicate entries. And the templates for exporting an HTML version of your library are absolutely useless!

The HTML output and even the default interface of DL3 makes me very sad and frustrated. The developers/designers of the app spent all this time on graphics, 3D effects, and a multitude of wood grains instead of on the usability of the app.

This is what we need from a library app:

  1. Easy book entry
  2. Easy to find a book in the library

Delicious Library 3 is awesome at book entry, that part fits my needs almost perfectly. The only thing that would make it better is integration with data sources other than Amazon.

DL3 Bookshelf ViewWhen it comes to finding a previously entered book, the DL3 app on the desktop works ok. The default 3D Bookshelf view with the books on a shelf (duh) is absolutely worthless for this, it makes it almost impossible to scan through the books and the cover from Amazon may not match the cover of the real book on your shelf making it counter-productive.

Switching to List view improves the situation a lot. You can control what fields/columns are visible and sort the columns.

DL3 Search ResultsOh wait; right there in the top left is search box. Well that should help right? WRONG, when you enter text in that box it displays the results in a pop-up with a fixed width that truncates the book titles to the point that they are useless.

I am going to stop complaining right there. Delicious Library has a lot of usability issues that will apparently never be addressed, lets move on to why it is still a very useful app.

You can output a CSV file!

DL3 Export a CSVI have written a little PHP file that takes the CVS file that DL3 outputs and makes a very simple HTML table with the data. Then I use jQuery and a couple libraries to make the table sortable, searchable, and filterable.

The PHP is not very efficient, if we had many more books the JavaScript/jQuery would be to slow to be useful, and having it all in a database would make it easier to do some other cool stuff with the data. But for now the simple PHP and JavaScript fit our needs and give us a great interface into our book library.

My Simple Library
My Simple Library

Here is my UGLY PHP:


<?PHP
$firstRow = true;
$file_handle = fopen("export.csv""r");
while (!feof($file_handle) ) {
    $line_of_text = fgetcsv($file_handle1024);
    $author = $line_of_text[1];
    $title = $line_of_text[4];
    $series = $line_of_text[2];
    $subtitle = $line_of_text[3];
    if ($author == "") {
        $author = " ";
    }
    if ($title == "") {
        $title = " ";
    }
    if ($series == "") {
        $series = " ";
    }
    if ($subtitle == "") {
        $subtitle = " ";
    }
    if ($firstRow == false) {
        if ($line_of_text[0]) {
            print "" . $author . "" . $title . "" . $series . "" . $subtitle . " ";
        }
    } else {
        $firstRow = false;
    }
}
fclose($file_handle);
?>

I am using jQuery 2.0.2 and tablesorter with the Zebra and Filter widgets.

Here is the JavaScript, it is almost entirely cut and paste from the tablesorter web page:


$(document).ready(function()
    {
        $("#myTable").tablesorter({
          theme : 'blue',
          sortList: [[0,0], [1,0]],
          widgets: ["zebra""filter"],
          widgetOptions : {
            // If there are child rows in the table (rows with class name from "cssChildRow" option)
            // and this option is true and a match is found anywhere in the child row, then it will make that row
            // visible; default is false
            filter_childRows : false,

            // if true, a filter will be added to the top of each table column;
            // disabled by using -> headers: { 1: { filter: false } } OR add class="filter-false"
            // if you set this to false, make sure you perform a search using the second method below
            filter_columnFilters : true,

            // css class applied to the table row containing the filters & the inputs within that row
            filter_cssFilter : 'tablesorter-filter',

            // class added to filtered rows (rows that are not showing); needed by pager plugin
            filter_filteredRow   : 'filtered',

            // add custom filter elements to the filter row
            // see the filter formatter demos for more specifics
            filter_formatter : null,

            // add custom filter functions using this option
            // see the filter widget custom demo for more specifics on how to use this option
            filter_functions : null,

            // if true, filters are collapsed initially, but can be revealed by hovering over the grey bar immediately
            // below the header row. Additionally, tabbing through the document will open the filter row when an input gets focus
            filter_hideFilters : false// true, (see note in the options section above)

            // Set this option to false to make the searches case sensitive
            filter_ignoreCase : true,

            // if true, search column content while the user types (with a delay)
            filter_liveSearch : true,

            // jQuery selector string of an element used to reset the filters
            filter_reset : 'button.reset',

            // Delay in milliseconds before the filter widget starts searching; This option prevents searching for
            // every character while typing and should make searching large tables faster.
            filter_searchDelay : 300,

            // if true, server-side filtering should be performed because client-side filtering will be disabled, but
            // the ui and events will still be used.
            filter_serversideFilteringfalse,

            // Set this option to true to use the filter to find text from the start of the column
            // So typing in "a" will find "albert" but not "frank", both have a's; default is false
            filter_startsWith : false,

            // Filter using parsed content for ALL columns
            // be careful on using this on date columns as the date is parsed and stored as time in seconds
            filter_useParsedData : false,

            filter_onlyAvail : 'filter-onlyAvail'
          }
        });
    }
);

If you are looking for a way to keep track of your books, give Delicious Library 3 a try. So far it is working well for us.

BooksComputersWebsite

Maintainable JavaScript by Nicholas C. Zakas

Maintainable JavaScript by Nicholas C. Zakas
Maintainable JavaScript by Nicholas C. Zakas
I read this book using Safari Books Online using various laptops and an iPad.

This is an amazing book.

Following a style guide while programming is common in many languages, but for me it is a new idea in JavaScript. Reading Douglas Crockford’s Style Guide http://javascript.crockford.com/code.html can teach you a lot, but Maintainable JavaScript teaches you not only the how, but also the why.

This book does focus on following a style guide but it also includes how to set-up and use a build system with your JavaScript. I can’t wait to start putting that information to use. As a front-end developer I have not used a build system.

Nicholas also has a great presentation available that covers many of the topics in the book on SlideShare at http://www.slideshare.net/nzakas/maintainable-javascript-2012

From the publisher:

You may have definite ideas about writing code when working alone, but team development requires that everyone use the same approach. With the JavaScript practices in this book—including code style, programming tips, and automation—you’ll learn how to write maintainable code that other team members can easily understand, adapt, and extend. Author Nicholas Zakas assembled this collection of best practices as a front-end tech leader at Yahoo!, after completing his own journey from solo hacker to team player.

I rate this book a 10 out of 10 and recommend it to anyone who has moved beyond beginner JavaScript.

BooksComputersNon-Fiction

Codecademy JavaScript Courses

Codecademy Web Site
Codecademy
I first learned about Codecademy last year and I immediately jumped into it and completed a few of the JavaScript courses and promptly forgot about it.

Lately I have been writing more and more JavaScript and jQuery to make interactive prototypes for work. I rate my JavaScript skills somewhere around intermediate and I am challenging myself to work my way up to expert by the end of the year. As a part of that personal challenge I have been reading a lot of JavaScript, jQuery, and Git books and websites, this is how I ended up back on the Codecademy website.

Compared to last year, Codecademy has made many improvements. The JavaScript courses have been updated, they still have plenty of ambiguous wordings that makes completing the lesson harder than it should be and many of the lessons don’t teach much more than how to cut-and-paste. But with some help from the available Forums, I finished the JavaScript courses in 4 days without too much trouble.

I really enjoyed the courses on inheritance and constructors. I am going to put that to use immediately and refactor a lot of code and use courses to make my code much easier to maintain, modify and re-use.

All that said, I did have some issues while working through the lessons. A handful of times, I thought I understood the task but just couldn’t get it to accept my answer. The forums were helpful but it was not easy to find questions/answers related to the exact lesson/task I was having trouble with. I would appreciate it if the forums were broken down by individual lessons instead of by whole class.

The in-browser coding environment is very slick, but in many of the lessons there were warnings from JSHint. Those warning were very distracting when I was starting out, after awhile I learned to ignore most of them.

Overall I enjoyed the Codecademy experience and I plan on continuing participating on the courses offered there. In between reading books and writing code, probably while on the couch in front of the TV, I will work my way through the Web Fundamentals, jQuery, JavaScript (done), Projects, Python, Ruby, PHP, and APIs lessons.

From Codecademy:

Codecademy is an education company. But not one in the way you might think. We’re committed to building the best learning experience inside and out, making Codecademy the best place for our team to learn, teach, and create the online learning experience of the future.

Education is old. The current public school system in the US dates back to the 19th century and wasn’t designed to scale the way it has. Lots of companies are working to "disrupt" education by changing the way things work in the classroom and by bringing the classroom online.

We’re not one of those companies. We are rethinking education from the bottom up. The web has rethought nearly everything – commerce, social networking, healthcare, and more. We are building the education the world needs – the first truly net native education. We take more cues from Facebook and Zynga in creating an engaging educational experience than we do from the classroom.

We do not want to open up universities. We want to open up knowledge. Everyone knows something they can teach someone else and we want to help them do it. Our community has created tens of thousands of courses and taken millions of courses. At this point, more than a billion lines of code have been submitted to Codecademy.

Education is broken. Come help us build the education the world deserves.

I rate Codecademy a 9 out of 10 and it wouldn’t take many improvements to make it a 10.

ComputersWebsite

Adobe Fireworks CS6 Classroom in a Book: The official training workbook from Adobe Systems

I read this book on O’Reilley’s Safari Books Online using personal and work laptops along with the Safari Books app on an iPad.

I really like the Adobe Classroom in a Book series and have read many of them. They are great because they are based on real-world use and come with all of the files needed to build the projects used in them.

Back in the day I did the Photoshop Classroom in a Book and completed all of the tutorials, followed every step, and wrote out the answers to the quizzes at the end of each chapter. Since then I pretty much just read through the book and absorb as much as I can, returning to the book when I get stuck in the project I am working on.

I am working with a designer that uses Fireworks to build his web site designs and was completely befuddled by Fireworks. Getting the images I needed to build a demo web site seemed incredibly hard and inefficient. So I grabbed this book and spent a couple of days reading it.

This book did not disappoint, it has already helped me figure out how to get the content out of Fireworks more efficiently. It still doesn’t make a lot of sense to me just how hard it is, but most of that is just how Fireworks functions and I am still not a fan of it. Fireworks is a through-back to the Macromedia days and I don’t feel like it has been updated the way it should be for modern web design. It may be a good tool for designers to build prototypes and designs to show clients, but for the people trying to implement those designs it kinda sucks.

One of the cool features of Fireworks I learned form the book is the creation of CSS3 properties that closely mimic the Live Filters such as drop-shadows, with some tweaking this has worked great for us and really saved a lot of time.

I only have one real complaint about this book, the design used in the tutorials feels very Y2K to me, it is very dated. It is not Web 2.0, responsive, or anything that I would consider "modern."

From the publisher:

Those creative professionals seeking the fastest, easiest, most comprehensive way to learn Adobe Fireworks choose Adobe Fireworks CS6 Classroom in a Book from the Adobe Creative Team. The 14 project-based lessons in this book show readers step-by-step the key techniques for working in Fireworks.

Readers will learn what they need to know to design and mock up Web pages or interfaces for rich Internet applications or tablet apps. In addition readers will learn how to demo a design for a client in real time, export the design as an interactive PDF, and export vector design elements as CSS3-only markup for use in websites. This edition, fully revised for CS6, covers CSS extraction using the CSS Properties panel, jQuery Mobile skinning, and sprite creation. It also includes instruction on working with the Styles panel and several new enhancements to the Properties panel, including the new color selection and gradient editing features. The companion DVD includes lesson files so readers can work along with the book.

I rate this book an 8 out of 10, anyone who needs to or wants to learn Adobe Fireworks can learn a lot from it in a short time.

BooksComputersNon-Fiction

Fotorama Slide Show and phpSmug

Fotorama Web Site Home Page
Fotorama
As a part of my web site moving and redesign I wanted to include a slideshow at the top of the home page.

After researching and thinking about writing one of my own I found Fotorama which is a jQuery based slideshow framework that allows for many different types of slideshows with a ton of options. Take a look at the website and the examples, they are amazing.

So I broke the process down into a handful of steps and iterated up to the dynamic slideshow that it is now.

The first step was getting a version running on a test page with static content hard-coded into the page. There was a bit of tweaking here and there along with coming up with the idea to have a design that resembles a new window "Window" with Hide and Fullscreen buttons.

The next step was figuring out how to dynamically get the picture URLs and Captions directly from SmugMug so that anytime I update SmugMug the slidesow on my website would also be updated. For that I chose to use phpSmug which is a wrapper class for the SmugMug API written and maintained by Colin Seymour.

I ran into 2 issues with implementing phpSmug, the biggest of which was that it would randomly error out with a "CURL Error 7" which was causing my website to load very slowly and breaking the slideshow. I have addressed this issue by using the caching built into phpSmug combined with writing the parsed data necessary for the slideshow into a MySQL table. Anytime the SmugMug API is not available and the phpSmug cache has expired the data for the slideshow will be pulled from the database.

Here is the code:


<?php
$user="username";
$password="password";
$database="database_name";
$tablename="table_name";
mysql_connect(localhost,$user,$password);
@mysql_select_db($databaseor die"Unable to select database");

/* Last updated with phpSmug 3.0 */
require_once"/path/to/phpSmug.php" );

try {
  $code = "SmugMug API";
  // My API Key and App Name from SmugMug Admin Panel
  $f = new phpSmug"APIKey=api_key""AppName=app_name_and_version" );
  // Enable disk based caching with expires in 1 hour
  $f->enableCache("type=fs""cache_dir=/path/to/phpsmugcache""cache_expire=3600" );
  // Set timeout
  $f->req->setConfig(array'timeout' => 2));
  // Login Anonymously
  $f->login();
  // Get images from Portfolio
  $images = $f->images_get"AlbumID=album_id""AlbumKey=album_key""Heavy=1" );
  $images = ( $f->APIVer == "1.2.2" ) ? $images['Images'] : $images;
  $i = 0;
  foreach ( $images as $image ) {
    if ($i != 0) {
      $query .=  ",\n";
      $output .=  ",\n";
    }
    $i++;
    // Create SQL String
    $query .= "('','".$image['X2LargeURL']."','".$image['TinyURL']."','".htmlentities($image['Caption'],ENT_QUOTES)."')";
    $output .= "{img: \"".$image['X2LargeURL']."\", thumb: \"".$image['TinyURL']."\", caption: \"".htmlentities($image['Caption'])."\"}";
  }

  // Empty Out Table
  mysql_query('TRUNCATE TABLE '.$tablenameor die(mysql_error());

  // Populate Table
  mysql_query("INSERT INTO cache (`id`, `x2largeurl`, `tinyurl`, `caption`) VALUES ".$query);

} catch ( Exception $e ) {
  $code = "{$e->getMessage()} (Error Code: {$e->getCode()})";
  //Read from Database
  $query="SELECT * FROM ".$tablename;
  $result=mysql_query($query);
  $num=mysql_numrows($result);

  $i=0;
  while ($i < $num) {
    $X2LargeURL=mysql_result($result,$i,"x2largeurl");
    $TinyURL=mysql_result($result,$i,"tinyurl");
    $Caption=mysql_result($result,$i,"caption");

    if ($i != 0) {
      $output .=  ",\n";
    }
    $i++;

    // Create SQL String
    $output .= "{img: \"".$X2LargeURL."\", thumb: \"".$TinyURL."\", caption: \"".$Caption."\"}";
  }

}

mysql_close();

?>


jQuery(document).ready(function(){

  try { console.log('code: <?php echo $code ?>'); } catch(err) { }

  // Load Fotorama.js script
  jQuery.getScript("/scripts/fotorama.js"function(){

    var portfolioBuildFlag = false;
    jQuery('#main').prepend('<article class="fotoramaWrapper"><div class="portfolioHeader gradient">Dave Nelson's Portfolio <div><span id="portfolioHide">[ Hide ]</span> <span id="portfolioFullScreen">[ Fullscreen ]</span></div></div><div id="myPortfolio"></div></article>');

    jQuery('#portfolioHide').on('click',portfolioToggle);
    jQuery('#portfolioFullScreen').on('click',function() {
      if(jQuery("#myPortfolio").is(":hidden") || portfolioBuildFlag === false) {
        portfolioShow();
      }
      jQuery('#myPortfolio').trigger('fullscreenopen');
    });

    function portfolioBuild() {
      jQuery('#myPortfolio').fotorama({
        data: [
        <?php
          echo $output."\n";
        ?>
        ],
        width'100%',
        height'auto',
        aspectRatio1.5,
        minHeight500,
        fitToWindowHeightfalse,
        margin0,
        shadowsfalse,
        cropToFitfalse,
        caption'overlay',
        autoplay3000,
        thumbBorderColor'#FCB03E',
        fullscreenIcontrue
      });
      portfolioBuildFlag = true;
    }
    function portfolioCookie(state) {
      if (state === "hidden") {
        document.cookie = "portfolioHide=true";
      } else {
        document.cookie = "portfolioHide=false";
      }
    }
    function portfolioToggle() {
      if(jQuery("#myPortfolio").is(":hidden") || portfolioBuildFlag === false) {
        portfolioShow();
      } else {
        portfolioHide();
      }
    }
    function portfolioShow() {
      if (portfolioBuildFlag === false) {
        portfolioBuild();
      }
      jQuery('#myPortfolio').slideDown('fast');
      jQuery('#portfolioHide').text('[ Hide ]');
      jQuery('#myPortfolio').trigger('play')
      portfolioCookie('shown');
    }
    function portfolioHide() {
      jQuery('#myPortfolio').slideUp('fast');
      jQuery('#portfolioHide').text('[ Show ]');
      jQuery('#myPortfolio').trigger('pause')
      portfolioCookie('hidden');
    }
    function portfolioInit() {
      var portfolioHide = document.cookie.replace(/(?:(?:^|.*;\s*)portfolioHide\s*\=\s*((?:[^;](?!;))*[^;]?).*)|.*/"$1");
      if (portfolioHide != "true") {
        portfolioBuild();
      } else {
        jQuery('#portfolioHide').text('[ Show ]');
      }
    }
    portfolioInit();

  }); // Load Fotorama.js script

}); // document ready

ComputersWebsite

Pro jQuery by Adam Freeman

I read this book on Safari Books Online using Firefox.

I am doing more and more with jQuery and went looking for a book that could show me the ins-and-outs of it and "Pro jQuery" is definitely that book.

I do not agree that this is a “Pro” book as it does not cover professional techniques for programming in JavaScript using the current best practices that you would find in a production environment, but this book is a great reference for jQuery and I could find none that were better.

This book has taken my jQuery skills from advanced newbie to a solid understanding of what I would use jQuery for and what I would not. I expect to use it as a reference for a long time to come.

From the publisher:

Query is one of the most popular and powerful JavaScript libraries available today. It’s widely used to create rich user experiences and to simplify website and application development. It is the tool of choice for web developers everywhere and sets the standard for simplicity, flexibility and extensibility.

In Pro jQuery, seasoned author Adam Freeman explains how to get the most from jQuery by focusing on the features you need for your project. He starts with the nuts and bolts and shows you everything through to advanced features, going in depth to give you the knowledge you need. Getting the most from jQuery is essential to truly mastering web development.

What you’ll learn

  • Understand the capabilities of jQuery and why it is special
  • Use the core of jQuery to enrich HTML, including tables, forms and data displays
  • Use jQuery UI to create rich and fluid user experiences
  • Use rich interactions such as drag and drop, sortable data and touch sensitivity
  • Use jQuery Mobile to create touch-enabled interfaces for mobile devices and tablets
  • Extend jQuery by creating custom plugins and widgets

Each topic is covered clearly and concisely, and is packed with the details you’ll need to learn to be truly effective with jQuery. The most important features are given a no-nonsense, in-depth treatment, and chapters contain examples that demonstrate both the power and the subtlety of jQuery.

I rate this book an 8 out of 10 and recommend it to anyone interested in learning more about jQuery.

BooksComputersNon-Fiction

Apple Pop-Up Museum and Vintage Computer Festival

Last weekend I attended the Vintage Computer Festival and Apple Pop-Up Museum at the empty CompUSA store off of Holcomb Bridge Road. It was nice to see someone doing something with one of these abandoned storefronts.

It was great fun seeing all of the old Apple, Commodore, Atari, and other computers and gaming consoles. It all made me very nostalgic, but not so much as I would trade in any of my current computers for any of them. It was really amazing what we were able to produce using those old machines.

And good news, the Apple Pop-Up Museum is going to be open 2 additional Saturdays, May 18 and June 8.

About the Vintage Computer Festival:

The Vintage Computer Festival is an international event that celebrates the history of computing.

The mission of the Vintage Computer Festival is to promote the preservation of "obsolete" computers by offering folks a chance to experience the technologies, people and stories that embody the remarkable tale of the computer revolution.

Through our event and the Vintage Computer Festival Archives—our publicly accessible archive of computer hardware, software, literature and ephemera—we promote interest in researching and documenting the history of the computer. Above all, we promote the fun of playing with old computers.

About the Apple Pop-Up Museum:

The exhibit displays an exclusive collection of game-changing Apple personal computers and consumer electronics products while presenting the history of the company since its founding in 1976 to the present. An Apple I, the first disk II and controller card, an original Apple II, an original Lisa and a Xerox Alto are among the rare artifacts to be displayed.

Check out more pictures from the Museum and Festival: http://photo.davenelson.com/Events/2013-Apple-Pop-Up-Museum/29080622_ZnCzzN

ComputersHappy

Portal 2 Video Game

I really enjoyed the first Portal video game, it was a much needed break from the first person shooters I had been playing that were focused on violence.

Portal did not disappoint, the levels grew progressively harder as the game went on and the payoff at the end was spectacular. The GLaDOS song at the end of the game is fantastic.

Now we have Portal 2, I played it using Steam from Valve on a MacBook Pro. There were no slowdowns, frame-drops, or stutters during the game, and the audio was great.

It took me about 50 hours to play through the game, there were only a couple of levels where I got stuck and spent more than 20 minutes trying to get past. There were also plenty of levels where I died a number of time, but death in Portal is no big deal, you start over in the same puzzle close to the place where you dies, you even get to keep a lot of your progress in many of them.

Another great feature of Portal 2 is that it is easy to create your own puzzles and share them with the world. There are tons of player created levels available to play and they are a great way to add re-playability to the game.

From the Portal 2 web site:

The sequel to 2007’s Game of the Year, Portal 2 is a hilariously mind-bending adventure that challenges you to use wits over weaponry in a funhouse of diabolical science.

Using a highly experimental portal device, you’ll once again face off against a lethally inventive, power-mad A.I. named GLaDOS. And this time you won’t be alone. Meet an expanded cast of characters as you think your way through dangerous, never-before-seen areas of Aperture Laboratories.

Break the laws of spatial physics in ways you never thought possible, with a wider variety of portal puzzles and an expansive story that spans a single player and co-operative game mode.

I rate this game a 9 out of 10 and recommend it to anyone who loves first person shooters and puzzle games.

ComputersGames

The Adobe Photoshop Lightroom 4 Book for Digital Photographers by Scott Kelby

I read this book as a PDF bought from O’Reily Media’s Safari Books Online mostly using an iPad and iBooks but also using the Preview app on a MacBook Pro.

I really dislike showing any photographs without the minimum of rotate, crop, exposure correct, color correct, and export at the needed sizes and Lightroom allows me to do that very quickly.

I have been using Lightroom since the beta of Lightroom 3 and I read Scott Kelby’s version of this book back then. I loved the book and Lightroom so much that I lent the book out until it didn’t come back, and that’s ok, I like to think that it is still floating out there somewhere being read by a photographer that has been stuck using some antiquated tools to manage and edit their photos.

This book for version 4 is a lot like the one for version 3, but it is well worth the read as many new chapters have been added and Lightroom 4 has enough new features and behaviors that the new book is a great help for getting the most from it. Scott does a great job pointing out the places that Lightroom 4 differs from previous versions but doesn’t dwell on those differences to the point that a person just starting out with version 4 would be distracted by them.

The only content in the book that I found not useful is the chapter pages, I would prefer that Scott went back to being funny or leaving the space blank.

From the publisher:

Since Lightroom first launched, Scott Kelby’s The Lightroom Book for Digital Photographers has been the world’s #1 best-selling Lightroom book. In this latest version for Lightroom 4, Scott uses his same step-by-step, plain-English style and layout to make learning Lightroom easy and fun. Scott doesn’t just show you which sliders do what, and he doesn’t just cover the newest features of Lightroom (though, of course, he does that, too, with discussions of the improved Clarity feature, White Balance adjustment brush, photo book capabilities, and much more). Instead, by using the following three simple, yet brilliant, techniques that make it just an incredible learning tool, this book shows you how to create your own photography workflow using Lightroom…

About My Workflow

I like the workflow that Scott covers in the book with the exception of using collections. I prefer to not use collections because they are only internal to the Lightroom database, I prefer to have my files organized in the computers file system so that I will be able to easily find them if I stop using Lightroom one day.

My current workflow looks like this:

  1. Get out there and take a lot of pictures
  2. Remove the memory card from the camera and use a card reader to get the images into the computer. My file structure looks like “Dave Import / 2012 / 20120725_eli-playground” which is “my import/year/yyyymmdd_name-of-event” then when I export I use the same structure but begin with “Dave Export”.
  3. Import the images into Lightroom adding my IPTC copyright information along with generic keywords from the shoot.
  4. Quickly look through all of the images and identify obvious rejects by flagging them by typing “x” which identifies them as rejects and get an overall feel for them.
  5. Now I take a break, at least 15 minutes long. This allows my thought about the images to gel and take shape.
  6. Upon coming back I will use “Flags” to identify the photos I never want to see again by typing “x” which marks them as rejected, and “p” which marks them as a pick. Photos that do not get a flag are kept, but they do not get exported. Then I delete all of the rejected photos, from the Lightroom database and also from the hard drive.
  7. Now I use “Filters” to work with just the picks and I switch to the “Develop” module.
  8. In the develop module I work my way through the images using the techniques that Scott covers in his book. Many images that were marked as picks may become not-picked or even rejected based on the results of being edited.
  9. Now that all of the picks are edited I add captions that describe each image and keywords that can be used to search for each image. This takes a long time and a lot of thought, but it is also what will make your images valuable in the future, if you cannot find a photo you cannot sell that photo.
  10. Then I export the picks as original size JPGs with an sRGB colorspace and my naming convention of “dave-nelson-20120725-112317-0001.jpg” which is “my-name-yyyymmdd-hhmmss-####.jpg”.
  11. At my SmugMug web site I create a new gallery giving it a name, caption, and pricing list then use MacDaddy to upload the exported images to that directory.
  12. Lastly I send out emails and post on various web sites that I have some new photos available for viewing and purchase.

This particular process has worked well for me but it has been tweaked many times over the years. Also keep in mind that I am a hobbiest photographer and that the money I do make from photography does not come close to paying for itself.

I rate this book a 9 out of 10 and a must read for anyone interested in using Lightroom to manage and edit photographs.

BooksComputersPhotographySoftware

Metro 2033 Video Game

I played this game on a MacBook Pro using OnLive and had no technical difficulties.

This first person shooter has a lot of problems, it starts out slow, takes a long time to get going, and then at the very end throws some odd control issues at you. It is definitely “on a rail” and appears to only offer one pretty flat story to tell.

Maybe its biggest problem is that it is trying to tell a story. It may have been a better game if there was more than one way to get to the end and something in all the dialog that let me know that the end was coming.

But for all that, it is not a half bad shooter and it is available for less than $10 when on sale.

From the publisher:

Set in the shattered subway of a post apocalyptic Moscow, Metro 2033 is a story of intensive underground survival where the fate of mankind rests in your hands. In 2013 the world was devastated by an apocalyptic event, annihilating almost all mankind and turning the earth’s surface into a poisonous wasteland. A handful of survivors took refuge in the depths of the Moscow underground, and human civilization entered a new Dark Age. The year is 2033. An entire generation has been born and raised underground, and their besieged Metro Station-Cities struggle for survival, with each other, and the mutant horrors that await outside. You are Artyom, born in the last days before the fire, but raised Underground. Having never ventured beyond your Metro Station-City limits, one fateful event sparks a desperate mission to the heart of the Metro system, to warn the remnants of mankind of a terrible impending threat. Your journey takes you from the forgotten catacombs beneath the subway to the desolate wastelands above, where your actions will determine the fate of mankind. Metro 2033 is a gripping, atmospheric first person shooter experience powered by cutting edge technology to deliver incredible visuals. Witness the everyday horrors of a broken society living in constant fear. Brave the darkness of the tunnels, where mutants hunt their prey and ghostly spirits lurk. Explore the desolate city-surface, trusting your gas mask and rifle to protect you from a poisoned world and the creatures that roam there. Steel your nerve and prepare to face the terrors that await.

I rate this game a 7 out of 10.

ComputersGames

Fallout 3: Game of the Year Edition

I bought this game on Steam and played it in Windows 7 in Bootcamp on a MacBook Pro.

There were a lot of crashing with the game initially; apparently the default install is a horrible experience full of crashes and blue screens for many, many players. It took a lot of searching and a lot of fiddling around to get the game to play for more than 10 minutes without crashing but eventually I found the right combination of settings and the game played great.

When the developers say that this is an open world game, they are not kidding. You can go almost anywhere at any time and while wondering around can be solid fun, later in the game I found it annoying. I would stumble upon things that were obviously a part of some quest but I had not found the guy that would give me the quest yet.

For example I found a violin in one of the Vaults (a place where people lived to get away from the radiation), it was definitely part of a quest as I had found nothing else like it in my travels, but I had no idea what to do with it or who could possible give me such a quest. With the help of the Fallout Wiki I found out where to get the appropriate quest and the game did a great job of giving me a good option to complete the quest easily once I found the right person.

That is one of the most impressive parts of this game, how it compensates for the user not following the main quest arc. I did all kinds of things trying to see how I could break the game and felt that I never did.

I really enjoyed this game and look forward to playing the next in the series, Fallout: New Vegas.

From the official web site:

Vault-Tec engineers have worked around the clock on an interactive reproduction of Wasteland life for you to enjoy from the comfort of your own vault. Included is an expansive world, unique combat, shockingly realistic visuals, tons of player choice, and an incredible cast of dynamic characters. Every minute is a fight for survival against the terrors of the outside world – radiation, Super Mutants, and hostile mutated creatures. From Vault-Tec, America’s First Choice in Post Nuclear Simulation.

I rate this game an 8 out of 10

ComputersGames