Some funny Ascii arts

January 21, 2010

/facepalm

……………………………………..________
………………………………,.-‘”……………….“~.,
………………………..,.-”……………………………..“-.,
…………………….,/………………………………………..”:,
…………………,?………………………………………………\,
………………./…………………………………………………..,}
……………../………………………………………………,:`^`..}
……………/……………………………………………,:”………/
…………..?…..__…………………………………..:`………../
…………./__.(…..“~-,_…………………………,:`………./
………../(_….”~,_……..“~,_………………..,:`…….._/
……….{.._$;_……”=,_…….“-,_…….,.-~-,},.~”;/….}
………..((…..*~_…….”=-._……“;,,./`…./”…………../
…,,,___.\`~,……“~.,………………..`…..}…………../
…………(….`=-,,…….`……………………(……;_,,-”
…………/.`~,……`-………………………….\……/\
………….\`~.*-,……………………………….|,./…..\,__
,,_……….}.>-._\……………………………..|…………..`=~-,
…..`=~-,_\_……`\,……………………………\
……………….`=~-,,.\,………………………….\
…………………………..`:,,………………………`\…………..__
……………………………….`=-,……………….,%`>–==“
…………………………………._\……….._,-%…….`\
……………………………..,

/moo

…………….(___)……….
……………..|Oo|………..
………. /““ OO)………
………/ |____– …….Moooo
…….*…L……L………….

/Oly

……………………„–~*”¯. . . . . . . . . ¯”"*~-„„…………………………
………… ……„-*¯. . . . . . . . . . . . . . .”".„„–„„¯”~-„………………………
…………. .,-” . . . . . . . . . . . . . . . . . . . .”". .”"„„- “~,…………………………………
…………..,- , . . . . . . . . . : : .„-~**~„ . . . . . . . . “” „„-”-,………………………………
………,-”¯ . . .”. . „ . . . . . . : :,/ . . . . .’\ . . . . . . . . . . .”„„ ‘-,……………………………
……../::::_„„„_ : : : :~ . . . . . : | . . O . .,\ . . . . . . . . . . . „”"-„ \……………………
……..|:,-”: : : :”-, : : : . ‘,. . . . .”-,„__„„-” .” . . . . . . . . . . . .”"„-’\…………………
……..” … . : : : : ‘\,; : : : :’\,. . . . . . . . . . . . . . . . . . . . . . ., .” \……………………
……………. . . : : \::;;;; : : :’\, . . . . . . . . . . . . . . . . . . . . . , “„ \………………..
…………………. :/:::;;;;;;;;;:::’\, . . . . . . . . . . . . . . . . . . . : :’, \ |………………
…………………,-’:::;;;;;;;;;;;;;; ) . . . . . . . . . . . . . . . . . . : : ‘ „ – |………………
………………„-’:::;;;;;;;;;;_„„„–” : . . . . . . . . . . . . . . . . : : , ‘ „ ‘,’ |……………
………….„„~”_„„–~~**”¯- – ” . . . . . . . . . . . . . . . . . : : : :„ „ “,”, \………………
………,-”¯:¯¯:::::_„ ; : : : : : . . . . . . . . . . . . . . . . : : : : „ ‘ ,’ „” , . \……………………
………”—~~*”"¯/ : : : : : : : : : . : : : : : : : . . : : : : : : : ‘ „” ,’„ \ , ‘ . ,\…………………
…………………/ : : : : : : : : : : : : : . . . . . . . : : : : : :’, ,” – , ‘„ , ‘ , ‘, “-,………………
………………../ : : : : : : : : : . . . . . . . . : : : : : : : : – , ‘ ” – ‘ , ,- ‘, „ . ‘-, “-,…………
………………,’ : : : : : : : : : : . . . . . . . : : : : : : : : : :- ,’ “„ ‘ , ” – ‘ -, ” – ‘, – ,”-,………
……………../ : ‘, : : : : : : : : . . . . . . . : : : : : :, : : ” , -, ‘ “” „ “, .” ,’,” . ‘, ” ‘, . .”-,……
…………………’, : : : : : : : . . . . . . . : : : : : : : : „ . .” ,’ – .„„ ,’ „ . .,” “, . .” ‘„ ‘ . . .”-,
………………..,’.\ : : : : : : . . . . . . . : : : : : ,’ . . ” . . , ‘ – . , , . ,” -” . ‘ . “” . ‘, “„ – . . “
…………………. | : : : : : : . . . . . : : : : : . ‘, . . .: : ‘ . ‘, . : . : . “‘ . . . . . : :„ : ” . . . : : .”
…………………..’, : : : : : . . . . . : : : : :, -„,’ , ‘ . . . . .”, . : : -, . ,, . „ . . . – „ . ., . .„ ‘,

…………………………………….__,,,,,,,—,,,,,,_……………
…………………………_,,,–~’’¯¯ ; ; ; ; ; ; ; ; ; ; ;¯’’-,,_……………
…………………….,-~’’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;¯’~,_……………
…………………,-‘’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;’’~-,,……………
……………..,-‘’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; _,,_ ; ; ;¯’-,……………
…………..,-‘’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;,-‘’_ ¯’-,\ ; ; ; ; ‘,…………
…………,’ ; ; ; ; ; ; ; ; ; ;,,-~’’’’’~-,, ; ; ; ; ; ; ; ; ; ; ; ; ;’-‘;;;’, : :| |; ; ; ; ; ‘,………
……….,-‘ ; ; ; ; ; ; ; ; ;,-‘/ :,-~’’~, : ‘,, ; ; ; ; ; ; ; ; ; ; ; ; ;’-,-‘ : // ; ; ; ; ; ;’,………
……..,-‘ ; ; ; ; ; ; ; ; ; ;’,| : ‘-,;;;;,-‘ : /’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ¯’’’¯ ; ; ; ; ; ; ; ‘-,………
…….,’ ; ; ; ; ; ; ; ; ; ; ; ;’’-,,___,,-~’ ; ; ; ; ; ; ; ; ; ;’’~,, ; ; ; ; ; ; ; ; ; ; ; ; ; ;’-,………
…….| ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;-,;;’, ; ; ; ; ; ; ; ; ; ; ; ; ; ;’-…………
……,’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;-;;;;| ; ; ; ; ; ; ; ; ; ; ; ; ; ; |…………
……| ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ,,-‘,;;;;|’’-~ ; ; ; ; ; ; ; ; ; ; ; ; ‘,…………
……| ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;—,,,,,,,_,,,,-~’’, ‘-,;;;| ,,-‘ ; ; ; ; ; ; ; ; ; ; ; ; ;’,………
……| ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;¯’’~-,,,_ , , , , , , ‘,;,’,’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;\…………
……| ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;’’-,~-,, , ,,’’,’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;’,…………
……’, ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ‘’-,,¯’’;;;;| ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;’,…………
…….| ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;’’-,_,’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ‘,………
…….’, ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;’,…………
……..’, ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; \…………
………\ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ‘,…………
……….’, ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;|…………
………..| ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;’-,…………
………..’, ; ; ; ; ; ; ; ; ,,–~~–,, ; ; ; ; ;,——–,, ; ,–~, ; ; ,,-~, ; ;,–,,;,,-~~-,, ; ; ; ; ; ;’,…
…………| ; ; ; ; ; ; ,-‘’ . ,,–,, . ‘-, ; ; ; ;| . ,-,, . ‘, | . . | ; ;’-, . .\,,/ . ./’-,,–, . ‘, ; ; ; ; ; ; ‘-,…
…………| ; ; ; ; ; ; | . .,’ ; ; ;’, . .| ; ; ; | . .’-‘ . ,-‘ | . . | ; ; ; ‘-, . . .,-‘ ; ;,-‘ . ,-‘ ; ; ; ; ; ; ; ‘-
…………’, ; ; ; ; ; ;’, . ‘-,__,-‘ . ,’ ; ; ; | . .|\ . .\ . | . . |___ ; ;} . . / ; ; ;’—-‘ ; ; ; ; ; ; ; ; ; ;’-,
………….| ; ; ; ; ; ; ;’-,,_ . ._,,-‘ ; ; ; ; |__| .\__\ ;|_____/ ; ;/__/ ; ; ; ; (¯) ; ; ; ; ; ; ; ; ; ; ;
………….’, ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;¯ ; ; ; ; ; ; ; ; ; ; ; ; ; ‘-,…
…………,’ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ,,_
…………| ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

{o,o}
|)__)
-”-”-
O RLY?

/You Fail

