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::{time, thread}; | |
use std::sync::{Arc, Mutex}; | |
use std::time::Instant; | |
use nix::unistd; | |
use nix::unistd::ForkResult; //懺悔:これいらなかったです(cargo buildするとワーニング出ます。削ってください。) | |
fn main() { | |
let s = Arc::new(Mutex::new(String::new())); //Arcの中のMutexの中の文字列がデータ本体です。 | |
let s1 = s.clone(); |
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
$ cargo run | |
・・・ | |
1秒後 Child: "" | |
2秒後 Child: "" | |
3秒後 Child: "" | |
4秒後 Child: "" | |
5秒後 Parent { child: Pid(50794) }: "written" | |
5秒後 Child: "" | |
6秒後 Parent { child: Pid(50794) }: "written" | |
6秒後 Child: "" |
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> | |
int main(){ | |
int pid = fork(); //子の場合: 0, 親の場合: 子のPID | |
//子の処理 | |
if (pid == 0){ | |
while(1){ | |
sleep(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
export CLICOLOR=1 | |
export LSCOLORS=DxGxcxdxCxegedabagacad | |
alias 'ls=ls -G' |
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
[ -z "$PS1" ] && return | |
HISTCONTROL=ignoreboth | |
shopt -s histappend | |
HISTSIZE=1000 | |
HISTFILESIZE=2000 | |
shopt -s checkwinsize | |
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then | |
debian_chroot=$(cat /etc/debian_chroot) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>BackgroundAlphaInactive</key> | |
<real>0.5</real> | |
<key>BackgroundBlur</key> | |
<real>0.0</real> | |
<key>BackgroundBlurInactive</key> | |
<real>0.48512961647727271</real> |
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
### OLD ### | |
cd /lib/firmware/brcm/ | |
sudo wget https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm80211/brcm/brcmfmac43430-sdio.bin -O brcmfmac43430-sdio.bin | |
sudo wget https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm80211/brcm/brcmfmac43430-sdio.txt -O brcmfmac43430-sdio.txt | |
sudo reboot | |
### NEW ### | |
cd /lib/firmware/brcm/ |
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 | |
###文献リスト### | |
cat ../rpim_book.bbl | | |
grep '^\\bibitem' | | |
sed 's/bibitem/cite/' | | |
awk '{print "s/\\"$1"/["NR"]/g"}' > ./cite.sed | |
cat ../rpim_book.bbl | | |
sed 's/bibitem/cite/' | |
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::env; | |
fn main(){ | |
let args: Vec<String> = env::args().collect(); | |
let num:i32 = args[1].parse::<i32>().unwrap(); | |
println!("{0: >width$ }","人", width= 2 + 2*num as usize); | |
for i in 0..num { | |
let width_left = (2*num - i*2 - 1) as usize; | |
let width_right = (i*4 + 4) as usize; |
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
🍣: 🐟 🍚 | |
echo 🐟🍚 → 🍣 | |
🐟: 🐛 | |
echo 🐛 → 🐟 | |
🌾: 💩 | |
echo 💩 → 🌾 | |
🐛: 🌿 | |
echo 🌿 → 🐛 | |
🍚: 🌾 | |
echo 🌾 → 🍚 |
NewerOlder