Re: How to decode UTF strings?

2019-10-25 Thread Arne Vajhøj

On 10/25/2019 4:52 PM, DFS wrote:

=?iso-8859-9?b?T/B1eg==?= 
=?utf-8?Q?=EB=AF=B8?= 
=?GBK?B?0Pu66A==?= 
=?UTF-8?B?zp3Or866zr/PgiDOks6tz4HOs86/z4I=?= 


How does something like:

from email.header import decode_header

def test(s):
print(s)
s2 = decode_header(s)
print(s2[0][0])
print(s2[1][0].strip())

test('=?iso-8859-9?b?T/B1eg==?= ')
test('=?utf-8?Q?=EB=AF=B8?= ')
test('=?GBK?B?0Pu66A==?= ')
test('=?UTF-8?B?zp3Or866zr/PgiDOks6tz4HOs86/z4I=?= 
')


work?

Arne

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


Re: security quirk

2013-01-30 Thread Arne Vajhøj

On 1/29/2013 11:55 PM, RichD wrote:

I read Wall Street Journal, and occasionally check
articles on their Web site.  It's mostly free, with some items
available to subscribers only.  It seems random, which ones
they block, about 20%.

Anywho, sometimes I use their search utility, the usual author
or title search, and it blocks, then I look it up on Google, and
link from there, and it loads!  ok, Web gurus, what's going on?


WSJ want their articles to be findable from Google.

So they open up for Google indexing them.

If they require any type of registration to see an article,
then Google will remove the link.

So therefore WSJ (and many other web sites!) gives more access
if you come from Google than if not.

Arne


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


Re: Which Lisp to Learn?

2009-03-08 Thread Arne Vajhøj

Xah Lee wrote:

For those of you imperative programers who kept on hearing about lisp
and is tempted to learn, then, ...


You:
* consider yourself unfairly treated by various communities
* post a long drivel about various Lisp flavors to newsgroups
  that are not in any way Lisp related
?

There seems to be a disconnect somewhere.

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


Re: Mathematica 7 compares to other languages

2008-12-10 Thread Arne Vajhøj

Jon Harrop wrote:

Xah Lee wrote:

Kaz Kylheku wrote:

Really? ``50 or hundreds'' of lines in C?

  #include  /* for sqrt */

  void normalize(double *out, double *in)
  {
double denom = sqrt(in[0] * in[0] + in[1] * in[1] + in[2] *
in[2]);

out[0] = in[0]/denom;
out[1] = in[1]/denom;
out[2] = in[2]/denom;
  }

Doh?

Kaz, pay attention:

Xah wrote: «Note, that the “norm” as defined above works for vectors
of any dimention, i.e. list of any length.»


That is still only 6 lines of C code and not 50 as you claimed:

double il = 0.0;
for (int i=0; i

Not that it matters, but the above requires C99 (or C++).

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


Re: The Importance of Terminology's Quality

2008-08-22 Thread Arne Vajhøj

Paul Wallich wrote:

Martin Gregorie wrote:

On Fri, 22 Aug 2008 22:56:09 +, sln wrote:

On Thu, 21 Aug 2008 09:11:48 -0500, [EMAIL PROTECTED] (Rob Warnock) wrote:

[EMAIL PROTECTED]> wrote:
*IS* raw machine code, *NOT* assembler!!

[snip]

I don't see the distinction.
Just dissasemble it and find out.

There's a 1:1 relationship between machine code and assembler. Unless 
its a macro-assembler, of course!
 

Each op is a routine in microcode.
That is machine code. Those op routines use machine cycles.

Not necessarily. An awful lot of CPU cycles were used before microcode 
was introduced. Mainframes and minis designed before about 1970 didn't 
use or need it and I'm pretty sure that there was no microcode in the 
original 8/16 bit microprocessors either (6800, 6809, 6502, 8080, 
8086, Z80 and friends).


The number of clock cycles per instruction isn't a guide either. The 
only processors I know that got close to 1 cycle/instruction were all 
RISC, all used large lumps of microcode and were heavily pipelined.


By contrast the ICL 1900 series (3rd generation mainframe, no 
microcode, no pipeline, 24 bit word) averaged 3 clock cycles per 
instruction. Motorola 6800 and 6809 (no microcode or pipelines either, 
1 byte fetch) average 4 - 5 cycles/instruction.


One problem with this discussion is that the term "microcode" isn't 
really well-defined. There's the vertical kind, the horizontal kind, 
with and without internal control-flow constructs, and then there are 
various levels of visibility to the user -- see e.g. the pdp-8 manual, 
where "microcoding" is used to mean piling the bits for a bunch of 
instructions together in the same memory location, which works fine as 
long as the instructions in question don't use conflicting sets of bits.


I thought microcode was relative well defined as being the software
used to implement instructions that were not fully implemented in
hardware.

http://en.wikipedia.org/wiki/Microcode does not make me think otherwise.

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


Re: The Importance of Terminology's Quality

2008-08-21 Thread Arne Vajhøj

Piet van Oostrum wrote:

Arne Vajhøj <[EMAIL PROTECTED]> (AV) wrote:

AV> Robert Maas, http://tinyurl.com/uh3t wrote:

John W Kennedy <[EMAIL PROTECTED]> wrote:

JWK> Into the 60s, indeed, there were still machines being made
JWK> that had no instruction comparable to the mainframe BASx/BALx
JWK> family, or to Intel's CALL. You had to do a subprogram call by
JWK> first overwriting the last instruction of what you were
JWK> calling with a branch instruction that would return back to
JWK> you.

That's not true, that you needed to do that, that there was no
other way available. The subroutine linkage I invented for S.P.S.
(Symbolic Programming System, i.e. IBM 1620 assembly language) was
to reserve a 5-digit space immediately before the subroutine entry
point for storing the return address. So the caller needed to know
only one address, the entry point, and do both store-return-address
and jump relative to that address, rather than needing to know both
the entry point and the last-instruction-JUMP-needs-patch address
as independent items of information.



AV> CDC Cyber did something very similar.
AV> Not very recursion friendly.


Actually, the CYBER way wasn't too bad. IIRC the CYBER had a subroutine
instruction that stored the return address in the location that the
instruction referenced and then jumped to the address following that
location. To implement a recursive procedure you started the code of the
procedure with saving the return address to a stack.


It was of course doable.

Else Pascal would have been hard to implement.

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


Re: The Importance of Terminology's Quality

2008-08-12 Thread Arne Vajhøj

Robert Maas, http://tinyurl.com/uh3t wrote:

John W Kennedy <[EMAIL PROTECTED]> wrote:
JWK> Into the 60s, indeed, there were still machines being made
JWK> that had no instruction comparable to the mainframe BASx/BALx
JWK> family, or to Intel's CALL. You had to do a subprogram call by
JWK> first overwriting the last instruction of what you were
JWK> calling with a branch instruction that would return back to
JWK> you.

That's not true, that you needed to do that, that there was no
other way available. The subroutine linkage I invented for S.P.S.
(Symbolic Programming System, i.e. IBM 1620 assembly language) was
to reserve a 5-digit space immediately before the subroutine entry
point for storing the return address. So the caller needed to know
only one address, the entry point, and do both store-return-address
and jump relative to that address, rather than needing to know both
the entry point and the last-instruction-JUMP-needs-patch address
as independent items of information.


CDC Cyber did something very similar.

Not very recursion friendly.

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


Re: spam <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

2008-07-13 Thread Arne Vajhøj

donald wrote:

Arne Vajhøj wrote:


Google does not accept spam complaints.  Go ahead, try it.  That's 
why they've been the #1 Usenet spamming tool for years now.  What 
you're seeing is the spam slowly expanding into the software 
development groups.  uk.railway is probably a random group added to 
confuse spam filters.  Some groups, like rec.photo.digital, have been 
getting hundreds of Google spams a day for about a year.


Ask your news service for a Google UDP (Usenet Death Penalty) or 
configure your reader to drop everything with "googlegroups.com" in 
the Message-ID.


Some real users do use GG.


This is true, however there are acceptable losses.


Everybody is free to look at it that way.

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

Re: spam

2008-07-13 Thread Arne Vajhøj

[EMAIL PROTECTED] wrote:

rickman wrote:

I love the way that people who plonk others feel the need to inform
everyone of it.  That ranks up there with, "I know what you are, but
what am I?"


It is a matter of basic politeness and common courtesy.  Without the
plonk, the killfiled poster is left hanging in the wind, wasting his
time writing responses that will never be read.

If you were talking with a blind man, would you silently creep
out of the room leaving him talking to the walls, or would you
be polite and excuse yourself before leaving?


I think most people will want to be polite to a blind.

I very much doubt that the same applies to usenet posters
they want to plonk.

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


Re: spam <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

2008-07-13 Thread Arne Vajhøj

Kevin McMurtrie wrote:

In article <[EMAIL PROTECTED]>,
 Lew <[EMAIL PROTECTED]> wrote:

WDC wrote:

BTW I reported it, yo should too.

To whom did you report it, so that we may also report it there?


Google does not accept spam complaints.  Go ahead, try it.  That's why 
they've been the #1 Usenet spamming tool for years now.  What you're 
seeing is the spam slowly expanding into the software development 
groups.  uk.railway is probably a random group added to confuse spam 
filters.  Some groups, like rec.photo.digital, have been getting 
hundreds of Google spams a day for about a year.


Ask your news service for a Google UDP (Usenet Death Penalty) or 
configure your reader to drop everything with "googlegroups.com" in the 
Message-ID.


Some real users do use GG.

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


Re: The Importance of Terminology's Quality

2008-06-01 Thread Arne Vajhøj

szr wrote:

Arne Vajhøj wrote:

szr wrote:

Peter Duniho wrote:

On Fri, 30 May 2008 22:40:03 -0700, szr <[EMAIL PROTECTED]>
wrote:

Arne Vajhøj wrote:

Stephan Bour wrote:

Lew wrote:
} John Thingstad wrote:
} > Perl is solidly based in the UNIX world on awk, sed, } > bash
and C. I don't like the style, but many do.
}
} Please exclude the Java newsgroups from this discussion.

