<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>STRCPY - Super Coder&#039;s Page</title>
		<link>http://strcpy.com/</link>
		<description>Technology sharing related with software development. Specially content will be focused to programming language, and embedded systems.</description>
		<language>ko</language>
		<pubDate>Tue, 16 Dec 2008 10:52:35 +0900</pubDate>
		<generator>Textcube 1.7.6 : Staccato</generator>
		<image>
		<title>STRCPY - Super Coder&#039;s Page</title>
		<url>http://strcpy.com/attach/1/1017169486.jpg</url>
		<link>http://strcpy.com/</link>
		<width>110</width>
		<height>110</height>
		<description>Technology sharing related with software development. Specially content will be focused to programming language, and embedded systems.</description>
		</image>
		<item>
			<title>How to get screen resolution in case of using multiple monitors ?</title>
			<link>http://strcpy.com/281</link>
			<description>You can simply get the total number of monitors by&lt;a href=&quot;/tag/Screen.MonitorCount&quot;&gt;Screen.MonitorCount&lt;/a&gt;.&lt;br&gt;If you have dual monitors, the return value of Screen.MonitorCount is 2.&lt;br&gt;&lt;br&lt;a href=&quot;/tag/Screen.Monitors&quot;&gt;Screen.Monitors&lt;/a&gt;[ index ] has the properties related with your multiple monitors.&lt;br&gt;&lt;br&gt;Here&#039;s the simple example which measure the full screen resolution for multiple monitors.&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;//&lt;br&gt;// Programmed 2008 by Kurapa Chunun Kang (kurapa@kurapa.com)&lt;br&gt;//&lt;br&gt;// http://kurapa.com&lt;br&gt;//&lt;br&gt;function&lt;a href=&quot;/tag/GetScreenResolution&quot;&gt;GetScreenResolution&lt;/a&gt;: TRect;&lt;br&gt;var&lt;br&gt;&amp;nbsp; i: Integer;&lt;br&gt;&amp;nbsp; r, n: TRect;&lt;br&gt;begin&lt;br&gt;&amp;nbsp; // initialize returning value&lt;br&gt;&amp;nbsp; r.Left := 0;&lt;br&gt;&amp;nbsp; r.Right := 0;&lt;br&gt;&amp;nbsp; r.Top := 0;&lt;br&gt;&amp;nbsp; r.Bottom := 0;&lt;br&gt;&lt;br&gt;&amp;nbsp; for i := 1 to Screen.MonitorCount do&lt;br&gt;&amp;nbsp; begin&lt;br&gt;&amp;nbsp; &amp;nbsp; n.Left := Screen.Monitors[i-1]&lt;a href=&quot;/tag/WorkareaRect&quot;&gt;WorkareaRect&lt;/a&gt;.Left;&lt;br&gt;&amp;nbsp; &amp;nbsp; n.Right := Screen.Monitors[i-1].WorkareaRect.Right;&lt;br&gt;&amp;nbsp; &amp;nbsp; n.Top := Screen.Monitors[i-1].WorkareaRect.Top;&lt;br&gt;&amp;nbsp; &amp;nbsp; n.Bottom := Screen.Monitors[i-1].WorkareaRect.Bottom;&lt;br&gt;&amp;nbsp; &amp;nbsp; if r.Left&amp;gt;n.Left then r.Left := n.Left;&lt;br&gt;&amp;nbsp; &amp;nbsp; if r.Right&amp;lt;n.Right then r.Right := n.Right;&lt;br&gt;&amp;nbsp; &amp;nbsp; if r.Top&amp;gt;n.Top then r.Top := n.Top;&lt;br&gt;&amp;nbsp; &amp;nbsp; if r.Bottom&amp;lt;n.Bottom then r.Bottom := n.Bottom;&lt;br&gt;&amp;nbsp; end;&lt;br&gt;&lt;br&gt;&amp;nbsp; Result := r;&lt;br&gt;end;&lt;br&gt;&lt;br&gt;&lt;br&gt;// In case of clicking button, window size is changed to the full resolution.&lt;br&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br&gt;var r: TRect;&lt;br&gt;begin&lt;br&gt;&amp;nbsp; r := GetScreenResolution;&lt;br&gt;&amp;nbsp; Left := r.Left;&lt;br&gt;&amp;nbsp; Top := r.Top;&lt;br&gt;&amp;nbsp; Width := (r.Right-r.Left);&lt;br&gt;&amp;nbsp; Height := (r.Bottom-r.Top);&lt;br&gt;end;&lt;/div&gt;&lt;br&gt;</description>
			<category>Borland Delphi</category>
			<category>Dual Monitors</category>
			<category>GetScreenResolution</category>
			<category>Multiple Monitors</category>
			<category>Screen.MonitorCount</category>
			<category>Screen.Monitors</category>
			<category>WorkareaRect</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/281</guid>
			<comments>http://strcpy.com/281#entry281comment</comments>
			<pubDate>Tue, 16 Dec 2008 10:30:42 +0900</pubDate>
		</item>
		<item>
			<title>Remote Desktop not work after SP3 installation ?</title>
			<link>http://strcpy.com/280</link>
			<description>&lt;p&gt;This is caused by test certificate confiliction. you can clear this problem 
