先日、表題のニュースがありました。以下、簡単な使い方メモ
1.拡張機能のインストール
- Colabという名前の拡張機能があるのでインストール(Google製であることを確認)
2.JupiterNotebook形式でファイル作成
- ファイル作成から、JupiterNotebook形式を選ぶ
3.カーネル選択
- Colabを選ぶ
- Auto Connectを選ぶとCPUだけ利用
- GPUやTPUを利用したい場合は、New Colab Serverを選ぶ
というところですね。
情報工学技術を利用した教育支援、いわゆる教育工学の研究やってます。研究に関係する技術動向(プログラミングねた)や、日常の覚書き、呟きなどを書いていこうかと思います。今のところ、初歩的なプログラムネタばっかりですが、、、、長い目でお付き合いください。
先日、表題のニュースがありました。以下、簡単な使い方メモ
1.拡張機能のインストール

public string getShorURL(string url){
string serviceURL = "https://www.googleapis.com/urlshortener/v1/url";
string jsonRequest = "{\"longUrl\": \"" + url + "\"}";
WebClient client = new WebClient { Encoding = Encoding.UTF8 };
client.Headers["Content-Type"] = "application/json";
return client.UploadString(serviceURL, jsonRequest);
}
結果は、JSON形式で以下のように返ってきます。 public void getAlbumList() throws MalformedURLException, IOException, ServiceException {
PicasawebService myService = new PicasawebService("example");
myService.setUserCredentials("USERID", "PASSWD");
URL feedUrl = new URL("http://picasaweb.google.com/data/feed/api/user/USERID?kind=album");
UserFeed myUserFeed = myService.getFeed(feedUrl, UserFeed.class);
for (AlbumEntry myAlbum : myUserFeed.getAlbumEntries()) {
System.out.println(myAlbum.getTitle().getPlainText());
System.out.println(myAlbum.getId());
}
}
public void getPhotoList() throws MalformedURLException, IOException, ServiceException {
PicasawebService myService = new PicasawebService("example");
URL feedUrl = new URL("http://picasaweb.google.com/data/feed/api/user/USERID/albumid/ALUBUMID");
myService.setUserCredentials("USERID", "PASSWD");
AlbumFeed feed = myService.getFeed(feedUrl, AlbumFeed.class);
for (PhotoEntry photo : feed.getPhotoEntries()) {
System.out.println(photo.getTitle().getPlainText());
System.out.println(photo.getHtmlLink().getHref());
System.out.println(photo.getId());
}
}
}