Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-06 Thread Alan McKinnon
On 06/08/2015 20:28, J. Roeleveld wrote:
 On Thursday, August 06, 2015 02:59:09 PM Mick wrote:
 On Wednesday 05 Aug 2015 22:47:43 Alan McKinnon wrote:
 On 05/08/2015 23:12, J. Roeleveld wrote:
 On Wednesday, August 05, 2015 06:20:17 PM Mick wrote:
 On Wednesday 05 Aug 2015 11:47:58 Alan McKinnon wrote:
 Much of what makes programming work has been dumbed down in recent
 years so that employable persons without imagination[1] can have jobs
 and do something useful. I'm reminded of an old saw about PHP:

 The nice thing about php is it let's everyone and their dog write
 code.
 The bad thing about php is that they do.

 Your imagination[1] footnote didn't make it to the list.  I thought for
 a minute that you used some php parser ...  :p

 It's not that old for an old saying.
 I can't find a reference to that saying older then august 2014 using
 Google.

 And all those are links to the same email written by our own Alan
 McKinnon

 Ah! That's because it was I who made it up years ago and have told it to
 lots of people.

 About a year ago is obviously the first time I wrote it down :-)

 Run the same search for perl - it's probably more appropriate than php and
 may find older samples of the same ol' saying.
 
 Nope, can't find a single hit with either line.
 
 Also would surprise me, as the largest part of the massive amount of bad code 
 (mostly copy/pasted from each other) arrived after PHP appeared.

It works just as well for php, perl, basic, VB, J2EE frameworks and any
draggy-droppy workflow thing that claims to produce runnable code.

It seems that only C is immune, probably because of the high barrier to
entry that must be climbed before writing something useful (and hello
world is not useful :-) )


-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-06 Thread J. Roeleveld
On Thursday, August 06, 2015 02:59:09 PM Mick wrote:
 On Wednesday 05 Aug 2015 22:47:43 Alan McKinnon wrote:
  On 05/08/2015 23:12, J. Roeleveld wrote:
   On Wednesday, August 05, 2015 06:20:17 PM Mick wrote:
   On Wednesday 05 Aug 2015 11:47:58 Alan McKinnon wrote:
   Much of what makes programming work has been dumbed down in recent
   years so that employable persons without imagination[1] can have jobs
   and do something useful. I'm reminded of an old saw about PHP:
   
   The nice thing about php is it let's everyone and their dog write
   code.
   The bad thing about php is that they do.
   
   Your imagination[1] footnote didn't make it to the list.  I thought for
   a minute that you used some php parser ...  :p
   
   It's not that old for an old saying.
   I can't find a reference to that saying older then august 2014 using
   Google.
   
   And all those are links to the same email written by our own Alan
   McKinnon
  
  Ah! That's because it was I who made it up years ago and have told it to
  lots of people.
  
  About a year ago is obviously the first time I wrote it down :-)
 
 Run the same search for perl - it's probably more appropriate than php and
 may find older samples of the same ol' saying.

Nope, can't find a single hit with either line.

Also would surprise me, as the largest part of the massive amount of bad code 
(mostly copy/pasted from each other) arrived after PHP appeared.

--
Joost



Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-06 Thread Mick
On Wednesday 05 Aug 2015 22:47:43 Alan McKinnon wrote:
 On 05/08/2015 23:12, J. Roeleveld wrote:
  On Wednesday, August 05, 2015 06:20:17 PM Mick wrote:
  On Wednesday 05 Aug 2015 11:47:58 Alan McKinnon wrote:
  Much of what makes programming work has been dumbed down in recent
  years so that employable persons without imagination[1] can have jobs
  and do something useful. I'm reminded of an old saw about PHP:
  
  The nice thing about php is it let's everyone and their dog write code.
  The bad thing about php is that they do.
  
  Your imagination[1] footnote didn't make it to the list.  I thought for
  a minute that you used some php parser ...  :p
  
  It's not that old for an old saying.
  I can't find a reference to that saying older then august 2014 using
  Google.
  
  And all those are links to the same email written by our own Alan
  McKinnon
 
 Ah! That's because it was I who made it up years ago and have told it to
 lots of people.
 
 About a year ago is obviously the first time I wrote it down :-)

