Monday, May 6, 2013

Initial Impressions of Light Table IDE

Light Table is a programming integrated development environment (IDE). But it's a little different compared to what is currently out there. The author, +Chris Granger, has focused on what we are creating rather than getting to the creation. If that concept doesn't quite make sense in your head, don't worry. It's visual. Think real-time flow of your program. If you want to watch how a value changes as it moves through your program you can see it in real-time. Bret Victor gave a great talk on the idea called Inventing on Principle. Light Table extends this concept and the roadmap for development has a lot of nifty fun features of programmers.

I love UX/UI. Especially when it makes stuff easier/faster/better. Light Table is basically IDE porn.

I don't think I can really describe it better than that, but I'll try to explain some things I like and where it has some room for improvement. I have been using it as a primary editor for VB.Net, Python (Django), and a little JavaScript for nearly a week. VB.Net is my day job, the others are for projects at home. For the most part I work in Sublime Text 2, which is a fantastic editor. If you haven't checked it out before the go grab it and start playing. It's extensible, built in Python, and has tons of plugins available. And yes, I write VB in it. It supports VB Script which is good enough. I switch back and forth between Visual Studio and Sublime Text 2 depending on what I'm working on.

Welcome Screen
1. Light Table Welcome Screen
So clearly minimalism is heavily at play here. I'm a fan of minimalism, so this works for me. What you see at the top are tabs. They're unobtrusive. You'll notice I'm in full screen mode here, or as I like to call it: Stop messaging me on Google Talk mode. You can hit ctrl + enter and it pops up the command prompt so you can be handsfree. Which I like. Granger is a fan of VIM so there are vim bindings that can be enabled. But I like his theory that the future of editing code can't always just be that the vim, emacs, etc style of only text visualization is the answer forever. 


Command Bar
2. Command Bar via ctrl + enter
The UI is clean and simple. After all, you don't need a ton of features to get your work done. The workspace tab allows you to bring files into the "workspace" which is kind of like open folder for Sublime Text 2. What's different is that you can add files or folders to this workspace from all over the place. Then those files all show up on the quick open stuff under navigation which we'll get to.


Light Table Workspace
3. Light Table Workspace
So any of those files on the left, or if you have multiple folders can be removed from the workspace without affecting your files on disk. Handy feature. But also, you can just add another folder or files to the workspace. And everything is available to open. Double-clicking any of the files on the left will open them for editing in the current tabset on the right. Tabsets are like groups of tabs. You can subdivide so you can have multiple tabsets each with multiple tabs.

From there we can move on to the navigate tab. It basically shows you all files in all folders. Let's look at a django project.


Light Table Navigate
4. Light Table Navigate
One of the great things about more and more programs is the support for fuzzy search. This makes using command bars and file openers incredibly easy but it also makes search in general better regarding programming languages. You may have 10 methods with Get as the beginning like GetMyFoo, GetNewBars, etc. But if you want GetMyFoo, you can just search for Foo. Fuzzy search will find it. That concept can be expanded on drastically in practice and in different concepts (command bar for instance, file names, settings, and your code itself) and you get some pretty awesome results. I've loved that in Sublime Text 2 and I'm loving using it in Light Table.

The default them is also pleasant for code. It's not terribly high contrast but I find it's easy on my eyes in a dark room. And let's be honest. We program in the dark a lot. But my other favorite monokai is on there and switching is a command and a few keystrokes away so I don't mind switching back and forth.

5. Light Table Default Theme
If you watch the videos you'll see some of the wonderful things Light Table can do, but I think the best thing going for it right now is the incredibly responsive development. I'm not sure if +Chris Granger is working solo or if he has assembled a team, but I watched the repo on GitHub for issue tracking and I'm getting a lot of mail which is Q&A and feature suggestions and bug fixes. I love that part of it. I'm actually learning more about the editor just by watching the "issues" emails come across.


I think that's all I'll go into for now. I'm using it as the IDE of choice for a Django project at the moment and it'll be interesting to see what ultimately I like and dislike at the end of that. Code Mirror's underlying editor has a few bugs with the syntax in VB, but I have a feeling some of the features the community requests will be easy to address once the plugin system is live, which is forthcoming in 0.5. I'm already wondering if I can build out some Django tools for the editor, even though I'm not sure what that would look like. It supports virtualenvs for python, although I haven't tried it. Django work means I'm not really doing eval much unless I'm just quickly testing pieces of a function.

I'll post again once I have had the opportunity to really spend a lot of hours in it. For now, I really enjoy it. I miss some of the conveniences of Sublime Text 2, but they're not anything that can't be resolved. And for an alpha...this product has definitely caught my attention. I look at it and all I can think is how amazing this is going to be.

Thursday, January 31, 2013

Windows 8: Good, Bad, and the In Between

I'm just going to admit it up front: I am a complete sucker for a good UI. UX is important as well but if you give me a really ugly UI and say "But the UX is amazing!" I'm less likely to be interested. Love it, hate it, whatever, the new Windows style of interface is attractive. Live tiles are a clever method for content consumption that is far more interesting than a straight feed reader. Even though that's basically the purpose.

Sure you can put whatever you want there, but essentially it's a feed. The ease of programming for the Windows 8 style of application is also welcome. Granted, I really don't know anything about XAML. I can mostly read what's going on but I'm currently having to read up on what it is I want to do if I'm not going to be dropping things in from the toolbox. But it's fun. And you get Visual Studio.

