「 Class」を含む日記 RSS

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

2012-02-08

<div id="1355c9e9f2f21898dcda34c90"></div><div class="naverMatomeBPFoot01" data-na="NA:bottom">http://matome.naver.jp/odai/2132852574058151401" target="_blank" data-na="NL:undertitle">Wordpressで役に立つまとめのまとめ http://matome.naver.jp" target="_blank" data-na="NL:matome">[NAVER まとめ]</div><script type="text/javascript" charset="UTF-8" src="<a href="http://matome.naver.jp/pasteScript?id=2132852574058151401&p=1355c9e9f2f21898dcda34c90&color=01">http://matome.naver.jp/pasteScript?id=2132852574058151401&p=1355c9e9f2f21898dcda34c90&color=01"></script>

<script type="text/javascript" charset="UTF-8" src="http://matome.naver.jp/pasteScript?id=2132852574058151401&p=1355c9e9f2f21898dcda34c90&color=01"></script>

2012-02-02

The way to Take the place of a fabulous Personal computer Computer keyboard

Changing a new laptop computer keyboard will be difficult regarding someone considering that it is without a doubt defined to become tech function though really isn't. Just by subsequent a number of easy steps one could replace the actual laptop key pad comfortably.

1st step is actually to ensure that you will have powered down the vitality and taken off the particular battery. Equally you might want to unplug this from switchboard to prevent just about any hassle. An individual will be through with the software, you ought to start all the laptop computer along with remove lots of the screws behind that. Even if various mobile computer models possess different screws but it is simple to choose the anchoring screws in order to them all.

Typically, all the keyboards are generally devote a plastic material sheet which happens to be screwed throughout the equipment. For that reason right here anyone must also get rid of the screws in an effort to get rid of those plastic-type sheets. Any time one can find absolutely no plastic-type material sheets after that probably right now there may be some clamps which is often deleted readily.

An individual will be through with the actual taking away the plastic material sheets right now there may be some cosmetic outstanding on the computer keys. All of these plastic material bits has to be removed cautious and it could be completed any help in various cosmetic choose and tooth find. It is actually highly recommended will not use almost any needle which is able to really problems another aspects of machines.

At this time you might be through with just about all screws inside the back, you need to take away the screws towards the top because in some laptop or pc units often times there are anchoring screws beginning which should end up being deleted before you really replace all the computer keys. When most of anchoring screws really are eliminated, you will see the laptop computer keyboard is something related to any thin knowledge lead that is straightaway that come with the actual motherboard best in the bottoom. To eliminate any laptop correctly, feel free to use the equivalent enamel pick to enable you to raise the plastic-type connectors which you'll find storing with this knowledge lead. You will see of the fact that entirely computer keyboard can be free professionals who log in very easily lift that up.

You will have successfully carried out the most important part and it's the moment you are able to replace that classic laptop or pc computer keyboard while using unique 1. Very first thing earliest, take the popular computer hp laptop keyboard out from the plastic page and remedy a repair anywhere between that cosmetic fittings that are existing for the chief panel. You will need to ensure that your comprehensive brand new keyboard set is set. These days include the info line very carefully. You need to use similar choose anyone used formerly to try the equivalent. Be sure that the entire openings as well as clamps are straight aligned along with the mess space as a result for all those securing that screws repeatedly, it is possible to finished the software as necessary. Lastly refasten your current laptop computer keyboard within the top and also if you wish to remove any specific cosmetic articles replicate the equivalent option a person achieved it up to now.

Now restricted most of the screws from again and get that laptop's solar battery funding the area to enable you to observe regardless if your own laptop have been replaced instead systematically or even in no way. An individual will be through with tensing all the screws, start up your current laptop considering the fact that a person hear numerous beeps in the beginning then very likely you might want to eradicate all of the procedures once again. See a BIOS through important F2 or DEL button to be sure of whether or not keyboard is actually tracked down to be had and not even.

Tags:

HP DV7-2020x Keyboard

HP DV7-2022tx Keyboard

HP DV7-2040us Keyboard

HP DV7-2043cl Keyboard

HP DV7-2100 Keyboard

HP DV7-2103tx Keyboard

HP DV7-2104tx Keyboard

HP DV7-2105tx Keyboard

HP DV7-2108tx Keyboard

2012-01-28

s2jdbc-genが動かない

増田でこんなこと聞いていいのかわからないけど、誰かわかる人教えて欲しい。

seasar公式サイトにある、s2jdbcチュートリアルを試してみたんだけど、entityの生成でいきなり躓いてしまった。

$ ant -f s2jdbc-gen-build.xml gen-entity
Buildfile: /Users/hoge/dev/s2jdbc-tutorial/s2jdbc-gen-build.xml

gen-entity:
[gen-entity] Java Result: 1

BUILD FAILED
/Users/hoge/dev/s2jdbc-tutorial/s2jdbc-gen-build.xml:46: Exception in thread "main" java.lang.NoClassDefFoundError: 
Caused by: java.lang.ClassNotFoundException: 
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

動かしている環境

- Mac osx 10.7.2

- java version "1.6.0_29"

- Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)

- Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)

s2jdbc-gen-build.xml:46 っていうのが、classpathに関する記述の箇所なので、動かすのに必要なjarが読み込まれていないからなんだろうなぁ、って思ってるんだけど。

同じ現象で躓いて、うまく解決できた人がいたら、教えて欲しい。

 38   <target name="gen-entity">
 39     <gen-entity
 40       rootpackagename="${rootpackagename}"
 41       entitypackagename="${entitypackagename}"
 42       javafiledestdir="${javafiledestdir}"
 43       javafileencoding="${javafileencoding}"
 44       env="${env}"
 45       jdbcmanagername="${jdbcmanagername}"
 46       classpathref="classpath">
 47         <jvmarg value="${vmarg.encoding}"/>

2011-12-28

Summer scenery to take pictures of small skills

Undesirable cameras benefits us many 100 % satisfaction, leading to numerous spectacular images, as well as the hot months is operating relating to dependable summertime. This specific classmate through break free will be able to figure out any tons in addition to waterways, downtown along with far-away beautiful gardening, and yet may these pure attractiveness to become a memento playing hit decrease, apart from skin color boil due to the high-end digicam purpose, a great deal more simple could be to evaluation whatever taking pictures competency as well as having photos. The amount, smaller try to make your work latest many of the summer season harvesting powerful see to it, typically the classmate need to next image have a go through, you become this confidently unexpected wonder.

Digital cameras would bring us lots of enjoyment, leaving a myriad of unique images, and summertime is journeying in wonderful summer season. The classmate throughout the getaway can recognize that reams together with estuaries and rivers, metropolitan and also countryside attractive panoramas, yet take place all these charm being a memento opportunity straight down, together with steam as a result of a camcorder operation, a lot more crucial is usually to examine ones own taking functionality and also taking photographs. That period, the little generate your choice have quite a few summer months firing effective be mindful, the particular classmate may as well within the next snapshot have a shot at, you will get the particular total surprising stun.

Household landscapes

By out of doors firing indoors panoramas, basic will need throughout the Windows 7, out-of-doors mild typically currently have more substantial indoors light-weight, now a couple of challenges ought to be sorted out, is the particular coverage time frame, a couple of it truly is in order to avoid a display reflective, when pics of any camera through hands-on management operate, might take number of years coverage setting up, when photographic camera goes so that you can twit style, can easily will likely be ISO level of sensitivity Surroundings bump up, this ISO 2 hundred or perhaps ISO six hundred aiming.

Inside panorama 's best golf shot employing a tripod, in any other case, wants a spot to guide, one example is in opposition to any divider and entry, and even the true reason for executing it is because very long coverage is quite effortless construct any digital camera protein shake, producing photographs regarding fluffy envision. It's best to utilize the shutter launch, or perhaps utilize to get center-weighted avoiding relocate a video camera. Notice: except if absolutely necessary, tend not to available the particular pen, stay clear of a lot more reflective.

Out-of-doors landscapes

Bring that landscape designs from the probability with the photo may well schedule some individuals or even factors, and this also may help the room inside the operation of your view photos. Get a large surfaces area photos, as an example the veranda as well as the roof top, hillside, for example. Typically inside the mid-day is without a doubt the most suitable time frame filming this landscapes. Filming, having a polarizer to adjust a illumination with the stars, produce the particular heavens develop into dreary quite a few, well known from the glowing blue stars the white kind of fog up, as a way to boost the space or room repeatedly.

Several virtually no guidebook vulnerability management of any camera together with location form, as well as the landscape designs way is completely features on the list of manner, you are able to use landscape designs way to adopt shots. Together with handbook vulnerability restrain photographic camera might opt for aperture goal option that will movie, aperture to help acquired far better pick out F8 to help you photograph or maybe F11, this photo will be extra management concentrations senses.

houses

The particular modify on the urban center is without a doubt switching, specifically together with a lot of approach large establishing intended for symbolize, and also this are at recent many portrait digital photography buffs including firing template.

Yet typical photographic camera through simply how much suitable container distortion, hence as a way to make an effort to reduce the photograph of your deformation belonging to the accumulating " up ", thus you ought to pick around substantial thoughts and opinions filming. One example is inside the steps, or perhaps some other might help the beliefs with area. If you fail to find the correct destination for a reside, you can from the again, clear of the particular lead entity to cut back a distortion. Maybe you've employed the greatest wide-angle standard zoom lens. Vivid stars will be able to replace with a developing with the darkish. Having a polarizer to cut back or perhaps wipe out construction with reflective a glass. In addition to, certainly, consume an excellent know with the can make one of a kind imaginative results.

mineral water

Firing apply or maybe a aerosol in waters, incorporate the use of part mild and also backlight try to make waters intended for introducing see through pattern. Several novices all of coveted by a really "splash with photos, in truth, I am able to effortlessly applied for, so the hurrying h2o glance alot more downy, have got a form of passionate blur. Shutter possibly inside 1/10 so that you can 1/6 erinarians regulate might get move cosmetic perception for splash pics.

At night and also night time

Local plumber to be able to sunset taking scenario regarding is usually 15-30 moments, next the stars always possess some colouring failed to ends. As a way to raise the graphic with the amount with subject, can easily on the ending with the passage and also uncover several regarding an individual's special world. It is as well the location where the tripod on has to be, commonly programmed coverage is definitely o . k ., yet you should attempt to utilize hands-on visibility, and also the employment of the particular shutter put out restrain taking, respectively for 2, 5, 8, 12 and also of sixteen secs shutter tempo so that you can capture some photo contrast.

Needless to say now and again continue to are able to use ISO200 to help you photograph, yet so that you can be aware of an electronic camcorder with disturbance handle is normally adequate, when pixels will be overweight, or maybe together with ISO100 contrasting by using base style to help motion picture.

In truth firing night time scenarios, at times to be able to as well do not require that filming with step-by-step developing oh, this streets these kinds of, a small amount convert tips plus aiming design and style, might get the result of experiencing a specialized pattern.



_____________________________________________

