Sunday, July 31, 2005

Check out my new blog!

My new blog is located at http://www.flux88.com .

I have successfully ported over the posts from Blogger to dasBlog, and you can even find a nifty little app to help you do the same on my new blog.

I will keep this blog up for the sake of old comments and such, but don't expect any more posts...

5 Comments:

At 10:48 AM, Anonymous Anonymous said...

Reading your blog and I figured you'd be interested in advancing your life a bit, call us at 1-206-339-5106. No tests, books or exams, easiest way to get a Bachelors, Masters, MBA, Doctorate or Ph.D in almost any field.

Totally confidential, open 24 hours a day.

Hope to hear from you soon!

 
At 4:37 AM, Blogger clicking4man said...

I enjoyed reading your blog. There is a lot of useful information about seo forum in it. We offer Turnkey Websites and Reliable Hosting. We also provide a blogging service that will help your site get indexed fast and keep the search engines visiting your site. Click here for more information about seo forum.
Thank you
TWP Admin

 
At 7:57 AM, Anonymous Anonymous said...

frontpage web hosting Web Hosting Ecommerce Your source for the latest in the frontpage web hosting industry, frontpage web hosting News, links and latest frontpage web hosting developments.

 
At 6:28 PM, Blogger Infactahost.com said...

Hey, you have a great blog here! I'm definitely going to bookmark you!

I have a shared hosting plan site/blog. It pretty much covers shared hosting plan related stuff.

Come and check it out if you get time :-)

 
At 6:13 AM, Blogger Swingin80 said...

Cool blog you have. I have a online payday loan no faxing related site. Check it out if you get a chance. The URL is online payday loan no faxing

 

Post a Comment

<< Home

Wednesday, July 06, 2005

Chinese translations

Sometimes for fun I will read a google-translated, chinese blog and giggle at the funny things that it translates.  My favorite is “My Guestbook” becomes “Abundant Guest Garden.”

Even funnier is Star Wars: Episode III with chinese translated subtitles…

winterson.com: episode iii, the backstroke of the west

This is hilarious!

0 Comments:

Post a Comment

<< Home

Friday, July 01, 2005

ControlInjector article updated

I updated my article on Code Project, the new Control Injector is much better and more useful than before.  If you haven’t yet read it, please do so and rate the article.

The link is on the right under My Articles.

0 Comments:

Post a Comment

<< Home

Thursday, June 30, 2005

Replace notepad completely...

I wonder why Microsoft doesn't choose to update some of their most frequently used programs more often.  I mean come on!  When was the last time you saw an update to Solitaire for crying out loud.  (Speaking of, there will be a new suite of card games, complete with nice gooey graphics updates, in Longhorn….)

Anyway, one of those crappy programs is notepad, which I am glad to replace with something better.

Download Notepad2, then run this guy's batch file to tell Windows to stfu and replace the notepad.exe file.

Now I get a decent editor to View Source in Internet Explorer!

2 Comments:

At 4:06 AM, Anonymous sandor korozsi said...

Hi! There are a lot of good stuff to use instead of notepad! :) Have you tried Scintilla (or SciTE)? It is free, and comes with code complete, source code highlighting, multi tabbed (if you want) etc-etc! Highly configurable! Have a look at scite, if you didn't fully commit yourself to use notepad2!

 
At 7:43 AM, Blogger subdigital said...

I will definitely check it out. I like the fact that it's tabbed, that is definitely a plus over Notepad2. I imagine that the batch file posted above will work with any notepad replacement.

 

Post a Comment

<< Home

Wednesday, June 29, 2005

Lessons learned -- ViewState, Server Controls, and Control lifecycle.

Ugh, well... I finally fixed the major issue that has held up my development for 2 days now.It really boiled down to the fact that I had properties that were persisting themselves with ViewState like this:


private const string MYNAME_KEY = "__MyName";
public string MyName
{
get { return ViewState[MYNAME_KEY].ToString(); }
set { ViewState[MYNAME_KEY] = value; }
}



Which will work perfectly well as long as you don't access this property before the control's Init event... This is what I have come up with, (and someone please correct me if I am wrong) is that ViewState is really an IStateBag instance that is given to your control, which is different for each control... This helps eliminate conflicts if I add multiple controls on the same page... If I try to access the property before this instance is created (which may be when our control is added to the parent controls collection... I'm not yet sure of this) then I get a brand new string, not the one that was previously persisted... .NET doesn't give you any error or warning that this is happening, which makes it very hard to track down.The above worked for most of my server controls, but one in particular was giving me problems. I moved the persistance code away from the property itself, which I think I like better visually anyway, and this seems to have relieved the problem.This is how you tinker with your controls viewstate:


  
private string _myName;
public string MyName
{
get { return _myName; }
set { _myName = value; }
}

protected override object SaveViewState()
{
Pair p = new Pair();
p.First = this._myName;
p.Second = base.SaveViewState();

return p;
}

protected override void LoadViewState(object savedState)
{
Pair p = savedState as Pair;
this._myName = p.First as ArrayList;
base.LoadViewState (p.Second);
}
Hopefully this might save someone a few hours of head-scratchin.... it certainly cost me a lot more than a couple headaches.

0 Comments:

Post a Comment

<< Home

Monday, June 27, 2005

Server control Page reference

Why does the following code generate a null reference exception?

 




 

public class MyServerControl : WebControl, INamingContainer
{
private TextBox textbox1;

protected override CreateChildControls()
{
if(! Page.IsPostBack)
{
//do stuff
}
}
}


The page reference is not set. I see this sort of example all the time on the web regarding server controls. Why is it that I can not get this to work?

3 Comments:

At 8:38 AM, Blogger subdigital said...

Ahh, the reference is not set until the Load method, which may occur after the CreateChildControls() method...

Man... this stuff is getting really confusing.

 
At 11:31 AM, Blogger Shey's Rebellion said...

How'd you make your code all snazzy looking on blogger with the tabbing and framing?

 
At 12:35 PM, Blogger subdigital said...

It's just css...

edit your template and make a class in the styles section for your code...

mine looks sort of like this:

.code
{
font-family: Courier;
font-size: 10px;
background-color: AliceBlue;
border: solid 1px Navy;
overflow: auto; //this makes it scrollable
}

then you can have comments in green by adding a subclass...

.code codecomments
{
color: Green;
}

 

Post a Comment

<< Home

Thursday, June 23, 2005

My worst job ever

Leave it to Rory Blyth to stir up some well-bottled memories of my youth.

But anyway, reading that post got me thinking. I think I have 2 of the "crappiest jobs ever" ... one was a Paperboy and the other was a Popcorn wagon attendant.

I shall reminisce in the terrors that were my first 2 jobs...

When I was 12 I decided to take a job as a paperboy. My neighbor friends all had a paper route and I somtimes helped them. It was fun and easy. Until I decided to suit up. Since 3 of my friends already had routes near our houses, I had to get a route 3 miles from my house. Where my friends had 20-30 papers on their route, I had more than 60. These papers were delivered at 4:00 am on my doorstep every Wednesday and Saturday morning, and I swore I could hear the driver snicker as he dropped 2 heavy bundles of paper on my Welcome mat.

It took me nearly an hour to fold the papers and shove them in those paper carriers (I had 2 to fill -- one went on my shoulders and one on my handlebars). I finished at around 5:30 and had 2 hours to deliver the papers. I pedaled like crazy until I reach the neighborhood, which was a trailer park. If you have never graced a trailer park with your presence before, let me tell you that THEY ALL LOOK ALIKE. I was never going to memorize this route! On top of that, everybody who lived there was old and wanted their paper perfectly on their doorstep, which is right inside the carport. This meant that I had to set my bike down FOR EVERY HOUSE and walk the paper up there.

On top of all of this responsibility: I had to collect. I had to make several trips to the neighborhood to collect money: $4.00 for each house. I got to keep $1 of that. This means in a one month period I spent about 60+ hours delivering papers and trying to collect money. I made $60 for the entire month. This makes me want to cry even now. But I was a trooper and that amount in my mind equaled "one super nintendo game EVERY MONTH!"... how sad is that.




The next candidate for worst job ever was a popcorn wagon attendant for an outdoor museum in Dallas. It was called Old City Park and they had a popcorn wagon outside. It was about the size of the trunk of my Altima (read: SMALL) and I sat next to a hot-ass popcorn machine. Inside the wagon it was probably 10 degrees hotter than the Dallas summer heat outside. On a good day my wagon was only about 105 degrees F.. The saddest part of this: I got paid $4.25 / hour.

--- ahh, I feel much better now (sort of).....

0 Comments:

Post a Comment

<< Home

Monday, June 20, 2005

Securing client-side content: Flash files

I came across this little pickle about security and flash files. Basically since Flash is a wide open standard, anyone can easily grab your swf file and decompile it. Obfuscation works a little bit here, but a determined little bastard could eventually modify your source.

Of course someone could also just run your flash movie from their own server.

I came up with this little security table for some suggested guidelines in protecting our flash component.



















Flash Security
ThreatSuggested response
File could be stolen and hosted on another serverCome up with an dynamic encrypted key system-- the malicous users would have to know the scheme to get the file to unlock -- this is not 100%
File could be hotlinked from another serverflash file will only allow paths from the same domain as the swf resides... this will ensure that no one will be able to hijack our swf and load their own XML file
File could be decompiledObfuscate the code


What worries me is that none of these are 100% safeguards. They will deter the average evil-doer, but anyone smart & determined enough could get steal our file and modify it.

Does anyone have any suggestions on improving what I have above?

1 Comments:

At 11:10 AM, Blogger Shey's Rebellion said...

Flash is so easy to steal. Another reason not to use it ;)

I'm surprised by the number of people who don't know that flash can be easily decompiled.

 

Post a Comment

<< Home

Friday, June 17, 2005

HDNUG

I attended my first Houston Dot Net User Group meeting last night. It was a lot larger than I originally thought. Judging by their crappy website I would have never thought that they have been around for 3 years. I estimated about 120 people attended the meeting, which they said was their largest turn-out ever.

Anyway, I enjoyed the presentation on Enterprise Library, but more enjoyed talking to my old buddy Moe Al-Kazzaz! I haven't seen him since he graduated from UH last year.

I also heard that Venkat is going to be speaking at HDNUG in August. Save me a seat for that talk!

0 Comments:

Post a Comment

<< Home

Tuesday, June 14, 2005

DevCon 2005 afterthoughts

Man, what a day! I had a blast at this conference. I really got something from every session, which was a lot more than I was expecting... especially after reading some of Jason Olson's comments about TechEd. Anyway, I especially enjoyed the talks by Michael Stuart and Venkat Subramaniam on the new Visual Studio 2005 testing integration. My favorite features of Visual Studio 2005 are too many to list here, but mainly I think that Team Foundation Server is a huge step in the right direction. Microsoft is really paying attention to the community and providing what the developers really want/ (or already use)... but much tighter integration with the IDE. This was a recurring theme throughout the day... that you can do all of these things without leaving Visual Studio. I did think that the free books were a little lame... I mean 90% of the people that were present would not need an "Introduction to..." anything. They are obviously past that point. But I guess I shouldn't expect much for an entry price of $99. The books they handed out were:
  • Introducing Visual Basic 2005 for Developers
  • Introducing SQL 2005
  • Introducing ASP.NET 2.0
