<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=12803833&amp;blogName=thomasnguyen.com&amp;publishMode=PUBLISH_MODE_FTP&amp;navbarType=TAN&amp;layoutType=CLASSIC&amp;homepageUrl=http%3A%2F%2Fwww.thomasnguyen.com%2Fblog%2F&amp;searchRoot=http%3A%2F%2Fblogsearch.google.com%2F" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" title="Blogger Navigation and Search"></iframe> <div></div>
home blog contact

Code Review FUN!
Wednesday, October 15, 2008
Legacy code can be fun!
How many wrongs make a right? The more the merrier?

//VB.NET
Public Function ConvertSDToStringSD(ByVal securityDescriptor() As Byte, ByVal securityInfo As Integer) As String
Dim pStringSD As IntPtr
Dim stringSDLen As Integer
Dim success As Boolean = ConvertSecurityDescriptorToStringSecurityDescriptor(securityDescriptor, 1, securityInfo, pStringSD, stringSDLen)
' The following ensures that the memory allocated to pStringSD by the unmanaged
' Win32 API is freed.
Try
If Not success Then
Throw New System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error)
End If
Return Marshal.PtrToStringAuto(pStringSD, stringSDLen)
Finally
If (pStringSD <> IntPtr.Zero) Then
Marshal.FreeHGlobal(pStringSD)
End If
pStringSD = IntPtr.Zero
End Try
End Function


TOM ANGRY, can you guess why?

Labels: , ,

1 comments
Reading Material: Writing Secure Code.
Thursday, October 02, 2008
Shey asked me today, "how many books have u read in the last 4 months/" and well, I suck. I re-read Catcher in the Rye, but it's not technical. It helps me go to bed, really. I have been glancing at Wrox's C# 2008 as well, but not really reading it in depth like I should.

Today, I also realized that I didn't actually read Writing Secure Code. I thought read it, but in reality, it took me forever to read Code Complete. I thought I read both. C'mon they almost look the SAME!

I'll start reading chapter one from Writing Secure Code tonight and hopefully one chapter a night until I'm done. I'm hoping I can finish before I head over to he Kaizen Conference at the end of this month. I got my official invitation about two weeks ago, WHOOT!

P.S. If anyone knows whether we can recommend a friend to get an invitation, please let me know. I want Garo to go with us...NERD Power Hour FTW!

Labels: , ,

1 comments
CI in SD Conference.
Friday, September 05, 2008
Continuous Improvement in Software Development Conference!
Long name for something I've been longing.

I'm at a point in development where I need to start improving not just code, but the also practices as an entire team. There are so many things out there to help product development/quality, but I just don't have enough time to investigate them on my own. What better than to learn from the cream of the crop?

So, where do I learn about these things? From the source! Subscribe to their blogs and you'll get the news before it's anywhere: Ayende Rahien, Chad Myers, and Jeremy Miller.

Labels: , , ,

2 comments
Microsoft ArcReady Event.
Wednesday, August 20, 2008
FREE Event, so join up!

I just hope it's not a marketing thing...

Labels: , , , ,

0 comments
SqlException: Invalid object name.
Thursday, July 10, 2008
SqlException: Invalid object name 'dbo.sometableName'
Actual name: 'foo.sometableName'

Mappings for table schema and table names are in the view:
SELECT * FROM INFORMATION_SCHEMA.TABLES

NHibernate: Let users update/modify .hbm.xml file. That's just too much work to have users set that up on installation.

Manual SQL: Create a class that will hunt down the schema of a table from the view. This just seems ridiculous!

Any ideas to dynamically find the schema of a table?

Labels: , ,

1 comments
System.OverflowException!!!
Thursday, July 03, 2008
This is the first time in my life I've actually run into an OverflowException when converting a string value to C#'s Int32. It's time to upgrade and beef up the application to handle Int64 in certain scenarios. Time to play with the big boys.

The max value for an Int32 is 2,147,483,647.
The max value for an Int64 is 9,223,372,036,854,775,807.

Here's my Event Log:
Event Type: Error
Event Source: Secure Vantage Audit Collection Admin
Event Category: None
Event ID: 0
Date: 7/3/2008
Time: 1:39:23 PM
User: N/A
Computer: CLEAN-OPSMGR
Description:
Could not update AuditCollectionAdminServices.