by performing below procedures.&lt;/p&gt;
&lt;p&gt;1. Click Start, click Run, type certmgr.msc, and then press ENTER.&lt;/p&gt;
&lt;p&gt;2. In the list that appears, find and expand the Trusted Root Certification 
Authority folder.&lt;/p&gt;
&lt;p&gt;3. Within the Trusted Root Certification Authority folder, find and expand 
the&lt;a href=&quot;/tag/Certificate&quot;&gt;Certificate&lt;/a&gt;s folder.&lt;/p&gt;
&lt;p&gt;4. In the right pane, find and delete all entries named Microsoft Test Root 
Authority.&lt;/p&gt;
&lt;p&gt;5. Restart the computer.&lt;/p&gt;</description>
			<category>MS Windows Tweak</category>
			<category>Certificate</category>
			<category>Remote Desktop</category>
			<category>Remote Desktop Connection</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/280</guid>
			<comments>http://strcpy.com/280#entry280comment</comments>
			<pubDate>Mon, 15 Dec 2008 13:13:51 +0900</pubDate>
		</item>
		<item>
			<title>How to turn off monitor ?</title>
			<link>http://strcpy.com/279</link>
			<description>&lt;pre&gt;If you want, you can turn off or turn on the monitor power. Try it:&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;SendMessage(Application.Handle, WM_SYSCOMMAND,&lt;a href=&quot;/tag/SC_MONITORPOWER&quot;&gt;SC_MONITORPOWER&lt;/a&gt;, 0);&lt;br&gt;&lt;br&gt;or&lt;br&gt;&lt;br&gt;SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 1);&lt;/div&gt;&lt;br&gt;&lt;/pre&gt;</description>
			<category>Borland Delphi</category>
			<category>Monitor Power</category>
			<category>SC_MONITORPOWER</category>
			<category>Turn Monitor Off</category>
			<category>Turn Off Monitor</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/279</guid>
			<comments>http://strcpy.com/279#entry279comment</comments>
			<pubDate>Wed, 10 Dec 2008 15:57:08 +0900</pubDate>
		</item>
		<item>
			<title>How to set and get sessions on JSP code ?</title>
			<link>http://strcpy.com/278</link>
			<description>Here&#039;s the simple example to set and put&lt;a href=&quot;/tag/session&quot;&gt;session&lt;/a&gt;s.&lt;br&gt;&lt;br&gt;save_my_name,jsp&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;br style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;nbsp;&amp;nbsp; String name = request.getParameter( &quot;username&quot; );&lt;/span&gt;&lt;br style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;/tag/session.setAttribute&quot;&gt;session.setAttribute&lt;/a&gt;( &quot;theName&quot;, name );&lt;/span&gt;&lt;br style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;br&gt;&amp;lt;HTML&amp;gt;&lt;br&gt;&amp;lt;BODY&amp;gt;&lt;br&gt;&amp;lt;A HREF=&quot;next_page.jsp&quot;&amp;gt;Continue&amp;lt;/A&amp;gt;&lt;br&gt;&amp;lt;/BODY&amp;gt;&lt;br&gt;&amp;lt;/HTML&amp;gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;save_my_name.jsp saves the user&#039;s name in the session, and puts a link to another page, next_page.jsp.&lt;br&gt;next_page.jsp shows how to retrieve the saved name.&lt;br&gt;&lt;br&gt;next_page.jsp&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&amp;lt;HTML&amp;gt;&lt;br&gt;&amp;lt;BODY&amp;gt;&lt;br&gt;Hello, &lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;lt;%=&lt;a href=&quot;/tag/session.getAttribute&quot;&gt;session.getAttribute&lt;/a&gt;( &quot;theName&quot; ) %&amp;gt;&lt;/span&gt;&lt;br&gt;&amp;lt;/BODY&amp;gt;&lt;br&gt;&amp;lt;/HTML&amp;gt;&lt;/div&gt;</description>
			<category>JSP</category>
			<category>JSP session control</category>
			<category>session</category>
			<category>session.getAttribute</category>
			<category>session.setAttribute</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/278</guid>
			<comments>http://strcpy.com/278#entry278comment</comments>
			<pubDate>Mon, 27 Oct 2008 14:13:16 +0900</pubDate>
		</item>
		<item>
			<title>How to add a declaration on JSP code ?</title>
			<link>http://strcpy.com/277</link>
			<description>If you have developed C or C++ program, you may know below examples.&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;// printf( &quot;a.out&quot;);&lt;br&gt;&lt;br&gt;/*&lt;br&gt;&amp;nbsp; printf( &quot;b.out&quot;);&lt;br&gt;*/&lt;/div&gt;&lt;br&gt;&lt;br&gt;Above code have no bug, but no code will be compiled, because it&#039;s all&lt;a href=&quot;/tag/declaration&quot;&gt;declaration&lt;/a&gt;s.&lt;br&gt;&lt;br&gt;In JSP, you can make declarations as well. In some documents, a declarations is also called as&lt;a href=&quot;/tag/remark&quot;&gt;remark&lt;/a&gt;.&lt;br&gt;&lt;br&gt;To add a declaration, you must use the &lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;lt;%! and %&amp;gt;&lt;/span&gt; sequences to enclose your declarations, as shown below. &lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&amp;lt;%@ page import=&quot;java.util.*&quot; %&amp;gt;&lt;br&gt;&amp;lt;HTML&amp;gt;&lt;br&gt;&amp;lt;BODY&amp;gt;&lt;br&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;lt;%!&lt;/span&gt;&lt;br style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;nbsp; &amp;nbsp; Date theDate = new Date();&lt;/span&gt;&lt;br style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;nbsp; &amp;nbsp; Date getDate()&lt;/span&gt;&lt;br style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println( &quot;In getDate() method&quot; );&lt;/span&gt;&lt;br style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return theDate;&lt;/span&gt;&lt;br style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;br&gt;Hello!&amp;nbsp; The time is now &amp;lt;%= getDate() %&amp;gt;&lt;br&gt;&amp;lt;/BODY&amp;gt;&lt;br&gt;&amp;lt;/HTML&amp;gt;&lt;/div&gt;&lt;br&gt;Above code is actually&lt;a href=&quot;/tag/dead code&quot;&gt;dead code&lt;/a&gt;, because it;s surrounded with &amp;lt;%! and %&amp;gt;.&lt;br&gt;</description>
			<category>JSP</category>
			<category>dead code</category>
			<category>declaration</category>
			<category>remark</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/277</guid>
			<comments>http://strcpy.com/277#entry277comment</comments>
			<pubDate>Mon, 27 Oct 2008 14:07:15 +0900</pubDate>
		</item>
		<item>
			<title>How to include file in JSP ?</title>
			<link>http://strcpy.com/276</link>
			<description>Just like ASP, or PHP, JSP is also allow to&lt;a href=&quot;/tag/include&quot;&gt;include&lt;/a&gt; for programmer by include function.&lt;br&gt;Here&#039;s the simple example.&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&amp;lt;HTML&amp;gt;&lt;br&gt;&amp;lt;BODY&amp;gt;&lt;br&gt;Going to include hello.jsp...&amp;lt;BR&amp;gt;&lt;br&gt;&lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;lt;%@&lt;a href=&quot;/tag/include file&quot;&gt;include file&lt;/a&gt;=&quot;hello.jsp&quot; %&amp;gt;&lt;/span&gt;&lt;br&gt;&amp;lt;/BODY&amp;gt;&lt;br&gt;&amp;lt;/HTML&amp;gt;&lt;br&gt;&lt;/div&gt;</description>
			<category>JSP</category>
			<category>include</category>
			<category>include file</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/276</guid>
			<comments>http://strcpy.com/276#entry276comment</comments>
			<pubDate>Mon, 27 Oct 2008 14:01:31 +0900</pubDate>
		</item>
		<item>
			<title>How to print out text strings on HTML directly ?</title>
			<link>http://strcpy.com/275</link>
			<description>&lt;p&gt;In&lt;a href=&quot;/tag/JSP&quot;&gt;JSP&lt;/a&gt;, you can print out text strings by out.println().&lt;/p&gt; &lt;br&gt; &lt;p&gt;Here&#039;s the example.&lt;/p&gt;&lt;pre&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&amp;lt;HTML&amp;gt;
