rsions from Reinhold Birkenfeld, the one using graphs by bearophile
...
since many of you have already collected and tested these... i wonder
if anyone'd be interested to put together all the (working) code in a
single message? (or even a webpage.)
thanks.
Xah
[EMAIL PROTECTED]
http
the predicate given. For example, in the given
example, it tells us that the 2nd, 3rd, 4th elements are equivalent.
And they are equivalent measured by the predicate function given, which
basically tests if their last item are the same integer. (note that if
we want to view the result as indexes, then it is 1-based index. i.e.
counting starts at 1.)
PS if you didn't realize yet, nested lists/dictionaries in perl is a
complete pain in the ass.
PS note that the code "sub {$_[0]->[3] == $_[1]->[3]}" is what's called
the lambda form, in Perl.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
lee.org/perl-python/gen_parti_by_equiv.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
is there a way to write a expression of a function with more than 1
argument?
e.g., i want a expression that's equivalent to
def f(x,y)
return x+y
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
guages
are hardware-centric), as opposed to algorithm math concepts.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
rate a law suit and if such company do not take software
correctness seriously, we must punish them.
Please spread this awareness.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
org/UnixResource_dir/writ/responsible_license.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
Xah Lee wrote:
> folks:
>
> when using google to post a reply, it sometimes truncates the subject
> line. i.e. [perl-python] is lost. This software error is obvious,
]]
(we do not assume the given set has order, so the result is not
ordered.)
Perl code and Python code will be posted in 2 days.
This is brought to you by the perl-python community. To subscribe, see
http://xahlee.org/perl-python/python.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir
t in range(s)
@for a in partiSet[t]
@for b in partiSet[s]]
@
@ll=( [[9,1],[5],[2,8,7]])
@t=genpair(ll)
@t2=genpair2(ll)
@if (t.sort()==t2.sort()): print 'yay'
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
once i have a expresson of a function, how to apply it to arguments?
e.g. if i have
lambda x,y:x+y
i have to applied it to a,b in my code.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
n throughly brainwashed by
imperative shits. (and these morons don't even know it)
i'll explain the ins and outs of expressions of functions some other
day.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
PS sorry for the rude remarks out of nowhere.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
if i understand correctly, forms such as
(lambda x,y:x+y)(a,b)
can only be gained thru experience? and not documented directly
anywhere in the official docs?
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
i have a bunch of files encoded in GB18030. Is there a way to convert
them to utf16 with python?
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
ython doc is quite stilted. Where in the python doc is a programer
supposed read about how the package/module system in Python works?
(besides the tutorial that touches it)
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
Truely superb!
Thanks!
Xah
[EMAIL PROTECTED]
http://xahlee.org/
[EMAIL PROTECTED] wrote:
> Xah Lee <[EMAIL PROTECTED]> wrotE:
>
> > i have a bunch of files encoded in GB18030. Is there a way to
convert
> > them to utf16 with python?
>
> You will need CJKCod
nutshell, these people are spreading
untruths and indirectly are causing massive harm in the computing
industry. People, we need to stop it. This each of us can do by not
accepting their attitudes or behavior. In online forums, work place,
conventions, conversations etc., raise questions or otherwi
>def myFun(var):
> return var+1
>globe = 0
>globe = myFun(globe)
this is intriguing. How does it work?
not a rhetorical question, but where in the python doc can i read about
it?
thanks.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python
Nevermind. I was thinking too much. :) Thanks.
Xah
Peter Hansen wrote:
> Xah Lee wrote:
> >>def myFun(var):
> >> return var+1
> >>globe = 0
> >>globe = myFun(globe)
> >
> > this is intriguing. How does it work?
> > not a rhetoric
e program.
a absolute requirement in this problem is to minimize the number of
comparison made between files. This is a part of the spec.
feel free to write it however you want. I'll post my version in a few
days.
http://www.xahlee.org/perl-python/python.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
"released ..." indicates the doc or the doc and the
software?
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
27;s unicode. Is there something
similar?
--
this post is archived at
http://xahlee.org/perl-python/unicodedata_module.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
how do i get a unicode's number?
e.g. 03ba for greek lowercase kappa? (or in decimal form)
Xah
Xah Lee wrote:
> python has this nice unicodedata module that deals with unicode
nicely.
>
> #-*- coding: utf-8 -*-
> # python
>
> from unicodedata import *
>
> # each u
, '|', name(x,'-')
--
http://xahlee.org/perl-python/unicodedata_module.html
anyone wants to supply a Perl version?
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
Brian McCauley wrote:
> Xah Lee wrote:
>
> > i don't know what's the state of Perl's unicode.
>
> perldoc perlunicode
--
http://mail.python.org/mailman/listinfo/python-list
Fuck google incorporated for editing my subject name without
permission.
and fuck google incorporated for editing my message content without
permission.
http://xahlee.org/UnixResource_dir/writ/responsible_license.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http
Combo114.py
Genpair114.py
Here're the files: del_dup.zip
-
to get the code and full detail with latest update, please see:
http://xahlee.org/perl-python/delete_dup_files.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
Claudio Grondi wrote:
> >> I'
Today we'll write a program that can sort a matrix in all possible
ways.
Here's the Perl documentation. I'll post a Perl and Python version in 2
days.
---
sort_matrix( $matrix, [[$n1, $stringQ, $directionQ], [$n2, $stringQ,
$directionQ], ...]) sorts a matrix by $n1 th column then $n2 th.
common and does not indicate
incompetence), being aware of it helps greatly in its exposition.
This and past critics on Python documentation and IT doc in general is
archived at
http://xahlee.org/Periodic_dosage_dir/t2/xlali_skami_cukta.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
there is a Python, pithy
mighty, lissome, and tabby
algorithms it puffs
tim-toady it engulfs
and sways universality
there is a camel, lanky
ugly, petty, ungainly
foolhardy comports
hacking it supports
and toadies eunuch's fancy
Xah
[EMAIL PROTECTED]
â http://xahlee.org/PageTwo_dir/more
umm... looks like it should've been:
Comparison can be chained, and is equivalent to a sequence of
comparisons with âandâ in between. For example, âxhttp://xahlee.org/
Terry Reedy wrote:
> >Comparisons can be chained, and is evaluated from left to right. For
> >example, x < y <= z is equivalent t
Better:
there is a Python, pithy
mighty, lissome, and tabby
algorithms it puffs
conundrums it snuffs
and cherished by those savvy
there is a camel, kooky
ugly, petty, ungainly
hacking it supports
TIMTOWTDI it sports
and transports DWIM-wit's fancy
Xah
[EMAIL PROTECTED]
â http://xahle
2]:
result.sort(lambda x,y: cmp(float(x[dir[0]]),
float(y[dir[0]])) )
else:
result.sort(lambda x,y: cmp(float(x[dir[0]]),
float(y[dir[0]])), None, True )
return result
m = [
[3, 99, 'a'],
[2, 77, 'a'],
[1, 77, '
ing
needs to be Python-as-is, as opposed to computer science framework.
I'll might have to give more details in the future, but I've made some
headway in this respect before; peruse:
http://xahlee.org/Periodic_dosage_dir/t2/xlali_skami_cukta.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org
happen.
findreplace = [
(ur'',
ur'''tt
'''),
]
...
inF = open(filePath,'rb')
s=unicode(inF.read(),'utf-8')
inF.close()
for couple in findreplace:
outtext=s.replace(couple[0],couple[1])
s=outtext
outF = open(temp
ursor position and the
char's ascii code, says the EOL is ascii 10 when it is in fact ascii
13. Fuck the irresponsible fuckhead who is responsible for this.
http://xahlee.org/UnixResource_dir/writ/responsible_license.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
Xah Lee wrote:
> Why is
can any GNU person or emacs coder answer this?
specifically: why does what-cursor-position give incorrect answer.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/PageTwo_dir/more.html â
Xah Lee wrote:
> I found the problem now. (after some one hour debug time) Python
> didn't have pro
the doc is talking about?
But, can this doc be (re-)written effectively and easily so that any
programers needn't do trial'n'error post-reading?
The answer to the questions are resounding yeses, you fucking asses.
paypal me a hundred dollars and i'll rewrite the whole re doc in a f
how to represent the unicode "em space" in regex?
e.g. i want do something like this:
fracture=re.split(r'\342371*\|\342371*',myline,re.U)
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
t by null bytes here? Unprintable chars?? and the "\number"
is meant to be decimal? and in what encoding?
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
suppose the same for
groupindex() )
thanks.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
WRITERS or NEED EXAMPLE HERE.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
send your feedbacks to Steve Holden. (http://www.holdenweb.com/)
If he deem it proper, he will paypal me $100 bucks, and you can thank
him for the instigation and betterment of the Python doc.
Meanwhile, feel free to incorporate my edits into python doc.
Xah
[EMAIL PROTECTED]
â http
I have produced my doc.
( http://xahlee.org/perl-python/python_re-write/lib/module-re.html )
isn't there a hundred dollars due to me?
Xah
[EMAIL PROTECTED]
â http://xahlee.org/PageTwo_dir/more.html
Steve Holden wrote:
> Xah Lee wrote:
> [mountains of irrelevant drivel which no
Dear Steve Holden,
the rewrite of the regex doc is instigated by your offer.
it is published and announced here on April 18th. If you deem it
proper, paypal me. It will be to your credit and easier to incorporate
into the main doc.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http
Programing Challenge: Constructing a Tree Given Its Edges.
Show you are the boss.
http://xahlee.info/perl-python/python_construct_tree_from_edge.html
here's plain text.
── ── ── ── ──
Problem: given a list of edges of a tree: [child, parent], construct the
med entities to unicode char.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 28, 3:57 am, mer...@stonehenge.com (Randal L. Schwartz) wrote:
> >>>>> "Xah" == Xah Lee writes:
>
> Xah> curious question.
> Xah> suppose you have 300 different strings and they need all be replaced
> Xah> to say "aaa".
>
>
iteral, not regex)? because i thought implementing replacement for
string should be much simpler and faster, because buffers comes with
it a whole structure such as “point”, text properties, buffer names,
buffier modifier, etc.
Xah
On Sep 28, 5:28 am, Xah Lee wrote:
> On Sep 28, 3:57 am, mer...
lisp, etc. I'll post a emacs lisp
solution in a couple of days.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 5, 4:31 am, Tim Bradshaw wrote:
> On 2011-12-05 11:51:11 +0000, Xah Lee said:
>
> > python has more readible syntax, more modern computer language
> > concepts, and more robust libraries. These qualities in turn made it
> > popular.
>
> Yet you still post h
Responsible Software Licensing
Xah Lee, 200307
Software is a interesting invention. Software has this interesting
property, that it can be duplicated without cost, as if like copying
money. Never in history are goods duplicable without cost. But with the
invention of computer, the ephemeral non
Responsible Software Licensing & Free Software Foundation
Xah Lee, 2005-07
Dear Programers,
I have always respected the Free Software Foundation (FSF) and its
community.
when i wrote the article a couple years ago on Responsible Software
Licensing, i thought it might not be welcomed by
cumentation problems, see
bottom of:
http://xahlee.org/perl-python/python.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
. Zawinski (~1971-)
The code is 3.4 thousand lines of Perl in one single file. Rather
incomprehensible.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
they have the right to do so.
On the other hand, in terms of documentation quality, technological
excellence, responsibility in software, Microsoft in the 21st century
is the holder of human progress when compared to the motherfucking Open
Sourcers lying thru their teeth fuckheads.
Xah
[EMAIL PROTE
basic,
necessary, functional layout feature as multi-columns is not there yet.
This is a indication of the fatuousness of the IT industry's
technologies and its people.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
------
Xah Lee wrote:
sometimes in the last
basic,
necessary, functional layout feature as multi-columns is not there yet.
This is a indication of the fatuousness of the IT industry's
technologies and its people.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
------
Xah Lee wrote:
sometimes in the last
The Bug-Reporting Attitude
Xah Lee, 2005-02, 2006-01
People,
There is a common behavior among people in software geek forums, that
whenever a software is crashing or behaving badly, they respond by
“go file a bug report” as if it is the duty of software consumers.
When a software is ostensibly
IT Industry Predicament
Xah Lee, 200207
As most of you agree, there are incredible wrongs in software industry.
Programs crash, injurious tools, uninformed programers, and decrepit
education system. Over the years of my computing industry experience
since 1995, i have recently gradually come to
tion:
What are OOP's Jargons and Complexities
http://xahlee.org/Periodic_dosage_dir/t2/oop.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Languages to Hate, Xah Lee, 2002
http://xahlee.org/UnixResource_dir/writ/language_to_hate.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
bvious. But however, suppose the cursor is at t in the
“alternate” inside the “link” tag, then it would first select
the whole “alternate” word, then the whole “rel="alternate"”,
then the whole link tag, then the whole content of the entry tag, then
including the “” tags itself.
(i
own
syntax. However, this is still not trivial, and amounts to several
programing efforts.
Anyone would be interested in this problem?
PS bpalmer on #emacs irc.freenode wrote a elisp quicky to deal with
lisp, but that program is currently not fully working... see bottom
http://paste.lisp.org/
For
Python and Java, i think the report will also have to count method
call since that what these langs deal with... slightly quite more
complex than just functional langs...
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
xahlee.org/UnixResource_dir/complang.html
(computer language logos)
Again: the primary purpose of this message, is to beseach that the
power-that-be of lispers, seriously think about getting themselves a
official logo. Thanks.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailma
eds a logo, i'll post a reply to this
thread wthin a month.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
[EMAIL PROTECTED] wrote:
> On Oct 28, 10:24 pm, "Xah Lee" <[EMAIL PROTECTED]> wrote:
> > I have brought this topic here here before... that i think LISP really
The Condition of Industrial Programers
Xah Lee, 2006-05
Before i stepped into the computing industry, my first industrial
programing experience is at Wolfram Research Inc as a intern in 1995.
(Wolfram Research is famously known for their highly successful
flagship product Mathematica) I thought
f you do know
a web hosting company that can take some 80 G of bandwidth/month for
less than $25 a month, please let me know! (i do hope if someone here
runs a hosting business and can host my site. I will certainly return
the favor.)
Thanks.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Xa
The Nature of the “Unix Philosophy”
Xah Lee, 2006-05
In the computing industry, especially among unix community, we often
hear that there's a “Unix Philosophy”. In this essay, i dissect the
nature and characterization of such “unix philosophy”, as have been
described by Brian Kernighan, Rob
, 1990.
http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
Has anyone read this paper? And, would anyone be interested in giving a
summary?
thanks.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
ive
of extraneous concepts in languages, i'll have to write a essay in
detail some other day.
Thanks for the summary.
Is there no one else who are able to read that paper?
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
> Xah Lee wrote:
> > in March, i posted a essay "
Interactive Find and Replace String Patterns on Multiple Files
Xah Lee, 2006-06
Suppose you need to do find and replace of a string pattern, for all
files in a directory. However, you do not want to replace all of them.
You need to look at it in a case-by-case basis. What can you do?
Answer
αβγλϕρκψ ≤≥≠≈⊂⊃⊆⊇∈
ⅇⅈⅉ∞∆° ℵℜℂℝℚℙℤ ℓ∟∠∡ ∀∃ ∫∑∏
⊕⊗⊙⊚⊛∘∙ ★☆";
}
class UnicodeTest {
public static void main(String[] arg) {
方 x1 = new 方();
System.out.println( x1.str北 );
System.out.println( x1.str★ );
}
}
If you know a lang that does full unicode support, pleas
stupid.
I may or may not write a detailed account later. If you have specific
questions, or want to know specific reasons of my claims, please don't
hesitate to email. (privately if you deem it proper)
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
[EMAIL PROTECTED] wrote:
> Last year, i
e:
• Scsh manual, Chapter 6: Pattern-matching strings with regular
expressions
http://www.scsh.net/docu/html/man-Z-H-7.html
• Mathematica Book, section 2.8.4 String Patterns
http://documents.wolfram.com/mathematica/book/section-2.8.4
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.
Xah Lee wrote:
« the Python regex documentation is available at:
http://xahlee.org/perl-python/python_re-write/lib/module-re.html ...»
Jürgen Exner wrote:
«Yeah, sure, and the Perl regex documentation is available at 'perldoc
perlre'. So what? Is that anything new or surprising?»
.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Logo LISP
Xah Lee, 2006-12
Ken Tilton wrote:
«Small problem. You forget that Ron Garret wants us to change the
name of Common Lisp as the sure-fire way to make it more popular (well,
hang on, he says it is necessary, not sufficient. Anyway...) I do not
think we can safely pick a new logo
..etc) that are quite common in
computer graphics literatures.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
far as i know, Mathematica is the platform that allows one to do
graphics programing. But, i think Flash probably is another platform
that does it. And i think VisualPython is also.
I'm interested in other platforms that allows one to do this.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
J
Here's their license:
http://www.vpython.org/webdoc/visual/license.txt
I read it wrong before.
Thanks for correction.
This is superb! I'll be looking into vpython!
Xah
Ravi Teja wrote:
> Xah Lee wrote:
>
> > Regarding VisualPython... i saw a demo in 2002 by a professor
impossible to introduce a more stringent and
logical alias list.
»
Fuck the unix mother fuckers.
-
See also: Responsible Software Licensing
http://xahlee.org/UnixResource_dir/writ/responsible_license.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo
antonness.
For more info about the longbets.org site, see:
http://en.wikipedia.org/wiki/Long_Now_Foundation
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
is there a module that lets me parse validated html files and store it
as a tree?
for example, i want to be able to easily, say, replace the following
References
• a...
...
to
References
a...
...
Thanks.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org
source_dir/writ/responsible_license.html
Responsible Software Licensing & the Free Software Foundation
http://xahlee.org/UnixResource_dir/writ/responsible_license_FSF.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
s to be classified according to some Python idiosyncrasies or
categorization by some forced âcomputer scienceâ outlook.
The complete rewritten doc is here:
http://xahlee.org/perl-python/python_re-write/lib/module-re.html
-
There were more issues and notes... but this will be it for today.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
is archived at:
http://xahlee.org/perl-python/re-write_notes.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
â
--
http://mail.python.org/mailman/listinfo/python-list
erratum:
the correct URL is:
http://xahlee.org/perl-python/python_re-write/lib/module-re.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
x module is at:
http://xahlee.org/perl-python/python_re-write/lib/module-re.html
See also: Responsible Software Licensing
http://xahlee.org/UnixResource_dir/writ/responsible_license.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Today we'll be writing a function called Range. The Perl documentation
is as follows.
Perl & Python & Java Solutions will be posted in 48 hours.
This is Perl-Python a-day. See
http://xahlee.org/web/perl-python/python.html
Xah
[EMAIL PROTECTED]
â http
Today we'll be writing a function called Range. The Perl documentation
is as follows.
Perl & Python & Java Solutions will be posted in 48 hours.
This is Perl-Python a-day. See
http://xahlee.org/web/perl-python/python.html
Xah
[EMAIL PROTECTED]
â http
, either personally or as part of the
Python collective, to behave properly.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
Newsgroups: comp.lang.python
From: Ron Adam <[EMAIL PROTECTED]> - Find messages by this author
Date: Sat, 07 May 2005 20:23:35 -0400
Local: Sat,May 7 2005 8:23Âpm
Su
n't a solution.
can this be done in Python?
or, must the args be changed to a list?
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
, 6.5, 6.8]
Range( 5, -4, -2); # returns [5,3,1,-1,-3]
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Here's the Perl code.
--
#! perl
# http://xahlee.org/tree/tree.html
# Xah Lee, 2005-05
#_ Range _ _ _ _
=pod
B
Range($iMax) generates the list [1, 2, ... , $iMax].
Range($iMin, $iMax) generates the list [$iMin, ... , $iMax].
Range($iMin, $iMax, $iStep)
Here's the Python solution.
--
# -*- coding: utf-8 -*-
# Python
# http://xahlee.org/tree/tree.html
# Xah Lee, 2005-05
# implementation note: When iStep is a decimal, rounding error
# accumulates. For example, the last item returned from
# Range(0,18,0.3) is 17.7 not 18. A remedy
e not expected to be exemplary. These
are exercises for all, also as a intro to functional programing to
industry programers. Also, later on there will be non-trivial problems.
# -*- coding: utf-8 -*-
# Python
# http://xahlee.org/tree/tree.html
# Xah Lee, 2005-05
import math;
def Range(iMin, iMax
What are OOP's Jargons and Complexities
Xah Lee, 20050128
The Rise of Classes, Methods, Objects
In computer languages, often a function definition looks like this:
subroutine f (x1, x2, ...) {
variables ...
do this or that
}
In advanced languages such as LISP family, it is not uncomm
What are OOP's Jargons and Complexities
Xah Lee, 20050128
The Rise of Classes, Methods, Objects
In computer languages, often a function definition looks like this:
subroutine f (x1, x2, ...) {
variables ...
do this or that
}
In advanced languages such as LISP family, it is not uncomm
of static versus instance members, is one complexity arising
out of OOP.
--
to be continued tomorrow.
This is part of an installment of the article
“What are OOP's Jargons and Complexities”
by Xah Lee, 20050128. The full text is at
http://xahlee.org/Periodic_dosage_dir/t2/oop.html
201 - 300 of 529 matches
Mail list logo