Movatterモバイル変換


[0]ホーム

URL:


はてラボはてな匿名ダイアリー
ようこそ ゲスト さんログインユーザー登録

「adapter」を含む日記RSS

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

2025-01-29

VS2022のAIによる置き換えすごいな。

メソッドパラメーターを追加したいが、Adapterパターンで逃げるのも好ましくないケースでの作業がやりやすくなってる。

Permalink |記事への反応(0) | 10:59

このエントリーをはてなブックマークに追加ツイートシェア

2023-01-28

蛇口ホースを取り付けるのに四苦八苦した

家のユニットバスの床が汚い。

水でざっと流そうと思ったがシャワーは固定のやつなので、代わりに洗面台の蛇口ホースを取り付けてザーッと流そうと思った。

早速ダイソーホースを買ってきたが、蛇口デカすぎてハマらない。

調べてみると蛇口の口の部分を外してアタッチメントを付ける事でホース接続できるらしい。

早速ホームセンターに行く。

 

蛇口はメスネジで、その口径は15cmとして統一規格があるらしい。家から持ってきた蛇口の蓋がホームセンターで売られてる蛇口にハマる事を確認。その蛇口実験台にする事とした。

 

とりあえずホースをしっかり掴むHose ConnectorとTapAdapterというのがセットで売られてたのでカゴに入れる。

名前から言ってTapAdapterだけで接続できそうな感じがするが、蛇口と同じくメスネジだし、口径も大きいのでさらにもう一つ、メスネジ同士を接続しかも双方の口径が違うアタッチメント必要なようだ。

ホームセンターの水回りコーナーを探してみると、そのものズバリのもの発見。Reducing Nippleというらしい。Nippleって乳首以外にも使うんだと感心した。

15x20cmのReducing Nippleを試す。

TapAdapter側 (20cm) とはうまく接続できた。

しか蛇口側 (15cm) とはうまく接続出来ない。

口径は合ってるが、ネジ山の間隔がもっと短くないといけないのだ。

しかしそんな短いものはNippleコーナーにはなかった。

諦めかけたその時、AeratorAdapter Kitというもの発見

コレは蛇口とも接続出来るし、前述のTapAdapter も付いている。万々である。これとHose Connectorを単品で買い帰宅

当然成功しかし達成感はハンパなかった。

 

その後すぐに、別に洗面器に水溜めてもザッと流せるよねと気付いたが、まぁ良い。俺は俺のやりたい事をやり遂げたんだ。

Permalink |記事への反応(0) | 19:26

このエントリーをはてなブックマークに追加ツイートシェア

2022-07-03

anond:20220703004534

そういう記事主題って「Adapterパターンの使い方解説」でしょ

テストユニットテストを書いて自動実行できるようにしよう。だから既存クラス修正しよう。でFAだよね?

これは「新クラス作成時に既存クラスを流用したいがテスト工数は増やしたくない」ってテーマに対する回答でしょ

なんか間違った解説記事から間違った回答を導き出してて全然NGって感じです

Permalink |記事への反応(0) | 00:49

このエントリーをはてなブックマークに追加ツイートシェア

adaptorパターンの使いどころがヤバい

既存クラスを変更するとそのクラスを利用している箇所すべてで修正必要になるからadapterごまかす!みたいな紹介を多々見かけた。既存クラステストもやり直さなくて済むし!とか。

ヤバない?

テストユニットテストを書いて自動実行できるようにしよう。だから既存クラス修正しよう。でFAだよね?

Permalink |記事への反応(1) | 00:45

このエントリーをはてなブックマークに追加ツイートシェア

2022-03-11

anond:20220311102012

クラス名やメソッド名が長いのは問題にならないけど

コールバックを渡すのにわざわざAdapter継承したクラスを作ってインスタンス化して設定、とかありえん面倒臭さだった

Permalink |記事への反応(0) | 10:52

このエントリーをはてなブックマークに追加ツイートシェア

2020-03-30

オーバードーズ自分意識を消す魔術

なにか自分に都合が悪いこと、直面するのがとても恐ろしいことが起こった時。私たちはそれに対峙するか、逃げるという選択肢を採ることができる。

たとえば自分不祥事当事者になった時に、周囲からの追及を逃れようとして、雲隠れしてしまうことも逃避の一種だ。

だが、どこにも逃げ場がなくなった時にはどうすればよいか

自分自身を消せばいい。

より正確に言えば、自分自身の意識を消せばいいのだ。

河井案里参院議員救急搬送 薬を多量に服用

https://mainichi.jp/articles/20200330/k00/00m/040/093000c

自分自身の力で世界を変えることができないのなら、怖れの苦しみを逃れる手っ取り早い方法は、それを感じる意識を消すことだ。

どこにも逃げ場がなくなって、服毒自殺を図ったり、睡眠薬等のオーバードーズを起こすということは、自分自身の情動をやりくりするための戦略だ。それは魔術じみた子供だましに周囲からは見えるかもしれないが、本人にしてみれば、立派な戦略なのだ

そんなことを言ってた哲学者がいなかったけか。サルトルだったと思うんだが。

誤訳してたらスマ

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

