473,889 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Boost process and C

Hi,

Is there any group in the manner of the C++ Boost group that works on
the evolution of the C language? Or is there any group that performs an
equivalent function?

Thanks,
-vs

Apr 29 '06
335 11981
Flash Gordon wrote:
we******@gmail. com wrote:
Ben C wrote:
On 2006-05-03, we******@gmail. com <we******@gmail .com> wrote:
CBFalconer wrote:
> we******@gmail. com wrote:
>> CBFalconer wrote:
> ... snip ...
>>> The last time I took an (admittedly cursory) look at Bstrlib, I
>>> found it cursed with non-portabilities
>> You perhaps would like to name one?
> I took another 2 minute look, and was immediately struck by the use
> of int for sizes, rather than size_t. This limits reliably
> available string length to 32767.
[snip]

> [...] I did find an explanation and
> justification for this. Conceded, such a size is probably adequate
> for most usage, but the restriction is not present in standard C
> strings.
Your going to need to conceed on more grounds than that. There is a
reason many UNIX systems tried to add a ssize_t type, and why TR 24731
has added rsize_t to their extension. (As a side note, I strongly
suspect the Microsoft, in fact, added this whole rsize_t thing to TR
24731 when they realized that Bstrlib, or things like it, actually has
far better real world safety because its use of ints for string
lengths.) Using a long would be incorrect since there are some systems
where a long value can exceed a size_t value (and thus lead to falsely
sized mallocs.) There is also the matter of trying to codify
read-only and constant strings and detecting errors efficiently
(negative lengths fit the bill.) Using ints is the best choice
because at worst its giving up things (super-long strings) that nobody
cares about,
I think it's fair to expect the possibility of super-long strings in a
general-purpose string library.


Ok, so you can name a single application of such a thing right?


Handling an RTF document that you will be writing to a variable length
record in a database. Yes, I do have good reason for doing this. No, I
can't stream the document in to the database so I do have to have it all
in memory. Yes, RTF documents are encoded as text. Yes, they can be
extremely large, especially if they have graphics embedded in them
encoded as text.


So now name the platform where its *possible* to deal with this, but
where Bstrlib fails to be able to deal with them due to its design
choices.
it allows in an efficient way for all desirable encoding scenarios,
and it avoids any wrap around anomolies causing under-allocations.
What anomalies? Are these a consequence of using signed long, or
size_t?


I am describing what int does (*BOTH* the encoding scenarios and
avoiding anomolies), Using a long int would allow for arithmetic on
numbers that exceed the maximum value of size_t on some systems (that
actually *exist*), so when there was an attempt to malloc or realloc on
such sizes, there would be a wrap around to some value that would just
make it screw up. And if I used a size_t, then there would be no
simple space of encodings that can catch errors, constants and write
protected strings.


Is an extra byte (or word, or double word) for a flags field really that
big an overhead?


I need two *bits* for flags, and I want large ranges to catch errors in
the scalar fields (this is a *safe* library). An extra struct entry is
the wrong way to do this because it doesn't help my catch errors in the
scalar fields, and its space inefficient.

ssize_t would have been a reasonable *functional* choice, but its not
standard. size_t is no good because it can't go negative. long int is
no good because there are plenty of real platforms where long int is
larger than size_t. int solves all the main real problems, and as a
bonus the compiler is designed to make sure its the fastest scalar
primitive available.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

May 4 '06 #211
REH

Ben C wrote:
Why? And why do you think objects of user-defined types have to be
"allocated and freed manually"?
They don't _have_ to be, but they _might_ be.

One of the "features" of C is that the programmer has control over
memory allocation and de-allocation.

Yes, C++ has this same "feature." Memory allocation is completely
under control of the programmer.

Usually in practice this just means a lot of bugs and crashes; but there
are good reasons for it too: you can write domain-specific allocators
that are more efficient and/or tunable in the amount of space or time
they use, instead of relying on a general-purpose allocator or
garbage-collector all the time. C++ does not do GC, nor are you required to use any "general-purpose"
allocator.

The programmer also might implement things like shallow-copy and
copy-on-write.

Somehow all of these things need to happen when an expression like this
is evaluated:

string a = b + c;

