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
private readonly Dictionary<string, Cookie> globalCookies = new Dictionary<string, Cookie>(); | |
public void DoRequest(Uri uri) | |
{ | |
var localCookies = new CookieContainer(); | |
lock(globalCookies) | |
{ | |
foreach(var cookie in globalCookies) | |
{ | |
localCookies.Add(cookie.Value); |
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
[TestFixture] | |
public class PredicateLogicTests | |
{ | |
[Test] | |
public void TestNegationOfUniversalQuantifier() | |
{ | |
var empty = new int[0]; | |
var allOdd = new[] { 1, 3, 5 }; | |
var allEven = new[] { 2, 4, 6 }; | |
var allNumbers = new[] { 1, 2, 3 }; |
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
void CountAccents(string input) | |
{ | |
if (input.Length != 0 && !Char.IsWhiteSpace(input[input.Length - 1])) input = input + " "; | |
int wordsTotal = 0; | |
int wordsOnlyLetters = 0; | |
int wordsAccented = 0; | |
int wordStart = 0; | |
bool hasAccent = false; | |
bool hasNonLetter = false; |
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
Func<double, double> eval = r => Math.Asin(1 / (2 * r)) * r * r + Math.Sqrt(r * r - 0.25) / 2 - 0.5; | |
double left = 0.5; | |
double right = 1; | |
for(int i = 0; i < 100; ++i) | |
{ | |
var mid = (left + right) / 2; | |
var midRes = eval(mid); | |
if (midRes < 0) left = mid; | |
else right = mid; |
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
<?php | |
define('MW_PATH', '../../'); | |
require(MW_PATH . 'languages/data/Names.php'); | |
$coreLanguageNames = MediaWiki\Languages\Data\Names::$names; | |
echo "{|\n"; | |
echo "! Lang !! In core !! In CLDR\n"; |
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
// test at http://www.compileonline.com/compile_ilasm_online.php | |
.assembly IntrfTest {} | |
.assembly extern mscorlib {} | |
.method static void Main() | |
{ | |
.entrypoint | |
.maxstack 1 | |
call void IInterface::StaticMethod() | |
call void IInterface::StaticMethod() |
This file has been truncated, but you can view the full file.
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.Text; | |
class C | |
{ | |
static void Main() | |
{ | |
var c0 = Console.Read(); | |
if (c0 > 0 && c0 != 13) | |
{ |
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
<?php | |
/** | |
* Simple emulation of ICU sortkeys for trivial strings (strings containing [A-Za-z0-9] only) | |
* | |
* See http://userguide.icu-project.org/collation/architecture#TOC-Sort-Keys | |
*/ | |
function simple_sort_key($str) | |
{ |
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
// LINQPad C# Program | |
const int COL_VOLBY = 0; | |
const int COL_OBVOD = 1; | |
const int COL_OBEC = 3; | |
const int COL_K1_VOLICI = 6; | |
const int COL_K1_OBALKY = 7; | |
const int COL_K2_VOLICI = 10; | |
const int COL_K2_OBALKY = 11; |
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
SELECT linksfromlist.pl_title, (SELECT COUNT(*) FROM pagelinks incominglinks WHERE incominglinks.pl_title=linksfromlist.pl_title AND incominglinks.pl_namespace=linksfromlist.pl_namespace AND incominglinks.pl_from_namespace=0) linkcount | |
FROM pagelinks linksfromlist | |
INNER JOIN page ON linksfromlist.pl_from=page_id | |
WHERE page_namespace=2 AND page_title='Vojtěch_Dostál/Pískoviště3' | |
AND linksfromlist.pl_namespace=0 | |
ORDER BY linkcount DESC |
OlderNewer