I acquire consistently admired to assay adapted brands of swiss fake watches affluence watches. If comparing the above brand, there are replica watches uk not abounding differences you can accretion distant from the above of replica rolex uk the replica. You can accretion some of the best Patek Philippe replica watches and acquire abolishment to rolex replica say added than your architectonics or you could accretion bigger above and a lower replica hublot watches casting and achieve your best easier.

2007 September — Visual Basic Feng Shui

Monthly Archives: September 2007

Offline Web Apps

1
Filed under Uncategorized

Jim Rapoza writes an interesting article in the latest eWeek about the 5 things that Web 2.0 apps need to recognize to be successful. It’s called IT Planner – 5 Steps to Next Generation Web Apps

  • Build Rich web apps. Ok pretty general, but a good start, I suppose
  • Remain “Open” minded. Open with your data, open to open-source, etc 
  • Keep Data Dynamic. Basically, allow users to play with it locally instead of only processing on the server. Sounds good, if not a bit like the “open minded” idea above. 
  • Make it available offline. Sure.
  • Be Flexible. Allow your app to be “molded” which ever way a user might like. Interesting idea. Basically, “make it configurable, and easy to import and export data”. Hmm, sounds a lot like the 2′nd item also.

All pretty good ideas for…..wait…..what was that? “Available offline”?

Huh? A web app available for offline use. Why, that’s just scandalous. Not too mention soooo last decade.

So. If I’m to understand this properly, one of the next great things in web applications is…. drum roll…. the traditional fat client desktop app.

And the circle remains unbroken. <Sigh>

Syntactic Sugar

5
Filed under .NET, Rants, VB Feng Shui

What’s with this?

I’ve seen this term bandied about, usually referring to some new feature in VB, and usually in a disparaging way.

Why?

I thought pretty much everything about a 3 or 4GL was syntactic sugar. Without that sugar, we’d be coding in assembler or hex opcodes. I mean, an IF THEN ELSE construct is just syntactic sugar for a bunch of JNEs or JEQs, right? Hell, object oriented code is nothing but syntactic sugar for an array of type structures and function calls with an index as their first argument (the hidden ME pointer in all OO compiler code).

Sounds more like just so much L337ism to me.

I say bring it on. As long as it makes sense, expands the language in useful ways, and isn’t required to make use of the language, the more the merrier. My only concerns would be:

  • Any additional syntax that’s required in order to successfully use the language. That’s VB.NET’s biggest problem now, with respect to adoption by users of VB.
  • Compatibility breaking changes

Still, I think ANDALSO is a tad corny, nice, but corny. So shoot me.

Apophysis Tutorials

0
Filed under Apophysis

The Apophysis Wiki at Wikispaces.com has an excellent page devoted to tutorial resources that are available in different places.

Most are good, a few are excellent, especially:

These are all great techniques that are guaranteed to waste piles of your time, if you’re into this sort of thing!

KB938194, Beware!

2
Filed under Troubleshooting, Vista

This Vista Update, delivered 9/4/07 at about 3am (for one machine, anyways) has some serious issues, so beware.

Now, when I load Word 2007, if I immediately quit Word, it crashes. And if I attempt to load a document by dbl clicking on it, Word fails to load the document completely, just opens an empty window. Even odder though, is that I have a different machine that I pulled the update earlier for (it’s set to manual update) and it’s fine.

The only difference between the two that I can see, is that on the failed machine, Word was OPEN at the time of the upgrade.

Even worse, UNDOING the Patch caused the machine to fail to boot. It would start to boot up, then just shut down.

I had to use the “Boot to last known valid configuration” option, then use the System Restore Point function to rewind back to before the 3am patch.

Once I’d done that, everything ran fine again.

Ah the joys of automated updates.

Native or Psuedo-Code VB6?

2
Filed under Code Garage, VB Feng Shui

VB6 has the interesting capacity to compile to either native code or pseudo-code.

Native code is actual Intel machine code. Pseudo-Code is much like the .NET “Intermediate Language” or IL, although, I suspect, a little less refined<G>

Most VB6 programmers I’ve known tend to compile to Native code although pseudo-code can be quite handy in some circumstances. First, it compiles much faster. Second, the generated EXE’s or DLL’s are typically much smaller than Native code EXE’s or DLL’s.

But what if you want, or need, to tell the difference at run time?

You could write up a conditionally compiled constant, but then you have to remember to switch the condition when appropriate. Still, that’s probably the ideal way to go.

But, that’s not really  a runtime solution, now, is it.

I happened upon the solution ages ago when I was researching an article I wrote for VBPJ about implementing TRY CATCH exceptions in VB6.

Essentially, you grab the first byte pointed to by a function pointer and check it. If it’s an &HA1, you’re in the IDE running pseudo-code.

If it’s &HBA, you’re running as compiled pseudo-code.

Anything else means you’re running compiled native code.

As far as I can tell, this technique works regardless of optimization settings, etc.

Yeah, it’s probably a little overkill, but that’s what hacking is all about. Plus, knowing whether you’re in the IDE without scrambling the state of the ERR variable is quite handy in some circumstances. I created a separate function for that purpose.

Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long)

Private Function pGetAddr(addr As Long) As Long
   '---- utility function for IsNative and IsIDE

   pGetAddr = addr
End Function

Public Function IsNative() As Boolean
   '---- determine whether we're running
   '     a Native code EXE, or a PsuedoCode exe
   '     Also can determine whether we're in
   '     IDE or not
   '
   '     Now this is HardCode!
   '
   Static Inited As Boolean
   Static bIsNative As Boolean
   Dim b As Byte

   If Not Inited Then
      CopyMemory b, ByVal pGetAddr(AddressOf pGetAddr), 1
      Select Case b
         Case &HA1
            '---- In IDE
            bIsNative = False
         Case &HBA
            '---- Psuedocode compiled
            bIsNative = False
         Case Else
            '---- native code Compiled
            '     the actual byte might be any number of things
            '     because of optimizations in use
            '     but will generally be either &H55, &HC7 or &H83
            bIsNative = True
      End Select
   End If
   IsNative = bIsNative
End Function

Public Function IsIDE() As Boolean
   '---- determine if we're running in environment
   Static Inited As Boolean
   Static bIsIDE As Boolean
   Dim b As Byte

   If Not Inited Then
      CopyMemory b, ByVal pGetAddr(AddressOf pGetAddr), 1
      '---- &HA1 means we're in the IDE, else we're not
      bIsIDE = (b = &HA1)
   End If
   IsIDE = bIsIDE
End Function

Stuff you didn’t know you had

0
Filed under Uncategorized

When I switched to Vista, at least one of the pieces of software I used occasionally got fragged, ReadIris OCR.

It was the free one that came with my OfficeJet G85, but hey, it worked quite well for what I needed, when I’ve needed it.

Anyway, it sort of installs under Vista but then complains about not being able to load FMTSAM.DLL and barfs. And they don’t even give you a proper uninstall for that package. Gah!

So after hacking through Borneo the registry and Program Files to remove the aborted ReadIris install, I went looking for OCR packages, and came across a mention of Microsoft Office Document Imaging.

Sure enough, this is a little “Office Tool” that was bundled beginning with Office 2003, so you very well might already have it on your machine.

It does several things, but the most interesting for me (at least right now), is the OCR capability.

Point it at a multi-page TIFF file (yes, it only recognizes TIFF files, and same wacky proprietary MS format), click the “Send to Word” button and presto-chango, you have text from an image (or scan or whatever).

What, you say, you don’t have your stuff in TIFF format?

Load up Word, paste your images in, select Print and choose the Microsoft Document Office Image Writer printer (at least, in Word 2007, not sure about 2003 for this one):

image 

It’ll generate a multi-page TIFF file as the printout of your document, that you can feed directly into Document Imaging.

And the best part, it seems to actually to a decent OCR.

Colonel Sanders and Willie Nelson’s Love Child a Geek Demigod

0
Filed under Uncategorized

I’ve got nothing but love and respect for Whitfield Diffie, and I’ve known the name for ages (after all, you don’t invent public key encryption and NOT become famous in geek circles)!

There’s a short interview with him in the latest ComputerWorld, and now, I gotta say, I have even more respect for the guy.

He’s a fellow at Sun, full-on genius, and pulls off the Colonel’s beard with a good ol’ Willie haircut.

image

Ya gotta respect that!

Office Desk

0
Filed under Uncategorized

I finally finished out my dream desk. Actually, I finished it out a while back, but just thought about posting here. Maybe it’ll inspire other cabinetry-hackers like myself.

I started with an electrically height-adjustable corner lab bench. Used office supply place, about 100$. This allows the entire desk to lift up to standing height, for those long conference calls where I have to walk around some.

Removed the top. It’s now a workbench in a corner of my dad’s shop.

Welded up a support frame from an old bed rail. You can see that in a pic of the underside of the finished desk here:

image

Built up the table top from 3/4″ MDF, oak baseboards, oak 1x4s and green/gold slate tiles. Here’s a pic of the MDF base, plus the border and edging. The tiles are set in the center area, about 1/4″ below the surface of the border boards. The notch is for the adjustable keyboard/mouse tray.

image

Biscuit joined oak 1x4s with pecan trim to make an adjustable keyboard tray. This was the mockup:

image

Filled the tile area with about 3 gallons of epoxy (to give it that super wet, super thick, bar countertop look, and to fill it up to the same level as the border). Stained everything a custom red mahogany.

And bolted it all together to get this (I left the keyboard in place to give a sense of scale, ignore the office, it’s in its normal state of disarray). The most nerve wracking part of the whole build was having the entire piece completely built, stained, with the tiles glued and mortared in place, and then mixing 3 gallons of epoxy to pour over it. Screw that up and the whole thing would have had to go on the trash.

image

This shot gives a little better look at the keyboard tray and overall desk, and it shows off the gloss of the epoxy top:

image

and this one shows off the tiles:

image

Now, granted, it’s not quite as cool as David Barry’s Tie Fighter Desk, but it works a little better for video conferences<g>

image

However, I don’t have drawers. Maybe I could do a Jawa Sandcrawler filing cabinet…

Any other cool/practical desk hacking out there?