I like Eclipse a lot. My Java class and C class both had me using Eclipse (IDE was optional but Eclipse was a natural choice) and I found myself productive in it and all that. But when it came to playing with Android, the experience felt extremely clunky. I know there are many that will disagree, and that's fine. Preference is subjective. Visual Studio feels streamlined. When I drive a car, gadgets are fun but I really only care if they enhance my driving experience. I don't need a million buttons to do things. I don't have to have volume control on my steering wheel, but it's handy. I don't need extensive configuration. My car's purpose is a point A to point B type of thing for me and I like to feel the drive. I feel the same about the tools I use to fulfill my role of code monkey.

Visual Studio deploys easily between tests for Desktop (windows 8 store), Tablet, and Phone. The simulators are clean for tablet and phone. And you don't have to wait for what feels like an eternity for them to boot. That's my favorite part.

As for the operating system itself, I don't understand all the complaints. Granted, I'm an individual that hits the windows key and then immediately begins typing to get my desired program. I don't like having to run through context menus to find it. So for me to use Windows 8, I had almost no learning curve. Yes to get to my wireless settings I have to go through the charm bar. So what? Hide the stuff I don't need to see all the time. I'm fine with that. I spend most of my time on the desktop. I really don't see the Start menu dash unless I'm doing a search to find the program I want.

This isn't some sort of colossal failure or a war on users. Why is it we idolize the screens we see on Star Trek and such and then when we're presented with something that moves more toward that direction we reject it?

I've never been a fan of the ribbon for Office, but I actually like it for Windows Explorer. New folder? Boom. Dedicated icon for that. Search filtering. Dedicated icons. I feel like it's an improvement. It adds a little bulk to the top of the window but it isn't an unwelcome feature.

Windows 8 really shines with touch interaction though. I like the paradigm shift. The choice of blending tablet with desktop is nice because you can grab a tablet PC (that is, one running Windows 8, not WindowsRT) and have it on the couch while you're watching television, but then snap it in to whatever docking method your particular hardware supports and you're back to your usual mouse and keyboard. Love that.

Friday, November 2, 2012

New Project - Active/Responsive Ambient Lighting

So, while browsing the wonderful web one day recently a friend of mine, +Clint Shuman, sent me a link to an RGB LED grid that acted as a responsive ambient light for a TV. Awesome right? I love stuff like this. It's simple, but it really adds an interesting touch to movie night. Naturally, we immediately set out to program our own version.

The concept of active ambience is pretty interesting. The fire in that Avatar video link really enhances the feeling of having that torch flipped around. I definitely like that but there are a few limitations to this implementation of ambipi.

First, it is Windows only. Although Windows is a perfectly pervasive and acceptable OS, it is not the only one - nor is it frequently the choice of my media enthusiasts. A home theater build using Linux is often a less expensive and adaptable solution. Further, the limitation of using XBMC that is specially compiled for this feature limits the playing pool to a release cycle based on this feature. One can't simply update to the latest and greatest XBMC the whenever they please (ambipi extensions, not boblight for those thinking of it).

Which leads to the main hurdle: what about active ambience for other uses of the machine? VLC? Video conferencing? And the list continues. I want a solution that works with the display output and not only one application (although it has plenty of extensions). Adalight and others certainly have achieved this, but I would like to solve the problem in python and make it as cross platform/device as possible with additional configuration. Ultimately, how nifty would this type of thing be on displays, at trade shows, etc? Pretty eye catching.

So enter python and some good fun playing with websockets to test the results. I don't have any LEDs to plug into my Raspberry Pi, so Clint and I setup a cherrypy server with a websocket to communicate back to the server. The webpage has a configurable grid of squares. Although we started with a 3x2 grid, we have moved on to a 5x3 as we feel it'll produce a better ambience. The test with 8x8 went well but for now I just want to focus on getting a basic setup working flawlessly. Originally we made a full grid with all pieces of the screen updating (that is, all 15 boxes in a 5x3) but then decided to do a perimeter only since we won't have LEDs in the center behind the display. A perimeter of boxes on a 5x3 results in a 12-count. The grid generation algorithm was changed to simply build a full row if it was the first or last row and since the algorithm is only run once, there's no performance hit.

At first, we were at about 8 fps using screencaptures for each individual grid. This is super slow (200-300 millisecond response time based on grid size). So we changed the algorithm to capture the screen once and then resize it before sending it off to be analyzed by bounding box. This significantly improved performance and currently we're around 15-20 fps depending on how tempermental my CPU is feeling. Oddly my computer at work runs at about 45 ms pretty consistently while at home I'm more consistently in the 80-100 ms range. I still haven't figured out why that is, but I did just upgrade to Windows 8 so maybe there are some issues I haven't found yet relating to that (work is Windows XP).

Ultimately, I'd like to move to the win32api and see if I can get any improvement over the Python Imaging Library (PIL). For linux, we currently have GTK being used. It's possible we'll go to native C and use X to grab the window if needed, but we'll need to run some tests. GTK is staying pretty consistent with where PIL is (45 ms). I thought GTK would be far faster, but perhaps there's room for improvement with the algorithm.

The current plan (for me, Clint will use an Arduino) is to have my computer serving the image data over UDP to a Raspberry pi. Alternatively, could leave the Pi plugged in but that does involve the limitation of putting the computer next to the pi and therefore next to the tv. I don't currently have any spare computers lying around so a network method is preferable.