This file contains hidden or 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
#!/bin/bash | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin | |
export PATH | |
clear | |
CUR_DIR=$(pwd) | |
if [ $(id -u) != "0" ]; then | |
printf "Error: You must be root to run this script!" | |
exit 1 |
This file contains hidden or 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
IEnumerable<string> strings = new List<string>(); | |
if (strings is IEnumerable<object>) | |
Console.WriteLine("True"); | |
else | |
Console.WriteLine("False"); | |
/// why this is False?? | |
if (strings is IList<object>) | |
Console.WriteLine("True"); |
This file contains hidden or 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
t = {} | |
meta = {__index = | |
function(_, idx) | |
return function(...) | |
-- ... will be table type "arg" | |
print(idx, arg[1]) | |
end | |
end} | |
setmetatable(t, meta) |
This file contains hidden or 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 string HelloWorld() | |
{ | |
// workable | |
WSHttpBinding binding = new WSHttpBinding(); | |
EndpointAddress address = new EndpointAddress("http://localhost:8732/Design_Time_Addresses/WcfServiceLibrary1/Service1/"); | |
IService1 proxy = ChannelFactory<IService1>.CreateChannel(binding, address); | |
using (proxy as IDisposable) | |
{ | |
proxy.GetData(99); | |
} |
This file contains hidden or 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
http://blogs.msdn.com/b/rxteam/ | |
http://www.codeproject.com/KB/Parallel_Programming/RxByExample.aspx | |
http://msdn.microsoft.com/en-us/data/gg577609 | |
http://stackoverflow.com/questions/1969036/reactive-extensions-rx-and-asynchronous-class | |
Using dotnet4.0 needs some modifications !! Follow me. | |
1,Observer模式 | |
http://msdn.microsoft.com/en-us/library/dd990377(VS.100).aspx |
This file contains hidden or 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.Runtime.InteropServices; | |
class HighResolutionTimer | |
{ | |
private bool isPerfCounterSupported = false; | |
private Int64 frequency = 0; | |
// Windows CE native library with QueryPerformanceCounter(). | |
[DllImport("kernel32.dll", SetLastError = true)] |
This file contains hidden or 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 class List<T> : IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable | |
class CFromList : List<int>{} | |
// public class ArrayList : IList, ICollection, IEnumerable, ICloneable | |
class CFromArrayList : ArrayList{} | |
public partial class Form1 : Form | |
{ | |
private void button1_Click(object sender, EventArgs e) | |
{ |
This file contains hidden or 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
; Listing generated by Microsoft (R) Optimizing Compiler Version 16.00.30319.01 | |
TITLE C:\Documents and Settings\sun\my documents\visual studio 2010\Projects\aabb\aabb\aabb.cpp | |
.686P | |
.XMM | |
include listing.inc | |
.model flat | |
INCLUDELIB MSVCRTD | |
INCLUDELIB OLDNAMES |
This file contains hidden or 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 <stdio.h> | |
int main (int argc, char *argv[]) | |
{ | |
int a = 99; | |
int b = a; | |
int* pLocala = NULL; | |
int* pLocalb = NULL; | |
int d = 1; |
This file contains hidden or 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 <stdio.h> | |
int main (int argc, char *argv[]) | |
{ | |
int a = 99; | |
int b = a; | |
int* pLocala = NULL; | |
int* pLocalb = NULL; | |
int d = 1; |