comp.lang.c++
http://groups.google.com/group/comp.lang.c++?hl=en
comp.lang.c++@googlegroups.com
Today's topics:
* C++ standards committee looking at adding Cairo to the C++ standard - 1
messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/0b3c6e40a26c7051?hl=en
* different rounding behavior with float and double - 5 messages, 4 authors
http://groups.google.com/group/comp.lang.c++/t/05d32024f4d7a3b9?hl=en
* Friendly GUI for windows building? - 7 messages, 6 authors
http://groups.google.com/group/comp.lang.c++/t/c865fa27ccf9e327?hl=en
* problem with iterator (map iterator) - 5 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/d13893c5b2525bf2?hl=en
* INTRODUCING ISLAM - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/8ab937b119cd3e17?hl=en
* Sausages. - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/980d4c6ba62f36ff?hl=en
* Decoding GIF file in C? [Source code here] - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/dec6ec0426c88c64?hl=en
* STL map to STL vector - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/1164ef3d2f08f58f?hl=en
==============================================================================
TOPIC: C++ standards committee looking at adding Cairo to the C++ standard
http://groups.google.com/group/comp.lang.c++/t/0b3c6e40a26c7051?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Jan 9 2014 6:44 pm
From: "Alf P. Steinbach"
On 09.01.2014 23:28, Chris M. Thomasson wrote:
>> "Rui Maciel" wrote in message news:labt7p$co4$1@dont-email.me...
>
>> It appears that Herb Sutter wants to add a 2D drawing library to the
>> C++ standard, and he is
>> looking at libCairo as a base for this library.
>
>> The link to the Cairo's mailing list:
>> http://lists.cairographics.org/archives/cairo/2013-December/024858.html
>
>> What are your thoughts on this?
>
> Graphics for C++, Humm. Perhaps raw bitmaps?
>
> Then teach the students how to program their own line and circle
> plotting algorithms in C++. Then go for Bezier Curves, and on and
> on. Turning math into visual representations can be a powerful
> method of teaching...
>
> IMVHO, starting to learn 2d graphics from "scratch" is the essence
> of the power of C++.
>
> ;^)
http://www.boost.org/doc/libs/1_55_0/libs/gil/doc/index.html
cheers & hth.,
- Alf
==============================================================================
TOPIC: different rounding behavior with float and double
http://groups.google.com/group/comp.lang.c++/t/05d32024f4d7a3b9?hl=en
==============================================================================
== 1 of 5 ==
Date: Thurs, Jan 9 2014 7:51 pm
From: Raymond Li
On 9/1/14 5:46 pm, Raymond Li wrote:
> I have encountered a problem related to floating point rounding. I
> googled a lot and there are many clear and helpful information. e.g.
>
> http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/
> http://support.microsoft.com/kb/125056/en-hk
>
>
> Although the urls have explained the cause, I need to find a practical
> way to solve a rounding problem. My program has calculated a weighted
> accumulation as 3.5. When the figure is rounded to nearest number, it
> became 3 (but I want it to round up to 4). I understood it would be due
> to approximation value of 3.5 as 3.49999...
>
> I found a simple fix by using float instead of double. I list the
> program below and wish someone could explain why using double would
> incur the rounding problem while float would not. In the code below,
> fun1() use float and the calculation is 'correct'. In fun2(), it uses
> double and the figure 3.5 is rounded as 3.
>
> Raymond
>
>
>
> //######################
>
>
>
>
> #include <cmath>
> #include <iostream>
>
> //using namespace std;
>
> using std::cout;
> using std::endl;
> int fun1();
> int fun2();
>
> int main(int argc, char ** argv)
> {
> fun1();
> fun2();
> return 0;
> }
>
>
>
> int fun1()
> {
>
> float weighted=10.0;
> float average=100.0;
> float z[]=
> {
> 4.0,
> 4.0,
> 4.0,
> 4.0,
> 4.0,
> 3.0,
> 3.0,
> 3.0,
> 2.0,
> 4.0
> };
>
> float total=0.0;
>
> int i=0;
> for (i=0;i<10;i++)
> {
> float item=z[i]*weighted/average;
> total=total+item;
> cout << i << " accumulate is " << total << endl;
> // NSLog(@"z[%d] is %f, total is %f", i, z[i], total);
> }
>
> float answer=round(total);
> // NSLog(@"rounded is %f", answer);
> cout << "rounded is " << answer << endl;
> return 0;
> }
>
>
> int fun2()
> {
>
> double weighted=10.0;
> double average=100.0;
> double z[]=
> {
> 4.0,
> 4.0,
> 4.0,
> 4.0,
> 4.0,
> 3.0,
> 3.0,
> 3.0,
> 2.0,
> 4.0
> };
>
> double total=0.0;
>
> int i=0;
> for (i=0;i<10;i++)
> {
> double item=z[i]*weighted/average;
> total=total+item;
> cout << i << " accumulate is " << total << endl;
> // NSLog(@"z[%d] is %f, total is %f", i, z[i], total);
> }
>
> double answer=round(total);
> // NSLog(@"rounded is %f", answer);
> cout << "rounded is " << answer << endl;
> return 0;
> }
>
> 0 accumulate is 0.4
> 1 accumulate is 0.8
> 2 accumulate is 1.2
> 3 accumulate is 1.6
> 4 accumulate is 2
> 5 accumulate is 2.3
> 6 accumulate is 2.6
> 7 accumulate is 2.9
> 8 accumulate is 3.1
> 9 accumulate is 3.5
> rounded is 4
> ***(above is the version using float, 3.5 is rounded as 4) ***
>
> 0 accumulate is 0.4
> 1 accumulate is 0.8
> 2 accumulate is 1.2
> 3 accumulate is 1.6
> 4 accumulate is 2
> 5 accumulate is 2.3
> 6 accumulate is 2.6
> 7 accumulate is 2.9
> 8 accumulate is 3.1
> 9 accumulate is 3.5
> rounded is 3
>
> ***(this version use double, 3.5 is rounded as 3) ***
>
>
> --- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Thanks for your replies. I hope to stick to double too. But the users
have implemented the logic in legacy system and I need to convince them
if I do something different from them. They claimed that the interim
calculations (z[i]*weighted/average) are used too and they would feel
uncomfortable if I make any adjustment. The worst problem I faced is
that they claimed that the legacy system (which is not really legacy, it
is running Oracle pl/sql) does not have the rounding error.
So I investigated and found it weird that the rounding problem could be
avoided by using float. I am uncomfortable to this workaround (using
float), as I am afraid there would be cases that the rounding issue
recur in other scenarios. So I really want someone could explain why the
float datatype would round correctly in the above case, while using
double rounded 'incorrectly'.
If I am free to rewrite the code, after learning from you, I would
rewrite the code as follow. The problem is that I have to convince my
users, and their legacy system was already implemented.
Regards,
Raymond
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <iomanip>
using std::setprecision;
using std::cout;
using std::endl;
int fun3();
int main(int argc, const char * argv[])
{
// insert code here...
// std::cout << "Hello, World!\n";
fun3();
return 0;
}
int fun3()
{
cout << setprecision(17);
double weighted=10.0;
double average=100.0;
double z[]=
{
4.0,
4.0,
4.0,
4.0,
4.0,
3.0,
3.0,
3.0,
2.0,
4.0
};
double total=0.0;
int i=0;
for (i=0;i<10;i++)
{
//double item=z[i]*weighted/average;
double item=z[i]*weighted; // defer the division
total=total+item;
cout << "in loop " << i << ", accumulate is " << total << endl;
// NSLog(@"z[%d] is %f, total is %f", i, z[i], total);
}
total=total/average; // division done at last to avoid truncation error
double answer=round(total);
cout << "rounded is " << answer << " and original is " << total <<
endl;
return 0;
}
output:
in loop 0, accumulate is 40
in loop 1, accumulate is 80
in loop 2, accumulate is 120
in loop 3, accumulate is 160
in loop 4, accumulate is 200
in loop 5, accumulate is 230
in loop 6, accumulate is 260
in loop 7, accumulate is 290
in loop 8, accumulate is 310
in loop 9, accumulate is 350
rounded is 4 and original is 3.5
--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
== 2 of 5 ==
Date: Thurs, Jan 9 2014 8:39 pm
From: Richard Damon
On 1/9/14, 10:51 PM, Raymond Li wrote:
> Thanks for your replies. I hope to stick to double too. But the users
> have implemented the logic in legacy system and I need to convince them
> if I do something different from them. They claimed that the interim
> calculations (z[i]*weighted/average) are used too and they would feel
> uncomfortable if I make any adjustment. The worst problem I faced is
> that they claimed that the legacy system (which is not really legacy, it
> is running Oracle pl/sql) does not have the rounding error.
>
> So I investigated and found it weird that the rounding problem could be
> avoided by using float. I am uncomfortable to this workaround (using
> float), as I am afraid there would be cases that the rounding issue
> recur in other scenarios. So I really want someone could explain why the
> float datatype would round correctly in the above case, while using
> double rounded 'incorrectly'.
>
> If I am free to rewrite the code, after learning from you, I would
> rewrite the code as follow. The problem is that I have to convince my
> users, and their legacy system was already implemented.
>
> Regards,
> Raymond
>
Float eliminates the error IN THIS EXAMPLE, not in general, it probably
is a matter of which round down and which round up after the divide by
100.0. There will be other example number sets where double is right but
float is wrong.
Unless you run a lot of tests with a number of different cases, which
similarly stress the accuracy, it would be impossible to say "does not
have the rounding problem", it just shows that it doesn't have it for
THAT set of numbers. The one case where I would believe it really not
having a rounding problem would be a system that did the math in
decimal, instead of binary, those systems, while the do have round off
errors, have them where decimal thinking people expect them, so they
don't complain.
A question on operation, in "real" use, are the numbers going to be this
nice? If they are, then you may be able to adjust the rounding so that
0.499 rounds up instead of down. If they aren't then you are going run
into the fact that this is a pathological one in a million case of the
sum just hitting the break point of the round function, and the round
off error makes you cross over the line.
== 3 of 5 ==
Date: Thurs, Jan 9 2014 9:39 pm
From: Robert Wessel
On Fri, 10 Jan 2014 11:51:54 +0800, Raymond Li <faihk1@gmail.com>
wrote:
>On 9/1/14 5:46 pm, Raymond Li wrote:
>> I have encountered a problem related to floating point rounding. I
>> googled a lot and there are many clear and helpful information. e.g.
>>
>> http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/
>> http://support.microsoft.com/kb/125056/en-hk
>>
>>
>> Although the urls have explained the cause, I need to find a practical
>> way to solve a rounding problem. My program has calculated a weighted
>> accumulation as 3.5. When the figure is rounded to nearest number, it
>> became 3 (but I want it to round up to 4). I understood it would be due
>> to approximation value of 3.5 as 3.49999...
>>
>> I found a simple fix by using float instead of double. I list the
>> program below and wish someone could explain why using double would
>> incur the rounding problem while float would not. In the code below,
>> fun1() use float and the calculation is 'correct'. In fun2(), it uses
>> double and the figure 3.5 is rounded as 3.
>>
>> Raymond
>>
>>
>>
>> //######################
>>
>>
>>
>>
>> #include <cmath>
>> #include <iostream>
>>
>> //using namespace std;
>>
>> using std::cout;
>> using std::endl;
>> int fun1();
>> int fun2();
>>
>> int main(int argc, char ** argv)
>> {
>> fun1();
>> fun2();
>> return 0;
>> }
>>
>>
>>
>> int fun1()
>> {
>>
>> float weighted=10.0;
>> float average=100.0;
>> float z[]=
>> {
>> 4.0,
>> 4.0,
>> 4.0,
>> 4.0,
>> 4.0,
>> 3.0,
>> 3.0,
>> 3.0,
>> 2.0,
>> 4.0
>> };
>>
>> float total=0.0;
>>
>> int i=0;
>> for (i=0;i<10;i++)
>> {
>> float item=z[i]*weighted/average;
>> total=total+item;
>> cout << i << " accumulate is " << total << endl;
>> // NSLog(@"z[%d] is %f, total is %f", i, z[i], total);
>> }
>>
>> float answer=round(total);
>> // NSLog(@"rounded is %f", answer);
>> cout << "rounded is " << answer << endl;
>> return 0;
>> }
>>
>>
>> int fun2()
>> {
>>
>> double weighted=10.0;
>> double average=100.0;
>> double z[]=
>> {
>> 4.0,
>> 4.0,
>> 4.0,
>> 4.0,
>> 4.0,
>> 3.0,
>> 3.0,
>> 3.0,
>> 2.0,
>> 4.0
>> };
>>
>> double total=0.0;
>>
>> int i=0;
>> for (i=0;i<10;i++)
>> {
>> double item=z[i]*weighted/average;
>> total=total+item;
>> cout << i << " accumulate is " << total << endl;
>> // NSLog(@"z[%d] is %f, total is %f", i, z[i], total);
>> }
>>
>> double answer=round(total);
>> // NSLog(@"rounded is %f", answer);
>> cout << "rounded is " << answer << endl;
>> return 0;
>> }
>>
>> 0 accumulate is 0.4
>> 1 accumulate is 0.8
>> 2 accumulate is 1.2
>> 3 accumulate is 1.6
>> 4 accumulate is 2
>> 5 accumulate is 2.3
>> 6 accumulate is 2.6
>> 7 accumulate is 2.9
>> 8 accumulate is 3.1
>> 9 accumulate is 3.5
>> rounded is 4
>> ***(above is the version using float, 3.5 is rounded as 4) ***
>>
>> 0 accumulate is 0.4
>> 1 accumulate is 0.8
>> 2 accumulate is 1.2
>> 3 accumulate is 1.6
>> 4 accumulate is 2
>> 5 accumulate is 2.3
>> 6 accumulate is 2.6
>> 7 accumulate is 2.9
>> 8 accumulate is 3.1
>> 9 accumulate is 3.5
>> rounded is 3
>>
>> ***(this version use double, 3.5 is rounded as 3) ***
>>
>>
>> --- news://freenews.netfront.net/ - complaints: news@netfront.net ---
>
>Thanks for your replies. I hope to stick to double too. But the users
>have implemented the logic in legacy system and I need to convince them
>if I do something different from them. They claimed that the interim
>calculations (z[i]*weighted/average) are used too and they would feel
>uncomfortable if I make any adjustment. The worst problem I faced is
>that they claimed that the legacy system (which is not really legacy, it
>is running Oracle pl/sql) does not have the rounding error.
>
>So I investigated and found it weird that the rounding problem could be
>avoided by using float. I am uncomfortable to this workaround (using
>float), as I am afraid there would be cases that the rounding issue
>recur in other scenarios. So I really want someone could explain why the
>float datatype would round correctly in the above case, while using
>double rounded 'incorrectly'.
You shouldn't depend on that, it's just a coincidence of how the
rounding error happened to accumulate.
I've modified you program to display a bit more precision (attached
below). With the better display of precision, you can see the
roundoff errors accumulating differently:
(float) 0 item is 0.40000000596046448 accumulate is
0.40000000596046448
(float) 1 item is 0.40000000596046448 accumulate is
0.80000001192092896
(float) 2 item is 0.40000000596046448 accumulate is 1.2000000476837158
(float) 3 item is 0.40000000596046448 accumulate is 1.6000000238418579
(float) 4 item is 0.40000000596046448 accumulate is 2
(float) 5 item is 0.30000001192092896 accumulate is 2.2999999523162842
(float) 6 item is 0.30000001192092896 accumulate is 2.5999999046325684
(float) 7 item is 0.30000001192092896 accumulate is 2.8999998569488525
(float) 8 item is 0.20000000298023224 accumulate is 3.0999999046325684
(float) 9 item is 0.40000000596046448 accumulate is 3.5
rounded is 4
(double) 0 item is 0.40000000000000002 accumulate is
0.40000000000000002
(double) 1 item is 0.40000000000000002 accumulate is
0.80000000000000004
(double) 2 item is 0.40000000000000002 accumulate is
1.2000000000000002
(double) 3 item is 0.40000000000000002 accumulate is
1.6000000000000001
(double) 4 item is 0.40000000000000002 accumulate is 2
(double) 5 item is 0.29999999999999999 accumulate is
2.2999999999999998
(double) 6 item is 0.29999999999999999 accumulate is
2.5999999999999996
(double) 7 item is 0.29999999999999999 accumulate is
2.8999999999999995
(double) 8 item is 0.20000000000000001 accumulate is
3.0999999999999996
(double) 9 item is 0.40000000000000002 accumulate is
3.4999999999999996
rounded is 3
But as I said, you can depend on that. For example, changing the
series to:
{
9.0,
9.0,
9.0,
8.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
};
Will cause the float version to round to 3 as well:
(float) 0 item is 0.89999997615814209 accumulate is
0.89999997615814209
(float) 1 item is 0.89999997615814209 accumulate is 1.7999999523162842
(float) 2 item is 0.89999997615814209 accumulate is 2.6999998092651367
(float) 3 item is 0.80000001192092896 accumulate is 3.4999997615814209
(float) 4 item is 0 accumulate is 3.4999997615814209
(float) 5 item is 0 accumulate is 3.4999997615814209
(float) 6 item is 0 accumulate is 3.4999997615814209
(float) 7 item is 0 accumulate is 3.4999997615814209
(float) 8 item is 0 accumulate is 3.4999997615814209
(float) 9 item is 0 accumulate is 3.4999997615814209
rounded is 3
IOW, this will vary with the exact set of inputs. So don't do that.
Even worse, you can get this to wander around based on whether or not
you tell the compiler to produce strict IEEE compliant math, and the
requested optimization level (on x86 machines you often see
intermediate results with a higher precision than you'd expect if the
code is using the x87 FPU).
Changing the values (as has been suggested) so that all of them have
exact representations can reduce the roundoff error, but cannot
eliminate it (you'll still get roundoff error on that final division,
even if you get none on the individual terms). OTOH, you probably
will get away with this so long as the only case you care about is
"xxx5.0 / 10.0", since that will have an exact result (.5 being
exactly representable in a binary FP number). This is obviously
fragile, and will go to pot the first time someone tosses in a number
with more than a single decimal place.
If this is important, I'd generally advise avoiding floating point
entirely, and use a package that allows you to do this all with scaled
integers or rationals. I'm not sure what the PL/SQL code is doing,
but it may be using a scaled type, or if it's using a floating type,
they might just be hitting one set of rounding errors that happens to
generate the expected result. And that may just be the worst scenario
- trying to duplicate the existing behavior when the existing behavior
is not what anyone is actually expecting.
/* ----- */
#include <cmath>
#include <iostream>
#include <iomanip>
using std::cout;
using std::endl;
int fun1();
int fun2();
inline int round(double x) { return (floor(x + 0.5)); }
int main(int argc, char ** argv)
{
fun1();
fun2();
return 0;
}
int fun1()
{
float weighted=10.0;
float average=100.0;
float z[]=
{
4.0,
4.0,
4.0,
4.0,
4.0,
3.0,
3.0,
3.0,
2.0,
4.0
};
float total=0.0;
int i=0;
for (i=0;i<10;i++)
{
float item=z[i]*weighted/average;
total=total+item;
cout << "(float) " << i << " item is " <<
std::setprecision(20) << item
<< " accumulate is " << std::setprecision(20) << total
<< endl;
}
float answer=round(total);
cout << "rounded is " << answer << endl;
return 0;
}
int fun2()
{
double weighted=10.0;
double average=100.0;
double z[]=
{
4.0,
4.0,
4.0,
4.0,
4.0,
3.0,
3.0,
3.0,
2.0,
4.0
};
double total=0.0;
int i=0;
for (i=0;i<10;i++)
{
double item=z[i]*weighted/average;
total=total+item;
cout << "(double) " << i << " item is " <<
std::setprecision(20) << item
<< " accumulate is " << std::setprecision(20) << total
<< endl;
}
double answer=round(total);
cout << "rounded is " << answer << endl;
return 0;
}
== 4 of 5 ==
Date: Fri, Jan 10 2014 12:19 am
From: Raymond Li
Thanks again for your replies! Richard and Robert explained further!
Thanks! Thanks! Thanks!
The numbers are always 'nice' because there are constraints, e.g. the
weights always add up to 100. Besides, the data would only be in value
between 1 to 5. Therefore, indeed using float could be 'safe' in our
cases. But I am just 'unhappy' to use float instead of double.
Unfortunately, I will stick to the legacy system's implementation (where
actually I have no access to the code) and have to do the division in
interim.
A colleague of mine suggested using NSNumberFormatter to do the
rounding. His demonstration seems to have solved our particular case and
the code can still use double as datatype. It would be platform
dependent at least. And I have to spend time to study the details and
check for potential problems. But I could only object to users if I can
find a case that the legacy system calculate wrong.
Raymond
--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
== 5 of 5 ==
Date: Fri, Jan 10 2014 2:23 am
From: ram@zedat.fu-berlin.de (Stefan Ram)
Raymond Li <faihk1@gmail.com> writes:
>The numbers are always 'nice' because there are constraints, e.g. the
I just wrote the following code that comes with no guarantee whatsoever.
#include <iostream> // ::std::cout, ::std::cin
#include <ostream> // <<
#include <string> // ::std::string
#include <limits> // ::std::numeric_limits
#include <cmath> // ::std::pow, ::std::round
#include <sstream> // ::std::stringstream
#include <cstdlib> // ::std::rand, RAND_MAX
/* fill with zeros at the left until the length is n */
::std::string fill( ::std::string s, size_t const n )
{ while( s.length() < n )s = "0" + s; return s; }
/* insert a dot a the position n from the right
(n is the distance from the right end of the string) */
::std::string dot( ::std::string s, int const n )
{ size_t const len{ s.length() };
return s.substr( 0, len - n ) + "." + s.substr( len - n, n )+( n ? "" : "0" ); }
template< typename T >
::std::string to_string( T const v )
{ ::std::stringstream s; s << v; return s.str(); }
/* convert v/10^i to a string */
::std::string tostring( double const v, int const i )
{ ::std::string s{ to_string(( long )v )};
::std::string t{ fill( s, i + 1 )};
return i ? dot( t, i ): t + ".0" ; }
/* round so that the number looks nice in the decimal system
if there is a nice number near
n: how many positions to try after the dot
m: how many zeros or nines approximately
are required to trigger the special rounding */
::std::string myround( double const x )
{ int n = 0.4 * ::std::numeric_limits<double>::digits10
- ::std::log( x )/::std::log( 10 );
int m = 0.4 * ::std::numeric_limits<double>::digits10;
double v = x;
for( int i = 0; i < n; ++i )
{ double const r = fabs( v - round( v ));
if( r < ::std::pow( 10, -m ))
return tostring( round( v ), i );
v *= 10.; }
return to_string( x ); }
int main()
{ ::std::cout << myround( 0.300000001 )<< '\n';
::std::cout << myround( 0.299999999 )<< "\n\n";
::std::cout << myround( 1.300000001 )<< '\n';
::std::cout << myround( 1.299999999 )<< "\n\n";
::std::cout << myround( 1.000000001 )<< '\n';
::std::cout << myround( 0.999999999 )<< "\n\n";
::std::cout << myround( 10.00000001 )<< '\n';
::std::cout << myround( 9.999999999 )<< "\n\n";
::std::cout << myround( 100.0000001 )<< '\n';
::std::cout << myround( 99.99999999 )<< "\n\n";
::std::cout << myround( 0.100000001 )<< '\n';
::std::cout << myround( 0.099999999 )<< "\n\n";
::std::cout << myround( 0.010000001 )<< '\n';
::std::cout << myround( 0.009999999 )<< "\n\n\n\n";
for( int i = 0; i < 6; ++i )
{ double const v{ ::std::pow( 10, 4 - 8 * ::std::rand() /( 1. + RAND_MAX )) };
::std::cout << v << '\n' << myround( v ) << "\n\n"; }}
==============================================================================
TOPIC: Friendly GUI for windows building?
http://groups.google.com/group/comp.lang.c++/t/c865fa27ccf9e327?hl=en
==============================================================================
== 1 of 7 ==
Date: Fri, Jan 10 2014 12:08 am
From: Francois Guillet
Rupert Miscavige a pr�sent� l'�nonc� suivant :
...
> Sure it is. Crap. The proof for this is that they are unable to compile a
> windows binary, for whatever reasons, then let the user using it.
> Directly, as they are supposed to do.
And what do you suggest instead which would be better ?
== 2 of 7 ==
Date: Fri, Jan 10 2014 6:48 am
From: Cristiano Araujo
you can use QtCreator.
== 3 of 7 ==
Date: Sat, Jan 11 2014 11:26 am
From: Dombo
Op 06-Jan-14 23:42, woodbrian77@gmail.com schreef:
> On Sunday, January 5, 2014 9:43:19 PM UTC-6, Geoff wrote:
>>
>> A source distribution allows you to take any portion of it you may
>> like without having to drag all of the framework into your
>> application. It also allows you to build debug and release versions of
>> the framework. This seems entirely logical to me.
>
> I agree, but think it's hard to get investors interested
> in a 100% open source project.
Open source software is not only written by unpaid idealistic nerds when
they are not jerking off. Most successful open source projects have
commercial backing, and many contributions to those projects are done by
paid developers.
Money is not only being made by providing support, but also quite often
by a dual licensing policy, counting on that GPL is not acceptable for
many companies.
== 4 of 7 ==
Date: Sat, Jan 11 2014 11:36 am
From: Jorgen Grahn
On Sat, 2014-01-11, Dombo wrote:
...
> Most successful open source projects have
> commercial backing, and many contributions to those projects are done by
> paid developers.
For the /big/ projects that's probably true, but not for the thousands
of normal-sized ones.
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
== 5 of 7 ==
Date: Mon, Jan 13 2014 5:58 am
From: David Brown
On 05/01/14 05:06, �� Tiib wrote:
> On Sunday, 5 January 2014 02:36:34 UTC+2, Ike Shaffer wrote:
>> Mr Flibble wrote:
>>
>>>> Then I guess you can skip reading that LGPL manifest and just send an
>>>> e-
>>>> mail to them, telling that you intend to use their crap, and make big
>>>> money.
>>>>
>>>> Let them call you an imbecile! LOL
>>>>
>>>> You are a wise man flib
>>>
>>> I've decided that as well as being an idiot you are also a troll so
>>> welcome to my killfile.
>>
>> Ohh yes, you lost the debate, proved as imbecile.
>>
>> Just send that email, flib, tell them you won't register nor pay a shit.
>>
>> Let them conclude this discussion. No need need for their LGPL reading.
>
(I know this is replying to a week-old post - I've been on holiday.)
And of course, IANAL - this is just my understanding of the LGPL in
general, and not Qt in particular.
> It is perfectly legal to use dynamically linked Qt in commercially
> (or how ever you want to license it) distributed application. There are
> only such limitations:
> 1. Your application must be dynamically linked to the Qt components that
> came with your downloaded LGPL Qt distribution. No static linking allowed.
That's not quite true (assuming Qt uses the standard LGPL). You can
also make your application available in a linkable object form. The
point is that the user (anyone legally obtaining the application source
or binary) should be able to take the source for the LGPL library (Qt in
this case), modify it if they want, re-compile it, and link it with your
application code. The linking can be static or dynamic.
Of course, having the LGPL code as a dynamic library is by far the most
common solution - but linkable object code for static linking is allowed.
> 2. You can�t make changes to the Qt source code itself and sell your
> application based on the changed version of Qt.
The LGPL does not allow Qt to make that kind of restriction. I suppose
it is possible that Qt are using a modified LGPL with additional
restrictions like this, but I did not see that on their website (though
I only had a very quick look). The whole point of LGPL is that you -
either the developer or the end user - can take the code and change it
as you want. But any changes you make must be made available to anyone
else to whom you give or sell the binary code, so that they too can
modify the LGPL'ed code (and re-compile and re-link it). But you can't
make changes to the Qt stuff and keep these changes secret from your
customers (as you can when using the commercial Qt license).
> 3. You must inform users of your application that Qt is used in the
> application in some licence text or in a readme somewhere within your
> distributed application files.
I don't know that you need mention Qt explicitly like this, but you /do/
have to provide the user with the source code for the LGPL code (i.e.,
the Qt library), with any modifications you have made. You can include
the source directly, or a written offer valid for 3 years (etc., etc.).
In practice, at least in the *nix world, you provide the application
without any Qt library and dynamically link to the shared libraries on
the end-user's system. As you are not distributing any LGPL code (using
headers is allowed), you don't have to say much - but of course you
would list the Qt dll/so files needed as part of your system requirements.
> 4. You must provide a copy of the Qt LGPL licence file together with your
> distributed application files.
>
> These things above can't be show stopper problems.
They are not - a lot of systems are made using the LGPL versions of Qt.
>
> The biggest annoyance with Qt is that it tends to create large binaries.
> Lesser annoyance is that it uses custom preprocessors that do not
> understand too well C++ (particularily templates and preprocessor) and
> other tools tend also not to understand Qt crap (underlining it red
> and reporting errors).
>
It is this second point that puts /me/ off using Qt - I can live with
big binaries for my PC software.
Another annoyance is that until relatively recently, the Python bindings
(PyQt) were under the GPL (or a commercial licence), rather than the
LGPL (or Python licence), meaning you couldn't use Python and Qt without
making the whole application as GPL or paying for the commercial
license. Now that Nokia's PySide bindings are complete for Python LGPL
Qt development, I might look again at it for future software.
== 6 of 7 ==
Date: Mon, Jan 13 2014 6:02 am
From: David Brown
On 07/01/14 07:40, Ian Collins wrote:
> woodbrian77@gmail.com wrote:
>> On Sunday, January 5, 2014 9:43:19 PM UTC-6, Geoff wrote:
>>>
>>> A source distribution allows you to take any portion of it you may
>>> like without having to drag all of the framework into your
>>> application. It also allows you to build debug and release versions of
>>> the framework. This seems entirely logical to me.
>>>
>>
>> I agree, but think it's hard to get investors interested
>> in a 100% open source project.
>
> Um, Linux, MySQL, PostgreSQL, Illumos, the BSDs...?
>
> There are plenty of investors will to invest in companies who add value
> (usually support or other, often also open source, add-ons) to open
> source projects.
>
He said it was /hard/, not /impossible/. There are many ways to make
money from open source software, and therefore many reasons for
investors to back open source projects - but it can be a hard sell to
persuade the investors.
== 7 of 7 ==
Date: Mon, Jan 13 2014 10:34 am
From: Öö Tiib
On Monday, 13 January 2014 15:58:37 UTC+2, David Brown wrote:
> On 05/01/14 05:06, �� Tiib wrote:
> > On Sunday, 5 January 2014 02:36:34 UTC+2, Ike Shaffer wrote:
> >> Mr Flibble wrote:
> >>
> >>>> Then I guess you can skip reading that LGPL manifest and just send an
> >>>> e-
> >>>> mail to them, telling that you intend to use their crap, and make big
> >>>> money.
> >>>>
> >>>> Let them call you an imbecile! LOL
> >>>>
> >>>> You are a wise man flib
> >>>
> >>> I've decided that as well as being an idiot you are also a troll so
> >>> welcome to my killfile.
> >>
> >> Ohh yes, you lost the debate, proved as imbecile.
> >>
> >> Just send that email, flib, tell them you won't register nor pay a shit.
> >>
> >> Let them conclude this discussion. No need need for their LGPL reading.
> >
>
> (I know this is replying to a week-old post - I've been on holiday.)
> And of course, IANAL - this is just my understanding of the LGPL in
> general, and not Qt in particular.
I just posted it to conclude the back and forth trollish name-calling
with some useful guidance how to do it. I did use words *must* and
*can't* may be too strongly, sorry. Indeed there are (too painful even
for my enemies) ways how to not follow that guidance.
> > It is perfectly legal to use dynamically linked Qt in commercially
> > (or how ever you want to license it) distributed application. There are
> > only such limitations:
> > 1. Your application must be dynamically linked to the Qt components that
> > came with your downloaded LGPL Qt distribution. No static linking allowed.
>
> That's not quite true (assuming Qt uses the standard LGPL). You can
> also make your application available in a linkable object form. The
> point is that the user (anyone legally obtaining the application source
> or binary) should be able to take the source for the LGPL library (Qt in
> this case), modify it if they want, re-compile it, and link it with your
> application code. The linking can be static or dynamic.
However ... we don't want to sell half-built binaries with removed
link-time optimisations as LGPL 2.1 6.a) ... or do we?
> Of course, having the LGPL code as a dynamic library is by far the most
> common solution - but linkable object code for static linking is allowed.
The idea of static linking is to distribute less binaries that are better
optimised. "Allowed" is distribution of more binaries that are worse
optimised. I am in difficulties to imagine why we want that.
> > 2. You can�t make changes to the Qt source code itself and sell your
> > application based on the changed version of Qt.
>
> The LGPL does not allow Qt to make that kind of restriction. I suppose
> it is possible that Qt are using a modified LGPL with additional
> restrictions like this, but I did not see that on their website (though
> I only had a very quick look). The whole point of LGPL is that you -
> either the developer or the end user - can take the code and change it
> as you want. But any changes you make must be made available to anyone
> else to whom you give or sell the binary code, so that they too can
> modify the LGPL'ed code (and re-compile and re-link it). But you can't
> make changes to the Qt stuff and keep these changes secret from your
> customers (as you can when using the commercial Qt license).
Yes, that was what I meant, we can not make unpublished changes to
LGPL library. If we do whatever changes to Qt we have to publish that
modded Qt too and that means again some pain we don't desire.
> > 3. You must inform users of your application that Qt is used in the
> > application in some licence text or in a readme somewhere within your
> > distributed application files.
>
> I don't know that you need mention Qt explicitly like this, but you /do/
> have to provide the user with the source code for the LGPL code (i.e.,
> the Qt library), with any modifications you have made. You can include
> the source directly, or a written offer valid for 3 years (etc., etc.).
If we followed "1." and "2." then we did not make any changes and so
we do not need to publish the Qt library. Then we just mention it as
dependency.
> In practice, at least in the *nix world, you provide the application
> without any Qt library and dynamically link to the shared libraries on
> the end-user's system. As you are not distributing any LGPL code (using
> headers is allowed), you don't have to say much - but of course you
> would list the Qt dll/so files needed as part of your system requirements.
However if we modified Qt and our application needs that Qt then there
must be some ways to acquire the modded Qt in source code form
for all users and ways to check that it is the correctly modded Qt for
application.
> > 4. You must provide a copy of the Qt LGPL licence file together with your
> > distributed application files.
> >
> > These things above can't be show stopper problems.
>
> They are not - a lot of systems are made using the LGPL versions of Qt.
>
> > The biggest annoyance with Qt is that it tends to create large binaries.
> > Lesser annoyance is that it uses custom preprocessors that do not
> > understand too well C++ (particularily templates and preprocessor) and
> > other tools tend also not to understand Qt crap (underlining it red
> > and reporting errors).
> >
>
> It is this second point that puts /me/ off using Qt - I can live with
> big binaries for my PC software.
If to use Qt only as GUI layer and to develop that with Qt tools (drag
and drop like OP asked) then it is easy. If to use it as framework for
whole application then eventually there will be desire to use other
tools (that may need to read/write code) and that it is difficult.
> Another annoyance is that until relatively recently, the Python bindings
> (PyQt) were under the GPL (or a commercial licence), rather than the
> LGPL (or Python licence), meaning you couldn't use Python and Qt without
> making the whole application as GPL or paying for the commercial
> license. Now that Nokia's PySide bindings are complete for Python LGPL
> Qt development, I might look again at it for future software.
That PyQt is AFAIK separate (not C++; Python) plugin by separate
corporation. There are other ways how to bind Python to C++ project.
==============================================================================
TOPIC: problem with iterator (map iterator)
http://groups.google.com/group/comp.lang.c++/t/d13893c5b2525bf2?hl=en
==============================================================================
== 1 of 5 ==
Date: Fri, Jan 10 2014 5:52 am
From: Jim Anderson
I'm writing a small program that will use a map (i.e. map<string,int>).
it has been a while since I have written in c++, so I found an example
on the internet and modified it for my own use. But when I try to
compile my program, I get a compile error.
The code looks ok to me, so I did a search on the internet to see if
others had the same problem. I found 3 or 4 examples, but the solutions
were all related to using an iterator, when infact a const_iterator
should be used. That is not the cause of my problem, as near as I can tell.
I have reduced my code to a simple example:
1
2 #include <iostream>
3 #include <map>
4 #include <string>
5
6 using namespace std;
7
8 int main()
9 {
10 map<string, int> totals;
11
12 totals.insert(std::pair<string,int>("NJ",10));
13 totals.insert(std::pair<string,int>("NY",20));
14 totals.insert(std::pair<string,int>("PA",30));
15 totals.insert(std::pair<string,int>("CT",40));
16
17 map<int,string>::iterator iter;
18 for(iter = totals.begin(); iter != totals.end(); ++iter) {
19 cout << (*iter).first << ": " << (*iter).second << endl;
20 }
21 }
I'm using the GNU compiler g++ version 4.4.5 on crunchbang linux. The
compile error messages are:
1 g++ -g -Wall -I/home/jja/bfs/include -DLINUX -c problem.cc
2 problem.cc: In function �int main()�:
3 problem.cc:18: error: no match for �operator=� in �iter =
totals.std::map<_Key, _Tp, _Compare, _Alloc>::begin [ with _Key =
std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
_Tp = int, _Compare = std:: less<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >, _Alloc =
std::allocator<std::pai r<const std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, int> >]()�
4 /usr/include/c++/4.4/bits/stl_tree.h:154: note: candidates are:
std::_Rb_tree_iterator<std::pair<const int, std ::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >&
std::_Rb_tree_iterator<std::pair<const int, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >::operator=(const
std::_Rb_tree _iterator<std::pair<const int, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >&)
5 problem.cc:18: error: no match for �operator!=� in �iter !=
totals.std::map<_Key, _Tp, _Compare, _Alloc>::end [ with _Key =
std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
_Tp = int, _Compare = std:: less<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >, _Alloc =
std::allocator<std::pai r<const std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, int> >]()�
6 /usr/include/c++/4.4/bits/stl_tree.h:216: note: candidates are:
bool std::_Rb_tree_iterator<_Tp>::operator!=(co nst
std::_Rb_tree_iterator<_Tp>&) const [with _Tp = std::pair<const int,
std::basic_string<char, std::char_trai ts<char>, std::allocator<char>
> >]
7 make: *** [problem.o] Error 1
Can anyone help explain the compile errors/
Jim Anderson
== 2 of 5 ==
Date: Fri, Jan 10 2014 6:27 am
From: drew@furrfu.invalid (Drew Lawson)
In article <laoulm$sju$1@speranza.aioe.org>
Jim Anderson <jjanderson52000@yahoo.com> writes:
>I'm writing a small program that will use a map (i.e. map<string,int>).
>it has been a while since I have written in c++, so I found an example
>on the internet and modified it for my own use. But when I try to
>compile my program, I get a compile error.
> 10 map<string, int> totals;
> 17 map<int,string>::iterator iter;
Those two lines do not use the same kind of map.
--
Drew Lawson So risk all or don't risk anything
You can lose all the same
== 3 of 5 ==
Date: Fri, Jan 10 2014 6:22 am
From: Jim Anderson
RESOLVED.
Please ignore my post. I spent a day looking at this compiler error and
then right after posting, I noticed that line 17 has string and int
transposed and should be:
map<string,int>::iterator iter;
not:
map<int,string>::iterator iter;
On 01/10/2014 08:52 AM, Jim Anderson wrote:
> I'm writing a small program that will use a map (i.e. map<string,int>).
> it has been a while since I have written in c++, so I found an example
> on the internet and modified it for my own use. But when I try to
> compile my program, I get a compile error.
>
> The code looks ok to me, so I did a search on the internet to see if
> others had the same problem. I found 3 or 4 examples, but the solutions
> were all related to using an iterator, when infact a const_iterator
> should be used. That is not the cause of my problem, as near as I can tell.
>
> I have reduced my code to a simple example:
>
> 1
> 2 #include <iostream>
> 3 #include <map>
> 4 #include <string>
> 5
> 6 using namespace std;
> 7
> 8 int main()
> 9 {
> 10 map<string, int> totals;
> 11
> 12 totals.insert(std::pair<string,int>("NJ",10));
> 13 totals.insert(std::pair<string,int>("NY",20));
> 14 totals.insert(std::pair<string,int>("PA",30));
> 15 totals.insert(std::pair<string,int>("CT",40));
> 16
> 17 map<int,string>::iterator iter;
> 18 for(iter = totals.begin(); iter != totals.end(); ++iter) {
> 19 cout << (*iter).first << ": " << (*iter).second << endl;
> 20 }
> 21 }
>
>
> I'm using the GNU compiler g++ version 4.4.5 on crunchbang linux. The
> compile error messages are:
>
> 1 g++ -g -Wall -I/home/jja/bfs/include -DLINUX -c problem.cc
> 2 problem.cc: In function �int main()�:
> 3 problem.cc:18: error: no match for �operator=� in �iter =
> totals.std::map<_Key, _Tp, _Compare, _Alloc>::begin [ with _Key =
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
> _Tp = int, _Compare = std:: less<std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > >, _Alloc =
> std::allocator<std::pai r<const std::basic_string<char,
> std::char_traits<char>, std::allocator<char> >, int> >]()�
> 4 /usr/include/c++/4.4/bits/stl_tree.h:154: note: candidates are:
> std::_Rb_tree_iterator<std::pair<const int, std ::basic_string<char,
> std::char_traits<char>, std::allocator<char> > > >&
> std::_Rb_tree_iterator<std::pair<const int, std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > > >::operator=(const
> std::_Rb_tree _iterator<std::pair<const int, std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > > >&)
> 5 problem.cc:18: error: no match for �operator!=� in �iter !=
> totals.std::map<_Key, _Tp, _Compare, _Alloc>::end [ with _Key =
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
> _Tp = int, _Compare = std:: less<std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > >, _Alloc =
> std::allocator<std::pai r<const std::basic_string<char,
> std::char_traits<char>, std::allocator<char> >, int> >]()�
> 6 /usr/include/c++/4.4/bits/stl_tree.h:216: note: candidates are: bool
> std::_Rb_tree_iterator<_Tp>::operator!=(co nst
> std::_Rb_tree_iterator<_Tp>&) const [with _Tp = std::pair<const int,
> std::basic_string<char, std::char_trai ts<char>, std::allocator<char> > >]
> 7 make: *** [problem.o] Error 1
>
>
> Can anyone help explain the compile errors/
>
> Jim Anderson
== 4 of 5 ==
Date: Fri, Jan 10 2014 6:25 am
From: Jim Anderson
Drew,
Thank you. I spent a day looking at the problem, then 5 minutes after I
posted, I saw the cause. A bit of egg on my face, but sometimes this
happens.
Jim
On 01/10/2014 09:27 AM, Drew Lawson wrote:
> In article<laoulm$sju$1@speranza.aioe.org>
> Jim Anderson<jjanderson52000@yahoo.com> writes:
>> I'm writing a small program that will use a map (i.e. map<string,int>).
>> it has been a while since I have written in c++, so I found an example
>> on the internet and modified it for my own use. But when I try to
>> compile my program, I get a compile error.
>
>> 10 map<string, int> totals;
>
>> 17 map<int,string>::iterator iter;
>
> Those two lines do not use the same kind of map.
>
>
>
== 5 of 5 ==
Date: Mon, Jan 13 2014 3:09 pm
From: Luca Risolia
Jim Anderson wrote:
> I noticed that line 17 has string and int
> transposed and should be:
> map<string,int>::iterator iter;
or:
decltype(totals)::iterator iter;
or, since you use iter in a for loop only:
for (auto iter = std::begin(totals); // or std::cbegin() from C++14
==============================================================================
TOPIC: INTRODUCING ISLAM
http://groups.google.com/group/comp.lang.c++/t/8ab937b119cd3e17?hl=en
==============================================================================
== 1 of 2 ==
Date: Sat, Jan 11 2014 2:58 am
From: BV BV
INTRODUCING ISLAM
I. ISLAM AND MUSLIMS
The name of this religion is Islam, the root of which is Silm and Salam which means peace. Salam may also mean greeting one another with peace. One of the beautiful names of God is that He is the Peace. It means more than that: submission to the One God, and to live in peace with the Creator, within one's self, with other people and with the environment. Thus, Islam is a total system of living. A Muslim is supposed to live in peace and harmony with all these segments; hence, a Muslim is any person anywhere in the world whose obedience, allegiance, and loyalty are to God, the Lord of the Universe.
II. MUSLIMS AND ARABS
The followers of Islam are called Muslims. Muslims are not to be confused with Arabs. Muslims may be Arabs, Turks, Persians, Indians, Pakistanis, Malaysians, Indonesians, Europeans, Africans, Americans, Chinese, or other nationalities.
An Arab could be a Muslim, a Christian, a Jew or an atheist. Any person who adopts the Arabic language is called an Arab. However, the language of the Qur'an (the Holy Book of Islam) is Arabic. Muslims all over the world try to learn Arabic so that they may be able to read the Qur'an and understand its meaning. They pray in the language of the Qur'an, namely Arabic. Supplications to God could be in any language.
While there are one billion Muslims in the world there are about 200 million Arabs. Among them, approximately ten percent are not Muslims. Thus Arab Muslims constitute only about twenty percent of the Muslim population of the world.
III. ALLAH THE ONE AND THE ONLY GOD
Allah is the name of the One and Only God. Allah has ninety-nine beautiful names, such as: The Gracious, The Merciful, The Beneficent, The Creator, The All-Knowing, The All-Wise, The Lord of the Universe, The First, The Last, and others.
He is the Creator of all human beings. He is the God for the Christians, the Jews, the Muslims, the Buddhists, the Hindus, the atheists, and others. Muslims worship God whose name is Allah. They put their trust in Him and they seek His help and His guidance.
IV. MUHAMMAD
Muhammad was chosen by God to deliver His Message of Peace, namely Islam. He was born in 570 C.E. (Common Era) in Makkah, Arabia. He was entrusted with the Message of Islam when he was at the age of forty years. The revelation that he received is called the Qur'an, while the message is called Islam.
Muhammad is the very last Prophet of God to mankind. He is the final Messenger of God. His message was and is still to the Christians, the Jews and the rest of mankind. He was sent to those religious people to inform them about the true mission of Jesus, Moses, Jacob, Isaac, and Abraham.
Muhammad is considered to be the summation and the culmination of all the prophets and messengers that came before him. He purified the previous messages from adulteration and completed the Message of God for all humanity. He was entrusted with the power of explaining, interpreting and living the teaching of the Qur'an.
V. SOURCE OF ISLAM
The legal sources of Islam are the Qur'an and the Hadith. The Qur'an is the exact word of God; its authenticity, originality and totality are intact. The Hadith is the report of the sayings, deeds and approvals of the Prophet Muhammad. The Prophet's sayings and deeds are called Sunnah. The Seerah is the writings of followers of Muhammad about the life of the Prophet. Hence, it is the life history of the Prophet Muhammad which provides examples of daily living for Muslims.
VI. SOME ISLAMIC PRINCIPLES
A. Oneness of God:
He is One and the Only One. He is not two in one or three in one. This means that Islam rejects the idea of trinity or such a unity of God which implies more than one God in one.
B. Oneness of mankind:
People are created equal in front of the Law of God. There is no superiority for one race over another. God made us of different colors, nationalities, languages and beliefs so as to test who is going to be better than others. No one can claim that he is better than others. It is only God Who knows who is better. It depends on piety and righteousness.
C. Oneness of Messengers and the Message:
Muslims believe that God sent different messengers throughout the history of mankind. All came with the same message and the same teachings. It was the people who misunderstood and misinterpreted them.
Muslims believe in Noah, Abraham, Isaac, Ismail, Jacob, Moses, David, Jesus, and Muhammad. The Prophets of Christianity and Judaism are indeed the Prophets of Islam.
D. Angels and the Day of Judgment:
Muslims believe that there are unseen creatures such as angels created by God in the universe for special missions.
Muslims believe that there is a Day of Judgment when all people of the world throughout the history of mankind till the last day of life on earth, are to be brought for accounting, reward and punishment.
E. Innocence of Man at Birth:
Muslim believe that people are born free of sin. It is only after they reach the age of puberty and it is only after they commit sins that they are to be charged for their mistakes. No one is responsible for or can take the responsibility for the sins of others. However, the door of forgiveness through true repentance is always open.
F. State and Religion:
Muslims believe that Islam is a total and a complete way of life. It encompasses all aspects of life. As such, the teachings of Islam do not separate religion from politics. As a matter of fact, state and religion are under the obedience of Allah through the teachings of Islam. Hence, economic and social transactions, as well as educational and political systems are also part of the teachings of Islam.
VII. PRACTICES OF ISLAM
God instructed the Muslims to practice what they believe in. In Islam there are five pillars, namely:
1. Creed (Shahada): The verbal commitment and pledge that there is only One God and that Muhammad is the Messenger of God, is considered to be the Creed of Islam.
2. Prayers (Salat): The performance of the five daily prayers is required of Muslims.
3. Fasting (Saum): Fasting is total abstinence from food, liquids and intimate intercourse (between married couples) from dawn to sunset during the entire month of Ramadan.
4. Purifying Tax (Zakat): This is an annual payment of a certain percentage of a Muslim's property which is distributed among the poor or other rightful beneficiaries.
5. Pilgrimage (Hajj): The performance of pilgrimage to Makkah is required once in a life time if means are available. Hajj is in part in memory of the trials and tribulations of Prophet Abraham, his wife Hagar and his eldest son Prophet Ishmael.
VIII. OTHER RELATED ASPECTS
A. Calendar:
Islamic practices are based on the lunar calendar. However, Muslims also use the Gregorian calendar in their daily religious lives. Hence, the Islamic calendar includes both the common era and the migration (Higra) year of the Prophet of Islam from Makkah to Madinah in the year of 623 C.E.
B. Celebrations (Eid):
Muslims have two celebrations (Eid); namely, Eid of Sacrifice and Eid of Fast-Breaking. The Eid of Sacrifice is in remembrance of the sacrifice to be by Prophet Abraham of his son. The Eid of Fast-Breaking comes at the end of the month of fasting, Ramadan.
C. Diets:
Islam allows Muslims to eat everything which is good for the health. It restricts certain items such as pork and its by-products, alcohol and any narcotic or addictive drugs.
D. Place of Worship:
The place of worship is called Mosque or Masjid. There are three holy places of worship for the Muslims in the world. These are: Mosque of Kaaba in Makkah, Mosque of the Prophet Muhammad in Madinah, and Masjid Aqsa, adjacent to the Dome of the Rock in Jerusalem.
A Muslim may pray any where in the world whether in a Mosque, a house, an office, or outside. The whole world is a place of worship. It is preferable that Muslims pray in a congregation, however, he/she may pray individually anywhere.
E. Holidays:
The holy day of the Muslims is Friday. It is considered to be sacred and the Day of Judgment will take place on Friday. Muslims join together shortly after noon on Friday for the Friday congregational prayer in a Mosque. A leader (Imam) gives a sermon (Khutba) and leads the congregational prayer.
F. Distribution of Muslims in North America:
There are approximately five million Muslims in North America and are distributed in its major cities such as New York, Detroit, Boston, Toledo, Chicago, Los Angeles, San Francisco, Houston, Cedar Rapids (Iowa), Toronto, Montreal, Ottawa, Edmonton, Vancouver, Windsor, Winnipeg, Calgary, and others.
G. Contributions in North America:
Muslims are established in North America. The Sears Tower and the John Hancock buildings in Chicago were designed by a Muslim chief architect, originally from Bangladesh. Muslims have established academic institutions, community centers and organizations, schools and places of worship. They live in peace and harmony among themselves and among other groups of people in the society. The rate of crime among Muslims is very minimal. Muslims in North America are highly educated and they have added to the success of American scientific and technological fields.
The Muslims of the early period of the Islamic era were pioneers in medicine, chemistry, physics, geography, navigation, arts, poetry, mathematics, algebra, logarithms, calculus, etc. They contributed to the Renaissance of Europe and world civilization.
IX. NON-MUSLIMS
Muslims are required to respect all those who are faithful and God conscious people, namely those who received messages. Christians and Jews are called People of the Book. Muslims are asked to call upon the People of the Book for common terms, namely, to worship One God, and to work together for the solutions of the many problems in the society.
Christians and Jews lived peacefully with Muslims throughout centuries in the Middle East and other Asian and African countries. The second Caliph Umar, did not pray in the church in Jerusalem so as not to give the Muslims an excuse to take it over. Christians entrusted the Muslims, and as such the key of the Church in Jerusalem is still in the hands of the Muslims.
Jews fled from Spain during the Inquisition, and they were welcomed by the Muslims. They settled in the heart of the Islamic Caliphate. They enjoyed positions of power and authority.
Throughout the Muslim world, churches, synagogues and missionary schools were built within the Muslim neighborhoods. These places were protected by Muslims even during the contemporary crises in the Middle East.
--- Ahmad H. Sakr, Ph.D.
For more information please contact:
The Institute of Islamic Information and Education P.O. Box 41129
Chicago, IL 60641-0129 U.S.A.
INTRODUCTION OF III&E
The Institute of Islamic Information and Education (III&E) is dedicated to the cause of Islam in North America through striving to elevate the image of Islam in North America through striving to elevate the image of Islam and Muslims by providing the correct information about Islamic beliefs, history and civilization from the authentic sources. Enquiries are welcome.
http://www.islamicity.com/mosque/intro_islam.htm
thank you
== 2 of 2 ==
Date: Sat, Jan 11 2014 8:16 am
From: Mr Flibble
On 11/01/2014 10:58, BV BV wrote:
> INTRODUCING ISLAM
There is no God mate.
/Flibble
==============================================================================
TOPIC: Sausages.
http://groups.google.com/group/comp.lang.c++/t/980d4c6ba62f36ff?hl=en
==============================================================================
== 1 of 1 ==
Date: Sat, Jan 11 2014 9:11 am
From: Mr Flibble
Sausages.
/Flibble
==============================================================================
TOPIC: Decoding GIF file in C? [Source code here]
http://groups.google.com/group/comp.lang.c++/t/dec6ec0426c88c64?hl=en
==============================================================================
== 1 of 2 ==
Date: Sun, Jan 12 2014 9:50 pm
From: kirannd1989@gmail.com
Thanks for the nominations :-).
Fortunately i was able to find only this to start up.
Hope u understand how a startup person would feel, when he comes across a source file all of a sudden.
Please can u direct me to the place where i can find something useful.
On Thursday, January 9, 2014 9:03:33 AM UTC+5:30, Ian Collins wrote:
> kirannd1989@gmail.com wrote:
>
> > Hi..
>
> > i tried compiling this code but there are few undefined Macro/functions like MK_FP().
>
> > I am trying it on WIN32, VS2012.. i have made changes accordingly.
>
> > Is this solution dependent on any library.
>
> > Thanks in advance
>
> >
>
> >
>
> > On Monday, August 1, 1994 1:02:48 PM UTC+5:30, Cyborg wrote:
>
>
>
> Are you going for the record for the oldest post to reply to?
>
>
>
> --
>
> Ian Collins
== 2 of 2 ==
Date: Mon, Jan 13 2014 4:58 am
From: Jorgen Grahn
On Mon, 2014-01-13, kirannd1989@gmail.com wrote:
> Thanks for the nominations :-).
> Fortunately i was able to find only this to start up.
> Hope u understand how a startup person would feel,
> when he comes across a source file all of a sudden.
>
> Please can u direct me to the place where i can find something useful.
What do you want to do? Decoding GIFs was useful back in 1994, but
since then a few other image formats have become more popular. There
are widely used libraries for decoding all of them.
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
==============================================================================
TOPIC: STL map to STL vector
http://groups.google.com/group/comp.lang.c++/t/1164ef3d2f08f58f?hl=en
==============================================================================
== 1 of 3 ==
Date: Mon, Jan 13 2014 4:06 pm
From: mrc2323@cox.net (Mike Copeland)
Is it possible to simply (single statement) move the data from one
container type (the TeamMap, below) to a different type of container
(the TeamVector, below)? My data resides in the map object, but since I
have to occasionally display the data in different orders (e.g.
teamName, teamTypeCode), I must copy the data to a vector and sort it
before producing my listings.
I know that I can copy the individual objects from the map to the
vector one-at-a-time, but I'm hoping that there's a technique that will
do it simply and quickly. Any thoughts? TIA
typedef map<char, int> ShirtStats;
struct TeamData
{
bool isAdded; // Added to container data
bool isValidTeam; // really is a team
char teamTypeCode; // Team type Code
int teamMembers1; // Count of Team Members-1
int teamMembers2; // Count of Team Members-2
int genderCounts[NMAXEVT][2]; // counts of Gender by Event
int shirtTotalMatrix[5][8];
string teamCode; // Team's Code (strTId)
string teamName; // Team's Name
ShirtStats shirtStats;
} extern teamWork;
typedef map<string, TeamData> TeamMap;
TeamMap::iterator tIter;
ShirtStats::iterator ssIter;
TeamMap teamMap;
typedef vector<TeamData> TeamVector;
typedef TeamVector::iterator TeamIter;
TeamVector teamVect;
TeamIter tvIter;
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
== 2 of 3 ==
Date: Mon, Jan 13 2014 3:39 pm
From: Luca Risolia
Mike Copeland wrote:
> Is it possible to simply (single statement) move the data from one
> container type (the TeamMap, below) to a different type of container
> (the TeamVector, below)?
std::for_each(std::make_move_iterator(std::begin(TeamMap)),
std::make_move_iterator(std::end(TeamMap)),
[](decltype(TeamMap)::value_type&& v) {
TeamVector.push_back(std::move(v.second));
});
== 3 of 3 ==
Date: Mon, Jan 13 2014 4:40 pm
From: Ian Collins
Mike Copeland wrote:
> Is it possible to simply (single statement) move the data from one
> container type (the TeamMap, below) to a different type of container
> (the TeamVector, below)? My data resides in the map object, but since I
> have to occasionally display the data in different orders (e.g.
> teamName, teamTypeCode), I must copy the data to a vector and sort it
> before producing my listings.
> I know that I can copy the individual objects from the map to the
> vector one-at-a-time, but I'm hoping that there's a technique that will
> do it simply and quickly. Any thoughts? TIA
Construct the vector using the map's beginning and end:
TeamVector t( teamMap.begin(), teamMap.end() );
--
Ian Collins
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.lang.c++"
group.
To post to this group, visit http://groups.google.com/group/comp.lang.c++?hl=en
To unsubscribe from this group, send email to comp.lang.c+++unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c++/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment