<?xml version="1.0"?>
<rss version="2.0.">
  <channel>
    <title>Advogato blog for Chicago</title>
    <link>http://www.advogato.org/person/Chicago/</link>
    <description>Advogato blog for Chicago</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Thu, 24 Jul 2008 08:24:38 GMT</pubDate>
    <item>
      <pubDate>Wed, 16 Jul 2008 21:55:17 GMT</pubDate>
      <title>16 Jul 2008</title>
      <link>http://www.advogato.org/person/Chicago/diary.html?start=129</link>
      <guid>http://www.advogato.org/person/Chicago/diary.html?start=129</guid>
      <description>&lt;b&gt;Work Demonstration Complete&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; My Arduino board was being used for a demonstration at work,&#xD;
but it enabled me to get a lot of use out of it and work&#xD;
bought me a couple of bits that I wanted to play with,&#xD;
notably a network interface and a Mifare reader module.&#xD;
&#xD;
&lt;p&gt; Anyways, its back to being used for what I want to do things&#xD;
with, notably robot building. However, this time I am being&#xD;
distracted by a different use, which is sound generation -&#xD;
or should I say Noise generation.&#xD;
&#xD;
&lt;p&gt; I have had my imagination sparked by the prospect of using&#xD;
the Arduino plus some knowledge I have gained from my ham&#xD;
stuff to generate a synth. It's been done before, but not by&#xD;
a lot of people. &#xD;
&#xD;
&lt;p&gt; There seem to be a couple of routes to go down - &lt;a href="http://www.uchobby.com/index.php/2007/11/11/arduino-sound-part-1/" &gt;This&#xD;
page&lt;/a&gt; documents the different ones. The main ones seem to&#xD;
be this:&#xD;
&#xD;
&lt;p&gt; &lt;ol&gt;&lt;li&gt;Use the Arduino to control a synth or other noise&#xD;
making source.&lt;li&gt;Use the Arduino *as* the synth.&lt;/ol&gt;&#xD;
&#xD;
&lt;p&gt; I've not yet completly decided which route I'm going down, I&#xD;
know that the sounds generated by the first method might&#xD;
be... better, but I have an aweful lot to learn about&#xD;
generating noises...</description>
    </item>
    <item>
      <pubDate>Tue, 15 Jul 2008 22:02:51 GMT</pubDate>
      <title>15 Jul 2008</title>
      <link>http://www.advogato.org/person/Chicago/diary.html?start=128</link>
      <guid>http://www.advogato.org/person/Chicago/diary.html?start=128</guid>
      <description>&lt;b&gt;More posts about things which are not-quite-work&lt;/b&gt;&lt;br&gt;&#xD;
Its increasingly difficult to talk about things which are&#xD;
work related because, well, I'm not allowed to. Because the&#xD;
work is what I'm interested in and takes up so much of my&#xD;
time, it does mean that some blogs being to dry out.&#xD;
&#xD;
&lt;p&gt; &lt;b&gt;Arduino java.lang.StackOverflowError&lt;/b&gt;&lt;br&gt;&#xD;
It seems obvious if you know, but there isn't that much in&#xD;
the Google results for a search with those keywords.&#xD;
Basically, this happens if you do something silly with&#xD;
strings and quote marks... for example, compiling the&#xD;
following (in Arduino 0011):&#xD;
&lt;div style="margin-left:100px"&gt;&lt;code&gt;Serial.print("rar);&lt;/code&gt;&lt;/div&gt;&#xD;
&#xD;
&lt;p&gt; Ok, now, its not immediately obvious without good syntax&#xD;
highlighting that the " is missing from this, and compiling&#xD;
won't give you a line number where it all goes wrong. &#xD;
&#xD;
&lt;p&gt; I &lt;b&gt;Think&lt;/b&gt; The Stack Overflow Error is caused when the&#xD;
distance between this typo and the next " is so big that it&#xD;
would cause a StackOverflow... I think. Im now not sure.&#xD;
Eitherway, look for missing quotemarks or similar typo's.</description>
    </item>
    <item>
      <pubDate>Tue, 15 Apr 2008 16:40:16 GMT</pubDate>
      <title>15 Apr 2008</title>
      <link>http://www.advogato.org/person/Chicago/diary.html?start=127</link>
      <guid>http://www.advogato.org/person/Chicago/diary.html?start=127</guid>
      <description>&lt;b&gt;Visual Studio, HttpModules and compiling for IIS6&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; Things are becoming a little tricky. Because Windows&#xD;
2008&#xD;
has only just been released, the migration to that is going&#xD;
to be relatively slow (I can't realistically suggest that we&#xD;
have our production server as a 2008 box ... yet). So we're&#xD;
stuck with using Windows 2003 and IIS6 for our .Net hosting.&#xD;
&#xD;
&lt;p&gt; However, we're programming on Vista boxes, which of&#xD;
course,&#xD;
are running IIS7 and all its finery. Now, having a test&#xD;
platform which is a different version to the deployment&#xD;
platform is never a good idea, and right now, its a royal&#xD;
pain in the ass. And why? Well, randomly, the way I add headers:&#xD;
&#xD;
&lt;p&gt; &lt;b&gt;Good&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; &lt;code&gt;response.AddHeader("Content-type",&#xD;
"text/html");&lt;/code&gt;&#xD;
&#xD;
&lt;p&gt; &lt;b&gt;Bad&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; &lt;code&gt;response.Headers.Add("Content-type",&#xD;
"text/html");&lt;/code&gt;&#xD;
&#xD;
&lt;p&gt; The first one works, the second one ... &#xD;
&#xD;
&lt;p&gt; &lt;code&gt;System.PlatformNotSupportedException: This operation&#xD;
requires IIS integrated pipeline mode.&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;at System.Web.HttpResponse.get_Headers()&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;at ...&lt;/code&gt;&#xD;
&#xD;
&lt;p&gt; Go figure.</description>
    </item>
    <item>
      <pubDate>Sun, 6 Apr 2008 21:54:38 GMT</pubDate>
      <title>6 Apr 2008</title>
      <link>http://www.advogato.org/person/Chicago/diary.html?start=126</link>
      <guid>http://www.advogato.org/person/Chicago/diary.html?start=126</guid>
      <description>&lt;b&gt;MS SSMSE 2005 Error on Installation on Vista&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; Ok, if you're an indie developer for the Microsoft platform,&#xD;
then you might have SQL Server (Express) then you might also&#xD;
want to install MS SSMSE (Microsoft Sql - Server Management&#xD;
Studio Express).&#xD;
&#xD;
&lt;p&gt; &lt;b&gt;The Good&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; Ok, so you've downloaded the SSMSE install package, and it&#xD;
doesn't install and the MS reference for it is about&#xD;
permissions on the Data Directory. There might be one single&#xD;
file which has the wrong permissions, but I couldn't find&#xD;
one. Installations continue to fail no matter what the&#xD;
install user is.&#xD;
&#xD;
&lt;p&gt; &lt;b&gt;The Ugly&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; To install, there is a very simple solution - Turn UAC off -&#xD;
its in the user panel of the control panel. Then installing&#xD;
SSMSE is painless. Just remember to turn UAC&#xD;
back on again after you've done it, oh and pray that you&#xD;
dont need UAC's protection for the few minutes that you had&#xD;
it turned off... (Why do you think this section is entitled&#xD;
"The Ugly"?)&#xD;
&#xD;
&lt;p&gt; &lt;b&gt;The down-right-Bad&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; If you decided to go with MS Sql Server 2008 Express&#xD;
because, well, why not... (think of all those new features)&#xD;
then you have a bigger problem. At the moment, SSMSE is only&#xD;
available in the 2005 variant, which does not allow&#xD;
connections to a 2008 Express service.</description>
    </item>
    <item>
      <pubDate>Mon, 3 Mar 2008 14:13:55 GMT</pubDate>
      <title>3 Mar 2008</title>
      <link>http://www.advogato.org/person/Chicago/diary.html?start=125</link>
      <guid>http://www.advogato.org/person/Chicago/diary.html?start=125</guid>
      <description>&lt;b&gt;A good workman never blames his tools&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; This weekend for me has been a near disaster. I started work&#xD;
on my SpokePov and USBTinyISP. Then my Solder Iron melted.&#xD;
Not the plastic hand wrap, no, the nib. Thats it for&#xD;
soldering - no more soldering being done without a soldering&#xD;
iron.&#xD;
&#xD;
&lt;p&gt; I now need to go and buy a nice soldering iron which is&#xD;
temperature controlled - if you use one thats too hot, you&#xD;
end up having problems, if you use one thats too cold or&#xD;
does daft things (like the cold solder one) then you have&#xD;
problems. &#xD;
&#xD;
&lt;p&gt; So now I have a fully built USB dongle, and a half-built&#xD;
SpokePov, and a not very happy monster.</description>
    </item>
    <item>
      <pubDate>Mon, 18 Feb 2008 16:46:15 GMT</pubDate>
      <title>18 Feb 2008</title>
      <link>http://www.advogato.org/person/Chicago/diary.html?start=124</link>
      <guid>http://www.advogato.org/person/Chicago/diary.html?start=124</guid>
      <description>&lt;b&gt;IIS 6, 64 Bit Windows and No ASP.NET tab!&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; Ok, this one had me stumped for a bit, and it took me a long&#xD;
time to find out why. Basically, the problem is that there&#xD;
is no ASP.NET tab in website properties, and this is because&#xD;
.NET isn't installed properly. The first thing to do is&#xD;
download and install .Net framework, which dosn't seem to do&#xD;
anything.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; The second thing to then do is to run:&#xD;
&lt;code&gt;%SYSTEMROOT%\MICROSOFT.NET\Framework64\v2.??\aspnet_iisreg&#xD;
-i&lt;/code&gt; which will then try and re-register. Now if this&#xD;
"works" but dosnt have any effect, its probably because&#xD;
you've got a beta of .Net installed. However, if this throws&#xD;
an error, its probably because IIS is running in 32bit mode.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; Why would it be? Well aparantly it has to to be able to deal&#xD;
with PHP. Maybe thats true, maybe it isn't any more - but&#xD;
either way, theres lots of install guides out there telling&#xD;
you how to break it into 32 bit mode. To Fix...&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; &lt;code&gt;cscript %SystemDrive%\inetpub\AdminScripts\adsutil.vbs&#xD;
set w3svc/AppPools/Enable32bitAppOnWin64 0&lt;/code&gt;&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; The 0 is what sets it back to default (64 bit) where having&#xD;
that as a 1 will set it to being 32 bit mode. Of course now&#xD;
all your PHP is probably broken. &lt;i&gt;But then again it was&#xD;
anyways.&lt;/i&gt;&#xD;
&#xD;
&lt;p&gt; Just re-run the first command, and reboot (IIS? Server?)</description>
    </item>
    <item>
      <pubDate>Sat, 9 Feb 2008 16:36:02 GMT</pubDate>
      <title>9 Feb 2008</title>
      <link>http://www.advogato.org/person/Chicago/diary.html?start=123</link>
      <guid>http://www.advogato.org/person/Chicago/diary.html?start=123</guid>
      <description>&lt;b&gt;.Net Interop&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; This post should really be titled "Please write 1000 times,&#xD;
Vista is Not XP". Yesterday, I had the pleasure of having to&#xD;
look at how to write .Net wrappers around a Windows dll - to&#xD;
be precise, the Smart Card interface -&#xD;
&lt;code&gt;WinSCard.dll&lt;/code&gt;. We've previously written code in&#xD;
C, but really the time is to move on and use C#. The&#xD;
problem's been addressed before, and it dosn't take a genius&#xD;
to find Google has references to &lt;a href="http://www.aspfree.com/c/a/C-Sharp/Smart-Cards-in-.NET-Part-2/" &gt;Smart&#xD;
Cards in .NET&lt;/a&gt;. In particular, this is the second part of&#xD;
a three part essay. The first part discusses using a COM&#xD;
object to wrap around the dll functions, but this is the&#xD;
simpler way of doing it.&#xD;
&#xD;
&lt;p&gt; Apart from the required &lt;code&gt;using&lt;/code&gt;lines, the code to&#xD;
do this, is relativly simple:&#xD;
&#xD;
&lt;p&gt; &lt;pre&gt;public class MyClass{&#xD;
  [DllImport("WinScard.dll")]&#xD;
  public static extern int SCardEstablishContext(&#xD;
    uint dwScope,&#xD;
    int nNotUsed1,&#xD;
    int nNotUsed2,&#xD;
    ref int phContext);&#xD;
}&lt;/pre&gt;&#xD;
&#xD;
&lt;p&gt; This is a fully functioning class which provides the&#xD;
interface to one of the functions in the DLL. Now, whats the&#xD;
problem?&#xD;
&#xD;
&lt;p&gt; Well, in this instance, its a security violation. Some of&#xD;
the dll functions can be called and run without any problems&#xD;
at all, but some of them cause&#xD;
&lt;code&gt;AccessViolationException&lt;/code&gt;. The helpful hint that&#xD;
comes with it suggests that this is because memory is&#xD;
corrupt (and after lots of uhming and ahhing we decide its&#xD;
not). No, the problem is because the memory is protected. In&#xD;
Vista that is. The same code running on XP provides no&#xD;
problems whatsoever.&#xD;
&#xD;
&lt;p&gt; Now heres my problem - my Google skills, usually pretty&#xD;
nifty, are failing me - I am struggling to search the great&#xD;
intertubes for a solution I am still scratching my head. The&#xD;
combinations of keywords I'm using still only come back with&#xD;
results are either:&#xD;
&#xD;
&lt;p&gt; 1) Useless&#xD;
2) People suffering the problem who havn't solved it.&#xD;
3) Results about something similar in XP which has the same&#xD;
exception which is fixed by a MS .Net hotfix (which is&#xD;
irrelevant).&#xD;
4) People who have a solution along the lines of "run your&#xD;
code as root".&#xD;
&#xD;
&lt;p&gt; So I need to spend more time looking at that soon.</description>
    </item>
    <item>
      <pubDate>Thu, 7 Feb 2008 17:15:50 GMT</pubDate>
      <title>7 Feb 2008</title>
      <link>http://www.advogato.org/person/Chicago/diary.html?start=122</link>
      <guid>http://www.advogato.org/person/Chicago/diary.html?start=122</guid>
      <description>&lt;b&gt;Build Tools&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; Ok I'm pretty on top of the world at the moment, mostly&#xD;
