4 月ã‹ã‚‰ãŠæ‰‹ä¼ã„ã—ã¦ã„ã‚‹一休.comã®é–‹ç™ºãƒ¡ãƒ³ãƒãƒ¼ãŒã€äº¬éƒ½ã§ 2 泊 3 æ—¥ã®é–‹ç™ºåˆå®¿ã™ã‚‹ã¨ã„ã†è©±ã‚’èžã„ãŸã®ã§ã€å¯†ã‹ã«ç´›ã‚Œè¾¼ã‚“ã§ãã¾ã—ãŸã€‚
事å‰ã«äºˆç¿’ãŒå¿…è¦ã ã£ãŸã®ã§ã™ãŒã€æ•°è©±ã ã‘見ãŸçŠ¶æ…‹ã§åˆå®¿ã«çªå…¥ã—ã¾ã—ãŸã€‚
é’春全部プãƒã‚°ãƒ©ãƒŸãƒ³ã‚°ã«ã‹ã‘ãŸçµæžœãŒä¿ºã§ã™
— ã—ã°ã‚„ã‚“ (@shibayan) 2016å¹´8月11æ—¥
ウッ
— ã—ã°ã‚„ã‚“ (@shibayan) 2016å¹´8月11æ—¥
ã¡ã¯ã‚„ãµã‚‹ã«é–¢ã—ã¦ã¯ä»–ã®äººãŒã¾ã¨ã‚ã¦ãれるã¨ä¿¡ã˜ã¦ã„ã‚‹ã®ã§å‰²æ„›ã—ã¾ã™ã€‚競技ã‹ã‚‹ãŸã‚’ã™ã‚‹ã¨ 1 日㧠3kg ç—©ã›ã‚‹ã¨èžã„ã¦ãƒ€ã‚¤ã‚¨ãƒƒãƒˆã‚¯ãƒ©ã‚¹ã‚¿ãŒé¨’ã‚ãã¾ã—ãŸã€‚
作ã£ãŸã‚‚ã®
Visual Studio ã«ã¯ Directed Graph Markup Language (DGML) ã¨ã„ã†ãƒ•ã‚¡ã‚¤ãƒ«ã‚’æ“作ã™ã‚‹æ©Ÿèƒ½ãŒç”¨æ„ã•ã‚Œã¦ã„ã‚‹ã®ã§ã€ãれを利用ã—㦠URL Rewrite ã®ãƒ«ãƒ¼ãƒ«ä¾å˜é–¢ä¿‚を表示ã™ã‚‹ãƒ„ールを作りã¾ã—ãŸã€‚
例ãˆã°ä»¥ä¸‹ã®ã‚ˆã†ãª URL Rewrite ã®ãƒ«ãƒ¼ãƒ«ã‚’用æ„ã—ã¦ã€DGML を書ã出ã—ã¾ã™ã€‚
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Redirect from blog"> <match url="^blog/([_0-9a-z-]+)/([0-9]+)" /> <action type="Redirect" url="article/{R:2}/{R:1}" redirectType="Found" /> </rule> <rule name="Redirect from page"> <match url="^page/([_0-9a-z-]+)/([0-9]+)" /> <action type="Redirect" url="article/{R:2}/{R:1}" redirectType="Found" /> </rule> <rule name="Redirect from top"> <match url="^top$" /> <action type="Redirect" url="article/12345/12345" redirectType="Found" /> </rule> <rule name="Redirect from root"> <match url="^$" /> <action type="Redirect" url="top" redirectType="Found" /> </rule> <rule name="Error response"> <match url="^error$" /> <action type="AbortRequest" /> </rule> <rule name="Rewrite to article.aspx"> <match url="^article/([0-9]+)/([_0-9a-z-]+)" /> <action type="Rewrite" url="article.aspx?id={R:1}&title={R:2}" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
書ã出ã—ãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’ Visual Studio ã§é–‹ãã¨ã€æœ‰å‘グラフã¨ã—ã¦è¡¨ç¤ºã•ã‚Œã¾ã™ã€‚特ã«èª¬æ˜Žã¯è¦ã‚‰ãªã„ã¨æ€ã„ã¾ã™ãŒã€ãƒ«ãƒ¼ãƒ«é–“ã®ä¾å˜é–¢ä¿‚ãŒè¦–覚化ã•ã‚Œã¦ã„ã‚‹ã“ã¨ãŒåˆ†ã‹ã‚Šã¾ã™ã。
DGML ã®æ“作ã«å¿…è¦ãª GraphModel ライブラリ㯠Visual Studio ã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã‚ã‚Šã¾ã™ãŒã€å ´æ‰€ãŒã¡ã‚‡ã£ã¨ã‚ã‹ã‚Šã«ãã„ã®ã§ã‚¹ã‚¯ãƒªãƒ¼ãƒ³ã‚·ãƒ§ãƒƒãƒˆã ã‘è²¼ã£ã¦ãŠãã¾ã™ã€‚
実際㮠Rewrite ルールãªã©ã§è©¦ã—ã¦ã„ãªã„ã®ã§ã€å¤šåˆ†å¾®å¦™ãªå‹•ä½œã¨ã‹æ™®é€šã«ã‚ã‚‹ã¨æ€ã„ã¾ã™ãŒã€ä»Šå›žã®å®Ÿè£…ã®ãƒ¡ã‚¤ãƒ³ã¯æ£è¦è¡¨ç¾ã§å®šç¾©ã•ã‚ŒãŸ match url ã‚’ã©ã†ã‚„ã£ã¦ä½œã‚‹ã‹ã€ã¨ã„ã†éƒ¨åˆ†ã§ã—ãŸã€‚
æ£è¦è¡¨ç¾ã«ãƒžãƒƒãƒã™ã‚‹å…¥åŠ›æ–‡å—列を作るãŸã‚ã«ã€ä»Šå›žã¯ Fare ã¨ã„ã†ãƒ©ã‚¤ãƒ–ラリを使ã„ã¾ã—ãŸã€‚元々㮠Java 実装を C# ã«ç§»æ¤ã—ãŸãƒ©ã‚¤ãƒ–ラリã«ãªã‚Šã¾ã™ã€‚
Fare.Xeger クラスを使ã†ã¨ã€ç°¡å˜ã«æ£è¦è¡¨ç¾ã«ãƒžãƒƒãƒã™ã‚‹ãƒ©ãƒ³ãƒ€ãƒ ãªæ–‡å—列を生æˆã—ã¦ãã‚Œã¾ã™ã€‚使ã„方も以下ã®ã‚ˆã†ã«ã¨ã¦ã‚‚シンプルã§ã™ã€‚
var xeger = new Fare.Xeger("^blog/([_0-9a-z-]+)/([0-9]+)"); var str = xeger.Generate();
ã“ã‚Œã§å…¥åŠ›æ–‡å—列ãŒç”Ÿæˆã•ã‚Œã‚‹ã®ã§ã€ã‚ã¨ã¯ä¸Šã‹ã‚‰é †ã« Rewrite ルールを辿ã£ã¦è¡Œã£ã¦ GraphModel ã®è¡¨ç¾ã«ãƒžãƒƒãƒ”ングã—ã¦ã„ã‚‹ã ã‘ã§ã™ã€‚
GraphModel 㯠Node 㨠Link ã‚’è¿½åŠ ã—ã¦ã„ãã ã‘ã§ã€ã„ã„æ„Ÿã˜ã«ã‚°ãƒ©ãƒ•ã‚’作ã£ã¦ãれるã®ã§è‰¯ã„æ„Ÿã˜ã§ã—ãŸã€‚
京都ã§ã®é£Ÿäº‹
食事ã¯åŸºæœ¬çš„ã«å…¨ã¦ naoya ã•ã‚“ãŒæ¡ˆå†…ã—ã¦ãã‚Œã¾ã—ãŸã€‚ãŠæ˜¼ã¯ãƒ©ãƒ¼ãƒ¡ãƒ³ã¨ã¤ã‘麺ã§è¿·ã„ã¤ã¤ã‚‚ã€ã¿ã‚“ãªãŒã¤ã‘麺ã ã£ãŸã®ã§ãƒ©ãƒ¼ãƒ¡ãƒ³é¸ã¶ãらã„ã²ããã‚Œã¦ã‚‹ã®ãŒç§ã§ã™ã€‚
æŸã¯ã¦ãªç¤¾ã®ã™ãè¿‘ãã«ã‚る店ã§ã—ãŸãŒã€ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ³ã—ã¦ãŸæ™‚ã«ã¯æ¯Žæ—¥ãŒå¿™ã—ã™ãŽã¦äº‹å‹™æ‰€ã‹ã‚‰ä¸€æ©ã‚‚外ã«å‡ºãªã‹ã£ãŸãªã¨æ€ã„出ã—ã¾ã—ãŸã€‚大å¦ç”Ÿã®é ƒãªã®ã§ã¨ã¦ã‚‚æ‡ã‹ã—ã„話ã§ã™ã€‚
夜も最高ã®åº—ã§ã€ã“ã“ã‚‚çƒä¸¸å¾¡æ± ã®è¿‘ãã§ã—ãŸã€‚ã¿ã‚“ãªã§é€²æ—ã‚’æ°—ã«ã›ãšé£²ã‚€é…’ã¯æœ€é«˜ã¨ã„ã†æ„Ÿã˜ã§ã™ã€‚
京都ã£ã¦å®‰ãã¦ç¾Žå‘³ã—ã„店多ã„ã‚“ã ã¨æ€ã„ãªãŠã—ã¾ã—ãŸã€‚ã¾ãŸå€‹äººçš„ã«ã‚‚食ã¹ã«è¡ŒããŸã„ãŠåº—ã§ã—ãŸã€‚
åˆå®¿ã®æº–å‚™ãªã©ã¯å…¨ã¦ä»»ã›ã£ãã‚Šã§ã€æœ¬å½“ã«ä¹—ã£ã‹ã£ãŸã ã‘ã§ç”³ã—訳ãªã„æ°—æŒã¡ã§ã„ã£ã±ã„ã§ã™ãŒã€é›†ä¸ã—ã¦ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°å‡ºæ¥ãŸã®ã¨æ¥½ã—ã„時間をéŽã”ã™ã“ã¨ãŒå‡ºæ¥ã¦æœ€é«˜ã§ã—ãŸã€‚