「sixty」を含む日記 RSS

はてなキーワード: sixtyとは

2019-07-25

anond:20190725100512

英語だって234,567を、two hundred thirty four thousand five hundred sixty sevenのようにフルに表記することは普通にある。

567をfive sixty sevenのように略して言うこともある。

それは覚えてもらうしかない。

漢数字アラビア数字たまたま一対一対応してるからといって、2万3千4百5十6なんていう表記間抜けっぽい。

壱と一、弐と二とかは考慮余地があるが、これは改ざん防止だからちょっと問題がちがう。

2019-07-10

Terms of Use

I. INTRODUCTION

These Terms of Use and End User License Agreement (collectively, the “Agreement”) together with all the documents referred to in it constitute a legally binding agreement made between you as a natural person (“you”, “your” or “user”) and We (“we,” “us” or “our”), concerning your access to and use of the software application for mobile devices (the “App”).

All the documents that relate to the App are hereby expressly incorporated herein by reference.

Please read this Agreement carefully before you download, install or use the App.

It is important that you read and understand this Agreement as by downloading, installing or using the App you indicate that you have read, understood, agreed and accepted the Agreement which takes effect on the date on which you download, install or use the App. By using the App you agree to abide by this Agreement.

If you do not agree with (do not accept) this Agreement, or if you do not agree at least with one of the provisions of this Agreement, you are not authorized to, and you may not access, download, install or use the App and you must ly discontinue downloading, installing the App and remove (delete) the App from any mobile device in your possession or under your control.

II. CHANGES TO THIS AGREEMENT

We reserve the right, at our sole discretion, to make changes or modifications to this Agreement at any time and for any reason. We will keep you informed about any changes by updating this Agreement and you waive any right to receive specific notice of each such change. It is your responsibility to periodically review this Agreement to stay informed of updates. You will be subject to, and will be deemed to be aware of and to have accepted, the changes in any revised Agreement by your continued use of the App after the date such revised Agreement is posted.

III. RESTRICTIONS ON WHO CAN USE THE APP

In order to download, install, access or use the App, you must (a) be eighteen (18) years of age or older.

All users who are minors in the jurisdiction in which they reside (generally under the age of 18) must have the permission of, and be directly supervised by, their parent or guardian to use the App, so if you are between the ages of thirteen (13) and seventeen (17) years and you wish to use download, install, access or use the App, before doing so you must: (a) assure and confirm (if needed) that your parent or guardian have read and agree (get your parent or guardian’s consent) to this Agreement prior to you using the App; (b) have the power to enter a binding contract with us and not be barred from doing so under any applicable laws.

Parents and guardians must directly supervise any use of the App by minors.

Any person under the age of thirteen (13) years is not permitted to download, install, access or use the App.

You affirm that you are either more than eighteen 18 years of age, or an emancipated minor, or possess legal parental or guardian consent, and are fully able and competent to enter into the terms, conditions, obligations, affirmations, representations, and warranties set forth in this Agreement, and to abide by and comply with this Agreement.

IV. GENERAL TERMS

The App is a utility program designed to enhance your device experience. The App allows to scan any types of document to high quality PDF or JPEG; to save and store any scan copies of documents on your mobile devices; to share your scans via email; upload scanned documents to cloud services like box, Evernote or Google Drive (see the full performance list on the App’s page on itunes.apple.com). All documents shall be stored locally on your device and shall never be sent to any third-party unless you export them to other apps or devices by means of the App.

The App is intended only for your personal non-commercial use. You shall use the App only for the purposes, mentioned above.

V. PRIVACY POLICY

Your privacy is very important to us. Accordingly, we have developed the Privacy Policy in order for you to understand how we process, use and store information including personal data. Access to the App and use of the Services is subject to the Privacy Policy. By accessing the App and by continuing to use the Services, you are deemed to have accepted the Privacy Policy, and in particular, you are deemed to have acknowledged the ways we process your information as well as appropriate legal grounds for processing described in the Privacy Policy. We reserve the right to amend the Privacy Policy from time to time. If you disagree with any part of the Privacy Policy, you must immediately stop using the App and Services. Please read our Privacy Policy carefully.

VI. END USER LICENSE AGREEMENT

By using the App, you undertake to respect our intellectual rights (intellectual rights related to the App’s source code, UI/UX design, content material, copyright and trademarks, hereinafter referred to as the “Intellectual Property Rights”) as well as those owned by third parties.

