はてなキーワード: Requireとは
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.
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.
You agree not to use the App in any way that:
is unlawful, illegal or unauthorized;
is defamatory of any other person;
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.
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 provided “as 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.
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 PROVIDED “AS 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 Permalink | 記事への反応(0) | 23:18
一応あらかじめ釘を指しておくと、有名で実用的な言語に限った比較の話である
「LL言語は楽勝」というのが一般的な見解だと思うけど、よくよく考えてみたらRubyほど学習コストの高い言語も珍しいと思う
言語を(使うものとして)理解するには、「コアコンセプトを理解する」「構文を覚える」「組み込み/標準ライブラリに何が有るかを覚える」という要素があるように感じている(これは感じているだけなので事実ではないかもしれない)
Rubyはプログラマがプログラミング的なことについて楽をするための言語である(と思う)
たとえば素数判定ひとつするにしても、自力で高速な素数判定を実装するよりも、 require 'prime' して Integer#is_prime? するのが正しいという雰囲気がある
というよりも、自力で一生懸命実装することが悪であるかのような雰囲気さえある
「こう書けば短い/楽なのに、どうしてそう書かないの?」という雰囲気が漂っている
Rubyで時間計算量やメモリ効率の話をするのはナンセンスなので、純粋に書き方のみを取り上げて優劣を語ることができる
そうなってくると、『ちゃんとRubyが書ける』という状態になるには「組み込み/標準ライブラリに何が有るかを覚える」というステップが非常に大事になってくる
これが莫大なコストになっている。
「コアコンセプトを理解する」コストはHaskellやRustではやや大きいかもしれないが理解するのはそう難しくない「Haskell入門して1ヶ月経つけどHaskellの何が特徴的なのかまったくわからん」などという人はいない
そう考えるとRubyは「組み込み/標準ライブラリに何が有るかを覚える」が非常に大事だし莫大な量である
Rubyに入門して数年経つけど、いまだに「えっこんなメソッドあったの」というのが時々ある
辛い
犯罪者にはならない 無害なMAP (minor-attracted person=未成年者に引かれる人)を
更に言えば性犯罪以前に、(利益を目的としていない)犯罪自体が自閉傾向が強いそうな
でもワイはしっかり教育をし、どんな特性を持っていても、平穏に暮らせるようにした方が良いと思っている
■法律の問題:通報義務があるのでペドがカウンセラーに相談できない事態 (治療拒否ならまだ良い方)
At the same time, laws can also deter them from even speaking to their therapists.
Across Canada, provincial rules require that mental-health professionals must report a patient to authorities if they have reasonable grounds to believe that a specific child is at risk of being sexually molested or exploited.
At the same time, laws can also deter them from even speaking to their therapists.
Across Canada, provincial rules require that mental-health professionals must report a patient to authorities if they have reasonable grounds to believe that a specific child is at risk of being sexually molested or exploited.
■それでは深刻化するばかりだと治療しようとするも、ペドは自閉症または統合失調気味で知能が低めとバッサリ
https://www.cbc.ca/news/canada/virtuous-pedophiles-group-gives-support-therapy-cannot-1.2710160
■法律の問題:通報しないといけないのでペドがカウンセラーに相談できない可能性
Many jurisdictions have passed mandatory reporting regulations for psychologists and other health care providers.
Consequently, when someone who thinks he might be a pedophile comes in for counseling or therapy, the psychologist may be compelled by law to report the person to the authorities.
https://www.theatlantic.com/health/archive/2013/08/what-can-be-done-about-pedophilia/279024/
■通報じゃなくて無害なMAP(minor-attracted person=未成年者に引かれる人)をメンタルヘルスの専門家は支援しようという試み。なお保守派右翼はおこ
はてブのおもしろページ、ねこのら~とか言うのが3つもあって目障り。
Anti-アドブロッカーキラー関連ですでに入れている人も多いかも。
https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=ja
http://b.hatena.ne.jp/hotentry/funに対して、下記のスクリプトを追加する。
// ==UserScript== // @name New Userscript // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match http://b.hatena.ne.jp/hotentry/fun // @require http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js // @grant none // ==/UserScript== (function() { 'use strict'; $('.following-bookmarks-container[data-entry-url^="http://www.nekonora"]').parent().parent().remove(); })();
やった~
日本の現行法で医師/弁護士の守秘義務が解除される場合として、
児童福祉法第 25 条
児童虐待の防止等に関する法律第 5 条 同第 6 条第 1 項・第 3 項)
児童虐待に係る通告)
3 刑法(明治四十年法律第四十五号)の秘密漏示罪の規定その他の守秘義務に関する法律の規定は、第一項の規定による通告をする義務の遵守を妨げるものと解釈してはならない。
とはいえ反社会的なこと言っても実害が確認されなければ傾聴が基本
※カナダについて
通告義務について
・医師、看護婦(士)、歯科医、薬剤師、臨床心理士を含む、ヘルス・ケア専門職
・ユースワーカー、レクリエーションワーカー
・弁護士
刑罰について
上記の通告義務者が、疑わしい子ども虐待・ネグレクトに関して通告を怠った場合には、
通報者は子どもの虐待、ネグレクトに気づいたら、「疑い」だけで通告することができる。この段階では、虐待の疑いについて事前評価と調査を実施0の結果、通告の半分の45%が誤通となるが、逆に表現するとその半分の55%が保護などのサービスを受けている。
http://www.ritsumei.ac.jp/~yamamoto/seminar/03goudou/rits2ss.htm
※アメリカについて
<児童虐待通告法>
各州の通告義務者 約40種ほどの専門職 (特に重要な専門家は、医療関係者・保険従事者・教育関係者・社会サービス関係者・司法、警察関係者)
義務とはなっていない者 家族・隣人・一般人(但しこれらからも通告を受け入れる)
各州の特殊な例 コロラド・イリノイ・カリフォルニア州 写真の現像者にも通告義務(児童の性的な写真に明白に現れているような性的虐待や性的搾取を知る立場にある者)
フロリダ・ケンタッキー・ミネソタ州等 虐待を疑う立場にある者は誰でも通告義務がある
措置 以前に同様の虐待事実があることがわかり、その事実に疑いを持ちながらも通告しなかった通告義務者の存在が明らかになったとき、通告義務者にも訴追が行われる。罰金、拘禁刑の制裁に対応し、行政的には、医師等の免許取り消しまたは停止の措置がとられている。
問題点 監視の網の目を細かくしすぎた。→精神科医やカウンセラーに対しても通告義務を課し、虐待の範囲で不明瞭な法律規定をおいたことから、児童虐待の定義が不本意に拡張され、あいまいなものとなった
http://www.ritsumei.ac.jp/~yamamoto/seminar/03goudou/rits2ss.htm
イギリス
■ドキュメント映画:The Paedophile Hunter・・・文字通りペドを狩る。狩られた者は実際には行為に及んでおらず(逮捕後、釈放もされた)撮影が原因により自殺したが起訴なし。英国アカデミー賞テレビ部門 単発ドキュメンタリー賞受賞作品。なおペドの疑いがある者に私刑を行う団体と支援者がいる模様
■UK-wide operation snares 660 suspected paedophiles・・・存在的な児童虐待犯罪者が一線を超える前(他害する前)にアクションが大事
http://www.nationalcrimeagency.gov.uk/news/411-uk-wide-operation-snares-660-paedophiles
■法律の問題:通報義務があるのでペドがカウンセラーに相談できない事態 (治療拒否ならまだ良い方)
At the same time, laws can also deter them from even speaking to their therapists.
Across Canada, provincial rules require that mental-health professionals must report a patient to authorities if they have reasonable grounds to believe that a specific child is at risk of being sexually molested or exploited.
At the same time, laws can also deter them from even speaking to their therapists.
Across Canada, provincial rules require that mental-health professionals must report a patient to authorities if they have reasonable grounds to believe that a specific child is at risk of being sexually molested or exploited.
■それでは深刻化するばかりだと治療しようとするも、ペドは自閉症または統合失調気味で知能が低めとバッサリ
https://www.cbc.ca/news/canada/virtuous-pedophiles-group-gives-support-therapy-cannot-1.2710160
■法律の問題:通報しないといけないのでペドがカウンセラーに相談できない可能性
Many jurisdictions have passed mandatory reporting regulations for psychologists and other health care providers.
Consequently, when someone who thinks he might be a pedophile comes in for counseling or therapy, the psychologist may be compelled by law to report the person to the authorities.
https://www.theatlantic.com/health/archive/2013/08/what-can-be-done-about-pedophilia/279024/
■通報じゃなくて無害なMAP(minor-attracted person=未成年者に引かれる人)をメンタルヘルスの専門家は支援しようという試み。なお保守派右翼はおこ
http://www.asapinternational.org/index.html
anond:20190111232502 anond:20190111232447 anond:20190111194222 anond:20190112102503 anond:20190111214535 anond:20190111210552 anond:20190112211233 anond:20190112221516 anond:20190112181634 anond:20190116112046 anond:20190125120114 anond:20190125135939 anond:20190125141949
/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice
---------------------------
Finderで「移動」→「フォルダへ移動...」で下記を入れて「移動」
/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A
/Volumes/TimeMachine/Backups.backupdb/***/***/Macintosh HD/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A
(***のところは環境に合わせて書き換え←TimeMachineのHDを開いて確認)
Mac側の「MobileDevice」を「MobileDevice_」などとリネームしてバックアップして、
TimeMachineの方の同名ファイルをMac側にドラッグ&ドロップ
---------------------------
https://developer.apple.com/download/more/
#Yosemiteにインストール可能なのはVer6.3 - 7.2
#下記でバージョンチェック
https://en.wikipedia.org/wiki/Xcode
2) 下記にMobileDeviceがインストールされる
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A
Replace
/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice
It works.
---------------------------
Finder - Go - Go to the folder...
/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A
Backup:
/Volumes/TimeMachine/Backups.backupdb/***/***/Macintosh HD/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A
#You must rewrite the *** according to your environment (see your TimeMachine hard drive)
You can see the file 'MobileDevice' in both folder.
#You should back up your original file before replace.
---------------------------
if you don't have backup, try this.
1) Download and Install 'Xcode'
https://developer.apple.com/download/more/
#Require ID (free registration)
#check this ;
https://en.wikipedia.org/wiki/Xcode
2) You can find the file 'MobileDevice' at
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A
空耳:あぁん、ひどぅい!
空耳:相変わらずケツ欲しい、いいな?
英語:My college kids will see. You know?
英語:I no require, I no require...
意味:いらない、いらないんだ…
英語:I'm just gonna back home...
意味:君のことを傷つけたくないよ
あんかけチャーハンについてのほぼ公式?英文を見つけたので追記、文末にソース記載
英語:Disobedience huh? That's a mistake...
意味:逆らう気か?そうはさせないぞ
英語:Maybe you and I should try to start one, then.
発音:メイビュ ア シュド ライトゥ スタ ワン ゼン(ビオランテ特有の出身地であるカナダ訛りが強く識別困難の為、誤りの可能性大)
意味:そんなに自信があるならおっ始めようじゃねぇか
英語:Be calm, be calm, up right up right up right up right...
意味:落ち着いて、落ち着いて、上げて上げて上げて上げて…
英語:Give! I'll rip them a parts!
発音:ゲダッ プ
意味:立て
聴音:ユゲ メッ~ド?
発音:ユー ライク ザッポイン?
意味:お前そこ(舐められるの)好きなのか?
発音:イェアッ カモーン!
意味:よっしゃ、来いよ!
英語:Roman-Greco? just straight up?
意味:ローマングレコ?(※グレコローマン式レスリングのこと)正統派の?
空耳:いやぁ、スイマセーン
英語:That's what I'm saying.
意味:そのとおり(それが俺の言ってる事さ)
空耳:牛だ、モーモー
発音:プシ ダウン、ワンモア!
意味:押し下げろ、もう一回だ!
英語:Hey bro, what's happenin'?
空耳:お~激しい(^ω^)
英語:Oh I see.
発音:オーゥ アイ シー
意味:分かった
意味:もう1回?
空耳:恐ろしいぞ…
英語:I served caesar.
空耳:おっほっほっほっほ~、元気だ(^ω^)
意味:おごりにするぜ
空耳:オビ=ワンいくつぐらい?
意味:そんなにしたいのか?俺と?
空耳:お前、人のモノを・・・!
発音:オー マイ ショルダー!
意味:どうだ?
空耳:構わん、H行こう!
発音:カモン、レッツゴ!
意味:さあ、いこうぜ!
空耳:カモン、チンポお兄さん
英語:Come on, I wanna see more of this son
発音:ドゥ ワチュ ワネ
意味:好きにすればいいさ
意味:抑えられないよ!
意味:何やってんだ?立て
英語:Give up!
発音:ギブ アップ!
発音:レディ ファースト(相手を坊や呼ばわりをするのが多い兄貴なりの見下し方だと思われる)
英語:Take your souvenir, Turn around.
意味:お土産(※パンツのこと)頂いたよ。振り返って(見て)ご覧
英語:You could grab my balls like that, huh?
発音:ユ クル グラ マイ ボー ライダッ、ハァン?(ビオランテ特有の出身地であるカナダ訛りが強く識別困難の為、誤りの可能性大)
意味:お前はこんなふうに俺のタマを掴むことなんか出来たか、あぁん?
空耳:最強
発音:ソー ハゥ ジュー フィール?
意味:それで、どんな気分だい?
発音:アー ユー ゴー ナゥ?
空耳:差をつけるでぇ
発音:ハゥ イッツ ゴナ ビー
意味:どうなるかな
意味:お前、それは違うぜ
空耳:茂美、怖いでしょう…
意味:二人もろともだ!(兄貴に脱がされそうなカズヤが相討ちを狙って放った言葉)
空耳:そうなんでーちゅ…
空耳:叩け!
意味:もう一回叩け!
空耳:血ぃ吸われたやろ?
空耳:ちょろ~ん★
発音:ィッツォローン!
意味:借りるだけだよ!
英語:Chains are too tight...
意味:鎖がきつ過ぎる…
空耳:チンポ♂朝勃ち
英語:(I'll show you) who's the boss of this gym.
発音:(イ ショユウ) フズザ ボスォブ ディス ジム(ビオランテ特有の出身地であるカナダ訛りが強く識別困難の為、誤りの可能性大)
発音:ドゥ ユゥ ノゥ ミー?
意味:俺を知ってるか?
意味:もう一回やる?
英語:I know you like the bottom.
空耳:どうですか?
英語:Training start?
空耳:どけよおめぇ!
空耳:とにかくションベン
英語:Incredible.
意味:(カズヤに1ラウンド取られたことに対して)信じられない気分だ
意味:いいケツだ♂
英語:SOB(Son of Bitch), Let's see if you can tolerate that, huh?
発音:エスオービー、レツ シー イフ ユ キャ トレレー ザッ、ハァン?(ビオランテ特有の出身地であるカナダ訛りが強く識別困難の為、誤りの可能性大)
意味:クソ野郎、お前にこれが受け切れるかどうか見せてもらおうじゃねぇか、あぁん?
空耳:何がファックだボーイ!
英語:What the fuck a boy!
発音:ワッタ ファック ア ボーイ!
発音:ナッシン
発音:alright well here's the wrestling mat.
発音:ハッテー、ショ!(戦争映画など、軍隊風演技での発音に倣ったものらしい)
意味:気をつけぇぇっ!
発音:ハ! イヤー ライ メン
意味:ハッ!上等だぜ。
意味:それやるの嫌か?
英語:I wasn't ready.
発音:アイ ワズン レディ
意味:準備が出来てなかったんだ
意味:おねんねしな(とどめだ)
英語:What's I gotta do with wrestling?
発音:レッシー ワチュ ガッ
意味:君の実力を見せてもらおうか
空耳:へい、構わん。殺すぞ♂
英語:Hey, come in. Close the door.
意味:おう、入れよ。ドア閉めろよ。
発音:テェイキィッ ボーイ!
発音:ワ ドゥ チュ ゲッ ファットゥ?
意味:お前何で掘られないんだ?(署の皆はお前のケツ掘りたがってるぜ)
英語:Did i tell you guys to stop?
意味:(キスを強要させたマカーイら奴隷に対して)お前らやめろだなんて言ったか?
空耳:やっぱりな♂
発音:エンプリィ ナウ
意味:(部屋に)誰もいないな
空耳:歪みねぇな
発音:ユゥ ガット ミー マーッナウ
意味:お前、俺を怒らせたな
英語:You know what I'm talking about.
発音:ユーノワッ ターキンァバウ
意味:俺の言ってることが分かってるはずだ
英語:Feel confident in position son.
意味:好きな姿勢をとってくれよ坊や(君の自信のある体勢でかまわないよ)
空耳:ワープロも出来る、レスリングも出来る、ビキビキビキニ1,2,3
英語:Well whatever you wanna do, if that's what you wanna do, if you think you can beat me 1,2,3.
Excelを持っているならはてブのJSONデータをそのまま取り込めるそうだからそのデータを使ってブクマが付いた時間のグラフが描けそう。
例えばこんな感じでJSONデータが取れる。 http://b.hatena.ne.jp/entry/jsonlite/https://anond.hatelabo.jp/20180315232737
Excel持ってないならスクリプトでCSVにしてしまえばいい。
rubyスクリプトだとこんな感じ。(Mechanize無し版に差し替え。なぜMechanizeを使っていたかと言うとはてブがUser-Agentが空だと値を返してくれないから。ちょっと長くなるが自前でUAを渡すようにした。)
#!/usr/bin/ruby
site = ARGV[0]
json_uri = URI.parse("http://b.hatena.ne.jp/entry/jsonlite/%s" % [site])
response = Net::HTTP.start(json_uri.host, json_uri.port) do |http|
http.get(json_uri.path, "User-Agent" => "Mozilla/5.0")
end
json_data = JSON.parse(response.body)
json_data['bookmarks'].each do |bookmark|
puts [bookmark['user'], bookmark['timestamp'], bookmark['comment'], bookmark['tags'].to_s].to_csv
end
引数に取得したいページのURLを入れる。hatebuapi-csv.rbという名前で保存したとしたらこんな感じで実行。
% hatebuapi-csv.rb https://anond.hatelabo.jp/20180315######## > 結果.csv
引数がA,B,C,D,Eあるとして
A,Bだけ渡したら、内部でC,D,Eを自動的に解釈するメソッドが作りたかった
これ、例えば
func hogeAll(A a, B b, C c, D d, E e) {
}
func hoge(A a, B b) {
}
んだけど、ABCDE全てに対して有/無のメソッドを全て定義すると果てしなくなる
実際にこれはよくやられると思う
HikisuClass hikisu = HikisuClass.create(a,b) // これで内部で自動的にc,d,eを解釈する
でもメソッド一個のためにクラスを作るのってクソ面倒だなと思う
もう一個方法があるとしたら、Classに値を入力したあとメソッドを実行する方法だ
hoge.a = a
hoge.b = b
hoge.do()
hoge(a,b,null,null,null) みたいなことになりそう
ちなみに何でそういうことをしたいかと言えば、自然言語がそうなってるからだ
大抵の引数が省略されるし、省略されたりされなかったりする、非常に柔軟なんだ
もちろん受ける側の作り込みが大変になるが、ちゃんとリーダブルに作ろうとしたらそっちのほうが良いんじゃないかと思える
引数のoptional,requireを指定できればもっと良い
これってポリモーフィズムあたりの話か?
___
追記:
あ、DIコンテナみたいな話かな
でも結局煩雑だし使いたくない
http://anond.hatelabo.jp/20170524171732
FAQはあくまでFAQだからね。手続きの正当性をなぜFAQでみているのか、どの部分を持って手続きの問題がある、とツイート主がおっしゃってるのかわかりませんが、マニュアルにちゃんと書いてあって、ふつうに執り行われてる手続きであるとは思いますよ。そもそも国連の特別報告者はあくまで準司法quasi-judicialで、問題提起が大事だって書いてあるし、これが初動なわけだから、内容が不適切だとおっしゃるなら質問にちゃんと答えりゃいいんですよ。とりあえずツイート主が言ってることは根拠がないですよ。むしろ、人権侵害がある国にこそ公開でやることで回答する動機づけをしてるのは明らかだし。
国際機関を含む多国間交渉の場は利害も考え方もまちまちだから、手続きが大事で、そこを外すと何も進まなくなる。日本政府は問題を指摘しつつも誠実に対応する(ことが求められる)が、他の国(人権侵害のひどい国)なら「回答する前に書簡が政府攻撃に使われた」として回答拒否の口実にしてくるはず。
これは実例に照らして真反対。緊急性や重大性が低く、相手がちゃんと回答してくる可能性が高い場合にこそconfidentialにしている。
今回の書簡は基本的には「質問」であり、当該政府からの回答に加え、別途行ったその他の調査内容と合わせて検討し、国連人権理事会に報告書を提出するのが特別ラポルトゥールへの委託内容。その報告書はまだ単なる個人作成の文書であるがこの時点で公開されて議論の対象となる。書簡公開はルール違反。
これも事実誤認でルール違反じゃない。ちゃんと書いたように,マニュアルに認められている。
送られた書簡とそれに対する受け取った回答の文章は、受任者が対応した報告書を作成するときまで機密にするか、受任者が、特定の状況によって、それ以前に行動が必要であると決定する。
37. The text of all communications sent and responses received thereon is confidential until such time as they are published in relevant reports of mandateholders or mandate-holders determine that the specific circumstances require action to be taken before that time.
プレスリリースを即座にすることも認められている。
重大な懸念や、政府が書簡に対して本質的な回答が出来ない状態が続く場合などの適切な状況では、受任者は個人で、あるいは他の受任者(特別報告者、作業部会など)プレスリリースやプレスカンファレンス、その他の公的な意見表明などを行う場合がある。
一般的に言って、受任者は政府との対話の中で、プレスリリースなどのプレス向けの声明を発出する前にそのことを明らかにするべきである。受任者が、書簡の中で、プレスリリース等をすぐにおこなう意向を示したい時は、書簡の中にそのような意向を記載することが出来る。受任者は、懸念された国からの応答に対しても公平に明らかにするべきである。
49. In appropriate situations, including those of grave concern or in which a Government has repeatedly failed to provide a substantive response to communications, a Special Procedure mandate-holder may issue a press statement, other public statement or hold a press conference, either individually or jointly with other mandate-holders.
50. In general, mandate holders should engage in a dialogue with the Government through the communications procedure before resorting to a press release or other public statement. When a mandate holder sends a communication with the intention of issuing a press release shortly thereafter, such intention could be indicated to the Government in the communication. Mandate holders should indicate fairly the responses provided by concerned States.
とされているように、初動が一方的に公開であることは別に認められているし、反論の公平性は、反論文を同じ場所に掲示することで保とうという意思が見える。
また前に書いたように、イギリスのSnooper's charterについては、就任直後にガーディアンのインタビューでいきなり問題提起しており、不必要にテロの危険性をマスコミが翼賛的に報道している状態に苦言を呈しているけど別にイギリスは「反論の機会もなしにメディアでしゃべるなんて!」とも批判もしてない。(なぜインタビューされたかというと、このケナタッチ氏の就任は、アメリカがメルケルとかを盗聴してたことが明らかになったのちだったので、親アメリカ派のエストニア人候補が反対されたという経緯でヨーロッパではその就任が注目されていた。)そしてイギリス政府は、ガーディアンに政府の見解を送り、ガーディアンもそれを掲載した。ただそれだけの話なんだよ。
greasemonkey書いて戻るボタン押さなくて良くした。
// ==UserScript== // @name anond easy track back // @description anond easy track back // @namespace http://anond.hatelabo.jp/ // @include http://anond.hatelabo.jp/* // @require https://code.jquery.com/jquery-3.2.1.min.js // ==/UserScript== (function() { var url = window.location.href, isEditPage = url.slice(url.lastIndexOf('/')).startsWith('/edit'); if (isEditPage) { appendTrackBackContent(); } else { appendEditLink(); } })(); function appendTrackBackContent(){ var postId, match = $('#text-title').val().match(/anond:(92;d{14})/); if (match.length>1){ postId = match[1]; } else { return; } jQuery.ajaxSetup({async:false}); var content = ''; $.get('http://anond.hatelabo.jp/' + postId, function(data){ var section = $(data).find('.section'); var title = $(section).children('h3').text().slice(1); $(section).children('p:not([class])').each(function(idx, val){ content += $(val).text() + "<br/>"; }); content = '<hr><h4>' + title + '</h4><p><small>' + content + '</small></p>'; }); jQuery.ajaxSetup({async:true}); $(content).insertAfter('.post-submit'); } function appendEditLink () { var masudaId = $('#bannersub .username a').text(); $('h3').each(function (idx, val){ var postId = $(val).children(":first-child").attr("href").slice(1); $(val).append(' <a href="http://anond.hatelabo.jp/' + masudaId + '/edit?title=Re: [anond:' + postId + ':title]">92;u2190</a>'); }); }
タイトルに「anond:14桁の番号」があったらそっから引っ張ってきて画面下に表示する。
大なり小なりとかがエンコードされてるけど普通に表示する方法よくわからない。ちなみに直さないと使えない。
http://anond.hatelabo.jp/20070612084049
一部これの真似
私はコミットログの書き方に悩む英語の苦手な人間である。実際、似たような人は世の中に結構いるようで、頻出単語を集計したりまとめたものは既にあって役に立つのだけれど、これらはあくまで単語の話であり、具体的な文を構成する過程でやっぱり困る部分がかなりあった。
要するに、どういう時にどういう文が使われているのか、ということを示した例文集が欲しいのである。ググると他にも「例文集があればいいのに」みたいな声はあるくせして、しかし誰も作ろうとしない。何なんだお前ら。それじゃ私が楽できないじゃないか。
ここで挙げているコミットログは全て実際のコミットログからの転載である。当然ながら各コミットログの著作権はそれぞれの書き手にある。いずれも各英文でググれば出てくるし、フェアユースの範囲なら許してくれるだろうと考え名前とプロジェクト名は割愛したが、ここにお詫びと感謝を述べておきたい。
抽出条件だが、参考にできそうなコミットログを多く含んでいそうなリポジトリをGitHubのSTARの多い方からざっと目で見て適当に選び、それぞれ最新コミットから5000件抽出した(あわせて前処理として、コミットログ冒頭のタグ情報は消去した)。
atomのみ5400件抽出していたため、計25400件のコミットログがベースである。このうち、以下の条件に合致するものは参考例にすべきでないとして一律排除した。
こうして残った8540件を眺めながら、適当に切り出したのがこの用例集である。個人的に「うーんこの」と思った表現も、散見される場合は載せた。
ということで、以下用例を羅列していく。
以上の用例をふまえ、今回の参考ログ8540件から先頭の単語を出現回数で並べると次のようになった。
Add | 1149 |
Fix | 1014 |
Update | 584 |
Remove | 566 |
Use | 382 |
Don't | 260 |
Make | 228 |
Move | 178 |
Change | 103 |
Rename | 85 |
Improve | 76 |
Avoid | 68 |
Allow | 65 |
Implement | 60 |
Handle | 58 |
コミットログの基本形はもちろん動詞 + 名詞である。名詞は固有名詞、複数形、不可算名詞が多いが、単数形の場合の冠詞は a が使われるか、あるいは省略される。the はまず使われない。
何かを追加した、という表現では非常に広く Add が使われる。メソッドからテスト、ドキュメントに至るまで大概これでまかなえる。
一方、何かを修正した、という表現では広く Fix が使われる。「何か」は typo や crash といった単語からメソッド名まで幅広い名詞を取るが、動名詞はあまり取らないのと、that節は取らないのでその点は注意が必要である。
Fix は「何かが正しく動くようにした」ことを示し、正しい動作内容が何かを説明しない。そこで正しい動作内容に言及したい場合は Make sure が使われる(こちらはthat節が取れる)。ただし Fix よりもニュアンス的に重い表現と思われ、Fix を使わず Make sure ばかり使うのはちょっとキモいのではないかと思う(Ensure はさらに重い表現っぽい)。
また、Fix は typo 以外でのドキュメント修正に対して使われることは稀である。対して Update はドキュメント、コメント、テストに使われ、本体のコードの修正に対しては使われない。本体コードの修正にあわせてテストも更新したなら Update が使われる。ただ、テスト機構それ自体のバグを修正したなら Fix である。
無駄な何かを単純に除去したなら Remove を使う。これまでのもの(A)から別のもの(B)に切り替えたのであれば Use B instead of A か Change A to B が使われる。新たに何かを利用するようにしたのであれば Use を、利用を取りやめた場合は Don't use を使うことが多い。
何かをしないようにしたなら Don't を、内部実装の効率化なら Make A + 比較級/形容詞 か Improve が使われる。
中身の変更を伴わない単なる名前の変更なら Rename A to B、コードや機能の論理上の場所を移動させたなら Move A to B である。
この辺はリファクタリングと呼ばれる行為と思うが、Refactor というぼんやりした動詞はあまり使われず、このように変更内容の種類に応じて動詞が使い分けられている。
コミットログにはWhyを書くべきだ、というのを何かで見かけたので because とか since を使ったログがどの程度あるかを調べたが、8540件のうち22件だった。基本的に短く、シンプルに、一目で意味が取れるログが好まれる傾向がある。例えば get rid of とか2件しか使われておらず、圧倒的に remove である。
一方で、シンプルな単語だけど開始単語としては使われないものもある。例えば次のような単語である。Expand(9)、Extend(8)、Print(5)、Optimize(5)、Publish(4)、Append(4)、Modify(3)、Manage(2)、Revise(2)、Dump(2)、Insert(2)、Migrate(2)、Enhance(1)、Edit(1) 。いずれもカッコ内は8540件に対する冒頭での登場回数である。結局、より一般的で平易な単語で表せたり、Refactor同様に抽象度が高すぎると使われないのだろう。
8000件もログを見たおかげで、迷いなくコミットメッセージが思いつくようになったのが個人的には今回書いてて最大の収穫だった。たぶんカンニングペーパーを作る行為それ自体が効率のいい学習になるという話と同じだと思う。
このまとめも100以上用例を転載してあるので、それを読むだけでも多少は効果があるんじゃないかと思う。同じようにコミットログ書きたくねぇなぁ英語わっかんねぇなぁと思っている人にとって、何か役に立つところがあれば幸いである。
結構簡単にできた。
ここから、ページ切り替えてURLを収集する処理も追加すれば、
クローロング部分は完成。
require 'nokogiri'
url = 'http://ja.aliexpress.com/category/200003482/dresses.html?spm=2114.52010108.6.7.gT0qlW&addpid=32546825642&isOnSale=yes%22'
charset = nil
end
doc = Nokogiri::HTML.parse(html, nil, charset)
num=0
doc.css('a[class = "product "]').each do |product|
p product.attribute("href").text
p num = num+1
end
Solving this problem is going to require a diverse set of intellectual property, technical and information assets and an inclusive attitude toward software developers. ※Intellectual property、知的財産権と訳したくなるのは判るが、ここでは誰もそんな話はしていない。
"Independent developers are facing walled gardens" への対置として挙げられているのだから、intellectual property は「知的財産」と訳すのが妥当。
intellectual property rightsとは書かれておらず、また、権利の話をしているわけではないから、「知的財産権」と訳すべきかは微妙。
◇Hell, start an Occupy Doubt Street movement and doubt the lot of them simultaneously. ●ったく、「オキュパイ・ダウト・ストリート」の運動でも始めて、あらゆる大企業を一斉に疑えばいいさ。 ◆「ダウト通り占拠」運動でも始めて、連中にまとめてダウトを突き付ければいいじゃないか。 ※オキュパイはそのままだと通常の読者層は理解できないと思う。
"Occupy Doubt Street" が "Occupy Wall Street" をもじったものであることは明らか。同語の日本語訳としては「オキュパイ・ウォール・ストリート」もしくは「ウォール街占拠」が妥当。
したがって、この場合は「オキュパイ・ダウト・ストリート」あるいは「ダウト街占拠」が採るべき訳と考えられる。「ダウト通り」という訳語は「ウォール街」から離れてしまうので不適当。
ぼくのかんがえたただしいやくw
◇Solving this problem is going to require a diverse set of intellectual property, technical and information assets and an inclusive attitude toward software developers.
●この問題を解くには、さまざまな知的な資質や、技術的・情報的な資産、そしてソフトウェア開発者に対する包括的な態度が必要だ。
●この問題を解決するには、さまざまな知的財産権、技術的・情報的な資産、そしてソフトウェア開発者が制限を受けずに仕事を進められる環境が必要になるだろう。
◆問題の解決には多彩な知的資質や技術・情報資産、そしてソフトウエア開発者を束縛しない姿勢が要求される(だろう)。
※Intellectual property、知的財産権と訳したくなるのは判るが、ここでは誰もそんな話はしていない。
※inclusive attitude、最近は社会適応に絡んで「包摂的」の訳を充てている場合が多いが、対象読者に通じるかは疑問。原文で言っているのは明らかに「エンジニアの好きにやらせろという主旨」なのでこの訳。
◇I was a professor for ten years and spent a great deal of my time doing research and consulting.
●教授を10年やったこともあるし、研究やコンサルティングにもだいぶ時間を使ったよ。
●教授を10年やって、研究やコンサルティングにもだいぶ時間を使ったよ。
◆十年に及ぶ教授勤めをして、研究やコンサルティングに大分時間を費やしてきた。
※明示されてないが教授をやりながら並行的に研究・コンサルティングを(その一貫もしくは副業的に)していたと(も)とれるので、教授と研究/コンサルティングは明確に分断してはダメ。その反面、教授を辞めてから研究/コンサルティングをしていなかったとは書いてないので、添削版もニュアンス的にはいささか問題がある。
◇[M]any of today's most successful companies were written off at one time or another as having an empty pot. If you'd like, buy me a Starbucks and you can have an Apple while we discuss them.
●今最も成功している会社の多くが、鍋が空だと思われてしまったことがある。もしその気があれば、スターバックスをおごってくれたら、アップルに関する話でもするよ。
●今とても成功している会社の多くが、過去のある時期にはもう鍋は空だと見限られてしまったことがある。どうだろう、「スターバックス」をおごってくれたら「リンゴ」をあげるけど、食べながら低迷した大企業の話でもしようか。
◆今日、隆盛を極めている企業の多くは、どこかの段階で命運が尽きたと噂された経験をしてきている。暇ならスターバックスで一杯侈ってくれないか。アップルの話でもしてあげようじゃないか。
※empty pot、中国の故事とされている逸話。空鍋と訳すのは間違い。
※スターバックスもアップルも落目の時期があったという、業界方面の共通認識に基づく、ものすごく捻った文章なので注意。
◇Hell, start an Occupy Doubt Street movement and doubt the lot of them simultaneously.
●ったく、「オキュパイ・ダウト・ストリート」の運動でも始めて、あらゆる大企業を一斉に疑えばいいさ。
◆「ダウト通り占拠」運動でも始めて、連中にまとめてダウトを突き付ければいいじゃないか。
※オキュパイはそのままだと通常の読者層は理解できないと思う。
ここまでにEmpty potの原典とスターバックス、アップルの業績凋落およびオキュパイ関連の資料当たるのも含めて一時間。飽きた。
もうちょっと調べて、考えような。
下記のようなファイルを用意してOKボタンを押下してもgettxt.jsのOnOKが呼ばれません。
誰か教えて下さい。
gettxt.js
http.createServer(function (req, res) {
fs.readFile('./HTMLPage.html', 'UTF-8', function(err, data) {
res.writeHead(200, {'Content-Type': 'text/html'});//text/plainから変更
res.end(data); // 「Hello, world!」から変更
});
}).listen(8124);
function OnOK(){
var text = document.getElementById("text").value;
// textを使って何か処理を行う
}
※<>は全角にしてます
<head>
<script src="gettxt.js"></script>
</head>
<body>
<input type="text" id="text" size=50></input>
<button onClick=javascript:OnOK() >OK</button>
</body>
私の持てる知識を絞り出してなんとか完成しました。
**************************************************************************************
完成したサイトがこちらです。
LapyNetニュース
**************************************************************************************
私は普段webとは関係ない仕事してます。なんとか休日を利用して、
メインのコードはこんな感じ
----------------------------------------------------------------------------------------------------------------------
App::uses('Sanitize', 'Utility'); class RssfeedsController extends AppController { public $helpers = array('Html','Form','Session','Number','Cache'); public $uses = array( 'Rssfeed', 'Tweet', 'Wadai', 'Rank', 'Oracle' ); ************************************************************************************** public function index() { $title_for_layout = "LapyNetニュース"; $content = "Hello World!!"; $this->set(compact('title_for_layout','content')); if(date("G")>0 and date("G") < 7){ $today = date("Y-m-d", strtotime('-1 day')); }else{ $today = date("Y-m-d"); } $params = array( 'conditions' = > array( 'and' = > array( 'Rssfeed.time' = > $today, )), 'order' = > 'tweets desc', 'limit' = > '50' ); $this- >set('posts',$this- >Rssfeed- >find('all',$params)); $paramz = array( 'order' = > 'Rssfeed.id desc', 'limit' = > '10' ); $this->set('posts2',$this->Rssfeed->find('all',$paramz)); $paramz = $this- >Rssfeed- >query('SELECT id,title FROM rssfeeds order by id desc limit 10'); $this->set('posts2', $paramz); $parapara = $this- >Oracle- >query('SELECT id,title FROM oracles order by id desc limit 10'); $this- >set('postx', $parapara); $funking = $this- >Rank- >query('SELECT id,frank FROM ranks where creation=(select max(creation) from ranks)'); $this- >set('funking', $funking); } ************************************************************************************** public function mizuno() { $parapara = array( 'order' => 'Oracle.id desc', 'limit' => '30' ); $recent_posts = $this->Oracle->find('all',$parapara); return $recent_posts; } ************************************************************************************** public function wadai() { if(date("G")>0 and date("G") < 7){ $today = date("Y-m-d", strtotime('-1 day')); }else{ $today = date("Y-m-d"); } $params = array( 'conditions' => array( 'and' => array( 'Rssfeed.time' => $today, 'Rssfeed.kubetu' => 4 )), 'order' => 'tweets desc', 'limit' => '100' ); $this->set('posts',$this->Rssfeed->find('all',$params)); $this->set("title_for_layout","2CHニュース-LapyNetニュース"); $paramz = array( 'order' => 'Rssfeed.id desc', 'limit' => '10' ); $this->set('postyy',$this->Rssfeed->find('all',$paramz)); $parapara = array( 'order' => 'Oracle.id desc', 'limit' => '10' ); $this->set('postyx',$this->Oracle->find('all',$parapara)); $funking = $this->Rank->query('SELECT * FROM ranks where creation=(select max(creation) from ranks)'); $this->set('funking', $funking); } ************************************************************************************** public function hot() { if(date("G")>0 and date("G") < 7){ $today = date("Y-m-d", strtotime('-1 day')); }else{ $today = date("Y-m-d"); } $params = array( 'conditions' => array( 'and' => array( 'Rssfeed.time' => $today, 'Rssfeed.kubetu' => 3 )), 'order' => 'tweets desc', 'limit' => '20' ); $title_for_layout = "LapyNetニュース"; $this->set("title_for_layout","ニュース-LapyNetニュース"); $this->set('posts',$this->Rssfeed->find('all',$params)); $parapara = array( 'order' => 'Oracle.id desc', 'limit' => '10' ); $this->set('postxx',$this->Oracle->find('all',$parapara)); $paramz = array( 'order' => 'Rssfeed.id desc', 'limit' => '10' ); $this->set('postsxxx',$this->Rssfeed->find('all',$paramz)); $funking = $this->Rank->query('SELECT * FROM ranks where creation=(select max(creation) from ranks)'); $this->set('funking', $funking); } ************************************************************************************** public function newnew() { if(date("G")>0 and date("G") < 7){ $today = date("Y-m-d", strtotime('-1 day')); }else{ $today = date("Y-m-d"); } $params = array( 'conditions' => array( 'and' => array( 'Rssfeed.time' => $today, 'Rssfeed.kubetu' => 2 )), 'order' => 'tweets desc', 'limit' => '20' ); $this->set("title_for_layout","エンタメニュース-LapyNetニュース"); $this->set('posts',$this->Rssfeed->find('all',$params)); $paramz = array( 'order' => 'Rssfeed.id desc', 'limit' => '10' ); $this->set('postszz',$this->Rssfeed->find('all',$paramz)); $paramz = $this->Oracle->query('SELECT id,title FROM rssfeeds order by id desc limit 10'); $this->set('postszz', $paramz); $parapara = $this->Oracle->query('SELECT id,title FROM oracles order by id desc limit 10'); $this->set('postzy', $parapara); $funking = $this->Rank->query('SELECT * FROM ranks where creation=(select max(creation) from ranks)'); $this->set('funking', $funking); } ************************************************************************************** public function top() { if(date("G")>0 and date("G") < 7){ $today = date("Y-m-d", strtotime('-1 day')); }else{ $today = date("Y-m-d"); } $params = array( 'conditions' => array( 'and' => array( 'Rssfeed.time' => $today, 'Rssfeed.kubetu' => 1 )), 'order' => 'tweets desc', 'limit' => '20' ); $this->set('posts',$this->Rssfeed->find('all',$params)); $param = array( 'conditions' => array('times > current_timestamp + interval -600 minute and Kubetu = 4'), 'order' => 'tweets desc', 'limit' => '30' ); $this->set('posts2',$this->Rssfeed->find('all',$param)); } ************************************************************************************** public function view($id = null ) { $this->Rssfeed->id = $id; //驥崎ヲ√↑荳譁・i縺励> $user = AuthComponent::user(); $TwimStatus = ClassRegistry::init('Twim.TwimStatus'); $TwimStatus->getDataSource()->setToken(AuthComponent::user()); $statuses = $TwimStatus->tweet(); $rairai = $this->Rssfeed->read(title,$id); $alcol = $this->Rssfeed->read(); $this->set('post', $alcol); $this->set('post2', $user); $this->set('post3', $statuses); $this->set("title_for_layout",$rairai[Rssfeed][title]."-LapyNetニュース"); $paramz = array( 'order' => 'Rssfeed.id desc', 'limit' => '20' ); $this->set('postszz',$this->Rssfeed->find('all',$paramz)); $parapara = array( 'order' => 'Oracle.id desc', 'limit' => '30' ); $this->set('postzy',$this->Oracle->find('all',$parapara)); } ************************************************************************************** public function add() { if($this->request->isPost()){ if($this->Tweet->save($this->data)) { $this->Session->setFlash('seikou'); $this->redirect(array('controller'=>'rssfeeds','action'=>'view',$contents11)); }else{ $this->Session->setFlash('sipai'); $this->redirect(array('controller'=>'rssfeeds','action'=>'view',$contents11)); } } } ************************************************************************************** public function delete($id = null) { $this->Rssfeed->id = $id; $this->set('set', $this->Rssfeed->read()); $this->redirect(array('controller'=>'tweets','action'=>'delete',$this->data['tweet']['rssfeed_id'])); } ************************************************************************************** public function oracle() { if($this->request->is('post')) { $user = AuthComponent::user(); $TwimStatus = ClassRegistry::init('Twim.TwimStatus'); $TwimStatus->getDataSource()->setToken(AuthComponent::user()); $contents1 = $this->request->data['Rssfeed']['contents']; $contents2 = $this->request->data; $statuses = $TwimStatus->tweet($contents1); if($this->Rssfeed->save($contents2)) { $this->Session->setFlash('成功です。'); $this->redirect(array('controller'=>'rssfeeds','action'=>'view',$contents11)); $this->redirect($this->referer()); }else{ $this->redirect(array('controller'=>'rssfeeds','action'=>'view',$contents11)); $this->Session->setFlash('失敗です。'); } } } ************************************************************************************** public function makelist() { $rssfeeds = $this->paginate(); if ($this->request->is('requested')) { return $rssfeeds; } else { $this->set('rssfeeds', $rssfeeds); } } } ---------------------------------------------------------------------------------------------------------------------- rssフィードはこんな感じです。 ---------------------------------------------------------------------------------------------------------------------- #!/usr/bin/php <?php header('Content-type: text/html; charset=UTF-8'); require_once ('/var/www/html/s/magpierss/rss_fetch.inc'); define('MAGPIE_CACHE_AGE', 60*5); define('MAGPIE_CACHE_DIR', '/var/www/html/s/cache/'); define('MAGPIE_OUTPUT_ENCODING','UTF-8'); $urls = array( '*********************************'); $items = getRssList($urls); echo '<ul>'; foreach ($items as $item) { $href = mb_convert_encoding($item['link'], "UTF-8", "auto"); $title = mb_convert_encoding($item['title'], "UTF-8", "auto"); $description = mb_convert_encoding($item['description'], "UTF-8", "auto"); $megami = mb_convert_encoding($description, "UTF-8", "auto"); ************************************************************************************** $all = 'http://urls.api.twitter.com/1/urls/count.json?url='.$href; $Rits = file_get_contents($all); $Olfe = mb_convert_encoding($Rits, 'UTF-8', 'auto'); $data = json_decode($Olfe); $tweets = $data->count; ************************************************************************************** $checkman = db_check_urls($href); $checkman2 = db_check_pr($title); $nowtimes = date('Ymd'); if($checkman == 0 &amp;&amp; $checkman2 == 0){ #$hrefs = urlencode($href); db_put_urls($nowtimes,$href,$title,$description,$tweets); echo "<li><a href=$href>$title</a><br>$megami<p>$tweets</p><p>$checkman</p></li>"; }else{ } } echo '</ul>'; ************************************************************************************** function getRssList($urls) { $rssitems = array(); foreach ($urls as $url) { $obj = fetch_rss($url); $rssitems = array_merge($rssitems, $obj->items); } return $rssitems; } ************************************************************************************** function db_check_pr($japanese){ $moji = mb_substr($japanese,0,2); if($moji == 'PR'){ return 1; }else{ return 0; } } ************************************************************************************** function db_check_urls($href){ require '/var/www/html/s/database_conf.php'; try { $db = new PDO($dsn, $dbUser, $dbPass); $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = 'SELECT count(*) AS count FROM rssfeeds WHERE urls = :language'; $prepare = $db->prepare($sql); $languages = array($href); foreach ($languages as $language) { $prepare->bindValue(':language', $language, PDO::PARAM_STR); $prepare->execute(); $result = $prepare->fetchColumn(); if ($result > 0) { return true; }else{ return false; } } } catch (PDOException $e) { echo 'エラーが発生しました。内容: ' . h($e->getMessage()); } function h($var) { return htmlspecialchars($var, ENT_QUOTES, 'UTF-8'); } } ************************************************************************************** function db_put_urls($nowtimes,$href,$title,$description,$tweets){ require '/var/www/html/s/database_conf.php'; try { $db = new PDO($dsn, $dbUser, $dbPass); $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sikibetu = 5; $moto = "アニゲー速報VIP"; $sql = 'insert into rssfeeds (id, time,urls,title,contents,tweets,times,kubetu,teikyo) values (?, ?, ?, ?, ?, ?, ?, ?, ?)'; $prepare = $db->prepare($sql); $prepare->bindValue(1, 0, PDO::PARAM_STR); $prepare->bindValue(2, $nowtimes, PDO::PARAM_STR); $prepare->bindValue(3, $href, PDO::PARAM_STR); $prepare->bindValue(4, $title, PDO::PARAM_STR); $prepare->bindValue(5, $description, PDO::PARAM_STR); $prepare->bindValue(6, $tweets, PDO::PARAM_STR); $prepare->bindValue(7, 'cast( now() as datetime)', PDO::PARAM_STR); $prepare->bindValue(8, $sikibetu, PDO::PARAM_STR); $prepare->bindValue(9, $moto, PDO::PARAM_STR); $prepare->execute(); } catch (PDOException $e) { echo 'エラーが発生しました。内容: ' . h($e->getMessage()); } } ?>
---------------------------------------------------------------------------------------------------------------------
**************************************************************************************
参考にした書籍
CakePHP2 実践入門 (WEB+DB PRESS plus)
CakePHP2 実践入門 (WEB+DB PRESS plus)
作者: 安藤祐介,岸田健一郎,新原雅司,市川快,渡辺一宏,鈴木則夫
発売日: 2012/09/29
購入: 5人 クリック: 165回
Webアプリ開発を加速する CakePHP2定番レシピ119
Webアプリ開発を加速する CakePHP2定番レシピ119
**************************************************************************************
一番難しいところはtwitterログインとwebサイト連結でした。
ツイート数でランキングしてます、ネットの話題を見つけられます。
ホームページビルダーを使用しています。
今のホームページビルダーは昔と違って高機能ですね。
テンプレートも何種類もあって今はすごいです。
に分かれています。
今更cakephpを使っている人は少ないかもしれませんが、
twitterアカウントあるといつでも参加できますので、
自分で読めよめんどくせーな.
このくらいでわかるだろ.
http://anond.hatelabo.jp/20130724162534
// ==UserScript== // @name anondNoAdd // @namespace http://http://anond.hatelabo.jp/ // @include http://anond.hatelabo.jp/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js // @version 1 // ==/UserScript== $("#afc_footer").remove();
書き捨て
https://github.com/tdtds/massr
bundle install --path vendor/bundle Gemfile syntax error: /h/massr/Gemfile:14: syntax error, unexpected ':', expecting kEND gem 'sinatra-reloader', require: 'sinatra/reloader' ^ /h/massr/Gemfile:16: syntax error, unexpected ':', expecting kEND gem 'pit', require: 'pit' ^ sudo gem install sinatra Successfully installed sinatra-1.3.3 1 gem installed Installing ri documentation for sinatra-1.3.3... unrecognized option `--encoding=UTF-8' For help on options, try 'rdoc --help' ERROR: While generating documentation for sinatra-1.3.3 ... MESSAGE: exit ... RDOC args: --ri --op /Library/Ruby/Gems/1.8/doc/sinatra-1.3.3/ri --line-numbers --inline-source --title Sinatra --main README.rdoc --encoding=UTF-8 lib README.de.rdoc README.es.rdoc README.fr.rdoc README.hu.rdoc README.jp.rdoc README.ko.rdoc README.pt-br.rdoc README.pt-pt.rdoc README.rdoc README.ru.rdoc README.zh.rdoc LICENSE --title sinatra-1.3.3 Documentation --quiet
アホか