Saturday, January 31, 2015

Digest for comp.lang.c++@googlegroups.com - 1 update in 1 topic

Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Jan 31 10:14PM

On Sat, 31 Jan 2015 14:34:18 -0500
DSF <notavalid@address.here> wrote:
[snip]
> is removing "virtual" from two of the template functions (the dtor and
> Sort) when I read that virtuals in a template are a "no-no." (Putting
> them back to virtual made no difference.)
 
I have no idea what is wrong with the way you have organised the rest of
your code (probably your build scripts do not properly recompile
files which include altered files), but you seem to have misunderstood
this last point, because a destructor cannot be a function template to
begin with. There is nothing wrong with a template class having a
virtual function, including a virtual destructor. What you cannot have
is a function template in a class (templated or untemplated) which is
virtual. You seem to misunderstand the difference between a
non-static function of a template class, which can be virtual, and a
function template, which cannot.
 
Chris
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.

Digest for comp.lang.c++@googlegroups.com - 25 updates in 7 topics

DSF <notavalid@address.here>: Jan 31 02:34PM -0500

Hello!
 
I know I'm not giving much information here, but posting all of the
code is impractical. I am hoping someone knows the general conditions
that might make the following happen.
 
I have a class called "CopyDirectory". Within it is a template
container "FAList" that holds a list of the class "HashIndex".
 
CopyDirectory.h:
 
class HashIndex
{...};
 
class CopyDirectory
{
yadda, yadda, yadda,
 
FAList<HashIndex> hindex;
};
 
FAList has 30+ functions. CopyDirectory uses about seven of them.
 
When compiling the entire project, I get the following linker
errors:
 
Error: Error: Unresolved external 'FAList<HashIndex>::Find(const
HashIndex&) const' referenced from module copydirectory.cpp
 
Error: Error: Unresolved external 'FAList<HashIndex>::Add(const
HashIndex&)' referenced from module copydirectory.cpp
 
Error: Error: Unresolved external 'FAList<HashIndex>::XlateCI()'
referenced from module copydirectory.cpp
 
Error: Error: Unresolved external 'FAList<HashIndex>::GetItem(int)'
referenced from module copydirectory.cpp
 
 
Note that GetItem is not called by CopyDirectory and XlateCI is a
private function of the template. As noted, CopyDirectory uses more
of the template's functions than Add and Find. The map file shows the
other template functions used by HashIndex but, as expected, does not
show Add or Find.
 
This project used to compile with no errors. The only change I made
is removing "virtual" from two of the template functions (the dtor and
Sort) when I read that virtuals in a template are a "no-no." (Putting
them back to virtual made no difference.)
 
I know this is not much to go on, but I'm hoping it's the result of
a commonly known error or that someone can offer tests to find out
what is wrong.
 
Thanks,
DSF
"'Later' is the beginning of what's not to be."
D.S. Fiscus
Geoff <geoff@invalid.invalid>: Jan 31 12:07PM -0800

On Sat, 31 Jan 2015 14:34:18 -0500, DSF <notavalid@address.here>
wrote:
 
>is removing "virtual" from two of the template functions (the dtor and
>Sort) when I read that virtuals in a template are a "no-no." (Putting
>them back to virtual made no difference.)
 
If undoing the changes makes no difference it means you didn't
"recompile the entire project", which means you didn't clean
everything before the recompilation and re-link.
Ian Collins <ian-news@hotmail.com>: Feb 01 09:50AM +1300

DSF wrote:
> errors:
 
> Error: Error: Unresolved external 'FAList<HashIndex>::Find(const
> HashIndex&) const' referenced from module copydirectory.cpp
 
Are the member functions of FAList defined inline, or in a separate
file? If the latter, the file will probably have to be included in each
compilation unit that uses FAList.
 
--
Ian Collins
Rosario193 <Rosario@invalid.invalid>: Jan 31 09:09AM +0100

On Fri, 30 Jan 2015 19:54:24 +0100, Rosario193 wrote:
 
better 2 functions...
nice execise exendible to biger numbers
possible there are errors...
 
#include <stdio.h>
#include <string.h>
#include <limits.h>
 
#define u8 unsigned char
#define u32 unsigned
#define i32 int
#define P printf
#define F for
#define R return
 
// convert u32 "argnumber" to
// u8 array of digits "rstr" in base "base" little endian form
// result ok if return one number > 0
// that is the len of the array "rstr" that contain "argnumber"
i32 u32ToA(u8* rstr, u32 rstrsize, u32 argnum, u32 base)
{u32 i, j, k;

if(rstr==0) R -1;
if(rstrsize>0xFFFFFFF|| rstrsize<2)
R -1;
rstr[0]=0;
if(base<=1 || base>256) R -1;
if(argnum==0){rstr[1]=0; R 1;}
 
F(i=0; argnum!=0 && i<rstrsize; ++i)
{rstr[i]=argnum%base; argnum/=base;}
if(i==rstrsize) R -1;
rstr[i]=0; /* the last 0 is not in the number digits */
R i;
}
 
i32 NumStrToDisplayStr(u8* rstr, u32 len)
{static u8 str[64]="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
u32 tmp, i, j, a, b;

if(rstr==0) R -1;
if(len>0xFFFFFFF||len<1)
R -1;
F(i=0, j=len-1; i<j; ++i, --j)
{a=rstr[i]; b=rstr[j]; // we are not arabs so swap
if(a>35||b>35) R -1;
rstr[i]=str[b]; rstr[j]=str[a];
}
if(i==j) {a=rstr[i];
if(a>35) R -1;
rstr[i]=str[a];
}
R len;
}
 
int main(void)
{u32 m=0x12f5e188, i, x, base;
i32 r;
u8 result[128]; // 0..126 127[0]

if(CHAR_BIT!=8 || sizeof(u32)!=4)
{P("this can not to run here\n"); R 0;}
 
F(base=0; base<=257; ++base)
{r=u32ToA(result, 128, m, base);
P("base=%u r=%u ", base, r);
if(r>0)
{if(base<=36)
{if(NumStrToDisplayStr(result, (u32) r)==-1) R 0;}
F(i=0; i<(u32)r; ++i)
{if(base<=36) P("%c", result[i]);
else {x=result[i];
P("%u", x);
}
if(base>36 && i!=(u32)r-1) P("_");
}
}
if(base!=0 && base%3==0) P("\n");
else P("#");
if(base>=2 && base<=36 && strlen(result)!=(u32)r)
P("Find Error base=%u", base);
}
P("\n");
R 0;
}
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 31 08:09AM

On Fri, 2015-01-30, Christopher Pisz wrote:
> On 1/30/2015 4:04 AM, Rosario193 wrote:
>> On Thu, 29 Jan 2015 10:06:05 -0600, Christopher Pisz wrote:
>>> On 1/29/2015 1:51 AM, Rosario193 wrote:
...
>>>> unsigned i, aa;
 
>>>> aa=a;
>>>> for( i=sizeof(int)-1; ; --i )
...
 
> listing. employeePay = twoWeekSalary is immediately obvious. You are
> writing C++ (supposedly) code for humans to read. You are not working in
> matlab.
 
Well, I think it's ok with short, meaningless names if the scope is
small and the code is otherwise clear ... but I suspect
intToHexChar(int) above would not be helped by better naming alone.
 
/Jorgen
 
PS I haven't followed this thread, so I don't understand what's wrong
with a std::sprintf(), wrapped with a std::string. Or any of the
other obvious solutions which don't require duplicating that logic
manually.
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Rosario193 <Rosario@invalid.invalid>: Jan 31 09:13AM +0100