Oh well, at roughly 200 pages each it should take long to breeze through them, and I might stumble on a gem or 2 :). The ASP.NET one is written by Dino Esposito, so I will crack it open, I enjoyed his 1.1 version.

0 Comments:

Post a Comment

<< Home

Thursday, June 09, 2005

Visual Studio DevCon 2005 - Houston

I'll be there! Look for me in the Team Systems track...

4 Comments:

At 2:52 PM, Blogger Shey's Rebellion said...

I think venkat will be there to.

 
At 5:30 PM, Blogger subdigital said...

yeah he is giving a talk on testing.. which I will be attending.

You gonna go?

 
At 5:46 PM, Blogger Shey's Rebellion said...

when is it?

 
At 7:20 PM, Blogger subdigital said...

it was today, man!

 

Post a Comment

<< Home

Monday, June 06, 2005

Reformats are fun -- cool utilities

Today I reformated my computer at work. It REALLY needed a fix, it was running so slow!

Anyway, I got 90% of the things I need installed in 1 day, which is pretty good. Now I'm wondering: I want to make a backup image of this install... should I use Norton Ghost or Acronis TruImage?


The first thing I like to do is customize the UI a bit... to do that I first patch uxtheme, then I download a nice visual style & background.

So far I am liking Milk, Simple Plan, and of course Water Color. I also found a good milk-look-alike called Kuantum that has extras for the Yz dock. Yz dock is a mac-cloned taskbar that auto-magnifies when your mouse rolls over it. I like this thing, and it goes great with TopDesk.

Anyway, here's a screenshot of the style in action:




YZ Dock looks like this:

0 Comments:

Post a Comment

<< Home

Saturday, May 28, 2005

My first article published!

Read my first published article here at CodeProject. I developed a ControlInjector for applying a String.Format() pattern to server controls, mixing html literal content and private controls.

The benefit is similar to the benefit of String.Format(), where you separate the string itself, and the variables to insert.

Let me know what you think of it!

3 Comments:

At 4:15 PM, Blogger Sam said...

Your link is messed up. :)

 
At 4:33 PM, Blogger Sam said...

Ok, read the article. Great idea! There's a few ways I think it could be improved though... nitpicky really:

Method name: It doesn't "inject" anything. It Formats. As you said, like String.Format(), except it's for Controls. So I'd just call it Format() to keep with the existing semantics. A bit more intuitive I think.

I don't like the Hashtable. As a general rule Hashtables as parameters are a warning sign to me. You're taking what could be a compile-time error, and turning it into a possible run-time error. I'd just use a Control[] array. This way it could be:

static Control Format(string html, Control[] controls);

This way you don't have to have the repetitive code of creating the Hashtable everywhere you use the method too. If you want to use a Hashtable internally that's fine I think. That leads me to my last concern:

I'm not sure I see the reasoning behind using named parameters. Still if you like 'em that's cool, but you might want to consider supporting the standard numbered stand-ins also. This way I can change the name of a Control and not have to worry about editing a string also. With the rename refactoring in Resharper for example, it'll take care of renaming the reference in the method call, but not the id in the string, so I may just forget about it until I get a nasty run-time error.

Still, great idea, definitely gets a thumbs up from me! :)

 
At 5:07 PM, Blogger subdigital said...

I'll fix that link.. :) and thanks for the comments!

I really liked the Inject naming scheme, but yeah you're right about the benefit of keeping with the current semantics.

The reason I used a hashtable was to leverage the existing functionality of a hashtable... and this way I wouldn't have to worry about the order that I added the control.. This also leads to the problem of order if I omit the control ID and just use a number...

I guess it's just a matter of preference, but I will definitely keep these things in mind for a future revision.

Today I added the ability to read the html string from an embedded resource, so that we can add a .html file in visual studio as an embedded resource, have full designer support, and then Format/Inject the controls later! The entire thing will be compiled so it is easily distributable. This has cleaned up my recent code quite a bit!

 

Post a Comment

<< Home

Monday, May 23, 2005

Server controls vs. User Controls

I ran across an interesting problem today, and I'm surprised that I have never read anything online or in ASP.NET books on the topic.

Basically I created a Wizard Control that will facilitate the common UI task of separating a long task into steps. The idea of a Wizard with Next/Previous buttons has been a foundation of windows applications since the beginning. Providing a similar interface for the web can help a lot.

The control provides a table that looks like this:












Header
Step 1 of 5
Content goes here...

so I have the control developed, all is well, the html looks all nice and neat like this:


<cc1:Wizard id="wizard1" runat="server" HeaderText="New User">
<cc1:WizardStep id="step1" runat="server" ValidationGroup="step1Group">
I am inside step 1!!!
</cc1:WizardStep>
</cc1:Wizard>



Now what if I wanted to encapsulate some of the controls in step1 into it's own user control? Sounds like it would tidy things up a bit. So I did this, and everything was okay. Until I wanted to make each ascx file in charge of validating and saving itself...

So I decide to instead, derive from FoundationWizardStep in the ascx code-behind. This way I could provide a couple public properties and method for validating and saving the form fields. This gives you an error though, because you cannot make a user control (one with an ascx file) derive from System.Web.UI.Control. Instead it must derive from System.Web.UI.UserControl. What's the difference, you ask? Well I suppose the it takes some extra steps in rendering to allow for rich designer support, but aside from that? Not much.

