Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ jobs:
node_modules/.astro/assets
restore-keys: ${{ runner.os }}-astro-build
- run: bun run build
dirs-small:
name: All dirs must be small (<5MB)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- run: nix run github:ut-code/internal-helpers#disallow-large-dir contents/articles/*/*
- run: nix run github:ut-code/internal-helpers#disallow-large-dir contents/members/*
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,23 @@
- できないかつクロップが許容できない場合は、 `fit: contain` と背景色 (`bg_color:`) を指定してください。

- 画像サイズは 1MB 未満に抑えてください。 ffmpeg や ImageMagick を使い、解像度を下げたり、画質 (Quality) を下げたり、WebP (or AVIF) に変換するなどができます。

- 参考 <https://stackoverflow.com/questions/7261855/recommendation-for-compressing-jpg-files-with-imagemagick>
- 例:

- `mogrify -resize 800x -quality 80 -fromat webp *.png *.jpg *.jpeg`
- 見ての通り。
- `ffmpeg -i ./input.png -vf 'scale=1920:-1' -crf 10 output.avif`
- -> 50~300kb 程度になります。AVIF の場合、多少 (数秒~1分程度) 時間がかかります。
- `-vf scale={width}:{height}`: 画像の横幅。height が -1 のときは、横幅から計算する。
- `-crf`: 画像の圧縮率。大きいほうが圧縮率が高い。

- HEIC は対応していないので、 ImageMagick で他のフォーマットに変換してください。
- 例: `magick picture.HEIC picture.webp`

- 各記事のファイルサイズの合計は5 MB までに抑えてください。
- 理想は 1MB 未満です。
- ファイルサイズの確認には、`ncdu` が使いやすいです。

### プロジェクト

Expand Down
2 changes: 1 addition & 1 deletion contents/articles/2019/09-30_2019a-first-lecture/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ ut.code();では、水曜 6 限、土曜 2 限の時間で、全 8 回の学習

## 参考: オープンスペース

![駒場キャンパスオープンスペース](./komaba-open-space.jpg)
![駒場キャンパスオープンスペース](./komaba-open-space.webp)
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions contents/articles/2019/10-01_windows-home-to-education/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,42 @@ image: +/images/no-image.svg

提供されるライセンスは kivuto 社の管理の下で提供されているようです。アップグレード専用のライセンスのため、仮想環境等にクリーンインストールすることはできません。

![](./windows-01.png)
![](./windows-01.webp)

