November 19, 2006
Daniel Keep wrote:
> Blech.  No offense, but I hate web apps.  Dialup makes these things slow
> as molasses to use.  I've made a website with Google Pages before, and
> it was not a fun experience.
> 
> *click a button*  *wait* ... ... ... ... *page loads*
> 
> In an ideal world, I could edit in OOo or GVim and have the files
> mirrored over FTP or somesuch.  I really aught to try that one of these
> days...

I'm haven't used this google service before, but other people publish papers like yours this way. And if one do not have a wiki (I hate wiki's, btw) or other means to publish versioned documents - google docs seems best option.

Out of curiosity, I have created new document and pasted contents from open office. It takes me a about 10 seconds (OO was opened already) to have it online - http://docs.google.com/View?docid=dtqh79k_1rbxfmb


-- 
serg.
November 19, 2006

Serg Kovrov wrote:
> Daniel Keep wrote:
>> Blech.  No offense, but I hate web apps.  Dialup makes these things slow as molasses to use.  I've made a website with Google Pages before, and it was not a fun experience.
>>
>> *click a button*  *wait* ... ... ... ... *page loads*
>>
>> In an ideal world, I could edit in OOo or GVim and have the files mirrored over FTP or somesuch.  I really aught to try that one of these days...
> 
> I'm haven't used this google service before, but other people publish papers like yours this way. And if one do not have a wiki (I hate wiki's, btw) or other means to publish versioned documents - google docs seems best option.
> 
> Out of curiosity, I have created new document and pasted contents from open office. It takes me a about 10 seconds (OO was opened already) to have it online - http://docs.google.com/View?docid=dtqh79k_1rbxfmb
> 

Not bad, except that there's no spacing between paragraphs.  It also destroyed indenting on all the code examples :3

In any case, I dumped out the text to a plain text file, and re-marked
it up in reStructuredText.  Generates almost exactly the same HTML
output, but now people can't complain they can't view it :P  I'll post
it up as soon as I've worked out if I'm going to include this "Q&A" section.

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/
November 19, 2006
Ok, here's the third revision.  Includes some clearer examples, a Q&A
section, and is now written in plain text, and then dumped out to HTML.
 If anyone complains about what file format it's in now, they can get
stuffed :P  (And *yes*, the HTML is generated directly from the .txt file.)

Again, all feedback and suggestions is welcome.

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/


November 19, 2006
Daniel Keep wrote:
> Ok, here's the third revision.  Includes some clearer examples, a Q&A
> section, and is now written in plain text, and then dumped out to HTML.
>  If anyone complains about what file format it's in now, they can get
> stuffed :P  (And *yes*, the HTML is generated directly from the .txt file.)
> 
> Again, all feedback and suggestions is welcome.
> 
> 	-- Daniel

I finally managed to find a copy of the C99 standard, and I've filled in what characters you can use... although it's still a bit tricky to understand.  That said, I added an example which shows using function names written entirely in hiragana, so it obviously works :P

Secondly, I've removed the references to std.utf.stride.  After going over the docs again, and actually *testing* the code, it turns out I was dead wrong on what stride does: it returns the length of the code point sequence at the given location, not the number of code points from that location.  Whoopsie.

I've replaced the code showing how to use std.utf.stride with a small function that correctly computes the number of code points in a string.

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/


November 19, 2006

Daniel Keep wrote:
> Daniel Keep wrote:
>> Ok, here's the third revision.  Includes some clearer examples, a Q&A
>> section, and is now written in plain text, and then dumped out to HTML.
>>  If anyone complains about what file format it's in now, they can get
>> stuffed :P  (And *yes*, the HTML is generated directly from the .txt file.)
>>
>> Again, all feedback and suggestions is welcome.
>>
>> 	-- Daniel
> 
> I finally managed to find a copy of the C99 standard, and I've filled in
> what characters you can use... although it's still a bit tricky to
> understand.  That said, I added an example which shows using function
> names written entirely in hiragana, so it obviously works :P

konnichiwa!!!!!!11one :D

> 
> Secondly, I've removed the references to std.utf.stride.  After going
> over the docs again, and actually *testing* the code, it turns out I was
> dead wrong on what stride does: it returns the length of the code point
> sequence at the given location, not the number of code points from that
> location.  Whoopsie.
> 
> I've replaced the code showing how to use std.utf.stride with a small
> function that correctly computes the number of code points in a string.
> 
> 	-- Daniel
> 

Nice job on the article.
Why don't you place it on the dsource tutorials section? It's a wiki system, so you can update it more easily.
November 19, 2006

Hasan Aljudy wrote:
> 
> 
> Daniel Keep wrote:
>> Daniel Keep wrote:
>>> Ok, here's the third revision.  Includes some clearer examples, a Q&A
>>> section, and is now written in plain text, and then dumped out to HTML.
>>>  If anyone complains about what file format it's in now, they can get
>>> stuffed :P  (And *yes*, the HTML is generated directly from the .txt
>>> file.)
>>>
>>> Again, all feedback and suggestions is welcome.
>>>
>>>     -- Daniel
>>
>> I finally managed to find a copy of the C99 standard, and I've filled in what characters you can use... although it's still a bit tricky to understand.  That said, I added an example which shows using function names written entirely in hiragana, so it obviously works :P
> 
> konnichiwa!!!!!!11one :D

Actually, I'm pretty sure it's supposed to be konnichiha: people keep spelling and saying it "konnichiwa" because westerners misheard what the Japanese were saying :3

(Do correct me I'm wrong, btw...)

>>
>> Secondly, I've removed the references to std.utf.stride.  After going over the docs again, and actually *testing* the code, it turns out I was dead wrong on what stride does: it returns the length of the code point sequence at the given location, not the number of code points from that location.  Whoopsie.
>>
>> I've replaced the code showing how to use std.utf.stride with a small function that correctly computes the number of code points in a string.
>>
>>     -- Daniel
>>
> 
> Nice job on the article.
> Why don't you place it on the dsource tutorials section? It's a wiki
> system, so you can update it more easily.

Honestly, I'd love to see this on the official D website; from the number of people coming to the forums saying "why doesn't this work?" and "strings are teh borken!" it's obvious we need to have something that says "this is how things work and why they work the way they do."

But if Walter doesn't want it, then I'm happy to stick it up on the Wiki... yet another format I'll have to change it over to :P

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/
November 19, 2006
Pierre Rouleau wrote:
> One aspect is the string formatting.  Does D support string formatting similar to Python's dictionary-based formatting like:
> 
> a_dict = {person_name : 'Daniel'}
> a_string = 'Hello %(person_name)s ! How are you?' % a_dict
> 

No, but it ought to be easy enought to make.  A quick hack at it:

# import cashew .utils .array ;
#
# char[] dictsub (char[] src, char[][char[]] dict) {
#   char[]  result ;
#   char[]* plug   ;
#   size_t  open   ,
#           close  ,
#           pos    ;
#
#   while (NOT_FOUND != (open = src.indexOf("%(", pos))) {
#     close   = src.indexOf(")", open) ;
#     result ~= src[pos .. open]       ;
#     pos     = close + 1              ;
#
#     if (null is (plug = src[open + 2 .. close] in dict)) {
#       throw new Exception("dictsub: invalid key " ~ src[open .. close + 1]);
#     }
#     result ~= *plug;
#   }
#   result ~= src[pos .. $];
# }

Don't quote me on that working exactly right as is, since its just off the top of my head.  But usage would be fairly straight forward, while not quite as pretty as Python since we don't yet have associative literals.

# char[][char[]] a_dict;
# a_dict["person_name"] = "Daniel";
# a_string = "Hello %(person_name)! How are you?".dictsub(a_dict);

-- Chris Nicholson-Sauls
November 19, 2006
Daniel Keep wrote:
> 
> Hasan Aljudy wrote:
>>
>>konnichiwa!!!!!!11one :D
> 
> 
> Actually, I'm pretty sure it's supposed to be konnichiha: people keep
> spelling and saying it "konnichiwa" because westerners misheard what the
> Japanese were saying :3
> 
> (Do correct me I'm wrong, btw...)

Unless my Japanese mentor was playing a prank on me (which is /entirely/ possible) its actually a quirk thing.  While it is written "kon'ityi-ha" it is indeed pronouned "kon'nityi-wa", as the 'ha' kana is written for the particle 'wa' for some long-forgotten reason.  (Kind of like the archaic 'wo' kana is still used for the 'o' prefix, as in "(w)o-genki desu-ka".)

-- Chris Nicholson-Sauls
November 19, 2006

Chris Nicholson-Sauls wrote:
> Daniel Keep wrote:
>>
>> Hasan Aljudy wrote:
>>>
>>> konnichiwa!!!!!!11one :D
>>
>>
>> Actually, I'm pretty sure it's supposed to be konnichiha: people keep
>> spelling and saying it "konnichiwa" because westerners misheard what the
>> Japanese were saying :3
>>
>> (Do correct me I'm wrong, btw...)
It's written konnichiha in hiragana, but it's pronounced konnichiwa, because the "ha" is actually a particle, and the "ha" particle is pronounced "wa" even though it's written as "ha".
I think the phrase is basically an incomplete sentence understood to be "It's morning" or something like that ..

> 
> Unless my Japanese mentor was playing a prank on me (which is /entirely/ possible) its actually a quirk thing.  While it is written "kon'ityi-ha" it is indeed pronouned "kon'nityi-wa", as the 'ha' kana is written for the particle 'wa' for some long-forgotten reason.  (Kind of like the archaic 'wo' kana is still used for the 'o' prefix, as in "(w)o-genki desu-ka".)

kon'ity-ha?
Wow, what kind of romanization system is that? Now /that/ is a prank ..

I think what you said about the ha/wa is correct thu. From what I've gathered, the particle used to be pronounced "ha" but its pronunciation has changed over the centuries, while the spelling for it didn't.


> 
> -- Chris Nicholson-Sauls
November 19, 2006
Chris Nicholson-Sauls wrote:
> Daniel Keep wrote:
> 
>>
>> Hasan Aljudy wrote:
>>
>>>
>>> konnichiwa!!!!!!11one :D
>>
>>
>>
>> Actually, I'm pretty sure it's supposed to be konnichiha: people keep
>> spelling and saying it "konnichiwa" because westerners misheard what the
>> Japanese were saying :3
>>
>> (Do correct me I'm wrong, btw...)
> 
> 
> Unless my Japanese mentor was playing a prank on me (which is /entirely/ possible) its actually a quirk thing.  While it is written "kon'ityi-ha" it is indeed pronouned "kon'nityi-wa", as the 'ha' kana is written for the particle 'wa' for some long-forgotten reason.  

yep.

(Kind of like the
> archaic 'wo' kana is still used for the 'o' prefix, as in "(w)o-genki desu-ka".)

Now you're just making stuff up.  :-) 'wo' is used as a particle indicating the object of a transitive verb.  Like "hon wo yomu" (read a book)
   本を読む
Nothing to do with with the polite 'o' prefix in, o-genki desu ka:
   御元気ですか
(Though you're more likely to see it written with the hiragana 'o' instead: お元気ですか。)

--bb