Category Archives: Thoughts on Technology

Thoughts on Technology

PyPair: A Python Library for Pairing Swiss Tournaments

Something I’ve spent a few hours on in the last month is a small python library, that I am calling PyPair, that allows you to easily manage a Swiss-System Tournament. For those unfamiliar with this concept:

“A Swiss-system tournament is a non-elimination tournament format. There are several rounds of competition, but considerably fewer rounds than in a round-robin tournament, so each competitor (team or individual) does not play every other competitor. Competitors meet one-to-one in each round and are paired using a predetermined set of rules designed to ensure that as far as possible a competitor plays competitors with the same current score, subject to not playing the same opponent more than once. The winner is the competitor with the highest aggregate points earned in all rounds.”


A short example of using PyPair:

from pypair import Tournament

Players = { 1:"Tim",
2:"Jeff",
3:"Kristi",
4:"Jacob",
5:"Doug",
6:"Karen",
7:"David"}

to = Tournament()

for player in Players:
to.addPlayer( player, Players[player] )

pairings1 = to.pairRound()

print pairings1

Yields the output:

{1: [1, 7], 2: [2, 6], 3: [3, 5]}

Which is a simple python dictionary where each key is a table number that corresponds to a list of the players playing at that table.

If you would like to see a more complex example see here.

If you are interested in the math behind the pairings, PyPair essentially does the following when you call the pairRound() function:

Group players by point totals
Starting with the group who has the most points:

  • Create a graph with all players in current point total
  • Connect players in the graph that have not played yet
  • Use a Blossom based algorithm to compute a maximal matching of the graph
  • Take any unpaired players and add them to the group with the next highest point total
Repeat until there are one/none unpaired players
If there is one unpaired player, assign a bye
Return a python dictionary of the pairings

The networks created by PyPair are implemented using the NetworkX library.

If you have any suggestions for improvement or find an issue feel free to open a ticket on GitHub or leave a comment below.

Cheers,
~Jeff Hoogland

Read More

Sager NP2740 Review – A Linux Powerhouse

When I buy a piece of hardware I generally use it until it becomes completely non-functional. Because of this, my old Sager laptop I bought five years ago was finally needing an upgrade so I set about doing research trying to find a replacement.

I was looking for something powerful to stream some games on, but also light enough that it was not going to feel like a brick next to my Chromebook. Since Linux is my OS of choice, having reasonable Linux support is also on my list of desires. Because of this I wanted to stay away from ATI graphics cards and nVidia cards with optimus.

The winner you ask? After a good deal of research it ended up being the Sager NP2740:

The Hardware

The NP2740 ended up being one of the few pieces of hardware out there that met all my specifications. At 4.2 pounds the NP2740 is just a small bit heavier than my HP14 Chromebook. When ordering from PowerNotebooks.com the hardware also came with a no-OS option.

One of the things that draws me to Sager laptops is how customizable they tend to be compared to other laptops. The few pieces of hardware on the NP2740 that have to stay as is are:

That leaves us the memory and storage space to customize. The memory comes stock at 8gigs, but for my system I opt’d to push the memory to the maximum 16gigs as I knew I would be running virtual machines on my system.

Storage space is the one place where the NP2740 really comes out ahead of other laptops in this form factor. In addition to have a standard 2.5″ mobile drive, the NP2740 also has an mSATA slot that you can add an SSD to. Personally I have a 240gig, Intel 530 SSD in my unit.

The Performance

On a system this powerful I never expect a reasonable battery life, so I was fairly surprised with the NP2740. When under a constant heavy load (virtual machines running, code compiling, audio going) the battery in the NP2740 lasts for just under three hours. While doing light office work that life extends to around five hours.

In terms graphics performance I must say I have been thoroughly impressed with the Intel Iris 5200. For specifics on performance you should see the benchmarks here, but I will say this little card has handled everything I have thrown at it – including streaming some of those games using OBS.

Most importantly – the cooling on the laptop is excellent. I can use the device on my lap for hours without any discomfort from heat discharge.

The Linux Support

Starting with Ubuntu 14.04.1, all of the hardware on the Sager NP2740 is functional by default. If you are using an older Linux distro the RTL8723BE wireless chipset might give you some trouble, but there are workarounds. Because the graphics chip is Intel based you should have full 3D support with the open source drivers present on most Linux distros.

Best of all is that I was able to get the hardware with no OS pre-loaded, so I did not have to pay a premium to get a copy of Windows with my new laptop.

The Wrap Up and Price Point

I always do a lot of research before making a large purchase and I must say that even after days of research the NP2740 blows all the other competition away. Even with my wife’s company discounts, other brands such as Dell, Toshiba, and Lenovo could not come close to the $1,300 I ended up paying for the NP2740. You can configure your own starting just under $1,000.

All in all I have been very happy with my Sager NP2740. If you are in the market for a Linux PC that is portable, but does not sacrifice performance – this might just be the laptop for you.

Cheers,
~Jeff Hoogland

Read More

Why Netflix support is a Win for Desktop Linux

I am what you could call a practical free software advocate. This means that while I love open source software and everything it stands for, at the end of the day I really just need a computer that works for the tasks I need accomplish. Most people in the world are exactly like me, except they don’t care in the slightest about free software. They just want a computer that works.

That is why things like Netflix and Steam officially supporting Linux as a desktop operating system is so important. You will get a lot more users who are willing to try an alternative OS when it does not require them to give up using the services they love to do so.

So do me a favor – stop complaining. Every time I see one of these large services start supporting desktop Linux, the complainers come out of the wood work with something else to whine about. With Steam it was DRM in the games that now ran natively. With Netflix folks are complaining about it requiring the use of Google’s branded Chrome browser.

The truth is, change is gradual, but it is coming. So the next time a major content creator/provider opts to add support for our operating system of choice – lets just say thank you instead of complaining about the way in which they are adding that support.

The “year of the Linux desktop” is not something that is just going to magically happen when the clock strikes twelve at midnight on January first. It is something that is going to happen slowly over years worth of time. The addition of services like Netflix and Steam are fantastic wins in this slow change.

Read More

pyHook for Linux with pyxHook

Today I would like to share a simple solution to a problem I have wasted several hours on in the last week: Listening for key presses on Linux using Python. You see, on Windows you can simply use the pyHook library that has existed for years. On Linux no such library is as well documented.

After posting my question in several forums I finally was able to track down a reasonable, fairly simple solution. Contained in the Simple Python Keylogger is a pyxhook.py library that is desktop independent and GUI toolkit neutral.
To hopefully save future python developers some time in the future I’ve created a GitHub repository for just pyxhook and a simple example of how to utilize it:

#Libraries we need
import pyxhook
import time

#This function is called every time a key is presssed
def kbevent( event ):
#print key info
print event

#If the ascii value matches spacebar, terminate the while loop
if event.Ascii == 32:
global running
running = False

#Create hookmanager
hookman = pyxhook.HookManager()
#Define our callback to fire when a key is pressed down
hookman.KeyDown = kbevent
#Hook the keyboard
hookman.HookKeyboard()
#Start our listener
hookman.start()

#Create a loop to keep the application running
running = True
while running:
time.sleep(0.1)

#Close the listener when we are done
hookman.cancel()

Read More

qAndora – A Cross Platform, FOSS, Pandora Radio Player

One of my goals for this year is to become proficient in a cross platform GUI tool kit. The toolkit I’ve chosen to get my hands dirty with is Qt because in addition to being cross platform it also has a fantastic amount of documentation.

I always find I learn programming easier when I am building some practical instead of going through various tutorials that you just throw away when you are done. So with that, my “learn Qt” project is something I’m calling qAndora:

qAndora is a cross platform, open source, Pandora Internet Radio client written in Python using Qt and VLC. If you would like to jump right to giving this little application a try you can find install instructions here. I have tested the player successfully on Ubuntu 14.04 and Windows 7, but it should work anywhere you can install VLC and run Python.

A few other random screenshots of the tool:

If you have any suggestions or feature requests please feel free to leave them in a comment below.

Cheers,
~Jeff Hoogland

Read More

Bodhi Linux is NOT Dead – It is just Changing Hands

A week ago I posted that I was stepping down from my position as doing the primary development work for the Bodhi Linux project. I just wanted to clear the air that this change does not mean that the project is shutting down. In the previous post I ask for folks looking to help and since then I have talked to a number of different people and currently have a few different people working to take over my previous duties.

So let me make one thing clear for worried folks:

Bodhi is not dead and a 3.0 release will be happening still.

New timelines are still being figured out and when the new folks working on development have their footing fully underneath them they will be sharing more information I am sure. As for myself, I will still be sparing enough time to the project to field questions the new folks might have and provide insights wherever needed – I just won’t directly be doing the heavy lifting any longer.
~Jeff Hoogland

Read More

Stepping Down from Bodhi Linux Lead

I am sure anyone who has been following the Bodhi project has taken note that the 3.0.0 release timeline has not happened as expected. Due to a variety of reasons I would like to announce today that I will no longer be actively developing Bodhi Linux.

Bodhi has been a labor of love for me that was started nearly four years ago. In that time all of the other original team members fell away. In fact I have worked with dozens of different people over the course of the last few years. I have made friends and learned more than I could have ever imagined.

With that being said, even though I no longer have the bandwidth to actively develop Bodhi, I know many enjoy using the project. So if you are reading this and have an interest in picking up where I am leaving off, please contact me. All Bodhi related code can be found on my GitHub page and I am more than happy to help guide you in the right direction with how things work as you are getting started.

To our users out there, thanks to your amazing support earlier this year our existing servers are paid for through the end of April 2015. So even if no one chooses to pick up where I have left off, your existing systems will continue having repository access until this time.

All in all, it has been fun. I started Bodhi during my senior year of undergrad and have continued to guide it through moving three times, graduate school, getting married, several different jobs, and even my first wonderful kid:

I’d like to close with saying thanks to the Bodhi and open source community as a whole. In general you have been very supportive of the small project I started to Enlighten the world.

