Enable Google Now for Chrome

As you may already know, Google Now is available for the desktop through the Chrome browser. You need a mobile device with Now already activated on it to use it, but after that it works exactly the same way. You can click the notification bell in your system tray and up come your information cards.

 

nowshot_png__788×593_[1]

Now on the desktop uses the location information from your connected device also, so you don’t need to worry about location-enabling your PC.

This is supposed to be rolling out over the next few weeks, but if you’re impatient like me then you’ll want to turn it on right away. I checked their site and other posts, but there’s no indication of how to manually opt-in early. It turns out it’s pretty simple: Just point your Chrome browser to chrome://flags/#enable-google-now and set it to Enabled.

googlenow

Viola!

Creating a .gitignore file in Windows

Git Logo

I somewhat recently took up Git for version control. Coming from SVN, there have been a few concepts to reconcile, but by and large it’s been nice and easy. I think I’ll do another post on getting started with Git soon.

In the meantime, I encountered an interesting problem while trying to create a .gitignore file in Windows explorer. This is in Windows 7, but I assume it’s the same in most recent versions. First, what is a .gitignore file? For the uninitiated, it’s a file that will tell Git to stop asking about certain file extensions or folders. Otherwise these will show up every time as needing to be added to the repository. You generally want to ignore any superfluous files that will increase the repository size, change often and be generally unnecessary to the project. This may include things like logs, temp files, or compiled versions. What you should have in your .gitignore is generally different for each development environment, such as a .pyc in Python or the /obj and /bin folders in Visual Studio projects. Here’s a github repo of some common configurations.

So you’re all set up with the rules for your project. Great! But wait..in Windows, you can’t create a new file with just the .name format. The system thinks gitignore is the file extension and you’re omitting the name:

Windows 7 error from creating a file with the .name format

Windows 7 error from creating a file with the .name format

 

There are a number of workarounds to this. The easiest is just to rename it via the command prompt.

  1. Create the file .gitignore.txt
  2. Right click on your current folder and select “open command window here”
  3. Type ren .gitignore.txt .gitignore
Renaming the file via the command prompt allows the .name pattern

Renaming the file via the command prompt allows the .name pattern

Success!

ArcPy: Testing for Selected Features

I’ve come across this before, and had someone recently ask me again. The question is if it is possible to check if there is a selection existing on an ArcGIS data layer via Python (ArcPy in this case). It’s easy to set, remove and manipulate the selection, but there isn’t actually a built-in function to check if one exists in the first place. It turns out it’s pretty simple:

If the data is a Layer, which it should be in order to actually hold a selection, then:

desc=arcpy.Describe("layer_name")
desc.FIDSet

u'3; 4; 5; 6'

 

FIDSet will return a semicolon delineated string of selected FIDs. When none are selected, it is blank: u''. This is as opposed to if you simply use a Search Cursor or some other iterator. These will only return the selected features, except if none are selected then it will return the whole dataset.

After this, you can simply check if the string is empty, or if you want to use the FIDs, do a string.split(';').

Splice – Music to Work By

Splice is a fantastic interface-driven puzzle game. I would definitely say it’s one of the most unique puzzle games I’ve had the pleasure to own. It’s an award-winning Indie game that I picked up in a Steam pack a while back..and then again in a recent Humble Bundle. As an aside – if you haven’t heard of Humble Bundle yet, check it out! It’s basically pay-what-you-want nerd stuff for charity. Anyway, the HB version came with a soundtrack, and it’s great.

[bandcamp album=3147462786  bgcol=e1f2f4 linkcol=4285BB size=grande3]
I find this music to be simultaneously relaxing and mentally stimulating. I’ve written papers and coded to it a few times already..I can’t get it out of my head! Cipher Prime did a nice write-up on the inspirations of how it was created. The pensive, rolling piano isn’t overly complex, while there’s a hint of melody that draws you in. It’s a shame it’s so short – anyone know of a similar artist?

Serving WOFF on IIS 7.5

I recently was publishing a pre-fab website on one of our servers. As a general good practice and way to make sure everything is wired correctly, I checked the Chrome developer console.

I see this error:

chrome_woff_error

WOFF is the Web Open Font Format, and is on its way through the W3C to become a full standard. It’s already supported in all modern browsers, and is expected to be the common standard for all web fonts. So, clearly something was going off course here and my fonts weren’t displaying correctly as a result. The .woff file was in the correct location, and the rest of the site was being served normally. This points to one common culprit: MIME Types.

You would think that a lack of MIME Type on the Server could give something a little more useful than a 404 Not Found. After all, the resource is there, it’s just not allowed to be served. Wouldn’t a 403 Forbidden make more sense?

At any rate, the solution is to simply add the MIME Type to your web server.

First, open your IIS Manager and select the website that you want to serve on. You can also select a child application if you don’t want to apply the MIME Type to all other applications.

default_site

Select your site or application

Then select Handler Mappings from the features grid. Click Add on the right pane to add a new Type.

add

Then finally enter the new MIME Type as shown:

MimeTypeToEnter

Viola! All done. I’ve read a number of different options to put in place of font-woff, such as x-font-woff. The official documentation does list a Media Type of font-woff, however.

Coming soon…

The sites are up (blog and business) but certainly not complete! I’m apprehensive about writing posts before the business site is all set up, since I don’t really want much traffic without the whole picture present. Still, I’m very excited to get started on everything..

 Scroll to top