&amp;lt;BODY&amp;gt;
&amp;lt;%&lt;br&gt;  // This scriptlet declares and initializes &quot;date&quot;&lt;br&gt;  System.out.println( &quot;Evaluating date now&quot; );&lt;br&gt;  java.util.Date date = new java.util.Date();
%&amp;gt;
Hello!&amp;nbsp; The time is now
&amp;lt;%&lt;br&gt;  // This scriptlet generates HTML output&lt;br&gt;  out.println( String.valueOf( date ));
%&amp;gt;
&amp;lt;/BODY&amp;gt;
&amp;lt;/HTML&amp;gt;&lt;/div&gt;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;But above example can be expressed as below.&lt;/pre&gt;
&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&amp;lt;HTML&amp;gt;&lt;br&gt;&amp;lt;BODY&amp;gt;&lt;br&gt;&amp;lt;%&lt;br&gt;&amp;nbsp; &amp;nbsp; // This scriptlet declares and initializes &quot;date&quot;&lt;br&gt;&amp;nbsp; &amp;nbsp; System.out.println( &quot;Evaluating date now&quot; );&lt;br&gt;&amp;nbsp; &amp;nbsp; java.util.Date date = new java.util.Date();&lt;br&gt;%&amp;gt;&lt;br&gt;Hello!&amp;nbsp; The time is now &amp;lt;%= date%&amp;gt;&lt;br&gt;&amp;lt;/BODY&amp;gt;&lt;br&gt;&amp;lt;/HTML&amp;gt;
&lt;/div&gt;&lt;p&gt;&amp;nbsp; &lt;/p&gt;&lt;p&gt;Both ways shows the same result, but the second is much faster and have good readability than the first. code,&lt;br&gt;&lt;/p&gt;</description>
			<category>JSP</category>
			<category>JSP</category>
			<category>JSP Optimization</category>
			<category>Print Out Text Strings</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/275</guid>
			<comments>http://strcpy.com/275#entry275comment</comments>
			<pubDate>Mon, 27 Oct 2008 13:48:40 +0900</pubDate>
		</item>
		<item>
			<title>Put Date Time on HTML</title>
			<link>http://strcpy.com/274</link>
			<description>&lt;p&gt;In JSP, you can simply put Date Time as below.&lt;/p&gt;  &lt;br /&gt;  &lt;pre&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&amp;lt;HTML&amp;gt;&lt;br&gt;&amp;lt;BODY&amp;gt;&lt;br&gt;Hello!&amp;nbsp; The time is now &lt;span style=&quot;background-color: rgb(250, 255, 169);&quot;&gt;&amp;lt;%= new&lt;a href=&quot;/tag/java.util&quot;&gt;java.util&lt;/a&gt;.Date() %&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;lt;/BODY&amp;gt;&lt;br&gt;&amp;lt;/HTML&amp;gt;&lt;/div&gt;&lt;/pre&gt;</description>
			<category>JSP</category>
			<category>DateTime</category>
			<category>java.util</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/274</guid>
			<comments>http://strcpy.com/274#entry274comment</comments>
			<pubDate>Mon, 27 Oct 2008 13:42:19 +0900</pubDate>
		</item>
		<item>
			<title>Clipboard copy function working</title>
			<link>http://strcpy.com/272</link>
			<description>When copying trackback address or shortcut url on the articles, clipboard function is really useful.&lt;br&gt;But there are some compatibility issue in browsers.&lt;br&gt;&lt;br&gt;I checked below function is working on Microsoft Internet Explorer. For supporting Firefox, you need to find another solution.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;function copy_clip(meintext){&lt;br&gt;    if (window.clipboardData) { &lt;br&gt;        // the IE-manier&lt;br&gt;        window.clipboardData.setData(&quot;Text&quot;, meintext);&lt;br&gt;        // waarschijnlijk niet de beste manier om Moz/NS te detecteren;&lt;br&gt;        // het is mij echter onbekend vanaf welke versie dit precies werkt:&lt;br&gt;    } else if (window.netscape) {&lt;br&gt;        // dit is belangrijk maar staat nergens duidelijk vermeld:&lt;br&gt;        // you have to sign the code to enable this, or see notes below&lt;br&gt;        netscape.security.PrivilegeManager.enablePrivilege(&#039;UniversalXPConnect&#039;);&lt;br&gt;&lt;br&gt;        // maak een interface naar het clipboard&lt;br&gt;        var clip = Components.classes[&#039;@mozilla.org/widget/clipboard;1&#039;].createInstance(Components.interfaces.nsIClipboard);&lt;br&gt;        if (!clip) return;&lt;br&gt;&lt;br&gt;        // maak een transferable&lt;br&gt;        var trans = Components.classes[&#039;@mozilla.org/widget/transferable;1&#039;].createInstance(Components.interfaces.nsITransferable);&lt;br&gt;        if (!trans) return;&lt;br&gt;&lt;br&gt;        // specificeer wat voor soort data we op willen halen; text in dit geval&lt;br&gt;        trans.addDataFlavor(&#039;text/unicode&#039;);&lt;br&gt;&lt;br&gt;        // om de data uit de transferable te halen hebben we 2 nieuwe objecten nodig om het in op te slaan&lt;br&gt;        var str = new Object();&lt;br&gt;        var len = new Object();&lt;br&gt;&lt;br&gt;        var str = Components.classes[&quot;@mozilla.org/supports-string;1&quot;].createInstance(Components.interfaces.nsISupportsString);&lt;br&gt;&lt;br&gt;        var copytext=meintext;&lt;br&gt;&lt;br&gt;        str.data=copytext;&lt;br&gt;&lt;br&gt;        trans.setTransferData(&quot;text/unicode&quot;,str,copytext.length*2);&lt;br&gt;&lt;br&gt;        var clipid=Components.interfaces.nsIClipboard;&lt;br&gt;&lt;br&gt;        if (!clip) return false;&lt;br&gt;&lt;br&gt;        clip.setData(trans,null,clipid.kGlobalClipboard);&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    var msg = alert_msg[&#039;url_copy&#039;];&lt;br&gt;    if(typeof(msg)==&#039;undefined&#039;||!msg) return;&lt;br&gt;    alert(msg);&lt;br&gt;}&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Usage sample&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&amp;lt;a href=# onclick=&#039;copy_clip( &quot;http://kurapa.com&quot;); return false;&#039;&amp;gt;http://kurapa.com&amp;lt;/a&amp;gt;&lt;/div&gt;&lt;/pre&gt;&lt;br&gt;</description>
			<category>Javascript</category>
			<category>clipboard copy</category>
			<category>ie clipboard</category>
			<category>javascript clipboard</category>
			<category>text string copy</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/272</guid>
			<comments>http://strcpy.com/272#entry272comment</comments>
			<pubDate>Fri, 17 Oct 2008 13:28:56 +0900</pubDate>
		</item>
		<item>
			<title>Find File at certain directory in Delphi</title>
			<link>http://strcpy.com/271</link>
			<description>This function we show below receives as parameters a file specification (like for example &#039;C:\tmp\*.tmp&#039; or &#039;C:\*&#039; if you want to search the entire hard disk.) and optionally a set of attributes (exactly as Delphi&#039;s&lt;a href=&quot;/tag/FindFirst&quot;&gt;FindFirst&lt;/a&gt; function), and it returs a StringList with the full pathnames of the found files. You should free the StringList after using it.&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;interface&lt;br&gt;&lt;br&gt;uses SysUtils, Classes;&lt;br&gt;&lt;br&gt;function FindFile(const filespec: TFileName; attributes: integer&lt;br&gt;&amp;nbsp;&amp;nbsp; = faReadOnly Or faHidden Or faSysFile Or faArchive): TStringList;&lt;br&gt;&lt;br&gt;implementation&lt;br&gt;&lt;br&gt;function FindFile(const filespec: TFileName; attributes: integer): TStringList;&lt;br&gt;var&lt;br&gt;&amp;nbsp; spec: string;&lt;br&gt;&amp;nbsp; list: TStringList;&lt;br&gt;&lt;br&gt;procedure RFindFile(const folder: TFileName);&lt;br&gt;var&lt;br&gt;&amp;nbsp; SearchRec: TSearchRec;&lt;br&gt;begin&lt;br&gt;&amp;nbsp; // Locate all matching files in the current&lt;br&gt;&amp;nbsp; // folder and add their names to the list&lt;br&gt;&amp;nbsp; if FindFirst(folder + spec, attributes, SearchRec) = 0 then begin&lt;br&gt;&amp;nbsp; &amp;nbsp; try&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; repeat&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (SearchRec.Attr and faDirectory = 0) or&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; (SearchRec.Name &amp;lt;&amp;gt; &#039;.&#039;) and (SearchRec.Name &amp;lt;&amp;gt; &#039;..&#039;) then&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; list.Add(folder + SearchRec.Name);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; until FindNext(SearchRec) &amp;lt;&amp;gt; 0;&lt;br&gt;&amp;nbsp; &amp;nbsp; except&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; FindClose(SearchRec);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; raise;&lt;br&gt;&amp;nbsp; &amp;nbsp; end;&lt;br&gt;&amp;nbsp; &amp;nbsp; FindClose(SearchRec);&lt;br&gt;&amp;nbsp; end;&lt;br&gt;&amp;nbsp; // Now search the subfolders&lt;br&gt;&amp;nbsp; if FindFirst(folder + &#039;*&#039;, attributes&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Or faDirectory, SearchRec) = 0 then&lt;br&gt;&amp;nbsp; begin&lt;br&gt;&amp;nbsp; &amp;nbsp; try&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; repeat&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ((SearchRec.Attr and faDirectory) &amp;lt;&amp;gt; 0) and&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; (SearchRec.Name &amp;lt;&amp;gt; &#039;.&#039;) and (SearchRec.Name &amp;lt;&amp;gt; &#039;..&#039;) then&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RFindFile(folder + SearchRec.Name + &#039;\&#039;);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; until FindNext(SearchRec) &amp;lt;&amp;gt; 0;&lt;br&gt;&amp;nbsp; &amp;nbsp; except&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; FindClose(SearchRec);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; raise;&lt;br&gt;&amp;nbsp; &amp;nbsp; end;&lt;br&gt;&amp;nbsp; &amp;nbsp; FindClose(SearchRec);&lt;br&gt;&amp;nbsp; end;&lt;br&gt;end; // procedure RFindFile inside of FindFile&lt;br&gt;&lt;br&gt;begin // function FindFile&lt;br&gt;&amp;nbsp; list := TStringList.Create;&lt;br&gt;&amp;nbsp; try&lt;br&gt;&amp;nbsp; &amp;nbsp; spec := ExtractFileName(filespec);&lt;br&gt;&amp;nbsp; &amp;nbsp; RFindFile(ExtractFilePath(filespec));&lt;br&gt;&amp;nbsp; &amp;nbsp; Result := list;&lt;br&gt;&amp;nbsp; except&lt;br&gt;&amp;nbsp; &amp;nbsp; list.Free;&lt;br&gt;&amp;nbsp; &amp;nbsp; raise;&lt;br&gt;&amp;nbsp; end;&lt;br&gt;end;&lt;/div&gt;&lt;br&gt;&lt;br&gt;Sample call&lt;br&gt;&lt;br&gt;You can try this function placing a ListBox and a button on a form and adding this code to the OnClick event of the button:&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br&gt;var&lt;br&gt;&amp;nbsp; list: TStringList;&lt;br&gt;begin&lt;br&gt;&amp;nbsp; list := FindFile(&#039;C:\Delphi\*.pas&#039;);&lt;br&gt;&amp;nbsp; ListBox1.Items.Assign(list);&lt;br&gt;&amp;nbsp; list.Free;&lt;br&gt;end;&lt;/div&gt;</description>
			<category>Borland Delphi</category>
			<category>File Search</category>
			<category>FindFirst</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/271</guid>
			<comments>http://strcpy.com/271#entry271comment</comments>
			<pubDate>Fri, 10 Oct 2008 13:08:32 +0900</pubDate>
		</item>
		<item>
			<title>How to delete file on certain path ?</title>
			<link>http://strcpy.com/270</link>
			<description>The file deletion function is really simple. It&#039;s exactly the same with C function.&lt;br&gt;Following is the example.&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;unlink( &#039;c:/hello.world.txt&#039;);&lt;/div&gt;&lt;br&gt;</description>
			<category>PHP</category>
			<category>Delete File</category>
			<category>File Delete Function</category>
			<category>Unlink</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/270</guid>
			<comments>http://strcpy.com/270#entry270comment</comments>
			<pubDate>Wed, 01 Oct 2008 16:45:18 +0900</pubDate>
		</item>
		<item>
			<title>ASCII Artwork Generator from image file</title>
			<link>http://strcpy.com/268</link>
			<description>Now a days, we don&#039;t use&lt;a href=&quot;/tag/ASCII Artwork&quot;&gt;ASCII Artwork&lt;/a&gt; usually for internet communication, because technology is changing rapidly.&lt;br&gt;&lt;br&gt;Following snipet is the really great source can generage ASCII Artwork from image file such as jpeg or gif.&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&amp;lt;?php&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; $filename = $_POST[&#039;file&#039;];&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; $image = file_get_contents($filename);&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; $image = imagecreatefromstring($image);&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; $width = imagesx($image);&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; $height = imagesy($image);&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; $m_aspect = 164.0 / 48.0;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; $i_aspect = $width / $height;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; if($i_aspect &amp;lt; $m_aspect)&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $percent = 48.0 / $height;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $new_height = $height * $percent;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $new_width = 11.875 * $new_height / 6.0 * $width / $height;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; else&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $percent = 164.0 / $width;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $new_width = $width * $percent;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $new_height = 6.0 * $new_width / 11.875 * $height / $width;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; $image_p =&lt;a href=&quot;/tag/imagecreatetruecolor&quot;&gt;imagecreatetruecolor&lt;/a&gt;($new_width, $new_height);&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href=&quot;/tag/imagecopyresampled&quot;&gt;imagecopyresampled&lt;/a&gt;($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; for($i = 0; $i &amp;lt; $new_height; $i++)&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $rgb =&lt;a href=&quot;/tag/ImageColorAt&quot;&gt;ImageColorAt&lt;/a&gt;($image_p, 0, $i); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; // OPTIMIZED&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $r = dechex(($rgb &amp;gt;&amp;gt; 16) &amp;amp; 0xFF); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; // OPTIMIZED&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $g = dechex(($rgb &amp;gt;&amp;gt; 8) &amp;amp; 0xFF); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; // OPTIMIZED&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $b = dechex($rgb &amp;amp; 0xFF); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // OPTIMIZED&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &#039;&amp;lt;font color=&quot;#&#039; . $r . $g . $b . &#039;&quot;&amp;gt;&#039; . strtoupper(dechex(rand(0, 15))); &amp;nbsp; &amp;nbsp; // OPTIMIZED&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for($j = 1; $j &amp;lt; $new_width; $j++)&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; $rgb = ImageColorAt($image_p, $j, $i);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; $r = dechex(($rgb &amp;gt;&amp;gt; 16) &amp;amp; 0xFF);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; $g = dechex(($rgb &amp;gt;&amp;gt; 8) &amp;amp; 0xFF);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; $b = dechex($rgb &amp;amp; 0xFF);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; if(strlen($r) &amp;lt; 2)&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $r = &#039;0&#039; . $r;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; if(strlen($g) &amp;lt; 2)&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $g = &#039;0&#039; . $g;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; if(strlen($b) &amp;lt; 2)&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $b = &#039;0&#039; . $b;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; }&lt;br&gt;// NO OPTIMIZATION &amp;nbsp; &amp;nbsp; echo &#039;&amp;lt;font color=&quot;#&#039; . $r . $g . $b . &#039;&quot;&amp;gt;&#039; . strtoupper(dechex(rand(0, 15))) . &#039;&amp;lt;/font&amp;gt;&#039;;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; if($rgb != ImageColorAt($image_p, $j - 1, $i)) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; // OPTIMIZED&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; { &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // OPTIMIZED&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &#039;&amp;lt;/font&amp;gt;&amp;lt;font color=&quot;#&#039; . $r . $g . $b . &#039;&quot;&amp;gt;&#039;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; // OPTIMIZED&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; } &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // OPTIMIZED&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; echo strtoupper(dechex(rand(0, 15))); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // OPTIMIZED&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; // OPTIMIZED&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &#039;&amp;lt;/font&amp;gt;&#039;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // OPTIMIZED&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &#039;&amp;lt;br&amp;gt;&#039; . &quot;\n\n&quot;;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; imagedestroy($image);&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; imagedestroy($image_p);&lt;br&gt;?&amp;gt;&lt;/div&gt;</description>
			<category>PHP</category>
			<category>ASCII Artwork</category>
			<category>ImageColorAt</category>
			<category>imagecopyresampled</category>
			<category>imagecreatetruecolor</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/268</guid>
			<comments>http://strcpy.com/268#entry268comment</comments>
			<pubDate>Tue, 23 Sep 2008 07:55:23 +0900</pubDate>
		</item>
		<item>
			<title>Finding process name on OS</title>
			<link>http://strcpy.com/267</link>
			<description>Following function is very useful when checking currently working process based on name.&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;using System.Diagnostics;&lt;br&gt;&lt;br&gt;.&lt;br&gt;.&lt;br&gt;.&lt;br&gt;&lt;br&gt;public bool&lt;a href=&quot;/tag/IsProcessOpen&quot;&gt;IsProcessOpen&lt;/a&gt;(string name)&lt;br&gt;{&lt;br&gt;&amp;nbsp; &amp;nbsp; foreach (Process clsProcess in Process&lt;a href=&quot;/tag/GetProcess&quot;&gt;GetProcess&lt;/a&gt;es) {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (clsProcess.ProcessName.Contains(name))&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br&gt;&amp;nbsp; &amp;nbsp; }&lt;br&gt;&amp;nbsp; &amp;nbsp; return false;&lt;br&gt;}&lt;/div&gt;&lt;br&gt;</description>
			<category>C#</category>
			<category>GetProcess</category>
			<category>IsProcessOpen</category>
			<category>Process Name</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/267</guid>
			<comments>http://strcpy.com/267#entry267comment</comments>
			<pubDate>Mon, 22 Sep 2008 13:05:52 +0900</pubDate>
		</item>
		<item>
			<title>Convert System.DateTime to UNIX timestamp</title>
			<link>http://strcpy.com/266</link>
			<description>In case of development in clinet/server application, datetime formation conversion is frequently required.&lt;br&gt;Following is the simple example for datetime conversion.&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;private double ConvertToTimestamp(DateTime value)&lt;br&gt;{&lt;br&gt;&amp;nbsp; &amp;nbsp; //create Timespan by subtracting the value provided from&lt;br&gt;&amp;nbsp; &amp;nbsp; //the Unix Epoch&lt;br&gt;&amp;nbsp; &amp;nbsp; TimeSpan span = (value - new DateTime(1970, 1, 1, 0, 0, 0, 0).ToLocalTime());&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; //return the total seconds (which is a UNIX timestamp)&lt;br&gt;&amp;nbsp; &amp;nbsp; return (double)span.TotalSeconds;&lt;br&gt;}&lt;/div&gt;</description>
			<category>C#</category>
			<category>DateTime Conversion</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/266</guid>
			<comments>http://strcpy.com/266#entry266comment</comments>
			<pubDate>Mon, 22 Sep 2008 10:23:22 +0900</pubDate>
		</item>
		<item>
			<title>Retrieve system information</title>
			<link>http://strcpy.com/265</link>
			<description>When system information is required in application,&lt;a href=&quot;/tag/SystemInformation&quot;&gt;SystemInformation&lt;/a&gt; global instance is very useful.&lt;br&gt;&lt;br&gt;In case of getting&lt;a href=&quot;/tag/Monitor Size&quot;&gt;Monitor Size&lt;/a&gt;,&lt;a href=&quot;/tag/Virtual Screen&quot;&gt;Virtual Screen&lt;/a&gt;,&lt;a href=&quot;/tag/Computer Name&quot;&gt;Computer Name&lt;/a&gt;,&lt;a href=&quot;/tag/Keyboard Delay&quot;&gt;Keyboard Delay&lt;/a&gt;,&lt;a href=&quot;/tag/Network Connection&quot;&gt;Network Connection&lt;/a&gt;,&lt;a href=&quot;/tag/Power Status&quot;&gt;Power Status&lt;/a&gt;, and other system variables, SystemInformation instance is very useful.&lt;br&gt;&lt;br&gt;Following reference code is the example.&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;//Namespace reference&lt;br&gt;using System:&lt;br&gt;&lt;br&gt;.&lt;br&gt;.&lt;br&gt;.&lt;br&gt;&lt;div style=&quot;font-weight: normal; font-family: &#039;Courier New&#039;,Courier,monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; 
Hashtable sysValues = &lt;a href=&quot;http://www.google.com/search?q=new+msdn.microsoft.com&quot;&gt;&lt;span style=&quot;color: rgb(0, 128, 0);&quot;&gt;new&lt;/span&gt;&lt;/a&gt; Hashtable&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;)&lt;/span&gt;;&lt;/div&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sysValues.Add(&quot;Monitor Size: &quot;, SystemInformation.PrimaryMonitorSize);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sysValues.Add(&quot;VirtualScreen: &quot;, SystemInformation.VirtualScreen);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sysValues.Add(&quot;Working Size: &quot;, SystemInformation.WorkingArea);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sysValues.Add(&quot;Computer Name: &quot;, SystemInformation.ComputerName);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sysValues.Add(&quot;Keyboard Delay: &quot;, SystemInformation.KeyboardDelay);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sysValues.Add(&lt;a href=&quot;/tag/Total Monitors&quot;&gt;Total Monitors&lt;/a&gt;: &quot;, SystemInformation.MonitorCount);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sysValues.Add(&quot;Network Connection: &quot;, SystemInformation.Network);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sysValues.Add(&quot;Power Status: &quot;, SystemInformation.PowerStatus);&lt;br&gt;.&lt;br&gt;.&lt;/div&gt;&lt;br&gt;&lt;br&gt;</description>
			<category>C#</category>
			<category>Computer Name</category>
			<category>Keyboard Delay</category>
			<category>Monitor Size</category>
			<category>Network Connection</category>
			<category>Power Status</category>
			<category>SystemInformation</category>
			<category>Total Monitors</category>
			<category>Virtual Screen</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/265</guid>
			<comments>http://strcpy.com/265#entry265comment</comments>
			<pubDate>Mon, 22 Sep 2008 09:29:02 +0900</pubDate>
		</item>
		<item>
			<title>How to call SetTimer function on MFC CDialog class ?</title>
			<link>http://strcpy.com/264</link>
			<description>&lt;span class=&quot;postbody&quot;&gt;Hi, problem with&lt;a href=&quot;/tag/MFC&quot;&gt;MFC&lt;/a&gt; Dialog based app:
&lt;br&gt;

&lt;br&gt;
In &lt;span style=&quot;font-weight: bold;&quot;&gt;OnInitDialog&lt;/span&gt;:
&lt;br&gt;

&lt;br&gt;
&lt;/span&gt;
&lt;table width=&quot;90%&quot; align=&quot;center&quot; border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;1&quot;&gt;
&lt;tbody&gt;&lt;tr&gt; 
	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
	  &lt;td class=&quot;code&quot;&lt;a href=&quot;/tag/SetTimer&quot;&gt;SetTimer&lt;/a&gt;(&lt;a href=&quot;/tag/WM_USER&quot;&gt;WM_USER&lt;/a&gt;+100, 500, NULL );&lt;/td&gt;
	&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span class=&quot;postbody&quot;&gt;
&lt;br&gt;

&lt;br&gt;
In &lt;span style=&quot;font-weight: bold;&quot;&gt;OnTimer&lt;/span&gt;:
&lt;br&gt;

&lt;br&gt;
&lt;/span&gt;
&lt;table width=&quot;90%&quot; align=&quot;center&quot; border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;1&quot;&gt;
&lt;tbody&gt;&lt;tr&gt; 
	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
	  &lt;td class=&quot;code&quot;&gt;
&lt;br&gt;
MessageBox(...
&lt;br&gt;
CDialog::OnTimer(nIDEvent);
&lt;br&gt;
&lt;/td&gt;
	&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span class=&quot;postbody&quot;&gt;
&lt;br&gt;

&lt;br&gt;
But OnTimer never reached. Why? When i call SendMessage(&lt;a href=&quot;/tag/WM_TIMER&quot;&gt;WM_TIMER&lt;/a&gt;, 0, 0); OnTimer calls succesfully.&lt;/span&gt;</description>
			<category>C, C++</category>
			<category>Event Call</category>
			<category>MFC</category>
			<category>SetTimer</category>
			<category>WM_TIMER</category>
			<category>WM_USER</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/264</guid>
			<comments>http://strcpy.com/264#entry264comment</comments>
			<pubDate>Wed, 30 Jul 2008 10:16:29 +0900</pubDate>
		</item>
		<item>
			<title>How to search file on certain directory ?</title>
			<link>http://strcpy.com/263</link>
			<description>In case of finding files on certain directory, you need to use&lt;a href=&quot;/tag/FindFirstFileEx&quot;&gt;FindFirstFileEx&lt;/a&gt; function.&lt;br&gt;&lt;br&gt;Following example shows the example,&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;bool KFindFile(void *findname)&lt;br&gt;{&lt;br&gt;&amp;nbsp; &amp;nbsp; WIN32_FIND_DATA FindFileData;&lt;br&gt;&amp;nbsp; &amp;nbsp; HANDLE hFind;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; CString strSearch = (LPCTSTR)findname;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; hFind = FindFirstFileEx( strSearch, FindExInfoStandard, &amp;amp;FindFileData, FindExSearchNameMatch, NULL, 0);&lt;br&gt;&amp;nbsp; &amp;nbsp; if (hFind==INVALID_HANDLE_VALUE)&lt;br&gt;&amp;nbsp; &amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox( NULL, CString(&quot;Invalid Handle Value&quot;), CString(&quot;Error&quot;), MB_OK);&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;br&gt;&amp;nbsp; &amp;nbsp; }&lt;br&gt;&amp;nbsp; &amp;nbsp; else&lt;br&gt;&amp;nbsp; &amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox( NULL, (LPCTSTR)FindFileData.cFileName, (LPCTSTR)FindFileData.cFileName, MB_OK);&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FindClose( hFind);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;br&gt;&amp;nbsp; &amp;nbsp; }&lt;br&gt;}&lt;/div&gt;&lt;br&gt;Above source works on Windows CE Platform as well. And you can use above function as below:&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;.&lt;br&gt;.&lt;br&gt;.&lt;br&gt;KFindFile( _T(&quot;\\My Documents\\My Pictures\\PIC-*.jpg&quot;));&lt;br&gt;.&lt;br&gt;.&lt;br&gt;.&lt;/div&gt;&lt;br&gt;&lt;br&gt;</description>
			<category>C, C++</category>
			<category>evc</category>
			<category>FindFirstFileEx</category>
			<category>Search File</category>
			<category>WIN32 API</category>
			<category>WinCE</category>
			<category>WIndows CE</category>
			<category>Windows XP</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/263</guid>
			<comments>http://strcpy.com/263#entry263comment</comments>
			<pubDate>Mon, 16 Jun 2008 08:50:59 +0900</pubDate>
		</item>
		<item>
			<title>IFRAME Auto Resize in IE, FireFox by Javascript</title>
			<link>http://strcpy.com/262</link>
			<description>Here&#039;s the simple&lt;a href=&quot;/tag/iframe&quot;&gt;iframe&lt;/a&gt; auto-resize example working on&lt;a href=&quot;/tag/IE&quot;&gt;IE&lt;/a&gt;, and&lt;a href=&quot;/tag/FireFox&quot;&gt;FireFox&lt;/a&gt;.&lt;BR&gt;&lt;BR&gt;
&lt;DIV style=&quot;PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: rgb(228,228,228)&quot;&gt;&amp;lt;iframe id=&#039;ifrm&#039;&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; frameborder=0&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; width=100%&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; height=450&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scrolling=no&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; src=&#039;http://kurapa.com&#039;&lt;BR&gt;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;BR&gt;&lt;BR&gt;&amp;lt;script language=&#039;javascript&#039;&amp;gt;&lt;BR&gt;&lt;BR&gt;function getDocHeight(doc)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; var docHt = 0, sh, oh;&lt;BR&gt;&amp;nbsp; if (doc.height)&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp; &amp;nbsp; docHt = doc.height;&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&amp;nbsp; else if (doc.body)&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp; &amp;nbsp; if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;&lt;BR&gt;&amp;nbsp; &amp;nbsp; if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;&lt;BR&gt;&amp;nbsp; &amp;nbsp; if (sh &amp;amp;&amp;amp; oh) docHt = Math.max(sh, oh);&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&amp;nbsp; return docHt;&lt;BR&gt;}&lt;/DIV&gt;
&lt;DIV style=&quot;PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: rgb(228,228,228)&quot;&gt;function getReSize()&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; var iframeWin = window.frames[&#039;ifrm&#039;];&lt;/DIV&gt;
&lt;DIV style=&quot;PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: rgb(228,228,228)&quot;&gt;&amp;nbsp; var iframeEl = window.document.getElementById? window.document.getElementById(&#039;ifrm&#039;): document.all? document.all[&#039;ifrm&#039;]: null;&lt;/DIV&gt;
&lt;DIV style=&quot;PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: rgb(228,228,228)&quot;&gt;&amp;nbsp; if ( iframeEl &amp;amp;&amp;amp; iframeWin )&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp; &amp;nbsp; var docHt = getDocHeight(iframeWin.document);&lt;/DIV&gt;
&lt;DIV style=&quot;PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: rgb(228,228,228)&quot;&gt;&amp;nbsp; &amp;nbsp; if (docHt != iframeEl.style.height) iframeEl.style.height = docHt + &#039;px&#039;;&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&amp;nbsp; else&lt;BR&gt;&amp;nbsp; { // firefox&lt;BR&gt;&amp;nbsp; &amp;nbsp; var docHt = window.document.getElementById(&#039;ifrm&#039;).contentDocument.height;&lt;BR&gt;&amp;nbsp; &amp;nbsp; window.document.getElementById(&#039;ifrm&#039;).style.height = docHt + &#039;px&#039;;&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;}&lt;/DIV&gt;
&lt;DIV style=&quot;PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: rgb(228,228,228)&quot;&gt;function getRetry()&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; &amp;nbsp; getReSize();&lt;BR&gt;&amp;nbsp; &amp;nbsp; setTimeout(&#039;getRetry()&#039;,500);&lt;BR&gt;}&lt;BR&gt;getRetry();&lt;BR&gt;&amp;lt;/script&amp;gt;&lt;/DIV&gt;&lt;BR&gt;</description>
			<category>Javascript</category>
			<category>auto resize</category>
			<category>FireFox</category>
			<category>IE</category>
			<category>iframe</category>
			<category>iframe auto resize</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/262</guid>
			<comments>http://strcpy.com/262#entry262comment</comments>
			<pubDate>Sat, 03 May 2008 08:39:31 +0900</pubDate>
		</item>
		<item>
			<title>How to limit by Timeout when opening URL ?</title>
			<link>http://strcpy.com/261</link>
			<description>Previously, I wrote the example to set&lt;a href=&quot;/tag/timeout&quot;&gt;timeout&lt;/a&gt; for&lt;a href=&quot;/tag/fopen&quot;&gt;fopen&lt;/a&gt; function. But it is not practical way to put timeout, because the configuration data is also modified by that function.&lt;br&gt;&lt;br&gt;Here&#039;s another way to achieve the same function.&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;$query = &quot;http://kurapa.com/api/?lic=&quot; . $license_key . &quot;&amp;amp;i=&quot; . $ipaddress;&lt;br&gt;$url = parse_url($query);&lt;br&gt;$host = $url[&quot;host&quot;];&lt;br&gt;$path = $url[&quot;path&quot;] . &quot;?&quot; . $url[&quot;query&quot;];&lt;br&gt;$timeout = 1;&lt;br&gt;$fp =&lt;a href=&quot;/tag/fsockopen&quot;&gt;fsockopen&lt;/a&gt; ($host, 80, $errno, $errstr, $timeout)&lt;br&gt;&amp;nbsp; &amp;nbsp; or die(&#039;Can not open connection to server.&#039;);&lt;br&gt;if ($fp)&lt;br&gt;{&lt;br&gt;&amp;nbsp; fputs ($fp, &quot;GET $path HTTP/1.0\nHost: &quot; . $host . &quot;\n\n&quot;);&lt;br&gt;&amp;nbsp; while (!feof($fp))&lt;br&gt;&amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; $buf .= fgets($fp, 128);&lt;br&gt;&amp;nbsp; }&lt;br&gt;&amp;nbsp; $lines = split(&quot;\n&quot;, $buf);&lt;br&gt;&amp;nbsp; $data = $lines[count($lines)-1];&lt;br&gt;&amp;nbsp; fclose($fp);&lt;br&gt;} else {&lt;br&gt;&amp;nbsp; # enter error handing code here&lt;br&gt;}&lt;br&gt;echo $data;&lt;/div&gt;&lt;br&gt;&lt;br&gt;As you can see above, I used fsockopen function to put timeout.&lt;br&gt;</description>
			<category>PHP</category>
			<category>fopen</category>
			<category>fsockopen</category>
			<category>timeout</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/261</guid>
			<comments>http://strcpy.com/261#entry261comment</comments>
			<pubDate>Mon, 14 Apr 2008 11:24:25 +0900</pubDate>
		</item>
		<item>
			<title>How to put timeout when opening URL by fopen ?</title>
			<link>http://strcpy.com/260</link>
			<description>Here&#039;s the simplest way to implement that.&lt;br&gt;&lt;br&gt;&amp;lt;?php&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;/tag/timeout&quot;&gt;timeout&lt;/a&gt; = 3;&lt;br&gt;&amp;nbsp; &amp;nbsp; $old = ini_set(&#039;default_socket_timeout&#039;, $timeout);&lt;br&gt;&amp;nbsp; &amp;nbsp; $file =&lt;a href=&quot;/tag/fopen&quot;&gt;fopen&lt;/a&gt;(&#039;http://example.com&#039;, &#039;r&#039;);&lt;br&gt;&amp;nbsp; &amp;nbsp; ini_set(&#039;default_socket_timeout&#039;, $old);&lt;br&gt;&amp;nbsp; &amp;nbsp; stream_set_timeout($file, $timeout);&lt;br&gt;&amp;nbsp; &amp;nbsp; stream_set_blocking($file, 0);&lt;br&gt;&amp;nbsp; &amp;nbsp; //the rest is standard&lt;br&gt;?&amp;gt;&lt;br&gt;</description>
			<category>PHP</category>
			<category>fopen</category>
			<category>timeout</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/260</guid>
			<comments>http://strcpy.com/260#entry260comment</comments>
			<pubDate>Mon, 31 Mar 2008 21:30:17 +0900</pubDate>
		</item>
		<item>
			<title>How can I increase MySQL max connections?</title>
			<link>http://strcpy.com/259</link>
			<description>&lt;span class=&quot;mediumtext&quot;&gt;edit the file /etc/my.cnf&lt;br /&gt;
&lt;br /&gt;
The file should look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;/tag/mysql&quot;&gt;mysql&lt;/a&gt;d]&lt;br /&gt;
set-variable = max_connections=500&lt;br /&gt;
&lt;br /&gt;
Increase 500 to the number you desire.&lt;/span&gt;</description>
			<category>SQL</category>
			<category>max connection</category>
			<category>mysql</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/259</guid>
			<comments>http://strcpy.com/259#entry259comment</comments>
			<pubDate>Wed, 19 Mar 2008 05:42:00 +0900</pubDate>
		</item>
		<item>
			<title>How to rename(change file name) in C# ?</title>
			<link>http://strcpy.com/258</link>
			<description>Simplest way to change file name in C# is using File.Move() function.&lt;br&gt;&lt;br&gt;Here&#039;s the simple example change file name for Samsung Black Jack Phone. However it may work on another platform if it supports .NET compact framework.&lt;br&gt;&lt;br&gt;In addition, File creation time can be obtained by FileInfo class. See the below example for addition example.&lt;br&gt;&lt;br&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;//&lt;br&gt;// Programmed 2008 by Kurapa Chunun Kang (kurapa@kurapa.com)&lt;br&gt;//&lt;br&gt;using System;&lt;br&gt;using System.Collections.Generic;&lt;br&gt;using System.Linq;&lt;br&gt;using System.Text;&lt;br&gt;using System.IO; // added for FileInfo class&lt;br&gt;&lt;br&gt;namespace fnc&lt;br&gt;{&lt;br&gt;&amp;nbsp; &amp;nbsp; class Program&lt;br&gt;&amp;nbsp; &amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;  // developed for Samsung Black Jack Smart Phone&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void KChangeFileNameFo&lt;a href=&quot;/tag/BlackJack&quot;&gt;BlackJack&lt;/a&gt;(string strDir)&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int iocnt = 100;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DirectoryInfo dir = new DirectoryInfo( strDir);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FileInfo[] bmpfiles = dir.GetFiles(&quot;PIC-*.jpg&quot;);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Total number of bmp files&quot;, bmpfiles.Length);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (FileInfo f in bmpfiles)&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String fn = f&lt;a href=&quot;/tag/CreationTime&quot;&gt;CreationTime&lt;/a&gt;.Year + &quot;-&quot;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + ((f.CreationTime.Month&amp;lt;10) ? &quot;0&quot;:&quot;&quot;) + f.CreationTime.Month + &quot;-&quot;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + ((f.CreationTime.Day &amp;lt; 10) ? &quot;0&quot; : &quot;&quot;) + f.CreationTime.Day + &quot;_&quot;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + ((f.CreationTime.Hour &amp;lt; 10) ? &quot;0&quot; : &quot;&quot;) + f.CreationTime.Hour&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + ((f.CreationTime.Minute &amp;lt; 10) ? &quot;0&quot; : &quot;&quot;) + f.CreationTime.Minute&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + ((f.CreationTime.Second &amp;lt; 10) ? &quot;0&quot; : &quot;&quot;) + f.CreationTime.Second&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + (iocnt++)&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + &quot;.jpg&quot;;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; File.Move( strDir + &quot;\\&quot; + f.Name, strDir + &quot;\\&quot; + fn);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; KChangeFileNameForBlackJack(@&quot;\Storage Card\My Pictures&quot;);&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br&gt;&amp;nbsp; &amp;nbsp; }&lt;br&gt;}&lt;/div&gt;&lt;br&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a class=&quot;extensionIcon&quot; href=&quot;http://strcpy.com/attachment/1113679021.zip&quot;&gt;&lt;img src=&quot;http://strcpy.com/image/extension/zip.gif&quot; alt=&quot;&quot; /&gt; fnc.zip&lt;/a&gt;&lt;/div&gt;&lt;br&gt;</description>
			<category>C#</category>
			<category>BlackJack</category>
			<category>CreationTime</category>
			<category>DateTime</category>
			<category>Filename Change</category>
			<category>Rename</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/258</guid>
			<comments>http://strcpy.com/258#entry258comment</comments>
			<pubDate>Wed, 12 Mar 2008 10:32:36 +0900</pubDate>
		</item>
		<item>
			<title>How to convert W3C Date Time Format ?</title>
			<link>http://strcpy.com/257</link>
			<description>&lt;p&gt;When generating RSS, or Sitemap,&lt;a href=&quot;/tag/W3C Date Time Format&quot;&gt;W3C Date Time Format&lt;/a&gt; string is used. In case of using xmlrpc, it contains W3C Date Time Format string conversion module such as&lt;a href=&quot;/tag/w3cdatetime_encode&quot;&gt;w3cdatetime_encode&lt;/a&gt;, and&lt;a href=&quot;/tag/w3cdatetime_decode&quot;&gt;w3cdatetime_decode&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you don&#039;t use xmlrpc module, you can declare below module in order to use W3C Date Time Format string conversion module. Of course, if your PHP supports the function, you don&#039;t need to declare&amp;nbsp; below functions.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;
&lt;p&gt;// date helpers - added by kurapa 2008-02-12&lt;br /&gt;function w3cdatetime_encode($timet, $utc=0) {&lt;br /&gt;&amp;nbsp;if (!$utc) {&lt;br /&gt;&amp;nbsp; $t=strftime(&quot;%Y-%m-%dT%H:%M:%S&quot;, $timet);&lt;br /&gt;&amp;nbsp;} else {&lt;br /&gt;&amp;nbsp; if (function_exists(&quot;gmstrftime&quot;)) &lt;br /&gt;&amp;nbsp; &amp;nbsp;// gmstrftime doesn&#039;t exist in some versions&lt;br /&gt;&amp;nbsp; &amp;nbsp;// of PHP&lt;br /&gt;&amp;nbsp; &amp;nbsp;$t=gmstrftime(&quot;%Y-%m-%dT%H:%M:%S&quot;, $timet);&lt;br /&gt;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp; &amp;nbsp;$t=strftime(&quot;%Y-%m-%dT%H:%M:%S&quot;, $timet-date(&quot;Z&quot;));&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;$t .= &quot;+00:00&quot;;&lt;br /&gt;&amp;nbsp;return $t;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;function w3cdatetime_decode($idate, $utc=0) {&lt;br /&gt;&amp;nbsp;// return a timet in the localtime, or UTC&lt;br /&gt;&amp;nbsp;$t=0;&lt;br /&gt;&amp;nbsp;if (ereg(&quot;([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; $idate, $regs)) {&lt;br /&gt;&amp;nbsp; if ($utc) {&lt;br /&gt;&amp;nbsp; &amp;nbsp;$t=gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]);&lt;br /&gt;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp; &amp;nbsp;$t=mktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;} &lt;br /&gt;&amp;nbsp;return $t;&lt;br /&gt;}&lt;/p&gt;&lt;/div&gt;</description>
			<category>PHP</category>
			<category>W3C Date Time Format</category>
			<category>W3C Date Time Format Conversion</category>
			<category>w3cdatetime_decode</category>
			<category>w3cdatetime_encode</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/257</guid>
			<comments>http://strcpy.com/257#entry257comment</comments>
			<pubDate>Thu, 28 Feb 2008 06:28:22 +0900</pubDate>
		</item>
		<item>
			<title>Find Files in certain directory</title>
			<link>http://strcpy.com/256</link>
			<description>Following is the simple c# example to fins file in given directory.&lt;br /&gt;&lt;br /&gt;
&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;using System.IO; // added for FileInfo class&lt;br /&gt;&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;&lt;br /&gt;DirectoryInfo dir = &lt;span class=&quot;codeKeyword&quot;&gt;new&lt;/span&gt; DirectoryInfo(@&quot;F:\WINNT&quot;);&lt;br /&gt;FileInfo[] bmpfiles = dir.GetFiles(&quot;*.bmp&quot;);&lt;br /&gt;Console.WriteLine(&quot;Total number of bmp files&quot;, bmpfiles.Length);&lt;br /&gt;foreach( FileInfo f in bmpfiles)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; Console.WriteLine(&quot;Name &lt;span class=&quot;codeKeyword&quot;&gt;is&lt;/span&gt; : {0}&quot;, f.Name);&lt;br /&gt;&amp;nbsp; Console.WriteLine(&quot;Length of the file &lt;span class=&quot;codeKeyword&quot;&gt;is&lt;/span&gt; : {0}&quot;, f.Length);&lt;br /&gt;&amp;nbsp; Console.WriteLine(&quot;Creation time &lt;span class=&quot;codeKeyword&quot;&gt;is&lt;/span&gt; : {0}&quot;, f.CreationTime);&lt;br /&gt;&amp;nbsp; Console.WriteLine(&quot;Attributes of the file are : {0}&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; f.Attributes.ToString());&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;</description>
			<category>C#</category>
			<category>File Search</category>
			<category>FindFile</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/256</guid>
			<comments>http://strcpy.com/256#entry256comment</comments>
			<pubDate>Mon, 25 Feb 2008 10:57:50 +0900</pubDate>
		</item>
		<item>
			<title>Get the actual filesize for a size above 2GB in Windows</title>
			<link>http://strcpy.com/255</link>
			<description>&lt;code&gt;&lt;span class=&quot;html&quot;&gt;
If you want to get the actual&lt;a href=&quot;/tag/filesize&quot;&gt;filesize&lt;/a&gt; for a size above 2GB in Windows, you can use the&lt;a href=&quot;/tag/COM&quot;&gt;COM&lt;/a&gt;-extensions in PHP.&lt;br&gt;
&lt;br&gt;
An example is as follows:&lt;br&gt;
&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&lt;code&gt;&lt;span class=&quot;html&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;&amp;lt;?&lt;br&gt;function KF&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;ileSize&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;$file&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;)&lt;br&gt;{&lt;br&gt;&amp;nbsp; &amp;nbsp; if (&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;file_exists&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;$file&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;))&lt;br&gt;&amp;nbsp; &amp;nbsp; {&lt;br&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;default&quot;&gt;$fsobj &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;= new &lt;/span&gt;&lt;span class=&quot;default&quot;&gt;COM&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;Scripting.FileSystemObject&quot;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;);&lt;br&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;default&quot;&gt;$file &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;= &lt;/span&gt;&lt;span class=&quot;default&quot;&gt;$fsobj&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;GetFile&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;$file&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;);&lt;br&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;default&quot;&gt;$var &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;= (&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;$file&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;Size&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;) + &lt;/span&gt;&lt;span class=&quot;default&quot;&gt;1 &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;- &lt;/span&gt;&lt;span class=&quot;default&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;;&lt;br&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;br&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; return &lt;/span&gt;&lt;span class=&quot;default&quot;&gt;$var&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;;&lt;br&gt;
 &amp;nbsp; &amp;nbsp; }&lt;br&gt;&amp;nbsp; &amp;nbsp; else&lt;br&gt;&amp;nbsp; &amp;nbsp; {&lt;br&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; //&lt;/span&gt;&lt;span class=&quot;string&quot;&gt; File does not exist&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;&lt;br&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; return 0&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;;&lt;br&gt;&amp;nbsp; &amp;nbsp; }&lt;br&gt;}&lt;br&gt;
&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;span class=&quot;default&quot;&gt;&lt;br&gt;
&lt;/span&gt;This will return the corrent filesize. And it is very useful with
PHP-GTK applications, where you want to use the filesize for larger
files.&lt;br&gt;
&lt;br&gt;
This example also works for files over a Windows-network. Try this example with the function:&lt;br&gt;
&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&lt;span class=&quot;default&quot;&gt;&amp;lt;?&lt;br&gt;
 &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;echo KF&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;ileSize&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;c:/tmp/foo.mp3&quot;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;);&lt;br&gt;
&lt;/span&gt;&lt;span class=&quot;default&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/code&gt;</description>
			<category>PHP</category>
			<category>COM</category>
			<category>File Size</category>
			<category>filesize</category>
			<category>Get Actual File Size</category>
			<category>PHP COM-extensions</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/255</guid>
			<comments>http://strcpy.com/255#entry255comment</comments>
			<pubDate>Sun, 24 Feb 2008 15:46:08 +0900</pubDate>
		</item>
		<item>
			<title>How to elimiate the  &quot;Restore Previous Session&quot; dialog when FireFox 2.0 starts</title>
			<link>http://strcpy.com/254</link>
			<description>If you want to get rid of the &quot;Restore Previous Session&quot; dialog and simply start a new &lt;span class=&quot;highlight&quot;&gt;session&lt;/span&gt; everytime, you need to add one value in your &lt;span class=&quot;highlight&quot;&gt;Firefox&lt;/span&gt; config file.&lt;br /&gt;
&lt;br /&gt;1) put below strings in URL field&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;about:config&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;2) set &lt;span style=&quot;background-color: rgb(193, 193, 193);&quot;&gt;browser.sessionstore.enabled&lt;/span&gt; -&amp;gt; false&lt;br /&gt;&lt;br /&gt;3) set &lt;span style=&quot;background-color: rgb(193, 193, 193);&quot;&gt;browser.sessionstore.resume_session_once&lt;/span&gt; -&amp;gt; &quot;true&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Restart &lt;span class=&quot;highlight&quot;&gt;Firefox&lt;/span&gt;, and your done!</description>
			<category>MS Windows Tweak</category>
			<category>FireFox</category>
			<category>FIrefox Session</category>
			<category>Firefox Tweak</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/254</guid>
			<comments>http://strcpy.com/254#entry254comment</comments>
			<pubDate>Thu, 14 Feb 2008 08:19:46 +0900</pubDate>
		</item>
		<item>
			<title>ISO 8601 format time format string conversion</title>
			<link>http://strcpy.com/253</link>
			<description>When communicating with XML,&lt;a href=&quot;/tag/ISO 8601&quot;&gt;ISO 8601&lt;/a&gt; format time string is used. In case of using xmlrpc, it contains ISO 8601 format time string conversion module such as&lt;a href=&quot;/tag/iso8601_encode&quot;&gt;iso8601_encode&lt;/a&gt;, and iso8601_decode.&lt;br /&gt;&lt;br /&gt;If you don&#039;t use xmlrpc module, you can declare below module in order to use ISO 8601 format time string conversion module. Of course, if your PHP supports the function, you don&#039;t need to declare&amp;nbsp; below functions.&lt;br /&gt;&lt;br /&gt;
