Tuesday, September 30, 2014

Digest for comp.lang.c++@googlegroups.com - 24 updates in 5 topics

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: Sep 29 10:08PM -0700

On Monday, September 29, 2014 2:50:50 PM UTC-5, Mr Flibble wrote:
 
> Only got one comment: use boost.asio and get rid of all that crap.
 
The C++ Middleware Writer is an alternative to the
serialization library in Boost more so than asio.
 
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 30 06:33PM +0100


>> Only got one comment: use boost.asio and get rid of all that crap.
 
> The C++ Middleware Writer is an alternative to the
> serialization library in Boost more so than asio.
 
That is no reason to not use boost.asio; boost.asio is for networking
not serialization.
 
Rule of thumb for modern software development: as much as your code as
possible should be portable so get rid of that Winsock shite and use
boost.asio.
 
/Flibble
Christopher Pisz <nospam@notanaddress.com>: Sep 30 02:32PM -0500

On 9/30/2014 12:33 PM, Mr Flibble wrote:
> possible should be portable so get rid of that Winsock shite and use
> boost.asio.
 
> /Flibble
 
I don't particularly enjoy debugging boost.asio, but haven't really
heard of anyone getting around that with iocp. Who started the thread,
is hard to find out.
"Öö Tiib" <ootiib@hot.ee>: Sep 30 02:29PM -0700

On Tuesday, 30 September 2014 22:33:16 UTC+3, Christopher Pisz wrote:
 
> I don't particularly enjoy debugging boost.asio, but haven't really
> heard of anyone getting around that with iocp. Who started the thread,
> is hard to find out.
 
Sometimes it is indeed difficult to debug modern C++ if all types
around of where something breaks are whole page of "<", "::" and ">"
nausea far worse than worst of XML. There is alternatively a C
library named "libuv" (part of "node.js" but may be used separately)
that is somewhat similar to boost.asio and that people use for
networking quite finely.
c.milanesi.bg@gmail.com: Sep 30 02:13PM -0700

> I hope you are aware that something like this exists in boost?
 
Sure, but I was not satisfied by that, and so I designed and
implemented my own library.
 
> In what sense is your work different
> or even better than the boost solution?
 
I don't really know Boost.Units,
but here are some apparent differences.
 
Boost.Units supports 12-year-old compilers, while Cpp-Measures
requires, and takes advantage of, the parts of C++11 available
in GCC and VC++ 2012.
 
Boost.Units includes many definitions of magnitudes and units
in the library, while Cpp-Measures requires that the application
programmer defines the needed magnitudes and the units,
although many examples will be available in documentation.
 
Boost, when expanded, is 500 megabytes large,
while Cpp-Measures is 200 KB of library code
for the application programmer,
and less than 1 MB with all tests and documentation.
It is not clear to me how to install only the Boost.Units library
and its dependencies instead of all Boost.
 
Application code using Cpp-Measures is less verbose.
For example, the following Boost.Units expression
 
quantity<absolute<fahrenheit::temperature> >
T1p(32.0*absolute<fahrenheit::temperature>());
 
corresponds to the following Cpp-Measures expression
 
point1<fahrenheit> T1p(32);
 
Application code using Cpp-Measures is compiled faster
and produces less machine code.
For example, the example provided by Boost.Units Quick Start page,
when compiled using GCC for Windows, with stripping and optimization,
takes 3 times the time to compile the equivalent code
using Cpp-Measures, and generates an executable 7 times as large.
 
Cpp-Measures supports 2-dimensional and 3-dimensional measures,
with algebraic operations, dot product and cross product,
while I couldn't find such features in Boost.Units.
 
Cpp-Measures supports signed and unsigned angles modulo one turn,
while I couldn't find such features in Boost.Units.
 
> - do you differentiate between absolute and relative values (for
> instance for time, but also for location/distance)
 
Yes, for example, a variable representing an absolute length measured
in inches, is defined as:
 
point1<inches> variable_name;
 
While a variable representing a relative length measured
in inches, is defined as:
 
vect1<inches> variable_name;
 
> - can you work with non-floating-point base types (especially
> fixed-point types implemented on top of integers)?
 
I tested it with the following types:
float, double, long double, int, long, long long, complex<double>.
Not tested yet, and probably not working properly yet
fixed-point, rational, multiple-precision,
and arbitrary-precision types.
 
> - can you work with mixed base types (for instance fixed-point types
> based on integers of various size and scaling)?
 
Automatic conversion between fixed-point types is not supported yet,
but you can do something like the following:
 
auto a = vect1<inches,float>(1.2f) + vect1<inches,double>(2.3);
 
And you get that "a" is of type "vect1<inches,double>",
and it has value 3.5.
 
--
 
Carlo Milanesi
Robert Hutchings <rm.hutchings@gmail.com>: Sep 29 06:43PM -0500

