"Denial ain't just a river in Egypt."
Mark Twain (1835-1910)
brain jockey COD IV crysis dave barry desert eagle directx 10 directx 9 Emre Akoz Engin Ardic humor mods music philosophy politics quotes screen shots siyasal sosyoloji sourtimes stalker turkiye

Latest Updated Posts
1 Are you another one? Or are you just like the other one?
(269)
2Upgrade from Girlfriend v7.0 to Wife 1.0 / Girlfriend Versions
(794)
3 Upgrade from Girlfriend v7.0 to Wife 1.0
(496)
4 Dead iphone save trick
(436)
5Funnies / Saying Goodbye to Mother
(1,794)
6Funnies / George Carlin's Views on Aging
(1,016)
7 The Paradox of Our Times
(1,179)
8 The Art Of Peace | O Sensei
(929)
9 Meditation Is Not a Medicine
(1,172)
10 There Will Be a Way
(511)
Most Popular Posts
1Down at the Shooting Range | by the Delaware Water Gap / fernando
(397,488)
2brynn / re: brynn
(369,907)
3Down at the Shooting Range | by the Delaware Water Gap / brynn
(368,674)
4Down at the Shooting Range | by the Delaware Water Gap / brynn
(368,317)
5 Down at the Shooting Range | by the Delaware Water Gap
(264,858)
6Down at the Shooting Range | by the Delaware Water Gap / And Then There Were Trees, and Bullets, and Guns, and Horses, and Indians and Outlaws | What What West...
(215,911)
7Chevrolet Mako Shark Corvette Concept | 1961 / Corvette Stingray Sport Coupe | 1963
(53,314)
8 Chevrolet Mako Shark Corvette Concept | 1961
(48,502)
9Crysis Single Player Custom Maps / Crysis Warhead | The Expansion Pack
(17,241)
10S.T.A.L.K.E.R. Clear Sky | Screenshots (DX9) / S.T.A.L.K.E.R. Clear Sky | Screenshots (DX10 - DX10.1)
(16,226)
posts rssPosts RSS Add to Google
blog rssBlBlog RSS Add to Google
SokSa is a Microsoft WebSpark Member
Sign In
 
The Alarm that Cried 'Fire!'
icy; Wednesday, December 26, 2007Reads: 241
There is a fire alarm system in our building; as I am sure is the case with all other buildings on the island of Manhattan. Our fire alarm system, however is tested vigorously, which I sincerely hope is NOT THE CASE with other fire alarm systems on the same island. These are regular tests, maybe as regular as twice a month, a week, a day. Sometimes they do an upgrade of some sort and test if it works; sometimes there is a construction on one of the floors and they have to test it for operationality. Sometimes they just test it to test the test. The bottom line is we regularly are harrassed by the loud pitch of the audio and the flashes of the visual signals.

These tests are introduced with an announcement, something that would sound like: "We will be conducting a test on the fire alarm system. Please disregard all audio and visual signals. Again, this is a test of the public broadcast system..." - oh sorry, that's something else.

Most of the time, though, the tests are not introduced, but are rather preceeded by the announcement. We get the test first, and the information that the test was just a test and not a bad-ass fire afterwards.

The situation in our building is dire, as far as I can fathom. If we ever have a real fire, that fire alarm system will functions as it is supposed to; and I am pretty much sure that none of us will move our butts in the slightest manner, because we will be sure that it is "just a test" and that we are to "disregard all the audio and visual signals". We are so keen on these alarms that the lung piercing loud noise is just an ambient sound for most of us. The visual signals? Peh, I don't even notice them anymore. It's as if somebody is taking pictures inside, which is quite normal for our studio.

The bottom line is: we ALL WILL burn and die in this building, with the alarms blazing and lights flashing. No one will panic, start screaming and running. We'll just be sitting, listening to music with the headphones and sipping our coffees, trying to block out the alamrs, sure that it is just another test.

... there it goes again... now, where is my coffee...
Technorati Ping Request Confirm
icy; Sunday, December 02, 2007Reads: 255

I've been working on the "Ping Services" issue this Sunday afternoon. All for a higher good than this crummy site.