まずは[こちら](https://utokyo.onthehub.com/)にアクセスして、Windows 10 を選択しましょう。

![](./windows-02.png)
![](./windows-02.webp)

「カートに追加」と書いてあるので有料のように見えますが、もちろん無料です。

![](./windows-03.png)
![](./windows-03.webp)

東京大学の学生であることを証明するため、いつもの UTokyo Account でログインします。

![](./windows-05.png)
![](./windows-05.webp)

こちらも怖いですが同じく「ご注文手続き」をクリックです。

![](./windows-07.png)
![](./windows-07.webp)

連絡先を入力します。

![](./windows-08.png)
![](./windows-08.webp)

おめでとうございます!Windows 10 Education のプロダクトキーが発行されました!

![](./windows-09.png)
![](./windows-09.webp)

スタートメニューから「ライセンス認証」と検索し、「ライセンス認証の設定」をクリックします。

![](./windows-10.png)
![](./windows-10.webp)

「プロダクト キーの変更」をクリックします。

![](./windows-11.png)
![](./windows-11.webp)

先ほど発行されたプロダクトキーを入力しましょう。

![](./windows-12.png)
![](./windows-12.webp)

作業を全て終了し、「開始」ボタンを押せば完了です。自動的に再起動し、30 分程度でアップグレードが完了するはずです。
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Diff not rendered.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Console.WriteLine(100 * 15);

最近のエディタ(プログラムを編集するためのソフトウェア)では、プログラマの支援のための豊富な機能が搭載されています。その中でも最も使用頻度が高いのがこのエディタの補完と呼ばれる機能で、曖昧な知識をコンピューターが自動的に補ってくれます。

![補完が表示されている様子](./autocomplete.png)
![補完が表示されている様子](./autocomplete.webp)

C#は比較的「厳しい」言語なので、コンピューターにより容易にプログラムが解析できます。したがってエディタ上で表示される候補は(今回の環境では)「完璧」な候補であり、補完に従って書いている限りエラーになることはありませんし、補完に現れない書き方をしたらエラーとなります。

Expand Down Expand Up @@ -211,7 +211,7 @@ Console.WriteLine(i);

### フォーマッタにかけてみる

![フォーマッターの起動の様子](./format.png)
![フォーマッターの起動の様子](./format.webp)

\[Command / Ctrl\] + \[Shift\] + \[P\]に続いて、「Format Document」を選択しましょう。コードが正しければ、変化はほとんどないはずです。自分が書いたコードと見比べて、どのように直すべきなのか考えましょう。

Expand Down Expand Up @@ -288,7 +288,7 @@ double Factorial(int number)

### 実世界に例えてみよう

![](./analogy.png)
![](./analogy.webp)

「犬」という現実世界の物体を考えてみましょう。犬を特徴できる要素として、「名前」「年齢」「体調」といった値があるのに対し、「鳴く」「吠える」「走る」といった動作も存在しています。これらをまとめて「犬」を抽象化した「定義」を作成します。

Expand Down
Diff not rendered.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ title: "「エンジニアになろう」講習会初回講義を実施しまし
date: 2019-10-03T12:01:25+09:00
categories:
- "info"
image: ./image.jpg
image: ./image.webp
author: tnagaya
---

10/3 (水) 6 限、本セメスターの最初の活動として、[「エンジニアになろう」講習会](https://utcode.net/2019/info/2019a-schedule/)第一回を実施しました。

![](./people.jpg)
![](./people.webp)

6限での実施だったのにもかかわらず、たくさんの方にご参加いただきました!本当にありがとうございました。[今回の講座と同内容の講座](https://utcode.net/2019/info/2019a-first-lecture/)を今週の土曜日(10/5)に実施します!事前申込・事前準備等一切不要なので、ぜひお気軽にお越しください!
Diff not rendered.
Diff not rendered.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "第一回「エンジニアになろう」講習会土曜日の部を実
date: 2019-10-06T08:59:05+09:00
categories:
- "info"
image: ./image.jpg
image: ./image.webp
author: tnagaya
---

Expand Down
Diff not rendered.
Diff not rendered.
18 changes: 9 additions & 9 deletions contents/articles/2019/11-03_utcode-lectures-01/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ image: +/images/no-image.svg

[Visual Studio Code](https://code.visualstudio.com/)(以下 VSCode)は、Microsoft のエディタです。様々なプログラミング言語を軽快に扱えることで有名な、今最も人気のソフトウェアです。

![VSCodeの公式サイト](./vscode-official.png)
![VSCodeの公式サイト](./vscode-official.webp)

インストールが終わったら、「Remote: SSH」プラグインを追加しておきましょう。

![Remote - SSHプラグイン](./remote-ssh.png)
![Remote - SSHプラグイン](./remote-ssh.webp)

## PC とサーバー・VPS の利用

Expand All @@ -30,19 +30,19 @@ image: +/images/no-image.svg

[こちら](https://www.vultr.com/?ref=8284679-4F)から登録すると、ut.code();の公式サイトを運営するためのアカウントからの紹介としてカウントされるため、(広告のようで心苦しいのですが)$10 の入金で一ヶ月間使える$50 分のクーポンがもらえます。

[![Vultr公式サイト](./vultr-home.png)](https://www.vultr.com/?ref=8284679-4F)
[![Vultr公式サイト](./vultr-home.webp)](https://www.vultr.com/?ref=8284679-4F)

日本で使える VPS サービスとして、他にも ConoHa というサービスもあります。どちらを使っても大して変わりませんが萌えキャラが好きな方は ConoHa を使いましょう(詳しくはググりましょう)。

## Vultr で新しいサーバーを立ち上げる

以下の内容は Vultr に特有の内容ですが、基本的にどの VPS を利用しても同じです。

![Vultrの管理画面トップページ](./vultr-admin.png)
![Vultrの管理画面トップページ](./vultr-admin.webp)

Vultr の管理画面はシンプルで大変使いやすいデザインになっています。新しいサーバーを立ち上げる場合は、「+」ボタンを押してください。

![Vultrサーバーの設定画面](./launch-instance.png)
![Vultrサーバーの設定画面](./launch-instance.webp)

今回は上の画像のように設定してみましょう。OS の種類は Ubuntu 18.04 としています。実は Linux には様々な種類があり、Ubuntu はその中でも世界中で最も有名なものです。トラブルになった時にも情報が得られやすいので、ut.code();では基本的に Ubuntu を利用していきます。

Expand All @@ -52,11 +52,11 @@ Vultr の管理画面はシンプルで大変使いやすいデザインにな

## サーバーと IP アドレス

![IPアドレス](./ip-address.png)
![IPアドレス](./ip-address.webp)

リストに戻ると、4 つの数字がドット記号で区切られている部分があります。これを**IP アドレス**と呼びます。IP アドレスとは、一般的なネットワークに接続されているコンピューターを区別するための番号です。ネットワークに接続する全ての端末に、重複しないように割り当てられます。今皆さんが目の前にしている PC やスマホにも、もちろん割り当てられていますよ!

![サーバーの詳細情報](./server-info.png)
![サーバーの詳細情報](./server-info.webp)

サーバーの詳細情報を表示させると、ログイン用の ID やパスワードも表示できます。

Expand All @@ -66,11 +66,11 @@ Vultr の管理画面はシンプルで大変使いやすいデザインにな

VSCode を起動して、\[Cmd / Ctrl\] + \[Shift\] + \[P\]を押してください。このショートカットキーは、現在利用可能なすべての機能を一覧表示(コマンドパレット)し、素早くアクセスするためのショートカットキーです。VSCode は、このショートカットキーさえ覚えてしまえばどこに何の機能があるのかを全く覚えなくても使用できます。面倒くさがり屋のためのショートカットキーですね笑

![コマンドパレット](./command-palette.png)
![コマンドパレット](./command-palette.webp)

コマンドパレットから、「Remote-SSH: Connect Current Window to Host...」を実行します。実際には適当に入力して絞り込みをかけると素早くアクセスできます。

![ユーザー名とホスト名の指定](./connection-string.png)
![ユーザー名とホスト名の指定](./connection-string.webp)

先ほど確認したユーザー名と IP アドレスを、「ユーザー名@IP アドレス」の形式で指定します。続いてパスワードの入力も求められるので、同じように入力しましょう。途中で「Continue / Cancel」の選択を求められた場合は「Continue」を押して続行してください。

Expand Down
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
14 changes: 7 additions & 7 deletions contents/articles/2019/11-03_utcode-lectures-02/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ image: +/images/no-image.svg

「**ターミナル**」と呼ばれるソフトウェアがあります。これは、PC をマウスやタッチパネルではなく、文字によって操作するためのソフトウェアです。

![macOSのターミナル](./terminal.png)
![macOSのターミナル](./terminal.webp)

サーバーは、ネットサーフィンをしたり、表計算をしたり、ゲームをしたりするためのコンピューターではありません。したがって、サーバーに「画面」に相当するものはないのが普通です。使わなくなった PC をサーバーにする場合はあるんですけどね。したがって、サーバーを操作するためには、このように文字ベースのコマンドを使用する必要が出てきます。

「黒い画面」と呼ばれて恐れられるこのターミナルですが、慣れてしまえば全く怖くありません。今回は、VSCode に内蔵されているターミナルを使用して、サーバーをあれこれ操作していきましょう!

## VSCode 統合ターミナルの起動

![統合ターミナルの起動](./integrated-terminal.png)
![統合ターミナルの起動](./integrated-terminal.webp)

統合ターミナルの起動

メニューからターミナルを起動します。当然のことながらコマンドパレットからも起動できるのでお好みでどうぞ。

## ファイルシステムとユーザー

![ターミナルの見方](./prompt.png)
![ターミナルの見方](./prompt.webp)

パソコンでは、様々なデータを「ファイル」や「フォルダ」という単位で分けて管理しますよね。コマンドを使ってファイルシステムを操作するとき、普段皆さんが目にしている「フォルダ」に相当するものは「**ディレクトリ**」という名前で呼ばれます。

Expand All @@ -36,11 +36,11 @@ Linux において、ディレクトリは、「**ルートディレクトリ**

Linux には、最初から存在している「**root**」と呼ばれる特殊なユーザーがあります。root ユーザーは、コンピューター内の全てのファイルやディレクトリにアクセスできる権限を持っています。Ubuntu では、root ユーザーのホームディレクトリは/root にあります。

![ディレクトリの木構造](./directory-structure.png)
![ディレクトリの木構造](./directory-structure.webp)

## 相対パスと絶対パス

現在開いているディレクトリを「**カレントディレクトリ**」と呼びます。すべてのファイルやディレクトリは、ルートディレクトリを基準とした「**絶対パス**」で表される他、カレントディレクトリからの「**相対パス**」で表すことができます。例えば、カレントディレクトリが「/home/utcode」のとき、「/home/utcode/pictures/xxx.jpg」は「pictures/xxx.jpg」と表されます。
現在開いているディレクトリを「**カレントディレクトリ**」と呼びます。すべてのファイルやディレクトリは、ルートディレクトリを基準とした「**絶対パス**」で表される他、カレントディレクトリからの「**相対パス**」で表すことができます。例えば、カレントディレクトリが「/home/utcode」のとき、「/home/utcode/pictures/xxx.webp」は「pictures/xxx.webp」と表されます。

パスを表現するとき、他にも様々な記号が利用できます。

Expand All @@ -56,7 +56,7 @@ Linux には、最初から存在している「**root**」と呼ばれる特殊

## コマンドの入力方法

![コマンドを打ってみた様子](./run-command.png)
![コマンドを打ってみた様子](./run-command.webp)

コマンドはスペース区切りで入力し、最初がコマンド名、それ以降をそのコマンドの「**引数**」と呼びます。コマンド名や引数にスペース文字が含まれる場合は、値全体を「""(ダブルクォーテーション)」で囲むことでスペースが区切り文字として認識されることを防ぐことができます。以下にコマンドの一例を示します。使い方はググってください笑

Expand Down Expand Up @@ -94,4 +94,4 @@ Linux には、最初から存在している「**root**」と呼ばれる特殊

- コマンドのみを使用して、「/root」に以下に相当するディレクトリ構造を作成してください。

![課題: コマンドを使ってみる](./sample-structure.png)
![課題: コマンドを使ってみる](./sample-structure.webp)
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Loading