Run the same search for perl - it's probably more appropriate than php and may 
find older samples of the same ol' saying.

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-05 Thread Fernando Rodriguez
On Wednesday, August 05, 2015 6:18:07 AM Franz Fellner wrote:
 walt wrote:
  On Tue, 04 Aug 2015 08:19:37 +0200
  Franz Fellner alpine.art...@gmail.com wrote:
  
   Fernando Rodriguez wrote:
On Monday, August 03, 2015 6:41:22 PM walt wrote:
 That line declares *hostname as a constant and then the statement
 below proceeds to assign a value to the 'constant'.  I wonder how
 many hours of frustration have been suffered by student
 programmers while trying to understand the logic behind that.

Because it's not a constant, it's a pointer-to-constant :)
   Both of you are right, you can read the declaration in both ways:
   hostname is of type pointer to const char.
   *hostname is of type const char.
   
   But in this case it is not *hostname, that get's a value assigned,
   it's simply hostname. If you do not set hostname to NULL it stays
   uninitialised, which means its value is what the actual memory is set
   to - quite undefined. Correct initialization is really important and
   should be done consequently so it gets an automatism ;) (would avoid
   issues like this)
   

const char *hostname; /* pointer to constant char */
char *const hostname; /* constant pointer to char */
const char *const hostname; /* constant pointer to constant char */

Is that confusing enough?
  
  confusing++
  
  Thank you both for being patient enough to teach the ineducable :)
  
  Let me give you one more example of syntax that I find unreasonable,
  and then I'll ask my *real* question, about which I hope you will have
  opinions.
  
  Okay, the statement I referred to above uses this notation:
  
   if (!link-network-hostname)  this notation makes sense to me
   r = sd_dhcp_lease_get_hostname(lease, hostname); this doesn't
 
 The -operator returns the address of the object, in this case of 
hostname.
 If you would just pass hostname the function would receive a _copy_ of the 
object.
 hostname is an out-argument, the function writes to it. That is needed 
sometimes
 as C only can return one value, if you need to return more things you need 
to pass
 them as out-args. But for that to work you need to operate on the actual 
object and
 not a copy of it, so you need to pass the address to the actual object.
 The declaration of the function of course needs to specify the arg as 
pointer to
 the actual type, here pointer to a pointer to char.

You can look at it like that, but more technically it's because C doesn't 
support out arguments, or reference arguments, or objects. All arguments are 
passed by value. You can return multiple values in a struct but it's not very 
convenient both in terms of usability (you need to store the result in a 
variable before you can use it unless you only care about one member) and 
performance since everything needs to be copied. Plus the implementation may 
vary significantly between compilers and architectures

So in order to get a value back from the function (other than the return) you 
pass the address (a pointer) where you want that data to be written. Things 
like that make C seem primitive if your coming from a higher level language 
but it is what makes C so powerful. Once you get the hang of it and understand 
how everything works it's actually simpler than higher level languages because 
C doesn't do stuff behind you back (or does very little) so you can read C code 
a understand what's going on under the hood. Most Java and .NET developers for 
example have no clue about what goes on in their own programs under the hood.

  
  In this context does 'hostname' mean a-pointer-to-a-pointer-to-the-
  charstring we actually need?
  
  Doesn't this code seem needlessly complicated?
  
  okay, screed over, thanks for listening
  
  Somewhere I read that there was really only *one* java program ever
  written, and every subsequent java program was written by cut-and-paste
  from the first one.
  
  Is that how professional developers learn the art of programming?

That's how you write bugs :) There's nothing wrong with it if you take the 
take to understand what it's doing but it's too often done blindly.

  I really would like to hear your opinions on that question because I
  feel it's an important topic.
  
  Thanks guys.
  
  
  
 
 
 

