Re: python adds an extra half space when reading from a string or list

2013-07-04 Thread feedthetroll
Am Mittwoch, 3. Juli 2013 19:01:23 UTC+2 schrieb ru...@yahoo.com:
> On 07/03/2013 08:12 AM, feedthetr...@gmx.de wrote:
>>> Am Mittwoch, 3. Juli 2013 12:00:14 UTC+2 schrieb Νίκος:
> Στις 3/7/2013 12:45 μμ, ο/η Chris Angelico έγραψε:
> ] You have betrayed the trust of all your customers.
> ...
> I just received a call form on of my customers asking me to explain your 
> mail ...
> Of course i should have give you the root pass(it was indeed stupid), 
> but you violated my trust.
> You should have been clear that you didnt want to help and not asking me 
> via private mail for the root pass.
>>> 
>>> May i cite:
>>> Am Dienstag, 4. Juni 2013 19:12:41 UTC+2 schrieb Νικόλαος Κούρας:
> Τη Τρίτη, 4 Ιουνίου 2013 8:09:18 μ.μ. UTC+3, ο χρήστης Chris Angelico 
> έγραψε:
>>> On Wed, Jun 5, 2013 at 3:02 AM, Νικόλαος Κούρας 
>>> wrote:
> I'm willing to let someone with full root access to my webhost to see 
> thigns from the inside.
> ...
>>> You need to read up on what happens when you enter Dummy Mode and give
>>> someone full root access to your web host. You really REALLY need to
>>> understand what that means before you offer random strangers that kind
>>> of access to someone else's data.
>>> 
>>> *
>>> *
>>> I've half a mind to take you up on your offer, then go look for
>>> personal and private info from your clients, and email it to them
>>> (along with a link to this thread) to point out what's going on.
>>> *
>>> *
>>> ChrisA
> 
> I know what full root access mean.
> I also trust you.
> ...
>>>  
>>> Am Mittwoch, 5. Juni 2013 00:12:26 UTC+2 schrieb Chris Angelico:
> The call is strong... I could rule the galaxy alongside my father...
> I've searched my feelings, and I know this to be true!
> 
>>> *
>>> *
> Okay. I accept. I'll **do as I promised.** Might be interesting, and
> educative - for someone, at least.
>>> *
>>> *
>>> [emphasis added for those, who do not want to read the whole post]
>>> 
>>> Any questions?
> 
> Yes.  

Ahhh! Like you I *love* to answer rhetorical questions. ;-)

> If you tell someone you're going to beat them up but 
> they don't take you seriously because they are naive, 
> or they think you're kidding, or they don't understand 
> you because you told them in hints rather than directly, 
> is it ok to beat them up?

Yes, or the police would have to arrest every participant of a boxing, martial 
arts, ... championship.

> Are the existence of laws against beating people up
> negated because you told them in advance?  Or negated
> because they "deserve" the beating?

Yes, or every M.D. would be arrested. You allow him to cut your body and 
therefore it's O.K.

> Does it make any difference if they contribute to
> their own beating, say by showing up at a designated
> place and time?

Yes. In case of a punchfest (is this correct in english, the german word is 
"Massenschlägerei") *every* participant is convicted.

> Does it make any difference if the beating is for 
> their own good?  (In the beater's opinion?)  (In
> the majority opinion?)

Yes. In case the one who confirms the "their own good" is an accredited 
specialist (psychiatrist, judge [yes there is corporal punishment in many, many 
legal systems, established and endorsed by majority opinion], ...)

> I am sorry Mr/Ms. FeedTheTroll for being so dumb.  

I forgive, no problem ;-)
And, if you have to be personal on a public list, I would prefer Mrs.

> I know the answers to all these questions are obvious 
> to everyone else here but I am not sure about them.

Then I hope, I was able to enlighten you. ;-)

btw: Highly offtopic. Therefore I'm out.

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


UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-04 Thread Νίκος

I just started to have this error without changing nothing

in my index.html(template) and metrites.py(which ipen the template)

[Thu Jul 04 11:35:14 2013] [error] [client 108.162.229.97] Original 
exception was:
[Thu Jul 04 11:35:14 2013] [error] [client 108.162.229.97] Traceback 
(most recent call last):
[Thu Jul 04 11:35:14 2013] [error] [client 108.162.229.97]   File 
"/home/nikos/public_html/cgi-bin/metrites.py", line 19, in 
[Thu Jul 04 11:35:14 2013] [error] [client 108.162.229.97] host = 
socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] or 'UnResolved'
[Thu Jul 04 11:35:14 2013] [error] [client 108.162.229.97] 
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: 
invalid start byte
[Thu Jul 04 11:35:14 2013] [error] [client 108.162.229.97] Premature end 
of script headers: metrites.py



Why cant it decode the starting byte? what starting byte is that?
--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: Important features for editors

2013-07-04 Thread Dave Angel

On 07/04/2013 03:59 AM, Νίκος wrote:

Στις 4/7/2013 10:32 πμ, ο/η cutems93 έγραψε:

I am researching on editors for my own reference. I found that each of
them has some features that other don't, but I am not sure which
features are significant/necessary for a GOOD editor. What features do
you a good editor should have? Keyboard shortcuts? Extensions?

Thanks!
Min


Download Sublime Text v3

Is a great editor



When possible, it's polite to supply a link to the page where it's 
described or can be downloaded.  In this case,


http://www.sublimetext.com/

It looks pretty good on the web page.  The main negatives I can see are:
It costs $70 per user
It can only be purchased with Paypal, which I won't use.
It's available for OS/X, Linux and Windows, with a single purchase
The eval/demo is not time-limited (currently)

The positives
It can be customized, apparently in Python
The simple customizations are specified by JSON files
Current download is version 2, but there's a version 3 beta, and if 
you buy now, you won't have an upgrade fee.


..

Note that the OP didn't ask which is a good editor, but which features 
make a good editor.  I'll post a response to that in a little while.



--
DaveA

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


Re: python adds an extra half space when reading from a string or list

2013-07-04 Thread feedthetroll
Am Mittwoch, 3. Juli 2013 19:00:50 UTC+2 schrieb rusi:
> On Wednesday, July 3, 2013 7:42:19 PM UTC+5:30, feedth...@gmx.de wrote:
> > Any questions?
> YES! 
> Who is that hiding behind 'FeedTheTroll' ?

Oh, it's just yattt (yet another troll trolling troll) lurching around to find 
amazing threads (Well, in fact these threads stopped being amazing weeks ago. I 
must be some sort of masochist :-) )

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


Access Violation Error while using Python Ctypes

2013-07-04 Thread HighBeliever
I used the following code to import the functions of a dll in my Python code.

from ctypes import *

hunspell=CDLL('C:\Nhunspell\Hunspellx64.dll')
hunspell.HunspellInit.restype = POINTER(c_int)
hunspell.HunspellInit.argtypes = (c_char_p, c_char_p)
hunspell.HunspellSpell.argtypes = (POINTER(c_int), c_char_p)
hunspell.HunspellAdd.argtypes = (POINTER(c_int), c_char_p)
hunspell.HunspellSuggest.argtypes = (POINTER(c_int), 
POINTER(POINTER(c_char_p)), c_char_p)

class Hunspell(object):
def __init__(self):
self.hunhandle = hunspell.HunspellInit('en_US.aff', 
'en_US.dic')

a=Hunspell()

The class Hunspell should act as a wrapper for the function, but then I get 
this error when I try to run this.

Traceback (most recent call last):
  File "C:\Users\KURO\Desktop\hunspell\text.py", line 49, in 
a=Hunspell()
  File "C:\Users\KURO\Desktop\hunspell\text.py", line 17, in __init__
self.hunhandle = hunspell.HunspellInit('en_US.aff', 'en_US.dic')
WindowsError: exception: access violation reading 0x01FBB000

Please help me out.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Important features for editors

2013-07-04 Thread Νίκος

Στις 4/7/2013 10:32 πμ, ο/η cutems93 έγραψε:

I am researching on editors for my own reference. I found that each of them has 
some features that other don't, but I am not sure which features are 
significant/necessary for a GOOD editor. What features do you a good editor 
should have? Keyboard shortcuts? Extensions?

Thanks!
Min


Download Sublime Text v3

Is a great editor

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: Default scope of variables

2013-07-04 Thread Dave Angel

On 07/04/2013 01:32 AM, Steven D'Aprano wrote:



  


Well, if I ever have more than 63,000,000 variables[1] in a function,
I'll keep that in mind.





[1] Based on empirical evidence that Python supports names with length at
least up to one million characters long, and assuming that each character
can be an ASCII letter, digit or underscore.



Well, the number wouldn't be 63,000,000.  Rather it'd be 63**100

I probably have it wrong, but I think that looks like:

859,122,207,646,748,720,415,212,786,780,258,721,683,540,870,960,267,706,738,947,655,539,422,295,787,680,882,091,181,482,626,114,653,152,637,456,091,641,990,601,474,111,018,521,295,858,424,750,289,461,372,414,431,396,326,232,796,267,104,001

variables.  (The number has 180 digits)

--
DaveA


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


Important features for editors

2013-07-04 Thread cutems93
I am researching on editors for my own reference. I found that each of them has 
some features that other don't, but I am not sure which features are 
significant/necessary for a GOOD editor. What features do you a good editor 
should have? Keyboard shortcuts? Extensions?

Thanks!
Min
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Default scope of variables

2013-07-04 Thread Ian Kelly
On Wed, Jul 3, 2013 at 11:32 PM, Steven D'Aprano
 wrote:
>> Python lets you do that across but not within functions.
>>
>> But Javascript/ECMAScript/whatever doesn't give you that. A var
>> declaration makes it function-local, no matter where the declaration is.
>> That's pointless. C++, on the other hand, lets you do this:
>>
>> void somefunc() {
>> for (int i=0;i<10;++i) {
>> // do something with outer i
>> for (int i=0;i<4;++i) {
>> // do something with inner i
>> }
>> // outer i is visible again
>> }
>> // neither i is visible
>> }
>
> That's truly horrible. If the cost of this "flexibility" is that I'll
> have to read, and debug, other people's code with this sort of thing, I'm
> happy to be less flexible. For what possible reason other than "because I
> can" would you want to use the same loop variable name in two nested
> loops?

It's interesting to note that while Java and C# also allow reuse of
local variable names, they do not allow local variables declared in
inner scopes to shadow variables declared in enclosing scopes, as in
the example above.  But the following would be perfectly legal:

void somefunc() {
for (int i = 0; i < a.size; ++i) {
// do something with a[i]
}
for (int i = 0; i < b.size; ++i) {
// do something with b[i]
}
}

And the two i's are treated as completely separate variables here, as
arguably they should be since they're used for two distinct purposes.
-- 
http://mail.python.org/mailman/listinfo/python-list


<    1   2