In C++ the basic mechanism you use for this is constructors. For example
the string copy constructor might set up a shallow copy-on-write copy.
Someone has to write the code for that. If the programmer writes it, and
it's not just part of the framework, then it has to get implicitly
called. Yes, the programmer can write a constructor to do this. He does not
have to.
struct foo {
int x, y;
};

foo operator+ (const foo& a, const foo& b)
// for it you are of the "I hate references" camp: foo operator+ (foo a,
foo b)
{
const foo z = {a.x + b.x, a.y + b.y};
return z;
}

foo x = {1, 2};
foo y = {3, 4};
foo z = x + y;

simplistic, but no constructors.


Yes exactly, and AFAIK the kind of operator-overloading that has been
proposed for C is something like this-- it's fine for structs
representing things like complex numbers (that are a few words long and
don't contain pointers).

But this is quite limited. You can use it for complex numbers, numbers
longer than the largest machine type, and as has been suggested perhaps
to wrap assembler intrinsics for multimedia instructions.

But you can't easily use it efficiently as it stands for matrices or
strings (which are two other common uses for operator overloading).

On its own it's not enough; with the extra workarounds you need, you end
up with C++ (or some other kind of "octopus made by nailing four extra
legs onto a dog").


I still don't get your point.

REH

May 4 '06 #212
Flash Gordon wrote:
jacob navia wrote:
Flash Gordon a écrit :
Is an extra byte (or word, or double word) for a flags field really
that big an overhead?
Well, I have that extra "Flags" field in the string library of
lcc-win32. I have the size as a size_t as you propose, and I need 32
bits for the flags.

The problem is that 32 bits is quite a lot for a few bits info... For
programs that use extensively strings, 32 bits multiplied by several
thousand small strings can make a big difference in RAM used, specially
for the more common short strings.

I see the point of Bstrlib, and it is a very valid design decision.


I've yet to see software where short strings made up a significant
portion of the memory footprint and saving the memory that avoiding the
flags would be of real use. Of course, such applications might exist.


Any program that reads words from any language dictionary. Like a
spell checker, or a word puzzle solver/creator, or a spam filter. For
dictionaries the size of the english language dictionary, these kinds
of applications can typically push the L2 cache of your CPU pretty
hard.
Personally I would say that using negative lengths was asking for
problems because at some point a negative length will be checked without
first changing it to positive.


I think you miss the point. If the string length is negative then it
is erroneous. That's the point of it. But the amount of memory
allocated being negative, I use to indicate that the memory is not
legally modifiable at the moment, and being 0 meaning that its not
modifiable ever. The point being that the library blocks erroneous
action due to intentionally or unintentionally having bad header values
in the same test. So it reduces overhead, while increasing safety and
functionality at the same time.

You know, you can actually read the explanation of all this in the
documentation if you care to do so.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

May 4 '06 #213
Jordan Abel wrote:
On 2006-05-04, we******@gmail. com <we******@gmail .com> wrote:
Ben C wrote:
On 2006-05-03, we******@gmail. com <we******@gmail .com> wrote:
> CBFalconer wrote:
>> we******@gmail. com wrote:
>> > CBFalconer wrote:
>> ... snip ...
>> >> The last time I took an (admittedly cursory) look at Bstrlib, I
>> >> found it cursed with non-portabilities
>> >
>> > You perhaps would like to name one?
>>
>> I took another 2 minute look, and was immediately struck by the use
>> of int for sizes, rather than size_t. This limits reliably
>> available string length to 32767.

[snip]

>> [...] I did find an explanation and
>> justification for this. Conceded, such a size is probably adequate
>> for most usage, but the restriction is not present in standard C
>> strings.

> Your going to need to conceed on more grounds than that. There is a
> reason many UNIX systems tried to add a ssize_t type, and why TR 24731
> has added rsize_t to their extension. (As a side note, I strongly
> suspect the Microsoft, in fact, added this whole rsize_t thing to TR
> 24731 when they realized that Bstrlib, or things like it, actually has
> far better real world safety because its use of ints for string
> lengths.) Using a long would be incorrect since there are some systems
> where a long value can exceed a size_t value (and thus lead to falsely
> sized mallocs.) There is also the matter of trying to codify
> read-only and constant strings and detecting errors efficiently
> (negative lengths fit the bill.) Using ints is the best choice
> because at worst its giving up things (super-long strings) that nobody
> cares about,

I think it's fair to expect the possibility of super-long strings in a
general-purpose string library.
Ok, so you can name a single application of such a thing right?
> it allows in an efficient way for all desirable encoding scenarios,
> and it avoids any wrap around anomolies causing under-allocations.

What anomalies? Are these a consequence of using signed long, or
size_t?


I am describing what int does (*BOTH* the encoding scenarios and
avoiding anomolies), Using a long int would allow for arithmetic on
numbers that exceed the maximum value of size_t on some systems (that
actually *exist*), so when there was an attempt to malloc or realloc on
such sizes, there would be a wrap around to some value that would just
make it screw up. And if I used a size_t, then there would be no
simple space of encodings that can catch errors, constants and write
protected strings.


If it's longer than the maximum size_t value, you probably can't have it
anyway, so there's no point in being able to represent it.


Huh?
Silly encoding tricks buy you nothing, just use another field with bit
flags.


If I do that, I lose space, speed, and error detection. I see it as
buying me a whole hell of a lot actually.
> If I tried to use size_t I would give up a significant amount of
> safety and design features (or else I would have to put more entries
> into the header, making it less efficient).

If you only need a single "special" marker value (for which you were
perhaps using -1), you could consider using ~(size_t) 0.


For the mlen, I need one value that indicates a write protected string
(that can be unprotected) and one the indicates a constant (that can
never be unprotected). The slen has to be of the same type as mlen,
and so in order to check for potential errors, I set it to -1 to
indicate that it has been deterministical ly set to an invalid value.
Of course I could just isolate a handful of values, however, but this
makes the error space extremely small, which reduces your chances of
finding accidental full corruptions,


This shouldn't be left to chance anyway, pretending that it can be
caught invites disaster when inevitably one of the cases comes up when
it _doesn't_ get caught.


Uhh ... that's the situation we have with basically all other string
libraries in existence for C *today*. My library and TR 24731 are the
only ones to attempt to catch these errors *before* any undefined
scenario occurs. In practice this means that a greater percentage of
corruption errors are simply caught in your normal error handling.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

May 4 '06 #214
On 2006-05-04, jacob navia <ja***@jacob.re mcomp.fr> wrote:
Ben C a écrit :

Yes exactly, and AFAIK the kind of operator-overloading that has been
proposed for C is something like this-- it's fine for structs
representing things like complex numbers (that are a few words long and
don't contain pointers).

But this is quite limited. You can use it for complex numbers, numbers
longer than the largest machine type, and as has been suggested perhaps
to wrap assembler intrinsics for multimedia instructions.

But you can't easily use it efficiently as it stands for matrices or
strings (which are two other common uses for operator overloading).

Why not?

Suppose Matrix A,B,C;

C = A+B;

Your operator + function would allocate the space, add the matrix to a
possible linked lists of matrices that allows to GC unused ones, and
return the results.


A reference to them presumably.

Yes indeed, if you have a garbage collector (and references) there is no
problem.

That's why I say operator-overloading works well in languages where
the framework manages storage for you (e.g. in Python, and apparently
lcc-extended C).

[snip]
Besides, I think that using the addition operator to "add" strings is an
ABOMINATION because:

a+b != b+a
"Hello" + "World" != "World" + "Hello"

It just makes NO SENSE. The same thing when you apply the addition
operator to dates: it makes NO SENSE to ADD dates. Only subtraction
makes sense. And yes, multiplying dates is left "as an exercise" for the
fools!
And what about left-shifting iostreams :)
If you feel that operator overloading would not solve the problem for
matrices addition, then you will have to devise other means of doing that.

The GC however, is an ELEGANT solution to all this problems. We would
have the easy of use of C++ with its automatic destructors, WITHOUT
PAYING THE PRICE in language and compiler complexity.

This last point is important: compiler complexity increases the effort
that the language implementor must do and increases the "bug surface".


Yes of course. Although I would say, why not leave poor C alone and
start a new language? Or just use a different language that already
exists... there are a lot out there.

I often get the feeling there's a lot of pain and complexity in C++ that
could have been avoided if it hadn't started out trying to be compatible
with C.
May 4 '06 #215
On 2006-05-04, REH <sp******@stny. rr.com> wrote:

Ben C wrote:
Usually in practice this just means a lot of bugs and crashes; but there
are good reasons for it too: you can write domain-specific allocators
that are more efficient and/or tunable in the amount of space or time
they use, instead of relying on a general-purpose allocator or
garbage-collector all the time.
C++ does not do GC, nor are you required to use any "general-purpose"
allocator.
Yes I know. But you do get constructors, destructors and references, so
you can fit explicit memory management "under the hood" of operator
overloading.
The programmer also might implement things like shallow-copy and
copy-on-write.

Somehow all of these things need to happen when an expression like this
is evaluated:

string a = b + c;

In C++ the basic mechanism you use for this is constructors. For example
the string copy constructor might set up a shallow copy-on-write copy.
Someone has to write the code for that. If the programmer writes it, and
it's not just part of the framework, then it has to get implicitly
called.

Yes, the programmer can write a constructor to do this. He does not
have to.
I don't know of a way to do it without a constructor (for a
shallow-copied copy-on-write string class).

[snip] I still don't get your point.


Show me the string example, and hopefully either you will get my point
or I will get yours :)
May 4 '06 #216
On 2006-05-04, we******@gmail. com <we******@gmail .com> wrote:
Jordan Abel wrote:
On 2006-05-04, we******@gmail. com <we******@gmail .com> wrote:
> Ben C wrote:
>> On 2006-05-03, we******@gmail. com <we******@gmail .com> wrote:
>> > CBFalconer wrote:
>> >> we******@gmail. com wrote:
>> >> > CBFalconer wrote:
>> >> ... snip ...
>> >> >> The last time I took an (admittedly cursory) look at Bstrlib, I
>> >> >> found it cursed with non-portabilities
>> >> >
>> >> > You perhaps would like to name one?
>> >>
>> >> I took another 2 minute look, and was immediately struck by the use
>> >> of int for sizes, rather than size_t. This limits reliably
>> >> available string length to 32767.
>>
>> [snip]
>>
>> >> [...] I did find an explanation and
>> >> justification for this. Conceded, such a size is probably adequate
>> >> for most usage, but the restriction is not present in standard C
>> >> strings.
>>
>> > Your going to need to conceed on more grounds than that. There is a
>> > reason many UNIX systems tried to add a ssize_t type, and why TR 24731
>> > has added rsize_t to their extension. (As a side note, I strongly
>> > suspect the Microsoft, in fact, added this whole rsize_t thing to TR
>> > 24731 when they realized that Bstrlib, or things like it, actually has
>> > far better real world safety because its use of ints for string
>> > lengths.) Using a long would be incorrect since there are some systems
>> > where a long value can exceed a size_t value (and thus lead to falsely
>> > sized mallocs.) There is also the matter of trying to codify
>> > read-only and constant strings and detecting errors efficiently
>> > (negative lengths fit the bill.) Using ints is the best choice
>> > because at worst its giving up things (super-long strings) that nobody
>> > cares about,
>>
>> I think it's fair to expect the possibility of super-long strings in a
>> general-purpose string library.
>
> Ok, so you can name a single application of such a thing right?
>
>> > it allows in an efficient way for all desirable encoding scenarios,
>> > and it avoids any wrap around anomolies causing under-allocations.
>>
>> What anomalies? Are these a consequence of using signed long, or
>> size_t?
>
> I am describing what int does (*BOTH* the encoding scenarios and
> avoiding anomolies), Using a long int would allow for arithmetic on
> numbers that exceed the maximum value of size_t on some systems (that
> actually *exist*), so when there was an attempt to malloc or realloc on
> such sizes, there would be a wrap around to some value that would just
> make it screw up. And if I used a size_t, then there would be no
> simple space of encodings that can catch errors, constants and write
> protected strings.
If it's longer than the maximum size_t value, you probably can't have it
anyway, so there's no point in being able to represent it.


Huh?


size_t has to be able to represent the size of any object. to have
a string longer than its maximum value you have to have an array of
characters longer than that maximum value - which you can't have.
Silly encoding tricks buy you nothing, just use another field with bit
flags.


If I do that, I lose space, speed, and error detection. I see it as
buying me a whole hell of a lot actually.


Space and speed are cheap these days.

Even if you have a million strings, that's still only four megabytes
saved. If you make a million calls, that's still only a few million
cycles saved.

It does _not_ buy you error detection in general, and a false sense of
safety can be dangerous.

Probably the best thing to do to prevent errors would be make everything
use your API, and make sure your functions don't have bugs. Once you
have that, the only possible source of errors is bit rot, and you can't
do anything about that.
May 4 '06 #217
On 2006-05-04, jacob navia <ja***@jacob.re mcomp.fr> wrote:
It just makes NO SENSE. The same thing when you apply the addition
operator to dates: it makes NO SENSE to ADD dates. Only subtraction
makes sense. And yes, multiplying dates is left "as an exercise" for
the fools!


The addition operator on dates would work _exactly_ the same way as the
addition operator on pointers - you can subtract two of them, or add one
to a number (representing an interval)

Presumably, the number would be taken as seconds [so that the
subtraction operator would call difftime, and addition, on systems where
it's not trivial, could call localtime, modify tm_secs, and then call
mktime]
May 4 '06 #218
Jordan Abel a écrit :
On 2006-05-04, jacob navia <ja***@jacob.re mcomp.fr> wrote:
It just makes NO SENSE. The same thing when you apply the addition
operator to dates: it makes NO SENSE to ADD dates. Only subtraction
makes sense. And yes, multiplying dates is left "as an exercise" for
the fools!

The addition operator on dates would work _exactly_ the same way as the
addition operator on pointers - you can subtract two of them, or add one
to a number (representing an interval)

Presumably, the number would be taken as seconds [so that the
subtraction operator would call difftime, and addition, on systems where
it's not trivial, could call localtime, modify tm_secs, and then call
mktime]


Yes adding a number to a date makes sense, but I was speaking about
adding two dates!
May 4 '06 #219
we******@gmail. com wrote:
Flash Gordon wrote:
we******@gmail. com wrote:
Ben C wrote:
On 2006-05-03, we******@gmail. com <we******@gmail .com> wrote:
> CBFalconer wrote:
>> we******@gmail. com wrote:
>>> CBFalconer wrote:
>> ... snip ...
>>>> The last time I took an (admittedly cursory) look at Bstrlib, I
>>>> found it cursed with non-portabilities
>>> You perhaps would like to name one?
>> I took another 2 minute look, and was immediately struck by the use
>> of int for sizes, rather than size_t. This limits reliably
>> available string length to 32767.
[snip]

>> [...] I did find an explanation and
>> justification for this. Conceded, such a size is probably adequate
>> for most usage, but the restriction is not present in standard C
>> strings.
> Your going to need to conceed on more grounds than that. There is a
> reason many UNIX systems tried to add a ssize_t type, and why TR 24731
> has added rsize_t to their extension. (As a side note, I strongly
> suspect the Microsoft, in fact, added this whole rsize_t thing to TR
> 24731 when they realized that Bstrlib, or things like it, actually has
> far better real world safety because its use of ints for string
> lengths.) Using a long would be incorrect since there are some systems
> where a long value can exceed a size_t value (and thus lead to falsely
> sized mallocs.) There is also the matter of trying to codify
> read-only and constant strings and detecting errors efficiently
> (negative lengths fit the bill.) Using ints is the best choice
> because at worst its giving up things (super-long strings) that nobody
> cares about,
I think it's fair to expect the possibility of super-long strings in a
general-purpose string library.
Ok, so you can name a single application of such a thing right?

Handling an RTF document that you will be writing to a variable length
record in a database. Yes, I do have good reason for doing this. No, I
can't stream the document in to the database so I do have to have it all
in memory. Yes, RTF documents are encoded as text. Yes, they can be
extremely large, especially if they have graphics embedded in them
encoded as text.


So now name the platform where its *possible* to deal with this, but
where Bstrlib fails to be able to deal with them due to its design
choices.


If the DOS port hadn't been dropped then depending on the compiler we
might have hit this. A significant portion of the SW I'm thinking of
originated on DOS, so it could have hit it.
> it allows in an efficient way for all desirable encoding scenarios,
> and it avoids any wrap around anomolies causing under-allocations.
What anomalies? Are these a consequence of using signed long, or
size_t?
I am describing what int does (*BOTH* the encoding scenarios and
avoiding anomolies), Using a long int would allow for arithmetic on
numbers that exceed the maximum value of size_t on some systems (that
actually *exist*), so when there was an attempt to malloc or realloc on
such sizes, there would be a wrap around to some value that would just
make it screw up. And if I used a size_t, then there would be no
simple space of encodings that can catch errors, constants and write
protected strings.

Is an extra byte (or word, or double word) for a flags field really that
big an overhead?


I need two *bits* for flags, and I want large ranges to catch errors in
the scalar fields (this is a *safe* library). An extra struct entry is
the wrong way to do this because it doesn't help my catch errors in the
scalar fields, and its space inefficient.