On Sat, 31 Jan 2015 09:09:09 +0100, Rosario193
 
>i32 NumStrToDisplayStr(u8* rstr, u32 len)
>{static u8 str[64]="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
if someone use static array in a function... Is that function not
multithread? is it possible something goes wrong if 2 cpu
read in the same time the same position of mem?
 
Geoff <geoff@invalid.invalid>: Jan 31 06:51AM -0800

On Sat, 31 Jan 2015 09:09:09 +0100, Rosario193
 
>possible there are errors...
 
Does the fact you are posting erroneous code, fixing it, fixing the
fixes and refactoring the fixed fixes not tell you there is something
wrong with your method and style?
Rosario193 <Rosario@invalid.invalid>: Jan 31 04:50PM +0100

On Sat, 31 Jan 2015 06:51:50 -0800, Geoff wrote:
 
 
>Does the fact you are posting erroneous code, fixing it, fixing the
>fixes and refactoring the fixed fixes not tell you there is something
>wrong with your method and style?
 
yes it is a little difficult write error free code...
expecially in numeric algos...
Rosario193 <Rosario@invalid.invalid>: Jan 31 04:53PM +0100

On Sat, 31 Jan 2015 06:51:50 -0800, Geoff <geoff@invalid.invalid>
wrote:
 
 
>Does the fact you are posting erroneous code, fixing it, fixing the
>fixes and refactoring the fixed fixes not tell you there is something
>wrong with your method and style?
 
yes why have to write routines in this f... group...
Rosario193 <Rosario@invalid.invalid>: Jan 31 04:56PM +0100

On Wed, 28 Jan 2015 11:30:11 -0800, Geoff wrote:
 
 
>>No, i really need help,I'm new in C ++ and I can not easily handle its concepts.
 
>You also seem to have trouble with the concept of how to reply to
>other people on Usenet. DO NOT REPLY TO YOUR OWN POSTS.
 
the comunication is 1 to many so post and its reaply can be from the
same person
Rosario193 <Rosario@invalid.invalid>: Jan 31 05:46PM +0100

On Sat, 31 Jan 2015 16:53:43 +0100, Rosario193
>>fixes and refactoring the fixed fixes not tell you there is something
>>wrong with your method and style?
 
>yes why have to write routines in this f... group...
 
yes why have I to write routines in this f... group???
Geoff <geoff@invalid.invalid>: Jan 31 09:32AM -0800

On Sat, 31 Jan 2015 17:46:02 +0100, Rosario193
>>>wrong with your method and style?
 
>>yes why have to write routines in this f... group...
 
>yes why have I to write routines in this f... group???
 
Yes, indeed.
Geoff <geoff@invalid.invalid>: Jan 31 09:50AM -0800

On Sat, 31 Jan 2015 16:56:40 +0100, Rosario193
 
>the comunication is 1 to many so post and its reaply can be from the
>same person
 
When you are replying to a specific person, it is logical, proper and
courteous to reply to that post, not to your own post from an earlier
time.
Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo>: Jan 31 01:19AM -0500


> I'd love to see a C++ group playing with Beaglebone Blacks, doing blog-posts on these things... and a vibrant community...
 
> Because: just being able to get a light to blink with some C-code is far away from organizing an industrial or embedded project. I'm sure that leveraging C++, one can really do some great things in this area.
> PS: the whole internet-of-things theme is also interesting in this respect. I want to run C++ code in gadgets and not use crazy stuff like javascript (https://tessel.io/).
 
I see. There is nothing much I am aware of but there is something. Take a look
at https://www.youtube.com/watch?v=fj_d9NUiL-o and http://arduino.cc, in
particular http://arduino.cc/en/Reference/Libraries for the C++ libraries they
provide. This might get you in contact with the people who also thinks C++ might
be useful at machine control/industrial automation/robotics.
 
Two words of caution though:
 
1. It is not accidental that the most of machine control applications are
written in languages you call "crazy" (you mentioned JavaScript but there are
lots of others, in particular at some point in the past Forth was very popular,
LISP was used a lot, too. IMHO the common feature of these languages is the
virtual machine capable of compiling and executing code in target environment.
The ability to create such an environment cheaply (a typical full-fledged Forth
target-side environment was well under 10KB of code and LISP environments were
not much fatter) was apparently a critical requirement. Obviously nowadays more
more computational resources are available on the embedded side but functionally
this requirement is still there. Especially robotics and AI applications can win
tremendously from the code's being generated or sent to the environment, and
then being compiled and optimized "on the fly". Unfortunately, C++ might be the
least suitable language for even simply dynamic loading of compiled code to the
working application, let alone on-target compilation.
 
2. From my experience, early introduction of framework is a very common design
mistake. A good framework can IMHO only be developed by summarizing real
experience from multiple applications. Essentially, only after writing many
"essentially same" pieces of code *and putting them to production, after all
fixes that often change lots of models* you will find reasonable abstractions to
reuse. Still any new occasion might require lots of re-doing (in the
abstractions). An attempt to use a freshly-baked framework for a seemingly
pliant task is often a waste. Useful abstractions get crystallized gradually. In
some way a framework can be naturally seen as a set of constraints and rules and
hopefully we can agree that it is harmful to start constraining designs early
before building enough use cases (in our case, applications) that prove that the
rules/constraints would be indeed reasonable. It is like coming to a foreign
country and starting writing laws for its inhabitants without living among them
for a long time.
 
Long story short, my advice would be to develop your 1st, 2nd and maybe 3rd
*non-trivial* (this is important) application right on top of the API provided
by your platform of choice, then study the resulting code for similarities. If
the results are not crying for the framework, postpone the framework and get
back to it after developing / studying few more non-trivial applications.
 
-Pavel
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 31 08:22AM

On Fri, 2015-01-30, Scott Lurndal wrote:
>>that appear at the same conferences. (Scott Meyers, Herb Sutter, ...)
 
> I wonder if these guys, who write about C++, have actually written
> real-world production applications in C++?
 
Don't know about the others, but Stroustrup shows clear signs of
having been in the trenches (see e.g. the last few chapters in
TC++PL 3rd ed). When he had time for that, I don't know.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 31 08:39AM

On Sat, 2015-01-31, Pavel wrote:
...
> Two words of caution though:
 
[...]
 
> resulting code for similarities. If the results are not crying for the
> framework, postpone the framework and get back to it after developing
> / studying few more non-trivial applications.
 
Quoting it to fix the formatting. I agree wholeheartedly, and you
formulate it well.
 
It took me a decade of programming to see it that way. Sadly, too
many never learn, and start any major project by writing a framework
or abstraction layers which then turn out to be a bad fit for whatever
the application needs to do :-/
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
jononanon@googlemail.com: Jan 31 01:15AM -0800

> (http://www.vollmann.ch/de/presentations/index.html)
 
> Also:
> http://www.artima.com/shop/effective_cpp_in_an_embedded_environment
 
Some additional interesting reading-sources are:
http://arobenko.gitbooks.io/bare_metal_cpp/
 
Real-Time C++ (by Christopher Kormanyos)
http://www.springer.com/computer/communication+networks/book/978-3-642-34687-3
 
This last book seems very interesting. It uses C++11 and the author, Kormanyos, has also contributed to Boost.
"Öö Tiib" <ootiib@hot.ee>: Jan 31 09:08AM -0800

On Saturday, 31 January 2015 10:40:05 UTC+2, Jorgen Grahn wrote:
> many never learn, and start any major project by writing a framework
> or abstraction layers which then turn out to be a bad fit for whatever
> the application needs to do :-/
 
Framework is good selling argument. At least it is good argument for
incompetent ears (and usually we sell to incompetent ears). It sounds
easy to extend and to reuse and so it sounds like good investment.
Therefore we should always mention making or extending frameworks in
visionary discussions. However in real work we should ignore it, if
later asked for then we can extract some "framework" out from existing
product.
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jan 30 11:39PM

On 30/01/2015 19:00, Lynn McGuire wrote:
> take hold with Sutter behind it.
> http://isocpp.org/blog/2014/01/n3888
 
> Now C++ needs a standard user interface library.
 
No C++ does not need a standard user interface library; other languages
have tried and failed to achieve that.
 
/Flibble
Christopher Pisz <nospam@notanaddress.com>: Jan 30 05:44PM -0600

On 1/30/2015 5:39 PM, Mr Flibble wrote:
 
> No C++ does not need a standard user interface library; other languages
> have tried and failed to achieve that.
 
> /Flibble
 
.NET failed with WPF?
"Öö Tiib" <ootiib@hot.ee>: Jan 31 07:14AM -0800

On Saturday, 31 January 2015 01:39:44 UTC+2, Mr Flibble wrote:
 
> > Now C++ needs a standard user interface library.
 
> No C++ does not need a standard user interface library; other languages
> have tried and failed to achieve that.
 
That is attitude that results with various third party commercial
crap like that Flash (proprietary ECMAScript) or that Unity (also
ECMAScript and Mono) to be successful. Everybody knows how C++ is
more efficient and everybody knows how pad or phone becomes hot in
your hands when such Flash or Unity is running there.
Christian Gollwitzer <auriocus@gmx.de>: Jan 31 09:27AM +0100

Am 30.01.15 um 19:23 schrieb Paul Rubin:
 
> That is a safe and simple approach, but it works by copying data all
> over the place instead of passing pointers, resulting in performance
> loss.
 
This "performance loss" is partly a myth. Consider the following code,
assuming it is compiled using a recent (C++11) compiler
 
====================
#include <vector>
 
std::vector<double> compute() {
const size_t N=100000;
std::vector<double> result(N);
for (size_t i=0; i<N; i++) {
result[i]=2*i;
}
return result;
}
 
int main() {
auto s = compute();
// print it or whatever
return 0;
}
 
=========================
 
 
At first, it may seem that this code copies the big vector twice: Once
into a temporary return value, once into the automatic variable s. This
is not the case, once for the move constructors in C++11 and second for
return value optimization, some years already in the compilers. Instead,
the vector is constructed directly into the place where the main
functinos expects it to be.
 
Christian
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jan 30 11:42PM

>> Minimum = 20ms, Maximum = 21ms, Average = 20ms
 
>> Lynn
 
> I can ping wnd.com and twitter.com.
 
wnd.com Brian? Really? Worse than Fox News mate; even I know this and I
don't live in America. It might help if you get over this "God" delusion.
 
/Flibble
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 31 07:53AM

On Fri, 2015-01-30, Lynn McGuire wrote:
> On 1/30/2015 10:29 AM, Scott Lurndal wrote:
>> Victor Bazarov <v.bazarov@comcast.invalid> writes:
...
 
> C:\dii>ping google.com
 
> Pinging google.com [64.233.168.101] with 32 bytes of data:
> Reply from 64.233.168.101: bytes=32 time=21ms TTL=42
 
Not to mention there's a whole bunch of ICMP messages apart from Echo
Request (ping). Some of them are vital if you want IPv4 to work
properly, so I don't think anyone blocks the whole ICMP protocol.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
ram@zedat.fu-berlin.de (Stefan Ram): Jan 31 04:38AM

>.NET failed with WPF?
 
Java failed with AWT, so they replaced it by Swing.
Now, Swing also has failed. It had to be replaced by JavaFX.
 
IIRC, WPF replaces WinForms, so WinForms also had failed.
 
It is possible, that WPF and JavaFX will be replaced by
something else in 5 - 10 years from now, as the history
given above shows that GUI libraries tend to fail in
Java-like languages and have to be replaced.
 
GUI libraries for Java-like languages - a history of failure.
 
However, a GUI library is different from a »Drawing Library«.
 
C++ does not even have means to access directories of the
file system or sockets via its standard library, which might
be deemed more important than a drawing library by some.
Also, a standard GUI interface would be helpful, which would
include means to draw.
 
»Drawing« is just outputting, while a GUI library also would
read input from a user.
 
We can draw with ASCII-Art for now, or output something like
SVG or png.
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.

Digest for comp.programming.threads@googlegroups.com - 4 updates in 4 topics

Ramine <ramine@1.1>: Jan 30 05:22PM -0800

Hello,
 
 
If you want to learn easily about what is Deep Learning in artificiel
intelligence , please read the following book , i have just
read it and it is a good book:
 
Read it from here:
 
http://neuralnetworksanddeeplearning.com/index.html
 
 
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Jan 30 05:15PM -0800

I correct some typos , please read again...
 
Hello,
 
 
 
 
I want to clear something about my Distributed sequential lock
algorithm, you can download it and read about it here:
 
https://sites.google.com/site/aminer68/scalable-distributed-sequential-lock
 
 
If you read carefully the source code you will notice that
i am using this: "myid3:=FCount6^.fcount6;" inside the RLock()
method in the reader side, so when my algorithm switches
from a Seqlock mode to a Distributed lock mode, the
"myid3:=FCount6^.fcount6;" will be "serialized" when the
writer side increment FCount6^.fcount6, so in the writer side i am
calling the distributed reader-writer lock when the algorithm switches
to a Distributed mode, so if you have noticed since the
"myid3:=FCount6^.fcount6;" is serialized in the reader side
when "FCount6^.fcount6" is incremented in the writer side,
so this will look like a probabilistic mechanism cause
the reader side is serializing the the transfer of FCount6^.fcount6
on the bus, and the writer side is serializing the transfer of
a variable in the bus also when it is calling the WLock() of the
distributed lock, so this is a kind of a probabilistic mechanism
cause this can generate contention and the reader side can call
RLock() on a distributed lock's reader-writer mutex that is entered
before the reader by the writer, but even though it is a probabilistic
mechanism, this probabilistic mechanism will give a good result and it
eliminates the "livelock" situation of the Seqlock when
there is more writers.
 
 
 
 
Thank you for your time.
 
 
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Jan 30 04:21PM -0800

Hello,
 
 
I want to clear something about my Distributed sequential lock
algorithm, you can download it and read about it here:
 
https://sites.google.com/site/aminer68/scalable-distributed-sequential-lock
 
 
If you read carefully the source code you will noticed that
i am using this: "myid3:=FCount6^.fcount6;" inside the RLock()
method in the reader side, so when my algorithms switches
from a Seqlock mode to a Distributed lock mode, the
"myid3:=FCount6^.fcount6;" will be "serialized" when the
writer side increment FCount6^.fcount6, so in the writer side i am
calling the distributed reader-writer lock when the algorithm swithes
to a Distributed mode, so if you have noticed since the
"myid3:=FCount6^.fcount6;" is serialized in the reader side
when "FCount6^.fcount6" is incremented in the writer side,
so this will look like a probalistic mechanism cause
the reader side is serializing the the transfer of FCount6^.fcount6
on the bus, and the writer side is serializing the transfer of
a variable in the bus also when it is calling the WLock() of the
distributed lock, so this is a kind of a probalistic mechanism
cause this can generate contention and the reader side can call
RLock() on a distributed lock's reader-writer mutex that is entered
before the reader by the writer, but even though it is a probalistic
mechanism, this probabilistic mechanism will give a good result and it
eliminates the "livelock" situation of the Seqlock when
there is more writers.
 
 
 
 
Thank you for your time.
 
 
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Jan 30 03:48PM -0800

Hello,
 
 
I was thinking about my next projects and algorithms...
 
 
And here is what i am thinking to implement:
 
As you have noticed i have implemented my Parallel archiver,
you can download it and read about it here:
 
https://sites.google.com/site/aminer68/parallel-archiver
 
 
I was thinking more and more and i think my Parallel archiver can
be used as a base to implement a parallel file system and parallel
database system...
 
How my Parallel archiver can be used to imoplement a parallel file system ?
 
 
Look at my parallel archiver i am storing the paths's names of my files
inside the Parallel archiver's archive, and this is useful cause
i can use AVL trees and use my Parallel archiver to implement a
parallel file system, for example if i have two paths's names such
as "/amine/products/cpu" and "/amine/products/motherboards",
i can split the paths and store the directory called "amine"
inside an in-memory AVL tree, and i can store the second directory
called "products" inside the parent's "amine" AVL tree, and i can store
the "cpu" and "motherboards" directories inside the parent's "products"
AVL tree, this way it will be easy to implement a parallel file system
and the files of the file system will be stored inside the hardisk
archiver and it will be access in O(1) time complexity and the
directories's names and the files's names will be stored inside the
in-memory AVL trees and they will be accessed in log(n) time
complexity, and of course i will use my Distributed sequential lock in
each AVL tree etc. this is my new idea to implement a file system
using my Parallel archiver. I can extend this idea of a parallel file
system using my Parallel archiver to implement also a parallel database
system, all i have to do is implement indexed tables and
and there more complex operations and this is easy to do, i have
just to store for example the files inside the "cpu" directory that
contains the index that is "cpu frequency" inside
another AVL tree so that you can use an SQL statement to query the index
that is "cpu frequency", the tables's names that will be indexed will be
stored for example inside a hashtable so that it will be accessed very
fast, and this is how i will implement a database system using my
Parallel archiver and by extending the idea of implementing a parallel
file system using my Parallel archiver, and of course the database
system will be a parallel database system using my Distributed
sequentiel lock in each AVL trees etc.
 
Finally as you have noticed this is my new ideas of my next
projects that i will implement if i have more time to do
it.
 
 
 
Thank you for your time.
 
 
 
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.

Friday, January 30, 2015

Digest for comp.lang.c++@googlegroups.com - 1 update in 1 topic

"Öö Tiib" <ootiib@hot.ee>: Jan 30 12:51PM -0800

On Friday, 30 January 2015 19:02:41 UTC+2, Wouter van Ooijen wrote:
> carefully to what the full-time coders ask, so they are worth reading
> and listening to.
 
> And me? I am a teacher...
 
Scott was joking. It is clearly different focus to spread knowledge and
to help others to gain skills to learn and to think ... or to apply that
knowledge and skills in practice. We engineers should cooperate with
teachers more tightly perhaps ... instead of joking.
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.

Digest for comp.lang.c++@googlegroups.com - 25 updates in 7 topics

Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo>: Jan 29 10:59PM -0500


>> What is your goal for asking these questions?
 
> Teasing you.
 
> No, but seriously: I'm simply asking about good techniques. Recommend to me a book, framework, methodology, technique, ...
you might get more useful answers if you describe your particular target
platform and what it provides in terms of OS, programming interfaces,
C++ implementations, hardware capabilities, drivers for the devices of
your interest and the of industrial automation app you are trying to create.
jononanon@googlemail.com: Jan 29 11:51PM -0800

On Friday, January 30, 2015 at 4:59:52 AM UTC+1, Pavel wrote:
> platform and what it provides in terms of OS, programming interfaces,
> C++ implementations, hardware capabilities, drivers for the devices of
> your interest and the of industrial automation app you are trying to create.
 
Basically I'm thinking of applications that can leverage a lot of C++'s powers.
 
Things like a generic framework, for controlling automatic vacuum cleaners and similar robots. But it should be so well-designed generic that I can easily transfer it to a small off-road vehicle.
 
Or (probably simpler) a cocktail machine, where I can design input-recipes in a text-based from; and load them via the webserver-interface.
 
Or a framework for automatic modern washing machines. It should work with different hardware-types, have a nice user interface, allow the loading of washing-steps in a text-based form (that you load over the machine's webserver).
 
Or a Drone project.
 
Or a Mars Rover. (except that I do NOT have the requirement that it must work on Mars!). Yes I think that's a good example.
A generic Rover framework. One that is good enough that I can adapt it to become e.g. an automatic lawn-mower.
 
Stuff like that...
 
Basically I'm looking for the C++ book, that you'd recommend the junior C++ team-members of a Mars-Rover team should read...
... with the aim of doing really great software-architecture work and creating a superb and easily-maintainable system.
 
Basically the book that a world-class C++ programmer might write, after dedicatedly playing with a Beaglebone Black for a year, and focusing strongly on hardware-related themes such as timers, concurrency, states, safety-concept, maintainability, hardware-extensibility, ... and also including ways of tackling low-level requirements such as : recurring tasks, messaging, and message-passing, signals, callbacks,
and handling it with nice patterns.
 
I've just realized... such a book does not exist yet.
 
I guess I'm finished and will just wait and see what happens in the future...
 
 
I'd love to see a C++ group playing with Beaglebone Blacks, doing blog-posts on these things... and a vibrant community...
 
Because: just being able to get a light to blink with some C-code is far away from organizing an industrial or embedded project. I'm sure that leveraging C++, one can really do some great things in this area.
PS: the whole internet-of-things theme is also interesting in this respect. I want to run C++ code in gadgets and not use crazy stuff like javascript (https://tessel.io/).
David Brown <david.brown@hesbynett.no>: Jan 30 09:06AM +0100

> Rover framework. One that is good enough that I can adapt it to
> become e.g. an automatic lawn-mower.
 
> Stuff like that...
 
What you are asking for does not - and /cannot/ - exist. The range is
too great. I have worked on embedded systems with 2 GB ram running
Linux - and systems with 32 bytes of ram (yes, /bytes/ - not KB, MB, or
GB). In a fancy washing machine you will have a powerful board
controlling a touch screen - but you will also have tiny processors
controlling pumps and motors.
 
What you want is like asking for a container that is suitable for the
pencils on your desk, but should be easily adaptable to shipping cars
across the pacific and collecting moon rocks.
Wouter van Ooijen <wouter@voti.nl>: Jan 30 10:52AM +0100

> A generic Rover framework. One that is good enough that I can adapt it to become e.g. an automatic lawn-mower.
 
> Stuff like that...
 
> Basically I'm looking for the C++ book, that you'd recommend the junior C++ team-members of a Mars-Rover team should read...
 
There should be no junior on such a team.
 
> ... with the aim of doing really great software-architecture work and creating a superb and easily-maintainable system.
 
Sorry, there is no silver bullet, and likewise there is no one book that
will teach you how to do a such a very difficult thing the right way.
There are lots of books, talks on youtube, blogs, articles, etc. on this
topic. Read and apply as much as you can, and learn from it. In the long
run your exeperience might help the industry a little step further.
 
> Basically the book that a world-class C++ programmer might write, after dedicatedly playing with a Beaglebone Black for a year, and focusing strongly on hardware-related themes such as timers, concurrency, states, safety-concept, maintainability, hardware-extensibility, ... and also including ways of tackling low-level requirements such as : recurring tasks, messaging, and message-passing, signals, callbacks,
> and handling it with nice patterns.
 
World-class C++ programmers tend to know their limitations and focus on
more limited fields. Start by listening to every youtube talk by
Stroustrup, then broaden you reach by listening to the talks of guys
that appear at the same conferences. (Scott Meyers, Herb Sutter, ...)
 
Wouter van Ooijen
scott@slp53.sl.home (Scott Lurndal): Jan 30 04:23PM

>more limited fields. Start by listening to every youtube talk by
>Stroustrup, then broaden you reach by listening to the talks of guys
>that appear at the same conferences. (Scott Meyers, Herb Sutter, ...)
 
I wonder if these guys, who write about C++, have actually written
real-world production applications in C++?
 
The old (and insulting) expression "Those do can, do, those who can't, teach"
comes to mind :-).
jononanon@googlemail.com: Jan 30 08:55AM -0800

Just found this:
 
http://accu.org/index.php/conferences/accu_conference_2008/accu2008_sessions#C++%20for%20Embedded%20Systems
Slides:
http://accu.org/content/conf2008/Vollmann-embcpp08.pdf
(http://www.vollmann.ch/de/presentations/index.html)
 
Also:
http://www.artima.com/shop/effective_cpp_in_an_embedded_environment
Wouter van Ooijen <wouter@voti.nl>: Jan 30 06:02PM +0100

Scott Lurndal schreef op 30-Jan-15 om 5:23 PM:
> real-world production applications in C++?
 
> The old (and insulting) expression "Those do can, do, those who can't, teach"
> comes to mind :-).
 
That obviously bait, but there is a lot of (unavoidable) truth in it:
those who are full-time coders don't have time to spare to be good
speakers or authors, and vice versa.
 
But Strustroup and Meyers are good communicators, and they listen very
carefully to what the full-time coders ask, so they are worth reading
and listening to.
 
And me? I am a teacher...
Wouter
woodbrian77@gmail.com: Jan 30 11:49AM -0800

On Friday, January 30, 2015 at 11:02:41 AM UTC-6, Wouter van Ooijen wrote:
 
> But Strustroup and Meyers are good communicators, and they listen very
> carefully to what the full-time coders ask, so they are worth reading
> and listening to.
 
I'd add Andrei Alexandrescu to the list. I get a kick
out of him and Scott Meyers. Chandler Carruth is
knowledgeable and funny also.
 
 
 
> And me? I am a teacher...
 
Thank G-d for teachers. I owe a great debt to
my teachers.
 
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
scott@slp53.sl.home (Scott Lurndal): Jan 30 04:29PM

>> 13 packets transmitted, 0 packets received, 100.0% packet loss
>> ~ $
 
>> How sad is all this.
 
."
 
>A web server doesn't necessarily answer to control messages ("pings"),
>as you may already know. But the content is there.
 
In fact, ICMP packets are almost universally blocked at the
edge ingress gateway, for very good reasons. The yahoo servers
are a notable exception.
Lynn McGuire <lmc@winsim.com>: Jan 30 12:53PM -0600

On 1/30/2015 10:29 AM, Scott Lurndal wrote:
 
> In fact, ICMP packets are almost universally blocked at the
> edge ingress gateway, for very good reasons. The yahoo servers
> are a notable exception.
 
C:\dii>ping google.com
 
Pinging google.com [64.233.168.101] with 32 bytes of data:
Reply from 64.233.168.101: bytes=32 time=21ms TTL=42
Reply from 64.233.168.101: bytes=32 time=20ms TTL=42
Reply from 64.233.168.101: bytes=32 time=20ms TTL=42
Reply from 64.233.168.101: bytes=32 time=20ms TTL=42
 
Ping statistics for 64.233.168.101:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 20ms, Maximum = 21ms, Average = 20ms
 
Lynn
woodbrian77@gmail.com: Jan 30 11:15AM -0800

On Friday, January 30, 2015 at 12:53:32 PM UTC-6, Lynn McGuire wrote:
> Approximate round trip times in milli-seconds:
> Minimum = 20ms, Maximum = 21ms, Average = 20ms
 
> Lynn
 
 
I can ping wnd.com and twitter.com.
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
Rosario193 <Rosario@invalid.invalid>: Jan 30 11:04AM +0100

On Thu, 29 Jan 2015 10:06:05 -0600, Christopher Pisz wrote:
>> for( i=sizeof(int)-1; ; --i )
>You win the ugly code of the week award.
 
>What's wrong with #include <cstdio> ?
 
i have one old C++ compiler that allow that
 
>Defining your own types as primitive types accomplishes what? One more
>search someone has to do when looking at your code.
 
here there is not "stdint.h" where would it be uint32_t
 
>Naming all variables with a single or double letter rather than a
>meaningful name.
 
not for the words one always use
 
>(void) parameters instead of (), for what purpose? I thought you were
>trying to save keystrokes.
 
i want sys call "int main(void)"
and not call "int main()"
 
>more than one statement on the same line
 
instruction that are connected, i sometime write in the same line
 
>Statements sometimes on same line with brackets, sometimes not,
>sometimes no brackets at all. At least be consistent with ugly style.
 
they call it readability...
Rosario193 <Rosario@invalid.invalid>: Jan 30 11:05AM +0100

On Thu, 29 Jan 2015 14:48:02 +0100, jak wrote:
> Res = LT[Byte % Base] + Res;
> return Res;
>}
 
#include <stdio.h>
#include <string.h>
#include <limits.h>
 
#define u8 unsigned char
#define u32 unsigned
#define i32 int
#define P printf
#define F for
#define R return
 
 
// result ok if return one number > 0
// that is the len of the string result even if there is some 0 in it
i32 uToA(u8* rstr, u32 rstrsize, u32 argnumber, u32 base)
{u32 i, j, k;
u8 tmp[64];
u8 str[64]="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
if(rstr==0) R -1;
if(rstrsize > 0xFFFFFFF) R -1;
rstr[0]=0;
if(base<=1 || base>255) R -1;
 
F( i=0, tmp[0]=0; argnumber; ++i)
{tmp[i]=argnumber%base; argnumber/=base;}
if(i+2>rstrsize) R -2;
if(i!=0) --i;
if(base<=36)
{F(k=0, j=i; ;--j, ++k)
{rstr[k]=str[tmp[j]];
if(j==0) break;
}
}
else {F(k=0, j=i; ;--j, ++k)
{rstr[k]=tmp[j];
if(j==0) break;
}
}
++k; rstr[k]=0;
R k;
}
 
 
 
int main(void)
{u32 m=0x12f5e188, i, x, base;
i32 r;
u8 result[128]; // 0..126 127[0]
 
F(base=0; base<=256; ++base)
{r=uToA(result, 128, m, base);
P("base=%u r=%u ", base, r);
if(r>0)
{F(i=0; i<(u32)r; ++i)
{if(base<=36) P("%c", result[i]);
else {x=result[i];
P("%x", x);
}
if(base>36 && i!=(u32)r-1) P("_");
}
}
if(base!=0 && base%3==0) P("\n");
else P("#");
if(base>=2 && base<=36 && strlen(result)!=(u32)r)
P("Find Error base=%u", base);
}
P("\n");
R 0;
}
 
base=0 r=4294967295 #base=1 r=4294967295
#base=2 r=29 10010111101011110000110001000
#base=3 r=18 211011120100120120
base=4 r=15 102331132012020
#base=5 r=13 1122413311234#base=6 r=11 51322023240
base=7 r=11 10611560514#base=8 r=10 2275360610#base=9 r=9 734510516
base=10 r=9 318103944#base=11 r=9 15361A224#base=12 r=8 8A647B20
base=13 r=8 50B991B2#base=14 r=8 30367144#base=15 r=8 1CDD8049
base=16 r=8 12F5E188#base=17 r=7 D30B6BC#base=18 r=7 9664A56
base=19 r=7 6E8HB6G#base=20 r=7 4J82JH4#base=21 r=7 3EIDG2I
base=22 r=7 2HFKBC4#base=23 r=7 239GIG6#base=24 r=7 1FMINJ0
base=25 r=7 17E8G7J#base=26 r=7 10K2JP2#base=27 r=6 M4F9FF
base=28 r=6 IDEON4#base=29 r=6 FELQPF#base=30 r=6 D2LIOO
base=31 r=6 B3DQEH#base=32 r=6 9FBOC8#base=33 r=6 847NFF
base=34 r=6 701EEC#base=35 r=6 61YBO4#base=36 r=6 59E2KO
base=37 r=6 4_15_1b_2_9_21#base=38 r=6 4_0_15_7_16_10#base=39 r=6
3_14_13_17_c_f
 
base=40 r=6 3_4_a_e_26_18#base=41 r=6 2_1e_17_13_26_20#base=42 r=6
2_12_9_19_1_1
2
base=43 r=6 2_7_1_29_3_6#base=44 r=6 1_28_26_d_27_4#base=45 r=6
1_20_19_26_10_18
 
base=46 r=6 1_19_2_4_1f_6#base=47 r=6 1_12_8_2a_1c_1#base=48 r=6
1_b_2c_11_2d_18
 
base=49 r=6 1_6_8_29_5_b#base=50 r=6 1_0_2c_29_1c_2c#base=51 r=5
2f_1_2_20_c
base=52 r=5 2b_1a_11_33_1c#base=53 r=5 28_10_24_1d_b#base=54 r=5
25_16_9_7_2a
base=55 r=5 22_29_35_12_4#base=56 r=5 20_13_14_b_20#base=57 r=5
1e_7_27_e_36
base=58 r=5 1c_6_15_c_2c#base=59 r=5 1a_e_32_36_10#base=60 r=5
18_20_2a_c_18
base=61 r=5 16_3b_1b_32_2e#base=62 r=5 15_20_2d_16_30#base=63 r=5
14_c_b_7_3c
base=64 r=5 12_3d_1e_6_8#base=65 r=5 11_35_14_38_36#base=66 r=5
10_32_1e_28_30
base=67 r=5 f_34_2b_42_4#base=68 r=5 e_3b_2e_7_c#base=69 r=5
e_2_16_24_6
base=70 r=5 d_11_1d_c_4#base=71 r=5 c_24_37_18_11#base=72 r=5
b_3c_12_2e_18
base=73 r=5 b_e_33_48_14#base=74 r=5 a_2d_0_29_46#base=75 r=5
a_4_1_3c_45
base=76 r=5 9_28_31_1e_10#base=77 r=5 9_3_3c_10_4#base=78 r=5
8_2e_19_19_36
base=79 r=5 8_d_f_2_10#base=80 r=5 7_3d_17_3b_18#base=81 r=5
7_1f_2e_5_f
base=82 r=5 7_2_4c_3c_20#base=83 r=5 6_3a_1b_34_35#base=84 r=5
6_20_3a_3f_3c
base=85 r=5 6_7_53_13_1d#base=86 r=5 5_46_a_17_6#base=87 r=5
5_30_6_12_f
base=88 r=5 5_1a_45_29_30#base=89 r=5 5_6_14_32_37#base=90 r=5
4_4c_20_8_18
base=91 r=5 4_3a_b_40_43#base=92 r=5 4_28_2f_f_34#base=93 r=5
4_17_2c_19_30
base=94 r=5 4_6_5c_54_30#base=95 r=5 3_56_1_5c_36#base=96 r=5
3_47_34_2e_48
base=97 r=5 3_39_34_2e_a#base=98 r=5 3_2b_60_2_3c#base=99 r=5
3_1e_53_1b_f
base=100 r=5 3_12_a_27_2c#base=101 r=5 3_5_4b_3d_0#base=102 r=5
2_5f_4d_10_c
base=103 r=5 2_55_b_23_53#base=104 r=5 2_4a_52_33_50#base=105 r=5
2_40_52_65_27
base=106 r=5 2_37_9_e_40#base=107 r=5 2_2d_47_2e_6#base=108 r=5
2_24_38_1e_60
base=109 r=5 2_1b_45_12_58#base=110 r=5 2_12_6d_40_4#base=111 r=5
2_a_42_3_21
base=112 r=5 2_2_2f_5_58#base=113 r=5 1_6b_34_17_11#base=114 r=5
1_64_51_7_36
base=115 r=5 1_5e_12_1a_1d#base=116 r=5 1_57_5c_23_2c#base=117 r=5
1_51_47_6c_f
base=118 r=5 1_4b_47_56_10#base=119 r=5 1_45_5b_2d_2e#base=120 r=5
1_40_a_42_18
base=121 r=5 1_3a_43_70_1a#base=122 r=5 1_35_16_19_2e#base=123 r=5
1_2f_74_c_72
base=124 r=5 1_2a_68_2a_30#base=125 r=5 1_25_6c_51_45#base=126 r=5
1_21_2_62_3c
base=127 r=5 1_1c_25_3d_3b#base=128 r=5 1_17_57_43_8#base=129 r=5
1_13_17_57_6
base=130 r=5 1_e_66_5d_36#base=131 r=5 1_a_41_3a_32#base=132 r=5
1_6_28_56_30
base=133 r=5 1_2_1c_13_82#base=134 r=4 84_1b_64_4#base=135 r=4
81_27_23_45
base=136 r=4 7e_3e_47_50#base=137 r=4 7b_61_32_52#base=138 r=4
79_5_57_6
base=139 r=4 76_3e_15_51#base=140 r=4 73_81_6f_4#base=141 r=4
71_43_38_30
base=142 r=4 6f_d_76_58#base=143 r=4 6c_6f_8a_f#base=144 r=4
6a_4c_5f_18
base=145 r=4 68_31_73_2c#base=146 r=4 66_1f_24_14#base=147 r=4
64_14_84_3c
base=148 r=4 62_12_5e_90#base=149 r=4 60_18_35_77#base=150 r=4
5e_25_8e_90
base=151 r=4 5c_3b_2f_60#base=152 r=4 5a_58_35_10#base=153 r=4
58_7c_92_72
base=154 r=4 57_f_8_4#base=155 r=4 55_41_53_4f#base=156 r=4
53_7b_33_84
base=157 r=4 52_1f_36_79#base=158 r=4 50_66_50_10#base=159 r=4
4f_15_73_75
base=160 r=4 4d_69_95_68#base=161 r=4 4c_24_8_90#base=162 r=4
4a_85_2_60
base=163 r=4 49_49_79_99#base=164 r=4 48_13_1e_20#base=165 r=4
46_86_2a_72
base=166 r=4 45_59_96_88#base=167 r=4 44_32_c_6#base=168 r=4
43_e_73_90
base=169 r=4 41_98_76_91#base=170 r=4 40_7f_9_72#base=171 r=4
3f_69_76_a8
base=172 r=4 3e_58_61_5c#base=173 r=4 3d_4b_6b_15#base=174 r=4
3c_42_8b_66
base=175 r=4 3b_3e_b_90#base=176 r=4 3a_3d_40_88#base=177 r=4
39_40_74_4b
base=178 r=4 38_47_9e_90#base=179 r=4 37_53_5_1#base=180 r=4
36_62_4_18
base=181 r=4 35_74_97_40#base=182 r=4 34_8b_4d_9e#base=183 r=4
33_a5_8a_a8
base=184 r=4 33_b_91_90#base=185 r=4 32_2c_5a_90#base=186 r=4
31_50_98_30
base=187 r=4 30_78_8a_72#base=188 r=4 2f_a4_2a_30#base=189 r=4
2f_16_2c_7b
base=190 r=4 2e_47_8d_36#base=191 r=4 2d_7c_88_81#base=192 r=4
2c_b5_17_48
base=193 r=4 2c_2f_b3_ba#base=194 r=4 2b_6e_17_a#base=195 r=4
2a_af_7f_36
base=196 r=4 2a_30_63_3c#base=197 r=4 29_77_80_a4#base=198 r=4
28_c2_d_72
base=199 r=4 28_48_90_38#base=200 r=4 27_98_77_90#base=201 r=4
27_22_85_8a
base=202 r=4 26_77_b6_0#base=203 r=4 26_5_39_66#base=204 r=4
25_5f_a1_c
base=205 r=4 24_bd_51_72#base=206 r=4 24_50_11_ba#base=207 r=4
23_b2_ad_6
base=208 r=4 23_48_81_b8#base=209 r=4 22_b0_5a_5c#base=210 r=4
22_49_32_90
base=211 r=4 21_b6_6_85#base=212 r=4 21_51_a6_40#base=213 r=4
20_c3_66_9f
base=214 r=4 20_62_17_6#base=215 r=4 20_1_8a_31#base=216 r=4
1f_7a_f_60
base=217 r=4 1f_1c_51_ac#base=218 r=4 1e_99_76_58#base=219 r=4
1e_3e_79_5d
base=220 r=4 1d_c0_57_4#base=221 r=4 1d_68_b_50#base=222 r=4
1d_10_70_90
base=223 r=4 1c_98_a7_13#base=224 r=4 1c_43_aa_c8#base=225 r=4
1b_d0_78_45
base=226 r=4 1b_7e_b_82#base=227 r=4 1b_2c_43_da#base=228 r=4
1a_bf_3c_a8
base=229 r=4 1a_6f_d7_2c#base=230 r=4 1a_21_46_90#base=231 r=4
19_ba_52_51
base=232 r=4 19_6e_11_a0#base=233 r=4 19_22_69_e4#base=234 r=4
18_c1_70_84
base=235 r=4 18_78_21_bd#base=236 r=4 18_2f_66_10#base=237 r=4
17_d4_4f_ae
base=238 r=4 17_8d_c9_2e#base=239 r=4 17_47_e2_ca#base=240 r=4
17_2_99_18
base=241 r=4 16_ae_d9_5b#base=242 r=4 16_6b_b1_1a#base=243 r=4
16_29_1c_b1
base=244 r=4 15_db_c_a8#base=245 r=4 15_9a_80_6d#base=246 r=4
15_5a_81_72
base=247 r=4 15_1b_c_36#base=248 r=4 14_d4_15_30#base=249 r=4
14_96_9b_db
base=250 r=4 14_59_a5_c2#base=251 r=4 14_1d_2f_62#base=252 r=4
13_dd_31_3c
base=253 r=4 13_a2_aa_d5#base=254 r=4 13_68_9d_ba#base=255 r=4
13_2f_6_72
base=256 r=4294967295 #
Christopher Pisz <nospam@notanaddress.com>: Jan 30 10:27AM -0600

On 1/30/2015 4:04 AM, Rosario193 wrote:
>> You win the ugly code of the week award.
 
>> What's wrong with #include <cstdio> ?
 
> i have one old C++ compiler that allow that
 
Upgrade your compiler to the year 2015. You are posting example code for
someone else to use.
 
 
>> Naming all variables with a single or double letter rather than a
>> meaningful name.
 
> not for the words one always use
 
Every single variable you have in your code is a single or double
letter. No one knows wtf aa=a; means without having to study your entire
listing. employeePay = twoWeekSalary is immediately obvious. You are
writing C++ (supposedly) code for humans to read. You are not working in
matlab.
 
 
>> trying to save keystrokes.
 
> i want sys call "int main(void)"
> and not call "int main()"
 
Why? Are you posting to a C++ newsgroup? Are you programming modern C++?
 
 
>> Statements sometimes on same line with brackets, sometimes not,
>> sometimes no brackets at all. At least be consistent with ugly style.
 
> they call it readability...
 
That's hilarious.
Christopher Pisz <nospam@notanaddress.com>: Jan 30 10:32AM -0600

On 1/30/2015 4:05 AM, Rosario193 wrote:
> #define F for
> #define R return
 
>SNIP
 
For Pete's sake, just stop. Go back to 1970.
Rosario193 <Rosario@invalid.invalid>: Jan 30 07:21PM +0100

On Fri, 30 Jan 2015 11:05:13 +0100, Rosario193 wrote:
> if(j==0) break;
> }
> }
 
all these swap show that arabs representation for number, or little
endian
is the right way...
and we have only wrong
 
Rosario193 <Rosario@invalid.invalid>: Jan 30 07:54PM +0100

On Fri, 30 Jan 2015 11:05:13 +0100, Rosario193 wrote:
 
some corrections... base 256 shoule be ok too...
 
#include <stdio.h>
#include <string.h>
#include <limits.h>
 
#define u8 unsigned char
#define u32 unsigned
#define i32 int
#define P printf
#define F for
#define R return
 
 
// result ok if return one number > 0
i32 uToA(u8* rstr, u32 rstrsize, u32 argnumber, u32 base)
{u32 i, j, k;
u8 tmp[64];
u8 str[64]="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
if(rstr==0) R -1;
if(rstrsize > 0xFFFFFFF) R -1;
rstr[0]=0;
if(base<=1 || base>256) R -1;
 
F( i=0, tmp[0]=0; argnumber; ++i)
{tmp[i]=argnumber%base; argnumber/=base;}
if(i+2>rstrsize) R -2;
if(i!=0) --i;
if(base<=36)
{F(k=0, j=i; ;--j, ++k)
{rstr[k]=str[tmp[j]];
if(j==0) break;
}
}
else {F(k=0, j=i; ;--j, ++k)
{rstr[k]=tmp[j];
if(j==0) break;
}
}
++k; rstr[k]=0;
R k;
}
 
 
int main(void)
{u32 m=0x12f5e188, i, x, base;
i32 r;
u8 result[128]; // 0..126 127[0]

if(CHAR_BIT!=8 || sizeof(u32)!=4)
{P("this can not to run here\n"); R 0;}
 
F(base=0; base<=257; ++base)
{r=uToA(result, 128, m, base);
P("base=%u r=%u ", base, r);
if(r>0)
{F(i=0; i<(u32)r; ++i)
{if(base<=36) P("%c", result[i]);
else {x=result[i];
P("%u", x);
}
if(base>36 && i!=(u32)r-1) P("_");
}
}
if(base!=0 && base%3==0) P("\n");
else P("#");
if(base>=2 && base<=36 && strlen(result)!=(u32)r)
P("Find Error base=%u", base);
}
P("\n");
R 0;
}
Rosario193 <Rosario@invalid.invalid>: Jan 30 08:04PM +0100

On Thu, 29 Jan 2015 14:48:02 +0100, jak wrote:
 
 
> if (Base > 1 && Base <= 16)
> for (; Byte > 0; Byte /= Base)
> Res = LT[Byte % Base] + Res;
 
here just above the compiler said one error, so not compile...
i think the reason why is the const above...
so i wrote it this
 
Res = (char) LT[Byte % Base] + Res;
 
and compile...
 
Rosario193 <Rosario@invalid.invalid>: Jan 30 08:13PM +0100

On Thu, 29 Jan 2015 14:48:02 +0100, jak wrote:
 
your program print:
 
Base 2:
1) 10001000
2) 11100001
3) 11110101
4) 10010
 
