Thursday, December 31, 2009

Xsd2Code - better than XSD

I've been working on a few ASP.Net projects and one of the key aspects of this project is creating some usable XSD schemas that are then translated into objects.

At first, I started using the regular xsd.exe that creates a class (in either VB or C#) from a schema with the simple statement.

xsd "myfile.xsd" /l:CS /o:"C:\MyOutput\" /c

But I always wanted to have this directly within Visual Studio. I'm sure there's another way (so please let me know) but then I found
Xsd2Code .net class generator3.0.

It does the same thing that XSD does but also lets you create add Serialize and DeSerialize options, making it easier to convert a basic XML file into an object.

var o = FormInstance.Deserialize(xml);

The best part is that it's a Visual Studio plug-in (from Codeplex of course), so you can right-click on an XSD file and have it generate the necessary code. By default, the Serialization methods aren't included - but it's an option right from the generate dialog, shown here.



Anyone know of other tools for this purpose?

Wednesday, December 30, 2009

Jun Tangunan's Nicely Designed Controls

Just because a lot of cool stuff exists in VFPX doesn't mean there are other sources for inspired design.Jun Tangunan has been showcasing a number of his creations on his Foxite site.

Following Craig Boyd's lead to create "good-looking" applications, Jun's collection currently includes:

- An awesome looking button class
- A custom TitleBar class
- A switchbox class
- A calendar sidebar class
- A non-ActiveX based Date Picker
Jun Tangunan : Presenting SSButton Class


I just wish Jun would put his goodies into VFPX so they can be packaged at some point.

Great work!

Thursday, December 17, 2009

One Great Resume

VisualCV is a great service for consultants and just about anyone who is looking at building the next generation of resumes. But they also have a great sense of humour. Take a look at this CV

Thursday, November 26, 2009

Tip: Add your application in Control Panel

Here's another Foxite goodie: Add your application in Control Panel

Of course, this works for any application, not just VFP apps - but if you've ever wondered about how to easily add your application to the Windows control panel, here you go.

I ran it with Windows 7 and it added it with only 3 security warnings.

Wednesday, November 11, 2009

Tom's Planner | Online Project Planning

I first read about this tool over on TechCrunch and noted it down. I just tried it and have to say "wow".

Project Management can be hard but this tool makes communicating it super easy. Even better, the project manager can publish it online (with password protection for easier review)

It's certainly not as powerful as MS Project but many times too much time is spent filling in details that are never used when the most important part of handling a project is communicating where it's at.

Project files are stored on your own computer so you still have control over them but you can publish it, export it as a Project file or even just as an image.

The file format is simply a text file with details (this might be the beginning of a nice open standard project format)

This is a great online tool to do just that.

Thank You



On every day, we are thankful for our freedom. Thank You. To all of the veterans, of every nation, everywhere, who have given us that freedom.

Sunday, November 01, 2009

Windows 7 - review for developers

(note: the title refers to a review for developers - this is not about how to develop specifically for Windows 7 but rather a review of Windows 7 from the point of a developer and how its changes may affect you.)

Ars Technica does a very detailed review of Windows 7, going through key features and also the left-over bits of Vista. I'm using Windows 7 and find when I move over to XP or even Windows 2003, I really miss many features and so definitely recommend upgrading but let's go through the details on the review.

I've been using Windows 7 on and off now in beta and in its public form for over a year. While I never could wrap my head and get totally into Vista (I typically used Windows 2003 as a workstation - but I had to install and remove it for Trish twice), my first impressions of Windows 7 were very positive. The way Microsoft has "fixed" UAC for security is HUGE and while I still get a few "Are you sure you want to" dialogs, it's far less frequent than in Vista and one of the main reasons, in my mind, for developers (and users) to upgrade.

For an end user, the review is good but software developers should really take note, as it delves into the new user interface guidelines (also available in PDF) and even points out how inconsistent some Windows 7 pieces can be.

One feature I love about Windows 7 is the new Snipping tool. Developers with Snag-It will scoff at its limited feature but it does make it much easier for grabbing screen shots for regular users, instead of the old Ctrl+Print screen. I use Jing a fair bit on non-Snag it machines and it has stopped working occasionally in Windows 7, making the tool that much more useful.

But let me address some of the review points head on:

Ars actually slams the Windows 7 UI on several points, many of which I agree with. It's very bizarre to switch between the new UI in the control panel and find that some elements conform to the new user interface whereas others go back to the old Windows-XP style dialogs. Hey, you can't redesign everything - but just it feels wrong, as though even a little change would have been more welcome.

Some quick examples can be easily seen in the Control Panel. The Power options look new and fresh:




While the system Properties looks like Windows XP:



So far, I see three different UI approaches going on : the new look (like the Power Settings), the old XP properties and then the hybrid MMC look, found in the Device Manager, etc. As I go through different aspects of the Windows 7 control panel for the first time, you never really know which one you're going to get. Granted, there are definite problems with the new approach for complex dialogs but even the basic experience just feels "confusing".

As Those who have read some of my Advisor articles know, I do enjoy the inductive approach to user interfaces (while others don't) so it's maddening to me that Microsoft is still going between the three choices. There are pros and cons to each - but choose one already.

But as a developer, I understand this. I'm converting over a legacy FoxPro app that started as a DOS app and I'm moving over the key pieces into a more current interface based on the functions users use. Sure, while VFP 9 can run backward-compatible so a DOS-based UI can be used, the switching between a new interface and the older one definitely shows inconsistencies in an application. (I'll post on this later as it's definitely an experience).

The new Taskbar
I first lamented the loss of the Quick Launch (you can still reactivate it if you really miss it) - but I'm finding between the Jump List and the ability to pin on demand, it's a very welcome replacement. The comment on Ars where "number of applications offering this level of integration is currently low" is really related to the right-click functionality. Any application that supports document opening from the Explorer immediately supports the Recent functionality, including Visual FoxPro. Of course, if you're constantly opening VCX and SCX files, it may not really help. I've been running Ubuntu on another machine and the Taskbar concept is fairly similar between the two, making it easier to switch back and forth.

What I'm finding very useful about the new task bar is the awareness of what apps I'm really using. I use Wakoopa to track what applications I use on a variety of machines but on my primary workstation, it has helped cement my regular tasks to the point where I don't use SlickRun half as much as I used to.

The Start menu itself also makes it easier to find those recent files. I don't have FoxIt Reader pinned to my task bar, even though I use it frequently for reading, but the ability to immediately see what I've recently opened is definitely welcomed.

That said, the other part of the new start menu, the Start Menu search, is still as unusable on my machine as under Vista. I know many people rave about how nice it is to find applications but on my laptop (a Toshiba Satellite L300 with 4 GB RAM), searching for a simple word like "Feed" or "Hand" takes an initial 3 seconds simply to get any results. I find other areas of the Windows Explorer UI just as sluggish.

Document Libraries
Windows 7 introduces the concept of Libraries which is a huge improvement over My Documents. Rather than forcing users to put files into My Documents, Libraries let you specify which folders you want to use for Documents, Video, Music, Pictures, etc.
So immediately, I add my own "Projects" folder to My Documents and ensure it is indexed so I can find them fairly quickly. You can also add network drives so it isn't just limited to your machine.

One thing to be aware of is that thumbnails seem to be gone and some of the previews don't show. The secret is that the default option under Advanced for viewing is "Always Show Images, not thumbnails" - who thought of that?

Search? What search.
The Windows 7 and Vista search suffer from the "Google" UI approach - a single box where you have to know what the modifiers are to make it useful (datemodified, size). I recall a post by yag, where he commented on how new interns follow that concept, just put a single search box and have it search everything. This sounds great in concept but in a real application where users are comfortable putting information into fields (like Date Started or Customer Name and Part Name), users almost always wanted the traditional search where you put details into what you wanted to search for. That's a generational difference for sure, but having to know the modifiers, yuck. I see some experienced computer users who still type text into the search box and then instead of just hitting enter, move their mouse over to the Search button to initiate the search.

A list of default search modifiers (or filters, as Microsoft calls them) is available here. They also work with Windows Desktop search in XP and Vista.

Developer hint: you can create your own filter handler tags - see the MSDN article here.

One issue I have with the Windows Library concept may be specific to my machine (but others might be experiencing it) is a lag that seems to occur when searching or loading a simple folder. Sometimes the folder automatically refreshes (like XP) when I drop a new file into it, but other times I have to hit F5 to refresh it. I suspect the problem is related to when in an actual folder vs. a "library", which is akin to a virtual folder.

Devices
Ars Technica goes through the Devices page in details but one thing that I have observed is that it is *imperative* that you upgrade your drivers, especially if you are using things like SD Cards that are built into your computer. Sometimes, perfectly good SD cards don't show up or refresh until after I either a) restart or b) reload the driver.

Ars goes through more of the details for under the hood enhancements and some of the built-in applications. I think everyone will immediately notice the changes to Paint (making it more Office 2007-like) and others - but many of the changes are things that I don't use much anymore. I switched from a Windows Smartphone to an iPhone so the Mobile sync doesn't really apply that much and most of my Mail (now handled through Live Essentials) is done through gMail. One weird change was that Movie Maker is now part of Live Essentials instead of the operating systems. The main reasoning behind that is the development life cycle. There can be improvements rolled out to that product that are separate from the OS updates. It also elevates the Live brand a bit more but is Movie Maker really a tool that belongs in a "web-based" suite like Live? I haven't worked with it that much in the new versions but it doesn't quite make sense in that regard.

Multi-touch needs to wait for more devices and as we've seen, some of the Vista enhancements like Sideshow have never taken off. Multi-touch shows a lot of promise, though, as its implementations are being felt across the entire industry.

At the end, Ars reverts back to the old comment that Windows 7 is really "Windows Vista SP2", even so far as version #s go. I think it's the other way around. I think Windows Vista was more like a badly released beta and that Windows 7 is what they should have released in the first place. Considering that gMail was in beta just until recently, I don't think that's a far stretch.

Wednesday, October 28, 2009

New Hentzenwerke Visual FoxPro Book

Jim Booth has released an update to the popular "Effective Techniques for Application Development with Visual FoxPro" book from Hentzenwerke.

Published by Rainer Becker (and dFPUG c/o ISYS GmbH) and Whil Hentzen in both English and German, the eBook covers Visual FoxPro pretty much from soup to nuts but as Jim notes, " Although there is a lot of Visual FoxPro specific information in the book, there are also discussions that transcend any particular development tool or language."


Hentzenwerke Moving from Windows to Linux

Saturday, October 17, 2009

SWFox Conference on Twitter

For those who aren't attending SW Fox, they're doing a great job keeping people up with live streaming as well as call-outs to twitters - for example, Eric's first day wrap-up.

But as well, Joel Leach over on Foxite is also posting his thoughts bout it, including individual sessions, like Dealing with Legacy code by Alan Stevens.

SWFox Conference (swfox) on Twitter

Thursday, October 15, 2009

What Is Your Best Experience?

Amazing how a post on one topic really touches on so many others. Anil Dash posts aboutCommunications and Perception, defending his role as a marketer and communicator. The one line that hits home is "By starting to place importance on experiences and appreciation instead of objects and consumption, we become more sustainable as a society while also becoming more creative as a culture."

Just last night, Trish and I were talking about music and concerts we've attended and certainly the best concerts we've seen were the ones that delivered the best overall experience instead of just the big artist (that's why seeing a Beatles cover band in the Cavern ranks right up there).

The best place by far to have an experience is in person - and one of those places, this year, for FoxPro developers, is Southwest Fox, starting today. Instead of just building a product, the opportunity to see how others are using it, and experiencing it, is invaluable. Attendees of any conference always talk about the value of the networking vs the value of the sessions. Get out and talk around. And then share them with the world, via blogs, tweets or just talking with developers back at home.

This isn't a "touchy-feely" post - certainly there is absolutely a need for objects and consumption. But the real value should be in their experience and appreciation. Your product will make you feel better knowing how other people are experiencing it.

That experience will also make your product and your development better.

(disclaimer: I say this as I stay packed away in my office, sharing my experiences over forums, blogs and other items.)

Wednesday, October 14, 2009

Visionpace: Liar, liar, pants on fire!

Dave Aring has a great post on commenting that isn't specific to VFP but in any development environment. He takes on the Scrum and Agile belief that "all comments are lies".

I will readily say it - last year at SWFox, I made the suggestion that you really don't need to comment your code (at least to a certain extent) if you are using Source code control. After all, when you change something, you check it in, explaining why you did it. (in addition, it was a diatribe against comment headers in code - don't make me read the top of a program to figure out what you did in line 4931)

After reading Dave's post, obviously trying to figure out WHY someone did something by reading through the change log might be a little tough - so you may want to comment it a little. I like Art's point : "it's good to comment *why* something was done (as opposed to commenting *what* something does)"

The problem isn't that all comments are lies or that comments don't prove value, it's that when the code changes, the original comments aren't revised! (that is the one reason why Dave does note as the problem).

It's a great read:
Visionpace: Liar, liar, pants on fire!

Now, as Dave said
"If you have made it this far, you are just not getting enough billable hours in. ", back to billable hours.

Thursday, October 08, 2009

What You Should be Doing Next Week:: Blogging Southwest Fox 2009

I was going to title this "What are you doing next week" but unfortunately, I can't make SW Fox this year.

But the session list totally rocks. From basic VFP topics to how to use VFP with SourceGear's Vault and Subversion and a cool keynote from Sara Ford, I'm really going to miss the learning and networking opportunities.

So here's hoping those lucky attendees will share the love and live-blog some of the great sessions, or better yet, U-Stream them.

Here's hoping....
Doug Hennig: Southwest Fox 2009 is Next Week!

Update: Eric Selje - Salty Dog Solutions - will be blogging here

Thursday, September 24, 2009

Adam Barr on Leveraging Your Weakness

Adam has a great post about how managers can take what many perceive as a weakness and turn it into a strength.

His point is that if you consider a weakess is likely that the user is overdoing something, "which means that the person actually possesses a strength that they are just overdoing. Take away the overdoing and presto, what's left is a strength."

It only goes so far certainly - we are talking about personality traits (what quality is a developer who writes buggy code overdoing?).

I'm not so sure what the long term effects of promoting a weakness might be, but it is an interesting idea.

Do you have a weakness that you can "flip" into a strength?

Proudly Serving My Corporate Masters: Leverage Your Weakness

Wednesday, September 16, 2009

Social Media and Recruiting: ways to go?

This is a great 4 minute review of how social networking is changing the world...Some of the stats are pretty incredible to think about.

I've been off Twitter and FB for a while now but using LinkedIn and VisualCV when looking for contract work. What was interesting was that one of the recruiters I was talking to was starting to get into the habit of using LinkedIn for searching for people.

I'm sure in the US and other areas, this has pretty much already happened for recruiters months and years ago. What's different here though, is that these are federal government recruiters - one demographic that has not really embraced social media (at least in Canada).

At any rate, very interesting and well-done presentation.

Still think corporate participation in Social Media is optional? - Skrocki's Blog

Sunday, September 13, 2009

Be aware of Gmail Scam

I use gMail and just received an email asking for information regarding account currency.

This is a major scam. Although this is being reported, immediate Google searches aren't turning up anything.

The emails are sent from verifyscess@googledesk.com and is cc'ing a "Gmail Team" address at accessaccount10@gmail.com.

Do NOT be fooled - this is most definitely a scam.

Gmail Scam Warning Code:VX2G99AAJ

Wednesday, September 02, 2009

Peter discusses using ARG Command Bars

FoxPro developer Peter Hart has started a blog to showcase his learnings when working with the Arg Command Bars library.

CommandBars is a fantastic library for FoxPro developers that replicates the Office command menus beautifully. Peter shows how it goes even further now with support for the Office 2007 interface.

Great place to learn how to use his tool even further from my earlier videos.


ARG-Software (Command Bars Library blog of a FoxPro developer)

Saturday, August 22, 2009

Craig's DevLink - I like it when you agree with me

Craig has some great reviews of the recent DevLinks days in his area but this post caught my eye:
DevBlog: DevLink Day 2

Why? Two reasons:
1) This comment:
"Concepts such as what kinds of comments and how many are important. It turns out that most comments in code aren't needed. If you write self-documenting code, even fewer are needed."

Those who attended my sessions at last year's SWFox heard me state this numerous times in my session on Code Analyst - even to the point where it appeared I was suggesting getting rid of comments entirely.

In a recent project, though, it became even clearer - I only needed comments to bookmark where I may need to do future work.

Self-documenting code is essential to maintainable code - and while having methods like GetPubishingAcronymForABookTitle goes into overkill of how to name a method, naming your methods right is important regardless of the language.

On the other side of the coin, one of the tools used in a recent project was a .Net documentation tool (Document X) that puts the documentation right into the .Net code as comments. While certainly useful for making documentation part of the stored source, it cluttered function headers with lots of comments.

The second reason?

" In the car were Rod Paddock and John V. Peterson, who I have known for a very long time."
I can only imagine...getting together with old friends is always fun...getting together with opinionated older friends is even better.



Thursday, July 30, 2009

So long Newsgator (for me, at least)

Change is never easy.

I've been using Newsgator for several years now (even bought it when it was a commercial user tool) and have loved seeing it move from an upstart newsreader (congrats Greg!) to a great enterprise tool.

When Google Reader came along, I still continued to use Newsgator mostly for the great Newsgator Go (or mobile) version. I loved being able to read feeds on my phone without having to go online every time.

Sadly today, in my inbox, I received word that they are no longer going to support these tools for consumer use after August 31st.

Now I have to move all of the great clips (another great feature of Newsgator) to another reader. I don't mind Google Reader but I will really miss not having it on my Windows mobile device. That said, it may convince me to look at other phones now that one of my main reasons for staying away from the iPhone and others was NewsGator Go.

To their credit, Newsgator is providing some great transition tips encouraging users to move to Google. It's a win-win for Google Reader, certainly but I will definitely miss Newsgator as my consumer reader.

Good luck in the future, Newsgator - you were a wonderful tool and exactly what I was looking for, when I needed it.

Wednesday, July 15, 2009

dev{shaped} » Fun Developers book

dev{shaped} » Book has compiled a list of various developer-oriented posts (and comics) and put them into a creative commons book called Developers, developers, developers. It covers specific development topics (like continuous integration and language wars) to career advice (remaining valuable) and up and coming concepts. Plus it has a handful of very funny comics.

Sure, you can read a lot of these posts online - but now you can either a)buy it or b) download it in PDF.

