Joe Cincotta: Thoughts and such…

Icon

Nerdism for the masses.

DemoVibes 4 Rocks My Bollocks! / Finally an HVSC Update / iTOKCore Update / Invite

Its true, thanks to Willbe for Demo Vibes Volume 4. My office has taken a severe pounding from my subwoofer thanks in no small part to Willbe’s music selection for this latest DV mix disc.



I also managed to squeeze some moments in to my present state of complete overwhelme to update my HVSC mirror to update 41! You can find it here… What is HVSC? Look here to start with.

Gearing up to roll out 2.3.2 of iTOKCore and new versions of the customer and employee thin clients. Actually, I started using Cygwin for managing what used to be native unix apps on the Windows boxes (compiled under GCC).

Eventually I am thinking that I would like to try running the VNC reflector activation framework on Linux using Mono to handle the windows server interop using web services and POSIX process activation. I have a feeling its going to have to be written using Java and I am going to have to create a simpler interop framework using Apache. We’ll see.


Oh, its Sebastian’s third birthday soon… check out the invite!

Filed under: Uncategorized

Recent Work / Implementing the Singleton Pattern in C#

Its been a while – I know. Things are crazy hectic right now so not much time to post. So here is some recent work: DPM New Website and Glenn Hughes Accountants are both little projects which were done very quickly. Also, just launched 2.2.1 of iTOKNet. Crazy times…

Implementing the Singleton Pattern in C#.

Definitely worth a read! I found that when I REALLY needed a truely single instance of a class in an AppDomain the traditional Java singleton pattern does not work in .Net as a true singleton. The multithreaded nature of the platform, especially web based .Net implementations such as web services or ASP; when the AppDomain starts a pool of threads is initialized and there can be many distinct instances of the ‘singleton’ running if you use the non thread-safe singleton approach defined in the above article.

Simple fix to a complex problem. Love it…

Filed under: Uncategorized

Welcome Luca! / I’m Back / BizBlox 0.9.8.3

Well, this explains why I have been a little quiet on the blog. Luca is the newest member of the family. What a cute little boy he is… Been looking after the other two and trying to keep on top of work things at night. Needless to say I am a little tired.



BizBlox 0.9.8.3 has been released today after I found doing some load testing that DOCollection had a memory leak in it! It has been resolved but this has had some impact for developers. You can read more about the update here.

Filed under: Uncategorized

For the exceptional amongst us…

You may have noticed that we are faced with a conundrum when using the framework provided by the .Net TimeZone class for inheritance; that is Public Overrides Function GetDaylightChanges(ByVal year As Integer) As System.Globalization.DaylightTime only returns one instance of DaylightTime.

What if you live in the southern hemisphere and daylight savings happens twice a year? (Jan 1 – March26 and then October 10 to Dec31) Um? Serious head scratch… That was an oversight Microsoft guys! Well, the workaround is to SWAP the Standard and Daylight times and offsets for Southern Hemisphere regions.

Example: For Sydney, say that it is Daylight time from March 26 to October 10 – but daylight time is UTC +10 and standard time is UTC+11 (it is actually +11 during the real daylight time) and rename your return values of standard and daylight names to be opposite to what you would expect. This creates a single (albeit inverted) DaylightTime class for any timezone. No matter how idiotic it ends up reading in your XML datafiles! It works…

Filed under: Uncategorized

.NET Generic TimeZone Management

Ever wondered how the hell you can have a ‘live’ timezone which understands its own daylight savings rules and handles localization without having to use .Net globalization?

The usual circumstance where this problem manifests itself is when deploying time sensitive applications on web servers. If you can store some simple timezone region info (a timezone label) for each user then you can perform locale agnostic conversions for the user as long as you store all your times as UTC… Just look up the label and use the TimeZoneFactory to create your timezone.

Use an XML datafile to popultate the TimeZone objects through the Factory. You can even have a RealTimeZone ListItemCollection helper for binding a list of RealTimeZones to a combo box.

Here is the core class without the creation factories – (ie: this is the hard part!):


