[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

net/http and begin/end block

Ezra Zygmuntowicz

7/15/2005 4:59:00 PM

Hey list-
I have the following code that seems to work fine:

require 'net/http'

def fetch(page, section='display', limit=5)
data = ''
begin
data = Net::HTTP.get_response("192.168.0.2", "/#{page}")
rescue Exception => e
limit -= 1
limit > 0 ? retry : raise
end
data.body.gsub!(/\/temporaryimages/, "http://19...
temporaryimages")
data.body.gsub!(/\/wrappers\/(\d+)\.news/i, "/page/#{section}/\1")
end

I am using it to fetch some templated web pages from an in house
server that almost never errors out. So my code works fine. But I am
wondering if this code will do what I think it should do upon
failure. Before I added the begin/rescue/end block, the server would
occasionally error out with a connection reset by peer error. So my
question is will this syntax work to retry fetching the page 5 times
before it gives up. Will the rescue Exception => e part catch pretty
much any type of error?
Thanks in advance for anyone explaining this to me or offering a
more robust solution.


-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
509-577-7732
ezra@yakima-herald.com




11 Answers

gogu

4/5/2012 4:40:00 PM

0

Ï "arktos-linux2" <hreokopia@bahalo.com> Ýãñáøå óôï ìÞíõìá
news:jlkh4r$u9g$1@speranza.aioe.org...
> On Thu, 05 Apr 2012 16:36:24 +0300, gogu wrote:
>>
>> He was mentally sick and...grafikos!
>> Have a look and decide what he was:
>> 1) he had a pharmacist's pension after 35 years, meaning he had a very
>> good pension even after the latest cuts...


> now 1680/month


>> 2) he sold his pharmacy about
>> 10 years ago and we all know how much cost a pharmacy in Athens,
>> especially in those good years... So he had a good "kompodema", too...


> a relative of mine who bought a pharmacy in 1987 paid
> aera in galatsi (one of cheapest in central athens) 18
> million drs. all this was undeclared and untaxed by the
> seller. the shop, fittings and stock were extra. typically
> u could buy at least one 100sqm flat in that area with that
> money alone @ that time.

QED!!!!
Tell this to ADR/Roubini who SKYLEYEI the body of a poor man who killed
himself, in order to attack again Greece!
He is a..."subhuman" as he likes to call others!
Sad, little man he is...

--

E' mai possibile, oh porco di un cane, che le avventure
in codesto reame debban risolversi tutte con grandi
puttane! F.d.A

Coins, travels and more:
http://s208.photobucket.com/albums/bb120...
http://gogu.enosi.org/...


ADR

4/5/2012 5:40:00 PM

0

On Thursday, April 5, 2012 9:27:07 AM UTC-7, arktos-linux2 wrote:
> On Thu, 05 Apr 2012 16:36:24 +0300, gogu wrote:
>
> >
> >
> > He was mentally sick and...grafikos!
> > Have a look and decide what he was:
> > 1) he had a pharmacist's pension after 35 years, meaning he had a very
> > good pension even after the latest cuts...
>
> now 1680/month
>
>
> > 2) he sold his pharmacy about
> > 10 years ago and we all know how much cost a pharmacy in Athens,
> > especially in those good years... So he had a good "kompodema", too...
>
> a relative of mine who bought a pharmacy in 1987 paid
> aera in galatsi (one of cheapest in central athens) 18
> million drs. all this was undeclared and untaxed by the
> seller. the shop, fittings and stock were extra. typically
> u could buy at least one 100sqm flat in that area with that
> money alone @ that time.
> --

I understand. It is tough starting a pharmacy and getting the license. My guess is that most would not have this account of money and would have to borrow heavily either from friends and relatives or from a bank. Which means high payments for a long period of time. It is obvious that the man was pushed over the edge by the cuts in pensions and the outrageous additional taxation.

My mother has so far lost about 25% of her pension. Of the additional pension that she was receiving that was providing some cushion, only 25 euros per month are now being paid. Of course, I had to pay for her the "haratsi".. Otherwise, she would have starved to death or would have been unable to pay for her medication.

Nashton

4/5/2012 6:39:00 PM

0

On 04-05-12 2:40 PM, ADR wrote:
> On Thursday, April 5, 2012 9:27:07 AM UTC-7, arktos-linux2 wrote:
>> On Thu, 05 Apr 2012 16:36:24 +0300, gogu wrote:
>>
>>>
>>>
>>> He was mentally sick and...grafikos!
>>> Have a look and decide what he was:
>>> 1) he had a pharmacist's pension after 35 years, meaning he had a very
>>> good pension even after the latest cuts...
>>
>> now 1680/month
>>
>>
>>> 2) he sold his pharmacy about
>>> 10 years ago and we all know how much cost a pharmacy in Athens,
>>> especially in those good years... So he had a good "kompodema", too...
>>
>> a relative of mine who bought a pharmacy in 1987 paid
>> aera in galatsi (one of cheapest in central athens) 18
>> million drs. all this was undeclared and untaxed by the
>> seller. the shop, fittings and stock were extra. typically
>> u could buy at least one 100sqm flat in that area with that
>> money alone @ that time.

I understand. It is tough starting a pharmacy and getting the license.

My guess is that most would not have this account of money and would have

to borrow heavily either from friends and relatives or from a bank. Which

means high payments for a long period of time. It is obvious that the man

was pushed over the edge by the cuts in pensions and the outrageous
additional

taxation.


My mother has so far lost about 25% of her pension. Of the additional

pension that she was receiving that was providing some cushion, only 25

euros per month are now being paid. Of course, I had to pay for her the

"haratsi". Otherwise, she would have starved to death or would have been

unable to pay for her medication.

-----------------------


Do something about your chars, i.e., learn to use newsreaders.

Why is it necessary to purchase a license in Greece? In the US and
Canada, passing the NAPLEX and finding funding is all that is required.
In most cases, pharmacists *rent* the real estate instead of buying it
outright at the onset of their careers.

Where the heck anyone can come up with millions of Euros by borrowing
from friends (LOL) and relatives and banks (which for corporations
require a 25% down payment, i.e. equity in order for the potential buyer
to secure a loan and pay reasonable rates) is only something that exists
in your head and demonstrates how far gone in orbit you really are when
it comes to money matters.

What is painfully obvious is that this man had it better than many other
Greeks in his age group, if the stories about him being a former
pharmacist are true.
What is also obvious is that he unfortunately decided to end his life
prematurely. What is even more remarkable is the fact that you, a
biomedical researcher, is oblivious to the fact that he was mentally ill
and acted while in the midst of what was probably a dark phase of his
depression. Unless you're suggesting that he acted in a lucid and
calculated manner and ended his life as a protest. Is it possible? Sure.
Not very likely, given that his financial situation belies the rational
that he provided for ending his life.

The only depravity here is your attempt to use this to further advance
your ideological views, over and over and over again.




gogu

4/5/2012 7:06:00 PM

0

? "ADR" <aretzios@yahoo.com> ?????? ??? ??????
news:6138185.6.1333647604311.JavaMail.geo-discussion-forums@pbnv7...
>> a relative of mine who bought a pharmacy in 1987 paid
>> aera in galatsi (one of cheapest in central athens) 18
>> million drs. all this was undeclared and untaxed by the
>> seller. the shop, fittings and stock were extra. typically
>> u could buy at least one 100sqm flat in that area with that
>> money alone @ that time.

>I understand. It is tough starting a pharmacy and getting the license. My
>guess is that most would not have this account of money and would have to
>borrow heavily either from friends and relatives or from a bank. Which
>means high payments for a long period of time. It is obvious that the man
>was pushed >over the edge by the cuts in pensions and the outrageous
>additional taxation.

You IDIOT!
Read the letter his daughter sent to the press and you will understand it
was a POLITICAL action!
She states it clearly!
But "subhumans" (your words...) like you will always lie!
LIE has become a second nature to you!

>Of the additional pension that she was receiving that was providing some
>cushion, only 25 euros per month are now being paid.

That's a blatant LIE!
Epikoyrikes pensions are *NOT* cut bellow 150 euros!
If for instance one has an epikoyrikh pension even 1 euro over 150 euros
(151 euros), his pension will eventually be cut by...1 euro, not a single
euro less!
Which is also not quite accurate since cuts are for pensions of 200 euros
and up:
200 euros= 0% cut
200-250=10% on the whole amount
250-300=15% on the whole amount
And so on...
You are LYING!
As usually of course...

--

E' mai possibile, oh porco di un cane, che le avventure
in codesto reame debban risolversi tutte con grandi
puttane! F.d.A

