1. Tasks

------=_NextPart_000_002F_01C005E5.EC07D5C0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear Coders,

I've done quite homework on EU programming and i want you friends to =
help me evaluate myself. Send me small programming tasks so that i can =
have feedback. It will be appreciated.

-Bert Wishes

Asif

------=_NextPart_000_002F_01C005E5.EC07D5C0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear Coders,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've done quite homework on EU =
programming and i=20
want you friends to help me evaluate myself. Send me small programming =
tasks so=20
that i can have feedback. It will be appreciated.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-Bert Wishes</FONT></DIV>
<DIV>&nbsp;</DIV>

------=_NextPart_000_002F_01C005E5.EC07D5C0--

new topic     » topic index » view message » categorize

2. Re: Tasks

oooo i just remembered something...
i know it was min/max comparision of a pair
of passed objects now....
99% sure, because i needed those one liners
for my fuzzy logic library...
however, the one liners turned out to be rather performance
penalty severe for the type of work the fuzzy library did,
as it called many many iterations of tiny tiny data objects...
as such, a 'standard for loop' approach gleaned much
faster benchmarking and is what i wound up with in the
library... (just check the zip file hoping the one liners were there)
i cant access the archives from here (at least not easily)...
could u perhaps jiri?
(im asking cuz now i wont be able to freaking sleep, heh...
and its already like 4, 5am here now LOL)
----- Original Message -----
From: jiri babor <jbabor at PARADISE.NET.NZ>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Monday, August 14, 2000 5:25 AM
Subject: Re: Tasks


> Hawke', you are wicked. I spent close to ten minutes trying to come up
> with a decent min/max one-liner. Only to discover your memory is even
> worse than mine: I am almost sure your forgotten one-liners were
> Carl's sign and abs functions.
>
> Admit it! jiri
>

_______________________________________________
Why pay for something you could get for free?
NetZero provides FREE Internet Access and Email
http://www.netzero.net/download/index.html

new topic     » goto parent     » topic index » view message » categorize

3. Re: Tasks

found it ;)


(carl's code)
function min(object a, object b)
return  a*(a<=b)  +   b*(b<a)
end function

grin ;) carl, the master of one-liners so very ownZ...
gawd, how DOES he think this chit up?
it hurts my head just looking at that one again...
the abs was bad nuff:
     return x * ( (x>0) - (x<0) )
but the min/max just makes my wittle bwain hurtZ


----- Original Message -----
From: jiri babor <jbabor at PARADISE.NET.NZ>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Monday, August 14, 2000 5:25 AM
Subject: Re: Tasks


> Hawke', you are wicked. I spent close to ten minutes trying to come up
> with a decent min/max one-liner. Only to discover your memory is even
> worse than mine: I am almost sure your forgotten one-liners were
> Carl's sign and abs functions.
>
> Admit it! jiri
>


_____NetZero Free Internet Access and Email______
   http://www.netzero.net/download/index.html

new topic     » goto parent     » topic index » view message » categorize

4. Re: Tasks

and ya, be'faour yaZ say it jiri ;)
i realize that carl's code frag i pasted a couple minutes ago
doesnt actually solve the problem as i originally stated it
with only one line....my bad ;)
is it modifiable to do so?
to return the highest value contained within a sequence?
is it indeed possible to create a one-liner(tm) that
returns the highest/lowest value in a sequence?
at this point im not sure....
recursively split the sequence in consecutive halves and
pass those halves to carl's function???
(ok so that might take 2 lines or more...)

----- Original Message -----
From: jiri babor <jbabor at PARADISE.NET.NZ>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Monday, August 14, 2000 5:25 AM
Subject: Re: Tasks


> Hawke', you are wicked. I spent close to ten minutes trying to come up
> with a decent min/max one-liner. Only to discover your memory is even
> worse than mine: I am almost sure your forgotten one-liners were
> Carl's sign and abs functions.
>
> Admit it! jiri
>

_______________________________________________
Why pay for something you could get for free?
NetZero provides FREE Internet Access and Email
http://www.netzero.net/download/index.html

new topic     » goto parent     » topic index » view message » categorize

5. Re: Tasks

Good morning, Hawke'.

I cannot do them as one-liners, but using your (Carl's?) suggestion, two
statements suffice.
The code below is not terribly efficient and is applicable to one-dimensional
sequences only.

jiri

--  minmax.ex
--  jiri_babor at hotmail.com
--  00-08-15

function min(sequence s)
    while length(s)>1 do s=s[1]*(s[1]<=s[2])+s[2]*(s[2]<s[1])&s[3..length(s)]
end while
    return s[1]
end function

function max(sequence s)
    while length(s)>1 do s=s[1]*(s[1]>=s[2])+s[2]*(s[2]>s[1])&s[3..length(s)]
end while
    return s[1]
end function

-- test --------------------------------------------------------------
? min({4.1, -77.2, 111, 15.3})
? max({4.1, -77.2, 111, 15.3})

new topic     » goto parent     » topic index » view message » categorize

6. Re: Tasks

ooooOOOOO
good stuff jiri
i was thinking find(1,{somerecursivemumbojumbo}) might save our arse here
sumfin like splitting the sequence into successive halves, using carl's
oneliner in the center of that to process the successive halves, making
each value get set to 0 if it was under another value in recursive
succession
and using find(1,result) to pull out that very last true to show us the
location/index of the highest/lowest singular value remaining....
yer's is really close to that premise by rotating thru pairs of next door
neighbor values and continously repicking the highest/lowest from those
kissing cousins....
kind of a bubble sort thing going there...
well done :)

we are close ;)


----- Original Message -----
From: Jiri Babor <J.Babor at GNS.CRI.NZ>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Monday, August 14, 2000 4:14 PM
Subject: Re: Tasks


> Good morning, Hawke'.
>
> I cannot do them as one-liners, but using your (Carl's?) suggestion, two
> statements suffice.
> The code below is not terribly efficient and is applicable to
one-dimensional
> sequences only.
>
> jiri
>
> --  minmax.ex
> --  jiri_babor at hotmail.com
> --  00-08-15
>
> function min(sequence s)
>     while length(s)>1 do
> end while
>     return s[1]
> end function
>
> function max(sequence s)
>     while length(s)>1 do
> end while
>     return s[1]
> end function
>
> -- test --------------------------------------------------------------
> ? min({4.1, -77.2, 111, 15.3})
> ? max({4.1, -77.2, 111, 15.3})
>

_______________________________________________
Why pay for something you could get for free?
NetZero provides FREE Internet Access and Email
http://www.netzero.net/download/index.html

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu