Python IDE Woes

I love  the Python programming language. I could spend hours explaining why it’s generally my go to language when coding something new but that’s not what I really want to touch on today. Today it’s about IDEs and editors.

IDE or editor selection is almost a cultish exercise. Developers break out into small societies around coding tools and banish those exhibiting wandering eyes towards  tool lust. In some cases I’ve fallen into those patterns when I find a tool that I enjoy. It can be frustrating to have to uproot your development workflow to accommodate a new tool even when it’s obvious that after the initial learning curve the tool will make life easier. With all that said I am not stuck to any IDE or editor. I’m an IDE/editor swinger.

There are plenty of choices for Python, many of which I’ve used throughout the years. My problem is that all of those I’ve tried I always end up moving away from to one of the default editors: vim or emacs (in my case vim). For the heck of it this post is to go through the main reasons for the most recent movements back to vim.

IDEs and Editors

Eclipse

I used to joke that every 6 months I’d give Eclipse a try. It’s very popular in the Java programming world and has a great Python plugin called PyDev. However, Eclipse itself always feels sluggish even when I’m writing Java. Keep in mind I’m not on some old hardware which is limiting the IDE nor am I doing some corner case kind of usage. The sluggishness is not terrible either, but it’s noticeable reminding me that I’m using a very large piece of software. One of my thoughts is that if I notice the IDE/editor for anything other than a helpful feature then there is likely a problem.

NetBeans

NetBeans is not all that different than Eclipse in my mind. It’s a Java IDE which is extendable to other languages. Last time I tried NetBeans it was less sluggish than Eclipse. My main issue with NetBeans is I can never tell what is going one with the IDE. There was a pretty big push for first class Python support in NetBeans. I played with that IDE version for a while and, overall, liked it. Now searching python on the NetBeans site returns nothing. It seems like there are random community efforts to bring Python back into NetBeans but I want something that works well right now (no offense to any of the efforts!).

PyCharm

Another similar IDE is PyCharm. I have at least one fellow Python developer which swears by PyCharm and I can see why. It doesn’t seem sluggish even though it’s pretty large. It has a good feature set. But it has confusing proprietary licensing and the IDE is specific to the language. If you need to get some Ruby coding done then it’s a different JetBrains IDE and, I assume, another purchase and license agreement. That’s a bit frustrating!

Komodo IDE

Komodo IDE was one of the earlier Python IDEs I tried.  I have to admit not trying it in a while, but last time I played with it I felt it was sluggish in a similar way to Eclipse. Like Eclipse it has a lot of plugins/add-ons available which is great but, then again, it’s proprietary and costs $382. Sort of a long term deal breaker right there.

Komodo Edit

The younger brother of Komodo IDE, Komodo Edit actually feels more useable to me. I believe it’s just the basic core of Komodo IDE, but that works in it’s favor. It seemed faster and kept out of my way. The initial start screen always feels clunky. However, the license is weird and is not listed on the FSF or OSI list. I guess it’s proprietary? Confusion is not a good thing.

Sublime Text

This one kills me. Sublime Text is a fantastic editor. I really like it! The editor is very fast and has some unique features. It’s available on all three major computer platforms (Linux, Windows and OS X). The license is proprietary but is simple, understandable. I believe this may be a first. Though the fact it’s proprietary makes it a harder editor to make my default. If Sublime Text was Free Software or Open Source it would be my programming default editor.

Scribes

This was a nice editor. I say was for Scribes because it looks like it is no longer actively developed. It’s a shame because it was a powerful and fast editor with an Open license. Even though it’s an older editor than Sublime Text I liked it for a lot of the same reasons. If this was still being worked on it would be my default programming editor.

PIDA

PIDA was my default IDE for a while. If I was using an IDE it was likely to be PIDA. It was Open, had good plugins, fast, embedded Vim as the editor, said it loved me, etc.. However, the PIDA web site has disappeared and the last stable release was about 3 years ago. It seems like a8 may be the replacement but I’ve not had time to run with it yet.

Others To Look At

As I stated before I’d like to spend some time with a8. It looks like it’s X based only (Linux, BSD, etc..) which is fine for me since most all of my dev is on Linux. I’ve also seen a lot of talk about Ninja IDE and it looks promising though I’m generally not a fan of specific language IDEs since I am not always using the same language.

What Do You Use?

Seriously. If you are doing Python development regularly what are you using and why? What features have you found to be amazing and which ones are overrated marketing dribble? Am I the only guy who continues to go back to vim in this day and age?

Why I Chose NewsBlur

Not all that long ago Google Reader closed it doors pushing millions of users off the platform. Many users were frustrated to lose their long time place to get their news not all that different from someone in yesteryear losing their favorite newspaper.  The whole thing was far from ideal but did go to teach users that you can’t expect cloud services to last forever (which is a good wake up call). But in the fall of Google Reader came many possible replacements which added their own spins on how one reads news. Feedly, The Old Reader and NetVibes were a few of the popular replacements. But I settled on NewsBlur and eventually became a paid user.

NewsBlur is mainly written by Samuel Clay (more on why I say mainly later).  He seems like a friendly, hard working fellow. He responds to bug reports and is active in his products community.  While this may seem like common sense just take a few minutes to look at random SaaS products on the Internet. You’ll find many of the developers are hidden behind customer service groups who, at worst, are outsourced and are more of a dead end than a way to get things fixed. Long story short, it seems like Samuel really cares about his product.

It is possible to have a Free account on NewsBlur. While you are limited to a specific amount of feeds many people will find the limits are higher than the feed counts they had in Google Reader. At the time of writing the limit is 64 sites.

There are some social features provided by NewsBlur yet these features are not required nor forced into general workflow. For instance, there is a concept of the BlurBlog which looks like it could be fun. But I tend to read the news and share elsewhere. If I ever decide to use the BlurBlog functionality it’s there. Otherwise I can just use NewsBlur as a fantastic reader.

NewsBlur is Open Source under the MIT license (also known as the Expat License). This gives me peace of mind knowing if Samuel ever decided that he was done with NewsBlur I could export my feeds, setup my own instance, and continue using the product on my own infrastructure. Yeah, it’s not trivial but it’s possible which is a huge advantage given the last reader I used shut down.

No software is without it’s bugs but Samuel does a good job bug squashing. And if you are developer who wants to give a hand you can patch the issue yourself and submit the fix (another win for Open Source). At the time of writing there are 43 development contributors to NewsBlur. This is a much better solution than waiting for a customer service representative to reinterpret your bug submission to a developer so that the fix may be done someday in the future.

If you are still looking for a replacement for Google Reader give NewsBlur a chance even if it’s a second chance as the application seems to be enhanced weekly. If you like it, consider becoming a paid user. Can you can’t say no to Shiloh:

Introducing Flask-Track-Usage

A little while ago one of the guys on a project I work one was asking about how many people were using the projects public web service. My first thought was to go grepping through logs. After all, the requests are right there and pretty consumable with a bit of Unix command line magic. But after a little discussion it became clear that would get old after a while. What about a week from now? How about a month or year? Few people want to go run commands and then manually correlate them. This lead to us looking around for some common solutions. The most obvious one was Google Analytics. To be honest I don’t much care about those systems. While that one may not (or may be) intrusive on users I just don’t feel all that comfortable forcing people to be subjected to a third party of a third party unless there is no other good choice. Luckily, being that the metrics are service related, the javascript/cookie/pixel based transaction wouldn’t have worked very well anyway.

So it was off to look at what others have made with a heavy eye towards Flask based solutions so it matched the same framework we were already using. Flask-Analytics came up in a search. The simple design was something I liked but the extension was more so aimed at using cookies to track users through an application while we want to track overall usage. I figured it was time to roll something ourselves and provide it back out to the community if they could use it as well.

Here it is in all it’s simplistic glory: Flask-Track-Usage. It doesn’t use cookies nor javascript and can store the results into any system which you provide a callable or Storage object. There is also FreeGeoIP integration for those what want to track where users are coming from. The code comes with a MongoDB Storage object for those who want to store the content back into their MongoDB. Want to know a bit more of the technical details? Check out the README or the project page. Patches welcome!

That Darn First Homebrew