-- 
Fernando Rodriguez



Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-05 Thread Alan McKinnon
On 05/08/2015 10:18, Fernando Rodriguez wrote:
 You can look at it like that, but more technically it's because C doesn't 
 support out arguments, or reference arguments, or objects. All arguments are 
 passed by value. You can return multiple values in a struct but it's not very 
 convenient both in terms of usability (you need to store the result in a 
 variable before you can use it unless you only care about one member) and 
 performance since everything needs to be copied. Plus the implementation may 
 vary significantly between compilers and architectures
 
 So in order to get a value back from the function (other than the return) you 
 pass the address (a pointer) where you want that data to be written. Things 
 like that make C seem primitive if your coming from a higher level language 
 but it is what makes C so powerful. Once you get the hang of it and 
 understand 
 how everything works it's actually simpler than higher level languages 
 because 
 C doesn't do stuff behind you back (or does very little) so you can read C 
 code 
 a understand what's going on under the hood. Most Java and .NET developers 
 for 
 example have no clue about what goes on in their own programs under the hood.

Thanks for the reminder. I'd forgotten much about C (not needing to read
or write it much these days)
 
   
   In this context does 'hostname' mean a-pointer-to-a-pointer-to-the-
   charstring we actually need?
   
   Doesn't this code seem needlessly complicated?
   
   okay, screed over, thanks for listening
   
   Somewhere I read that there was really only *one* java program ever
   written, and every subsequent java program was written by cut-and-paste
   from the first one.
   
   Is that how professional developers learn the art of programming?

Looking back 12 months to some former colleagues, that is *exactly* how
the Java ecosystem works. I haven't seen anyone write Java from scratch
in *years* now, all of them seem to twiddle little bits inside some huge
framework and have zero concept about what is going on.

So you get anomolies like a giant payroll/compensation/commission
reporting tool thingamagic from Oracle that does everything imaginable
about sales commissions, except actually report on them. True fax - ask
my wife


 That's how you write bugs :) There's nothing wrong with it if you take the 
 take to understand what it's doing but it's too often done blindly.
 
   I really would like to hear your opinions on that question because I
   feel it's an important topic.

Much of what makes programming work has been dumbed down in recent years
so that employable persons without imagination[1] can have jobs and do
something useful. I'm reminded of an old saw about PHP:

The nice thing about php is it let's everyone and their dog write code.
The bad thing about php is that they do.

I suppose there's a place for that kind of thing, a lot of corporate
systems are mostly boilerplate where a huge framework (and equally huge
expensive over-specced hardware) gets the job done. The thing that
really changes is the exact calculations in the business-logic
middleware layer, someone else did the heavy lifting of joining all the
modules together to resemble the real-world workflow.

It's not my way of working though, and I suspect most Gentooers tend the
same way if they get the chance.


-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-05 Thread Mick
On Wednesday 05 Aug 2015 11:47:58 Alan McKinnon wrote:
 Much of what makes programming work has been dumbed down in recent years
 so that employable persons without imagination[1] can have jobs and do
 something useful. I'm reminded of an old saw about PHP:
 
 The nice thing about php is it let's everyone and their dog write code.
 The bad thing about php is that they do.

Your imagination[1] footnote didn't make it to the list.  I thought for a 
minute that you used some php parser ...  :p

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-05 Thread Alan McKinnon
On 05/08/2015 19:20, Mick wrote:
 On Wednesday 05 Aug 2015 11:47:58 Alan McKinnon wrote:
 Much of what makes programming work has been dumbed down in recent years
 so that employable persons without imagination[1] can have jobs and do
 something useful. I'm reminded of an old saw about PHP:

 The nice thing about php is it let's everyone and their dog write code.
 The bad thing about php is that they do.
 
 Your imagination[1] footnote didn't make it to the list.  I thought for a 
 minute that you used some php parser ...  :p
 


That's what happens when you make a typo after a thinko


-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-05 Thread J. Roeleveld
On Wednesday, August 05, 2015 12:47:58 PM Alan McKinnon wrote:
 On 05/08/2015 10:18, Fernando Rodriguez wrote:
In this context does 'hostname' mean a-pointer-to-a-pointer-to-the-
charstring we actually need?

Doesn't this code seem needlessly complicated?

okay, screed over, thanks for listening

Somewhere I read that there was really only *one* java program ever
written, and every subsequent java program was written by
cut-and-paste
from the first one.

Is that how professional developers learn the art of programming?
 
 Looking back 12 months to some former colleagues, that is *exactly* how
 the Java ecosystem works. I haven't seen anyone write Java from scratch
 in *years* now, all of them seem to twiddle little bits inside some huge
 framework and have zero concept about what is going on.

Only 12 months?
Most IDEs and/or frameworks basically set up everything and just add bits like 
// Write your code here
Problems start when these ama...eerh... programmers put there code in other 
locations...

 So you get anomolies like a giant payroll/compensation/commission
 reporting tool thingamagic from Oracle that does everything imaginable
 about sales commissions, except actually report on them. True fax - ask
 my wife

Don't need to ask her, seen it with my own eyes...

It keeps amazing me that the software actually does work most of the time.

  That's how you write bugs :) There's nothing wrong with it if you take the
  take to understand what it's doing but it's too often done blindly.
  
I really would like to hear your opinions on that question because I
feel it's an important topic.
 
 Much of what makes programming work has been dumbed down in recent years
 so that employable persons without imagination[1] can have jobs and do
 something useful. I'm reminded of an old saw about PHP:
 
 The nice thing about php is it let's everyone and their dog write code.
 The bad thing about php is that they do.

Couldn't find that particular quote, but the following page should be required 
study for everyone starting with programming. (It's for PHP, but should work 
for ALL languages):
http://code.tutsplus.com/tutorials/why-youre-a-bad-php-programmer--net-18384


 I suppose there's a place for that kind of thing, a lot of corporate
 systems are mostly boilerplate where a huge framework (and equally huge
 expensive over-specced hardware) gets the job done.

Well, when you have a big rocketbooster for propulsion, why not build a car 
from solid rock without wheels?

 The thing that
 really changes is the exact calculations in the business-logic
 middleware layer, someone else did the heavy lifting of joining all the
 modules together to resemble the real-world workflow.

And then these same corporates want to add new features and such which means 
improving the codebase. Breaking the badly (or not at all) understood logic in 
the process.

 It's not my way of working though, and I suspect most Gentooers tend the
 same way if they get the chance.

++ this is why I still use Gentoo...



Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-05 Thread J. Roeleveld
On Wednesday, August 05, 2015 06:20:17 PM Mick wrote:
 On Wednesday 05 Aug 2015 11:47:58 Alan McKinnon wrote:
  Much of what makes programming work has been dumbed down in recent years
  so that employable persons without imagination[1] can have jobs and do
  something useful. I'm reminded of an old saw about PHP:
  
  The nice thing about php is it let's everyone and their dog write code.
  The bad thing about php is that they do.
 
 Your imagination[1] footnote didn't make it to the list.  I thought for a
 minute that you used some php parser ...  :p

It's not that old for an old saying.
I can't find a reference to that saying older then august 2014 using Google.

And all those are links to the same email written by our own Alan McKinnon

--
Joost



Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-05 Thread Alan McKinnon
On 05/08/2015 23:12, J. Roeleveld wrote:
 On Wednesday, August 05, 2015 06:20:17 PM Mick wrote:
 On Wednesday 05 Aug 2015 11:47:58 Alan McKinnon wrote:
 Much of what makes programming work has been dumbed down in recent years
 so that employable persons without imagination[1] can have jobs and do
 something useful. I'm reminded of an old saw about PHP:

 The nice thing about php is it let's everyone and their dog write code.
 The bad thing about php is that they do.

 Your imagination[1] footnote didn't make it to the list.  I thought for a
 minute that you used some php parser ...  :p
 
 It's not that old for an old saying.
 I can't find a reference to that saying older then august 2014 using Google.
 
 And all those are links to the same email written by our own Alan McKinnon


