<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>hjk41的日志</title>
    <link>https://blog.sinzy.net/@hjk41</link>
    <description></description>
    <pubDate>Tue, 16 Oct 2012 17:17:27 -0700</pubDate>
    <managingEditor>member@blog.sinzy.net (hjk41)</managingEditor>
    <language>zh-CN</language>
    <generator>n19 Blog Application v3.8</generator>
    <atom:link href="https://blog.sinzy.net/@hjk41/rss" rel="self" type="application/rss+xml" />
        <item>
      <title>building zlib 1.2.7 (64bit) with Visual Studio 2012</title>
      <link>https://blog.sinzy.net/@hjk41/entry/22891</link>
      <description><![CDATA[<p class="ubb__first"><strong>1.</strong> Open a command line window</p><p class="ubb__split"><strong>2. C:&gt;\</strong> &quot;(visual studio install directory)\Microsoft Visual Studio 10.0\VC\bin\amd64\vsvars32.bat&quot;</p><p class="ubb__split"><strong>3. C:&gt;\</strong> set path=&quot;(visual studio install directory)\Microsoft Visual Studio 10.0\VC\bin\amd64\&quot;;%path%<br />    This is to enable the system to find &quot;ml64.exe&quot; when we execute the next command</p><p class="ubb__split"><strong>4. C:&gt;\</strong> cd &quot;(zlib directory)\contrib\masmx64&quot;</p><p class="ubb__split"><strong>5. D:\zlib\&gt;</strong> bld_ml64.bat<br />    This batch file will compile two assembly files into corresponding object files: inffasx64.obj and gvmat64.obj. If you want to compile into 32bit library, just replace masmx64 with masmx32, and bld_ml64.bat with bld_ml32.bat.</p><p class="ubb__split">6. Open &quot;(zlib directory)\contrib\vstudio\vc10\zlibvc.sln&quot; with VS2012, and choose to update the solution. Of course you can also use VS2010, but it may pop up an error saying &quot;error LNK1123. failure during conversion to COFF&quot;. It is said that installing SP1<br />of VS2010 may solve it. But I didn&#039;t try.</p><p class="ubb__split">7. Open the project property of &quot;zlibvc&quot; -&gt; Build Events -&gt; Pre-Build Event -&gt; Command Line. Clean the &quot;Command Line&quot; field. You can see that the they are trying to execute the bld_ml64.bat file. But somehow it does not work. If you don&#039;t clean the command line, you will get an error when compiling, saying &quot;bld_ml64.bat is not recognized as command or executable&quot;.</p><p class="ubb__split">8. Modify &quot;zlibvc.def&quot; line 4 from &quot;VERSION 1.2.7&quot; to &quot;VERSION 1.2&quot;. Visual Studio seems to support only &quot;Major.Minor&quot; version number. If you don&#039;t do this, you get a &quot;LNK1118: syntax error in &#039;VERSION&#039; statement&quot; message.</p><p class="ubb__split">9. Compile the solution.</p><p class="ubb__split">10. Now you should have dll and lib files generated in &quot;(zlib directory)\contrib\vstudio\vc10\x64\ZlibDllRelease&quot;. Include &quot;zlib.h&quot; and link to dll or lib files in your project, and you should be able to use zlib.</p>]]></description>
      <pubDate>Tue, 16 Oct 2012 17:17:27 -0700</pubDate>
      <guid>https://blog.sinzy.net/@hjk41/entry/22891</guid>
    </item>
        <item>
      <title>买了个MK802，便宜，但还是太geek</title>
      <link>https://blog.sinzy.net/@hjk41/entry/22860</link>
      <description><![CDATA[<p class="ubb__first"><img alt="" src="http://www.android-hk.com/wordpress/wp-content/uploads/2012/05/mk802-lg.jpg" class="entry__contentimg ubb__img" loading="lazy" /><br />MK802是一个U盘大小的，使用android 4.0的mini pc，提供一个HDMI接口输出和两个USB接口，并通过一个DC转换器供电。</p><p class="ubb__split">我是打算买来当播放器接电视用的。原来家里有个HTPC，用的是amd fusion，大小大概是20*20，但声音有点大。我想把这htpc找个柜子放起来，作为下载机和文件服务器，然后用MK802来播放HTPC上的电影。</p><p class="ubb__split">350买的，淘宝有一堆卖这个的，昨天到货。拿到手后，首先看到的是这个东西的个子还是比U盘要大一圈的，甚至比3G上网卡还要大。做工还行，虽然是塑料的，但看着挺结实。</p><p class="ubb__split"><strong>外观：</strong>先尝试使用USB供电，发现即使是用HTPC的usb口供电，也不能正常启动，会在启动界面上反复重启，只能使用变压器来供电。另外，还要把HDMI通过接线接到电视上，所以整套系统看起来其实还是挺乱的，感觉就像一堆线接到电视上，还是不够cool啊。。。要是有一个单靠HDMI口就能驱动起来的，做成类似U盘的形状，直接插到HDMI口上就好了</p><p class="ubb__split"><strong>稳定性：</strong> 昨天晚上开了一晚上，很稳定，没有死机现象，不过机器非常烫，不知道用久了会不会出问题。<br /> <br /><strong>字体：</strong>字体还是太小，我离32寸的电视2米远，使用最大的字体，在用软件的时候还是看得很费劲。</p><p class="ubb__split"><strong>控制：</strong>控制上不太好控制，只能用无线鼠标和无线键盘，用着很费劲，因为得一直抬着头看。昨天试图装vnc server，发现droid vnc server不能用，在pc能能登录，但是完全无法控制。droidmote也不能用，于是很杯具的只能使用无线鼠标。</p><p class="ubb__split"><strong>视频播放：</strong>据说能放1080P，但是我没试。mk802有内置的2G空间，另外还可以装32G的SD卡。但我想放samba服务器上的视频，于是装了个cifsmanager，结果cifsmanager在ICS下还不能用。于是装es file explorer，然后很杯具的发现es file explorer居然不能用系统自带的那个有硬件加速的播放器来放视频，而mx player只能放rmvb之类的，4G的mkv放不了。。。</p><p class="ubb__split">结论：这玩意还是太geek了，自己装过HTPC的应该都能理解我说的--拿着个无线键盘鼠标看电视，实在是很奇怪的事情。此外播放网络硬盘上视频还是不方便，希望过段时间能有改善</p><p class="ubb__split"><strong>2012/08/01更新：现在Rev 2.0的firmware可以下载了，刷完以后，VNC Server和cifs manager能用了，不过market上还是有好些应用找不到，过几天再折腾</strong></p>]]></description>
      <pubDate>Sat, 21 Jul 2012 16:06:03 -0700</pubDate>
      <guid>https://blog.sinzy.net/@hjk41/entry/22860</guid>
    </item>
        <item>
      <title>setting process affinity in windows in command line</title>
      <link>https://blog.sinzy.net/@hjk41/entry/22754</link>
      <description><![CDATA[<p class="ubb__first">If you need to bind a process to some specific cores, you can use the &quot;Set Affinity&quot; function in taskmgr.exe. Open task manager-&gt;processes-&gt;right click a process-&gt;set affinity.</p><p class="ubb__split">However, if you want to set affinity in command line, you will need some tools. Here is a program I wrote to deal with this:</p><p class="ubb__split"></p><pre><code>
#include &lt;iostream&gt;
#include &lt;sstream&gt;
using namespace std;

#include &lt;Windows.h&gt;


int main(int argc, char ** argv)
{
    if(argc!=3)
    {
        cout&lt;&lt;&quot;usage: &quot;&lt;&lt; argv[0] &lt;&lt; &quot; pid mask&quot; &lt;&lt;endl;
        return 1;
    }

    int pid = 0;
    istringstream sspid(argv[1]);
    sspid&gt;&gt;pid;
    if(pid&lt;=0)
    {
        cout&lt;&lt;&quot;bad pid&quot;&lt;&lt;endl;
        return 1;
    }

    HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid);
    if(!hProcess)
    {
        cout&lt;&lt;&quot;cannot open the process&quot;&lt;&lt;endl;
        return 1;
    }

    string mask_str = argv[2];
	DWORD_PTR mask = 0;
    if(mask_str.size()&gt;sizeof(mask)*8)
    {
        cout&lt;&lt;&quot;mask is too long: mask_size=&quot;&lt;&lt;mask_str.size()&lt;&lt;&quot;, sizeof(mask)=&quot;&lt;&lt;sizeof(mask)*8&lt;&lt;endl;
        return 1;
    }

    for(int i=mask_str.size()-1; i&gt;=0;i--)
    {
        mask = mask&lt;&lt;1;
        if(mask_str[i]==&#039;1&#039;)
        {
            mask |= 1;
        }
    }

    if( !SetProcessAffinityMask(hProcess, mask) )
    {
        cout&lt;&lt;&quot;error setting affinity mask: &quot;&lt;&lt;mask&lt;&lt;endl;
        cout&lt;&lt;&quot;error num: &quot;&lt;&lt;GetLastError()&lt;&lt;endl;
        CloseHandle(hProcess);
        return 1;
    }
    CloseHandle(hProcess);
    return 0;
}
</code></pre><p class="ubb__workaround"></p><p class="ubb__split">Compile the code with Visual C++, and use it like this:<br />  C:&gt;\ setaffinity.exe [pid] [mask]</p><p class="ubb__split">The mask is a binary number string. e.g. &quot;1011&quot; will bind the process to cores #0, #2 and #3.<br />For more information, check out my github project: https://github.com/hjk41/setaffinity_windows</p>]]></description>
      <pubDate>Tue, 17 Jan 2012 11:47:53 -0800</pubDate>
      <guid>https://blog.sinzy.net/@hjk41/entry/22754</guid>
    </item>
        <item>
      <title>MIUI download icon won&#039;t go away issue [solved]</title>
      <link>https://blog.sinzy.net/@hjk41/entry/22619</link>
      <description><![CDATA[<p class="ubb__first">I flashed a MIUI rom on my HD2. One day I tried to use the browser on the phone to download an APK, but it failed. The download icon on the top left corner of the screen then sticks. I tried reboot, downloading the APK again, and clearing the browser data cache, none worked. Finally, I found a software called &quot;Download Manager&quot; in the applications. I cleared the data and cache of that software, and the download icon disappears.</p>]]></description>
      <pubDate>Fri, 09 Sep 2011 17:30:46 -0700</pubDate>
      <guid>https://blog.sinzy.net/@hjk41/entry/22619</guid>
    </item>
        <item>
      <title>simple command line timer for windows</title>
      <link>https://blog.sinzy.net/@hjk41/entry/22571</link>
      <description><![CDATA[<p class="ubb__first">I have just switched to working on Windows. And I found that there is no such thing as the time command line tool in Linux. So I decided to write one myself. I don&#039;t need many features. Counting the number of seconds a command takes is enough. I used the QueryPerformanceCounter() function to get the accurate time. So it is not portable to Linux or other platforms. </p><p class="ubb__split">Anyone who is interested can modify the code at its own will. But I would appreciate it if you can give me your improved version of the code. I have also attached a compiled version. It works on Windows Server 2008 R2 and Windows 7. Other Windows versions are not tested.</p><p class="ubb__split">Use it like this:<br />    C:\&gt; timer command [arguments]</p><p class="ubb__split">It gives:<br />    [command outputs]...<br />    --------------<br />    time elapsed: 0.123s</p><p class="ubb__split"><strong>Download:</strong><br /><a href="http://www.mediafire.com/?vzf4yv5xs9saemu" target="_blank">http://www.mediafire.com/?vzf4yv5xs9saemu</a><br /><a href="http://www.rayfile.com/zh-cn/files/f5a8ae19-b81c-11e0-93f2-0015c55db73d/" target="_blank">http://www.rayfile.com/zh-cn/files/f5a8ae19-b81c-11e0-93f2-0015c55db73d/</a></p><p class="ubb__split"><br />-----------------------------------<br />Source code:<br /></p><pre><code>
#define NOMINMAX
#include &lt;windows.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;string&gt;
#include &lt;iostream&gt;
using namespace std;

double gettime(){
	LARGE_INTEGER nFreq;
	LARGE_INTEGER nTime;
	QueryPerformanceFrequency(&amp;nFreq);
	QueryPerformanceCounter(&amp;nTime);
	return (double)nTime.QuadPart*1000/nFreq.QuadPart;
}

int main(int argc, char ** argv){
	if(argc&lt;2 || argc&gt;=2 &amp;&amp; string(argv[1])==&quot;--help&quot;){
		cout&lt;&lt;endl;
		cout&lt;&lt;&quot;This is a very very simple timing tool by hjk41.&quot;&lt;&lt;endl;
		cout&lt;&lt;endl;
		cout&lt;&lt;&quot;Use it this way: &quot;&lt;&lt;endl;
		cout&lt;&lt;&quot;\tC:\\&gt;&quot;&lt;&lt;argv[0]&lt;&lt;&quot; command [arguments]&quot;&lt;&lt;endl;
		cout&lt;&lt;endl;
		return 0;
	}

	double start=gettime();

	string cmd=argv[1];
	for(int i=2;i&lt;argc; i++){
		cmd= cmd+&quot; &quot;+argv[i];
	}
	system(cmd.c_str());

	double end=gettime();
	double exe_time=(end-start)/1000;

	cout&lt;&lt;&quot;----------------&quot;&lt;&lt;endl;
	cout&lt;&lt;&quot;time elapsed: &quot;&lt;&lt;exe_time&lt;&lt;&quot;s&quot;&lt;&lt;endl;

	return 0;
}
</code></pre><p class="ubb__workaround"></p><p class="ubb__split"></p><p class="ubb__split">--------------------------------------<br />Chinese Edition, ignore this if you cannot read Chinese. :-)</p><p class="ubb__split">Windows下的简单计时程序。<br />使用方法<br />    C:\&gt; timer 命令 [参数]</p><p class="ubb__split">结果：<br />    [命令输出]...<br />    --------------<br />    time elapsed: 0.123s</p><p class="ubb__split"><strong>下载链接:</strong><br /><a href="http://www.rayfile.com/zh-cn/files/f5a8ae19-b81c-11e0-93f2-0015c55db73d/" target="_blank">http://www.rayfile.com/zh-cn/files/f5a8ae19-b81c-11e0-93f2-0015c55db73d/</a><br /><a href="http://www.mediafire.com/?vzf4yv5xs9saemu" target="_blank">http://www.mediafire.com/?vzf4yv5xs9saemu</a></p><p class="ubb__split">上面有源码。你可以随便改，但是如果有什么改进，希望你能告诉我，我好更新一下。 :-)</p>]]></description>
      <pubDate>Wed, 27 Jul 2011 15:05:22 -0700</pubDate>
      <guid>https://blog.sinzy.net/@hjk41/entry/22571</guid>
    </item>
        <item>
      <title>android market force close on Typhoon CM7 firmware v3.4.2</title>
      <link>https://blog.sinzy.net/@hjk41/entry/22561</link>
      <description><![CDATA[<p class="ubb__first">After a clean install of Typhoon CM7 v3.4.2 on HD2, I found that android market always force closes. A brief search on the Internet indicates that market works well with v3.4.1, but force closes on v3.4.2. Then I found the following solution on xda-developers:</p><p class="ubb__split">With a rooted rom:<br />1) open a terminal emulator<br />2) su<br />3) chmod 777 /cache</p><p class="ubb__split">Then everything works well.</p>]]></description>
      <pubDate>Tue, 19 Jul 2011 09:49:00 -0700</pubDate>
      <guid>https://blog.sinzy.net/@hjk41/entry/22561</guid>
    </item>
        <item>
      <title>starting / stopping service in windows using command line</title>
      <link>https://blog.sinzy.net/@hjk41/entry/22551</link>
      <description><![CDATA[<p class="ubb__first">In Linux, you typically use &quot;service stop xxx&quot; or &quot;/etc/init.d/xxx stop&quot; for this purpose. </p><p class="ubb__split">Here is the equivalent on windows:<br />   net stop xxx</p><p class="ubb__split">You can also start a service using:<br />    net start xxx</p><p class="ubb__split">However, there is no such thing as &quot;net restart&quot;. So you have to do it manually by stopping and then starting the service.</p>]]></description>
      <pubDate>Wed, 13 Jul 2011 15:48:24 -0700</pubDate>
      <guid>https://blog.sinzy.net/@hjk41/entry/22551</guid>
    </item>
        <item>
      <title>list logged-on users in windows</title>
      <link>https://blog.sinzy.net/@hjk41/entry/22536</link>
      <description><![CDATA[<p class="ubb__first">In Linux, we do that with &quot;w&quot; or &quot;who&quot;. In windows, we can use &quot;query session&quot;.</p>]]></description>
      <pubDate>Wed, 06 Jul 2011 12:41:45 -0700</pubDate>
      <guid>https://blog.sinzy.net/@hjk41/entry/22536</guid>
    </item>
        <item>
      <title>杯具，在M8上装上了M9 ROM，然后屏幕失灵了</title>
      <link>https://blog.sinzy.net/@hjk41/entry/22245</link>
      <description><![CDATA[<p class="ubb__first">本来还想买M9来玩玩呢，毕竟从硬件配置上，M9已经直追ip4了，而且才卖2.5K。</p><p class="ubb__split">今天给M8装了个M9 ROM，跟HD2装android原理一样，估计就是拿HD2那个loader弄的。开机发现界面挺漂亮，是我见过的android界面中最漂亮的一个。杯具的是，屏幕在这个时候失灵了。</p><p class="ubb__split">M8屏幕失灵是个很普遍的毛病，据说新机一年之内能换，可惜这机器已经用了两年了。这个机器原来也有一次失灵，把贴膜揭开再贴回去就好了，没想到这次完全的不行了。</p><p class="ubb__split">据说M9也有屏幕失灵的问题，看来meizu还是没找到根本的解决办法。本来还想买个M9来玩呢，现在看来，暂时不能买了</p>]]></description>
      <pubDate>Wed, 05 Jan 2011 16:18:52 -0800</pubDate>
      <guid>https://blog.sinzy.net/@hjk41/entry/22245</guid>
    </item>
        <item>
      <title>贴个非常牛x，非常快的HD2 android</title>
      <link>https://blog.sinzy.net/@hjk41/entry/22210</link>
      <description><![CDATA[<p class="ubb__first">从xda-developers看到的，自己装了一下，发现真的很快。相同的CPU频率下，运行速度明显快于以前用过的shubcraft啊，matt之类。另外，启动速度也非常快，快到发指，基本上5-10秒的样子。</p><p class="ubb__split">作者自己的解释是说，他把所有系统文件都放到RAM里了，所以快。不过原来运行时不也放在RAM里的吗？</p><p class="ubb__split">不管怎么样，强力推荐这个版本：darkstone SuperRAM FroYo</p><p class="ubb__split">XDA-developer链接：<br />http://forum.xda-developers.com/showthread.php?t=870518</p><p class="ubb__split">目前最新版本是1.5，下载链接：<br />http://www.multiupload.com/01Q9CDT76Y</p><p class="ubb__split">似乎要翻墙 ;-(</p>]]></description>
      <pubDate>Thu, 23 Dec 2010 20:22:51 -0800</pubDate>
      <guid>https://blog.sinzy.net/@hjk41/entry/22210</guid>
    </item>
      </channel>
</rss>