Coins, travels and more:
http://s208.photobucket.com/albums/bb120...
http://gogu.enosi.org/...


gogu

4/5/2012 7:12:00 PM

0

? "Nashton" <nana@na.ca> ?????? ??? ??????
news:jlkoss$ijh$1@speranza.aioe.org...
> On 04-05-12 2:40 PM, ADR wrote:
>> On Thursday, April 5, 2012 9:27:07 AM UTC-7, arktos-linux2 wrote:
>>> On Thu, 05 Apr 2012 16:36:24 +0300, gogu wrote:
>>>
>>>>
>>>>
>>>> He was mentally sick and...grafikos!
>>>> Have a look and decide what he was:
>>>> 1) he had a pharmacist's pension after 35 years, meaning he had a very
>>>> good pension even after the latest cuts...
>>>
>>> now 1680/month
>>>
>>>
>>>> 2) he sold his pharmacy about
>>>> 10 years ago and we all know how much cost a pharmacy in Athens,
>>>> especially in those good years... So he had a good "kompodema", too...
>>>
>>> a relative of mine who bought a pharmacy in 1987 paid
>>> aera in galatsi (one of cheapest in central athens) 18
>>> million drs. all this was undeclared and untaxed by the
>>> seller. the shop, fittings and stock were extra. typically
>>> u could buy at least one 100sqm flat in that area with that
>>> money alone @ that time.
>
> I understand. It is tough starting a pharmacy and getting the license.
>
> My guess is that most would not have this account of money and would have
>
> to borrow heavily either from friends and relatives or from a bank. Which
>
> means high payments for a long period of time. It is obvious that the man
>
> was pushed over the edge by the cuts in pensions and the outrageous
> additional
>
> taxation.
>
>
> My mother has so far lost about 25% of her pension. Of the additional
>
> pension that she was receiving that was providing some cushion, only 25
>
> euros per month are now being paid. Of course, I had to pay for her the
>
> "haratsi". Otherwise, she would have starved to death or would have been
>
> unable to pay for her medication.
>
> -----------------------


> Do something about your chars, i.e., learn to use newsreaders.

;-)
He's dumb.

> Why is it necessary to purchase a license in Greece? In the US and Canada,
> passing the NAPLEX and finding funding is all that is required.
> In most cases, pharmacists *rent* the real estate instead of buying it
> outright at the onset of their careers.

This is another LIE of him!
You don't need any license since you have a pharmacist's degree.
You can open your pharmacy wherever you want.
There were a few restrictions like for instance the distance between 2
pharmacies but they are gone by now.
He's IGNORANT either a LIAR...


> What is painfully obvious is that this man had it better than many other
> Greeks in his age group, if the stories about him being a former
> pharmacist are true.