Wednesday, July 08, 2009

PEM Editor Video Series for VFP

If you haven't tried out the VFPX PEM Editor, you may want to check out Jordan's video series here.

The PEM Editor replaces the Properties Window, Edit Property/Method, New Property, and New Method, and Document View tools in Visual FoxPro. Sound like a lot?

There are 8 videos in all, totaling less than an hour of your viewing time.

It's this type of tool, along with the Control Renamer, FoxTabs, Tabbing Navigation, among others, that shows the need for an installer for VFP that includes these great tools that improve the VFP IDE experience.

It's something that has been brought up numerous times before, in VFPX discussions as well as at last year's Southwest Fox.

Consider a single installer that runs automatically after a VFP installation (or on its own) that installs and sets up:
- PEM Editor
- Control Renamer
- FoxTabs
- Tabbing Navigation
- Automated Build
- the updated Sedna and FFC controls
- Alternate SCCText (if desired)
- Code Analyst

(the above are all tools that improve the IDE)
And then creates a separate Samples folder for the other samples such as:
- GDIPlusX
- FoxCharts
- ThemedControls
- Tab Menu
- Desktop Alerts
- and more

Developers are always using new tools and expecting the most from their IDEs - many of the tools in VFPX provide a major improvement in productivity for VFP developers, be they building new applications or maintaining legacy applications.

