Blog - Title

15 Apr 2004

  • Fabulous Adventures In Coding

    Writing Code On Whiteboards Is Hard

    • 87 Comments
    Work has been crazy lately and I haven't had much time to work on SimpleScript. It's a lot of work starting from scratch! Right now I'm writing a templatized hash table for the binders and other lookup tables. I haven't written templatized C++ for a loooong...
  • Fabulous Adventures In Coding

    When Are You Required To Set Objects To Nothing?

    • 52 Comments
    A quick follow up on my earlier entry on the semantics of Nothing in VBScript. I see code like this all the time: Function FrobTheBlob() Dim Frobber, Blob Set Frobber = CreateObject("BitBucket.Frobnicator") Set Blob = CreateObject("BitBucket.Blobnicator...
  • Fabulous Adventures In Coding

    Riddle me this, Google

    • 36 Comments
    One of the reasons why I do all this technical stuff in a blog is to leverage the power of search engines like Google. I wrote a program the other day to go through the referrer log and extract all the Google queries that sent people to my page, and I...
  • Fabulous Adventures In Coding

    The Stygian Depths Of Hacked-Together Scripts

    • 30 Comments
    Last time on FABULOUS ADVENTURES: Eric Lippert: The second term is asymptotically insignificant compared to the first, so we'll throw it away, and declare that any sort on a list of n items has at least a worst case of O(n log n) comparisons. Leo...
  • Fabulous Adventures In Coding

    Aargh, Part Five: Comment Rot

    • 24 Comments
    Gripe #6: Comment Rot If you've been reading my SimpleScript code you might have noticed that there are very few comments in my code. That's deliberate. Why do we have comments in the first place? We have comments because sometimes the semantics...
  • Fabulous Adventures In Coding

    SimpleScript Part Six: Threading Technicalities

    • 20 Comments
    Refresher Course Before you read this, you might want to take a quick refresher on my original posting on the script engine threading model. That was a somewhat simplified (!) description of the actual script engine contract. Let me just sum...
  • Fabulous Adventures In Coding

    SimpleScript Part Seven: Binder Skeleton

    • 17 Comments
    In Part Five I was discussing modules: there is a "global module" and any number of additional modules. Each module is associated with a named item, and the only module which is associated with more than one named item is the global module. This means...
  • Fabulous Adventures In Coding

    Aaargh, Part Six: One More Thing About Comments

    • 16 Comments
    Gripe #7: Use The Right Struct For The Job I meant to include this one in yesterday's gripe about comments, as this illustrates a time when I found a comment that should never have been there. The person who wrote the comment should have realized that...
  • Fabulous Adventures In Coding

    SimpleScript Part Five: Named Items and Modules

    • 16 Comments
    Named Items "Named items" are what we call the "top level" objects of the host provided object model. WScript in WSH, window in Internet Explorer, Response in ASP, are all named items. A host tells an initialized script engine about named items...
  • Fabulous Adventures In Coding

    Some LΘ℃αℓization Questions

    • 15 Comments
    A reader asked me a few questions about localization the other day. That's not a subject that I have a lot of experience on, but I can speak to it a bit. (I know that I've seen a blog from a Microsoft localization PM somewhere in the last six months,...
  • Fabulous Adventures In Coding

    You Are Thrilled To Read Today's Blog Entry

    • 13 Comments
    No tech today. Too busy. But this was too precious to pass up: The Greenlake neighbourhood in the north end of Seattle does something really cool; they have one weekend in April that everybody knows is "the garage sale weekend". Everyone who...
  • Fabulous Adventures In Coding

    The Rarefied Heights of Mathematical Purity

    • 11 Comments
    A number of people have asked me for the software I used yesterday to extract the Google queries from the .TEXT referrer log. Have patience, and all will be revealed. In this and the next blog entries I'm going to demonstrate the difference between...
  • Fabulous Adventures In Coding

    Dude, Where's My Asymptotic Order Analysis?

    • 4 Comments
    "There is something missing from this analysis. Saying that this is an O(n) algorithm perhaps isn't quite the whole story. What did I leave out? That line in yesterday's post generated lots of good commentary. Several people mentioned some...
  • Fabulous Adventures In Coding

    nameditemlist.cpp

    • 2 Comments
    #include "headers.h" NamedItemList::NamedItemList() { this->m_cBuckets = 0; this->m_Buckets = NULL; this->m_pMutex = NULL; } NamedItemList::~NamedItemList() { this->Clear(); if (NULL != this->m_Buckets) delete[] this->m_Buckets;...
  • Fabulous Adventures In Coding

    Runtime Typing in VBScript

    • 1 Comments
    A few short takes today: SimpleScript I wrote the name table logic over the weekend but it is not ready to post yet. For those of you following the conversation in yesterday's comments about whether I should use standard templates...
  • Fabulous Adventures In Coding

    binder.cpp

    • 1 Comments
    #include "headers.h" Binder::Binder() { DLLAddRef(); this->m_cref = 1; this->m_thread = GetCurrentThreadId(); } Binder::~Binder(void) { DLLRelease(); } HRESULT Binder::Create(Binder * * ppBinder) { AssertOutPtr(ppBinder); *ppBinder ...
  • Fabulous Adventures In Coding

    binder.h

    • 0 Comments
    #ifndef BINDER_H // { #define BINDER_H class Binder : public IDispatch { protected: class Name { public: Name(); ~Name(); HRESULT SetValue(VARIANTARG * pvar); HRESULT GetValue(VARIANT * pvar); BOOL IsFunction(void); HRESULT ExecuteFunction...
  • Fabulous Adventures In Coding

    invoke.cpp

    • 0 Comments
    #include "headers.h" HRESULT InvokeDispatch(IDispatch * pdisp, DISPID dispid, REFIID riid, LCID lcid, WORD flags, DISPPARAMS * pDispParams, VARIANT * pvarResult, EXCEPINFO * pExcepInfo, UINT * pError) { AssertReadPtr(pdisp); HRESULT hr; // We...
  • Fabulous Adventures In Coding

    invoke.h

    • 0 Comments
    #ifndef INVOKE_H // { #define INVOKE_H extern HRESULT InvokeDispatch(IDispatch * pdisp, DISPID dispid, REFIID riid, LCID lcid, WORD flags, DISPPARAMS * pDispParams, VARIANT * pvarResult, EXCEPINFO * pExcepInfo, UINT * pError); extern BOOL IsValidDispatch...
  • Fabulous Adventures In Coding

    hash.cpp

    • 0 Comments
    #include "headers.h" ULONG ComputeHash(const WCHAR * psz) { AssertReadString(psz); ULONG hash = 0; while (*psz != '\0') { hash = 17 * hash + *psz; ++psz; } return hash; }
  • Fabulous Adventures In Coding

    hash.h

    • 0 Comments
    #ifndef HASH_H // { #define HASH_H extern ULONG ComputeHash(const WCHAR * psz); #endif // HASH_H }
  • Fabulous Adventures In Coding

    mutex.cpp

    • 0 Comments
    #include "headers.h" Mutex::Mutex() { m_fInitialized = FALSE; } HRESULT Mutex::Create(Mutex * * ppMutex) { AssertOutPtr(ppMutex); HRESULT hr; BOOL fSuccess; DWORD error; Mutex * pMutex = NULL; pMutex = new Mutex(); if (NULL == pMutex) { hr...
  • Fabulous Adventures In Coding

    mutex.h

    • 0 Comments
    #ifndef MUTEX_H // { #define MUTEX_H class Mutex { private: CRITICAL_SECTION m_criticalsection; BOOL m_fInitialized; Mutex(); public: static HRESULT Create(Mutex * * ppMutex); ~Mutex(); void Enter(void); void Leave(void); }; #endif ...
  • Fabulous Adventures In Coding

    nameditemlist.h

    • 0 Comments
    #ifndef NAMEDITEMLIST_H // { #define NAMEDITEMLIST_H class NamedItemList { private: class NamedItem { private: NamedItem(); public: ~NamedItem(); static HRESULT Create(const WCHAR * pszName, NamedItem * * ppNamedItem); NamedItem * m_pNext;...
Page 1 of 1 (24 items)