Ah! That's because it was I who made it up years ago and have told it to
lots of people.

About a year ago is obviously the first time I wrote it down :-)


-- 
Alan McKinnon
alan.mckin...@gmail.com




[gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-05 Thread walt
On Wed, 05 Aug 2015 23:00:36 +0200
J. Roeleveld jo...@antarean.org wrote:

 the following page should be required 
 study for everyone starting with programming. (It's for PHP, but
 should work for ALL languages):
 http://code.tutsplus.com/tutorials/why-youre-a-bad-php-programmer--net-18384

Excellent article, thanks, and interesting website.  I've been looking
for a good javascript tutorial and I see they offer several of them.





Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-05 Thread Fernando Rodriguez
On Wednesday, August 05, 2015 12:47:58 PM Alan McKinnon wrote:
 Much of what makes programming work has been dumbed down in recent years
 so that employable persons without imagination[1] can have jobs and do
 something useful. I'm reminded of an old saw about PHP:

It may be that in recent years the trend has made it to the FOSS community, 
but I'd say it goes to the mid to early 90s with Microsoft's Visual IDEs. 

By the late 90s you could write a Windows GUI application in VisualBasic 6 
mostly by drag and drop on the visual designer. With Visual Studio .NET in 
2000/1 your could do it for a web application (ASP.NET) as well and you could 
design a database driven web app without writing a single line of code. In 
VS2008 they came up with a designer where you write the program by dragging 
blocks into a flowchart[1].

These tools are nice (at least the ones for GUI apps). I wish we had similar 
tools of the same quality in the FOSS world. The problem is that you'll get 
programmers that only know how to drag and drop and when it comes to the 10% 
of the program that needs to be coded they do a horrible job.


1. https://msdn.microsoft.com/en-us/library/gg983474%28v=vs.110%29.aspx

-- 
Fernando Rodriguez



Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-04 Thread Franz Fellner
Fernando Rodriguez wrote:
 On Monday, August 03, 2015 6:41:22 PM walt wrote:
  That line declares *hostname as a constant and then the statement below
  proceeds to assign a value to the 'constant'.  I wonder how many hours
  of frustration have been suffered by student programmers while trying to
  understand the logic behind that.
 
 Because it's not a constant, it's a pointer-to-constant :)
Both of you are right, you can read the declaration in both ways:
hostname is of type pointer to const char.
*hostname is of type const char.

But in this case it is not *hostname, that get's a value assigned, it's 
simply hostname. If you do not set hostname to NULL it stays uninitialised, 
which means its value is what the actual memory is set to - quite undefined.
Correct initialization is really important and should be done consequently so 
it gets an automatism ;) (would avoid issues like this)

 
 const char *hostname; /* pointer to constant char */
 char *const hostname; /* constant pointer to char */
 const char *const hostname; /* constant pointer to constant char */
 
 Is that confusing enough?
 
 -- 
 Fernando Rodriguez
 





RE: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-04 Thread Franz Fellner
walt wrote:
 On Tue, 04 Aug 2015 08:19:37 +0200
 Franz Fellner alpine.art...@gmail.com wrote:
 
  Fernando Rodriguez wrote:
   On Monday, August 03, 2015 6:41:22 PM walt wrote:
That line declares *hostname as a constant and then the statement
below proceeds to assign a value to the 'constant'.  I wonder how
many hours of frustration have been suffered by student
programmers while trying to understand the logic behind that.
   
   Because it's not a constant, it's a pointer-to-constant :)
  Both of you are right, you can read the declaration in both ways:
  hostname is of type pointer to const char.
  *hostname is of type const char.
  
  But in this case it is not *hostname, that get's a value assigned,
  it's simply hostname. If you do not set hostname to NULL it stays
  uninitialised, which means its value is what the actual memory is set
  to - quite undefined. Correct initialization is really important and
  should be done consequently so it gets an automatism ;) (would avoid
  issues like this)
  
   
   const char *hostname; /* pointer to constant char */
   char *const hostname; /* constant pointer to char */
   const char *const hostname; /* constant pointer to constant char */
   
   Is that confusing enough?
 
 confusing++
 
 Thank you both for being patient enough to teach the ineducable :)
 
 Let me give you one more example of syntax that I find unreasonable,
 and then I'll ask my *real* question, about which I hope you will have
 opinions.
 
 Okay, the statement I referred to above uses this notation:
 
  if (!link-network-hostname)  this notation makes sense to me
  r = sd_dhcp_lease_get_hostname(lease, hostname); this doesn't

The -operator returns the address of the object, in this case of hostname.
If you would just pass hostname the function would receive a _copy_ of the 
object.
hostname is an out-argument, the function writes to it. That is needed 
sometimes
as C only can return one value, if you need to return more things you need to 
pass
them as out-args. But for that to work you need to operate on the actual object 
and
not a copy of it, so you need to pass the address to the actual object.
The declaration of the function of course needs to specify the arg as pointer 
to
the actual type, here pointer to a pointer to char.

 
 In this context does 'hostname' mean a-pointer-to-a-pointer-to-the-
 charstring we actually need?
 
 Doesn't this code seem needlessly complicated?
 
 okay, screed over, thanks for listening
 
 Somewhere I read that there was really only *one* java program ever
 written, and every subsequent java program was written by cut-and-paste
 from the first one.
 
 Is that how professional developers learn the art of programming?
 
 I really would like to hear your opinions on that question because I
 feel it's an important topic.
 
 Thanks guys.
 
 
 





[gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-04 Thread walt
On Tue, 04 Aug 2015 08:19:37 +0200
Franz Fellner alpine.art...@gmail.com wrote:

 Fernando Rodriguez wrote:
  On Monday, August 03, 2015 6:41:22 PM walt wrote:
   That line declares *hostname as a constant and then the statement
   below proceeds to assign a value to the 'constant'.  I wonder how
   many hours of frustration have been suffered by student
   programmers while trying to understand the logic behind that.
  
  Because it's not a constant, it's a pointer-to-constant :)
 Both of you are right, you can read the declaration in both ways:
 hostname is of type pointer to const char.
 *hostname is of type const char.
 
 But in this case it is not *hostname, that get's a value assigned,
 it's simply hostname. If you do not set hostname to NULL it stays
 uninitialised, which means its value is what the actual memory is set
 to - quite undefined. Correct initialization is really important and
 should be done consequently so it gets an automatism ;) (would avoid
 issues like this)
 
  
  const char *hostname; /* pointer to constant char */
  char *const hostname; /* constant pointer to char */
  const char *const hostname; /* constant pointer to constant char */
  
  Is that confusing enough?

confusing++

Thank you both for being patient enough to teach the ineducable :)

Let me give you one more example of syntax that I find unreasonable,
and then I'll ask my *real* question, about which I hope you will have
opinions.

Okay, the statement I referred to above uses this notation:

 if (!link-network-hostname)  this notation makes sense to me
 r = sd_dhcp_lease_get_hostname(lease, hostname); this doesn't

In this context does 'hostname' mean a-pointer-to-a-pointer-to-the-
charstring we actually need?

Doesn't this code seem needlessly complicated?

okay, screed over, thanks for listening

Somewhere I read that there was really only *one* java program ever
written, and every subsequent java program was written by cut-and-paste
from the first one.

Is that how professional developers learn the art of programming?

I really would like to hear your opinions on that question because I
feel it's an important topic.

Thanks guys.





Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-04 Thread Mike Gilbert
On Tue, Aug 4, 2015 at 7:56 PM, walt w41...@gmail.com wrote:
 Let me give you one more example of syntax that I find unreasonable,
 and then I'll ask my *real* question, about which I hope you will have
 opinions.

 Okay, the statement I referred to above uses this notation:

  if (!link-network-hostname)  this notation makes sense to me
  r = sd_dhcp_lease_get_hostname(lease, hostname); this doesn't

 In this context does 'hostname' mean a-pointer-to-a-pointer-to-the-
 charstring we actually need?

 Doesn't this code seem needlessly complicated?

