Re: Compression of random binary data

2017-10-23 Thread Marko Rauhamaa
Gregory Ewing :

> What you *can't* do is compress 16 random decimal digits to less than
> 6.64 bytes.

More precisely:

   Regardless of the compression scheme, the probability of shortening
   the next bit sequence is less than 0.5 if the bits are distributed
   evenly, randomly and independently.

Often the distribution is not even, or there is interdependence between
the bits. Then, a compression scheme can do miracles.


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


Re: IDLE doesn't recognise installed packages

2017-10-23 Thread Terry Reedy

On 10/23/2017 10:23 AM, Daniel Tangemann wrote:

I've recently downloaded and installed python 3.6. (I had already also 2.7 and 3.2 on my computer) 
Initially pip was looking in the wrong directory to install to, so I changed that. then it had 
trouble installing matplotlib, so I decided to get rid of the older versions of python, which 
srewed things up even more. now scrips that I had written (in 3.6), that were running without 
errors before, aren't working anymore. I tried reinstalling python, and I tried the repair option 
multiple times as well. when I look into the python folder, I can see the modules that I have 
installed (and that I import into those scripts), but the IDLE doesn't see them! what's even more 
weird, is that "pip list" doesn't bring up anything but pip itself, while typing 
"pip install matplotlib" returns a message that
   it's already installed. how do I fix this?
cheers


Recognition of installed packages is done by the python running IDLE and 
executing your import statements, by not IDLE.  The only effect IDLE 
could have is any manipulation of sys.path.


You can find the executable running IDLE with

>>> import sys; sys.executable
'C:\\Programs\\Python37\\pythonw.exe'

Find the sys.path being used with
>>> sys.path

If you run the same binary (minus the 'w' if present), you can find the 
sys.path used without IDLE.  You can also test imports without IDLE in use.


It is possible that you have more than one binary around, but I cannot 
tell from here.  To make sure you are running pip with the same binary 
as IDLE, enter path-to-binary  -m pip instance, on windows, given the above


path> C:\Programs\Python37\python.exe -m pip list

--
Terry Jan Reedy

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


Re: Compression of random binary data

2017-10-23 Thread Gregory Ewing

danceswithnumb...@gmail.com wrote:

I did that quite a while ago. 352,954 kb.


Are you sure? Does that include the size of all the
code, lookup tables, etc. needed to decompress it?

But even if you have, you haven't disproved the theorem about
compressing random data. All you have is a program that
compresses *that particular* sequence of a million digits.

To disprove the theorem, you would need to exhibit an
algorithm that can compress *any* sequence of a million
digits to less than 415,241 bytes.

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


Re: Compression of random binary data

2017-10-23 Thread Gregory Ewing

danceswithnumb...@gmail.com wrote:

12344321

It only takes seven 8 bit bytes to represent this


This is not surprising. The theoretical minimum size
for 16 arbitrary decimal digits is:

log2(10) * 16 = 53.15 bits = 6.64 bytes

I think you misunderstand what is meant by the phrase
"random data cannot be compressed".

A string of decimal digits represented in ASCII is
*not* completely random. There are 256 possible values
for each byte, and you're only using 10 of them.

What you *can't* do is compress 16 random decimal
digits to less than 6.64 bytes.

If you have something that you think can do better
than that, we would like to see it.

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


Re: Compression of random binary data

2017-10-23 Thread Chris Angelico
On Tue, Oct 24, 2017 at 2:28 AM, Paul Moore  wrote:
> Hope this helps put the subject into context. Compression is a very
> technical subject, to "do it right". Special cases can be worked out,
> sure, but the "hidden assumptions" in a method are what make the
> difference between a "compression algorithm" and a "way of storing my
> particular data more efficiently".

And to put *this* into context and perspective, both of the above are
extremely useful tools/algorithms. Generalized compression algos are
used all the time, special-purpose lossy compression algos too, and
"way[s] of storing my particular data more efficiently" are utterly
crucial to many applications. But they're not universal compression
schemes.

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


Re: Compression of random binary data

2017-10-23 Thread Steve D'Aprano
On Tue, 24 Oct 2017 03:13 pm, danceswithnumb...@gmail.com wrote:

> I did that quite a while ago. 352,954 kb.

Sure you did. Let's see the code you used.




-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

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


Re: Compression of random binary data

2017-10-23 Thread danceswithnumbers
I did that quite a while ago. 352,954 kb. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compression of random binary data

2017-10-23 Thread Steve D'Aprano
On Tue, 24 Oct 2017 01:27 pm, danceswithnumb...@gmail.com wrote:

> Finally figured out how to turn this into a random binary compression
> program. Since my transform can compress more than dec to binary. Then i
> took a random binary stream, changed it to a decimal stream 0-9 tranformed
> it into a compressed/encrypted binary stream 23.7% smaller. 

Smaller than the original binary stream? I don't think so.

There's nothing clever about "compressing" a random binary stream if first you
expand it, then remove the extra space you added and claim victory because
the result is smaller than the expanded version.


> Yes! Decode reverse is easy..sorry so excited i could shout.

Then this should be easy for you:

http://marknelson.us/2012/10/09/the-random-compression-challenge-turns-ten/

All you need to do is compress this file:

http://marknelson.us/attachments/million-digit-challenge/AMillionRandomDigits.bin

to less than 415241 bytes, and you can win $100.





-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

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


Re: Compression of random binary data

2017-10-23 Thread danceswithnumbers
Finally figured out how to turn this into a random binary compression program. 
Since my transform can compress more than dec to binary. Then i took a random 
binary stream, changed it to a decimal stream 0-9 tranformed it into a 
compressed/encrypted binary stream 23.7% smaller. Yes! Decode reverse is 
easy..sorry so excited i could shout. 

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


Re: Installing tkinter on FreeBSD

2017-10-23 Thread Thomas Jollans
On 24/10/17 00:16, Dick Holmes wrote:
> I am trying to use tkinter on a FreeBSD system but the installed 
> versions of Python (2.7 and 3.6) don't have thinter configured. I tried 
> to download the source (no binaries available for FreeBSD) and build a 
> new version of Python but the build reported that it couldn't install 
> _tkinter. Despite this report, Python works for non-tkinter 
> applications. Is there a magical formula for configuring tkinter during 
> or after a build??

If you have Tcl/Tk installed, the configure script should detect it.

Is Tcl/Tk installed? If yes, does the configure script output say
anything about tcl, tk or tkinter?


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


Re: Sandsifter software finds hidden instructions inside processors.

2017-10-23 Thread skybuck2000
On Tuesday, October 24, 2017 at 1:13:22 AM UTC+2, MRAB wrote:
> On 2017-10-23 23:50, skybuck2...@hotmail.com wrote:
> > Question:
> > 
> > What do the letters
> > 
> > #   v  l  s  c
> > 
> > Stand for in this source code ?
> > 
> > v = not valid/valid
> > l = length
> > s = ?
> > c = ?
> > 
> > If somebody with lots of python experience could dive into this code and 
> > then tell me I'd be most gratefull ! :)
> > 
> > 
> > 
> > #
> > # ./sifter.py --unk --dis --len --sync --tick -- -P1 -t
> > # ./injector -P1 -t -t -R -0 -s 4293486582
> > #
> > # insn tested: 129563
> > # artf found:  0
> > # runtime: 00:00:04.23
> > # seed:4293486582
> > # arch:64
> > # date:2017-10-22 16:10:51
> > #
> > # cpu:
> > # processor : 0
> > # vendor_id : AuthenticAMD
> > # cpu family: 15
> > # model : 43
> > # model name: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
> > # stepping  : 1
> > # microcode : 0x4d
> > #   v  l  s  c
> >  0f0d00  1  3  5  2 
> > (0f0d)
> >  0f0d01  1  3  5  2 
> > (0f0d0100)
> >  0f0d02  1  3  5  2 
> > (0f0d0200)
> >  0f0d03  1  3  5  2 
> > (0f0d0300)
> >0f0d0400  1  4  5  2 
> > (0f0d0400)
> >0f0d0401  1  4  5  2 
> > (0f0d0401)
> >0f0d0402  1  4  5  2 
> > (0f0d0402)
> >0f0d0403  1  4  5  2 
> > (0f0d0403)
> >0f0d0404  1  4  5  2 
> > (0f0d0404)
> >0f0d0405  1  8  5  2 
> > (0f0d0405)
> >0f0d04050100  1  8  5  2 
> > (0f0d04050100)
> >0f0d04050200  1  8  5  2 
> > (0f0d04050200)
> >0f0d04050300  1  8  5  2 
> > (0f0d04050300)
> >0f0d04050400  1  8  5  2 
> > (0f0d04050400)
> > 
> > Bye,
> >Skybuck.
> > 
> 
> v = valid
> l = length
> s = signum
> c = sicode

Thank you, at least signum seems correct, I will investigate sicode later !;)

So far found this tabel describing the meaning for these values:

https://people.cs.pitt.edu/~alanjawi/cs449/code/shell/UnixSignals.htm

Unix Signals
SIGHUP  1   ExitHangup
SIGINT  2   ExitInterrupt
SIGQUIT 3   CoreQuit
SIGILL  4   CoreIllegal Instruction
SIGTRAP 5   CoreTrace/Breakpoint Trap
SIGABRT 6   CoreAbort
SIGEMT  7   CoreEmulation Trap
SIGFPE  8   CoreArithmetic Exception
SIGKILL 9   ExitKilled
SIGBUS  10  CoreBus Error
SIGSEGV 11  CoreSegmentation Fault
SIGSYS  12  CoreBad System Call
SIGPIPE 13  ExitBroken Pipe
SIGALRM 14  ExitAlarm Clock
SIGTERM 15  ExitTerminated
SIGUSR1 16  ExitUser Signal 1
SIGUSR2 17  ExitUser Signal 2
SIGCHLD 18  Ignore  Child Status
SIGPWR  19  Ignore  Power Fail/Restart
SIGWINCH 20 Ignore  Window Size Change
SIGURG  21  Ignore  Urgent Socket Condition
SIGPOLL 22  Ignore  Socket I/O Possible
SIGSTOP 23  StopStopped (signal)
SIGTSTP 24  StopStopped (user)
SIGCONT 25  Ignore  Continued
SIGTTIN 26  StopStopped (tty input)
SIGTTOU 27  StopStopped (tty output)
SIGVTALRM 28ExitVirtual Timer Expired
SIGPROF 29  ExitProfiling Timer Expired
SIGXCPU 30  CoreCPU time limit exceeded
SIGXFSZ 31  CoreFile size limit exceeded
SIGWAITING 32   Ignore  All LWPs blocked
SIGLWP  33  Ignore  Virtual Interprocessor Interrupt for Threads Library
SIGAIO  34  Ignore  Asynch

5 is indeed trap I know that much ! ;)

Bye,
  Skybuck.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sandsifter software finds hidden instructions inside processors.

2017-10-23 Thread skybuck2000
Idea of this software is basically:

Generate random bytes and feed them to processor.

Observe result of processor if good or bad (error codes).

If good check docs.
If bad adjust and retry.

