You know you’re a geek when…

Earlier today I was trying to count the number of ‘friends’ I had on a message board I frequent.  Friends are people who can see private posts and whose posts come up in a special color.  I went to the part of the site that listed all the users on my friends list, and saw what looked to be a medium sized list that I had no intention of counting.  Instead, I copied the list switched over to my open terminal, and typed :

wc -l

Then I pasted the contents of the list, and hit Ctrl-D to signify the end of input. It correctly counted that I had 18 friends on the site. Also, it’s because of instincts like this that I probably have fewer than that many in real life…

Posted in Uncategorized | Leave a comment

Tools for the Discerning Programmer

Last week, I read on Slashdot that is was “System Administrator Day” (apparently the last Friday in July for those who are interested.)  I decided to walk over to the IT department and wish them a happy sysadmin day.  The short trip turned out to be well worth my while, as I found out that I was getting a new desktop to do my programming work on.

5.1 Windows Experience... pshaw

Not too shabby for a work computer

The new PC has respectable specs (nothing close to my awesome home computer, of course) but it was a good upgrade, so I was happy.  The only downside to getting a new PC is having to set it all up to my liking again.  IT did a great job of putting all the basics (Windows, Visual Studio, etc…) on there, but I still need to tweak it to get the exact set of tools and utilities I like.

There are countless little tools and programs that I use in my job maybe a couple times a week, but there are some that I use many times a day.  Without these wonderful programs, my work would be much more labor-intensive, tedious, and boring.  I figure others out there might benefit from these programs as well, so now I present to you my list of “Tools for the Discerning Programmer.”  These are the programs that I have found that I just couldn’t live without.

  1. Google Chrome -
    I absolutely could not live without Google Chrome!  I used to be an avid Firefox user, but a couple years ago, I switched and never looked back.  This beast of a browser is a serious internet workhorse.  The extension library is rapidly growing and Chrome helps me stay organized, and get the job done.For power users, I must recommend a couple of great extensions that I use:  Vimium, Lite Weather, and of course AdBlock Plus 
  2.  Notepad++
    Notepad++ is probably the greatest open source utility for Windows that I have seen.  It is SO handy in SO many situations.  It is basically the Swiss-army knife of Windows apps.  It is a super-handy text editor, IDE, source code highlighter, and just about whatever else you need it to be.  In terms of text editors with GUIs, this one is my favorite.
  3. Cygwin
    This dandy little tool is a must for anyone who wants Unix-like tools (like grep, make, gcc, etc…) for use in Windows.  Essentially, Cygwin just makes binaries of all these programs (or whichever ones you want) available on your Windows path so you can use them in your CMD shell (or PowerShell or whatever.)   Cygwin really shines, however, when you use it with a nice terminal Emulator.  I used to use PuTTY (a great program) and Console2 (also a great program.) But this time I’ve decided to go with mintty.  It is a really neat, clean terminal, and suits my needs quite well.  Though any of the above work quite nicely.Mintty Terminal Running Bash and Cygwin
    Pictured above is my terminal running another nice little utility: ack.  As ack’s confidently named website (betterthangrep.com) implies, ack is better than grep at searching through source code.  It is generally easier to use and ignores non-source code files (fully customizeable.)  It is written in pure perl, so you don’t need any other programs (besides perl5) for it to run.

There are lots of other great tools that I use very frequently, like TortoiseSVN, AutoHotkey, Perl, not to mention the greatest text editor on the planet but the ones listed above are everyday life-saving tools that I absolutely could not do my job without.  If you aren’t already using these great programs, I highly recommend checking them out today!  Heck, even if you’re not a programmer you probably still would find them useful!

Did I miss anything?  Any programming (or other general computing) tools that will absolutely change my life?  Please let me know!

 

VI - The editor

Posted in Uncategorized | Leave a comment

More Google+ Set Operations

This post is a follow-up to the post I made over the weekend.