Permalink |記事への反応(0) | 23:29

このエントリーをはてなブックマークに追加ツイートシェア

2018-08-14

adapterとadopterは別の意味を持つ単語

前者は広くアダプターと呼ばれてるんだから

後者をアドプターとするのはしごく当然ではないのか

Permalink |記事への反応(0) | 10:14

このエントリーをはてなブックマークに追加ツイートシェア

2013-08-26

初めてのRailsサイト作った人が使ったGemリスト一覧

ども。

以前、はてな匿名ダイアリー日記を書いた者です。

【Ruby on Rails勉強】 xvideosまとめサイトっておいしいの?

上の記事でも書いていますが、Railsはおろか、Rubyを初めて触った人間ゼロからWebサービスリリースするために利用しているGemを公開したいと思います

作ったサービス

サイトonalife(オナライフ)
URLhttp://www.onalife.com
説明xvideos動画の共有・ユーザー参加型のまとめサイト

使っているGem

sqlite3

developmentモードで起動する際のデータベースsqlite3を使うようにしています

コーディングサーバー起動→動作確認→コーディング…という流れになりますが、サーバーを起動する際に、

$rails s

と実行するだけでサーバーが起動できるため大変手軽です。

サーバー起動後はブラウザhttp://localhost:3000/アクセスすれば開発用のサイトを確認できます

mysql2

productionモード(本番環境)で利用するのはMySQLを使うようにしています

理由は他のWebサイトで推奨されていたため。

sqlite場合だと、単純にDBデータファイルとして扱っており、同時に複数アクセスがあった際、最初アクセス中にファイルロックされてしま仕様との記事をどこかで見たため、MySQLを使うようにしています

developmentとproductionで動作を分けるには、config/database.ymlで分けることができます

development:

adapter:sqlite3

database:db/development.sqlite3

pool: 5

timeout: 5000

production:

adapter:mysql2

database: production.mysql

encoding: utf8

pool: 5

username: <yourname>

password: <password>

timeout: 5000

kaminari

pagenation系のド定番ですね。

よくWebサービスのページ下にある [1][2]・・・[X]といったリンクが表示されている、あれです。

http://memo.yomukaku.net/entries/238

https://github.com/amatsuda/kaminari

unicorn

Unicorn +Nginx +Rails で構築しています

効果の違いなどはGoogle先生質問すると大量に返答がありますのでこちらでは割愛

体感的にもかなり違います

nokogiri

スクレイピングするのに使っています

ONALIFE(オナライフ)では、xvideosの動画URL画像パスを抜き出す為に、こちらのGemを使っています

HTMLブロック単位で抜き出せるため大変重宝しました。

http://himaratsu.hatenablog.com/entry/2013/04/27/002249

http://nokogiri.org/

acts-as-taggable-on

タグ機能を簡単に実装するためのGem

これは捗る。超絶オススメ

サイトタグ機能はこちらで一瞬のうちに導入できました。

自作するとなるとかなり労力使いますから…こういったところは極力他の人が作ってくれたものを流用してもバチはあたらんでしょう。

https://github.com/mbleigh/acts-as-taggable-on

typus

管理画面を一瞬で作ってくれるGem

通常だと管理画面もrails g xxx とかやって controller 作って、view 作って…とかやらないといけませんが、こちらのGemを使うと一瞬で終わります

素晴らしい!!

サイトでは、投稿していただいたxvideosの動画が不適切な場合などに消去する必要があるため、どうしても管理者向けの画面が欲しかったのでこちらを使いました。

データベースを直接操作してdelete とかできちゃいます

http://www.func09.com/wordpress/archives/1136

google-analytics-rails

Webサイトを作る上でアクセス解析というのは必須です。

自分サイトアクセス傾向を解析して、どうすればアクセスが伸ばせるか、ということを考察するのに必要不可欠な機能です。

通常、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

http://anond.hatelabo.jp/20130120190550

じゃあの。

Permalink |記事への反応(2) | 00:46

このエントリーをはてなブックマークに追加ツイートシェア

2012-01-06

Article 14 the mobile phonewill know thebattery skills

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.

Permalink |記事への反応(0) | 18:26

このエントリーをはてなブックマークに追加ツイートシェア

2011-12-29

Portable electronic equipmentbattery technology

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.

trickle charge. For depth dischargecore to charge. Whencore voltage in less than about 2.8 V, use a constant 0.1 C of the current charging forit.

fast charging.Core voltage trickle chargemore than the threshold, improve the charging current rapid charging. Fast charging current should belower than 1.0 C.

stable voltage. Inthe fast charging process,once thecore 4.2 V voltage, stable voltage phase began. This is through the minimum charge current ortimer or of thetwo joint to interrupt charge. When the minimum current below about 0.07 C, can interrupt charge.The timer is to relyon a default totriggerthe timer interrupt.

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.

lithiumion/polymerbattery charge is an example ofapplications-double input 1.2 Alithiumbattery charger LTC4097

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.

2.1linearscheme

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.

linearscheme chargerapplication examples-double input Li + charger and intelligentpower source selectorMAX8677A

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