…………………………………………………………………………………………………..
…………………………………………………………………………………………………..
………………………„„„„„„„„_………………………………………………………………….
………………../“` /:::::::::::“`~,……….[YOU FAIL!!!]
………………/:::,/“`”””““– ,:::\……………………………………………………..
………………|::/ • • • • • • • • •|::::|…………………………………………………………..
……………….\| • •„„„_ – -_„„„ •|::/………………………………………………….___…..
……………….-|• • •õ-`|::|‘ -õ• •|:/|……………………………………………_-~“ • • • \..
……………….|;| • • • / • \ • • • | ;/………………………………….., —~“ • ` • • • • , /..
……………….`-| • • • ¯ ¯ • • • •|`…………………………………/` • • • • • •_•,•-““’…..
………………….\ • •`¯¯¯¯` •,,- |,………………………………/ • • • • • • /_,,__,,………
……………………`\ • • ¯• /-` / “~-,………….___………./ • •’~,,,_• `• • • •`|• •\……..
…………………….| •-¯¯¯ • /::::::::::::`/“¯/¯::::::::\……./• • • •• • • •\ /• • • |• • | \……
…………………,`:| •/¯¯\`~,/::::::::::::::/::::/::::/¯¯¯¯`-,_,| • • • • • • • |• • • •/• • •|•/……
…………….-~`:::|• /::::::\•/::::::::::::::/::/“::::::::::::::::::/ `-_¯¯“~`¯ /`• • / • • / /…….
….._..-~`/::::::::| •/:::::::/::::::::::::::/:::::::::::::::::::::::/:\ • •`-,,–,__/,__/,_, / ‘………
…/::::::::/:::::::::|/::::::::/:::::::::::::/:::::::::\::::::::::::::|::::\• •• •“~-~–~ ’………………
..|:::::::::|::::::::::|:::::::/:::::::::::::/::::::::::::\:::::::::::::|::::::\ • • • • • /………………….
./:\::::::::|::::::::::|::::::/::::::::::::/:::::::::::::::\:::::::::::::\::::::¯¯~~¯|…………………..
/:::\:::::::\::::::::::|::::/:::::::::::/:::::::::::::::::::“~-,_,,_______,__,-’……………………
::::\::::::::\:::::::::|:::/::::::::::/::::::::::::::::::::::::::::/………………………………………
:::::\:::::::::\:::::::|::/:::::::::/:::::::::::::::::::::::::::::/……………………………………….
:::::::\:::::::::\:::::|:/:::::::/:::::::::::::::::::::::::::::::/………………………………………..
:::::::::\:::::::::\:::|::::::/:::::::::::::::::::::::::::::::::/…………………………………………
::::::::::|::::::::::\:|::::/:::::::::::::::::::::::::::::::::::|………………………………………….
::::::::::|::::::::::::|:/::::::::::::::::::::::::::::::::::::::\………………………………………….
::::::::::|::::::::::::|:::::::::::::::::::::::::::::::::::::::::\…………………………………………
::::::::::|::::::::::::|::::::::::::::::::::::::::::::::::::::::::\………………………………………..
::::::::::|::::::::::::|:::::::::::::::::::::::::::::::::::::::::::\……………………………………….


C# Read Tab or Comma Delimited File to Dataset

December 18, 2009

Schema File:

Before you use DataAdapter, there is a catch – the driver (Jet.OLEDB) has default value for delimiter, in my case, it is comma, it will not recognize tab delimited file even you specify “FMT=TabDelimeted” in OLEDB connection string,

To change it, you can edit windows registry (see the url reference in this post), but sometimes you need to read comma delimited file too, so this is not a real solution.

Another solution is to add a reference to “schema.ini” file, which is located in the file uploaded folder (same folder as the file you are going to parse).

Format will be:

[filename.txt]

Format=TabDelimited

You can add multiple file references, so that will become:

[myfile1.txt]

Format=TabDelimited

[myfile2.txt]

Format=TabDelimited

For those Comma Delimited files, you can just skip this step.

Code to add file reference

// If text file is Tab Delimited, add file reference to “schema.ini” file

     if (rblDelimitedOption.SelectedValue == “1″)

     {

         cs.AddTXTFileSchema(saveFilePath, “schema.ini”, saveFileName);

     }

     public void AddTXTFileSchema(string filepath,string schemafilename, string filename)

    {

        FileStream fs = new FileStream(filepath + “/” + schemafilename, FileMode.Append, FileAccess.Write);

        StreamWriter sw = new StreamWriter(fs);

        sw.WriteLine(“[" + filename + "]“);

        sw.WriteLine(“Format=TabDelimited”);

        sw.Close();

    }

Now you can retrieve the dataset from Tab or Comma delimited file

OLEDB to fill in dataset:

/// Parse a TXT file, retrive all content and return as dataset. It is assumed the first row of csv file is the header.

    public DataSet ParseTXTFileWithHeader(string filepath, string filename)

    {

        DataSet ds = new DataSet();

        string conn_csv_str;

        conn_csv_str = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” + filepath + “;Extended Properties=’text;FMT=Delimited;HDR=YES’”;

        string sql_select;

        OleDbConnection obj_oledb_con;

        OleDbDataAdapter obj_oledb_da;

        obj_oledb_con = new OleDbConnection(conn_csv_str);

        obj_oledb_con.Open();

        sql_select = “select * from [" + filename + "]“;

        obj_oledb_da = new OleDbDataAdapter(sql_select, obj_oledb_con);

        obj_oledb_da.Fill(ds);

        obj_oledb_con.Close();

        return ds;

    }

