先日の講義でプログラムと型の話がありました。
一部の方には、実際に何が問題になり得るかを口頭で説明しましたが、念の為実際に問題になる実例を示します。 なお、本文の内容は授業上必須ではないはずですので、お暇な方だけ、どうぞ。
ここでは来週説明する予定であるifとforが出ていますので、今は雰囲気だけ感じてください。
#forについてはp121、ifについてはp128に、それぞれ説明があります。
一時期話題になった、FizzBuzzというプログラムを例に挙げてみます。
# Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
# Use of this source code is governed by a BSD-style license that can be | |
# found in the LICENSE file. | |
# | |
# GNU Make based build file. For details on GNU Make see: | |
# http://www.gnu.org/software/make/manual/make.html | |
# | |
# |
# Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
# Use of this source code is governed by a BSD-style license that can be | |
# found in the LICENSE file. | |
# | |
# GNU Make based build file. For details on GNU Make see: | |
# http://www.gnu.org/software/make/manual/make.html | |
# | |
# |
dn: cn=samba,cn=schema,cn=config | |
objectClass: olcSchemaConfig | |
cn: samba | |
olcAttributeTypes: {0}( 1.3.6.1.4.1.7165.2.1.4 NAME 'acctFlags' DESC 'Account | |
Flags' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} S | |
INGLE-VALUE ) | |
olcAttributeTypes: {1}( 1.3.6.1.4.1.7165.2.1.3 NAME 'pwdLastSet' DESC 'NT pwdL | |
astSet' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VAL | |
UE ) | |
olcAttributeTypes: {2}( 1.3.6.1.4.1.7165.2.1.5 NAME 'logonTime' DESC 'NT logon |
dn: cn=apple_auxillary,cn=schema,cn=config | |
objectClass: olcSchemaConfig | |
cn: apple_auxillary | |
olcAttributeTypes: {0}( 1.2.840.113556.1.4.867 NAME 'altSecurityIdentities' EQ | |
UALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.14 | |
66.115.121.1.15 ) | |
olcAttributeTypes: {1}( 1.2.840.113556.1.4.771 NAME 'servicePrincipalName' EQU | |
ALITY caseExactMatch SUBSTR caseExactSubstringsMatch SYNTAX 1.3.6.1.4.1.1466. | |
115.121.1.15 ) |
dn: cn=apple,cn=schema,cn=config | |
objectClass: olcSchemaConfig | |
cn: apple | |
olcAttributeTypes: {0}( 1.3.6.1.4.1.250.1.60 NAME 'ttl' EQUALITY integerMatch | |
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) | |
olcAttributeTypes: {1}( 1.3.6.1.4.1.63.1000.1.1.1.1.6 NAME 'apple-user-homeurl | |
' DESC 'home directory URL' EQUALITY caseExactIA5Match SUBSTR caseExactIA5Sub | |
stringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) | |
olcAttributeTypes: {2}( 1.3.6.1.4.1.63.1000.1.1.1.1.7 NAME 'apple-user-class' | |
DESC 'user class' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMat |
FFmpeg Howto | |
Table of Contents | |
* Generic Syntax | |
* Main Options | |
* Encoding : |
先日の講義でプログラムと型の話がありました。
一部の方には、実際に何が問題になり得るかを口頭で説明しましたが、念の為実際に問題になる実例を示します。 なお、本文の内容は授業上必須ではないはずですので、お暇な方だけ、どうぞ。
ここでは来週説明する予定であるifとforが出ていますので、今は雰囲気だけ感じてください。
#forについてはp121、ifについてはp128に、それぞれ説明があります。
一時期話題になった、FizzBuzzというプログラムを例に挙げてみます。
#!/usr/bin/ruby | |
class Test | |
def initialize | |
end | |
def test | |
f = Proc.new {|item| puts item} | |
f.call("hello1") | |
f("hello2") |
# -*- coding: utf-8 -*- | |
import webapp2 | |
import logging | |
class MainPage(webapp2.RequestHandler): | |
def get(self): | |
addr = self.request.remote_addr | |
try: | |
lst = self.request.get_all('q') |
!/bin/bash | |
host='localhost' | |
verbose=1 | |
request_decrypt() { | |
otp=$1 | |
qw_str=$(echo $otp | tr "axje.uidchtnmbrl'poygk,qf;" 'abcdefghijklmnopqrstuvwxyz') | |
url="http://${host}/wsapi/decrypt?otp=${qw_str}" | |
test $verbose -eq 1 && echo "url: ${url}" |