SPNote

SharePoint Notes

타나토노트 Thanatonaute

타나토노트 thanatonaute 는 죽음을 뜻하는 그리스 어 타나토스 thanatos 와
항해자를 뜻하는 나우테스 nautes 를 합쳐 만든 조어로서, 우리말로 하면
영계 탐사자 쯤으로 이해할 수 있다.

우리의 죽음 뒤에 무엇이 있을까?
정말 천국과 지옥이 있을까? 아님 아무것도 없을까?

개인적으로는 종교를 믿지 않기에…
후자에 손 들어주고 싶다.

하지만 만약 있다면? 아마도 권선징악에 따른 보상 심리가
사람에겐 기본적으로 내장?하고 있기에 그렇게 생각하는 것은 아닐까?

한 일생을 저울질하여 평가를 받는다면,
나는 어떻게 살아야할까?

스스로가 택하는 바가 아닌 좋은 점수만 받기 위해
행동하는 자신은 무슨 의미가 있을까?

점점 획일화되고 있는 세상에서
줏대 없이 따라하는 똑같음을 비판하는 것은 아닐까?

캐나다 생활 관련 참조 사이트

1. 영문 주소 변환 서비스
 - 우정사업본부 > 국내 우편 온라인 조회 이후 검색어에 해당사양 입력
 - http://www.koreapost.go.kr/servlet/kpp.post.PostInfo

2. Human Resources and Skills Development
 - SIN 에 관한 정보를 얻을수 있습니다.
 - http://www.hrsdc.gc.ca/en/cs/comm/hrsd/whats_new.shtml
 - http://www.hrsdc.gc.ca/asp/gateway.asp?hr=en/cs/sin/030.shtml&hs=sxn#q1

3. Canada Map
 - http://listingsca.com/maps.asp

4. TravelCanada - 캐나다 관광청
 - 캐나다 정보 파악엔 최고의 사이트
   각 주와 해당 지역에 따른 설명과 Culture, Festival & Events, Outdoor,
   Touring, Winter 등 Travel Plan 쓰기에 좋은 website 입니다.
 - http://www.keepexploring.ca/tc_redesign/app/en/ca/home.do

5.  About Toronto
 - Toronto 에 대한 정보를 얻을때
 - http://www.torontotourism.com/Visitor

6. Winnipeg.ca
 - When I want to find about information of Winnipeg
 - http://www.winnipeg.ca/census/2001/

Attach JavaScript Functions to the onload event of body on SharePoint pages

As you all know that SharePoint is tricky to do things in comparison with Plain ASP.NET. Even though it's not easy but if you study it instead of implement what you want yourself, you can use functions which SharePoint provides and one of them is "spBodyOnLoadFunctionNames array" which is SharePoint provides a way to add your events to onload. Here's a usage below.

[code:js;ln=on]

// Usage
_spBodyOnLoadFunctionNames.push(”YourFunctionToAdd“);

[/code]

If you didn't know about it or if you want that onload event but you need to implement then use this below.
From JavaScript: The Definition Guide, Flanagan, O’Reilly

[code:js;ln=on]

/*
 * runOnLoad: portable registration for onload event handlers.
 * this source from JavaScript, The Definition Guide,  Flanagan, O'Reilly
 */
function runOnLoad(f) {
    if (runOnLoad.loaded) f();    // If already loaded, just invoke f() now.
    else runOnLoad.funcs.push(f); // Otherwise, store it for later
}
 
runOnLoad.funcs = [YourFunctionToAdd]; // The array of functions to call when the document loads
runOnLoad.loaded = false; // The functions have not been run yet.
 