power detection principle. Good capacity check planat least to havebattery voltage, temperature andbattery electric current, measuring method; A micro 9 a;And aset of and the verification of the punishmentpower detection algorithm is proposed. Bq2650x and bq27x00 is full capacity check program function, with a measuring voltage and temperature of thedigital converter (ADC)and a measuring electric current and charging sensor theasp. These capacity check plan alsohas a microprocessor, is responsible for the implementation of theTexas instrumentspower detection algorithm is proposed. The algorithm can compensate thelithiumionbatterylife.low self-discharge, aging, the temperature and dischargerate, and other factors.Chip embedded microprocessoras host system processor save these calculation burden. Capacity check program can provide remainingpowerstate information, bq27x00 series products also offer surplus can RunTime (RunTime toEmpty) hostmayat anyTime to capacity check plan these information query, thenLED indicatorlight through or displays will inform theuserbattery. Capacity check meter is very easy to use, the system processorneedonly configuration12 C or HDQ communication drive can.

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 Ω.

battery identification. Alow cost WeiMao batteries aregettingmore andmore serious, these cellsmay not containOEM requirements of security protection circuit. So, genuinebatterymay contain figure 4 (a) shows the appraisal circuit. When to identify thebattery, the host to containIC (bq26150, the function is cyclic redundancy check (CRC)) issued thebattery packs aask value (challenge), theCRC will containbatteryaccording to this inquiry value and, in thebuilding of theIC inCRC polynomial calculation theCRC value.CRC is basedon the host ofcommand andICsecret in the query of the definition of theCRC polynomial completed, the host inCRC values calculated with the calculation result of wellbattery comparison to identify the appraisal success.

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.

double thebatteryapplication. Figure 4 (b) for use bq26500 supportdouble the typicalapplication oflithiumionbattery circuit. In order to supportmorebattery, and this circuit isadding a adjustable regulators. Capacity check millions of BATpin and the bottom of abattery anode linked to complete the variable voltage measurement of thebattery.

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.

DS2762application characteristics

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

Permalink |記事への反応(0) | 11:54

このエントリーをはてなブックマークに追加ツイートシェア

2010-04-22

Redmine 0.9.3をTomcat 6で実行する方法

結構苦労したので健忘録として。。

環境は以下のとおり

JDK,Tomcat,JRubyインストール済み

MySQLインストール
yum installmysql-server
MySQLの起動
/etc/init.d/mysqld start
MySQLの設定

rootパスワードなどを設定する

mysql_secure_installation
Rubyモジュールインストール

RubyGemsモジュールインストールする

jruby -Sgem installrailsjruby -Sgem installwarblerjruby -Sgem installactiverecord-jdbc-adapterjruby -Sgem installactiverecord-jdbcmysql-adapterjruby -Sgem installjdbc-mysql
MySQLRedmineデータベースを作成
mysql -uroot -pmysql> create databaseredmine characterset utf8;mysql> grantall privilegesonredmine.* to 'redmine'@'localhost' identified by 'redmine';mysql>exit

(ここでは、パスワードredmineしているが自由に)

RedmineDB設定

(任意の場所に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コメントアウト

DBへのデータ投入
jruby -Srake generate_session_storejruby -Srakedb:migrateRAILS_ENV=productionjruby -Srake load_default_dataRAILS_ENV=production
起動確認

script/serverで起動し、http://localhost:3000 にアクセスして正常に動作するか確認する

jrubyscript/server -e production
production.rbの修正

Tomcatで動かしたときにログ出力するための設定をする

viconfig/environments/production.rbconfig.logger = Logger.new(config.log_path)config.logger.level = Logger::INFO
warblerの設定

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"

warファイルを作成

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

http://localhost:8080/redmine/ にアクセスしてインストールできたか確認して完了!

Permalink |記事への反応(0) | 04:30

このエントリーをはてなブックマークに追加ツイートシェア

2008-11-14

VMware server2.0windows NT4.0がゲストOSの時に、ネットにつながらない!

今日仕事中に↑がわからなくてめっちゃ困った。

VMware Tools入れただけで何とかなると思ったら全然だめなんだもの。

Googleで引っかからなかったのは検索方法が悪かったのか…?

どうにか解明したので日本語化しとく

ネットワークに繋がらない場合は以下の方法をおためしあれ。

1.ゲストOS(=NT4.0)上でネットワークアダプタを全部削除

2.ゲストOSシャットダウン

3.VMware上でゲストOSハードウェア設定からネットワークアダプタを全部削除

4.ゲストOS起動

5.ゲストOSシャットダウン

6.VMware上でゲストOSハードウェア設定にネットワークアダプタを追加

7.ゲストOS起動

8.ゲストOS上でネットワークアダプタAMD PCNET FamilyEthernetAdapter]をNTCD(i386の中)から入れる

9.ゲストOS再起動

これで使えるはずー

Permalink |記事への反応(0) | 23:00

このエントリーをはてなブックマークに追加ツイートシェア

 
ログインユーザー登録
ようこそ ゲスト さん
Copyright (C) 2001-2025 hatena. All Rights Reserved.

[8]ページ先頭

©2009-2025 Movatter.jp