This file contains hidden or 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
| $paths = New-Object "System.Collections.Generic.List[string]" | |
| if ($Args[0] -eq "official"){ | |
| $paths.Add("C:\Users\ashia\AppData\Local\Programs\Python\Python35\Scripts\") | |
| $paths.Add("C:\Users\ashia\AppData\Local\Programs\Python\Python35\") | |
| }elseif ($Args[0] -eq "anaconda"){ | |
| $paths.Add("C:\Users\ashia\Anaconda2") | |
| $paths.Add("C:\Users\ashia\Anaconda2\Scripts") | |
| $paths.Add("C:\Users\ashia\Anaconda2\Library\bin") | |
| }else{ | |
| echo "Invalid argument!" |
This file contains hidden or 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=[0] | |
| c=0 | |
| n=200000 | |
| import numpy | |
| for i in range(2*n): | |
| b=numpy.random.rand(1,2) | |
| a.append(b) | |
| for j in range(i,n): | |
| d=a[j]**2+a[2*j]**2 | |
| if d <= 1: |
This file contains hidden or 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
| sig Element{} | |
| one sig Group{ | |
| elements: set Element, | |
| unit: one elements, | |
| mult: elements -> elements -> one elements, | |
| inv: elements -> one elements | |
| } | |
| fact NoRedundantElements{ |
This file contains hidden or 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
| sig Element {} | |
| one sig Ring{ | |
| elements: set Element, | |
| zero: one elements, | |
| un: one elements, | |
| add: elements -> elements -> one elements, | |
| mult: elements -> elements -> one elements, | |
| neg: elements -> one elements | |
| } |
This file contains hidden or 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
| fn f(a: &mut i32){ | |
| *a += 1; | |
| } | |
| fn main() { | |
| let mut a: i32 = 3; | |
| println!("Hello, world! The number is {}", a); | |
| f(&mut a); | |
| println!("The number is {}", a); | |
| } |
This file contains hidden or 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
| fn f(a: &mut i32){ | |
| *a += 1; | |
| } | |
| fn main() { | |
| let mut a: i32 = 3; | |
| println!("Hello, world! The number is {}", a); | |
| f(&mut a); | |
| println!("The number is {}", a); | |
| } |
This file contains hidden or 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
| fn f(a: &mut i32, b: &i32){ | |
| *a += *b; | |
| } | |
| fn main() { | |
| let mut a: i32 = 3; | |
| println!("Hello, world! The number is {}", a); | |
| { | |
| let b: i32 = 2; | |
| f(&mut a, &b); |
This file contains hidden or 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
| fn f<'a>(a: &'a mut i32, b: &'a i32){ | |
| *a += *b; | |
| } | |
| fn main() { | |
| let mut a: i32 = 3; | |
| println!("Hello, world! The number is {}", a); | |
| { | |
| let b: i32 = 2; | |
| f(&mut a, &b); |
This file contains hidden or 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`のライフタイムで参照を一つ取る。最低でもこの関数 | |
| // と同じだけの長さでなくてはならない。 | |
| fn print_one<'a>(x: &'a i32) { | |
| println!("`print_one`: x is {}", x); | |
| } | |
| // ミュータブルな参照でも同様 | |
| fn add_one<'a>(x: &'a mut i32) { | |
| *x += 1; | |
| } |
This file contains hidden or 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
| sig Element {} | |
| one sig Ring{ | |
| elements: set Element, | |
| zero: one elements, | |
| un: one elements, | |
| add: elements -> elements -> one elements, | |
| mult: elements -> elements -> one elements, | |
| neg: elements -> one elements | |
| } |