Now if I make FoundationWizardStep in turn derive from UserControl, I get even more weird behavior. I get a run-time exception in the html that the FoundationWizard doesn't have a child property of type FoundationWizardStep...

Now I have resolved the problem by eliminating the ascx control and making it a complete server control (class only). Anyone have ideas as to why this happened?

2 Comments:

At 5:52 AM, Anonymous Anonymous said...

Ben, do a search under Michelle Leroux Bustamante and FrontController on MSDN. She had a great article posted at one time that showed a Wizard Step interface based on the FrontController pattern. Looked better than the stuff shipping in 2.0

 
At 10:49 AM, Anonymous Anonymous said...

Wizard control is included in the Visual Studio 2005.

 

Post a Comment

<< Home

Thursday, May 19, 2005

Forza Motorsport

My new fix is Forza Motorsport for XBox. I am really getting into it. I particularly like how you can search for cars that match certain criteria; searching is a feature that is common to most applications (be it web, windows, whatever) but not so much in games... I'd like to see more of this.

Also, I REALLY like the fact that they licensed Porsche and Ferrari, these were missing from Gran Turismo 3 and it was disappointing (yes, I know that RUF's cars are really Porsches, but still)

I haven't yet played GT4 and was wondering how it stacks up against Forza.... I have a PS2, so I might pick it up if it's better than Forza.

0 Comments:

Post a Comment

<< Home

Tuesday, May 17, 2005

VS 2005 Beta 2 has arrived!

I walked in my office today and opened the yellow envelope on the floor by the door to find:

  • Visual Studio 2005 Beta 2 - Team Suite CD
  • Visual Studio 2005 Beta 2 - Team Foundation Server
  • SQL Server 2005 Developer Edition - 365 day trial
Now I have to find the time to reformat my machine because there is no way I am installing anything heavy on it right now... it's running too slow.

Why in the world does VS2003 start moving like molasses after a couple months of use? When I add a new item to my solution I have to wait 3 full minutes before I regain control of the computer... how ghey.

5 Comments:

At 7:47 AM, Blogger Shey's Rebellion said...

eeeh, i've never had that problem, how many projects do you have under the "projects" directory? I'm just guessing.

 
At 7:50 AM, Blogger Shey's Rebellion said...

ohh i also wanted to ask, could it be the registry?

 
At 7:11 PM, Blogger subdigital said...

in 1 solution we have 11 (count them, eleven) projects..

in the current solution I am working on there are 4 projects.

The problem happens in both solutions, and also happens frequently on my boss's computer.

What in the registry would cause such delays?

 
At 7:27 AM, Blogger Shey's Rebellion said...

i don't know, it made sense when i wrote it. What kind of hard drives are the projects on?

 
At 9:33 AM, Blogger subdigital said...

standard IDE hard drives, 7200 rpm ...

 

Post a Comment

<< Home

Tuesday, May 03, 2005

ASP.NET 1.1 Master Pages

I was too impatient to wait for .NET 2.0's Master Pages, so I started to look at some of the (many) implementations for master pages in ASP.NET 1.1 ...


I ran across this article at CodeProject and I started to implement it in my new project. The basic idea behind it is to parse a child page (Context Page) and before Viewstate is even loaded, it does a Server.Execute to execute the desired master page, and the master page just loads its controls into the HttpContext (it makes sure not to render itself). The execution resumes at the Context page and the entire control collection of <form> is copied into a specifically named control and finishes execution!



The master page looks like this:


<html>
...
//header & navigation
<div id="masterContextContainer"> </div>

//footer
</html>




That's it! Mark the class with the [MasterPage()] attribute and it's ready to go!



The Context Page is just a normal aspx page that has the class marked as [ContextPage(masterPageAlias)] and it's done.



There are a number of different methods to accomplish this, but I found this one to be very nice because A) I can inherit my PageBase class from this MasterContextPage and start using it on existing web forms... B) it's very clever!


The only thing I found that is a little iffy is the Tracing. If you have both pages enabled it messes up, so make sure and set the Master Page to trace="false" so that you don't get any conflicts with control id's.

0 Comments:

Post a Comment

<< Home

Sunday, May 01, 2005

Hear my email on .NET Rocks!

Carl Franklin from .NET Rocks! chose my email to read on the next show. Tune in and listen...

For my prize I got to pick from their section of "useless crap", and I chose the big-ass coffee mug... because I can always use more coffee! (I guess I am not dorky enough to wear a skin tight baseball shirt or truckers hat that says ".NET Rocks!" on it... )

If you aren't a regular listener, you should really try it out, most of the time you'll learn a thing or two new, and it's sometimes pretty funny. My favorite shows were with Scott Hanselman & Rory Blyth and Bill Vaughn & Rocky Lohtka. Here's a hilarious quote from the show:

"I'm done with objects."

- Rocky Lohtka on .NET Rocks at Dev Connections 2005

0 Comments:

Post a Comment

<< Home

Thursday, April 28, 2005

NHibernate and ASP.NET - Part 2

After some toying around, I have my first object Saving/Updating/Deleting and using a GetAll method to bind to a Datagrid. All of this with about 5 or 6 lines of UI code! Yummy!

I still have some design concerns to wrinkle out, though. Here's how I have mine set up:

public class NHManager
{
public NHManager()
{
//load config

//create session factory
}
}


