こんにちは高知工科大Advent Calendar 2015の6日目担当です.
今日は大学生なら一度は経験する問題について書いていきます.
みなさんも一度はmysqlを使った時に遅くてイライラしたことがあると思います.
大量のデータにselect文投げたら15時間経過した後に結果が帰ってくることとかあるあるですよね.
今日はそんな問題を多少改善する方法についてです.
/* | |
* CHALLANGE: | |
* Cache `index.html` file using service worker. | |
* | |
* This bit of code is included in <script> tag of index.html | |
* if (navigator.serviceWorker) { | |
* navigator.serviceWorker.register('serviceworker.js', {scope: '/'}) | |
* } | |
* | |
*/ |
//Script to Copy shortcuts to Startup Folder | |
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null | |
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog | |
$OpenFileDialog.ShowDialog()|Out-Null | |
$File = $OpenFileDialog.filename | |
$startup = [environment]::getfolderpath("Startup") | |
Copy-Item $File $startup |
# Set Keybinding for GNOME Terminal in Slot 0 | |
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name "GNOME Terminal" | |
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ command "gnome-terminal --maximize" | |
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ binding "<Primary><Alt>t" | |
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']" | |
# Print out all Slots | |
for i in `seq 0 9`; | |
do |
#!/bin/bash | |
### Google Domains provides an API to update a DNS "Syntheitc record". This script | |
### updates a record with the script-runner's public IP, as resolved using a DNS | |
### lookup. | |
### | |
### Google Dynamic DNS: https://support.google.com/domains/answer/6147083 | |
### Synthetic Records: https://support.google.com/domains/answer/6069273 | |
USERNAME="" |
#!/bin/bash | |
for i in $(seq 1 10000) | |
do | |
echo $(pwd) >/dev/null | |
done |
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
こんにちは高知工科大Advent Calendar 2015の6日目担当です.
今日は大学生なら一度は経験する問題について書いていきます.
みなさんも一度はmysqlを使った時に遅くてイライラしたことがあると思います.
大量のデータにselect文投げたら15時間経過した後に結果が帰ってくることとかあるあるですよね.
今日はそんな問題を多少改善する方法についてです.
This is a copy of work done by Jason Davies that demonstrates use of science.js. It is posted here simply so it can be studied. The original example code can be found at science.js/examples/kde. Slight modifications were made so it displays well on bl.ocks.org.
PHP | |
-------------------------------------------------------------- | |
Total Iterations: 10,000,000 | |
time(): 0.73976612091064 seconds (13,517,785/sec) | |
microtime(): 4.2245488166809 seconds (2,367,116/sec) | |
microtime(true): 1.2555038928986 seconds (7,964,929/sec) | |
HHVM | |
-------------------------------------------------------------- | |
Total Iterations: 10,000,000 |