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
#!/bin/bash | |
if [ "$1" == "" ]; then | |
cat <<EOF | |
Paste the contents of the keyboard as if they were typed using the keyboard | |
Usage: $(basename $0) WAIT_TIME | |
where WAIT_TIME is the delay, like "3s" (three seconds) | |
EOF |
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
#!/bin/bash | |
# Copyright (c) 2020 Maurizio Tomasi | |
# | |
# This Bash script downloads the "fmt" C++ library and installs it in | |
# the current directory. | |
FMT_VERSION="7.1.2" | |
download_file() { |
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
#!/usr/bin/env python3 | |
# -*- encoding: utf-8 -*- | |
import numpy as np | |
from litebird_sim import all_compute_pointing_and_polangle | |
from scipy.spatial.transform import Rotation as R | |
def polangle_scipy(theta, phi, poldir): | |
cos_psi = np.clip(-np.sin(phi) * poldir[:, 0] + np.cos(phi) * poldir[:, 1], -1, 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
# -*- encoding: utf-8 -*- | |
# Check different implementations of the algorithm to determine if a | |
# point z ∈ ℂ belongs to Julia set J_c | |
import complex | |
import math | |
import strformat | |
import times |
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
# -*- encoding: utf-8 -*- | |
import numpy as np | |
import math | |
from numba import njit, vectorize, int32, int64, float32, float64 | |
@njit | |
def normalize_angle(ang): | |
result = ang |
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 Stripeline | |
import DelimitedFiles | |
db = Stripeline.InstrumentDB() | |
for horn in keys(db.focalplane) |> collect |> sort | |
curdet = db.detectors[db.focalplane[horn].polid] | |
curdet.band == "W" && continue | |
response = curdet.bandshape | |
freqs = range(response.lowest_frequency_hz, response.highest_frequency_hz, length=response.num_of_frequencies) ./ 1e9 | |
filename = "$(horn).txt" |
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
To compile the SASS files into "nimdocs.css", install SASS | |
gem install sass | |
and then run | |
sass -t compressed nimdocs.scss:nimdocs.css | |
Maurizio Tomasi | |
December 2014 |
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 <iostream> | |
#include <vector> | |
template<typename T> T | |
mean_with_accumulator(const std::vector<T> & vec) | |
{ | |
T acc = 0.0; | |
for(T cur_element : vec) | |
acc += cur_element; |
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
__Z24doubleThisRd: | |
pushq %rbp | |
movq %rsp, %rbp | |
movq %rdi, -8(%rbp) | |
movq -8(%rbp), %rax | |
movsd (%rax), %xmm0 # Put in xmm0 the value pointed by RAX | |
addsd %xmm0, %xmm0 # Calculate x+x instead of 2x | |
leave | |
ret |
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
double | |
doubleThis(double & x) | |
{ | |
return x * 2; | |
} |
NewerOlder