
はてなキーワード:adapterとは
家のユニットバスの床が汚い。
水でざっと流そうと思ったがシャワーは固定のやつなので、代わりに洗面台の蛇口にホースを取り付けてザーッと流そうと思った。
早速ダイソーでホースを買ってきたが、蛇口がデカすぎてハマらない。
調べてみると蛇口の口の部分を外してアタッチメントを付ける事でホースと接続できるらしい。
早速ホームセンターに行く。
蛇口はメスネジで、その口径は15cmとして統一規格があるらしい。家から持ってきた蛇口の蓋がホームセンターで売られてる蛇口にハマる事を確認。その蛇口を実験台にする事とした。
とりあえずホースをしっかり掴むHose ConnectorとTapAdapterというのがセットで売られてたのでカゴに入れる。
名前から言ってTapAdapterだけで接続できそうな感じがするが、蛇口と同じくメスネジだし、口径も大きいのでさらにもう一つ、メスネジ同士を接続ししかも双方の口径が違うアタッチメントが必要なようだ。
ホームセンターの水回りコーナーを探してみると、そのものズバリのものを発見。Reducing Nippleというらしい。Nippleって乳首以外にも使うんだと感心した。
15x20cmのReducing Nippleを試す。
TapAdapter側 (20cm) とはうまく接続できた。
口径は合ってるが、ネジ山の間隔がもっと短くないといけないのだ。
諦めかけたその時、AeratorAdapter Kitというものを発見。
コレは蛇口とも接続出来るし、前述のTapAdapter も付いている。万々歳である。これとHose Connectorを単品で買い帰宅。
その後すぐに、別に洗面器に水溜めてもザッと流せるよねと気付いたが、まぁ良い。俺は俺のやりたい事をやり遂げたんだ。
なにか自分に都合が悪いこと、直面するのがとても恐ろしいことが起こった時。私たちはそれに対峙するか、逃げるという選択肢を採ることができる。
たとえば自分が不祥事の当事者になった時に、周囲からの追及を逃れようとして、雲隠れしてしまうことも逃避の一種だ。
だが、どこにも逃げ場がなくなった時にはどうすればよいか。
自分自身を消せばいい。
自分自身の力で世界を変えることができないのなら、怖れの苦しみを逃れる手っ取り早い方法は、それを感じる意識を消すことだ。
どこにも逃げ場がなくなって、服毒自殺を図ったり、睡眠薬等のオーバードーズを起こすということは、自分自身の情動をやりくりするための戦略だ。それは魔術じみた子供だましに周囲からは見えるかもしれないが、本人にしてみれば、立派な戦略なのだ。
そんなことを言ってた哲学者がいなかったけか。サルトルだったと思うんだが。
La multiplicitédes conduites émotionnelles
Suivantles formes prisespar l'émotion,la transformationrevêtdes formesdifférentes : l’anéantissementdes objets (etparfois dela conscience) pourla peur, l’uniformisation delastructure du monde pourla tristessepassive.Le moteur de l’évasionest l’impossibilité de confronterun objet danslepremier cas ou d’adapterles moyens face àla disparition d’unedes conditions de l’action dansle second.
情動が採る形態によって、変容は異なる形態をおびる。怖れにたいして、対象の無化(時には意識の無化である)、受動的な悲観にたいして、世界の構造の画一化といったように。逃避を動機づけているのは、まず、対象に対峙できないこと。さらには、行動するための条件が無くなってしまった状況に適応する術を失ってしまうこと。
http://www.cnam.fr/servlet/com.univ.collaboratif.utils.LectureFichiergw?ID_FICHIER=1295877018192
ども。
以前、はてな匿名ダイアリーで日記を書いた者です。
→【Ruby on Rails勉強】 xvideosまとめサイトっておいしいの?
上の記事でも書いていますが、Railsはおろか、Rubyを初めて触った人間がゼロからWebサービスをリリースするために利用しているGemを公開したいと思います。
| サイト名 | onalife(オナライフ) |
|---|---|
| URL | http://www.onalife.com |
| 説明 | xvideos動画の共有・ユーザー参加型のまとめサイト |
developmentモードで起動する際のデータベースはsqlite3を使うようにしています。
コーディング→サーバー起動→動作確認→コーディング…という流れになりますが、サーバーを起動する際に、
$rails s
と実行するだけでサーバーが起動できるため大変手軽です。
サーバー起動後はブラウザでhttp://localhost:3000/ でアクセスすれば開発用のサイトを確認できます。
productionモード(本番環境)で利用するのはMySQLを使うようにしています。
理由は他のWebサイトで推奨されていたため。
sqliteの場合だと、単純にDBのデータをファイルとして扱っており、同時に複数アクセスがあった際、最初のアクセス中にファイルがロックされてしまう仕様との記事をどこかで見たため、MySQLを使うようにしています。
developmentとproductionで動作を分けるには、config/database.ymlで分けることができます。
development:
database:db/development.sqlite3
pool: 5
timeout: 5000
production:
encoding: utf8
pool: 5
timeout: 5000
よくWebサービスのページ下にある [1][2]・・・[X]といったリンクが表示されている、あれです。
http://memo.yomukaku.net/entries/238
https://github.com/amatsuda/kaminari
Unicorn +Nginx +Rails で構築しています。
効果の違いなどはGoogle先生に質問すると大量に返答がありますのでこちらでは割愛。
ONALIFE(オナライフ)では、xvideosの動画URLや画像パスを抜き出す為に、こちらのGemを使っています。
http://himaratsu.hatenablog.com/entry/2013/04/27/002249
自作するとなるとかなり労力使いますから…こういったところは極力他の人が作ってくれたものを流用してもバチはあたらんでしょう。
https://github.com/mbleigh/acts-as-taggable-on
通常だと管理画面もrails g xxx とかやって controller 作って、view 作って…とかやらないといけませんが、こちらのGemを使うと一瞬で終わります。
素晴らしい!!
当サイトでは、投稿していただいたxvideosの動画が不適切な場合などに消去する必要があるため、どうしても管理者向けの画面が欲しかったのでこちらを使いました。
データベースを直接操作してdelete とかできちゃいます。
http://www.func09.com/wordpress/archives/1136
自分のサイトのアクセス傾向を解析して、どうすればアクセスが伸ばせるか、ということを考察するのに必要不可欠な機能です。
通常、Google Analytics にサイトを登録すると、Javascript のコードが生成されるので、それをWebサービスに貼り付けるだけで完了ですが、こちらのGemを使うと、Google Analytics で生成されるID番号のみを登録するだけで自動的に挿入されるようになります。
まだONALIFE(オナライフ)は発展途上のサービスです。
機能を拡張していくうえで、先人たちのありがたいGemをどんどんこれからも活用していければ、と思っています。
みなさんもこれは便利!というお勧めのGemがあれば是非教えて頂ければと思います。
以上、ONALIFE(オナライフ)で利用しているGem一覧の紹介でした。
http://anond.hatelabo.jp/20101206224349
http://anond.hatelabo.jp/20101203150748
http://anond.hatelabo.jp/20120914214121
If users want to prolongbattery the efficient use ofthe time, in addition to the quality of the charger to have the guarantee, the right skills and charging is essential, because oflow quality charger or wrong charging methods would affectbatterytime andlife cycle, the following is about to charge skills:
1. Thebattery before they leavethe factory,manufacturers were activatedprocessing, and the charge, so thebattery aremore electricity, myfriends saybattery charging adjustment period in accordance withthe time, standbystill seriously insufficient,assuming that thebattery is really quality goodsbattery of words, this kind of circumstance shouldextend the setting and then 3 ~ 5times fully charge and discharge.
2. If new phone islithiumionbattery, so before 3 ~ 5times charging commonly knownas adjustment period, should be chargedmore than 14 hours, in order to ensure that the fully activatelithiumion activity. Thelithiumionbattery no memory effects, but have very strong suisex, should give full activatedPANASONIC CGR-D220 Battery, to guarantee the use of after canreach the right performance.
3. Some automation intelligent quick charger when instructionslightschange, saidonly full of 90%. The chargerwill automaticallychange with slow chargewill batteries. Bestwill use after batteries,otherwise,itwill shorten usetime.
4. Before charging and discharginglithiumbatterydoes notneed special, butwill not dischargedamage to thebattery.As faras possible when chargingat the slow ChongChongDian, reduce the way quick charge;Timedon'tmore than24 hours. Thebattery after three tofivetimes fully recharge cycles of internal after chemicalwill beall "activate" to achieve the best use effect.
5. Please usethe original or the reputation of the good brand charger, li-ionbattery tolithiumbattery charger with special, and follow the instructions,otherwise,itwilldamage to thebattery, and even dangerous.
6. Havemany users often in chargestill leave hercell phone, actually suchwill be very easy toPANASONIC CGA-S101E/1B Batterydamage the servicelife of the mobile phone, because in charge of the process, the circuit boards of mobile phone can calorific, if thistimemore exotic phone,may produce instant backflow current, internal parts to mobile phonedamage.
7. Thebatterylife dependson thenumber repeatedly charging and discharging, so shouldtry to avoidmorebattery electric charge when, thiswill shortenbatterylife.Cell phonetimemore than 7days, supposed to completely dischargethe cell phonebattery, enough electricity before use.
8.The cell phonebattery have self-discharge,need not when thenimh batterieswill press the residual capacity every day, about 1% of the discharge,lithiumbattery every day to 0.2% ~ 0.3% discharge. In for thebattery,try to use the special socket,don'twill thehome appliance suchas the Shared and theTV charger socket.
9. Though thephones inthe network coveragearea, but inthe cell phone charge,cellphones have been unable toaccept and call.At this time, can use of the mobile phone is not transfer function,will be transferred to the mobile phone side of fixedtelephone in order to prevent callslost, this kind of method for mobile phone is not inthe network coverage of thearea or weaksignal and temporarily unable to the applicable also.
10.Don'twill be exposed to high temperature orcoldPANASONIC DMW-BCG10E Battery,asthe dog, should not put the phoneon thecar, and thesun blazed through the; Orgetair conditioning room, inair conditioning to be blown continuously place. When charging, thebattery is alittleheat is normal, but can't letit what the high temperature "suffer". In order to avoid the happening of this kind of circumstance, had better be in chargeat room temperature, anddon't coveranythingon the mobile phone.
11. Nickel cadmium (N iCd) before thebattery must ensure that the batteries are no electricity, recharging thebattery must ensure that sufficient electricity after.
12. Ifthe cell phonebattery placed too long and not use, the bestmaintenance department tocellphones to theapplication for aliveprocessing, also can use a constantdc voltage is the voltage adjustment for 5 ~ 6 V, current 500 ~ 600mA reverseconnectbattery.Note that a touch namely release,the most repeated threetimes can, through such treatment afteranother, withthe originaladapter to "adaptation" charge.
13. Charge is notas longas possible, to no protection circuit batteries that should stop after charging, or thebatterywill withfever or overheating impact performance.
14.Lithiumionbattery must choose special charger,otherwisemay notreach the saturatedstate, affect their performance. Charging completes, should avoid to place in chargeronmore than12 hours ormore, long-termneed not when shouldmake abattery andcell phoneseparation.
1, about the trickle charge, rapid charging and stablebattery charging algorithm
According to the energy requirements of thefinalapplication, abatterymay contain up to 4lithiumion orlithium polymerbatterycore,its configuration will have a variety ofchange,at the sametime with amainstreampoweradapter: directadapter,USBinterface orcar charger. Remove thecore quantity,core configuration orpoweradapter type difference, thebatteryhas the same charge characteristics. So they charge algorithm.Lithiumion and li-ion polymerbattery best charging algorithm can divided into three phases: trickle charge, rapid charging and stable charge.
Advancedbattery charger withadditional security function normally. For example, if thecore temperature exceeds the given window, usually 0 ℃-45 ℃, charge will be suspended.
Remove some verylow-end equipment, nowon themarket/li-ion polymerlithiumionbattery solutions are integrated with theouter components or, inaccordance with the characteristics of the charging to charge, this is not just toget better effect charge, but also for safety.
LTC4097 can be used to exchangeadapter orUSBpower supply for single quarter/polymerlithiumionbattery. Figure 1 fordouble input 1.2 Alithiumbattery charger LTC4097schemes.It USES constant current/constant voltage algorithm charging, from exchangeadapterpower charge, programmable filling up to 1.2 electric current A, and withUSBpower can beas highas 1 A,at the sametime,automatic detection in each input voltage whether there. This device also provideUSB the current limit.Applications includePDA,MP3players,digital camera,lightportable medical andtest equipment andbigcolor cellular phone. The performance characteristics: no external micro controller charging termination; The inputpowerautomatic detection and choice; Through the resistance fromthe exchange of chargingadapter input can beas highas 1.2 A programming charge current; The resistance of programmableUSB charging current is up to 1 A;100% or20%USB charging currentset; The inputpower output and existing bias NTC (VNTC)pinas a120mA drive ability; NTC thermistors input (NTC)pin for temperature qualified charged; Pre-settingsbattery voltage with floating plus or minus 0.6%accuracy; Thermal regulationmaximize chargerate and free hotair LTC4097 can be used to exchangeadapter orUSBpower supply for single quarter/polymerlithiumionbattery. The use of constant current/constant voltage algorithm charging, from exchangeadapterpower charge, programmable filling up to 1.2 electric current A, and withUSBpower can beas highas 1 A,at the sametime,automatic detection in each input voltage whether there. This device also provideUSB the current limit.Applications includePDA,MP3players,digital camera,lightportable medical andtest equipment andbigcolor cellular phone.
2,lithiumion/polymerbatteryscheme
Lithiumion/polymerbattery chargescheme for differentnumber ofcore,core configuration, andpower types are different.At presentmainly have threemain chargingscheme:linear, Buck (step-down)switch and SEPIC (booster and step-down)switch.
When the input voltage inbig with the charger with sufficient clearance ofcore afteropening voltage,it islinearscheme, especially 1.0 C fast charging current than 1 Abig too much. For example,MP3players usuallyonlyonecore, capacity from 700 to 1500mAh differ, full charge voltage isopen 4.2 V.MP3 playerpower is usually theAC/DCadapter orUSBinterface, the output is the rule of 5 V;At this time, thelinearscheme isthe most simple, most charger of the efficiency of thescheme. Figure 2 shows forlithiumion/polymerbattery solutionlinearscheme,basicstructure andlinear voltageneat device.
MAX8677A isdouble inputUSB/ACadapterlinear charger, built-inSmartPower Selector, used for rechargeable single quarterby Li + batteriesportable devices. The charger integration of thebattery andthe externalpower source and loadswitch chargingall thepowerswitch, so that no externalMOSFET.MAX8677A ideal used inportable devices, suchassmartphones,PDA,portable mediaplayers,GPS navigation equipment,digital camera, anddigital cameras.
MAX8677A can work in independentUSB and thepower inputACadapter ortwo input eitherone of the input. Whenconnecting externalpower supply, intelligentpower source selectorallows the system notconnectbattery or can and depth dischargebatteryconnection. Intelligentpower source selector willautomaticallyswitch to thebattery system load, use the system did not use the inputpower supply parts forbattery,make full use of limitedUSBand adapterpower supply input.All theneeded electric current detection circuit, including the integration of thepowerswitch,all integration in the piece.DC input current highest limit can be adjusted to 2 A andDC andUSB inputall can support100mA, 500mA, andUSB hung mode. Charge current can be adjusted toas highas 1.5 A, thus support wide range ofbattery capacitive. Other features includeMAX8677A thermal regulation,over-voltage protection, charging status and fault output,power supply good surveillance,battery thermistors surveillance, and chargingtimer.MAX8677A using save a space, hot enhanced, 4mm x 4mm,24 of thepins TQFN encapsulation, regulations, work in exceptional temperature range (40 ~ + 85 ℃).
2.2 Buck (step-down)switchscheme
When A 1.0 C of the charging currentmore than 1 A, or the input voltage of thecore than withhigh voltageopenmany, Buck or step-down plan is A better choice. For example, basedon the hard drive in thePMP, often use singlecorelithiumionbattery, the full ofopen is 4.2 V voltage, capacity from1200 to2400mAh range. And nowPMP is usually use thecar kit to charge,its output voltage in a 9 V to 16 between V. In the input voltage andbattery voltage is the voltage difference between high (minimum 4.8 V) willmakelinearschemelowers efficiency. This kind oflow efficiency, plusmore than 1.2 A 1 C fast charging electric current, have seriousheat dissipation problems. To avoid this kind of situation, will the Buckscheme. Figure 3 forlithiumion/polymerbattery chargerscheme Buck diagram,basicstructure with Buck (step-down)switching voltage regulators completely the same.
2.3 SEPIC (booster and step-down)switchscheme
In some use of three or fourlithiumion/polymercore series equipments, charger of the input voltage is notalways greater than thebattery voltage. For example, laptop computers use 3corelithiumionbattery, full charge voltage isopen12.6 V (4.2 Vx3), capacity is 1800mAh to 3600mAh from.Power supply input or output voltage is 1 6 VAC/DCadapter, or iscar kit, the output voltage in a 9 V to 16 between V. Apparently, thelinear and Buck solutions are not for thisgroup of batteries. This is about to use SEPICscheme,it can in the output voltage is higher than when thebattery voltage, can be in the output voltage less than when thebattery.
3, andpower detection algorithm is proposed
Manyportable products use voltage measurements to estimate the remainingbatterypower, but thebattery voltage and surpluspower relationship but will with the dischargerate, temperature andbattery aging degree ofchange,make this kind of method cantop 50%margin of error. Themarket for longer to use product demand unceasingly strengthens, so the system design personnelneedmoreaccurate solution. Use capacity check plan come to measurebattery or consumption of electricity, will be in a wide range ofapplicationpower to providemoreaccurate estimate of thebatterypower.
3.1power detection algorithm isone ofthe examples ofapplication, function complete list,double thebatteryportablebatteryapplication design
Thebattery circuit description. Figure 4 (a) can be used for identification ofIC functions with typicalapplication circuit batteries.According to the use ofICtesting program is different, thebatteryneeds to haveat least three to four outside the terminal.
VCC and BATpins will even to thebattery voltage, so that for, Cpower and thebattery voltage measurement. Thebattery isconnected a grounding resistance smaller detection resistors, let capacity check meter high impedance SRP and SRN input can monitor sensor resistanceon bothends of the voltage. Throughtesting the currentflows through a resistor can be used to judge thebattery or release the amount of electricity. Designers choose detection resistance value must be considered when resistanceon bothends of the voltage can'tmore than100mV,low resistancemay bemore hours in current errors. Circuit board layout must ensure that SRP and SRN totesting fromas closeas possible to theconnection of the resistor sensor resistance end; In other words, they should be the Kelvinattachment.
HDQpinneed external and resistors, this resistance should be located the host or themainapplication, such capacity check plan to thebattery andportable devices when sleep functionenableconnection broken. Advice and resistance choose10 k Ω.
Once thebattery through the appraisal, bq26150 will issuecommands to ensure that the host and quantitytest plan ofmaterial lines between normal communication. When thebatteryconnection interruption or toconnect,the whole the identification process will be repeatedagain.
Host to be able to read capacity check plan of variable voltage measurementbattery, tomake sure the end of discharging threshold and charging terminate threshold.As for the remainingstatepower (RemainingStateofCapacity), do notneed to read can use directly.
The above bq2650x and bq27x00etc capacity check plan provides thebatterymanufacturer a simple to use options, thisscheme L [just measuringbattery voltage to be precise, so these capacity check plan can be applied to variousbatteryframework, and can support thebattery identification anddouble thebatteryapplication '
3.2power detection algorithm is an example ofapplicationsanother, can apply toall kinds of general voltmeter newIC.
Today'smanymanufacturers can provide a variety of voltmeterIC,, theuser can choose the suitable function device, to optimize the product price. Use voltmeter measurement of storagebattery parameters, the separate architectureallowsusers in the host custompower measurement algorithm within. Eliminating embedded processorbattery cost.On this to Dallase semicconductor company called cases of DS2762chip for typical analysis. A new separate voltmeterIC,itsstructure see chart 5 (a) below.
DS2762 is a single quarter oflithiumbattery voltmeter and protection circuit, integrated into a tiny 2.46mm x 2.74mm inversion of packaging. Due to internal integration forpower detection of high precise resistance, this device is very save a space.It is the small size and incomparable highlevel of integration, for mobile phonebattery and other similar handheld products, suchasPDA,etc, areall very ideal. Integrated protection circuit continuously monitoring thebattery voltage,over voltage andflow fault (charging or discharge period). Different from the independent protectionIC, DS2762allowmain processor surveillance/control protection FET conductionstate, such, can DS2762 through the protection of thepower system and the control circuit implementation. DS2762 can also charge abattery consumptionhas depth, when thebattery voltage within three V, provide a limit of the charging current recovery path.
DS2762accurate monitoringbattery current, voltage and temperature, the dynamic range andresolution ofcommon satisfy any mobile communication producttesting standards. The measurement of current for internally generated when the integral,realize thepower measurement. Through the real-time, continuousautomatic disorders correct, the precision ofpower measurement can be increased. The built-in measuring resistance due to eliminatemanufacturing process and temperature and cause resistancechange, further improve the precision of the voltmeter. Important data stored in 32bytes, canadd the lock EEPROM; 16bytes ofSRAM are used to keep dynamic data. And DS2762all communicationall through the 1-Wire,more communicationinterface node, minimize thebattery and theconnection to the host.Itsmain features for; Single quarter oflithiumbattery protector; High precision current (power measurement), voltage and temperature measurement; Optional integrated 25 m Ω measuring resistance, each DS2762 after fine-tuning alone; 0 Vbattery restore charge; 32bytes can lock EEPROM, 16bytesSRAM, 64 aROM;
1-Wire, node,digital communicationinterface; Supportmorebatterypower management, and through the protection system control FETpower; Dormancy modepower supply currentonly 2 µ A (most); Work modepower supply current for 90 µ A (most); 2.46mm x 2.74mm inversion of packaging or 16 feet SSOP packageled, and both are can choose with or without detection resistance; Afterhas with e
結構苦労したので健忘録として。。
環境は以下のとおり
yum installmysql-server
/etc/init.d/mysqld start
mysql_secure_installation
jruby -Sgem installrailsjruby -Sgem installwarblerjruby -Sgem installactiverecord-jdbc-adapterjruby -Sgem installactiverecord-jdbcmysql-adapterjruby -Sgem installjdbc-mysql
mysql -uroot -pmysql> create databaseredmine characterset utf8;mysql> grantall privilegesonredmine.* to 'redmine'@'localhost' identified by 'redmine';mysql>exit
(任意の場所にRedmineを解凍して、解凍先のディレクトリに移動した後)
cpconfig/database.yml.exampleconfig/database.ymlviconfig/database.yml
database.yml
production:adapter:jdbcmysql database:redmine host:localhost username:redminepassword:redmine encoding: utf8#development:###test:##
後のwarbleでのエラーを防ぐため、developmentとtestをコメントアウト
jruby -Srake generate_session_storejruby -Srakedb:migrateRAILS_ENV=productionjruby -Srake load_default_dataRAILS_ENV=production
script/serverで起動し、http://localhost:3000 にアクセスして正常に動作するか確認する
jrubyscript/server -e production
viconfig/environments/production.rbconfig.logger = Logger.new(config.log_path)config.logger.level = Logger::INFO
warble.rbを生成
jruby -Swarbleconfig
warble.rbを修正
viconfig/warble.rbconfig.dirs = %w(appconfiglib log vendor tmp extra files lang)config.gems = ["jdbc-mysql", "activerecord-jdbcmysql-adapter", "activerecord-jdbc-adapter"]config.gems["rails"] = "2.3.5"config.gems["rack"] = "1.0.1"config.webxml.rails.env = "production"
jruby -Swarble
できたwarファイルをTomcatに配置して、Tomcatを起動する
mvredmine-0.9.3.war /usr/local/tomcat/webapps/redmine.war/usr/local/tomcat/bin/startup.sh
warblerのバグ(?)でwarに入らないファイルをコピーして入れる
cp vendor/gems/rubytree-0.5.2/.specification /usr/local/tomcat/webapps/redmine/WEB-INF/vendor/gems/rubytree-0.5.2
VMware Tools入れただけで何とかなると思ったら全然だめなんだもの。
Googleで引っかからなかったのは検索方法が悪かったのか…?
どうにか解明したので日本語化しとく
ネットワークに繋がらない場合は以下の方法をおためしあれ。
1.ゲストOS(=NT4.0)上でネットワークアダプタを全部削除
3.VMware上でゲストOSのハードウェア設定からネットワークアダプタを全部削除
6.VMware上でゲストOSのハードウェア設定にネットワークアダプタを追加
8.ゲストOS上でネットワークアダプタ[AMD PCNET FamilyEthernetAdapter]をNTのCD(i386の中)から入れる
これで使えるはずー