System.OverflowException: Value was either too large or too small for an Int32.
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.String.System.IConvertible.ToInt32(IFormatProvider provider)
at System.Convert.ToInt32(Object value)
at SecureVantage.OpsMgr.Consoles.Services.AuditCollectionAdmin.DataAccess. AdtAdminData.GetStats() in C:\apps\opsmgr-consoles_BUILD_0.2_Beta\src\Services.AuditCollectionAdmin\DataAccess\AdtAdminData.cs:line 66

...


So what the hell is Audit Collection Admin Services? It's a BETA product I'm currently fine tuning for SecureVantage. WHOOOHOOO!

Labels: ,

0 comments
SVNMigration Project.
Monday, June 02, 2008
Before MMS, we streamlined our product line, revamped our website, and now it's time to re-align our source code and build processes. Our old development environment consisted of three different source repositories: VSS, Subversion, and a shared folder. I piloted Subversion/Trac since started here and we've decided to move all of our source code into Subversion/Trac.

The hardest part about this entire process was making sure we didn't lose anything while we're doing our house cleaning. Even though we only have four people working on projects that will be moving to Subversion, we needed to make sure we didn't delete something someone else was working on in the shared folder. This painful process shined a light on Subversion and is one of the reasons why we're (finally) migrating.

It was surprisingly very simple to do, and with only one hurdle.

1. Backing up the SVN and Trac Repositories:
Our SVN/Trac system sits on a VM and our biggest concern was if the VM passed out, so I created a script that would backup all of our stuff and copy it over to a physical machine.
svnadmin dump --quiet C:/SVNRepos/_Template > C:/Backup/SvnDump/_Template
C:/Python24/Scripts/trac-admin.py C:/Trac/_Template hotcopy C:/Backup/TracDump/_Template

2. Load them back into the revamped projects list:
With our new product line and consolidated projects, we needed to load the projects up one at a time. Man, the repository is so fresh and so clean!
svnadmin create C:/SVNRepos/template
svnadmin load C:/SVNRepos/template < C:/Backup/SvnDump/_Template

In order to load up Trac again, I stopped the Trac service and copy/pasted the hotcopy (just a copied snapshot) and restarted the service again. I hope they'll create a command for it soon.

One Roadblock/Hurdle, whatever you want to call it:
I had dumped all of my projects, backed them up, and started to loaded them back up in Subversion. Here's the scenario:

I have two repositories, ProjA and ProjB. ProjA is the main one, and ProjB is the prototype. Yes, I wrongfully treated them as seperate repositories. So now that I have two dumps, I want to load ProjA and then ProjB into the ProjA/branches folder. After properly loading ProjA, I took a look at the documentation for svnadmin load and went at it:

Try One:
svnadmin load --parent-dir C:\SVNRepos\ProjA\branches\prototype-ProjB C:\SVNRepos\ProjA < C:\Backup\SvnDump\ProjBDump
Twitter to call on help, and James to the rescue:
(2:54:51 PM) James: yeah that'll fail

Try Two, after James fix:
svnadmin load --parent-dir branches\prototype-ProjB C:\SVNRepos\ProjA < C:\Backup\SvnDump\ProjBDumpK
Still get a file not found error for 'branches\prototype-ProjB', gah!

After playing around, I found the problem. It was telling me exactly what was wrong. All I had to do was add the folder 'branches\prototype-ProjB' and commit it BEFORE loading ProjB, der der. I assumed that Subversion would automatically add the folder for me, shame on me. No wait, shame on the documentation for not telling me. Or should I shift the blame to Subversion for not implementing that for me? Actually, I really shouldn't have made two seperate repositories in the first place. Oh well, it's done and I'm happy.

3. Sit back, relax, and enjoy.
Not really, next week I'll start working full time, hardcore, and heads down on a BETA for our Audit Collection Admin. Supposedly, a lot of buzz is going around about the demos I created for MMS.

Labels: , , , , , ,