http://www.gobatteryonline.com/canon-powershot-sd850-is-battery-charger-gose.html

http://www.chargerbatteryshop.co.uk/panasonic-lumix-dmc-tz7-battery-charger-cbbs.html

2011-12-17

CStaticコントロールにCBitmapを表示する方法

//ダイアログクラスにメンバ変数定義
std::auto_ptr<CBitmap> m_pbmp;

//bitmapを設定するメンバ関数
void C*****Dlg::Set*****Bitmap() {
	CDC* pDC = GetDC();
	CDC memdc;
	memdc.CreateCompatibleDC(pDC);
	m_pbmp.reset(new CBitmap());
	CBitmap& bmp = *m_pbmp;
	bmp.CreateCompatibleBitmap(pDC, width, height);
	
	CBitmap* old = memdc.SelectObject(&bmp);
	memdc.FillSolidRect(0,0,width,height, color);
	memdc.SelectObject(old);
	((CStatic*)GetDlgItem(IDC_STAIC_*********))->SetBitmap(bmp);
}

スクリーンと同じデバイスコンテキストビットマップ作成し単色で描画している。描画し終わった後のSelectObjectを忘れてはいけない。

CStatic::SetBitmapに渡した後も実際に描画されるまでCBitmapの寿命保証しなければならない。

そのためメンバ変数にCBitmapを持たせるがCBitmapが再利用を考慮していないという驚くべき仕様なので仕方なくauto_ptrでラップしている。

いい加減MFC滅びてくれないかな。抽象度が低すぎる。こんな記事自分ブログに書きたくないよ。

さらにVisualStudio 2005のauto_ptrのバグを見つけた operator = にポインタを渡すとおかしくなる。これは本来コンパイルエラーになるべきで代わりにresetメンバ関数を使用するべきだ。

修正するには<memory>ヘッダのauto_ptr_refのコンストラクタひとつ上の行(642行目)に private: template<class T> friend class auto_ptr; を挿入する。

これならばアクセス制御をしているだけなので他のコードへの影響は無いと思う。

2011-12-15

Critical Thinking: Film Critics Across the Country Name Their Top Movies and Actors

"The Artist"? "The Descendants"? "Hugo"? There was no critical consensus following a day of intense voting yesterday when a gaggle of critics groups voted their top honors. These included the Los Angeles Film Critics Association (LAFCA), the Boston Society of Film Critics (BSFC), and the New York Film Critics Online (NYFCO), as well as critics in San Francisco, Detroit and Indiana. The American Film Institute also announced its annual top 10, typically taking no risks.

Best Picture: "The Descendants" got a strong push with a win at the LAFCA, but "The Artist" took the top prize at the BSFC and the NYFCO. Both titles will make the final Academy shortlist. Fortified by nominations for their respective directors Martin Scorsese and Terrence Malick, "Hugo" and "The Tree of Life" should get nominations. The critics groups didn't get "The Help," any more than "The Blind Side," but the Civic Rights-era drama did make the American Film Institute top ten this year, so don't discount it yet.

Best Actor: Michael Fassbender is coming up fast with an LAFCA win. Why should we care about that group in particular? They're on a six-year roll predicting the Oscar winner for Best Actor. Brad Pitt's also a contender for "Moneyball," getting an art-house bump from "The Tree of Life," with Gary Oldman coming up on the outside thanks to the critical and box-office success of "Tinker, Tailor, Soldier, Spy" and a nod from the San Francisco Film Critics. How about George Clooney for "The Descendants"? He's still in the race, but not at the forefront. Like going for long shots? Then bet Michael Shannon for "Take Shelter," which won NYFCO. And if there's a sweep for "The Artist," add in Jean Dujardin.

Best Actress: Michelle Williams of "My Week With Marilyn," solidifies her spot with a win at the Boston Film Critics Association. Los Angeles went way out for Yung-Jun Hee in "Poetry" (what?) in their 'we're cool and uncorrupted by the Oscar race' vote. NYFCO went classic with Meryl Streep for "The Iron Lady." She's the Streep, but neither she nor Williams will be helped by an apparent lack of enthusiasm for their moves as a whole. Ditto Viola Davis ("The Help"), who will nonetheless make the top five Oscar nominees. Either SF winner Tilda Swinton ("We Need to Talk About Kevin") or multiple-runner-up Kirsten Dunst ("Melancholia") may slip in or come in sixth or seventh. Keep an eye out for Charlize Theron ("Young Adult"), Elizabeth Olsen ("Martha Marcy May Marlene") and Felicity Jones ("Like Crazy) as wild-card entries.

Best Supporting Actor: This is a two-man race between octogenarian Christopher Plummer and Albert Brooks playing against type as a cold-blooded hands-on killer. On the fringes: Patton Oswalt ("Young Adult"), Kenneth Branagh ("My Week with Marilyn") and Andy Serkis ("Rise of the Planet of the Apes").

Best Supporting Actress: Coming up on the inside is Melissa McCarthy for "Bridesmaids." Hurray for comedy! Bolstered by a best ensemble award from the LAFCA, this may push McCarthy into the five Oscar nominees. The LAFCA got behind Jessica Chastain, the NYFCO Breakthrough Performer, who was in every movie from "The Tree of Life" to "The Help," where she'll be competing against her popular co-star Octavia Spencer. The San Francisco critics supported Vanessa Redgrave for "Coriolanus," and Janet McTeer ("Albert Nobbs") was an LAFCA runner up in the category.

Who's out of the running in these five major categories? The Girl With the Dragon Tattoo, War Horse, J. Edgar and Midnight in Paris all underwhelmed. The X-Factor remains Scott Rudin's buzzy "Extremely Loud and Incredibly Close," which has not been screened widely after the New Yorker's David Denby flagrantly broke embargo on Rudin's other major film, "The Girl with the Dragon Tattoo." Pack the Kleenex box for this one.

http://www.chargerbatteryshop.co.uk/panasonic-cga-s002-digital-camera-battery-cbbs.html

http://www.gobatteryonline.com/canon-powershot-sd500-battery-charger-gose.html

http://www.keyboard-store.com/asus-04gncb1kusa4-laptop-keyboard.html

Critical Thinking: Film Critics Across the Country Name Their Top Movies and Actors

"The Artist"? "The Descendants"? "Hugo"? There was no critical consensus following a day of intense voting yesterday when a gaggle of critics groups voted their top honors. These included the Los Angeles Film Critics Association (LAFCA), the Boston Society of Film Critics (BSFC), and the New York Film Critics Online (NYFCO), as well as critics in San Francisco, Detroit and Indiana. The American Film Institute also announced its annual top 10, typically taking no risks.

Best Picture: "The Descendants" got a strong push with a win at the LAFCA, but "The Artist" took the top prize at the BSFC and the NYFCO. Both titles will make the final Academy shortlist. Fortified by nominations for their respective directors Martin Scorsese and Terrence Malick, "Hugo" and "The Tree of Life" should get nominations. The critics groups didn't get "The Help," any more than "The Blind Side," but the Civic Rights-era drama did make the American Film Institute top ten this year, so don't discount it yet.

Best Actor: Michael Fassbender is coming up fast with an LAFCA win. Why should we care about that group in particular? They're on a six-year roll predicting the Oscar winner for Best Actor. Brad Pitt's also a contender for "Moneyball," getting an art-house bump from "The Tree of Life," with Gary Oldman coming up on the outside thanks to the critical and box-office success of "Tinker, Tailor, Soldier, Spy" and a nod from the San Francisco Film Critics. How about George Clooney for "The Descendants"? He's still in the race, but not at the forefront. Like going for long shots? Then bet Michael Shannon for "Take Shelter," which won NYFCO. And if there's a sweep for "The Artist," add in Jean Dujardin.

Best Actress: Michelle Williams of "My Week With Marilyn," solidifies her spot with a win at the Boston Film Critics Association. Los Angeles went way out for Yung-Jun Hee in "Poetry" (what?) in their 'we're cool and uncorrupted by the Oscar race' vote. NYFCO went classic with Meryl Streep for "The Iron Lady." She's the Streep, but neither she nor Williams will be helped by an apparent lack of enthusiasm for their moves as a whole. Ditto Viola Davis ("The Help"), who will nonetheless make the top five Oscar nominees. Either SF winner Tilda Swinton ("We Need to Talk About Kevin") or multiple-runner-up Kirsten Dunst ("Melancholia") may slip in or come in sixth or seventh. Keep an eye out for Charlize Theron ("Young Adult"), Elizabeth Olsen ("Martha Marcy May Marlene") and Felicity Jones ("Like Crazy) as wild-card entries.

Best Supporting Actor: This is a two-man race between octogenarian Christopher Plummer and Albert Brooks playing against type as a cold-blooded hands-on killer. On the fringes: Patton Oswalt ("Young Adult"), Kenneth Branagh ("My Week with Marilyn") and Andy Serkis ("Rise of the Planet of the Apes").

Best Supporting Actress: Coming up on the inside is Melissa McCarthy for "Bridesmaids." Hurray for comedy! Bolstered by a best ensemble award from the LAFCA, this may push McCarthy into the five Oscar nominees. The LAFCA got behind Jessica Chastain, the NYFCO Breakthrough Performer, who was in every movie from "The Tree of Life" to "The Help," where she'll be competing against her popular co-star Octavia Spencer. The San Francisco critics supported Vanessa Redgrave for "Coriolanus," and Janet McTeer ("Albert Nobbs") was an LAFCA runner up in the category.

Who's out of the running in these five major categories? The Girl With the Dragon Tattoo, War Horse, J. Edgar and Midnight in Paris all underwhelmed. The X-Factor remains Scott Rudin's buzzy "Extremely Loud and Incredibly Close," which has not been screened widely after the New Yorker's David Denby flagrantly broke embargo on Rudin's other major film, "The Girl with the Dragon Tattoo." Pack the Kleenex box for this one.

http://www.chargerbatteryshop.co.uk/panasonic-cga-s002-digital-camera-battery-cbbs.html

http://www.gobatteryonline.com/canon-powershot-sd500-battery-charger-gose.html

http://www.keyboard-store.com/asus-04gncb1kusa4-laptop-keyboard.html

2011-12-08

Operaが重いと思ったらvpsを疑ってみる

vpsとは"visited pages search"の略で、vpsフォルダの中に訪問したページのデータを貯めこんで全文検索できるようにしてあるらしいのだが、これが溜まるとOperaの動作が重くなるようだ。

最近Operaがページを読み込むたびに1.5秒ほどフリーズしていたのがvpsを削除することでなくなった。これでOpera出会った時の軽快さが戻ってきた。

他にもキャッシュ関連のデータはあるはずだが、自分環境ではvpsの削除でじゅうぶん速くなった。というわけでOperaユーザーで速度を重視する人はvpsフォルダの削除も考えてもいいと思う。

関連ページ

Opera、起動と終了が遅いのを改善する

http://d.hatena.ne.jp/gnarl/20090405/1238927684

FreeBSD: Opera のガリガリの原因を find - classiclog

http://artrec.homeunix.com/news/classiclog/story/1274006262_60618_0.html

2011-11-17

また罠かよ

NotesDateTime型

Dim a As New NotesDateTime '<-



COMException はハンドルされませんでした

Retrieving the COM class factory for component with CLSID {29131526-2EED-1069-BF5D-00DD011186B7} failed due to the following error: 80040154 クラスが登録されていません (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).



regsvr32 -u nlsbe.dll

regsvr32 nlsbe.dll

やってもだめだぜ。64bitOSだからか?

方法5個あって、自分選択肢が与えられて、結局5個試させられて、全部だめで(しかもその理由が、自分がちょっと変えた環境などへ見事に突いてくる)。

2011-11-08

Thunderbird から Outlook 2007 にメールを移行

やー。面倒でした。



古い情報だと Outlook Express を経由しろと書いてあるので、後継であるらしいWindows Live Mail を経由して(Windows Live Mail からエクスポートする方法で)

Outlook に移行したのだが、どういうわけか宛名が文字列として移行されてしまい、xxx@example.com というメールアドレスの移行ができなかったんです



で eml → msg もしくは pst 形式への変換ソフトを探すのですが、無料ものが見つからなくてあんまり情報もありませんでした。が、ありましたよ!お兄さん。

これなら、msg ⇔ eml の相互変換ができますです



MrMAPI.exe

http://mfcmapi.codeplex.com/



ヘルプはっときますね。

====

MAPI data collection and parsing tool. Supports property tag lookup, error translation,
   smart view processing, rule tables, ACL tables, contents tables, and MAPI<->MIME conversion.
MrMAPI currently knows:
  3916 property tags
   801 dispids
    35 types
    58 guids
   148 errors
    27 smart view parsers

Usage:
   MrMAPI -?
   MrMAPI [-Search] [-Dispids] [-Number] [-Type <type>] <property number>|<property name>
   MrMAPI -Guids
   MrMAPI -Error <error>
   MrMAPI -ParserType <type> -Input <input file> [-Binary] [-Output <output file>]
   MrMAPI -Flag <flag value> [-Dispids] [-Number] <property number>|<property name>
   MrMAPI -Rules [-Profile <profile>] [-Folder <folder>]
   MrMAPI -Acl [-Profile <profile>] [-Folder <folder>]
   MrMAPI [-Contents | -HiddenContents] [-Profile <profile>] [-Folder <folder>] [-Output <output directory>]
          [-Subject <subject>] [-MessageClass <message class>] [-MSG] [-List]
   MrMAPI -ChildFolders [-Profile <profile>] [-Folder <folder>]
   MrMAPI -XML -Input <path to input file> -Output <path to output file>
   MrMAPI -FID [fid] [-MID [mid]] [-Profile <profile>]
   MrMAPI -MAPI | -MIME -Input <path to input file> -Output <path to output file> [-CCSFFlags <conversion flags>]
          [-RFC822] [-Wrap <Decimal number of characters>] [-Encoding <Decimal number indicating encoding>]
          [-AddressBook] [-Unicode] [-Charset CodePage CharSetType CharSetApplyType]

All switches may be shortened if the intended switch is unambiguous.
For example, -T may be used instead of -Type.

   Help:
   -?   Display expanded help.

   Property Tag Lookup:
   -S   (or -Search) Perform substring search.
           With no parameters prints all known properties.
   -D   (or -Dispids) Search dispids.
   -N   (or -Number) Number is in decimal. Ignored for non-numbers.
   -T   (or -Type) Print information on specified type.
           With no parameters prints list of known types.
           When combined with -S, restrict output to given type.
   -G   (or -Guids) Display list of known guids.

   Flag Lookup:
   -Fl  (or -Flag) Look up flags for specified property.
           May be combined with -D and -N switches, but all flag values must be in hex.

   Error Parsing:
   -E   (or -Error) Map an error code to its name and vice versa.
           May be combined with -S and -N switches.

   Smart View Parsing:
   -P   (or -ParserType) Parser type (number). See list below for supported parsers.
   -B   (or -Binary) Input file is binary. Default is hex encoded text.

   Rules Table:
   -R   (or -Rules) Output rules table. Profile optional.

   ACL Table:
   -A   (or -Acl) Output ACL table. Profile optional.

   Contents Table:
   -C   (or -Contents) Output contents table. May be combined with -H. Profile optional.
   -H   (or -HiddenContents) Output associated contents table. May be combined with -C. Profile optional
   -Su  (or -Subject) Subject of messages to output.
   -Me  (or -MessageClass) Message class of messages to output.
   -Ms  (or -MSG) Output as .MSG instead of XML.
   -L   (or -List) List details to screen and do not output files.

   Child Folders:
   -Chi (or -ChildFolders) Display child folders of selected folder.

   MSG File Properties
   -X   (or -XML) Output properties of an MSG file as XML.

   MID/FID Lookup
   -Fi  (or -FID) Folder ID (FID) to search for.
           If -FID is specified without a FID, search/display all folders
   -Mid (or -MID) Message ID (MID) to search for.
           If -MID is specified without a MID, display all messages in folders specified by the FID parameter.

   MAPI <-> MIME Conversion:
   -Ma  (or -MAPI) Convert an EML file to MAPI format (MSG file).
   -Mi  (or -MIME) Convert an MSG file to MIME format (EML file).
   -I   (or -Input) Indicates the input file for conversion, either a MIME-formatted EML file or an MSG file.
   -O   (or -Output) Indicates the output file for the convertion.
   -Cc  (or -CCSFFlags) Indicates specific flags to pass to the converter.
           Available values (these may be OR'ed together):
              MIME -> MAPI:
                CCSF_SMTP:        0x02
                CCSF_INCLUDE_BCC: 0x20
                CCSF_USE_RTF:     0x80
              MAPI -> MIME:
                CCSF_NOHEADERS:        0x0004
                CCSF_USE_TNEF:         0x0010
                CCSF_8BITHEADERS:      0x0040
                CCSF_PLAIN_TEXT_ONLY:  0x1000
                CCSF_NO_MSGID:         0x4000
                CCSF_EMBEDDED_MESSAGE: 0x8000
   -Rf  (or -RFC822) (MAPI->MIME only) Indicates the EML should be generated in RFC822 format.
           If not present, RFC1521 is used instead.
   -W   (or -Wrap) (MAPI->MIME only) Indicates the maximum number of characters in each line in the
           generated EML. Default value is 74. A value of 0 indicates no wrapping.
   -En  (or -Encoding) (MAPI->MIME only) Indicates the encoding type to use. Supported values are:
              1 - Base64
              2 - UUENCODE
              3 - Quoted-Printable
              4 - 7bit (DEFAULT)
              5 - 8bit
   -Ad  (or -AddressBook) Pass MAPI Address Book into converter. Profile optional.
   -U   (or -Unicode) (MIME->MAPI only) The resulting MSG file should be unicode.
   -Ch  (or -Charset) (MIME->MAPI only) Character set - three required parameters:
           CodePage - common values (others supported)
              1252  - CP_USASCII      - Indicates the USASCII character set, Windows code page 1252
              1200  - CP_UNICODE      - Indicates the Unicode character set, Windows code page 1200
              50932 - CP_JAUTODETECT  - Indicates Japanese auto-detect (50932)
              50949 - CP_KAUTODETECT  - Indicates Korean auto-detect (50949)
              50221 - CP_ISO2022JPESC - Indicates the Internet character set ISO-2022-JP-ESC
              50222 - CP_ISO2022JPSIO - Indicates the Internet character set ISO-2022-JP-SIO
           CharSetType - supported values (see CHARSETTYPE)
              0 - CHARSET_BODY
              1 - CHARSET_HEADER
              2 - CHARSET_WEB
           CharSetApplyType - supported values (see CSETAPPLYTYPE)
              0 - CSET_APPLY_UNTAGGED
              1 - CSET_APPLY_ALL
              2 - CSET_APPLY_TAG_ALL

   Universal Options:
   -I   (or -Input) Input file.
   -O   (or -Output) Output file or directory.
   -F   (or -Folder) Folder to scan. Default is Inbox. See list below for supported folders.
           Folders may also be specified by path:
              "Top of Information Store\Calendar"
           Path may be preceeded by entry IDs for special folders using @ notation:
              "@PR_IPM_SUBTREE_ENTRYID\Calendar"
           MrMAPI's special folder constants may also be used:
              "@12\Calendar"
              "@1"
   -Pr  (or -Profile) Profile for MAPILogonEx.
   -M   (or -MoreProperties) More properties. Tries harder to get stream properties. May take longer.
   -No  (or -NoAddins) No Addins. Don't load any add-ins.
   -On  (or -Online) Online mode. Bypass cached mode.
   -V   (or -Verbose) Verbose. Turn on all debug output.

Smart View Parsers:
    1 Additional Ren Entry IDs Ex
    2 Appointment Recurrence Pattern
    3 Conversation Index
    4 Entry Id
    5 Entry List
    6 Extended Folder Flags
    7 Extended Rule Condition
    8 Flat Entry List
    9 Folder User Fields Stream
   10 Global Object Id
   11 Property
   12 Property Definition Stream
   13 Recipient Row Stream
   14 Recurrence Pattern
   15 Report Tag
   16 Restriction
   17 Rule Condition
   18 Search Folder Definition
   19 Security Descriptor
   20 SID
   21 Task Assigners
   22 Time Zone
   23 Time Zone Definition
   24 Web View Persistence Object Stream
   25 Nickname Cache
   26 Encode Entry ID
   27 Decode Entry ID

Folders:
    1 Calendar
    2 Contacts
    3 Journal
    4 Notes
    5 Tasks
    6 Reminders
    7 Drafts
    8 Sent Items
    9 Outbox
   10 Deleted Items
   11 Finder
   12 IPM_SUBTREE
   13 Inbox
   14 Local Freebusy
   15 Conflicts
   16 Sync Issues
   17 Local Failures
   18 Server Failures
   19 Junk E-mail

Examples:
   MrMAPI PR_DISPLAY_NAME

   MrMAPI 0x3001001e
   MrMAPI 3001001e
   MrMAPI 3001

   MrMAPI -n 12289

   MrMAPI -t PT_LONG
   MrMAPI -t 3102
   MrMAPI -t

   MrMAPI -s display
   MrMAPI -s display -t PT_LONG
   MrMAPI -t 102 -s display

   MrMAPI -d dispidReminderTime
   MrMAPI -d 0x8502
   MrMAPI -d -s reminder
   MrMAPI -d -n 34050

   MrMAPI -p 17 -i webview.txt -o parsed.txt

2011-10-07

ドロップアウトしたら Apple で働くことになった話

Steve Jobsのスタンフォード大でのスピーチ翻訳ありがとうございます

ドロップアウトというほどでもないかもしれないけど、人生万事塞翁が馬、というお話NHK でのインタビューで SJ 本人も言ってますが10 年先なんて未来のことはわからないです

江島健太郎さんみたいな自分語りの話になってしまうんですが、私もベーマガで育った世代で、高校の時は N88-BASIC という今は懐かしい言語を叩いていました。

そのままパソコンどっぷりな路線を走っていれば、いちプログラマとして今頃どこかの会社デスマに参加していたのかもしれませんが、大学海外旅行に目覚めた私は、リアル世界のほうがおもしろい、これ、リアルドラクエじゃん!とパソコンのことは忘れ、バイト旅行を繰り返す大学生になっていました。1 年くらいぶらぶらしたりもしました。

海外のいろんな国のいろんな人たちの生活を見ていると、日本既定路線に乗ってあくせく働くのがなんだかおかしく思えてくるんですね。だって米ドル換算のお金では日本人はるか金持ちしょうが、そんなお金はなくてもみんな楽しそうに暮らしてる。何してるんだかわからない人たちがたくさんいて、だからって暮らせないわけじゃない。もちろん、通りすがり旅人に過ぎない私には見えてないものはたくさんあっただろうし、逆に日本にいたって皆が皆、杓子定規な生活を送っているわけでもないっていうのは、後になってまた悟るわけですが。

はいえ、これと言ってやりたいこともなかったし、大学勉強ももうやめてもいいかなと思いつつ、一応理系学生だった私はそのうち研究室を選ばなければいけない時期に差し掛かりました。当時は AI と称して人工知能とか流行ってたんですが、ここで昔の血が少し騒ぎ出し、ちょっとまじめにプログラミングをやってみるかと思い、情報工学系の研究室に応募したんです面接では僕は燃えます!みたいな受け答えをし、それなりに手応えはあったかなと思っていたんですが、蓋を開けてみたら、不合格でした。燃えますといいつつ、勢いだけで中身の伴わない若造だったから落とされたかなと、振り返ってみれば思います。真面目に勉強したいという人は他にもいくらでもいたわけで。

二次の応募とかもあったんですが、似たような結果で、最終的には一番人気のない情報工学とはまったく関係ない研究室への配属が決まりました。ちょっとやさぐれましたね。ところがこの若気の至りかプチ挫折のようなものがなければ、私は Apple で働くことにならなかっただろうし、間違いなく今の会社でも働いてなかったと思います

すっかやる気をなくした私は、その研究室でもメインストリームではなく、傍流のテーマをやることになりました。その傍流の研究リードしていた院生Mac を使っている人で、そこで私も研究室の隅にあった Mac を使うことになりました。Macintosh Classic でした。メインストリームNECパソコンとか使っていたので、そっちに行っていたら、やはりデスマ参加者になっていたかもしれません。

そして研究に夢中になる代わりに Mac に夢中になりました。Mac 雑誌を読み漁ったり、片っ端からフリーウェアをインストールしたりとかしてました。自分Mac も手に入れました。トラックパッド搭載の PowerBook で、以来、私はトラックパッド派ですThinkPadトラックポイント派の人とは永遠にわかりあえないでしょう。AppleMagic Trackpad をリリースしたときは、俺の時代がきたと思いましたね。

Mac に夢中になる一方で、大学を出たら何をしたいというのもなかったんですが、就職活動はしてみて、大きくはないがそれなりにおもしろそうな仕事を取って来てる会社に、システムエンジニアとして内定をいただきました。ですが、詳細はまた別の長い話になってしまうので割愛しますが、結局内定は辞退してしまました。大学は出たもののいわゆるプータローになったのです海外ぶらぶらしすぎると、良くも悪くも開き直ってしまうんですよね。

また海外に行ったりして、帰ってきたところで、たまたま声をかけられ、小さな事務所の立ち上げから手伝うことになりました。ここで偶然か必然か、社長Mac好きな人で、事務所で使うパソコンは全部 Mac を使うことになります。私はそのセットアップやメンテナンスをやることになりました。メイン仕事海外とのやりとりで、必要に迫られてそこでなんとか英語の読み書きも覚えました。

それからまたいろいろあって、その事務所をやめ、再びプータローになったのですが、Mac 好きは大学の時からずっと継続していました。Mac情報サイトを巡回するのが日課だったのですが、失業保険も切れそうだというある日、MACお宝鑑定団Apple Japan求人の話を見かけました。受かるとは思っていなかったのですが、失業中だしダメ元で応募してみることにしてみました。

面接はもちろんスーツで行ったのですが、Apple面接担当された方々は全員 T シャツしかApple T シャツを着て現れたのが、かなり印象に残っています別に毎日 Apple T シャツを来てるわけではなく、この日はたまたまみんな Apple T シャツになってしまった、と後から聞きましたが。面接自体はそんなにうまく受け答えができなかったと思いました。でも、なぜか採用通知が来ました。

振り返ってみれば、真面目に大学勉強してたら一般企業に行ってただろうし、第一希望研究室全然行けなくて、一番人気のない研究室のさらにマイナーテーマをやることになったおかげで Mac出会えたし、内定を辞退してプータローしたり、小さな事務所で Mac の面倒は何でも見なければいけなかったお陰で、その後の Apple での仕事につながる知識や経験を手に入れることができたし、そうしたことが折り重なって Apple で働くことができたのだと思います

私みたいな人間を雇ってくれた Apple、そしてその Apple を作ってくれた SJ には本当に感謝しています。Good bye, Steve.

2011-09-17

Google Reader+Firefoxはてなブックマークを快適に使う方法

やりたいこと

以下を全てGoogle Reader上で行いたい。

  1. フィードを登録する。
  2. リスト表示で記事タイトルを眺める。
  3. 気に入った記事をクリックして全文読む。
  4. 気に入った記事へはてなスターを付ける。
  5. はてブコメントを見る。
  6. ブコメはてなスターを付ける。
  7. はてブコメントを登録する。

まず、やったこと

以下をインストール
Google Reader Full Feed Modの設定変更

タイトルクリックしたら自動的に全文を取得して表示して欲しい。以下の設定を行うと出来る。

  1. Google Reader右上のギアマーククリック→「Full Feed Mod設定」をクリック→「Auto Load」をクリック
  2. 自動的に全文表示するアイテム」を「すべて」に変更
  3. 「OK」をクリック
Google Reader plus Hatenaの改造

ブコメが表示されないので、これを直したい。

id:northappleさんが「googleリーダー内ではてなブックマークのコメントを参照したいで.. - 人力検索はてな」という質問の回答及びコメント欄でこれを直す方法を教えてくれている。よって、その通りに変更すると直る。2ヶ所置換が必要。

不満な点

  1. Google Readerからワンクリックで「はてなブックマークFirefox拡張」の「ブックマークを追加」ウィンドウを開いて欲しい。
  2. ブコメには作成年月日だけではなく、時分も表示して欲しい。
  3. 記事を開いたら自動ブコメをロードして欲しい。
  4. Google Reader上で記事へはてなスターを付けたい。
  5. Google Reader上でブコメはてなスターを付けたい。
  6. タイトルが長いとブクマ数が隠れてしまうので、それを見えるようにしたい。

改造方法

以下、Google Reader plus Hatenaの変更点です。変更するには、Firefoxの右上にある猿(Greasemonkey)のアイコンの右にある下矢印をクリック→「ユーザスクリプト管理」をクリック→「Google Reader plus Hatena」の「設定」をクリック→「このユーザスクリプト編集します」をクリックするとエディタで「Google Reader plus Hatena」のスクリプトが表示されるのでそれを編集する。

1. Google Readerからワンクリックで「はてなブックマークFirefox拡張」の「ブックマークを追加」ウィンドウを開く。

62行目

mySpan.innerHTML = '<a href="http://b.hatena.ne.jp/entry/'+url+'" onClick="window.open(this.href,\'\',\'status=yes,scrollbars=yes,directories=yes,menubar=yes,resizable=yes,toolbar=yes\'); return false;" ><img src="'+ BookmarkImageURL +'" /></a>';

を、

mySpan.innerHTML = '<a href="http://b.hatena.ne.jp/my/add.confirm?url='+url+'"><img src="'+ BookmarkImageURL +'" /></a>';

に変更。これで「○○ users」をクリックすると、目的ウィンドウが開くようになる。

2. ブコメには作成年月日だけではなく、時分も表示する。

147行目

var t = bookmark.timestamp.split(" ")[0].split("/");

を、

var t = bookmark.timestamp;

に変更。

156行目、

html += "<li><span class=\"__hatena_bookmark_anywhere_timestamp\">"+escapeHTML(t[0])+"年"+escapeHTML(t[1])+"月"+escapeHTML(t[2])+"日</span><img src=\"http://www.hatena.ne.jp/users/"+escapeHTML(bookmark.user.substring(0,2))+"/"+bookmark.user+"/profile_s.gif\" width=\"16\" height=\"16\"><a href=\"http://b.hatena.ne.jp/"+escapeHTML(bookmark.user)+"/"+escapeHTML(t.join(""))+"\" class=\"hatena_bookmark_anywhere_user\">"+escapeHTML(bookmark.user)+"</a><span class=\"hatena_bookmark_anywhere_tags\">"+tags.join(", ")+"</span>"+escapeHTML(bookmark.comment)+"</li>";

を、

html += "<li><span class=\"__hatena_bookmark_anywhere_timestamp\">"+escapeHTML(t.slice(2,-3))+"</span><img src=\"http://www.hatena.ne.jp/users/"+escapeHTML(bookmark.user.substring(0,2))+"/"+bookmark.user+"/profile_s.gif\" width=\"16\" height=\"16\"><a href=\"http://b.hatena.ne.jp/"+escapeHTML(bookmark.user)+"/"+escapeHTML(t.split(" ")[0].split("/").join(""))+"#bookmark-"+escapeHTML(json.eid)+"\" class=\"hatena_bookmark_anywhere_user\">"+escapeHTML(bookmark.user)+"</a><span class=\"hatena_bookmark_anywhere_tags\">"+tags.join(", ")+"</span>"+escapeHTML(bookmark.comment)+"</li>";

に変更。

# ブコメはてなスターを取得しやすいように、ブコメリンクブコメパーマリンクへ変更してあります

3. 記事を開いたら自動ブコメをロードする。

300行目(インデントしか無い空行)


を、


var evt = document.createEvent( "MouseEvents" );
evt.initEvent( "click", false, true );
createSpan.dispatchEvent( evt );

に変更。(「 JavaScriptの動かないコード (中級編) clickイベントを強制的に発生させたい (fireEvent/createEventの使い方) - 主に言語とシステム開発に関して」を参考にさせて頂きました。)

4-5.

出来た。けど、めちゃくちゃソースが汚いので、差分として公開するのが難しい。ごめんなさい。

# どーやるのがベストプラクティスなのか分からない・・・

6.

どなたかご教示してくださると嬉しいです _ _

書いた人

id:al001

人力検索はてなで質問しました:人力検索はてな

2011-09-15

http://anond.hatelabo.jp/20110915144054

まぁお受験(というか学歴)至上主義なのはアメリカも同じだし、いくところまでいくと思うよ。

学費は高騰して「金持ち以外は大学行く意味無いんじゃないか」という話になりつつある。

雇用問題も、雇用回復してるのはlower classだけでmiddle classは壊滅状態から全く立ち直ってない。

そり多数の貧乏人を貧乏にして少数の金持ちが全部吸い上げるようなシステムを地で行ってるわけだから当然そうなる。

日本も同じ流れになってるし、まぁ止まんないだろうなと思う。

2011-08-25

Jobsやめたった。

Jobsやめたった。びっくり。

http://www.engadget.com/2011/08/24/steve-jobs-resigns-as-ceo-of-apple/

"Steve's extraordinary vision and leadership saved Apple and guided it to its position as the world's most innovative and valuable technology company," said Art Levinson, Chairman of Genentech, on behalf of Apple's Board. "Steve has made countless contributions to Apple's success, and he has attracted and inspired Apple's immensely creative employees and world class executive team. In his new role as Chairman of the Board, Steve will continue to serve Apple with his unique insights, creativity and inspiration."

Google情報とその受け取り手の合間、インフラ仕事するならば、Jobs率いたAppleは受け取り手に寄り添うようなプロダクトを出してきたように思う。思えばあの日、Bill Gatesを背中にしながら、彼はある種の手触り、これから起きる超高度情報化社会と、そこでの自分たちの役割を確固として見据えていたのではないかIBMが消え、また今HPも去ろうという時、消費者一人一人、個人の存在生き方に視点を持ち続ける、そんな会社を残してくれたJobs感謝したい。

蛇足Twitterでこんな鋭いコメントしてた人がいた。

As grandpa used to say "the cemeteries are full of people who couldn't be replaced".

2011-08-04

独学のプログラムエロ動画検索作ってみた

【お知らせ】2011/09/07

新しいエロWEBサービス作りました

http://d.hatena.ne.jp/uniqueweb/20110906/1315285545



プログラムは全く得意じゃないけれど最近よく見かけるようになったエロ動画検索自分でも作ってみたくて頑張ってみました。

近年、インターネットの普及によりエロ動画が自宅で簡単に見れるという素晴らしい時代になりました。

自分が若い頃はインターネットなんてものはなくエロビデオが主流でドキドキしながらレンタルビデオ屋に行き、可愛い女の子レジにいない隙を見計らってお兄さんにパッケージを伏せて空箱を渡しビデオを借りたものでした。

お兄さんにビデオ空箱を渡そうとした時に可愛い子がレジに戻ってきて焦って渡すのをやめてものすごく変な動きをしながらエロビコーナーに引き返していくなんてことも多々ありましたw

僕のお気に入りといえば「白石ひとみ」や「あいだもも」といった女優でよく借りてました。エロビを借りるということがものすごく恥ずかしい時代?年頃?でカモフラージュ普通ビデオと一緒に借りるということもしていました。それはそれは大変な思いでオナニーしてたんです

しかも、ビデオデッキ自体が貴重な時代でリビングに一台しかないのが当たり前でした。

深夜家族が寝静まってからヘッドフォンビデオを抱えリビングに行き暗がりの中でヘッドフォンテレビ差し込んでビデオ再生ボタンを期待に胸をふくらませながら押したものです。いいシーンを何回も見るためにビデオを巻き戻すんですが、ビデオを巻き戻すガチャガチャンという機械音で家族が起きてこないか?とかそれはそれはドキドキしながら見てました。一仕事終えたあとヘッドフォンを外したらジャックが外れていて大音量で喘ぎ声が響き渡っていたなんてこともありました。誰も起きてこなかったのは優しさなんでしょうか?w

さて、大分前置きが長くなりましたがエロというものものすごい技術発展させるものだと思いますエロのおかげで日本ビデオは普及しエロのおかげで日本インターネットものすごく普及したと言っていいと思います自分エロを通して技術の発展に貢献し自分自身のスキルアップになれば。という高い志を持ってこのサイト制作しました。決して自らのオナニーライフの充実と性癖を充たすため作ったわけではありません・・・

※2011.08.07 利用中のサーバーに障害が発生しているようで現在サーバー接続できない状態となっています・・・

※2011.08.07 23:53 復帰した模様です

サイト名:ヌキネーター

サイト名の由来は抜きネタからきています。抜きネーター、ヌキネーターという感じです

エロサイト制作工程日記にしてみたんで良かったら読んで下さい。そしてこのサイトを使って夜いろいろと励んでくれたら嬉しいです

では制作日記を書いていきたいと思います

サーバー選び

まず前提条件としてお金ほとんどかけたくない。アダルトサイトであるということから

サーバー選びからはいりました。

月の予算は5000円以内で考えていたのでけっこう探すのが大変でした。

日本アダルトサイトを許可している所はかなり限られていてさらにやりたいことができるのは

専用サーバーVPSしかないのでそうなると専用サーバー予算オーバーなので

VPSで探すことになり検索しまくってはじめに見つけたVPSはKAGOYAのVPSだったのですがβ版で募集を締め切っていて泣く泣く諦めました。

KAGOYAはかなり評判がいいみたいなので使ってみたかった。

次に見つけたのが○○○VPS海外サーバー日本語サポートがあり転送量の制限なしディスク容量100G

月1300円程度で借りれるということで初期設定費用に5000円程度かかりましたが借りてみました。

結果、ここは最悪でした。

  • 通信が頻繁に切れる
  • 激重
  • 借りて一ヶ月もしないうちにサービス継続が困難になりそうなのでIPが変わるとかメールがくる
  • まりに通信環境が悪すぎるとメールすると環境調査に協力してくれとメールがくる
  • 時間をかけて沢山の項目を調べて返信するも全く返答がない。

まりの酷さに1ヶ月で解約。

よく調べてみたら評判がものすごく悪い某VPS再販らしいです

お金時間をドブに捨てました・・・

もう失敗したくないと思い今度は比較的有名な海外サーバーLINODE

日本語サポートはないけれど抜群のサポートです

iptablesの設定でどうしてもうまくいかなくて拙い英語メールしてみたら

10分しないうちに返信がきました!

メールに書かれているとおりにコマンド入力したらあっさり解決。

素晴らしい!はじめからLINODEにすればよかった。

担当ブライアンはなぜか分からないけどとてもフレンドリーで親切に感じましたw

サーバー設定

LINODEは複数のディストリビューションから好きなものを選択できるので

とりあえず、64bit版を選択。

サーバー設定はほんとに面倒ですね。

一番面倒だけど重要だということで

SSH

Tripwire

chkrootkit

Clam AntiVirus

iptables

Apache

SSL

その他各種監視ツールの導入をしました。

ほんとに面倒でした。

データベース

はじめはmysqlストレージエンジンgroongaを使おうと思ったのです

初めに借りた最悪なVPSOSが32bit版だったのでgroongaがのソースが見つからずなぜかと思っていたら

どこかで見つけた記事で32bit版ではgroongaの性能を発揮しきれないということで32bit版の提供をやめてしまったらしいと書いてたので

じゃあ、sennaにするかということで最悪VPSsennaインストール

その後LINODEに変更したのでOSに64bit版を選択し念願のgroongaをインストール

しかし、調べてみると

などが理由で、結局sennaに戻して2度手間に・・・

プログラムもそれに合わせてその都度書き換えたので2度手間どころか3度手間4度手間でした・・・

senna導入はrpmでさくっといけるので簡単です

依存関係で少しはまりました。

まず

# rpm -qa | grep -i mysql

mysqlインストールされてたら削除

perl-DBIが必要なのでインストール

# yum install perl-DBI

そして下記の順番でインストール

rpm -ivh mecab-0.98-tritonn.1.0.12a.x86_64.rpm

rpm -ivh mecab-ipadic-2.7.0.20070801-tritonn.1.0.12a.x86_64.rpm

rpm -ivh senna-1.1.4-tritonn.1.0.12a.x86_64.rpm

rpm -ivh MySQL-shared-5.0.87-tritonn.1.0.12a.x86_64.rpm

rpm -ivh MySQL-client-5.0.87-tritonn.1.0.12a.x86_64.rpm

rpm -ivh MySQL-server-5.0.87-tritonn.1.0.12a.x86_64.rpm

rpm -ivh MySQL-devel-5.0.87-tritonn.1.0.12a.x86_64.rpm

my.cnfの設定をして終了

で肝心の全文検索ですデータ件数が5万件程度で少ないせいなのか、あいまい検索と比べてそれほど速さを実感できなかったです・・・

でもきっとすごく速くなったはず!

ちなみに「麻美ゆま おっぱい」で検索した場合、0.01 secで結果が返ってきました。


動画データ作成

さて、動画データ作成ですがいくつかのエロサイト制作記事でもあるようにスクレイピングということをします。

スクレイピングとはWEBサイトから特定の情報だけを取得することでネット上にあるサイトクロールして必要なデータだけを拾ってデータを作るといった感じでしょうか。

スクレイピングプログラム自体は以前にTidy関数を使って為替データ10分おきに取得するような物を作ったことがあったのでそれほど時間はかからいかなと思ったのですがけっこう時間かかりました。

スクレイピングにはTidyhtmlSQL、それにPHP Simple HTML DOM Parserを使いました。

下記のサイトを参考にしました。

phpによるスクレイピング処理入門

SQL みたいな文法で HTML を抽出する PHP のライブラリ

htmlSQLよりアツい!?jQueryみたいにセレクタでHTMLをparse(解析)する「PHP Simple HTML DOM Parser」

つの中で抜群に使えるのはPHP Simple HTML DOM Parserだったんです

ループ処理させるとメモリがすごいことになって今回のようなスクレイピングに向いてないみたいで

結局、htmlSQLTidyの両方を使ってスクレイピングしました。

両方ともPHP Simple HTML DOM Parserに比べるとうまくデータの取得ができないことが多く残念な感じなんですが他に選択肢がないので・・・

使える順に並べると

PHP Simple HTML DOM Parser

htmlSQL

Tidy

といった感じかもしれません。

おおまかにデータを取得して正規表現で特定データを抜き出しました。

広告との連携

広告にはDMMアフィリエイトを利用しています

http://affiliate.dmm.com/link.html

利用可能な物はパッケージ画像、サンプル画像(縮小)と書かれていたのでそれに従い画像を利用。

注記に※ユーザーレビュー引用いただけません。とだけ書かれているのでそれ以外は引用ありと判断して説明文とタイトルなどを利用

女優データジャンルデータDVDデータ、を紐付けたデータベース作成検索ワードに応じて検索結果に関連する商品を表示させるようにしました。

現状、売り上げ0で意味があるのか分かりませんけどw

負荷対策とか転送量とかDOS攻撃対策とか

エロサイトということで多少はチューニングとか設定とかしないとまずいかもと思い色々調べて設定しました。

やったこと

KeepAlive On

MaxKeepAliveRequests 60

KeepAliveTimeout 3

<IfModule prefork.c>
StartServers       7
MinSpareServers    5
MaxSpareServers   10
ServerLimit       30
MaxClients        30
MaxRequestsPerChild  4000
</IfModule>

様子見ということで2日間で設定してみました。

query_cache_limit=1M

query_cache_min_res_unit=4k

query_cache_size=16M

query_cache_type=1

とりあえずこんなところを設定してみましたが、爆発的なアクセスがあるわけでもないので有効なのか今のところ分かりません(-_-;)

Apache Benchでテストはしてみましたけど問題はない感じですが実際にチューニングができているか分かりません。


サイトデザイン

プログラマーとして有名なゆうすけさんのサイトgoogleを参考にしました。

シンプルで使いやすいようにしようと思いこのデザインしました。

3カラム中央可変となっています

クロスブラウザIE7、firefox3、chromeで行いました。

可変ものって作ったことなかったんですがけっこう面倒なんですね。

サイト機能

ブックマーク機能とメニューの折りたたみ機能検索結果の表示方法切替を作りました

まず、ブックマーク機能ですログインなしで気に入った動画ブックマークできるようにしました。

ブックマークに追加した動画ブックマークページで確認できるようにしました。

cookie機能を利用したらいけると思い色々調べてjquery.cookie.jsを利用。

保存したクッキー情報を呼び出してphpに渡して処理し指定要素にブックマーク一覧をloadメソッドで表示させるという感じです

$(function(){
$("#youso").load("xxx.php");
});

メニューの折りたたみ機能は人気AV女優AV女優別、人気タグなどをそのまま表示させるとずらっと長くなって邪魔だったのでつけました。

これには同じくjquery.cookie.jsを利用しました。

参考サイトhttp://blog.caraldo.net/2009/03/newjqqookiemenu.php

検索結果の表示方法切替にはZoomer Galleryを利用しました。

参考URLhttp://phpjavascriptroom.com/?t=ajax&p=jquery_plugin_zoom#a_zoomergallery

検索結果ページで表示される

[ここの画像]

××× の検索結果

44件中 1~10件目を表示

ここの画像の部分をクリックするとgoogleイメージ検索みたいに一覧でイメージ表示できるようにしてみました。

動画表示ページ

基本的に動画の埋め込みを許可しているサイトのみプレイヤー表示をしそれ以外は画像を表示し動画データリンクするようにしました。

埋め込み部分はあらかじめそれぞれのサイト対応したプレーヤー部分のコード記述しVIDEOIDの部分に置き換えるような形にしました。

XVIDEOSを例にすると

XVIDEOS場合かならず動画urlhttp://www.xvideos.com/videoXXXXXX/のようになりますのでXXXXXXの部分を

VIDEOID部分に置き換えるようにプログラムを組みました、

埋め込み部のソース

>||<object width="510" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="allowScriptAccess" value="always" /><param name="movie" value="http://static.xvideos.com/swf/flv_player_site_v4.swf" /><param name="allowFullScreen" value="true" /><param name="flashvars" value="id_video=VIDEOID" /><embed src="http://static.xvideos.com/swf/flv_player_site_v4.swf" allowscriptaccess="always" width="510" height="400" menu="false" quality="high" bgcolor="#000000" allowfullscreen="true" flashvars="id_video=VIDEOID" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>
||<

その他の動画サイトURLの一部分のデータを使っているので同様の処理をしました。

まとめ

実際の作業は2、3週間ですが色々調べる時間が多くて制作に2ヶ月くらいかかりました。

自分エロ動画検索を作ってみて有名プログラマーさん達がいかに優秀なのか思い知らされました。

皆さん思いついて数日で作ってしまうのでびっくりです

全くWEBの知識がない人で4、5ヶ月ですごいの作っちゃう人とかもいるみたいですし世の中広いな~と思います

しかし、エロサイト作りで勉強になりますね~

大分、色んな知識を得ることができました。

これからプラグラム勉強しようと思う人はぜひエロサイトから入ってみて下さい。

きっと楽しいですよ!

そんなこんなで?頑張って作ってみたエロ動画検索、良かったら使ってみて下さい。

これで少しは技術の発展に役立てたでしょうか?w

アダルト動画検索ヌキネーター

P.S エロサイトを作っていてはじめは楽しくて興奮しながら作ってたのです最後の方はエロい物を見ても全く反応しなくなりましたw

  不能ではないんですけど・・・現在も性欲が著しく減退しております・・・

  そしてスーパーpre記法がうまういかないのはなぜ?はてな匿名ダイアリー投稿全然からない・・・

  そしてそしてプログラマーさんとかデザイナーさんとかエロい人とかお気軽にお声をおかけ下さい。



【お知らせ】2011/09/07

新しいエロWEBサービス作りました

http://d.hatena.ne.jp/uniqueweb/20110906/1315285545

2011-04-09

Permalink」の右にusersを出すgreasemonkey

がほしいというエントリです

<p class="sectionfooter"><a href="/(¥d{14})">Permalink</a>

<p class="sectionfooter"><a href="/$1">Permalink</a><a href="http://b.hatena.ne.jp/entry/anond.hatelabo.jp/$1"><img src="http://b.hatena.ne.jp/entry/image/http://anond.hatelabo.jp/$1"></a>

になればいいんです。どうかお願いします

2011-03-30

http://anond.hatelabo.jp/20110330125201

というわけでサンプルコード書きなおしてみた。

サンプルコード意味はないので注意な。

JAVA

public class Main {

    public static void main(String[] args) {
        int count= args.length==0?100000:Integer.parseInt(args[0]);

        long start=System.currentTimeMillis();
        Main m=new Main();

        double result=0;
        for(int i=0;i<count;i++){
            result+=m.test((double)(0.1f*i));
        }
        System.out.println(result);
        System.out.println(String.format("COMPLETE! %d msec",System.currentTimeMillis()-start));
    }

    private double product=0;
    public double test(double rad){

        return this.product+=Math.tan(rad);
    }
}

PHP

<?php
class Test{
    private $product;
    public function test($rad)
    {
        return $this->product+=tan($rad);
        
    }
}

$count =is_null($argv[1])?100000:(int)$argv[1];
$start=microtime(true);

$t=new Test();
$result=0;
for($i=0;$i<$count;$i++){
    $result+=$t->test(0.1*$i);
}
echo "{$result}\n";
printf("COMPLETE! %f msec",  (microtime(true)-$start)*1000);

結果

JAVA

$java -jar test.jar 100000
-7.524990063072938E9
COMPLETE! 31 msec

PHP

$ php -f test.php 100000
-11900078829.3
COMPLETE! 209.314108 msec

うむ。有意な差はあるっぽいな。(結果が違い過ぎてるのはなんか問題があるかもしれん)

多分、変数の型が出鱈目で計算されるようなもんだとPHPは遅くなるのだと思われ。javaは強い型制約があるから、同じ型同士の計算だと速いとか?

http://anond.hatelabo.jp/20110330114912

サンプルコード

JAVA

package test;

public class Main {

    public static void main(String[] args) {
        int count= args[0]==null?10000:Integer.parseInt(args[0]);

        long start=System.currentTimeMillis();
        Main m=new Main();
        for(int i=0;i<count;i++){
            System.out.println(m.test());
        }
        
        System.out.println(String.format("COMPLETE! %d msec",System.currentTimeMillis()-start));
    }


    public String test(){


        return "ぽぽぽぽーん";
    }
}

PHP

<?php
class Test{
    public function test(){

        return "ぽぽぽぽーん";
    }
}

$count =is_null($argv[1])?10000:(int)$argv[1];
$start=microtime(true);

$t=new Test();
for($i=0;$i<$count;$i++){
    echo $t->test()."\n";
}

printf("COMPLETE! %f msec",  (microtime(true)-$start)*1000);

結果

$ java -jar test.jar 10000

ぽぽぽ...

COMPLETE! 1008 msec

$ php -f test.php 10000

ぽぽぽ...

COMPLETE! 988.869190 msec

実行したのは全く同じ環境jdkは1.6でPHPは5.2。

どういうことなのか説明してもらおうか?

2011-03-19

ドラゴンボールで学ぶオブジェクト指向Z

これは http://anond.hatelabo.jp/20110316202255 の続編です

GTをやる前に改を書いてくれている人がいてとてもしっかりした内容なのでちゃんと勉強したい人はそっちを見てね!

d:id:ryoasai:20110317 - ドラゴンボールで学ぶオブジェクト指向 改 | 達人プログラマーを目指して

またオブジェクト指向については

d:id:m-hiyama:20080109 いまさらながらだけど、オブジェクトクラスの関係を究めてみようよ | 檜山正幸のキマイラ飼育

がとても詳しいです。合わせて読むとかなりしっかりと理解出来ると思います。

変な書籍を買うよりこちらがオススメです



はじめに(いいわけ

ホットエントリに行くとは思っておらず、皆様ありがとうございます

ドラゴンボールオブジェクト指向にする」というコンセプトではなく、「オブジェクト指向を(無理矢理)ドラゴンボールで説明する」という遊びだったので

プログラマーの方々にはツッコミを受けてしまいましたがここは遊びだと思って楽しんで下さい…。

ドラゴンボールは小さい頃から大好きでしたが流石にうるおぼえ過ぎました

専門家の方々からも厳しいツッコミを受けました



それはさておき「説明する題材を決める→好きな漫画から無理矢理当てはまりそうな例を考える」という思考実験なので、気が向いた方は色々考えてみると楽しいと思います。僕は楽しかったです

ジョジョの奇妙な冒険で学ぶオブジェクト指向

 スタンドとか波紋法とか色々面白そうです

ジャニーズで学ぶオブジェクト指向

 これは難易度が高そうです

BLで学ぶオブジェクト指向

 継承誘い受け、移譲=ヘタレ攻めだと思います。



結論

やっぱりドラゴンボールで例えると分かりやすいな!

無理がある!




ドラゴンボールで学ぶオブエジェクト思考Z ドラゴンボールで学ぶデザインパターン

デザインパターンとはドクターゲロが考えた「こうやって設計すれば色々捗るぞ」という例のことです。実際はGoFという人たちが考えたもので23個のよくあるパターン名前を付けて整理してくれたわけですね。

23個の中にはブルマさんですらわからいものが多いので(さすがドクターゲロですね)良く使う、代表的な物をいくつか紹介しま



Singletonパターン

Singleton世界に一つだけしか存在出来ないようにする方法です

balls = new DragonBalls(); //これでは誰でもドラゴンボールを作れてしまう!
balls.callShenron();

クラスの中にはいくつかのメソッドがありますが、簡単に言うと外から呼べるもの、外からでは呼べないもの

二種類があります。そうやってメソッド保護することで世界崩壊を防ぐわけですね。

基本的な戦闘力をアップさせるには本人の努力が必要になり、外から簡単に挙げられてしまうとジャンプ三本柱が外れてしまいます。

(某漫画などは努力しなくともあがったりしますが)

ただナメック星の最長老界王神などはかなり偉いので、本人の才能を引き出すことが可能した

現実には思いつきのような仕様を後から言われることが多々あります。困ります


//地球上にひとつだけ存在するドラゴンボールをつくろう
class DragonBalls{
	private DragonBalls(){
	      //ドラゴンボールを作れないように生成メソッド保護します。
	}
	static function sagasouze(){
		static singleton_dragonball;
		//ドラゴンボールを生成。
		//DragonBallsクラスの中なので、保護してある「new DragonBalls()」を呼べます。
		if(!singleton_dragonball)singleton_dragonball = new DragonBalls();
		return singleton_dragonball;
	}
}

これで界王神から怒られることもありませんね。

プログラマーは神なのでドラゴンボールを作れます




Proxyパターン

何かの処理を行うためにProxy、代理人を立てる設計です

地球のみんなは地球しか話せませんが、ナメック星にいるクリリンを通して願いを叶える必要があります

クリリンももちろん地球しか話せませんが、ナメック語を話せるデンデがいるため、地球のみんなは願いを叶えることが出来ます

class Kuririn{
     private dende = new Dende();
     
     function request( wish1, wish2, wisth3){
		this.dende.request(wish1);
		this.dende.request(wish2);
		this.dende.request(wish3);
     }
}

kuririn.request(
	"ピッコロを生き返らせてくれ",
	"ピッコロナメック星へとワープさせてくれ",
	"ナメック星にいる孫悟空フリーザ以外を全員地球へとワープさせる"
);

この場合メリットはデンデが何をやっているかクリリンプログラミングした人が知る必要が無いということです

デンデを通して願いと伝える実装だけ行えば大丈夫です

地球の人はナメック星にいるナメック星人が「デンデ」であることを知る必要もありません。

それでも願いは叶うんです

本来であればデンデやクリリンは願いが叶うのを待つ必要がありましたが、地球の人は一気に伝えることが可能なように設計しました

それでないと不便ですからね。

//デンデクラスナメック星人英語でNamekianらしいですclass Dende extends Namekian{
	function translate(word){
		namekian = *****//ナメック語に翻訳します。
		return namekian;
	}
	function request(wish){
		static polunga;
		if(!polunga){
			polunga = DragonBalls.spell("タッカラプト ポッポルンガ プリピット パロ");
		}
		polunga.ask(this.trasnlate(wish));
	}
}




Template Method

大まかなアルゴリズムだけ決めておいて、実装はサブクラスに任せる設計がTemplate Methodです

ナメック星に行く方法を考えた時いくつかの方法がありました。古い宇宙船を探してきて直して載せて…っていちいち書くより同じメソッドナメック星に行けたほうが便利ですね。

abstract class WayToNamek{
	abstract function prepareSpaceShip();
	abstract function launchSpaceShip( ship ) ; 
	function gotoSU839045YX( people ){
		ship = prepareSpaceShip( );			//船を修理しまship.load(people);					//人を載せます
		this.launchSpaceShip(ship);	//船を出発します。
	}
}

ナメック星に行く方法を定義したので「ブルマクリリン悟飯」組と「悟空」をそれぞれナメック星に連れて行きましょう。

way = new WayWithKamisamaShip();
way.gotoSU839045YX( buruma, kuririn, gohan );

way = new WayWithSaiyajinShip();
way.gotoSU839045YX( goku );

と簡単に方位SU83、距離9045YXまで乗員を連れて行くことが出来ます

つの方法を実装します。神様の船を修理して行く方法と、サイヤ人の船(悟空が乗ってきた船)で行く方法の二つです

//神様の船で行きますclass WayWithKamisamaShip extends WayToNamek{
 	function prepareSpaceShip(){
 		return new KamisamaShip(); //船を準備します。神様の船を使います。
 	}
 	function launchSpaceShip(ship){
 		ship.inputByVoice("ナメック星に出発");	//
 	}
 }
 class WayWithSaiyajinShip extends WayToNamek{
 	function prepareSpaceShip(){
 		return new SaiyajinShip();      //船を準備します。サイヤ人の船(フリーザの船?)を使います。
 	}
 	function launchSpaceShip(ship){
		//audio = new HighSpecAudio();
 		//ship.setAudio(audio);
 		ship.turnOnCenterButton();	//真ん中のボタンを押すだけ
 	}
 }

元になる船も違いますし、発射の仕方も違いますが同じ呼び出し方が出来ます

オーディオの位置が決まりませんでしたが、今回の運用では不要とのクライアントからのご意見したのでだったので

せっかく用意したオーディオ無駄になりましたが、コメントアウトしてあります




他のパターン

他にもまだまだあります。のんびり紹介していこうと思います。

ではでは。

2011-03-16

http://anond.hatelabo.jp/20110316202255

デザインパターン編を書いてたら99ブクマだと…。なんだかすみません。

あと増田で書くの初めてで記法がちとわかっていなくて見づらくて申し訳ないです。


ブクマコメントレス

>おもしろい。でもJavaJSRubyじゃ同じオブジェクト指向でもまったく違った設計と思想になるのでまとめて説明は難しいかも

言語世界として、どんな世界がいいか考えましょうという話に持って行きたかったけど難しかったですね。


ASしらないけど classが使えるJSっぽいところみるとASなんですねこ

>@shinout 面白い!けどいろいろ間違ってる!!コード動かしてみいや

それっぽい言語なので動きません。JavaとかASとかそのへんですねー。

その割に一部ちゃんと書いてるのが誤解しそうですね。


OOPを習得したPGとそうでないPGとの生産性の差がドラゴンボールで言うところの戦闘力の差という比喩でたとえるとよい。初心者PGが何人集まってもかなわないところがある。

ドラゴンボールで学ぶ開発」というタイトルで是非w



>17号と18号が逆

いません…直しました



セルはis-aはなhas-aで実装した方がいいような気がする。

セルってチートいですよね。くらった技を覚えるブウの設計と、遺伝子を持っているから技が使えるセル設計をどうするかは議論になりそうです



>なんか、むしろ分かり辛くなってると思うけど、心意気やよし!

>かりやすいんだかわかりにくいんだか

無理がありました



>連載はextendされたけど、主人公の継承には失敗したよね

素晴らしいコメント設計ミスで主役になれなかったのは運用カバー出来ましたね。



セルクラスの承継よりもオブジェクトコンポジションの方がいいのか分からない。

http://anond.hatelabo.jp/20110316215156

で突っ込まれてる内容の方がいいかもしれませんね。

でも悟空ベジータは吸収じゃなくて細胞を合成してる?とかなので17号、18号とは別にする必要があったりします。



>その他残念とかダメとか誤字とかのコメント

申し訳ありません…。

2011-03-03

ブログの問題を解いてみた

http://okajima.air-nifty.com/b/2011/01/2011-ffac.html

ぷよぷよを解く問題をやってみた

かかった時間はおおよそ1時間

途中でわからないところがあったのでくぐってしまった

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder[] blocks = {
                new StringBuilder("**GYRR"),
                new StringBuilder("RYYGYG"),
                new StringBuilder("GYGYRR"),
                new StringBuilder("RYGYRG"),
                new StringBuilder("YGYRYG"),
                new StringBuilder("GYRYRG"),
                new StringBuilder("YGYRYR"),
                new StringBuilder("YGYRYR"),
                new StringBuilder("YRRGRG"),
                new StringBuilder("RYGYGG"),
                new StringBuilder("GRYGYR"),
                new StringBuilder("GRYGYR"),
                new StringBuilder("GRYGYR")
            };

            bool updated = true;
            while (updated)
            {
            breaked:
                DumpBlock(blocks);
                for (int i = 0; i < blocks.Length; i++)
                {
                    for (int j = 0; j < blocks[i].Length; j++)
                    {
                        char c = blocks[i][j];
                        if (c == '*')
                            continue;
                        updated = false;
                        if (KillBlocks(blocks, i, j))
                        {
                            updated = true;
                            goto breaked;
                        }
                    }
                }
            }
            DumpBlock(blocks);
            Console.Read();
        }
        struct Point
        {
            public int x, y;
            public Point(int x, int y)
            {
                this.x = x;
                this.y = y;
            }
        }
        static bool KillBlocks(StringBuilder[] blocks, int x, int y)
        {
            bool[,] visted = new bool[blocks.Length,blocks[0].Length];

            MarkBlock(visted, blocks, x, y);

            Queue<Point> queque = new Queue<Point>();
            for (int i = x; i < blocks.Length; i++)
                for (int j = y; j < blocks[i].Length; j++)
                    if(visted[i,j] == true)
                        queque.Enqueue(new Point(j,i));

            if (queque.Count < 4)
                return false;

            while (queque.Count > 0)
            {
                Point p = queque.Dequeue();
                RemoveBlock(blocks, p.x, p.y);
            }
            return true;
        }
        static void MarkBlock(bool[,] visted, StringBuilder[] blocks, int x, int y)
        {
            if (x < 0 || y < 0 || x >= blocks.Length || y >= blocks[0].Length || visted[x, y] == true)
                return;
            char c = blocks[x][y];
            visted[x, y] = true;
            if (x + 1 < blocks.Length && blocks[x + 1][y] == c) MarkBlock(visted, blocks, x + 1, y);
            if (y + 1 < blocks[0].Length && blocks[x][y + 1] == c) MarkBlock(visted, blocks, x, y + 1);
            if (x > 0 && blocks[x - 1][y] == c) MarkBlock(visted, blocks, x - 1, y);
            if (y > 0 && blocks[x][y - 1] == c) MarkBlock(visted, blocks, x, y - 1);
        }
        static void DumpBlock(StringBuilder[] blocks)
        {
            foreach (StringBuilder s in blocks)
                Console.WriteLine(s);
            Console.WriteLine();
        }
        static void RemoveBlock(StringBuilder[] blocks,int x,int y)
        {
            int i;
            if (y == 0)
            {
                blocks[y][x] = '*';
                return;
            }
            for (i = y; i > 0; i--)
            {
                blocks[i][x] = blocks[i - 1][x];
            }
            blocks[i][x] = '*';
        }
    }
}

