|
kakan wrote: The obvious choice is to use a XML file.
I'm not sure it is the most obvious choice. It will be quite overkill to use XML format, especially if you have a lot of data to save. And I think in that case a binary file is easier to handle.
|
|
|
|
|
hi all
i need an implementation of an association rule mining algorithm. (no matter which algorithm)
thanks
|
|
|
|
|
pardis wrote: (no matter which algorithm)
Here it is[ ^]
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
i m using VC++ for desighning an export tool for writing elements in DGN file but a difficulty that i m facing is that i m not able to write the extents of the elements properly i.e low range i m getting in +ve and high range in -ve
i m using "dgnlib" for writing dgn file.
that is why i m not able to fit the view of the dgn when i open it in Microstation
pls reply soon
i'll be highly oblidged
thankx
regards
Pan_angel
|
|
|
|
|
Hi All,
I need to replace char buffer with std::string.
Please find below the code i am using.
AmtInvalidError[50];
long MinimumAmtRequired = (((x*)L_Item)->GetMinAmount()*100);
long MaximumAmtRequired = (((x*)L_Item)->GetMaxAmount()*100);
sprintf(AmtInvalidError, "$%ld.%02d to $%ld.%02d", labs(MinimumAmtRequired/100L),abs((int)(MinimumAmtRequired%100L)), labs(MaximumAmtRequired/100L),abs((int)(MaximumAmtRequired%100L)));
the above code works fine and i get "$25.00 to $100.00" in AmtInvalidError correctly(taking the values for min and max amounts).
Instead of AmtInvalidError array i want to use AmtInvalidError as std::string, and continue populating the string to value "$25.00 to $100.00".
But i am not able to do this becoz, sprintf cannot be used, and hence want to know if there is any other way.
Please kindly help me.
-- modified at 3:55 Thursday 14th December, 2006
Thanks & Regards,
Dhana
|
|
|
|
|
Hello,
Use _vscprintf to predetermine the length of the formatted string, allocate the space using std::string::resize , then vsprintf your text into the buffer pointed to by a dereferenced begin iterator ((char*)&(*Str.begin()) ):
For Unicode version, use _vscwprintf , vswprintf (or vswprintf_s for safe CRT version in VS 2005) and wchar_t , accordingly.
|
|
|
|
|
jana_dhana wrote: now i need to replace the array with std::string, and also keep the formatting that i am doing to show the decimal places.
good. what have you tried for this ?
[edit]
please also apply 5. in the posting guidelines[^]
thanks
[/edit]
|
|
|
|
|
Is there a reason you need to stop using the char array, or do you just need the final answer in a std::string?
If you just need the string, add the final line
std::string strError = AmtInvalidError;
If you want to use std::string all the way through, you'll probably have to stop using sprintf, and use a std::stringstream instead
|
|
|
|
|
You can declare string variable like,
string sMyString(AmtInvalidError);
|
|
|
|
|
prasad_som wrote:
string sMyString(AmtInvalidError);
sMyString variable points to same AmtInvalidError array or creates new one?
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
the constructor copies the array into its own memory...
|
|
|
|
|
toxcct wrote: the constructor copies the array into its own memory...
So its better to write the code which populates the std::string variable instead of just copying an existing array into newone for efficient memory usage.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
A_LaxmansMyString variable points to same AmtInvalidError array or creates new one?
Creates own version. You can assume its implementation like copy constructor. If there is a pointer, you need to allocate own memory for this class.
This way one can have control over own memory.
|
|
|
|
|
Hi,
I am developing a relativly simple 2D graphics application.
Purpose: displaying lots of rectangles (those come from a
file. There has to be some pre-processing, but basically
all elemets are rectangle.
Now I would like to have the follwoing features: scrolling and
zooming, all in an MFC application.
I was trying to use the ANISOTROPIC mode, this doesn't work in
an MFC application. Any idea how I get this mode to work in an
MFC framework?
Thanks,
Joerg
|
|
|
|
|
Perhaps this[^] would help a little?
|
|
|
|
|
Great, looks like this is what I was looking for.
Thanks so far, I'll need a bit to read
Regards,
Joerg
|
|
|
|
|
MFC used to include some tutorials. Are they not provided anymore? The first tutorial was called Scribble which I think answered most or all of your questions. Is it not provided any more?
|
|
|
|
|
Say I got 20 or more projects in a solution.If the sln file is building under msbuild i.e msbuild mysolution.sln then is that enough to proceed. Well if any body has any experience with integrating msbuild and cc.net please share their thoughts.I'm looking for an easy way to get started.I have gone through many site ah well....
-- modified at 5:37 Thursday 14th December, 2006
_________________________
"When the superior man refrains from acting, his force is felt for a thousand li." Sun Tzu
|
|
|
|
|
mejax wrote: "When the superior man refrains from acting, his force is felt for a thousand li." Sun Tzu
Dude, read the forum rules above.
If you had been a superior man, you would never have asked this in the wrong forum. There are excellent programming forums on this site for such questions.
_____________________________________
Action without thought is not action
Action without emotion is not life
|
|
|
|
|
this is not a programming question, if that is what troubles you...
|
|
|
|
|
Should it not be on this forum though? http://www.codeproject.com/script/comments/forums.asp?forumid=3831[^]
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
What is it then???
A builder question??
It is a programming question and it is not the place for it
|
|
|
|
|
asking for general topic around programming is not considered as if the guy was asking for some help writing code...
|
|
|
|
|
This is a skeletal msbuild project build task I use to start off my builds. It assumes that the build file is located in a build directory at the project root.
<ItemGroup>
<Project
Include="..\**\*.csproj"
Exclude="$(MSBuildProjectFile)" />
</ItemGroup>
<Target Name="Build">
<MSBuild
Projects="@(Project)"
Targets="Build">
<Output TaskParameter="TargetOutputs" ItemName="BuiltAssemblies"/>
</MSBuild>
<Message Text="Built: @(BuiltAssemblies)"/>
</Target>
That builtassemblies variable is super useful, you use it to feed the other tasks in your build file with a list of assemblies to process.
Its always a good idea to develop your build file outside of ccnet. Only wire it up for CI once you have it working standalone.
Dont know if there is a forum for build / test automation, so the lounge seems fine to me.
Ryan
|
|
|
|