http://xahlee.org/perl-python/list_comprehension.html
• Jargons of Info Tech Industry
http://xahlee.org/UnixResource_dir/writ/jargons.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Jon Harrop wrote:
> David Hopwood wrote:
> > That's consistent with the behaviour of list comprehensions in
nline
http://documents.wolfram.com/mathematica/
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
sa wrote:
> xah:
>
> i've provided k implementations here:
>
> http://www.nsl.com/k/xah.k
>
> of a dozen or so of the functions in your toolkit. many are trivial,
> since they&
http://xahlee.org/UnixResource_dir/writ/english_lawers.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
â
--
http://mail.python.org/mailman/listinfo/python-list
my perl and python tutorial
http://xahlee.org/perl-python/index.html
is now available for download for offline reading.
Download link at the bottom.
Xah
â http://xahlee.org/
â
--
http://mail.python.org/mailman/listinfo/python-list
New Science Discovery: Perl Idiots Remain Idiots After A Decade!
A excerpt from the new book 〈Modern Perl〉, just published, chapter 4
on “Operators”. Quote:
«The associativity of an operator governs whether it evaluates from
left to right or right to left. Addition is left associative, such
that
y bad written. Becha ass!
Xah
On Feb 29, 4:08 am, Kiuhnm wrote:
> On 2/29/2012 9:09, Xah Lee wrote:
>
>
> > New Science Discovery: Perl Idiots Remain Idiots After A Decade!
>
> > A excerpt from the new book 〈Modern Perl〉, just published, chapter 4
> > on “Operator
fun example.
in-place algorithm for reversing a list in Perl, Python, Lisp
http://xahlee.org/comp/in-place_algorithm.html
plain text follows
What's “In-place Algorithm”?
Xah Lee, 2012-02-29
This page tells you what's “In-place algorithm”, usi
ive me sir, but i haven't been at python for a while. :)
i was, actually, refreshing myself of what little polyglot skills i
have.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
ization they provide is microscopic and temporary.
best is really floor(x/y).
idiomatic programing, is a bad thing. It was spread by perl, of
course, in the 1990s. Idiomatic lang, i.e. lang with huge number of
bizarre idioms, such as perl, is the worst.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
Xah Lee wrote:
«… One easy way to measure it is whether a programer can read and
understand a program without having to delve into its idiosyncrasies.
…»
Chris Angelico wrote:
«Neither the behavior of ints nor the behavior of IEEE floating point
is a "quirk" or an "idiosyncracy
n when 2 operators are adjacent e.g. 「3 △ 6 ▲ 5 」?
do you happen to know some site that shows the relevant page i can
have a look?
thanks.
Xah
On Mar 1, 3:00 am, Kiuhnm wrote:
> On 3/1/2012 1:02, Xah Lee wrote:
>
> > i missed a point in my original post. That is, when the same
some additional info i thought is relevant.
are int, float, long, double, side-effects of computer engineering?
Xah Lee wrote:
«… One easy way to measure it is whether a programer can read and
understand a program without having to delve into its idiosyncrasies.
…»
Chris Angelico wrote
On Mar 5, 9:26 pm, Tim Roberts wrote:
> Xah Lee wrote:
>
> >some additional info i thought is relevant.
>
> >are int, float, long, double, side-effects of computer engineering?
>
> Of course they are. Such concepts violate the purity of a computer
> language
oject, if someone actually use a
parallel-algorithm-aware language to work on this problem, and report
on the break-point of file-size of parallel-algorithm vs sequential-
algorithm.
Anyone would try it? Perhaps in Fortress, Erlang, Ease, Alice, X10, or
other? Is the Clojure parallel aware?
Xah
--
http://mail.python.org/mailman/listinfo/python-list
r
key with 8th bit. keyX doesn't have a ID, but you can make one by
finding the number at the place you found the key C. Key C is
actually
optional, but when inner key and keyX's number matches, it changes
the
nature of the lock. This is when you need to turn on keyMode …
Xah
--
http://mail.python.org/mailman/listinfo/python-list
to know.
⢠Theory vs Practice
⢠Jargons of IT Industry
⢠The Lambda Logo Tour
⢠English Lawers
PS don't forget to checkout: ãFrom Why Not Ruby to Fuck Python, Hello
Rubyã @ http://xahlee.org/UnixResource_dir/writ/why_not_Ruby.html
yours humbly,
Xah
--
http://mail.pyth
=_gZK0tW8EhQ
i just started watching, havn't done yet.
(thx jcs's blog for the news)
PS posted to python and perl forums too, because i think might be
interesting for lang aficionados . Reply to just your community
please.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 3, 8:22 am, Rainer Weikusat wrote:
> Xah Lee writes:
>
> [...]
>
> > For example, “Is mathematics science or art?”, is the same type of
> > question that has been broached by dabblers now and then.
>
http://en.wikipedia.org/wiki/Liberal_arts
this is the best
format follows, as a amenity for tech
geekers.
---
World Multiconference on Systemics, Cybernetics and Informatics ???
Xah Lee, 2010-04-04
Starting in 2004, i regularly receive email asking me to participate a
conference, called “World Multiconference
hi guys,
sorry am feeling a bit prolifit lately.
today's show, is: 〈Fuck Python〉
http://xahlee.org/comp/fuck_python.html
Fuck Python
By Xah Lee, 2012-04-08
fuck Python.
just fucking spend 2 hours and still going.
here's the short story.
so
On Apr 8, 4:34 am, Steven D'Aprano wrote:
> On Sun, 08 Apr 2012 04:11:20 -0700, Xah Lee wrote:
>
> [...]
>
> I have read Xah Lee's post so that you don't have to.
>
> Shorter Xah Lee:
>
> "I don't know Python very well, and rather than adm
Xah Lee wrote:
« http://xahlee.org/comp/fuck_python.html »
David Canzi wrote
«When Microsoft created MS-DOS, they decided to use '\' as the
separator in file names. Â This was at a time when several previously
existing interactive operating systems were using '/' as the
too. (python code welcome too.)
Xah
--
http://mail.python.org/mailman/listinfo/python-list
Understand HTML5?〉
http://xahlee.org/UnixResource_dir/writ/html5_vs_intelligence.html
Xah
--
http://mail.python.org/mailman/listinfo/python-list
ch of Fuckfaces. (and
Fuck Pythoners. Python fucking idiots.)
O, don't forget,
〈Programing: What are OOP's Jargons and Complexities (Object Oriented
Program as Functional Program)〉
http://xahlee.org/Periodic_dosage_dir/t2/oop.html
please you peruse of it.
your servant, humbly
Learn Technical Writing from Unix Man in 10 Days
Quote from man apt-get:
remove
remove is identical to install except that packages are
removed
instead of installed.
Translation:
kicking
kicking is identical to kissing except that receiver is kicked
inste
On Apr 29, 7:43 pm, Jason Earl wrote:
> On Sat, Apr 28 2012, Steven D'Aprano wrote:
> > On Sat, 28 Apr 2012 14:55:42 -0700, Xah Lee wrote:
>
> >> Learn Technical Writing from Unix Man in 10 Days
>
> >> Quote from man apt-get:
>
> >> remove
Dear lisp comrades, it's Friday!
Dear Xah, your writing is:
• Full of bad grammar. River of Hiccups.
• Stilted. Chocked under useless structure and logic.
• WRONG — Filled with uncouth advices.
• Needlessly insulting. You have problems.
• Simply stinks. Wort
n be done in less than 20 minutes if you just type
continuously.
If your typing doesn't come anywhere close to a data-entry clerk, then
any layout “more efficient” than Dvorak is practically meaningless.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
also worked as data entry
clerk for a couple of years. Am a dvorak touch typist since 1994. (and
emacs since 1997) However, i never learned touch type the numbers on
the main section till i think ~2005. Since about 2008, the numerical
keypad is used as extra function keys.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
st of the time being
thinking,
│ planning, debugging, communicating with customers or managers,
reading
│ documentation, testing, committing code, sketching data schemas on
the
│ whiteboard ... to say nothing of the dreaded strategy meetings.
you can find the study on my site. URL in the first post o
Ba Wha 13, 7:23 nz, Ehfgbz Zbql 〔ehfgbzcz...@tznvy.pbz〕 jebgr:
│ Qibenx -- yvxr djregl naq nal bgure xrlobneq ynlbhg -- nffhzrf gur
│ pbzchgre vf n glcrjevgre.
│ Guvf zrnaf va rssrpg ng yrnfg gjb pbafgenvagf, arprffnel sbe gur
│ glcrjevgre ohg abg sbe gur pbzchgre:
│
│ n. Gur glcvfg pna glcr bayl
for some reason, was unable to post the previous message. (but can
post others) So, the message is rot13'd and it works. Not sure what's
up with Google groups. (this happened a few years back once.
Apparantly, the message content might have something to do with it
because rot13 clearly works. Yet,
so there are several
sites all trying to do it. Talk is cheap, the hardest part is actually
to get money to finance and manufacture it. The latest one, which i
deem good, is Truely Ergonomic keyboard. It sells for $200 and is in
pre-order only now.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
th.
there's many ways we can cookup tests right away to see. e.g. try to
squeeze a rubber ball with 4th and thumb. Repeat with pink + thumb.
Or, reverse exercise by stretching a rubber band wrapped on the 2
fingers of interest. You can easy see that pinky isn't stronger.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 17, 2:26 pm, Dotan Cohen wrote:
> On Fri, Jun 17, 2011 at 20:43, Xah Lee wrote:
> > u r aware that there are already tens of layouts, each created by
> > programer, thinking that they can create the best layout?
>
> Yes. Mine is better :)
> Had Stallman not heard
On Jun 18, 4:06 am, Dotan Cohen wrote:
> On Sat, Jun 18, 2011 at 01:09, Xah Lee wrote:
> > thanks. didn't know about Ducky keyboard. Looks good. Also nice to
> > hear your experience about Truly Ergonomic keyboard.
>
> I like it, see my first-hour review
> here:htt
this will be of interest to those bleeding-edge pythoners.
“what… is the airspeed velocity of an unladen swallow?”
xahlee.org/funny/unladen_swallow.html
Xah
--
http://mail.python.org/mailman/listinfo/python-list
llows.
--
Emacs Lisp: Processing HTML: Transform Tags to HTML5 “figure” and
“figcaption” Tags
Xah Lee, 2011-07-03
Another triumph of using elisp for text processing over perl/python.
The Problem
--
Summary
I want batch tran
On Jul 4, 12:13 pm, "S.Mandl" wrote:
> Nice. I guess that XSLT would be another (the official) approach for
> such a task.
> Is there an XSLT-engine for Emacs?
>
> -- Stefan
haven't used XSLT, and don't know if there's one in emacs...
it'd be nic
On Jul 5, 12:17 pm, Ian Kelly wrote:
> On Mon, Jul 4, 2011 at 12:36 AM, Xah Lee wrote:
> > So, a solution by regex is out.
>
> Actually, none of the complications you listed appear to exclude
> regexes. Here's a possible (untested) solution:
>
>
>
On Jul 5, 12:17 pm, Ian Kelly wrote:
> On Mon, Jul 4, 2011 at 12:36 AM, Xah Lee wrote:
> > So, a solution by regex is out.
>
> Actually, none of the complications you listed appear to exclude
> regexes. Here's a possible (untested) solution:
>
>
>
2011-07-11
On Jul 11, 6:51 am, jvt wrote:
> I might as well toss my two cents in here. Xah, I don't believe that
> the functional programming idiom demands that we construct our entire
> program out of compositions and other combinators without ever naming
> anything. That
osoft sites... are they in C/C++ and or dotnet?
Xah
--
http://mail.python.org/mailman/listinfo/python-list
find this a interesting “challenge”. This is a parsing
problem. I haven't studied parsers except some Wikipedia reading, so
my solution will probably be naive. I hope to see and learn from your
solution too.
i hope you'll participate. Just post solution here. Thanks.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 17, 12:47 am, Xah Lee wrote:
> 2011-07-16
>
> folks, this one will be interesting one.
>
> the problem is to write a script that can check a dir of text files
> (and all subdirs) and reports if a file has any mismatched matching
> brackets.
> …
Ok, here's
On Jul 18, 7:07 pm, Billy Mays wrote:
> On 7/18/2011 7:56 PM, Steven D'Aprano wrote:
>
>
>
>
>
>
>
>
>
> > Billy Mays wrote:
>
> >> On 07/17/2011 03:47 AM, Xah Lee wrote:
> >>> 2011-07-16
>
> >> I gave it a shot. It doe
On Sunday, July 17, 2011 2:48:42 AM UTC-7, Raymond Hettinger wrote:
> On Jul 17, 12:47 am, Xah Lee wrote:
> > i hope you'll participate. Just post solution here. Thanks.
>
> http://pastebin.com/7hU20NNL
just installed py3.
there seems to be a bug.
in this file
http://xahle
: %s' % name
>
> --
> Bill
as Ian Kelly mentioned, your script fail because it doesn't report the
position or line/column number of first mismatched bracket. This is
rather significant part to this small problem. Avoiding unicode also
lessen the value of this exercise, because han
reported = True
> else:
> stack.append(c)
>
> print '%s: %s' % (name, ("good" if len(stack) == 1 else "bad
> '%s' at %s:%s" % first_bad))
Thanks for the fix.
Though, it seems still wrong.
On the file http://xahlee.org/p/time_machine/tm-ch04.html
there is a mismatched curly double quote at 28319.
the script reports:
tm-ch04.html: bad ')' at 68:2
that doesn't seems right. Line 68 is empty. There's no opening or
closing round bracket anywhere close. Nearest are lines 11 and 127.
Maybe Billy Mays's algorithm is wrong.
Xah (fairly discouraged now, after running 3 python scripts all
failed)
--
http://mail.python.org/mailman/listinfo/python-list
e naive. I hope to see and learn from your
> > solution too.
>
> > i hope you'll participate. Just post solution here. Thanks.
>
> I thought I'd have some fun with multi-processing:
>
> https://gist.github.com/1087682
hi Thomas. I ran the program, all cpu went max (i have a quad), but
after i think 3 minutes nothing happens, so i killed it.
is there something special one should know to run the script?
I'm using Python 3.2.1 on Windows 7.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
mismatched curly quotes.
> > (e.g.http://xahlee.org/p/time_machine/tm-ch04.html )
>
> > LOL Billy.
>
> > Xah
>
> I suspect its due to the file mode being opened with 'rb' mode. Also,
> the diction of characters at the top, the closing token is the key,
> wh
pt to Validate Matching Brackets
Xah Lee, 2011-07-19
This page shows you how to write a elisp script that checks thousands
of files for mismatched brackets.
The Problem
Summary
I h
s
py3 validate_brackets_Thomas_Jollans_2.py
c:/Users/h3/web/xxst/find_elisp/validate matching brackets/xxdir
\xx.txt
h3@H3-HP 2011-07-21 05:21:59 ~/web/xxst/find_elisp/validate matching
brackets
py3 --version
Python 3.2.1
h3@H3-HP 2011-07-21 05:27:03 ~/web/xxst/find_elisp/validate matching
bracke
On Jul 19, 11:07 am, Thomas Jollans wrote:
> On 19/07/11 18:54, Xah Lee wrote:
>
>
>
>
>
>
>
>
>
> > On Sunday, July 17, 2011 2:48:42 AM UTC-7, Raymond Hettinger wrote:
> >> On Jul 17, 12:47 am, Xah Lee wrote:
> >>> i hope you
ks for the code.
are you willing to make it complete and standalone? i.e. i can run it
like this:
perl Rouslan_Korneychuk.pl dirPath
and it prints any file that has mismatched pair and line/column number
or the char position?
i'd do it myself but so far i tried 5 codes, 3 fixes, all failed. Not
a complain, but it does take time to gather the code, of different
langs by different people, properly document their authors and
original source urls, etc, and test it out on my envirenment. All
together in the past 3 days i spent perhaps a total of 4 hours running
several code and writing back etc and so far not one really worked.
i know perl well, but your code is a bit out of the ordinary ☺. If
past days have been good experience, i might dive in and study for
fun.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
suggestion of ideas.
i haven't done extensive testing on my own code neither.
I'll revisit maybe in a few days.
Feel free to grab my report and make it nice. If you would like to fix
your code, feel free to email.
Xah
On Jul 21, 7:26 am, Ian Kelly wrote:
> On Thu, Jul 21
On Jul 21, 9:43 am, pyt...@bdurham.com wrote:
> Xah,
>
> 1. Is the following string considered legal?
>
> [ { ( ] ) }
>
> Note: Each type of brace opens and closes in the proper sequence. But
> inter-brace opening and closing does not make sense.
nu!
> Or must a closi
On Jul 31, 11:38 am, gavino wrote:
> On Jul 13, 1:04 pm, ccc31807 wrote:
>
>
>
>
>
>
>
>
>
> > On Jul 12, 7:54 am, Xah Lee wrote:
>
> > > maybe this will be of interest.
>
> > > 〈What Programing Language Are t
html
i'd be interested to know what Dotan Cohen use too.
i tried the swapping number row with symbols a few years back. didn't
like it so much because numbers are frequently used as well,
especially when you need to enter a series of numbers. e.g. heavy
math, or dates 2010-02-28. One can
d it daily for about a month before I switched to APLX - aka micro
> APL.. and as I had zero problems.. So, I suspect it is 100% A+
> compatible.
>
> Initially, I thought of writing a python wrapper that would handle
> conversion from Unicode to A+'s peculiar brand of latin1 and back (among
> other things) but never had the time.
hi Chris,
i created a page dedicated to creating math symbol layouts for
different langs.
I linked to your post.
I wonder if you would let me mirror your X code on my site? Or, if you
place it on somewhere more permanent or dedicate page such as git, i'd
link to that. Thanks.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
might be of interest.
〈English Idiom in Unix: Directory Recursively〉
http://xahlee.org/comp/idiom_directory_recursively.html
--
English Idiom in Unix: Directory Recursively
Xah Lee, 2011-05-17
Today, let's discuss something in the category of lingu
Xah wrote:
«In the emacs case: “Recursive delete of xx? (y or n) ”, what could it
possibly mean by the word “recursive” there? Like, it might delete the
directory but not delete all files in it?
»
Jonathan de Boyne Pollard wrote:
> It might *try* to delete the directory but not any of
nism). Realizing the algorithmic property and parallel-
execution issues of linked list is only recent years.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
On May 22, 3:46 pm, Chris Angelico wrote:
> On Mon, May 23, 2011 at 6:22 AM, Xah Lee wrote:
> > Xah wrote:
> > «In the emacs case: “Recursive delete of xx? (y or n) ”, what could it
> > possibly mean by the word “recursive” there? Like, it might delete the
> > directo
On May 22, 4:32 pm, Chris Angelico wrote:
> On Mon, May 23, 2011 at 9:17 AM, Xah Lee wrote:
> > the context is this: In emacs directory manager (aka dired), when you
> > call dired-do-delete on a directory, emacs prompts, this way:
> > “Recursive delete of xx? (y or n)”
>
On May 23, 9:28 pm, Chris Angelico wrote:
> On Tue, May 24, 2011 at 2:20 PM, Xah Lee wrote:
> > why don't you file a bug report? In GNU Emacs 23.2, it's under the
> > Help menu. I suppose it's the same in other emacs distro.
>
> Because I do not consider its b
; I'm one of the 'people'. You say exposed to, I say bothered/bored with.
>
> I have nothing against the use of a proper, precise term. And that word can
> be a complex one with many, many sylables (seems to add value, somehow).
>
> But I'm not an academic, so I don't admire the pedantic use of terms that
> need to be explained to 'lay' people. Especially if there is a widespread,
> usually shorter and much simpler one for it. A pointless effort if
> pointless, even when comming from a physicist. :-)
very well said, Rikishi42.
this one is probably the most intelligent post in this thread.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
nlink" instead of "delete"? Or "directory"
> instead of "folder", pointing out that "directory" is the correct term
> because a directory is just a listing and does not "contain" the actual
> files. Of course these implementation details will never matter to
> anyone except under the rarest conditions.
>
> Thorsten
well said.
half of posts in this thread are from idiots. just incredible, but
again, its newsgroups ... what am i thinking ...
Xah
--
http://mail.python.org/mailman/listinfo/python-list
On May 26, 4:20 am, Thorsten Kampe wrote:
> Did your mom tell you to "recursively clean up your room"?.
that had me L O L!
i think i'll quote in my unix hating blogs sometimes, if you don't
mind. ☺
Xah
--
http://mail.python.org/mailman/listinfo/python-list
A Moronicity of Guido van Rossum
Xah Lee, 200509
On Guido van Rossum's website:
http://www.artima.com/weblogs/viewpost.jsp?thread=98196
dated 20050826, he muses with the idea that he would like to remove
lambda, reduce(), filter() and map() constructs in a future version
Python 3000.
d will be considered an incurable
disease. And you know what incurable diseases do: they invite the
quacks and charlatans in, who in this case take the form of Software
Engineering gurus." —Edsger Dijkstra 1930-2002.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
the industrial dignitaries are just fucking liers. And
today we have the fucking Java and fucking Perl and their bosses
trumpeting their fucking state-of-the-art-ness. Go fuck your wifes.
(disclaimer: all mentions of any real person are just opinion.)
-
See also:
http://xahlee.org/perl-python/python_3000.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
/_scripts/check_file_size.pl
)
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
# perl
# Tue Oct 4 14:36:48 PDT 2005
# given a dir, report all html file's size. (counting inline images)
# XahLee.org
use Data::Dumper;
use File::Find;
use File::Basename;
$inpath = '/Users/t/web/m
Xah Lee wrote: « would anyone like to translate the following perl
script to Python or Scheme (scsh)?»
Here's the Python version.
# -*- coding: utf-8 -*-
# Python
# Wed Oct 5 15:50:31 PDT 2005
# given a dir, report all html file's size. (counting inline images)
# XahLee.org
27;d be some
general interest. For some background of this song, see
http://xahlee.org/Periodic_dosage_dir/sanga_pemci/daisy_bell.html
i'm interested in getting versions that can sing the song in Windows,
Mac, Linux using whatever speech synth each OS may provide. Thanks.
Xah
[EMAIL PROTE
Dear Michael Goettsche,
why don't you lead the pack to be on-topic for a change, huh?
Xah
Michael Goettsche wrote:
> On Saturday 08 October 2005 22:10, Xah Lee wrote:
> > there is a MacPerl program posted in 1998 that uses Mac's speech synth
> > to sing Daisy Be
fuckheads. Motherfucking don't know
shit and yet lying thru their teeth with fanfare.
(for the technical context and justification of this message, please
see the essays at the bottom of:
http://xahlee.org/perl-python/python.html )
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Sort a List
Xah Lee, 200510
In this page, we show how to sort a list in Python & Perl and also
discuss some math of sort.
To sort a list in Python, use the “sort” method. For example:
li=[1,9,2,3];
li.sort();
print li;
Note that sort is a method, and the list is changed in place.
Sup
Python Doc Problem Example: sort()
Xah Lee, 200503
Exhibit: Incompletion & Imprecision
Python doc “3.6.4 Mutable Sequence Types” at
http://python.org/doc/2.4/lib/typesseq-mutable.html
in which contains the documentation of the “sort” method of a list.
Quote:
«
Operation Result N
explain what it is, and the
latch on of “multiple passes” and the mysterious “by department,
by salary”.
Here's a suggested rewrite: “Since Python 2.3, the result of sort()
no longer rearrange elements where the comparison function returns
0.”
---
This post is archived at:
http://xah
ve
languages and its people. In Python, the language syntax is tainted. In
Perl, a complex construct is invented. In both camps, the basic
mathematics of sorting and its implementation aspects are completely
belied.
For the official doc of Perl's sort, type on the command line:
“perldoc -f sort”.
-
this post is archived at:
http://xahlee.org/perl-python/sort_list.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
name as acknowledgement at my
website essay)
The Python doc really should mention it at the place where the sort
method is documented.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Microsoft Hatred, FAQ
Xah Lee, 20020518
Question: U.S. Judges are not morons, and quite a few others are
not morons. They find MS guilty, so it must be true.
Answer: so did the German population thought Jews are morons by
heritage, to the point that Jews should be exterminated from earth
list?
Thanks.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Split File Fullpath Into Parts
Xah Lee, 20051016
Often, we are given a file fullpath and we need to split it into the
directory name and file name. The file name is often split into a core
part and a extension part. For example:
'/Users/t/web/perl-python/I_Love_You.html'
becomes
Bryan wrote:
> mr. xah... would you be willing to give a lecture at pycon 2006? i'm sure you
> would draw a huge crowd and a lot of people would like to meet you in
> person...
>
> thanks.
I'd be delight to.
My requirements are: 1 cup of fat-free milk, free, and
Xah Lee wrote:
> > In Perl, spliting a full path into parts is done like this:
Dr.Ruud wrote:
> And then follows Perl-code that only works with an optional .html
> "extension",
Thanks for the note. I've corrected it here:
http://xahlee.org/perl-python/split_fullp
ileExtension
if os.path.exists(p2): p=p2
imgPaths.append(p)
temp=[]
print imgPaths
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Xah Lee wrote:
> is there a way to condense the following loop into one line?
>
> # -*- coding: utf-8 -*-
> # python
>
> import re, os.path
>
> imgPaths=[u'/Users/t/web/Periodic_dosage_dir/lanci/t4/oh/DSCN2059m-s.jpg',
> u'/Users/t/web/Periodic_dosage_di
hrows an OSError
exception”.
i think the function shouldn't complain if dir already exists. How is a
programer to distinguish if the dir already exists, or if there's a
problem creating the dir?
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/
Peter Hansen wrote:
> Xah Lee wrote:
> > If you think i have a point, ...
>
> You have neither that, nor a clue.
Dear Peter Hansen,
My messages speak themselfs. You and your cohorts's stamping of it does
not change its nature. And if this is done with repetitiousness, it
gi
> Xah Lee, on Aug 22, 2:43 pm wrote:
> Unix, RFC, and Line Truncation
> http://xahlee.org/UnixResource_dir/writ/truncate_line.html
Steve wrote:
> I've seen this argument before. There's at least one VERY good reason
> to hard-code linebreaks in text: to preserve a cover
xpr
falseExpr) )
is there a way to similate it?
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
[EMAIL PROTECTED] wrote:
> what do you mean by one line ? Using map/filter, I believe it is
> possible.
>
> Somthing like:
>
> map(lambda (s,f): os.path.exists(f) and f or s,
> map
t i do hate the mother fucking fuckheads Pythoners for one
thing that they don't know what functional programing really is, and on
the other hand fucking trumpet their righteousness and lies thru their
teeth of their ignorance. (that Guido guy with his Python 3000 article
on his blog is one ex
hing cross-posted is considered as troll, and the inter-language
communication has been essentially completely cut off. Basically, the
only ones generating all the garbage posts are these troll-criers
themselves. (will have to flesh out on this particular point of
net-sociology in a essay some other d
One-Liner Loop in Functional Style
Xah Lee, 200510
Today we show a example of a loop done as a one-liner of Functional
Programing style.
Suppose you have a list of file full paths of images:
/Users/t/t4/oh/DSCN2059m-s.jpg
/Users/t/t4/oh/DSCN2062m-s.jpg
/Users/t/t4/oh/DSCN2097m-s.jpg
/Users/t
Thomas Bellman wrote:
>try:
> os.makedirs("/tmp/trh/spam/norwegian/blue/parrot/cheese")
>except os.error, e:
> if e.errno != errno.EEXIST:
> raise
This is what i want. Thanks.
(the doc needs quite some improvement...)
Xah
[EMAIL PROTE
ng list at Yahoo.com. To see the mailing list, go
to: http://groups.yahoo.com/group/haskell-a-day
To subscribe, send a email to: haskell-a-day-subscribe @
yahoogroups.com
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 529 matches
Mail list logo