Somebody wrote a nice short explanation of what SandSifter does to give you an 
idea (it's a new algorithm to find undocumented instructions fast !):

It's guessing possible X86 instructions by exploiting the Instruction Decoder 
via the (PF) Page Fault result code. Effectively splitting an instruction 
across two pages and only having one page of it executable. When the decoder 
fetches the instruction it notices that it's incomplete, attempts to fetch the 
next part that is on a new non-executable page. The decoder then throws a page 
fault since it's not executable. So it moves the entire instruction one to the 
left and tries again with various combinations until it doesn't get a page 
fault at which point it executes it.

And thus it attempts to 'tunnel' through every possible instruction. That's the 
general very simplified explanation.

Bye,
  Skybuck.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sandsifter software finds hidden instructions inside processors.

2017-10-23 Thread MRAB

On 2017-10-23 23:50, skybuck2...@hotmail.com wrote:

Question:

What do the letters

#   v  l  s  c

Stand for in this source code ?

v = not valid/valid
l = length
s = ?
c = ?

If somebody with lots of python experience could dive into this code and then 
tell me I'd be most gratefull ! :)



#
# ./sifter.py --unk --dis --len --sync --tick -- -P1 -t
# ./injector -P1 -t -t -R -0 -s 4293486582
#
# insn tested: 129563
# artf found:  0
# runtime: 00:00:04.23
# seed:4293486582
# arch:64
# date:2017-10-22 16:10:51
#
# cpu:
# processor : 0
# vendor_id : AuthenticAMD
# cpu family: 15
# model : 43
# model name: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
# stepping  : 1
# microcode : 0x4d
#   v  l  s  c
 0f0d00  1  3  5  2 (0f0d)
 0f0d01  1  3  5  2 (0f0d0100)
 0f0d02  1  3  5  2 (0f0d0200)
 0f0d03  1  3  5  2 (0f0d0300)
   0f0d0400  1  4  5  2 (0f0d0400)
   0f0d0401  1  4  5  2 (0f0d0401)
   0f0d0402  1  4  5  2 (0f0d0402)
   0f0d0403  1  4  5  2 (0f0d0403)
   0f0d0404  1  4  5  2 (0f0d0404)
   0f0d0405  1  8  5  2 (0f0d0405)
   0f0d04050100  1  8  5  2 (0f0d04050100)
   0f0d04050200  1  8  5  2 (0f0d04050200)
   0f0d04050300  1  8  5  2 (0f0d04050300)
   0f0d04050400  1  8  5  2 (0f0d04050400)

Bye,
   Skybuck.



v = valid
l = length
s = signum
c = sicode
--
https://mail.python.org/mailman/listinfo/python-list


Re: Sandsifter software finds hidden instructions inside processors.

2017-10-23 Thread skybuck2000
Question:

What do the letters

#   v  l  s  c

Stand for in this source code ?

v = not valid/valid
l = length
s = ?
c = ?

If somebody with lots of python experience could dive into this code and then 
tell me I'd be most gratefull ! :)



#
# ./sifter.py --unk --dis --len --sync --tick -- -P1 -t
# ./injector -P1 -t -t -R -0 -s 4293486582
#
# insn tested: 129563
# artf found:  0
# runtime: 00:00:04.23
# seed:4293486582
# arch:64
# date:2017-10-22 16:10:51
#
# cpu:
# processor : 0
# vendor_id : AuthenticAMD
# cpu family: 15
# model : 43
# model name: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
# stepping  : 1
# microcode : 0x4d
#   v  l  s  c
0f0d00  1  3  5  2 (0f0d)
0f0d01  1  3  5  2 (0f0d0100)
0f0d02  1  3  5  2 (0f0d0200)
0f0d03  1  3  5  2 (0f0d0300)
  0f0d0400  1  4  5  2 (0f0d0400)
  0f0d0401  1  4  5  2 (0f0d0401)
  0f0d0402  1  4  5  2 (0f0d0402)
  0f0d0403  1  4  5  2 (0f0d0403)
  0f0d0404  1  4  5  2 (0f0d0404)
  0f0d0405  1  8  5  2 (0f0d0405)
  0f0d04050100  1  8  5  2 (0f0d04050100)
  0f0d04050200  1  8  5  2 (0f0d04050200)
  0f0d04050300  1  8  5  2 (0f0d04050300)
  0f0d04050400  1  8  5  2 (0f0d04050400)

Bye,
  Skybuck.
-- 
https://mail.python.org/mailman/listinfo/python-list


Installing tkinter on FreeBSD

2017-10-23 Thread Dick Holmes
I am trying to use tkinter on a FreeBSD system but the installed 
versions of Python (2.7 and 3.6) don't have thinter configured. I tried 
to download the source (no binaries available for FreeBSD) and build a 
new version of Python but the build reported that it couldn't install 
_tkinter. Despite this report, Python works for non-tkinter 
applications. Is there a magical formula for configuring tkinter during 
or after a build??

TIA!

--
Dick Holmes

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


Re: grapheme cluster library

2017-10-23 Thread Thomas Jollans
On 23/10/17 16:25, Rustom Mody wrote:
> On Monday, October 23, 2017 at 1:15:35 PM UTC+5:30, Steve D'Aprano wrote:
>>
>> and more. Many linguists also include digraphs (pairs of letters) like the
>> English "th", "sh", "qu", or "gh" as graphemes.
>>
>>
>> https://www.thoughtco.com/what-is-a-grapheme-1690916
>>
>> https://en.wikipedia.org/wiki/Grapheme
> 
> Um… Ok So I am using the wrong word? Your first link says:
> | For example, the word 'ghost' contains five letters and four graphemes 
> | ('gh,' 'o,' 's,' and 't')
> 
> Whereas new regex findall does:
> 
 findall(r'\X', "ghost")
> ['g', 'h', 'o', 's', 't']
 findall(r'\X', "church")
> ['c', 'h', 'u', 'r', 'c', 'h']
> 

The definition of a "grapheme" in the Unicode standard does not
necessarily line up with linguistic definition of grapheme for any
particular language.

Even if we assumed that there was a universally agreed definition of the
term for every written language (for English there certainly isn't),
you'd dictionaries information on which language you're dealing with to
pull this trick off.

As an example to illustrate why you'd need dictionaries:

In Dutch, "ij" (the "long IJ", as opposed to the "greek Y") is generally
considered a single letter, or at the very least a single grapheme.
There is a unicode codepoint for it (ij), but it isn't widely used.

So "vrij" (free) has three graphemes (v r ij) and three or four letters.
However, in "bijectie" (bijection), "i" and "j" are two separate
graphemes, so this word has eight letters and seven or eight graphemes.
("ie" may or may not be one single grapheme...)


-- Thomas


PS: This may not be obvious to you at first unless you're Dutch.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Windows alternative: multiprocessing.connection.wait on Pipe, Tkinter File Handlers

2017-10-23 Thread Thomas Jollans
On 23/10/17 18:34, Josh Jacobson wrote:
> The two functions in the subject are not fully implementable on Windows,
> and so I am looking for an alternative.
> 
> Relevant SO postings including full code and description, with bounty:
> Freezes
> ,
> Input
> 
> 
> 
> 
> I have two scripts:
> 
> *Processor_child.py*: Its purpose is to perform a number of data analysis
> and cleaning operations. This must perform the same operations when run
> alone (without Tkinter_parent.py) as it does when packaged into a GUI with
> Tkinter_parent.py.
> 
> *Tkinter_parent.py*: Its purpose is to provide a GUI for those who can't
> use Processor_child directly.Within Processor_child, there are for loops
> that ask the user for input on each iteration. These prompts need to appear
> in the Tkinter app, accept the input, and send it back to Processor_child.
> 
> 
> 
> The main issue is having the script not move forward on execution until
> input has been sent.
> 
> I know of three ways to theoretically solve this, but *none of these work
> in production on a Windows machine*:
> 
> 1. while pipe1.poll() != True:
> 
> time.sleep(0.1)

My intuition tells me that this kind of thing should be in a separate
thread rather than buried in the main loop. You might wait in a thread
and somehow (no idea what the best way to do this is in tkinter) pass a
message to the GUI thread when it's done.

Not sure if this will help.

> 
> This causes constant loading and a "freezing" like user experience.
> 
> 2. multiprocessing.connection.wait
> 
> From the documentation: ""Windows: ... Note that pipe handles and socket
> handles are not waitable handles."
> 
> 3. Tkinter file handlers
> 
> From the documentation: "This feature is not available on Windows."

Both of these are about Windows not having the same select() system call
as *nix. You can work around this by using a local (loopback) TCP
connection rather than a multiprocessing-supplied pipe (--> socket
module). Then you can use select on both Windows and *nix (-->select
module).

Why do the GUI and the processing have to be in separate scripts? Maybe
it would be easier to import the processing bits as a module and then
run them "directly" - possibly via multiprocessing or threading.

> 
> 
> *Given that none of the 3 available options works on Windows, what options
> are available for Windows machines?*
> 
> See Tkinter application 'freezes' while continually polling Pipe for
> contents (multiprocessing)
> 
> and How can I implement an `input` method in a Tkinter parent script, with
> the displayed prompt and return value being sent back to a child script?
> 
> for further description and code samples.
> 

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


Re: Compression of random binary data

2017-10-23 Thread Ian Kelly
On Mon, Oct 23, 2017 at 1:42 PM,   wrote:
> Wow, do programmers actually use zscii. That is huge. So much wated space.

Not really. ZSCII is only relevant if you're writing Z-code or a
Z-code interpreter. Those in turn are only relevant if you're writing
Infocom games.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: choice of web-framework

2017-10-23 Thread Chris Warrick
On 23 October 2017 at 21:37, John Black  wrote:
> Chris, thanks for all this detailed information.  I am confused though
> with your database recommendation.  You say you teach SQLAlchemy but
> generally use PostgreSQL yourself.  I can maybe guess why there seems to
> be this contradiction.  Perhaps PostgreSQL is better but too advanced for
> the class you are teaching?  Can you clarify on which you think is the
> better choice?  Thanks.

Different Chris, but I’ll answer. Those are two very different things.

PostgreSQL is a database server. It talks SQL to clients, stores data,
retrieves it when asked. The usual stuff a database server does.
Alternatives: SQLite, MySQL, MS SQL, Oracle DB, …

SQLAlchemy is an ORM: an object-relational mapper, and also a database
toolkit. SQLAlchemy can abstract multiple database servers/engines
(PostgreSQL, SQLite, MySQL, etc.) and work with them from the same
codebase. It can also hide SQL from you and instead give you Python
classes. If you use an ORM like SQLAlchemy, you get database support
without writing a single line of SQL on your own. But you still need a
database engine — PostgreSQL can be one of them. But you can deploy
the same code to different DB engines, and it will just work™
(assuming you didn’t use any DB-specific features). Alternatives:
Django ORM.

psycopg2 is an example of a PostgreSQL client library for Python. It
implements the Python DB-API and lets you use it to talk to a
PostgreSQL server. When using psycopg2, you’re responsible for writing
your own SQL statements for the server to execute. In that approach,
you’re stuck with PostgreSQL and psycopg2 unless you rewrite your code
to be compatible with the other database/library. Alternatives (other
DBs): sqlite3, mysqlclient. There are also other PostgreSQL libraries
available.

-- 
Chris Warrick 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compression of random binary data

2017-10-23 Thread danceswithnumbers
Wow, do programmers actually use zscii. That is huge. So much wated space.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: choice of web-framework

2017-10-23 Thread John Black
In article , 
ros...@gmail.com says...
> For the database, I generally use PostgreSQL, unless the job's so
> simple it can be done with flat files. Using Flask with SQLAlchemy is
> a popular option, but you can also dive into psycopg2 directly (the
> "2" doesn't mean "Python 2.7 only", it's fine). The tech stack
> Python+Flask+SQLAlchemy+PostgreSQL+Linux is an extremely solid one, or
> you can switch out any part fairly easily.
> 
> Disclaimer: I use Flask and SQLAlchemy when I'm teaching my students
> how to build web apps in Python, but I don't have much experience with
> any other frameworks or ORMs. Other options may very well be viable
> and/or superior; all I can say is that the above *is* viable.

Chris, thanks for all this detailed information.  I am confused though 
with your database recommendation.  You say you teach SQLAlchemy but 
generally use PostgreSQL yourself.  I can maybe guess why there seems to 
be this contradiction.  Perhaps PostgreSQL is better but too advanced for  
the class you are teaching?  Can you clarify on which you think is the 
better choice?  Thanks.

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


Re: Searching For Old Posts On Python

2017-10-23 Thread Cai Gengyang
Right ... I am going to continue learning Python then ...



On Thursday, October 19, 2017 at 3:39:44 AM UTC+8, Ian wrote:
> On Mon, Oct 16, 2017 at 10:42 PM, Cai Gengyang  wrote:
> > https://duckduckgo.com/html/?q=%22Cai%20Gengyang%22%20python  This
> > seems to be the only method that works, using DuckDuckGo
> 
> Or any search engine, really.
> https://www.google.com/search?q=site%3Apython.org+cai+gengyang


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


Windows alternative: multiprocessing.connection.wait on Pipe, Tkinter File Handlers

2017-10-23 Thread Josh Jacobson
The two functions in the subject are not fully implementable on Windows,
and so I am looking for an alternative.

Relevant SO postings including full code and description, with bounty:
Freezes
,
Input




I have two scripts:

*Processor_child.py*: Its purpose is to perform a number of data analysis
and cleaning operations. This must perform the same operations when run
alone (without Tkinter_parent.py) as it does when packaged into a GUI with
Tkinter_parent.py.

*Tkinter_parent.py*: Its purpose is to provide a GUI for those who can't
use Processor_child directly.Within Processor_child, there are for loops
that ask the user for input on each iteration. These prompts need to appear
in the Tkinter app, accept the input, and send it back to Processor_child.



The main issue is having the script not move forward on execution until
input has been sent.

I know of three ways to theoretically solve this, but *none of these work
in production on a Windows machine*:

1. while pipe1.poll() != True:

time.sleep(0.1)

This causes constant loading and a "freezing" like user experience.

2. multiprocessing.connection.wait

>From the documentation: ""Windows: ... Note that pipe handles and socket
handles are not waitable handles."

3. Tkinter file handlers

>From the documentation: "This feature is not available on Windows."


*Given that none of the 3 available options works on Windows, what options
are available for Windows machines?*

See Tkinter application 'freezes' while continually polling Pipe for
contents (multiprocessing)

and How can I implement an `input` method in a Tkinter parent script, with
the displayed prompt and return value being sent back to a child script?

for further description and code samples.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compression of random binary data

2017-10-23 Thread Neil Cerutti
On 2017-10-23, alister via Python-list  wrote:
>> 12344321
>>
>> It only takes seven 8 bit bytes to represent this
>
> Would you care to provide the seven 8-bit bytes you propose to use?
> Paul

 I would suspect he is using BCD & storing 2 values in reach
 byte that is not what is meant by you cant compress random
 data. his compression is simply removing redundant space
 from an inefficient coding
>>>
>>> I suspect he is using ASCII and storing one value in each byte.
>> 
>> There's also ZSCII, which stores roughly 3 characters every 2
>> bytes. Since all the digits are in A2, this sequence would
>> take up 7 bytes in ZSCII as well.
>> 
>> http://inform-fiction.org/zmachine/standards/z1point0/sect03.html
>
> not sure how 16 characters can be represented by either ascii
> or zscii in only 8 bytes

Oops! I hastily counted completely wrong. It's 10 bytes in ZSCII
version 2, using a shift-lock.

   * 16 bits* 
12 ->  0 00101 01001 01010
349 -> 0 01011 01100 10001
999 -> 0 10001 10001 10001
888 -> 0 1 1 1
843 -> 0 1 01100 01011
21  -> 1 01010 01001 00101

-- 
Neil Cerutti

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


Re: I used list, def. why li += [100,200] , and li = li + [100,200] is different

2017-10-23 Thread Bill

Rob Gaddi wrote:

On 10/23/2017 09:29 AM, 임현준 wrote:

I am a Korean student, and I am a beginner in English and Python.;(

I can't understand about this def

If I want to print

[1,2,3,4,5]
[1,2,3,4,5,100,200]

I will make code like this, and I can understand code.


def modify(li):
  li += [100,200]

list = [1,2,3,4,5]
print(list)
modify(list)
print(list)


BUT, when I make code like this.

I will make code like this, and I can understand code.


def modify(li):
  li = li + [100,200]

list = [1,2,3,4,5]
print(list)
modify(list)
print(list)



python print

[1,2,3,4,5]
[1,2,3,4,5]

why 'li+= [100,200]'and 'li = li + [100,200]' 's print is different
please help me



Lists are mutable, they can be changed.  Your call to += is equivalent 
to a call to li.extend([100, 200]), which changes the single existing 
object pointed to by the "li" reference.  The second time, however, 
you take the existing value that "li" refers to [1,2,3,4,5], create a 
new object that is ([1,2,3,4,5] + [100,200]), and reassign the local 
reference "li" to point to that new object.  Then your function ends, 
"li" goes out of scope, nothing points to that newly created object 
and it gets lost.





The problem and both solutions are great!  Thanks for posting!

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


Re: I used list, def. why li += [100, 200] , and li = li + [100, 200] is different

2017-10-23 Thread Rhodri James

On 23/10/17 17:29, 임현준 wrote:

I am a Korean student, and I am a beginner in English and Python.;(

I can't understand about this def

If I want to print

[1,2,3,4,5]
[1,2,3,4,5,100,200]

I will make code like this, and I can understand code.


def modify(li):
  li += [100,200]
> list = [1,2,3,4,5]
print(list)
modify(list)
print(list) 


Here is approximately what Python does when you run this:

* Create a list [1,2,3,4,5]

* Give the list the name "list".  In talking about Python we often say 
that it *binds* the name "list" to the list [1,2,3,4,5].  (It is usually 
a bad idea to use names like "list" that also have a meaning in Python, 
but we will ignore that for now.)



list \
  +---+
  | 1,2,3,4,5 |
  +---+

* Print the object bound to the name "list", which is the list [1,2,3,4,5].

* Call modify().  This also binds the name "li" to the object that 
"list" is bound to.



list \
  +---+
  | 1,2,3,4,5 |
  +---+
li --/

* Create a new list [100,200]

* "li += [100,200]" for a list means "change the list bound to the name 
'li' by joining the new list onto the end of it.  It is still the same 
object, it just has some more added to it.


list \
  +---+
  | 1,2,3,4,5,100,200 |
  +---+
li --/

"list" is still bound to the same object, so you see the changes outside 
the function modify().




BUT, when I make code like this.

I will make code like this, and I can understand code.


def modify(li):
  li = li + [100,200]


What happens here is a little different.  It starts off the same with 
"li" and "list" bound to the same object:


list \
  +---+
  | 1,2,3,4,5 |
  +---+
li --/

and a new object [100,200] that doesn't have a name.  What happens next is:

* Take the object bound to the name "li" and the unnamed object 
[100,200], and create a *new* object by joining them together.


* Bind the name "li" to this new object

list \
  +---+
  | 1,2,3,4,5 |
  +---+

li --\
  +---+
  | 1,2,3,4,5,100,200 |
  +---+

Notice that it is only the name "li" that is bound.  The name "list" 
still refers to the original object.  When we return from the function, 
we stop using the name "li" and nothing refers to our new object 
[1,2,3,4,5,100,200] any more.  Python will quietly delete it ("garbage 
collect") in the background.


The key is that "+" on its own creates a new object, while "+=" alters 
the existing object.


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: Compression of random binary data

2017-10-23 Thread danceswithnumbers
Good point

I hope it has a use, other than a cute toyi don't see it yet.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: I used list, def. why li += [100, 200] , and li = li + [100, 200] is different

2017-10-23 Thread MRAB

On 2017-10-23 17:29, 임현준 wrote:

I am a Korean student, and I am a beginner in English and Python.;(

I can't understand about this def

If I want to print

[1,2,3,4,5]
[1,2,3,4,5,100,200]

I will make code like this, and I can understand code.


def modify(li):
  li += [100,200]

list = [1,2,3,4,5]
print(list)
modify(list)
print(list)


BUT, when I make code like this.

I will make code like this, and I can understand code.


def modify(li):
  li = li + [100,200]

list = [1,2,3,4,5]
print(list)
modify(list)
print(list)



python print

[1,2,3,4,5]
[1,2,3,4,5]

why 'li+= [100,200]'and 'li = li + [100,200]' 's print is different
please help me


In both cases, you're binding a list to the local name "li".

However, in the first example:

li += [100,200]

it's doing this:

li = li.__iadd__([100,200])

The __iadd__ method is modifying the list li and then returning that 
modified list.


The list that was passed in has been modified.

In the second example:

li = li + [100,200]

it's doing this:

li = li.__add__([100,200])

The __add__ method is creating a new list and then returning that new list.

The local name "li" now refers to a new list, not the list that was 
passed in. When the function returns, the local name "li" is forgotten, 
and the new list that "li" referred to is discarded because there are no 
other references to it.

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


Re: I used list, def. why li += [100,200] , and li = li + [100,200] is different

2017-10-23 Thread Rob Gaddi

On 10/23/2017 09:29 AM, 임현준 wrote:

I am a Korean student, and I am a beginner in English and Python.;(

I can't understand about this def

If I want to print

[1,2,3,4,5]
[1,2,3,4,5,100,200]

I will make code like this, and I can understand code.


def modify(li):
  li += [100,200]

list = [1,2,3,4,5]
print(list)
modify(list)
print(list)


BUT, when I make code like this.

I will make code like this, and I can understand code.


def modify(li):
  li = li + [100,200]

list = [1,2,3,4,5]
print(list)
modify(list)
print(list)



python print

[1,2,3,4,5]
[1,2,3,4,5]

why 'li+= [100,200]'and 'li = li + [100,200]' 's print is different
please help me



Lists are mutable, they can be changed.  Your call to += is equivalent 
to a call to li.extend([100, 200]), which changes the single existing 
object pointed to by the "li" reference.  The second time, however, you 
take the existing value that "li" refers to [1,2,3,4,5], create a new 
object that is ([1,2,3,4,5] + [100,200]), and reassign the local 
reference "li" to point to that new object.  Then your function ends, 
"li" goes out of scope, nothing points to that newly created object and 
it gets lost.


--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Compression of random binary data

2017-10-23 Thread Thomas Jollans
On 2017-10-23 17:39, danceswithnumb...@gmail.com wrote:
> Thanks Paul...blunt to the point.
> 
> My 8 year old can decode this back into base 10, i still have to help him a 
> bit going from base 10 to 8 bit bytesit's incredibly simple to decode. No 
> dictionary, can easily be done with pencil and paper, does not rely on 
> redundancies.

It is, is it? Well, you know the rules:

"Code or it didn't happen."


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


I used list, def. why li += [100, 200] , and li = li + [100, 200] is different

2017-10-23 Thread 임현준
I am a Korean student, and I am a beginner in English and Python.;(

I can't understand about this def

If I want to print 

[1,2,3,4,5]
[1,2,3,4,5,100,200]

I will make code like this, and I can understand code.


def modify(li):
 li += [100,200]

list = [1,2,3,4,5]
print(list)
modify(list)
print(list)


BUT, when I make code like this.

I will make code like this, and I can understand code.


def modify(li):
 li = li + [100,200]

list = [1,2,3,4,5]
print(list)
modify(list)
print(list)



python print

[1,2,3,4,5]
[1,2,3,4,5]

why 'li+= [100,200]'and 'li = li + [100,200]' 's print is different
please help me
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compression of random binary data

2017-10-23 Thread Thomas Jollans
On 2017-10-23 07:39, Steve D'Aprano wrote:
> By the way: here is a very clever trick for hiding information in the file
> system:
> 
> http://www.patrickcraig.co.uk/other/compression.php
> 
> 
> but as people point out, the information in the file, plus the information in
> the file system, ends up being *larger* than the original. Well done to
> Patrick Craig for finding a clever loophole to "win" the challenge, but he
> did so without actually compressing the original data.

Thanks Steve that was very entertaining.


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


Re: Compression of random binary data

2017-10-23 Thread danceswithnumbers
Thanks Paul...blunt to the point.

My 8 year old can decode this back into base 10, i still have to help him a bit 
going from base 10 to 8 bit bytesit's incredibly simple to decode. No 
dictionary, can easily be done with pencil and paper, does not rely on 
redundancies.

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


Re: Compression of random binary data

2017-10-23 Thread danceswithnumbers
Just trying to find a practical application for this alg. Not real useful as it 
stands now. 

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


Re: Compression of random binary data

2017-10-23 Thread Paul Moore
On 23 October 2017 at 15:29,   wrote:
> I'm really not trolling, and even though some are sarcastic i sm learning 
> from your comments.

I'm willing to believe that, but if you're trying to claim you have
"compressed" data (in a way that satisfies the technical,
information-theoretic meaning of the word), you need to be *really*
careful not to include hidden information in your assumptions.

For example, if I have a string made up of only the numbers 0-7, then
I can trivially (octal) store that data in 3 bits per digit. But
that's not compression, as there's "hidden information" in the
knowledge that you're using a restricted character set. Factor in that
information and your string only contains 3 bits of information per
digit.

Using bytes (characters, if you assume a 1-byte encoding) to hold just
the digits 0-9 is inefficient (there's 256 bytes and you're only using
10 of them), and "of course" you can hold that data more efficiently.
But that's not "compression", that's simply using a better encoding.
In the technical sense, "compression" is about looking at redundancies
that go beyond the case of how effectively you pack data into the
bytes available.

> Dec to bin is not bad at removing wasted space

Yep, you're not talking about what people usually refer to as
compression, but rather about optimising an encoding.

>, but there is a better way. Here is an example. How would you compress these 
>numbers.

10 digits = log2(10) bits of information. So getting down to 4 bits is
about encoding. You can go further by using a variable length encoding
and "extra knowledge" about which digits come up most commonly to give
the common digits shorter representation. That's called Gray coding.
You can use the fact that repeated copies of the same digit come up
together a lot to replace them by digit + count. That's run-length
encoding. There are other more complex approaches. But what *all* of
these have in common is that if you provide random input (within the
limits of what you support - digit strings here) then you'll *always*
get at least one input that encodes to a longer output than your
input.

> Compress this:
>
> 4135124325

10 x 10 digits = 10 x log2(10) bits of information = a bit under 34
bits of information

>
> Bin to dec...still very large
> 0110
> 0000
> 1101
> 01100101

4x8 = 32 bits, but there's probably a couple of leading zeros needed
if you want to encode all 10-digit numbers.


> New compression method:
>
> 11000101
> 11000111
> 0100
>
> A full byte less than bin.

You'll need to explain how to decode this, in a way that can be used
to decode the encodings of arbitrary 10-digit numbers, and with any
leading zeroes that are needed to cover the whole space of 10-digit
numbers, before you can claim you've compressed 10-digit numbers using
only 24 bits. And if you do that, you've basically overturned most of
information theory, so I'd start by assuming there's a flaw in your
argument - sorry about that... ;-)

Hope this helps put the subject into context. Compression is a very
technical subject, to "do it right". Special cases can be worked out,
sure, but the "hidden assumptions" in a method are what make the
difference between a "compression algorithm" and a "way of storing my
particular data more efficiently".

> I know many are skepticalthats okay.this has taken 6 years, im not going 
> to insult your intelligence with something so juvenile as dec to bin. I'm 
> really trying to find an application for this since it only deals with digits 
> 0-9 or 0-20 or other strange combinations. Wait did you just give it away in 
> that small exampleno, because it also encrypts in a way that has never 
> been done. The compression is better than log(256)÷log (10)wait isn't 
> that impossible, binary is minimalistic. I agree that binary is minimalistic, 
> but the architecture is not, making all arguments conjecture...not laws.

No-one is going to accept a claim that an algorithm you're not willing
to publish is valid. This is about maths/science, not "proprietary
algorithms" or anything like that. If you don't publish your methods,
people will simply point at information theoretic proofs and say
"either you're missing something, or your approach doesn't work in
cases that I care about, so thanks but no thanks".

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


IDLE doesn't recognise installed packages

2017-10-23 Thread Daniel Tangemann
hi,
I've recently downloaded and installed python 3.6. (I had already also 2.7 and 
3.2 on my computer) Initially pip was looking in the wrong directory to install 
to, so I changed that. then it had trouble installing matplotlib, so I decided 
to get rid of the older versions of python, which srewed things up even more. 
now scrips that I had written (in 3.6), that were running without errors 
before, aren't working anymore. I tried reinstalling python, and I tried the 
repair option multiple times as well. when I look into the python folder, I can 
see the modules that I have installed (and that I import into those scripts), 
but the IDLE doesn't see them! what's even more weird, is that "pip list" 
doesn't bring up anything but pip itself, while typing "pip install matplotlib" 
returns a message that it's already installed. how do I fix this?
cheers
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: grapheme cluster library

2017-10-23 Thread Rustom Mody
On Monday, October 23, 2017 at 1:15:35 PM UTC+5:30, Steve D'Aprano wrote:
> On Mon, 23 Oct 2017 05:47 pm, Rustom Mody wrote:
> 
> > On Monday, October 23, 2017 at 8:06:03 AM UTC+5:30, Lawrence D’Oliveiro
> > wrote:
> [...]
> >> Bear in mind that the logical representation of the text is as code points,
> >> graphemes would have more to do with rendering.
> > 
> > Heh! Speak of Euro/Anglo-centrism!
> 
> I think that Lawrence may be thinking of glyphs. Glyphs are the display form
> that are rendered. Graphemes are the smallest unit of written language.
> 
> 
> > In a sane world graphemes would be called letters
> 
> Graphemes *aren't* letters.
> 
> For starters, not all written languages have an alphabet. No alphabet, no
> letters. Even in languages with an alphabet, not all graphemes are letters.
> 
> Graphemes include:
> 
> - logograms (symbols which represent a morpheme, an entire word, or 
>   a phrase), e.g. Chinese characters, ampersand &, the ™ trademark 
>   or ® registered trademark symbols;
> 
> - syllabic characters such as Japanese kana or Cherokee;
> 
> - letters of alphabets;
> 
> - letters with added diacritics;
> 
> - punctuation marks;
> 
> - mathematical symbols;
> 
> - typographical symbols;
> 
> - word separators;
> 
> and more. Many linguists also include digraphs (pairs of letters) like the
> English "th", "sh", "qu", or "gh" as graphemes.
> 
> 
> https://www.thoughtco.com/what-is-a-grapheme-1690916
> 
> https://en.wikipedia.org/wiki/Grapheme

Um… Ok So I am using the wrong word? Your first link says:
| For example, the word 'ghost' contains five letters and four graphemes 
| ('gh,' 'o,' 's,' and 't')

Whereas new regex findall does:

>>> findall(r'\X', "ghost")
['g', 'h', 'o', 's', 't']
>>> findall(r'\X', "church")
['c', 'h', 'u', 'r', 'c', 'h']
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compression of random binary data

2017-10-23 Thread danceswithnumbers
I'm really not trolling, and even though some are sarcastic i sm learning from 
your comments. Dec to bin is not bad at removing wasted space, but there is a 
better way. Here is an example. How would you compress these numbers. If you 
look for redundancy and then code to a bulky dictionary or change it to binary, 
one would unflate the other would only get it down to 

Compress this:

4135124325

Bin to dec...still very large
0110
0000
1101
01100101

New compression method:

11000101
11000111
0100

A full byte less than bin.

I know many are skepticalthats okay.this has taken 6 years, im not going to 
insult your intelligence with something so juvenile as dec to bin. I'm really 
trying to find an application for this since it only deals with digits 0-9 or 
0-20 or other strange combinations. Wait did you just give it away in that 
small exampleno, because it also encrypts in a way that has never been 
done. The compression is better than log(256)÷log (10)wait isn't that 
impossible, binary is minimalistic. I agree that binary is minimalistic, but 
the architecture is not, making all arguments conjecture...not laws.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compression of random binary data

2017-10-23 Thread alister via Python-list
On Mon, 23 Oct 2017 13:40:59 +, Neil Cerutti wrote:

> On 2017-10-23, Chris Angelico  wrote:
>> On Mon, Oct 23, 2017 at 11:18 PM, alister via Python-list
>> wrote:
>>> On Mon, 23 Oct 2017 10:41:55 +0100, Paul Moore wrote:
>>>
 On 23 October 2017 at 10:32,  
 wrote:
> According to this website. This is an uncompressable stream.
>
> https://en.m.wikipedia.org/wiki/Incompressible_string
>
> 12344321
>
> It only takes seven 8 bit bytes to represent this

 Would you care to provide the seven 8-bit bytes you propose to use?
 Paul
>>>
>>> I would suspect he is using BCD & storing 2 values in reach byte that
>>> is not what is meant by you cant compress random data. his compression
>>> is simply removing redundant space from an inefficient coding
>>
>> I suspect he is using ASCII and storing one value in each byte.
> 
> There's also ZSCII, which stores roughly 3 characters every 2 bytes.
> Since all the digits are in A2, this sequence would take up 7 bytes in
> ZSCII as well.
> 
> http://inform-fiction.org/zmachine/standards/z1point0/sect03.html

not sure how 16 characters can be represented by either ascii or zscii in 
only 8 bytes



-- 
I fear explanations explanatory of things explained.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compression of random binary data

2017-10-23 Thread Neil Cerutti
On 2017-10-23, Chris Angelico  wrote:
> On Mon, Oct 23, 2017 at 11:18 PM, alister via Python-list
> wrote:
>> On Mon, 23 Oct 2017 10:41:55 +0100, Paul Moore wrote:
>>
>>> On 23 October 2017 at 10:32,  
>>> wrote:
 According to this website. This is an uncompressable stream.

 https://en.m.wikipedia.org/wiki/Incompressible_string

 12344321

 It only takes seven 8 bit bytes to represent this
>>>
>>> Would you care to provide the seven 8-bit bytes you propose
>>> to use?
>>> Paul
>>
>> I would suspect he is using BCD & storing 2 values in reach
>> byte that is not what is meant by you cant compress random
>> data. his compression is simply removing redundant space from
>> an inefficient coding
>
> I suspect he is using ASCII and storing one value in each byte.

There's also ZSCII, which stores roughly 3 characters every 2
bytes. Since all the digits are in A2, this sequence would take
up 7 bytes in ZSCII as well.

http://inform-fiction.org/zmachine/standards/z1point0/sect03.html

-- 
Neil Cerutti

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


Re: right list for SIGABRT python binary question ?

2017-10-23 Thread Karsten Hilbert
On Mon, Oct 23, 2017 at 03:26:18PM +0200, Thomas Jollans wrote:

> >> It points to a memory corruption.
> > 
> > While running valgrind and friends is beyond my capabilitis I
> > have run the problem through gdb to at least obtain a stack
> > trace to see what gives:
> 
> I wouldn't read too much into that. You know that somehow some memory
> got corrupted. You know at which point Python trips over the error - but
> that doesn't really tell you anything about how the memory initially got
> corrupted.

Thanks, I know. However, I am grasping for straws here since
I am unable to "properly" debug the python binary as such.

Karsten
-- 
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: right list for SIGABRT python binary question ?

2017-10-23 Thread Thomas Jollans
On 2017-10-23 14:23, Karsten Hilbert wrote:
> On Sat, Oct 21, 2017 at 09:31:54AM +0200, dieter wrote:
> 
>> It points to a memory corruption.
> 
> While running valgrind and friends is beyond my capabilitis I
> have run the problem through gdb to at least obtain a stack
> trace to see what gives:


I wouldn't read too much into that. You know that somehow some memory
got corrupted. You know at which point Python trips over the error - but
that doesn't really tell you anything about how the memory initially got
corrupted.

> 
>   ...
>   ==> verifying target database schema ...
>   ==> checking migrated data for plausibility ...
>   Done bootstrapping GNUmed database: We very likely succeeded.
>   log: 
> /home/ncq/Projekte/gm-git/gnumed/gnumed/server/bootstrap/bootstrap-latest.log
>   Debug memory block at address p=0x6aab7c: API ''
>   0 bytes originally requested
>   The 3 pad bytes at p-3 are not all FORBIDDENBYTE (0xfb):
>   at p-3: 0x33 *** OUCH
>   at p-2: 0x47 *** OUCH
>   at p-1: 0x00 *** OUCH
>   Because memory is corrupted at the start, the count of bytes 
> requested
>  may be bogus, and checking the trailing pad bytes may segfault.
>   The 4 pad bytes at tail=0x6aab7c are not all FORBIDDENBYTE (0xfb):
>   at tail+0: 0x00 *** OUCH
>   at tail+1: 0x00 *** OUCH
>   at tail+2: 0x00 *** OUCH
>   at tail+3: 0x00 *** OUCH
>   The block was made by call #0 to debug malloc/realloc.
>   Fatal Python error: bad ID: Allocated using API '', verified using API 
> 'o'
> 
>   Program received signal SIGABRT, Aborted.
>   0xb7fd9ce9 in __kernel_vsyscall ()
>   (gdb) bt
>   #0  0xb7fd9ce9 in __kernel_vsyscall ()
>   #1  0xb7d6edd0 in __libc_signal_restore_set (set=0xbfffed40) at 
> ../sysdeps/unix/sysv/linux/nptl-signals.h:79
>   #2  __GI_raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:48
>   #3  0xb7d70297 in __GI_abort () at abort.c:89
>   #4  0x0055fb74 in Py_FatalError (msg=0xbfffefec "bad ID: Allocated 
> using API '\037', verified using API 'o'") at ../Python/pythonrun.c:1700
>   #5  0x00499adb in _PyObject_DebugCheckAddressApi (api=111 'o', 
> p=0x6aab7c <_Py_ZeroStruct>) at ../Objects/obmalloc.c:1640
>   #6  0x004997a5 in _PyObject_DebugFreeApi (api=111 'o', p=0x6aab7c 
> <_Py_ZeroStruct>) at ../Objects/obmalloc.c:1527
>   #7  0x0049964f in _PyObject_DebugFree (p=0x6aab7c <_Py_ZeroStruct>) at 
> ../Objects/obmalloc.c:1471
>   #8  0x00471043 in int_dealloc (v=0x6aab7c <_Py_ZeroStruct>) at 
> ../Objects/intobject.c:139
>   #9  0x00497bee in _Py_Dealloc (op=False) at ../Objects/object.c:2262
>   #10 0x00489bad in dict_dealloc (mp=0xb7888f34) at 
> ../Objects/dictobject.c:1085
>   Python Exception  'utf-8' codec can't 
> decode bytes in position 1-2: unexpected end of data: 
>   #11 0x00497bee in _Py_Dealloc (op=) at ../Objects/object.c:2262
>   Python Exception  'utf-8' codec can't 
> decode bytes in position 1-2: unexpected end of data: 
>   #12 0x004b9ab7 in subtype_dealloc (self=) at 
> ../Objects/typeobject.c:1035
>   Python Exception  'utf-8' codec can't 
> decode bytes in position 1-2: unexpected end of data: 
>   #13 0x00497bee in _Py_Dealloc (op=) at ../Objects/object.c:2262
>   #14 0x0044dc7a in instancemethod_dealloc (im=0xb78984b4) at 
> ../Objects/classobject.c:2388
>   #15 0x00497bee in _Py_Dealloc (op= 0xb78984b4>) at ../Objects/object.c:2262
>   #16 0x004885d7 in insertdict_by_entry (mp=0xb78880d4, key='_shutdown', 
> hash=598970216, ep=0x88d6d4, value=None) at ../Objects/dictobject.c:519
>   #17 0x00488857 in insertdict (mp=0xb78880d4, key='_shutdown', 
> hash=598970216, value=None) at ../Objects/dictobject.c:556
>   #18 0x0048910f in dict_set_item_by_hash_or_entry (
>   op={'current_thread': , 
> '_BoundedSemaphore': None, 'currentThread': , 
> '_Timer': None, '_format_exc': None, 'Semaphore':  0xb789b6c4>, '_deque': None, 'activeCount': , 
> '_profile_hook': None, '_sleep': None, '_trace_hook': None, 'ThreadError': 
> , '_enumerate': None, '_start_new_thread': None, 
> 'BoundedSemaphore': , '_shutdown': None, 
> '__all__': ['activeCount', 'active_count', 'Condition', 'currentThread', 
> 'current_thread', 'enumerate', 'Event', 'Lock', 'RLock', 'Semaphore', 
> 'BoundedSemaphore', 'Thread', 'Timer', 'setprofile', 'settrace', 'local', 
> 'stack_size'], '_Event': , 'active_count': 
> , '__package__': None, '_Condition':  remote 0xb784c9e4>, '_RLock': , '_test':  at remote 0xb78a2b74>, 'local':   x6fd420>, '__doc__': "Thread modul...(truncated), key='_shutdown', 
> hash=598970216, ep=0x0, value=None) at ../Objects/dictobject.c:795
>   #19 0x00489285 in PyDict_SetItem (
>   op={'current_thread': , 
> '_BoundedSemaphore': None, 'currentThread': , 
> '_Timer': None, '_format_exc': None, 'Semaphore':  0xb789b6c4>, 

Re: Compression of random binary data

2017-10-23 Thread Chris Angelico
On Mon, Oct 23, 2017 at 11:18 PM, alister via Python-list
 wrote:
> On Mon, 23 Oct 2017 10:41:55 +0100, Paul Moore wrote:
>
>> On 23 October 2017 at 10:32,   wrote:
>>> According to this website. This is an uncompressable stream.
>>>
>>> https://en.m.wikipedia.org/wiki/Incompressible_string
>>>
>>> 12344321
>>>
>>> It only takes seven 8 bit bytes to represent this
>>
>> Would you care to provide the seven 8-bit bytes you propose to use?
>> Paul
>
> I would suspect he is using BCD & storing 2 values in reach byte
> that is not what is meant by you cant compress random data.
> his compression is simply removing redundant space from an inefficient
> coding

I suspect he is using ASCII and storing one value in each byte.

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


Sockets but calling from different programs

2017-10-23 Thread T Obulesu
I'm new to python3 and scratching my head to write a program for this logic:

classA.py
Class A:
  # class for socket communication
  basic init method that initializes port, address, connection

 method send(message):
 # for sending any message through the given port


   method receive():
   # will be keep on listening for incoming messages



classB.py

Class B:
   import the send method from class A
   send the messages from this class


classC.py

Class C:
import the receive method from the class A
receive all the messages from the same socket from here.



Note:
 classA.py, classB.py, ClassC.py are saved in different locations.


Can someone help me in writing the code and how can I create a single object 
and use it in multiple classed?

This is how my code looks like:
import socket
import select

class ChatServer:

def __init__( self):
self.port = 8880;
self.srvsock = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
self.srvsock.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, 1 )
self.srvsock.bind( ("", 8880) )
self.srvsock.listen( 5 )
print("New socket bind")
while 1:
print("Waiting for new connection")
self.sock,(remhost,remport)=self.accept_new_connection()
print ('ChatServer started on port %s' % port)

def send(self,data):
self.sock.send(data)
def receieve(self):
self.str=sock.recv(1024)
print(self.str)


I want to run this code first time when my project starts and want to call 
send() and receive() functions from other two different python files located in 
different path.
  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: right list for SIGABRT python binary question ?

2017-10-23 Thread Karsten Hilbert
On Sat, Oct 21, 2017 at 09:31:54AM +0200, dieter wrote:

> It points to a memory corruption.

While running valgrind and friends is beyond my capabilitis I
have run the problem through gdb to at least obtain a stack
trace to see what gives:

...
==> verifying target database schema ...
==> checking migrated data for plausibility ...
Done bootstrapping GNUmed database: We very likely succeeded.
log: 
/home/ncq/Projekte/gm-git/gnumed/gnumed/server/bootstrap/bootstrap-latest.log
Debug memory block at address p=0x6aab7c: API ''
0 bytes originally requested
The 3 pad bytes at p-3 are not all FORBIDDENBYTE (0xfb):
at p-3: 0x33 *** OUCH
at p-2: 0x47 *** OUCH
at p-1: 0x00 *** OUCH
Because memory is corrupted at the start, the count of bytes 
requested
   may be bogus, and checking the trailing pad bytes may segfault.
The 4 pad bytes at tail=0x6aab7c are not all FORBIDDENBYTE (0xfb):
at tail+0: 0x00 *** OUCH
at tail+1: 0x00 *** OUCH
at tail+2: 0x00 *** OUCH
at tail+3: 0x00 *** OUCH
The block was made by call #0 to debug malloc/realloc.
Fatal Python error: bad ID: Allocated using API '', verified using API 
'o'

Program received signal SIGABRT, Aborted.
0xb7fd9ce9 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7fd9ce9 in __kernel_vsyscall ()
#1  0xb7d6edd0 in __libc_signal_restore_set (set=0xbfffed40) at 
../sysdeps/unix/sysv/linux/nptl-signals.h:79
#2  __GI_raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:48
#3  0xb7d70297 in __GI_abort () at abort.c:89
#4  0x0055fb74 in Py_FatalError (msg=0xbfffefec "bad ID: Allocated 
using API '\037', verified using API 'o'") at ../Python/pythonrun.c:1700
#5  0x00499adb in _PyObject_DebugCheckAddressApi (api=111 'o', 
p=0x6aab7c <_Py_ZeroStruct>) at ../Objects/obmalloc.c:1640
#6  0x004997a5 in _PyObject_DebugFreeApi (api=111 'o', p=0x6aab7c 
<_Py_ZeroStruct>) at ../Objects/obmalloc.c:1527
#7  0x0049964f in _PyObject_DebugFree (p=0x6aab7c <_Py_ZeroStruct>) at 
../Objects/obmalloc.c:1471
#8  0x00471043 in int_dealloc (v=0x6aab7c <_Py_ZeroStruct>) at 
../Objects/intobject.c:139
#9  0x00497bee in _Py_Dealloc (op=False) at ../Objects/object.c:2262
#10 0x00489bad in dict_dealloc (mp=0xb7888f34) at 
../Objects/dictobject.c:1085
Python Exception  'utf-8' codec can't 
decode bytes in position 1-2: unexpected end of data: 
#11 0x00497bee in _Py_Dealloc (op=) at ../Objects/object.c:2262
Python Exception  'utf-8' codec can't 
decode bytes in position 1-2: unexpected end of data: 
#12 0x004b9ab7 in subtype_dealloc (self=) at 
../Objects/typeobject.c:1035
Python Exception  'utf-8' codec can't 
decode bytes in position 1-2: unexpected end of data: 
#13 0x00497bee in _Py_Dealloc (op=) at ../Objects/object.c:2262
#14 0x0044dc7a in instancemethod_dealloc (im=0xb78984b4) at 
../Objects/classobject.c:2388
#15 0x00497bee in _Py_Dealloc (op=) at ../Objects/object.c:2262
#16 0x004885d7 in insertdict_by_entry (mp=0xb78880d4, key='_shutdown', 
hash=598970216, ep=0x88d6d4, value=None) at ../Objects/dictobject.c:519
#17 0x00488857 in insertdict (mp=0xb78880d4, key='_shutdown', 
hash=598970216, value=None) at ../Objects/dictobject.c:556
#18 0x0048910f in dict_set_item_by_hash_or_entry (
op={'current_thread': , 
'_BoundedSemaphore': None, 'currentThread': , 
'_Timer': None, '_format_exc': None, 'Semaphore': , '_deque': None, 'activeCount': , 
'_profile_hook': None, '_sleep': None, '_trace_hook': None, 'ThreadError': 
, '_enumerate': None, '_start_new_thread': None, 
'BoundedSemaphore': , '_shutdown': None, 
'__all__': ['activeCount', 'active_count', 'Condition', 'currentThread', 
'current_thread', 'enumerate', 'Event', 'Lock', 'RLock', 'Semaphore', 
'BoundedSemaphore', 'Thread', 'Timer', 'setprofile', 'settrace', 'local', 
'stack_size'], '_Event': , 'active_count': , '__package__': None, '_Condition': , '_RLock': , '_test': , 'local': , '__doc__': "Thread modul...(truncated), key='_shutdown', 
hash=598970216, ep=0x0, value=None) at ../Objects/dictobject.c:795
#19 0x00489285 in PyDict_SetItem (
op={'current_thread': , 
'_BoundedSemaphore': None, 'currentThread': , 
'_Timer': None, '_format_exc': None, 'Semaphore': , '_deque': None, 'activeCount': , 
'_profile_hook': None, '_sleep': None, '_trace_hook': None, 'ThreadError': 
, '_enumerate': None, '_start_new_thread': None, 
'BoundedSemaphore': , '_shutdown': None, 
'__all__': ['activeCount', 'active_count', 'Condition', 'currentThread', 
'current_thread', 'enumerate', 'Event', 'Lock', 'RLock', 'Semaphore', 
'BoundedSemaphore', 'Thread', 'Timer', 'setprofile', 'settrace', 'local', 
'stack_size'], '_

Re: Compression of random binary data

2017-10-23 Thread alister via Python-list
On Mon, 23 Oct 2017 10:41:55 +0100, Paul Moore wrote:

> On 23 October 2017 at 10:32,   wrote:
>> According to this website. This is an uncompressable stream.
>>
>> https://en.m.wikipedia.org/wiki/Incompressible_string
>>
>> 12344321
>>
>> It only takes seven 8 bit bytes to represent this
> 
> Would you care to provide the seven 8-bit bytes you propose to use?
> Paul

I would suspect he is using BCD & storing 2 values in reach byte
that is not what is meant by you cant compress random data.
his compression is simply removing redundant space from an inefficient 
coding

Can you compress that sequence on paper when you only have the values 0-9 
to work with (forget computer representation & removing un-used bits)


-- 
Old age and treachery will overcome youth and skill.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: choice of web-framework

2017-10-23 Thread Kevin van Keeken
Greetings,

while reading through this topic i would like to know, if cherrypy is a
viable web-framework as well?

I stumbled upon this project a while ago, but didn't read through it in
detail and would like to hear something about it, especially in regards
to the project requirements.

Kind regards

> Patrick Vrijlandt  writes:
>> ...
>> The project is completely new, there are no histories to take into
>> account (current solutions are paper-based). The website involves
>> questionnaires that will be developed, filled out and stored. Users
>> are not programmers or developers. They should be
>> authenticated. Version control is required. Internationalization is
>> not an issue. I expect that the project will add additional
>> requirements and complexity later on that I can not foresee yet. I'm
>> targeting a single deployment (maybe a second on a development
>> machine). I usually work on Windows, but Linux can be considered.
> I am using Plone (a CMS (= Content Management System) build on top of
> Zope) for something like this. It has a standard extension
> "CMFEditions" for version control of its content.
>
> The content is managed in the Zope Object Database (= "ZODB"). This is
> also valid for the revisions. Thus, you do not get
> "git/mercurial/..."-style version control (based on files) but
> you see when and by whom a version was created, can revert to a
> previous version and see differences between versions. There is no
> merge support, though.
>
> The standard Plone content types are likely not sufficient to
> implement your questionnaires; you will probably define one of
> more specific for your task. But, this is not too complex.
>
> Questions about Plone (and the underlying Zope) can be asked at
> "https://community.plone.org/";.
>
>

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


Re: Compression of random binary data

2017-10-23 Thread Ben Bacarisse
danceswithnumb...@gmail.com writes:

> ... First let me clarify before you lump this in with
> perpetual motion, or cold fusion. It is a mapping solution to compress
> ANY i repeat ANY random file with numbers of only 0 - 9 such as are in
> the million rand numbers page. Entirely possible.

Of course it is.  I have half a dozen programs on this machine that do
it.  I don't need yours.

It's possible you want to claim something beyond what you stated, but no
one is going to get excited until you actually claim such a thing.


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


Re: Compression of random binary data

2017-10-23 Thread Marko Rauhamaa
Thomas Jollans :

> On 2017-10-23 11:32, danceswithnumb...@gmail.com wrote:
>> According to this website. This is an uncompressable stream.
>> 
>> https://en.m.wikipedia.org/wiki/Incompressible_string
>> 
>> 12344321
>
> No, it's not. According to that article, that string is incompressible
> by a particular algorithm. I can see no more general claims.

Here's a compression algorithm that manages to compress that string into
a 0-bit string:

 * If the original string is 12344321 (whatever that means),
   return the empty bit string.

 * Otherwise, prepend a don't-care bit to the original string and return
   the result of the concatenation.

>> It only takes seven 8 bit bytes to represent this
>
> You amaze me.
>
 bin(12344321)
> '0b1000110001100111001110100100010100100110111'
 len(bin(12344321)[2:])
> 51
 7 * 8
> 56

So danceswithnumbers made a correct statement!

Anyway, a fun troll.


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


Re: Compression of random binary data

2017-10-23 Thread danceswithnumbers
I really do not think this has a value besides being a trinket or cute toy. 
Like i said i can not see how it can be adapted to work as a rand binary 
compression alg...it only works with 0-9 in any seq. It's taken me six years to 
solve, but so what.

Jon Hutton
danceswithnumb...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compression of random binary data

2017-10-23 Thread Thomas Jollans
On 2017-10-23 11:32, danceswithnumb...@gmail.com wrote:
> According to this website. This is an uncompressable stream.
> 
> https://en.m.wikipedia.org/wiki/Incompressible_string
> 
> 12344321

No, it's not. According to that article, that string is incompressible
by a particular algorithm. I can see no more general claims.

> 
> It only takes seven 8 bit bytes to represent this
> 

You amaze me.

>>> bin(12344321)
'0b1000110001100111001110100100010100100110111'
>>> len(bin(12344321)[2:])
51
>>> 7 * 8
56


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


Re: Compression of random binary data

2017-10-23 Thread Chris Angelico
On Mon, Oct 23, 2017 at 8:32 PM,   wrote:
> According to this website. This is an uncompressable stream.
>
> https://en.m.wikipedia.org/wiki/Incompressible_string
>
> 12344321
>
> It only takes seven 8 bit bytes to represent this

That page says nothing about using a byte to represent each digit. So
if you're going to compress the data into bytes, you then have to
represent your compressed data in some comparable way. The simplest
representation is to treat this as a single number; in hexadecimal, it
would be 46339d7a29361, and if you want a byte representation of a
number, the most trivial way is to take each pair of hex digits and
store the corresponding byte: b"\x4\x63\x39\xd7\xa2\x93\x61" is seven
bytes (six and a half, rounded up). This is not data compression; this
is the more general question of how you store information at the
concrete level.

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


Re: Compression of random binary data

2017-10-23 Thread Paul Moore
On 23 October 2017 at 10:32,   wrote:
> According to this website. This is an uncompressable stream.
>
> https://en.m.wikipedia.org/wiki/Incompressible_string
>
> 12344321
>
> It only takes seven 8 bit bytes to represent this

Would you care to provide the seven 8-bit bytes you propose to use?
Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compression of random binary data

2017-10-23 Thread danceswithnumbers
According to this website. This is an uncompressable stream.

https://en.m.wikipedia.org/wiki/Incompressible_string

12344321

It only takes seven 8 bit bytes to represent this
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compression of random binary data

2017-10-23 Thread Chris Angelico
On Mon, Oct 23, 2017 at 8:06 PM,   wrote:
> Ridiculous? Ludicrous??
>
> Harsh words! First let me clarify before you lump this in with perpetual 
> motion, or cold fusion. It is a mapping solution to compress ANY i repeat ANY 
> random file with numbers of only 0 - 9 such as are in the million rand 
> numbers page. Entirely possible. Since i did it, not by hiding data anywhere 
> then it must be conjecture not law.
>

Where did you get the idea that you start with a representation that
uses ten symbols (0-9) and uses an entire byte for each one? Where is
that stated?

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


Re: Compression of random binary data

2017-10-23 Thread danceswithnumbers
Ridiculous? Ludicrous??

Harsh words! First let me clarify before you lump this in with perpetual 
motion, or cold fusion. It is a mapping solution to compress ANY i repeat ANY 
random file with numbers of only 0 - 9 such as are in the million rand numbers 
page. Entirely possible. Since i did it, not by hiding data anywhere then it 
must be conjecture not law.

Jon J Hutton 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: right list for SIGABRT python binary question ?

2017-10-23 Thread Karsten Hilbert
On Sun, Oct 22, 2017 at 11:10:33PM +0200, Karsten Hilbert wrote:

>> It points to a memory corruption.
>
> thanks for your guidance. I fear this approach is out of my class.

For what it's worth I have run a successful overnight memory
stress test (memtest86+) so it shouldn't be a bad bit in
hardware.

Karsten
-- 
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: grapheme cluster library

2017-10-23 Thread Steve D'Aprano
On Mon, 23 Oct 2017 05:47 pm, Rustom Mody wrote:

> On Monday, October 23, 2017 at 8:06:03 AM UTC+5:30, Lawrence D’Oliveiro
> wrote:
[...]
>> Bear in mind that the logical representation of the text is as code points,
>> graphemes would have more to do with rendering.
> 
> Heh! Speak of Euro/Anglo-centrism!

I think that Lawrence may be thinking of glyphs. Glyphs are the display form
that are rendered. Graphemes are the smallest unit of written language.


> In a sane world graphemes would be called letters

Graphemes *aren't* letters.

For starters, not all written languages have an alphabet. No alphabet, no
letters. Even in languages with an alphabet, not all graphemes are letters.

Graphemes include:

- logograms (symbols which represent a morpheme, an entire word, or 
  a phrase), e.g. Chinese characters, ampersand &, the ™ trademark 
  or ® registered trademark symbols;

- syllabic characters such as Japanese kana or Cherokee;

- letters of alphabets;

- letters with added diacritics;

- punctuation marks;

- mathematical symbols;

- typographical symbols;

- word separators;

and more. Many linguists also include digraphs (pairs of letters) like the
English "th", "sh", "qu", or "gh" as graphemes.


https://www.thoughtco.com/what-is-a-grapheme-1690916

https://en.wikipedia.org/wiki/Grapheme


> And unicode codepoints would be called something else — letterlets??
> To be fair to the Unicode consortium, they strive hard to call them
> codepoints But in an anglo-centric world, the conflation of codepoint to
> letter is inevitable I guess. To hear how a non Roman-centric view of the 
> world would sound: A 'w' is a poorly double-struck 'u'
> A 't' is a crossed 'l'
> Reasonable?

No, T is not a crossed L -- they are unrelated letters and the visual
similarity is a coincidence. They are no more connected than E is just an F
with an extra line.

But you are more right than you knew regarding W: it *literally was* a
doubled-up V (sometimes written U) once upon a time.

For a long time W did not appear in the Latin alphabet, even after people used
it in written text. It was considered a digraph VV then a ligature and
finally, only gradually, a proper letter. As late as the 16th century the
German grammatican Valentin Ickelshamer complained that hardly anyone,
including school masters, knew what to do with W or what it was called.

https://en.wikipedia.org/wiki/W#History



> The lead of https://en.wikipedia.org/wiki/%C3%9C has
> 
> | Ü, or ü, is a character…classified as a separate letter in several
> | extended Latin alphabets
> | (including Azeri, Estonian, Hungarian and Turkish), but as the letter U
> | with an umlaut/diaeresis in others such as Catalan, French, Galician,
> | German, Occitan and Spanish.


Indeed: sometimes the same grapheme is considered a letter in one language and
a letter-plus-diacritic in another.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

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


Re: Modern website

2017-10-23 Thread dieter
Andrew Z  writes:
> I realize the following has little todo with python per se. But i hope to
> get a guidance on how these types of tasks are done nowadays.
>
> The task:
> Ive been asked to create  an integration process. That is a few webpages
> with questioneer with the submission to a "mother" company using its API .
> Ideally this process will be used by a few 3rd party "child" companies -
> they would just point a link from their site to mine. Prospective users
> will fill out the pages and "mother company" will create accounts
> associated with the referal "child" company.
>
> The problem:
>   how do i create a modern , slick  website. I also see , that each of
> "child" would want to extend the look and feel of their site onto this
> process. So, my process should have at least a few templates i can offer ,
> that would match their site...
> Im not too excited to use weebly or squarespace - id rather host everything

If the liberty of the "client" sites is of primary concern, then
you can use a so called "service oriented architecture".
Such an architecture sonsists of components, most of which providing
a services via a standard API, destined for programmatic use.

You can have services on different levels of abstraction, e.g.
a base level using only structural data without any presentation
and on top of this some standard presentation (which can be used
by clients with more standard presentation requirements).

There are several API-frameworks: e.g. frameworks supporting
WSDL (= "Web Services Description language", an XML-based technology),
JSON-RPC, XML-RPC, ReST, ...

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


Re: choice of web-framework

2017-10-23 Thread dieter
Patrick Vrijlandt  writes:
> ...
> The project is completely new, there are no histories to take into
> account (current solutions are paper-based). The website involves
> questionnaires that will be developed, filled out and stored. Users
> are not programmers or developers. They should be
> authenticated. Version control is required. Internationalization is
> not an issue. I expect that the project will add additional
> requirements and complexity later on that I can not foresee yet. I'm
> targeting a single deployment (maybe a second on a development
> machine). I usually work on Windows, but Linux can be considered.

I am using Plone (a CMS (= Content Management System) build on top of
Zope) for something like this. It has a standard extension
"CMFEditions" for version control of its content.

The content is managed in the Zope Object Database (= "ZODB"). This is
also valid for the revisions. Thus, you do not get
"git/mercurial/..."-style version control (based on files) but
you see when and by whom a version was created, can revert to a
previous version and see differences between versions. There is no
merge support, though.

The standard Plone content types are likely not sufficient to
implement your questionnaires; you will probably define one of
more specific for your task. But, this is not too complex.

Questions about Plone (and the underlying Zope) can be asked at
"https://community.plone.org/";.


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