public abstract class BusinessBase
{
private static NHManager _mgr = null;
[ThreadStatic()]
protected static NHManager Manager
{
get
{
if( _mgr == null)
_mgr = new NHManager();
return _mgr;
}
}

private ISession _session = null;
protected ISession CurrentSession
{
get
{
if( _session == null )
{
//see if context contains it
if( HttpContext.Current[NHSESSION] == null )
//key is a constant
{

//this is the first access for this request,
//load the object

_session = Manager.OpenSession();
HttpContext.Current[NHSESSION] = _session;
}
else
{
//it exists in this request
_session = HttpContext.Current[NHSESSION]
as ISession;
}
}
//make sure it's connected
if(! _session.IsConnected)
_session.ReConnect();
return _session;
}
}
}


Is there anything glaringly wrong about the above sample? I am expecting a little flaming due to the [ThreadStatic()] in my ASP.NET Application, but is it really that bad since my manager object is WORM (Write Once Read Many) ???

I welcome suggestions and comments (now that they will actually work :P )

3 Comments:

At 6:43 AM, Blogger subdigital said...

I have changed this design to now start the NHSession using a HttpModule, so that it can easily be used for other web apps.

I may also use the HttpApplication to store a reference to the NHManager class, and implement a singleton. This way I can guarantee that only one instance is created AND that it will only be created once (remember it's expensive to create the configuration and session factory).

If I wanted to add, say, a windows forms app to this solution, I could easily use the NHManager class's singleton to create another Session Factory and store that in my application somewhere...

I'd have 2 session factories... which isn't ideal... but I don't think I would be able to use the same one from the HttpContext described above.

 
At 7:02 PM, Blogger mortgage said...

home equity loans mortgage rates home loans home equity line of credit car insurance cash advance credit cards debt consolidation dental plans health insurance home equity line of credit home equity loan home equity loans debt consolidation home finance home loan life insurance mortgage mortgage mortgage brokers mortgage companies mortgage lenders mortgage loans mortgage loan mortgage refinance mortgage refinance mortgage refinancing mortgages mortgage cash advance payday loans realtors refinance web hosting Alabama mortgage Alaska mortgage Arizona mortgage California mortgage Colorado mortgage Connecticut mortgage Mortgage Delaware mortgage Florida mortgage Georgia mortgagerefinance refinance Hawaii mortgage Idaho mortgage Illinois mortgage Indiana mortgage Iowa mortgage Kansas mortgage Kentucky mortgage Louisiana mortgage Maine mortgage Maryland mortgage Massachusetts mortgage Michigan mortgage Minnesota mortgage Mississippi mortgage Missouri mortgage Montana mortgage Nebraska mortgage Nevada mortgage New Hampshire mortgage New Jersey mortgage New Mexico mortgage New York mortgage North Carolina mortgage North Dakota mortgage Ohio mortgage Oklahoma mortgagemortgage rates Oregon mortgage Pennsylvania mortgage Rhode Island mortgage South Carolina mortgage South Dakota mortgage Tennessee mortgage Texas mortgage Utah mortgage Vermont mortgage Virginia mortgage Washington mortgage West Virginia mortgage Wisconsin mortgage Wyoming mortgage online casinos online poker cheap domain names domain names

 
At 10:05 PM, Anonymous Anonymous said...

buddy,

I am scratching my head on adding nhibernate to my simple website, i would be really appriciate if you could throw me bones here ( code snippets ) to my mail id mailbabu@gmail.com

thanks - BMR

 

Post a Comment

<< Home

New template

Well I gave up on the old template because I recently was told that nobody can reply to any of my posts! I wonder what this has to do with the template that I was using, but I think that was the culprit. Maybe people actually do read this after all. :)

1 Comments:

At 8:40 PM, Blogger subdigital said...

Here is my first comment in a LONG time!

 

Post a Comment

<< Home

Wednesday, April 27, 2005

NHibernate and ASP.NET

If you haven't seen Nhibernate yet, you should really check it out. There are a lot of free ORM tools out there, but this one seems to be the most liked, as far as I've read. I am implementing it in a new project at work and so far I am liking it. A lot.

What I like best is that my Base business object can implement all of the details in Saving, Updating, and deleting objects... all I have to do is make sure and create the xml mapping file and all is taken care of for me.

I do have some design concerns though, as I don't want my front-end coupled to NHibernate at all. The UI developer shouldn't even have to know the workings of the object persistance, he/she should just call BusinessObject.Save() and let the Data Layer handle it.

So, following some advice on TSS and Code Project I decided to abstract the nitty-gritty into a static class.

Ooh, did I just say static? That must be wrong... Static classes are not very reliable in a web application, as you don't control it's lifetime at all. So I have some basic code that generates the necessary configuration, loads my persistant classes into NHibernate, and builds the session factory, and this is all static. As far as the application goes, we won't be able to tell it isn't working because the static members will just be recreated once they are lost. I'm concerned about the performance hit that we will suffer because of this.

I also want to avoid tying it to the Application bag, because that introduces a coupling between the UI and the Class library.

I'm sort of stumped at this point, and I haven't read anything yet that gives me a better alternative. Can someone recommend a solution?

0 Comments:

Post a Comment

<< Home

Monday, April 11, 2005


interior 2 Posted by Hello

0 Comments:

Post a Comment

<< Home


interior Posted by Hello

1 Comments:

At 7:27 PM, Blogger &#39;Thought &amp; Humor&#39; said...

You have a riveting web log and undoubtedly
must have atypical & quiescent potential for
your intended readership. May I suggest that
you do everything in your power to honor
your Designer/Architect as well as your audience.
Please remember to never restrict anyone's
opportunities for ascertaining uninterrupted
existence for their quintessence.

Best wishes for continued ascendancy,
Howdy
Editor