0 comments
Getting Involved Again.
Tuesday, April 22, 2008
So I've been meaning to get back on the HDNUG and AgileHouston train again for a while. A series of recent events finally made me get up and get involved again.

  • Last week, James and Ben (GO COOGS!) went to the ALT.NET conference in Seattle along with a long list of very famous people. I envy you two, hehe.

  • Yesterday, James and I had a short talk about how to get something started in his new found home, Ellensburg, Washington. He's a bit far from Seattle to get drive to the events, so he's looking for help. Today, I emailed Chris Koenig about helping James out with his connections. Within minutes, I get a response with a "handy-dandy" link and a few contacts...AWESOME.

  • This morning, my boss emails me about a free local event in Houston on May 7, 2008 on the "State of .NET" that we'll be attending.

Good fun. I'm ready, bring it.

Oh yeah, I'll be attending MMS this year in Vegas along with the SecureVantage team!

Labels: , , , , , , , ,

0 comments
discountasp.net's Subdomains Suck.
Friday, April 04, 2008
So we're looking to create a subdomain under our current hosting service: Discount ASP. First of all, they charge $5 a month just to have this feature turned on. Second, check out how they want us to implement it:

http://kb.discountasp.net/article.aspx?id=10102

In summary, we want this: http://subdomain.example.com. Here are the steps:
1. Create a default.asp page under the root of http://example.com.
2. Create a "subdomain" folder under the root.
3. Include the script at the top of the default.asp page to look for "subdomain.example.com" in the server variables.
4. If found, redirect the user to http://subdomain.example.com/subdomain.

WTF, why do I have to create a freaking "subdomain" folder?

Dreamhost, thanks for making it easy for us!

Labels: , , ,

0 comments
Heroes Happen {Here} Event.
Tuesday, March 25, 2008
Last Thursday, I went to a free Microsoft Launch Event for Server 2008, Visual Studio 2008, and SQL Server 2008, called Heroes Happen Here. It was at the Westin Galleria, NOT to be mistaken by the Westin Oaks! Who knew two Westins existed in the Galleria mall? Crazy.

Anyway, I took the developer track and VS2008/.NET 3.5 has a few things I want to dig my hands into:
1. LINQ - Down and dirty querying with a yet clean and refined look. Query almost anything: SQL, XML, DataSets, join on different datasources, forget all the for loops to get what you want...just LINQ it.
2. New features in AJAX with ASP.NET - Supposedly, you don't have to write ANY JavaScript.

For breakfast and lunch, they hooked us up with some fancy bag that contained everything we needed for the day: water, orange juice, grapes, a sandwich, snickers, muffin, and some other stuff.

There were hands-on-labs, but I didn't have time to get to them, but they're here to download.

The main reason I came was to pick up a copy of each of these products, but as an added bonus, I found a copy of Vista Ultimate! I've been waiting to upgrade my XP Media Center machine at home.

Labels: , , , , , ,

0 comments
Silverlight 2 Beta 1 Released!
Wednesday, March 05, 2008
So here goes a big update to the last post on Getting Started With Silverlight, Silverlight 2 Beta 1 has been released!

Here are the direct links as of today:
Silverlight 2.0 beta 1 runtime
Silverlight tools beta 1 for VS 2008
Silverlight 2 SDK Beta 1
Expression Studio 2.5 Preview

Now, I'm off to go play with ScottGu's tutorials (the other). Hopefully, the Beta 1 has what I want to prepare for MMS 2008.

Also, for all those interested in knowing if Silverlight is going to be ported to mobile devices: the answer is yes, Nokia being the first! Unfortunately, it will only be version 1.0.

Labels: , , , ,

0 comments
Visual Studio.NET 2008 + Subversion + NAnt.
Friday, February 29, 2008
I've had trouble trying to figure out a way to grab the Subversion revision number in order to populate it into the the auto-generated CommonAssemblyInfo.cs file.

major.minor[.build[.revision]]

Google got me Bryant's post that linked to Jonathan Malek's post. Which didn't help at all because he already migrated his blog to WordPress and the link couldn't be found. The next link I found worth was Dan Hounshell's post on the topic. Guess who it refers to? Jonathan's (now invisible) post.

So finally, I put a few things together and I came up with an almost-done solution, YAY!

<property name="svnrevision" value="0"/>
<property name="svnrevisiontortoise" value="nothing" />
<if test="${directory::exists('.svn')}">
<!--... run the tortoise command line stuff to get latest ...-->
<loadfile file=".svn\all-wcprops" property="svnrevisiontortoise" failonerror="false" />
<regex pattern="ver\/(?'svnrevision'\w+)\/" input="${svnrevisiontortoise}" failonerror="false" />
</if>
<echo message="Using Subversion revision number: ${svnrevision}" />

The only stipulation for this is you HAVE to do an update on the repository before calling running this. I tried running a command, but I don't have Subversion installed on the machine, so it doesn't recognize it. Plus, I don't want to add that dependency. Maybe I can throw it in a bin folder or something as a reference.

<exec program="svn" commandline="up" failonerror="true" output="svn.update.log.txt" append="true"/>

Now that I have .revision automatically generated, I'll need to figure out a simple way to both tag and generate the build number.

Labels: , , , , ,

1 comments
Getting Started with Silverlight.
Tuesday, February 26, 2008
There's a ton of stuff out there that just makes my head go crazy. If you want to get started, here's the quick run down of problems I ran into and what I did to get things up and running.

Version Clarification
TypeNameDescription
FREESilverlight 1.0Initial release.
FREESilverlight 1.1 Alpha September Refresh
Upcoming Release (final version will be named 2.0).
TrialMicrosoft Expression BlendSupports Visual Studio 2005. (Project files only)
"Preview"Microsoft Expression Blend 2
(December Preview)
Supports Visual Studio 2008. (Solution and Project files!)
FREESilverlight 1.1 tools for VS2008Support of Silverlight 1.1 in Visual Studio 2008.

*Pretend Blend v1 and Silverlight 1.0 never existed. Get all the lastest stuff, believe me. You'll be MUCH happier.

I'm getting started with the Creating a Clock with Silverlight tutorial. I'm running Silverlight 1.1 Alpha, Visual Studio 2008 (with Resharper 3.0), Expression Blend 2 December Preview, and the Silverlight Tools Alpha for VS2008 all on a Vista Business Edition machine.

READY-SET-GO.

Update: This is a Silverlight example, but the Silverlight 2 Beta 1 has not been released yet (along with the tools for VS2008) that makes me sad, =(. Still, it is an awesome tutorial to create a Digg client application from Scott Guthrie.

"The entire application is implemented in about 35 lines of C# code and 75 lines of XAML page/user-control markup" -ScottGu <-- WOW.

Labels: , , , ,

0 comments
Visual Studio 2008 - What More Can You Ask For?
Tuesday, February 12, 2008
So I was talking to James a little bit about Visual Studio's features and things I'd like it to have. Here's my list of things I might just not know about or things that would make life easier in Visual Studio 2008.

-Right click a base class you created and click "Extend Class"
-Right-click an interface and click "Implement Interface"
-Save/Configure windows layout (dual screen vs. single)
-FULL LIST of the current keyboard mapping scheme that is readable

Oh yeah, Visual Studio + ReSharper is the only IDE I'd suggest. Without it, you're missing a TON of stuff.

Labels: , ,

1 comments
Subtopic: QUICKLY Get log4net Setup.
Tuesday, January 22, 2008
(This is a subtopic of the Learning NHibernate by Example (Small).)

It took me a while to get used to log4net version 1.2.10. Here's my attempt at a quick crash course on what I consider the basics of log4net.

Step 1: Download and reference it, derrr.

Step 2: Create a log4net.config file. I put mine in the OrderSystem.UI section, in the same location as the app.config of the startup application.

Here is mine, for now:
<?xml version="1.0" encoding="utf-8" ?>
<log4net debug="false">

<!-- Console Appender declaration -->
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%-5p : %m%n" />
</layout>
</appender>

<!-- Default configuration-->
<root>
<level value="INFO" />
<appender-ref ref="ConsoleAppender" />
</root>

<!-- Overriden configuration by class name -->
<category name="NHibernate">
<level value="Error" />
</category>
<category name="OrderSystem.UI">
<level value="ALL" />
</category>
<category name="OrderSystem.DataAccessLayer">
<level value="ALL" />
</category>
<category name="OrderSystem.Objects">
<level value="ALL" />
</category>

</log4net>


Step 3: Pickup the log4net.config file. I added this to the bottom of my OrderSystem.UI's AssemblyInfo.cs file.
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]

Step 4: In any class - Import the namespace.
using log4net;