While some people remember their first homebrew as something that brought great fun and great taste it’s not my story. My story is one that is far greater than the simple beer that started it all for a hobbyist. See, it was a comedy of errors that taught me much more than a simple yet tasty first batch could have.

My very first attempt at homebrewing was a hefeweizen. I chose a hefeweizen for a few reasons. First it’s one of my favorite styles of beer. There is something about the esters and light ody that draws me in. Then there was the temperature control factor. I believed, correctly I might add, it to be easier to keep my place warm than keep it cool even in winter. Since esters are wanted in the hefeweizen style and esters are more common in higher brewing tempature it seemed like the perfect fit.

What I didn’t think about was that my first try was going to be with such a delicate style. In fact Big Beard Brewconsin even noted this after I wrote my first Homebrew post. It’s not like attempting a hop bombed IPA or a malty stout where mistakes can be overpowered by the primary flavors. With a lighter beer hiding defects isn’t so easy and my beer was full of mistakes.

The first big mistake was in my boil. As I noted previously I let it boil over. Luckily it was only for a second and I was able to recover before losing too much. This was probably the most minor of all your mistakes.

Up next was a common rookie mistake. I didn’t know that the tempature in the primary could be 5 or more degrees warmer than the outside. I had my ambient temperature at 72F thinking that I was keeping the fermentation somewhere around there. In reality in was keeping things somewhere in the upper 70s! I’m sure this caused the yeast to be stressed and put out byproducts.

But the mistakes kept rolling and I let the beer stay in primary too long. The beer really was done after a week and half, maybe two but I kept it in primary for almost three weeks. Why? Because it seemed like that’s what many homebrewers were recommending on forums, blogs, etc.. Keeping that beer for a week and a half after fermentation was done is one of the causes for an infusion of extreme bitterness to not the back end. When it was time to dispose of the trub it had a very distinct smell which was present in the bitter aftertaste of the beer.

When it came time to bottle I misused the autosiphon. I should have had the primary higher and the bottle bucket lower but I put them on the same level. This caused me to more or less pump the beer from bucket to bucket causing a lot of aeration. The taste of cardboard that seeped in is likely from this error.

I believe the first process showed me what can happen when specific things go wrong. So far I’ve avoided all of the mistakes I made with my first try with my second homebrew: A partial grain American IPA. It’s currently in primary and resting inside a slightly larger water container (to help keep temperature). More to come soon, I’m sure!

Sim City 5

Sim City was one of the first PC games I played when I was young. I remember enjoying the sequels I was able to get my hands on. EA recently released Sim City 5 to a largely upset audience of gamers who have turned very vocal in the last few weeks. For one, digital rights management (DRM) required single player games to still be online (or maybe it was a bad creative decision). Servers were overloaded on launch. AI pathing was more or less broken causing traffic pile ups. RCI didn’t seem to always work as expected. Zoning sizes are not as obvious as they should be. I could go on and on…

So, when a friend asked if I wanted to join and play I was understandably reluctant. Why spend money on something people seem to dislike so much? Reading reddit made the game sound worse than Duke Nukem Forever. For instance one person says the game is broken to the core. Another person noted that their legitimate copy was disabled. Even mainstream media was writing up negative articles. None of these things inspire confidence in a game which usually inspires positively rabid fans.

It took a little convincing but I eventually decided to give it a shot based on how much fun my friend was having playing the game. I figured I’d get a game session or two out of it before getting bored or frustrated from bugs. I was wrong. While I noticed some bugs (most of which were minor UI glitches) overall the game was fun and playable. In fact I spent five hours one night experimenting with industry. It’s fun! So why are so many people unhappy? There are a few reasons…

There is a simple theory that may explain why some people still rage about the game. Sim City 4 had a large modding community which expanded the game greatly. I’ve even heard some of the mods were done/inspired by people who deal in civic work making the sim even more realistic (I can not confirm this — I did not play Sim City 4 or any of it’s mods). If you try to take the young Sim City 5 and place it up against the older and more  worldly Sim City 4 then 5 won’t be much of a match.

As many people noted the game is far from perfect. While I initially noticed the minor UI bugs I later started to notice more and more wrong with the game. For instance the numbers didn’t always seem to add up which is a problem for a simulation game. Another problem was with destroying service vehicles accidentally. Or  setting up a bus station in a specific way that makes them disappear. The end result is useless mods to service buildings.

