[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: from Hex to string

Kroeger, Simon (ext)

3/8/2006 10:08:00 AM

p "66726f6d 70736e20".scan(/\w\w/).inject('') {|s, b| s << b.hex.chr}
=> "frompsn "

cheers

Simon

> -----Original Message-----
> From: Une bévue [mailto:pere.noel@laponie.com.invalid]
> Sent: Wednesday, March 08, 2006 10:14 AM
> To: ruby-talk ML
> Subject: from Hex to string
>
> i have datas like that :
>
> 646c6532 00000000 61657674 0000012e 00000000 00000000
> 0000011c 00000004
> 00000001 00000000 00000000 00000000 [...]
> 6c6f6e67 00000004 00000000 66726f6d 70736e20 00000008
> 00000000 005c0001
> 3b3b3b3b 2d2d2d2d 54455854 00000006 626d6b6d 3a76
>
>
> seems to be hex encoded US-ASCII (?)
>
> how to convert that in user readable us-ascii ? (to string)
>
> i now i have the sequence "70736e20" which is "psn "
> --
> une bévue
>
>


6 Answers

pere.noel

3/8/2006 11:38:00 AM

0

Kroeger, Simon (ext) <simon.kroeger.ext@siemens.com> wrote:

> p "66726f6d 70736e20".scan(/\w\w/).inject('') {|s, b| s << b.hex.chr}
> => "frompsn "

fine, i do have about the same to translate into string.
this comes from event.data (event being a NSAppleEventDescriptor in
cocoa/MacOS X)

this is followed by :
"00000008 00000000"
which would have to be the psn number of the application having send the
event (i need this psn number in order to know which application is of
concern)

i know, because it's me having type an url into safari, by ps -ax giving
:

1347 ?? S 0:05.34 /Applications/Safari.app/Contents/MacOS/Safari
-psn_0_6029313

that, the psn number is "6029313" being an odd number, "00000008
00000000" an even number, afaik.

how could i convert that part "00000008 00000000" into an integer ?

i've make use of :
keyword = 'addrpsn '.unpack('N').first
sign=event.paramDescriptorForKeyword(keyword)
p "sign.class = #{sign.class} - paramDescriptorForKeyword"
=> "sign.class = NilClass - paramDescriptorForKeyword"
sign=event.descriptorForKeyword(keyword)
p "sign.class = #{sign.class} - descriptorForKeyword"
=> "sign.class = NilClass - paramDescriptorForKeyword"

which would be the "proper" way to get the psn number but always fails
into nil class...

instead of doing that by scan, gsub etc...

however it appears to me NSAppleEventDescriptor don't give any way to
get pid, psn nor sign of the application having send this event : the
reason why, as a workaround, i 'm using this sort of hacking ))
--
une bévue

NEMO

9/23/2013 2:10:00 PM

0

On 9/23/2013 7:03 AM, Michael Ejercito wrote:
>
>
> "NEMO" wrote in message news:l1peio$jvl$2@news.mixmin.net...
>> On 9/22/2013 10:10 PM, Michael Ejercito wrote:
>>> http://www.israpundit.com/arch...
>>>
>>> The Anniversary of Oslo: 20 Years of Fiction, Fantasy and Failure
>>>
>>> By Matthew M. Hausman
>
>> ANOTHER jew rectum on Israpundit for you to suck, gook! Mazel tov!
> Mangina, have there been any vaginas for you to fuck?

Gook, did you even stop sucking jew rectums over yom kipper?

> You are a Nazi.

You are a craven gook.

> As a Nazi, you are, above all else

As a craven gook with a mouth full of jew diarrhoea, you are, below all
else.

NEMO

9/24/2013 12:40:00 PM

0

On 9/23/2013 5:25 PM, Michael Ejercito wrote:
>
>
> "NEMO" wrote in message news:l1pi3o$ocb$7@news.mixmin.net...
>
>> On 9/23/2013 7:03 AM, Michael Ejercito wrote:
>>>
>>>
>>> "NEMO" wrote in message news:l1peio$jvl$2@news.mixmin.net...
>>>> On 9/22/2013 10:10 PM, Michael Ejercito wrote:
>>>>> http://www.israpundit.com/arch...
>>>>>
>>>>> The Anniversary of Oslo: 20 Years of Fiction, Fantasy and Failure
>>>>>
>>>>> By Matthew M. Hausman
>>>
>>>> ANOTHER jew rectum on Israpundit for you to suck, gook! Mazel tov!
>>> Mangina, have there been any vaginas for you to fuck?
>
>> Gook, did you even stop sucking jew rectums over yom kipper?
> I suck no rectums.

Yes, you do, gook: 24/7.

> I do not you failed to answer my question.

Learn English, you stupid cunt.

>>> You are a Nazi.
>
>> You are a craven gook.
> That would be better than being a Nazi nithing.

How can it be, gook? You're not even WHITE.

>>> As a Nazi, you are, above all else
>
>> As a craven gook with a mouth full of jew diarrhoea, you are, below
>> all else.
>
> You are a nithing- homo sapiens by birth, subhuman BY CHOICE.

YOU are a craven gook, subhuman BY BIRTH.

Michael Ejercito

9/25/2013 2:44:00 AM

0



"NEMO" wrote in message news:l1s187$tr8$1@news.mixmin.net...

>On 9/23/2013 5:25 PM, Michael Ejercito wrote:
>>
>>
>> "NEMO" wrote in message news:l1pi3o$ocb$7@news.mixmin.net...
>>
>>> On 9/23/2013 7:03 AM, Michael Ejercito wrote:
>>>> Mangina, have there been any vaginas for you to fuck?
>>
>>> Gook, did you even stop sucking jew rectums over yom kipper?
You still refuse to answer the question.

>> I suck no rectums.

>Yes, you do, gook: 24/7.
Mangina, I suck no rectums.


The following link explains you.


http://www.nizkor.org/ftp.cgi/people/ftp.py?people//m/morton.chris/what...


Michael

> I do not you failed to answer my question.

Learn English, you stupid cunt.

>>> You are a Nazi.
>
>> You are a craven gook.
> That would be better than being a Nazi nithing.

How can it be, gook? You're not even WHITE.

>>> As a Nazi, you are, above all else
>
>> As a craven gook with a mouth full of jew diarrhoea, you are, below
>> all else.
>
> You are a nithing- homo sapiens by birth, subhuman BY CHOICE.

YOU are a craven gook, subhuman BY BIRTH.

The Revd

9/25/2013 12:51:00 PM

0

On Tue, 24 Sep 2013 19:44:00 -0700, "Michael Ejercito"
<mejercit@hotmail.com> wrote:

>
>
>"NEMO" wrote in message news:l1s187$tr8$1@news.mixmin.net...
>
>>On 9/23/2013 5:25 PM, Michael Ejercito wrote:
>>>
>>>
>>> "NEMO" wrote in message news:l1pi3o$ocb$7@news.mixmin.net...
>>>
>>>> On 9/23/2013 7:03 AM, Michael Ejercito wrote:
>>>>> Mangina, have there been any vaginas for you to fuck?
>>>
>>>> Gook, did you even stop sucking jew rectums over yom kipper?
> You still refuse to answer the question.

YOU still don't understand that WE aks the questions, gook.

>>> I suck no rectums.
>
>>Yes, you do, gook: 24/7.
> Mangina, I suck no rectums.

Gook, of COURSE you do. You've sucked every jew rectum on Israpundit
at least a dozen times.

>
> The following link explains you.

Greek your link and greek you, gook.

Michael Ejercito

9/25/2013 2:07:00 PM

0



"The Revd" wrote in message
news:cvm5495ikk4hlsbv19fs30dj89cuq3pegs@4ax.com...

>On Tue, 24 Sep 2013 19:44:00 -0700, "Michael Ejercito"
><mejercit@hotmail.com> wrote:

>>
>>
>>"NEMO" wrote in message news:l1s187$tr8$1@news.mixmin.net...
>>
>>>On 9/23/2013 5:25 PM, Michael Ejercito wrote:
>>>> I suck no rectums.
>>
>>>Yes, you do, gook: 24/7.
>> Mangina, I suck no rectums.

>Gook, of COURSE you do. You've sucked every jew rectum on Israpundit
>at least a dozen times.
I suck no rectums.

>>
>> The following link explains you.

>Greek your link and greek you, gook.
Nithing, fuck your denigration of the Greek people.


The following article explains your pathology.

History's oldest hatred

by Jeff Jacoby
The Boston Globe
March 11, 2009

http://www.jeffjacoby.com/4743/historys-old...

ANTI-SEMITISM is an ancient derangement, the oldest of hatreds, so it
is strange that it lacks a more meaningful name. The misnomer "anti-
Semitism" -- a term coined in 1879 by the German agitator Wilhelm
Marr, who wanted a scientific-sounding euphemism for Judenhass, or
Jew-
hatred -- is particularly inane, since hostility to Jews has never had
anything to do with Semites or being Semitic. (That is why those who
protest that Arabs cannot be anti-Semitic since "Arabs are Semites
too" speak either from ignorance or disingenuousness.)

Perhaps there is no good name for a virus as mutable and unyielding as
anti-Semitism. "The Jews have been objects of hatred in pagan,
religious, and secular societies," write Joseph Telushkin and Dennis
Prager in Why the Jews?, their classic study of anti-Semitism.
"Fascists have accused them of being Communists, and Communists have
branded them capitalists. Jews who live in non-Jewish societies have
been accused of having dual loyalties, while Jews who live in the
Jewish state have been condemned as 'racists.' Poor Jews are bullied,
and rich Jews are resented. Jews have been branded as both rootless
cosmopolitans and ethnic chauvinists. Jews who assimilate have been
called a 'fifth column,' while those who stay together spark hatred
for remaining separate."

So hardy is anti-Semitism, it can flourish without Jews. Shakespeare's
poisonous depiction of the Jewish moneylender Shylock was written for
audiences that had never seen a Jew, all Jews having been expelled
from England more than 300 years earlier. Anti-Semitic bigotry infests
Saudi Arabia, where Jews have not dwelt in at least five centuries;
its malignance is suggested by the government daily Al-Riyadh, which
published an essay claiming that Jews have a taste for "pastries mixed
with human blood."

Esther Confounding Haman (Engraving by Gustave Dor???, 1875)
There was Jew-hatred before there was Christianity or Islam, before
Nazism or Communism, before Zionism or the Middle East conflict. This
week Jews celebrate the festival of Purim, gathering in synagogues to
read the biblical book of Esther. Set in ancient Persia, it tells of
Haman, a powerful royal adviser who is insulted when the Jewish sage
Mordechai refuses to bow down to him. Haman resolves to wipe out the
empire's Jews and makes the case for genocide in an appeal to the
king:

"There is a certain people scattered and dispersed among ... all the
provinces of your kingdom, and their laws are different from those of
other peoples, and the king's laws they do not keep, so it is of no
benefit for the king to tolerate them. If it please the king, let it
be written that they be destroyed." After winning royal assent, Haman
makes plans "to annihilate, to kill and destroy all the Jews, the
young and the elderly, children and women, in one day . . . and to
take their property for plunder."

What drives such bloodlust? Haman's indictment accuses the Jews of
lacking national loyalty, of insinuating themselves throughout the
empire, of flouting the king's law. But the Jews of Persia had done
nothing to justify Haman's murderous anti-Semitism -- just as Jews in
later ages did nothing that justified their persecution under the
Church or Islam, or their expulsion from so many lands in Europe and
the Middle East, or their repression at the hands of Russian czars and
Soviet commissars, or their slaughter by Nazi Germany. When the
president of Iran today calls for the extirpation of the Jewish state,
when a leader of Hamas vows to kill Jewish children around the world,
when firebombs are hurled at synagogues in London and Paris and
Chicago, it is not because Jews deserve to be victimized.

Some Jews are no saints, but the paranoid frenzy that is anti-Semitism
is not explained by what Jews do, but by what they are. The Jewish
people are the object of anti-Semitism, not its cause. That is why the
haters' rationales can be so wildly inconsistent and their agendas so
contradictory. What, after all, do those who vilify Jews as greedy
bankers have in common with those who revile them as seditious
Bolsheviks? Nothing, save an irrational obsession with Jews.

At one point in the book of Esther, Haman lets the mask slip. He
boasts to his friends and family of "the glory of his riches, and the
great number of his sons, and everything in which the king had
promoted him and elevated him." Still, he seethes with rage and
frustration: "Yet all this is worthless to me so long as I see
Mordechai the Jew sitting at the king's gate." That is the
unforgivable offense: "Mordechai the Jew" refuses to blend in, to
abandon his values, to be just like everyone else. He goes on sitting
there -- undigested, unassimilated, and for that reason unbearable.

Of course Haman had his ostensible reasons for targeting Jews. So did
Hitler and Arafat; so does Ahmadinejad. Sometimes the anti-Semite
focuses on the Jew's religion, sometimes on his laws and lifestyle,
sometimes on his national identity or his professional achievements.
Ultimately, however, it is the Jew's Jewishness, and the call to
higher standards that it represents, that the anti-Semite cannot
abide.

With all their flaws and failings, the Jewish people endure, their
role in history not yet finished. So the world's oldest hatred endures
too, as obsessive and indestructible -- and deadly -- as ever.

(Jeff Jacoby is a columnist for The Boston Globe.)