Re: fsxNet Usenet gateway problem again

2018-09-08 Thread Peter J. Holzer
On 2018-09-06 18:03:19 +0200, Thomas Jollans wrote:
> I love that the reposted messages come with a header
> 
> Path: uni-berlin.de!<...>!.POSTED.agency.bbs.nz!not-for-mail
>^

This is normal for Usenet Messages. The format of the path header is the
same as that of UUCP mail addresses and in the early days of Usenet you
could actually use the path as the mail address of the sender in many
cases. This stopped working when UUCP was replaced by NNTP as the
transport protocol, so servers added "not-for-mail" at the end instead
of the username to prevent people from (ab)using the path as a mail
address.

hp

-- 
   _  | Peter J. Holzer| we build much bigger, better disasters now
|_|_) || because we have much more sophisticated
| |   | [email protected] | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson 


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Object-oriented philosophy

2018-09-08 Thread Michael F. Stemper
On 2018-09-06 16:04, Stefan Ram wrote:
> "Michael F. Stemper"  writes:
>>> You have a operation »Resistance( V )«.
>> Mathematically, that's an operation, I suppose. I tend to think of it
>> as either a function or a method.
> 
>   I deliberately did not use neither "a function" nor
>   "a method" because by "operation" I meant something else,
>   I meant the three methods "Resistance( V )« (literally,
>   »Resistance( self, V )«) of your three classes (and possible
>   of other model classes added in the future) /viewed together
>   as an abstract concept/ "get the resistance under 'this'
>   model", independent of any specific load model.

Took me two days, but I finally grok what you said.

>>> OOP is advantageous if you can anticipate that you will want
>>> to extend operations for other types.
>> Since the way that each operation (aside from __init__) differs
>>from one load type to the next, is there really an advantage?
> 
>   The implementation differs, but not the interface and meaning.
> 
>   The advantage is that you can extend this operation for
>   additional types /without/ modifying the existing implementations
>   (the open-closed principle!). Whereas with a single
>   procedure in a non-OOP language, you would have to /modify/
>   (error-prone!) an existing procedure.

And another advantage has surfaced through this discussion. Even though
the common code was only half-a-dozen lines or so, it changed three
times due to suggestions made in this thread. Abstracting it to a
parent meant that I only had to implement and test each of these changes
in one place, rather than three.

>>> (Non-OOP means in this case that you have a single
>>> definition of a function »Resistance( entity, V )« which
>>> contains an internal multiple branch on the type of the
>>> entity.)
>> To be honest, that sounds painful and hard to maintain. Of course,
>> back in my F77 days, it would have been the only option.
> 
>   Well, non-OOP is /not/ obsolete. It just has other specific
>   advantages and disadvantages. It could be advantageous,
>   when one adds new operations more often than new types.

To misquote "Chico Escuela", "Fortran been berry, berry good to me."

-- 
Michael F. Stemper
A preposition is something you should never end a sentence with.
-- 
https://mail.python.org/mailman/listinfo/python-list


perplexing error

2018-09-08 Thread Sharan Basappa
I am running a small python code. The main module calls another data loader 
module. I keep this getting this error.

AttributeError: 'str' object has no attribute 'raw_data' 

I tried few things in the code and finally realized that no matter the line 
number is 68 of data loader module. Of course, this was after a few iterations.
I then commented this line itself but I still get this error.

Below is a little longer code snippet.

AttributeErrorTraceback (most recent call last)
D:\Projects\Initiatives\machine learning\Log analyzer\log_analyzer.py in 
()
 32 model = para['models']
 33 assert model in ['DT', 'LR', 'SVM']
---> 34 raw_data, event_mapping_data = data_loader.bgl_data_loader(para)
 35 
 36 logger.debug("raw data %s \n", raw_data)
D:\Projects\Initiatives\machine 
learning\loglizer-master\loglizer-master\utils\data_loader.py in 
bgl_data_loader(para)
 66 # get the label for each log
 67 data_df['label'] = (data_df['label'] != '-').astype(int)
---> 68 #logger.debug("data frame %s \n", data_df)
 69 logger.debug("\n")
 70 raw_data = data_df[['label','seconds_since']].as_matrix()
AttributeError: 'str' object has no attribute 'raw_data' 

If you notice, line 68 is commented.
I am not sure what I am doing wrong.

Need some inputs ...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: don't quite understand mailing list

2018-09-08 Thread Michael F. Stemper
On 2018-09-07 21:23, Dennis Lee Bieber wrote:
> On Sat, 8 Sep 2018 00:07:36 + (UTC), Steven D'Aprano
>  declaimed the following:

>> (A mild rebuke for a mild social faux pas is not ridicule.)

>   If I wanted to get snarky -- I'd suspect a /contractor/ might be
> someone skilled in editing technical documents for a project, with little
> actual computer skills. Justification for the harsh opinion: 30 years as a
> software engineer at Lockheed Sunnyvale

