LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

PHP: writing a dal the DAO way part 1

Since php supports OO I think we should follow the OO rules. SO I wrote a DAO layer like sun recommends it for it’s J2EE framework. So lets start with the Factory. lets put it in a folder dal. ```php <?php include_once( ‘constants.php’ ); require_once( ‘factory/DatabaseFactory.php’ ); class Factory { function getInstance () { static $instance; if (!isset($instance)) { $c = CLASS; $instance = new $c; } return $instance; }

Read More...

Compound Operators Or How T-SQL Is Morphing Into VB Or C#

C# is becoming more dynamic (like Python and Ruby) but now SQL is becoming more like C# (but with LINQ C# is becoming more like SQL) Confused? Good! SQL Server has added compound operators. Instead of writing SET @value = @value + 100 you can just do SET @value += 100 See that? I can see a lot of people writing Dynamic SQL already smiling. Really who wants to write code like this whole day long?

Read More...

SQL Server 2008 Adds ISO Week,TZoffset, Nanosecond And Microsecond To Datepart

I saw microsecond and nanosecond already in CTP5 but this is the first time I have seen ISO Week (ISO_WEEK) and Time Zone Offset(TZoffset), maybe I haven’t looked hard enough 🙂 Here are the datepart and abbreviations you have to use for the 4 new oness microsecond mcs nanosecond ns TZoffset tz ISO_WEEK isowk, isoww ISO_WEEK datepart ISO 8601 includes the ISO week-date system, a numbering system for weeks. Each week is associated with the year in which Thursday occurs.

Read More...

Interview/Exam questions part 2

Read my previous post. So let’s continue with question 4. This one builds on question 3. Make a class that inherits from Time and call it SportsTime. SportsTime should have a constructor like this SportsTime(int h, int m, int s, int hs). SportsTime has an added property called hundredthsofasecond. SportsTime also has a method called ToUniversalTime with hundredthsofasecond added to what we had before. SportsTime also has another method called TimeDifference which accepts a parameter SportsTime and calculates the difference between the parameter and the class you are in.

Read More...

Dear PHP-God(s)(ess)(esses)

Dear PHP-God(s)(ess)(esses), I would like to tell you a little story. Once upon a time there was a very nice programming language although they called it Basic. But Basic was not very userfriendly so they made it Visual. At the same time they added some real cool features. Features that made it a mature and responsible language. A nice language to write in. The two best features were SET OPTION EXPLICIT ON

Read More...

Interview/exam questions

Working for the government has it’s pros and cons. The con being that if you want to have a promotion then you have to do an test. So this morning I had the first of two tests for this promotion, meaning that this was the basic test on 20 out of 200 points to be won. This was for analysts and programmers alike. The second part will be more discriminatory. So lets not bore you with question number 1 and 2 (who writes use cases anyway).

Read More...

SQL Server 2008 Release Candidate 0 Available To The General Public

SQL Server 2008 Release Candidate 0 has been made available to the general public. There are 2 versions (and 3 flavors of each) ISO or DVD Download it here: http://www.microsoft.com/downloads/details.aspx?FamilyId=35F53843-03F7-4ED5-8142-24A4C024CA05&displaylang=en Don’t forget to also visit the SQL Server 2008 Release Candidate 0 connect site here: https://connect.microsoft.com/SQLServer/content/content.aspx?ContentID=5395

Read More...

Do you have any questions for Paul Nielsen or Louis Davidson

Paul Nielsen and Louis Davidson have agreed to be interviewed on Less Than Dot. Paul Nielsen is the author of SQL Server 2005 Bible and blogs at http://sqlblog.com/blogs/paul_nielsen/default.aspx. Louis Davidson is the author of Pro SQL Server 2005 Database Design and Optimization and he blogs at http://sqlblog.com/blogs/louis_davidson/default.aspx. Both of these authors have 2008 editions of their book coming out this year. So do you have anything in mind that you would like to ask them?

Read More...

SQL Dependency tracker and pretty pictures

Today I finally got SQL-Toolbelt from RedGate Software and I just had to play with it a bit. I especcially liked the dependency tracker and the pretty picture it produced from my Database. Look. Isn’t it pretty? It’s art :p.

Read More...

Visual studio got tired

I know when VS is tired. Everytime I get this little message it needs a rest. **Error 3 Visual Basic compiler is unable to recover from the following error: System Error &Hc0000005& (Visual Basic internal compiler error) Save your work and restart Visual Studio.** It normally only does that once a day, and I have given up on sending the error to microsoft. I bet noone reads them anyway.

Read More...