&lt;DIV style=&quot;PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: rgb(228,228,228)&quot;&gt;// date helpers&lt;br /&gt;function iso8601_encode($timet, $utc=0) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; // return an ISO8601 encoded string&lt;br /&gt;&amp;nbsp; &amp;nbsp; // really, timezones ought to be supported&lt;br /&gt;&amp;nbsp; &amp;nbsp; // but the XML-RPC spec says:&lt;br /&gt;&amp;nbsp; &amp;nbsp; //&lt;br /&gt;&amp;nbsp; &amp;nbsp; // &quot;Don&#039;t assume a timezone. It should be specified by the server in its&lt;br /&gt;&amp;nbsp; // documentation what assumptions it makes about timezones.&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; // &lt;br /&gt;&amp;nbsp; &amp;nbsp; // these routines always assume localtime unless &lt;br /&gt;&amp;nbsp; &amp;nbsp; // $utc is set to 1, in which case UTC is assumed&lt;br /&gt;&amp;nbsp; &amp;nbsp; // and an adjustment for locale is made when encoding&lt;br /&gt;&amp;nbsp; &amp;nbsp; if (!$utc) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $t=strftime(&quot;%Y%m%dT%H:%M:%S&quot;, $timet);&lt;br /&gt;&amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (function_exists(&quot;gmstrftime&quot;)) &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // gmstrftime doesn&#039;t exist in some versions&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // of PHP&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $t=gmstrftime(&quot;%Y%m%dT%H:%M:%S&quot;, $timet);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $t=strftime(&quot;%Y%m%dT%H:%M:%S&quot;, $timet-date(&quot;Z&quot;));&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; return $t;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function iso8601_decode($idate, $utc=0) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; // return a timet in the localtime, or UTC&lt;br /&gt;&amp;nbsp; &amp;nbsp; $t=0;&lt;br /&gt;&amp;nbsp; &amp;nbsp; if (ereg(&quot;([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})&quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$idate, $regs)) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ($utc) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $t=gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $t=mktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; } &lt;br /&gt;&amp;nbsp; &amp;nbsp; return $t;&lt;br /&gt;}&lt;/DIV&gt;&lt;br /&gt;&lt;br /&gt;As I mentioned, above functions will be very useful if you need to implement RSS, or Sitemap.&lt;br /&gt;</description>
			<category>PHP</category>
			<category>ISO 8601</category>
			<category>ISO 8601 Format</category>
			<category>ISO-8601</category>
			<category>ISO8601_decode</category>
			<category>iso8601_encode</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/253</guid>
			<comments>http://strcpy.com/253#entry253comment</comments>
			<pubDate>Wed, 13 Feb 2008 08:43:37 +0900</pubDate>
		</item>
		<item>
			<title>How to include Javascript from anonther ?</title>
			<link>http://strcpy.com/252</link>
			<description>&lt;p&gt;Actually there is such a function in PHP which function is &lt;a href=&quot;/tag/include&quot;&gt;include&lt;/a&gt;&quot;.&lt;br&gt;It&#039;s very strong function.&lt;br&gt;&lt;br&gt;But Javascript does not support such a function.&lt;br&gt;&lt;br&gt;Here&#039;s the alternate method to do that.&lt;br&gt;&lt;br&gt;&lt;br&gt;To include javascript, following is using usually:&lt;/p&gt;
