Tuesday, July 26, 2011
Friday, July 22, 2011
C++ - MD and MT compile option
Simple explanation
Microsoft Visual C++ Static and Dynamic Libraries
http://shitohichiumaya.blogspot.com/2009/10/visual-c-md-and-mt-compile-option.html
- MT: Multi-threaded static library. This is good for distribution a whole application package, since everything is statically linked and there is no dependency to the environment.
- MD: Multi-threaded Dynamic link library. If you distribute some library instead of a whole application, dynamically linked runtime is better since, some part of the program uses one version of runtime, and the other uses different version,this causes a trouble. For example, 'new'ed some memory at one version of runtime, and 'delete'd by other version of runtime could be a trouble.
http://dev.mobixo.net/2008/03/use-mtd-or-mdd.html
| /MD | causes application to use the multithread- and DLL-specific version of the run-time library. Applications compiled with this option are linked to MSVCRT.lib. This library provides a layer of code that allows the linker to resolve external references. The actual working code is contained in MSVCR80.DLL, which must be available at run time to applications linked with MSVCRT.lib. |
/MT | causes your application to use the multithread, static version of the run-time library. Defines _MT and causes the compiler to place the library name LIBCMT.lib into the .obj file so that the linker will use LIBCMT.lib to resolve external symbols. |
C++ - The #include Directive
http://msdn.microsoft.com/en-us/library/36k2cdd4(v=vs.80).aspx
#include "path-spec" #include <path-spec>
| Syntax Form | Action |
|---|---|
Quoted form | This form instructs the preprocessor to look for include files in the same directory of the file that contains the #include statement, and then in the directories of any files that include (#include) that file. The preprocessor then searches along the path specified by the /I compiler option, then along paths specified by the INCLUDE environment variable. |
Angle-bracket form | This form instructs the preprocessor to search for include files first along the path specified by the /I compiler option, then, when compiling from the command line, along the path specified by the INCLUDE environment variable. |
web terminologies
AJAX - http://en.wikipedia.org/wiki/Ajax_(programming)
Document Object Model (DOM)
- The Document Object Model (DOM) is a cross-platform andlanguage-independent convention for representing and interacting with objects in HTML, XHTML and XML documents.
http://www.quirksmode.org/dom/intro.html
Document Object Model (DOM)
- The Document Object Model (DOM) is a cross-platform andlanguage-independent convention for representing and interacting with objects in HTML, XHTML and XML documents.
http://www.quirksmode.org/dom/intro.html
Difference Between Unicode and ASCII,
http://www.differencebetween.com/difference-between-unicode-and-ascii/Thursday, July 21, 2011
Sencha - loading an image
- set an ID of Panel (e.g., PreviewPaneAI)
- set an ID of a sub-panel for an image (e.g., assetImageContainerAI),
and set a height properly.
- Send an image properly to a client from Phython,
- Use the following code for AIuserProject.js.
updatePreview: function(node) {
var str='<img src="{img}" style="float: right;" height="100%" />';
str = str.replace("{img}",node.attributes.thumbnailURL);
panel = Ext.getCmp('assetImageContainerAI');
panel.body.update(str);
}
- set an ID of a sub-panel for an image (e.g., assetImageContainerAI),
and set a height properly.
- Send an image properly to a client from Phython,
- Use the following code for AIuserProject.js.
updatePreview: function(node) {
var str='<img src="{img}" style="float: right;" height="100%" />';
str = str.replace("{img}",node.attributes.thumbnailURL);
panel = Ext.getCmp('assetImageContainerAI');
panel.body.update(str);
}
Tuesday, July 19, 2011
Sencha - combo box
After creating a combo box, we have to
- Set the url.
- Set id and autoRef.
- minChars: 0,
- displayField: 'filename', (which is one of components of the fileStore.)we need to set autoRef: fileLoadForm2 of the FormPanel,
and autoRef: loadProjectPresetButton2 of the Button,
and then implement as follows (MainPanel.js)
this.loadProjectPresetButton2.on('click', this.onSubmitClick.createCallback(this, this.fileLoadForm2, false));
this.loadProjectPresetButton2.on('click', this.delayRefreshAllTrees, this );In addition, Tree.py
if "fileSelectCombobox2" in e.__dict__:
self.loadTree(os.path.join(BASE_PROJECT_FOLDERS[0],e.fileSelectCombobox2)+PROJECTFILE_INDICATOR)// Upload from Vizard to Browser of saved trees.//
socket.onevent('saved_trees', function(e){//})
#page_request = page_request.split('?_dc')[0]
Sencha - textfield
First, make a Textfield and a Button under a FormPanel including a FieldSet (which is for a layout).
FormPanel should have an autoRef (e.g., fileSaveForm) for this code (MainPanel.js)
The 'fileSaveButton' is an autoRef of the 'Save Project Preset' button.
'fileSaveField' is an autoRef of the textfield.
this.fileSaveButton.on('click', this.onSubmitClick.createCallback(this, this.fileSaveForm, false));
this.fileSaveButton.on('click', this.delayRefreshAllTrees, this);
Finally, when a user clicks the button, the fileSaveForm is invoked
and somehow the textfield under the formpanel is invoked as well.
Then, a text message (written by the user) is transferred to python scripts using a callback function.
mk:@MSITStore:C:\Program%20Files%20(x86)\WorldViz\Vizard4\help\Vizard.chm::/vizhtml_collecting_form_data.htm
On the other hand, when you display something from python to Sencha, we can call data as follows.
Of course, somehow we need to register JSON.
vizhtml.registerCode("check-nodes.json",items,isFile=True)
initComponent: function() {
this.on('click', this.onClick, this);
},
onClick: function(node){
if (node.isLeaf()) {this.updatePreview(node);
}
},
updatePreview: function(node) {
Ext.getCmp('fileSaveField').setValue(node.attributes.file_location);
}
Subscribe to:
Posts (Atom)