'Thought & Humor'
Cyber-Humor & Cyber-Thought
http://ilovehowdy.blogspot.com/
Harvard Humor Club
http://groups.yahoo.com/group/Harvard_Humor_Club/

 

Post a Comment

<< Home


yet another Posted by Hello

0 Comments:

Post a Comment

<< Home


here's another angle Posted by Hello

0 Comments:

Post a Comment

<< Home


I'm selling my car... anyone interested? Posted by Hello

0 Comments:

Post a Comment

<< Home

Sunday, March 20, 2005

IE / Firefox and Javascript

I'm pretty sure all web developers have been annoyed a time or two (thousand) at the differences in the way Firefox and IE perform with the same HTML / Javascript. I am forced to use IE primarily at work because half of the legacy code is only IE compliant, which is kind of sad.

One recent annoyance I had was a simple one: opening a pop-up window. Here was the code:


<a onclick="window.open('url.html', 'some page', 'toolbar=no, location=no, scrollable=no');" href="#" > link < /a > 


This worked fine in Firefox, but not in IE. IE complained about "invalid argument" ... after about 3 hours of googling I found out that the page title (what I had put as "some page") has to be 1 word for IE to function properly. How retarded is that?

On a side note, checkout these cool extensions for firefox! ... Tidy is my new favorite...

0 Comments:

Post a Comment

<< Home

Tuesday, March 08, 2005

Free books from Apress

Thanks to a link from Mykre , I now have some new books to read! Apress is giving out some eBooks for free, and they might just be worth the download! Enjoy!

0 Comments:

Post a Comment

<< Home

Thursday, March 03, 2005

Team Development with ASP.NET Multiple Projects

I thought I'd share my little setup with the world. I have been googling my ass off trying to find out the best way to do what I need done, but I haven't had much luck.

Basically here was my problem:
  • Multiple Developers accessing the solution -- need multiple projects (this was before source control -- yuck).
  • Different components in VB.NET / C# (can't combine languages until 2.0)
    • the previous code used single file aspx pages...(double yuck)
    • need to maintain common directory structure as on live server
Now I read a solution somewhere that just said to keep adding projects underneath your web projects root directory, and remove the "application" in iis, remove global.asax & web.config and you're good to go. But wait, when you compile it leaves the .dll in the local \bin folder. I tried to set the output directory to the root bin folder, but Visual Studio didn't keep the changes. In fact, when I clicked apply it just reverted to "\bin" instead of " ..\..\bin"
I recieve a (stupid) suggestion from a website to add each project as a reference in the main project -- well this caused all 10 projects to be built each time I compiled... yuck.

Finally, after a few problems of not being able to debug certain dll's, I started at the solution again. Jason Olson recommended I try editing the project file directly with notepad. DAMNIT why didn't I think of this in the first place?!?! It worked like a charm! I'm not sure why Visual Studio compained about the output folder in the first place. In any case, I have been so used to just building all of the projects each time I wanted to compile, that it feels like the build speed is lightning fast!

0 Comments:

Post a Comment

<< Home

Saturday, February 26, 2005

annoyances while combining VB.NET and C#

I ran across this annoyance today, probably a bug in Visual Studio. I have a custom collection that encapsulates an arraylist, and it basically has 5 different overloads for the Add() method.

well this is written in VB.NET, while 1 of the instances of this class is in C#. When I added a new overload to the collection, I named it add() instead of Add() (VB.NET takes the first declared name as the correct case usage for variables and methods, so my other methods were changed as well, but the compiler doesn't actually show this change unless you visit the line again -- and hit a carriage return).

My C# project complained no method named Add() existed. Hrm, so I use intellisense to find out that the method is now called add() -- weird. So I change it to add() to get it to compile, then go fix it.

Well the compiler this time complained that there didn't exist an add() method. Ok, now I'm a little upset. This is just stupid. The compiler is obviously confused. I go back in to the VB.NET project, fix the case to read Add(), and I get ANOTHER compile error. This time saying that there was no Add() method. Arg!

Viewing the object in intellisense must've slapped VS back into shape because it showed the correct method: Add(). Rewriting the line verbatim solved the problem and compiled just fine.

Ahh, that's why they say, "Where do you want to go today?" (one of my old professors used to say that....)

0 Comments:

Post a Comment

<< Home

Monday, February 21, 2005

I swear I'm the last to know everything....

I must be really out of the loop. Even searching on google before I never ran into this until yesterday: NUnitASP. What a cool extension. I must've been searching on the wrong terms because it's been out for over a year. Anyway it lets you grab pages and test things with full HtppContext so you can really test the front end behavior and be confident in your pages.

Anyway, if there exists such a soul that has not heard/used ASP.NET unit testing before I suggest checking out NUnitASP. There's a pretty easy-to-follow tutorial at http://www.theserverside.net/articles/showarticle.tss?id=TestingASP

Now to write tests for my 100+ pages... /quiver

(on a side note I'm still looking for some practicle examples of testing my class library code with NUnit... I'm missing the bigger picture I think, but how can I easily test a class library that almost primarily deals with database interaction?? )

0 Comments:

Post a Comment

<< Home

Tuesday, February 15, 2005

Empires: Dawn of the Modern World

Empires: Dawn of the Moder World

I am ADDICTED to this game! I played the original Empire Earth for a really long time, and this is a pretty good sequel.

One really cool thing is that Empire Earth 2 is coming out pretty soon, and it looks like another good addition to the series. The original EE will probably be offered free from Sierra once it hits stores, so keep an eye out for that.

