Showing posts with label stupid. Show all posts
Showing posts with label stupid. Show all posts

Tuesday, May 10, 2011

Skype and discoverability aka Resize Chat Message Width

For a while now I’ve been quite annoyed by how narrow the chat window is in Skype, especially when pasting code, exception logs, e.g:

image

Not very useful at times, especially given the real estate available, and this was only at 1366 horizontal resolution. Initial binging (and googling) turned up nothing, so I mentally filed it away in the (increasingly larger) pile of Things That Piss Me Off™.

Alas, today i went to vertically resize a non-skype related window that was hovering over skype. To my surprise I see a horizontal resize cursor rather than it’s vertical equivalent. Seems as though the chat width CAN be resized by grabbing the edges of the text entry field. The only indication that this is possible is the cursor change when hovering. Now, I understand that not everything can be discoverable, but to me this is a bit ridiculous.

Re-searching this turns out that other people have discovered this long before me. Unfortunately the size of my Things That Piss Me Off™ pile hasn’t decreased…

Thursday, April 7, 2011

c# Linq Compound Froms

I’m a bit embarrassed to admit this, but even after using linq in it’s various form for a couple of years now, I hadn’t really ever noticed compound from expressions e.g.

   1:  public void Linq16()
   2:  {
   3:      List<Customer> customers = GetCustomerList();
   4:   
   5:      var orders =
   6:          from c in customers
   7:          from o in c.Orders
   8:          where o.OrderDate >= new DateTime(1998, 1, 1)
   9:          select new { c.CustomerID, o.OrderID, o.OrderDate };
  10:   
  11:      ObjectDumper.Write(orders);
  12:  }

(from 101 LINQ samples)

Very handy for flattening an object hierarchy, etc. In the end though it’s just syntactic sugar over SelectMany (like a good deal of many LINQ functions). Anyway, another tool in the belt.

Wednesday, October 27, 2010

Rhosync Compile Errors–Rake Log File

Standard behaviour to run a Rhosync webserver requires running the following command in the folder containing your Rhosync server app (talking windows here):

   1:  rake rhosync:start

which will run in a new cmd window. Problem is if there is a compile error, this window will close before you get to see the error. I was expecting to see errors in logs somewhere, but my limited searching turned up nothing.

Easy fix is to just call rake instead. e.g.

 

   1:  rake