On 9/29/2014 6:18 PM, JiiPee wrote:
> understand and accept that all the code done in workplace belongs to the
> company, that is natural.... but I do not think its right that also code
> outside work is theirs.
Yes, I agree with you. If I write C++ code that has nothing to do with
my employer, how can they claim it as "their" IP? THAT makes no sense
to me...
Christopher Pisz <nospam@notanaddress.com>: Sep 29 06:51PM -0500

On 9/29/2014 6:18 PM, JiiPee wrote:
> understand and accept that all the code done in workplace belongs to the
> company, that is natural.... but I do not think its right that also code
> outside work is theirs.
 
 
Usuaully the intelectual property blurb in the paperwork states that it
own works _related to the company's business_, which is reasonable. If
you have a blurb in your paperwork sweeping everything without that
condition, than I'd mention it. If you have a project worth anything,
i.e a game engine you've been working on for 5 years, I A) Wouldn't
recommend working for a game company B) Would get written papers stating
that you will retain ownership and that they have been notified that
this work was underway before your employment.
Stuart <DerTopper@web.de>: Sep 30 09:36AM +0200

On 09/30/14, JiiPee wrote:
> understand and accept that all the code done in workplace belongs to the
> company, that is natural.... but I do not think its right that also code
> outside work is theirs.
 
Well, they can say anything they want, that's the beauty of freedom of
speech. Whether it is legally sound or not is quite another story. Here
in Germany your landlord can put a clause into your contract that you
have to paper the walls regularly. However, such a clause is illegal in
Germany and has therefore no effect. Worse, it can nullify the whole
contract - which is why they put an severability clause into the
contract as well. If your contract does not contain such a clause,
things may turn out to be very interesting, indeed.
 
Just out of curiousity: If you write a virus in your spare time which
destroys all atomic weapons in the world (good job IMHO), and the
Russians and the US Army are looking for someone to shoot, would it be
your head in the block or your bosses? After all, it was _his_ code... ;-)
 
Regards,
Stuart
 
PS: I wouldn't work for such a company in the first place. That doesn't
mean that I have a problem with security, I just don't like ridiculous
interference with my personal life (another thing would be if I worked
for the MoD and went to anti-war demonstrations). It turns out that my
contract contains a clause that I must not make statements about my work
or my company to existing and _future_ clients of our company. That's a
bummer. When I confronted my boss - whom I went to school with for two
years - he admitted that he did not even read through this particular
clause, he just copied the whole thing from the internet.
David Brown <david.brown@hesbynett.no>: Sep 30 09:44AM +0200

On 30/09/14 01:18, JiiPee wrote:
> understand and accept that all the code done in workplace belongs to the
> company, that is natural.... but I do not think its right that also code
> outside work is theirs.
 
It is not uncommon for software companies to have this attitude - in
fact, I believe it is the default legal position. The reasoning is
basically that if you work for them as a professional programmer, then
when you program you do so as a professional. Thus when you are
programming, you are working - you are therefore either working for them
(and they own the code), or you are moonlighting (which is illegal) and
competing against your own employer.
 
Of course it is usually possible to form agreements about what this
covers, such as distinguishing between different types of programming,
or for specific cases - just as you can take a second job with agreement
from your main employer.
 
A good employer will be happy to reach an accord of some sort - as long
as you are not tiring yourself out with hobby programming to late at
night (and thus unable to do your real job as well as you could), and as
long as you are not competing with them in some way, then it is usually
fine.
 
The same thing applies in many professions, and there have been
countless cases of disagreement when someone has made an invention at
home that their employer then claims. So it is best to get details of
such agreements in writing - especially if you are doing something that
might turn out to be valuable.
seeplus <gizmomaker@bigpond.com>: Sep 30 12:59AM -0700

On Tuesday, September 30, 2014 5:37:16 PM UTC+10, Stuart wrote:
> bummer. When I confronted my boss - whom I went to school with for two
> years - he admitted that he did not even read through this particular
> clause, he just copied the whole thing from the internet.
 
Haa!
 
Who can take in all those Ts and Cs that companies stick in there.
Did you see that experiment setting up a free Wi-Fi hotspot
in London recently.
 
{ When people connected to the hotspot, the terms and conditions
they were asked to sign up to included a "Herod clause" promising
free Wi-Fi but only if "the recipient agreed to assign their
first born child to us for the duration of eternity".
 
Six people signed up.}
"Osmium" <r124c4u102@comcast.net>: Sep 30 06:57AM -0500

"Stuart" wrote:
 
> bummer. When I confronted my boss - whom I went to school with for two
> years - he admitted that he did not even read through this particular
> clause, he just copied the whole thing from the internet.
 
I think your chance of getting a job as a programmer or an engineer with
those constraints in the USA are real close to zero. Unless you are Very
Special the company is not going to be willing to even enter negotiations
with you regarding the basics. It also displays an "attitude".
 