Premere un tasto per continuare . . .
 
Base 3:
1) 12001
2) 22100
3) 100002
4) 200
 
Premere un tasto per continuare . . .
 
Base 4:
1) 2020
2) 3201
3) 3311
4) 102
 
Premere un tasto per continuare . . .
 
Base 5:
1) 1021
2) 1400
3) 1440
4) 33
 
Premere un tasto per continuare . . .
 
Base 6:
1) 344
2) 1013
3) 1045
4) 30
 
Premere un tasto per continuare . . .
 
Base 7:
1) 253
2) 441
3) 500
4) 24
 
Premere un tasto per continuare . . .
 
Base 8:
1) 210
2) 341
3) 365
4) 22
 
Premere un tasto per continuare . . .
 
Base 9:
1) 161
2) 270
3) 302
4) 20
 
Premere un tasto per continuare . . .
 
Base 10:
1) 136
2) 225
3) 245
4) 18
 
Premere un tasto per continuare . . .
 
Base 11:
1) 114
2) 195
3) 203
4) 17
 
Premere un tasto per continuare . . .
 
Base 12:
1) B4
2) 169
3) 185
4) 16
 
Premere un tasto per continuare . . .
 
Base 13:
1) A6
2) 144
3) 15B
4) 15
 
Premere un tasto per continuare . . .
 