Probably easy for most people to work out, but for us linux noobs simple things can sometimes seem very difficult :(

Monday, October 25, 2010

Node != Nodejs

Recently built a new Ubuntu 10 VM to test out a few Node.js ideas. While support for windows is improving, it just isn’t ready for prime time. I’m very much a linux noob so I just tried following the various guides out there.

I’ve followed these steps successfully recently so it came as a surprise when running:

   1:  neil@ubuntu:~$ cd node
   2:  neil@ubuntu:~/node$ ./configure

resulted in:

   1:  neil@ubuntu:~/node$ ./configure: 4: autoconf: not found
(or some other such error)

Now trying to brute my way through the install I pushed on and ran:

   1:  neil@ubuntu:~/node$ make
   2:  neil@ubuntu:~/node$ sudo make install
furthers errors ensued…

However then running:

   1:  neil@ubuntu:~/node$ node

gave me the oh so informative:

   1:  The program 'node' is currently not installed.  You can install it by typing:
   2:  sudo apt-get install node

DO NOT RUN sudo apt-get install node

As this will install the node module. Confused? Well node != nodejs. node is apparently a Amateur Packet Radio Node program. Not what we want unless you’re into ham radios… Attempting to run node will usually result in something along the lines of:

   1:  axconfig: port 1 not active 
   2:  axconfig: port 2 not active 

 

How to fix all this? Well thanks to stack-overflow and the nodejs group at least I knew where to start:

First remove the node package:

   1:  sudo apt-get remove --purge node
   2:  sudo apt-get clean

 

And then run the following to get a stable version of nodeJS running (e.g. v0.2.4):

   1:  sudo apt-get install build-essential
   2:  cd node
   3:  git checkout v0.2.4
   4:  ./configure
   5:  make
   6:  sudo make install

 

You should now be able to run nodeJS scripts. YMMV

Thursday, September 3, 2009

Work Smarter Not Harder

Lately I’ve been getting into the habit of writing down the little snippets of goodness I happen upon in my daily web traversing. It’s kinda like twitter but on paper, I force myself to write one “item” per line, e.g. “Use mocks as a last resort, stubs as standard. 95% of testing is state-based, 5% interaction – Roy Osherove”.

I’ve found it really useful of late as they tend to be important things to remember that I don’t want to lose in the bookmark/tag cloud. Writing them down also helps me remember them in the first place.

Onto the title of this post however… I was doing some Asp.Net MVC work today when I half remembered something along the lines of “if you’re doing x, then you should use y”. I was doing x but for the life of me couldn’t remember what y was. I chastised myself for not writing it down on my “twitter-sheet” and spent half an hour re-finding the quote which I promptly wrote down.

Turns out I had previously written it down. Two lines above my fresh version. Live and learn… 

Tuesday, June 2, 2009

Asp.Net Web Development Server Tip

Well call me slow but I just realized that the built in Asp.Net Web Development Server allows you to recompile/deploy your assemblies without the need to restart the web server. This seems to have been available since at least VS 2005 so all this time I've been debugging through pages for apparently no reason... I seem to remember that closing IE would kill the web server while debugging, which definitely isn't the case (anymore?).

What's even more interesting is that Session data is preserved across deployments. Was hoping authentication would be as well but I haven't had time to test that properly.

I'm mostly using Asp.Net MVC these days which tends to mitigate the need to do the old login->browse->debug routine. Still handy to remember though

Friday, May 29, 2009

Deploying ASP.NET 2.0 + (IIS, "The page cannot be found", 404.2)

It's been a while since I've had to setup a Windows 2003 server to test Asp.Net apps on so i was a bit baffled when when i couldn't get the website to serve aspx pages. Navigating to the site would result in "The page cannot be found" http 404.


Did all the usual googling, checked the logs at %WINDIR%\System32\Logfiles\W3SVC* which contained lines similar to:

2002-11-25 05:46:15 127.0.0.1 GET /default.asp - 80 - 127.0.0.1 - 404 2 1260


Right, just need to lookup what the "404 2 1260" error means. Despite the detail on that page there's no concrete answers.

Anyway long story short, i had forgotten to register Asp.Net 2.0 with IIS using the old chestnut: aspnet_regiis -i. Allow Asp.Net 2.0 in IIS->Web Service Extensions and away we go.


I'll just slink back to my cave now :(

Monday, February 23, 2009

HTML Engine Automatic Tag Expanding

Well this one had me stumped for a little while... I'm using the JQuery UI library for an ASP.NET (MVC) project. I was trying something quickly using FireBug I grabbed this piece of markup and pasted it into my .aspx page:

lt span class="ui-icon ui-icon-info" / gt Hey! Sample

Easy i thought. I was expecting some CSS conflicts so it was no surprise that my aspx version didn't look the same as the example.html version. But for the life of me couldn't work out which attribute/element combinations were different. They looked identical, they actual CSS was identical.
After much hair pulling I discovered a mysterious closing span tag that wasn't present in my pasted code??? Seems most HTML rendering engines (IE, FF, Chrome) don't like to output inline closing tags for elements that should obviously have content e.g . Unfortunately for me, instead of converting:

span / ...

to:

...

they decide to "fill out" the element within its parent, such that:

...

and hence destroyed the CSS rules :(
Examing the network request/response in Firebug reveals that the HTML that comes down from the server is in fact the same as the .aspx file.
Note to self: to blindly copy/paste example code even when it really should work :)
Edit: I use Syntax Highlighter to format my code, but again the HTML engines seems to insist on messing up my inline lt span / gt tags for this post, grrr....

Tuesday, October 14, 2008

Don't name your View "View"

but if you must don't try to use code like this: Obviously you'll just end up with a StackOverflowException. ActionName attribute to the rescue! It's strange what working in a different environment or with different technology can lead you to make the most simple mistakes :)