But even with these issues I still have had fun. Why? Because I believe the developers will fix the issues — at least most of them. No game is perfect. The more complex a game is the more likely there will be bugs at launch. Some of the bugs can even be fun or funny. However, if most of these bugs still exist in roughly a month I will be pretty upset. If by the end of April the game is not making big leaps forward in polish I’ll probably join in the frustration. If the game does make big movement forward then I’ll be continue to be a happy camper.

If you are thinking about buying the game I recommend waiting till at least the next patch is released. EA has offered a free game to people who bought Sim City 5 but this will be going away after today. While Amazon is selling the game far cheaper than EA I believe most players will want to wait for a more polished product even at that cheaper price point. If you already purchased this game don’t forget today is the last day you can redeem your free game as a Sim City 5 owner. If you have not done it yet, choose and download!

RSS Isn’t Dead

Google announced that they are discontinuing their popular Google Reader service. For those unaware Google Reader is a convenient way to read RSS feeds. For anyone who doesn’t know what RSS is it stands for Really Simple Syndication: a convenient way to bring customized web content to you all in one place. Google Reader was a very popular way to read RSS feeds which, upon it’s notification of closing, had large amounts of users searching the Internet for a replacement.

Apparently RSS is dead. Well, if you listen to some writers. Their thought is that “everyone” uses Twitter, G+ or Facebook to read or be notified of new content. This probably comes as a big shock to the large amount of people who use RSS readers and services everyday. The truth is that not everyone uses social media as a way to keep tabs on news and information outside of their own social life. I’d hazard to say most people use social media for social purposes with an added small amount of news/information usage. For instance, if someone is really in to Lenovo products they will probably follow or friend Lenovo to get updates from them. But following posts directly from a company or organization is not the same thing as reading feed from multiple sources. Even those social platforms that do offer the ability to mix general life with corporate/news generally lack the ability to separate the two well. Maybe I’m odd but I don’t like seeing pictures of everyone’s kids and family updates mixed with not-so-happy hard news.

Saying RSS is dead reminds me of how email is dead. It isn’t at all but people do like to state it. Maybe people should also say going to CNN.com to read CNN news is dead? News organizations have social media presence and if social media is where everyone reads content then shouldn’t these organizations post directly to the social applications and skip the overhead of running their own systems? Using social media as the location for news sounds like trading custom news and data for digital water cooler conversations with company PR women.

RSS is not dead. RSS services are evolving into different platforms where focused data is king. At least the smart ones are. As a prime example look at Newsblur. It’s a web based RSS reader with options to train the system on the kind of news you like from your subscriptions. Granted, it does add some social functions for those who want that but the reader alone is what makes the service great. When it comes to hanging out and sharing random bits of life the social media outlets are still, and will likely always be, the most attractive players.

In the end social media and RSS are not the same thing. Yes, there can be crossover but that does not mean RSS is dead or that social applications and RSS are truly competing  RSS services are just evolving.

Adding SSL to MyFitnessPal with HTTPS Everywhere

MyFitnessPal is a simple, social site which helps track food, water and exercise. The web applications touts over 1 million foods and, if what you are eating is not listed, you can enter your own nutritional facts. Like many popular social applications MyFitnessPal uses SSL and, like many popular apps it moves the user AWAY from SSL after logging in. This means everything after login is being sent over the Internet in the clear.

Why?

There are a few reasons this is the case. The simplest answer is that they don’t realize that sending information of the Internet without any encryption is a problem. After all, it’s just food data right? But it’s not. It’s also the authentication token (in this case a cookie) which goes over the wire unencrypted.

They may turn it off to decrease load. I’ve heard this argument used before by people. It is true that SSL is ‘more expensive’ on the servers than plain HTTP but in the age of cloud computing, agile development and devops SSL should be an easy default.

No matter what the actual reason is please don’t take this as a slight to MyFitnessPal. Many sites have this issue. If they didn’t tools like HTTPS Everywhere wouldn’t exist to try and protect user data in transit.

Fix