If you haven't taken advantage of these tools, check out the video series for the PEM Editor just to get a glimpse of what you're missing.

Tuesday, June 30, 2009

Southwest Fox Registration Saver Deadline Coming Up

Southwest Fox, the fantastic US FoxPro developers conference, has a special deal for registration with $125 off the regular $745 price.

Note: The deadline has been extended to July 7th, 2009 so sign up today.

The conference line-up looks amazing this year, just as in past years. One of the tracks that really seems to be fleshing out is the Technology Track, with sessions on Virtual PC, SourceGear Vault, Subversion and more.

Southwest Fox definitely has it all: great speakers, great sessions, great networking - a great experience for developers.

Saturday, June 27, 2009

Death of a legend

While I don't usually use this site for personal thoughts, I do want to take a moment to recognize the death of Michael Jackson, a true legend in pop culture and someone who affected the entire world with his music in a positive way.

While his lifestyle was crushing and troubling, his legacy lives on through his music and his impact on the video generation. Like his music or not, he invented pop culture as it exists today (through video, music and celebrity). I think most of the world today has some memory of him, as I know I do.

Just a thought - his planned comeback tour should continue on - with other musicians (Justin, Usher, Smokey, Paul, his brothers to name a few) taking part in those 50 concert shows, paying tribute to him. The money could go towards the obvious litigation that will be coming.