Playing these types of games makes me think of how good of an example they are for good object oriented design and opportunity for lots of design patterns. I really think a game like this is over my head at the moment, but it's nice to have something to strive for.

Most resell shops will have this game for about $10-$15, so pick it up... it's good.

0 Comments:

Post a Comment

<< Home

Saturday, February 12, 2005

ASP.NET Enterprise Environment

I have been reading a lot about agile practices lately, sopping up as much information I can get my hands on. I'm hooked. I knew immediately that these practices would benefit me at work. The problem is that these are geared towards general development. Web development is slightly different, and it poses some problems with source control, unit testing, and other things...

For source control I setup Subversion on our test server, then installed Apache to serve up the repository over http. It uses WebDAV and Apache permissions to identify the user. As many people know, the subversion admin directory (.svn) doesn't play well with Visual Studio .NET Web projects. I think it has something to do with FrontPage server extensions, but whatever. Anyway, there is a modified version of TortoiseSVN availalable that can convert this to a more friendly (_svn) directory. Beware of using this though... other tools will not work if you use this method. For Visual Studio integration I am using AnkhSVN (which you can configure to use _svn directories). This works very well, however it's still not idea. Here's why:
I frequently run into commit conflicts on my .dlls, .suo, and .pdb files. This really doesn't matter since the .dll's will be recompiled, but it gets quite annoying. I'm really looking on a better way to manage my directory structure to easily omit these files from the source control. (I'm thinking that NAnt may help me setup a different structure, but I haven't messed around with it yet)

For unit tests, it's quite difficult to implement in a web environment (at least it appears to be). One thing I quickly realized is that most of our logic was residing directly in the page. Obviously, this is not desirable so I started work on a robust class library (which is coming along quite nicely now). But how do I write unit tests for code that inserts data into a database? Should I insert, then check to see if the data was inserted? I can easily see this doubling my work. Almost ALL of my code is database interaction.

I have also started configuring CruiseControl.NET to do some continuous integration on my repository. This is waiting on a few other factors, but is the next step in improving my development environment at work.

I know I'm on the right track, but I am not finding enough good resources specific to ASP.NET development with architecture, directory structures. I'd love any advice on how to improve in these areas, maybe some book recommendations.... Thanks!

0 Comments:

Post a Comment

<< Home

Categories

When is Blogger going to supporting Post Categories? It's one of the neater features of .Text and Drupal (2 other other blogging platforms that I have used.)

It would serve as a tool for people to ignore my non-technical posts if they were so inclined. (Wait, who in the hell would wanna do that?!?!)

File this under: Blogging!

0 Comments:

Post a Comment

<< Home

Friday, January 14, 2005

Pass-Phrases are the new thing

Well, this link is hardly new, but it's link-worthy nonetheless. This is a very interesting article on password security.

Robert Hensing's Blog on Passwords

0 Comments:

Post a Comment

<< Home

Sunday, January 09, 2005

It's that time again - System wipe

Like many computer power (read: nit-picky) users, I find the need to reformat my machine just about twice a year. This time around I have been lazy and it has been 9 months since my last reformat. This is mainly because I have been utterly dependent upon it as a server.

I have been developing applications in PHP that were being shown to different clients, and it seemed each time I was about to finish a project, another one came right along.

I also started a couple ASP.NET projects and was becoming very dependent upon my computer (well, a little more than usual).

To top it all off my computer serves media content to my xbox, whicch I also didn't want to interrupt.

I finally realized that I was NEVER going to get a break from being dependent upon my computer, so tonight I will reformat. After this install I plan to "ghost" my hard drives and make a set of restore cd's. I have heard this is a great tool for many people, but my computer is rarely in a position where I want a "snapshot" to always return to. This will be my opportunity to do that.

To make my restore state the most useful in the long run, I have written down all the software I want to have on it. Good god! No wonder my system is so damn slow! I hand-wrote an entire page of software titles that I will be installing.

I might as well list it out and explain why I like each piece of software... maybe someone will find it useful. Or maybe you can post a comment making fun of me. In any case, this is my blog NOT YOURS!

.....sorry, got a little carried away. Where were we? Ahh, yes.. the software list, complete with comments.

My OS is WinXP Pro, for reasons that are probably obvious. Pretty much the only things I do are play games, develop in .NET and mess with DirectX... enough said.

Security

(these days it is a must to install these programs first! Think how dangerous it could be to visit 1 site without anti-virus / anti-spy with a stock version of IE.... /shudder)
  • McAfee Enterprise 7 - far better than Norton imho...
  • SpyBot - It's free and catches more than Ad-aware
  • Ad-aware - well, Spybot isn't perfect.... any suggestions on replacing these 2 with one all mighty Anti-Spy solution?
System


  • DirectX 9.0c SDK - For my ventures in game programming with the awe-inspiring Managed DirectX
  • .NET 1.1 - For my managed development
  • PHP - cuz a little side money from Rent-a-coder never hurts.
  • IIS - for asp.net and php
Databases


I use 2 because I have to develop for different target database servers.
  • SQL Server 2000 (for asp.net stuff)
  • MySQL (for php)