because I've spent two days in "the Zone", and in that time&#xD;
I've managed to write some very handy new tools for the new&#xD;
project, mainly: The new&#xD;
improved build procedure is now in place, and its using a&#xD;
streamlined batch file to build it. It basically uses a&#xD;
program that I've written&#xD;
(CompilerWriter) that is called both Before and After the&#xD;
compilation - using arguments Pre and Post.&#xD;
&#xD;
&lt;p&gt; It also uses &lt;a href="http://cloc.sourceforge.net/" &gt;Cloc&lt;/a&gt;&#xD;
as an alternative to &lt;a href="http://www.dwheeler.com/sloccount/" &gt;Sloccount&lt;/a&gt;&#xD;
(Cloc is much faster in a Windows Environment, not to&#xD;
mention running nativly without having to mess around with&#xD;
Cygwin).&#xD;
&#xD;
&lt;p&gt; &lt;ol&gt;&#xD;
 &lt;li&gt;Call Pre-compiler to make entries into Database and&#xD;
generate the unique id for the build. Write the assembly&#xD;
info.cs file and return the id of the database entry.&#xD;
 &lt;li&gt;Call the compiler and capture the return code. Send all&#xD;
errors, warnings and notices to a file.&#xD;
 &lt;li&gt;Call the code line counter and put its output into a&#xD;
file (CSV)&#xD;
 &lt;li&gt;Call the post-compiler giving it the return information&#xD;
from the compiler, along with the error file, and the code&#xD;
line counter. It then moves the build to the test folder,&#xD;
corrects the databse entry line for its counts of error and&#xD;
file size, and also moves it into the historic build folder&#xD;
along with copies of all the reports&#xD;
&lt;/ol&gt;&#xD;
&#xD;
&lt;p&gt; All together, its working very nicely - it generates a HTML&#xD;
report of the build and opens it in a tab in Firefox. Now, I&#xD;
could combine these tools in an ANT or a MSBuild file, but&#xD;
instead I just made a batch file to do it all.</description>
    </item>
    <item>
      <pubDate>Mon, 4 Feb 2008 17:56:03 GMT</pubDate>
      <title>4 Feb 2008</title>
      <link>http://www.advogato.org/person/Chicago/diary.html?start=121</link>
      <guid>http://www.advogato.org/person/Chicago/diary.html?start=121</guid>
      <description>&lt;b&gt;MSSQL&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; Oh that wonderful height of confusing riddles. Some&#xD;
interesting things that I've noted (and mentioned before no&#xD;
doubt) that in the connection string, the use of&#xD;
&lt;code&gt;Localhost&lt;/code&gt;&#xD;
actually causes a network / tcp connection. It seems that&#xD;
the way to force a local area connection (Shared Memory or&#xD;
Named Pipe) is to use &lt;code&gt;(Local)&lt;/code&gt; or &lt;code&gt;.&lt;/code&gt;.&#xD;
However, if you're connecting to an SQL Express install (and&#xD;
what ms "indie" developer isn't) then you need to use&#xD;
something along the lines of &lt;code&gt;data&#xD;
source=.\SQLEXPRESS&lt;/code&gt; in your connection string.&#xD;
&#xD;
&lt;p&gt; Also note that some confusing errors might occur if you&#xD;
don't - "Failure to connect" is the main essence, but the&#xD;
message goes on (unhelpfully) to explain that this might be&#xD;
caused by a lack of allowance for a) named pipes or b)&#xD;
remote connections. How many hours have people spent&#xD;
scratching their heads going "But I've turned those on!". &#xD;
&#xD;
&lt;p&gt; In fact, you don't need to turn either on, just adding the&#xD;
&lt;code&gt;\SQLEXPRESS&lt;/code&gt; should be all that you need to do.&#xD;
&#xD;
&lt;p&gt; &lt;b&gt;Jmon / AngryBot&lt;/b&gt;&#xD;
&#xD;
&lt;p&gt; So, with Log4net now logging to the MS-SQL database, the&#xD;
framework for Jmon is now being built for the second time.&#xD;
My original framework (which the project name still is&#xD;
AngryBot) was quite good apart from it had too many hacks in&#xD;
it where I taught it how to play Poker (it required some not&#xD;
very nice hacks to listen to the poker bot and work out what&#xD;
hand it had. It also didn't have a very good idea of some of&#xD;
the specific differences in hands).&#xD;
&#xD;
&lt;p&gt; I know I haven't released the source code yet - I'm trying&#xD;
to tidy it all up, and the main reason is that I'm slightly&#xD;
embarrassed about a bit of it, and that bit is this - the&#xD;
main core, which I never got round to writing properly.&#xD;
&#xD;
&lt;p&gt; The IRC side uses &lt;a href="http://smartirc4net.meebey.net/jaws/" &gt;SmartIrc4Net&lt;/a&gt;&#xD;
by Meebey, which deals with everything IRC related. I hook&#xD;
into the message received event, and deal with it basically&#xD;
like this:&#xD;
&#xD;
&lt;p&gt; &lt;code&gt;if (e.Data.Message.StartsWith("!")) {&lt;br&gt;&#xD;
&amp;nbsp;&amp;nbsp;&amp;nbsp;   string classname = "AngryBot.Commands." +&#xD;
tag.Substring(1).ToUpper();&lt;br&gt;&#xD;
 &amp;nbsp;&amp;nbsp;&amp;nbsp;  ObjectHandle handle =&#xD;
Activator.CreateInstance(null,&#xD;
classname);&lt;br&gt;&#xD;
 &amp;nbsp;&amp;nbsp;&amp;nbsp;  BaseCommand command =&#xD;
(BaseCommand)handle.Unwrap();&lt;br&gt;&#xD;
 &amp;nbsp;&amp;nbsp;&amp;nbsp;  command.Run(irc, e);                 &lt;br&gt;&#xD;
}&lt;/code&gt;&#xD;
&#xD;
&lt;p&gt; But what if the command dosn't exist I hear you say - what&#xD;
if someone goes &lt;code&gt;!Bang&lt;/code&gt; and the class&#xD;
AngryBot.Commands.BANG does not exist? What if it does&#xD;
exist, but isn't a BaseCommand? What happens when someone&#xD;
sends "!"? Well, around that is a&#xD;
try-catch which gets everything that breaks, and just&#xD;
ignores it. &#xD;
&#xD;
&lt;p&gt; I know. Eww. And that's why you haven't got the code released&#xD;
yet, because its just not worth it.&#xD;
&#xD;
</description>
    </item>
    <item>
      <pubDate>Fri, 1 Feb 2008 15:24:10 GMT</pubDate>
      <title>1 Feb 2008</title>
      <link>http://www.advogato.org/person/Chicago/diary.html?start=120</link>
      <guid>http://www.advogato.org/person/Chicago/diary.html?start=120</guid>
      <description>In fact, my previous-to-previous post also contains more&#xD;