Nope, looks like standard C to me. If you want a function to update an
argument, you need to pass a pointer to said argument. If you want to
update a pointer, you need to pass a pointer to a pointer.



[gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-03 Thread walt
On Mon, 3 Aug 2015 14:23:18 -0400
Mike Gilbert flop...@gentoo.org wrote:

 On Sun, Aug 2, 2015 at 11:16 AM, walt w41...@gmail.com wrote:
  On Sun, 2 Aug 2015 08:03:11 -0700
  walt w41...@gmail.com wrote:

  Oops, journalctl tells me that systemd-networkd is segfaulting
  repeatedly during boot.  I'm reverting back to systemd-222-r1 until
  this gets sorted out.
 
 Fixed in systemd-224-r1. Next time file a bug; I don't always read
 this list.

Thanks Mike.  The fix is amazingly simple but looking at the patch
makes me realize how little I understand the c language after years
of reading c code but not writing any :/

const char *hostname = NULL;  (upstream apparently forgot the = NULL)

That line declares *hostname as a constant and then the statement below
proceeds to assign a value to the 'constant'.  I wonder how many hours
of frustration have been suffered by student programmers while trying to
understand the logic behind that.

coughing from the dust on my 40-year-old Kernighan and Ritchie I see
that they didn't include the 'const' keyword at all.  That was a later
change introduced by some ANSI committee, bless them.

sigh I truly don't understand how any working code get written.

Anyway, thanks again for the fix :)




Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior [FIXED]

2015-08-03 Thread Fernando Rodriguez
On Monday, August 03, 2015 6:41:22 PM walt wrote:
 That line declares *hostname as a constant and then the statement below
 proceeds to assign a value to the 'constant'.  I wonder how many hours
 of frustration have been suffered by student programmers while trying to
 understand the logic behind that.

Because it's not a constant, it's a pointer-to-constant :)

const char *hostname; /* pointer to constant char */
char *const hostname; /* constant pointer to char */
const char *const hostname; /* constant pointer to constant char */

Is that confusing enough?

-- 
Fernando Rodriguez



Re: [gentoo-user] Re: systemd-224 Look out for new networking behavior

2015-08-03 Thread Mike Gilbert
On Sun, Aug 2, 2015 at 11:16 AM, walt w41...@gmail.com wrote:
 On Sun, 2 Aug 2015 08:03:11 -0700
 walt w41...@gmail.com wrote:

 I've been running systemd for a long time without needing to enable
 the dhcpcd service at boot time.  Starting with systemd-224 that is no
 longer true.

 Oops, journalctl tells me that systemd-networkd is segfaulting
 repeatedly during boot.  I'm reverting back to systemd-222-r1 until
 this gets sorted out.

Fixed in systemd-224-r1. Next time file a bug; I don't always read this list.



[gentoo-user] Re: systemd-224 Look out for new networking behavior

2015-08-02 Thread walt
On Sun, 2 Aug 2015 08:03:11 -0700
walt w41...@gmail.com wrote:

 I've been running systemd for a long time without needing to enable
 the dhcpcd service at boot time.  Starting with systemd-224 that is no
 longer true. 

Oops, journalctl tells me that systemd-networkd is segfaulting
repeatedly during boot.  I'm reverting back to systemd-222-r1 until
this gets sorted out.





[gentoo-user] Re: systemd-224 Look out for new networking behavior

2015-08-02 Thread Martin Vaeth
walt w41...@gmail.com wrote:

 Oops, journalctl tells me that systemd-networkd is segfaulting
 repeatedly during boot.

systemd has become very picky on cflags; e.g. -DNDEBUG
and friends cause strange behaviour and segfaults.