Base 14:
1) 9A
2) 121
3) 137
4) 14
 
Premere un tasto per continuare . . .
 
Base 15:
1) 91
2) 100
3) 115
4) 13
 
Premere un tasto per continuare . . .
 
Base 16:
1) 88
2) E1
3) F5
4) 12
 
Premere un tasto per continuare . . .
 
my print:
base=0 r=4294967295 #base=1 r=4294967295 #base=2 r=29
10010111101011110000110001
000#base=3 r=18 211011120100120120
base=4 r=15 102331132012020#base=5 r=13 1122413311234#base=6 r=11
51322023240
base=7 r=11 10611560514#base=8 r=10 2275360610#base=9 r=9 734510516
base=10 r=9 318103944#base=11 r=9 15361A224#base=12 r=8 8A647B20
base=13 r=8 50B991B2#base=14 r=8 30367144#base=15 r=8 1CDD8049
base=16 r=8 12F5E188
 
so result in other base except 16 swapped are different...
James Moe <jimoeDESPAM@sohnen-moe.com>: Jan 30 11:07AM -0700

Hello,
I am looking into some code for DNS MX lookup. It compiles but is
missing a library for building the executable.
Can anyone suggest which library contains the missing functions?
 
c++ mx-lookup.cpp
/tmp/ccRz24GU.o: In function `MXLookup(char const*)':
mx-lookup.cpp:(.text+0x99): undefined reference to `__res_query'
mx-lookup.cpp:(.text+0xc6): undefined reference to `ns_initparse'
mx-lookup.cpp:(.text+0x10a): undefined reference to `ns_parserr'
mx-lookup.cpp:(.text+0x196): undefined reference to `ns_get16'
mx-lookup.cpp:(.text+0x1cd): undefined reference to `ns_name_uncompress'
collect2: error: ld returned 1 exit status
 
 
--
James Moe
jmm-list at sohnen-moe dot com
"Öö Tiib" <ootiib@hot.ee>: Jan 30 10:31AM -0800