A friend of mine wrote Science Fiction as a hobby. Our company refused to
give him permission to have it published since it might reflect badly on the
company.
drew@furrfu.invalid (Drew Lawson): Sep 30 12:27PM

In article <mNlWv.358129$J62.156216@fx03.am4>
 
>When I entered my first software company, they said they also own all
>the code I do on my spare time, even if its some game I am programming
>at home. Is this really true as well?
 
When you took that job, you most likely signed an employment
agreement. If this was in that agreement, then it is true. Depending
on jurisdiction, some parts of that agreement may not be enforcable.
 
The agreements I've been under have included:
 
1) The company owns anything done on company time and company
equipment, if it relates to the main business interests of the
company.
 
2) The company owns anything done on company equipment.
 
3) The company owns any IP created during my employment, unless
explicitly dislaimed. Any patents I receive must be assigned
to the company.
 
I think I'm currently under #3, but I haven't had reason to look
recently.
 
In some circles, #3 is called things like "the IBM rule," as they
were well known for having and enforcing that. If you were working
on the Great American Novel, it was recommended to pass it by HR
and get acknowledgement that it was a personal work.
 
 
>understand and accept that all the code done in workplace belongs to the
>company, that is natural.... but I do not think its right that also code
>outside work is theirs.
 
Somewhat, this is for legal convenience. How do you prove that
your project was done on your home computer, rather than on the
company's dime?
 
--
Drew Lawson | "But the senator, while insisting he was not
| intoxicated, could not explain his nudity."
Bo Persson <bop@gmb.dk>: Sep 30 06:30PM +0200

On 2014-09-30 01:43, Robert Hutchings wrote:
> If I write C++ code that has nothing to do with
> my employer, how can they claim it as "their" IP? THAT makes no sense
> to me...
 
And what if their huge team of lawyers claim that is DOES have something
to do with your employer? Like their secret plans for a new product...
 
 
Bo Persson
Robert Hutchings <rm.hutchings@gmail.com>: Sep 30 12:00PM -0500

On 9/30/2014 11:30 AM, Bo Persson wrote:
 
> And what if their huge team of lawyers claim that is DOES have something
> to do with your employer? Like their secret plans for a new product...
 
> Bo Persson
 
Indeed! Unless one signs a contract that explicitly states that "C++
code developed for personal use is NOT the IP of <employer>", you would
have to fight a team of lawyers, and that is a daunting prospect...
woodbrian77@gmail.com: Sep 30 11:03AM -0700

On Tuesday, September 30, 2014 12:00:53 PM UTC-5, Robert Hutchings wrote:
 
> Indeed! Unless one signs a contract that explicitly states that "C++
> code developed for personal use is NOT the IP of <employer>", you would
> have to fight a team of lawyers, and that is a daunting prospect...
 
When it comes to dealing with companies with lots
of lawyers, you have to be careful. I haven't had a
debit or credit card in over 10 years because I don't
trust those companies.
 
There are advantages to working for a small company.
One of them is you don't have to fend off those lawyers.
 
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
Stuart <DerTopper@web.de>: Sep 30 10:14PM +0200

Stuart wrote:
>> bummer. When I confronted my boss - whom I went to school with for two
>> years - he admitted that he did not even read through this particular
>> clause, he just copied the whole thing from the internet.
 
 
On 09/30/14, Osmium wrote:
> those constraints in the USA are real close to zero. Unless you are Very
> Special the company is not going to be willing to even enter negotiations
> with you regarding the basics. It also displays an "attitude".
 
Gosh, I hadn't suspected this. I wonder whether this is an "American"
thing or just another indicator that software engineers are getting
closer and closer to the status of a McDonald employee. If I look at the
rates that are offered in most freelancer websites, I'd say that
McDonalds employees are only slighly less paid.
 
> A friend of mine wrote Science Fiction as a hobby. Our company refused to
> give him permission to have it published since it might reflect badly on the
> company.
 
I can partly understand this. However, it would be better if your
company allowed your friend to publish under a pseudonym.
 
Regards,
Stuart
Vir Campestris <vir.campestris@invalid.invalid>: Sep 30 09:30PM +0100

On 30/09/2014 00:18, JiiPee wrote:
> understand and accept that all the code done in workplace belongs to the
> company, that is natural.... but I do not think its right that also code
> outside work is theirs.
 
This depends on your contract and the country where you work.
 
If you really want to know seek a legal newsgroup, or even pay a lawyer.
 
uk.legal.moderated is quite good, but I suspect not relevant to you.
 
Andy
Christopher Pisz <nospam@notanaddress.com>: Sep 30 03:31PM -0500