// Run all registered functions in the order in which they were registered.
// It is safe to call runOnLoad.run() more than once: invocations after the
// first do nothing. It is safe for an initialization function to call
// runOnLoad() to register another function.
runOnLoad.run = function() {
    if (runOnLoad.loaded) return;  // If we've already run, do nothing
 
    for(var i = 0; i < runOnLoad.funcs.length; i++) {
        try { runOnLoad.funcs[i](); }
        catch(e) { /* An exception in one function shouldn't stop the rest */ }
    }
 
    runOnLoad.loaded = true; // Remember that we've already run once.
    delete runOnLoad.funcs;  // But don't remember the functions themselves.
    delete runOnLoad.run;    // And forget about this function too!
};
 
// Register runOnLoad.run() as the onload event handler for the window
if (window.addEventListener)
    window.addEventListener("load", runOnLoad.run, false);
else if (window.attachEvent) window.attachEvent("onload", runOnLoad.run);
else window.onload = runOnLoad.run;

[/code]

but the above one is much simple and easy to use in SharePoint. You can use this for regular HTML or .NET pages.

Guid.ToString(”B”).ToUpper() means???

When you want print out GUID like this format
{855F9A70-9A43-435B-A5B1-B91A7F58BAD1} => bracket surrounded….
you can use that one.

For example, Guids of SPlist or SPField  
guid.ToString(”B”).ToUpper();

[Sample Code here]:
[code:c#;ln=on]

string strGuid = "0b51264d-baa6-49dc-8970-1d24979053ac";
Guid guid = new Guid(strGuid);
string guidBTest1 = guid.ToString();
string guidBTest2 = guid.ToString("B").ToUpper();
Response.Write(guidBTest1 + "");
Response.Write(guidBTest2);

[/code]

[In Detail]
The format parameter can contain the following format specifiers. In the table that follows, all digits in the return value are hexadecimal. Each character ‘x’ represents a hexadecimal digit; each hyphen (’-'), bracket (’{', ‘}’), and parenthesis (’(', ‘)’) appears as shown.

SpecifierFormat of Return Value
N 32 digits:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
D 32 digits separated by hyphens:
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
B 32 digits separated by hyphens, enclosed in brackets:
{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
P 32 digits separated by hyphens, enclosed in parentheses:
(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

The provider parameter is reserved for future use and does not contribute to the execution of this method. A null reference can be coded for this parameter.

- Reference from http://msdn.microsoft.com/en-us/library/s6tk2z69.aspx

Using aspnet_regiis

ASP.NET IIS Registration Tool (Aspnet_regiis.exe)

Refer: http://msdn.microsoft.com/en-us/library/k6h9cz8h(VS.80).aspx

under %windir%\Microsoft.NET\Framework\v2.0.50727
or v1.1.4322. aspnet_regiis command can be used to install or update frameworks

When I need to choose ASP.NET Versions between v1.1 and v.2.0 on ASP.NET tab of Default Web Site Properties in IIS Manager but I can't see v1.1 so that I used the command to install v1.1.

> aspnet_regiis -i

By the way when I use the command with -lv parameter, I can see the output below

1.1.4322.0 Valid ...
2.0.50727.0 Valid (Root) ...

The problem is that I want to switch Root to v1.1 and there is a way to do it.

> aspnet_regiis -sn W3SVC/ (means default:Root)
sn : install scriptmaps for this version at the specified path, non-recursively

after that you could see the changes and using sn option, you can change scriptmaps by site. ie) -sn W3SVC/1/ROOT, W3SVC/3/ROOT ...
plus, -lk option with the command you can see IIS metadata keys affected.


Grant user or group to the IIS metabase and other directories

After you create a new website or virtual directory and browse a aspx file,
you might have error such as...

The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to C:\WINDOWS\Microsoft.NET\
Framework\v2.0.50215\Temporary ASP.NET Files'.


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

[Answer]
You can grant access to this account explicitly using the aspnet_regiis -ga switch,
for example:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215>aspnet_regiis -ga "NT Authority\Network Service"

[Ref]
aspnet_regiis -ga
Grant the specified user or group access to the IIS metabase and other directories used by ASP.NET.