On Friday, 30 January 2015 20:07:28 UTC+2, James Moe wrote:
> mx-lookup.cpp:(.text+0x196): undefined reference to `ns_get16'
> mx-lookup.cpp:(.text+0x1cd): undefined reference to `ns_name_uncompress'
> collect2: error: ld returned 1 exit status
 
You should link with -lresolv (libresolv)
James Moe <jimoeDESPAM@sohnen-moe.com>: Jan 30 12:08PM -0700

On 01/30/2015 11:31 AM, Öö Tiib wrote:
> You should link with -lresolv (libresolv)
 
Thank you!
 
--
James Moe
jmm-list at sohnen-moe dot com
Lynn McGuire <lmc@winsim.com>: Jan 30 01:00PM -0600

"Experimenting with a Proposed Standard Drawing Library for the C++ language"
https://msopentech.com/blog/2015/01/28/experimenting-with-a-proposed-standard-gui-for-the-c-language/
 
C++ has needed a standard drawing library for a LONG time! This may take hold with Sutter behind it.
http://isocpp.org/blog/2014/01/n3888
 
Now C++ needs a standard user interface library.
 
Lynn
G DeR <me@myworld.com>: Jan 30 07:25PM +0100

Il 29/01/2015 21:23, Stefan Ram ha scritto:
 
