Friday, July 10, 2009

Schema 24 Volts Charger Battery

COLLADA setup

Windows (Visual Studio)

Compiling DOM

solution files and projects in Visual Studio directory

[Sun-path] \\ projects

and include the project files for VS 2005 and VS 2008.

dom.sln Open the file and compile the project Sun dynamic library for the DLL version, or compile the project dom-static to get a static library LIB.

Whatever type you choose, the compiler will be placed in the folder \\ build .

Compiling client applications

will happen, below, to see "vc8" in different ways: those are for Visual C + + 8 (Visual Studio 2005), if you're using Visual C + + 9 (Visual Studio 2008) , replace "VC9" a "vc8" in all respects in which it appears.

will happen also to see "1.4" and "14", referring to COLLADA 1.4.

If you are using COLLADA 1.5, replace it with "1.5" and "15."

Project Settings

Change project settings, select the menu Project -> Properties .

All settings that affect us are in the Configuration Properties menu .

Set the directory of the headers

expand the menu C / C + + add the item Additional Include Directories the following files:

\\ include

\\ include \\ 1.4

\\ external-libs \\ boost

Set preprocessor directives

In a Sun or dom-static , add these directives to the voice Preprocessor menu C / C + +:

BOOST_ALL_NO_LIB

PCRE_STATIC

DOM_INCLUDE_LIBXML

Linking with static library

Select menu Linker and add the following lines in Additional Library Directories:

\\ build \\ vc8-1.4 (release) or \\ build \\ vc8-1.4-d (debug)

\\ external-libs \\ libxml2 \\ win32 \\ lib

\\ external-libs \\ pcre \\ lib \\ vc8

\\ external-libs \\ minizip \\ win32 \\ lib \\

\\ external-libs \\ boost \\ lib \\ vc8

Add the following lines in the menu under Input Additional Dependencies

libcollada14dom22-s.lib (release) or libcollada14dom22-sd.lib (debug)

libxml2_a.lib

zlib.lib

wsock32.lib

pcre.lib (release) or pcre-d.lib (debug)

pcrecpp.lib (release) or pcrecpp-d.lib (debug)

minizip.lib (release) or minizip-d.lib (debug)

libboost_filesystem.lib (release) or libboost_filesystem-d.lib (debug)

libboost_system.lib (release) or libboost_system-d.lib (debug)

Warnings and errors at runtime linker

filling out an application that links the static library you could get into this warning:

LINK: warning LNK4098: defaultlib 'MSVCRT' Conflicts with use of other libs; use / NODEFAULTLIB: library

Ignoring the warnings you encounter an error at runtime like this:

This application has failed to start Was Because MSVCR80.dll not found. ...

If you encounter this problem go to the voice Ignore specific library Linker menu and add msvcrt.

Recompile and warnings should disappear and the application work.



Sunday, June 28, 2009

How Do Units Of Insulin Equate To Cc's?

How to Save a file in Python

First we must distinguish between text files and binary files. The first are those that if you open a text editor are readable (and understandable?) The latter do contain a series of strange characters.
Then what are the binaries? The advantage is that when you save the binary numbers is more efficient and therefore smaller. However, when you are a beginner to a binary file is a little 'difficult to manage, because we see through the examples.
Try saving the phrase "Hello World!" in ascii and binary
ASCII
# Open the file in write mode test
f = open ("test.txt", "w") # write the sentence
f.write (" Hello World! ")
# close the file f.close ()
File size: 12 Bytes
Binary
import struct # Open the file in write mode and binary provabin
f = open ("provabin.txt ',' w + b ')
# convert the sentence
struct.pack bin = ('12s ',' Hello World! ") #
the 12s indicates that we are converting a string of 12 characters
# write the sentence
f.write (bin )
# close the file f.close ()
File size: 12 Bytes
Try opening the file and compare them, maybe you will surprised ...
The two files are identical this is because the binary encoding of a character is the character himself, this is due to the amount of information managed by the binary data format.
aside the explanation of why it is so (easily retrievable on the Internet or on any computer book) we can see what is gained in using ascii or binary wanting to save the number 12345, it will in a text file Byte 9 (1 Character -> 1 Byte), whereas in a binary file it would take a total of 2 bytes (an integer -> 2 Bytes)
Now let's try to save 12,345 in ascii and binary
ASCII
# Open the file in write mode test
f = open ("test.txt", "w") # write the sentence
f.write ("12345") # close
file f.close ()
File Size: 5 Bytes
Binary
import struct # Open the file in write mode and binary provabin
f = open ("provabin.txt ", 'w + b') # convert the sentence
struct.pack bin = ('h', 12345)
# h indicates that we are running a short (2Byte)
# write the phrase
f.write (bin) # close the file
f.close ()
File size: 2 Byte