As I'm sure you know, quantum tunneling involves a particle not impacting a barrier. One would expect that a particle hitting a barrier would bounce off, just like a baseball off a wall [I wanted to link that to a clip of The Great Escape with Hilts in his cell, but due to copyright enforcement the closest I can get is the final scene - SPOILER ALERT]. A curious thing can happen with individual particles in quantum mechanics, though. There's a probability, dependent upon the speed and mass of the particle and the thickness and other properties of the barrier, that the particle will tunnel through and appear on the other side. This has a number of absolutely cool applications: pressure sensors, a bunch of physics and semiconductor stuff, and of course the scanning tunneling microscope.
All this strikes me as similar to something else, though, and that is the errors in collision detection that some games have. I had a friend in high school that made an awesome QBasic platformer called Bouncy, which was just a bouncy ball that had to bounce around a screen to get to the exit. In some of the early versions, it was quite possible to get bouncing so fast that you'd run straight through the platform you were on and die. The probability of going through the platform was dependent upon your speed, the thickness of the platform, and the length of time between calculations. Sounds quite a lot like quantum tunneling! Which is why I think we're in The Matrix, and that our simulation needs to calculate things at a finer time resolution. Quantum mechanics is very probably just a programming error. Q.E.D.
Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts
Friday, October 15, 2010
Thursday, May 7, 2009
.NET Compilation for 64-bit Platform Support
At work, I was faced with a problem of a .NET program looking at the wrong registry values, and picking up the wrong machine.config. You see, a 32-bit application running on 64-bit Windows is supposed to be presented with its own 32-bit view of the machine, from registry entries to system DLLs. This is all pretty spectacular, which is why they call it WOW. For more information on WOW64, Wikipedia is your friend.
.NET is a bit tricky, though. By default, .NET applications are compiled with the /platform:anyCPU [MSDN /platform documentation]. This means they will run as 32-bit applications on 32-bit systems, and as 64-bit applications on 64-bit systems. When a .NET application is part of a larger system of applications, this can cause incompatibilities. All the regular C-compiled executables will run in 32-bit, but your .NET app will be interacting with the 64-bit environment and be out of sync.
To solve this, you can simply specify /platform:x86 when part of a 32-bit package, and /platform:x64 when part of a 64-bit package.
The next question is: How do I know if a .NET program was compiled with the /platform option specified as x86, x64, or anyCPU?
For regular applications, a Google search yielded the following blog post on using dumpbin to determine if it is a 32-bit or 64-bit application. For .NET applications, using dumpbin /HEADERS isn't quite enough. Programs compiled with the anyCPU option will still show up as:
14C machine (x86)
32 bit word machine
Dumpbin has other options, though, and /CLRHEADER comes to the rescue. For anyCPU applications, the relevant portion is:
1 flags
IL Only
x86 applications get:
B flags
IL Only
32-Bit Required
Dumpbin is a highly useful diagnostic tool, as I find out often.
Update: I just tried dumpbin on an /platform:x86 application running on 32-bit Windows, and the "flags" attribute had no lines beneath it, but it looks like the "1" vs "B" is still accurate. Perhaps this expansion is new in Visual Studio 2008's dumpbin.
.NET is a bit tricky, though. By default, .NET applications are compiled with the /platform:anyCPU [MSDN /platform documentation]. This means they will run as 32-bit applications on 32-bit systems, and as 64-bit applications on 64-bit systems. When a .NET application is part of a larger system of applications, this can cause incompatibilities. All the regular C-compiled executables will run in 32-bit, but your .NET app will be interacting with the 64-bit environment and be out of sync.
To solve this, you can simply specify /platform:x86 when part of a 32-bit package, and /platform:x64 when part of a 64-bit package.
The next question is: How do I know if a .NET program was compiled with the /platform option specified as x86, x64, or anyCPU?
For regular applications, a Google search yielded the following blog post on using dumpbin to determine if it is a 32-bit or 64-bit application. For .NET applications, using dumpbin /HEADERS isn't quite enough. Programs compiled with the anyCPU option will still show up as:
14C machine (x86)
32 bit word machine
Dumpbin has other options, though, and /CLRHEADER comes to the rescue. For anyCPU applications, the relevant portion is:
1 flags
IL Only
x86 applications get:
B flags
IL Only
32-Bit Required
Dumpbin is a highly useful diagnostic tool, as I find out often.
Update: I just tried dumpbin on an /platform:x86 application running on 32-bit Windows, and the "flags" attribute had no lines beneath it, but it looks like the "1" vs "B" is still accurate. Perhaps this expansion is new in Visual Studio 2008's dumpbin.
Wednesday, June 4, 2008
Microsoft Tech-Ed: Wednesday June 4
This morning, the bus line was extremely long - one of the cons of being the second hotel on the route. Breakfast's bacon was much better today, though, so I was quite happy with the morning.
My morning talk was on managed to native interop best practices, which turned out to be a slight waste of time. C++/CLI and COM interop don't really apply to my current programming tasks, so I plan on remembering the keywords to look up when/if I actually need them. I will continue to use PInvoke, is what it comes down to. The second talk on LINQ and VS2008 IDE tips and tricks (combined and how they relate) was an excellent session. The speaker was Amanda Silver, so if you ever have the chance to attend a presentation of hers, I highly recommend it.
Lunch was a bit on the mediocre side, but the baked macaroni and cheese was surprisingly good. The conversation was better, and just as informative for me as most of the talks here. Which brings me to a surprising fact: Attending conferences can be tiring, even when you're just sitting in rooms learning. I guess my brain is working harder than I think sometimes.
I missed the afternoon sessions in order to prepare a virtual machine for a DataDude talk on Friday morning. It is nice to see all my work over the past few months start to come together for something practical, even if it's just a presentation, rather than a functional product. But, at one point, the press releases seemed to indicate that I need to have something done by the end of the year, so we'll have to see what happens. My busy work schedule may continue for awhile...
Dinner this evening was at SeaWorld in one of the pavilions. It was a bit awkward at first, because there was a live band for background music and very few people. The food was nothing to write home about, but I guess I'm doing that anyway, in a way. We left dinner on the earlier side in order to enter the rest of the park. We saw the Shamu Rocks show, and a ski show, then walked around until the 10:00pm fireworks Mystify show. The word cheesy comes to mind. I was only there for a couple of hours, and I'm just glad that I didn't have to pay, and that I didn't have to be there longer. If there's one thing recently that would keep me from having kids, it's attending this amusement park. I do not look forward to having to be at one again, and keeping track of kids in that chaos can only make such an experience even more taxing. And you all should know by now how much I hate taxes.
Needless to say, I'm going straight to bed tonight.
My morning talk was on managed to native interop best practices, which turned out to be a slight waste of time. C++/CLI and COM interop don't really apply to my current programming tasks, so I plan on remembering the keywords to look up when/if I actually need them. I will continue to use PInvoke, is what it comes down to. The second talk on LINQ and VS2008 IDE tips and tricks (combined and how they relate) was an excellent session. The speaker was Amanda Silver, so if you ever have the chance to attend a presentation of hers, I highly recommend it.
Lunch was a bit on the mediocre side, but the baked macaroni and cheese was surprisingly good. The conversation was better, and just as informative for me as most of the talks here. Which brings me to a surprising fact: Attending conferences can be tiring, even when you're just sitting in rooms learning. I guess my brain is working harder than I think sometimes.
I missed the afternoon sessions in order to prepare a virtual machine for a DataDude talk on Friday morning. It is nice to see all my work over the past few months start to come together for something practical, even if it's just a presentation, rather than a functional product. But, at one point, the press releases seemed to indicate that I need to have something done by the end of the year, so we'll have to see what happens. My busy work schedule may continue for awhile...
Dinner this evening was at SeaWorld in one of the pavilions. It was a bit awkward at first, because there was a live band for background music and very few people. The food was nothing to write home about, but I guess I'm doing that anyway, in a way. We left dinner on the earlier side in order to enter the rest of the park. We saw the Shamu Rocks show, and a ski show, then walked around until the 10:00pm fireworks Mystify show. The word cheesy comes to mind. I was only there for a couple of hours, and I'm just glad that I didn't have to pay, and that I didn't have to be there longer. If there's one thing recently that would keep me from having kids, it's attending this amusement park. I do not look forward to having to be at one again, and keeping track of kids in that chaos can only make such an experience even more taxing. And you all should know by now how much I hate taxes.
Needless to say, I'm going straight to bed tonight.
Tuesday, June 3, 2008
Microsoft Tech-Ed: Tuesday June 3
The keynote presentation was fairly enjoyable. Bill Gates had a "last full day at Microsoft" video which had some funny appearances from multiple celebrities. The demonstrations were interesting enough, too. IBM made an appearance in one, and that can be read about on an MSDN blog: DataDude goes multi-platform. It was nice to see some of my work make an appearance in front of thousands of people, but even better was that the demonstration worked!
Anyway, breakfast was pretty decent. The bacon needed to be crisper in order to be really enjoyable, but luckily, I only grabbed 7 pieces. I spent the rest of the day attending talks on LINQ, data binding in Windows Presentation Framework, DataDude, and parallel programming.
Probably the coolest part of the day was the dinner/party thing for the various sponsors. There was good food all around the booths and most booths were giving away some cool stuff. I got 6 new t-shirts, so I don't have to go shopping for shirts this year, plus a key chain compass, a squishy basketball, a noisy monkey toy, a LINQ pocket reference book, and a slinky! Free stuff rocks!
Anyway, breakfast was pretty decent. The bacon needed to be crisper in order to be really enjoyable, but luckily, I only grabbed 7 pieces. I spent the rest of the day attending talks on LINQ, data binding in Windows Presentation Framework, DataDude, and parallel programming.
Probably the coolest part of the day was the dinner/party thing for the various sponsors. There was good food all around the booths and most booths were giving away some cool stuff. I got 6 new t-shirts, so I don't have to go shopping for shirts this year, plus a key chain compass, a squishy basketball, a noisy monkey toy, a LINQ pocket reference book, and a slinky! Free stuff rocks!
Labels:
Bill Gates,
DataDude,
demo,
food,
free stuff,
IBM,
keynote,
LINQ,
Microsoft,
presentation,
programming,
Tech-Ed,
work,
WPF
Subscribe to:
Posts (Atom)