約 3,932,674 件
https://w.atwiki.jp/xbox360score/pages/1938.html
Connect 4 項目数:15 総ポイント:200 難易度: ☆Windows Phone7用タイトル 製品情報:Windows Phone Store 配信日:2012年10月9日 DL費用:90円 ジャンル:カード&ボード 世界が揺れている 本体を振って、ゲーム内で地震を起す 10 旅立ちの時 試合に勝利 5 見習いコネクター 10試合に勝利 5 半人前コネクター 25試合に勝利 10 一人前コネクター 50試合に勝利 20 超人コネクター 500試合をプレイ 10 伝説コネクター 1000試合をプレイ 15 なんでもほどほどに 難易度ノーマルでCPU10人に勝利 15 師匠と修行 難易度プロでCPU10人に勝利 20 低燃費 クイックゲームで、CPUに10手以内で勝利 5 天才 クイックゲームで、30秒以内に勝利 5 交差点 1枚のチップで2ライン達成 15 人生の醍醐味 全てのモードで1回勝利 10 ノリノリ ノーマルかプロのCPU相手に5連勝 25 チャレンジャー チャレンジモード達成 30
https://w.atwiki.jp/ookowaikowai/pages/37.html
using System; using System.Collections.Generic; using System.Linq; using System.Text; using DxLibDLL; using System.Net; namespace DesignProject { partial class Scene { public void CreateConnect() { this.sceneMenu.Add(new MenuManager(this)); this.sceneMenu[this.sceneMenu.Count - 1].menu.Add( new Menu( this.sceneMenu[this.sceneMenu.Count - 1], (Menu menu) = { if (menu.system.key.PushMoment(DX.KEY_INPUT_UP)) { menu.cursorY -= 1; if (menu.cursorY 0) { menu.cursorY = 0; } } if (menu.system.key.PushMoment(DX.KEY_INPUT_DOWN)) { menu.cursorY += 1; if (menu.cursorY = 3) { menu.cursorY = 2; } } if (menu.system.key.PushMoment(DX.KEY_INPUT_Z)) { switch (menu.cursorY) { case (0) //ホスト menu.parentManager.nextMenuID = 4; break; case (1) //クライアント menu.parentManager.nextMenuID = 1; break; case (2) //戻る menu.system.scene.nextSceneID = 0; break; default break; } } if (menu.system.key.PushMoment(DX.KEY_INPUT_X)) { //戻る menu.system.scene.nextSceneID = 0; } return; }, (Menu menu) = { DX.DrawString(320 - 45 + 10, 240 - 100 + 10, "Connect", DX.GetColor(255, 0, 0)); DX.DrawString(320 - 50 + 10, 240 + 10, "ほすと", DX.GetColor(255, 255, 255)); DX.DrawString(320 - 50 + 10, 240 + 40, "くらいあんと", DX.GetColor(255, 255, 255)); DX.DrawString(320 - 50 + 10, 240 + 70, "もどる", DX.GetColor(255, 255, 255)); DX.DrawBox( 320 - 90 + 5, 240 + 5 + menu.cursorY * 30, 320 - 90 + 160, 240 + 5 + menu.cursorY * 30 + 25, DX.GetColor(255, 255, 255), DX.FALSE ); return; }, (Menu menu) = { return; } ) ); this.sceneMenu[this.sceneMenu.Count - 1].menu.Add( new Menu( this.sceneMenu[this.sceneMenu.Count - 1], (Menu menu) = { if (menu.system.key.PushMoment(DX.KEY_INPUT_LEFT)) { menu.cursorX -= 1; if (menu.cursorX 0) { menu.cursorX = 0; } } if (menu.system.key.PushMoment(DX.KEY_INPUT_RIGHT)) { menu.cursorX += 1; if (menu.cursorX = menu.system.ipAndPortArray.Length) { menu.cursorX = menu.system.ipAndPortArray.Length - 1; } } if (menu.system.key.PushMoment(DX.KEY_INPUT_UP)) { menu.system.ipAndPortArray[menu.cursorX] += 1; if (menu.system.ipAndPortArray[menu.cursorX] 9) { menu.system.ipAndPortArray[menu.cursorX] = 0; } } if (menu.system.key.PushMoment(DX.KEY_INPUT_DOWN)) { menu.system.ipAndPortArray[menu.cursorX] -= 1; if (menu.system.ipAndPortArray[menu.cursorX] 0) { menu.system.ipAndPortArray[menu.cursorX] = 9; } } if (menu.system.key.PushMoment(DX.KEY_INPUT_Z)) { //接続開始 Console.WriteLine(NetworkUDP.GetIPFromArray(menu.system.ipAndPortArray).ToString()); menu.parentManager.nextMenuID = 2; } if (menu.system.key.PushMoment(DX.KEY_INPUT_X)) { //戻る menu.parentManager.nextMenuID = 0; } return; }, (Menu menu) = { DX.DrawString(320 - 45 + 10, 240 - 100 + 10, "Connect", DX.GetColor(255, 0, 0)); for (int j = 0; j 4; j++) { for (int i = 0; i 3; i++) { DX.DrawString( 320 - 160 + (j * 3 + i) * 20, 240 + 10, menu.system.ipAndPortArray[j * 3 + i].ToString(), DX.GetColor(0, 255, 0) ); } if (j != 3) { DX.DrawString( 320 - 160 + (j * 3 + 2) * 20 + 10, 240 + 10, ".", DX.GetColor(255, 255, 255) ); } else { DX.DrawString( 320 - 160 + (j * 3 + 2) * 20 + 10, 240 + 10, " ", DX.GetColor(255, 255, 255) ); } } for (int i = 0; i 5; i++) { DX.DrawString( 320 - 160 + (3 * 4 + i) * 20, 240 + 10, menu.system.ipAndPortArray[3 * 4 + i].ToString(), DX.GetColor(0, 255, 0) ); } DX.DrawBox( 320 - 166 + menu.cursorX * 20, 240 + 5, 320 - 166 + 20 + menu.cursorX * 20, 240 + 5 + 25, DX.GetColor(255, 0, 0), DX.FALSE ); return; }, (Menu menu) = { IPEndPoint clipIP = NetworkUDP.GetClipIP(); if (clipIP != null) { menu.system.ipAndPortArray = NetworkUDP.GetIPArray(clipIP); } return; } ) ); //クライアント側接続 this.sceneMenu[this.sceneMenu.Count - 1].menu.Add( new Menu( this.sceneMenu[this.sceneMenu.Count - 1], (Menu menu) = { if (menu.system.key.PushMoment(DX.KEY_INPUT_X)) { //戻る menu.system.udp.Close(); menu.parentManager.nextMenuID = 1; } if (menu.system.udp.receiveCount != 0) { UDPMessage message = menu.system.udp.GetReceiveMessage(); if (message.type == UDPMessage.MESSAGE_SYSTEM) { Console.WriteLine(message.DataToInt()); if (message.DataToInt() == UDPMessage.SYSTEM_CONNECT) { Console.WriteLine(NetworkUDP.GetIPFromArray(menu.system.ipAndPortArray).ToString() + " - " + menu.system.udp.clientEndPoint.ToString()); if (NetworkUDP.GetIPFromArray(menu.system.ipAndPortArray).ToString().Equals( menu.system.udp.clientEndPoint.ToString() )) { menu.parentManager.nextMenuID = 3; } } } } }, (Menu menu) = { DX.DrawString(320 - 45 + 10, 240 - 100 + 10, "Connect", DX.GetColor(255, 0, 0)); DX.DrawString(320 - 50 + 5, 240 + 70, "connecting...", DX.GetColor(255, 255, 255)); }, (Menu menu) = { menu.system.udp = new NetworkUDP(NetworkUDP.GetIPFromArray(menu.system.ipAndPortArray).Port); menu.system.udp.StartReceiveThread(); menu.system.udp.SendSystemMessage(UDPMessage.SYSTEM_CONNECT, NetworkUDP.GetIPFromArray(menu.system.ipAndPortArray)); } ) ); //クライアント側接続成功 this.sceneMenu[this.sceneMenu.Count - 1].menu.Add( new Menu( this.sceneMenu[this.sceneMenu.Count - 1], (Menu menu) = { if (menu.system.key.PushMoment(DX.KEY_INPUT_Z)) { menu.system.udp.SendStringMessage("from Client", NetworkUDP.GetIPFromArray(menu.system.ipAndPortArray)); } if (menu.system.udp.receiveCount != 0) { UDPMessage message = menu.system.udp.GetReceiveMessage(); if (message.type == UDPMessage.MESSAGE_STRING) { //Encoding sjisEnc = Encoding.GetEncoding("Shift_JIS"); //Console.WriteLine(sjisEnc.GetString(message.data, 0, message.dataLength) + " Received"); Console.WriteLine(message.DataToString() + " Received"); } if (message.type == UDPMessage.MESSAGE_SYSTEM) { Console.WriteLine(message.DataToInt()); if (message.DataToInt() == UDPMessage.SYSTEM_CLOSE) { menu.system.udp.Close(); menu.parentManager.nextMenuID = 0; } } } if (menu.system.key.PushMoment(DX.KEY_INPUT_X)) { //接続の終了 menu.system.udp.SendSystemMessage(UDPMessage.SYSTEM_CLOSE, NetworkUDP.GetIPFromArray(menu.system.ipAndPortArray)); menu.system.udp.Close(); menu.parentManager.nextMenuID = 0; } }, (Menu menu) = { DX.DrawString(320 - 45 + 10, 240 - 100 + 10, "Connect", DX.GetColor(255, 0, 0)); DX.DrawString(320 - 50 + 5, 240 + 70, "connected!", DX.GetColor(255, 255, 255)); }, (Menu menu) = { Console.WriteLine("Connected to Host"); } ) ); //ホスト側接続待機 this.sceneMenu[this.sceneMenu.Count - 1].menu.Add( new Menu( this.sceneMenu[this.sceneMenu.Count - 1], (Menu menu) = { if (menu.system.key.PushMoment(DX.KEY_INPUT_X)) { //戻る menu.system.udp.Close(); menu.parentManager.nextMenuID = 0; } if (menu.system.udp.receiveCount != 0) { UDPMessage message = menu.system.udp.GetReceiveMessage(); if (message.type == UDPMessage.MESSAGE_SYSTEM) { //Console.WriteLine(BitConverter.ToInt32(message.data, 0)); Console.WriteLine(message.DataToInt()); if (message.DataToInt() == UDPMessage.SYSTEM_CONNECT) { menu.system.udp.SendSystemMessage(UDPMessage.SYSTEM_CONNECT, menu.system.udp.clientEndPoint); menu.parentManager.nextMenuID = 5; } } } }, (Menu menu) = { DX.DrawString(320 - 45 + 10, 240 - 100 + 10, "Connect", DX.GetColor(255, 0, 0)); DX.DrawString(320 - 50 + 5, 240 + 70, "waiting...", DX.GetColor(255, 255, 255)); }, (Menu menu) = { NetworkUDP.SetClipIP(); menu.system.udp = new NetworkUDP(NetworkUDP.GetIPFromArray(menu.system.ipAndPortArray).Port); menu.system.udp.StartReceiveThread(); } ) ); //ホスト側接続成功 this.sceneMenu[this.sceneMenu.Count - 1].menu.Add( new Menu( this.sceneMenu[this.sceneMenu.Count - 1], (Menu menu) = { if (menu.system.key.PushMoment(DX.KEY_INPUT_Z)) { menu.system.udp.SendStringMessage("from Host", menu.system.udp.clientEndPoint); } if (menu.system.udp.receiveCount != 0) { UDPMessage message = menu.system.udp.GetReceiveMessage(); if (message.type == UDPMessage.MESSAGE_STRING) { //Encoding sjisEnc = Encoding.GetEncoding("Shift_JIS"); //Console.WriteLine(sjisEnc.GetString(message.data, 0, message.dataLength) + " Received"); Console.WriteLine(message.DataToString() + " Received"); } if (message.type == UDPMessage.MESSAGE_SYSTEM) { //Console.WriteLine(BitConverter.ToInt32(message.data, 0)); Console.WriteLine(message.DataToInt()); if (message.DataToInt() == UDPMessage.SYSTEM_CLOSE) { menu.system.udp.Close(); menu.parentManager.nextMenuID = 0; } } } if (menu.system.key.PushMoment(DX.KEY_INPUT_X)) { //戻る menu.system.udp.SendSystemMessage(UDPMessage.SYSTEM_CLOSE, menu.system.udp.clientEndPoint); menu.system.udp.Close(); menu.parentManager.nextMenuID = 0; } }, (Menu menu) = { DX.DrawString(320 - 45 + 10, 240 - 100 + 10, "Connect", DX.GetColor(255, 0, 0)); DX.DrawString(320 - 50 + 5, 240 + 70, "connected!", DX.GetColor(255, 255, 255)); }, (Menu menu) = { Console.WriteLine("Connected from Client"); } ) ); } } }
https://w.atwiki.jp/honeybe/pages/37.html
JDBC Connection Connect DataSource ConnectionPoolDataSource oracle.jdbc.pool.OracleConnectionPoolDataSource cods = new oracle.jdbc.pool.OracleConnectionPoolDataSource(); cods.setDriverType("thin"); cods.setServerName("server"); cods.setPortNumber(1251); cods.setDatabaseName("database"); cods.setUser("user"); cods.setPassword("password"); マニュアルに書かれている通り。 ConnectionCache 9i 10g oracle.jdbc.pool.OracleConnectionPoolDataSource cods = new oracle.jdbc.pool.OracleConnectionPoolDataSource(); cods.setDriverType("thin"); cods.setServerName("server"); cods.setPortNumber(1251); cods.setDatabaseName("database"); cods.setUser("user"); cods.setPassword("password"); cods.setConnectionCachingEnabled(true); 参考: http //otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/java.102/B19275-02/concache.htm
https://w.atwiki.jp/nintendo-rev/pages/22.html
WiiConnect24とは? 公式サイト WiiConnect24http //www.nintendo.co.jp/wii/features/wiiconnect24.html Wiiの電源が切れているように見える時でも、 様々なサービスが提供できる『眠らないシステム』。 スタンバイモードに入るとファンは回りませんが、インターネット接続など一部の機能は動作します。 そしてその時、Wiiは豆電球1個分程度の少ない消費電力で稼働します。 Wiiがインターネットと常時接続可能になり、ユーザーが眠っている間にも、開発者側から 新しい兵器や乗り物、レベルなどを「プッシュ」することが可能になります。 例えば『どうぶつの森』で、自分が眠っている間に自分の村に友達が遊びに来て、 メッセージやプレゼントを残していく、 そんな、毎日電源を入れるのが楽しみになるようなことが実現できます。 任天堂が目指しているのは、「毎日が新しいシステム」です。 WiiConnect24で利用可能予定のコンテンツ RSSを利用したニュース ゲームの最新情報 配信されてきたゲームデータ インターネット電子メール その他 ※公式サイトを一部改変いたしました また任天堂の岩田社長はインタビューでこう語っています Wiiが24時間動作可能なモードでインターネットに接続されているとする。 これを使えば,夜中のうちに任天堂が各家庭のWiiに向かって 「今月のニンテンドーDSの試遊ソフト」をプッシュ型で送りつけたりできる。 ユーザーは翌朝起きると,WiiのLEDランプがピカピカと光っていて, 任天堂から何か届いているのを見つける。 そして自分のニンテンドーDSを持ってきて, Wiiを経由して試遊ソフトをダウンロードするといった使い方を想定している。 (DSの試遊ソフトダウンロードは「みんなのニンテンドーチャンネル」で実現する。) スタンバイ時におけるWiiConnect24の動作の問題点 一部、WiiConnect24でのチャンネルはスタンバイ時にWiiConnect24への接続を有効にしないと利用することが出来なくなる。 任天堂公式には、「ニュースチャンネル」が該当するが「お天気チャンネル」も利用不能になる。 Wii公式サイト内Q A ニュースチャンネルが起動しないんだけど? SDカードに保存してあるチャンネルはWiiConnect24が使えないので注意。 WiiConnect24 対応ソフト 発売日 タイトル 価格 メーカー 公式 2006年12月 2日 Elebits 6,090円 コナミデジタルエンタテインメント ● 2007年4月26日 Wiiでやわらかあたま塾 4,800円 任天堂 ●■ 7月26日 Dewy s Adventure水精デューイの大冒険!! 6,090円 コナミデジタルエンタテインメント ● 10月25日 銀魂 万事屋ちゅ~ぶ ツッコマブル動画 6,090円 バンダイナムコゲームス ● 11月 1日 スーパーマリオギャラクシー 5,800円 任天堂 ●■ 11月22日 マリオ&ソニック AT 北京オリンピック 5,800円 任天堂 ● 12月13日 ナイツ ~星降る夜の物語~ 7,140円 セガ ● 2008年1月31日 大乱闘スマッシュブラザーズX 6,800円 任天堂 ●■ 31日 ファミリースキー 5,500円 バンダイナムコゲームス ●■ 2月21日 ウイニングイレブン プレーメーカー2008 7,140円 コナミデジタルエンタテインメント ●■ 3月 6日 メトロイドプライム3 コラプション 6,800円 任天堂 ●■ 4月10日 マリオカートWii(Wiiハンドル同梱) 5,800円 任天堂 ●■ 6月 5日 不思議のダンジョン風来のシレン3 ~からくり屋敷の眠り姫~ 7,140円 セガ ●■ 10月16日 Wii Music 5,800円 任天堂 ● 2008年 街へいこうよ どうぶつの森 価格未定 任天堂 WiiConnect24を使用するチャンネル、機能 配信日 タイトル 価格 メーカー 公式 本体内蔵 Wii伝言板(USBキーボード対応) 0円 任天堂 ● 本体内蔵 似顔絵チャンネル 0円 任天堂 ● 本体内蔵 写真チャンネル 0円 任天堂 ●■ 本体内蔵 Wiiショッピングチャンネル(USBキーボード対応) 0円 任天堂 ●■ 2006年12月19日 お天気チャンネル 0円 任天堂 ●■ 2007年1月26日 ニュースチャンネル 0円 任天堂 ●■ 2007年2月14日 みんなで投票チャンネル 0円 任天堂 ●■ 2007年11月12日 Miiコンテストチャンネル 0円 任天堂 ●■ 2007年11月27日 みんなのニンテンドーチャンネル 0円 任天堂 ●■ 2008年3月4日 TVの友チャンネル Gガイド for Wii 0円 任天堂 ●■
https://w.atwiki.jp/artpromotion/pages/81.html
締切: 2009/9/15 タイプ: ギャラリー展覧会 展覧会期間: 2010/1/17 - 2/13 開催場所: 米 ニュージャージー州 会場: George Segal ギャラリー 応募条件: ファイン アート アーティスト対象。画材の制限なし。 料金: $40 委託料: 50% リンク: ウェブサイト: http //www.montclair.edu/Arts/galleries 要綱: http //www.montclair.edu/Arts/galleries/ArtConnections6ProspectusFINAL.pdf 日本語の要綱: ※応募の際には、必ず主催者ウェブサイトの内容、要綱を確認してください。 広告
https://w.atwiki.jp/vocaloidchly/pages/3080.html
作詞:オレジナルP 作曲:オレジナルP 編曲:オレジナルP 歌:巡音ルカ 翻譯:yanao 請取用翻譯者不要冒著被我發現然後詛咒一輩子的危險改動我的翻譯謝謝合作 Rainbow Connection 在夏天的某個日子,我在那遇見了你 我確定我你的心跳都開始加快 無論晝夜我都在想著你,你的笑容進入我的心裡 但隨著時間經過,我得承認我的記憶愈來愈淡薄了 如果我能夠收集起你我的眼淚, 是否能造出一道美麗的橋樑? 我有些害怕你是否和我有一樣的想法,但我是如此相信的 希望能在某天變得自由 讓我們沿著這條路前往我們相遇的重要場所 架起彩虹的橋樑吧! 我們將會在雨後就我們兩人在這裡跳舞 Rainbow Connection! 當下雨時,我總是眺望著窗外 而每次我都會發覺我正在獨自嘆氣 我問我自己「這陣雨到底何時會停?」 但在心裡的某個角落, 我知道「那」並不是會一直出現的 我應該要用話語去敘述我的感覺嗎? (在那時我們說了些什麼呢?) 就在不久前我就希望能見到你 (我迷失於不知該如何傳達我的心意) 天氣的多變就宛如一面鏡子 (情緒的混亂令我的心情一片迷濛) 反映出我們的心情 希望你能夠理解我的想法 我們將不會再產生誤解,我們的關係也會變得更好 架起心靈的橋樑吧! 我似乎能坦率對你說出我的心意了 我希望能在某天變得自由 讓我們沿著這條路前往我們相遇的重要場所 架起彩虹的橋樑吧! 我們將會在雨後就我們兩人在這裡跳舞 Rainbow Connection!
https://w.atwiki.jp/makarunote/pages/274.html
Planet Connection (プラネット・コネクション) 基本情報 アーティスト COSIO(ZUNTATA) 配信日 2014/02/06 ジャンル ゲーム 原曲 Planet Connection(アルカノイドDS) 解禁方法 ミュージックパネル1枚で解禁→2016/03/10以降は解禁不要 BPM 127 難易度 S2/N4/H6(旧:2/4/6) 特徴 「メリーゴーランド」地帯に注意!リズム難NORMAL以上はスライド注意 アップデートに伴う特記事項 2018/03/2915段階の難易度表記に対応。 【アップデート年表へ戻る】 【トップページへ戻る】
https://w.atwiki.jp/taichik15/pages/45.html
ConnectionManagerの実装 liftでデータベースを使うには、ConnectionManagerトレイトの継承したクラスを作成する必要がある。 ConnectionManagerのサブクラスで実装するメソッド newConnection( name ConnectionIdentifier ) Box[Connection] システムが新しいコネクションが必要な時に呼ばれる releaseConnection(conn Connection) システムが使わなくなったコネクションをConnectionManagerに戻すときに呼ばれる closeAllConnections_!() 全てのコネクションを閉じる。必ず実装する必要はないが、サーバを落とすときにこのメソッドが呼ばれるようにBoot.scalaで設定する。 実装例 コネクションプール機能を備えたDBVendorを実装する。 サーバ起動時に確保するコネクション数とプールしておく最大コネクション数をコンストラクタで指定するようにする。プールがいっぱいの時にnewConnectionが呼ばれた場合は、一時的に接続を確保し、releaseConnectionが呼ばれたら直ちに接続を閉じる。 import net.liftweb._ import mapper._ import common._ import scala.collection.mutable.Queue import java.io._ import java.net._ import java.sql.{Connection, DriverManager} class MyDBVendor(driver String, url String, user Box[String], pwd Box[String], initConnectionSize Int, maxConnectionSize Int) extends ConnectionManager with Logger { private val pool = new Queue[Connection] private var poolSize = 0 private var connectionSize = 0 private var tmpConnectionSize = 0 initConnectionPool private def initConnectionPool = { debug( "initializing connection pool..." ) for( i - 1 to initConnectionSize ) { getConnection match { case Full( conn ) = { poolSize += 1 connectionSize += 1 pool += conn } case _ = () } } debug( "connection pool is initialized." ) } private def getConnection Box[Connection] = try { debug( "making connection..." ) Class.forName( driver ) val conn = ( user, pwd ) match { case (Full( u ), Full( p )) = DriverManager.getConnection( url, u, p ) case _ = DriverManager.getConnection( url ) } debug( "connection is established poolSize=%d, connectionSize=%d, tmpConnectionSize=%d, maxConnectionSize=%d".format(poolSize, connectionSize, tmpConnectionSize, maxConnectionSize) ) Full( conn ) } catch { case ex = { error( "could not get connection", ex ) Empty } } private def useConnection Box[Connection] = if( pool.isEmpty ) { if( connectionSize maxConnectionSize ) { connectionSize += 1 getConnection } else { tmpConnectionSize += 1 getConnection } } else { debug( "use connection from pool poolSize=%d- %d, connectionSize=%d, tmpConnectionSize=%d, maxConnectionSize=%d".format(poolSize, poolSize-1, connectionSize, tmpConnectionSize, maxConnectionSize) ) poolSize -= 1 Full(pool.dequeue) } private def freeConnection( conn Connection ) = if( tmpConnectionSize != 0 ) { debug( "closing tmporary connection poolSize=%d, connectionSize=%d, tmpConnectionSize=%d- %d, maxConnectionSize=%d".format(poolSize, connectionSize, tmpConnectionSize, tmpConnectionSize-1, maxConnectionSize) ) tmpConnectionSize -= 1 conn.close } else { debug( "putting connection back to pool poolSize=%d- %d, connectionSize=%d, tmpConnectionSize=%d, maxConnectionSize=%d".format(poolSize, poolSize+1, connectionSize, tmpConnectionSize, maxConnectionSize) ) poolSize += 1 pool += conn } def newConnection( name ConnectionIdentifier ) Box[Connection] = synchronized { useConnection } def releaseConnection(conn Connection) = synchronized { freeConnection( conn ) } def closeAllConnections_!() Unit = synchronized { try { debug( "closing all connections" ) debug( "poolSize %d, connectionSize %d".format( poolSize, connectionSize ) ) while( poolSize != connectionSize ) wait( 1000 ) while( !pool.isEmpty ) { debug( "closeing connection poolSize=%d- %d, connectionSize=%d- %d".format(poolSize, poolSize-1, connectionSize, connectionSize-1) ) pool.dequeue.close poolSize -= 1 connectionSize -= 1 } debug( "all connections are closed poolSize=%d, connectionSize %d, tmpConnectionSize %d".format(poolSize, connectionSize, tmpConnectionSize) ) } catch { case ex = error( "failed to close all connections poolSize=%d, connectionSize %d, tmpConnectionSize %d".format(poolSize, connectionSize, tmpConnectionSize) ) } } } 使用例 Boot.scalaで以下のように記述する if (!DB.jndiJdbcConnAvailable_?) { val vendor = new MyDBVendor( Props.get("db.driver").openOr("com.mysql.jdbc.Driver"), Props.get("db.url").openOr("jdbc mysql //localhost/dbname"), Props.get("db.username"), Props.get("db.password"), Props.get("db.init.connection.size").openOr("5").toInt, Props.get("db.max.connection.size").openOr("10").toInt ) LiftRules.unloadHooks.append(vendor.closeAllConnections_! _) DB.defineConnectionManager(DefaultConnectionIdentifier, vendor) }
https://w.atwiki.jp/tetoteconnect/pages/156.html
ジャンル オリジナル タイトル connected アーティスト Shohei Tsuchiya(ZUNTATA) コレオグラファー SOLID CUBE BPM (110) 解禁方法 2023/07/04 追加配信 詳細 難易度 楽曲Lv ノーツ数 STANDARD 3 89 EXPERT 6 116 ULTIMATE 9 147 MANIAC - - CONNECT - - 「Smash a mirror」等でお馴染みのTAITO Sound Team「ZUNTATA」所属の土屋昇平による テトテコネクト初出のオリジナル楽曲。 2023/12月の周年記念コラボイベントの一環としてMUSIC DIVERにも移植された。 (bpm表記はそちらからの引用) 攻略等 動画 ULTIMATE(ALL PERFECT) EXPERT(ALL PERFECT) STANDARD(ALL PERFECT)
https://w.atwiki.jp/api_programming/pages/116.html
下位ページ 変数 演算子 Content using statement ToyboxToybox.System Monkey C と その他言語との違いJava Lua/Javascript Ruby, Python, and PHP 関数 構文Ifステートメント ループdo/while loop whileループ forループ 関数の戻り値 Instanceof and Has エラー 例外 Structured Exception Handling Objects コンストラクタ 継承 Inheritance データの隠蔽 Data Hiding Weak References (Connect IQ 1.2.x) モジュール Modules Using Statements スコープ Annotations http //developer.garmin.com/connect-iq/programmers-guide/monkey-c/ using Toybox.Application as App; using Toybox.System; class MyProjectApp extends App.AppBase { // onStart() is called on application start up function onStart() { } // onStop() is called when your application is exiting function onStop() { } // Return the initial view of your application here function getInitialView() { return [ new MyProjectView() ]; } } using statement C++のusingステートメント, Java™, Ruby, Python™のimportのようなもの。 using statements lexically bring modules into our name space. using節のあとで、, we can refer to a module by its shortened name (in this case System). Toybox Monkey C のルートモジュール Toybox.System Toybox.Syste 例:デバッグコンソールに表示する場合 System.println( "Hello Monkey C!" ); Javaの名前空間と違って、Monkey C のモジュールは関数、クラス、変数を含んだ、staticなオブジェクトであり、有用な関数を含んでいる println() コンソールに表示する(改行する) print() コンソールに表示する(改行しない) getTimer() ミリ秒のタイマー getClockTime() 現在時刻の取得 = System.ClockTimeを取得する getSystemStats() 現在のシステムステータスの取得 = System.Statsを取得する trap():デバッグ用(今後のSDKで採用?) exit() "User terminated"のメッセージを出して終了 error() エラーを発生させて、終了 Monkey C と その他言語との違い As Italian and Spanish derive from Latin, Monkey C derives heavily from past languages. C, Java™, JavaScript, Python™, Lua, Ruby, and PHP all influenced the design for Monkey C. If you are familiar with any of those languages, Monkey C should be easy to pick up. Java Like Java, Monkey C compiles into byte code that is interpreted by a virtual machine. Also like Java, all objects are allocated on the heap, and the virtual machine cleans up memory (Java through garbage collection, Monkey C through reference counting). Unlike Java, Monkey C does not have primitive types—integers and floats are objects. This means primitives can have methods just like other objects. While Java is a statically typed language, Monkey C is duck typed. In Java, the developer must declare the types for all parameters of a function, and declare the return value type. The Java compiler checks these at compile time to ensure type safety. Duck typing is the concept of “if it walks like a duck, and quacks like a duck, than it must be a duck”[1]. For example function add( a, b ) { return a + b; } function thisFunctionUsesAdd() { var a = add( 1, 3 ); // Return 4 var b = add( "Hello ", "World" ); // Returns "Hello World" } The Monkey C compiler does not verify type safety, and instead causes a runtime error if a function mishandles a method. Monkey C modules serve a similar purpose as Java packages, but unlike packages, modules can contain variables and functions. It is common for static methods to exist in the module as opposed to a particular class. Lua/Javascript The main difference between JavaScript or Lua and Monkey C is that functions in Monkey C are not first class. In JavaScript, a function can be passed to handle a callback function wakeMeUpBeforeYouGoGo() { // Handle completion } doLongRunningTask( wakeMeUpBeforeYouGoGo ); In Lua, to create an object, you bind functions to a hash table function doSomethingFunction( me ) { // Do something here } function newMyObject() { local result = {}; result["doSomething"] = doSomethingFunction; } Neither of these techniques works in Monkey C, because functions are bound to the object they are created in. To create a callback in Monkey C, create a Method object. Method objects are a combination of the function and the object instance or module they originate from. You can then call the method using method() function wakeMeUpBeforeYouGoGo() { // Do something here } doLongRunningTask( method( wakeMeUpBeforeYouGoGo ) ); Ruby, Python, and PHP Objects in Ruby and Python are hash tables, and have many of the properties of hash tables. Functions and variables can be added to objects at run time. Monkey C objects are compiled and cannot be modified at runtime. All variables have to be declared before they can be used, either in the local function, the class instance, or in the parent module. When importing a module, all classes inside the module have to be referenced through their parent module. You import modules, not classes, into your namespace. 関数 Functions are the meat[2] of your program. Functions define discrete callable units of code. Monkey C functions can take arguments, but because Monkey C is a dynamically typed language the argument types is not declared; just its name. Also, it is not necessary to declare the return value of a function, or even if a function returns a value, because all functions return values. You can specify the return value with a return statement, but if your function doesn’t have a return statement it will return the last value on the stack. Functions can exist in a class or module, or appear in the global module. 構文 Ifステートメント if statements allow branch points in your code myInstance.methodToCall( parameter ); if ( a == true ) { // Do something } else if ( b == true ) { // Do something else } else { // If all else fails } Monkey C は次の演算子もサポートしている var result = a ? 1 2; なお、trueと判定されるのは true A non-zeroでない整数 Nullでないオブジェクト ループ while loops do/while loops do/while loop do { // Code to do in a loop } while( expression ); whileループ while( expression ) { // Code to do in a loop } 一行での表現はサポートしていないので、括弧囲みで画 forループ // Monkey C does allow for variable declaration in for loops for( var i = 0; i array.size(); i++ ) { // Code to do in a loop } 関数の戻り値 Monkey Cでは全ての関数に戻り値がある。returnキーワードを使って、戻り値を設定する必要がある。 return expression; The expression is optional. Functions without a return statement automatically return the last value operated on. Instanceof and Has Monkey Cでは、プログラマにダック・タイピング言語のような自由さがあるが、トーレドオフとして、コンパイラのチェックが不十分である。そのため?実行時のチェック用に instanceof has という演算子が準備されている。 instanceof演算子は、そのインスタンスが、あるクラスから継承されているか、チェックする var value = 5; // 変数 value が Number かどうか? if ( value instanceof Toybox.Lang.Number ) { System.println( "Value is a number" ); } has演算子は、与えられたオブジェクトがシンボル(など)を持っているかチェックする。 たとえば、Toybox.Sensor.Magnetometer は magnetometerのライブラリをもっているが、全てのGarmin製品が磁気探知機の機能 を持っているわけではない。このようなとき、 an example of changing your implementation based on those criteria var impl; // Toybox に Magnetometer module が存在するか、チェックする if ( Toybox has Magnetometer ) { impl = new ImplementationWithMagnetometer(); } else { impl = new ImplementationWithoutMagnetometer(); } Monkey C’s object-oriented design patterns in conjunction with the has and instanceof operator enables software that has implementations for many devices in one code base. エラー Because Monkey C uses dynamic typing, there are many errors for which the compiler cannot check. If the error is of high enough severity, it will raise an fatal API error and cause your app to terminate at runtime. These errors cannot be caught. At this time all of these errors are fatal and there is no way to trap them, though this may be addressed in future updates. Array Out Of Bounds An attempt is being made to reference an array outside of its allocated bounds Circular Dependency There is a loop in the dependency graph of a module or object that prevents a module or object from being constructed Communications Error An error has occurred in BLE communications File Not Found The app file could not be found, which is usually caused when trying to load a resource from the app file Illegal Frame The return address on the stack is corrupted Initializer Error An error occured in an initializer Invalid Value An argument passed to a function or method is invalid Null Reference A value is being requested from a null value Out of Memory Indicates no more system memory is available for allocation Permission Required An attempt was made to use a restricted API without permission Stack Underflow The stack pointer went past the bottom of the stack memory limit Stack Overflow The stack pointer went past the top of the stack memory limit Symbol Not Found An attempt was made to access a variable or method that does not exist in the specified object or method System Error A generic error used by the Toybox APIs for fatal errors Too Many Arguments Too many arguments used by a method, which are currently limited to 10 arguments Too Many Timers Too many Timer Timer objects for the target device were started Unexpected Type Indicates an operation being done on a variable that is unsupported by the type; for example, trying to perform a bitwise OR on two string Unhandled Exception An Exception was thrown but was not caught by an exception handler Watchdog Tripped A Monkey C function has executed for too long; watchdogs prevent a Monkey C program from hanging the system via an infinite loop 例外 Structured Exception Handling Java/Javascriptのような、try-catchをサポートしている try { // Code to execute } catch( ex instanceof AnExceptionClass ) { // Code to handle the throw of AnExceptionClass } catch( ex ) { // Code to catch all execeptions } finally { // Code to execute when } throwも使える Objects Objects are created with the class keyword. Classes allow data and operations to be bound together on an object. コンストラクタ initializeメソッドで実施 class Circle { hidden var mRadius; function initialize( aRadius ) { mRadius = aRadius; } } function createCircle() { var c = new Circle( 1.5 ); } 継承 Inheritance extendsキーワード using Toybox.System as Sys; class A { function print() { Sys.print( "Hello!" ); } } class B extends A { } function usageSample() { var inst = new B(); inst.print(); // Prints "Hello!" } You can call superclass methods by using the super class’s symbol using Toybox.System; class A { function print() { System.print( "Hello!" ); } } class B extends A { function print() { // Call the super class implementation A.print(); // Amend the output System.println( "Hola!" ); } } function usageSample() { var inst = new B(); inst.print(); // Prints "Hello! Hola!" } データの隠蔽 Data Hiding public と hidden がある。hidden は protectedと同じで、サブクラスからもアクセスできる class Foo { hidden var mVar; } function usageSample() { var v = new Foo(); Toybox.System.println( v.mVar ); // Runtime Error } Weak References (Connect IQ 1.2.x) Monkey C is reference counted, which means the runtime system will free memory when the number of objects referencing that memory decrements to zero. Reference counting allows memory to become available very quickly which is important in low memory environments. The kryptonite of reference counting are circular references. A circular reference happens when a cycle is formed in the reference chain. For example, imagine object C references object A, object A references object B, and object B references object A. Now C gets invited to sit at the cool-kid table, so it dereferences A so it can hang out with its real friends.[3] This forms a roundabout to nowhere. The memory for A and B should be freed at this point, but A and B both have a reference count of one because they reference each other. The memory used by A and B are now unavailable to objects from the cool-kids table. Sometimes B really does need to reference A. In these cases, you can use a weak reference. A weak reference is an object that keeps a reference to an object but does not increment the reference count. This means the object reference can be destroyed, and is a case that should be handled. To create a weak reference you use the weak() method. Weak is a method in Lang.Object and is available to all Monkey C objects. var weakRef = obj.weak() If you are calling weak on one of the immutable types (Number, Float, Long, Double, String), then it returns the object itself. Otherwise it will return a WeakReference instance. class WeakReference { //! Return if the reference is still alive. //! @return true if object is still alive, false otherwise. //! When you are dead I will be STILL ALIVE //! I feel fantastic and I am STILL ALIVE function stillAlive(); //! Get the object referenced. //! @return Object referenced, or null if object is no //! longer alive. function get(); } You can use the stillAlive method to check if the reference has been cleaned up. Use get to create a strong reference to the object. Only keep the strong reference during the scope you need it! if( weakRef.stillAlive() ) { var strongRef = weakRef.get(); strongRef.doTheThing(); } モジュール Modules Modules in Monkey C allow for the scoping of classes and functions. Unlike Java packages, Monkey C modules have many of the same properties as classes. You can have variables, functions, and classes at the module level module MyModule { class Foo { var mValue; } var moduleVariable; } function usageSample() { MyModule.moduleVariable = new MyModule.Foo(); } Using Statements You can bring a module into your scoping level with the using keyword. using allows a module to be imported into another class or module by a symbol using Toybox.System; function foo() { System.print( "Hello" ); } The as clause provides a wat to assumed a module with a different name within scope. This is useful for shortening module names or when you simply disagree with our naming scheme[4] using Toybox.System as Sys; function foo() { Sys.print( "Hello" ); } using statements are scoped to the class or module in which they are defined. APIs and App Types The app type defines the user context of an app. Watch faces, for example, have many constraints because they operate in low power mode. To enforce these limits, the Connect IQ Virtual Machine will limit your available APIs based on your app type. モジュールの使用制限 A Toybox module requested for your app type that is outside this list will result in a Symbol Not Found error. スコープ Monkey C is a message-passed language. When a function is called, the virtual machine does a look up operation at runtime to find the function being called. Here is the hierarchy that it will search Instance members of the class Members of the superclass Static members of the class Members of the parent module, and the parent modules up to the global namespace Members of the superclass’s parent module up to the global namespace For exmaple, if function a() is called on an instance of Child(), it will be able to access non-member functions b(), c(), and d() when b() is a member of the parent module of the object c() is a static member of the object d() is the parent module of the parent module, also known as the globals module The code below tries to clarify using Toybox.System as Sys; function d() { Sys.print( "this is D!" ); } module Parent { // A module function. function b() { Sys.print( "This is B!" ); d(); // Call a globally visible function } // A child class of a Parent module class Child { // An instance method of Child function a() { Sys.print( "This is A!" ); b(); // Call a function in our parent module c(); // Call a static function within the class. d(); // Call a globally visible function. } // A static function of Child. // Note that static methods can t call instance method but still have // access to parent modules. static function c() { Sys.print( "This is C!" ); b(); // Call a method in the parent module. d(); // Call a globally visible function } } } Annotations Monkey C allows associating symbols with class or module methods and variables. These symbols are currently written into the debug.xml file generated by the compiler, but may be used in the future to add new features without changing the Monkey C grammar ( debugOnly) class TestMethods { ( test) static function testThisClass( x ) } This is different than Monkey Typing, where a thousand monkeys over infinite time write the works of Shakespeare. ↩ Tofu for the vegetarians, BBQ for Kansans… ↩ Not that this ever happened to the author. ↩ We are all about conflict avoidance here. ↩