ssize_t would have been a reasonable *functional* choice, but its not
standard. size_t is no good because it can't go negative. long int is
no good because there are plenty of real platforms where long int is
larger than size_t. int solves all the main real problems, and as a
bonus the compiler is designed to make sure its the fastest scalar
primitive available.


Strangely enough, when a previous developer on the code I'm dealing with
thought he could limit size to a "valid" range an assert if it was out
of range we found that the asserts kept getting triggered. However, it
was always triggered incorrectly because the size was actually valid! So
I'll stick to not artificially limiting sizes. If the administrator of a
server the SW is installed on wants then s/he can use system specific
means to limit the size of a process.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc

Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
May 4 '06 #220

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

65
5415
by: perseus | last post by:
I think that everyone who told me that my question is irrelevant, in particular Mr. David White, is being absolutely ridiculous. Obviously, most of you up here behave like the owners of the C++ language. A C++ interface installation IS ABOUT THE C++ LANGUAGE! The language does not possess the ability to handle even simple file directory manipulation. Those wise people that created it did not take care of it. So, BOOST is a portable...
205
10775
by: Jeremy Siek | last post by:
CALL FOR PAPERS/PARTICIPATION C++, Boost, and the Future of C++ Libraries Workshop at OOPSLA October 24-28, 2004 Vancouver, British Columbia, Canada http://tinyurl.com/4n5pf Submissions
17
1908
by: Howard Gardner | last post by:
/* If I am using boost, then how should I write this program? As it sits, this program is using SFINAE to determine whether or not a type supports particular syntax. I suspect that there is functionality in boost to do this. I have found mpl::has_xxx, which I suspect of being part of the solution. I've also found type_traits::has_nothrow_constructor
2
6637
by: smith4894 | last post by:
{ not sure you're aware of that but there are the newsgroups for all major operating systems. you might want to try asking in the forum 'comp.os.linux.development.apps', since memory-mapped files are not a language-supported structure, they are platform-specific. -mod } I'm trying to use boost serialization to serialize/deserialize data to and from a mmap'd file. I have my own ostream/istream classes that essentially read/write bytes...
5
2400
by: linyanhung | last post by:
I used a boost multi thread in VS 2005 on a Duo Core PC, and made a two thread process. The code is something like this: #include <boost/thread/thread.hpp> void fun1() { //do something
8
6220
by: Matt England | last post by:
My team currently using Boost Threads, but we are considering switching to ZThreads. (We seek cross-platform, C++ multithreading capabilities in an external library.) ZThread(s): http://zthread.sourceforge.net/ http://www.inf.uni-konstanz.de/dbis/members/vinnik/zsim/doc/ Can anyone share their ZThreads experience, either good, bad, or
2
2417
by: ironpingwin | last post by:
Hi! I'd like to make few threads which will run in the same time in C++. I try to use boost library v 1.34.1 (it can't be newest, because I compile on remote machine, which is not administrated by me). In this version there isn't detach() function. How to run functions from two different class in the same time?
13
4543
by: brad | last post by:
Still learning C++. I'm writing some regex using boost. It works great. Only thing is... this code seems slow to me compared to equivelent Perl and Python. I'm sure I'm doing something incorrect. Any tips? #include <boost/regex.hpp> #include <iostream> // g++ numbers.cpp -o numbers -I/usr/local/include/boost-1_35 /usr/local/lib/libboost_regex-gcc41-mt-s.a // g++ numbers.cpp -o numbers.exe
5
3596
by: ameyav | last post by:
Hi All, I am converting some C code into C++ code. The objective is to improve throughput. I have some code written in C which serially parses through a list of files, opens each one of them, processes the data and closes the file. All the files are processed one by one. The obvious performance bottleneck that i could think of is the wasted cpu cycles for file i/o. *My solution* was to spawn multiple threads to do the file i/o. For...
0
9967
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9810
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11202
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10443
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7151
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5830
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6029
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3256
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.