As long as you keep using the App, we you a limited, non-exclusive, non-transferable non-sublicensable, non-assignable and revocable license to access and use the App pursuant to this Agreement on any Apple-branded products that you own or control except that the App may be accessed and used by other accounts associated with you via Family Sharing or volume purchasing (the “License”).

The source code, design and content, including information, photographs, illustrations, artwork and other graphic materials, sounds, music or video (hereinafter – the “works”) as well as names, logos and trademarks (hereinafter – “means of individualization”) within the App are protected by copyright laws and other relevant laws and/or international treaties, and belong to us and/or our partners and/or contracted third parties, as the case may be.

In the event of any third party claim that your possession and use of the App infringes that third party’s intellectual property rights, Apple will not be responsible for the investigation, defense, settlement and discharge of any such intellectual property infringement claim.

These works and means of individualization may not be copied, reproduced, retransmitted, distributed, disseminated, sold, published, broadcasted or circulated whether in whole or in part, unless expressly permitted by us and/or our partners and/or contracted third parties, as the case may be.

All rights, title and interest in and to the App and its content, works and means of individualization as well as its functionalities (1) are the exclusive property of We and/or our partners and/or contracted third parties, (2) are protected by the applicable international and national legal provisions, and (3) are under no circumstances transferred (assigned) to you in full or in part within the context of the license herewithin.

We will not hesitate to take legal action against any unauthorized use of our trademarks, names or symbols to protect and restore our rights. All rights not expressly ed herein are reserved. Other product and company names mentioned herein may also be the trademarks of their respective owners.

VII. PROHIBITED BEHAVIOUR

You agree not to use the App in any way that:

is unlawful, illegal or unauthorized;

is defamatory of any other person;

is obscene or offensive;

infringes any copyright, right or trademark of any other person;

advocates, promotes or assists any unlawful act such as (by way of example only) copyright infringement or computer misuse.

You shall not make the App available to any third parties. In addition, you shall not modify, translate into other languages, reverse engineer, decompile, disassemble or otherwise derivative works from the App or any documentation concerning the App.

You shall not transfer, lend, rent, lease, distribute the App, or use it for providing services to a third party, or any rights to the App or any documentation concerning the App to a third party.

Misuse of any trademarks or any other content displayed on the App is prohibited.

You shall not copy and/or duplicate and/or distribute and/or publish and/or use any content in the App, directly or indirectly, by way of a violation of our Intellectual Property Rights.

Moreover, you shall not make any attempts to use the App or part thereof for malicious intentions.

Also we are not responsible for the way you use the App.

It is clarified that we may adopt, against a user who violated the present Agreement, any legal measures at our disposal pursuant to the applicable laws.

All disputes arising from the usage of the App, shall be governed by and construed in accordance with the laws of the United States of America, and shall be submitted to the sole jurisdiction of the competent courts of New York, New York, the United States of America.

VIII. AVAILABILITY OF THE APP, SECURITY AND ACCURACY

In order to use the App, you are required to have a compatible mobile phone or tablet, and internet access. However, please note that we offer you widgets that save translations and allow you to access them later in offline mode.

The App is available for downloading and installing on handheld compatible mobile devices running Apple iOS Operating System 11.0 with minimum system requirements.

We do not warrant that the App will be compatible with all hardware and software which you may use.

We make no warranty that your access to the App will be uninterrupted, timely or error-free. Neither does Apple have an obligation whatsoever to furnish any maintenance and support services with respect to the App.

You acknowledge the App is provided via the internet and mobile networks and so the quality and availability of the App may be affected by factors outside our reasonable control.

The version of the App may be upgraded from time to time to add support for new functions and services.

We may change or update the App and anything described in it without noticing you. If the need arises, we may suspend access to the App, or close it indefinitely.

You also warrant that any information that you submit to us is true, accurate and complete, and you agree to keep it actual at all times.

You can discontinue using our Services at any time by choosing the relevant option in your iTunes Account Settings. If you decide not to use the App for any reason you should uninstall the App.

IX. CHARGES

The App is provided on a paid basis. You will need to pay a one-time fee of $14.99 in order to download the App. Once you download the App, you will get access to all its features.

Prices are in U.S. dollars, may vary in countries other than the U.S. and are subject to change without notice.

