Saturday, May 14, 2005

The Coderoom 2

Episode 2 of The Coderoom is now out. I watched it on TheServerSide.NET, who was the first to host it. In this episode, a group of developers must make a bluetooth-enabled application to more or less simulate interaction that a shopper might have in a shopping mall (i.e., be able to view specials going on in the stores via your phone).

The show gives face-time to Rory Blyth, who serves as the MSDN dude that accompanies each episode (or at least, that's been the trend so far). Rory was the co-host of .NET Rocks for 50 episodes, but got too busy when he started working for The Man, and had to relinquish his title!

And speaking of TheServerSide.NET, I just found this site today. My company, which is primarily a Java shop, has sent out broadcast emails before referring to content on TheServerSide.COM. I glanced over that site, and had wished that there was a .NET equivilent, especially since you can get free ebooks, etc. Come to find out, there is an equivilent, just a TLD away!

Friday, May 13, 2005

.NET Rocks!

Yeah, I know, it's 112 episodes into the series at this point, but I've been listening to old episodes of Carl Franklin's .NET Rocks! internet radio talk show focusing on .NET technologies (thank you MSDN for putting all of the first 100 episodes on the spring DVD). I find Carl pretty entertaining, as well as the collection of regulars and featured guests that participate. I was already familiar with Carl's work as the author of Visual Basic 4.0 Internet Programming, which is one of the few technical books that I actually own. Since it's VB4 technology, that's kind of dating myself a little bit (but not as much as stating that I used VB3 professionally for a year or more before VB4 came out!).

Great way to make it through a monotonous workday, as well as being introduced to the major players in the .NET world (whether employed by MS or not).

Tuesday, May 03, 2005

Great Way to Learn Assembly

I don't program in Assembly language on a regular basis, but every now and then, I get the opportunity to play with microcontrollers or other devices that require knowledge of assembly and/or machine code.

Being a high-level developer (VB, Java, C#), it's both interesting and extremely confusing to work at the machine's level. But, I found that a great way to teach myself a new assembly language is to actually write an emulator (simulator) in the high-level language to execute real/compiled machine code.

For instance, in the past, I wrote a simulator for the TMS370 microcontroller because I needed to learn its assembly language to write some serial I/O routines.

A better example for this audience might be to create an emulator for the Z80 microprocessor, simply because there's a lot of real-world programs that you can run (i.e., "Donkey Kong" arcade game used the Z80). Of course, emulating arcade machines involves more than just simulating the CPU and memory--you also need to emulate the graphics system in order to "see" if your CPU emulation is working correctly or not.

But, my point is simple--by forcing yourself to implement each opcode as part of an emulator, including all the different addressing variations, you will truly understand how the opcodes work. And, if you get stuck, you could always check the MAME source code (which emulates a multitude of popular CPUs).

Try it, if you dare! (btw--I'm toying with this very same idea for a book, if I can find the time....damn, I hate working so much).

Thursday, April 28, 2005

My Fingers Can Spell Better than My Conscious Mind

I find it odd that when I type, I don't really think about how to spell what I'm typing. And, if I need to tell someone how to spell something, I'll often need to type it out first (if only on an invisible keyboard).

Is that because while I type, I'm reading at the same time, so I can see what is correct/incorrect? Did my brain wire itself up incorrectly? Interesting phenomenon, though.

Sunday, April 24, 2005

IE Max Connections

I found this Q-Article that discusses the Maximum Server Connections in IE.

If you've ever tried to download multiple files from the same server, you might have noticed that only two will download at one time, and the third won't start until one of the first two finishes. This is actually because IE is compliant with an RFC (2616) that states that no browser should maintain more than 2 connections at a time. This won't only affect download of files, but also images, etc, while your web pages are being loaded.

In the Q-Article, MS tells you what registry setting to create in order to override this default behavior. Know that by doing this, you're causing your browser to break with the RFC spec.

Monday, April 18, 2005

Welcome Fellow Dog Shit Haters

A quick look at my statcounter shows that about 75% of the visitors to my blog this month have had dog shit problems in their yards (as evident because of the referring URL).

Some samples (it looks like my October 2004 entry on the subject ranks high on Yahoo's results):

search.yahoo.com/search?p=keeping dogs out of the yard&ei=UTF-8&pstart=1&fr=slv1-&b=11

search.yahoo.com/search?p=how to keep dogs off your lawn&fr=FP-tab-web-t-222&toggle=1&ei=UTF-8

search.yahoo.com/search?p=keeping dogs away from lawn&fr=FP-tab-web-t&toggle=1&ei=UTF-8

search.yahoo.com/search?p=dog crap in my yard&ei=UTF-8&fl=0&pstart=1&fr=slv1-adbe&b=11

To all the people out there who hate mowing over clumps of shit (cause you know it's another 3 passes before the stuff falls off of the mower wheel): I feel your pain. ;-)

2004MN

Asteroid 2004MN [wikipedia] Impact Analysis [NASA].

This is the "It's going to hit....wait, it's not going to hit...." asteroid that may or may not make impact now in 2036.

Now, after the lastest simulations, it looks like this badboy might just hit us after all. It will make a very close approach in 2029, inside the range of where our satellite TV birds are. The Earth's gravity will alter it's current orbit, and this alteration might be what will take the event in 2036 from another near-miss to an actual impact.

The impact will be rated at around 850 megatons, which is HUGE! Human Race Extinction Huge. You can expect a impact winter afterwards, assuming that you survive the actual event. What a nice way to instantly reverse decades of global warming!

Friday, March 18, 2005

SQL Server Reporting Services

For the past week or so, I've been exploring SQL Server Reporting Services. My only impression (coming from someone experienced in both Access report writing and Crystal Reports): WOW!

First off, if you have a license to run SQL Server (Standard or Enterprise), then you have the license to install Reporting Services onto your database server. It's now part of the SQL Server package, not a separate application that's licensed by itself.

Having said that, though, the recommended architecture is to have Reporting Services run on its own machine. This way, the report processing does not bog down your [production] database server. The caveat here is that you'll have to pay the boys in Redmond for another SQL Server license.

The product is built upon .NET Web Services. Because of this, you'll need the .NET Framework v1.1 installed, as well as IIS (for ASP.NET) on the reporting server.

If you're brave, or have complicated requirements, then you can perform all report processing via the Web Service. However, for integration with existing [legacy] applications, or to simplify development of new applications, there is a feature called "URL Access". Basically, this provides a hyperlink that links to a web-based report viewer running on the Report Server. The user clicks on the link (which also includes the report path and name), and is taken to the ASP.NET web site where the report is displayed.

Reporting Services offers a subscription feature. Maybe you need a report emailed to you every day detailing activity from the previous day. Set up a subscription for that report, and you'll have emails awaiting every morning. Cool feature!

Even though this is a SQL Server product, don't think that you're limited to just SQL Server databases. Because this is a .NET application, you're actually limited to anything that ADO.NET can get at (which is just about any data sources, including custom ones if you want to do the coding). So, if you need to query that Oracle database that contains your JDE sales data, then go for it!

I don't think that Reporting Services is necessarily a "CrystalReports" killer. Reporting Services does act as a server, so with that in mind, there still could be a use for ActiveReports or CrystalReports. But, I won't be using them anytime soon in my designs!

Saturday, February 26, 2005

New Mersenne Prime Confirmed!

The cat was let out of the bag a little bit early, but it has been confirmed that 2^25964951 - 1 is prime. In binary, this would be a string of numbers containing 25964951 ones. In decimal (base 10), this is a 7816230 digit number.

I say the "cat was let out" because George Woltman (the founder/coordinator/programmer of the GIMPS project) was working to allow the hometown newspaper of the volunteer whose computer found the prime to have an "exclusive" story, including revealing the exponent's value. But, the exponent's value was released by mistake on mersenneforum.org (and it was actually guessed beforehand by examining the Primenet log files).

Article: Mathworld Link

GIMPS homepage: mersenne.org

Congratulations to George and the lucky volunteer!

Tuesday, February 08, 2005

Review: maps.google.com

I stumbled upon Google Maps this morning (after it was slashdotted). First impression: WOW!

It seems to use the same type of client-side JavaScript service code that GMail does. This prevents the need for the browser itself to fetch a new web page with each request. Instead, the service code interacts with a webservice of sorts, and grabs only the data that it needs. This makes the requests lightning fast without bogging down their servers (because the server does not need to serve up redundant code that had already been given to the browser as part of the previous request).

It looks good, seems to be a little more accurate than other mappers (i.e., my home address usually gets plotted in the wrong block, but this at least hit the right block, but still not the exact location), and has a great search built in (i.e., try doing a search for all of the McDonalds in your town, or just put in Mexican, etc).

The sad thing is that right now, Google is still every geek's favorite underdog. But, as they establish more and more dominance on the web, they'll soon grow into another monopoly that people will grow to hate.

Thursday, February 03, 2005

Thank you FoxNews

A big Thank You! to Fox News, the first and so far only major news outlet that I read that actually call Terrorist in Iraq "Terrorists" instead of "Insurgents".

Case in point: I'm perusing the various news websites this morning. One of the top headlines is:

MSNBC: 20 dead as Iraq insurgents launch new attacks
CNN: Insurgents kill 12 Iraqi army recruits
CBSNEWS: 20 Killed By Iraqi Insurgents
ABCNEWS: Insurgents Ramp Up Attacks in Iraq
FOXNEWS: Terrorists Kill 19 in Iraq

Mainstream media in the United States has this fear that actually acknowledging the true nature of those perpetrating violence would somehow validate President Bush's choice to invade Iraq. It's pretty clear that al'Qaeda is running the "insurgency" in Iraq. It is so refreshing to see a news outlet call it what it is.

Monday, January 17, 2005

Geomagnetic Storming

As I write this, the first of two expected CME's has impacted the Earth's magnetic field, and has kicked off a G3 Geomagnetic storm (moderate). Skywatchers should be alert for middle and low-latitude auroras tonight (whenever nighttime is for you) and tomorrow also.

Thursday, January 06, 2005

GB-PVR Plugin Tutorial Released

Here's a tutorial that I put together to explain how to create a simple plugin for GB-PVR from nothing. The tutorial uses Visual Studio.NET 2003, so some parts might not translate to other development environments.

http://prdownloads.sourceforge.net/gbpvrwidgets/PluginTutorial.pdf?download


This will actually evolve into documentation for creating plugins using the Widget Library. But, since the library is not yet ready, I truncated the guide so that it's usable with GB-PVR today.

Tuesday, January 04, 2005

Why Lucas-Lehmer Test Works

A question was asked on Mersenneforum.org about why the Lucas-Lehmer test works. The answer given was basically "You need to study Number Theory for years and years to understand the complexity behind why the test works".

Okay, so that's my tongue-in-cheek summarization, but the thread did get a little heated.

I've done a little work with the Lucas-Lehmer sequence, and have found some surprising relationships to Quadratic Residues. Of course, without the years and years of Number Theory studies, I can't come up with a proof, so I'll never get my name on it. ;-)

Basically, it comes down to the fact that all terms of the Lucas-Lehmer sequence modulo a Mersenne number (Mp = 2^p - 1) must be a quadratic residue of that Mersenne number for it to be a Mersenne Prime. If you hit a term in the LL sequence that is not a QR of Mp, then Mp is composite.

Note: I'll qualify by saying that you need to verify that +/- the LL term must be a QR, because of one of those weird Number Theory things. For example, term 2 of the LL modulo 127 is 67. However, 67 is not a QR of 127. But, 127 - 67 = 60, which is a QR, so the test still passes.

So, here appears to be a necessary condition for primality. But that still does not answer the question of "why".

Well, this is where Number Fields come in handy. I'm no expert on fields, but you don't need to be in order to see how a field behaves.

Quadratic residues of a Mersenne Prime form a field of numbers with exactly (2^(p-1) - 1) elements. Each of these elements, when squared (mod Mp) results in another number in the field. This leads to a beautiful cyclical sub-field of exactly p-1 elements (meaning that the subfield starts to repeat itself every p element).

Here is an example of that sub-field effect starting with 44 modulo 127:

44	31	72	104	21	60	44
31 = 44^2 mod 127; 72 = 31^2 mod 127; etc

This behavior does not always exist with composite numbers, because the prime factors of those numbers somehow interfere with the field's behavior (during the modulo operation, I would guess). You end up with something like the fields for each prime factor overlapping, which distorts the results.

For example, here's two subfields modulo 2047 (a Mersenne composite = 23*89). Each starting number is a QR of 2047, but :
64	2	4	16	256	32	1024	512	128	8	64

36 1296 1076 1221 625 1695 1084 78 1990 1202 1669

Notice that 64's subfield correctly "wraps around" after 11 iterations, but 36 fails to. This shows that some subfields are cyclical, while others aren't (because of that interference effect).

When we continue squaring the subfield modulo 2047, we see that we actually jump into another cyclical subfield of the proper length:


36	1296	1076	1221	625	1695	1084	78	1990	1202	1669	1641	1076
In this case, both 1296 and 1641 are modular square roots of 1076, but the subfield containing 1296 actually turns into the subfield containing 1641. The fact that there are two roots for a QR is not unusual, but these numbers are not +/- the same number, as the roots of a prime's QR would be. The overall result is that the field containing all QR's of a Mersenne composite turns out to contain less than 2^(p-1) - 1 elements. (In this example, think because 36 did not have it's own 11 numbers, it only added 2 numbers to the total field).

So, the LL sequence is related to the same mechanism that causes the beautiful cyclical patterns of the quadratic residue subfields. These patterns only exist modulo prime numbers. Composite numbers cause one subfield to change into another. This same mechanism leads to the LL sequence to fail for composite numbers.

And, of course, I don't have any further explaination for this phenomenon, so you'll need to study Number Theory for a while. ;-)

For reference, here is a breakout for M7 (127 = 2^7 - 1). The field of QR's shown are x^2 % Mp, and are Quadratic Residues because they have modulo square roots (x).

Mp	LL	-LL	x	QR	x	QR

127 4 123 1 1 33 73
14 113 2 4 34 13
67 60 3 9 35 82
42 85 4 16 36 26
111 16 5 25 37 99
--> 0 127 6 36 38 47
125 2 7 49 39 124
2 125 8 64 40 76
2 125 9 81 41 30
2 125 10 100 42 113
2 125 11 121 43 71
2 125 12 17 44 31
2 125 13 42 45 120
2 125 14 69 46 84
2 125 15 98 47 50
16 2 48 18
17 35 49 115
18 70 50 87
19 107 51 61
20 19 52 37
21 60 53 15
22 103 54 122
23 21 55 104
24 68 56 88
25 117 57 74
26 41 58 62
27 94 59 52
28 22 60 44
29 79 61 38
30 11 62 34
31 72 63 32
32 8

Thursday, December 30, 2004

Possible new Mersenne Prime found?

Some guy posted with an Italian email address asking what he should do about his copy of Prime95 beeping and flashing at him. This is something that Prime95 will do if it finds an exponent "p" that passes the Lucas-Lehmer test (indicating that 2^p-1 is prime).

George hasn't heard from him since that posting, so it very well could be a prank or a known bug with small exponents. It would probably be easy enough for George to check which exponent was assigned to his client (since he has already matched the email address to a PrimeNet user), and start the verification process on that exponent.

The last Mersenne prime was discovered in May 2004, and the one before that in November of 2003. These numbers have no practical use, other than perhaps for random number generators. The ones being found today are millions of digits long.

Interesting FFT Explanation

I found a link to this person's web page where FFT Multiplication is demonstrated using an Excel spreadsheet.

http://www.gweep.net/%7Eshifty/portfolio/fftmulspreadsheet/index.html

Tuesday, December 14, 2004

Comet Machholz

There's a comet in the sky that is brightening, and will continue to do so through January. Currently located near the feet of Orion, it is a Magnitude 5 object, just visible to the naked eye. At its brightest, it's expected to be around a Magnitude 4 object.

http://www.spaceweather.com/comets/machholz/11dec04/Westlake2.jpg

http://www.spaceweather.com/images2004/13dec04/skymap_north.gif

http://cfa-www.harvard.edu/iau/Ephemerides/Comets/2004Q2_1.html

Comets are amazing sights to see. I missed Halley's back in '86, but I sure took in Hale-Bopp in '97. Machholz is not going to be nearly as spectacular, but it will be worth looking for in January to say the least, if only to say that you were able to pick it out of the sea of background stars.

Thursday, December 09, 2004

Kerry Absent More Than Not

Ok, I know that Senator Kerry was campaigning for presidency, which required him to be away from the Senate floor more often than not over the past year, but where I'm going to have a problem is if he receives his full salary for 2004. The law states that if a Senator is not present when Congress is in session, and he is not sick, then pay shall be deducted.

http://www.talonnews.com/news/2004/june/0617_kerry_preempt_ethics.shtml

I, for one, will be interested in seeing his tax filings for 2004 when he releases them in a few months. Same for Edwards and anyone else who had any absenses from Congress.

This isn't about the Presidential Election.... This is about holding our lawmakers fiscally responsible. These are the same people who can give themselves a pay raise while the rest of the country is working on frozen salaries.

Thursday, December 02, 2004

GBPVR: First Thoughts

Despite having developed for the GB-PVR platform, I don't actually have a HTPC running yet. Well, I don't have a complete one running with a remote control, etc.

I currently have a P3-800 box with 256MB and about 60GB of combined HDD space. It has a SB-16 sound card, and a WinTV PVR-150MCE capture card. Right now, there's a SIS AGP video card in there.

It took a little bit of trial and error to get GB-PVR to work on this interim setup. One lesson learned, and I'm not sure if it was made clear in the documentation or not (probably was, but I tend to skip over important details), is that you need a MPEG-2 decoding software (aka, a software DVD player that integrates with Media Player, etc) like WinDVD, etc. Or at least, GB-PVR started playing for me after I installed one.

In the current set up, I still have intermittent problems with live tv and watching video in GB-PVR, but scheduled recordings fire off without a hitch. I'm proud to report that I was able to record Ghost Hunters on SciFi last night during the busy Wednesday Night 9PM timeslot and play it back later (through Media Player, but it was still a great picture).

I'm sure my issues are related to the fact that Sub just put in support for the WinTV 150MCE, and probably issues related to the video card (it's not supported by Media Center, so it's going to get upgraded sometime). I won't rule out my software configuration either.


Annoying Website Feature

Here's something that annoys me, and I run into it using Blogger.com of all places:

Some sites take a while (meaning >1 second) to load, but the browser renders the page and its form elements while it's still loading. Then, there's a "onload" event handler for the body tag that sets the focus to a particular control.

That in itself is not the annoying part, but my bank and blogger.com both do this on the login screen.

So, what happens is that I type my username, hit Tab, and then start typing my password. Well, in the middle of the password, that "onload" handler fires off, moving the cursor back to the username box, and it usually ends up with the latter half of my password being typed in clear text within that username box.