Zune

by Jesse 28. January 2008 15:32

Been thinking about it for a while now and I finally bit it and bought a Zune (4g, black) and I was mildly irritated right off the bat.  Let me back up -- I have a sandisk 1gb that has the mega-idiot feature.  You plug it in, its a mass storage device, copy paste, copy paste, unplug it, it rebuilds its own index, done.  Sigh, I guess I have to graduate to using someone else's interface and I'm FORCED to use it.  Not so happy about that, but oh well, I'll get over it.

I download the software from the zune website and ! I've got a ...firmware update available?  Really now??  Ok, I'll play along so update away.  Sure enough, a process that I am very familiar with commences and within a couple minutes I've updated to 2.1 -- cool.  It activates my zune (which again, I'm fundamentally against, why should I have to activate? ...agh, anyway) and now I'm met with the zune software.  It's bad, I kind of like it until I try to copy over my playlists ...which are in media player -- both made my MS so they'll work nicely!  Bernt!  Wrong.  The correct answer is to open up my current playlists and changed them over to m3u(?).  Grr.  Ok, great, fine, dandy, now I got music and away it goes.

I'll confess -- I had never bothered to look into pod-anythings.  At all.  Ever.  Why? I'm not a fan of apple and the crap they sell.  Luckily, on the zune is a (shameless) plug for msnbc that you can download the evening news ...I happen to missed yesterdays news so off I go.  I see I can subscribe so I get everyone of 'em from, cool.  "So what else does this thing have?" and it was all down hill from there.  I find strongbad has a feed, ask a ninjabbc radio, discovery, cnn, a bunch of places and I subscribed to 'em all.  I configured it to take some more so than others (keep 3 vs 10 etc). 

Alright, I got some musica and some podcasts downloading, awesome...soooo how do you make this wireless sync work?  Long story short, I gave up on Vista and it worked perfectly on XP (I got a spare PC that has all my junk on it) -- and its nothin short of freakin awesome.  I come in, tell it to sync, sit it down and a few minutes later, done -- even connects @ 802.11g!  Now, just a week later ...I've got about 500m free and thinking I should've bought the 8gb at LEAST.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Misc | Tech | Zune

HTML v5 on draft

by Jesse 24. January 2008 02:43

A draft of html 5 has been posted up on w3.  Might want to take a look, namely the new elements and attributes.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Coding | Tech | Design

Vista, IIS7, Windows Authentication and you

by Jesse 21. January 2008 08:14

I've been tasked with enabling Windows Authen to the current project I'm working on which "back in the old days" of IIS6 was uber easy -- tell it to use windows for the authentication, set your allow/deny groups, done, move along.  With IIS7 you get this really nasty rude surprise...

Server Error in '/someAppImWorkingOn' Application.

Access is denied.

Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.

Error message 401.2.: Unauthorized: Logon failed due to server configuration.  Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server.  Contact the Web server's administrator for additional assistance.


Version Information: Microsoft .NET Framework Version:2.0.50727.312; ASP.NET Version:2.0.50727.833

Woah, ok, fine cousin Vinnie I'll just ...um, go over here for a while.  Jesh.

So I go bouncing around the net and I keep seeing posts about going into vista and enabling various stuff for IIS ...I go take a look and well well well, what do we have here?  Windows Authen, thank you very much ...along with all the other useful stuff.

Ooook, now let me guess, you have to go turn it on (yep!) so into the Inetmgr.msc, click on authentication, and no surprise...

Right click, enable, annnnddd back to the page.  But how do you know its working?  Here's a test I came up with on the fly to verify the stuff is doing its thing.  Just as a note, you have windows authen enabled and anonymous enabled for the following tests.

Go into your root page, whatever that may be (default.aspx?) and drop in a LoginName control onto the page (look under Login in your toolbox), drop it on the page somewhere obvious, the top works great.  Dump this into your web.config somewhere under <system.web>, you've probably seen this before...

<authentication mode="Windows"/>
<
authorization>
     <
deny users="?"/>
</
authorization>

so you've seen this, the ? disables all anonymous users.  Load your page up and you'll see <domainName>\<userName> on the screen (assuming you are on a domain).  Great, it works, now change <deny users="?"/>  to <deny users="*"/> (This'll disable ALL users) -- You'll get a prompt (!) and a nasty 401.2 error when you click cancel.  Switch back to the ? and go back into inetmgr and disable windows authen.  Refresh the page and you'll get the same 401.2 error.

I almost forgot, if you take away the <deny users="?"/> you'll see NO username at the top (its anonymous after all!)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

.Net | Coding | Tech | Security | Design

Code to HTML

by Jesse 15. January 2008 02:58
I had been thinking of doing this, but apparently, someone's had the idea before (well, duh, you see it all over the place) -- pasting your souce code up doesn't always do what you think/wish/hope it will do and I came across this article regarding this.  It's a good, easy, quick read and ...well, its coded already.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | Coding

Hardware failure (big unhappy face)

by Jesse 9. January 2008 03:10

Cry

You never think its going to happen, but then it does.  Wow that sound cliche.  Last night I came home from work, broke out the laptop in the living room and was going to setup a site for a kids baseball team (thats Coach Riley to you) and...hmm, where's my wireless??  I have two routers in my house, one for the front, one for the back and I'm only seeing the back one.  I go down stairs and my beloved wrt54g (v1 mind you and they're up to ...v9 or 10 now) has no life, at all.  Being the electro-nerd, I break out my MM and verify that yes, the power supply is still working and I am offically SOL.  I try some voodoo which results in - nothing.  Sigh.  And it was so easy to drop dd-wrt on it too.  I've had that router for at LEAST 5 years so it led a good life and served me well.  I got two low gain antennas which I may find useful for some other project at some time but it sucks.  What's worse -- I need to buy another router now and the newest wrts are ...well, lame and I really don't like/want/need a "draft-n" router (those things piss me off).  To quote strongbad "Why do my 30 year old electronics keep breaking on me?!".  Time to get a new one.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Cross-thread goodness

by Jesse 4. January 2008 02:57

Ran into an interesting problem yesterday and it continues today.  I'm tossing in a more useful network awareness method into the project simply because ...well, its kinda weak to have it only check when the app starts so I find this awesome event handler that does exactly what I want.  It checks for a network connection of any kind (and ignores loopback) and by using System.Net.NetworkInformation, 1 line sets this up ...if you press tab and let vstudio write the rest of it ...

NetworkChange.NetworkAvailabilityChanged += new NetworkAvailabilityChangedEventHandler(NetworkChange_NetworkAvailabilityChanged);

and it gives you the method "NetworkChange_NetworkAvailabilityChanged" -- a delegate method, which is fine, until you try to update stuff on a winform and you get this nasty "Cross-thread" error -- rude surprise.  Ok, fine.  I find a param I can set to disable this exception, but we're not about that -- we're going to do it right so off to ::shivers:: MSDN help.  2 hours pass and it shows me an example of a good threading call and a bad threading call, both of which are like saying "nuclear physics starts with this 3 mile long calculation" and its great, but I want something thats clear, less cluttered and to the point.  Well, the accountant suggests I check out CLR via C# and brain up on threads, so I do.  Since delegates is a good place to start, I pop open chapter 15 to better understand what all a delegate does and expects and within that chapter it refers me to chapter 23 which talks in great depth about async operations -- imagine that.

Ok, so now it makes sense why its complaining.  The two threads are independent and for no real good reason should one ever be allowed to talk to the other.  Think about an HR app that would allow this ...mmm scary eh?  So I come across a few year old blog, the only one I find that answers my question just the way I like it -- short, sweet, to the point and with the least amount of code as possible -- and it all makes perfect sense.

The long and short of it?  Within the method it creates, use System.Thread and do a This.Invoke(new WaitCallback(<methodName>), <methodArguments if any>); and within your <methodName> call up your usual control.text = "new stuff" ...with no cross thread complains.  Here's the rest of the snippet.

private void NetworkChange_NetworkAvailabilityChanged(object sender, System.Net.NetworkInformation.NetworkAvailabilityEventArgs e)
{
     //To view the cross-threading error, uncomment the lines below and comment out this.invoke
     //bool alive = NetworkInterface.GetIsNetworkAvailable();
     //if (alive)
     //     Status.Text = "Connected";
     //else Status.Text = "Disconnected";

    
this.Invoke(new WaitCallback(CheckNetwork), NetworkInterface.GetIsNetworkAvailable());
}

private void CheckNetwork(object NetworkNowAlive)
{
    
bool alive = (bool)NetworkNowAlive;

     if (alive)
          
Status.Text = "Connected";
    
else Status.Text = "Disconnected";
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | Coding | Design | Architecture

Selenium and the Kiss Theory

by Jesse 3. January 2008 03:17

I've been tasked with testing our ajax enabled admin site for a project we've been working on for a little while now.  Jim, the head dev, asked me to use this thing called Selenium to test it with since current unit tests wigs out with ajax items.  So off I go to figure this thing.  After a short learning curve, its not all that hard, but I DEFINITELY recommend some downloads to supplement.

If you're lucky enough to be like me and know absolutely nothing about how this thing works, don't worry -- it only took me ...2 hours? to get this running and firing off tests.  This should cut that down into a few minutes.  Before I send you off into the wild unknown, here's a market-less overview of what this thing is.  Selenium is a web unit tester that uses specifically formed html pages (tables, thats it) to run against your site.  That's it, thats all.  All you need is the site setup locally and this thing installed in another place, using the same IIS.  Now was that so bad?

Now for the meat.  Download this (its small, under 2MB), create a new IIS app and dump the zip file contents into it.  Wow that was hard.  Navigate your browser to your new IIS app/index.html and you should something like this.

Click the Selenium TestRunner, it'll bring you to another page, on the left, you'll see "Test Suite" and a link, click go, and a ton of stuff will appear.  At the top right, you'll see "Selenium TestRunner" in bold and "Execute tests" -- click the left most of those tests (this is run all) and wait a minute -- it'll rip though a ton of tests.  Most, if not all should pass (ideally, all pass).

Ok, great it works, now what?  Here's were I take everything on their site and ignore it.  "But what about all the functions, methods, blah blah?!?" I like to cheat and work more efficiently by letting software do the work and thankfully, they have and "IDE" for download as a firefox extension -- besides, reading the site its like reading msdn, yea its "cool" but 99.999999% of it you won't use.  Anyway, so now what?  That thing you just downloaded has ALL the stuff in it making it a million times easier to make this stuff work and now you can make tests to your hearts content, very quickly, which is great.

Now we switch gears a bit because as you will discover, its a ROYAL PITA to figure out what the controls are named and you WILL need this info.  So instead of hunting though that notepad, may I suggest you try this, IE Dev Toolbar.  Using this is easy and here's your learning curve.  After you've downloaded this go into IE and (if you don't have menu bar showing, you shall suffer) click view, Explorer Bar, IE Developer Toolbar and you'll get this at the bottom of your IE. 

You're only really worried about the first two buttons which are "Select Element by click" and "Refresh".  Basically if selecting by click isn't working, click the refresh button and it works.  To get this to work, click that first button and click something on a webpage you want to know.  The middle box will be populated and look as such.

You're only worried about "Name" which in this case is "connspeed" which you can double click on and copy/paste.  Now to bring all this together.  Go into firefox, click tools, Selenium IDE and close firefox.  You'll get this very uninteresting looking thing which is about to make your life easier.  Under "Command" in the big box, click the top most row (there's one there, believe me) and all the other controls below become active.  Oh and for the sake of blog, I'm only doing a SHORT example, open a page, type some stuff, click a link (google search).  This'll seem cumbersome at first, but its the fastest way I've found so far, so stick with me on this.

Where it says "Command/Target/Value" click the dropdown arrow and look for "open" (or just type it, it'll autocomplete), type in the base URL for your site and leave value blank.  Click the row below the command you just created (trust me again, there's one there) and now hunt for the "type" command (or again, type it) and here's where IE dev comes in handy -- open up google, and click the "Select By Element" button, click on the search text box.  You'll find its name is simply "q", so in the target column, type in Q and set your value for blog.rileytech.net.  Finally, we want to click the search button, so we give it another command of "click" with the target being the "Google Search" button which name value is "btnG".  Your result should look something like this.

Now save as html into the directory where you copied the Selenium files over earlier and remember the filename.  Only one final step to make this puppy work, you need a test master file of sorts -- its sole purpose is to house links to the tests you just created.  No more, no less.  So fire up your favorite html editor, create a table that looks something like this (or just copy this and save it)

<html><body><table><tr>
<td>Test Suite</td></tr>
<tr><td><a href="./mytest.html">google test</a></td></tr>
</table></body></html>

Go back into Selenium, Selenium Test Runner and type in the url for your newly created master file and it should come up nicely.  Run it like you did the other tests and away you go.  Other useful commands are "verify" commands which you'll find there's a nice collection of them, along with "assert" (assertCheck is a good one).

Wow that was a long post.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | Visual Studio | C# | Coding | Design | Architecture

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Like the description says, at my core, I'm a scientist and engineer.  I came from humble beginnings on a 486DX2 Packard Hell playing doom2 on IPX to in a small time retail shop and got into hardware (ISO layers FTW!) and it was all downhill from there.  I'm infinitely curious about almost everything and always wanting to know.

Some of the stuff I'm currently into/researching...

Sitefinity

Ninject

Subsonic

Java

Currently working on ...
i did the hundred 
and some extra stuff

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's, their brother nor their dog's view in anyway.  At all.  Ever.

© Copyright 2007-2008