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
static IEnumerable<string> FetchStockQuotes(string[] symbols) | |
{ | |
var quotes = new List<string>(); | |
string url = string.Format("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20({0})&env=store://datatables.org/alltableswithkeys", | |
String.Join("%2C", symbols.Select(s => "%22" + s + "%22"))); | |
var wc = new WebClient {Proxy = WebRequest.DefaultWebProxy}; | |
var ms = new MemoryStream(wc.DownloadData(url)); | |
var reader = new XmlTextReader(ms); | |
XDocument doc = XDocument.Load(reader); |
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
dynamic expando = new ExpandoObject(); | |
var p = expando as IDictionary<String, object>; | |
p["A"] = "New val 1"; | |
Console.WriteLine(expando.A); |
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
Для установки плагинов зайти в директорию плагина и запустить "python setup.py install" | |
Может ругаться на отсутствие setuptools, тогда нужно запустить файл http://python-distribute.org/distribute_setup.py |
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
%Если нужно немного русских слов в английском тексте: | |
\documentclass[10pt, conference, compsocconf]{IEEEtran} | |
\fontfamily{cmr}\selectfont | |
\usepackage[utf8]{inputenc} | |
\usepackage[russian, english]{babel} | |
\begin{document} | |
this is english text |
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
[WebMethod] | |
public static void SomeMethod(int paramA, string paramB) | |
{ | |
... | |
} | |
$.ajax({ | |
type: "POST", | |
contentType: "application/json; charset=utf-8", | |
url: window.location.href + "/SomeMethod", |
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
import sys | |
import pprint | |
def pretty_print(object): | |
class decoder_stream: | |
def write(self, s): | |
if s.startswith("'") and s.endswith("'"): | |
s = "'%s'" % s[1:-1].decode('string_escape') | |
elif s.startswith("u'") and s.endswith("'"): | |
s = "u'%s'" % s[2:-1].decode('unicode_escape').encode('utf8') |
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
$.ajax({ | |
type: "POST", | |
contentType: "application/json; charset=utf-8", | |
url: window.location.href + "/SomeMethod", | |
data: { paramA : valueA, paramB : valueB }, | |
dataType: 'json', | |
success: function (response) { | |
... | |
} | |
}); |
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
hg grep --all "PATTERN" FILENAME |
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
## Ignore Visual Studio temporary files, build results, and | |
## files generated by popular Visual Studio add-ons. | |
# User-specific files | |
*.suo | |
*.user | |
*.sln.docstates | |
# Build results |
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
DateTime.ToString() Patterns | |
All the patterns: | |
0 MM/dd/yyyy 08/22/2006 | |
1 dddd, dd MMMM yyyy Tuesday, 22 August 2006 | |
2 dddd, dd MMMM yyyy HH:mm Tuesday, 22 August 2006 06:30 | |
3 dddd, dd MMMM yyyy hh:mm tt Tuesday, 22 August 2006 06:30 AM | |
4 dddd, dd MMMM yyyy H:mm Tuesday, 22 August 2006 6:30 | |
5 dddd, dd MMMM yyyy h:mm tt Tuesday, 22 August 2006 6:30 AM |
OlderNewer