~Jeff Hoogland

Read More

Bodhi Linux 3.0.0 Release Candidate 1

At Bodhi we work firmly on a “its ready when its ready schedule” as opposed to sticking to our set release goals and churning out something we are not happy with. Better late than never as the saying goes! Just ten days after the targeted release date I am happy to share our first Release Candidate for Bodhi Linux’s third major release:

As you can see from the image our default theme has matured some (it is nearly complete in fact). For a full change log you can see my running TODO list as we work towards our 3.0.0 stable release here.
Download Links
Legacy Hardware Support

The most important new thing in this release is the addition of an ISO image that supports legacy hardware. The legacy ISO image features a 3.2 kernel that will work on 486 machines (or newer), including non-PAE hardware. This ISO image currently features the same E19 desktop that the other three discs have, but if all goes as planned the legacy disc will feature the E17 desktop by default starting with our second release candidate.
Existing 3.0.0 Users Can Upgrade

As always existing 3.0.0 users can simply use eepDater to get the latest and greatest system from their current install. 64bit users will need to implement this workaround though for a troublesome package that found its way into the beta.
Known Issues

There are a couple of small issues we are aware of and working to remedy for our RC2 release later this month. They are:
  • The quick start guide opens twice on the live CD/the first time you boot Bodhi
  • There is an Enlightenment segfault the first time you access the menu on the live cd/on a new install (just press f1 and everything is fine)
  • App Center does not work (we are still working on implementing a new installer tool for this)
Bug Reporting/Issues

As always please, please, please do not post issues in a comment on this post. Instead open a thread in the 3.0.0 testing section of our user forums. Also keep in mind this is a testing release not intended for production machines.
~Jeff Hoogland

Read More

Bodhi Linux 3.0.0 Beta Release

Its been two months since we had our alpha release and since then Ubuntu 14.04 has released as “stable”. That means the core for our upcoming Bodhi 3.0.0 release is finally stable enough for me to stamp a “beta” label onto it. For those that do not really care what I have to say and just want a download link, this beta release comes in the following three flavors:

Those looking for a change log / my TODO list for 3.0.0 please see here. All of these images are built directly on top of the latest Ubuntu 14.04 packages. The 32bit and 64bit images utilize the 3.13 Linux kernel, while the Chromebook image utilizes a 3.11 kernel due to hardware compatibility issues.

The Chromebook image is tested/designed to work with the Acer C720 and HP 14″ Chromebooks. It could very well work with other Chromebooks, but they have not been tested. For more information on installing Bodhi on your Chromebook follow the directions here.

Updated Release Schedule

Some folks made note that when I first posted the Bodhi 3.0.0 release schedule we were set for a stable release at the end of June. After some discussion on our user forums it was decided that we would all be more comfortable with waiting till after Ubuntu releases their first major update to 14.04 before we called 3.0.0 our “stable” Bodhi release. With this in mind the Bodhi 3.0.0 stable release has been moved from a June 27th target date to a August 2nd target date. This makes our release cycle heading towards 3.0.0 stable look like:

  • May 30th – Release Candidate
  • June 27th – Release Candidate 2
  • August 2nd – Stable Release

New Look and Applications

While I a linked a change log above, a picture is worth a thousand words as they say! Below is pictured the new Radiance Enlightenment theme that is nearing completion (Thanks Duma!) which is now the default look for Bodhi 3.0.0. Also shown in the screenshot is ePad text editor (replaces Leafpad) and eepDater system updater.

Bug Reporting/Issues

As always please, please, please do not post issues in a comment on this post. Instead open a thread in the 3.0.0 testing section of our user forums. Also keep in mind this is a testing release not intended for production machines.

Happy Testing,
~Jeff Hoogland

Read More

HOWTO: Stream Twitch.tv to Chromecast

I recently picked up a Chromecast and one of the things I was looking for was to stream Twitch.tv from my laptop to my TV using the device. Thankfully setting this setup is fairly simple thanks to the aide of the TCast Chrome plugin.

Step 0 – Install Chrome/Chromium

Streaming to the Chromecast from your PC currently requires a Chrome based browser. Install either Google Chrome or Chromium.

Step 1 – Install Google Cast and TCast Extensions

Select each of the addon links below and add them to your browser:

Step 2 – Enable Streaming from your Channel of Choice
Open the twitch.tv stream URL you want to cast to your Chromecast. Play your stream and then click the Chromecast button underneath the video player. You will then see the following appear over your stream:
Next, click the Chromecast icon in the upper right hand corner of your browser and select the Chromecast device you want to stream to:
Your Chromecast should then take a minute to load up the stream and then it should soon be playing! In your browser page you will then see the following screen from which you can adjust the stream quality and play/pause the stream:
And you are all set – enjoy streaming twitch on your Chromecast device! Have any questions or issues please feel free to leave a comment below and I’ll do my best to help.
I’ve only tested the above instructions on my Linux based PC, but these extensions should work on any platform that supports Chrome/Chromium.
Cheers,
~Jeff Hoogland

Read More