issues which I had not really looked into, partially because&#xD;
of unreliable information that sites had told me, and also&#xD;
partially because I forget that when you read Blog posts&#xD;
(even blog posts from the company who are producing the&#xD;
software), &lt;b&gt;anything&lt;/b&gt; that speculates about the future&#xD;
is doing just that - speculating. &#xD;
&#xD;
&lt;p&gt; Windows 2008, being launched officially in some 26 days&#xD;
according to &lt;a&gt;&#xD;
Microsoft&lt;/a&gt; is the reason that people don't have a&#xD;
migration path from Windows 2003 to Vista-servers. Blatantly&#xD;
because they will be migrating to Windows 2008.&#xD;
&#xD;
&lt;p&gt; Starting a project right now is really bad timing. We&#xD;
basically have no choice but to write it for Windows 2003 &amp;amp;&#xD;
IIS 6, because our deployment date will be before 2008 has&#xD;
passed our stringent "hmm well it hasn't fallen over *yet*"&#xD;
style credence plans. If only 2008 had been released in 2007...&#xD;
&#xD;
&lt;p&gt; &lt;b&gt;surely it doesn't matter&lt;/b&gt; but it does. We don't make&#xD;
"websites". We're doing funky things with managed code and&#xD;
talking to hardware modules. We have a vision of what we&#xD;
want to write, we know how it breaks down in the project,&#xD;
and now, we have the leisure of being able to select our&#xD;
tools. &lt;i&gt;And this selection process is killing my mind.&lt;/i&gt;</description>
    </item>
  </channel>
</rss>