2011-01-24

Win7 64bit IE8 + Silverlight + Flashget

覚書。

OS:Windows7 64bit使用。

Internet Explorer8(64bit版ではない)にてGyaO!Yahoo!ニュースDMM等の動画サイトを閲覧するとブラウザクラッシュする。

Internet Explorer は動作を停止しました

強制終了されるページはMicrosoft Silverlightプラグインを使用したもの。


イベントビューアーでログを見てみると

障害が発生しているアプリケーション名: iexplore.exeバージョン: 8.0.7600.16700、タイムタンプ: 0x4cd23213

障害が発生しているモジュール名: getflash.dllバージョン: 1.0.0.1、タイムタンプ: 0x4506208e

例外コード: 0xc0000005

障害オフセット: 0x00008c40

障害が発生しているプロセス ID: 0x1198

障害が発生しているアプリケーションの開始時刻: 0x01cbbb667d383d68

障害が発生しているアプリケーション パス: C:\Program Files (x86)\Internet Explorer\iexplore.exe

障害が発生しているモジュール パス: C:\PROGRA~2\FlashGet\getflash.dll

FlashGet1.73をインストールしていたのだが、こいつとSilverlightの相性がわるいのか。

IEの『アドオン管理から『FlashGet Bar』と『gFlash Class』を無効したら落ちなくなった。