You may be charged by your communications service provider for downloading and/or accessing the App on your mobile phone or tablet device, so you should check the terms of agreement with your operator. This may include data roaming charges if you do this outside your home territory. All these charges are solely your responsibility. If you do not pay the bills related to your mobile phone or tablet device, then we assume that you have the permission from the person that does it before incurring any of these charges.

X. THIRD PARTY WEBSITES AND RESOURCES

The App may link you to other sites on the Internet and contracted third parties to provide you certain services. We have no control over and accept no responsibility for the content of any website or mobile application to which a link from the App exists (unless we are the provider of those linked websites or mobile applications). Such linked websites and mobile applications are providedas is” for your convenience only with no warranty, express or implied, for the information provided within them.

You acknowledge that you must comply with applicable third party terms of agreement when using the App. You are solely responsible for and bear all risks arising from your use of any third-party websites or resources.

If you have any queries, concerns or complaints about such third party websites or mobile applications (including, but not limited to, queries, concerns or complaints relating to products, orders for products, faulty products and refunds) you must direct them to the operator of that third party website or mobile application.

XI. DISCLAIMER OF WARRANTIES

YOU AGREE THAT YOUR USE OF THE APP AND ITS SERVICES SHALL BE AT YOUR SOLE RISK. THE SERVICES AND ALL THE MATERIALS, INFORMATION, SOFTWARE, CONTENT INTEGRATED IN THE APP ARE PROVIDEDAS IS” AND “AS AVAILABLE”. WE DO NOT MAKE ANY WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, WITH REGARD TO THE MERCHANTABILITY, TECHNICAL COMPATIBILITY OR FITNESS FOR A PARTICULAR PURPOSE OF ANY SERVICE, PRODUCTS OR MATERIAL PROVIDED PURSUANT TO THIS AGREEMENT. WE DO NOT WARRANT THAT THE FUNCTIONS CONTAINED ON OR THROUGH THE SERVICES WILL BE AVAILABLE, UNINTERRUPTED OR ERROR-FREE, THAT DEFECTS WILL BE CORRECTED, OR THAT THE SER このエントリーをはてなブックマークに追加ツイートシェア

2016-04-13

2016 Calendar

はてな記法が一部使えますはてな記法一覧はてな記法が一部使えますはてな記法一覧

We are here to bring you the 2016 calendar of important dates and events in the world. If you want from month to month, day to day if you want, you can find a click away on our website calendar year if you wish.

You can save your work to date, you can yazdılar what you consider important. Youll find all the transactions made in calendar 2016.

Twelve-month amount beginning with Jan one and ending with December 31, and that has 12 months in non bissextile years and three hundred and sixty six days in an exceedingly leap year. additionally referred to as yr.

2012-02-10

How do you know to the Nikon D90

It had been a little situation of one's before one of the many high-end camera makers learned the particular Live life Access manner with a DIGITAL SLR requested a good online video media picture after which you can created a way to help you listing the item. Olympus seemed to be hinting at the capability in Present cards 2006, as soon as E-330 (the very first video camera by means of survive viewing) is released. Nonetheless Nikon was towards the blog post while using the D90 along with Cannon is definitely soon after along with the just-announced Canon EOD 5D Mark II Battery.

Typically the 12. 3-megapixel D90 carries LARGE DEFINITION online video from a conclusion with 1280 back button 720 pixels at 27 frames/second using the understanding and also depth-of-field restrain which usually simply a DIGITAL SLR offer. Naturally, Nikon isn't going to space an expensive precedence about this skill (and not undertake most people, finding the software when alot more of the adjunct you'll take advantage of once in a while, than only a main objective just for obtaining that D90). But, because this can be a 'world first', Photography Analyze is going to tackle the application ahead of moving on that will alternative further important qualities.

Virtually no owner guide book was initially supplied with a analysis camera still (after some hassles) most of us made it possible to down load an important PDF FILE type from Nikon European union ?nternet site. Surprisingly, this manually operated exclusively devotes one-and-a-half of 270 pages of content for you to video clip producing tasks and approximately a couple thirds of the site to help you videos playback. Less a page can be specified up to a show frame proportions in addition to appear possible choices : the 120 websites following on from the primary arguments belonging to the video clip manner.

Picture Abilities

Training video in any DIGITAL CAMERA is really a important loan -- primarily for the Nikon D90 Battery cost. Beforehand, any time you required a fabulous video camera by using compatible contact lenses, which you were taking a look at round $7000 for just a unit which will would not quite possibly track record high-definition, widescreen picture. However the D90 presents way more for just a cheaper package price by providing visitors while using same sorts of manipulate in excess of centering, subjection and additionally depth-of-field like they have having a DIGITAL CAMERA digicam, combined internet site snap by using almost any Nikkor website.

But, the actual D90's online video media model is absolutely not fantastic. As movie can certainly sole often be captured throughout Are located Perspective application, you are jammed aided by the prohibitions this means that (see below). The actual noise is normally taped monaurally and then the video recording formatting is certainly AVI which will, even though it truly is best with a large number of updating functions, uses so much ram (roughly 400MB for minute). Within assessments, some 24-second cut saved for 1280 times 720 LARGE DEFINITION method for 176 kbps appeared to be 40. 7MB dimensions.

Amazingly, this high-end camera works iwth using the premier random access memory playing cards. SOME SORT OF 32GB SDHC should help you track record as much as sixty units for training video, even though a different reduction is definitely which will video plans will be available to personal training minutes for HARLEY-DAVIDSON function and 20 short minutes with typical quality.

Saddest of can be the possibility that any autofocusing procedure :Nikon D90 Charger as well as some other primary adjustments - are not to be implemented if you find yourself photographing online video media. You can actually place emphasis quickly well before taking any preview not to mention make use of the manual place emphasis wedding ring within the contact lens even while photographing. Although if the content steps near as well as from everyone as long as you're taking, blurring might be unavoidable.

Different works that need to be placed well before taking a good movie involve getting exposed compensation, vivid white stability in addition to tact surroundings. For anyone utilizing aperture-priority AE, you can actually transformation a aperture functions even though tracking your movie and as well lens quality in and additionally available - nevertheless it will be hazardous seeing that sticking to center is usually hard.

Well before beginning online video grab you have to find the wished-for audio mode from Dvd movie Controls sub-menu while in the firing navigation. 3 selections are offered: 1280 back button 720 (16: 9), 640 back button 424 (3: 2) not to mention 320 x 216 (3: 2). You too can change this reasonable producing at as well as out (the default setting up might be ON).

Most of online video media photographing pattern goes as follows:

1. Arranged this high-end camera to have Perspective way by simply hitting a LV tab.

step 2. Target about them just by half-pressing a shutter mouse if you are throughout autofocus form; also concentrate personally.

3. Marketing a O . K . key in the center from the arrow topper to get started producing.

