Simple regex assist
ColdFusionIf you're still writing some sql create and update statements by hand these may help you. Mainly, I wanted to post these so I wouldn't forget them.
Create a list of cfqueryparam's from a list of cfargumen's. If you don't do any column renaming in your code then this is straight forward:
Find: <cfargument name="(\w+)" type="(\w+)" [^>]+>Replace With: <cfqueryparam value="Arguments.$1" cfslqtype="cf_sql_$2" />,
This next one will create all the values of an update statement from the list of cfqueryparam's, again if no column renaming has been done this is a one shot find/replace:
Find: (<cfqueryparam value="Arguments.([^"]+)" [^>]+>,?)Replace With: $2 = $1
Configuring SQL Server Express 2005 For Remote Connections
SQL ServerThis is a reference guide to change the settings in SQL Express Server to allow remote conections. I found most of my information at http://www.datamasker.com/SSE2005_NetworkCfg.htm , and I will be trying to simplify what is said there.
- Configure SQL to use TCP/IP connections as well as local connections in the Surface Area Configuration Utility.
Select the Services and Connections section.
Under Database Engine -> Remote Connections choose to use local and remote connections (TCP/IP only or TCP/IP and named pipes). You can also do this in the SQL Server Configuration Manager tool under:
SQL Server 2005 Network Configuration -> Protocols for SQL Express - Now restart/start the SQL Server service.
- You now need to configure Windows Firewall (only if you have it running) to exempt SQL Server and SQL Server Browser. To do this you simply need to add sqlservr.exe and sqlbrowser.exe to the exceptions.
The files can be found at:
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe
C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe.
You should have a successfully configured SQL Server, so start trying to connect to it remotely. If you are still having issues it may be necessary to restart the computer for all changes to take place.
Craig.
Firefox Developer Extensions
Web DevelopmentThis is just a reference post that I thought others may find valuable as well, but until I get an app that installs them all for me, here is a shopping list of all the Firefox extensions I like to use in my development setup.
Backup & Restore
Since we have a lot of extensions we use, first lets cover the extensions to backup and restore our extensions :-P
Firefox Extension Backup Extension (FEBE)
https://addons.mozilla.org/en-US/firefox/addon/2109
This extension backs up all your installed extensions in FF.
Compact Library Extension Organizer (CLEO)
https://addons.mozilla.org/en-US/firefox/addon/2942
Your restore mechanism :-) From the description:
"CLEO is a Firefox extension that works with FEBE* to package any number
of extensions/themes into a single, installable .xpi file..."
General
Web Developer Toolbar
https://addons.mozilla.org/firefox/60/
Probably the most popular web developer extension. This extension has
everything from quick access to view source and cookie management
functions to validation and CSS / display analysis functions.
Live HTTP Headers
https://addons.mozilla.org/firefox/3829/
Great for viewing HTTP headers and Requests being made to the server via HTML, Javascript, or Flash / Flex.
FireFTP
https://addons.mozilla.org/firefox/684/
An FTP client for FireFox.
Download Statusbar
https://addons.mozilla.org/firefox/26/
A great replacement for Firefox's download manager window.
Google Browser Sync
http://www.google.com/tools/firefox/browsersync/
Useful for synchronizing bookmarks, etc. across computers.
Minimize To Tray
https://addons.mozilla.org/en-US/firefox/addon/2110
Allows Firefox (and Thunderbird if installed for it) to be minimized to an icon on the task bar.
CSS / HTML
CSS Viewer
https://addons.mozilla.org/firefox/2104/
A great extension to help you see exactly what properties are being applied to any element under your mouse cursor.
ColorZilla
https://addons.mozilla.org/firefox/271/
Gets and copies and color from a page.
MeasureIt!
https://addons.mozilla.org/firefox/539/
Allows you to easily measure anything by drawing a square on the page.
IE View
https://addons.mozilla.org/firefox/1429/
A quick way to open Internet Explorer to the current page via right-click.
ColdFusion
ColdFire
http://coldfire.riaforge.org/
A Firefox extension and CF debugging template that allows you to view your debugging info inside the Firebug extension. This is great to have all your debugging info in one place and the debugging info won't mess up your HTML layouts anymore when it is dropped into the page normally.
Javascript
FireBug
https://addons.mozilla.org/firefox/1843/
FireBug is the most valuable extension for Firefox and Javascript
development. It has a great JS debugger, inline console, and reviewing
of AJAX requests. Beautiful.
Internationalization
Quick Locale Switcher
https://addons.mozilla.org/firefox/1333/
The name says it all.
Mozilla Thunderbird Update Not Completing
MiscellaneousRecently, I had an issue with Mozilla Thunderbird not being able to update. It would download the update, but not be able to install it saying it could not update some files. This would pretty much render Thunderbird useless because the update would try to run every time I started it and I would never be able to get into it.
The Fix - Stop Logitech QuickCam Software
Apparently, having a Logitech Webcam running can cause the updates to fail which is a freak compatibility issue I guess, but stopping QuickCam10.exe in my task manager sure enough allowed the update to run.
Just thought I would share this in case anyone else is Googling this issue without success.
Mike.
The Service Layer
Web Development
Lately I have read a few blog posts and talked to a few developers that either disagree with or are unfamiliar with the reasons for using a service layer in web applications. After posting this as a comment on the great Peter Bell's blog , where he references the discussion, I realized I might be better off cleaning it up and posting it here. While I don't go into detail about how I use service objects, I will save that for a later post if anyone says they are interested.
What I usually do is create a service layer for all gateways, DAOs and many other types of handlers including an email service that can prioritize outbound emails in an email queue. Some may argue that I even overuse the service pattern, but in all truth, I think it is very underused in web applications.
These are my explanations of why I feel the service layer can be a great benefit to both the developer and the resulting application (in terms of performance and stability).
The Developer
Having services is often the more logical way for a programmer to think...It often puts things in a very real world perspective. For instance, why do i see so many implementations of a shopping cart that not only contain items, but calculate all the invoice totals, manage taxes, shipping, etc. Doesn't it seem a little more logical to take the cart, along with coupons, etc. to a single register (similar to what you would do in real life)? I find it very easy to deal with a large set of requirements this way (no memorizing URL diagrams or looking at classes with 400 functions). With DAOs and gateways for a typical bean I like having the service layer to say, "Hey, go put this thing in storage for me" which could be totally different places (database, xml, etc.) any time I use the same bean. On the other hand, I can enjoy the active record type pattern by using ColdSpring to pass my beans a dao and give them an incredibly simple save method.
The Application
The application becomes incredibly solid with the use of the service layer...I love knowing that my application loads and 90% of the memory it will ever use is set and ready to go (and it is much smaller than reinstantiating a bunch of large objects on every request). My applications rarely bounce up and down by massive percentages of processor and memory usage because a few more or less users are on. It becomes very easy to spot when something is awry because I know what to expect. Alternatively, with tools like Spring, ColdSpring, etc. I can load objects every time, or as a singleton when first needed, or anyway I like with a few keystrokes.
Conclusions
I think sometimes we get a little too radical for our own good. It seems fairly often lately that I run into "Why the heck do we need X debates?" that claim much less complexity, removing item X allows the developer more creativity, and the application more flexibility. While I think these debates are healthy, I try to remember one thing...programming is about us...if it wasn't, then why didn't someone just come up with a cross-platform assembly language so we could stop there. The service layer is a tool for making things easier for us to understand and manage...it is also incredibly flexible.
My reading lately brought me to asking myself:
How much more work is it to have a service object than to embed this into my objects as they are?
Is adding more types by having a bean and DAO singleton over complicating something?
I've come to the conclusion that the difference if there is one is probably within minutes of eachother, and I could see the service layer even winning out quite often only because I think it is often "more human" for the developer to think of many problems that way. Does every customer get a cash register at a store? Do we all have our very own post office? Makes it very easy to have a flexible application and not have to memorize a complicated UML diagram in my head at least. That answers both questions for me at least.
It is easy for us to use tools like the service layer in dynamic languages and we deserve that benefit for as little work as it is now to implement. That being said, if you don't think its the right tool for the job, don't use it...we all have paid the price for using the wrong tool before and we learn from those experiences differently.
Mike.
I'm A CFEclipse committer!
CFEclipseSo, while I've been kind of a "sleeper" contributor to CFE, I have been ramping it up a bit lately and doing a little more than just keeping Mark Drew company and providing awkwardly humorous conversation. It's always wierd because you can't hear the person on the other end laughing with you...after years of messaging, I'm still self concious :-P
Anyway, more on the subject of this post, Mark Drew has decided that I'm finally worth the honor of having commit rights to the CFEclipse Subversion repository. Mainly this means two things to me:
- Mark Drew doesn't think I'm gonna blow it up (or that the odds are better that I won't)
- I feel like it means I have contributed some use be it in little bits to the project. I'm eager to see this contribution grow.
Anyway, whether you have been considering helping out with CFEclipse or not, I would like to reiterate how exciting it is to get to work with Mark even on the days I'm not able to do much more than discuss things with him. He has a way of making great things happen with CFE and making the entire process interesting and a lot of fun.
If you would be interested in experiencing the good and rewarding time that I've been getting, might I suggest contacting Mark to share your skills and see if there is something you'd like to do.
I'm not sure if this was an item everyone would be excited to hear about, but I'm very happy about it and I have noone nerdy to share this information with right now.
Thanks for putting up with me :-P
Mike Kelp




Loading....