2011-01-11

人材獲得作戦・4 試験問題ほか

http://okajima.air-nifty.com/b/2010/01/post-abc6.html

迷路の最短経路を求める問題が出たので解いてみた

幅優先探索を使えばいいのがわかっていたのですんなりかけたのだが無限ループになる個所があったので動くようになるまで時間がかかった


using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

namespace MazeFind
{
    class Point
    {
        public int x;
        public int y;
        public Point before;
        public Point(int x, int y,Point before)
        {
            this.x = x;
            this.y = y;
            this.before = before;
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            const char BreakChar = 'B';
            const char GoalChar = 'G';
            const char WallChar = '*';
            const char BeforeChar = '.';

            StringBuilder[] maze = new StringBuilder[]{
                new StringBuilder("**************************"),
                new StringBuilder("*S* *                    *"),
                new StringBuilder("* * *  *  *************  *"),
                new StringBuilder("* *   *    ************  *"),
                new StringBuilder("*    *                   *"),
                new StringBuilder("************** ***********"),
                new StringBuilder("*                        *"),
                new StringBuilder("** ***********************"),
                new StringBuilder("*      *              G  *"),
                new StringBuilder("*  *      *********** *  *"),
                new StringBuilder("*    *        ******* *  *"),
                new StringBuilder("*       *                *"),
                new StringBuilder("**************************"),
            };
            Point start = new Point(1, 1,null);

            //最短経路を探索する
            Queue<Point> queque = new Queue<Point>();
            queque.Enqueue(start);

            while (queque.Count > 0)
            {
                Point now = queque.Dequeue();
                if (maze[now.y][now.x] == BreakChar)
                    Console.WriteLine("break");
                if (maze[now.y][now.x] == WallChar || maze[now.y][now.x] == BeforeChar)
                    continue;
                else if (maze[now.y][now.x] == GoalChar)
                {
                    Point p = now.before;
                    while (p != null)
                    {
                        maze[p.y][p.x] = '@';
                        p = p.before;
                    }
                    break;
                }

                if (maze[now.y - 1][now.x] != '#')
                {
                    queque.Enqueue(new Point(now.x, now.y - 1, now));
                    maze[now.y][now.x] = '.';
                }
                if (maze[now.y][now.x + 1] != '#')
                {
                    queque.Enqueue(new Point(now.x + 1, now.y, now));
                    maze[now.y][now.x] = '.';
                }
                if (maze[now.y + 1][now.x] != '#')
                {
                    queque.Enqueue(new Point(now.x, now.y + 1, now));
                    maze[now.y][now.x] = '.';
                }
                if (maze[now.y][now.x - 1] != '#')
                {
                    queque.Enqueue(new Point(now.x - 1, now.y, now));
                    maze[now.y][now.x] = '.';
                }
            }

            //結果を出力する
            foreach (StringBuilder s in maze)
                Console.WriteLine(s.ToString().Replace(BeforeChar,' '));

            Console.ReadLine();
        }
    }
}
<||

