<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.lang.pike.user">
    <title>gmane.comp.lang.pike.user</title>
    <link>http://blog.gmane.org/gmane.comp.lang.pike.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8698"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8697"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8691"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8689"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8684"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8663"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8649"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8628"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8619"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8601"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8586"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8583"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8580"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8570"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8562"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8533"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8530"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8527"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8512"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.pike.user/8510"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8698">
    <title>Abuse of thread kill() to achieve setjmp/longjmp</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8698</link>
    <description>&lt;pre&gt;In playing around with some aspects of STONITH protection and
forbidden reconnects, I've set up a situation in which I conditionally
want to abort out of a pgsql reconnect hook back to almost the
top-level of the program, and then restart from there. My current
technique seems somewhat insane, so I'd appreciate any advice!

Sql.Sql db;
int main(int argc,array(string) argv)
{
db=Sql.Sql("pgsql://blahblah");
db-&amp;gt;master_sql-&amp;gt;set_notify_callback("_reconnect",recon,1);
while (Thread.Thread(doit)-&amp;gt;wait()!=5);
return 0;
}
int doit()
{
//do stuff, lots of SQL queries
write("Done!\n");
return 5;
}
void recon(int pid,string cond,string extra)
{
/* if (whatever condition) */ this_thread()-&amp;gt;kill();
}

If the thread is killed, wait() returns 0; if it ends normally, it
returns the thread's nonzero return value. By killing the thread and
starting over, I effectively execute a longjmp straight out of recon()
and back to the main routine. (I can't throw an exception, which is
the obvious thing to do here, because the pgsql reconnect module
catches them.)

What better ways are there of achieving this? I'm sure there must be
some. Opening up for random thoughts, queries as to my sanity, demands
for revocation of my coder's license, etcetera...

Chris Angelico


&lt;/pre&gt;</description>
    <dc:creator>Chris Angelico</dc:creator>
    <dc:date>2012-05-23T08:05:54</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8697">
    <title>Stackoverflow question: how is pike different from C?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8697</link>
    <description>&lt;pre&gt;hi,

maybe some of you who are more knowlegeable about C can help answer this
question:

http://stackoverflow.com/questions/10307319/is-there-a-guide-to-ch-cint-or-pike-for-c-c-programmers

greetings, martin.
&lt;/pre&gt;</description>
    <dc:creator>Martin Bähr</dc:creator>
    <dc:date>2012-05-22T04:24:49</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8691">
    <title>read callbacks</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8691</link>
    <description>&lt;pre&gt;So I'm trying to implement a read_callback, and it is not doing quite what I want.

I have a class Connection, that creates a Transport object, that itself creates a Stdio.File object.  I pass a callback function like this, mostly:

class Connection {
    object transport;

    void create() {
        predef::write("before transport\n");
        transport=.Transport(read_cb);
        predef::write("after transport\n");
    }

    void read_cb(mixed in_str) {
        predef::write("Connection: in_str==%O\n",in_str);
    }
}


class Transport {
    function in_cb;
    Stdio.File con;

    void create(function in_read_cb) {
        in_cb=in_read_cb;
        con=Stdio.File();
        write("before set_read_callback\n");
        con-&amp;gt;set_read_callback(read_cb);
        write("after set_read_callback\n");
        con-&amp;gt;open_socket();
        con-&amp;gt;connect(/* specific host and port */);
        write("before write\n");
        con-&amp;gt;write(/* protocol start data);
        write("after write\n");
    }

    int read_cb(mixed in_str) {
        predef::write("Entering Transport::read_cb()\n");

        mixed ret=in_cb(in_str);
        predef::write("ret==%O\n",ret);
        predef::write("in_str==%O\n",in_str);
        predef::write("Leaving Transport::read_cb()\n");
        return ret;
    }

}


So, in my main code, I am creating a connection object.  This should set the read_cb and send the data.  As shown, I have the transport set the read_cb to itself, and pass the information up to the function set at create time.

However, I don't seem to get anything anywhere.  I know that I am getting data because it was working when I just do a read directly, before attempting the callback, and also with the callback set I did a tcpdump and verified that I was getting the same data as before.  It just doesn't seem to be getting to the callback.  Here is what my debug statements are printing:

before transport
before set_read_callback
after set_read_callback
before write
after write
after transport
Entering Transport::read_cb()
Connection: in_str==0
ret==0
in_str==0
Leaving Transport::read_cb()


As shown, it seems to be receiving something, because the callback gets called, but there is no data there.

Maybe I'm using the function wrong?

Thanks
&lt;/pre&gt;</description>
    <dc:creator>Lance Dillon</dc:creator>
    <dc:date>2012-05-18T19:48:59</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8689">
    <title>multiple return types?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8689</link>
    <description>&lt;pre&gt;I have a class method that returns either an object (.Frame) or a mapping.  I have the function defined as such:

.Frame|mapping read_frame();

but when I try to define a variable:

.Frame|mapping start_frame;

I get the following error:

Connection.pike:45:syntax error, unexpected TOK_MAPPING_ID

However, if I change it to object instead of .Frame:

object|mapping start_frame;

It works fine.

Is this an error somewhere?  Or is that a syntax error on my part?
&lt;/pre&gt;</description>
    <dc:creator>Lance Dillon</dc:creator>
    <dc:date>2012-05-17T14:27:10</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8684">
    <title>Crypto.MD5</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8684</link>
    <description>&lt;pre&gt;I want to generate a hash exactly as md5sum would.  What would be the best way of doing that?  The docs don't seem to be that helpful.

http://pike.ida.liu.se/generated/manual/modref/ex/predef_3A_3A/Crypto/MD5.html

doesn't really say how to use it, other than it inherits from MD5_Info (Nettle.MD5_Info) and Hash (.Hash).

Nettle.MD5_Info just says it is an internal mixin class.
.Hash just says it is an abstract class, with only `()() listed, but it inherits Nettle.HashInfo
Nettle.HashInfo has block_size(), digest_size(), hash(), and name().

md5sum on a certain file game me:
2fcb2fbe1ff9e1dd6cfa10429879008

Crypto.MD5.hash() gave me "/\313/\276\37\371\341\335l\372\20B\230y\0\213"

I'm assuming there is some sort of transformation after Crypto.MD5.hash() to get the same result as md5sum, I just don't know what that is.

Actually, with a little experimenting, and looking at rfc1321 (http://www.ietf.org/rfc/rfc1321.txt), page 20, I came up with the following code.

string md5sum(string str) {
    string hash=Crypto.MD5.hash(str);
    string md5s=sprintf("%{%02x%}",map(hash/"",lambda(string h1) { return array_sscanf(h1,"%c")[0]; } ));
    return md5s;
}


There may be a more efficient way, if anybody can think of it.  I need to output every byte of the string returned from Crypto.MD5.hash() as a 2-byte hex, but I think doing array_sscanf() for each character is a little inefficient.

Thanks
&lt;/pre&gt;</description>
    <dc:creator>Lance Dillon</dc:creator>
    <dc:date>2012-05-15T15:12:15</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8663">
    <title>Architecture mismatch between Pike and ODBC driver</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8663</link>
    <description>&lt;pre&gt;We're running Pike on a Windows 64-bit server and when I try to connect to
an ODBC resource I get the following error:

-1:IM014:[Microsoft][ODBC Driver Manager] The specified DSN contains an
architecture mismatch between the Driver and Application

I guess is due to the fact that Pike runs in 32-bit mode and the
ODBC-driver in 64-bit mode?
How do I solve it? Any ideas?

# Pontus
&lt;/pre&gt;</description>
    <dc:creator>Pontus Östlund</dc:creator>
    <dc:date>2012-04-19T12:39:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8649">
    <title>SQLite and pike strings in bindings</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8649</link>
    <description>&lt;pre&gt;Is there a reason that pike strings are converted to "blob" when used in 
bindings for an SQLite query?
It seems k-&amp;gt;val.u.string-&amp;gt;size_shift always resolves to being 0, 
although I'm not sure where size_shift stands for, I've deduced from 
modules/_Roxen_roxen.c, line 318, that it should stand for 8-bit 
strings, correct?

But if it's an 8-bit string, why doesn't it get converted to TEXT?
What does size_shift=0,1 or 2 mean?

 &amp;gt; object db = Sql.Sql("sqlite://test.db");
 &amp;gt; db-&amp;gt;query("create table abc (bla TEXT);");
(1) Result: 0
 &amp;gt; db-&amp;gt;query("insert into abc (bla) values (:bar);",([":bar":"bar"]));
(2) Result: 0
 &amp;gt; db-&amp;gt;query("select typeof(bla) from abc;");
(3) Result: ({ /* 1 element */
                 ([ /* 1 element */
                   "typeof(bla)": "blob"
                 ])
             })

I've found in sqlite.cmod:

