Skip to content

Instantly share code, notes, and snippets.

Bertrand Le Roy bleroy

Block or report user

Report or block bleroy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View undefinedTrapBookmarklet.js
javascript: {
Object.defineProperty(Object.prototype, undefined, {
set: function(v) {
debugger;
}
})
};
void(0);
View bugFarm.js
let someProperty, someOtherProperty;
function setProperty(target, propertyName, value) {
target[propertyName] = value;
}
function getProperty(target, propertyName) {
return target[propertyName];
}
View setUndefinedProperty.js
'use strict';
const a = {foo: 'bar'};
let b, c;
a[b] = 42;
console.log(a[c]); // outputs: 42
View setValueFromParameter.js
function setProperty(target, propertyName, value) {
target[propertyName] = value;
}
function getProperty(target, propertyName) {
return target[propertyName];
}
View stanfordnlpoutput.txt
The second word of the sentence 'add your text here!' is your
The third lemma of the sentence 'add your text here!' is text
The parse of the sentence 'add your text here!' is (ROOT (S (VP (VB add) (NP (PRP$ your) (NN text)) (ADVP (RB here))) (. !)))
The second word of the sentence 'It can contain multiple sentences.' is can
The third lemma of the sentence 'It can contain multiple sentences.' is contain
The parse of the sentence 'It can contain multiple sentences.' is (ROOT (S (NP (PRP It)) (VP (MD can) (VP (VB contain) (NP (JJ multiple) (NNS sentences)))) (. .)))
View stanfordnlp.fs
open edu.stanford.nlp.simple
// Create a document. No computation is done yet.
let doc : Document = new Document("add your text here! It can contain multiple sentences.");
let sentences = doc.sentences().toArray()
for sentObj in sentences do // Will iterate over two sentences
let sent : Sentence = sentObj :?> Sentence
// We're only asking for words -- no need to load any models yet
Console.WriteLine("The second word of the sentence '{0}' is {1}", sent, sent.word(1));
// When we ask for the lemma, it will load and run the part of speech tagger
@bleroy
bleroy / WeekIn.NET.20170516.md
Created May 9, 2017
Tips for the Week in .NET
View WeekIn.NET.20170516.md

Please comment below...

View tinyorm.cs
public class POCO
{
public int Answer { get; set; }
}
//...
var db = DbContext.CreateDbContext(connectionString:
"Data Source=.\\SQL;Initial Catalog=tempdb;Integrated Security=True;Pooling=true;Max Pool Size=3000;");
var ids = await db.QueryAsync("select [Answer] = object_id from sys.objects;");
var pocoArray = ids.ToObjectArray<POCO>();
You can’t perform that action at this time.