この文章では、Linuxコマンド、sar, top, psを使って、一般的に負荷といわれるものの原因を切り分けることを目的とする。
「複数のタスクによるサーバリソースの奪い合いの結果に生じる待ち時間」を一言で表した言葉。OSのチューニングとは負荷の原因を知り、それを取り除くことにほかならない。
- ロードアベレージ(処理を実行したくても、実行できなくて待たされているプロセス(CPUの実行権限が与えられるのを待っている、またはディスクI/Oが完了するのを待っている)の数)を見る
core-toolbar { | |
font-family: RobotoDraft, sans-serif; | |
background-color: #4058A3; | |
box-shadow: 0px 3px 2px rgba(0, 0, 0, 0.2); | |
color: #fff; | |
font-size: 20px; | |
font-weight: 400; | |
height: 42px; | |
} |
// Based on http://bit.ly/215MBZ | |
function FailureDetector(ws) { | |
// ws stands for window size. | |
// How many heartbeat intervals we keep track of. | |
this.ws = ws || 100; | |
this.window = []; | |
this.last = null; | |
} | |
exports.FailureDetector = FailureDetector; |
import Maybe from 'folktale/maybe'; | |
const Inc = 'Inc'; | |
const Dec = 'Dec'; | |
const IncBy = 'IncBy'; | |
const IncFn = state => state + 1; | |
const DecFn = state => state - 1; | |
const IncByFn = (state, action) => state + action.incBy; |
http = require('http'); | |
fs = require('fs'); | |
fd = fs.openSync(__filename, 'r'); | |
size = fs.fstatSync(fd).size; | |
server = http.createServer(function(req, res) { | |
res.writeHead(200, { | |
'Content-Length': size, | |
'Content-Type': 'text/plain' |
// MIT License | |
// | |
// Copyright (c) 2019 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
import cv2 | |
import math | |
import numpy as np | |
import sys | |
def apply_mask(matrix, mask, fill_value): | |
masked = np.ma.array(matrix, mask=mask, fill_value=fill_value) | |
return masked.filled() | |
def apply_threshold(matrix, low_value, high_value): |
Open ~/.mozilla/firefox/<your_profile>/chrome/userContent.css
(create it if does not exist).
Paste the following content in it.
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document regexp("chrome://browser/content/devtools/**/.*"){
.devtools-monospace {
font-family: Consolas, monospace !important;
font-size: 8pt !important;
}
}
There are many tutorials and articles available online which explain functional programming. Examples show small functions, which are composed into others which again get composed. It is hard to imagine how it would all work, then come the analogies and then the math. While the math is necessary to understand it can be difficult to grasp initially. The analogies on the other hand, (at least for me) are not relatable. Some articles assume the reader knows the different terminologies of FP. Over all I felt it is not inviting to learn.
This introduction is for those who have had a tough time understanding those analogies, taken the plunge to functional programming but still have not been able to swim. This is yet another tutorial on functional programming
Functions are first class means they are just like anyone else, or rather they are not special, they behave the same as say primitives or strings or objects.
### Flutter Generated | |
# Miscellaneous | |
*.class | |
*.lock | |
*.log | |
*.pyc | |
*.swp | |
.DS_Store | |
.atom/ |