Sunday, May 09, 2010

Some photos from Think Next 2010

Some photos from Think Next 2010:

Portable sonar device, enable to show people locations through walls:


Big touch-screen device:


Technorati Tags:

Wednesday, March 10, 2010

Solution for "Impossible to log SQL 2008 performance counters under Windows 2008 64 bit?"

Alex Pinsker: Impossible to log SQL 2008 performance counters under Windows 2008 64 bit?


Here is solution, found by our DBA:
1. Open regedit.exe
2. Find the key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLSERVER\Performance"
3. Find the value named "Performance counters disabled"
4. Ensure, that its value is NOT "4" or "1". If it is - enforce it to "0"
5. Notice file name in value of "PerfIniFile" key and copy it to clipboard
6. Close the regedit
7. Open cmd and go to Binn folder of Sql Server installation. Usually in "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn"
8. Run the following commands:
8.1 unlodctr mssqlserver
8.2 lodctr [clipboard filename from (5.) above]
8.2.1 lodctr [clipboard filename from (.5) above]
(this only needs for sure, that counters are installed - there will be a message notifying on that)
8.3 lodctr /T:mssqlserver
9. Restart the server
10. Use perfmon to ensure, that counters for Sql Server reappeared

Monday, March 01, 2010

blog ping list

Long blog ping list - compiled from few sources:

http://1470.net/api/ping
http://api.feedster.com/ping
http://api.moreover.com/ping
http://api.moreover.com/RPC2
http://api.my.yahoo.com/RPC2
http://api.my.yahoo.com/rss/ping
http://bblog.com/ping.php
http://bitacoras.net/ping
http://blog.goo.ne.jp/XMLRPC
http://blogdb.jp/xmlrpc
http://blogmatcher.com/u.php
http://blogsearch.google.com/ping/RPC2
http://bulkfeeds.net/rpc
http://coreblog.org/ping/
http://mod-pubsub.org/kn_apps/blogchatt
http://ping.amagle.com/
http://ping.bitacoras.com
http://ping.blo.gs/
http://ping.bloggers.jp/rpc/
http://ping.blogmura.jp/rpc/
http://ping.cocolog-nifty.com/xmlrpc
http://ping.exblog.jp/xmlrpc
http://ping.feedburner.com
http://ping.myblog.jp
http://ping.rootblog.com/rpc.php
http://ping.syndic8.com/xmlrpc.php
http://ping.weblogalot.com/rpc.php
http://ping.weblogs.se/
http://pingoat.com/goat/RPC2
http://rcs.datashed.net/RPC2/
http://rpc.blogbuzzmachine.com/RPC2
http://rpc.blogrolling.com/pinger/
http://rpc.icerocket.com:10080/
http://rpc.newsgator.com/
http://rpc.pingomatic.com
http://rpc.pingomatic.com/
http://rpc.technorati.com/rpc/ping
http://rpc.weblogs.com/RPC2
http://topicexchange.com/RPC2
http://trackback.bakeinu.jp/bakeping.php
http://www.a2b.cc/setloc/bp.a2b
http://www.bitacoles.net/ping.php
http://www.blogdigger.com/RPC2
http://www.blogoole.com/ping/
http://www.blogoon.net/ping/
http://www.blogpeople.net/servlet/weblogUpdates
http://www.blogroots.com/tb_populi.blog?id=1
http://www.blogshares.com/rpc.php
http://www.blogsnow.com/ping
http://www.blogstreet.com/xrbin/xmlrpc.cgi
http://www.lasermemory.com/lsrpc/
http://www.mod-pubsub.org/kn_apps/blogchatter/ping.php
http://www.mod-pubsub.org/ping.php
http://www.newsisfree.com/RPCCloud
http://www.newsisfree.com/xmlrpctest.php
http://www.popdex.com/addsite.php
http://www.snipsnap.org/RPC2
http://www.weblogues.com/RPC/
http://xmlrpc.blogg.de
http://xmlrpc.blogg.de/
http://xping.pubsub.com/ping/
Technorati Tags: ,,

::boost for C# - Umbrella

Nice project: http://umbrella.codeplex.com/. Provides many components similar to the ::boost basics (like bind()...) - for C#.

Technorati Tags: ,,

Wednesday, February 24, 2010

C# - the fastest way to iterate over dictionary

Having a big dictionary, say 1M of <double,double> samples – what is the fastest way to iterate over it?
Comparing 3 options (iterate over KeyValuePair in the dictionary, iterate over Values collection and iterate over Keys collection) – below is code and timing comparison results.
// Of course if you iterating over Keys collection and accessing the value by key – it would be the slowest case.

// Create sample dictionary
var random = new Random();
var randomDictionaryOfDoubles =
    Enumerable.Repeat(0, 1000000).Select(
        i => Convert.ToDouble(random.Next()))
        .Distinct().OrderBy(i=>i)
        .ToDictionary(i => i);
double total = 0.0;
var stopWatch = new Stopwatch();
//Console.WriteLine("Starting KVP");
stopWatch.Reset();
stopWatch.Start();
foreach (KeyValuePair<double, double> kvp in randomDictionaryOfDoubles)
{
    total += (kvp.Value);
}
stopWatch.Stop();
Console.WriteLine("KVP took:    {0} Total = {1}", stopWatch.Elapsed, total);
//Console.WriteLine("Starting Values");
total = 0.0;
stopWatch.Reset();
stopWatch.Start();
// To get the values alone, use the Values property.
Dictionary<double, double>.ValueCollection valueColl = randomDictionaryOfDoubles.Values;
foreach (double d in valueColl)
{
    total += d;
}
stopWatch.Stop();
Console.WriteLine("Values took: {0} Total = {1}", stopWatch.Elapsed, total);
//Console.WriteLine("Starting keys");
total = 0.0;
stopWatch.Reset();
stopWatch.Start();
// To get the keys alone, use the Keys property.
Dictionary<double, double>.KeyCollection keyColl = randomDictionaryOfDoubles.Keys;
foreach (double d in keyColl)
{
    total += d;
}
stopWatch.Stop();
Console.WriteLine("Keys took:   {0} Total = {1}", stopWatch.Elapsed, total);
Console.ReadLine();

Here are results:

Method Time spent in iteration
Over key-value pairs 00:00:00.1854684
Over Values collection 00:00:00.1221380
Over Keys collection 00:00:00.0955291

Related article: http://dotnetperls.com/dictionary-lookup

Technorati Теги: ,,