       case T_STRING:
       {
         struct pike_string *s = k-&amp;gt;val.u.string;
         switch(s-&amp;gt;size_shift) {
         case 0:
           ERR( sqlite3_bind_blob(stmt, idx, s-&amp;gt;str, s-&amp;gt;len,
                                  SQLITE_STATIC),
                db);
           break;
         case 1:
         case 2:
           ref_push_string(s);
           f_string_to_utf8(1);
           s = Pike_sp[-1].u.string;
           ERR( sqlite3_bind_text(stmt, idx, s-&amp;gt;str, s-&amp;gt;len,
                                  SQLITE_TRANSIENT),
                db);
           pop_stack();
           break;

/Marc



&lt;/pre&gt;</description>
    <dc:creator>Marc Dirix</dc:creator>
    <dc:date>2012-04-18T16:34:15</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8628">
    <title>newbie questions - "finally", "amqp"</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8628</link>
    <description>&lt;pre&gt;Hello,

trying to evaluate Pike and just interesting :

  - what is best way to emulate finally (i.e. try/finally) ?
as for me using of catch\throw will break a backtrace
and gc may delay destruction of object ...

- is here exists any amqp module for pike (compatible with rabbitmq) ?



Best regards,
Oleksii Prudkyi


&lt;/pre&gt;</description>
    <dc:creator>Oleksii Prudkyi</dc:creator>
    <dc:date>2012-04-16T22:05:31</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8619">
    <title>Online docs of Pike</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8619</link>
    <description>&lt;pre&gt;Is there a reason why the online docs of Pike are still of 7.8 release 116,
2008-12-31 ?
Could we please update this to a more recent Pike version?
Possibly even have a latest 7.8 and a latest 7.9 tree?
&lt;/pre&gt;</description>
    <dc:creator>Stephen R. van den Berg</dc:creator>
    <dc:date>2012-04-14T13:33:11</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8601">
    <title>xml parse</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8601</link>
    <description>&lt;pre&gt;I need to parse some xml into just an ordinary tree/mapping, like this:

&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;reply&amp;gt;
&amp;lt;seq&amp;gt;0&amp;lt;/seq&amp;gt;
&amp;lt;status&amp;gt;OK&amp;lt;/ststus&amp;gt;
&amp;lt;contents&amp;gt;&amp;lt;token&amp;gt;askldjfklasdfjlasdf&amp;lt;/token&amp;gt;
&amp;lt;server_uuid&amp;gt;&amp;gt;some uuid data&amp;lt;/server_uuid&amp;gt;
&amp;lt;plugin_set&amp;gt;201204110537&amp;lt;/plugin_set&amp;gt;
&amp;lt;loaded_plugin_set&amp;gt;201204110537&amp;lt;/loaded_plugin_set&amp;gt;
&amp;lt;scanner_boottime&amp;gt;1331388234&amp;lt;/scanner_boottime&amp;gt;
&amp;lt;msp&amp;gt;FALSE&amp;lt;/msp&amp;gt;
&amp;lt;user&amp;gt;
&amp;lt;name&amp;gt;ldillon&amp;lt;/name&amp;gt;
&amp;lt;admin&amp;gt;TRUE&amp;lt;/admin&amp;gt;
&amp;lt;/user&amp;gt;&amp;lt;/contents&amp;gt;
&amp;lt;/reply&amp;gt;

Into something like:
([ "reply":
    ([ "seq": 0,
        "status": "OK",
        "contents":
            ([ "token": "asldkfjlasdjl",
                "server_uuid": "some uuid data",
                "plugin_set": "201204110537",
                "loaded_plugin_set": "201204110537",
                "scanner_boottime": 1331388234, // or Calendar object
                "msp": "FALSE",    // or Val object
                "user":
                    ([ "name": "ldillon",
                    "admin": "TRUE",    // or Val object
                ]),
        ]),
    ]),
])

I'm trying to puzzle through the Protocols.XML.Simple parser, but I'm not finding the docs helpful so far.

What would be a good module to look at for clarification?  The xml tree is a response to either an xmlrpc call, or a http post_query.  The items will be the same for type of query/call (although of course the data for each item could be different), but the responses for each call/query will be different, of course.


Thanks&lt;/pre&gt;</description>
    <dc:creator>Lance Dillon</dc:creator>
    <dc:date>2012-04-11T18:07:17</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8586">
    <title>calendar</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8586</link>
    <description>&lt;pre&gt;Is there a good tutorial or document on using Calendar?  I can get a Calendar object with Calendar.Second(), or Calendar.dwim_day("1 jan 1970") or something like that, but I need to get the current time_t, and so far none of the format_*() methods of Calendar.Second are giving me what I need.

Thanks
&lt;/pre&gt;</description>
    <dc:creator>Lance Dillon</dc:creator>
    <dc:date>2012-04-10T20:12:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8583">
    <title>big float and float parts</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8583</link>
    <description>&lt;pre&gt;Several parts to this question.  I need to be able to get the parts of the float, the exponent, sign, and actual digits.  Is there an easy way (function, module, whatever) to do this, or will I have to write something to pull that out?


Also, is there a way to get float to use the Gmp mpf type, make it a big float, for greater precision?

When I tested, it didn't seem to use it:

(67) Result: 9.12384761289347e+21
(68) Result: 9.12384761289347e+21

Thanks
&lt;/pre&gt;</description>
    <dc:creator>Lance Dillon</dc:creator>
    <dc:date>2012-04-10T14:38:51</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8580">
    <title>INT_MAX?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8580</link>
    <description>&lt;pre&gt;I'm writing a new Procotol module, but the protocol distinguishes between int and long (4 bytes and 8 bytes).  Is there an easy way to determine whether an int value (intp()==true) will fit in 4 bytes or 8?  Or if not, maybe INT_MAX is defined (possibly even LONG_MAX) and determine whether it is a native or bigint?

Thanks
&lt;/pre&gt;</description>
    <dc:creator>Lance Dillon</dc:creator>
    <dc:date>2012-04-10T13:54:31</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8570">
    <title>autodoc fail</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8570</link>
    <description>&lt;pre&gt;
Looks only happens when there is a class that has a setter or getter.
 
class Func(string daemon,string func,mixed ... args0){
        string `cmd(){
                werror("WARNING: Func.cmd deprecated.\n");
                return daemon;
        }
        string `cmd=(string s){
                werror("WARNING: Func.cmd deprecated.\n");
                return daemon=s;
        }
}
//! Return main thread.
Thread.Thread main_thread(){ }

[peterpan&amp;lt; at &amp;gt;brain brain5]$pike -x extract_autodoc run2.pike
Extracting file "run2.pike"...
PikeParser: expected ";", got "" (run2.pike:16)
/home/peterpan/pike/7.8.352/lib/modules/Tools.pmod/AutoDoc.pmod/PikeParser.pike:105: Tools.AutoDoc.PikeParser()-&amp;gt;parseError("expected \";\", got \"\"")
/home/peterpan/pike/7.8.352/lib/modules/Tools.pmod/AutoDoc.pmod/PikeParser.pike:179: Tools.AutoDoc.PikeParser()-&amp;gt;eat(";")
/home/peterpan/pike/7.8.352/lib/modules/Tools.pmod/AutoDoc.pmod/PikeExtractor.pmod:234: Tools.AutoDoc.PikeExtractor.Extractor()-&amp;gt;parseAdjacentDecls(Tools.AutoDoc.PikeParser()-&amp;gt;Class("Func"))
/home/peterpan/pike/7.8.352/lib/modules/Tools.pmod/AutoDoc.pmod/PikeExtractor.pmod:294:
    Tools.AutoDoc.PikeExtractor.Extractor()-&amp;gt;parseClassBody(&amp;lt; at &amp;gt;0=Tools.AutoDoc.PikeParser()-&amp;gt;Class("Func"),0,UNDEFINED,UNDEFINED)
/home/peterpan/pike/7.8.352/lib/modules/Tools.pmod/AutoDoc.pmod/PikeExtractor.pmod:211: Tools.AutoDoc.PikeExtractor.Extractor()-&amp;gt;parseAdjacentDecls(Tools.AutoDoc.PikeExtractor.Class("run2"))
/home/peterpan/pike/7.8.352/lib/modules/Tools.pmod/AutoDoc.pmod/PikeExtractor.pmod:294:
    Tools.AutoDoc.PikeExtractor.Extractor()-&amp;gt;parseClassBody(&amp;lt; at &amp;gt;1=Tools.AutoDoc.PikeExtractor.Class("run2"),0,"run2.pike",UNDEFINED)
/home/peterpan/pike/7.8.352/lib/modules/Tools.pmod/AutoDoc.pmod/PikeExtractor.pmod:502:
    Tools.AutoDoc.PikeExtractor-&amp;gt;extractClass("class Func(string daemon,string func,mixed ... args0){\r\n\tstring `cmd(){\r\n\t\twerror(\"WARNING: Func.cmd deprecated.\\n\");\r\n\t\treturn daemon;\r\n\t}\r
    \n\tstring `cmd=(string s){\r\n\t\twerror(\"WA"+[123],"run2.pike","run2")
/home/peterpan/pike/7.8.352/lib/modules/Tools.pmod/AutoDoc.pmod/ProcessXML.pmod:210: Tools.AutoDoc.ProcessXML-&amp;gt;extractXML("run2.pike",1,"class","run2",({"predef::"}))
/home/peterpan/pike/7.8.352/lib/modules/Tools.pmod/Standalone.pmod/extract_autodoc.pike:223: Tools.Standalone.extract_autodoc()-&amp;gt;extract("run2.pike",0,"./",&amp;lt; at &amp;gt;2=({"predef::"}))
/home/peterpan/pike/7.8.352/lib/modules/Tools.pmod/Standalone.pmod/extract_autodoc.pike:75: Tools.Standalone.extract_autodoc()-&amp;gt;main(2,({"run2.pike"}))


Guo Xuesong       &lt;/pre&gt;</description>
    <dc:creator>郭雪松</dc:creator>
    <dc:date>2012-04-10T07:22:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8562">
    <title>streaming_query() vs. big_query()</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8562</link>
    <description>&lt;pre&gt;Looking over the Sql.Sql members once more, I notice streaming_query() again.
Can someone remind me why streaming_query() was needed even if we have
big_query()?
Was it because some/many applications assume that the database object
could be used to start a new query even though the result object was still
in use processing the results of the last query?
&lt;/pre&gt;</description>
    <dc:creator>Stephen R. van den Berg</dc:creator>
    <dc:date>2012-03-30T06:05:35</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8533">
    <title>Parsing CSV with header row</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8533</link>
    <description>&lt;pre&gt;I don't know if there's an easier way, but the one-liner of this code
tickled my weirdness sense :)

This function reads in a CSV file with a header row, and returns an
array of mappings of header to data.

array(mapping(string:string)) parsecsv(string filename)
{
Stdio.FILE f=Stdio.FILE(filename);
return Parser.Tabular(f,sprintf("[Tabular description
begin]\ncsv\n%{:%s[,]\n%}[Tabular description
end]",array_sscanf(f-&amp;gt;gets(),"%{%*[\"]%s%*[\"]%*[,]%}")[0]))-&amp;gt;fetch()-&amp;gt;csv;
}

Input file:

"Asdf","Qwer","Zxcv"
"Hello","World","!"
1234,2345,3456
This,has,"a,comma"

Result:

({ /* 3 elements */
    ([ /* 3 elements */
      "Asdf": "Hello",
      "Qwer": "World",
      "Zxcv": "!"
    ]),
    ([ /* 3 elements */
      "Asdf": "1234",
      "Qwer": "2345",
      "Zxcv": "3456"
    ]),
    ([ /* 3 elements */
      "Asdf": "This",
      "Qwer": "has",
      "Zxcv": "a,comma"
    ])
})

Is it worth posting an example like this somewhere on the Parser.Tabular docs?

Chris Angelico


&lt;/pre&gt;</description>
    <dc:creator>Chris Angelico</dc:creator>
    <dc:date>2012-03-14T03:22:01</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8530">
    <title>Image.ANY - SVG support</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8530</link>
    <description>&lt;pre&gt;Hi
Is it possible to add SVG support to the Image.ANY module please?
Attached patch works for me at least until someone comes along with another
XML-based image format.  Thanks.
http://pike.1058338.n5.nabble.com/file/n5538267/mydiff mydiff 

--
View this message in context: http://pike.1058338.n5.nabble.com/Image-ANY-SVG-support-tp5538267p5538267.html
Sent from the Pike - User mailing list archive at Nabble.com.


&lt;/pre&gt;</description>
    <dc:creator>larcky</dc:creator>
    <dc:date>2012-03-05T17:44:58</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8527">
    <title>MIME.pmod handles MSIE bug but Protocols.pmod/HTTP.pmod/Server.pmod/Request.pike never used it</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8527</link>
    <description>&lt;pre&gt;
MIME.pmod says:
      // Check for MSIE:
      //
      // MSIE insists on sending the full local path to the file as
      // the "filename" parameter, but forgets to quote the backslashes.
      //
      // Heuristic:
      //   * If there are forward slashes, or properly quoted backslashes,
      //     everything's alright.
      //   * Note that UNC-paths (\\host\dir\file) look like they have
      //     a properly quoted backslash as the first character, so
      //     we disregard the first character.
      if ((param == "filename") &amp;amp;&amp;amp; guess &amp;amp;&amp;amp; entry2 &amp;amp;&amp;amp;
          !has_value(val, "/") &amp;amp;&amp;amp; !has_value(val[1..], "\\") &amp;amp;&amp;amp;
          (sizeof(entry2) &amp;gt;= 3) &amp;amp;&amp;amp; (entry2[1] == '=') &amp;amp;&amp;amp;
          (lower_case(entry2[0]) == param)) {
        val = map(entry2[2..], token_to_string) * "";
        if (has_value(val, "\\"))
          params[param] = val;
      }

Protocols.pmod/HTTP.pmod/Server.pmod/Request.pike called MIME.Message:
    MIME.Message messg = MIME.Message(body_raw, request_headers);

Protocols.pmod/HTTP.pmod/Server.pmod/Request.pike should call MIME.Message in this way:
    MIME.Message messg = MIME.Message(body_raw, request_headers,0,/*guess=*/1);



Guo Xuesong       &lt;/pre&gt;</description>
    <dc:creator>郭雪松</dc:creator>
    <dc:date>2012-02-24T04:35:53</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8512">
    <title>sizeof(string) == -1</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8512</link>
    <description>&lt;pre&gt;I stumbled upon a strange thing today which drove me nuts. I query an
Oracle database and get a recordset with mappings with two indices:

  NORMALTID which is a date
  VAERDE which is a float value as a string

When I was iterating over the recordset the loop got stuck for a while at
the last index and the program terminated (without any notice). So I traced
the output and saw that VAERDE in the last index was "" (an empty string).
So I added to the loop:

  if (row-&amp;gt;VAERDE == "")
    break;

Nothing happened. So I tried

  if (!sizeof(row-&amp;gt;VAERDE))
    break;

Nothing happened. So I traced the size of row-&amp;gt;VAERDE and to my surprise it
returned -1:

  werror("%d\n", sizeof(row-&amp;gt;VAERDE)) &amp;gt;&amp;gt; -1

So with

  if (row-&amp;gt;VAERDE == -1)
    break;

the program continues and finish ok.

But why on earth does sizeof return -1 for a (seemingly) empty string?

# Pontus
&lt;/pre&gt;</description>
    <dc:creator>Pontus Östlund</dc:creator>
    <dc:date>2012-02-15T10:55:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8510">
    <title>module Search</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8510</link>
    <description>&lt;pre&gt;
Hi,
 
Is there any example about howto use the module Search?

Guo Xuesong       &lt;/pre&gt;</description>
    <dc:creator>郭雪松</dc:creator>
    <dc:date>2012-02-09T03:17:09</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.pike.user/8509">
    <title>Warnings from Parser.LR.GrammarParser</title>
    <link>http://comments.gmane.org/gmane.comp.lang.pike.user/8509</link>
    <description>&lt;pre&gt;
Should I ignore these warnings?
 
Warning: repair: Repaired Shift-Reduce conflict on "RETURN"
Warning: repair: All conflicts removed!
Warning: repair: Repaired Reduce-Reduce conflict on "-"
Warning: repair: Repaired Reduce-Reduce conflict on "]"
Warning: repair: Repaired Reduce-Reduce conflict on ")"
Warning: repair: Repaired Reduce-Reduce conflict on ":"
Warning: repair: Repaired Reduce-Reduce conflict on "*"
Warning: repair: Repaired Reduce-Reduce conflict on "="
Warning: repair: Repaired Reduce-Reduce conflict on "!"
Warning: repair: Repaired Reduce-Reduce conflict on "token"
Warning: repair: All conflicts removed!
Warning: repair: Repaired Shift-Reduce-Reduce conflict on "-"
Warning: repair: Repaired Reduce-Reduce conflict on "]"
Warning: repair: Repaired Reduce-Reduce conflict on ")"
Warning: repair: Repaired Reduce-Reduce conflict on ":"
Warning: repair: Repaired Shift-Reduce-Reduce conflict on "*"
Warning: repair: Repaired Reduce-Reduce conflict on "="
Warning: repair: Repaired Reduce-Reduce conflict on "!"
Warning: repair: Repaired Reduce-Reduce conflict on "token"
Warning: repair: All conflicts removed!
Warning: repair: Repaired Shift-Reduce conflict on "="
Warning: repair: All conflicts removed!
Warning: repair: Repaired Shift-Reduce conflict on "-"
Warning: repair: Repaired Shift-Reduce conflict on "*"
Warning: repair: All conflicts removed!


Guo Xuesong       &lt;/pre&gt;</description>
    <dc:creator>郭雪松</dc:creator>
    <dc:date>2012-02-08T05:30:46</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.pike.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.pike.user</link>
  </textinput>
</rdf:RDF>