Reference

http://social.msdn.microsoft.com/Forums/en/vblanguage/thread/f4abe22c-db28-4f3b-8c6d-50bb05b2e583


C# code to return a dataset from CSV File (No header)

August 12, 2009

    public DataSet ParseCSVFile(string filepath, string filename)

    {

        DataSet ds = new DataSet();

        string conn_csv_str;

       conn_csv_str = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” + filepath + “;Extended Properties=’text;HDR=NO;FMT=Delimited’”;

 

        string sql_select;

 

        OleDbConnection obj_oledb_con;

        OleDbDataAdapter  obj_oledb_da;

 

        obj_oledb_con = new OleDbConnection(conn_csv_str);

        obj_oledb_con.Open();

 

        sql_select = “select * from [" + filename + "]“;

 

        obj_oledb_da = new OleDbDataAdapter(sql_select, obj_oledb_con);

        obj_oledb_da.Fill(ds);

        obj_oledb_con.Close();

 

        return ds;

 

    }


10 Harsh Truths About Corporate Websites

February 11, 2009

http://www.smashingmagazine.com/2009/02/10/10-harsh-truths-about-corporate-websites/#comment-313215


C# Code parse youtube data feed example

December 12, 2008

http://latebound.blogspot.com/2008/01/youtube-api-parser-in-one-line-of-code.html


Silverlight 2.0 Image Binding error: AG_E_NETWORK_ERROR

December 12, 2008

I start building my first app follow the example from ScottGu, retrieving youtube data feed.

One problem I found is when I using Image Binding to get video thumnails, there is a Error:Sys.InvalidOperationException: ImageError error #4001 in control ‘Xaml1′: AG_E_NETWORK_ERROR

Here is Scott ’s code:

————————————————————-
var stories = from story in xmlStories.Descendants("story")
where story.Element("thumbnail") != null &&
!story.Element("thumbnail").Attribute("src").Value.EndsWith(".gif")
select new DiggStory
{
Id = (int)story.Attribute("id"),
Title = ((string)story.Element("title")).Trim(),
Description = ((string)story.Element("description")).Trim(),
ThumbNail = (string)story.Element("thumbnail").Attribute("src").Value,
HrefLink = new Uri((string)story.Attribute("link")),
NumDiggs = (int)story.Attribute("diggs"),
UserName = (string)story.Element("user").Attribute("name").Value,
};

-------------------------------------------------------------

The line: HrefLink = new Uri((string)story.Attribute("link")) is not working for me.

After checking the code, I found Image.Source property is expecting ImageSource Oject , not really uri object.  HrefLink should be defined as ImageSource Object, and the line should be:

HrefLink = new BitmapImage(new Uri((string)story.Attribute(“link”)))

 Then it works fine for me.


script.aculo.us – userful Javascript library

December 11, 2008

http://script.aculo.us/

Nice page effect.


40+ Tooltips Scripts With AJAX, JavaScript & CSS

December 11, 2008

Removing default namespaces from an XDocument

December 11, 2008

http://www.moggoly.me.uk/blog/post/Removing-default-namespaces-from-an-XDocument.aspx

This post gives a handy function to remove default namespace in Xdocument.

My problem was  Xdocument.Descendants(ElementName) failed to get result, and there are Namespaces in root element. 

 

   1: private XDocument RemoveNamespace(XDocument xdoc)
   2: {
   3:     foreach (XElement e in xdoc.Root.DescendantsAndSelf())
   4:     {
   5:         if (e.Name.Namespace != XNamespace.None)
   6:         {
   7:             e.Name = XNamespace.None.GetName(e.Name.LocalName);
   8:         }
   9:         if (e.Attributes().Where(a => a.IsNamespaceDeclaration || a.Name.Namespace != XNamespace.None).Any())
  10:         {
  11:             e.ReplaceAttributes(e.Attributes().Select(a => a.IsNamespaceDeclaration ? null : a.Name.Namespace != XNamespace.None ? new XAttribute(XNamespace.None.GetName(a.Name.LocalName), a.Value) : a));
  12:         }
  13:     }
  14: 
  15:     return xdoc;
  16: }

A simple comparison between Adobe AIR and MS Silverlight

December 9, 2008