node.js CORS cross domain issue
紀錄一下
Actually, check SNMP service uptime.
Sometimes, we just want to release a single .exe file without a mass of .dll library files. This makes users easier to copy the file, and does not unveil the information of libraries used in the program.
Backend C# side string Info = ""; if (ds.Tables[1] != null) { for (int i = 0; i < ds.Tables[1].Rows.Count; i++) { if (Info == "") { } else { Info = Info + ","; } Info = Info + String.Format("{{\"id\": \"{0}\", \"type\": \"{1}\", \"Bal\": \"{2}\"}}", ds.Tables[1].Rows[i]["id"].ToString(), ds.Tables[1].Rows[i]["type"].ToString(), ds.Tables[1].Rows[i]["Bal"].ToString() ); } } Response.Write(String.Format("{{\"username\":\"{0}\", \"credit\":\"{1}\", \"balance\":\"{2}\", […]
最近在看 google web search api(reference), 剛好看到這個東西…
方法1: 透過 mouse events 去取得 mouse cursor position, 然後再呼叫 document.elementFromPoint var x = event.clientX, y = event.clientY, elementMouseIsOver = document.elementFromPoint(x, y); 方法2: 在比較新的瀏覽器可以用 jquery 的 querySelectorAll 取得 document.querySelectorAll( ":hover" );
using System.Diagnostics; [STAThread] public static void Main() { StackTrace stackTrace = new StackTrace(); // get call stack StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames) // write call stack method names foreach (StackFrame stackFrame in stackFrames) { Console.WriteLine(stackFrame.GetMethod().Name); // write method name } } Ref: http://www.csharp-examples.net/reflection-callstack/
T4 (Text Template Transformation Toolkit) 可以幫忙訂出 template 並用程式輔助來產生程式碼或文件(比方說不同語言的定義檔)。 使用 T4 之前可以先去下載 T4 Toolbox,安裝之後在 Visual studio 增加新項目時就可以看到有 “T4 Toolbox” 的分類,有 Generator、Script、Template 三種可選 首先定義template檔案,在這邊用System.Xml去讀取 resource file,同時 include SaveOutput.tt 做輸出用。 <#@ template language="C#" debug="True" #> <#@ include file="SaveOutput.tt" #> <#@ include file="T4Toolbox.tt" #> <#@ assembly name="System.Xml" #> <#@ import namespace="System.Xml" #> <# // <copyright file="i18n_js.tt" company="Onelab"> // Copyright […]
今天工作遇到,記錄一下… http://stackoverflow.com/questions/112055/what-does-d0-mean-in-a-windows-batch-file http://www.computerhope.com/forhlp.htm http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/percent.mspx?mfr=true