Blog

  • Bootcamp Time Difference Between Mac OS And Windows

    This is what you need to do in order to fix the time when booting in Mac OS:

    1. Create new file /sbin/localtime-toggle with the following contents:

    #!/bin/sh
    
    to_utc() {
    echo "localtime-toggle: Toggling to UTC."
    date -f %m%d%H%M%Y `date -u +%m%d%H%M%Y`
    }
    
    to_localtime() {
    echo "localtime-toggle: Toggling to localtime."
    date -u -f %m%d%H%M%Y `date +%m%d%H%M%Y`
    }
    
    trap 'to_localtime; exit' term
    to_utc
    { while true; do sleep 86400; done; } &
    wait

    2. Ensure that localtime-toggle is executable:

    chmod +x /sbin/localtime-toggle

    3. Create new file /System/Library/LaunchDaemons/org.osx86.localtime-toggle.plist with the following contents:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
       <key>Label</key>
       <string>org.osx86.localtime-toggle</string>
       <key>Program</key>
       <string>/sbin/localtime-toggle</string>
       <key>KeepAlive</key>
       <true/>
       <key>RunAtLoad</key>
       <true/>
       <key>HopefullyExitsFirst</key>
       <true/>
    </dict>
    </plist>

    4. Reboot.
    At this point, your computer’s clock should correctly be set to UTC as Leopard boots, and reset back to local time as Leopard shuts down.

  • Bootcamp Problem on Windows 7 with Audiodg.exe High CPU Usage

    BootcampDid you recently installed Windows 7 on your Mac Book Pro and experience problems while watching movies or YouTube videos? This problem is comming from your audio drivers. It seems that whenever you play something on your laptop and because the microphone is always open your sound card is trying to eliminate noise and this causes audiodg.exe to use some times more than 30% of the CPU.

    So here is what you have to do to be able to use your laptop with no problem!

    Disabling Audio Effects

    In order to fix the high CPU usage, I disabled the audio enhancements processed by the audiodg.exe file. To disable the audio enhancements, use the following steps:

    1. Right-click the speaker icon in the lower right corner.
    2. Select Playback Devices from the menu. A list of devices should appear on the screen.
    3. Double-click the device that has a green checkmark. The properties windows for that device should open.
    4. Click the Enhancements tab at the top.
    5. From the list of enhancements, uncheck all of them, or click the Disable all enhancements checkbox.
    6. Click the OK button to save your changes and close the window.
    7. Click OK to close the Playback Devices window.

    Once I disabled the enhancements, the movie played without any issues. I also didn’t notice any difference in sound with the enhancements disabled. If I do want to use sound enhancements, I’ll stick to the the options provided in the application. Something else you could try is disable the microphone if you do not use it, although I have not tested this myself.

  • LINQ to SQL Get DateTime from Sql Server (getDate)

    Ever wanted to get the current time and date from the SQL Server to avoid different times between yous server and the clients (for example having a centralized application running on many countries) ?

    Using LINQ to SQL there is no way to get the time from the database build in the class. What you need to do is write your own code as the example below:

        using System.Data.Linq;
        using System.Data.Linq.Mapping;
        using System.Data;
        using System.Collections.Generic;
        using System.Reflection;
        using System.Linq;
        using System.Linq.Expressions;
        using System.ComponentModel;
        using System;
    
        partial class dbGTOnlineDataContext
        {
            [Function(Name = "GetDate", IsComposable = true)]
            public DateTime GetSystemDate()
            {
                MethodInfo mi = MethodBase.GetCurrentMethod() as MethodInfo;
                return (DateTime)this.ExecuteMethodCall(this, mi, new object[] { }).ReturnValue;
            }
        }
    

    Then anywhere in your code you can simple use the code below to get the time from the SQL Server database:

    myDatabaseDataContext db = new myDatabaseDataContext();
    DateTime dtNow = db.GetSystemDate();
    
  • Digital TV (DVB-T) On your Media Center PC (MPEG4)

    Windows Media CenterAbout a month ago in Greece most of the TV Channels changed their broadcast type to Digital (DVB-T). I was waiting for this change for quite some time now since i have my Media Center PC connected at a Projector (720p).

    On the date of the change i turned my Antenna and started to search for the Digital channels from my Windows Vista installation only to see that my TV Tuner found all the channels, the TV Guide was dispayed correcly but no sound or image was displayed in any of the channels (some had only sound).

    After upgrading the system with the latest windows updates and also installed all the codecs i could think of I started thinking that the problem was with my TV Tuner (WinTV-HVR-1300). After quite some time searching in forums and blogs and even though most of the posts were suggesting that i need to buy a new more recent TV Tuner I found someone that was suggesting updating to Windows 7.

    After doing that everything worked as a charm. As it turns out Earlier Windows (up to Windows 7) do not support MPEG4 and H.264 for live TV. And there is nothing you can do that would work correcly other than upgrading your system.

    So if you want to be able to see DVB-T Channels with MPEG4 and H.264 Encoding on your Media Center PC you have to upgrade to Windows 7!

  • Crystal Reports & Framework 4 (Could not load file or assembly crdb_adoplus.dll)

    If you upgrade your project to .NET Framework 4 or for any reason you get a mysterious error like the one below:

    “Could not load file or assembly ‘file:///C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll’ or one of its dependencies. The system cannot find the file specified.”

    Try inserting the code below at your app.config or web.config file:

    <startup useLegacyV2RuntimeActivationPolicy="true">
            <supportedRuntime version="v4.0"/>
    </startup>
    It seems that microsoft changed the binding procedure and this setting changes that.




  • App Store Greece #2 on Paid apps (SMSTrack Greece)

    After a couple of days of advertising and a lot of help from our friends we found ourselfs #2 on the Top 10 Paid apps!

    Smart idea and it is something that we all miss from the good old days!

    SMSTrack Greece #2 App Store

  • App Store Greece #1 on Free apps (Arvyla Sounds Player)

    We have managed to get to the top in just one day back then the original application was releashed and now we have dropped on 2nd place!

    We are currently working on an update with more sounds…!!! Stay tuned…

    Arvyla Sounds Player Top Free App

  • How to get day of the week from a datetime in SQL Server

    The day of the week can be retrieved in SQL Server by using the DatePart function. The value returned by function is between 1 (Sunday) and 7 (Saturday). To convert this to a string representing the day of the week, use a CASE statement.

    Method 1:
    Create function running following script:

    CREATE FUNCTION dbo.udf_DayOfWeek(@dtDate DATETIME)
    RETURNS VARCHAR(10)
    AS
    BEGIN
    DECLARE @rtDayofWeek VARCHAR(10)
    SELECT @rtDayofWeek = CASE DATEPART(weekday,@dtDate)
    WHEN 1 THEN 'Sunday'
    WHEN 2 THEN 'Monday'
    WHEN 3 THEN 'Tuesday'
    WHEN 4 THEN 'Wednesday'
    WHEN 5 THEN 'Thursday'
    WHEN 6 THEN 'Friday'
    WHEN 7 THEN 'Saturday'
    END
    RETURN (@rtDayofWeek)
    END
    GO
    

    Call this function like this:
    SELECT dbo.udf_DayOfWeek(GETDATE()) AS DayOfWeek
    ResultSet:
    DayOfWeek
    ———-
    Monday

    Method 2:

    SELECT DATENAME(dw, GETDATE())

  • Clear all your SQL Server database with just 6 lines of T-SQL

    This is a SQL Script that Cleans your Database Records & resets Identity Columns, and it is all in 6 lines!

    /*Disable Constraints & Triggers*/
    exec sp_MSforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'
    exec sp_MSforeachtable 'ALTER TABLE ? DISABLE TRIGGER ALL'
    
    /*Perform delete operation on all table for cleanup*/
    exec sp_MSforeachtable 'DELETE ?'
    
    /*Enable Constraints & Triggers again*/
    exec sp_MSforeachtable 'ALTER TABLE ? CHECK CONSTRAINT ALL'
    exec sp_MSforeachtable 'ALTER TABLE ? ENABLE TRIGGER ALL'
    
    /*Reset Identity on tables with identity column*/
    exec sp_MSforeachtable 'IF OBJECTPROPERTY(OBJECT_ID(''?''), ''TableHasIdentity'') = 1 BEGIN DBCC CHECKIDENT (''?'',RESEED,0) END'
  • Windows Live Messenger on Windows XP x64

    Today I lost about 2 hours trying to find a way to run the latest Messenger version on my Windows XP 64bit installation since the old version i had (8.5) stopped working for no apparent reason. It seems that Microsoft stopped the support for 8.5 clients (I was prompt to update and could not log in). After searching on google i managed to find an MSI with the latest windows live version and installed it but still I could not log in and got a weird error. Searching a bit more i found out that you have to also install another MSI provided by Microsoft called Contacts-ship-neutral. After that everything works as a charm! So to sum up here is what you need in order to run Windows Messenger Live (14.0.80889.726) on Windows XP 64bit:

    1. Download and install the latest Microsoft Windows Live Messenger version in MSI form (.msi)
    2. Download and install Contacts-ship-neutral.cab from Microsoft

    I hope I’ll same some of you a lot of time searching for a solution!

    To save you some extra time here is a link to download those files…