They are true.
As it comes out he was a "leftist" all his life (his daughter's words...)
and an idealist.
This drove him to death.
End of story.

> The only depravity here is your attempt to use this to further advance
> your ideological views, over and over and over again.Exactly!

And this is repulsive!
But...that's ADR/Roubini;-)

--

E' mai possibile, oh porco di un cane, che le avventure
in codesto reame debban risolversi tutte con grandi
puttane! F.d.A

Coins, travels and more:
http://s208.photobucket.com/albums/bb120...
http://gogu.enosi.org/...


ADR

4/5/2012 8:38:00 PM

0

On Thursday, April 5, 2012 12:06:11 PM UTC-7, gogu wrote:

> >Of the additional pension that she was receiving that was providing some
> >cushion, only 25 euros per month are now being paid.
>
> That's a blatant LIE!
> Epikoyrikes pensions are *NOT* cut bellow 150 euros!
> If for instance one has an epikoyrikh pension even 1 euro over 150 euros
> (151 euros), his pension will eventually be cut by...1 euro, not a single
> euro less!
> Which is also not quite accurate since cuts are for pensions of 200 euros
> and up:
> 200 euros= 0% cut
> 200-250=10% on the whole amount
> 250-300=15% on the whole amount
> And so on...
> You are LYING!
> As usually of course...
>
It is amazing that you would lie to the ends of the earth. My mother was receiving an "epikouriki" pension of about 215 euros. 190 Euros were removed and it is not only 25 euros. This action was taken by the Bank of Greece where my mom receives her pension from. End of story.

(Mortar)

4/5/2012 8:38:00 PM

0

Nashton <nana@na.ca> wrote in news:jlkoss$ijh$1@speranza.aioe.org:
>
> Why is it necessary to purchase a license in Greece?

there is difference between being eligible to open
a pharmacy (degree + some on-job-training) and
getting a permit to set up the business which is
the usual greek nonsense.


> In the US and
> Canada, passing the NAPLEX and finding funding is all that is
> required. In most cases, pharmacists *rent* the real estate instead of
> buying it outright at the onset of their careers.

the 80s were the "golden era" of drachma inflation.
at that time property was the only way to secure
your wealth against inflation as there were no
alternatives: there were strict exchange controls
and holding/dealing with foreign currency or gold
was a criminal offense.

at that time banana imports were prohibited and
u had to wait for a telephone installation from
ote for up to 10 years just to conserve foreign
currency reserves.



>
> Where the heck anyone can come up with millions of Euros by borrowing
> from friends (LOL) and relatives and banks (which for corporations
> require a 25% down payment, i.e. equity in order for the potential
> buyer to secure a loan and pay reasonable rates) is only something
> that exists in your head and demonstrates how far gone in orbit you
> really are when it comes to money matters.

quite right. the case i was referring to involves
the sale of an inherited flat in an expensive area
of athens. it was well worth the investment. in the
late 80s, then 90s and early-to-mid 00s, having
a pharmacy was *very* profitable. things have
gone bad since.
--


choro

4/5/2012 9:33:00 PM

0

On 05/04/2012 20:06, gogu wrote:
> ? "ADR"<aretzios@yahoo.com> ?????? ??? ??????
> news:6138185.6.1333647604311.JavaMail.geo-discussion-forums@pbnv7...
>>> a relative of mine who bought a pharmacy in 1987 paid
>>> aera in galatsi (one of cheapest in central athens) 18
>>> million drs. all this was undeclared and untaxed by the
>>> seller. the shop, fittings and stock were extra. typically
>>> u could buy at least one 100sqm flat in that area with that
>>> money alone @ that time.
>
>> I understand. It is tough starting a pharmacy and getting the license. My
>> guess is that most would not have this account of money and would have to
>> borrow heavily either from friends and relatives or from a bank. Which
>> means high payments for a long period of time. It is obvious that the man
>> was pushed>over the edge by the cuts in pensions and the outrageous
>> additional taxation.
>
> You IDIOT!
> Read the letter his daughter sent to the press and you will understand it
> was a POLITICAL action!
> She states it clearly!
> But "subhumans" (your words...) like you will always lie!
> LIE has become a second nature to you!
>
>> Of the additional pension that she was receiving that was providing some
>> cushion, only 25 euros per month are now being paid.
>
> That's a blatant LIE!
> Epikoyrikes pensions are *NOT* cut bellow 150 euros!
> If for instance one has an epikoyrikh pension even 1 euro over 150 euros
> (151 euros), his pension will eventually be cut by...1 euro, not a single
> euro less!
> Which is also not quite accurate since cuts are for pensions of 200 euros
> and up:
> 200 euros= 0% cut
> 200-250=10% on the whole amount
> 250-300=15% on the whole amount
> And so on...
> You are LYING!
> As usually of course...

A pension is a pension; an acquired right by contract and no one side

to a contract has the right to break that contract!

I've heard of pension cuts of up to 50%. Could there be higher % cuts? I
don't know but it wouldn't surprise me.

*This* is *end of story* by my definition.
-- choro

choro

4/5/2012 9:35:00 PM

0

On 05/04/2012 20:12, gogu wrote:
> ? "Nashton"<nana@na.ca> ?????? ??? ??????
> news:jlkoss$ijh$1@speranza.aioe.org...
>> On 04-05-12 2:40 PM, ADR wrote:
>>> On Thursday, April 5, 2012 9:27:07 AM UTC-7, arktos-linux2 wrote:
>>>> On Thu, 05 Apr 2012 16:36:24 +0300, gogu wrote:
>>>>
>>>>>
>>>>>
>>>>> He was mentally sick and...grafikos!
>>>>> Have a look and decide what he was:
>>>>> 1) he had a pharmacist's pension after 35 years, meaning he had a very
>>>>> good pension even after the latest cuts...
>>>>
>>>> now 1680/month
>>>>
>>>>
>>>>> 2) he sold his pharmacy about
>>>>> 10 years ago and we all know how much cost a pharmacy in Athens,
>>>>> especially in those good years... So he had a good "kompodema", too...
>>>>
>>>> a relative of mine who bought a pharmacy in 1987 paid
>>>> aera in galatsi (one of cheapest in central athens) 18
>>>> million drs. all this was undeclared and untaxed by the
>>>> seller. the shop, fittings and stock were extra. typically
>>>> u could buy at least one 100sqm flat in that area with that
>>>> money alone @ that time.
>>
>> I understand. It is tough starting a pharmacy and getting the license.
>>
>> My guess is that most would not have this account of money and would have
>>
>> to borrow heavily either from friends and relatives or from a bank. Which
>>
>> means high payments for a long period of time. It is obvious that the man
>>
>> was pushed over the edge by the cuts in pensions and the outrageous
>> additional
>>
>> taxation.
>>
>>
>> My mother has so far lost about 25% of her pension. Of the additional
>>
>> pension that she was receiving that was providing some cushion, only 25
>>
>> euros per month are now being paid. Of course, I had to pay for her the
>>
>> "haratsi". Otherwise, she would have starved to death or would have been
>>
>> unable to pay for her medication.
>>
>> -----------------------
>
>
>> Do something about your chars, i.e., learn to use newsreaders.
>
> ;-)
> He's dumb.
>
>> Why is it necessary to purchase a license in Greece? In the US and Canada,
>> passing the NAPLEX and finding funding is all that is required.
>> In most cases, pharmacists *rent* the real estate instead of buying it
>> outright at the onset of their careers.
>
> This is another LIE of him!
> You don't need any license since you have a pharmacist's degree.
> You can open your pharmacy wherever you want.
> There were a few restrictions like for instance the distance between 2
> pharmacies but they are gone by now.
> He's IGNORANT either a LIAR...
>
>
>> What is painfully obvious is that this man had it better than many other
>> Greeks in his age group, if the stories about him being a former
>> pharmacist are true.
>
> They are true.
> As it comes out he was a "leftist" all his life (his daughter's words...)
> and an idealist.
> This drove him to death.
> End of story.

In other words you are saying *"good riddance"* since he was a *leftie*!

People like you should be strung up by the balls! But I doubt that you
have any!

-- choro

>
>> The only depravity here is your attempt to use this to further advance
>> your ideological views, over and over and over again.Exactly!
>
> And this is repulsive!
> But...that's ADR/Roubini;-)
>

Nashton

4/5/2012 9:56:00 PM

0

On 04-05-12 5:37 PM, arktos wrote:
> Nashton<nana@na.ca> wrote in news:jlkoss$ijh$1@speranza.aioe.org:
>>
>> Why is it necessary to purchase a license in Greece?
>
> there is difference between being eligible to open
> a pharmacy (degree + some on-job-training) and
> getting a permit to set up the business which is
> the usual greek nonsense.
>
>
>> In the US and
>> Canada, passing the NAPLEX and finding funding is all that is
>> required. In most cases, pharmacists *rent* the real estate instead of
>> buying it outright at the onset of their careers.
>
> the 80s were the "golden era" of drachma inflation.
> at that time property was the only way to secure
> your wealth against inflation as there were no
> alternatives: there were strict exchange controls
> and holding/dealing with foreign currency or gold
> was a criminal offense.

Yep.

>
> at that time banana imports were prohibited and
> u had to wait for a telephone installation from
> ote for up to 10 years just to conserve foreign
> currency reserves.

I remember those days. Inclusion in the Eurozone freed us of that nonsense.

>
>
>
>>
>> Where the heck anyone can come up with millions of Euros by borrowing
>> from friends (LOL) and relatives and banks (which for corporations
>> require a 25% down payment, i.e. equity in order for the potential
>> buyer to secure a loan and pay reasonable rates) is only something
>> that exists in your head and demonstrates how far gone in orbit you
>> really are when it comes to money matters.
>
> quite right. the case i was referring to involves
> the sale of an inherited flat in an expensive area
> of athens. it was well worth the investment. in the
> late 80s, then 90s and early-to-mid 00s, having
> a pharmacy was *very* profitable. things have
> gone bad since.

Pharmacists have no entitlement to being wealthy. I have the greatest
respect for them, don't get me wrong but even in these days, they're
making a mint.


> --
>
>