Archive

Archive for December, 2014

2014 in review

December 30, 2014 Leave a comment

The WordPress.com stats helper monkeys prepared a 2014 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 50,000 times in 2014. If it were a concert at Sydney Opera House, it would take about 19 sold-out performances for that many people to see it.

Click here to see the complete report.

Categories: Uncategorized

Read extended properties of a file in C#

December 10, 2014 1 comment

You need to make a reference to the COM library “Microsoft Shell controls and automation”

[STAThread]
public static void Main(string[] args)
{
List<string> arrHeaders = new List<string>();

Shell32.Shell shell = new Shell32.Shell();
var strFileName = @”C:\Users\Fiach\Desktop\sample_iTunes.mov”;
Shell32.Folder objFolder = shell.NameSpace(System.IO.Path.GetDirectoryName(strFileName));
Shell32.FolderItem folderItem = objFolder.ParseName(System.IO.Path.GetFileName(strFileName));

for (int i = 0; i < short.MaxValue; i++)
{
string header = objFolder.GetDetailsOf(null, i);
if (String.IsNullOrEmpty(header))
break;
arrHeaders.Add(header);
}

for (int i = 0; i < arrHeaders.Count; i++)
{
Console.WriteLine(“{0}\t{1}: {2}”, i, arrHeaders[i], objFolder.GetDetailsOf(folderItem, i));
}
Console.ReadLine();
}

Categories: Uncategorized

HTTP POST using PHP

December 4, 2014 Leave a comment

$url = ‘https://posttestserver.com/post.php&#8217;;
$data = array(‘key1’ => ‘value1’, ‘key2’ => ‘value2’);

// use key ‘http’ even if you send the request to https://&#8230;
$options = array(
‘http’ => array(
‘header’ => “Content-type: application/x-www-form-urlencoded\r\n”,
‘method’ => ‘POST’,
‘content’ => http_build_query($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo($result);

—- And the cool thing is that posttestserver.com lets you see what you posted to it. cool service!

Categories: Uncategorized