As the Righteous Brothers sang, "if there's a rock'n'roll heaven," then Michael has just joined one hell of a band.

He will be missed but his music lives on. Rest in peace, Michael Jackson.

Anyways, back to our regularly scheduled development posts.

Wednesday, June 17, 2009

Test Driven SQL Projects

SQL Server Central just posted part 2 of an interesting article on applying the techniques of test-driven development to a SQL project. The author, Andy Leonard, goes from describing basic tests for setting up your databases to writing tests for inserting and updating data.

It's good stuff for a variety of reasons. He noted in the first article that some of the techniques are simply good coding practices (drop and recreate) but by writing them up as test scripts as well as within the SQL itself makes the entire piece part of a regression test and can resolve lots of further problems. He also points out that unit tests mean different things to different people so ensure your definition is the same as others on your team.

I'll be the first to admit that I'm not following the full pattern of writing individual tests out for each of my tables (the firing squad can resume shortly) - but the overall approach that Andy describes is solid and depending on how you code, you might find you are already doing a lot of what he describes.

"What’s really cool about all this is the fact that it’s re-executable. You can run the same script against a new instance of SQL Server where WeatherData has never been deployed, or you can run it where only version 1.0 has been deployed. I like that a lot."

Much of it is obvious to most db developers (before creating a stored proc, check its existence, ensure you have the right database selected, etc) - but there's still a lot of dirty code out there in the while. I *love* re-executable SQL - on my current project, I'm seeing a lot of code that is made to run once, just to clean something up. I keep on sending it back to the developers noting that when we do an interim release, we need to be able to re-run the code as often as it takes until it's ready.

