* Good tutorial
* WCF REST Starter Kit
Monday, December 19, 2011
Wednesday, December 14, 2011
Monday, December 12, 2011
Certificate error when redirecting http://localhost to https://localhost
On IE, after the certificate error page is shown, clicking "Continue ..." link doesn't work.
Workaround for this problem
Notes: Adding "http://localhost" to "Trusted zone" (or any other zones) internally remove it from "Locked-down Local Machine Zone". If "http://localhost" is afterwards removed from "Trusted zone", it will no longer explicitly bound to any zone and will be considered to belong to "Internet zone". Thus the problem reported here won't reappear after the removal.
- "http://localhost" is by default is assigned to "Locked-down Local Machine Zone" by Windows (later than XP SP2)
- When "http://localhost/" is redirected to "https://localhost/", IE detect server SSL certificate error and shows an error page.
- This error page is internally has URL "res://ieframe.dll/invalidcert.htm?SSLError=50331648#http://localhost/" and is considered to be in "Internet Zone".
- "Locked-down Local Machine Zone" by default doesn't allow navigation into its zone from a less privileged zone (e.g. "Internet zone"). Thus clicking continue button is ignored.
Workaround for this problem
- Acces "https://localhost/". "https://localhost" is by default considered "Local Intranet zone" thus navigating from "res://ieframe" is possible.
- Access "http://127.0.0.1/". "http://127.0.0.1/" is by default considered "Internet zone" thus navigating from "res://ieframe" is possible.
- Add "http://localhost" to "Trusted Zone". "Trusted Zone" allows navigation from "Internet Zione" thus navigating from "res://ieframe" is possible.
- Using Group policy editor (gpedit.msc), edit User Configuration - Administrative Templates - Windows Components - Internet Explorer - Internet Control Panel - Security Page - Locked-down Local Machine Zone, and set "Web sites in less privileged Web content zones can navigate into this zone" to Enabled (don't forget to set the Options part inside the dialog to "Enabled" too).
Notes: Adding "http://localhost" to "Trusted zone" (or any other zones) internally remove it from "Locked-down Local Machine Zone". If "http://localhost" is afterwards removed from "Trusted zone", it will no longer explicitly bound to any zone and will be considered to belong to "Internet zone". Thus the problem reported here won't reappear after the removal.
Thursday, December 8, 2011
Installing SSL Certificate
Installing certificate on server
Installing certificate on clients
- http://www.globalsign.com/support/install/install_iis7.php
- Multiple common names for certificate using Self-SSL
Installing certificate on clients
Tuesday, November 29, 2011
MVC custom authorization and jQuery redirect
http://beckelman.net/post/2010/04/01/Custom-ASPNET-MVC-Authorization-Attribute-For-Ajax-Requests.aspx
http://blogs.msdn.com/b/rickandy/archive/2011/05/02/securing-your-asp-net-mvc-3-application.aspx
Tuning jQuery: http://www.artzstudio.com/2009/04/jquery-performance-rules/
Memory leak: http://stackoverflow.com/questions/1462649/jquery-memory-leak-with-dom-removal
http://blogs.msdn.com/b/rickandy/archive/2011/05/02/securing-your-asp-net-mvc-3-application.aspx
Tuning jQuery: http://www.artzstudio.com/2009/04/jquery-performance-rules/
Memory leak: http://stackoverflow.com/questions/1462649/jquery-memory-leak-with-dom-removal
Friday, November 18, 2011
Cryptography
Shared-key encryption
Shared-key signature
Public-key encryption
Public-key signature
Certificate is basically a message signatured by a Certificate Authority (CA)
- c = Enc(key, msg) ----(c)---- msg = Dec(key, c)
Shared-key signature
- m,a = h(key, m) ----(m,a)---- m,a =? h(key, m)
Public-key encryption
- c = Enc(P-recv, m) ----(c)---- m=Dec(S-recv,m)
Public-key signature
- m,a = f(S-send, m) ----(m,a)---- m,a =? g(P-send,m)
Certificate is basically a message signatured by a Certificate Authority (CA)
- m,a = f(S-CA, m) ----(m,a)---- m,a =? g(P-CA, m)
SSH see a good summary at http://aperiodic.net/phil/ssh/
- Host sends its public key to client for authentication
- Key authentication
- Client generate public-private key pair
- public key is sent to Host
- Client doesn't need password anymore (it needs to input passphrase for accessing the private key though)
- ssl-agent is used to remember the passphrase so that client can log into host without being asked anything
- Sequence for Key authentication
- Client connect to Server
- Server returns a 'challenge'
- Client create an 'authenticator' from the challenge and its private key, and send it back to Server
- Server check the 'authenticator' using the Client's public key
- SSH-Transport layer uses Key Exchange algorithm
- One example is here: http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange
Jargon of terms: http://identityaccessman.blogspot.com/
Saturday, November 5, 2011
Wednesday, October 12, 2011
Tuesday, October 11, 2011
prototype to jQuery
new Element -> $elem(...)
element.getDimensions() -> $dimensions(element)
element.className = -> $j(element).{has,add,remove}Class
element.addClassName(...) -> $j(element).addClass(...)
element.setStyle(...) -> $j(element).css(...)
element.select(selector) -> $j(selector, element)
$(element).readAttribute(..) -> $j(element).attr(...)
element.show -> $j(element).show()
element.hide -> $j(element).hide()
array.last() -> array[array.length-1]
array.clear() -> array.length=0
Sunday, October 2, 2011
OAuth
- OAuth 2.0 protocol Draft: http://tools.ietf.org/pdf/draft-ietf-oauth-v2-12.pdf
- Facebook: http://developers.facebook.com/docs/authentication/
Tuesday, September 27, 2011
Monday, September 26, 2011
Thursday, September 22, 2011
Web Programming
- Reference sites
- Javascript Frameworks
- Javascript Module pattern
- Summary: http://www.yuiblog.com/blog/2007/06/12/module-pattern/
- Bad side: http://edspencer.net/2009/10/javascript-module-pattern-overused-dangerous-and-bloody-annoying.html
- Porting prototype -> jQuery
Friday, September 9, 2011
Direct3D
* Cannot be used from session 0
http://support.microsoft.com/kb/978635
* WARP: Windows Advanced Rasterization Platform
http://msdn.microsoft.com/en-us/library/gg615082.aspx
http://support.microsoft.com/kb/978635
* WARP: Windows Advanced Rasterization Platform
http://msdn.microsoft.com/en-us/library/gg615082.aspx
Thursday, September 8, 2011
Coding guidelines
Taken from ACCU mailing list:
* Applied Informatics (2008). /C++ Coding Style Guide, Rules and
Recommendations/. Retrieved on 20 August 2008.
http://www.appinf.com/ download/CppCodingStyleGuide. pdf
* Construx (2008). /CxOne General Coding Standard/. Retrieved on 29 August 2008.
http://www.construx.com/File. ashx?cid=787
* Gabryelski, Keith (1997). /Wildfire C++ Programming Style, With Rationale/.
Retrieved on 20 August 2008.
http://www.chris-lott.org/ resources/cstyle/Wildfire-C++ Style.html
* Geotechnical Software Services (April 2007). /C++ Programming Style
Guidelines/. Retrieved on 20 August 2008.
http://geosoft.no/development/ cppstyle.html
* Google (2008). /Google C++ Style Guide/. Retrieved on 26 August 2008.
* Henricson, Mats , Erik Nyquist and Ellemtel Utvecklings AB (1997).
/Industrial Strength C++/. Retrieved on 20 August 2008.
http://hem.passagen.se/erinyq/ industrial/
* Hoff, Todd (1 March 2008). /C++ Coding Standard/. Retrieved on 20 August 2008.
http://www.possibility.com/ Cpp/CppCodingStandard.html
* Lockheed Martin Corporation (December 2005). /Joint Strike Fighter Air
Vehicle C++ Coding Standards/. Retrieved on 20 August 2008.
http://www.research.att.com/% 7Ebs/JSF-AV-rules.pdf
* Philips Medical Systems (19 May 2005). Coding Standard: C#". Retrieved on
20 August 2008.
http://www.tiobe.com/ standards/gemrcsharpcs.pdf
* Stroustrup, Bjarne (2 May 2008). /C++ Style and Technique FAQ/. Retrieved
on 20 August 2008.
http://www.research.att.com/% 7Ebs/bs_faq2.html
* Sutter, Herb and Andrei Alexandrescu (November 2004). C++ Coding Standards.
Addison–Wesley. ISBN-10 0321113586, ISBN-13 978-0321113580.
http://www.gotw.ca/ publications/c++cs.htm
* The Programming Research Group (May 2004). /High-integrity C++ Coding
Standard Manual, Version 2.2/. Requested from
http://www.codingstandard.com/ .
* Applied Informatics (2008). /C++ Coding Style Guide, Rules and
Recommendations/. Retrieved on 20 August 2008.
http://www.appinf.com/
* Construx (2008). /CxOne General Coding Standard/. Retrieved on 29 August 2008.
http://www.construx.com/File.
* Gabryelski, Keith (1997). /Wildfire C++ Programming Style, With Rationale/.
Retrieved on 20 August 2008.
http://www.chris-lott.org/
* Geotechnical Software Services (April 2007). /C++ Programming Style
Guidelines/. Retrieved on 20 August 2008.
http://geosoft.no/development/
* Google (2008). /Google C++ Style Guide/. Retrieved on 26 August 2008.
* Henricson, Mats , Erik Nyquist and Ellemtel Utvecklings AB (1997).
/Industrial Strength C++/. Retrieved on 20 August 2008.
http://hem.passagen.se/erinyq/
* Hoff, Todd (1 March 2008). /C++ Coding Standard/. Retrieved on 20 August 2008.
http://www.possibility.com/
* Lockheed Martin Corporation (December 2005). /Joint Strike Fighter Air
Vehicle C++ Coding Standards/. Retrieved on 20 August 2008.
http://www.research.att.com/%
* Philips Medical Systems (19 May 2005). Coding Standard: C#". Retrieved on
20 August 2008.
http://www.tiobe.com/
* Stroustrup, Bjarne (2 May 2008). /C++ Style and Technique FAQ/. Retrieved
on 20 August 2008.
http://www.research.att.com/%
* Sutter, Herb and Andrei Alexandrescu (November 2004). C++ Coding Standards.
Addison–Wesley. ISBN-10 0321113586, ISBN-13 978-0321113580.
http://www.gotw.ca/
* The Programming Research Group (May 2004). /High-integrity C++ Coding
Standard Manual, Version 2.2/. Requested from
http://www.codingstandard.com/
Wednesday, September 7, 2011
Tuesday, September 6, 2011
How to kill a process tree on Windows
Option 1: Query the system to generate the process tree, then kill each process in the tree as noted below.
http://stackoverflow.com/questions/3235218/how-terminate-child-processes-when-parent-process-terminated-in-c/5680096#5680096
http://stackoverflow.com/questions/3235218/how-terminate-child-processes-when-parent-process-terminated-in-c/5680096#5680096
However, there is a corner case that if some of the processes in the tree invokes some other processes between the step collect process <=> create tree, then we will miss the newly created process.
Option 2: Use Job Objects mechanism provided by Windows
On the topmost parent, create a Job Object and assign the current process to it. This way, the later invoked descendant processes are automatically added into the Job Object. Then we can kill the Job Object to kill the entire tree.
http://msdn.microsoft.com/en-us/library/ms684161%28VS.85%29.aspx
This option avoid the corner case on Option 1, however, we need to program the code into the parent process in order to do this.
Example of using Job Objects from C#
http://stackoverflow.com/questions/3342941/kill-child-process-when-parent-process-is-killed
DLL Init/Cleanup sequence
See ctrdll.c
- crtdll.c: BOOL WINAPI _CRT_INIT()
- crtdll.c: BOOL __cdecl __DllMainCRTStartup()
... this call _CRT_INIT()
- crtexe.c: int __tmainCRTStartup()
... similar to __DllMainCRTStartup()
Basic sequence for DLL_PROCESS_ATTACH
for each DLL
- Call __CRT_INIT() -> invoke C initializers then C++ constructors
- Call DllMain hook
Basic sequence for DLL_PROCESS_DETACH
for each DLL
- Call DllMain hook
- Call __CRT_INIT() -> invoke C+_ destructors and C atexit()/_onexit() ... reverse order of initialization
Basic sequence for DLL_THREAD_ATTACH and DLL_THREAD_DETACH
for each DLL
- Call DllMain hook
CWinApp::InitInstance and CWinApp::ExitInstance are called as part of DllMain hook (they are only called for DLL_PROCESS_ATTACH and DLL_PROCESS_DETACH).
Article regarding the order of DLL loading:
http://blogs.msdn.com/b/oleglv/archive/2003/10/28/56142.aspx
"Well, turns out that the loader seems to be preserving the order in which the imported DLLs are listed in the Imports Section of the loading executable."
- crtdll.c: BOOL WINAPI _CRT_INIT()
- crtdll.c: BOOL __cdecl __DllMainCRTStartup()
... this call _CRT_INIT()
- crtexe.c: int __tmainCRTStartup()
... similar to __DllMainCRTStartup()
Basic sequence for DLL_PROCESS_ATTACH
for each DLL
- Call __CRT_INIT() -> invoke C initializers then C++ constructors
- Call DllMain hook
Basic sequence for DLL_PROCESS_DETACH
for each DLL
- Call DllMain hook
- Call __CRT_INIT() -> invoke C+_ destructors and C atexit()/_onexit() ... reverse order of initialization
Basic sequence for DLL_THREAD_ATTACH and DLL_THREAD_DETACH
for each DLL
- Call DllMain hook
CWinApp::InitInstance and CWinApp::ExitInstance are called as part of DllMain hook (they are only called for DLL_PROCESS_ATTACH and DLL_PROCESS_DETACH).
Article regarding the order of DLL loading:
http://blogs.msdn.com/b/oleglv/archive/2003/10/28/56142.aspx
"Well, turns out that the loader seems to be preserving the order in which the imported DLLs are listed in the Imports Section of the loading executable."
Thursday, August 25, 2011
Thursday, August 18, 2011
Installer
How to enable Windows Installer logging
* http://support.microsoft.com/kb/223300
* Many tips
http://www.robertdickau.com/msi_tips.html
* Orca MSI editor
http://www.technipages.com/download-orca-msi-editor.html
* http://support.microsoft.com/kb/223300
* Many tips
http://www.robertdickau.com/msi_tips.html
* Orca MSI editor
http://www.technipages.com/download-orca-msi-editor.html
Monday, August 8, 2011
Tuesday, July 19, 2011
Sunday, July 3, 2011
Bull's eye
* Bull's eve fusion on Volume Rendering
* Technical Aspects of Bull's eye
Hearts
- {Left,Right} x {Atrium,Ventricle}
- Diastole, Systole
- Left Ventricle -> Apex ... Base
- Coronary arteries:
- RCA: Right Coronary Artery
- LAD: Left Anterior Descending
- LCX: Left Circumflex
* Good introduction inside the thesis
* Technical Aspects of Bull's eye
Hearts
- {Left,Right} x {Atrium,Ventricle}
- Diastole, Systole
- Left Ventricle -> Apex ... Base
- Coronary arteries:
- RCA: Right Coronary Artery
- LAD: Left Anterior Descending
- LCX: Left Circumflex
* Good introduction inside the thesis
Saturday, July 2, 2011
Isosurface rendering
http://www.csc.lsu.edu/~karki/SV/09-Isosurfacing.pdf
SlimDX, .NET wrapper for DirectX: http://slimdx.org/
SlimDX, .NET wrapper for DirectX: http://slimdx.org/
Saturday, June 25, 2011
Javascript HTML CSS
* Non-integer offsetWidth and offsetHeight in IE9 and FF4
http://vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/
* Memory Leak:
http://www.javascriptkit.com/javatutors/closuresleak/index.shtml
http://msdn.microsoft.com/en-us/library/Bb250448
http://stackoverflow.com/questions/1051090/how-can-i-control-ie6jqueryjquery-ui-memory-leaks
http://www.reigndropsfall.net/2011/01/05/internet-explorer-event-handler-leaks/
http://kirblog.idetalk.com/2011/06/prototype-17-memory-leak.html
Drip http://outofhanwell.com/ieleak/index.php?title=Main_Page
* How to handle IE6
http://www.virtuosimedia.com/dev/css/ultimate-ie6-cheatsheet-how-to-fix-25-internet-explorer-6-bugs
* Speeding up access
http://developer.yahoo.com/performance/rules.html
http://vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/
* Memory Leak:
http://www.javascriptkit.com/javatutors/closuresleak/index.shtml
http://msdn.microsoft.com/en-us/library/Bb250448
http://stackoverflow.com/questions/1051090/how-can-i-control-ie6jqueryjquery-ui-memory-leaks
http://www.reigndropsfall.net/2011/01/05/internet-explorer-event-handler-leaks/
http://kirblog.idetalk.com/2011/06/prototype-17-memory-leak.html
Drip http://outofhanwell.com/ieleak/index.php?title=Main_Page
* How to handle IE6
http://www.virtuosimedia.com/dev/css/ultimate-ie6-cheatsheet-how-to-fix-25-internet-explorer-6-bugs
* Speeding up access
http://developer.yahoo.com/performance/rules.html
* Cache control
Four headers:
◆ Last-Modified
◆ Expires
◆ Pragma
◆ Cache-Control
- public: Can be cached anywhere
- private: Only cacheable by browsers
- no-cache: Cannot be cached anywhere
- must-revalidate: Caches must check for newer versions
- proxy-revalidate: Proxy caches must check for newer versions
- max-age: A duration, in seconds, that the content is cacheable
- s-maxage: Overrides the max-age value for shared cachesC
Conditional GET and Etag http://jagbarcelo.blogspot.jp/2009/03/conditional-get-and-etag-implementation.html
Caching tutorial http://www.mnot.net/cache_docs/
Monday, May 23, 2011
CUDA Learning
- Summary of CUDA 4.0 New Features
- Andreas Moshovos lecture slides
- CuPP C++ Wrapper
- CUDA lectures
- C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\tools\CUDA_Occupancy_Calculator.xls
- NVIDIA Architecture and Fermi, see http://www.nvidia.com/content/PDF/fermi_white_papers/NVIDIA_Fermi_Compute_Architecture_Whitepaper.pdf
- Texture bind and multithreading http://forums.nvidia.com/index.php?showtopic=197400
- Volume Rendering using GPU
Wednesday, May 11, 2011
Tuesday, May 10, 2011
Memory Leak
* Visual Leak Detector http://vld.codeplex.com/documentation
* IAT patching technique explained http://domemtech.com/?p=504
* IAT patching technique explained http://domemtech.com/?p=504
Thursday, April 21, 2011
Wednesday, April 6, 2011
Wednesday, March 2, 2011
WPF Pixel Shader
* http://wpffx.codeplex.com/
* Shader Effect Visual Studio Project Template and Build Task
* Sample 1 http://khason.net/blog/hlsl-pixel-shader-effects-tutorial/
* Sample2 http://d.hatena.ne.jp/NyaRuRu/20080813/p1
* Tutorial http://cid-123ec1ed6c72a14a.skydrive.live.com/browse.aspx/Public/HLSL
* MSDN reference http://msdn.microsoft.com/en-us/library/bb509561%28VS.85%29.aspx
* Shader Effect Visual Studio Project Template and Build Task
* Sample 1 http://khason.net/blog/hlsl-pixel-shader-effects-tutorial/
* Sample2 http://d.hatena.ne.jp/NyaRuRu/20080813/p1
* Tutorial http://cid-123ec1ed6c72a14a.skydrive.live.com/browse.aspx/Public/HLSL
* MSDN reference http://msdn.microsoft.com/en-us/library/bb509561%28VS.85%29.aspx