Maybe Lockheed only used contractors for documentation. My previous
employer used them for much more than that: coding, testing, design.
We had one guy who only contracted to us for a year, who was a guru in
Oracle redundancy. He helped us through some rough design decisions.

Sometimes (as with the Oracle guru) we used contractors because it
didn't make sense to keep particular skills on staff. Sometimes, it
was to meet a crunch that was anticipated to be brief. Sometimes, it
was to fill an open slot while trying to find somebody to hire for
that slot.

-- 
Michael F. Stemper
87.3% of all statistics are made up by the person giving them.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: perplexing error

2018-09-08 Thread Peter Otten
Sharan Basappa wrote:

> I am running a small python code. The main module calls another data
> loader module. I keep this getting this error.
> 
> AttributeError: 'str' object has no attribute 'raw_data'
> 
> I tried few things in the code and finally realized that no matter the
> line number is 68 of data loader module. Of course, this was after a few
> iterations. I then commented this line itself but I still get this error.
> 
> Below is a little longer code snippet.
> 
> AttributeErrorTraceback (most recent call last)
> D:\Projects\Initiatives\machine learning\Log analyzer\log_analyzer.py in
> ()
>  32 model = para['models']
>  33 assert model in ['DT', 'LR', 'SVM']
> ---> 34 raw_data, event_mapping_data =
> data_loader.bgl_data_loader(para)
>  35
>  36 logger.debug("raw data %s \n", raw_data)
> D:\Projects\Initiatives\machine
> learning\loglizer-master\loglizer-master\utils\data_loader.py in
> bgl_data_loader(para)
>  66 # get the label for each log
>  67 data_df['label'] = (data_df['label'] != '-').astype(int)
> ---> 68 #logger.debug("data frame %s \n", data_df)
>  69 logger.debug("\n")
>  70 raw_data = data_df[['label','seconds_since']].as_matrix()
> AttributeError: 'str' object has no attribute 'raw_data'
> 
> If you notice, line 68 is commented.
> I am not sure what I am doing wrong.
> 
> Need some inputs ...

The source code in the traceback is read from the file when the exception is 
raised. If you edit a module after importing it the traceback may pick lines 
that caused the code raising the exception, but now contain something 
completely different. A little demo:

>>> with open("tmp.py", "w") as f: f.write("def f():\n return 1/0\n")
... 
21
>>> import tmp
>>> with open("tmp.py", "w") as f: f.write("def f():\n return 1/2\n")
... 
21
>>> tmp.f()
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/peter/tmp.py", line 2, in f
return 1/2
ZeroDivisionError: division by zero

Therefore you must ensure that the interpreter is restarted after changing 
the source code. This may include restarting a server or an editor.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: perplexing error

2018-09-08 Thread Peter Pearson
On 8 Sep 2018 17:25:52 GMT, Stefan Ram  wrote:
> Sharan Basappa  writes:
>> 66 # get the label for each log
>> 67 data_df['label'] = (data_df['label'] != '-').astype(int)
>>---> 68 #logger.debug("data frame %s \n", data_df)
>> 69 logger.debug("\n")
>> 70 raw_data = data_df[['label','seconds_since']].as_matrix()
>>AttributeError: 'str' object has no attribute 'raw_data' 
>>If you notice, line 68 is commented.
>>I am not sure what I am doing wrong.
>
>   In such cases, I do:
>
> print( 'at position 1' )
> data_df['label'] = (data_df['label'] != '-').astype(int)
> print( 'at position 2' )
> raw_data = data_df[['label','seconds_since']].as_matrix()
> print( 'at position 3' )
>
>   . If the last text printed is "at position 1", I will then
>   split even more:
>
> print( 'at position 1' )
> tmp = (data_df['label'] != '-').astype(int)
> print( 'at position 1a' )
> data_df['label'] = tmp
> print( 'at position 2' )
> raw_data = data_df[['label','seconds_since']].as_matrix()
> print( 'at position 3' )
>
>   and so on until the cause is reduced to the smallest
>   possible unit of code.

This approach is especially valuable when it turns out that
the file you're editing is not the file being included.

-- 
To email me, substitute nowhere->runbox, invalid->com.
-- 
https://mail.python.org/mailman/listinfo/python-list


Python now a top-3 programming language as Julia's rise speeds up

2018-09-08 Thread Internetado
Python has entered the top three for the first time in the TIOBE 
programming language index, surpassed only by C and Java.


According to TIOBE, Python is now becoming "increasingly ubiquitous" 
and a top choice at universities for all subjects that require 
programming, as well as in industry. The key to its popularity is it's 
easy to learn, install, and deploy.[...]


https://www.zdnet.com/article/python-now-a-top-3-programming-language-as-julias-rise-speeds-up/#ftag=RSSbaffb68

--
Eduardo
--
--
https://mail.python.org/mailman/listinfo/python-list