On 9/30/2014 3:14 PM, Stuart wrote:
> Stuart wrote:
SNIP
> closer and closer to the status of a McDonald employee. If I look at the
> rates that are offered in most freelancer websites, I'd say that
> McDonalds employees are only slighly less paid.
SNIP
 
Eh? I'm in America. Like I said before in this thread, it is pretty much
expected at any job that there will be some intellectual property clause
in your hiring paperwork. Usually, it only makes claims on things
_related to the companies business_, rather than a sweeping claim on
everything you do. i.e No, you cannot create a video game on your own
while working for a game studio. You can however invent the best flap
jack recipe.
 
As far as salaries go, I have never met a McDonald's employee making
$120,000/year. Of course, I don't get to McDonald's very often. I
suppose it depends what kind of software and where on the totem pole you
are. I am sure some companies I've worked for have done the "Let's hire
50 Afghanistan grunts to sludge out this code for $15/hr" and I don't
know the details of how that works, only that it results in a
maintenance nightmare. Perhaps that's what you are referring to when you
compare salaries. However, the average Software Engineer in America is
expected to make $60,000 out of college and the average McDonald's Fry
Cook is expected to make $10/hr. I think the average junior salary is
around $80,000 and seniors typically make $100,000+ last I checked. It
varies with your niche and city though.
 
Are Europeans making less? Their money is worth more, so perhaps. I dunno.
JKdr <jkdr@siberianoutpost.com>: Sep 30 05:06AM -0400

Input would be:
 
1) the strings that need to be searched for (or regex patterns) and
their substitutions
 
2) a stream (from a file) and its encoding
 
I spent some time trying to find an implementation of such an
algorithm, which I think shouldn't be a big deal at least in the case
that you don't use regex, just strings to find, but all implementations
I have found touch the input stream more than once
 
I think the data strategies of such algorithms is based on
graphs/decision trees, which are used in state machines and similar
algorithms
 
Unless I am missing something
 
Any ideas you could shared?
 
lbrtchx
(comp.lang.c++)
Jorgen Grahn <grahn+nntp@snipabacken.se>: Sep 30 09:44AM

On Tue, 2014-09-30, JKdr wrote:
> algorithm, which I think shouldn't be a big deal at least in the case
> that you don't use regex, just strings to find, but all implementations
> I have found touch the input stream more than once
 
Which ones /have/ you found?
 
> algorithms
 
> Unless I am missing something
 
> Any ideas you could shared?
 
Not really ... but I /have/ looked into the simpler case "search for
multiple strings at once" and there are several algorithms. Follow
the links from
 
http://en.wikipedia.org/wiki/Knuth.Morris.Pratt_algorithm
 
I've been meaning to implement this in C++: the case where the same
set of search strings are used over and over again can be
precalculated well, and encapsulated as an object.
 
On the other hand, I suspect std::regex might perform well. Is it
one-pass enough for your purposes?
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
JKdr <jkdr@siberianoutpost.com>: Sep 30 08:23AM -0400

On 09/30/2014 07:00 AM, Malcolm McLean wrote:
 
> Then it's a bit of a fiddle to hold the characters in a buffer, until they match
> or don't match your end of string character, which is the terminal of your
> suffix tree.
 
I had something very similar in mind. String search algorithms tend to
be messy (repeatedly looping though both data). What seems to be great
theoretically sometimes is not practical, could you point me to
algorithms like the ones you describe, preferably with tests? ;-)
 
Thank you
lbrtchx
JKdr <jkdr@siberianoutpost.com>: Sep 30 11:31AM -0400

On 09/30/2014 08:54 AM, Siri Crews wrote:
> That's called a finite state transducer
 
Yeap! Those kinds of problems have been studied to exhaustion
 

http://scholar.google.com/scholar?start=10&q="finite+state+transducer"+text
 
and there are implementations of such logic ...
 
http://en.wikipedia.org/wiki/Finite_state_transducer
 
http://jsalatas.ictpro.gr/java-fst-framework-api-review/
 
I was (very expectedly indeed ;-)) trying to tackle text
processing/corpora research problems with such FST-like strategies
 
Thank you very much,
lbrtchx
Juha Nieminen <nospam@thanks.invalid>: Sep 30 08:01AM

> acknowledge His help as being help and say to themselves instead, "I know
> how the help should be doled out," rather than having faith in God, again
> the result of sin.
 
As I thought, you have no response. Of course you don't, because there
is no response. The only thing you can do is to try more proselytizing.
 
I find it somewhat amusing how so many Christians think that
proselytizing is like magic: As long as people hear the words, magic
will sometimes happen. It's like a magical incantation.
 
--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Sep 30 09:49AM +0100

On Tue, 30 Sep 2014 08:01:59 +0000 (UTC)
 
> I find it somewhat amusing how so many Christians think that
> proselytizing is like magic: As long as people hear the words, magic
> will sometimes happen. It's like a magical incantation.
 
Fuck off.
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.

No comments: