Re: [Owfs-developers] ow* Output - leading spaces trimmed?
Hi, I also think, that something like that would be a nice solution. Possibly, you could even change the default and offer --pretty or --no-trim to restore the old behaviour. I think the default should be without spaces, but we should not forget about legacy applications, of course. br, Markus On Mar 18, Paul Alfille paul.alfi...@gmail.com wrote: Why is command line argument (--trim) a bad idea? On Mon, Mar 17, 2014 at 8:38 PM, Michael Markstaller m...@elabnet.de wrote: Hmm, if you get null, is this different from a bunch of spaces with no value? Either fully or not, a switch is another bad workaround.. My other 2 cents.. Michael On 17.03.2014 22:29, brucek wrote: OK, my 2 cents worth: I use the returned length to determine if I have had a valid read or not...so I would not like it to change. How about a startup switch? Bruce -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- __/\ Markus Gaugusch \ /ASCII Ribbon Campaign markus(at)gaugusch.at X Against HTML Mail / \-- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
Maybe I am an old chap. If I do not like a function in an API, I just create a wrapper and use my own wrapper in my code. In an object oriented environment it is even simpler, I can create my own class that extends the original and changes any behavior I need to behave differently. I am not literate in python, so unfortunately cannot provide an example, but it should be straight forward. Even a switch to owfs can cause trouble, as then there will be components that need owfs be running with --trim, and other components that need owfs without --trim. To use both kinds of components in a solution, you will need ownet and two owfs instances just to avoid trimming in the code. Vajk On Tue, Mar 18, 2014 at 9:06 AM, Markus Gaugusch mar...@gaugusch.at wrote: Hi, I also think, that something like that would be a nice solution. Possibly, you could even change the default and offer --pretty or --no-trim to restore the old behaviour. I think the default should be without spaces, but we should not forget about legacy applications, of course. br, Markus On Mar 18, Paul Alfille paul.alfi...@gmail.com wrote: Why is command line argument (--trim) a bad idea? On Mon, Mar 17, 2014 at 8:38 PM, Michael Markstaller m...@elabnet.de wrote: Hmm, if you get null, is this different from a bunch of spaces with no value? Either fully or not, a switch is another bad workaround.. My other 2 cents.. Michael On 17.03.2014 22:29, brucek wrote: OK, my 2 cents worth: I use the returned length to determine if I have had a valid read or not...so I would not like it to change. How about a startup switch? Bruce -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- __/\ Markus Gaugusch \ /ASCII Ribbon Campaign markus(at)gaugusch.at X Against HTML Mail / \ -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
Actually --trim can act like -F (temperature scale) -- only on the component you want. It would passed as an argument to owserver and determine the output format. Sent via the Samsung Galaxy S™ III, an ATT 4G LTE smartphone Original message From: Vajk Fekete vaj...@gmail.com Date: 03/18/2014 5:33 AM (GMT-05:00) To: OWFS (One-wire file system) discussion and help owfs-developers@lists.sourceforge.net Subject: Re: [Owfs-developers] ow* Output - leading spaces trimmed? Maybe I am an old chap. If I do not like a function in an API, I just create a wrapper and use my own wrapper in my code. In an object oriented environment it is even simpler, I can create my own class that extends the original and changes any behavior I need to behave differently. I am not literate in python, so unfortunately cannot provide an example, but it should be straight forward. Even a switch to owfs can cause trouble, as then there will be components that need owfs be running with --trim, and other components that need owfs without --trim. To use both kinds of components in a solution, you will need ownet and two owfs instances just to avoid trimming in the code. Vajk On Tue, Mar 18, 2014 at 9:06 AM, Markus Gaugusch mar...@gaugusch.at wrote: Hi, I also think, that something like that would be a nice solution. Possibly, you could even change the default and offer --pretty or --no-trim to restore the old behaviour. I think the default should be without spaces, but we should not forget about legacy applications, of course. br, Markus On Mar 18, Paul Alfille paul.alfi...@gmail.com wrote: Why is command line argument (--trim) a bad idea? On Mon, Mar 17, 2014 at 8:38 PM, Michael Markstaller m...@elabnet.de wrote: Hmm, if you get null, is this different from a bunch of spaces with no value? Either fully or not, a switch is another bad workaround.. My other 2 cents.. Michael On 17.03.2014 22:29, brucek wrote: OK, my 2 cents worth: I use the returned length to determine if I have had a valid read or not...so I would not like it to change. How about a startup switch? Bruce -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- __ /\ Markus Gaugusch \ / ASCII Ribbon Campaign markus(at)gaugusch.at X Against HTML Mail / \ -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
What do you mean by my clients still have to expect both, wether the user added --trim or not ? I'm unclear on your setup. Do you mean programs or people? If it's a program, you can add --trim in the initialization string. On Tue, Mar 18, 2014 at 12:30 PM, Michael Markstaller m...@elabnet.de wrote: Vajk is right, it's surely easy to change/adopt in any client as we do it now by ltrimming the values.. I personally just never liked the default space-padding but it will probably break some things; A commandline option helps out personally but won't change anything here as my clients still have to expect both, wether the user added --trim or not. IMHO if - only changing the default to trimmed and add a --no-trim to save the legacy (although most known clients I tested today were fine..) would really help. So maybe the owhhtpd/JSON part could be changed and another idea without breaking other things: add an ow(net) API-call with something like _t for trimmed output (API is generated mostly anyway AFAIR) Michael -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
Vajk is right, it's surely easy to change/adopt in any client as we do it now by ltrimming the values.. I personally just never liked the default space-padding but it will probably break some things; A commandline option helps out personally but won't change anything here as my clients still have to expect both, wether the user added --trim or not. IMHO if - only changing the default to trimmed and add a --no-trim to save the legacy (although most known clients I tested today were fine..) would really help. So maybe the owhhtpd/JSON part could be changed and another idea without breaking other things: add an ow(net) API-call with something like _t for trimmed output (API is generated mostly anyway AFAIR) Michael -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
On 18.03.2014 17:34, Paul Alfille wrote: What do you mean by my clients still have to expect both, wether the user added --trim or not ? I'm unclear on your setup. Do you mean programs or people? If it's a program, you can add --trim in the initialization string. I mean programs, they run on some system not forcefully under my control, so like i.e. the user gets a RaspPi, does something, install owfs from somewhere and I (my client program) has no idea about which busmaster or options have been set calling owserver.. best regards Michael -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
Sorry, I think now I got your point: you mean adding --trim to owget/owhttpd not owserver(?) That makes sense! Michael On 18.03.2014 12:43, paul.alfille wrote: Actually --trim can act like -F (temperature scale) -- only on the component you want. It would passed as an argument to owserver and determine the output format. -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
Ok! Next release. Paul On Tue, Mar 18, 2014 at 12:42 PM, Michael Markstaller m...@elabnet.de wrote: Sorry, I think now I got your point: you mean adding --trim to owget/owhttpd not owserver(?) That makes sense! Michael On 18.03.2014 12:43, paul.alfille wrote: Actually --trim can act like -F (temperature scale) -- only on the component you want. It would passed as an argument to owserver and determine the output format. -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
The values are formatted with the standard C format parameters: %d, %u, %G in /module/owlib/src/c/ow_parseoutput.c With no particular reason to choose otherwise, no left-justification was done. The default justification looked better when printed out (it tended to stack better in tables). Although it would be trivial to change, I worry the effect on existing applications. We could always add another flag in the path name, Say /trim/10.123123233/temperature if its important enough. owget has no conception of the return value, it's just a string, so any change would have to be upstream. owhttpd would be easy to change, particularly the json implementation where the raw data is probably never presented, but rather interpreted first. owhttpd does know about the type of value. (It would be changed in /module/owhttpd/src/c/owhttpd_read.c) Currently owhttpd only formats differently for binary and bitfields, but that could be changed. Paul On Mon, Mar 17, 2014 at 9:36 AM, Michael Markstaller m...@elabnet.de wrote: Hi, one question/suggestion: I have in several clients/languages for each and every query a left-trim-function to remove the leading spaces in the output of values of owget,owhttp(text/json),.. What are these leading spaces good for? In the libow they might make sense (which=?) but in owget/owhhtpd(text/json), couldnt they just be removed before in owfs? Michael -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
Thanks Paul, I understand, just asking myself if changing this in the backend would really break something? Understand it looks nicer in owget - but anywhere else it is programatically just annoying.. I guess any client/function has to implement some parser for removing the leading whitespaces to get the value so it won't break much - although I might oversee something(?) But at least in owhttpd/text/Json they are useless overhead IMHO. In owget in breaks using it with simple (Ba)sh like let without working around the leading spaces first etc.pp. Lets hear other thoughts on this.. Michael On 17.03.2014 15:13, Paul Alfille wrote: The values are formatted with the standard C format parameters: %d, %u, %G in /module/owlib/src/c/ow_parseoutput.c With no particular reason to choose otherwise, no left-justification was done. The default justification looked better when printed out (it tended to stack better in tables). Although it would be trivial to change, I worry the effect on existing applications. We could always add another flag in the path name, Say /trim/10.123123233/temperature if its important enough. owget has no conception of the return value, it's just a string, so any change would have to be upstream. owhttpd would be easy to change, particularly the json implementation where the raw data is probably never presented, but rather interpreted first. owhttpd does know about the type of value. (It would be changed in /module/owhttpd/src/c/owhttpd_read.c) Currently owhttpd only formats differently for binary and bitfields, but that could be changed. Paul On Mon, Mar 17, 2014 at 9:36 AM, Michael Markstaller m...@elabnet.de mailto:m...@elabnet.de wrote: Hi, one question/suggestion: I have in several clients/languages for each and every query a left-trim-function to remove the leading spaces in the output of values of owget,owhttp(text/json),.. What are these leading spaces good for? In the libow they might make sense (which=?) but in owget/owhhtpd(text/json), couldnt they just be removed before in owfs? Michael -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
Michael, I agree with Paul on this. I think it is wrong to make a change to the existing behavior for this kind of reason. The law of least surprise says that what people have seen as OWFS output for the last decade should be the default way it continues to output things. It's not a question of whether people could make the changes to the new form, it's a question of forcing every app that expects the current form to rev so new apps don't have to strip the white space. There are probably apps that work and people use that have gone out of support, so breaking things is a big deal. If the issue is only for programming interfaces, it seems easy to either add an argument to wget to indicate whether it is stripped or not with the default being not stripped. You could also have a separate routine that returns a stripped version of a message so that every user does not need to invent their own. You could even add a text/JSON routine so that it is all done once. If this is to change the way OWFS looks, then Paul's idea of a pseudodirectory that indicates a stripped version is desired seems like a good way to approach it. For owhttpd, you could do a command argument that tells it to display everything in a stripped form. just my $.02. jerry On 03/17/2014 08:08 AM, Michael Markstaller wrote: Thanks Paul, I understand, just asking myself if changing this in the backend would really break something? Understand it looks nicer in owget - but anywhere else it is programatically just annoying.. I guess any client/function has to implement some parser for removing the leading whitespaces to get the value so it won't break much - although I might oversee something(?) But at least in owhttpd/text/Json they are useless overhead IMHO. In owget in breaks using it with simple (Ba)sh like let without working around the leading spaces first etc.pp. Lets hear other thoughts on this.. Michael On 17.03.2014 15:13, Paul Alfille wrote: The values are formatted with the standard C format parameters: %d, %u, %G in /module/owlib/src/c/ow_parseoutput.c With no particular reason to choose otherwise, no left-justification was done. The default justification looked better when printed out (it tended to stack better in tables). Although it would be trivial to change, I worry the effect on existing applications. We could always add another flag in the path name, Say /trim/10.123123233/temperature if its important enough. owget has no conception of the return value, it's just a string, so any change would have to be upstream. owhttpd would be easy to change, particularly the json implementation where the raw data is probably never presented, but rather interpreted first. owhttpd does know about the type of value. (It would be changed in /module/owhttpd/src/c/owhttpd_read.c) Currently owhttpd only formats differently for binary and bitfields, but that could be changed. Paul On Mon, Mar 17, 2014 at 9:36 AM, Michael Markstaller m...@elabnet.de mailto:m...@elabnet.de wrote: Hi, one question/suggestion: I have in several clients/languages for each and every query a left-trim-function to remove the leading spaces in the output of values of owget,owhttp(text/json),.. What are these leading spaces good for? In the libow they might make sense (which=?) but in owget/owhhtpd(text/json), couldnt they just be removed before in owfs? Michael -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
In my opinion having to trim the value is a miniscule annoyance compared to have an increasing number of redundant virtual directories. Vajk On Mon, Mar 17, 2014 at 6:49 PM, Jerry Scharf sch...@lagunawayconsulting.com wrote: Michael, I agree with Paul on this. I think it is wrong to make a change to the existing behavior for this kind of reason. The law of least surprise says that what people have seen as OWFS output for the last decade should be the default way it continues to output things. It's not a question of whether people could make the changes to the new form, it's a question of forcing every app that expects the current form to rev so new apps don't have to strip the white space. There are probably apps that work and people use that have gone out of support, so breaking things is a big deal. If the issue is only for programming interfaces, it seems easy to either add an argument to wget to indicate whether it is stripped or not with the default being not stripped. You could also have a separate routine that returns a stripped version of a message so that every user does not need to invent their own. You could even add a text/JSON routine so that it is all done once. If this is to change the way OWFS looks, then Paul's idea of a pseudodirectory that indicates a stripped version is desired seems like a good way to approach it. For owhttpd, you could do a command argument that tells it to display everything in a stripped form. just my $.02. jerry On 03/17/2014 08:08 AM, Michael Markstaller wrote: Thanks Paul, I understand, just asking myself if changing this in the backend would really break something? Understand it looks nicer in owget - but anywhere else it is programatically just annoying.. I guess any client/function has to implement some parser for removing the leading whitespaces to get the value so it won't break much - although I might oversee something(?) But at least in owhttpd/text/Json they are useless overhead IMHO. In owget in breaks using it with simple (Ba)sh like let without working around the leading spaces first etc.pp. Lets hear other thoughts on this.. Michael On 17.03.2014 15:13, Paul Alfille wrote: The values are formatted with the standard C format parameters: %d, %u, %G in /module/owlib/src/c/ow_parseoutput.c With no particular reason to choose otherwise, no left-justification was done. The default justification looked better when printed out (it tended to stack better in tables). Although it would be trivial to change, I worry the effect on existing applications. We could always add another flag in the path name, Say /trim/10.123123233/temperature if its important enough. owget has no conception of the return value, it's just a string, so any change would have to be upstream. owhttpd would be easy to change, particularly the json implementation where the raw data is probably never presented, but rather interpreted first. owhttpd does know about the type of value. (It would be changed in /module/owhttpd/src/c/owhttpd_read.c) Currently owhttpd only formats differently for binary and bitfields, but that could be changed. Paul On Mon, Mar 17, 2014 at 9:36 AM, Michael Markstaller m...@elabnet.de mailto:m...@elabnet.de wrote: Hi, one question/suggestion: I have in several clients/languages for each and every query a left-trim-function to remove the leading spaces in the output of values of owget,owhttp(text/json),.. What are these leading spaces good for? In the libow they might make sense (which=?) but in owget/owhhtpd(text/json), couldnt they just be removed before in owfs? Michael -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- Learn Graph Databases
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
Jerry, as I already wrote: I'm not sure if it might break something - but looking at my own code in Perl, python, bash, JS, C its always about removing the leading whitespaces. It won't fail if they aren't there.. Stripping the whitespaces in owhttp is - for me - rather a dirty workaround, but I could live with it. I just don't want to duplicate this workaround another 100 times.. Sometimes one also has to change long-lived behaviour and no one is forced to upgrade to the latest version, so nothing will break. There might have been really good reasons, to make it that way some 10J ago but these musn't stay true forever ;) Michael On 17.03.2014 18:49, Jerry Scharf wrote: Michael, I agree with Paul on this. I think it is wrong to make a change to the existing behavior for this kind of reason. The law of least surprise says that what people have seen as OWFS output for the last decade should be the default way it continues to output things. It's not a question of whether people could make the changes to the new form, it's a question of forcing every app that expects the current form to rev so new apps don't have to strip the white space. There are probably apps that work and people use that have gone out of support, so breaking things is a big deal. If the issue is only for programming interfaces, it seems easy to either add an argument to wget to indicate whether it is stripped or not with the default being not stripped. You could also have a separate routine that returns a stripped version of a message so that every user does not need to invent their own. You could even add a text/JSON routine so that it is all done once. If this is to change the way OWFS looks, then Paul's idea of a pseudodirectory that indicates a stripped version is desired seems like a good way to approach it. For owhttpd, you could do a command argument that tells it to display everything in a stripped form. just my $.02. jerry -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
On 17.03.2014 20:57, Vajk Fekete wrote: In my opinion having to trim the value is a miniscule annoyance compared to have an increasing number of redundant virtual directories. Vajk Ack, a separate Directory is IMHO no option, it's easier to ltrim.. Michael -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
OK, my 2 cents worth: I use the returned length to determine if I have had a valid read or not...so I would not like it to change. How about a startup switch? Bruce -Original Message- From: Michael Markstaller [mailto:m...@elabnet.de] Sent: Monday, March 17, 2014 4:47 PM To: owfs-developers@lists.sourceforge.net Subject: Re: [Owfs-developers] ow* Output - leading spaces trimmed? Jerry, as I already wrote: I'm not sure if it might break something - but looking at my own code in Perl, python, bash, JS, C its always about removing the leading whitespaces. It won't fail if they aren't there.. Stripping the whitespaces in owhttp is - for me - rather a dirty workaround, but I could live with it. I just don't want to duplicate this workaround another 100 times.. Sometimes one also has to change long-lived behaviour and no one is forced to upgrade to the latest version, so nothing will break. There might have been really good reasons, to make it that way some 10J ago but these musn't stay true forever ;) Michael On 17.03.2014 18:49, Jerry Scharf wrote: Michael, I agree with Paul on this. I think it is wrong to make a change to the existing behavior for this kind of reason. The law of least surprise says that what people have seen as OWFS output for the last decade should be the default way it continues to output things. It's not a question of whether people could make the changes to the new form, it's a question of forcing every app that expects the current form to rev so new apps don't have to strip the white space. There are probably apps that work and people use that have gone out of support, so breaking things is a big deal. If the issue is only for programming interfaces, it seems easy to either add an argument to wget to indicate whether it is stripped or not with the default being not stripped. You could also have a separate routine that returns a stripped version of a message so that every user does not need to invent their own. You could even add a text/JSON routine so that it is all done once. If this is to change the way OWFS looks, then Paul's idea of a pseudodirectory that indicates a stripped version is desired seems like a good way to approach it. For owhttpd, you could do a command argument that tells it to display everything in a stripped form. just my $.02. jerry -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers
Re: [Owfs-developers] ow* Output - leading spaces trimmed?
Why is command line argument (--trim) a bad idea? On Mon, Mar 17, 2014 at 8:38 PM, Michael Markstaller m...@elabnet.de wrote: Hmm, if you get null, is this different from a bunch of spaces with no value? Either fully or not, a switch is another bad workaround.. My other 2 cents.. Michael On 17.03.2014 22:29, brucek wrote: OK, my 2 cents worth: I use the returned length to determine if I have had a valid read or not...so I would not like it to change. How about a startup switch? Bruce -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech___ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers