[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

[ANN] - ptools 1.1.1

Berger, Daniel

8/23/2006 8:42:00 PM

Hi all,

This is just a quick announcement to let y'all know that I've released ptools
1.1.1 today.

What is it?
===========
Power tools for the File class. Additional methods include which, whereis,
head, tail, middle, wc, null, nl_convert, touch and binary?.

What's new?
===========
This release adds the File.null and File.binary? methods. The former returns
the null device on your system The latter returns whether or not the file in
question is a binary file (using a simple best-guess algorithm).

Where is it?
============
You can get it via gems, the RAA or RubyForge.

gem install ptools
http://raa.ruby-lang.org/proje...
http://rubyforge.org/projec...

Enjoy!

- Dan

PS - I forgot to put the dependency in the gem, but Windows users will need
win32-file-stat. If you're using the latest one-click installer, you've
already got it.


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.

5 Answers

Peña, Botp

8/24/2006 3:06:00 AM

0

fr daniel:
# Power tools for the File class. Additional methods include
# which, whereis,
# head, tail, middle, wc, null, nl_convert, touch and binary?.

very cool and helpful. now win users aren't left so far behind..

maybe, i can create a more efficient grep -r now, one that does not include binary files. Will #binary? work on unix too?

thanks for ptools -botp


Daniel Berger

8/24/2006 3:14:00 AM

0

Peña wrote:
> fr daniel:
> # Power tools for the File class. Additional methods include
> # which, whereis,
> # head, tail, middle, wc, null, nl_convert, touch and binary?.
>
> very cool and helpful. now win users aren't left so far behind..
>
> maybe, i can create a more efficient grep -r now, one that does not include binary files. Will #binary? work on unix too?
>
> thanks for ptools -botp
>
>
>
>
All of the ptools methods are cross-platform so yes, File.binary? will
work fine on Unix.

Glad you're enjoying it. :)

Regards,

Dan

Paul Lutus

8/24/2006 4:07:00 AM

0

Peña, Botp wrote:

> fr daniel:
> # Power tools for the File class. Additional methods include
> # which, whereis,
> # head, tail, middle, wc, null, nl_convert, touch and binary?.
>
> very cool and helpful. now win users aren't left so far behind..
>
> maybe, i can create a more efficient grep -r now, one that does not
> include binary files. Will #binary? work on unix too?

Yep. In a *nix file read/write context, specifying binary does nothing,
because Unix doesn't honor the distinction, so the test "binary?" should
always "work". It is only meaningful in Windows.

In fact, the entire "binary" idea was created to deal with the weird Windows
line endings. If "binary" is specified, the file read/write system stops
translating "\n\r" to "\n" on read, and "\n" to "\n\r" on write. That's
all.

A variation on "binary?" might read a file to see if it deviates from 7-bit
ASCII, but this will fail for perfectly valid Unicode text files. So IMHO
it's a bad idea.

--
Paul Lutus
http://www.ara...

Don H

7/9/2012 10:39:00 PM

0

"GM Smerkoff" <gmsmerkoff@carbon.tax.is.ineffective> wrote in message
news:jtfk4j$t87$1@bjf.motzarella.org...
> On 10/07/2012 7:10 AM, DonH wrote:
>> "GM Smerkoff" <gmsmerkoff@carbon.tax.is.ineffective> wrote in message
>> news:jtelhq$mor$1@bjf.motzarella.org...
>>> http://www.abc.net.au/news/2012-07-09/labor-left-weighs-into-greens-atta...
>>>
>>> The ring-leaders are described as "NSW Right" but really the union
>>> leaders - they are ostensibly anti-Greens but they are really
>>> anti-Gillard. The ALP is delusional, right to the very end.
>>>
>>>
>>
>> # Hmm, it could be that attack on the Greens is to divert attention from
>> stagnation of ALP under years of Rightwing dominance, mainly in NSW, but
>> generally - which is why many voters on the Left have migrated across to
>> the
>> Greens.
>> The ALP need not worry too much about preferences, as polls indicate
>> a
>> landslide to the Coalition (by default), and only the Senate would be
>> affected.
>> Hand the Senate over to the Coalition, thus facilitating return of
>> WorkChoices, and jacking up of GST? Yeah, really good move, that!
>>
>>
>
> The NSW Right, looking back past their recent decade of corruption, had a
> significant victory and achievement in The Accord where unions agreed to
> productivity increases in return for wage increases - a real partnership.
>
> Marxists don't care about workers (or the environment), only ideology. The
> latest moves are all confrontational. People should think about who
> creates the jobs in this country - it isn't placard-waving loonies and it
> isn't Wayne Swan - on the contrary.
>
> The damage that this ALP has done is incalculable. Our productivity is now
> so low that we cannot produce aluminium profitably - *that* is the tragedy
> from kow-towing and allying with Greens.
>
> The problem is that Green insanity has infiltrated ALP thinking. Combet is
> still talking about burying carbon.
>
> We need to get back to a rational society, where the government protects
> the borders and takes away the garbage and people can get on with the
> lives without gubbermint interference in everything.
>
> The ALP can think about that for the next decade - if it survives.
>
>
> --
> Greg Combet (Minister for Climate Change), says "coalminers should be
> investing more [into burying carbon]"
> http://www.watoday.com.au/opinion/political-news/the-burning-questions-that-wont-go-away-20120615-...
>

# Yeah, all the Tories can think of is : Productivity. It is their answer
to everything, as anything else involves wealth distribution, which is
anathema.
Hitler had the ultimate in Productivity, with his concentration camps,
where wage slaves became real slaves, and - Arbeit Mache Frei - freed you,
up the chimney.
The Accord? Yes, a good ploy, whereby workers contributed to their own
exploitation, and membership of unions has declined rapidly ever since.
True, in a Competitive World, some such measure was probably
inevitable, but let's not kid ourselves that it benefited anyone than the
corporate sector, as trickle-down-effect is up against profit-making.
As for Marxists and Ideology, for years the Right has had an open go,
as any hint of "Socialism" was equated with the dreaded Communism, and who
wants that?
However, failure of implied Utopian Capitalism (with Fall of the Wall)
to materialise, and recently GFC, and European malaise, is a good
opportunity for return of Leftist Ideology, as evident in return of
socialists in France, and almost in Greece.
So, dear old capitalism totters on, and our own ALP blames the Greens
for its own lack of ideology, values, and anything much else. Kindly
capitalism is no longer good enough.
Which is why DonH, the broken record, keeps harping on Industrial
Democracy, Cooperation, Overall Planning, Price Control, and a few other
such Old Fashioned Ideas.
There is no option but some type of Socialism, but the ALP has dropped
that, eh?
Hence, "GM Smerkoff" (Foster?) give your Tories a go, and see what
hell they "produce" - as is already becoming evident in NSW, Qld, and Vic.
Slash and burn.
WorkChoices will be back; and GST rate boosted.
No Carbon Tax? Doomsday will come quicker, and a bunker won't save
Rich from that.


ALP Fomenting Debt

7/9/2012 11:07:00 PM

0

On 10/07/2012 8:38 AM, DonH wrote:
> "GM Smerkoff" <gmsmerkoff@carbon.tax.is.ineffective> wrote in message
> news:jtfk4j$t87$1@bjf.motzarella.org...
>> On 10/07/2012 7:10 AM, DonH wrote:
>>> "GM Smerkoff" <gmsmerkoff@carbon.tax.is.ineffective> wrote in message
>>> news:jtelhq$mor$1@bjf.motzarella.org...
>>>> http://www.abc.net.au/news/2012-07-09/labor-left-weighs-into-greens-atta...
>>>>
>>>> The ring-leaders are described as "NSW Right" but really the union
>>>> leaders - they are ostensibly anti-Greens but they are really
>>>> anti-Gillard. The ALP is delusional, right to the very end.
>>>>
>>>>
>>>
>>> # Hmm, it could be that attack on the Greens is to divert attention from
>>> stagnation of ALP under years of Rightwing dominance, mainly in NSW, but
>>> generally - which is why many voters on the Left have migrated across to
>>> the
>>> Greens.
>>> The ALP need not worry too much about preferences, as polls indicate
>>> a
>>> landslide to the Coalition (by default), and only the Senate would be
>>> affected.
>>> Hand the Senate over to the Coalition, thus facilitating return of
>>> WorkChoices, and jacking up of GST? Yeah, really good move, that!
>>>
>>>
>>
>> The NSW Right, looking back past their recent decade of corruption, had a
>> significant victory and achievement in The Accord where unions agreed to
>> productivity increases in return for wage increases - a real partnership.
>>
>> Marxists don't care about workers (or the environment), only ideology. The
>> latest moves are all confrontational. People should think about who
>> creates the jobs in this country - it isn't placard-waving loonies and it
>> isn't Wayne Swan - on the contrary.
>>
>> The damage that this ALP has done is incalculable. Our productivity is now
>> so low that we cannot produce aluminium profitably - *that* is the tragedy
>> from kow-towing and allying with Greens.
>>
>> The problem is that Green insanity has infiltrated ALP thinking. Combet is
>> still talking about burying carbon.
>>
>> We need to get back to a rational society, where the government protects
>> the borders and takes away the garbage and people can get on with the
>> lives without gubbermint interference in everything.
>>
>> The ALP can think about that for the next decade - if it survives.
>>
>>
>> --
>> Greg Combet (Minister for Climate Change), says "coalminers should be
>> investing more [into burying carbon]"
>> http://www.watoday.com.au/opinion/political-news/the-burning-questions-that-wont-go-away-20120615-...
>>
>
> # Yeah, all the Tories can think of is : Productivity. It is their answer
> to everything, as anything else involves wealth distribution, which is
> anathema.

Yes, it is actually.

Far far better to be a wealthy, wealth-generating community that can
experiment with alternative ideas, support the arts and solve world hunger.

Or you can be impoverished, like Spain - bankrupted by all the loony
Green initiatives and totally owned and controlled by bankers for the
next decade or two.



> Hitler had the ultimate in Productivity, with his concentration camps,
> where wage slaves became real slaves, and - Arbeit Mache Frei - freed you,
> up the chimney.

Hitler had more in common with Stalin actually.

From a liberal, individualist and capitalist point of view Hitler and
Stalin are indistinguishable.

The reality is that 'Kapital Mache Frei'. Employing capital to automate
our world, frees us up from boring tedious labour.

Like self-serve checkouts at the supermarket - what a brilliant idea!
Everyone can be a manager. Someone tell those 10,000 morons at the
Department of Immigration that we don't need checkout chicks anymore.


> The Accord? Yes, a good ploy, whereby workers contributed to their own
> exploitation, and membership of unions has declined rapidly ever since.

The resultant growth in productivity actually gave the ALP a shot at
viability. Pity that the party was hijacked by the Socialist Forum and
subjected itself to the Rule of The Greens - it has gone down ever
since. Why anyone *wants* to be a union member is beyond me - if your
dues aren't handed to the moron ALP, they are spent on prostitutes and
dinners at expensive restaurants.


> True, in a Competitive World, some such measure was probably
> inevitable, but let's not kid ourselves that it benefited anyone than the
> corporate sector, as trickle-down-effect is up against profit-making.
> As for Marxists and Ideology, for years the Right has had an open go,
> as any hint of "Socialism" was equated with the dreaded Communism, and who
> wants that?

I give up, Julia Gillard?


> However, failure of implied Utopian Capitalism (with Fall of the Wall)
> to materialise, and recently GFC, and European malaise, is a good
> opportunity for return of Leftist Ideology, as evident in return of
> socialists in France, and almost in Greece.

Who will pay the debts? The gubbermint printing press?


> So, dear old capitalism totters on, and our own ALP blames the Greens
> for its own lack of ideology, values, and anything much else. Kindly
> capitalism is no longer good enough.
> Which is why DonH, the broken record, keeps harping on Industrial
> Democracy, Cooperation, Overall Planning, Price Control, and a few other
> such Old Fashioned Ideas.

I already told you you can get all the democracy you want just by buying
shares.

The alternative is the socialist method of stealing it through the tax
system.

The only difference is how crooked you want to be. How crooked do you
want to be?


> There is no option but some type of Socialism, but the ALP has dropped
> that, eh?

The ALP hasn't dropped anything. The only discernable policy of the ALP
is "Do whatever Abbott doesn't do".

> Hence, "GM Smerkoff" (Foster?) give your Tories a go, and see what
> hell they "produce" - as is already becoming evident in NSW, Qld, and Vic.
> Slash and burn.
> WorkChoices will be back; and GST rate boosted.
> No Carbon Tax? Doomsday will come quicker, and a bunker won't save
> Rich from that.
>
>


--
Who wants to hear another word about 'carbon' tax?
http://thehoopla.com.au/wp-content/uploads/2012/05/Days-of-whine-and-p...