2010-10-12

[][][][][]

日本語

エピクテートス http://web.archive.org/web/20040408184351/http://www.maharshin.com/PDA/Hepi/epi.html

修養訓

エピクテトス 『生きる手引き』 (The Enchiridion by Epictetus)

提要[1] - エピクテトス

英文

The Internet Classics Archive | The Enchiridion by Epictetus

Kindle Book

Amazon.com: A Selection from the Discourses of Epictetus with the Encheiridion eBook: Epictetus: Kindle Store

http://www.amazon.com/dp/B000JMKZHM/

Kindle for PC登場、日本からもダウンロード可能 -- Engadget Japanese

http://japanese.engadget.com/2009/11/10/kindle-for-pc/

mp3

http://www.archive.org/download/enchiridion_librivox/enchiridion-01-epictetus_64kb.mp3

http://www.archive.org/download/enchiridion_librivox/enchiridion-01-epictetus.mp3

書籍

Amazon.co.jp: 人生談義〈上〉 (岩波文庫): エピクテートス, Epictet, 鹿野 治助: 本

Amazon.co.jp: 人生談義〈下〉 (岩波文庫): エピクテートス, Epictet, 鹿野 治助: 本

Amazon.co.jp: 世界の名著 13 キケロ/エピクテトス/マルクス・アウレリウ: キケロ, 鹿野 治助: 本