Definitely worth the read.

Wednesday, June 03, 2009

Linux ready for the desktop? Show me productivity first.

ZDNet has an article titled Linux Ready for the Desktop.

While I do enjoy Ubuntu quite a bit (at least on one desktop) and I would never doubt the usefulness of Linux on a wide variety of machines, my concerns over open source systems have become more widespread with issues about forks.

Linux is certainly a different scenario than MySQL but consider this - mySQL has been considered a viable alternative for commercial RDBMS' for how long? It's been around since 1994 but has only really become a force to reckon with in the past 10 years.

Certain incarnations of Linux are certainly ready for the desktop (OpenOffice is arguably a good alternative to MS Office - bloat and all) - but then so are an entirely cloud or web-based OSes.

My #1 concern with any OS that I'm going to place on my desktop is "does it make me more productive?" (an offshoot of that would be "does it make any of my clients more productive?")

I'm a firm believer that people will pay for things that make them more productive. I believe Vista has shown that people are NOT willing to pay for upgrades that don't. The security argument doesn't completely wash with me because too many people gun for Microsoft since it is the leader - no OS is impervious to attack (except the one that isn't connected to anything).

Now I've been playing with the Windows 7 beta and so far, it isn't bad - but it still annoys me a bit more than Windows XP but far less than Vista. I've been living in a Visual Studio 2008 project with third party controls and while some of the results are nice, I still rely on Visual FoxPro to do a great deal of the background work.