&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;the_script.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/div&gt;
&lt;p&gt;&lt;br&gt;But above script is not available in Javascript so following is the alternate method to include another javascript.&lt;br&gt;&lt;br&gt;the_another_javascript.js:&lt;br&gt;&lt;/p&gt;
&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;document.write( &quot;&amp;lt;script type=\&quot;text/javascript\&quot; src=\&quot;the_script.js\&quot;&amp;gt;&amp;lt;/script&amp;gt;&quot;);&lt;/div&gt;
&lt;p&gt;Isn&#039;t it simple ?&lt;br&gt;&lt;br&gt;Actually the main logic above is writing script tag in the document.&lt;/p&gt;</description>
			<category>Javascript</category>
			<category>include</category>
			<category>javascript include in javascript</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/252</guid>
			<comments>http://strcpy.com/252#entry252comment</comments>
			<pubDate>Fri, 25 Jan 2008 15:30:01 +0900</pubDate>
		</item>
		<item>
			<title>Javascript based Browser Sniffing</title>
			<link>http://strcpy.com/251</link>
			<description>&lt;P&gt;The javascript browser snifer makes an extensive use of regular expressions and the&lt;a href=&quot;/tag/search&quot;&gt;search&lt;/a&gt;() and&lt;a href=&quot;/tag/match&quot;&gt;match&lt;/a&gt;() functions.&lt;br /&gt;&lt;br /&gt;By this function, you can know following information:&lt;br /&gt;[1] browser type&lt;br /&gt;[2] browser version&lt;br /&gt;[3] os type&lt;br /&gt;[4] os version&lt;br /&gt;[5] flash installation information&lt;br /&gt;&lt;br /&gt;Actually this script is effective when making web log.&lt;br /&gt;&lt;br /&gt;The following is the example of Javascript based&lt;a href=&quot;/tag/Browser Sniffing&quot;&gt;Browser Sniffing&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;
