This file contains hidden or 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
| Parameters: | |
| KeyName: | |
| Description: The EC2 Pair to allow SSH access | |
| Type: 'AWS::EC2::KeyPair::KeyName' | |
| Resources: | |
| Ec2Instance: | |
| Type: 'AWS::EC2::Instance' | |
| Properties: | |
| SecurityGroups: | |
| - !Ref InstanceSecurityGroup |
This file contains hidden or 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
| { | |
| "Parameters": { | |
| "KeyName": { | |
| "Description": "The EC2 Key Pair to allow SSH", | |
| "Type": "AWS::EC2::KeyPair::KeyName" | |
| } | |
| }, | |
| "Resources": { | |
| "Ec2Instance": { | |
| "Type": "AWS::EC2::Instance", |
This file contains hidden or 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
| Resources: | |
| HelloBucket: | |
| Type: AWS::S3::Bucket | |
| Properties: | |
| AccessControl: PublicRead | |
| WebsiteConfiguration: | |
| IndexDocument: index.html | |
| ErrorDocument: error.html |
This file contains hidden or 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
| { | |
| "Resources" : { | |
| "HelloBucket" : { | |
| "Type" : "AWS::S3::Bucket", | |
| "Properties" : { | |
| "AccessControl" : "PublicRead", | |
| "WebsiteConfiguration" : { | |
| "IndexDocument" : "index.html", | |
| "ErrorDocument" : "error.html" | |
| } |
This file contains hidden or 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
| import os | |
| import glob | |
| import frontmatter | |
| target_file = "*.markdown" | |
| new_dir = "new/" | |
| os.makedirs(new_dir, exist_ok=True) | |
| for fname in glob.glob(target_file): |
This file contains hidden or 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
| import torch | |
| from torch import nn, optim | |
| from torch.utils.data import TensorDataset, DataLoader | |
| from sklearn.datasets import fetch_california_housing | |
| from sklearn.model_selection import train_test_split | |
| from sklearn.preprocessing import MinMaxScaler | |
| from sklearn.metrics import mean_absolute_error | |
| # データ読み込み、訓練データ/テストデータの分割 | |
| housing = fetch_california_housing() |
This file contains hidden or 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
| import os | |
| import glob | |
| import frontmatter | |
| def create_url(fname): | |
| return 'blog/' + fname.replace('-', '/', 3).replace('.markdown', '') | |
| target_file = "*.markdown" |
This file contains hidden or 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 'fileutils' | |
| pattern = /\d{4}-\d{2}-\d{2}-(.*)\.markdown/ | |
| Dir.glob('./*.markdown').each do |file| | |
| old_name = File.basename(file) | |
| next unless (md = old_name.match(pattern)) | |
| new_name = "#{md[1]}.md" | |
| FileUtils.mv(old_name, new_name) |
This file contains hidden or 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
| Dir.glob("**/*.txt").each do |t| | |
| src = File.expand_path(t) | |
| dist = src.gsub(/txt$/, "md") | |
| cmd = "git mv #{src} #{dist}" | |
| puts "Execute '#{cmd}'" | |
| `#{cmd}` | |
| end |
This file contains hidden or 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
| ' 指定のセルの位置に画像ファイルのイメージを等倍で貼り付ける | |
| Private Sub PasteImageFromFile(targetRange As Range, imageFilePath As String) | |
| Dim image As Shape | |
| Dim startingSheet As Worksheet | |
| ' 処理開始前のシートを記録する | |
| Set startingSheet = ActiveSheet | |
| targetRange.Worksheet.Activate | |
| targetRange.Select |