On the same project, I work with SQL 2005 but I also have SQL 2008 on my office machines - I can safely say SQL 2008 is far better than SQL 2005 in making me more productive. Yet I still use VFP to write automated SQL scripts - it's simply better at text handling than any other tool.

Some people love the Windows Explorer - others find alternatives. The only real way any new operating system is going to make it is by making people more productive, not by a little but by a lot.

The iPhone isn't a great phone - but it does open up the entire world of smart phones to consumers in a way that Windows Mobile simply hasn't. Both phones have features that the others don't - but cell phones are a consumer product - they rely not just on impression and productivity but also "coolness".

Desktop operating systems do not rely on the coolness factor - they are there to get a job done. I don't want an operating system that simply replaces another - I want one that makes me do more with less.


Monday, June 01, 2009

Refactoring T-SQL

While much has been said about the benefits of refactoring application code (see VFPX Code Analyst), I typically haven't seen a lot of noise about refactoring T-SQL and stored procedure code.

The refactoring features found in SQL Manager tend to be more about refactoring your database design but not about the actual content of the SPs.

It's important to note that if you tend to rely on large stored procedures, then many of the same rules of refactoring apply:

1. Keep it short and sweet.
2. Make it readable.


So when dealing with a particularly unruly stored proc (over 1000 lines), I was quite happy to find Red Gate's SQL Refactor (here's a post from the lead developer).