&lt;DIV style=&quot;PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4&quot;&gt;
&lt;P&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;js/brwsniff.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; var br=new Array(4);&lt;br /&gt;&amp;nbsp; var os=new Array(2);&lt;br /&gt;&amp;nbsp; var flash=new Array(2);&lt;br /&gt;&amp;nbsp; br=getBrowser();&lt;br /&gt;&amp;nbsp; os=getOS();&lt;br /&gt;&amp;nbsp; flash=hasFlashPlugin();&lt;br /&gt;&amp;nbsp; document.write(&quot;Browser identifier: &quot;+br[0]+&quot;&amp;lt;br /&amp;gt;&quot;);&lt;br /&gt;&amp;nbsp; document.write(&quot;Browser version: &quot;+br[1]+&quot;&amp;lt;br /&amp;gt;&quot;);&lt;br /&gt;&amp;nbsp; document.write(&quot;Browser major version: &quot;+getMajorVersion(br[1])+&quot;&amp;lt;br /&amp;gt;&quot;);&lt;br /&gt;&amp;nbsp; document.write(&quot;Browser minor version: &quot;+getMinorVersion(br[1])+&quot;&amp;lt;br /&amp;gt;&quot;);&lt;br /&gt;&amp;nbsp; document.write(&quot;Browser engine: &quot;+br[2]+&quot;&amp;lt;br /&amp;gt;&quot;);&lt;br /&gt;&amp;nbsp; document.write(&quot;Browser engine version: &quot;+br[3]+&quot;&amp;lt;br /&amp;gt;&quot;);&lt;br /&gt;&amp;nbsp; document.write(&quot;Full user agent string: &quot;+getFullUAString()+&quot;&amp;lt;br /&amp;gt;&quot;);&lt;br /&gt;&amp;nbsp; document.write(&quot;Operating system identifier: &quot;+os[0]+&quot;&amp;lt;br /&amp;gt;&quot;);&lt;br /&gt;&amp;nbsp; document.write(&quot;Operating system version: &quot;+os[1]+&quot;&amp;lt;br /&amp;gt;&quot;);&lt;br /&gt;&amp;nbsp; document.write(&quot;Is Flash installed? &quot; + (flash[0]==2 ? &quot;Yes&quot; : (flash[0] == 1 ? &quot;No&quot; : &quot;unknown&quot;)) + &quot;&amp;lt;br /&amp;gt;&quot;);&lt;br /&gt;&amp;nbsp; document.write(&quot;Flash version: &quot;+flash[1]+&quot;&amp;lt;br /&amp;gt;&quot;);&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;You can download the latest full script and demo at &lt;A href=&quot;http://jsbrwsniff.sourceforge.net/&quot;&gt;http://jsbrwsniff.sourceforge.net/&lt;/A&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a class=&quot;extensionIcon&quot; href=&quot;http://strcpy.com/attachment/1385212200.zip&quot;&gt;&lt;img src=&quot;http://strcpy.com/image/extension/zip.gif&quot; alt=&quot;&quot; /&gt; jsbrwsniff-0.5.3.zip&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;</description>
			<category>Javascript</category>
			<category>Browser Sniffing</category>
			<category>Flash Plugin Detection</category>
			<category>Get Browser Information</category>
			<category>Get Browser Version</category>
			<category>Get Flash Information</category>
			<category>Get Flash Installation Status</category>
			<category>Get OS Information</category>
			<category>match</category>
			<category>OS Version Detection</category>
			<category>RegExp</category>
			<category>Regular Expression</category>
			<category>search</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/251</guid>
			<comments>http://strcpy.com/251#entry251comment</comments>
			<pubDate>Fri, 25 Jan 2008 14:35:36 +0900</pubDate>
		</item>
		<item>
			<title>How to download a file from a certain URL to server ?</title>
			<link>http://strcpy.com/250</link>
			<description>It&#039;s very simple by PHP reserved function called as &quot;copy&quot;.&lt;br /&gt;&lt;br /&gt;Here&#039;s the simple example do that.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;padding: 10px; background-color: rgb(228, 228, 228);&quot;&gt;&amp;lt;?&lt;br /&gt;if (copy($url, $dest))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; echo &quot;copy OK!&quot;;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; echo &quot;copy failed !&quot;;&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;</description>
			<category>PHP</category>
			<category>copy file</category>
			<category>download file</category>
			<author>(Super Coder)</author>
			<guid>http://strcpy.com/250</guid>
			<comments>http://strcpy.com/250#entry250comment</comments>
			<pubDate>Mon, 21 Jan 2008 11:40:19 +0900</pubDate>
		</item>
	</channel>
</rss>