Amazon.co.jp: 世界の名著 (14) キケロ エピクテトス マルクス・アウレリウス (中公バックス): キケロ, 鹿野 治助: 本

Amazon.co.jp: 幸福論 (第1部) (岩波文庫): ヒルティ, 草間 平作: 本

提要 エピクテートス 人生談義〈下〉 エピクテートス

諸々の存在のうち
ある物はわれわれの権内にあるが
ある物はわれわれの権内にない
意見や意欲や欲望や忌避
一言でいえばおよそ
われわれの活動であるものは
われわれの権内にあるが
肉体や財産や評判や官職
一言でいえばおよそ
われわれの活動でないものは
われわれの権内にない
そして
われわれの権内にあるものは
本性上自由であり
妨げられず
邪魔されないものであるが
われわれの権内にないものは
脆い隷属的な
妨げられる
自分ものでないものである

そこで次のことを記憶しておくがいい
もし本性上隷属的なものを
自由なものと思い
自分ものでないもの自分ものと思うならば
君は邪魔され
悲しみ不安にされ
また神々や人々を非難するだろう
だがもし君のものだけを
君のものであると思い
君のものでないもの事実そうであるように
自分ものでないものと思うならば
誰も君に決して強制はしないだろう
誰も君を妨げないだろう
君は誰をも非難せず
誰をもとがめ立てしないだろう
君は何一ついやいやながら
することはなく
誰も君に害を加えず
君は敵を持たないだろう
けだし君は何も害を受けないだろうから