Development


  • Microsoft Visual Studio .NET 2003
  • Dreamweaver MX 2004
  • EditPlus (though dreamweaver has better builtin ftp support)
  • SQLYog (free!) (wonderful tool for MySQL
  • Enterprise Manager / Query Analyzer
  • Subversion (best source control I've seen)

Visual


  • StyleXP (lots of clean visual styles out there) (i just recently learned that stylexp only hacks the microsoft dll to provide unsigned styles. The same thing can be accomplished with a manual hack. WindowsBlinds has their own dll for skinning, so I'm testing that out. I also got a copy of RoyalXP (the 2005 MCE style -- nice!)
  • Customize.org (for wallpapers)
Media


  • Windows Media Player 10 (though it's pissing me off to no end)
  • Winamp 5
Burning


  • Nero
  • Alcohol 120%
  • Daemon-Tools (for mounting images)
  • CloneDVD
I'd like comments. I'm always on the lookout for more good software to bloat my machine!

0 Comments:

Post a Comment

<< Home

Saturday, January 01, 2005

The Antec P160 ATX Case

I have been building computers for as long as I can remember. There was a time when I could actually make quite a bit of profit, and still stay well below what other major pc manufacturers were charging. That is not the case anymore, however the experience is still with me.

When someone would ask me to build them a computer, I would generally assess what they could do without and skimp on that. Most business users (in fact most users in general) do not need a good video card. Nor do they need that much hard drive space. I would go for the cheapest price when it came down to these componenents.

The computer chassis was the same thing. I would pay the extra money to get an ATX case, since they were far superior to old AT style cases, but still I would only spend about $30 on it. (Looking back on it, it was no wonder I cut myself so many times on jagged sheet metal found in cheap cases).

I recently discovered why Antec and other major case manufacturers charge upwards of $100 for their cases. I purchased the Antec P160 from Microcenter for $108.00 - $40 MIR = $68. Not bad, considering NewEgg had it for $115. Soon after I found that CompUSA had it for $60, but oh well. Who shops there anyway? Anyway, I'm getting side tracked. Here's a picture of the case:



Sure it looks nice from the outside, but is it worth $100 just from the front? Absolutely not. Sure the asthetics are nice, and the Power button / usb ports are cleverly positioned at the top of the case, but I can find an equally pleasing case for $40 or so from DealSonic. What's inside is even greater than the exterior.

First thing I noticed: When they say aluminum... they mean it. The whole thing is made of 2mm rolled aluminum. Most aluminum cases I had dealt with before had aluminum side panels or something. This is way better quality.

The hard drive cage is rotated perpendicular to the case, to allow easier access to the drives. You can see this in the next picture:



This is very clever. Though I have heard people have space issues when it comes to connecting SATA hard drives, but I don't have any of these. Not to mention you could easily stick SATA hard drives in the 3.5" slot below the floppy. The drive cage has rails for these sliding frames that you attach to the hard drives. Then you just slide the drive it and it clicks and locks. Easy!

The 5.25" drive bays have the same rail system. Man, I'm starting to love this case! In front of the hard-drive cage (which is detachable, by the way) is space for a fan. Hrmm, how can I get a fan in there, I wonder. I unscrew the thumbscrew on the panel seen in the picture and the piece slides out! The fan can screw into this metal frame and slide right into place. The thumb screw even stays attached to the piece so you won't lose it.

As for the fan on the back, it is attached by 4 rubber screws that you just pull through until they fan out, then you cut of the excess rubber hanging out the back. This gives you a fan that doesn't actually touch the chassis. They advertise that this is a quiet fan, but I have yet to ascertain that fact. I know that the rubber screws will definitely help.

The motherboard tray comes out to make installation easy. It includes 2 temperature sensors that you can place where you like, and the front panel houses a washable dust filter. 2 of the 5.25" drive bays have fake bezels to make your drives look uniform. I like this idea, but I have seen some crappy ones in the past, so I hope these function like they should.

The only thing I could ask for would be to replace the thumb screws on the PCI panel and replace them with the pci clamps. I saw those on a couple Thermaltake cases. (The Tsunami dream was my 2nd choice, but I really didn't want a door in front of my optical drives.)

So, I finally realized, after more than a decade of building computers, that the case is the same as just about any other component in a computer: you get what you pay for. Sadly I feel that I am not surprising anyone here. I just thought I would share my excitement with my new case.

0 Comments:

Post a Comment

<< Home

Wednesday, August 25, 2004

ahh, first week of classes

There is nothing like the bombardment of fraternaties and organizations that hound you into joining or donating or whatever. I often see signs like NBSA (National Black Student Association) or HSA (Hispanic Student Association)... and there are many others. In fact, I think there is one for just about every race out there, except white. Why is this? Because if there was a National White Student Association, it would be considered racist. Hrm, what is wrong with us?

0 Comments:

Post a Comment

<< Home

Tuesday, August 24, 2004

rentacoder is my friend

I am really liking rentacoder.com (why didn't I find this sooner?).... it's nice to be able to make a few hundred extra dollars per month for doing what I love: coding.

My only issues are that the RAC fee is huge, and that when they pay me, Paypal takes a tiny bit as well! Good god, by the time I get my money it will have diminished almost 20%!

0 Comments:

Post a Comment

<< Home

different browsers

I finally made the switch from IE (long-time user) to Mozilla Firefox and I can't believe I didn't do this sooner! IE is very annoying compared to Firefox, and is riddled with security flaws. My favorite feature is how you can break out of framed pages, such as those that open from links inside hotmail messages.... very cool.

0 Comments:

Post a Comment

<< Home

Monday, August 23, 2004

mathematical proof that girls are evil

First we know that girls take time and money, so

girl = time X money

next we know that time IS money, so

time = money

substitute in for time in the first equation:

girl = money X money or girl = money^2

now we know that money is the root of all evil, so:

money = sqrt(evil)

and substitute in for the other equation

girl = money^2 and money^2 = evil thus:

girl = evil

That is the lesson of the day....

0 Comments:

Post a Comment

<< Home

ugh... first day of classes. What a day, my feet hurt.

0 Comments:

Post a Comment

<< Home