How to put a literal percent sign (%) inside F#'s printf format strings? - .net-4.0

I want to print a % sign using F#'s printfn function. After googling the format syntax, this should do the trick: printfn "%%". Apparently not...
F# interactive output:
> printfn "%%";;
%%
val it : unit = ()
Weird...
I'm using F#3.1 and .NET 4.5, the F# interactive session uses .NET 4.0. Same thing.
For reference: printfn "%" doesn't compile (missing format specifier) and printfn "%s" "%" is my current workaround...
Update:
When I change the target F# runtime from 3.1 to 3.0, it works. Is this a bug in the 3.1 runtime?

If printfn "%%" outputs two percent signs (%%) instead of one percent sign (%), then you have to update F# 3.1 to at least version 3.1.1.
If you are using Visual Studio 2013, you can do this via Tools → Extensions and Updates → Updates → Visual Studio Gallery → Visual FSharp Tools.

Related

What does "branch##branch##branch" mean in Clearcase?

Background
I am trying to axe away some elements that are no longer needed in clearcase. I think I might have subverted some policy, becuase after I ran a rmbranch on the files I wanted to remove, each file ended up in this state:
/some/directory/##/main/dev/retired_branch_time_stamp/oldViewNum1234/1/file.txt##/main/dev/new_view_3425_nickname/1
I am familiar with /some/directory/element##/some/branch but not with the double "##" notation above. Hench my question...
Question
What does the something##something##something notation mean in clearcase?
As I mentioned in "Access labels of file through extended filename as directory", everything after the ## is a version-extended pathname (see pathnames_ccase )
Branch: element-pname##branch-pname
Version: element-pname##version-selector
So:
The first part /some/directory/##/ is a VOB-extended namespace directory
Then you have the pname followed by a version selector.
That does refer to the concept of "extended namespace":
An extension of the standard Windows or Linux or UNIX file system that allows access to versions of elements.

YAML with VC++ 2010 will compile to Release, but not to Debug

I'm trying to learn YAML with C++, i made the given yaml-cpp files into a .dll and .lib file with VC++ Express 2010 by using CMake. I have set up my project the same way i set up other libraries like SFML.
My issue is, when i try to build a Release version of the example code given on the yaml-cpp site i get:
Ogre
Dragon
Wizzard
However, when i try to build a Debug version, i get:
Assertion failed: false, file d:\microsoft visual studio 10.0\vc\include\yaml-cp
p\nodeimpl.h, line 39
I don't know how to handle this. Do i need to build a debug version of the library? If yes, how? I don't know which project options could affect this if i managed to change something.
When i'm compiling, i get a warning:
d:\microsoft visual studio 10.0\vc\include\yaml-cpp\conversion.h(51): warning C4146: unary minus operator applied to unsigned type, result still unsigned
With alot of template printouts, f.e. :
1> d:\microsoft visual studio 10.0\vc\include\yaml-cpp\nodereadimpl.h(35) : see reference to function template instantiation 'bool YAML::ConvertScalar<T>(const YAML::Node &,T &)' being compiled
1> with
1> [
1> T=unsigned int
1> ]
Is this a problem on my side? Bad CMake file and compilation?
> yaml_test.exe!main() Line 108 C++
yaml_test.exe!__tmainCRTStartup() Line 555 + 0x19 bytes C
yaml_test.exe!mainCRTStartup() Line 371 C
kernel32.dll!7c817077()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
Aborts at:
doc[i] >> monster;
The program doesn't try to enter the overloaded function.
In my own code it breaks when i try to use my first >> operator, which is the build in one for int.
I'm using the code from http://pastebin.com/PdKWDgQa, though for the original yaml-cpp example code it does the same. The output in Release mode is right, Debug stops and returns the same assert code.
For reference, the stack call in Release mode at the { bracket in the >> function for monster looks like this:
> yaml_test.exe!operator>>(const YAML::Node & node={...}, Monster & monster={...}) Line 36 C++
yaml_test.exe!main() Line 109 C++
msvcr100.dll!_initterm(void (void)* * pfbegin=0x00000001, void (void)* * pfend=0x003a5050) Line 873 C
yaml_test.exe!__tmainCRTStartup() Line 555 + 0x17 bytes C
kernel32.dll!7c817077()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
EDIT:
Actually, i have rebuilt the yaml-cpp project i made with CMake as Debug, everything runs fine when i use it now. I'm sorry if this is obvious, i'm new to these kind of issues.

Funny font in the build messages in Codeblocks using g++-4 (Cygwin) as compiler

I am using CodeBlocks 10.05 with Cygwin 1.7 to compile some C++ codes. The operating system is WinXP SP3. The compiler used is g++ 4.5.3.
When I build the following program:
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main()
{
unsigned long long a = 12345678901234;
printf("%u\n",a);
return 0;
}
it outputs the following in the build log:
C:\Documents and Settings\Zhi Ping\Desktop\UVa\143\main.cpp||In function ‘int main()’:|
C:\Documents and Settings\Zhi Ping\Desktop\UVa\143\main.cpp|9|warning: format ‘%u’ expects type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’|
C:\Documents and Settings\Zhi Ping\Desktop\UVa\143\main.cpp|9|warning: format ‘%u’ expects type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’|
||=== Build finished: 0 errors, 2 warnings ===|
I do not know why CodeBlocks prints the ‘ etc. symbols. Is there a way for CodeBlocks to properly display the characters?
Cygwin defaults to the UTF-8 encoding, whereas it looks like CodeBlocks assumes that output is in CP1252. Furthermore, since Cygwin tells it that UTF-8 is available, gcc uses separate left and right versions of quote characters instead of the usual ASCII ones. The result is what you're seeing. There are two ways to tackle this: either tell CodeBlocks to use UTF-8, or tell gcc to stick to ASCII by setting LANG=C. I don't know how to do either of these in CodeBlocks though.
Add the following Environment Variable to your computer:
LANG=C
In Windows 7, you can add it by going to Computer > Properties > Advanced System Settings > Environment Variables, then "New...". The menus should be similar in Windows XP.
I hope it's ok to answer an old question. This happened to me today as well, and it took me a while to fix it.

MSI DB, Visual Basic and cp1252 encoded string problems

I have such line of code (generated by MakeMSI)
oRec.StringData(2) = "A publicitar a aplicação"
oRec is record from Msi database, opened with:
oInstaller = MkObject("WindowsInstaller.Installer")
oMsi = oInstaller.OpenDatabase(MsiName, msiOpenDatabaseModeDirect)
oMsi.OpenView(selectQuery)
After executing and commiting string "A publicitar a aplicação" is converted to "A publicitar a aplicaçao" (ã is converted to a) in the database. I'm 100% sure database is cp1252 encoded, as when I edit field manualy and insert ã it displays well. Any ideas how to workaround this?
EDIT:
When building installer on Portugese Windows everything is fine
What is the codepage of the computer where you edit the property?
I don't know if VBA uses Unicode internally to store strings or not. If it does, then it should work on any computer; if it does not, then it should work correctly only where the system code page supports ‘ã’.
So another part of the problem is the source file itself: to work as expected it should be Unicode-enabled (UTF-8 or UTF-16), and the interpreter should handle it this was. Otherwise, you'll get unexpected results where the current code page is not compatible with cp1252.
Check the setting for Language for non-Unicode programs in the Regional settings in Windows. It should be set to Portuguese.

Show line numbers in Visual SlickEdit

Does anyone know how I can show line numbers in Visual SlickEdit? I can do this on a per file basis by doing View->Line Numbers, but I'd like to just set it as a mode in the editor and not have to do it for every file I open.
Thanks.
Do you want it for a specific file type?
You can do it for each language or all-languages
Tools->Options->Languages
Here you would select either 'All Languages' or a specific language (I just tried the 'all')
then you would select 'Line Numbers' on the right pane.
I've got SlickEdit 2007 (12.x), and AFAIK there's not a way to toggle line numbers for all files at once, but if you're only interested in a few different file types, you can turn on display of line numbers on a per-extension basis in the Display Line Numbers checkbox of the General tab of Tools > Options > File Extension Setup for each extension.
I'm using SlickEdit 2013 (v18.0.1.2 32-bit)
use
Tools -> Options -> Languages -> All Languages -> view
mark the check box line numbers
For SlickEdit Version 12.0.3.0 (Windows)
Tools -> Options -> File Extension Setup -> General (Tab)
You will see, Display line numbers check box
For SlickEdit 2012 (v17.0.2.0 64bit) (Linux)
Tools -> Options -> Languages -> Languages -> View
You will see, Line numbers check box