This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using System.Threading.Tasks.Dataflow; | |
namespace TPLDataFlowExample | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
template<typename Derived> class Parent | |
{ | |
public: | |
void SayHi() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
struct counter | |
{ | |
static int objects_created; | |
static int objects_alive; | |
counter() | |
{ | |
++objects_created; | |
++objects_alive; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include"windows.h" | |
#include<string> | |
#include<vector> | |
#include<algorithm> | |
using namespace std; | |
LARGE_INTEGER Frequency, PerformanceCount1, PerformanceCount2; | |
void TimeStart(){ | |
QueryPerformanceCounter(&PerformanceCount1); | |
} | |
void TimeEnd(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers. | |
# by: Brandon Tilly | |
# Source URL: https://gist.github.com/1027674 | |
# Post http://brandontilley.com/2011/01/31/gist-tag-for-jekyll.html | |
# | |
# Example usage: {% gist 1027674 gist_tag.rb %} //embeds a gist for this plugin | |
require 'cgi' | |
require 'digest/md5' | |
require 'net/https' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseA | |
{ | |
public: | |
virtual void foo()=0; | |
}; | |
class BaseB | |
{ | |
public: | |
virtual void bar(int a)=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static double TimeWatcher(Action action) | |
{ | |
System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch(); | |
watch.Start(); | |
action(); | |
watch.Stop(); | |
var useTime = (double) watch.ElapsedMilliseconds/1000; | |
return useTime; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static double TimeWatcher() | |
{ | |
System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch(); | |
watch.Start(); | |
// operations under test start | |
// ... | |
// operation under test stop | |
watch.Stop(); | |
var useTime = (double) watch.ElapsedMilliseconds/1000; | |
return useTime; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace __hidden__ { | |
struct print { | |
bool space; | |
print() : space(false) {} | |
~print() { std::cout << std::endl; } | |
template <typename T> | |
print &operator , (const T &t) { | |
if (space) std::cout << ' '; | |
else space = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add the following reference | |
//Microsoft.SqlServer.ConnectionInfo | |
//Microsoft.SqlServer.Management.Sdk.Sfc | |
//Microsoft.SqlServer.Smo | |
//Microsoft.SqlServer.SmoExtended | |
//Microsoft.SqlServer.SqlEnum | |
public void BackupDatabase(string databaseName, string userName, string password, string serverName, | |
string destinationPath) | |
{ | |
//Define a Backup object variable. |
NewerOlder