{{ message }}

Instantly share code, notes, and snippets.

😀
Hello everyone!

# Hiroshi Watanabe kaityo256

😀
Hello everyone!
Last active Sep 26, 2021

View kakenhi.md

# 科研費の話

## 大学の経理状況

まず、大学の経理状況をちょっと見てみましょう。例えば東大の令和元年度財務情報を見てみることにします。令和元年度の支出は2376億円、収入が2368億円となっています。収入のうち36%が国費、つまり税金ですが、そのメインは運営交付金という大学に毎年支給される補助金で763億円です。授業料は165億円と収入に占める割合は7%程度です。支出では、人件費が1009億円で42%ほどを占めます。つまり、毎年入ってくる運営交付金と授業料では人件費に届かないくらいです(附属病院による収益はかなり大きいですが、ここでは除いています)。多くの大学において運営交付金が収入に占める割合はもっと大きいと思います。気になる人は「大学名　財務諸表」で検索してみてください。

Created Jul 28, 2020
Redefined macro
View test.cpp
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 #define A 1 #define B 1 #define A B // test.cpp:5:0: warning: "A" redefined int main() { printf("%d\n", A); }
Created Jul 28, 2020
Redefined macro
View test.cpp
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 #define A(x, y) x + y #define A(x, y) x +y //test.cpp:4:0: warning: "A" redefined int main() { printf("%d\n", A(1, 2)); }
Created Jul 28, 2020
Redefined macro
View test.cpp
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 #define A 1 #define B 1 #define A 1 // No warning #define B 2 // test.cpp:7:0: warning: "B" redefined int main() { printf("%d %d\n", A, B);
Last active May 26, 2020
Dockerfile for Riken Simulator
View Dockerfile
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
 FROM ubuntu:18.04 MAINTAINER kaityo256 ENV USER user ENV HOME /home/\${USER} ENV SHELL /bin/bash RUN useradd -m \${USER} RUN gpasswd -a \${USER} sudo RUN echo 'user:userpass' | chpasswd
Created Mar 3, 2020
MPI_Probe sample
View test.cpp
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 #include #include void send() { std::string str = "Abracadabra"; MPI_Send(str.data(), str.size(), MPI_CHAR, 1, 0, MPI_COMM_WORLD); printf("Sent: %s\n", str.c_str()); }
Last active Feb 21, 2020
A problem of Redcarpet
View test.rb
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
 require 'redcarpet' require 'redcarpet/render/review' render = Redcarpet::Render::ReVIEW.new() mk = Redcarpet::Markdown.new(render) str1 = "\$t_1\$" str2 = "\$t_1\$ to \$t_2\$" puts "#{str1} is converted to "
Created Feb 5, 2020
Intel Compiler vs. GCC
View test.cpp
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 #include struct myrand { uint32_t operator()() { return 0; } uint32_t max(){ return std::mt19937::max(); }
Created Feb 5, 2020
Intel Compiler vs. GCC
View test.cpp
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 #include struct myrand { uint32_t operator()() { static uint32_t y = 2463534242; y = y ^ (y << 13); y = y ^ (y >> 17); return y = y ^ (y << 5); } uint32_t max(){
Created Feb 4, 2020
Intel Compiler vs. GCC
View main.cpp
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 int main() { std::mt19937 mt; std::uniform_real_distribution<> ud(0.0, 1.0); for (int j = 0; j <10000; j++) { for (int i = 0; i < 10000; i++) { if (i%2) ud(mt); } } }