OWASP explains what can happen as well as how to verify your safety. As far as I know the best fix is to install a rule in HTTP Everywhere to handle this site. Unfortunately most non-technical people may not be able to easily import the following but this is the rule that I came up with after noticing the lack of SSL post login:

<ruleset name="MyFitnessPal">
<target host="myfitnesspal.com"/>
<target host="www.myfitnesspal.com"/>
<target host="api.myfitnesspal.com"/>
<securecookie host="^www\.myfitnesspal\.com$" name=".*"/>
<rule from="^http://myfitnesspal\.com/" to="https://myfitnesspal.com/"/>
<rule from="^http://(www|api)\.myfitnesspal\.com/" to="https://$1.myfitnesspal.com/"/>
</ruleset>

Be aware though that this will NOT protect any data being transfered by the mobile applications. The real fix has to come from MyFitnessPal themselves. It looks like at least a few users have asked for the enhancement.

But Remember

Many sites have this issue. This issue should not stop you from using an application but do make an informed decision as to what data to pass along and what applications to link with. When possible use things such as HTTPS Everywhere. At the very least pay attention to your browser’s URL bar and know when your data is being sent in the clear.

Nexus 4 Mini Review

This Nexus 4 has only been with me a short time but I can already see why the guys and gals who got their hands on the original batch of devices have raved so highly about them. Here’s a short run down of my thoughts so far…

The Look

Nexus 4
Nexus 4 (Photo credit: abuakel)

The device is understated for what one expects from flagship devices. By that I mean the Nexus 4 is not meant to draw eyes to it or make you the talk of the cool guy crowd. It’s meant to look like a lot like every other Android device out there. Not exactly like others but close enough that by glancing it wouldn’t stand out. The main thing that does stand out when focusing on the device is the back due to it’s sparkle/glass look. It actually does make the device look special without forcing it’s ‘coolness factor’.

As a side note it’s nice to have fewer brand names thrown all over the back. I’ve had phones which had multiple brands plastered on it followed by reminding me (and everyone around me) the brands ‘involved’ in the device. The Nexus 4 says Nexus and has a smaller LG logo near the bottom. The front is refreshingly brandless. Bootup also avoids yelling about it’s Google and LG makers. I love it!

The Form

Like the look the form isn’t much different than many other current generation Android devices but does have a slightly larger screen than my previous SGS II. To be honest I really like that as I’ve grown accustomed to the general Android device slate. Where it does part ways with most of it’s siblings is in how well the build feels. It’s light without feeling cheap. It’s thin without feeling frail. I’m not totally sure why the back is glass (other than giving it a slightly different look on focused look) but I have to assume that ends up adding to the positive build feel.

General Usage

Blockbuster
Better than the app. (Photo credit: ario_)

Hopefully every Android device manufacturer is taking notice of this device because this thing is exactly how I want to use a phone. First off I didn’t have to spend time hiding a bunch of ‘value added’ applications that I’ll never use. The amount of telco bought devies I’ve had which forced me to keep NASCAR or Blockbuster installed even though I never used either is a sad number.

Next, the device is fast. Really fast. I’ve been on the Tegra everywhere bandwagon and now I’m thinking Snapdragon really may be where it’s at for phone size devices. Then there’s the fact the device is running stock Jelly Bean. This means no Sense, TouchWiz, etc… Just Android the way it was meant to be. No extra value is added which makes it much more valuable.

Most of the applications the one expects are there so I won’t jump into them but Google Now is something I can see using pretty often. Don’t get me wrong, this is not my first Jelly Bean device. I have a Nexus 7 which I’ve been very happy with, but the Google Now software on a device that only has wifi access does not do Google Now justice.

The camera seems quite good so far. To be fair I have not used it much yet but here is a test photo I took in moderate to low light in a coffee shop. For a more in-depth look at the camera look at TechRadar’s review.

Medium/Lower to low light indoor photo. No flash.

Some Downsides

Nothing is perfect but wow does the Nexus 4 come close! Two of the three downsides are minor and only are noticeable one time only.

SIM Size

The first thing I did after charging the new device was to pull the SIM card from my old device for use in my new one. I should have noticed when reading about the Nexus 4 that it uses a Micro-SIM. Not a big deal but it did require a run to the closest telco store to get one.

