ã¬ã³ã¸ã§ãã¹ã¿ãè¹ã§ãã¢ã¤ãã ã§ãã£ãããã¼ããè¹ã§ãããã¡ããã¡ãã«ã²ã£ã¤ãã¦ããã
æå¤ã¨ããã¾ã§ããã£ãããã¼ããè¹ã§ããã¨æã£ããã¨ã¯ãªãã¦ãæ©ãã§æéãã¹ã¿ã¿ãããªéººãè¹ã§ã¦ããã
ã¬ã³ã¸ã§è¹ã§ãããããã¦ããã¡ãã¡ã®å¤ªéººãé£ã¹ãããã¨ããçµã¿åããããããã¾ã§çãã¦ã¦ä»æ¥åãã¦çºçãããã¨ãããã¨ã
ç¡çãªç®æ¨ã決ããã¨ãã以å¤ã®ãã©ã³ã¹ãæªããªã
ãã¨ãã°
- ç®æ¨ããæ¯æ¥5æã«èµ·ãã¦åå¼·ãããã«ãã
- ããã°ã£ã¦èµ·ããã¨æ¥ä¸ç ããã¨ãã£ãå¯ä½ç¨ããã
- æ©èµ·ãã®ããã®å´åã大ããã家äºããããªãã«ãªã
- ç²¾ç¥çãªä½è£ããªããªã£ã¦ããã5æã«èµ·ãããã¦ã¯ããããæºè¶³æã¯ä½ã
ã¿ãããªãã¨ãããããæ°ãããã
ä¸æ©ç®ãå¼ãã¨ãä»ã®ãã¨ã¯ããã¨ãã¡ããã¡ããªã®ã ãã©ã5æã«èµ·ãããã¦ããã¨ããæºè¶³æã¯ãããéææãããã
æ¥ã«ã7æã¾ã§å¯ã¦ãã°ããããããã¿ããã«æ¹é転æããã®ãããããããã¯ä¸è¬çã«ã¯åãè¡ãã§ããããªãããã¯ãã£ã¦ããã»ããããããã«æããã®ã§â¦ã¿ããã«ãªã£ã¦ãã¾ãã¨ããªããªããããããªãã
åä½ã§è¦ãã¨è¯ããã¨ã ãã©ãç¶æ³ã¨ãã£ã¦ãªãã¨ãã«è¦ãããã¨ãããã¨ã«ãªãã®ãããããªãã
å 湿å¨ãè²·ã£ã
家ã®ä¹¾ç¥ããªãã¨ããããããæããã¨ããã·ã«å 湿å¨ãè²·ãã«è¡ã£ãã
ããã½ããã¯ã®æ°åå¼ããé»æ°ä»£ãä½ããã¿ã³ã¯ãã§ããã¦è¯ããããã¨ããåæ
å ±ã¯å¾ã¦ããã®ã ãã©ãæ6æã«èµ·ãã¦å 湿å¨ã«ã¤ãã¦èª¿ã¹ãã¨ãããã·ã£ã¼ãã®å 湿å¨ã¯ä¸ããã©ã°ã©ã°æ°´ãå
¥ãããã¦ä¾¿å©ãããã¨æããããã«ããã
ãã¼ã¿ã¼ã®ã¤ãããã¤ããªããã ãã©ããã¼ã¿ã¼ãåããã¨ãã§ãããããããã¨æ°åå¼ã«ãªãã
ããä¸æ®µé大ãã製åããããã©ãããã¯å¤§ãããªæ°ããããã7ãªããã«ã®æ°´ãéãã§ä¸ãã注ãã¤ã¡ã¼ã¸ã¯æã¦ãªãã£ãã
ããã§è²·ã£ã¦ãã¦åããã¦ã¿ãããé¨å±ã®æ¹¿åº¦ã常æ29%ã ã£ãã®ã44%ã¾ã§ä¸ãã£ãã
ãã©ããã«ãã¯ã¼ã§åãç¶ãã¦ããããããä¸ã«ã¯ãããªãã
ããä¸æ®µéã§ãã製åãè²·ãã¹ãã ã£ãã®ãâ¦?
â
ä»é±ã®åãããã風éªã£ã½ããããªãé ãçããããªãè©ãåã£ã¦ãããããªããªã³ããè©°ã¾ã£ã¦ãããããªèª¿åã®æªãã ã£ãã
家ãä¹¾ç¥ãã¦ãã¦ã調åãæªããªãã¨åãçãã¾ã¾å
¨ç¶æ²»ããªãã¦å°ã£ã¦ããã
ISUCON14 26ä½ã ã£ã
ååã«åºãã®ã2020å¹´ã§ãåãçã¾ãã¦ããã¯åå ãã¦ããªãã£ãã®ã ãã©ã声ãããã¦ããã£ã¦ãid:tkzwtks, id:akiymã¨åºãã
ãã®2人ã¨ã¯2017å¹´ã«ãä¸ç·ã«åºå ´ãã¦ããã®ã¨ãã¯æãããã¼ã«ã飲ã¿ãæ¨æãã¦ããã
æºå
æºåã¯ã»ã¼ãªã«ããã¦ãªãã¦ããããªããã°â¦ã¨ãä½åº¦ããã£ããã«æ¸ãè¾¼ãã ãããã ã£ãã
èªåã®ããã°ãè¦è¿ãã¦ããããããªã®ãã£ã¦ããªãã¨ãçºãã¦ãããè¦è¿ãã¨ãæ
ã¦ãªããã¨ããç²¾ç¥é¢ã®TRYãå¤ãã
å人ã®ã¹ãã«ã¨ãã¦ã¯ãæè¡çã«ã¯4å¹´åããä½ãé²æ©ãã¦ããªããã©ãæ®æ®µã®ä»äºãå¿ãããããããè½ã¡çãã¦è¡åãããã¿ãããªã¹ãã«ã¯ä¸ãã£ã¦ãã¦ããã¨æãã
æ風å
é湯ã®æ風åã«è¡ã£ã¦ãé´¨å·ãçºãã¦ãããªãã£ã¹ã«åãã£ãã
é´¨å·ã®ãããããããã¨ã¦ã¤ããªãã¦ããã®æ°æã¡ãããåæ³ãªã®ãï¼è¦å¶ããã»ããããã®ã§ã¯ãã¨ä¸å®ã«ãªãã
è¨èª
æ®ãã®äºäººã¯Goãå¾æã ãã©ãåãGoã¯æ¨æ¶ç¨åº¦ã«ããèªã¿æ¸ãã§ããªããã¨ãããã¨ããNode.jsãé¸ãã ãããããã¨ããã§ç¡çãã¦ä½¿ã£ã¦ãããªãã¨ç¿å¾ã§ããªãã®ã ãªâ¦ã¨æãã
TypeScriptã§åãã¤ãã¦ãã®ã¯ä¾¿å©ã ãã©ãSQLå
ã®ã«ã©ã åã¨ããã¼ãã«åã¨ããæ¥ãã§ã¿ã¤ãã³ã°ãã¦ãã©ãã©ãééããã®ã§ãå®è¡æã¨ã©ã¼ã¯ããåºã¦ããã
Promiseãä½ã£ã¦awaitããã»ã£ããããã«ãããã¨ã§éã«éåæå¦çãæ¸ããã®ã好ããªã®ã ãã©ãä»åã¯ãã¾ã使ããªãã£ãã
決æ¸ã·ã¹ãã ãå¼ã³åºããããã¯ã¬ã¹ãã³ã¹ãå¾
ãããè£ã§ãªã¯ã¨ã¹ãæãã£ã±ãªãã«å¤ãã¦ã¿ãããfailãã¦ãã¾ã£ãã
ããã¥ã¡ã³ããèªã
以åãæ¬æ¦ã«åºãã¨ãã«ãAPIã®ä»æ§æ¸ã«ãã³ããé ããã¦ããã®ãè¦éãã¦ããã®ãè¨æ¶ã«æ®ã£ã¦ãã¦ããããããããã¥ã¡ã³ããæåã«èªã人éã«ãªã£ãã
å®è£
ãéã«åããªãããã¯ãç¥ããªãç¥èãããã¾ã¾çµããã»ãããã¤ãã¹ã大ããã¨æãã
ãªã¼ã¸ã§ã³ã2åãããã¨ããServer Sent Eventsã«å¯¾å¿å¯è½ãã¨ãã決æ¸ãµã¼ãã¼ã¯åªçæ§ã®ããã«ããã®ããããåçã§ãã¾ããã¨ãããã³ããæ¸ããã¦ãããåªçæ§ãæ
ä¿ããããã®ãããã¯åãã¦è¦ãã
ãããã大ä¼ã«åºã¦ä¸ã¤æã¡å¸°ããç¥èãå¢ããã®ã¯å¬ããã
docs.stripe.com
ã³ã¼ããçºãã
è¡åãææªãªã®ã ãã©ãVSCodeã®Remote SSHã§ãµã¼ãã¼ã«å
¥ã£ã¦ããã®ã¾ã¾ã¤ãªãã£ã±ãªãã«ãã¦ãããgit pullããªãã¦ãããããã¤ãããã³ã¼ãããã®ã¾ã¾èªããã®ã§ãåæ ãæ©ãã
ã³ã¼ããæ¤ç´¢ããããVSCodeå
ã®ã¿ã¼ããã«ã§ãã°ãçºãããã便å©ã«ä½¿ã£ã¦ããããã¹ã£ã¦ãµã¼ãã¼å
ã®ãã¡ã¤ã«ãæ¸ãæãã¦ãã¾ããã¨ããã°ãã°ãã£ãã
SQLãç´æ¥æ¸ããã¦ããã®ã§ãUPDATEãã¨ããSELECTãã¨ãã§æ¢ãã¦ãã¤ã£ãã¿ã©ãããã¡ã¢ãã¦ãããã
ããã®ããæ¹ã¯ãã£ã¨ããã®ãããã¯ããã¨ããã³ã¡ã³ãã«ã¤ã£ãã¿ã©ãããæ¸ããã¦ãã¦å©ãã£ãã
ãã¼ãã¼ãã«è§¦ããªã
2人ã«ç»é¢ã«ã¤ãªãã§å®è£ ãã¦ããã£ã¦ãåã¯æ¨ªãããããã¹ãããããããã¥ã¡ã³ãã«ããã¨ããã¯ããããããã¨ã解説ããããã³ã¼ããçºãã¦ãå¤ãªå ´æãæ¢ããããã¨ããä½å¶ã§ãã»ã¼ä¸æ¥éãããã
- ãã¼ã¿ã®éæ£è¦å
- chairsã«latitude, longitudeããããã
- chairsã«can_assignã«ã©ã ã足ãã¦ãäºç´å¯è½ãªãtrueã¨ãããããããã«ãã
- ãããã³ã°ã®èª¿æ´
- ä¸åº¦ã«å ¨ridesãéãã¦é ã«ãããã³ã°ãããããã«
- 座æ¨ãè¦ãã¨ã0ä»è¿ã¨300ä»è¿ã«ã¯ã©ã¹ã¿ãã§ãã¦ããã®ã§ãé è»è·é¢ã§è¶³åããã¦ãè¿ãã®æ¤ åãå²ãå½ã¦ãããã«
- è·é¢/ã¹ãã¼ãã§æè¦æéãè¨ç®ãã¦æå°åããããã«
- ãªãããã¾ãé«è©ä¾¡ã«ã¯ã¤ãªããããè¬ã ã£ã
- ãµã¼ãã¼3å°ã«
- DBãã¢ããªx2ãã¨ãã3å°
- ãããã³ã°é »åº¦ãä¸ãã¦ãè¯ãæ¡ä»¶ã®æ¤
åãä½ãã®ãå¾
ã¤ããã«
- é »åº¦ãä¸ããã¨ãããã¼ã ããã¦ããããã
å¤æ¹ãããã«ãªã£ã¦ãServer Sent Eventãã£ã¦ãããªãã¨ãæã¡ä¸ãã§è©±ã«ã¤ãã¦ãããªããããã£ã¨ãããã¨è¨ã£ã¦ãå®è£
ãå§ãããã®ã®ããã¾ãåããæ念ããã
honoã«streamSSEã¨ããã¤ã³ã¿ã¼ãã§ã¤ã¹ããã£ã¦ãå®è£
ãããããªããåãã¦ããããã«ã¯è¦ããã®ã ãã©ããããã³ã°ãåããªããªã£ãã
ã¿ãããããã³ãã¯ã·ã§ã³ãåãããã¨ããµã¼ãã¼ãµã¤ãã®å¦çãç¶è¡ãã¦ããããã«è¦ãã¦ãSQLãæµãç¶ãã¦ããã使ã£ããã¨ãªãæè¡ãããããæ©ä¼ã«ãããªã使ãã®ã¯ä¸å¯è½ã¨ãããã¨ããããã
ããæéããªããããããããããã¨è¨ã£ã¦ããªãã¸ã§ã³ã1æéåãããæ»ãã¦çµäºã
ãªã®ã§ãä»ååã®ã³ã¼ãã¯1è¡ãå
¥ã£ã¦ãªãã
ãããã³ã°ã¯ããã¡ãã£ã¨ããã§ããããããªããã¨æã£ã¦ãæ¤
åãã¡ã®è¡ãå
ãå°çäºå®æå»ã¯è¨ç®ã§ããã®ã§ãçµããã®ãå¾
ã£ã¦ãããã¦ãããã¨ãã£ãäºç´ã¢ã«ã´ãªãºã ã¯ã©ãï¼ã¨ããäºç´ãã§ãã¦ããä¸å®æéã¯è¯ãæ¡ä»¶ãæ¢ããã©ãã¿ã¤ãããªããã°æã¡åã£ã¦ãããã³ã°ãããã®ã¯ã©ãï¼ã¨ã話ãã¦ãã®ã ãã©ãå®è£
ãéã«åããªãã£ãã
ããããèæ
®ãããããã£ã¨ãããªãã®ã§ã¯ãã¨èããã®ã¯æ¥½ããã£ãã
ã»ã«ã¤ç³»
é湯ã«è¡ã£ãå¹æããã£ã¦ãããã¤ã«ãªãè½ã¡çãã¦é²ããããã
æåã®æ¹ã«ãã¨ãã«ãªã¼ãã¼ãã¼ããè¦ã¦ãªãã£ãã®ã ãã©ããããã ãã ãããããããªã£ã¦ãã¦ããã®ã¾ã¾è¦ãªãã¾ã¾çµããããã¨æ±ºããã
ãã®çµæãã¾ã£ããç¦ããã¨ãªãããã¡ã¯ãã¡ãããã¯ãããã¨ããã»ã«ã¤ç³»ãªæ°åã«ãªããã
ããã¾ãç¹æ°ãæ°ã«ãããè½ã¡çãã¦è¡åããçµæã26ä½ã«å
¥ããã®ã§ãæå¤ãªçµæã ã£ãã30ä½ä»¥å
ã¯æ¬æ¦åºå ´ç¸å½ã®ã¹ã³ã¢ã¨ãããã¨ã ããNode.jsã§åºããã¼ã ã®ä¸ã§ã¯ä¸ä½ã®ã¹ã³ã¢ã ã£ãã
ãã¹ã¿åã®nodeå®è£ ã§ã26ä½ãnodeå©ç¨ãã¼ã ã®ä¸ã§1ä½ã«å ¥ãã¾ãã #isuconhttps://t.co/JKxzQ158Qz pic.twitter.com/N3BhKvrbOa
— 趣å³ã¯ããªã³ã¹ãã¼ãã§ã (@hitode909) 2024å¹´12æ8æ¥
ä»åã¯ããã ã¨ã³ããã¤ã³ããéãããã°ãããã¨ãããã®ã§ããªãããã¸ãã¹ãã¸ãã¯ãç解ãã¦æ¹åãããã¨ããåé¡ã§ããããããããããããã¨æ¥½ãããã
ã·ãã¥ã¬ã¼ã¿ãããã§ãã¦ããããåºé¡ã®åç»ãã¯ãªãªãã£ãé«ãããã®ãããå´åãããã£ã¦ããâ¦ã¨ãã®ã®ãã¦ããã
åºé¡è
ãã¹ã¿ãããã¹ãã³ãµã¼ãåå è
ã®ã¿ãªãã¾ã楽ãã大ä¼ãç¨æãã¦ãã ããããããã¨ããããã¾ããã
ä¹
ãã¶ãã«åºããã©ãçãåãåé¡ã解ãã¦ãã¨ãä»å¾ä¸å¹´éã¯ä¸é話ã®ãã¿ã«ãªãããåå ãã¦ããã£ãã¨æãã
â
ã¨ã¢ã³ã³ã®è¨å®ãããªããªããããã ãã¨ãããã®ã«ãªããªãã
å¤ã«ã¤ãã£ã±ãªããªã©ã空æ°ãä¹¾ç¥ãã¦ãæã«ã¯åãçããªã£ããããã®ã§ãå¤ã¯å¼±ãã¦ããããã®ã ãã©ãæ¯æ¥å¿ãããªã³ãªãããã®ã¯ããã©ãã
æ»ç¥ãç²æã®ããã¨ã¢ã³ã³ã§ããã¼ã¯ã«ããæ©è½ã¨ãããã§ããã¢ã¼ãã¨ããå¤ã ãæå¹ã«ãªãã¢ã¼ãã¨ããã¨ã«ãããªãã§ãã§ããããªé°å²æ°ãããã
ããã¾ã§ã¯ãåæè¨å®ã®ã¿ã¤ãã¼ã使ã£ã¦ããã®ã ãã©ãããã ã¨æ¼ã«ãªãã«ãªã£ã¦ãã¾ãã
ãã£ãã太é½å
çºé»ãä¹ã£ãã¦ããã®ã§ãæ¼ã®ãã¡ã«æ¸©ãã¦ãããã»ããæå©ã ã¨èããããã
説ææ¸ãçèªãããã30åãã¨ã«ãªã³ãªãã®ã¹ã±ã¸ã¥ã¼ã«ãèªåã§è¨å®ã§ããããã ã£ãã®ã§ãã²ã¼ã ã¦ã©ããã¿ãããªãªã¢ã³ã³ã§ã¡ãã¡ãè¨å®ãã¦ãã¿ã¤ãã¼ã®è¨å®ãå¤ãã¦ãå¤ã ããªãã«ãã¦ã¿ãã
é常ã«è¤éãªæä½ãå¿
è¦ã¨ãããã®ã§ã説ææ¸ãèªã¿è§£ããªãã¾ã¾ä¸çãçµãã人ãå¤ããã