Public Class RealTimeZone
  Inherits System.TimeZone

  Private Sub New()
  End Sub

  Private _GenericName As String
  Private _DaylightOffset As Integer
  Private _StandardOffset As Integer
  Private _DaylightStartMonthUTC As Integer
  Private _DaylightStartDayUTC As Integer
  Private _DaylightStartHourUTC As Integer
  Private _DaylightEndMonthUTC As Integer
  Private _DaylightEndDayUTC As Integer
  Private _DaylightEndHourUTC As Integer
  Private _DaylightName As String
  Private _StandardName As String

  Protected Friend Sub New(ByVal GenericName As String, ByVal DaylightOffset As Integer, ByVal StandardOffset As Integer, ByVal DaylightStartMonthUTC As Integer, ByVal DaylightStartDayUTC As Integer, ByVal DaylightStartHourUTC As Integer, ByVal DaylightEndMonthUTC As Integer, ByVal DaylightEndDayUTC As Integer, ByVal DaylightEndHourUTC As Integer, ByVal DaylightName As String, ByVal StandardName As String)
    Me._GenericName = GenericName
    Me._DaylightOffset = DaylightOffset
    Me._StandardOffset = StandardOffset
    Me._DaylightStartMonthUTC = DaylightStartMonthUTC
    Me._DaylightStartDayUTC = DaylightStartDayUTC
    Me._DaylightStartHourUTC = DaylightStartHourUTC
    Me._DaylightEndMonthUTC = DaylightEndMonthUTC
    Me._DaylightEndDayUTC = DaylightEndDayUTC
    Me._DaylightEndHourUTC = DaylightEndHourUTC
    Me._DaylightName = DaylightName
    Me._StandardName = StandardName
  End Sub

  Public ReadOnly Property GenericName() As String
    Get
      Return Me._GenericName
    End Get
  End Property

  Public Function RenderLocalTime(ByVal UTCTime As DateTime, ByVal timeFormat As String) As String
    Dim ot As DateTime = UTCTime.AddHours(GetUtcOffset(UTCTime).TotalHours)
    Return ot.ToString(timeFormat)
  End Function

  Public Function ConvertToLocalTime(ByVal SourceUniversalTime As DateTime) As DateTime
    Return SourceUniversalTime.AddHours(GetUtcOffset(SourceUniversalTime).TotalHours)
  End Function

  Public Function ConvertFromLocalTime(ByVal SourceLocalTime As DateTime) As DateTime
    Return SourceLocalTime.AddHours((GetUtcOffset(SourceLocalTime).TotalHours * -1))
  End Function

  Public Function GetUTCDayStart(ByVal Year As Integer, ByVal Month As Integer, ByVal Day As Integer) As DateTime
    Dim target As New DateTime(Year, Month, Day, 0, 0, 0)
    Return ConvertFromLocalTime(target)
  End Function

  Public Function GetUTCDayEnd(ByVal Year As Integer, ByVal Month As Integer, ByVal Day As Integer) As DateTime
    Dim target As New DateTime(Year, Month, Day, 23, 59, 59)
    Return ConvertFromLocalTime(target)
  End Function

  Public Function GetUTCDayStart(ByVal LocalDate As DateTime) As DateTime
    Dim target As New DateTime(LocalDate.Year, LocalDate.Month, LocalDate.Day, 0, 0, 0)
    Return ConvertFromLocalTime(target)
  End Function

  Public Function GetUTCDayEnd(ByVal LocalDate As DateTime) As DateTime
    Dim target As New DateTime(LocalDate.Year, LocalDate.Month, LocalDate.Day, 23, 59, 59)
    Return ConvertFromLocalTime(target)
  End Function

  Public Overrides Function GetDaylightChanges(ByVal year As Integer) As System.Globalization.DaylightTime
    Dim sdUTC As New DateTime(year, Me.DaylightStartMonthUTC, Me.DaylightStartDayUTC, Me.DaylightStartHourUTC, 0, 0)
    Dim edUTC As New DateTime(year, Me.DaylightEndMonthUTC, Me.DaylightEndDayUTC, Me.DaylightEndHourUTC, 0, 0)
    Return New System.Globalization.DaylightTime(System.TimeZone.CurrentTimeZone.ToLocalTime(sdUTC), System.TimeZone.CurrentTimeZone.ToLocalTime(edUTC), New TimeSpan(1, 0, 0))
  End Function

  Public Overloads Overrides Function GetUtcOffset(ByVal time As Date) As System.TimeSpan
    Dim dt As System.Globalization.DaylightTime = GetDaylightChanges(time.Year)
    Dim cmpStart As Integer = time.CompareTo(dt.Start)
    Dim cmpEnd As Integer = time.CompareTo(dt.End)
    If (cmpStart >= 0) And (cmpEnd     Return New TimeSpan(Me.StandardOffset, 0, 0)
  End Function

  Public Overloads Function GetUtcOffset() As System.TimeSpan
    Return GetUtcOffset(DateTime.UtcNow)
  End Function

  Public ReadOnly Property DaylightOffset() As Integer
    Get
      Return Me._DaylightOffset
    End Get
  End Property

  Public ReadOnly Property StandardOffset() As Integer
    Get
      Return Me._StandardOffset
    End Get
  End Property

  Public ReadOnly Property DaylightStartMonthUTC() As Integer
    Get
      Return Me._DaylightStartMonthUTC
    End Get
  End Property

  Public ReadOnly Property DaylightStartDayUTC() As Integer
    Get
      Return Me._DaylightStartDayUTC
    End Get
  End Property

  Public ReadOnly Property DaylightStartHourUTC() As Integer
    Get
      Return Me._DaylightStartHourUTC
    End Get
  End Property

  Public ReadOnly Property DaylightEndMonthUTC() As Integer
    Get
      Return Me._DaylightEndMonthUTC
    End Get
  End Property

  Public ReadOnly Property DaylightEndDayUTC() As Integer
    Get
      Return Me._DaylightEndDayUTC
    End Get
  End Property

  Public ReadOnly Property DaylightEndHourUTC() As Integer
    Get
      Return Me._DaylightEndHourUTC
    End Get
  End Property

  Public Overrides ReadOnly Property DaylightName() As String
    Get
      Return Me._DaylightName
    End Get
  End Property

  Public Overrides ReadOnly Property StandardName() As String
    Get
      Return Me._StandardName
    End Get
  End Property
End Class

Filed under: Uncategorized

My Sports Utility Vehicle! / Finally Firewall / Chiptunes are GO!

One of the best kids DVDs we have gotten is the Vegie Tales series. The kids love them and they are lots of fun. Gina bought a wooden Sports Utility Vehicle for Sebastian the other day and last weekend we painted it together. I tought him the basics of how to use the airbrush (he is nearly 3!) and he sorta got it first go – of course his favourite part was cleaning it since he gets to spray high pressure water at everything, but all the same, he did a great job on the vignette at the bottom of the bodywork. Had a great time doing it. I have been spending the last couple of nights doing the detail on it and coating it in clear lacquer to keep the paint job looking as good as it does now after he plays with it a bit. Just needs some chrome on the grille and another coat of lacquer and its good to go.

Aurora taught herself to walk during the weekend too – she was barely standing on Friday and by Sunday she was walking around the house and dancing. Its amazing – she clearly was able to do but just didn’t want to. Hey, if people would pick me up all the time I would hold off on walking too. Since she started later then Sebastian in the walking department, her center of gravity is much better – she has not fallen backwards once! I am sure her skull is happy about this – poor Sebastian had some doozies when he was learning to walk.

This weekend also FINALLY saw the end of our server woes with iTOK. We have gotten phase one of the cluster set up with the Fortigate firewall in place and the servers are now happier than ever. The Fortigate firewall is really a great buy! If you look at the features in comparison with something like Checkpoint – its about a tenth of the price and it really whoops its ass – easy to use yet deceptively powerful. I feel like I am only using 10% of what it can do since it protects our cluster and not our offices – it can do email filtering, web filtering and a whole lot more. I would recommend it for corporate offices more than server installations; however its good for both. Not much sleep on Friday night with all that going on.

Finally, this week is an official Module week. Starting with a legend: Reed – classic tunes from his group Fairlight. Some of these tunez have been in intros from groups such as Equinox et al, but he’s the man for smooth and funky 64K ditties! Check out his tune in this 64K Intro! SEXY animation, wonderful music and the usual mind bending 64K of compressed exe for what would have taken an SGI about a week to render 5 years ago. Gotta love it. Looking forward to the scene awards and presentations at BreakPoint2005. (Don’t forget to check out the BP05 invitro)…

Filed under: Uncategorized

About that Straight Eye Comment…

If you’re wondering what that comment was about – its this article in the SMH about some joking radio commentary regarding one of the stars of the TV show ‘Queer Eye For The Straight Guy’ which some people took WAY too seriously. And to make things worse, whilst the ABA says the comment was not in breach of the code of conduct – this Administrative Decisions Tribunal has come out demanding printing and verbal apologies.

My point is, imagine the outcry if there was a TV show called “Straight Eye for the Queer Guy” – but, hey, if its the other way around its quality watching. Mind you, I would rather have my testicles slowly mauled by a gaggle of rabid geese than watch that pathetic drawl.

If you STAR in a show calling yourself QUEER then one would expect you can have a sense of humor about being gay. In fact – I am pretty sure Carson CAN take the comments with a smile. Its politically ‘correct’ activists that think they act on everyone’s behalf that can’t. Sexuality is funny; Get a grip [pun intended].

Actually, now I think of it – I would really find ‘Straight Eye’ hilarious.

Filed under: Uncategorized

Tiny Personal Firewall Server Edition = Bad Move

Well, in and of itself, its not so bad. But I have spent a month fixing problems caused by a combination of things – firstly, there was an incorrect release of the software 6.0.56 (The consumer release is 6.0.4 at present) which we installed and had configured on the iTOK pilot server. It all worked well. Then hell broke loose.

We had hardware failure on the custom built server which was due (after some slooow process of trying to find the failing hardware and replacing each thing in the server piece at a time) to a faulty RAM unit. This caused a lot of problems for the technicians who were trying to use the software and intranet with frequent failure [BSOD].

Once the server was repaired, the BSODs continued… No more WMI hardware failure reporting, just BSODs. There was a note about AMD64 architecture and a PREVIOUS version of TPF6 causing BSOD so I downloaded the latest version. Hohum – its older than the one we were using… Hohoho! Its got a freaking completely different user interface.

No longer blue screens, instead, since the server is a Win2003 domain controller the entire permissions model on the machine is different from normal and the level of interprocess communication which has to happen on this server is insane – yeah, thanks for that Microsoft! Oh, did I mention that if you make the rules too loose on the firewall the SBS licensing server (embedded in Small Business Server) will detect other domain controllers in the datacenter (even though they have nothing to do with you) and SHUT DOWN! Nice one.

After spending days and days trying many configurations on the firewall we finally got something that seemed right – except it would slowly lock out the ASPNet user for no apparent reason. All of a sudden websites would stop responding, wierd stuff would happen and this firewall was tuned. We had everything you could imaging set up on this thing and it still would do this crazy stuff.

We had no option, remove TPF6 and look for a short term alternative before we set up the cluster environment in the datacenter. Ends up that I set up IP Filtering on the external adapter; just using Windows 2003 RAS setup. Did not use the firewall as that is even worse to set up. Just IP Filtering. Its TOO strict and the system can still not send email – but the new hardware is going in tomorrow so it should mean salvation.

Moral of the story – if you are going to use TPF6;
1/ Don’t use it on a domain controller – especially a Win2003 PDC with DNS AND ACTIVE DIRECTORY running.
2/ think twice before using on AMD64 architecture AT ALL.

Got some cool new VB.Net classes coming your way next week. Very useful XMLResource engine and ASP.Net ToolTip.

Filed under: Uncategorized

Straight Eye for the Queer Guy

Why the hell don’t we have Straight Eye for the Queer Guy? Because political correctness is a load of bollocks. Whilst I can’t stand 2UE (radio) they should be left the hell alone.

Filed under: Uncategorized

Storms / On the way to work…

Storms last night were so fearce that they started flooding the house – had to get up on the roof whilst it was storming to clear out the gutters. But no sooner had it come than it had gone… lucky – many others were not so fortunate.

The ride to work this morning was just so great – a chilly morning with a cold breeze blowing westerly off the mountains. My Triumph was purring… Did a powerslide out of ‘corner 2′ – wooot – those new Michelin’s just rock – then went past the beach on the way to the office (minor 1 minute detour)…

Eloura was closing out – most of the swell from the weekend had gone and the westerly wind was flattening out what was left. North Cronulla was looking nice – but small – there were a few guys out at Cronulla point and Shark Island but nothing serious seemed to be coming through, just some fun sets.

The sun on the water and they spray off the waves from the offshore with that crisp wind made for a glorious morning.

Amen.

…now get to work!

Filed under: Uncategorized

Follow

Get every new post delivered to your Inbox.