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
ProfileLoaderConfigurationManagerFactory plcmf = new ProfileLoaderConfigurationManagerFactory(); | |
ProfileLoaderConfigurationManager pclm = pclmf.GetProfileLoaderConfigurationManager(); | |
ContextWrapperManagerFactoryProxy cwmfp = ContextWrapperManagerFactoryProxy.GetContextWrapperManager(); | |
ContextWrapper cw = cwmfp.GetContextWrapper(context); | |
GetProfileLoaderContextApplicationManager gplcam = GetProfileLoaderContextApplicationManagerFactory.GetProfileLoaderContextApplicationManager(); | |
ProfileLoader loader = gplcam.CallGetProfileLoaderWithContextWrapper(pclm, cw); | |
UserProfile profile = loader.GetUserProfile(); |
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
use std::rand; | |
use std::rand::Rng; | |
use std::str; | |
use std::vec; | |
static MUTATION_RATE: float = 0.04; | |
static GENERATION_SIZE: int = 100; | |
static TARGET: &'static [u8] = bytes!("methinks it is like a weasel"); | |
static ALPHABET: &'static [u8] = bytes!("abcdefghijklmnopqrstuvwxyz "); |
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
use std::rand; | |
use std::rand::Rng; | |
use std::str; | |
static TARGET: &'static str = "methinks it is like a weasel"; | |
static ALPHABET: &'static [u8] = bytes!("abcdefghijklmnopqrstuvwxyz"); | |
fn random_char() -> u8 { | |
rand::task_rng().choose(ALPHABET) |
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
// Getting some cruft out of the way | |
public class le{ | |
// Set up a Person class for use in examples. | |
public class Person{ public string Name { get; set; } } | |
public static void Main(string[] args){ | |
// A gentle introduction to LINQ, language integrated queries, | |
// in C#. To start off, let's do some disambiguation. | |
// This is a lambda expression |
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
// Set up a simple object to use as "context" | |
var context = { foo: "bar" }; | |
// A function that uses a reference to a variable called "foo". | |
function returnFoo () { | |
return this.foo; | |
} | |
// This variable does not exist on scope, so is undefined. | |
returnFoo(); // => undefined |
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
angular.module('app.services') | |
.factory('Nsfw', function ($rootScope) { | |
'use strict'; | |
var _nsfw = false; | |
var broadcastNsfw = function (nsfw) { | |
$rootScope.$broadcast('Nsfw.Update', nsfw); | |
}; | |
var toggleNsfw = function () { |
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
angular.module('services', []) | |
.factory('State', function ($rootScope) { | |
'use strict'; | |
var state; | |
var broadcast = function (state) { | |
$rootScope.$broadcast('State.Update', state); | |
}; | |
var update = function (newState) { |
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
/* | |
Description: | |
Write a function 'notQuine' which returns a string containing every ASCII character that is NOT part of the source code of the function. | |
The outer 'function () { }' wrapper is included. | |
A function containing all of the characters is not a valid solution. | |
You may not modify Function.prototype.toString, notQuine.toString, String.indexOf, or String.fromCharCode. |
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
function solution(number){ | |
var range = function (max) { | |
var nums = []; | |
for (var i = 0; i < max; i++) { | |
nums.push(i); | |
} | |
return nums; | |
}; | |
return range(number) |
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
use std::rand; | |
use std::rand::Rng; | |
use std::str; | |
static TARGET: &'static str = "methinks it is like a weasel"; | |
static ALPHABET: [char, ..26] = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', | |
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', | |
's', 't', 'u', 'v', 'w', 'x', 'y', 'z']; |