Just in case anyone is interested, I thought I’d add a few examples of how set operations would be used with Google+, as well as a few ideas for how they could be implemented in the bar that you already type circles/people in to.  As reference, I have a couple of fictional circles described below:

FriendsWorkFamilyVideo Game Friends
JimmyFranklinArnoldGabe
KennyGabeBobMarkus
LennyHeatherCindiRomero
MannyJimmyDrewWill
NeddyEnriqueEnrique
PattiFranklinArnold
Franklin

Let’s say I want to post a message to my co-workers and my family.  G+ makes this easy



In set notation, this looks like

Work ∪ Family = {Franklin, George, Heather, Jimmy, Arnold, Bob,
Cindi, Drew, Enrique}

It doesn’t matter that Franklin is in both circles.  He’ll just get the post once.  But what if I wanted to make a post visible to all of my co-workers except those who are also family members?  In this case there is only one, but what if I couldn’t remember, or it were more complicated than that?  Set operations could make quick work of this one, it is denoted by the intuitive:

Work - Family = {Franklin, George, Heather}

Those family members who are not in Work are irrelevant to the whole operation, and were never under consideration for the post.

Now it could get a  little more complicated.  What if I want to post something visible to people who are both video gamers and family members.  Currently G+ does not allow this intersection operator, that would look something like this:

Video Game Friends ∩ Family = {Enrique, Arnold}

 

The resulting set for my family would actually be smaller than the one in my example, but you get the point.

The final bit of coolness would be the symmetric difference.  It is probably the least practical, but I’d love to see it implemented for completeness’ sake.  What if I wanted to post to people who were either Friends or co-workers, but not both.  This seems unlikely, but it’s possible.  It would look like this:

Friends Δ Work = {Kenny, Lenny, Manny, Neddy, Patti, Franklin,
George, Heather}

Notably absent is Jimmy, but he probably gets enough of me at work and as friends anyway…

 

So, if G+ adopted these set operations, they wouldn’t have to be hard to use.  In fact, you wouldn’t even need to use those goofy set symbols, instead, might I suggest the following:

Set OperationG+ symbol
∪ (Union)+
, (commas, like a list)
- (Complement)-
∩ (Intersection)&
Δ (symetric difference)
Probably not even needed...
% (if anyone really wanted it)

I’d welcome any other comments or suggestions if you’ve got any better/other ideas.

As a bonus, try and figure out who would get this post if I shared it using the following expression:

((Video Game Friends + Friends) - (Work - Family))
Posted in Uncategorized | Leave a comment

What Google+ REALLY Needs

You can't see me, but I'm definitely standing behind the bouncer.

In the past few weeks, Google’s new social networking site, Google+, has been sweeping across the web (or at least certain circles of it.)  A lot of skeptics have been complaining that Google+ seems to be a nerdy boys’ club.  And admittedly, early adopters are, by and large, geeky guys (for what it’s worth, it was like that in the early days of Facebook too.)

Well, if the detractors are worried that Google+ is a little too geeky, I’m about to up the ante.  I think there is one feature that Google+ could really use, even if 90% of users would never use it… at first.  The circles feature of Google+ is very useful.  It lets users divide their contacts into different groups for privacy and sharing settings.  It’s very convenient, but if you want to get really specific, there is no easy way to do it besides adding people, or small groups one by one.  Anyone geekier than me should already see where this is going; if Google+ wants to cement its status as the one social network to rule them all, then they need to support set operations with circles.

 

If you are not familiar with set operations, I don’t blame you.  You probably lead a normal, productive life.  Be grateful you don’t think of these sorts of things constantly, and wonder how the information about Google+ circles are stored on the backend.  Indeed it is a heavy (geeky) burden I carry.  If you are still interested in learning about set operations, feel free to read about them on Wikipedia.

