PIXNET Logo登入

minglight

跳到主文

Ming's Blog

部落格全站分類:視覺設計

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 10月 12 週三 201111:26
  • Sharepoint - server variable & function of Data View

Variables

ParameterValue


HttpHost
URL of the Web server.


Language
LCID of the language used on the site, for example 1033 for an English-language site.


ImagesPath
URL of the images path, in the context of the current Web site, for example: http://server/sites/test/_layouts/images/


HttpPath
URL of the path to the appropriate owssvr.dll file in the context of the current Web site. For example, http://server/sites/test/_vti_bin/owssvr.dll?CS=109, where CS=109 means that the UTF-8 character set is used for all communication to owssvr.dll.


HttpVDir
Root directory of the current subsite. For example, for the page http://server/sites/test/default.aspx, the value is http://server/sites/test/.


PageUrl
The URL of the currently requested page. For example, http://server/sites/test/default.aspx.


Project
The site-relative URL of the root folder of a list, if the current page request is in the context of a list. This is the name of the folder that contains all the files used in working with the list, for example, Lists/Announcements.


View
{GUID}. If the Web Part is a view of a list, this is the view identifier.


ListProperty_TemplateUrl
When the current page request is in the context of a list, and the list is a document library, this is the URL of the template document for this document library.


ListUrlDir_FALSE
When the current page request is in the context of a list, this is the complete URL to the root folder of the list, for example, http://server/sites/test/Lists/Announcements.


ListUrlDir_TRUE
When the current page request is in the context of a list, this is the site-relative URL of the root folder of the list. (This is the same as parameter Project).


URL_New, URL_NEW
When the current page request is in the context of a list, this is the URL to the page for creating a new item in the list (newform).


URL_Edit, URL_EDIT
When the current page request is in the context of a list, this is the URL to the page for editing an existing item in the list (editform).


URL_Display,URL_DISPLAY
When the current page request is in the context of a list, this is the URL to the page containing the default vi

(繼續閱讀...)
文章標籤

minglight 發表在 痞客邦 留言(0) 人氣(46)

  • 個人分類:Sharepoint
▲top
  • 8月 23 週二 201116:06
  • ThreadLocal - 進階探討

為了不誤導大家,把一些看完Source的進階心得寫在這兒
1. 把Map<Thread,value>放在ThreadLocal的缺點
    在某些情況下Thread不會重複使用. 例如Web環境,Container會產生一個新的Thread來處理Request-Response,因此如果ThreadLocal設計方式是ThreadLocal-簡介,將Map放在ThreadLocal中,你會發現這個Map越來越大,越來越大,要直到你重開Server才會重置 ( 以上純屬個人推論 XD )
2. ThreadLocal實際運作方式
    ThreadLocal並不會自己存放Map,而是把Map放到Thread裡面去!!
    Thread中會有一個ThreadLocalMap<ThreadLocal,Object> ,注意這邊的Key變成了ThreadLocal物件本身, 因此每個ThreadLocalMap都有可能會有以不同的ThreadLocal相對應的值.
    其實這種方式更直覺,每個Thread會有一個空間放一些客製的變數,而且好處是,當Thread掛掉之後,這個Map也會跟著Thread被GC掉.
3. ThreadLocal的API
    protected T initialValue() 
給繼承者使用, 預設回傳null, 當呼叫get()拿到null時會呼叫initialValue()將值擺進去.
    其他直覺的使用如下
     +get() : T 
     +set(T) : void     
     +remove(T) : void 
4. 使用ThreadLocal的時機
    我查了一下網路,有人說當你對一個bean/resource使用synchronized的時候,常常是寫法不易而且效能不彰(因為Thread都在排隊等放飯).因此ThreadLocal可以拿來取代synchronized
    這種說法是部分正確的. 其道理在於如果你今天只有一個飯鍋, 放飯的時間一定會拉很長,如果使用ThreadLocal, 當你需要吃的時候我直接給你一碗飯,這時候就不需要排隊了.
   
    ThreadLocal的觀念就是個人造業個人擔,不管你要對你的飯做什麼都不會影響到別人
    但是synchronized內的邏輯,因為是大家共用一個飯鍋,當輪到你盛飯的時候,如果你在飯鍋裡面加了滷肉,整鍋飯就會變成魯肉飯了.
    因此ThreadLocal可以取代synchronized的時機只有在於沒有人會對飯動手腳的時候才適用.
       
    可以把它當作requestScope的延伸
    這個就不需要太多解釋了,因為跟request在同一個Thread裡面 
(繼續閱讀...)
文章標籤

minglight 發表在 痞客邦 留言(0) 人氣(191)

  • 個人分類:Java World
▲top
  • 8月 22 週一 201113:53
  • ThreadLocal概念介紹

前置觀念 - 必須了解Thread, Thread.currentThread()被呼叫的機制, call stack機制.
ThreadLocal的目的 : 把變數存在currentThread中, 讓每個執行中的Thread都有自己的一份Copy, 而且彼此之間不會互相影響.
實作概念 : 
public class ThreadLocalConcept{
private Map<Thread,Object> localMap = Collections.synchronizedMap(new HashMap<Thread,Object>());
public void set(Object obj){
this.localMap.put(Thread.currentThread(), obj);
}
public Object get(){
this.localMap.get(Thread.currentThread());
}
} 
基本上就是這個localMap會放著各個Thread對應的變數, 因此在不同的Thread中呼叫到的Value都會是獨立的.
用途範例 : 在DAO中拿到Login User
     
一般來說Login User都是放在Session中, 但是平常我們使用的Service & DAO都會是Singleton, 是共用的, 因此不能夠將Login User放入
        
我們可以利用一個Request-Response是一個獨立Thread的特性, 搭配ThreadLocal將Login User存入各個Thread中,就可以拿到相對應的Login User了
(繼續閱讀...)
文章標籤

minglight 發表在 痞客邦 留言(2) 人氣(5,451)

  • 個人分類:Java World
▲top
  • 3月 25 週五 201122:59
  • Javascript重點分享 -- 第一集 : 核心概念

純粹分享學習心得,並不會有系統的介紹Javascript,我的JS經驗也很粗淺,如果有寫錯或是遺漏也請不吝指教
另外參考良葛格學習筆記就可以得到完整版本的教學了
1. null vs undefined vs not defined error
    null代表null物件
        除非手動assign一個參考為null,不然參考不會出現null值
    undefined有兩種情形
        a. 是一個參考的預設值,宣告一個變數而不assign時,其值就會是undefined (function的參數被呼叫時沒有被給值也算是這種情形)
        b. 呼叫物件不存在的屬性也會得到undefined值
    
    not defined error
        如果使用一個沒有宣告過的變數,就會得到錯誤(xx is not defined) -- 程式中斷

2. 條件判斷式
         在JS中判斷式有六種情形會被判定為false,其餘的情形都是true
         false的情形有 : false , 0 , null , undefined , "" , NaN
         PS.在PHP中, "0"也會被判定為false,是比較特別的情形
3. 利用typeof時如何分辨object vs function 
         可以想成instance vs  class的分別,另外null的type是object,是比較特殊的情形
4. global變數其實就是window物件的屬性,而global中的this指的就是window物件
(繼續閱讀...)
文章標籤

minglight 發表在 痞客邦 留言(0) 人氣(407)

  • 個人分類:Javascript & CSS
▲top
  • 4月 14 週三 201021:55
  • CH1.簡介

1. 分別描述 TCP , IP , HTTP 的
    a.功能
        TCP : 保證檔案完整, 管port的2^16(1~1023官方用的)
        IP  : 保證送對地方, 管IP的
        HTTP : 請求與回應,在TCP&IP之上建立的
2. Request包括了 method, url, param(包含header)
   Respnose包括了 state ,content-type , 內容(HTML)
   
3.Html是 Response的一部分
4.Get&Post
  a.Get有字數限制
  b.Get可以被加入書簽(因為在URL後面),Post沒辦法
 
5.URL(Uniform Resource Locator)
6.CGI (Common Gateway Interface)& Servlet
    a.語言 :
        CGI : PHP , c , Python , Perl
    Servlet : Java
    
    b.比較
        CGI : @多用Process處理(搞肛),
              @Servlet使用Thead
              @Servlet可以寫在JavaEE裡面, CGI只能呼叫
(繼續閱讀...)
文章標籤

minglight 發表在 痞客邦 留言(0) 人氣(26)

  • 個人分類:Java World
▲top
  • 9月 10 週四 200911:47
  • Java Reflection--淺談Class

1. java.lang.Class代表class or Interface;
    class : 基本class, array ,enum , primitive type , void
    interface : interface , annotation
    +isInterface():boolean
    +isArray():boolean
    
2.用obj.class or obj.getClass()可以得到Class物件, 是在建立.class檔案時放入的
   因此也可以用Class.forName("ming.MyClass");方式得到Class物件
   
