<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" >
  <channel>
  <title>moriBlog-memo</title>
  <link>https://kansaifumi.blog.shinobi.jp/</link>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="https://kansaifumi.blog.shinobi.jp/RSS/" />
  <description>JavaScript , Java , DOS , HTML(CSS) , JSP , SQL , VB , VBScript , ・・・etc　などの覚書</description>
  <lastBuildDate>Fri, 03 Aug 2012 08:28:42 GMT</lastBuildDate>
  <language>ja</language>
  <copyright>© Ninja Tools Inc.</copyright>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" />

    <item>
    <title>No50 Google MAP API</title>
    <description>
    <![CDATA[<p>
	Google MAP API<br />
	（社内イントラサイトやユーザーIDなどが必要なホームページなどは、無償で使用できない）<br />
	<br />
	<br />
	参考<br />
	まーかーを複数設置：　<a href="http://gmap3.blog52.fc2.com/blog-entry-17.html">http://gmap3.blog52.fc2.com/blog-entry-17.html</a><br />
	住所から座標を取得：　<a href="http://www.ajaxtower.jp/googlemaps/geocoding/index1.html">http://www.ajaxtower.jp/googlemaps/geocoding/index1.html</a></p>
<p>
	噴出し：<a href="http://www.nanchatte.com/map/showDifferentInfoWindowOnEachMarker.html">http://www.nanchatte.com/map/showDifferentInfoWindowOnEachMarker.html</a></p>
<p>
	&nbsp;</p>
<p>
	&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;<br />
	&lt;html lang=&quot;ja&quot;&gt;<br />
	&lt;head&gt;<br />
	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;</p>
<p>
	&lt;meta http-equiv=&quot;Content-Script-Type&quot; content=&quot;text/javascript&quot;&gt;<br />
	&lt;script type=&quot;text/javascript&quot; src=&quot;<a href="http://maps.google.com/maps/api/js?sensor=false&quot;&gt;&lt;/script">http://maps.google.com/maps/api/js?sensor=false&quot;&gt;&lt;/script</a>&gt;<br />
	&lt;/head&gt;<br />
	&lt;body&gt;</p>
<p>
	<br />
	&lt;input type=&#39;button&#39; value=&#39;検索&#39; onclick=&quot;aaa()&quot;&gt;</p>
<p>
	&lt;div id=&quot;map&quot; style=&quot;width:100%; height:90%;&quot;&gt;&lt;br&gt;<br />
	&lt;script type=&#39;text/javascript&#39;&gt;</p>
<p>
	var realAdr = [<br />
	[&quot;仕入れ先1&quot;,&quot;東京都大田区&quot;],<br />
	[&quot;仕入れ先2&quot;,&quot;横浜市青葉区&quot;],<br />
	[&quot;仕入れ先3&quot;,&quot;大阪市平野区&quot;]<br />
	];</p>
<p>
	var map = new google.maps.Map(document.getElementById(&quot;map&quot;), {<br />
	zoom: 5,<br />
	center: new google.maps.LatLng(36,138),<br />
	mapTypeId: google.maps.MapTypeId.ROADMAP<br />
	});</p>
<p>
	&nbsp;</p>
<p>
	function aaa(){</p>
<p>
	for (var i = 0; i &lt; realAdr.length; i++) {</p>
<p>
	getLatLng(realAdr[i][1],realAdr[i][0]);<br />
	}<br />
	}</p>
<p>
	function getLatLng(place,placeName) {<br />
	var geocoder = new google.maps.Geocoder();</p>
<p>
	geocoder.geocode({<br />
	address: place,<br />
	region: &#39;jp&#39;<br />
	},function(results, status) {<br />
	if (status == google.maps.GeocoderStatus.OK) {</p>
<p>
	//var bounds = new google.maps.LatLngBounds();<br />
	for (var r in results) {<br />
	if (results[r].geometry) {</p>
<p>
	//座標取得<br />
	var latlng = results[r].geometry.location;</p>
<p>
	//bounds.extend(latlng);</p>
<p>
	var address = results[0].formatted_address.replace(/^日本, /, &#39;&#39;);</p>
<p>
	<br />
	//初期値は吹き出しなしの場合<br />
	var myMarker = new google.maps.Marker({<br />
	position: latlng,<br />
	map: map,<br />
	title: placeName<br />
	});</p>
<p>
	//クリックして吹き出し<br />
	attachMessage(myMarker, placeName);</p>
<p>
	/*<br />
	//吹き出しを付ける場合<br />
	new google.maps.InfoWindow({<br />
	content: placeName<br />
	}).open(map, new google.maps.Marker({<br />
	position: latlng,<br />
	map: map,<br />
	title: &quot;aaa&quot;<br />
	}));<br />
	*/</p>
<p>
	}<br />
	}<br />
	//map.fitBounds(bounds);<br />
	} else if (status == google.maps.GeocoderStatus.ERROR) {<br />
	alert(&quot;通信エラー&quot;);<br />
	} else if (status == google.maps.GeocoderStatus.INVALID_REQUEST) {<br />
	alert(&quot;リクエストエラー&quot;);<br />
	} else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {<br />
	alert(&quot;送信多数エラー&quot;);<br />
	} else if (status == google.maps.GeocoderStatus.REQUEST_DENIED) {<br />
	alert(&quot;ジオコーダの利用不可エラー&quot;);<br />
	} else if (status == google.maps.GeocoderStatus.UNKNOWN_ERROR) {<br />
	alert(&quot;サーバ側エラー&quot;);<br />
	} else if (status == google.maps.GeocoderStatus.ZERO_RESULTS) {<br />
	alert(&quot;見つかりません&quot;);<br />
	} else {<br />
	alert(&quot;エラー&quot;);<br />
	}<br />
	});<br />
	}</p>
<p>
	<br />
	//クリックしたら吹き出し表示<br />
	function attachMessage(marker, msg) {<br />
	google.maps.event.addListener(marker, &#39;click&#39;, function(event) {<br />
	new google.maps.InfoWindow({<br />
	content: msg<br />
	}).open(marker.getMap(), marker);<br />
	});<br />
	}</p>
<p>
	<br />
	&lt;/script&gt;</p>
<p>
	&lt;/div&gt;<br />
	&lt;/body&gt;<br />
	&lt;/html&gt;</p>
]]>
    </description>
    <category>JavaScript</category>
    <link>https://kansaifumi.blog.shinobi.jp/javascript/no50%20google%20map%20api</link>
    <pubDate>Fri, 03 Aug 2012 08:28:42 GMT</pubDate>
    <guid isPermaLink="false">kansaifumi.blog.shinobi.jp://entry/50</guid>
  </item>
    <item>
    <title>No48 行挿入と更新を１ステートメントで行う</title>
    <description>
    <![CDATA[参考URL<a href="http://www.shift-the-oracle.com/sql/merge.html">http://www.shift-the-oracle.com/sql/merge.html</a><br />
<br />
<br />
<pre class="oracle" style="border-left: #e0f5f5 1em solid; margin-top: 0px">
MERGE INTO USER_MASTER
USING USER_MASTER_IMPORT 
ON ( USER_MASTER.USER_ID = USER_MASTER_IMPORT.USER_ID)
<span class="co1">-- 既存レコードの更新</span>
WHEN MATCHED THEN
	<a href="http://www.shift-the-oracle.com/sql/update.html"><span class="kw4">UPDATE</span></a>&nbsp;SET
		USER_NAME = USER_MASTER_IMPORT.USER_NAME,
		DEPT_NO = USER_MASTER_IMPORT.DEPT_NO,
		MODIFIED_ON = <a href="http://www.shift-the-oracle.com/sql/functions/sysdate.html"><span class="kw1">SYSDATE</span></a>
<span class="co1">-- 新規レコードの作成</span>
WHEN NOT MATCHED THEN
	<a href="http://www.shift-the-oracle.com/sql/insert.html"><span class="kw4">INSERT</span></a>
		( USER_ID, USER_NAME, DEPT_NO )
	VALUES
		( USER_MASTER_IMPORT.USER_ID,
		USER_MASTER_IMPORT.USER_NAME || <span class="st0">&#39;(新人)&#39;</span>,
		USER_MASTER_IMPORT.DEPT_NO )</pre>
]]>
    </description>
    <category>SQL</category>
    <link>https://kansaifumi.blog.shinobi.jp/sql/no48%20%E8%A1%8C%E6%8C%BF%E5%85%A5%E3%81%A8%E6%9B%B4%E6%96%B0%E3%82%92%EF%BC%91%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%81%A7%E8%A1%8C%E3%81%86</link>
    <pubDate>Tue, 17 Jan 2012 08:17:11 GMT</pubDate>
    <guid isPermaLink="false">kansaifumi.blog.shinobi.jp://entry/49</guid>
  </item>
    <item>
    <title>No47 Java　Blob型のInsert</title>
    <description>
    <![CDATA[サーバーに配置している画像パスを指定し、&nbsp;setBinaryStream　としてセットする。<br />
<br />
<br />
&nbsp;String db = &quot;TEST&quot;;<br />
&nbsp;Connection c = null;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c = ConnectionHelper.getConnection(db);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String fileName = &quot;c:/temp/aaa.jpg&quot;;<br id="NINJASELECTIONID" style="clear: both" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StringBuffer strsql = new StringBuffer();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strsql.append(&quot;UPDATE DRAW&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strsql.append(&quot; SET&nbsp;DATA = ?&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strsql.append(&quot; WHERE CODE = ?&quot;);<br id="NINJASELECTIONID" style="clear: both" />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;//条件設定<br />
&nbsp;&nbsp;&nbsp;&nbsp;PreparedStatement ps = c.prepareStatement(strsql.toString());<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;ps.setBinaryStream(1,new FileInputStream(file),(int)file.length());<br />
&nbsp;&nbsp;&nbsp;&nbsp;ps.setString(2, &quot;1111111111&quot;);<br />
<br />
　　return&nbsp;( ps.executeUpdate());]]>
    </description>
    <category>Java</category>
    <link>https://kansaifumi.blog.shinobi.jp/java/no47%20java%E3%80%80blob%E5%9E%8B%E3%81%AEinsert</link>
    <pubDate>Tue, 10 Jan 2012 02:32:46 GMT</pubDate>
    <guid isPermaLink="false">kansaifumi.blog.shinobi.jp://entry/48</guid>
  </item>
    <item>
    <title>No46 IMEモード</title>
    <description>
    <![CDATA[ただしテキストエリア上でIMEの変更は可能<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="pun">&lt;</span><span class="tag">mx:FormItem</span><span class="pln"> </span><span class="atn">label</span><span class="pun">=</span><span class="atv">&quot;指定なし&quot;</span><span class="pun">&gt;</span><br />
<span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="pun">&lt;</span><span class="tag">mx:TextInput</span><span class="pln"> </span><span class="atn">width</span><span class="pun">=</span><span class="atv">&quot;200&quot;</span><span class="pun">/&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;/</span><span class="tag">mx:FormItem</span><span class="pun">&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;</span><span class="tag">mx:FormItem</span><span class="pln"> </span><span class="atn">label</span><span class="pun">=</span><span class="atv">&quot;全角英数&quot;</span><span class="pun">&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;</span><span class="tag">mx:TextInput</span><span class="pln"> </span><span class="atn">width</span><span class="pun">=</span><span class="atv">&quot;200&quot;</span><span class="pln"> </span><span class="atn">imeMode</span><span class="pun">=</span><span class="atv">&quot;ALPHANUMERIC_FULL&quot;</span><span class="pln"> </span><span class="pun">/&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;/</span><span class="tag">mx:FormItem</span><span class="pun">&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;</span><span class="tag">mx:FormItem</span><span class="pln"> </span><span class="atn">label</span><span class="pun">=</span><span class="atv">&quot;半角英数&quot;</span><span class="pun">&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;</span><span class="tag">mx:TextInput</span><span class="pln"> </span><span class="atn">width</span><span class="pun">=</span><span class="atv">&quot;200&quot;</span><span class="pln"> </span><span class="atn">imeMode</span><span class="pun">=</span><span class="atv">&quot;ALPHANUMERIC_HALF&quot;</span><span class="pln"> </span><span class="pun">/&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;/</span><span class="tag">mx:FormItem</span><span class="pun">&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;</span><span class="tag">mx:FormItem</span><span class="pln"> </span><span class="atn">label</span><span class="pun">=</span><span class="atv">&quot;全角かな&quot;</span><span class="pun">&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;</span><span class="tag">mx:TextInput</span><span class="pln"> </span><span class="atn">width</span><span class="pun">=</span><span class="atv">&quot;200&quot;</span><span class="pln"> </span><span class="atn">imeMode</span><span class="pun">=</span><span class="atv">&quot;JAPANESE_HIRAGANA&quot;</span><span class="pln"> </span><span class="pun">/&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;/</span><span class="tag">mx:FormItem</span><span class="pun">&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;</span><span class="tag">mx:FormItem</span><span class="pln"> </span><span class="atn">label</span><span class="pun">=</span><span class="atv">&quot;全角カナ&quot;</span><span class="pun">&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;</span><span class="tag">mx:TextInput</span><span class="pln"> </span><span class="atn">width</span><span class="pun">=</span><span class="atv">&quot;200&quot;</span><span class="pln"> </span><span class="atn">imeMode</span><span class="pun">=</span><span class="atv">&quot;JAPANESE_KATAKANA_FULL&quot;</span><span class="pln"> </span><span class="pun">/&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;/</span><span class="tag">mx:FormItem</span><span class="pun">&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;</span><span class="tag">mx:FormItem</span><span class="pln"> </span><span class="atn">label</span><span class="pun">=</span><span class="atv">&quot;半角カナ&quot;</span><span class="pun">&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;</span><span class="tag">mx:TextInput</span><span class="pln"> </span><span class="atn">width</span><span class="pun">=</span><span class="atv">&quot;200&quot;</span><span class="pln"> </span><span class="atn">imeMode</span><span class="pun">=</span><span class="atv">&quot;JAPANESE_KATAKANA_HALF&quot;</span><span class="pln"> </span><span class="pun">/&gt;</span><br />
<span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">&lt;/</span><span class="tag">mx:FormItem</span><span class="pun">&gt;</span><br />
]]>
    </description>
    <category>Flex</category>
    <link>https://kansaifumi.blog.shinobi.jp/flex/no46%20ime%E3%83%A2%E3%83%BC%E3%83%89</link>
    <pubDate>Sat, 08 Oct 2011 04:58:10 GMT</pubDate>
    <guid isPermaLink="false">kansaifumi.blog.shinobi.jp://entry/47</guid>
  </item>
    <item>
    <title>No45_TIFF印刷</title>
    <description>
    <![CDATA[TIFFファイルをバッチで印刷させたい場合は、以下のコマンドを使用する。<br />
<br />
<br />
rundll32.exe shimgvw.dll,ImageView_PrintTo /pt フルパス引用符付き &quot;プリンタ名&quot;<br />
<br />]]>
    </description>
    <category>DOS</category>
    <link>https://kansaifumi.blog.shinobi.jp/dos/no45_tiff%E5%8D%B0%E5%88%B7</link>
    <pubDate>Sat, 04 Dec 2010 23:25:06 GMT</pubDate>
    <guid isPermaLink="false">kansaifumi.blog.shinobi.jp://entry/46</guid>
  </item>
    <item>
    <title>No44_タスク</title>
    <description>
    <![CDATA[備忘録として<br />
<br />
タスクの設定で、開始日を過去の日時にすると、明日から開始される。<br />
現時刻より、１分でも遅く登録すれば、すぐ開始される。<br />
<br />
<br />]]>
    </description>
    <category>JavaScript</category>
    <link>https://kansaifumi.blog.shinobi.jp/javascript/no44_%E3%82%BF%E3%82%B9%E3%82%AF</link>
    <pubDate>Sat, 13 Nov 2010 03:51:28 GMT</pubDate>
    <guid isPermaLink="false">kansaifumi.blog.shinobi.jp://entry/45</guid>
  </item>
    <item>
    <title>No43_フォーム</title>
    <description>
    <![CDATA[なかなかお洒落なフォームを発見<br />
<br />
http://www.emblematiq.com/lab/niceforms/<br />
<br />
<br />
しかしCSSでなく、JavaScriptで表示後にデザインを変えている。<br />
チェックボタンのチェックなどがJavascriptで出来なかったりする・・。<br />
<br />
<br />]]>
    </description>
    <category>JavaScript</category>
    <link>https://kansaifumi.blog.shinobi.jp/javascript/no43_%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0</link>
    <pubDate>Mon, 11 Oct 2010 09:11:45 GMT</pubDate>
    <guid isPermaLink="false">kansaifumi.blog.shinobi.jp://entry/44</guid>
  </item>
    <item>
    <title>No42_処理速度アップ（２）</title>
    <description>
    <![CDATA[処理速度（１）に続く第２弾<br />
<br />
１）new Array より []（Arrayリテラル）<br />
<pre>
for(var i=0;i&lt;loop;i++)[]; // 約88ms
for(var i=0;i&lt;loop;i++)new Array; // 約133ms</pre>
２）Math.absよりも三項演算子<br />
絶対値を求める場合、Mathクラスのabsメソッドを呼ぶよりも三項演算子で解決したほうが高速です。１万回の試行で約18msの高速化！<br />
<pre>
function abs(){
   var a = 100;
   return a&gt;0?a:-a;
}
for(var i=0;i&lt;loop;i++)abs(); // 約50ms
function mathAbs(){
   var a = 100;
   return Math.abs(a);
}
for(var i=0;i&lt;loop;i++)mathAbs(); // 約68ms</pre>
３）単純な数字文字列から数値の変換はプラス単項演算子で<br />
数字文字列から数値を取得する方法はいくつかありますが、数字のみで構成される文字列であればプラス演算子で解決するのが高速です。parseInt呼び出しと比較した場合、１万回の試行で約80msの高速化！<br />
<pre>
for(var i=0;i&lt;loop;i++)+&quot;0&quot;; // 約26ms
for(var i=0;i&lt;loop;i++)parseInt(&quot;0&quot;); // 約106ms
</pre>
４）小数点切捨てにparseIntを利用しない<br />
素直にMath.floorを利用したほうが高速です。１万回の試行で約50msの差が出ます。<br />
<br />
for(var i=0;i&lt;loop;i++)Math.floor(i); // 約74ms<br />
for(var i=0;i&lt;loop;i++)parseInt(i,10); // 約125ms<br />
<br />
５）documentのアクセスはローカル変数に<br />
for(var i=0;i&lt;loop;i++)document; // 約11ms<br />
var doc = document;<br />
for(var i=0;i&lt;loop;i++)doc; // 約4ms<br />
<br />
６）domオブジェクトのプロパティアクセスに注意しろ！<br />
for(var i=0;i&lt;loop;i++)div.offsetWidth; // 約127ms<br />
var ow = div.offsetWidth;<br />
for(var i=0;i&lt;loop;i++)ow; // 約5ms<br />
<br />
７）try～catch～句は遅い<br />
ry～catch～句が現れると、スクリプト実行に若干のオーバーヘッドが発生します。ループ内では注意が必要で、ループ全体をtry～catch～で囲んだほうがオーバーヘッドが少なくなるようです。<br />
<br />
for(var i=0;i&lt;loop;i++)i; // 約4.3ms<br />
for(var i=0;i&lt;loop;i++)try{i}catch(e){}; // 約5.8ms<br />
try{for(var i=0;i&lt;loop;i++)i;}catch(e){}; // 約4.9ms<br />
<br />
８）真偽値評価はbooleanで<br />
if文の評価にオブジェクトを書けば null or undefined でfalse扱いとなりますが、booleanで評価したほうが若干高速となるようです。<br />
<pre>
for(var i=0;i&lt;loop;i++)if(true)i; // 約5.3ms
var o={};
for(var i=0;i&lt;loop;i++)if(o)i; // 約7.5ms</pre>
<br />
<br />
<br />]]>
    </description>
    <category>JavaScript</category>
    <link>https://kansaifumi.blog.shinobi.jp/javascript/no42_%E5%87%A6%E7%90%86%E9%80%9F%E5%BA%A6%E3%82%A2%E3%83%83%E3%83%97%EF%BC%88%EF%BC%92%EF%BC%89</link>
    <pubDate>Sat, 26 Jun 2010 05:11:57 GMT</pubDate>
    <guid isPermaLink="false">kansaifumi.blog.shinobi.jp://entry/43</guid>
  </item>
    <item>
    <title>No41_金魚</title>
    <description>
    <![CDATA[<script language="javascript">var bkParam1=1; var bkParam2=1; var bkParam3=465;</script> <script language="JavaScript" type="text/javascript" src="http://www.kingyo8.com/kingyo.js"></script>
<div style="width: 170px; text-align: center; font-size: 11px;">&nbsp;</div>
<br/>
<object type="application/x-shockwave-flash" style="outline:none;" data="http://hosting.gmodules.com/ig/gadgets/file/112581010116074801021/fish.swf?" width="300" height="200"><param name="movie" value="http://hosting.gmodules.com/ig/gadgets/file/112581010116074801021/fish.swf?"></param><param name="AllowScriptAccess" value="always"></param><param name="wmode" value="opaque"></param><param name="scale" value="noscale"/><param name="salign" value="tl"/></object>]]>
    </description>
    <category>JavaScript</category>
    <link>https://kansaifumi.blog.shinobi.jp/javascript/no41_%E9%87%91%E9%AD%9A</link>
    <pubDate>Wed, 12 May 2010 12:49:59 GMT</pubDate>
    <guid isPermaLink="false">kansaifumi.blog.shinobi.jp://entry/42</guid>
  </item>
    <item>
    <title>No40_引いた時間を何時間何分何秒で表す</title>
    <description>
    <![CDATA[引いた時間:time<br />
time=(logoutdt-logindt)*24*60*60<br />
<br />
select (:time - mod(:time,3600))/3600　||'時間'||(mod(:time,3600) - mod(mod(:time,3600),60))/60 ||'分'||mod(mod(:time,3600),60)||'秒' from dual;<br />
<br />
<br />]]>
    </description>
    <category>SQL</category>
    <link>https://kansaifumi.blog.shinobi.jp/sql/no40_%E5%BC%95%E3%81%84%E3%81%9F%E6%99%82%E9%96%93%E3%82%92%E4%BD%95%E6%99%82%E9%96%93%E4%BD%95%E5%88%86%E4%BD%95%E7%A7%92%E3%81%A7%E8%A1%A8%E3%81%99</link>
    <pubDate>Thu, 25 Feb 2010 23:50:32 GMT</pubDate>
    <guid isPermaLink="false">kansaifumi.blog.shinobi.jp://entry/41</guid>
  </item>

    </channel>
</rss>