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
import string | |
import random | |
def main(): | |
alphabet = list(string.ascii_lowercase) | |
random.shuffle(alphabet) | |
alphabet = ''.join(alphabet) | |
for char in alphabet: | |
print(char) |
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
#include <algorithm> | |
#include <iostream> | |
#include <set> | |
#include <vector> | |
template <class T> | |
class Range { | |
public: | |
Range(const T upper) : Range(0, upper, 1) {} | |
Range(const T lower, const T upper) : Range(lower, upper, 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
<code_scheme name="Default"> | |
<option name="RIGHT_MARGIN" value="80" /> | |
<Objective-C> | |
<option name="INDENT_NAMESPACE_MEMBERS" value="2" /> | |
<option name="INDENT_C_STRUCT_MEMBERS" value="2" /> | |
<option name="INDENT_CLASS_MEMBERS" value="2" /> | |
<option name="INDENT_VISIBILITY_KEYWORDS" value="1" /> | |
<option name="INDENT_INSIDE_CODE_BLOCK" value="2" /> | |
<option name="FUNCTION_BRACE_PLACEMENT" value="2" /> | |
</Objective-C> |
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
program test | |
implicit none | |
integer :: a(10) | |
a = [1,2,3,4,5,6,7,8,9,10] | |
call print_int_array(a) | |
end program test |
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
import numpy as np | |
class Robot(object): | |
def __init__(self, pos, icon): | |
self.pos = pos | |
self.icon = icon | |
def move(self, dx): | |
self.pos += dx |
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
module indices | |
type :: localIdx | |
integer :: val | |
end type localIdx | |
type :: globalIdx | |
integer :: val | |
end type globalIdx | |
contains |
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
(*Grab the image off the web*) | |
img = Import["http://i.imgur.com/XgrV1va.jpg"]; | |
(*Cut it down to just the maze*) | |
croppedImg = ImageTrim[ | |
img, | |
{ | |
{3097.716894977169`, 288.36529680365334`}, | |
{3033.4246575342463`, 1346.2648401826486`}, | |
{432.5114155251141`, 1355.0319634703199`}, |
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
#include <iostream> | |
#include <iomanip> | |
#include <limits> | |
using namespace std; | |
#define PREC std::setprecision(std::numeric_limits<long double>::digits10 + 1) | |
int main() { | |
float c_float; |
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
#!/bin/bash | |
#smartfancontrol.sh | |
#### enter your preferred values here ################## | |
speed_min=2000 #RPM | |
speed_max=5500 #RPM | |
temp_min=46 #degrees celsius | |
temp_max=60 #degrees celsius |
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
program test | |
use ISO_FORTRAN_ENV | |
implicit none | |
real(kind=real64) :: x | |
call random_number(x) ! make sure x has been filled with "random" bits | |
write(*,*) x |
NewerOlder