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
pub trait ZpField: Field { | |
fn new(prime: u64) -> Self; | |
fn from(&self, a: u64) -> Self::U; | |
fn back(&self, a: Self::U) -> u64; | |
} |
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
Comme indiqué par le lien sur les guides, Rails a un certain nombre de conventions. | |
Une en particulier est que les classes représentant un modèle ont un nom singulier et que les tables en base de données ont un nom au pluriel. | |
Dans le cas de indicatorf Rails le voit comme un nom terminant en `f` et applique donc la règle d'anglais qui indique qu'un mot se terminant en `f` a un pluriel en `ves`. | |
Un conseil cependant, si tu souhaites appliquer un anglais correct et résoudre ton problème en même temps, il y a un moyen simple. | |
On ne dit pas "The indicator F" mais "The F indicator" il serait donc logique que tes modèles se nomment aindicator, bindicator, …, findicator, j_indicator. | |
Tes modèles seraient de la forme `Findicator` et tes tables de la forme `findicators`. |
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
#!/bin/sh | |
ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk-bundle | |
$ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc \ | |
--sysroot $ANDROID_NDK_HOME/platforms/android-18/arch-arm \ | |
-L `pwd`/../deps/openssl-install/lib/ \ | |
-L `pwd`/../deps/libsodium-1.0.10/libsodium-android-armv6/lib/ \ | |
"$@" |
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
case class PasswordHash(salt:Array[Byte], loops:Int, hash:Array[Byte], algorithm:String, keyLength:Int) { | |
def hashText(plainText:String):Array[Byte] = PasswordHash.hash(plainText, salt, loops, algorithm, keyLength) | |
def challenge(plainText:String):Boolean = java.util.Arrays.equals(hashText(plainText), hash) | |
} | |
object PasswordHash { | |
def hash(plainText:String):PasswordHash = { | |
val algo = "PBKDF2WithHmacSHA512" | |
val salt = new java.security.SecureRandom().generateSeed(512/8) | |
val loops = 10000 |
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 simple_parallel::pool::Pool; | |
use std::collections::HashMap; | |
use std::collections::hash_map::Entry; | |
pub type BI<'a,A> = Box<Iterator<Item=A> + Send + 'a>; | |
pub struct MapReduceOp<'a,M,R,A,K,V> | |
where M: 'static + Sync + Fn(A) -> BI<'a,(K,V)>, | |
R: 'static + Sync + Fn(&V,&V) -> V, | |
A:Send, |
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
// | |
// This file is auto-generated, please don't edit! | |
// | |
use core::*; | |
extern "C" { | |
pub fn cv_core_getBuildInformation() -> *const libc::types::os::arch::c95::c_char; |
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
> db.setProfilingLevel(2) | |
{ "was" : 0, "slowms" : 100, "ok" : 1 } | |
> db.test.find({ data: {$gt: ISODate("2014-08-31")}}) | |
> db.system.profile.find().limit(10).sort( { ts : -1 } ).pretty() | |
{ | |
"op" : "query", | |
"ns" : "test.test", | |
"query" : { | |
"data" : { | |
"$gt" : ISODate("2014-08-31T00:00:00Z") |
NewerOlder