I'll post a nicely working C# code here later this evening so that you can have fun with it as well :)

Cheers

Code sample

I have an XML document containing a list of ping sites and the function below grabs it to loop through. Some ping sites accept different parameters, some don't so I just typed a copule of simple fields to enable / disable them. You can add / remove more nodes to extend the functionality.

XML document looks like this
<services>
  <service>
    <name>Google BlogSearch</name>
    <masquaradeName>SokSa.com</masquaradeName>
    <url>http://blogsearch.google.com</url>
    <methodName>weblogUpdates.extendedPing</methodName>
    <rssLink>True</rssLink>
  </service>
</services>

What my pinger does is after every post, depending on the type of the post, whether it's a blog post or a regular thread, it sends update request to all the registered ping services. The configuration XML defines what parameters are going to be sent and with what name. Almost all ping services take similar, if not same, parameters; but some enable more - like google - so the XML configuration comes quite handy.

private void SendPing(bool isBlog)
{
    System.Xml.XmlDocument blogPingList = new XmlDocument();
    blogPingList.Load("blogPingServices.xml");

    foreach (XmlNode service

in blogPingList.DocumentElement.SelectNodes("service"))
    {
        string ping = service.SelectSingleNode("url").InnerText;
        string url = "http://www.soksa.com";
        string siteName = service.SelectSingleNode("masquaradeName").InnerText;
        string methodName = service.SelectSingleNode("methodName").InnerText;
        string rssLink = service.SelectSingleNode("rssLink").InnerText;

        System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(ping);
        request.Method = "POST";
        request.ContentType = "text/xml";

        using (System.IO.Stream stream = (System.IO.Stream)request.GetRequestStream())
        using (XmlTextWriter xml = new XmlTextWriter(stream, System.Text.Encoding.UTF8))
        { 
             xml.WriteStartDocument();
             xml.WriteStartElement("methodCall");
             xml.WriteElementString("methodName", methodName);

             xml.WriteStartElement("params");

            xml.WriteStartElement("param");
            xml.WriteElementString("value", siteName);
            xml.WriteEndElement();

            xml.WriteStartElement("param");
            xml.WriteElementString("value", isBlog ? "http://www.soksa.com/default.aspx" : "http://www.soksa.com/threadList.aspx");
            xml.WriteEndElement(); 

            if (rssLink == "True")
            {
                 xml.WriteStartElement("param");
                 xml.WriteElementString("value", isBlog ? "blog.rss" : "posts.rss");
                 xml.WriteEndElement(); 
            }
 
            xml.WriteEndElement();
            xml.WriteEndElement(); 
        } 
    }
}

What'smissing from this system is the response coming back from the ping services. I should also take action on Exceptions, for which I did not care a lot for this pretty exercise.

Cheers

Archive
Aug 2010[4]
Jul 2010[4]
Jun 2010[3]
May 2010[5]
Apr 2010[2]
Mar 2010[1]
Feb 2010[4]
Jan 2010[4]
Dec 2009[6]
Nov 2009[2]
Oct 2009[4]
Sept 2009[10]
Aug 2009[2]
Jul 2009[7]
Jun 2009[2]
May 2009[2]
Mar 2009[5]
Feb 2009[5]
Jan 2009[3]
Dec 2008[4]
Nov 2008[6]
Oct 2008[3]
Sept 2008[2]
Jul 2008[1]
Jun 2008[2]
May 2008[1]
Feb 2008[3]
Jan 2008[2]
Dec 2007[2]
Nov 2007[3]
Oct 2007[4]
Click here to add this blog page to your technorati favorites

[SokSa]Icy© 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010

I've been coding this site for myself since 2004. It will never be complete. I have accepted this. I'll always take one look at any part of it and wonder why I did what I did the way I did it and not this other way that could've been, not necessarily better, but, what if... Or some new framework will be released and I will be tempted to use the "new" one instead of the old one. If it ain't broke, don't fix it. There is much truth to these words.

"A tailor can never mend his own dress." - Turkish proverb.

du dud di?

Your Ad Here