Did it ever occur to you that you don't speak for entire news
groups?

Did it occur to you that there are nothing about Java in the
above ?

Looking at the original post, it doesn't appear to be about any
specific language.

Indeed.  That suggests it's probably off-topic in most, if not all,
of the newsgroups to which it was posted, inasmuch as they exist for
topics specific to a given programming language.

Perhaps - comp.programming might of been a better place, but not all
people who follow groups for specific languages follow a general
group like that - but let me ask you something. What is it you
really have against discussing topics with people of neighboring
groups? Keep in mind you don't have to read anything you do not want
to read. [1]

I very much doubt that the original thread is relevant for the Java
group.

But the subthread Lew commente don was about Perl and Unix. That is
clearly off topic.


I agree with and understand what you are saying in general, but still, 
isn't it possible that were are people in the java group (and others) 
who might of been following the thread, only to discover (probably not 
right away) that someone decided to remove the group they were reading 
the thread from? I know I would not like that, even if it wasn't on 
topic at the branch.


Personally, I find it very annoying to have to switch news groups in 
order to resume a thread and weed my way down the thread to where it 
left off before it was cut off from the previous group.


I am relative tolerant towards threads that are a bit off topic, if
the S/N ratio overall is good.

But I accept and respect that other people has a more strict
attitude against off topic posts.

And I am very little tolerant towards people that think they
can attack those that want only on topic posts.

One thing is to ask for a bit of slack regarding the rules
something else is attacking those that want the rules
kept.

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


Re: SPAM

2007-11-14 Thread Arne Vajhøj
Lew wrote:
> Yes, but it's not SPAM.
> 
> SPAM is a registered trademark of Hormel Foods Corporation for a canned 
> pork product.
> 
> Spam is unwanted messages or email.

It should be rather obvious what is was.

Why not leave it to Hormel to complain ?

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


Re: Distributed RVS, Darcs, tech love

2007-10-21 Thread Arne Vajhøj
Lew wrote:
>> very
>> different. Having a dead - i mean end of development line software
>> like TeX - and
> 
> Based on what do you call it "dead end".  It's used, it's outlasted many 
> other flashes in the pan, it does what its users require.  You will need 
> evidence for such a claim.

According to wikipedia the last version is from december 2002.

That level of activity could be considered dead.

It would for almost any other software. Tex has some
"absolute" over it, so I am not sure normal software
practices apply.

But you could argue based on that.

Arne

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


Re: which language allows you to change an argument's value?

2007-09-30 Thread Arne Vajhøj
Erik Wikström wrote:
>> their reference (alias) mechanism.  And C, Python, and Ruby probably
>> won't let you do that.  What about Java and Perl?
> 
> C will let you do it with pointers (it is just a syntactical difference
> from references in this case) and Java's references allows it.

