Visual C++ Express:
When a C/C++ application is built using functionality provided by the Visual C++ libraries, it becomes dependent on the presence of those libraries at runtime. In order for the application to run, it must link, either statically or dynamically, to the necessary Visual C++ libraries. see Windows Installer Deployment
For applications built in Visual C++ Express, it is recommended to redistribute Visual C++ libraries using the Visual C++ Redistributable Package (vcredist_x86.exe). Visual C++ Express does not install this package; however, it can be downloaded from Microsoft Visual C++ 2005 Redistributable Package (x86).
R6034 msvcr80.dll "Microsoft.VC80.CRT" vcredist_x86.exe Microsoft_VC80_CRT_x86.msm error for newly compiled programs,
solving the problem of running programs developed with Visual C++ Express on another computer. It is not enough to just copy the msvcr80.dll to another computer or folder! What you need to do is to redistribute your own application *.exe and vcredist_x86.exe.
http://www.codeproject.com/cpp/vcredists_x86.asp
http://blogs.msdn.com/nikolad/archive/2005/09/02/460368.aspx
How to print a long long integer using printf? A rather trivial question, well, not with MS Visual Express C++.
long = FFFFFFFFh = 4,294,967,295d and long long (with 16 byte) = FFFFFFFFFFFFFFFFh = 18,446,744,073,709,551,615d
But printf("%d",longlong) fails. What to take? You can take printf("%llX",longlong) if you can read hexadecimal.
Read more here: Size Prefixes for printf and wprintf Format-Type Specifiers
..
long long OverflowCatcher = 18446744073709551615;
printf("long long: %X \n", OverflowCatcher);
printf("long long: %d \n", OverflowCatcher);
printf("long long: %i \n", OverflowCatcher);
printf("long long: %lli \n", OverflowCatcher);
printf("long long: %o \n", OverflowCatcher);
printf("long long: %u \n", OverflowCatcher);
printf("long long: %f \n", OverflowCatcher);
printf("long long: %Ld \n", OverflowCatcher);
printf("long long: %lld \n", OverflowCatcher);
printf("long long: %llf \n", OverflowCatcher);
printf("long long: %lli \n", OverflowCatcher);
printf("long long: %llu \n", OverflowCatcher);
printf("long long: %Lu \n", OverflowCatcher);
printf("long long: %LX \n", OverflowCatcher);
printf("long long: %I64u \n", OverflowCatcher);
printf("long long: %I64d \n", OverflowCatcher);
printf("long long: %llu \n", OverflowCatcher);
printf("long long: %Lu \n", OverflowCatcher);
printf("long long: %qu \n", OverflowCatcher);
..
long long: FFFFFFFF
long long: -1
long long: -1
long long: -1
long long: 37777777777
long long: 4294967295
long long: -1.#QNAN0
long long: -1
long long: -1
long long: -1.#QNAN0
long long: -1
long long: 18446744073709551615
long long: 4294967295
long long: FFFFFFFF
long long: 18446744073709551615
long long: -1
long long: 18446744073709551615
long long: 4294967295
long long: qu
..
So, use printf("%llu",longlong); or printf("%I64u",longlong) to print a long long integer. Thank you.
Boolean in C or C++?
Using bool in C and MS Visual C++ Express results in: error C2059: syntax error : 'type'
Check with:
#if !defined(__BOOL_DEFINED)
printf_s("bool is not supported\n");
#elif defined(__BOOL_DEFINED)
printf_s("bool is supported\n");
#endif
Explanation from Codecomments.com
Your are compiling your code as C (not C++) code. Type 'bool' is not
present in the original C language. It was introduced relatively
recently in new C standard - C99. However, your compiler does not
support C99.
Either forget about 'bool' or use C++.
--
Best regards,
Andrey Tarasevich
Solution: Compile as C++ Code (/TP). Thank you
PubChem and SOAP and Office XP and XML Web Services from Office VBA
PubChem and SOAP and EXCEL+SOAP+VBA and the SOAP toolkit which is deprectated by .NET Webservices
An overview how to use the Entrez Utilities Web Service.
Example: http://www.ncbi.nlm.nih.gov/entrez/eutils/egquery.fcgi?CMD=search&DB=pccompound&term=Taxol
produces as output:
Taxol pubmed PubMed 11974 Ok pmc PMC 1249 Ok journals Journals 0 Term or Database is not found mesh MeSH 64 Ok books Books 64 Ok omim OMIM 11 Ok omia OMIA 0 Term or Database is not found ncbisearch NCBI Web Site 0 Term or Database is not found nucleotide Nucleotide 169 Ok protein Protein 146 Ok genome Genome 0 Term or Database is not found structure Structure 3 Ok taxonomy Taxonomy 0 Term or Database is not found snp SNP 342 Ok gene Gene 32 Ok unigene UniGene 2 Ok cdd Conserved Domains 2 Ok domains 3D Domains 12 Ok unists UniSTS 0 Term or Database is not found popset PopSet 0 Term or Database is not found geo GEO Profiles 17 Ok gds GEO DataSets 5 Ok homologene HomoloGene 18 Ok cancerchromosomes CancerChromosomes 1 Ok pccompound PubChem Compound 38 Ok pcsubstance PubChem Substance 68 Ok pcassay PubChem BioAssay 134 Ok nlmcatalog NLM Catalog 43 Ok gensat GENSAT 0 Term or Database is not found probe Probe 3 Ok genomeprj Genome Project 0 Term or Database is not found
ACRONIS and CACLs using mounted volumes
Backup and Restore with Acronis works fine, however if you have a Windows system with different users/admins you may step into problems with ACLS and access controls (even if you do not use EFS) on the new system. It is of course a good idea to backup a recovery agent private key. However this may not help you in some special cases (domain settings). That means after a crash or migration to a new system you can not access your files anymore. A quick check is to mount your backup on a new computer (not the original one) and run the following programs.
1) The Windows Sysinternals AccessChk tool with GUI and very fast. If something is wrong it will show ??? in Read/Write/Deny.
2) Windows Support Tools vfi.exe to calculate a CRC-32 (whenever the CRC calculation fails you are in trouble).
3) Run CACLs under the dos console (cmd) which displays or modifies access control lists (ACLs) of files
Turning off/on some switches (do not transfer security desciptors during backup) within ACRONIS 9.1 (according to Acronis Tech Support) does not help for mounted volumes. It helps only during direct restore. You may find some other solutions here: Fundamental Computer Investigation Guide For Windows Overview
JAVA 1.6 (Mustang) and the Eclipse 3.2 profiler (TPTP workbench)
Could not resolve to JVMPI interface
FATAL ERROR: JVMPI, an experimental interface, is no longer supported.
Please use the supported interface: the JVM Tool Interface (JVM TI).
For information on temporary workarounds contact: This email address is being protected from spambots. You need JavaScript enabled to view it.
Error occurred during initialization of VM
-Xrun library failed to init: piAgent
See SUN bug report: JVMPI removed from Mustang
Solution, use JVM 1.5 as Profiler, goto Eclipse Window --> Preferences --> JAVA Installed JREs --> search all and select and older JAVA VM. You can also set the proper execution environment.
Or you can manually profile your stuff with:
java -Xrunhprof:cpu=samples,depth=10,monitor=y,thread=n,doe=y -server myTestclass.class
Well, not so quick. Under WINDOWS this doesnt work as it should. You can have multiple JAVA versions (JVMs) installed.
The current version is controlled via the System --> Control Panel --> JAVA. To be absolutely sure which JAVA engines starts the Eclipse Environment open a command window and type JAVA -version. Additionally use the Sysinternals process explorer to get the selected path for Eclipse.exe. Per default an older JVM is not allowed under Windows, so you need to de-install version 1.6 or use Eclipse 3.3 and JVMTI. Additionally you can go to windows/system32 path and rename JAVAW.exe and JAVA.exe, in this way the older 1.5 version is used via the PATH argument or environment settings (JAVA_HOME).
Eclipse 3.2 and the TPTP Profiler and Agent Controller error
You installed the TPTP Profiler in a certain network environment and it worked, now you changed the host system and want to work locally (no network). This is true for WIN and LINUX.
Now everytime you start profiling the computer wants to make a connection to the computer it was supposedly installed on. Profiling is not possible anymore. (With or without firewall)
ERROR:
IWAT0284E The agent controller is not available on host localhost.
Make sure that:
* the agent controller is installed.
* the agent controller is configured to communicate with your machine.
* you have the correct host name and port number for the agent controller.
or
IWAT3034E: The agent controller on localhost:10002 is unavailable
Solution:
Goto Eclipse --> Windows --> Preferences --> Profiling and Logging --> hosts
You see two or more hosts (Assume you don't need remote profiling)
1) Local Direct Connection
2) localhost 10002
A) REMOVE the localhost 10002, (local direct connection should work) and apply (1)
B) If this is not possible, go to profile environment, terminate and delete old started projects(!)
C) Close and restart eclipse
D) goto Preferences and delete localhost 10002 now.
Voila! Profiling works.
Using LINUX GUIs (X11) under WIN requires the free Cygwin packet installed.
Do not forget to install the whole X11 package.
Use: cygwin.bat will start a shell or a Cygwin bash shell can be opened.
type startx will start the XWindows environment.
Problems.Error message:
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root
winValidateArgs - g_iNumScreens: 1 iMaxConsecutiveScreen: 1
(II) XF86Config is not supported
(II) See http://x.cygwin.com/docs/faq/cygwin-x-faq.html for more information
....
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
winPointerWarpCursor - Discarding first warp: 960 600
winInitMultiWindowWM - pthread_mutex_lock () returned.
Solution: Instead of startx use /usr/X11R6/bin/startxwin.sh
this will start XWIN correctly
Well, this is not the right explanation for the solution, bot the configs are different
so it works ;-)
A minimalistic Win XP takes around 38 MByte to 80 MByte. The new WIN7 with MinWin shown by Eric Traut is also a memory hog with 33 MBytes. In the screenshot below a WINXP with all stopped services and no explorer is shown. Given the fact that a crapware loaded PC eats up to 700 MByte thats quite an achievement. The non-stoppable services include the DCOM Server process launcher, the event log, plug and play, remote procedure calls (RPC), Security Accounts Manager, Terminal Services.
With a minimalistic version using full explorer support, but no network and printing support, many applications still run flawless. Furthermore the Windows Explorer is not needed for running programs. Its just a convenience GUI.
MinWin XP with Explorer excluded and most services stopped.
2D and 3D and n-Dimensional Sorting in EXCEL VBA
An oldie but goldie, how can I sort an 2-dimensional array, how can I sort a 3-dimensional array?
If you have 2D create Dim vntTemp(1 To 2) As Variant, or 10D: Dim vntTemp(1 To 10) As Variant
And for 2D add: lngCol = 1 To 2 and for 10D add lngCol = 1 To 10. You can also add avariable which defines the dimension.
If you use doubles (numbers) define them as double with CDbl(x), otherwise it will be sorted as variant/string.
The sort the array from the back:
BubbleSort3DimDesc My3DArray, 3
BubbleSort3DimDesc My3DArray, 2
BubbleSort3DimDesc My3DArray, 1
For small arrays its OK, otherwise look at ozgrid or cpearson QSortObjectsInPlace
Function BubbleSort3DimAscstrong>(TempArray() As Variant, SortIndex As Long)
'original from Andy Pope MVP - adujusted for 3DIM Array by Tobi, untested, fits my purpose
'http://social.msdn.microsoft.com/Forums/en-AU/isvvba/thread/320f3328-cb4f-43ce-aedf-c0f00f253b64
Dim blnNoSwaps As Boolean
Dim lngItem As Long
Dim vntTemp(1 To 3) As Variant
Dim lngCol As Long
Do
blnNoSwaps = True
For lngItem = LBound(TempArray) To UBound(TempArray) - 1
If TempArray(lngItem, SortIndex) > TempArray(lngItem + 1, SortIndex) Then
blnNoSwaps = False
For lngCol = 1 To 3
vntTemp(lngCol) = TempArray(lngItem, lngCol)
TempArray(lngItem, lngCol) = TempArray(lngItem + 1, lngCol)
TempArray(lngItem + 1, lngCol) = vntTemp(lngCol)
Next
End If
Next
Loop While Not blnNoSwaps
End Function
Function BubbleSort3DimDesc(TempArray() As Variant, SortIndex As Long)
'original from Andy Pope MVP - adujusted for 3DIM Array by Tobi, untested, fits my purpose
'http://social.msdn.microsoft.com/Forums/en-AU/isvvba/thread/320f3328-cb4f-43ce-aedf-c0f00f253b64
Dim blnNoSwaps As Boolean
Dim lngItem As Long
Dim vntTemp(1 To 3) As Variant
Dim lngCol As Long
Do
blnNoSwaps = True
For lngItem = LBound(TempArray) To UBound(TempArray) - 1
If TempArray(lngItem, SortIndex) < TempArray(lngItem + 1, SortIndex) Then
blnNoSwaps = False
For lngCol = 1 To 3
vntTemp(lngCol) = TempArray(lngItem, lngCol)
TempArray(lngItem, lngCol) = TempArray(lngItem + 1, lngCol)
TempArray(lngItem + 1, lngCol) = vntTemp(lngCol)
Next
End If
Next
Loop While Not blnNoSwaps
End Function
The fastest compiler switch for integer operations and the GCC compiler
Surprise, Surprise, its not -O2 or -O4, but a set of unrolled loops and alignments that also create a larger .EXE file
gcc -O24 -static -falign-jumps=8 -falign-functions=8 -fno-caller-saves -fsched-spec-load -fgcse-las -fgcse-sm -funroll-loops
For floating point its vectorized SS2 and SS3 and SS4 operations.
Keywords: SPEC.org and genetic optimization of compiler switches.
Source: EEMBC CoreMark and CoreMark complete list
UNDO fails in Word 2010 and EndNote X5 - VBA-Range.Text
This is an confirmed EndNote X5 with Word 2010 fubar. Copy/paste text with an EndNote X5 reference, the Undo function in word will be filled with multiple instances of VBA. Pressing Hundreds of times UNDO solves the issues and creates a everlasting aversion against the duo infernale (only topped by the Word ribbon and Endnote travelling libraries).
See: EndNote FAQ http://www.endnote.com/support/Faqs/CWYW/faq15.asp and
Microsoft 3db09314-be5a-4261-949b-ecb87f1eb369
Virtualbox broken and corrupt files on network shares
This is a very annoying problem, confirmed for LINUX<-> LINUX and LINUX <-> WIN. For Ubuntu the files in nautilus seem correct, but opening the files the content is corrupt. The same for ls and nautilus, the folders are different on mounted files or the folder content looks different. Similar, files that are copied from shares and edited do not contain the original content anymore. Basically virtualbox shared files are all damaged or corrupt once inside the VM. This is confirmed up to version 4.3 (2014). There is no final solution, just workarounds (such as reboot or update VBOX additions).
See Google: virtualbox shared folder damaged OR vbox shared files mount corrupt OR Virtualbox shared folder corrupts files OR corrupted file in shared folder
Workaround: Under VBOX and Ubuntu do not use nautilus for copying files, use MC (Midnight Commander) and preserve attributes. Copy files from outside (guest) to inside (host) with MC and edit in MC. Do not edit files on the share directly.
Plone and TinyMCE
Problem: The TinyMCE wysiwy geditor editor does not open during website editing or areas are grayed out. Other issues inclue hyperlinks or pictures can not be inserted. Sometimes resizing the Javascript window helps. Better:
Solution: Use Chrome and reset the view or zoom level to 100%