エピクテートス 提要 1 人生談義〈下〉 epictetus

リンク

【人間関係】他人を許すのは、他人の意のままにならないための手段なのである。

ラインホールド・ニーバーの祈り The Serenity Prayer http://anond.hatelabo.jp/20080105172324

[ゲシュタルトの祈り][Gestalt Prayer]

私は私のことをします。ですから、あなたはあなたのことをして下さい。

浴場での出来事、つまり湯をはねかける者、押す者、罵る者、盗む者

あなたを怒らすことができる人は誰でもあなたの主人となる。エピクテートス

[悪口][陰口][告げ口][お世辞][心にもない言葉]ねたみ・批判にあった時

[ロバ売りの親子][粉屋と息子とロバ]粉挽きとその息子と驢馬

自分と未来は変えられる。他人と過去は変えられない。

「すべては主観である。」モニモス

[人間関係は腹六分]

人間は一生、他人の心などわかるはずもない。MASTERキートン

2010-07-24

google発のProtocol Buffersについて

オブジェクトシリアライズツールであるプロトコルバッファについて書きます。

プロトコルバッファって何って方はこちらへ

Protocol Buffers 本家

http://code.google.com/apis/protocolbuffers/

XMLはもう不要!? Googleシリアライズツール「Protocol Buffer」

http://journal.mycom.co.jp/articles/2008/07/18/protocolbuffer/index.html

Protocol Buffers (Protocol Buffers の内部解説記事。とても参考になります)

http://dodgson.org/omo/t/?date=20080712

内容

プロトコルバッファは異種言語間でオブジェクトのやりとりをするための規格です。

独自の言語によりオブジェクトインターフェースを規定することで、多言語対応を行っています。

例えばこんな感じ。

  • address.proto
package tutorial;

message Person {
  required string name = 1;
  required int32 id = 2;        // Unique ID number for this person.
  optional string email = 3;

  enum PhoneType {
    MOBILE = 0;
    HOME = 1;
    WORK = 2;
  }

  message PhoneNumber {
    required string number = 1;
    optional PhoneType type = 2 [default = HOME];
  }

  repeated PhoneNumber phone = 4;
}

// Our address book file is just one of these.
message AddressBook {
  repeated Person person = 1;
}

以上のようなprotoファイルから各言語ソースコード、または何らかのデータ操作ライブラリを使いオブジェクトの処理を行います。

googleによってC++, Java, Python用のライブラリ作成されましたが、他の言語対応したサードパーティー製のライブラリがいくらでもあるので、実質的にほぼすべての言語で使えると言っても過言ではありません。

以下はこのライブラリを使ってみた感想などです。

整数型はVarintという可変長型でバイナリに保存される

数字が多きければ大きいほど、長いバイト長で保存されます。ただし、負数の場合符号ビットが立つ関係で、ほとんど常に変換後のバイト数が最長バイト数(10)になってしまいます。フィールドの型をsint32, sint64で宣言しると、各数値にzig-zags変換が行われるため、負数であってもその値の絶対値で使用バイト数が決まるようになります。

保存されるデータは各メッセージID/型/値のみ

バイナリに保存されるデータは各メッセージID/型/値のみです。なので、同じ定義の二つのメッセージ型は、プロトコルバッファ上では全く同じように扱うことが出来ます。例えば、片方からシリアライズしたデータを、もう片方の型でデシリアライズすることが可能です。

またオブジェクト連続シリアライズ/デシリアライズすることもできます。

継承されたクラスマッピング

すでに存在する継承関係のあるクラスを、Protocol Buffersでシリアライズ/デシリアライズしたい場合は次のようにします。

(Base, Derived はすでに存在するとします)

(ソースコード中になぜか日本語が書けないので、コメントはすべて英語になっています)

message PbBase {
        require int32 id = 1;
        require int32 value = 2;

        require Derived derived = 10; // - Point !!!
}

message PbDerived {
        require string string_value = 1;
}

継承元のメッセージ定義に、継承先のメッセージを持たせます。Base継承するクラスシリアライズ/デシリアライズしたい場合は、PbBaseメッセージを中心に処理を行うことで、比較的簡単に処理を実装することが出来ます。

例えばこんな感じ

Base *Base_DeserializeFrom(PbBase &pbobj)
{
    // Arrange the classes which inherits from Base.
    if (pbobj.has_derived()) {
        return new Derived(pbobj);
    }
    else
    ...
}

class Base {
    ...
    virtual void Base::SerializeTo(PbBase &pbobj) {
        // Set the fields of 'pbobj',
    }
    ...
};

class Derived {
    ...
    virtual void Base::SerializeTo(PbBase &pbobj)
    {
        PbDerived *derived = pbobj.mutable_derived();

        Base::SerializeTo(pbobj);
        // Set the fields of 'derived',
        ...
    }
    ...
};

protoファイルを以下のように書くと、メッセージの扱いが非常に難しくなります。

message PbBase {
        require int32 id = 1;
        require int32 value = 2;
}

message PbDerived {
        required PbBase base = 1; // - Here is the point !!!
        require string string_value = 2;
}
- 転職ならen
- 派遣ならen
7ページ中1ページ目を表示(合計:154件)