Search Results Due to Ads

I was just googling for something and got a very stupid result.

I googled for “worda wordb”. In the search result was a page with worda in the page, but wordb was only in the page because it was part of a google ad word in that page.

At first I thought google would be a little smarter about its search. The only thing I can think of is that this particular page had its ad words configured incorrectly and so google was indexing it incorrectly.

I was going to link to the page with with the google cache URL so that you could click it and see the highlighted words, but when I did I notice this at the top of the google cache header:

These terms only appear in links pointing to this page: wordb

So what I experienced is probably by design and not a goofy ad words configuration. Google is known to place pages higher in its rankings based on the link that points to the page. Ad-words is known to place ads in the list based on links pointing to the page. It was just strange for me to see what I saw.

VIM Regular Expressions are the ugliest

PCRE is beautiful by comparison.

Here is a good reference:

http://www.geocities.com/volontir/#substitute

I wanted to basically Perl -pie ‘s/_(\w+)/<\1>\0<\/\1>/’  It is kinda ugly, but it isn’t too bad if you know regex.

In VIM, the + modifier and the grouping parentheses require escaping as well, so it turned into this:

:'<,’>s/_\(\w\+\)/<\1>&<\/\1>/

WOW. The only things not prefixed with a backslash in that regex is _, <, >, and &.

My head would be spinning, but I’m too happy that I got VIM to do what I want.

find files by date

I previously wrote about how I don’t like the find in Solaris and a work around. Well, I recently had to dig up the same work around on MacOSX, so I guess I hate it and BSD Find command equally as much as Solaris. Go GNU FIND!

The GNU find command which I like so much is this one:

find / -printf “%T+ %s %u %t %i %p\n” | sort -nr | less

It finds all the files on my system and shows me them sorted by date! I do some Unix systems administration part time contract work. When someone else was changing things on a system, this command comes in very handy to find out what was changed and when.

Of course any find expression will work with the given command so tacking on -xdev -type or anything else makes a lot of good sense.

Visual Studio 2008 beta 2 high-dpi dialog oops.

Every development shop that ships software should try their software on 1920×1200 15.4″ displays with the DPI set to its real world value of 148. Ideally things would be tested at all DPI settings. A lot of stuff doesn’t display properly.

DebuggingNotEnabled

Oops. This is the default dialog any new ASP.NET Web Application Project will get in Visual Studio 2008 beta 2. I think I am supposed to click OK. 🙂

High DPI makes for high bugs

I’m in the middle of shifting jobs. I said so long to the wonderful Lenovo Thinkpad with only a 1024×768 display and I bought myself a nice Dell Latitude D820 with a 1920×1200 (WUXGA) display. I know my productivity is tied somewhat to number of pixels at my disposal. If I run out of room on my display for developer tools, I’m far less efficient than I could be. There were features I love that I didn’t use on the 1024×768 display.

