Sunday, November 29, 2009

Speeed Reader – a Google Reader WinMo client

Hi, just a quick note to tell you something about Speeed Reader, a very good Google Reader client for Windows Mobile. It will read your subscriptions and will sync your read/unread topics. Sharing topics through mail or twitter is easy and fast.

Please visit the site and try it, it’s great. You can follow Speeed Reader also here on twitter: http://twitter.com/SpeeedReader

Dev site: http://emuneee.wordpress.com/eeenno/speeed-reader/

hope this helps

a.

Thursday, November 19, 2009

Sql server getdate() – set to midnight

a very short note on a particular use of getdate() to obtain the today’s date with hours minutes and seconds set to midnight (00:00:00):

select dateadd(day, datediff(day, 0, getdate()), 0)

Friday, November 13, 2009

Facebook – wall post with Facebook Developer Toolkit, stream.publish

Just a c# sample that I find useful to have here – so that everybody around me can find it whenever needed :-)

public void Post(facebook.API fbAPI, string appLink)
{
    string response = fbAPI.stream.publish(
        " decided to go nuts.",
        new attachment()
        {
            name = "my application rocks",
            href = appLink,
            caption = "{*actor*}decided to go nuts.",
            description = "One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. http://indialimaalpha.blogspot.com/
",
            properties = new attachment_property()
            {
                category = new attachment_category() { text = "Take another action...", href = appLink }
            },
            media = new List<attachment_media>() {
                new attachment_media_image() { src = WebConfigurationManager.AppSettings["AbsolutePath"] + "images/go_joseki.jpg", href = appLink }
            }
        },
        new List<action_link>() {
            new action_link() { text = "Take Action!", href = appLink }
        },
        null,
        0);
}

Friday, November 06, 2009

Sql Server Restore

 

Some statements I found useful to recover a database backup applying some transaction logs (had to step into this due to a wrong delete operation on a production database – no, it wasn’t me…).

RESTORE DATABASE [TheDatabase]
FROM DISK = 'D:\foldername\bak\FULL_20091102_024436.bak'
WITH
MOVE 'TheDatabase_Data' TO 'D:\Program Files\Microsoft SQL Server\MSSQL\Data\TheDatabase_Data.mdf',
MOVE 'TheDatabase_log' TO 'D:\Program Files\Microsoft SQL Server\MSSQL\Data\TheDatabase_Log.ldf',
NORECOVERY

RESTORE LOG [TheDatabase] FROM DISK = 'D:\foldername\bak\20091102_060214.bak' WITH NORECOVERY

RESTORE LOG [TheDatabase] FROM DISK = 'D:\foldername\bak\20091103_180221.bak' WITH NORECOVERY

[…]

RESTORE LOG [TheDatabase] FROM DISK = 'D:\foldername\bak\20091105_000219.bak' WITH NORECOVERY

RESTORE LOG [TheDatabase] FROM DISK = 'D:\foldername\bak\20091105_060204.bak' WITH RECOVERY

Some comments: the NORECOVERY option used in all the statement but one causes Sql Server to leave the db in a non operational state; this is needed because we will apply other restore statements. In the last one I use the RECOVERY option, in order to put the database in operational state.

Obviously this is only a little part of the big big world of database maintenance: just to say, give a look at the RESTORE command syntax… http://msdn.microsoft.com/en-us/library/ms186858.aspx

Bye!