3.Class物件訊息在建立.class檔案就已經儲存好,編譯時期檢查相對應的.class檔案,
  Runtime會將有被使用到的Class資訊Load入定義區,因此有.class不一定會在定義區內,就不能做成物件
  使用Class.forName("package.name");將Class註冊入定義區中,並且將此Class回傳
  ==>Class.forName("package.name").newInstance();就會回傳此物件
  ps.只能new無參數建構子,如果沒有此定義就會出錯,也可以使用myClass.getConstructor.newInstance(Object...)來彌補有參數建構子的不足
4.使用Class物件可以得到各式各樣類別的定義, Constructors, Fields, Methods, package, SuperClass等
(繼續閱讀...)
文章標籤

minglight 發表在 痞客邦 留言(0) 人氣(476)

  • 個人分類:Java World
▲top
  • 6月 16 週二 200917:34
  • 使用 instanceof 要注意

最常犯的邏輯上的錯誤是 沒考慮到null的情形 而做instanceof , 卻又要在裡面做null判斷
ex :
public void m1(Object s1){
if(s1 instanceof  String){
(繼續閱讀...)
文章標籤

minglight 發表在 痞客邦 留言(0) 人氣(87)

  • 個人分類:Java World
▲top
  • 3月 05 週四 200911:05
  • JavaScript筆記 -- 物件導向客製化的物件

<code> 
var emp = function(config){
                                this.name ;
                                this.nick ;
                                this.stand = function(){
                                        document.write(this.name +" " + this.nick);
                                }
                                this.init = function(){
                                        //也可以是反過來
                                        this.name = this.name? this.name : config.name;
                                        this.nick = this.nick ? this.nick :config.nick;
                                        this.stand();
(繼續閱讀...)
文章標籤

minglight 發表在 痞客邦 留言(0) 人氣(139)

  • 個人分類:Javascript & CSS
▲top
  • 11月 01 週四 200715:09
  • 如何兩台電腦對接---簡易區域網路

1.先去弄個跳線(好像是雙頭不一樣的訊號)應該可以自己買
   ps.改天來自己學接網路線頭
2.一臺設定 192.168.0.1   255.255.255.0
    另依臺    192.168.0.2   255.255.255.0
3.執行---> //192.168.0.1
    即可連線
//以上為電台工程課大大鵬智  未來課長候選人的精闢講解
  晚一點把詳情來查清楚 :P
  改天來試試看
(繼續閱讀...)
文章標籤

minglight 發表在 痞客邦 留言(0) 人氣(7,549)

  • 個人分類:有用資訊區
▲top
«123

近期文章

  • Bootstrap Table 參考資料
  • 淺談JSONP - 合法的Cross Site Data Transfer
  • Javascript - Closure的運用
  • MS Integration Service (SSIS) 遇到的問題 : error code 0xC0202009
  • 沒辦法被Trim掉的space : non-break space(nbsp)
  • SQL - 找各班分數排名前N的
  • 利用HTML做出可以有標題跟內文的Email Link
  • 利用HtmlUnit - 使用Java連到一個網頁,執行自動化程式,或是執行某段script
  • 分享jQuery的queue使用
  • 良葛格Javascript筆記導覽 - CH4 瀏覽器相關&自訂Utils

文章分類

toggle 專案Review (1)
  • Taitra (0)
toggle 學習筆記 (7)
  • linux (0)
  • Struts2 (0)
  • MS Reporting Service (1)
  • Hibernate (0)
  • Sharepoint (4)
  • Java World (7)
  • Javascript & CSS (14)
  • GWT (1)
  • Google App Engine (0)
  • 有用資訊區 (1)
  • 生活心得 (0)
  • 未分類文章 (1)

最新迴響

  • [14/11/12] Steven 於文章「ThreadLocal概念介紹...」留言:
    那在Dao updte的時候 , 為何不直接呼叫sessio...
  • [12/07/06] 賴 建宏 於文章「面試經驗分享...」留言:
    先前台灣IBM搞砸台灣高鐵的訂票系統, 我被公司外派過去替他...
  • [12/05/11] Monty Pan 於文章「GWT Overview...」留言:
    我有用 google alert 訂閱 GWt,所以才看到的...
  • [12/05/10] Monty Pan 於文章「GWT Overview...」留言:
    拍謝,來打擾一下... 1. 嚴格說來,GWT 只有保...

文章彙整

參觀人氣

  • 本日人氣:
  • 累積人氣: