Everthing comes to an end, sooner or later.
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
Dortz commented: Noone ever actually explained it to me fully. +2
Everthing comes to an end, sooner or later.
Why not try out the link I posted in my 4th post... ?
Horrifically-scarred, MINERS are sleeping over innocent ILLUSIONS, awakening.
slack -> attack
Inevitable things are so inevitable.
but for some
even think of
Yes true, but you are missing the point here. You just can't have a software which claims to create *.fla files and that too hand it out for free.
OpenOffice exists, that's true, but I hope you realize they can't even think of extending support for *.doc files (anyways only MS knows the format headers though there is always possibility of reverse engg).
A software which performs in a same way as another software is good to go, but a software exactly same as a licensed software sure sounds like walking on barbed wire.... ;)
Don't try to manually color the code which you post. Just put the code in code tags and it would be displayed accordingly.
Hey there SubTonic, welcome to Daniweb. :D
one should try
Schools out for summer.
Horrifically-scarred, lifeless soul-reapers are sleeping over INNOCENT children, hideous.
ship -> sheep
a tinge of
Hmm, yes I looked at it very briefly. I guess the title open source flash is rather misleading.
Flash software was developed by Macromedia for a reason -- its proprietary software which has been licensed.
It was kind of expected. You just cant run a site openly which claims to host a free download or replacement to a proprietary or licensed software.
is a complicated
which is really
Aggregated input results in their average.
hulking -> sulking
Horrifically-scarred, lifeless soul-reapers are sleeping over LOST souls, hideous.
Thanks man, :)
So you're from India.. i know that lotsa Indian men are briliant.. especially when it comes to computer.
Thank you for the compliment...:mrgreen:
S.O.S stands for distress call, and since I like to help people, my name is S.O.S. ;)
Hey there buddy, welcome to Daniweb. :D
Looking for more answers from you than question... ;)
Welcome to Daniweb. :D
Hey there girly, welcome to Daniweb... :D
Good to meet a House / Scrubs fan... ;)
Welcome aboard my friend, welcome to Daniweb. :D
And its okay if you have bad English, its not my first langauge either.. ;)
a place where
Someone ought to close this thread, its getting insanely long.
junk food -> obese
conservatives -> preservatives
I still don't see how that example will guarantee 2 decimal places if there is less than that in the original input. I do see how it restrict to 2 decimal places if there is more than that and how it rounds up.
Obviously I can't post entire solutions being a moderator -- its against the site policy... ;)
The OP can always change the << function to implement the behaviour of printing to exactly two decimal points. And since the OP will be using the printing operation infrequently ( the values are meant to basically put in and pulled out from a database I believe ), the overhead of the < < function wouldn't be too much....
But seriously for such requirements whatever we suggest him would be too slow. Consider what you posted -- to many string operations just for the sake of initializing the MyDouble object. Not to forget that strings are classes in C++ and call constructors and destructors. Also since you have stored the data in strings instead of actual double, your realization is too much an overkill considering you have to write your own procedures for multiplication, division, addition, subtraction -- all of them involving string objects, along with taking each and every possible condition into consideration.
Thats why I said to OP:
If that is not acceptable to you then the only option left is to use the technique used by Compiler writers and Language designers to create your own …
No the output is not enough for me. I am very confused. I thought that this issue was a simple, widespread one and the answer would be an easy one. Some huge number of people should have needed it before me. Ok I understand that it is not the way I thought it was. The second thing, I perceived and believed that C and its derivatives were strong tools for programming. Now comes my new questions: Can you tell me? Where are the answers and/or the people who know the answers are hidden? In my first post I had said that i had searched hard in the net. Where can i go back to the beginning to learn searching in the net?(Seriously and truly) Is the time of C and the derivatives over. Thanks to every one for their interests and offers.
I already posted a dummy implementation on how you should go about creating your own datatype from the existing ones. If that is not acceptable to you then the only option left is to use the technique used by Compiler writers and Language designers to create your own primitive datatype -- a task which would definately not be easy on all accounts.
Interesting things should be dealt with first, leaving off the uninteresting ones to bug you later on.
I want to have a variable that is born as rounded to 2 decimal digits,processed as rounded to 2 decimal digits and finally posted to MS SQL as rounded to 2 decimal digits.
You can always do something weird as this:
// WARNING: Untested
#include <iostream>
#include <cstring>
#include <sstream>
class MyDouble
{
public:
MyDouble( ): var_(0.0) { } ;
MyDouble( double var )
{
var = var * PRECISION ;
var = static_cast<int> ( var ) / PRECISION ;
var_ = var ;
}
friend std::ostream& operator << (std::ostream& ostr, MyDouble& obj )
{
ostr << obj.var_ ;
return ostr ;
}
private:
static const double PRECISION = 100 ;
double var_ ;
} ;
int main( )
{
using namespace std;
MyDouble a( -9.5 ) ;
cout << a ;
cin.get( ) ;
return EXIT_SUCCESS ;
}
5) overloaded << operator that uses setprecision(2) to limit output to 2 decimal points
setprecision
doesn't control the number of decimal points that can be outputted but the total number of digits worth of precision you want.
eg.
double val = 1.23456 ;
cout << setprecision( 1 ) << val ; // will output is 1 and not 1.2
double var = 1.8234 ;
cout << setprecision( 1 ) << var ; // will output 2 and not 1
only on output -- internal representation of the double will not change.
Isn't that what he wants.. ?
One more thing, plz tell why is it preferrable to use int main(void) and return 0 rather than simply void main() . thnks a lot
Because that is what the C standard says.. ;)
There are only two correct prototypes for main( )
:
int main( void )
int main( int argc, char* argv[] )
And only three valid values which main can return:
return 0
return EXIT_SUCCESS
return EXIT_FAILURE
Anything else is implementation / platform dependent and may make your code non portable.
So in the end the whole hassle is about keeping your programs portable and makign sure that a standard exists which every C / C++ developer follows.
Probably not because such a class still has all the properties of double data type. You would need a class that does not depend on either float or double if you always want an exact precision. doubles and floats can not give that to you.
I guess his last two points would take care of that one....
5) overloaded << operator that uses setprecision(2) to limit output to 2 decimal points
6) overloaded >> to input double into data
Two questions rolled into one ... what is the difference between Virtual Memory and a Page File
You are getting confused -- Paging is a mechanism used to implement the concept of virtual memory. Paging is a mechanism in which the entire virtual memory is divided into pages -- pages which on demand can be pulled in them physical memory as and when required and written to secondary storage when they are no longer needed (process is idle, etc.). A page table is used to maintain the mappings between the pages and frames i.e. for a chunk of data if it resides at a virtual address X then its physical address is Y and vice versa. Hence whenever data is moved out from the Physical memory or brought into it, changes need to be made to the page table.
and how is this different from Linux swap?
The main difference lies in their names. Swapfiles operate by swapping entire processes from system memory into the swapfile. This immediately frees up memory for other applications to use.
In contrast, paging files function by moving "pages" of a program from system memory into the paging file. These pages are 4KB in size. The entire program does not get swapped wholesale into the paging file.
Also, with a whopping 8 gigs of RAM, why are 2 full gigs used up of this virtual memory?
I think both you and Joey and confused as to what "Virtual Memory" actually stands for the physical …
to the washroom.
Protected, wait I have heard this word in the context of C++..
of the Yak
spend -> extravagant
Horrifically scarred, lifeless soul-reapers are sucking over departed souls, HIDEOUS.
Of course considering
Flash software was developed by Macromedia for a reason -- its proprietary software which has been licensed.
For developing Flash applications you have to use Flash.
THANK YOU FOR HELP!
Now it's working!
You are welcome... :)