このメモは、私(@ymmt2005)が長年にわたってソフトウェアプロダクト開発に関わってきて 2022年現在こうしたほうが良いと考えているベストプラクティスです。
科学的な分析等に基づくわけではない経験則であるため、今後も随時見直すことがありますし、 ここに書いてあることが常に正しいわけでもあらゆるソフトウェア開発に適するわけでもありません。
しかしながら、実務経験が豊富で、モダンな技術スタックに明るいエンジニアの経験則は一定の 役に立つのではないかと考えて記します。
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
Database files have to be updated before starting the server, here are the steps that had to be followed: | |
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
brew unlink postgresql | |
brew install postgresql@9.6 | |
brew unlink postgresql@9.6 | |
brew link postgresql |
'use strict'; | |
exports.handler = (event, context, callback) => { | |
// Get request and request headers | |
const request = event.Records[0].cf.request; | |
const headers = request.headers; | |
// Configure authentication | |
const authUser = 'user'; | |
const authPass = 'pass'; |
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add bootstrap@4.0.0-beta jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
 | |
$n$を正の整数とする。$n$を割り切る正の整数が$1$個しかないとき、$n$を<b>単数</b>という。ちょうど$2$個あるとき、$n$を<b>素数</b>という。$3$個以上あるとき、$n$を<b>合成数</b>という。 | |
$$ | |
\begin{array}{|c|c|c|c|c|c|c|c|c|c} | |
\hline | |
\textbf{単数} & 1 & & & & & & & & & & \\ | |
\hline | |
\textbf{素数} & & 2 & 3 & & 5 & & 7 & & & & \\ | |
\hline | |
\textbf{合成数} & & & & 4 & & 6 & & 8 & 9 & 10 & \\ |
お作法についてはRuby on Rails に貢献する方法 | Rails ガイドを参考にしています。
Railsのコードを読むには、最低限次の二つの知識があったほうがよいです
#!/usr/bin/env ruby | |
require 'openssl' | |
require 'base64' | |
require './worker.rb' | |
$urls = %w( | |
http://www.aozora.gr.jp/cards/001779/files/56647_ruby_58166.zip | |
http://www.aozora.gr.jp/cards/000148/files/752_ruby_2438.zip | |
http://www.aozora.gr.jp/cards/001383/files/56866_ruby_58168.zip |
# Typical setup to include TensorFlow. | |
import tensorflow as tf | |
# Make a queue of file names including all the JPEG images files in the relative | |
# image directory. | |
filename_queue = tf.train.string_input_producer( | |
tf.train.match_filenames_once("./images/*.jpg")) | |
# Read an entire image file which is required since they're JPEGs, if the images | |
# are too large they could be split in advance to smaller files or use the Fixed |
# Wouldn't it be great if you could have STI like functionality | |
# without needing to encode strings of class names in the database? | |
# Well today is your lucky day! Discriminable Model is here to help. | |
# | |
# Simply specify your models desired type column, and provide a block to | |
# do the discrimination. If you want the whole STI-esque shebang of properly | |
# typed finder methods you can supply an array of 'discriminate_types' that will | |
# be used to apply an appropriate type. | |
# | |
# class MyModel < ActiveRecord::Base |
# Before | |
Rails.application.config.assets.version = '1.0' | |
Rails.application.config.assets.paths << Emoji.images_path | |
Rails.application.config.assets.precompile += %w( search.js ) | |
# After | |
Rails.application.config.assets.tap do |assets| | |
assets.version = '1.0' | |
assets.paths << Emoji.images_path | |
assets.precompile += %w( search.js ) |