Sent from my iPad
Begin forwarded message:
From: Jensie Tou <pandjtou@aol.com>
Date: November 30, 2014 at 1:45:29 PM CST
To: Jensie Tou <pandjtou@aol.com>
Subject: Fwd: 這個小女孩太厲害了!她父母到底怎麼教的呢?
Sent from my iPad
Begin forwarded message:
From: Jensie Tou <pandjtou@aol.com>
Date: November 30, 2014 at 1:45:29 PM CST
To: Jensie Tou <pandjtou@aol.com>
Subject: Fwd: 這個小女孩太厲害了!她父母到底怎麼教的呢?
Sent from my iPad
Begin forwarded message:
comp.lang.c++@googlegroups.com | Google Groups | ![]() |
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
blackball <bugway@gmail.com>: Nov 29 07:24PM -0800 Two different questions in one thread ? I have the same confusion with the first author. |
red floyd <no.spam.here@its.invalid>: Nov 29 05:09PM -0800 On 11/28/2014 2:12 PM, Paavo Helde wrote: > zero byte automatically). > hth > Paavo I like the #define NUL solution. It just comes out as more "readable". |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
comp.lang.c++@googlegroups.com | Google Groups | ![]() |
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
woodbrian77@gmail.com: Nov 29 02:27PM -0800 Currently all messages between my back and middle tiers are compressed. The following shows the messages the middle tier sends to the back tier. middle_messages_back @out (messageid_t, ::std::vector<cmw_account_info>) @out (messageid_t, ::cmw::marshalling_integer, cui_generator) @out (messageid_t) } The first message there is a login request. The second is a code generation request and the last is a keep alive. The keep alive is just a messageid_t which, in this case, is one byte. After being compressed, the keep alive message increases to 12 bytes. I think compression is helpful for the code generation request message, but not for the keep alive message. I'd guess compression isn't helping with the login message either, but am not sure. I've worked on systems that use compression for everything or not at all. Have you ever worked on a system that uses both compressed and non-compressed messages? I'd like to find some info on systems like that. Brian Ebenezer Enterprises - In G-d we trust. http://webEbenezer.net |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Nov 29 10:59PM > everything or not at all. Have you ever worked on a > system that uses both compressed and non-compressed > messages? I'd like to find some info on systems like that. Sausages. /Flibble |
Ian Collins <ian-news@hotmail.com>: Nov 30 12:10PM +1300 > everything or not at all. Have you ever worked on a > system that uses both compressed and non-compressed > messages? I'd like to find some info on systems like that. Compression is seldom any use for anything other than bulk transfer of compressible data or sausages. For inter-process or intra-process messages the overheads incurred by compression tend to outweigh any benefits for short messages and for LAN/WAN messaging packet latency has much more of a performance impact than packet size. One example is the application I use to distribute filesystems between local and geographically distributed hosts, there I only consider compression for full (not incremental) transfers of filesystems with a worthwhile compress ratio. -- Ian Collins |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
comp.programming.threads@googlegroups.com | Google Groups | ![]() |
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.programming.threads+unsubscribe@googlegroups.com. |
anastasiossouris@gmail.com: Nov 29 02:33AM -0800 On Monday, November 24, 2014 11:08:58 PM UTC+2, Ramine wrote: > dangerous ? > Thank you, > Amine Moulay Ramdane. That's an issue for hardware folks... Relaxed memory ordering performs better because the cores in a manycore machine can avoid doing extra work... Think that if an architecture implemented a sequential consistent memory model you would only need to perform atomic loads and stores and no memory barriers at all. So it is easier for you the programmer. BUT, the architecture underneath will implement in hardware those memory fences for you in EVERY load and store you perform. Next one realizes that ordering memory actions between different processors is not essential for every load and store. But only when you need it... So the hardware guys say to you: Well get those cheap load and stores you want. And if you want to order memory actions then i give to you those extra memory barriers instructions (which are costly with respect to other instructions), and you have to place them where they are needed. So, the hardware runs fast in the common case and CAN also run fast in the case where synchronization is needed if you succeed in placing only the required memory fences and no more. This certainly adds to the complexity a programmer has to face when implementing a lock-free algorithm and that's why you don't like it! :) |
Ramine <ramine@1.1>: Nov 28 02:11PM -0800 Hello, I have just received an email from the president Normand Peladeau of the Provalis Research that is a world-leading developer of text analysis software with ground-breaking qualitative, quantitative and mixed methods programs. Here is the website of his company: http://provalisresearch.com/company/ He saws my work on my Parallel projects that i have done with Delphi and Freepascal and i think he wants me to work for them, here is the email that i have received from him: ----- Amine, I saw one of your posting on the web and saw that you were probably in Quebec (videotron.ca). Are you looking for a programming job? Someone with Delphi skills and mathematical and statistical background would probably have a good chance to get an interesting programming job at my company. If you are interested in either a job or some contracts, please send me your CV or some notes. Normand Peladeau Provalis Research ---- Thank you, Amine Moulay Ramdane. |
"Chris M. Thomasson" <no@spam.invalid>: Nov 28 03:44PM -0800 > http://provalisresearch.com/company/ > He saws my work on my Parallel projects that i have done with Delphi and > Freepascal and i think he wants me to work for them That is great news; I wish you all the luck in the world. One little point, please _try_ running your algorithms through a race detector like https://code.google.com/p/data-race-test/wiki/ThreadSanitizer or http://www.1024cores.net/home/relacy-race-detector :^) |
Gerald Breuer <Gerald.Breuer@gmail.com>: Nov 29 01:55AM +0100 Ramine wrote: > He saws my work on my Parallel projects that i have done with Delphi > and Freepascal and i think he wants me to work for them, here is the > email that i have received from him: I hope he will notice your bug-frequency. |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.programming.threads+unsubscribe@googlegroups.com. |
comp.lang.c++@googlegroups.com | Google Groups | ![]() |
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
Paavo Helde <myfirstname@osa.pri.ee>: Nov 27 05:29PM -0600 Chicken Mcnuggets <chicken@mcnuggets.com> wrote in > { > netstring.push_back(c_netstring[i]); > } I understand this is just helper code, but you can achieve the same in a bit shorter and more reliable way: const char c_netstring[] = "13:SCGI\01\0,Test"; std::vector<char> netstring { std::begin(c_netstring), std::end(c_netstring) }; |
Chicken Mcnuggets <chicken@mcnuggets.com>: Nov 28 01:05PM On 27/11/14 23:10, Ben Bacarisse wrote: > then *always* increments it. Are you certain that the condition that > ends the loop (it != raw_scgi_netstring.end()) is going to fire and not > be "skipped"? I've removed all the the manual iterator increments in the loop and replaced them with continue (which in hindsight is what I meant to do originally anyway). I still get the same error which is unfortunate. I'm a bit stuck here. I've changed the iterator to a const iterator just to make sure I'm not doing anything stupid with it by accident and I still get the out of range exception. I could loop through it manually but that kinda defeats the purpose of using C++ in the first place. I might as well just write C style code for this if I do that way which I'm attempting to avoid. > string. The std::string class has lots of member function that can help > with this sort of task. > <snip> Yeah I started off with std::string and using the const char and string length constructor but hit the same issue there as I did here with out of range exceptions. I assumed it was because it was getting confused with all the NULLs but from the looks of it it was something more than that since the vector is exhibiting something similar. I can't keep swapping backwards and forwards. I'll stick with vector until I can get it working and then I'll think about a string implementation. I guess I could have a constructor for each so the user can choose how they want it stored internally if they like. Either way it can't hurt. |
Chicken Mcnuggets <chicken@mcnuggets.com>: Nov 28 04:18PM On 28/11/14 13:29, Stefan Ram wrote: > Someone writes: >> Subject: Dealing with strings with NULL characters in the middle > The ASCII character is spelled »NUL«. Ah. Yes. Thank you for the correction. |
Ben Bacarisse <ben.usenet@bsb.me.uk>: Nov 28 04:30PM Chicken Mcnuggets <chicken@mcnuggets.com> writes: <snip> > I still get the same error which is unfortunate. I'm a bit stuck > here. It's unlikely anyone can help without seeing the code. Ideally executable code. <snip> -- Ben. |
Chicken Mcnuggets <chicken@mcnuggets.com>: Nov 28 04:52PM On 28/11/14 13:05, Chicken Mcnuggets wrote: > implementation. I guess I could have a constructor for each so the user > can choose how they want it stored internally if they like. Either way > it can't hurt. Updated source code: http://ideone.com/3g6fW5 Produces the following output: Header Name: Header Value: Header Name: Header Value: Header Name: Header Value: Header Name: Header Value: Header Name: S Header Value: Header Name: SC Header Value: Header Name: SCG Header Value: Header Name: SCGI Header Value: Header Name: SCGI Header Value: Header Name: Header Value: Header Name: Header Value: Header Name: Header Value: Header Name: Header Value: Header Name: Header Value: Header Name: Header Value: The code works fine up until the NUL character and then fails for some reason. It appears that it doesn't see the NUL character as an individual character and then mucks up when you try and compare to it. I got rid of the iterators since that wasn't working and the new loop at least seems to produce some output to help with debugging. I've just run it through GDB and I think I've found the problem. My string that I am using is as follows: const char *c_netstring = "13:SCGI\01\0,Test"; Notice the first NUL character followed by a 1. In GDB it appears that the std::vector<char> interprets that as a single character (an ASCII 1 character aka SOH or Start of Heading or \001) rather than correctly interpreting it as an NUL (ASCII 0 or \000) followed by a 1 (ASCII 49 or \061). Now I know what the problem is. How do I fix this? I can't put a separator between the two characters because that would break the protocol so I'm kinda stuck here. |
Chicken Mcnuggets <chicken@mcnuggets.com>: Nov 28 04:53PM On 28/11/14 16:30, Ben Bacarisse wrote: > It's unlikely anyone can help without seeing the code. Ideally > executable code. > <snip> See my other post I just made with results from GDB and an explanation of what the problem is. |
Louis Krupp <lkrupp@nospam.pssw.com.invalid>: Nov 28 10:34AM -0700 On Fri, 28 Nov 2014 16:52:09 +0000, Chicken Mcnuggets <chicken@mcnuggets.com> wrote: <snip> >character aka SOH or Start of Heading or \001) rather than correctly >interpreting it as an NUL (ASCII 0 or \000) followed by a 1 (ASCII 49 or >\061). My reaction is probably the same as a lot of other folks: I should have seen that. This isn't a problem isn't with std::vector<char>; the compiler is handling the octal conversion \01 properly, and std::vector<char> is seeing the resulting byte. If I'm not mistaken, \1, \01 and \001 should all give the same result, a byte with a value of 1. >Now I know what the problem is. How do I fix this? I can't put a >separator between the two characters because that would break the >protocol so I'm kinda stuck here. \0001 should give you a nul byte followed by an ASCII '1'. Louis |
Chicken Mcnuggets <chicken@mcnuggets.com>: Nov 28 06:20PM On 28/11/14 17:34, Louis Krupp wrote: >> protocol so I'm kinda stuck here. > \0001 should give you a nul byte followed by an ASCII '1'. > Louis Awesome! That fixed that issue. Now I just need to fix my parser :P. Thank you everyone for your help, it is much appreciated. |
Paavo Helde <myfirstname@osa.pri.ee>: Nov 28 04:12PM -0600 Louis Krupp <lkrupp@nospam.pssw.com.invalid> wrote in > \0001 should give you a nul byte followed by an ASCII '1'. Another a bit more readable option would be const char *c_netstring = "13:SCGI\0" "1\0,Test"; or maybe something like #define NUL "\0" const char *c_netstring = "13:SCGI" NUL "1" NUL ",Test"; This defines a C array of 16 characters (the compiler adds one terminating zero byte automatically). hth Paavo |
Vincenzo Mercuri <invalid@world.net>: Nov 28 02:09AM +0100 Il 27/11/2014 22:31, Mr Flibble ha scritto: >> const calling the operator< potentially change the ordering :) > That might be the case but the *objects* inside the priority queue are > not const objects like the OP claimed. And how do you call objects that you cannot modify? -- Vincenzo Mercuri |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Nov 28 01:30AM On 28/11/2014 01:09, Vincenzo Mercuri wrote: >> That might be the case but the *objects* inside the priority queue are >> not const objects like the OP claimed. > And how do you call objects that you cannot modify? But you can modify them. const int i = 42; /* (1) a const object */ int j = 43; /* (2) a non-const object */ const int& r = j; /* (3) a reference-to-const to a non-const object */ We are talking about case (3) here: the underlying container of priority_queue is std::vector by default and it is not possible to store const objects in a std::vector. Theoretically you can use const_cast<> on the priority_queue top() element to "remove const" and modify it and you should not run into any problems as long as that change doesn't affect ordering. /Flibble |
Vincenzo Mercuri <invalid@world.net>: Nov 28 03:24AM +0100 Il 28/11/2014 02:30, Mr Flibble ha scritto: > We are talking about case (3) here: the underlying container of > priority_queue is std::vector by default and it is not possible to store > const objects in a std::vector. That's where our misunderstanding lies. With "stored as const" I mean that they can only be accessed by means of reference-to-const, also because it wouldn't make much sense to "store const objects", for the same reason why a "vector<const int>" is meaningless. In our case, std::priority_queue uses std::less<> by default (as its Compare type), which provides a std::less::operator() declared as: bool operator()( const T& lhs, const T& rhs ) const; that in turn requires T (OP's "duty"..) to define operator< which *must* be const because it's called by a const member function. [If the OP had to define his/her type for a container like vector, operator< wouldn't be required to be const anymore]. > Theoretically you can use const_cast<> on the priority_queue top() > element to "remove const" and modify it and you should not run into any > problems as long as that change doesn't affect ordering. I understand that but that was not my point: a reference-to-const is a reference-to-non-const via const_cast<> as much as an int is a double via static_cast<>. -- Vincenzo Mercuri |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Nov 28 01:53PM On 28/11/2014 02:24, Vincenzo Mercuri wrote: [snip] > I understand that but that was not my point: a reference-to-const > is a reference-to-non-const via const_cast<> as much as an int is > a double via static_cast<>. Wrong. The double would be a different object to the int when using static_cast<> whilst the result of the const_cast<> returns the *same* object. /Flibble |
bleachbot <bleachbot@httrack.com>: Nov 28 05:33AM +0100 |
ram@zedat.fu-berlin.de (Stefan Ram): Nov 28 01:29PM Someone writes: >Subject: Dealing with strings with NULL characters in the middle The ASCII character is spelled »NUL«. |
killet@killetsoft.de: Nov 27 11:05PM -0800 Here is a direct link to download a GeoDLL test version: http://www.killetsoft.de/zip/geodll.zip |
BV BV <bv8bv8bv8@gmail.com>: Nov 27 08:33PM -0800 Why is Smiling a Donation? (And smiling to your brother is donation). This is what the greatest Prophet (All Prayers and Peace of Allah be upon him) said and this is what the latest researches are discovering, so let's read .... Researchers have studied about smiling influence on others. They have found that smiling contains strong information that can influence the human subconscious mind! They found that everyone has his particular smile that no one can share with him. Moreover, every smile contains special effect, too. They photographed these smiles and showed it slowly, hence, they noticed some specific movements. Likewise, a person can have more than one kind of smiles, regarding his mental status, what is he speaking about and the person he is speaking to... Some of the most important information of such researches, researches are talking about what you can give to others through the smile, because it is more than giving a material thing for the following reasons: When smiling you can transmit joy to others, which is a sort of donation and which can be the most important. Studies showed that sometimes man may need joy and gladness more than food and drink. Also, that joy can treat many diseases starting by heart problems. Through the smile you can transmit information to others very easily, because a word with a smile has more influence on the brain. Magnetic resonance imaging has shown that expression influence changes too much with a smile. The expression is the same , however, the influenced brain parts differ according to smile type accompanying this information or this expression. You can calm an atmosphere stain of a given situation with a soft smile. This cannot be done with money. Hence, smile is worthier and more important than money. So, the less you can give to others is smile donation. Smile and recovery: Many doctors have noticed smile influence on recovery. Therefore, some researches declare that the doctor's smile is a part of the treatment! Then, giving a smile to your friend, your wife or your neighbor, you are giving them a free remedy prescription without feeling, and this is a kind of donation. For these reasons and others, smile is considered as a sort of donation, giving and generosity. And now dear reader, do you realize why did the prophet of compassion (All Prayers and Peace of Allah be upon him) say: (and smiling to your brother is donation)!! -------------------- By: Abduldaem Al-Kaheel www.kaheel7.com/eng http://www.kaheel7.com/eng/index.php/legislative-miracles/193-why-is-smiling-a-donation- Source: · Smile -- And The World Can Hear You, Even If You Hide, www.sciencedaily.com, Jan. 16, 2008. Thank you |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
comp.programming.threads@googlegroups.com | Google Groups | ![]() |
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.programming.threads+unsubscribe@googlegroups.com. |
Ramine <ramine@1.1>: Nov 27 02:48PM -0800 Hello, New research lights the way to super-fast computers Read more here: http://www.sciencedaily.com/releases/2014/11/141107091447.htm Thank you, Amine Moulay Ramdane. |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.programming.threads+unsubscribe@googlegroups.com. |
comp.lang.c++@googlegroups.com | Google Groups | ![]() |
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
Ben Bacarisse <ben.usenet@bsb.me.uk>: Nov 27 11:10PM Chicken Mcnuggets <chicken@mcnuggets.com> writes: <snip> > unknown location(0): fatal error in "SCGITest": std::out_of_range: > vector::_M_range_check: __n (which is 49) >= this->size() (which is > 15) The code increments an iterator in some specific cases. The for loop then *always* increments it. Are you certain that the condition that ends the loop (it != raw_scgi_netstring.end()) is going to fire and not be "skipped"? BTW, the code looks to be making heavy work of parsing out the parts of string. The std::string class has lots of member function that can help with this sort of task. <snip> -- Ben. |
Barry Schwarz <schwarzb@dqel.com>: Nov 27 02:55PM -0800 On Thu, 27 Nov 2014 09:38:16 -0800 (PST), elizuniga573@gmail.com wrote: >Yeah you are right , but the id is not the problem the message is >"instantiated from here" where i declared my priority queue. This is a completely different message than my system generates. >The question is how can a create a priority queue of a class because it seems what i do doesnt work. That is most likely not the question. The more probable question is how to define the class properly so a priority queue can be implemented. You need to provide the complete error message and identify the line of code the compiler is referring to. Go back and look at the hint I gave you in my last message. -- Remove del for email |
Nobody <nobody@nowhere.invalid>: Nov 19 09:52AM On Sun, 16 Nov 2014 14:34:18 -0800, Öö Tiib wrote: > You can't. There can be 'istream' whose size is not constant. For example > it can be some fifo or pipe that other application is writing into from > other side. It could even be a regular file which some other application is writing into. In that case, it will have a defined size at any moment in time, but that doesn't mean that you'll be able to read it all before the size changes. |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
comp.lang.c++@googlegroups.com | Google Groups | ![]() |
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
Chicken Mcnuggets <chicken@mcnuggets.com>: Nov 27 10:36PM On 25/11/14 20:01, Christopher Pisz wrote: > You'd probably want a class structure for the entire response and some > map of name and values inside. I don't know anything about the scgi > protocol though. I've been playing around with this a little bit this evening and can't get it to work correctly. This is my code so far (I've put it up on ideone.com because it wraps in a nasty way when posted here directly): http://ideone.com/TgynzG Unfortunately it throws an out of range exception. This is the actual error: unknown location(0): fatal error in "SCGITest": std::out_of_range: vector::_M_range_check: __n (which is 49) >= this->size() (which is 15) and I'm stumped. I'm also pretty sure my code is incorrect but haven't found the right method to parse a std::vector<char> for the correct values yet. Anyone got any suggestions? Using iterators and containers seem to be a bit of a pain at the moment. As far as I can tell this should be fine since I'm using an iterator which should stop at the end of the vector but it seems that is not the case. |
Chicken Mcnuggets <chicken@mcnuggets.com>: Nov 27 10:39PM On 27/11/14 22:36, Chicken Mcnuggets wrote: > bit of a pain at the moment. As far as I can tell this should be fine > since I'm using an iterator which should stop at the end of the vector > but it seems that is not the case. Doh forgot to add this is my code for initialising the vector: const char *c_netstring = "13:SCGI\01\0,Test"; const int string_length = 15; std::vector<char> netstring {}; for(int i = 0; i < string_length; ++i) { netstring.push_back(c_netstring[i]); } |
elizuniga573@gmail.com: Nov 27 09:08AM -0800 Hi, i have a problem with my priority queue i am trying to create a priority queue of a class called duty with three elements but it produces an error. the sentence is : the .h file is /////////////////////////////////////////////////////////////////////////// #ifndef DUTY_H #define DUTY_H class duty { public: duty(); virtual ~duty(); double costo_reducido; double costo_real; unsigned id; bool operator ==( const duty &d2) ; bool operator <( const duty &d2) ; bool operator >( const duty &d2) ; }; Digest for comp.programming.threads@googlegroups.com - 2 updates in 2 topics
Wednesday, November 26, 2014Digest for comp.lang.c++@googlegroups.com - 17 updates in 4 topics
Subscribe to:
Posts (Atom)
Blog Archive
About Me |