Step 5: In any class - Get the logger instance.
private static readonly ILog log = LogManager.GetLogger(typeof (Program));

Step 6: In any class - Use it.
log.Info(summary);

VOILA, now you can configure logging with an external configuration file.

Labels: , ,

3 comments
Learning NHibernate by Example (Small).
Friday, January 18, 2008
So I started a new project a couple weeks back and I'm going to put off separating the common features into a "CommonProject" until later. I've run into a few tedious steps over and over again, that I already knew NHibernate would help me resolve quickly and easily. Once this is complete, I'll take a look to see what needs to be done.

I like what I see already in NHibernate; I'm just not too happy about support for NHibernate.org and their community, or lack thereof. I downloaded a sample, but it's not using the most up-to-date version, which is currently 1.2.1GA. I have a working version of it. If you want it, let me know.

(By the way, does anyone know what the "GA" in 1.2.1GA means?)

My environment:
Microsoft SQL 2005
Microsoft Visual Studio 2005 (ReSharper 3.0.2)
NHibernate 1.2.1GA

Labels: , , , ,

3 comments
Dreamhost Rocks.
Wednesday, January 16, 2008
Although I was one of the few who got affected by this little accounting problem, I still really respect Dreamhost. Not only did the blog an apology and email me an apology, they even explained why this occurred and their solution to it. Honesty is the best policy.

I even learned something from them:
"The moral of this story is that “flexibility” is rarely desired in programming! The less a program will accept/the less a program will do/the less options and preferences it has, the more usable it is/the more understandable it is/the more stable it is."

It's too detailed to be made up, I guess. Anyway, my account is fixed and I'm still keeping my hosting with them.

Labels: ,

0 comments
Multiple Projects, Similar Functionality.
Thursday, January 03, 2008
I started a project more than a month back using Subversion, NUnit, and Trac. Here's the problem now: I have a new project that does almost the same thing. They're totally different projects and have no dependencies on each other. There's just a set of code that could be reused by the new project.

How should I handle the source code?
1. I could just keep them separate and that's no problem at all.
2. I could branch off and start a parallel project within the current repository.
3. Something else?

I haven't had experience with this situation and need some suggestions.

Labels: ,

1 comments
Visual Studio .NET 2005's Command Line Tool.
Friday, December 28, 2007
What I'm trying to do: call the link.exe to make a SampleFile.res into a SampleFile.dll.

Approach 1: Manual call from the Command Line Tool (CLT).
I don't like this idea because I'd have to open the CLT every time I want to recompile the *.res into a *.dll.
[Call 1] C:\Program Files\Microsoft Visual Studio 8\VC\bin> C:\Program Files\Microsoft Visual Studio 8\VC\bin\link.exe -machine:x86 -dll -noentry -out:C:\ProjectFoo\Installer\bin\Debug\SampleFile.dll C:\ProjectFoo\Installer\bin\Debug\SampleFile.res

[Call 2] C:\Program Files\Microsoft Visual Studio 8\VC\bin> link.exe -machine:x86 -dll -noentry -out:C:\ProjectFoo\Installer\bin\Debug\SampleFile.dll C:\ProjectFoo\Installer\bin\Debug\SampleFile.res


***I showed two calls for a reason. They do the same exact thing and both work successfully on the CLT.

Approach 2: Automate call from the Pre-Build event in the project.
I like this approach because it allows me to edit the file whenever I want and then compiles the *.res to a *.dll as needed. I put the following in the Pre-Build event section for my project.
C:\Program Files\Microsoft Visual Studio 8\VC\bin\link.exe -machine:x86 -dll -noentry -out:C:\ProjectFoo\Installer\bin\Debug\SampleFile.dll C:\ProjectFoo\Installer\bin\Debug\SampleFile.res

KABOOM! Error 1 The command "..." exited with code 128.

SOLUTION? COPY AND PASTE!
So looking at the properties for the CLT, here's what is called when I click it:
%comspec% /k ""C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"" x86

OO...a batch file, let's take a look at it. Since I'm on an x86:
call "%~dp0bin\vcvars32.bat"
(C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat)


More batch files? Keep them coming!
"%VS80COMNTOOLS%vsvars32.bat"
(C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat)