English: GSM Micro SIM card vs. GSM Mini SIM card
(Photo credit: Wikipedia)

Initial Usage

There was a decent amount of updates ready to be installed upon first usage. An OS update along with many application updates. It would be nice if Google could use the latest ROM when shipping new batches. Again, not a big deal at all but still would be nice.

Storage

This is what kept me from buying it originally. The storage is capped at 8 or 16g which doesn’t sound like a good deal for those of us who keep our music library with us at all times. There are options that limit this as an issue. Using Google Music, Amazon Cloud Player, Subsonic, Pogoplug, etc.. can keep your music collection within reach as long as you have a data connection but each has it’s own downsides as well. My annoyance is generally with the quality of the music player for the services. It’s not that they are bad players but they are feature poor compared to many of the locally players.

tl;dr

Reign Of The Android
(Photo credit: JD Hancock)

If you are in the market for a new Android phone right now then there is no better option than the Nexus 4. While not perfect it’s downsides are few and are heavily overshadowed by how well the device works both in terms of physical feel and software. A real Jelly Bean experience, great build quality, no telco lock in and really fast. Did I mention you don’t have to put up with apps forced on you by telcos? Assuming that the device is currently available in your region there is not a reason to avoid it. Go get it!

Raspberry Pi and Arduino: Good Friends

I have a Raspberry Pi and it’s pretty great. I have an Arduino Esplora and an Arduino Micro and they are fun. Though, as I’ve played more with the Arduino I’ve found one totally understandable drawback: it’s more or less local only. I mean that the data that comes back through sensors or the items being controlled only send response back over serial or USB/serial. It makes sense but it also limits what can be done with it when used all by itself. One of my early ideas for a project was to use a light and a temperature sensor to keep an eye on aging homebrew beer. Nothing super fancy, just records the information for viewing and alerting when the sensors see data outside of the accepted norms. I could do this with some LED’s, buzzer or a display that would notify me when things were off but that isn’t really the type of alerting I’d like to see. That type of alerting would require me to go look at the box for information. I might as well do the sensor gathering manually with my eyes and feeling inside the box. It also means the data would be lost on every iteration. Data from 10 minutes ago could only be gathered if I was present 10 minutes back. Enter Raspberry Pi.

The Raspberry Pi is able to power the Arduino Esplora and, likely, the Arduino Micro. Since communication is over USB/serial the Raspberry Pi can collect the data from the sensors and provide a networked view into the data. For instance, a web interface showing temperature and light graphs. And, best yet, it’s simple to add a USB wireless adapter to the Pi to avoid running an ethernet cable back to the network.

Now, from what I read, it’s possible to use Raspberry Pi itself without an Arduino to collect data and control devices but it requires an ADC for analog input/output. But there is something that seems more proper about separating the physical logic (using C in Arduino) from the notification and reporting logic (using Python on a Raspberry Pi). It feels almost MVC like.

In any case, if you are looking at doing some analog and digital stuff with a Raspberry Pi do know that adding a small Arduino makes life easy and, if you decide to change to another device for providing network views it should be a simple switch over.

Hi Arduino Esplora

Last night I ordered some sensors for use with my new Raspberry Pi but I just could not wait to play with sensors. I ran up to the closest electronics store at 10am to buy the last Arduino Esplora in stock.

This is a pretty new addition to the  Arduino line up. It comes with multiple sensors pre installed on the board as well as a library to make programming with the sensors a little too easy. It’s a bit pricier than the other boards but for something to learn on and do some random project prototyping it seems ideal.

After about 15 minutes I was already reading data off the sensors and reading it back from the serial console. But since I want to learn more about using the sensors I’ll be porting the project to the lower level API once I’ve finished prototyping on the Esplora library. The Esplora library makes it really easy but I feel like it’s hiding a lot of I want to learn. At this point I have a periodic temperature check which is holding current temperature, all time and relative averages and printing it back over serial in JSON. Now I just need to figure out how to both power the board and get its data over to either a Raspberry Pi or machine somewhere so I can trend and alert. I’m worried about the differences in volts between the two but I’m sure there is a safe way to interface and power. My first project is to keep an eye on the temperature and light levels of my homebrew to ensure proper aging!