2016年12月13日 星期二

vmware workstation player 12 guest 3D 設定

假設建立了一個 guest 叫做 windows_7 必須在
該 windows_7 vm 目錄下 windows_7.vmx 加入以下兩行:

mks.enableD3DRenderer = TRUE

mks.enableDX11Renderer = FALSE

2016年12月10日 星期六

使用 complete 呼叫的 jquery ajax polling

(function poll(){
  $.ajax({
    url: "/poll",
    success: function (data) {
      do_something_with(data);
    },
    dataType: "json",
    complete: poll,
    timeout: 30000
  });
})();

2016年12月7日 星期三

進階 jquery polling 即使 request 失敗也不會停止

function doPoll(){
    $.post('ajax/test.html').done(function(data) {
        /* process */
    }).always(function() {
        setTimeout(doPoll, 5000);
    });
}

jquery 簡單 polling 範例

function doPoll()
    $.post('ajax/test.html', function(data) {
        alert(data); // process results here 
        setTimeout(doPoll,5000);     
    }); 
}

2016年12月3日 星期六

如何禁止Vmware同步時間



參考:http://trufflepenne.blogspot.tw/2014/02/vmware.html
如果你有時必須調整VM裡的時間,但重開VM後又恢復現在時間,請利用以下步驟來修改(以windows 2008 R2為例):


停止VMWare tools, Windows Time服務
進入你的VM作業系統,選服務,把VMWare tools, Windows Time停止,並改為手動
取消Internet同步時間
進入你的控制台找到日期時間,進入後將以下取消打勾





修改VMWare configuration檔 (vmx, 跟VM檔案同一目錄)
a. shutdown VM
b. 切到你的VM目錄
c. 打開xxx.vmx
d. 找到tools.syncTime = "XXX" 標籤,刪掉之
e. 在最結尾填入以下
tools.syncTime = "FALSE"
time.synchronize.continue = FALSE
time.synchronize.restore = FALSE
time.synchronize.resume.disk = FALSE
time.synchronize.shrink = FALSE
time.synchronize.tools.startup = FALSE
time.synchronize.resume.host = FALSE
重新進入VM,修改時間,重開機就會看到新設定時間沒被同步
如果要讓VM重開時,都定在固定時間
在xxx.vmx最後加上
rtc.startTime = 1335862800
後面數字是timesatmp, 上面是2012 09:00:00 ,可用以下計算
http://www.onlineconversion.com/unix_time.htm