Some of the features are pretty basic (renaming variables, etc) but the one of great interest was the Encapsulate as a new Stored Proc.

As with a number of tools that are add-ons to other components, its overall usefulness might seem limited if you are building your stored procs either using testing patterns or have good code review sessions - but if you're inheriting or just watching one procedure get too big, it's definitely useful.

What about your SQL applications? How big do you let your stored procedures get?
What tools do you use?

Wednesday, May 20, 2009

Dealing with Font Sizes

Andy Kramek offers some great samples of identifying how long a string can be in a particular font. This is something that every UI designer needs to consider when dealing with screen design.

While many VFP developers will use FONTMETRIC and TXTWIDTH, Andy has wrapped it all into a fairly easy function to call.


Check it out here

Wednesday, April 15, 2009

SQL: Does a Field Exist?

In the FoxPro world, checking to see if a field exists can be done a number of ways:

=AFIELDS(la)
IF ASCAN(la,"FIELDNAME")>0

ENDIF

or

IF TYPE("FIELDNAME") = "U"

(I'm sure there are lots of other ways especially if you're already working with a data dictionary tool)

In T-SQL, there is no real equivalent however, you can do the same by using the INFORMATION_SCHEMA table.

While there is no shortage of sites on the web that will show you similar code (like this one), I wanted to post it here for any VFP devs who may be switching between DBFs and SQL.

IF NOT EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = 'MyTable'
AND COLUMN_NAME='MyColumn')
ALTER TABLE myTable ADD MyColumn decimal(10,2) NULL

Of course, this assumes that the table already exists but you can use similar approaches for tables as well.

IF NOT EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'myTable')
CREATE TABLE .....

if NOT EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'CFG_Fees'
AND COLUMN_NAME='minmFee')
ALTER TABLE .....


Sunday, April 05, 2009

VFPx Showcase: Control Renamer

