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
/* | |
Implemented pseudocode available at | |
http://en.wikipedia.org/wiki/Mersenne_twister | |
as an asm.js module to learn about asm.js | |
*/ | |
function MersenneTwister(stdlib, foreign, heap) { | |
"use asm"; |
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; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication11 { |
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
/* | |
output (cpu: i7 920) | |
Starting Benchmark | |
Running iteration: 1000/1000 | |
Running 1000000 sub-iterations - Time Taken: 00:00:00.0043953 | |
Running 1000000 sub-iterations - Time Taken: 00:00:00.0037585 | |
Test 1 | |
Average Time: 00:00:00.0043999 | |
Invalid Operations: 750007614 (75.001 %) |
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; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Runtime.CompilerServices; | |
using System.Threading; | |
using System.Threading.Tasks; |
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 MetagenomeDB as mdb | |
names = ['check1', 'check2', 'check3'] | |
def run(): | |
c = mdb.Collection.find_one({"name": "NL10_1002_vRNA:contigs-strict"}) | |
output=[] | |
for sequence in c.list_sequences(): | |
if (not "alignments" in sequence): | |
continue |
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 partial class PageSettings : System.Web.UI.UserControl { | |
protected override void OnPreRender(EventArgs e) { | |
base.OnPreRender(e); | |
if (Page.IsPostBack && PageUtil.IsPageValidated() && Page.IsValid && | |
Page.Request.Params.Get(Page.postEventSourceID).Contains("cmdUpdate")) { | |
//cmdUpdate_click postback event occurred | |
var Tabs = new TabsController(); | |
Tabs.UpdateTabSetting(TabId, "MyNewSetting", MySetting.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
//http://codereview.stackexchange.com/questions/13377/jquery-drawer-with-tab | |
/* | |
preference: rename jquery instance variables to start with $ | |
*/ | |
$(function () { | |
var $message = $('#message'), | |
$tab = $('#tab'), | |
$droid = $message.find('.droid'), | |
speed = 300; |
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
//example emit code borrowed and lightly modified from http://www.c-sharpcorner.com/uploadfile/puranindia/reflection-and-reflection-emit-in-C-Sharp/ | |
using System; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
using System.Threading; | |
namespace ConsoleApplication12 { | |
// declare the interface |
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 NullableInt = System.Nullable<int>; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("null:"); |
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 JustATest | |
{ | |
// public struct InheritingTuple(int A, int B) : (int, int)(A, B); | |
// same: public struct InheritingTuple(int A, int B) : (int A, int B)(A, B); | |
// same, better?: public struct InheritingTuple(int A, int B) : (int A: A, int B: B); | |
// compiles as: | |
// public struct InheritingTuple(int A, int B) : ValueTuple<int, int>(A, B); | |
// should this be allowed? | |
// I think no: ValueTuple<T...> structs sealed? | |
// where would attribute go? |
OlderNewer