My Problems with Vista

I recently had to downgrade from x64 to x86 on Vista, to deal with a number of problems, like my scanner not working, Eclipse issues, and just general pain in the ass stuff that always made it just a little more difficult than it needed to be. So I’m giving up 800MB of RAM for my scanner, which I have to hack the drivers for anyway since shamefully HP doesn’t provide drivers for older hardware. Scanner tech simply does not change that much from year to year, and building drivers shouldn’t be that hard if they are competent at all. Spending another 400$ when the Automatic Document Feed scanner I have still works fine is a retarded ‘solution’. Anyway, I am still being annoyed by Vista x86.

So this is my own version of ‘Vista Annoyances’ only without the solutions generally:

  • Vista tries to reconnect network drives before the network is connected, which is retarded. It dutifully points out that it can’t reconnect all network drives. And rather than simply connect when it does find the network, I am forced to open up Windows Explorer and click on the disconnected drive to have it reconnect.
  • Sleep simply doesn’t work. Oh, it puts my system to sleep alright. Just nothing I do will turn it back on once it is in sleep mode. This probably corrupted my Search Index when I had to hard reboot my system, so I was getting ‘Search Indexer’ had to close error messages every minute or so. Lovely.
  • Windows’ continued inability to deal with network folders in Windows Explorer. How many billions of times do their users have to sit there wondering why there folder tree won’t expand while a green bar goes across the top of the screen. Reboot seems to be the only option here… See reconnect bitching.
  • UAC: User Access Control. Does it really need to pop up two dialog boxes? One to ask me if I want to acces, the other to actually access? Is there really no way to combine those into a single dialog? Seriously? I know the general mantra is to just disable UAC, but I run pretty fast and loose on my system, with minimal reliance on AntiVirus software, and maximal reliance on questionable software, so I figure a little insurance may be worth the pain. But damn…
  • Years and years later, and the Taskbar still cannot do what I tell it to. It won’t remember that I like 2 rows of programs. It won’t rememebr that I use Autohide. It won’t show the Taskbar half the times when I move my mouse to the bottom, I have to prress the Windows button to get it to show. Why in god’s name must the Quick Launch toolbar resize handles make me guess if my icons are going to all be visible when I lock the task bar, or if a few will be in a side menu.
  • Dear god enough with the Windows System Tray Notification Area (say that 5 times fast) popup notices! Nothing more annoying than when those things popup and simply don’t go away. Or take FOREVER.
  • Just because I like a lot of ‘recent programs’ to show up in my Start menu, why does the stuff on the right side of the start menu also have to move all the way to the top? Wouldn’t it be better to stay closer to the Start button if possible?

More soon…

Posted by slaingod Tue, 15 Apr 2008 15:38:00 GMT


Rails Active Record Lameness

I know this is sacrilegious, but there is some serious lameness going on in ActiveRecord I’ve dealt with lately. Maybe I’m drawing outside of the Rails lines (going off the tracks?), but ActiveRecord seems to go out of its way to make things a pain in the ass.

AR::Base#sanitize_sql being a ‘protected’ method has always been a burr in people’s sides. This means you can’t call it yourself on your own piece of SQL. Presumably it is done this way so people HAVE to do it the Rails way, whether that means duplicating a bunch of code, or taking a lot more time for a one-off project, etc.

Currently I’m working a report generator for Flex, where the Flex app handles the SQL generation and passes back an XML version of the sql options like:

<query>
    <name>
    </name>
    <sql>
        <select>
            <![CDATA[Date(created_at) as date]]>
        </select>
        <select>
            <![CDATA[count(id) as total]]>
        </select>
        <from>
        </from>
        <conditions>
        </conditions>
        <group>
            <![CDATA[date]]>
        </group>
        <having>
            <![CDATA[date >= :start_date and date <= :end_date]]>
        </having>
    </sql>
</query>      

Now we can argue all day about the best way to do this, but the reality is that only Admin authenticated people are going to see these reports, so the fact that someone could send arbitrary sql against the database is outweighed by the Flex-ibility of being able to dynamically adjust the query values in Flex without having to create a custom server-side method for each report. It is easier in my case to let more readily available/cheaper Flex programmers handle this than more expensive Ruby coders.

