「Try」を含む日記 RSS

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

2017-09-24

anond:20170924180721

やったことがないことでやり方がわからないことはどうすればいいのか?

すぐに思いつくのがtryerrorだけど、これは非効率だし時に死ぬからおススメ出来ない

やっぱり未経験者は過去から蓄積された知見や似たようなモデルを見つけての模倣がいいでしょう

大抵のことはこれで解決しますんで

いや当然しないこともある

人生ってむっつかしー!

2017-09-10

anond:20170910121642

ウソです

 

 

CentOSインストール
c:\>docker pull centos

c:\>docker run -i -t centos /bin/bash

# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

pythonパスバージョン
# which pyhton
bash: which: command not found

# yum install which
Loaded plugins: fastestmirror, ovl

# which python
/usr/bin/python

# ls -l /usr/bin/py*
-rwxr-xr-x 1 root root   78 Nov  6  2016 /usr/bin/pydoc
lrwxrwxrwx 1 root root    7 Aug  1 17:23 /usr/bin/python -> python2
lrwxrwxrwx 1 root root    9 Aug  1 17:23 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 7136 Nov  6  2016 /usr/bin/python2.7

# python --version
Python 2.7.5

yumとは
# which yum
/usr/bin/yum

# file /usr/bin/yum
bash: file: command not found

# yum install file

# file /usr/bin/yum
/usr/bin/yum: Python script, ASCII text executable

# head /usr/bin/yum
#!/usr/bin/python
import sys
try:
    import yum
except ImportError:
    print >> sys.stderr, """\
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

    %s

# yum --version
3.4.3
  Installed: rpm-4.11.3-21.el7.x86_64 at 2017-08-01 17:23
  Built    : CentOS BuildSystem <http://bugs.centos.org> at 2016-11-05 23:37
  Committed: Florian Festi <ffesti@redhat.com> at 2016-07-26

  Installed: yum-3.4.3-150.el7.centos.noarch at 2017-08-01 17:23
  Built    : CentOS BuildSystem <http://bugs.centos.org> at 2016-11-15 15:30
  Committed: CentOS Sources <bugs@centos.org> at 2016-11-03

  Installed: yum-plugin-fastestmirror-1.1.31-40.el7.noarch at 2017-08-01 17:23
  Built    : CentOS BuildSystem <http://bugs.centos.org> at 2016-11-06 00:11
  Committed: Valentina Mukhamedzhanova <vmukhame@redhat.com> at 2016-08-04

yum remove pythonしてみた
# yum remove python
Loaded plugins: fastestmirror, ovl
Resolving Dependencies
--> Running transaction check
---> Package python.x86_64 0:2.7.5-48.el7 will be erased
--> Processing Dependency: python >= 2.4 for package: yum-3.4.3-150.el7.centos.noarch
--> Processing Dependency: python >= 2.2 for package: pyxattr-0.5.1-5.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: yum-metadata-parser-1.1.4-10.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: python-kitchen-1.1.1-5.el7.noarch
--> Processing Dependency: python(abi) = 2.7 for package: pygpgme-0.3-9.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: python-pycurl-7.19.0-19.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: libxml2-python-2.9.1-6.el7_2.3.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: python-chardet-2.2.1-1.el7_1.noarch
--> Processing Dependency: python(abi) = 2.7 for package: dbus-python-1.1.1-9.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: python-urlgrabber-3.10-8.el7.noarch
--> Processing Dependency: python(abi) = 2.7 for package: pyxattr-0.5.1-5.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: yum-3.4.3-150.el7.centos.noarch
--> Processing Dependency: python(abi) = 2.7 for package: pyliblzma-0.5.3-11.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: pygobject3-base-3.14.0-3.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: python-iniparse-0.4-9.el7.noarch
--> Processing Dependency: python(abi) = 2.7 for package: yum-utils-1.1.31-40.el7.noarch
--> Processing Dependency: python(abi) = 2.7 for package: rpm-python-4.11.3-21.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: yum-metadata-parser-1.1.4-10.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: python-kitchen-1.1.1-5.el7.noarch
--> Processing Dependency: python(abi) = 2.7 for package: pygpgme-0.3-9.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: python-pycurl-7.19.0-19.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: libxml2-python-2.9.1-6.el7_2.3.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: python-chardet-2.2.1-1.el7_1.noarch
--> Processing Dependency: python(abi) = 2.7 for package: dbus-python-1.1.1-9.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: python-urlgrabber-3.10-8.el7.noarch
--> Processing Dependency: python(abi) = 2.7 for package: pyxattr-0.5.1-5.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: yum-3.4.3-150.el7.centos.noarch
--> Processing Dependency: python(abi) = 2.7 for package: pyliblzma-0.5.3-11.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: pygobject3-base-3.14.0-3.el7.x86_64
--> Processing Dependency: python(abi) = 2.7 for package: python-iniparse-0.4-9.el7.noarch
--> Processing Dependency: python(abi) = 2.7 for package: yum-utils-1.1.31-40.el7.noarch
--> Processing Dependency: python(abi) = 2.7 for package: rpm-python-4.11.3-21.el7.x86_64
--> Processing Dependency: python-sqlite for package: yum-3.4.3-150.el7.centos.noarch
--> Running transaction check
---> Package dbus-python.x86_64 0:1.1.1-9.el7 will be erased
---> Package libxml2-python.x86_64 0:2.9.1-6.el7_2.3 will be erased
---> Package pygobject3-base.x86_64 0:3.14.0-3.el7 will be erased
---> Package pygpgme.x86_64 0:0.3-9.el7 will be erased
---> Package pyliblzma.x86_64 0:0.5.3-11.el7 will be erased
---> Package python-chardet.noarch 0:2.2.1-1.el7_1 will be erased
---> Package python-iniparse.noarch 0:0.4-9.el7 will be erased
---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be erased
---> Package python-pycurl.x86_64 0:7.19.0-19.el7 will be erased
---> Package python-urlgrabber.noarch 0:3.10-8.el7 will be erased
---> Package pyxattr.x86_64 0:0.5.1-5.el7 will be erased
---> Package rpm-python.x86_64 0:4.11.3-21.el7 will be erased
---> Package yum.noarch 0:3.4.3-150.el7.centos will be erased
--> Processing Dependency: yum >= 3.4.3 for package: yum-plugin-ovl-1.1.31-40.el7.noarch
--> Processing Dependency: yum >= 3.0 for package: yum-plugin-fastestmirror-1.1.31-40.el7.noarch
---> Package yum-metadata-parser.x86_64 0:1.1.4-10.el7 will be erased
---> Package yum-utils.noarch 0:1.1.31-40.el7 will be erased
--> Running transaction check
---> Package yum-plugin-fastestmirror.noarch 0:1.1.31-40.el7 will be erased
---> Package yum-plugin-ovl.noarch 0:1.1.31-40.el7 will be erased
--> Finished Dependency Resolution
Error: Trying to remove "yum", which is protected

 

 

結論

依存チェックではじかれて、pythonを削除できません

2017-08-27

[]Android 8のソース、27GB

追記

ローカルaospミラーからのcheck out(repo sync)に3時間かかった

(Core2Duo w)

 

追記

tar.gzに40分かかった

追記

 

追記

解凍に1時間40分w

 

追記

にんにん中now。途中でディスク容量が足りなくなる予定

 

追記

80分後にエラー終了

[  4% 2919/61548] yacc out/soong/.intermediates/frameworks...cc/frameworks/compile/mclinker/lib/Script/ScriptParser.cpp
FAILED: out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_arm_armv7-a_static_core/gen/yacc/frameworks/compile/mclinker/lib/Script/ScriptParser.cpp out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_arm_armv7-a_static_core/gen/yacc/frameworks/compile/mclinker/lib/Script/ScriptParser.h
BISON_PKGDATADIR=external/bison/data prebuilts/misc/linux-x86/bison/bison -d  --defines=out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_arm_armv7-a_static_core/gen/yacc/frameworks/compile/mclinker/lib/Script/ScriptParser.h -o out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_arm_armv7-a_static_core/gen/yacc/frameworks/compile/mclinker/lib/Script/ScriptParser.cpp frameworks/compile/mclinker/lib/Script/ScriptParser.yy
prebuilts/misc/linux-x86/bison/bison: 1: prebuilts/misc/linux-x86/bison/bison: Syntax error: "(" unexpected
ninja: build stopped: subcommand failed.
15:45:20 ninja failed with: exit status 1
make: *** [run_soong_ui] Error 1

 

 

今日はここまで

ちょっとアレしないと

 

 

追記

WSL(Windows Subsystem for Linux

bisonネットでひろったバイナリへ変更 → エラー対処できた可能性あり。時間切れで中断。ただ、ビルド継続するとディスクの空き容量が・・・

https://github.com/Microsoft/BashOnWindows/issues/1771

https://github.com/kxzxxx/android_build

 

UM(Ubuntu on Mac

make -j4でjavaメモリ不足?エラー。j4なしで → エラー対処できた可能性あり。時間切れで中断。こっちはディスク空きは大丈夫なはず

にしても、ネイティブメモリ16GBで厳しいのか・・ → 追記 8GBって認識されてる。

$ ldhw -c memory
     *-bank:0
          詳細: SODIMM DDR3 同期 1333 MHz (0.8 ns)
          ベンダー: 0x0383
          物理ID: 0
          シリアル: 0x00000000
          スロット: DIMM0
          サイズ: 8GiB
          クロック: 1333MHz (0.8ns)
     *-bank:1
          詳細: SODIMMProject-Id-Version: lshwReport-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>POT-Creation-Date: 2009-10-08 14:02+0200PO-Revision-Date: 2014-10-12 06:22+0000Last-Translator: Shushi Kurose <md81bird@hitaki.net>Language-Team: Japanese <ja@li.org>MIME-Version: 1.0Content-Type: text/plain; charset=UTF-8Content-Transfer-Encoding: 8bitX-Launchpad-Export-Date: 2016-06-27 17:08+0000X-Generator: Launchpad (build 18115) [空]
          物理ID: 1
          スロット: DIMM0

壊れたか!!!???

 

 

 

予断は許さないが、WSLでAndroidロムのビルドができる可能性あり

っていうか、AOSPじゃなくて、カスロムだとビルド成功報告があるしな

ただし、ディスク容量がたんまり必要

たぶんビルドで30GB以上でてくるはず

 

ソース 約30GB

.repo 約20GB

ビルド 約30GB

雑に計 約80GB

 

追記

WSL(Windows Subsystem for Linux

進捗10%でディスク空きが3GBwになったので、泣く泣く中断

UMでの出力ファイルサイズを見て、やるやらないきめましょう

 

UM(Ubuntu on Mac

時間で30%ぐらい。ってことは、10時間ってことか??

寝て起きても終わってないな。

 → さらに、前回中断してるので、それを加味すると10時間じゃきかないな。

追記

UM(Ubuntu on Mac

[ 57% 30322/52868] Building with Jack:...k_intermediates/with-local/classes.dex
FAILED: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex 
/bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
Out of memory error (version 1.3-rc6 'Douarn' (441800 22a11d4b264ae70e366aed3025ef47362d1522bb by android-jack-team@google.com)).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
ninja: build stopped: subcommand failed.
01:27:14 ninja failed with: exit status 1
build/core/main.mk:21: ターゲット 'run_soong_ui' のレシピで失敗しました
make: *** [run_soong_ui] エラー 1

#### make failed to build some targets (07:31:51 (hh:mm:ss)) ####


real	451m51.293s
user	418m48.588s
sys	13m8.276s

 

おおぅ・・

再起動してみるか

 

 

追記

mac再起動したけど、片方のメモリ認識せず

蓋開けて、刺し込み位置取り換えして、再起動・・・、16GB認識OK

よかった・・・

Galaxy S3が壊れて泣きそうなので、ほんとうによかった・・

 

 

追記

UM(Ubuntu on Mac

ビルド成功トータルで何時間だろう?10時間未満だとは思うけど・・

んで、outが44GB

ふざけんなwww

$ du -hs android-8.0.0_r4/
93G	android-8.0.0_r4/

これってなんかおかしくね?

WSL(Windows Subsystem for Linux)でもやりたかったけど、無理だな

外付けもあまってないしな〜〜

SSD調達しようかねえ?

 

追記

SSD500GB 20,000円付近か~~

KKOだからな~~~

どうしようかな~~~~

しぃなぁ~~~~~

 

外付けデータディスクとして使う予定だから、3.5HDDでもいいか???

いっつも悩むんだよなあああああ

 

内蔵の確かSSD128GBだったような気がするけど、この際に交換か???

 

追記

Core2DuoメモリGBの廃スペックノートPCUbuntu)でビルド

[  3% 2191/61548] Building with Jack: ...l_intermediates/with-local/classes.dex
FAILED: out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/with-local/classes.dex 
/bin/bash out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/with-local/classes.dex.rsp
Out of memory error (version 1.3-rc6 'Douarn' (441800 22a11d4b264ae70e366aed3025ef47362d1522bb by android-jack-team@google.com)).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
ninja: build stopped: subcommand failed.
11:39:11 ninja failed with: exit status 1
make: *** [run_soong_ui] エラー 1

#### make failed to build some targets (49:35 (mm:ss)) ####


real	49m34.775s

予想通りではあるが、メモリ不足で終了。オプションで調整できる?調整したところで無理か?

どうも、HDDの肥やしをみると、Android 6はビルドできたっぽいんだが。7でもメモリ不足で失敗してたか

 

追記

WSL(Windows Subsystem for Linux

USB2.0wの外付けHDDでやりなおし。なんか出てるな~~

[ 27% 17003/61548] Generating TOC: out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc
FAILED: out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc
/bin/bash -c "(prebuilts/build-tools/linux-x86/bin/ijar out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp ) && (if cmp -s out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc ; then rm out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp ; else mv out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc ; fi )"
ftruncate(fd_out, GetSize()): Invalid argument
/bin/bash: line 1: 30384 Aborted                 (core dumped) ( prebuilts/build-tools/linux-x86/bin/ijar out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp )
ninja: build stopped: subcommand failed.
10:26:21 ninja failed with: exit status 1
make: *** [run_soong_ui] Error 1

#### make failed to build some targets (08:44:50 (hh:mm:ss)) ####


real    524m50.540s
user    332m5.844s
sys     170m18.359s

https://forum.xda-developers.com/android/general/guide-build-rom-source-windows-10-t3469420/page2

 

追記

あの~~、ninja差分ビルド?部分ビルドってどうやんの・・・

 

まとめ

Core2DuoメモリGBの廃スペックノートPCUbuntu) → メモリ不足

Ubuntu on Mac miniメモリ16GB → 10時間ぐらい?でビルド完了

WSL(Windows Subsystem for Linux)・メモリ16GB・USB2.0外付けHDD → 検証なう・・

 bisonの入れ替えが必要

 ijarエラーが出ている

2017-08-06

5 reasons why Japanese Engineer are fu*king da*n

  • Because they likes "Technical document" much, though they usually study with books even it's Front-end latest technology, Many of them are just translated original EN contents or da*n not sexy sample code, it's worthless in the world which dynamically changing day by day in few months. Regardless of free latest contents which can be found everywhere, they just get Secondary Information given by some evangelists with passive mindset, it causes making this Evangelist? market stable due to this kind of information gap structure.

See also : https://anond.hatelabo.jp/20170728223725

2017-07-17

セッ失敗

付き合いはじめてすこしたった彼女セックスする機会があったのだけれど、

うまく勃起を維持できなくて失敗してしまった。

たくさんキスをして撫で回して指を挿れて、本当のところはわからないけれど彼女気持ち良さそうにして、イっちゃったと言ってはいて、それを見ていて非常な充足感を得ることはできたけれど、いざというときに役立たずで傷つけてしまったと思う。自分も不甲斐ない。

1日前にデートしたときは手を握っただけでいきり勃ってしまったのだけれどなんでだろう。

2杯飲んだお酒のせい?緊張のせい?普段オナニーの仕方のせい?ゴムのせい?

あと、想像では、裸をみただけで頭の奥がじんじんするような気がしていたけれど、思いのほか冷静だった。

肌すべすべだなー、思ったより脂肪ついてる、とか、おっぱい寄せていたんだなとか思ったよりも匂いが薄いとか。

とりあえず変な間があくまえに場を設けたいのだけれど、次は失敗したくない。

どうすると勃起を維持できるのだろう(栄養?訓練が必要?)?

どうやったらもっと彼女を喜ばせられるのだろう?

はてなーの諸先輩方にお知恵を借りたく思うのでよろしくおねがいいたします。

必要情報などあればなるべく答えていくのでご指示いただければと思います


Keep
  • 爪を短くしていてよかった
  • 清潔感のある下着をきていた
Problem
  • こういう流れになると思っていなく心構えが足りなかった
  • ゴムをもちあわせていなくコンビニに買いに行って時間ロス
Try
  • 薄い(高い)ゴムを使ってみる
  • お酒を減らす

2017-06-30

anond:20170630212139

情報処理安全確保支援士すごいね

俺は情報処理安全確保支援士取る気はないけど、ずいぶん昔にPMアプリケーションエンジニア試験TRYしたことを思い出した。

2017-06-10

http://anond.hatelabo.jp/20170610014440

https://hapaeikaiwa.com/2014/04/15/%E3%80%8C%E9%A0%91%E5%BC%B5%E3%81%A3%E3%81%A6%E3%81%AD%EF%BC%81%E3%80%8D%E3%82%92%E8%8B%B1%E8%AA%9E%E3%81%A7%EF%BC%9F/

日本語でも多くの状況で使われている「頑張れ!」。そのまま直訳をして「Try your best!」や「Do your best!」と言っている人をたくさん見かけますが、英語ではちょっと違和感がある表現なのでこのフレーズは出来るだけ避けましょう。

2017-04-30

今更だけど受験業界オンライン動画サービスマジですごいな。

社会人になって趣味世界史をだらだら勉強してるもんなんだけど、youtube世界史授業の動画探したらこんなのでてきた。

try it 高校世界史(372動画)

https://www.youtube.com/playlist?list=PLdG31GUo-My-kgENYDal25CJtarSwk7CD

世界史20プロジェクト(200動画)

https://www.youtube.com/playlist?list=PL10Gth9S1y6UsjC7frDds4xH3-mWbfTPR

二つとも登録不要無料。その他にもN予備校っていうのに登録すれば茂木誠という有名な世界史受験講師動画も70-80個ただで見れる。

あとはCMでやってる月額900円で教科問わず見放題のサービスがあるのはご存知通り。

の子はこういうのが当たり前でスマホ片手に勉強してるんだよなあ。

こんなわかりやすい授業をただで受けられるなんて羨ましい。

そりゃ学校の授業なんて聞かないよな。

今までは個人個人素人が単発でクオリティ無視youtubeに挙げてたけど、こういうプロが体系だった授業をフリー提供する時代になったことにちょっとした感動がある。

僕らはそういう恩恵は受けられなかったけど、社会人勉強としてはタダで教材が整ってきたといえるし、敷居はずいぶん低くなったと思う。

今更ではあるんだけど、なんか人に伝えたくなって書いてみた。

2017-03-28

シャワーのケレップとパッキンの交換

浴室のシャワー混合栓のパッキンとかを交換 - GONE WITH THE MEDICINE

http://d.hatena.ne.jp/whitypig/20110818/1313681497

株式会社カクダイ/Let's Try/バス(お風呂、浴室まわり)/2ハンドル混合水栓の水漏れ修理(パッキン交換)

http://kakudai.jp/try/buth/001_3.html

ここを参考にしつつ、ツーバルシャワー混合栓のケレップとパッキン交換。

用意する道具と材料

手順

  1. バケツ部品を洗うための水をためておく
  2. 止水栓を閉める
  3. ポイントを外す
  4. ドライバーハンドルのビスを外す
  5. モンキーレンチカバーナットを外す
  6. スピンドルを外す
  7. ケレップを取り出す
  8. スピンドルからパッキンを外して洗う
  9. その他部品も洗う
  10. スピンドルに新しいパッキンをつける
  11. ケレップを新しいものに交換
  12. スピンドルを取り付ける
  13. カバーナットを取り付ける
  14. ハンドルをビスで止める
  15. ポイントを付ける
  16. 止水栓を少し開け、問題いかチェック
  17. 止水栓を少しずつ開け、全開にしたのち半回転戻す

2017-03-13

Try!Swift Tokyo 2017に参加しました。

Try!Swift Tokyo 2017に参加しました。

総合的には悪い感想だったのですが、良い点と悪い点について書きます

良い点

会場の設備が充実していた

翻訳を始め、会場の広さやスクリーンなど、キャパに見合ったとても良い会場だった。

参加者から普段聞けない話が聞けた

やはり国内外からiOSエンジニアがたくさん参加されていたので、普段聞けないような話をたくさん聞けたのは良かった。

特に日本ユーザ数の多いアプリを手がけているエンジニアの話は貴重で、これだけでも参加した価値はあったと思う。

悪い点

Swiftにまつわる話が少なかった。かつ、トーク順をもう少し考えて欲しかった

やはりTry!Swiftとついていることもあって、聞きたかったのはSwiftの話だったが、3割くらい無関係or設計プロダクトの話だった。

決して勉強にならなかったわけではなかったのだが、前年のTry!Swiftがすごく良かったと聞いていて参加した分、期待外れは大きかった。

また、LTは全く関係ない話でも募集していたかもしれないが、それなら元から予定していたトークの間に挟むなど順番も考えて欲しかった。

特に、そのトーク問題があったわけではないが、一日の最後LTであることも悪い点の一つだった。

運営学祭の様な内輪ノリ感が見えた

これは特に三日目のハッカソンの際に感じたことだが、どうも内輪で盛り上がって置いてけぼりに感じることが多かった。

また、三日目は一日を通してグダグダだったと言わざるを得ないと思う。

これは違うかもしれないが、この日はアプリ道場の方々がメインで立ち回っていた様に見え、初日・二日目と違った様に思う。

など、あげればきりがないと思った。

名指しして申し訳ないが、今後アプリ道場運営に関わるイベントは参加しないと思う。

感想

決して安くない参加費を払って参加しているわけなので、少しでも知見を得たかったが、どう見ても価格に合う様な価値は得られなかったと思う。(良い点にも書いた通り、参加した意味がなかったわけではない)

隣の芝生ではないが、次週のDroidKaigi 2017がとても良さそうに見えて、参加費も半分以上違うことからこちらの方に参加すれば良かったと感じる。

遠方から来ている以上どちらも参加は難しく、より興味のあったTry!Swift選択したが、その分残念だった。

悪い感想エントリになったが、あくまでも個人の感想であり、全員が全員こういった感想ではないと思う。

これ以上自分擁護しても何の説得力もないので、次回の大型カンファレンスに期待して感想エントリを終わりたい。

2017-02-21

日本テレビ女尊男卑!っていうけど

量産型女子神経衰弱

・街行く女をバカにする「聞きにくい事を聞く」という番組

・街行く女性ヒール勝手に切ってしま番組

お笑いミソジニーネタ

中学生惨殺事件における、元警察の「残酷な殺し方だから犯人は女」

にわかカープ女子一切摘発

料理のできない若い女性バカにする「やってTRY

女性タレント暴言、ベッドに引きずり込み尻を叩く

・「女って怖〜い」「女の敵は女」ネタ

等等…

すべて、ここ二、三年のうちに見たもの

これでどこが「女尊男卑」なんだ?

で、これが男に対してやられた途端に「男性差別だ!男女逆なら許されないのに!」って騒ぎ出すんだろうな

カイカイ反応通信を見てると、ねらーと同じくミソジニスト韓国人イルベ民が日本バラエティを見て「なんて女性の扱いだ!神国韓国でやったら女性部に潰される!」と騒いでた

日本世界一女尊男卑日本番組女尊男卑だとか言ってるやつは韓国行ったら憤死しそう(あっちには徴兵制あるし)

2017-02-05

トライアンドエラーって言うなよ

try基本的動詞

error名詞

動詞名詞をandでつなぐなよ気持ち悪い。

正しくはtrial and errorだよ。

動詞同士で繋ぎたいなら

try and errだよ。こんな表現いたことないけど。

もうちょい勉強しろ

2016-12-30

運動神経悪い芸人」を見て笑ってる人間が怖い

やってTRYとかも同じだけど、何であれで笑えるのか理解できない。

他人の失敗がそんなに面白いか? 狂気を感じる。

2016-12-03

老害プログラマだが。最近若いもんが書いたコードを読んだ。

例外ってあるじゃろ。tryしてる間にthrowされたのをcatchするアレじゃ。あれは、たしか有用な仕組みじゃ。何かの関数に失敗したとき本来の値のかわりに特定の値を返すのもダサいし、参照型の引数成功たか否かを返すのもダサい場面、というのは確実にある。そもそもプログラマ怠惰で忘れっぽい生き物なので、例外という仕組みがなければ、関数で失敗したことにすら気づかないかもしれない。

だがな。例外魔物じゃぞ。昔は、gotoというものがあってだな。好きなところに処理を飛ばすことができる。あまりに、いろんなところに飛ばせるので、邪悪だと言い出した奴がおって、今ではあまり使われなくなった。なぜgoto邪悪と呼ばれたかgotoというのは、順接、分岐、反復という、プログラムを組む上で最低限必要制御構造から逸脱した、どっかからどっかに飛んでいく、という行為が容易にでき、それを多用したコードはまともな人間には読めなくなるからであった。そして、例外は、まさにその「どっかからどっかに飛んでいく」を容易にするための仕組みなのじゃ。

例外は、順接、分岐、反復による基本的制御構造があった上で、あくま対処を要するアブノーマルな状況に使われるべきものであり、例外というのは、制御機構として使ってはいけない。値を返す目的例外を使ってはいけない。一体どこから来て、どこへ行くのか分からない、そんな、流れ星のような例外の使い方をしてはいけないのじゃ。例外を使うなと言うつもりはまったくない。じゃが、例外制御構造を壊しうるものだと認識し、例外悪用していないか、それによってコードが追えなくなることはないか、と、考えてから、使ってほしいのじゃ。

イベント悪用も見た。イベントは非常に有用な仕組みだし、GUIなんかだと、もはや必須とも言える。なので、イベントを使うことは有用なことだ。けれど、イベントは、いつどこで発生するか予想が付きづらいものが多く、また、スレッドなどを使って非同期でイベントが処理される場合(今時は、多くがそうだろう)は、マルチスレッドと同じく、リソース排他制御を行う必要があるかもしれない。複数の処理が同時に動くというのは、恐ろしいことなのじゃ。いつの間にか、変わってないと思ってた変数が途中で変わるやもしれない。「まー、滅多に起こらないし、ええじゃろ」って判断の上、何も対策しない、という手もあるが、ええじゃろで済むのか済まないのか検討するくらいは必要じゃわな。C# なんかだと、言語レベルイベント実装されておる。じゃからイベント必要ないじゃろと言いたくなるような場面で、イベントが使われていたコードを見た。

便利な仕組みがどんどん出てきて、新しいものがどんどん古くなる今のコンピュータ業界。新しいものを追いかけるのもいいが、基本は基本として、しっかり押さえて欲しいのじゃ。今更、アセンブラゲームを作れるようになる必要なぞ、微塵もないが、自分コードがどのように動くのか、興味をもってほしいのじゃ。わしのような新しいもの不勉強老害は、最近若いもの基本的なことを不勉強からこそ、居場所があるのじゃ。じゃが、わしももう長くない。若いもんは、新しい仕組みの表面だけでなく深い部分に触れて、学んで、わしら老害を追い出せるくらいになってほしい。わしからは以上じゃ。

2016-08-30

例外の正しい使い方ってなんだよ。。。

↓こういう実装って駄目なの?

void sample(String str){

try{

str = str.replace("test","");

}catch(Nullpointerexception e){

str ="abc";

}

}

2016-06-08

日本式英語教育の弊害

何でも直訳調で訳させてしかもそれに◯して点数つけるもんだから

英語ゲームサイトでも情緒のない機械的翻訳が頭に浮かんでちっとも世界に入っていけない

TRY IT! →それをやれ

BUY NOW!→今買え

英語世界に馴染めば、この言葉の独特な感覚のようなものがつかめるんだろうが、

こちとら勉強嫌いの日本人なので全くそういう世界に入り込めん

ですます調でしかさな外国人のぎこちなさや胡散臭さにも通じるところがあるな

2016-05-08

Mothers Day 2016

We provides wide range Mothers Day for free here. You can download Mothers Day in wide range of high resolutions for your PC See our free Mothers Day Wallpaper gallery. You could download Mothers Day images to your computer with the high resolutions. Do not miss the quality. Free Images community gives the best quality images for your computer or web. Try to browse more pictures.

http://www.myneighbourmykiller.com/2016/05/08/mothers-day-greetings/

http://www.myneighbourmykiller.com/2016/05/08/mothers-day-cards/

http://www.myneighbourmykiller.com/2016/05/08/mothers-day-wishes/

http://www.myneighbourmykiller.com/2016/05/08/mothers-day-quotes/

http://www.myneighbourmykiller.com/2016/05/08/happy-mothers-day/

http://www.myneighbourmykiller.com/2016/05/08/mothers-day-poems/

http://www.myneighbourmykiller.com/2016/05/08/mothers-day/

MOTHERS DAY

admin | May 8, 2016 | Mothers Day | No Comments

We provides wide range Mothers Day for free here. You can download Mothers Day in wide range of high resolutions for your PC See our free Mothers Day Wallpaper gallery. You could download Mothers Day images to your computer with the high resolutions. Do not miss the quality. Free Images community gives the best quality images for your computer or web. Try to browse more pictures.

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Mothers Day

Share Good Morning Images, Graphics, Quotes! Wallpaper gallery to the Pinterest, Facebook, Twitter, Reddit and more social platforms. You can find more drawings, paintings, illustrations, clip arts and figures on the Free Images – wide range wallpapers community.

Search more related wallpapers bottom of the visuals like this gallery. In 2016, it will be a perfect year. Free your emotions!

If you leave your opinions via facebook comments, we are going to be so glad! Enjoy.

2016-04-14

detox

Toxins are everywhere. Car exhaust, secondhand smoke, flame retardants, plastic packaging, heavy metals, pesticides, BPA-coated receipts… Unless you’re living in virgin forest, you’re going to come into contact with some less-than-optimal chemicals pretty much every day.

That’s definitely no reason to panic. In fact, small doses of toxins may be good for you because of a phenomenon called hormesis – mild stress makes your cells work more efficiently. However, your body can have trouble clearing certain toxins. You eliminate most of the bisphenol-A (BPA) and other plastics you ingest, but a small percentage hides away in your fat cells, messing with your hormones and accumulating over time. It’s the same deal with several mold toxins, heavy metals like lead, nickel, cadmium, mercury, and aluminum, and with certain pharmaceuticals and drugs like THC.

A good detox protocol can help you eliminate these more stubborn toxins. The trouble is that many common detoxes don’t work. Juice and water cleanses, for example, are often actually counterproductive because they deprive your body of essential nutrients it needs to function. That said, there are a few genuine ways to detox.

Because so many toxins stay in your fat cells, one way to detox is through lipolysis – breaking down your fat cells and releasing the hard-to-reach toxins stored within them. Lipolysis is especially effective when you combine it with liver and kidney support or adsorbents that can suck up the released toxins. This article focuses on all of the above. Let’s start with saunas.

1) Sauna sessions

Sweating does more than cool you off. It also helps you get rid of both heavy metals and xenobiotics – foreign compounds like plastics and petrochemicals – in small but significant amounts. A 2012 review of 50 studies found that sweating removes lead, cadmium, arsenic, and mercury, especially in people with high heavy metal toxicity [1]. Another study put participants in both traditional and infrared saunas and found similar results [2]. Sweating also eliminates hormone-disrupting BPA, which accumulates in your fat cells [3].

There’s debate about the best kind of sauna for detoxification. A couple studies have shown that infrared saunas are the most effective for detoxing, but the research was funded by infrared sauna companies, so the results are questionable. Both traditional and infrared saunas are effective for detoxing [2]. That said, I prefer infrared saunas for a few reasons:

They don’t get as hot. Traditional saunas heat the air around you, while infrared light penetrates and heats your tissue directly. You sweat in an infrared sauna at around 130-150 degrees instead of at 180-200 degrees, so you can stay in for longer without feeling like you’re going to pass out. I’ve done 2-hour infrared sauna sessions (drinking salt water the whole time to replenish electrolytes and fluids, of course).

They’re easier on your electric bill. Again, infrared saunas require less energy, especially if you get a sauna that reflects infrared light back on you. This one, for example, costs about 15 cents an hour to run.

Infrared saunas are often cheaper.

I personally use a Sunlighten infrared sauna and love it. If you don’t want to buy an infrared sauna and there isn’t one around you, a standard sauna will work perfectly well [2]. There’s probably one in your local gym.

Keep in mind that sweating pulls electrolytes and trace minerals from your body, so it’s important to drink a lot of fluids and get plenty of salt (preferably Himalayan pink salt or another mineral-rich natural salt) if you’re going to use a sauna to detox [2].

2) Exercise

Exercise is another way to flush toxins from your body, and through more than just making you sweat. Exercise increases lipolysis (the breakdown of fat tissue), releasing toxins stored in your fat tissue. Studies show that people who exercise and lose body fat end up with higher levels of circulating hormone disruptors [4]. Increasing lipolysis through diet does the same thing [5].

Mobilizing toxins isn’t necessarily a good thing, particularly if you’re unequipped to get rid of them. You want to be sure you’re getting rid of toxins, not just moving them to a different part of your body. Working out addresses the issue to a degree: it improves circulation, providing more oxygen to your liver and kidneys so they can better filter out toxins. You can also give your system even more support and pull out bad stuff with the next two detox tools: activated charcoal and glutathione.

3) Activated charcoal

Activated charcoal is a form of carbon that has massive surface area and a strong negative charge. It’s been around for thousands of years and it’s still used in emergency rooms today to treat poisoning.

Charcoal binds to chemicals whose molecules have positive charges, including aflatoxin and other polar mycotoxins [6], BPA [7], and common pesticides [8]. Once the chemicals attach to the charcoal you can pass them normally (i.e. poop them out).

Charcoal can bind to the good stuff, too, so I don’t recommend taking it within an hour of other supplements. Try taking a couple charcoal pills along with exercise or have a sauna session. They should adsorb many of the toxins you release into your gut and GI tract.

4) Glutathione

Glutathione is a powerful antioxidant that protects you from heavy metal damage, according to studies in both human and rat cells [9,10,11,12]. Glutathione also supports liver enzymes that break down mold toxins and heavy metals. Your digestion will destroy normal glutathione, so opt for a liposomal glutathione supplement that makes it through your stomach. You can also supplement with N-acetylcysteine and alpha-lipoic acid, which your body can use to build glutathione on its own [13]. If you have severe heavy metal or mycotoxin poisoning, talk to a naturopath or functional medicine doctor about intravenous (IV) glutathione. It’s expensive and less convenient than an oral supplement, but it works very well.

5) Cryolipolysis

We’ve talked about how heat and exercise can increase fat burning to detox your fat cells. It turns out cold can do the same. Cryochambers are gaining popularity with professional athletes and other high performers for their ability to quell inflammation. It turns out they can help you burn fat – and release the toxins stored in itas well.

A cryochamber uses liquid nitrogen to supercool your body, stimulating mitochondrial function and decreasing inflammation. Intense cold also destroys fat cells, which has led to cryolipolysis therapy as a way to slim down [14,15]. You can use it to detox, too.

Can’t get your hands on a cryochamber? Try traditional cold thermogenesis instead.

6) Ketosis

Quick disclaimer: I haven’t found studies specifically looking at ketosis and toxin load, so you may want to take this section with a grain of (Himalayan) salt. That said, ketosis is a very effective way to induce lipolysis, particularly if you’re fasting.

When you’re in ketosis and you haven’t eaten recently, your body breaks down your fat stores into free fatty acids, which it then converts to ketones for fuel. That means that, in theory, you should be able to supercharge your detox (and fat loss) by dropping into nutritional ketosis.

The Bulletproof Diet puts you into mild ketosis, which curbs your hunger and sharpens your brain without forcing you to forego carbs entirely. If you want to try nutritional ketosis for detoxing, youll have to modify the Bulletproof Diet slightly. Skip carb reefed days for a couple weeks and limit carbs to ~30-50 grams per day. You can use keto urine strips or – even better – a blood ketone meter to test and make sure you’re becoming fat-adapted. Once your levels read around 1.5 mg/dL, you’re comfortably in nutritional ketosis. At that point, fasting will attack your fat stores and mobilize toxins, which you can mop up with activated charcoal or sweat out (or both).

7) Chelation therapy for heavy metals

Chelation therapy is the strongest way to detox heavy metals. It can also be dangerous, so many doctors don’t recommend it unless you have moderate to severe heavy metal poisoning. Chelation therapy uses compounds called chelators that form strong bonds with heavy metals, leaving them unable to further poison your body. You can then pass them normally. Chelation therapy is very effective for removing lead, mercury, aluminum, arsenic, iron, and copper.

If you’ve been exposed to a lot of heavy metals, talk to a functional medicine doctor about chelation therapy. You really want to go to a medical professional for this one, because it’s so effective that if your liver and kidneys aren’t able to process the metals (a common problem in people with heavy metal poisoning) you can get seriously ill.

Combining detox methods for maximum effect

Each of these 7 methods works well on its own, and you can stack methods for an even greater effect. Exercise and sauna sessions are a good example. Preliminary evidence suggests that exercising and then hitting the sauna afterward will detoxify you better than either one alone does [16]. With that in mind, here’s a sample detox protocol:

Take 2-3 mL liposomal glutathione and 2-3 g vitamin C an hour before exercising.

Exercise for at least 20-30 minutes (HIIT is a good option).

Take 3-4 activated charcoal pills.

Spend 45-60 minutes in a sauna. Remember to get plenty of water and salt/electrolytes.

If you have a lot of fat and you’re burning it off quickly, you’re probably getting rid of a lot of toxins in one fell swoop, and you may get a headache, digestive problems, brain fog, etc. If that happens try taking more glutathione, vitamin C, and charcoal. Be sure you take charcoal at least an hour away from other supplements, as it binds to vitamin C.

Toxins are a fact of modern life, especially if you live in a city or somewhere with poor air quality, mold, and/or a lot of petrochemical byproducts. These detox methods can give your body a little extra support dealing with pollutants and help you perform your best.

Subscribe below if you want more info about how to upgrade your body and brain. Thanks for reading and have a great week!

2016-03-04

window.OBR = window.OBR||{};(function(OBR){window.OB_releaseVer="01000501";window.OBR=window.OBR||{};OBR.k=OBR.k||;OBR.La=OBR.La||{};window.OBR$=function(d){return document.getElementById(d)};OBR.d=OBR.d||function(){var d={},a={v:function(){return d},h:function(a){d.X=a;d.cb=;d.startTime=(new Date).getTime()},startTime:function(){return d.startTime},log:function(a){var e=((new Date).getTime()-d.startTime)/1E3;1E3>d.cb.length&&d.cb.push(e+" >"+a)},printLog:function(){if(d.X.c.dj)window.console.log(d.cb.join("\n"));else{var a=d.X.b.Ia();a&&(a.innerHTML=d.cb.join("
"),a.style.display="block")}return d.cb.join("\n")}};a.h(OBR);return a}();OBR.printLog=OBR.d.printLog;OBR.H=function(){this.J=[]};OBR.H.prototype.add=function(d,a){var c;"string"===typeof d&amp;&amp;"function"===typeof a&amp;&amp;(c={},c.name=d,c.ai=a,this.J.push(c))};OBR.H.prototype.Qf=function(d){var a,c;OBR.d.log("remove event :"+d);a=0;for(c=this.J.length;a<c;a+=1)if(this.J[a]&amp;&amp;this.J[a].name&amp;&amp;this.J[a].name===d)try{this.J.splice(a,1)}catch(e){OBR.d.log("rm evnt err: "+e)}};</p&gt;

OBR.H.prototype.o=function(d,a,c){var e,b,f,g;a=a||[];c=!!c;OBR.d.log("event fire:"+d);e=0;for(b=this.J.length;e<b;e+=1)if(f=this.J&amp;&amp;this.J[e]?this.J[e].name:"",g=this.J&amp;&amp;this.J[e]?this.J[e].ai:null,f===d&amp;&g)try{g.apply(this,a)}catch(h){OBR.d.log("fire event *"+d+"* error: "+h)}!0===c&amp;&amp;this.Qf(d)};OBR.H.prototype.sa=function(){this.J=[]};OBR.b=OBR.b||function(){var d={},a={},c=document,e=OBR,b=null;a.v=function(){d.X=e;return d};a.h=function(a){e=a};a.Ba=function(){return function(){}};a.Gi=function(){var a=window.jQuery;return void 0!==a?!(/1\.(0|1|2|3|4)\.(0|1)/.test(a.fn.jquery)||/^1\.1/.test(a.fn.jquery)||/^1\.2/.test(a.fn.jquery)||/^1\.3/.test(a.fn.jquery)):!1};a.F=function(a){return null===a||isNaN(a)?null:e.n("outbrain_widget_"+a)};a.Ia=function(){return e.n("ob_holder")};a.ne=function(f){var g=a.Ia();null===g&amp;&amp;(g=e.b.createElement("div",</p&gt;

"ob_holder"),g.style.display="none",f?e.b.insertBefore(g,f):document.body.appendChild(g));return g};a.Vc=function(){if(!e.n(e.c.Pb)){var f=e.b.createElement("iframe",e.c.Pb),g=f.style;g.display="none";g.width="1px";g.height="1px";f.src="about:blank";(g=a.Ia())||(g=a.Va());e.b.Q(f,g)}};a.Va=function(){if(c.body)return c.body;var a;a=e.b.K("","","body",!0);return 0>=a.length?c.lastChild:a[0]};a.createElement=function(a,g,b,e){var d;a=c.createElement(a);"string"===typeof g&amp;&amp;a.setAttribute("id",g);"string"===

typeof b&amp;&amp;(a.style.cssText=b);for(d in e)e.hasOwnProperty(d)&amp;&amp;a.setAttribute(d,e[d]);return a};a.G=function(a){if(e.c.$d===e.c.Od)try{c.createStyleSheet().cssText=a}catch(g){OBR.d.log(g)}else{var b=c.createElement("style"),d=c.body?"string"===typeof c.body.style.WebkitAppearance:!1;b.type="text/css";c.getElementsByTagName("head")[0].appendChild(b);b[d?"innerText":"innerHTML"]=a}};a.N=function(a,g,b,d){var m=c.createElement("script");m.type=e.c.wj;m.src=a;m.charset="UTF-8";m.async=!!g;m.defer=!1;b&amp;&amp;

e.b.s(m,"load",function(a){var f=a.target;f&amp;&amp;setTimeout(function(){f.parentNode.removeChild(f)},3E3)});d&amp;&amp;e.b.s(m,"load",d);return m};a.Cl=function(a,g){var b=e.b.createElement("link",a);b.setAttribute("rel","stylesheet");b.setAttribute("type",e.c.Eh);g&amp;&amp;b.setAttribute("href",g);return b};a.ih=function(a){var g=e.n("ob_iframe");g&amp;&amp;(g.src=a)};a.Hf=function(){var a;a=isNaN(a)?1E5:a;return Math.floor(Math.random()*a)};a.nk=function(a,g,b){return a.replace(g,b)};a.Ll=function(){var f;if(f=OBR.n("objsonpp"))if(a.kj())a.Ka(f.parentNode)&amp;&amp;

f.parentNode.removeChild(f);else return OBR.n("objsonpp");f=c.createElement("iframe");f.id="objsonpp";f.tk&amp;&amp;(f.tk="seamless");(f.frameElement||f).style.cssText="width: 0; height: 0; border: 0";f.src="";c.body.appendChild(f);return f};a.R=function(a){var g,b;b=c.getElementsByTagName("head");try{b&amp;&amp;0<b.length?b[0].insertBefore(a,b[0].firstChild):(g=c.getElementsByTagName("script"),g[0].insertBefore(a,g[0].firstChild))}catch(d){e.d.log("Err insertToHead:"+d)}};a.Kl=function(a){a=a||OBR;return"function"!==</p&gt;

typeof a.H?(OBR.d.log("namespace.EventManager not function"),null):new a.H};a.O=function(a){return encodeURIComponent(a)};a.Ka=function(a){return null!==a};a.pj=function(f){var b,c=!1;if(a.Zc(f))return!1;b=f.Oe().recMode||"";f=f.Oe().dynamicWidgetLayout||"";b=e.c.rk[b]||"";"2"===b&amp;&amp;"1"===(e.c.sk[f]||"")&amp;&amp;(c=!0);c||"1"!==b&amp;&amp;"3"!==b||(c=!0);return c};a.Zc=function(a){return void 0===a||null===a};a.tj=function(b){return a.Zc(b)||""===b};a.getElementsByClassName=function(b,g){g||(g=document);return g.getElementsByClassName?

g.getElementsByClassName(b):a.K("class",b,"*",!0,!0,g)};a.K=function(b,g,e,d,m,l){var p,q,n;p=[];e=e||"*";d=!!d;m=!!a.tj(m);e=l?l.getElementsByTagName(e):c.getElementsByTagName(e);l=0;for(q=e.length;l<q;l+=1)n="class"===b?e[l].className:e[l].getAttribute(b),null!==n&amp;&amp;(!1===m&amp;&amp;(n=n.toLowerCase(),g=g.toLowerCase()),(n=""===b?!0:d?-1<n.indexOf(g):n===g)&amp;&amp;p.push(e[l]));return p};a.Wb=function(a,b,c){a.detachEvent?a.detachEvent("on"+b,c):a.removeEventListener&amp;&amp;a.removeEventListener(b,c,!1)};a.s=function(a,</p&gt;

b,c){a.attachEvent?a.attachEvent("on"+b,function(){c.call(a)}):a.addEventListener&amp;&amp;a.addEventListener(b,c,!1)};a.Q=function(a,b){try{b.appendChild(a)}catch(c){e.d.log("Fail insert into Dom:"+c)}};a.lb=function(b){b=e.n(b);!a.Zc(b)&amp;&amp;a.Ka(b.parentNode)&amp;&amp;b.parentNode.removeChild(b)};a.insertBefore=function(a,b){return b.parentNode.insertBefore(a,b)};a.isArray=function(a){return a instanceof Array?!0:"[object Array]"===Object.prototype.toString.call(a)};a.sb=function(a,b){var c=/htt(p|ps)?:\/\/127\.0\.0\.1(:\d\d\d\d)?/i;

return/^htt(p|ps)?:\/\/([\w\-]*|[\w\-]*\.[\w\-]*)\.outbrain\.com(:\d\d\d\d)?/i.test(a)||c.test(a)?a:b};a.al=function(a){a=a.replace(/^(\s*)/g,"");var b=c.createElement("div");b.innerHTML=a;return b.childNodes};a.Ua=function(a,b){return a?a.getAttribute(b):null};a.xa=function(a,b,c){a&amp;&amp;a.setAttribute(b,c)};a.I=function(a,b){var c=RegExp("[ '\"|]"+b+"[ '\"|]");a&amp;&amp;!c.test("|"+a.className+"|")&amp;&amp;(a.className+=" "+b)};a.ma=function(a,b){a&amp;&amp;typeof b===e.c.$k&amp;&amp;(a.classList?a.classList.remove(b):a.className=

a.className.replace(RegExp("(^|\\b)"+b+"(\\b|$)","gi")," "))};a.$=function(a,b){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c,e;try{return c=RegExp("[\\?&amp;]"+a+"=([^&amp;#]*)","i"),e=c.exec(decodeURIComponent(window.location.href.replace(/\+/g," "))),null===e?b:e[1]}catch(d){return b}};a.sh=function(a){"string"===typeof a&amp;&amp;0<a.indexOf("#")&amp;&amp;(a=a.substr(0,a.lastIndexOf("#")));return a};a.ie=function(a){var b=e.c.ga+"/strip_default.png";a.src!==b&amp;&amp;(a.alt="",a.title="",a.src=b)};a.Oh=function(){var a=</p&gt;

null,b,e,d=null;if("string"===typeof window.OB_MP_feed)a=window.OB_MP_feed;else if((b=c.getElementsByTagName("head"))&amp;&amp;0<b.length)for(e=b[0].getElementsByTagName("link"),b=0;b<e.length;b+=1)if(d=e[b],null!==d.type&amp;&amp;("application/rss+xml"===d.type||"application/atom+xml"===d.type)&amp;&amp;null!==d.href&amp;&amp;""!==d.href){a=d.href;break}return a};a.D=function(a,b){var c=null;a.currentStyle?c=a.currentStyle[b]:window.getComputedStyle&amp;&amp;(c=document.defaultView.getComputedStyle(a,null).getPropertyValue(b));return c};</p&gt;

a.xk=function(){var b=a.Ia(),g,c;a.Ka(b)&amp;&amp;(g=e.b.createElement("span","ob_a"),a.insertBefore(g,b),g.innerHTML=".",c=a.D(g,"color"),a.lb("ob_a"),g=e.b.createElement("a","ob_a"),g.setAttribute("href","void(0)"),g.innerHTML=".",a.insertBefore(g,b),b=a.D(g,"color"),a.lb("ob_a"),c="rgb(0, 0, 0)"===c||"#000000"===c?"#555":c,a.G(".ob-tcolor{color:"+c+"} .ob-lcolor{color:"+b+"} .ob-bgtcolor{background-color:"+c+"} .item-link-container:hover .ob-tcolor{border-color:"+c+"} "+(document.addEventListener?"":".odb_li:hover .ob-zapping-icon,.odb_div:hover .ob-zapping-icon,.item-container:hover .ob-zapping-icon,.ob-dynamic-rec-container:hover .ob-zapping-icon,.odb_li:hover .ob-textual-zapping-icon,.odb_div:hover .ob-textual-zapping-icon,.item-container:hover .ob-textual-zapping-icon,.ob-dynamic-rec-container:hover .ob-textual-zapping-icon{display:none !important;}")))};

a.Ke=function(b){var g=a.Ie("property","og:url","meta","content");null===g&amp;&amp;(g=a.Ie("rel","canonical","link","href"));null!==g||b||(g=window.location.href);null===g&amp;&amp;(g="");return g};a.Ie=function(b,g,c,e){var d=null;b=a.K(b,g,c,!1);null!==b&amp;&amp;0<b.length&amp;&amp;(d=b[0].getAttribute(e));return d};a.jh=function(b){var g,c,d;g=b.g("tracking",!1);c=b.g("comScoreEnabled",!0);d=e.c.je;!1===g&amp;&amp;(!0===c&amp;&amp;!1===d&amp;&amp;!b.Pe())&amp;&amp;(a.Vc(),g=b.q("pid",""),b=e.n(e.c.Pb))&amp;&amp;(b.src=e.c.ga+"/"+e.c.Ub+"3rd/comScore/comScore.htm#pid="+</p&gt;

g,e.c.je=!0)};a.Ei=function(){var b=a.Lb(8);"string"===typeof window.name&amp;&amp;(""===window.name||-1<window.name.indexOf("frame"))?(window.name=b,b=window.name):"string"===typeof window.name&amp;&amp;""!==window.name&amp;&amp;(b=window.name);return b=e.b.O(b.substring(0,9))};a.Lb=function(a){var b,c;b=[];a="number"===typeof a?a:8;for(c=0;c<a;c+=1)b.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".charAt(Math.floor(61*Math.random())));return b.join("")};a.me=function(a){for(var b="",c=0;c<a.length;c++)b=</p&gt;

b.concat(a[c]?"1":"0");return parseInt(b,2)};a.Xc=function(b){var g=b.getElementsByTagName("a")[0];if(null===b.offsetParent||0===b.offsetHeight||0===b.offsetWidth||0===b.clientHeight||0===b.clientWidth||"none"===a.D(b,"display")||"hidden"===a.D(b,"visibility"))return!1;var c=parseInt(a.D(b,"padding-top"),10)+parseInt(a.D(b,"padding-bottom"),10);return 0===b.clientHeight-c||g&amp;&amp;"none"===a.D(g,"display")?!1:!0};a.Oc=function(a){for(var b in e.La)if(e.La.hasOwnProperty(b)&amp;&amp;e.La[b].l===a)return e.La[b];

return null};a.Rl=function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0};a.Ga=function(a,b){return"function"!==typeof a?null:void 0===b?a():a(b)};a.kj=function(){return"Microsoft Internet Explorer"===navigator.appName};a.Fh=function(a,b){return a*b};a.Ge=function(a){if(!a||""===a)return[];a=a.replace("","").replace("http://","").replace("https://","").replace("www.","").replace("www2.","").split("/");a.pop();return 0<a.length?a:[]};a.ki=function(b,g){var c=a.Ge(b),e=[],d="";if(g>=c.length)d=

c.join(".");else{e[0]=c[0];for(d=1;d<=g;d+=1)e[d]=c[d];d=e.join(".")}return d};a.ti=function(){return"http"+("https:"===c.location.protocol?"s":"")};a.si=function(){var b,g;b=c.getElementById("widgetVersionSync");null===b&amp;&amp;(b=a.createElement("iframe","widgetVersionSync"),g=a.createElement("div",null,"display:none; height:0px; width:0px; border:none;"),g.appendChild(b),a.Va().appendChild(g));return b};a.ql=function(b){var g;g=window.OB_releaseVer;isNaN(g)||(isNaN(b)||g>=b)||(b=a.ti()+"://widgets.outbrain.com/external/sync/outbrainjs.html?needToBeVer="+

b.toString(),g=a.si(),g.src=b)};a.Sg=function(b){b=b.g("widgetVersionSync",0);isNaN(b)||""===b||(b=parseInt(b,10)||0,a.ql(b))};d.Rc=function(){if(b)return b;var a;try{var g=window.localStorage;g.setItem("OBtst","");g.removeItem("OBtst");a=g}catch(c){a={$b:{},setItem:function(a,b){this.$b[a]=b},removeItem:function(a){this.$b[a]=void 0},getItem:function(a){return"undefined"!==typeof this.$b[a]?this.$b[a]:null}}}return b=a};a.hg=function(a,b){d.Rc().setItem(a,b)};a.Qc=function(a){return(a=d.Rc().getItem(a))?

a:null};a.Gh=function(){d.Rc().removeItem("OB-USER-TOKEN")};a.h(OBR);return a}();OBR.ya=function(d,a,c,e,b,f,g,h,k){var m,l;m=this;l=0;k="function"===typeof k?k:OBR.b.Fh;m.start=function(){var p;l+=1;OBR.b.Ga(d,l)?OBR.b.Ga(a,l):(p=OBR.b.Ga(h,l))?OBR.b.Ga(e,l):(p=l===f&amp;&amp;1E3!==f)?OBR.b.Ga(e,l):(OBR.b.Ga(c,l),p=g?k(l,b):b,setTimeout(function(){m.start()},p))};m.start()};OBR.re=OBR.re||{fj:function(){return"complete"===document.readyState}};

OBR.Hc=function(){var d={},a=[];d.add=function(c){a.push(c)};d.remove=function(c){a.splice(c,1)};d.top=function(){return 0<a.length?a.shift():null};d.jj=function(){return 0>=a.length};d.Jl=function(){return a};d.qh=function(){a=[]};return d};

OBR.Ra=function(){function d(e,b){a.pb="resolve"===e?function(a){a&amp;&amp;a(b)}:function(a,g){g&amp;&g(b)};a.Pa=a.kk=function(){throw Error("Promise already completed.");};for(var f,g=0;f=c[g++];)f[e]&amp;&amp;f[e](b);delete c}var a={},c=[];a.pb=function(a,b){c.push({resolve:a,reject:b})};a.Pa=function(a){d("resolve",a)};a.kk=function(a){d("reject",a)};return a};

OBR.Ag=function(d){var a={},c=null,e,b;a.onClickOrAutoplay=void 0;a.onDisplayReady=void 0;a.onError=void 0;a.fetch=function(a){null===c?(c=a,b&amp;&amp;b(c,this),b=null):(c=a,OBR.Ja.of([this]))};a.shown=function(a){e=a;OBR.Ja&amp;&amp;OBR.Ja.pl(d.widgetId,d.playerId,e)};a.stopTimer=function(){if(this.tg){window.clearInterval(this.tg);var a=document.querySelector('[data-ob-player-id="'+d.playerId+'"] .timerNumber');a&amp;&amp;(a.textContent=a.parentElement.getAttribute("data-time"))}};a.placed=function(){OBR.Ja.ol(d.playerId)};

a.uj=function(a){b=a;c&amp;&amp;b(c,this)};a.Ue=function(){return d};a.Hl=function(){return e};a.Nl=function(){return d.when};return a};OBR.Fg=function(){var d={},a="00.000",c=null,e=null,b=0;d.start=function(){null===c&amp;&amp;(c=new Date);null!==e&amp;&amp;(b+=new Date-e)};d.stop=function(){var f=new Date(new Date-c-b),g=f.getUTCSeconds(),f=f.getUTCMilliseconds();e=new Date;return a=(9<g?g:"0"+g)+"."+(99<f?f:9<f?"0"+f:"00"+f)};return d};</p&gt;

OBR.rd=OBR.rd||function(){function d(){var a=window;a.googletag=a.googletag||{};a.googletag.cmd=a.googletag.cmd||[]}function a(a,g,c,e){var d=window;d.$revee&amp;&amp;d.googletag.cmd.push(function(){d.$revee.track({obpid:a,obsid:g,obdid:c,obpu:e});b.d.log("revee fire:"+e);b.d.log("revee fire id:"+c)})}var c={},e=!0,b;c.h=function(a){b=a;c.cc={}};c.Yb=function(f){if(f&amp;&amp;!1!==f.g("activateRevee",!1)){d();var g=f.q("pid",0),h=f.q("sid",0),k=f.q("did",0),m=f.ka();e||c.cc[k]?e&amp;&amp;(e=!1,f=b.b.N(b.c.U+"rva.outbrain.com/analytics-v1.js",

!0,!0,function(){m=document.location.href;a(g,h,k,m)}),b.b.R(f)):a(g,h,k,m);c.cc[k]||(c.cc[k]=!0)}};c.B=function(){e=!0;c.cc={}};c.h(OBR);return c}();OBR.c=OBR.c||function(){var d={},a={},c=OBR,e;a.Cg="opera";a.Od="msie";a.zg="firefox";a.xg="chrome";a.Eg="safari";a.Bg="mozilla";a.Al="boolean";a.$k="string";a.Vl="object";a.gl="undefined";a.Ul="number";a.Pb="ob_iframe";a.$e=!0;a.Ff=0;a.ec="outbrain_widget_";a.wj="text/javascript";a.Eh="このエントリーをはてなブックマークに追加ツイートシェア

2015-10-21

余冪に対応するプログラムの要素ってどんなの

デカルト閉圏というものがある。これは型付きλ計算直観主義論理モデルとなる圏だけども、その特徴は

である。これらをプログラム対応させると次のようになるだろう。

対象unit
直積直積
関数の型

これらの双対概念は次のようになるけども、

-双対概念プログラムへの対応
対象対象終了しない計算(例外)
直積直和判別共用体
余冪???

余冪に対応するものがよく分からん。余冪の定義からいうと余冪を X**Y と表現することにすれば

Hom(X**Y, Z)≅Hom(X, Y⊕Z)

が成立すればよい。だから

IntOrString = IntValue of int | StringValue of string

let f(x:int) : IntOrString = if x &gt;= 2 then IntValue(1) else StringValue("1")

なんて関数があったときに、これを一意的に

let f'(xy:X**Y) : string = "1"

のように書き換えることができればそれは余冪と言えると思えるのだが、そのような書き換えは可能なのか?

とりあえずこの場合に限れば、

exception Y of int

type XToYCopower(x:int) =
    let x' = if x &gt;= 2 then raise(Y(1)) else x

let f'(xy:XToYCopower) = "1"

みたいにして、呼び出すときは、

let mutable z: IntOrString = IntValue(0)
try
    z &lt;- StringValue(f'(XToYCopower(0))) 
with
    | Y(y) -&gt; z &lt;- IntValue(y)

とすると、書き換えができているような気もするし、やはり何か違う気もする。

よく分からんなぁ…。

2015-08-25

IT関係ないサラリーマンコミュニティサイト作っちゃいました。

私ごとですが、この度コミュニティサイト作成いたしました。

私の持てる知識を絞り出してなんとか完成しました。

**************************************************************************************

完成したサイトがこちらです。

LapyNetニュース

http://lapynetz.net/

**************************************************************************************

私は普段webとは関係ない仕事してます。なんとか休日を利用して、

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-&gt;set(compact('title_for_layout','content'));
if(date("G")&gt;0 and date("G") &lt; 7){
$today = date("Y-m-d", strtotime('-1 day'));
}else{
$today = date("Y-m-d");
}

$params = array(
'conditions' = &gt; array(
'and' = &gt; array(
'Rssfeed.time' = &gt; $today,
)),
'order' = &gt; 'tweets desc',
'limit' = &gt; '50'
);
$this- &gt;set('posts',$this- &gt;Rssfeed- &gt;find('all',$params));

$paramz = array(
'order' = &gt; 'Rssfeed.id desc',
'limit' = &gt; '10'
);
$this-&gt;set('posts2',$this-&gt;Rssfeed-&gt;find('all',$paramz));

$paramz = $this- &gt;Rssfeed- &gt;query('SELECT id,title FROM rssfeeds order by id desc limit 10');

$this-&gt;set('posts2', $paramz);

$parapara = $this- &gt;Oracle- &gt;query('SELECT id,title FROM oracles order by id desc limit 10');

$this- &gt;set('postx', $parapara);

$funking = $this- &gt;Rank- &gt;query('SELECT id,frank FROM ranks where creation=(select max(creation) from ranks)');

$this- &gt;set('funking', $funking);


}

 **************************************************************************************
public function mizuno() {
$parapara = array(
'order' =&gt; 'Oracle.id desc',
'limit' =&gt; '30'
);
$recent_posts = $this-&gt;Oracle-&gt;find('all',$parapara);
return $recent_posts;

}


 **************************************************************************************
public function wadai() {
if(date("G")&gt;0 and date("G") &lt; 7){
$today = date("Y-m-d", strtotime('-1 day'));
}else{
$today = date("Y-m-d");
}

$params = array(
'conditions' =&gt; array(
'and' =&gt; array(
'Rssfeed.time' =&gt; $today,
'Rssfeed.kubetu' =&gt; 4
)),
'order' =&gt; 'tweets desc',
'limit' =&gt; '100'
);
$this-&gt;set('posts',$this-&gt;Rssfeed-&gt;find('all',$params));





$this-&gt;set("title_for_layout","2CHニュース-LapyNetニュース");


$paramz = array(
'order' =&gt; 'Rssfeed.id desc',
'limit' =&gt; '10'
);
$this-&gt;set('postyy',$this-&gt;Rssfeed-&gt;find('all',$paramz));

$parapara = array(
'order' =&gt; 'Oracle.id desc',
'limit' =&gt; '10'
);


$this-&gt;set('postyx',$this-&gt;Oracle-&gt;find('all',$parapara));

$funking = $this-&gt;Rank-&gt;query('SELECT * FROM ranks where creation=(select max(creation) from ranks)');

$this-&gt;set('funking', $funking);



}
 **************************************************************************************
public function hot() {
if(date("G")&gt;0 and date("G") &lt; 7){
$today = date("Y-m-d", strtotime('-1 day'));
}else{
$today = date("Y-m-d");
}

$params = array(
'conditions' =&gt; array(
'and' =&gt; array(
'Rssfeed.time' =&gt; $today,
'Rssfeed.kubetu' =&gt; 3
)),
'order' =&gt; 'tweets desc',
'limit' =&gt; '20'
);
$title_for_layout = "LapyNetニュース";
$this-&gt;set("title_for_layout","ニュース-LapyNetニュース");
$this-&gt;set('posts',$this-&gt;Rssfeed-&gt;find('all',$params));

$parapara = array(
'order' =&gt; 'Oracle.id desc',
'limit' =&gt; '10'
);
$this-&gt;set('postxx',$this-&gt;Oracle-&gt;find('all',$parapara));

$paramz = array(
'order' =&gt; 'Rssfeed.id desc',
'limit' =&gt; '10'
);
$this-&gt;set('postsxxx',$this-&gt;Rssfeed-&gt;find('all',$paramz));

$funking = $this-&gt;Rank-&gt;query('SELECT * FROM ranks where creation=(select max(creation) from ranks)');

$this-&gt;set('funking', $funking);


}

 **************************************************************************************
public function newnew() {
if(date("G")&gt;0 and date("G") &lt; 7){
$today = date("Y-m-d", strtotime('-1 day'));
}else{
$today = date("Y-m-d");
}

$params = array(
'conditions' =&gt; array(
'and' =&gt; array(
'Rssfeed.time' =&gt; $today,
'Rssfeed.kubetu' =&gt; 2
)),
'order' =&gt; 'tweets desc',
'limit' =&gt; '20'
);
$this-&gt;set("title_for_layout","エンタメニュース-LapyNetニュース");
$this-&gt;set('posts',$this-&gt;Rssfeed-&gt;find('all',$params));

$paramz = array(
'order' =&gt; 'Rssfeed.id desc',
'limit' =&gt; '10'
);
$this-&gt;set('postszz',$this-&gt;Rssfeed-&gt;find('all',$paramz));

$paramz = $this-&gt;Oracle-&gt;query('SELECT id,title FROM rssfeeds order by id desc limit 10');

$this-&gt;set('postszz', $paramz);

$parapara = $this-&gt;Oracle-&gt;query('SELECT id,title FROM oracles order by id desc limit 10');

$this-&gt;set('postzy', $parapara);


$funking = $this-&gt;Rank-&gt;query('SELECT * FROM ranks where creation=(select max(creation) from ranks)');

$this-&gt;set('funking', $funking);



}
 **************************************************************************************
public function top() {
if(date("G")&gt;0 and date("G") &lt; 7){
$today = date("Y-m-d", strtotime('-1 day'));
}else{
$today = date("Y-m-d");
}
$params = array(
'conditions' =&gt; array(
'and' =&gt; array(
'Rssfeed.time' =&gt; $today,
'Rssfeed.kubetu' =&gt; 1
)),
'order' =&gt; 'tweets desc',
'limit' =&gt; '20'
);
$this-&gt;set('posts',$this-&gt;Rssfeed-&gt;find('all',$params));

$param = array(
'conditions' =&gt; array('times &gt; current_timestamp + interval -600 minute and Kubetu = 4'),
'order' =&gt; 'tweets desc',
'limit' =&gt; '30'
);
$this-&gt;set('posts2',$this-&gt;Rssfeed-&gt;find('all',$param));
}


 **************************************************************************************
public function view($id = null ) {
$this-&gt;Rssfeed-&gt;id = $id; //驥崎ヲ√↑荳譁・i縺励>
$user = AuthComponent::user();

$TwimStatus = ClassRegistry::init('Twim.TwimStatus');


$TwimStatus-&gt;getDataSource()-&gt;setToken(AuthComponent::user());

$statuses = $TwimStatus-&gt;tweet();
$rairai = $this-&gt;Rssfeed-&gt;read(title,$id);
$alcol = $this-&gt;Rssfeed-&gt;read();
$this-&gt;set('post', $alcol);

$this-&gt;set('post2', $user);
$this-&gt;set('post3', $statuses);
$this-&gt;set("title_for_layout",$rairai[Rssfeed][title]."-LapyNetニュース");

$paramz = array(
'order' =&gt; 'Rssfeed.id desc',
'limit' =&gt; '20'
);
$this-&gt;set('postszz',$this-&gt;Rssfeed-&gt;find('all',$paramz));

$parapara = array(
'order' =&gt; 'Oracle.id desc',
'limit' =&gt; '30'
);
$this-&gt;set('postzy',$this-&gt;Oracle-&gt;find('all',$parapara));

}
 **************************************************************************************
public function add() {

if($this-&gt;request-&gt;isPost()){
if($this-&gt;Tweet-&gt;save($this-&gt;data)) {
$this-&gt;Session-&gt;setFlash('seikou');
$this-&gt;redirect(array('controller'=&gt;'rssfeeds','action'=&gt;'view',$contents11));

}else{
$this-&gt;Session-&gt;setFlash('sipai');
$this-&gt;redirect(array('controller'=&gt;'rssfeeds','action'=&gt;'view',$contents11));
}
}
}
 **************************************************************************************
public function delete($id = null) {
$this-&gt;Rssfeed-&gt;id = $id; 
$this-&gt;set('set', $this-&gt;Rssfeed-&gt;read());
$this-&gt;redirect(array('controller'=&gt;'tweets','action'=&gt;'delete',$this-&gt;data['tweet']['rssfeed_id']));


}
 **************************************************************************************
public function oracle() {
if($this-&gt;request-&gt;is('post')) {

$user = AuthComponent::user();

$TwimStatus = ClassRegistry::init('Twim.TwimStatus');


$TwimStatus-&gt;getDataSource()-&gt;setToken(AuthComponent::user());

$contents1 = $this-&gt;request-&gt;data['Rssfeed']['contents'];
$contents2 = $this-&gt;request-&gt;data;
$statuses = $TwimStatus-&gt;tweet($contents1);


if($this-&gt;Rssfeed-&gt;save($contents2)) {
$this-&gt;Session-&gt;setFlash('成功です。');
$this-&gt;redirect(array('controller'=&gt;'rssfeeds','action'=&gt;'view',$contents11));
$this-&gt;redirect($this-&gt;referer());
}else{
$this-&gt;redirect(array('controller'=&gt;'rssfeeds','action'=&gt;'view',$contents11));
$this-&gt;Session-&gt;setFlash('失敗です。');
}
}


}
 **************************************************************************************
public function makelist() {
$rssfeeds = $this-&gt;paginate();
if ($this-&gt;request-&gt;is('requested')) {
return $rssfeeds;
} else {
$this-&gt;set('rssfeeds', $rssfeeds);
}
}

}

----------------------------------------------------------------------------------------------------------------------

rssフィードはこんな感じです。
----------------------------------------------------------------------------------------------------------------------

#!/usr/bin/php
&lt;?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 '&lt;ul&gt;';
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-&gt;count;

 **************************************************************************************

$checkman = db_check_urls($href);
$checkman2 = db_check_pr($title);

$nowtimes = date('Ymd');

 


if($checkman == 0 &amp;amp;&amp;amp; $checkman2 == 0){
#$hrefs = urlencode($href);
db_put_urls($nowtimes,$href,$title,$description,$tweets);
echo "&lt;li&gt;&lt;a href=$href&gt;$title&lt;/a&gt;&lt;br&gt;$megami&lt;p&gt;$tweets&lt;/p&gt;&lt;p&gt;$checkman&lt;/p&gt;&lt;/li&gt;";
}else{

}


}
echo '&lt;/ul&gt;';

 

 

 **************************************************************************************
function getRssList($urls)
{
$rssitems = array();
foreach ($urls as $url) {
$obj = fetch_rss($url);
$rssitems = array_merge($rssitems, $obj-&gt;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-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);


$sql = 'SELECT count(*) AS count FROM rssfeeds WHERE urls = :language';
$prepare = $db-&gt;prepare($sql);


$languages = array($href);
foreach ($languages as $language) {

$prepare-&gt;bindValue(':language', $language, PDO::PARAM_STR);
$prepare-&gt;execute();

$result = $prepare-&gt;fetchColumn();
if ($result &gt; 0) {
return true;
}else{
return false;
}
}

} catch (PDOException $e) {
echo 'エラーが発生しました。内容: ' . h($e-&gt;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-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$db-&gt;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-&gt;prepare($sql);

$prepare-&gt;bindValue(1, 0, PDO::PARAM_STR);
$prepare-&gt;bindValue(2, $nowtimes, PDO::PARAM_STR);
$prepare-&gt;bindValue(3, $href, PDO::PARAM_STR);
$prepare-&gt;bindValue(4, $title, PDO::PARAM_STR);
$prepare-&gt;bindValue(5, $description, PDO::PARAM_STR);
$prepare-&gt;bindValue(6, $tweets, PDO::PARAM_STR);
$prepare-&gt;bindValue(7, 'cast( now() as datetime)', PDO::PARAM_STR);
$prepare-&gt;bindValue(8, $sikibetu, PDO::PARAM_STR);
$prepare-&gt;bindValue(9, $moto, PDO::PARAM_STR);
$prepare-&gt;execute();

} catch (PDOException $e) {
echo 'エラーが発生しました。内容: ' . h($e-&gt;getMessage());
}
}
?&gt;

---------------------------------------------------------------------------------------------------------------------

**************************************************************************************

参考にした書籍

CakePHP2 実践入門 (WEB+DB PRESS plus)

CakePHP2 実践入門 (WEB+DB PRESS plus)

作者: 安藤祐介,岸田健一郎,新原雅司,市川快,渡辺一宏,鈴木則夫

出版社/メーカー: 技術評論社

発売日: 2012/09/29

メディア: 単行本ソフトカバー

購入: 5人 クリック: 165回

この商品を含むブログ (9件) を見る

Webアプリ開発を加速する CakePHP2定番レシピ119

Webアプリ開発を加速する CakePHP2定番レシピ119

作者: 長谷川智希,デジタルサーカス

出版社/メーカー: 秀和システム

発売日: 2013/09/28

メディア: 単行本

この商品を含むブログ (1件) を見る

**************************************************************************************

一番難しいところはtwitterログインwebサイト連結でした。

cakephp直感できに操作できていいです。

素人のわたしでも操作できましたので。

cakephpを使用しています

webからニュース収集してきます

ツイート数でランキングしてますネット話題を見つけられます

twitterアカウントログインできます

ニュースに対するコメントもできるし、

自分記事投稿できます。(画像も可)

デザインはよくわからないので、

ホームページビルダーを使用しています

今のホームページビルダーは昔と違って高機能ですね。

テンプレートも何種類もあって今はすごいです。

アマゾンawsを使用してます

サーバーWebサーバーデータベースサーバmysql)

に分かれています

今更cakephpを使っている人は少ないかもしれませんが、

データベースとの接続などは楽でした。

twitterアカウントあるといつでも参加できますので、

ニュースを通してコミュニケーション目的としたサイトを目指します。

2015-07-13

http://anond.hatelabo.jp/20150712023654

元増田です。

ちょっと距離が離れていたというのもあって、会うのは月1回ぐらい。

普通に外で飯を食べるだけという事も多かった。

実際に肌を重ねるのは2ヶ月に1回ぐらいだった。

当然毎回TRYしようとしたけど、凄く彼女は痛がるし、濡らしたりするテクも無かったので結局2年かけても貫通出来なかったんだよな。

それだけ大変だった彼女処女が行きずりの男が簡単に奪っていたのはショックだった。

俺が下手すぎたのかもしれないが。

2015-07-12

http://anond.hatelabo.jp/20150712023654

彼女が痛がるのでちょっとずつTRYしつづけて1年後無痛で貫通した俺から見ても無能と言わざるをえない

http://anond.hatelabo.jp/20150712013127

童貞処女で上手くセックス出来ずに2年経過

おいおい、性交成功するまでTRYし続けろよ。

2年も成功せずに経過って中学生だったの?

2015-05-22

What 'Good Kill' Gets Wrong About Drone Warfare

http://www.newsweek.com/2015/05/22/watch-drone-331949.html

In the opening scene of Patton (1970), the film’s namesake addresses a sea of troops about to be hurled onto World War II’s front lines in Europe and North Africa. General George S. Patton says, “Now, I want you to remember that no bastard ever won a war by dying for his country—he won it by making the other poor, dumb bastard die for his country.”

The film Good Kill, which comes out this week, depicts a lieutenant colonel delivering a similarly rousing speech to a group of recruits about to enter combat. Only this time it’s with drones. “Ladies and gentlemen,” he says, “the aircraft you’re looking at behind me is not the future of war; it is the here-and-fucking-now.”

The movie, written and directed by Andrew Niccol (Gattaca, Lord of War), provides a harrowing look at warfare’s newest frontier through the eyes of a fictional drone pilot. Major Tom Egan (Ethan Hawke), a former Air Force pilot yearning to fly again, spends 12 hours a day fighting militant groups like the Taliban from a dark, air-conditioned bunker in the Nevada desert—more than 7,000 miles away from the battlefield. Through prolonged close-ups on his computer screens, the audience is complicit, forced to watch as his strikes claim lives. When the camera turns, the audience sees Egan gradually unraveling from the stress. Joystick in hand, he surveils and strikes targets seen on a computer screen, racking up casualties. And then, after his shift, he trudges back to his home in Las Vegas, where his wife (January Jones), children and the challenges of domestic life await him.

Try Newsweek for only $1.25 per week

From World War II to contemporary conflicts, war films often highlight the humanity of soldiers, helping to connect civilians in the audience to the people and wars they once understood only in the abstract. Good Kill adds to this long cinematic tradition within the context of the U.S. drone program, a little-seen world filled with men and women at the forefront of modern warfare. “You can’t say you’re anti-drone,” Niccol tells Newsweek. “It’s like saying you’re anti-Internet.”

“The really exciting thing about working with Andrew [Niccol] is that he doesn’t really see this from a left-wing point of view or a right-wing point of view,” Hawke says. “He’s kind of coming at it as a humanitarian and a scientist.”

So how accurately does the film depict the lives and thoughts of these modern fighters? Newsweek reached out to a former drone operator, Brandon Bryant, to gauge how realistic the movie’s portrayal is and discovered that, in August 2013, early on in Good Kill’s production, he was contacted by a producer, who asked for his insights. Bryant critiqued an early version of the script, told his service stories and answered questions. But a few weeks in, he says, the producers became unresponsive.

This is nothing new to Hollywood insiders, who are used to the slow pace and false starts of independent filmmaking, but Bryant thinks the “snubbing,” as he refers to it, was because of a disagreement regarding one element in the script. Or rather, an element noticeably absent from it: the psychological impact of remote warfare on drone operators. “The psychological aspect is the most important part of this kind of film,” says Bryant. “Because what we’ve done is taken the warrior from the battlefield where...they’re no longer with their comrades.”

U.S. Air Force Maj. Casey Tidgewell (L) and Senior Airman William Swain operate an MQ-9 Reaper from a ground control station August 8, 2007 at Creech Air Force Base in Indian Springs, Nev. Ethan Miller/Getty

In 2005, Bryant was a University of Montana student struggling to pay his tuition and searching for any way out of Missoula. He agreed to give his friend a ride to a nearby Army recruiting office that summer and weeks later signed up to join the Air Force. After several months of testing and training at Lackland Air Force Base in Texas, Bryant was assigned to a windowless bunker on the periphery of Las Vegas, just like Hawke’s character in Good Kill. His job was to guide missiles to their intended targets via laser. He hated the work instantly, but, also like the film’s main character, Bryant knew he had to tough it out. In just six months during 2007, he says, he killed 13 people with four shots—some targets, others “collateral damage.”

He can recall every devastating detail of his first strike. Three men with rifles were walking along a road somewhere in Afghanistan; the two in front looked as if they were having an argument, while the third wandered a little behind them. Bryant says he had no idea who the men were, only that they were targets. Command ordered his team to aim a missile at the two men in front instead of the one in the back, astwo is better than one.”

by Taboolaby TaboolaSponsored LinksSponsored Links

Promoted LinksPromoted Links

RecommendedHuge Manta Ray Catch Angers ConservationistsKim Jong-un Assembles New ‘Pleasure Squad’ of Young WomenThe Beginning of the End of North Korea?The Full Beauty Photo Project: Big Women Bare AllWhen the smoke cleared, a crater appeared on Bryant’s screen, littered with the body parts of the two men. The third man lay on the ground, missing part of his right leg. “I watched him bleed out,” Bryant recalls. The third man’s blood, which on Bryant’s screen appeared white in infrared, drained from his body, pooled on the ground and cooled. “After a while, he stopped moving, and he became the same color as the ground.”

The horrors of his work soon wormed their way into Bryant’s subconscious. “I used to have a lot of trouble sleeping,” he says. “I just hated seeing my work when I closed my eyes.” This aspect of the job gets a nod in the film: As Egan retreats into himself and those he loves drift further away, he seeks comfort in vodka. Prolonged depression gives way to rage—Egan gets physically violent with his wife and angrily throws a bottle of liquor after a cashier makes a joke about his flight suit.

In 2011, nearly six years after joining the Air Force, Bryant turned down a $109,000 bonus and left. Upon exiting, he was presented for the first time with a report on his accomplishments: He was associated with 1,626 kills. “I felt sick to my stomach,” he says. “Civilians were being killed because leadership didn't care…. All they were doing was racking up tallies for their promotions.”

An MQ-9 Reaper takes off on a training mission August 8, 2007 at Creech Air Force Base in Indian Springs, Nev. Ethan Miller/Getty

Bryant’s guilt weighed heavily on his conscience. On a trip to Best Buy in late 2011, he used his military ID while paying for a video game. A young man behind him noticed it. “You served in the military? So did my brother. He served in the Marines and he killed, like, 30 people. How many people did you kill?” In front of a store full of people, Bryant responded, “If you disrespect the taking of another person’s life ever again, I will find you and kill you in front of your family.” He was asked to leave the store.

Most Shared. Venezuela Officials Suspected of Drug Trafficking Shares: 1.8k Dick Cheney’s Biggest Lie Shares: 955 Requiem for the Cryosphere: Huge Antarctic Ice Shelf Is About to Disintegrate Shares: 596 'Staying Up Late With Letterman': Our 1986 Profile Shares: 431 Why It’s Not Actually Raining Spiders in Australia Shares: 175 Most Read Court Ruling on Immigration Could Rock Obama, 2016 Race Taylor Swift Premieres 'Bad Blood' Video at Awards Show GMO Scientists Could Save the World From Hunger, If We Let Them Singing the End of 'Mad Men' Dick Cheney’s Biggest Lie It was after Bryant begrudgingly told a therapist this story that he finally agreed with her diagnosis: he had post-traumatic stress disorder (PTSD).

The issue of PTSD in drone operators is controversial. To someone outside the military, it might seem that a distinction should be made between those in combat who are on a conflict’s physical front lines and those operating on its technological front lines. But does such a distinction extend to remorse or guilt? Or to the difference between whether the blood that a soldier may feel is on his or her hands is there literally or just on a computer monitor?

Madeline Uddo, a psychologist and team leader of the PTSD clinical team at the Southeast Louisiana Veterans Health Care System, says PTSD can be diagnosed if a certain number of symptoms outlined in the Diagnostic and Statistical Manual of Mental Disorders—the guide used in psychiatry to diagnose mental disorders—are present. She notes that the manual’s fifth edition seems to cover the experience of drone operators. Furthermore, a Defense Department study from 2013 found that drone pilots experience many stress disorders, including PTSD, at the same rate as aircraft pilots.

Hawke and Niccol say that soldiers like the fictional Egan and the very real Bryant are essentially test subjects, and that what the military asks of them has “never been asked of a soldier before.” It’s an admission that Good Kill is in uncharted territory, but they avoid saying that Egan has PTSD, although Niccol calls what Hawke depicts in the film “an approximation” of PTSD.

According to Zev Foreman, a producer on the film, the creators were determined to leave Egan’s diagnosis open-ended so the audience is able to better interpret how it feels about the drone program. Or, as Foreman puts it, “[we’re] not making a statement particularly about anything while opening up a discussion about everything.”

Still, Bryant maintains that the filmmakers, in telling a drone operator’s story, have a responsibility to weigh in on the remorse that many of them face, something he feels Good Kill largely fails to do. “I wanted [them] to make a powerful movie, not just an entertaining one,” he says. “[They] wanted to make something akin to Top Gun with drones…. They’re doing what our society does—marginalizing the traumatic effects of personal experiences.”

While this back-and-forth could be chalked up to an outsider not understanding Hollywood’s rules, it indicates a bigger issue: Although troops can perform their duties 7,000 miles away from battle, that doesn’t mean they’re safe. And although drones allow us to see into any corner of the world at any time, when it comes to the psychological effects this type of fighting has on our soldiers, we're flying blind.

Bryant is currently in an inpatient program designed to help him cope with his PTSD. “When I go back to those memories and my emotions get high,” he says, “I feel rage or extreme depression. It’s helping me manage those emotions.”

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