About/Contact

Steve Trefethen

Steve Trefethen is CTO at Wanderful Media.
Contact me

View my LinkedIn profile



Calendar

<<  June 2013  >>
MoTuWeThFrSaSu
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

View posts in large calendar

Disclaimer

The posts on this weblog are provided AS IS with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.



Delphi IDE Wisdom

June 27 2007 7:00AM

It's Wednesday so here's my list for the Delphi IDE:

  • Learn the difference between design-time and run-time packages
  • Use incremental search
  • Learn to create/install/deploy your own components
  • Learn to build your project from the command line
  • Use View as Text
  • Learn to import a type library, from the command line
  • Use the History tab
  • Learn to partition your application to use packages
  • Use a debug desktop
  • Use "Automatically close on successful compile"
  • Learn to use the call stack
  • Learn to use the thread view
  • Learn to step in the CPU view
  • Use conditional breakpoints
  • Use the ExtraUnits registry key
  • Watch my video
  • Watch Nick's videos
  • Use component palette filtering
  • Learn all the shortcuts for your keybinding
  • Use selective symbol table loading to debug large packaged applications
  • Don't ignore hints and warnings
  • Use Syntax Check

My Other Lists
Delphi RTL and Language Wisdom
Delphi VCL Wisdom

What's your IDE list look like?

FacebookDel.icio.usDigg It!

Tags:

Using Google Maps from VCL sample application

June 26 2007 10:07PM
VCL application using Google Maps
As promised, I finally got a chance to clean up the code and wrap up a nice little example of calling into and out of the WebBrowser control hosted in a VCL application. The code is available here. Be sure to read this post as well as this post for additional details. If you find this of interest you'll also want to check out this post from Allen Bauer as well as this post from Marco Cantu.

The source code of this example uses the same Automation.pas unit that Allen distributed with his code.

Enjoy!

[UPDATE: April 25, 2008] Related posts:

FacebookDel.icio.usDigg It!

Tags:

Delphi RTL and Language Wisdom

June 26 2007 4:34PM

It's Tuesday and following up my VCL list from yesterday, here my list for the RTL and Object Pascal language:

  • Learn to create your own TList descendants
  • Learn to write your own TCollection/TCollectionItem descendants
  • Use Format
  • Learn TThread then, understand TThread.Synchronize
  • Use TFileStream, TStringStream, TMemoryStream
  • Learn how to use the classes in SyncObjs.pas
  • Learn to call a function from a dynamically loaded DLL
  • Use exceptions
  • Learn when to use stdcall
  • Learn to use open array parameters
  • Use the *utils.pas units, DateUtils, StrUtils, MaskUtils, ConvUtils, VarUtils etc.
  • Learn the Math unit
  • Use SafeMM
  • Learn which exceptions the RTL throws
  • Use try...finally
  • Read the comments in SysUtils.pas
  • Call FindClose after calling FindFirst
  • Learn how to load packages dynamically
  • Use FindCmdLineSwitch
  • Just because it's not in Windows.pas doesn't mean it can't be called from Delphi
  • Learn function inlining
  • Be careful using "with"
  • Learn to use interfaces
  • Use dynamic arrays
  • Read the Language Reference manual
What am I missing?
FacebookDel.icio.usDigg It!

Tags:

Delphi VCL wisdom

June 26 2007 5:18AM

I thought it might be fun as I wind down my last week at CodeGear to post a few $l(Baz Luhrmann)-esque lists on various Delphi product areas. So here's the first list relating to VCL:

  • Learn to use Actions then, learn to write action descendents
  • Learn how to create controls dynamically
  • Learn the difference/relationship between Parent and Owner
  • Learn how to handle a Windows messages
  • Learn how to use the OnCreateXXX methods in ComCtrls.pas
  • Use TCustomTreeView.ChangeDelay
  • Use TTreeNode.Data, TListItem.Data, TStringList.Objects
  • Learn how to use TMenuItems dynamically
  • Use Visual Form Inheritance
  • Use a custom icon for your application
  • Learn TScreen, TMonitor, TMouse, TClipboard
  • Use TApplicationEvents
  • Learn to use Align = alCustom
  • Learn when to override CreateParams
  • Learn when to use DoubleBuffered
  • Use frames
  • Learn to use packages