When I first started up the laptop I thought “Oh NO! These are not my eyes from when I was 16 years old!” I was afraid I had made a terrible mistake. I was slouching trying to read the display. I stepped through the new computer configuration and I immediately set the DPI from the default 96 DPI to the “Larger scale” setting of 120 DPI. This helped. Later that day or the next I did something I almost never do. I was using The Gimp to manipulate some image and I was using its inches support. I decided that it may be good if the inches scales actually were sized correctly. I figured having the correct DPI setting in your OS can only be good. Print Preview should be most accurate that way. I talked to some people who know displays far better than I do (#Linux from arstechica).

It turns out that my display has a 148 DPI (15.4″ diagonal – 1920×1600 – do some math). Windows confirmed when I pulled out a ruler and adjusted the numbers using the “Custom scale” setting. I was happy that this custom scale UI existed and I was even more happy that it visually confirmed what the calculations said. Once I set to 148DPI things were great. Fonts were huge.

By that I mean that fonts were the size they were supposed to be, but I have great vision. I can read Consolas at 6pt and I regularly run it at 7pt. Some things were just too big. Title bars and menus seemed like they were wasting screen real estate. As pointed out the day of the Safari release, Safari doesn’t use ClearType in Windows. Apple does their own font rendering (I’m guessing) in Safari for Windows. As a results my DPI settings had no effect on the display of fonts in Safari. So for a couple of weeks I ran with Safari being too small, and many things in windows being too big.

I’ve since reset my putty to default to 7pt Consolas instead of 8pt and today I shrunk the font from 9pt to 8pt for pretty much everything I could find in the Advanced Appearance dialog (it is still there in Vista).

Advanced Appearance

This is my most usable configuration yet. I love it.

I am disappointed with certain things which do not work with this high DPI setting. Windows Media Player for example seems to break some UI design guidelines. Ya know, the ones that basically say “use relative positioning so your application will work with various font sizes, DPI, and display resolutions, oh and this also means it will be easier to internationalize because that text that is four short words in English takes up 100 pixels, but it takes eleven long words in Finish, but only two Kanji in Japanese.

Leo Laporte - The Tech Guy 347 - Windows Media Player

See how the fonts are overlapping in the right top pane. Shame on you Microsoft.

Windows Media Player really surprised me by its little quirk. I was less surprised with the bug in Windows Live Writer. During setup for a new blog, it asks a couple of questions in a wizard.

Windows Live Writer

I couldn’t click the third option, yet it was the one I wanted. Luckily I could use the keyboard, tab, tab, tab, enter.

Windows Live Writer (2)

What you cannot even see on this screenshot is that there are two textboxes for username and password. I had done this wizard once before. When the next step said invalid username and password, I guessed that I had forgotten it on the last step. Again keyboard to the rescue, tab foo, tab bar, enter.

The really interesting thing here is that I’ve NEVER had these kinds of issues with either GNOME or KDE in Linux. I’m not a holy war kind of guy. I like both Windows and Linux. I use both Windows and Linux, but it seems to me that the Linux guys figured out the best practices for this type of layout a long time ago and they tend to use them. It is no coincidence that when you open Visual Studio you still get a grid on which to put controls in a fixed position. Yet if you open GLADE or QtDesigner the default is a Container that is NOT the fixed layout container.

Do you accept the terms of the licensing agreement

Do you accept the terms of the licensing agreement?

NO!

1.    INSTALLATION AND USE RIGHTS.  You may install and use any number of copies of the software on your devices running validly licensed copies of Internet Explorer.

WHAT???

So if I run the example in Firefox, my default browser, then I am breaking the license agreement. This is unacceptable. I clicked no, so I will not be looking at the WPF FlowDocument sample which I downloaded. (FlowDocumentSamp.exe)

Explaining Fuzzy Logic

I love this post on Explaining Heuristics over at Elegant Code.

I have run into the same issues to the extreme at my place of employment. Someone hears the words “Unit Tests” and immediately all tests are “Unit Tests”. It is as if no research is done into anything whatsoever. Mind you, this is a programmer!

One that I just couldn’t let go a while back was “Fuzzy Logic”. I took a “Soft Computing” course in college. As a project we did a fuzzy hand recognition system. It was rather interesting. We used Matlab’s Fuzzy Toolkit, so we really didn’t have to implement the fuzzy algorithms ourselves. We used line detection on peoples hands and gathered a dozen peoples hands (not a good enough pool for a real world application, but good enough for this college course. Gathering images was fun and easy – we used a digital camera. We just took pictures of people’s hands on the tables in the room in which the class met.

Recently, a coworker started calling some stuff we have “fuzzy logic”. I immediately objected and continued objecting anytime I had the energy to argue. This was not fuzzy, this code was 100% deterministic. Given a set of inputs it would ALWAYS 100% give the exact same output. It was just that the control flow for the program was a bit complex, and so describing it to our business users it wasn’t always 100% clear from where a result value came. I still continue to object to calling this “fuzzy logic”. No matter how complex a deterministic system gets, it is still deterministic. Heck, it wasn’t even that complex. There were about 5 possibilities. For some reason, explaining to certain business users “it could be one of these 5 cases” was not satisfactory (and I won’t argue that – there shouldn’t have been 5 cases – but that isn’t the point). The point is that it was not and is not fuzzy logic.

I just wanted to share in Daddy Starr’s frustration with imprecise language. I couldn’t agree more that “Incorrect or even imprecise language just drives me crazy.”

Thanks Daddy Starr!

Alt Double Click was new to me

Unlike Kate Gregory, the only shortcut that was new to me was Alt-DoubleClick. It isn’t a keyboard shortcut, so it is far less valuable to me.

I use Alt-Space all the time. I highly recommend it. I hope that Kate masters it usage.

My most recent “windows” keyboard shortcut which I have mastered is use of Ctrl-Alt-Break to restore and full screen an MSTSC(RDP) session. I can Alt-tab in a remote desktop session, and then Ctrl-Alt-Break and Alt-tab my desktop and then Alt-tab back to my remote desktop and then Ctrl-Alt-Break to full screen the remote desktop and continue Alt-tab in the remote session. It took my a while to master working this way, but being able to move between these things quickly without touching a mouse is absolutely brilliant!

Now if only Hit-a-Hint worked just a little better.

Wow – some real talk about Rails and Microsoft

I am listening to Hanselminutes #65.

Some very interesting perspectives on Rails and Microsoft. Its great to hear this type of sentiment come though a channel like Hanselminutes. Scott is someone who I would consider typically a pro-MS type who is open to new things. Hopefully the less open people will understand what Martin and David tried to convey.

http://hanselminutes.com/default.aspx?showID=82