I’ll give a brief overview of set operations here.  Basically a set is a collection of unique elements (or objects) just like your circles of friends in Google+.  Set operations allow you to combine these sets in interesting ways (similar to adding, subtracting, etc…)  Google+ already lets you use one set operation (whether you know it or not!)  When you add multiple circles (or individual people) to a post, you are using the union operator.  Union lets you add all the unique members of individual sets into one new set.  If your friend is in three of those circles (like he was a former roommate, co-worker, and also a member of your water polo team,) he doesn’t get the post three times.  That’s because the union operation (and all set operations) guarantee that the resulting set will only contain one of each element (in this case, one copy of each of your friends who are supposed to be there.)

 

This is already super useful, but what if you wanted to have everyone from a circle  except a couple of people (like planning a birthday party, or surprise anniversary party.)  It might be useful to share a post with everyone in the family circle except your uncle and aunt.  This is accomplished with the complement operation.  Or what if you want to share a post with your good friends, who are also your co-workers (if they are just good friends, or just co-workers, they don’t need to see the post.)  There is no reason

Those mesh shirt, snake owning people need to see this post!

People are complicated!

to make a new circle called “Good Friends AND Co-Workers,” but there is currently no way to share with just these people.  The intersection set operator would let you do this without adjusting your existing circles or adding new ones.

 

Those are just the basics, but set operations could get very specific and precise, and also have the potential to be very useful.  What makes them so useful is that the result of a set operation is itself a set that can be used in another operation.  Thus you can string them together until you get exactly the set you want.

Maybe you don’t get as excited by the possibility of set operations as I do, but just imagine the possibilities!  You could share a post with Your bowling friends, coworkers, church friends, and second cousins, unless any of those people are also classmates or ex-girlfriends but not both.  Ok, so that may be a bit extreme, but here’s a more realistic example:  Say you want to share some news with all your family except your nosy aunt (not that I have one… really!)  There is no way to do this besides adding family members one by one.  If you could just subtract the people you don’t want from individual posts, wouldn’t that be nice?

 

BONUS: Check out the follow-up post: More Google+ Set Operations

 

Posted in Uncategorized | 1 Comment

Ban Qi Calculator

Tonight I spent some time archiving my DVD collection.  This means that I had quite a bit of time stuck in front of the computer (inserting DVDs, clicking, waiting, listening to my DVD drive spin, etc…)

To pass the time, I decided to build a little program I’ve had bouncing around in my brain for a little while: The Ban Qi Calculator.  Essentially, the Ban Qi calculator figures the odds that any given covered piece on the board is a certain type (for an explanation of Ban Qi, see here.)  This is the type of calculation consummate Ban Qi players should be able to do in their heads without thinking about it.  Mere mortals like me, however could use some help.

I decided that the Ban Qi calculator would not be appropriate for use by players (not necessarily because it would provide an unfair advantage.  It would more likely be a distraction!) so I printed a (relatively) large warning that the tool is for kibitzers only.  Still, if two players wanted to make use of the tool during a game, and both had access, I suppose there’s no harm.

 

The Ban Qi Calculator

Pretty Colors and Interactive Buttons!

I wrote the tool in javascript, so it should work on just about anything (if you are a luddite who refuses to browse the internet using anything but wget, then you’re out of luck for now…)  As a matter of fact, it works (and looks) great on my Android phone.

I’ve already decided that the tool needs improvement.  For instance, if you ‘overshoot’ and accidentally mark a piece as flipped up, there is no easy way to add it back to the “unturned” totals.  I think when I get around to making an update, I’ll make the counts loop back to their max after they hit zero.  As a matter of fact, I could probably just do that now.  But I’m tired.  And going to bed.  So here in its imperfect state is the Ban Qi calculator v 1.0.

 

Ban Qi Calculator

 

UPDATE

I updated the Ban Qi calculator to reset back to the max number of pieces if you hit a button when it’s on zero.  I’m currently working on some other useful features to add (like figuring out if a potential target is in danger if you turn up next to it.)

Posted in Uncategorized | Leave a comment