When speaking about VFPx at last year's Southwest Fox conference, it became evident that there aren't a lot of avenues for finding out how to use various pieces of VFPx. So as part of the FoxShow, I'm creating videos designed to showcase VFPx components, starting with the Control Renamer.

If you have ever wanted to rename a control in a class or form but were hesitant because of missing other code references, the Control Renamer is definitely a tool you want to try.

Now, there are lots of areas where new options can be added into this tool - but they are primarily "extras" like setting color settings or some logging.

Check it out below!









Thursday, April 02, 2009

New VFP 9 SP2 Hotfixes: Report Designer Bug Fixed

Rick Schummer just noted this on his blog but it bears repeating.

A bug that Cathy Pountney had reported with the VFP 9 SP2 Report Designer has been fixed and is available for download, combined with 2 other hotfixes.

As Rick points out:
"Hopefully this is just the third in a string of hotfixes we will see from Microsoft as they support the product we all love. Today is a very good day. This is one small step for VFP, one giant leap for VFP developers. "

Download it here


Sunday, January 11, 2009

Windows 7: First Early Impressions on VPC



First off, let me say I do HAVE Vista on my laptop and find it very annoying compared to Windows XP. ( I wanted to state that after Kevin Hoctor's comment on twitter.)

Vista has moved XP into a more secure environment but along with it came UAC, which to this day annoys me and makes me feel like I have to do three steps when I only used to have to do one in XP.

So before committing myself to running a beta product that is supposedly faster than its predecessors, I put it onto a Virtual PC.

Certain UI elements (like the Taskbar Properties) have been cleaned up for which I'm thankful. I still DON'T like the new Start menu - I don't think it's taken me away from SlickRun.

I did get some BSODs when installing the Virtual Machine Add-ons ( I couldn't give it as feedback using MS connect - although part of the program, it wouldn't say I was part of it).



Still, I installed Foxfire! ( a VFP app) on it (and while I had to Run As Administrator to get it to work), it worked fine.

I noticed Alec Saunder's twitterss was nothing some performance degradation but the jury's still out and it IS still a beta. I was comforted by John Koziol's comments on a FoxShow, suggesting that with Windows 7, they have gotten rid of a lot of the excess baggage that Vista had with it.

So welcome Windows 7 - so far I'm happy to don my I'm a PC hat to try it out.




Monday, January 05, 2009

A New Year...A New Month...A New Technology...

I have (first correction - thanks Matt!) been pulling together links for a larger "start of the year" post and decided to scale it back and try something a bit different. The various sites that AKSEL manages will be going through a "re-branding" exercise in the near future but one of my goals this year is to follow Chris Brogan's Three Words idea (Freedom. Consistency. Communication - I'm still deciding...) as well as working in some of Mark Riffey's ideas into my weekly schedule.

Rod Paddock asked "What's in a title" - and pointed out that one thing developers can do to become better developers is to adopt more agile practices - and he lists several practices and his experience with them.

That's a great goal for developers but what about "database developers"? There are lots of developers out there but almost every role needs to be qualified further: web developer, application developer, database developer. Are there other qualifications that are needed?

A regular Windows application developer likely doesn't need to know about CSS - but a web developer better know CSS. Does a database developer have to know the normal forms? Or maybe how to design a database properly?

How do you qualify that? Because there are always exceptions to each rule.

One of the ways I'm starting this year is by taking a new technology each month and really exposing myself to it (insert joke here). What's my guideline? I'm not completely sure but my first technology (MVC) is something that is actually fairly broad - popularized with Ruby on Rails, "foxified" with FoxTrails and DotNetted with ASP MVC.

How do *you* plan to become a better developer?

Farewell Friend

Late last night, sad news traveled around the FoxPro community about the passing of Ceil Silver. While she had been battling cancer for quite some time, one would never know it from her constant enthusiasm. She was a great colleague and a good friend. She will be missed.

If you are so inclined, the charity of choice (according to her daughter, Rachel) would be the NYU Cancer Center where she was being treated.

Her daughter has updated her blog here.

Andy Kramek's post