FOUND IT! Well, it's the end of the road here, so I copied the entire batch file contents and pasted it before the call in the Pre-Build event. Worked like a charm...now I need help with finding out what is the right approach to doing this using best practices. Meanwhile, I'm going to hack this section up and minimize the calls and settings to let it keep working.

(10:54:43 AM) kashifkhan17: yup env settings it was
Thanks, Kashif! For helping me think through it.

Labels: , ,

0 comments
First Month on the Job.
Friday, December 14, 2007
What have I been doing? My first week was great and it just keeps getting better:
1. Put all code (legacy too) in Subversion.
2. Dug my hands into two projects, one new and one old.
-Include effective debugging, documentation and unit testing.
3. Got approved for training I found through blogs I read.
-Hopefully, David can go on Devon's tab too!

I'm currently working on a VBScript/COM project. It's not too bad, but I can't seem to get away from classic ASP and VBScript ever since I got my hands on it at Motion Grid about six years ago.

Deng, I just realized that I've been developing for six years, both professionally and as a hobby. I've changed so much as a developer and it's just getting started.

Time for work now...

Labels: , , ,

0 comments
ProjectBBOM.Dispose();
Wednesday, October 03, 2007
What? Disposed? YES DISPOSED...as of Friday, September 28th after lunch. How am I taking it? Pretty well for a pet project lasting over a year.

Bottom line, the root cause of this outcome is a mix of two things: 1) the users don't really know what the application is or does, 2) the developers and plan teams (us) underestimated and kept the scope and $$$ growing and growing. How can something like this happen? No documentation. No subject matter expert. No clear requirements. Code is just a BBOM. So what good came out of this? Agile methodologies implemented. Awesome use of our tools (JIRA/Wiki/Subversion vs. Emails/Excel/ClearCase). Postmortem review and presentation.

We also found out the reason for all our headaches is because the application we're rewriting doesn't even fit the business today (and tomorrow). It's a seven year old application with tons of bugs. The business is going back to the drawing board to find out what their users really want and need.

I'm now working on a messaging application that takes in feeds, stores it in our database and then creates downstream feeds for our subscribers. Looking at it for the first time today, its a beast!

Labels: , ,

0 comments
SELECT * FROM [TheWholeTable]
Friday, August 31, 2007
<rant>
Yes, the whole table.

This report shows the cash-type trades done in London and grouped by currency type.

39 currency types.
1:07 minutes to run.
6,722 rows of data.
20.4 MB Excel file (when exported).

It's a reporting tool, not a freaking SQL dump tool. Users, help us help you make this report more meaningful.
</rant>

Labels: , ,

0 comments
According to My Calculations...
Thursday, August 16, 2007
We have an data object that contains:
1. $principle (Long) - Principle
2. $days (int) - Number of Days Interest
3. $basis (int) - Basis (how many days in a year)
4. $dailyInterest (Long) - Daily Interest

Average Rate = 100 * $basis * ( $dailyInterest/$days ) / $principle

What screwed us over for an hour? DATA TYPE!!!
$dailyInterest/$days is an integer division! Therefore 5/3 gave us 1, instead of 1.6666!

So, boys and girls...

MIND YOUR DATA TYPES!

Labels: , , ,

0 comments
Meetings. Meetings. Meetings.
Tuesday, July 24, 2007
How do you convince a developer that Scrum-like meetings are more beneficial than just the time factor and the content is also totally different?

How do you convince a developer that Scrum meetings are necessary to facilitate Agility, provide value to the team, and actually help make the project go smooth?

How do you convince a developer if the team doesn't touch base once a day, the team can end up in different directions, even if we have a IM forum and can talk to each other one on one?

Labels:

0 comments
Interfaces and Implementations.
Thursday, June 07, 2007
Which style to you prefer when you use Interfaces and Implementations?

A) Separate them.
projectName/dao/
Blah.java

projectName/dao/impl/
BlahThis.java
BlahThat.java


B) Keep them together, and identify:
projectName/dao/
IBlah.java
BlahThisJdbc.java
BlahThatJdbc.java

I like B, just because the interfaces are right next to the implementations.

Labels: ,

2 comments
Project Estimation: Help Me.
Thursday, May 24, 2007
It seems like the estimates we make are always written in stone and no matter how many times we re-estimate, we never get it right. The plan team always want an earlier finish date and the developers always want a later finish date. How can you compromise?