> A compiler, however, is not an implementation, nor does
> it contain an implementation. So it would usually be
> false to list a compiler as an implementation.
 
Pedantry can sometimes provide two mutually exclusive indications
on one's personality. In one case, the picture is that of a person
devoted to a deep understanding of any subject, whose knowledge
originates from scrupulous attention to every detail, which is then
applied constantly, in any domain, as an established habit. In the
other case, such attitude highlights one's attention to unnecessary
and redudant quibbles, as evidence of a poor level of insight and low
consideration for other people, fact that results in a clumsy attempt
to show off one's own presumed insightfulness, while it inevitably
translates to childish exhibitionism and tangible superficiality to
other people's eyes.
 
--
Yet another musician
Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo>: Jan 29 10:31PM -0500

Jorgen Grahn wrote:
 
> Sure, that's what we're both talking about: how to give clues in the
> code to help people remember what the function does, while keeping the
> code as a whole readable.
I am not certain I understand the challenge here. I thought, if a person
is likely to guess correctly what a function does, it plainly
contributes to the readability. I am all for the good prototypes for a
number of reasons but I do not see how they can significantly help to
understand what the function does. At a function call or other reference
site, the prototype or signature is not always obvious, especially in C++.
> and needs to be seen in that context.
 
> But yes, if you take one of my signatures and strip off everything but
> the function name, you'll end up with a not very useful name!
It's not me, it's the reference site that one will be reading and at
which there may be less than perfect information about the prototype.
Understanding reference site is important because it's the most often
context where the reader would meet a name of useful function.
>> it as a part of an initializer.
 
> I don't think the risk is normally very high -- and I'm prepared to
> make exceptions for special cases.
The problem is that when one selects a name for a new publicly
accessible function he or she has no control on how the function will be
used. If the function turns out to be really useful, it is only more
probable that people might eventually want to pass it as an argument
etc. or initialize some pointer with it. Specifically it is almost
common to store setters in a map with a textual key to fill up some data
structures read from external sources such as configuration files. By
the time such usage is needed, it might be too late for the name change.
> /Jorgen
 
-Pavel
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.