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
import Data.List | |
import Data.String | |
import Text.Read | |
import System.Environment | |
import System.IO | |
hReadCount :: Handle -> IO(Int) | |
hReadCount input = do | |
l <- hGetLine input | |
return (read l :: Int) |
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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <time.h> | |
#include <sys/mman.h> | |
#include <sys/wait.h> | |
int funTime1() | |
{ | |
int r; |
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
% f : frequency array | |
% a : amplitude array | |
% p : phase array | |
% pm : phase margin | |
% fp : phase margin frequency | |
% str : title of the plot | |
function phasegainplot(f, a, p, Pm, Fp, str) | |
figure; | |
subplot(2, 1, 1); | |
semilogx(f, a); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <netdb.h> | |
void server(int sock) |
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 sha; | |
use std::default::Default; | |
use sha::sha1::Sha1; | |
use sha::utils::{Digest, DigestExt}; | |
use std::thread; | |
use std::iter; | |
use std::str::StrExt; | |
use std::str; | |
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
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
#![feature(simd)] | |
extern crate rand; | |
extern crate time; | |
mod lin_alg; | |
use lin_alg::Quat; | |
use rand::Rng; | |
fn main(){ | |
let mut rng = rand::XorShiftRng::new_unseeded(); |
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
mov ebx, [esp+8] ; stock l'adresse de la matrice dans ebx | |
mov ecx, [esp+12]; je sais pas où il devrait y avoir la longueur de la matrice, on le met dans ecx | |
add ecx, ebx ; on calcul l'adresse de fin de la matrice | |
loop: | |
mov dl, [ebx] ; on met les 8 bits d'un élément dans edx | |
not dl ; on inverse ces 8 bits | |
mov [ebx], dl ; on les remets dans la matrice | |
inc ebx ; on va à l'élément suivant | |
cmp ebx, ecx ; est-on à la fin de la matrice ? | |
jne loop ; si non continuer la boucle |
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
import subprocess | |
import re | |
doc = Document.getCurrentDocument() | |
segment = doc.getCurrentSegment() | |
binary = doc.getExecutableFilePath() | |
mangled = subprocess.check_output(['readelf', '-rW', binary]) | |
filt = subprocess.Popen(['c++filt'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) | |
output = filt.communicate(mangled) |
OlderNewer