So, perhaps this can spread this through the Delphi blogsphere. If your a Delphi blogger let's see your list.

FacebookDel.icio.usDigg It!

Tags:

A Windows Tray problem that drives me nuts

June 19 2007 4:40PM
Giant Cypress DX comfort bike

Windows tray bug
(overlapping menus)

One bug in Windows that's been there entirely too long is right clicking icons in the Windows tray (pictured) where the popup menus overlap. The tray poses it's own unique set of challenges with various tricks you can employ but this overlapping problem is really annoying.

Of course, Raymond Chen has blogged a number of times about tray related things so be sure to check them out if you're application uses the tray though I'm not sure there is a cure for this particular problem. Anyone?

FacebookDel.icio.usDigg It!

Tags:

Round II with the &quot;other&quot; Steve T.

June 11 2007 8:57PM
Steve Teixeira, Product Manager for Visual C++, has replied to my expansion of the API war post with some good insights about some of the issues I raised. First, I'd like to say thanks to Steve for the thoughtful response. I enjoy reading his blog, if you haven't checked it out at least read this post you're sure to get a good laugh from it, I certainly did.

Anyway, I'd like to respond to a few of his comments. Regarding transparency and the comparison with Google he said:

The comparison with Google is also interesting because Google customers have clearly been very happy to use services that Google has deemed beta quality (Gmail, Maps, Toolbar, etc.). Given the way folks are voting with their feet in favor of these things, a reasonable person could conclude that customers often find value in software even if it's not considered "RTM quality."

I think there is a huge difference between a service like GMail or Maps etc. and a multi-gigabyte CTP download which includes forewarnings regarding the potential nastiness non-RTM software could unleash on your machine. In the former if the software fails it means my mail didn't go through or got lost but in the latter it means I may have to reinstall my OS to regain the stability of my machine. Recently, Microsoft has been getting around that issue by leveraging Virtual PC images which is a good idea but what if I want/need several CTP's or what if my machine can't running a VM?

Nobody ever said that all things .NET were constrained. The referenced quote was making a point that it's a great deal of work to build WPF-quality user interfaces with straight Win32 because Win32's GDI is old and crufty. Of course you can build the Office ribbon and cool looking Vista apps in straight Win32, but the point is that it requires more effort than some of the alternatives.

I suppose I could understand if we were talking about a theoretical UI that didn't already exist but that's just it, Microsoft has already done the leg work on this one but can't share it because of competitive pressures (read Open Office) and perhaps more relevant to developers, the appearance that the "crufty" Win32 API hasn't actually run out of legs.

My guess is that the about face of Microsoft's C++ strategy is a mea culpa a la IE7. It seems clear that the C++/Win32 side of things were being ignored which is really the only plausible excuse for absolutely no Vista support for native development unless of course you look elsewhere.

Regarding my comment on Windows development undoubtedly meaning a move to .NET he said:

No way, Jose! In fact, the Visual C++ team's primary focus is on the native Windows platform. We have some very aggressive post-Orcas plans for advancing the state of the art of native development.

While I think there will be a Windows C++ native market for a very, very long time I also see the interop strategy as one of many steps that will be taken to move all but essential native development to .NET. Regarding the "post-Orcas" plans when exactly is that? It seems that's an awful long ways away considering Orcas is due out late this year. I imagine the field will change quite a bit by then so it will be interesting to see where this all ends up.

More seriously, my view on this is that the day has long passed where it is practical to keep up with every developer technology coming out of Microsoft. Ten years ago, it was totally doable and expected that any "real" developer was totally on top of all of the new stuff coming out of Microsoft.

While I agree with Steve truth be told the major area I'm really trying to keep pace with Microsoft's web development which to me includes:

  • IIS 6/7
  • C#/LINQ (and language C# enhancements in general)
  • ASP.NET
  • SQL 2005
  • Microsoft AJAX (aka, Atlas)
  • Microsoft AJAX controls
  • Silverlight (both beta 1 and now an alpha)
  • SharePoint
  • Microsoft Patterns & Practices
  • Script#
  • Windows Live services