Neither C or Java has call by reference.

C pointers and Java references may work similarly in most cases
but it is still call by value.

>I do not
> know about Ruby, Python and Perl, but (AFAIK) the all have OO support so
> I would be surprised if they used purely value semantics.

I can not see why OO should indicate anything about call by reference
support.

>> isn't "what i pass in, the function can modify it" not a desireable
>> behavior if i am NOT passing in the address of my argument?  For one
> 
> Being able to pass the actual object instead of a copy is highly
> desirable for two reasons. In most languages only one return value is
> allowed for a function so the ability to change parameters allows you to
> artificially return more without having to wrap them in constructs. The
> second reason is that for large objects the performance hit of having to
> create a copy each time you call a function can be forbidding.

Usually it is not a good thing, because it makes the code much
more difficult to read.

But sometimes it is handy.

I think C# got it right.

It allows it but require an explicit marking of it in both formal
argument list and actual argument list.

>> Java, Python, and Ruby, and we pass in a reference to object (not C+
>> +'s meaning of alias reference)
> 
> In what way does the C++ reference differ from those in Java, Python,
> and Ruby in this situation?

C++ and Java are very different in this aspect.

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

Re: Car-ac-systems

2007-09-14 Thread Arne Vajhøj
[text reordered from top post to standard newsgroup style]

John Timney (MVP) wrote:
> <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> On Sep 11, 9:35 am, "John Timney \(MVP\)"
>> <[EMAIL PROTECTED]> wrote:
>>> How do I control one with C# then!  Thats not on your site, clearly not
>>> everything I need to know then.  Waste of a site!
>> C# is just as off topic in comp.lang.java.programmer as car air-
>> conditioning systems. The latter, however, have the redeeming
>> characteristic that they are not the demonic spawn of evil Microsoft.
 > ho ho..now thats quite funny!

Before you start wondering too much try and make a search in
comp.lang.java.programmer for posts by nebulous99 ...

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


Re: Latest models of Gibson guitars

2007-08-19 Thread Arne Vajhøj
[EMAIL PROTECTED] wrote:

[some spam deleted]

> This is  a newsgroup of programming language Python, stop with this!

Actually this was posted to a bunch of newsgroups of which one is
about python.

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


Re: Computer Language Popularity Trend

2006-09-30 Thread Arne Vajhøj
Danno wrote:
> Xah Lee wrote:
>> This page gives a visual report of computer languages's popularity, as
>> indicated by their traffic level in newsgroups. This is not a
>> comprehensive or fair survey, but does give some indications of
>> popularity trends.
>>
>> http://xahlee.org/lang_traf/index.html
> 
> Wow, java is a low level industrial language? ;)

Compared to Python, Ruby etc. - yes.

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