1. How can you estimate the time it takes to analyze a project with unclear requirements? (We've tried to get better requirements, trust me...we have.)
2. How can you estimate for risks? We'll mention the best case and worst case, but best case is usually the only date others see.
3. When creating an estimate everyone should be involved, right? How can you convince your business analyst to provide insight on their side of things?

Labels: , ,

1 comments
CTRL + SHIFT + F, *uck Me.
Wednesday, May 16, 2007
We've been planning to use some type of data connection pooling for quite a while and decided to use the commons-dbcp from Apache.

In our applicationContext-jbdc.xml, we specify the url. I'm using Eclipse, so I formed a habit of doing a CTRL+SHIFFT+F to automatically format the XML for easy read before I deployed the project. BAD idea.

Rejected!
<property name="url">
<value>
jdbc:as400://[dbUrl]/[library]
</value>
</property>


Accepted
<property name="url">
<value>jdbc:as400://[dbUrl]/[library]</value>
</property>


Ok, fine it was rejected. What was the error thrown?
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.ibm.as400.access.AS400JDBCDriver'


It took us FOREVER++ to find out where the hell this problem came up. BAH!

Labels: , , , ,

0 comments
Just Getting the Job Done.
Tuesday, May 08, 2007
Seriously, why develop an application that just works. Ignoring best practices, design patterns, clean code, unit tests, etc. is a sin. Just because an application works, doesn't mean it's maintainable, easily extensible, and READABLE.

Clean up your code, help the next person who's going to work on it.

Labels: ,

1 comments
Development: WORST Practices.
Thursday, April 05, 2007
A few rules I put on integration and committing code (SHOULD be obvious, right?):
-Do an update, integrate, build-test-compile, then commit.
-Only commit what compiles and passes tests.
-If merges are not trivial, contact the other developer.
-Your changes work on your machine, but your commit breaks the CruiseControl build, wait until dependencies re-build and verify the build is a success. Otherwise, fix it ASAP.

So here's what you DON'T want to do:
1. When you do an update and a conflict occurs: comment out what does not compile, even if it isn't your code.
2. When a merge is not trivial and a conflict occurs: replace it with your working code.
3. If a block in a method doesn't work, comment out the things that are broken, and return a null.

Does anyone have a good link on basic software development BEST practices? Here's my list:
Best of the Shade Tree Developer
How to produce software quickly, Part 1 (2, 3, 4)

Labels: , ,

0 comments
JSF, Spring, Hibernate and a Little Magic Dust.
Friday, March 23, 2007
We have an awesome chassis (framework, starting point, whatever you want to call it). It has completely isolated modules: web, services, dao, and model. I've always wanted to know how something like this can be achieved, and now I know. We have a great team and one more will be jumping on board Monday (finally!) to help us out. That will DOUBLE the number of developers on this project, =).

I've learned so much about Java web development. It's very different from .NET and allows much more flexibility to do pretty much anything to your heart's content. Along with this flexibility, though, is the potential for complexity. We kept it simple: JSF, Spring, and Hibernate.

Here are some tutorial pages that were really helpful for me, but most of the help can from others on my team teaching and guiding me:
-This comes with JSF sample code, along with the rendered item, and even the HTML source rendered.
-How can you disregard the MyFaces documentation?
-Here is another good step-by-step tutorial going from static to dynamic pages.
-This Spring tutorial goes step-by-step on how to get started, even with a Tomcat server.

(I learned the basics of Hibernate from a team member.)

Labels: ,

2 comments
One Too Many Demos.
Monday, March 05, 2007
Agile Development: "Most agile methods attempt to minimize risk by developing software in short timeboxes, called iterations, which typically last one to four weeks."

I totally agree with this, but check out our perversion of it. We have multiple iterations, but of the presentation (not the software). It was of the same damn version: the Prototype!

Developer Led:
February 8: Finished the Prototype.
February 15: Initial "Prototype Demo".

Business Analyst Led:
February 21: Trial-Demo before the Business.
February 23: Demo to the Business (Representative).
March 5: Demo to the Business (Asia).
March 6: Demo to the Business (North America, Europe, Middle East, Africa*).
*Really, just Europe.

Each demo was a critique to make sure we show something good the the Business. After each demo shouldn't we improve and come back with another iteration? No, we have to make sure its consistent for our "script". That's right, we had a script during the demo and held on to it with dear life.

Meanwhile, I'm done with the new framework (just the basics) and starting to create one of the five reports for our next iteration, it's called the "Functional Demo".

Labels: ,

0 comments
Null Null-Check, Boo.
Saturday, February 24, 2007
I haven't used my Reliant account since I moved out of the old apartment last year. I'm linking my old account to the current one at the new place. I log in and check it out:

Null "Null Check", Boo.Null "Null Check", Boo Again.


Remeber folks, null-checks are important!

Labels: , ,

0 comments
"Completed" Rewrite Prototype.
Thursday, February 15, 2007
Can a prototype ever really be "complete"? I mean, this BBOM-rewrite has given me so many ideas and paths to take I had to settle with just one. So here's the rundown and some statistics on one sample report I created:

ApplicationOS/ServerTechnologiesReport (sec.)
BBOMWindows 2000, IIS, WebSphereASP, VBScript JSP, Java6.4
PrototypeLinux, Apache, TomcatJSP, JSF, Java2.7


The BBOM has been "optimized" and the Rewrite Prototype is just a proof of concept. I still think there is something crazy going on with the BBOM though. More than TWICE the time it takes to run a report?! Man, hopefully adding on user sessions, connection pooling, logging, and some other gadgets doesn't bog down the rewrite too much.

Labels:

0 comments
BBOM DailyWTF.
Friday, February 02, 2007
Back to the old BBOM Rewrite Project.

I'm finally digging through a page with 2272 lines of ASP/VBScript to find out what I can reuse. Obviously, not this...

If L_Usd ="ON" Then
s_Usd_on_text = "Currency values in US Dollars."
s_Usd_off_text = s_Usd_off_text_null
Else
s_Usd_off_text = "Currency values in local currency."
s_Usd_on_text = s_Usd_on_text_null
End If


And here's how it's being used...

<%=s_Usd_on_text%><%=s_Usd_off_text%>

Labels: ,

0 comments
Knights of the Round Table.
Saturday, January 13, 2007
I've been talking to James and Shey about having a round table discussion about new and matured technologies. It'd be great to keep in learning since I've been out of school for so long.

Let me know if you're interested in something like this and we can start reading up on them, make presentations, and possibly create a mock project. Shey also suggested to podcast them. I want to get started mid-February. I'm starting up on Spring MVC and Struts, since I need to learn it for work.

Some initial topics I'm interested in are: Spring MVC, Struts, AJAX, and RoR.

Labels: ,

1 comments
Class, ClassHome, ClassPK
Wednesday, January 03, 2007
So I'm doing an analysis of the BBOM project in order for a smooth rewrite, analytics, and just to see all what's really going down in this application. After some digging this morning, I bump into the xxx.xxx.xxx.data package:

My Friends: class, classHome, and classPK.

It has 147 classes total. Most (47 x 3 = 141) of which are in the format of AccountingType, AccountingTypeHome, and AccountingTypePK.

Here's a jist of they do...
AccountingType: accounting code and description with the normal constructors/getter/setters.
AccountingTypeHome: accounting type ids (8 of them), maps DB entries into human-readable items.
AccountingTypePK: specific class' id from AccountingType's code. OMG WHY?!

They ALL extend from General, GeneralHome, and GeneralPK which, you guessed it, contains no code, no structure, NOTHING. It's just an empty abstract base class.

Labels: ,

0 comments
Light Saturday Reading.
Saturday, December 09, 2006
Good Read.
Good Stuff.

This will consume a few nights and weekends, thanks Shey.

Labels: ,

0 comments





Recent Posts
First Year on the Job.
I Casted My Ballot.
Tom, Motorpool: "Thanks, I had Fun!"
Weekend: Chopin in Paris
Code Review FUN!
Reading Material: Writing Secure Code.
No Right Click? Use Shift + F10.
Hurricane Ike Recovery.
CI in SD Conference.
Microsoft ArcReady Event.

Archives
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
May 2008
June 2008
July 2008
August 2008
September 2008
October 2008
November 2008

Blogger
copyright 2006-2008 | thomasnguyen.com

Google Reader flickr del.icio.us nike+