One problem I've been running into, when I'm learning one of these new technologies, is that the web is becoming littered with example code based on CTP bits that, while some still work are completely out of date. Like this ASP.NET Atlas example from ScottGu (btw, impressive guy). The example still works and much of the information is relevant but the code, while similar, is out of date with the RTM bits from January '07. I suppose it might be a good idea to clearly label CTP versions for a given blog post though that could get a little crazy.

That said, I'm not going to hand-wave away the fact that there are areas where would do have overlap or should better aligned or must be better at messaging when and where to use what technology. And we also need to better align platform and tools releases. All of these things are true. But I don't believe it should be a fundamental goal to homogenize our platforms and APIs before letting anything out the door.

I'm glad to see agreement on and acknowledgement there is too much confusion. Hopefully, there will be some brainstorming around how to deliver so much technology in a more organized fashion sort of like session tracks at a conference. Btw, I not asking for homogenization though it would be good for Microsoft to "dogfood" the external developer experience to better understand the maze of CTP software that's currently available.

I think that about wraps it up. I'd like to thank Steve for taking the time to respond and Steve, if/when you get back to the bay area I'd love to hook up and rap about this and the ole' days over a beer, my treat. If I happen to make it up you way don't be surprised to hear from me!
FacebookDel.icio.usDigg It!

Tags:

Developing Facebook applications in C# with ASP.NET

June 10 2007 9:04AM

Updated VS.NET 2010 Facebook Starter Kit

I mentioned previously I've created my first Facebook (FB) application (which is still under development) but I've learned a lot along the way. I haven't found the Facebook documentation very useful at all and have gleened a lot through Google, the Facebook developer group and simply tinkering with things. As a result I've put together some steps I think could help save you some time if you're looking to write a Facebook application using ASP.NET and C#. Btw, you'll get no help from facebook.com regarding ASP.NET development.

One thing that took me awhile was understanding how an FB application appears on your profile page. I eventually realized that FBML can be used to push markup onto a users profile page. This block of markup can be set at the time you create a new application though the first time around, if you're like me, this may see a bit confusing keep in mind I'm new new to FB itself so a lot of this was confusing. From the FB toolkit you can also use the method setFBML to programmatically set this block of markup. Needless, to say being used to MSDN documentation FB doc leaves a lot to be desired. That said there are a few tools you can use to play with the API as well as sample your FBML markup.

Facebook start app screenshot

At any rate, here are the steps I followed to get my application working. Note, the project includes support for Microsoft AJAX so you'll want to have that installed as well although you could just tweak the .aspx and web.config files and use it without AJAX. The screenshot illustrates what you should get when your done. NOTE: In the following steps several links won't work unless you have an FB account.

UPDATE: I've created a new page on my wiki with updated steps and a VS.NET starter kit to make this much easier.

  1. Sign up for a Facebook account
  2. Add the Developer application to your account (you need an account for that link to work)
  3. Click Developer application from the left column and select click Set Up New Application
  4. Enter the Application Name and expand Optional Fields
  5. Under Optional Fields
    1. Set your callback URL http://localhost... will work just fine for development
    2. Select "Use iframe"
    3. Click Yes for "Can your application be added on FaceBook"
  6. Under Installation Options
    1. Check "Developer Mode"
    2. Under Site Nav use the same URL from Canvas Page URL (see Optional Fields)
    3. If you use my template set Edit URL to your Canvas Page URL + /settings
  7. Click Save then from the Developers Application browse to My Applications
  8. Click View About Page then click Add Application. This will allow you to easily work with your application during development.
  9. Download the Facebook Developer Toolkit from Microsoft
  10. Download my C# ASP.NET app to get you started or generate the boilerplate code for handling login (sorry I don't do VB.NET)
  11. You'll need to add a reference to the Facebook assemby to this project as I didn't want to include it as it being updated frequently right now
  12. Open Default.aspx.cs and fill in FACEBOOK_APPKEY and FACEBOOK_SECRET from your application's page on Facebook.
  13. Fire up the browser and hit your http://apps.facebook.com/<your_app_name> and you're off!

Please let me know what problems you have or let me know if these steps need tweaking.

Was this helpful?

[Updated: June 11, 2007] Added link to an update page on my wiki with this content.

[Updated: Feb. 24, 2008] Since this post was written I've created two VS.NET starter kits, one for Facebook Dev Toolkit and Facebook.NET. Here are some additional links:

FacebookDel.icio.usDigg It!