Getting this accomplished in Rails led to 5 workarounds in the code:

  def replace_named_bind_variables_no_quotes(statement, bind_vars) #:nodoc:
    statement.gsub!(/:(\w+)/) do
      match = $1.to_sym
      if bind_vars.include?(match)
        bind_vars[match]
      else
        raise ActiveRecord::PreparedStatementInvalid, "missing value for :#{match} in #{statement}"
      end
    end
  end

  def query

    # from_xml puts it in something like { queries => {query => [{name, sql}, {name,sql}....] }}
    queries = Hash.from_xml(params[:queries])['queries']['query']
#     logger.dbg queries.inspect

        # generate the report structure
        report = []
        queries.each { |data|

            query = data['sql']
            logger.dbg query.inspect

            # Now we need to get around a bunch of ActiveRecord lameness....
            # Presumably it is done this way to satisy someone's idea of 'how you should do things'
            # rather than, 'let's help them do it, no matter how they want to get it done'

            # first, AR doesn't do bind variables for anything but conditions...
            replace_named_bind_variables_no_quotes(query['group'], params) if query['group']
            replace_named_bind_variables_no_quotes(query['having'], params) if(query['having'])

            # second, we need to join the select clauses, as :select doesn't accept an array...   
            query['select'] = query['select'].join(', ')

            # third, AR doesn't support a separate HAVING clause, you have to attach it to GROUP BY
            if query['having'] and query['group'] # you always have both...
                query['group'] = query['group'] + " HAVING " + query['having']
                query.delete('having')
            end

            # fourth, we need to intern the keys so that they pass 'inspection' by AR
            interned_query = {}
            query.each { |key, value|
                interned_query[key.intern] = value if(value != nil) # AR doesnt like :conditions => nil either...
            }
            logger.dbg interned_query.inspect

            # fifth, we need to use Creative instead of just ActiveRecord::Base because there is a bug/weirdness in reset_table_name 
            # where it can't find the abstract_class
            report << [data['name'], Creative.find(:all, interned_query)]
        }

    # output the results xml
        str = ''
        xml = Builder::XmlMarkup.new(:target => str, :indent => 1)

        xml.result {
            report.each { |query|
                xml.query {
                    keys = []
                    xml.name query[0]
                    xml.cols {
                        exemplar = query[1].first
                        exemplar.attributes.each { |key, value|
                            xml.col key
                            keys << key
                        }
                    }
                    xml.rows {
                        query[1].each {  |row|
                            xml.r {
                                keys.each { |key|
                                    xml.v row.attributes_before_type_cast[key]
                                }    
                            }
                        }
                    }
                }
            }
        }
        render :xml => str

  end

Posted by slaingod Thu, 20 Mar 2008 10:06:00 GMT


Why the iPhone is Destroying Windows Mobile in the Market

