Skip to content

Instantly share code, notes, and snippets.

> 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")
//
// 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;
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,
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
#!/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/ \
"$@"
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`.
@kali
kali / zpfield.rs
Created August 29, 2016 11:15
Zp field
pub trait ZpField: Field {
fn new(prime: u64) -> Self;
fn from(&self, a: u64) -> Self::U;
fn back(&self, a: Self::U) -> u64;
}

Keybase proof

I hereby claim:

  • I am kali on github.
  • I am kali (https://keybase.io/kali) on keybase.
  • I have a public key ASDv5uRrAnqze_sDKiWzA13hJ3V8fZJkXzjo_tayotW9FQo

To claim this, I am signing this object:

error[E0046]: not all trait items implemented, missing: `clerks_info`
--> src/lib.rs:367:1
|
367 | impl<I, C, S, M> sda_transport::TransportInterface for SummerServer<I, C, S, M>
| ^ missing `clerks_info` in implementation
error: aborting due to previous error
error: failed to run custom build command for `libc-test v0.1.0 (file:///home/kali/libc/libc-test)`
process didn't exit successfully: `/home/kali/libc/libc-test/target/debug/build/libc-test-bad5caa69cfa4e7d/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=../src/lib.rs
cargo:rerun-if-changed=../src/dox.rs
cargo:rerun-if-changed=../src/unix/mod.rs
cargo:rerun-if-changed=../src/macros.rs
cargo:rerun-if-changed=../src/unix/notbsd/mod.rs
cargo:rerun-if-changed=../src/unix/notbsd/linux/mod.rs
cargo:rerun-if-changed=../src/unix/notbsd/linux/other/mod.rs