check out. Prevent the theme presented plus centred throughout the taking progression.Nikon Coolpix S3100 Charger for anyone within information option, you can actually switch totally focus by hand while you step on the way to and / or clear of this issue. Cautious mainly vigilant while blasting close-ups when smallish differences within the place emphasis position can display simply because blurring on the content. (To confuse issues, you'll find it tough to ascertain if the appearance within the LCD is definitely pin-sharp through bright normal light while you can not use a viewfinder on Take up residence Check out manner. )

5. To cure documenting, advertising OKAY all over again.

Taking part in lower back taped video tutorials is simple. Mass media all the LV control key the next time for you to disengage Live life Watch consequently touch typically the review button in the software. Make use of the arrow mattress pad to pick out your snap you need to have fun with not to mention press RIGHT to begin the process preventing this video clip playback.

2009-12-23

エロ単語帳 rev1.35+

なんとなくメンテナンスしてみた。

自分用なんで、細かいことは気にしない

■■年齢容姿

熟女

・MILF(略:Mom,I'd Like to Fuck)

女子学生

・school girl

美少女

・nymph

若い子

・young

・18yo(略:18 Year Old)

小学校高学年から中学生

・nymphet

10代のうち13歳以上

・teen

・teen age

10代のうち12歳以下

・subteen

・preteen

幼女

lolita

・loli

・pedo

デブ

fat

ぽっちゃり

・chubby

痩せ

・skinny

■■身体(胸部)

乳首

・nipple

微乳

・flat boobs

貧乳

・small boobs

巨乳

melon boobs

■■身体(下腹部)

女性

・cunt

パイパン

・tight pussy

・shaved

巨根

・well hung

■■臀部

・ass

■■行為

手コキ

・hand job

足コキ

toe job

・foot job

フェラ

・fellatio

blow job

・deepthroat

パイズリ

・titty fuck(短縮:titty、titfuck)

・tit wank

オナニー

・wank

・masturbation

・masturbate

放尿

・peeing

潮吹き

・squirting

female ejaculation

・gushing

■■性交

挿入

・penetrate

セックス(行為)

make love

・poontang

・screw

体位

・正常位

  missionary position

騎乗

  riding,woman on top

  cowgirl position

・背後位

  doggy style

  Spoons

・交差位

  tribadism

シックスナイン

  69

  sixty-nine

3P

・threesome

・3some

  男1+女2:ffm

  男2+女1:mmf

乱交

orgy

・gang bang

アナルセックス

・butt fuck

■■射精

精子

cream(短縮:cum)

・Semen

射精

cream shoot(短縮:cumshot)

中出し

creampie

・Middle soup stock

・vaginal cumshot

・cum pussy

顔射

・bukkake

・facial cumshot

・squirt

■■動詞

舐める

・licking

飲む

・deepthroat

■■性癖

少女

・girllove

少女性愛

・pedophilia

変態性欲

・paraphilia

マゾ

・masochism

■■行動

痴漢

・molest

・molestation

■■その他,一般(?)名詞

淫乱

・nympho

・nymphomaniac

触手

・tentacle

性的表現のある日本アニメマンガ

hentai

百合

・Shoujo-ai

ボーイズラブ

・Shonen-ai

・Global BL(短縮:GloBL)

性交のあるエロ

hardcore

性交がないエロ

・softcore

AV女優

・pornstar

売春(援交)

・prostitution

素人

・amateur

パンチラ

・upskirt

無修正

・uncensored

コスプレ

・costume

・cosplay

盗撮

・caught

変態

・kinky

2009-06-04

役に立つかもしれないエロ英単語 rev 1.2

エロ動画検索として最適な マイクロソフト検索エンジン

http://www.bing.com/videos

で役に立つかもしれないエロ英単語 加筆改訂版

そのまんまってのが有るけど気にしない。

一般(?)名詞

精子
美少女
  • nymph
AV女優
  • pornstar
パンチラ
  • upskirt
売春(援交)
  • prostitution
素人
  • amateur

年齢層

熟女
  • MILF(略:Mom,I'd Like to Fuck)
女子学生
  • school girl
若い子
  • young
  • 18yo(略:18 Year Old)
小学校高学年から中学生
  • nymphet
10代のうち13歳以上
  • teen
  • teen age
10代のうち12歳以下
  • subteen
  • preteen
幼女

体型

デブ
ぽっちゃり
  • chubby
痩せ
  • skinny

身体(胸部)

乳首
  • nipple
微乳
  • flat boobs
貧乳
  • small boobs
巨乳

身体(下腹部)

パイパン
  • tight pussy
  • shaved

臀部

  • ass

行為

手コキ
  • handjob
フェラ
  • fellatio
  • blow job
パイズリ
  • titty fuck(短縮:titfuck)
  • tit wank
オナニー
  • wank
  • masturbation
  • masturbate
放尿
  • peeing
潮吹き
  • squirting
  • female ejaculation
  • gushing

性交

セックス(行為)
体位
3P
  • threesome
  • 3some
    • 男1+女2:ffm
    • 男2+女1:mmf
乱交

射精

射精
  • cream shoot(短縮:cumshot)
中出し
  • creampie
  • Middle soup stock
  • vaginal cumshot
  • cum pussy
顔射
  • bukkake
  • facial cumshot

性癖

少女
少女性愛
  • pedophilia
変態性欲
  • paraphilia
マゾ
  • masochism

行動

痴漢
  • molest
  • molestation

その他

淫乱
  • nympho
  • nymphomaniac
触手
  • tentacle
性的表現のある日本アニメマンガ
百合
ボーイズラブ
  • Shonen-ai
  • Global BL(短縮:GloBL)
性交のあるエロ
性交がないエロ
  • softcore

2009-01-21

毎朝読対訳:就任演説(9)

http://anond.hatelabo.jp/20090121155728

 Our challenges may be new.

(M)我々の試練は新しいのかもしれない。

(A)私たちの挑戦は新しいものかもしれない。

(Y)我々の挑戦は新しいものかもしれない。

 The instruments with which we meet them may be new.

(M)それに立ち向かうための道具も、新しいかもしれない。

(A)立ち向かう手段も新しいものかもしれない。

(Y)我々がそれに立ち向かう手段も新しいものかもしれない。

 But those values upon which our success depends - hard work and honesty, courage and fair play, tolerance and curiosity, loyalty and patriotism -

(M)我々が成功するかどうかは、労働と誠実さ、勇気、フェアプレー、忍耐、好奇心忠誠心愛国心にかかっている。

(A)だが、成否を左右する価値観は、勤労と誠実さ、勇気と公正さ、寛容と好奇心、忠誠と愛国心、といったものだ。

(Y)しかし、我々の成功は、誠実や勤勉、勇気、公正、寛容、好奇心忠誠心愛国心といった価値観にかかっている。

 - these things are old. These things are true.

(M)古くから言われていることだ。だが、真実だ。

(A)これらは古くから変わらない。そしてこれらは真理だ。

(Y)これらは、昔から変わらぬ真実である。

 They have been the quiet force of progress throughout our history.

(M)それは歴史進歩させた静かな力だった。

(A)私たちの歴史を通じて、これらは前に進む静かな力となってきた。

(Y)これらは、歴史を通じて進歩を遂げるため静かな力となってきた。

 What is demanded then is a return to these truths.

(M)今求められているのは、こうした真理への回帰だ。

(A)必要なのは、こうした真理に立ち返ることだ。

(Y)必要とされるのは、そうした真実に立ち返ることだ。

 What is required of us now is a new era of responsibility -

(M)責任を果たすべき新たな時代だ。

(A)今私たちに求められているのは、新たな責任の時代だ。

(Y)いま我々に求められているのは、新しい責任の時代に入ることだ。

 - a recognition, on the part of every American, that we have duties to ourselves, our nation, and the world, duties that we do not grudgingly accept but rather seize gladly, firm in the knowledge that there is nothing so satisfying to the spirit, so defining of our character, than giving our all to a difficult task.

(M)我々米国人一人ひとりが、自分自身や国家世界に義務を負っていることを認識し、こうした義務を嫌々ではなく、喜んで受け入れることだ。私たちにとって、困難な仕事に全力で立ち向かうことほど、自らの性格定義し、精神をみたすものはない。

(A)それは、一人ひとりの米国人が、私たち自身や我が国、世界に対する責務があると認識することだ。その責務は嫌々ではなく、むしろ困難な任務にすべてをなげうつことほど心を満たし、私たち米国人を特徴づけるものはないという確信のもとに、喜んで引き受けるべきものだ。

(Y)米国民一人ひとりが自分自身と自国、世界に義務を負うことを認識し、その義務をいやいや引き受けるのではなく喜んで機会をとらえることだ。困難な任務に我々のすべてを与えることこそ、心を満たし、我々の個性を示すのだ。

 This is the price and the promise of citizenship.

(M)これが市民であることの代償と約束だ。

(A)これが市民であることの代償と約束である。

(Y)これが市民の代償であり約束なのだ。

 This is the source of our confidence - the knowledge that God calls on us to shape an uncertain destiny.

(M)これが私たちの自信の源泉だ。神が未知の運命を自らの手で形作るよう、我々に求めたものだ。

(A)これが、不確かな行き先をはっきりさせることを神が私たちに求めているという、私たちの自信の源でもある。

(Y)これが我々の自信の源なのだ。神が、我々に定かではない運命を形作るよう命じているのだ。

  This is the meaning of our liberty and our creed - why men and women and children of every race and every faith can join in celebration across this magnificent mall, and why a man whose father less than sixty years ago might not have been served at a local restaurant can now stand before you to take a most sacred oath.

(M)なぜ男性女性子供たちも、どのような人種宗教の人々も、こうして就任式に集まることができるのか。なぜ約60年前なら地元レストランで給仕されなかった可能性のある男の息子が、こうして皆さんの前で宣誓式に臨むことができるのか。これこそが、我々の自由、我々の信条意味なのだ。

(A)これが、私たちの自由と信念の意味だ。なぜあらゆる人種信仰男性女性子供がこの広大な広場に集い、共に祝えるのか。そしてなぜ、60年足らず前だったら地元レストランで食事をさせてもらえなかったかもしれない父を持つ男が、(大統領就任の)神聖な宣誓のためにあなたたちの前に立つことができるのか、ということだ。

(Y)これが我々の自由と信条意味なのだ。なぜ、あらゆる人種信条の男女、子どもたちが、この立派なモールの至る所で祝典のため集えるのか。そして、なぜ60年足らず前に地元食堂で食事することを許されなかったかもしれない父親を持つ男が今、最も神聖な宣誓を行うためにあなた方の前に立つことができるのか。

2007-10-30

40行で作るPerlテンプレートエンジン

60行で作るPHP用テンプレートエンジン

やってしまった・・・。

方針:

  • PHPのように<?php・・・?>が無いのでそのまま表示と(foreach|if|unless)に対応。
  • [% $c{title} %]で普通に表示(TTっぽい?)
  • [# $c{title} #]でHTMLエスケープ表示

package SixtyLinesTemplate;

use strict;
use warnings;
our $VERSION = '0.01';

sub convert {
    return unless defined(my $str = shift);
    $str =~ s{&}{&}gso;
    $str =~ s{<}{&lt;}gso;
    $str =~ s{>}{&gt;}gso;
    $str =~ s{\"}{&quot;}gso;
    $str;
}

sub include_template {
    my $tmpl = shift;
    my %c = %{+shift};
    eval convert_template($tmpl);
    die $@ if $@;
}

sub convert_template {
    my $tmpl = shift;
    my $cache = $tmpl.'.cache';
    return scalar do { open my ($FH) , $cache; local $/; <$FH> }
        if ( -f $cache &amp;&amp; (stat($tmpl))[9] <= (stat($cache))[9] );
    my $out = do { open my ($FH) , $tmpl; local $/; <$FH> };
    $out =~ tr/()/\x28\x29/;
    $out =~ s/\[%\s*(foreach|if|unless|end)\s*(.+?)\s*{?\s*%\]/");".(lc($1) eq 'end' ? '} print q(' : "$1 $2 { print q(")/ige;
    $out =~ s/\[%(.+?)%\]/);print $1; print q(/g;
    $out =~ s/\[#(.+?)#\]/);print SixtyLinesTemplate::convert($1); print q(/g;
    $out = 'print q('.$out.');';
    open my ($FH) , '>' , $cache;
    print $FH $out;
    $out;
}

1;

サンプルコード


use SixtyLinesTemplate;

my $context = {
    'title' => 'Example',
    'list'  => [10,'<A&amp;B>']
};

SixtyLinesTemplate::include_template('template.tmpl',$context);

サンプルテンプレート


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head&gt;
    <title>[# $c{title} #]</title>
  </head&gt;
  <body>
    <h1>[# $c{title} #]</h1>
    <table>
[% foreach my $i (0..@{$c{list}}-1) %]
      <tr bgcolor="[% $i % 2 ? '#FFCCCC' : '#CCCCFF' %]">
        <td&gt;[% $i %]</td&gt;
        <td&gt;[# $c{list}[$i] #]</td&gt;
      </tr>
[% end %]
    </table>
  </body>
</html>

出力例:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Example</title>
  </head>
  <body>
    <h1>Example</h1>
    <table>

      <tr bgcolor="#CCCCFF">
        <td>0</td>
        <td>10</td>
      </tr>

      <tr bgcolor="#FFCCCC">
        <td>1</td>
        <td>&lt;A&amp;amp;B&gt;</td>
      </tr>

    </table>
  </body>
</html>

foreachんところが汚く見えるかもしれませんが、あれは添え字を取ろうとするとああなるんでご勘弁を。

普通ループするだけならforeach my $item (@$c{title}) でいけますゆえ。

あと存在しない変数とか使うと死んだり警告でたりするのでevalの前にno strictとno warningsをやった方がいいかもねぇ。

って何まじめに検証してんだ俺・・・orz

追記:

SixtyじゃなくてFortyだね。恥ずかし!

追追記:

danさんに添削頂いたYO!

でも&amp;の奴はちゃんと書いてるんだけども投稿すると勝手エスケープされてしまってるんだよね。何でだろ?

ちなみにこのconvertの処理はCGI::Utilから拝借しました。

 
アーカイブ ヘルプ
ログイン ユーザー登録
ようこそ ゲスト さん