Ok, so this post is a little premature, but it just has to be said.  The reason the Windows Mobile (WM) is dying on the vine lies firmly on the shoulders of the .Net Compact Framework( the C# library used for many application ) and the main WIN32 CE  API in general. Now this is a little unfair of a characterization, because Apple has yet to release its SDK for the iPhone, but it is obvious that it is running a real OS.  So many things have been stripped out of the Windows Mobile OS, that it is an effort in frustration to do even the simplest things.  The documentation is a nightmare as well, with everything from the full .Net Framework listed with the Compact stuff, and there are no/few examples. To be fair also, as with all Microsoft products, backwards compatibility is always one of the main skeletons in the closet.  WM has been around for 10 years now, and that legacy, along with the WIN32 legacy in general, has really held it back. But there is also this sense that they said: “This is what we think you should do, so we won’t give you any other way.”

Here is a hit list of issues that I’ve come across:

  • There is no Rich Edit control, only a RichInk control.  And for some retarded reason they decided not to support full justification in the RichInk control, so almost no WM apps do either, from PocketWord on.  This means if you want justified text (like for an eBook reader), you have to roll your own.  It would have taken maybe another 100-200 bytes to support it.
  • Little transparency support.  Any decent design takes advantage of transparency these days, and I am spending an hour googling trying to figure out why my toolbar buttons look like shit.
  • No animation support.  Think Flash here (move button A to X,Y over 1 second and add a drop shadow) .  I imagine that Vista Aero has some better animation now, but WM has none. 
  • Just plain missing API calls, like OemToChar, and some other Unicode/Wide character support.  I’m trying to compile an unrar DLL for WM and it just isn’t pretty, even though unrar doesn’t use much craziness.
  • The WebBrowser control is completely crippled.
  • And because it is all closed source you can’t see a damned thing about how it is done. This would solve almost any problem out, there, making the Compact Framework source viewable so you could make your own versions without having to start from scratch. [Updated: I have since discovered that you can look at a lot of the underlying NETCF (and .NET Framework in general) source code using .NET Decompilers like Reflector.

I have a C/Win32 API app I need to modify, and I would like to port it to C# but it is turning into a nightmare. And of course I would even consider getting an iPhone once the SDK comes out if they had a Verizon version, but I get no GSM reception in my apartment in NYC. I’ll keep you posted.

UPDATED: So I’ve gone ahead and just started from scratch with my project (an eBook reader), in C# NETCF v1.0. I’ve got pagination down within 30 seconds for a 300 page paperback on a mobile device, and it now does full expand/squeeze justification of the text.

Posted by slaingod Mon, 18 Feb 2008 14:26:00 GMT


Biting the Hand That Feeds Me

So this is a note to all of the uploaders of the world.  Your efforts are much appreciated…but…I do have a few gripes about some of the more annoying and time consuming aspects of poorly uploaded files. All of these fall in the ‘if you spend the 30 seconds to do it, then you will save hundreds or thousands of other people that 30 seconds and the added frustration’ category.

 General

  • It is OK to use spaces in file names. No, really.  If you are using an OS that doesn’t handle spaces in the filenames, then you probably aren’t reading this blog. Underscores (_) are NOT spaces.  There was probably some rational against using spaces in file names years and years ago, but that ship has long since sailed.  The ONLY possible issue I could see is if you are using bash or some other shell that escapes spaces with a slash (\).  Or maybe you have a MIRC server script that is older than you are.  There really is no excuse.
  • When creating PAR2 repair volumes, do NOT put other crap into the volume set that isn’t part of the final product.  That means, I shouldn’t need to have an SFV, and NFO, a 100mb sample file, or any other garbage besides the RAR files to get my download to repair.

MP3s

  • If you are going to go to the trouble of uploading MP3s somewhere, have the decency to put accurate id3 tags in the files. Seriously.  It just wastes a ton of time for a ton of people to have to redo them.
  • It is a good idea to upload par2 files with your mp3s, so people can fix them.  This mostly means NNTP these days, since p2p does a good job of validating these days.
  • If you do upload par2 files, then please name them appropriately…don’t name them .par2.  Because, sadly this seems like a common issue, and you just end up with overwritten par2 files.  Or ‘D.par2’ isn’t really helpful either.
  • Rip your stuff at least at 192 VBR.  That’s pretty much the sweet spot for size/quality.  Go higher if you want, but definitely don’t upload stuff at 128 CBR.
  • Don’t tag your mp3’s with spaces between the characters. ‘R E D   H O T   C H I L I   P E P P E R S’ is not really helpful.  Maybe it’s a UNICODE thing, but how often do you actually see unicode in id3 tags?

Movies

  • Along with the spaces thing…File names no longer need to by 8.3. You can use literally hundreds of characters if you want.  ‘tia-ree.iso’ is sooo not helpful. Why not just name it ‘Resident Evil Extinction.iso’ instead?  Then we won’t have to waste time mounting the iso’s and opening our media players just to see what it is. I have no problem with including a group name in the filename, just make the whole thing actually useful.  ‘Resident Evil Extinction.DVD9.TIA.iso’ is fine too.
  • Do NOT ask me to join some IRC channel just so I can find out what your 5GB upload actually is,  I like the idea of being able to go somewhere and request something, and think it is a handy way to add value to some of the larger USENET groups, but still, just leeching shouldn’t require me to join an IRC channel.
  • Don’t release a 9GB HD rip of something.  If your encode went over, then suck it up and reencode it to DVD9 size (which is more like 8GB).  Same with 5GB files and DVDR size.  Maybe in another year or so, when harddrives are 10 cents a GB, that would make less non-sense, but until then, lets stick to the program.
  • Don’t have your release NFO files have spaces between everything: ‘h t t p : / / u s . i m d b . c o m / s o m e t h i n g’ just pisses everyone off since the are just going to have to type the name now anyway rather than deal with the spaces.
  • This one may just be me, but I actually prefer RAR volume sets that have ‘part001’ in the name, only because it means that the only RAR file you care about, the first one, shows up first in a directory listing, rather than what happens with ‘R01’, etc.
  • Learn how to post in USENET so that the files are ordered properly in an alphabetic list!  Starting your post with [001/100] is not acceptable. It just leads to dozens of uploads being ignored. Always put the title of your upload first, like ‘The Bourne Ultimatum.rar [001/100]’ so the files stick together and are easy to select without having to use search filters.

TV

  • Consistency in naming would be nice. ‘tds’, ’the daily show’, ’the.daily.show’, ’daily_show’: just go with ‘the daily show’ and be done with it.  ‘s01e21`, ‘01x21’, ‘121’: Executive decision here, go with s01e21.  It isn’t any better or worse than the others. but just stick with one.
  • Don’t put the episode name into the file name, unless you are releasing an entire season at once, especially on bittorrent.  Everyone’s uTorrent RSS feed regular expressions break if you start throwing stuff other than the show name and episode number in there.

These are all minor things, I know. But like so many ‘little things’ in life they add up. So take this with a grain of salt, but it’s something I needed to say. :)

Posted by slaingod Mon, 21 Jan 2008 09:39:00 GMT


Aveda Anti-Humectant Pomade Replacement?

Ok. so I’m finally getting fed up with the crazy prices for Aveda Anti-Humectant Pomade(AAHP).  It’s not that I can’t afford it, it’s just the principal. It’s the only product I’ve found that tamed my wooly mane, and back when I first started using it, it was $10 a jar for 2.5oz.  Now it is approaching $20 a jar.  One would think that as Aveda has become more popular, that economies of scale would kick in and the price would at least be able to maintain.  In fact, it probably has, but in the standard ‘if it’s expensive it must be better’ mentality surrounding all things beauty, inflating the prices is probably part of the marketing strategy.

In response, I’ve decided to go on a hair product odyssey, trying out everything that drugstore.com has in the pomade/wax section in the $5-6 range.  Since I spend over $100 a year on the AAHP, I’ve got a little leeway to see if I can’t find something else that’s as good. So if you see me having a bad hair day, you know the reason.  If anyone out there in the Intarweb has any thoughts or recommendations, let me know!

Update:

So far, the only product that I’ve found that even comes close is Canu’s Shea Butter, lol.  It’s basically like putting petroleum jelly in your hair.  It does a pretty good job, not quite as good as Aveda, but at a quarter of the price. Though it makes me think of those hair/AstroGlide moments.

I actually found a site that sells raw ingredients for beauty products: The Personal Formulator. They have most of the main ingredients for AAHP, Capric/Caprylic Triglycerides for 12$ for 32oz., Isopropyl Palmitate for 8$ for 32oz., and others.  I’m almost tempted to try my hand at making my own since the price is so nice: $1 for 2.5oz-ish versus $20.  If I get up the nerve and actually try it, I’ll let you know.

Posted by slaingod Thu, 17 Jan 2008 22:36:00 GMT


Using Drop Down Menus for Birthday and State in Web Forms

So in my dealings with clients and filling out the forms of websites in general, one thing keeps bugging me over and over:  sites that ask for your birthday using drop down list for month/day/year and sites that use drop down for state selection for your address.  There are some basic usuability issues here that really drive me nuts, if the web designers thought about it for more than a minute.

First off, why do you even need to know my birthday to begin with?  I guarantee that 90% of the people just go straight to the drop down list for year, set it to something over 21 and go on their way.  It isn’t like ‘birthday’ is any more legally helpful than simply asking for your age.  Why not just let the user enter ‘35’ for their age and be done with it.  I bet you would find that you end up getting a lot more accurate information out of your users in that situation. Typing two numbers is sooo much easier than dealing with drop down menus. If you want to keep the age up to date, all you need to do is keep track of the date they set their age, and adjust it accordingly when you retrieve it. Barring that, if for some reason you just have to have birthday info, then why not at least provide an easy way for the user to put in ‘4’ for the month, ‘16’ for the day, and ‘1982’ for the year?  Again it is just that much easier to do.

With states, the same thing applies.  I live in New York (NY), but apparently I can’t be trusted to type ‘NY’ for my state (2 keys).  Instead, I have to click the drop down, then scroll through 50+ state abbreviations (if say PR for Puerto Rico, etc. is included), and then click my state.  If I accidentally click the wrong one, I have to do it all over.  Or if I want to use a ‘shortcut’, I have to press N 5 times to get past the other ‘N’ states, and usually I have to go through it a couple of times because I overshoot, since just typing ‘N’ then ‘Y’ as a shortcut doesn’t actually work in most browsers.  The only other thought is that maybe the web developers are using this as some sort of easy data validation, to prevent someone from putting in ‘NX’ or something.  But that is precisely what server-side validation should do for you, not rely on the client to send ‘clean’ input.  Someone could easily call your registration method directly (without using a web form), so you had better implement server-side validation anyway.


Oh well, it is the little things that get to me, when you have to do them over and over and over…

Posted by slaingod Wed, 16 Jan 2008 16:18:00 GMT


Why is there no cheap CD/DVD automated changer for PC's?

So I really want an automated CD/DVD changer for my DVD burner on my PC. Ideally something that would work with pretty much any drive you threw in it. Simply a mechanism for taking a disc from one stack of blanks, dropping it into the DVD tray, and pulling it out when the dvd was finshed buring or being read. Ideally this could be used for:

  • Burning a bunch of downloaded files
  • Backing up a harddrive/mp3 collection that spanned many DVD
  • Ripping an entire CD/DVD collection to harddrive.

Something that could be upgraded with a new ‘Blu-Ray’, X-Ray or whatever type of disc in the future with the same physical specifications.

These things do exist, but are usually outrageously expensive for a little mechanical arm that pops a disk out.  Hell, I can buy a Roomba robot for $200, but the cheapest burner changer costs $500. It’s just a motorized arm for crying out loud.  IN the absence of something affordable, it would be great if there was a homebrew DIY project out there that was fairly easy to put together as weekend project that could do the same. The few examples out there, but they aren’t really practical, just pretty amazing from an ingenuity perspective.

Here are some of the existing way-to-expensive-for-casual-use models out there:

Forte (cheapest duplicator out there)

ReflexAuto (This is the basic design style of many of these, and the sort of thing I would want to see but in a smaller form factor. )

Sony (I KNOW!) had probably the only consumer device on the market but did nothing to promote it, the Sony VGP-XL1B.  A bunch of lucky souls got these at clearance prices before the 2007 holiday season for $99 (originally $399). They are now going for $400 on eBay. It isn;t the ideal solution tho, as dealing with a carousel when you need to label the burned media isn’t terribly easy.

The truth of the matter is that there is probably a limited timeframe where these things would be useful for the burning functionality, as hard drives get cheaper and larger. When 1TB heard drives are $100 in the near future, it basically reaches the break-even with physical media blanks.  It currently costs about $0.50  to $0.60 for each DVD you burn, to buy the media ($0.35 for Ritek in 100+ lots), plus $0.15  per sleeve to put them into a binder book (unless you just keep them stacked in the spindle), plus another $0.05 per disk for the cost of the burner. Companies are even realizing this, one company selling harddrives with 10 HiDef movies on them, you just pick the 10 movies you want. Obviously hard drives become a single point of a much larger catastrophic failure, but as long as a drive ilasts another 2 years, we should see 2TB drives for $100 by then so backups become trivial.

If I was in the DVD/Blu-Ray media business I would be crapping my pants right now.

 

Posted by slaingod Mon, 14 Jan 2008 16:55:00 GMT