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
In file included from mr87f.c:83: | |
../include/miracl.h:281:31: error: expected ';' after top level declarator | |
typedef unsigned mr_dltype mr_large; | |
^ | |
; | |
../include/miracl.h:350:5: error: unknown type name 'mr_large' | |
mr_large d; | |
^ | |
../include/miracl.h:395:12: error: expected ';' at end of declaration list | |
mr_unsign64 length[2]; |
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
/* | |
* MIRACL compiler/hardware definitions - mirdef.h | |
* This version suitable for use with most 32-bit computers | |
* e.g. 80386+ PC, VAX, ARM etc. Assembly language versions of muldiv, | |
* muldvm, muldvd and muldvd2 will be necessary. See mrmuldv.any | |
* | |
* Also suitable for DJGPP GNU C Compiler | |
* ... but change __int64 to long long | |
*/ |
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
mrarth1.c:688:26: warning: shift count >= width of type [-Wshift-count-overflow] | |
z->w[i]|=(lsb<<(MIRACL-1)); | |
^ ~~~~~~~~~~ | |
1 warning generated. | |
mrcore.c:625:17: warning: shift count >= width of type [-Wshift-count-overflow] | |
temp=MR_DIV(MAXBASE,nb); | |
~~~~~~~^~~~~~~~~~~ | |
../include/mirdef.h:28:29: note: expanded from macro 'MAXBASE' | |
#define MAXBASE ((mr_small)1<<(MIRACL-1)) | |
^ |
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
> bash linux64 | |
rm: *.exe: No such file or directory | |
rm: miracl.a: No such file or directory | |
In file included from big.cpp:44: | |
./big.h:302:16: error: friend declaration specifying a default argument must be a definition | |
friend int to_binary(const Big&,int,char *,BOOL justify=FALSE); | |
^ | |
./big.h:324:16: error: friend declaration specifying a default argument must be a definition | |
friend Big luc(const Big& ,const Big&, const Big&, Big *b4=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
// A function which takes a closure and returns an `i32`. | |
fn apply_to_n<F, T>(f: F, t: T) -> T where | |
// The closure takes an `i32` and returns an `i32`. | |
F: Fn(T) -> T { | |
f(t) | |
} | |
fn main() { | |
let double = |x| 2 * x; |
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
struct Container<A, B, T>(A, B); | |
// A trait which will check to see if two items are stored inside of container. | |
// Also retrieves first or last value. | |
trait Contains { | |
// Define generic types here which methods will be able utilize. | |
type A; | |
type B; | |
type T; | |
fn contains(&self, &Self::A, &Self::B) -> bool; |
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
trait Animal { | |
// Static method signature; `Self` refers to the implementor type | |
fn new(name: &'static str) -> Self; | |
// Instance methods, only signatures | |
fn name(&self) -> &'static str; | |
fn noise(&self) -> &'static str; | |
// A trait can provide default method definitions | |
fn talk(&self) { |
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::collections::HashMap; | |
struct RangeTuple<T> { | |
cache: HashMap<(T, T), bool>, | |
first: std::ops::Range<T>, | |
second: std::ops::Range<T>, | |
} | |
impl<T: Hash + Eq> RangeTuple<T> { | |
fn new(f: std::ops::Range<T>, s: std::ops::Range<T>) -> RangeTuple<T> { |
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
```rust | |
use std::collections::HashMap; | |
use std::hash::Hash; | |
struct RangeTuple<T> | |
where T: Hash + Eq { | |
cache: HashMap<(T, T), bool>, | |
first: std::ops::Range<T>, | |
second: std::ops::Range<T>, | |
} |
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
extern crate itertools; | |
use itertools::Itertools; | |
use std::thread; | |
use std::sync::{Mutex, Arc}; | |
fn is_palindrome(num: u64) -> bool { | |
let s = num.to_string(); | |
s.chars().zip(s.chars().rev()).all(|(i1, i2)| i1 == i2 ) | |
} |