Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - unya

#1
Hello Lutz,



I tried to add a new connectdb fixes and connect: PgSQL of module postgres.lsp.



The reason is that the parameters are omitted and for postgres PQconnectdb is possible, depending on the version parameter is increased.



PgSQLconnect is (C library "libpq"), has been changed in order to allow connections without a password, even if the host name and the setting.



You can be written as follows,

ex1.(PgSQL:connect "" "" "" "mydb");; host (socket file), user (login-name), passwd (empty)

ex2.(PgSQL:connectdb "host=srv port=25432 user=name dbname=mydb") ;; connect other port.



I would appreciate it if you can change it.



Thanks,


[attachment=0]postgres.zip[/attachment]
#2
Hi all,



It is a patch that can get a POST Parameter for function CGI:get.



it works this form.

<form action="/cgi-bin/post-data.cgi" method="POST" enctype="multipart/form-data">
<input type="checkbox" name="checkbox1" value="val1"/>val1<br/>
<input type="checkbox" name="checkbox1" value="val2"/>val2<br/>
<input type="checkbox" name="checkbox1" value="val3" checked/>val3<br/>

<input type="text" name="text1" size="30" maxlength="30" value="text sample">

<textarea name="textarea1" cols=40 rows=4>
abc
def
0123456789
</textarea>

<input type="submit" value="send"/>



(println CGI:params) ;; context parameter(for debug)

(println "checkbox1=" (CGI:get "checkbox1") "<br/>")
(println "text1=" (CGI:get "text1")  "<br/>")
(println "textarea1=" (CGI:get "textarea1")  "<br/>")


Result

params (("textarea1" "abcrndefrn0123456789rn") ("text1" "text sample") ("checkbox1" "val3") ("checkbox1" "val2"))

checkbox1=val3
text1=text sample
textarea1=abc def 0123456789


TEXTAREA returns multi-line string, line separator is "rn", see Result "textarea1".



thanks,


[attachment=0]new-cgi-module.zip[/attachment]
#3
Hello,



Japanese (or CJK) may be environmental issues, UT8 version had problems with the execution.



1. executable (module link.lsp made from) will not run correctly from the Japanese path. Failure to read encrypted lisp code from self-execution file.

--> patch - self exeutable-filepath-name UTF-8 on startup.



2. Command Parameters (argv) is still MBCS. problem with main-args function as reference. Or some code to create and process, UTF8 must convert.

   (main-args returns Character is MBCS)

--> changed main-args returns UTF8 string list on startup.



attached diff-file and the chaned file (protos.h, newlisp.c, win32-path.c).

base file is newlisp-10.3.0.



thanks,
#4
newLISP Graphics & Sound / TextTableWidget - JTable base
September 21, 2010, 01:24:06 AM
Hello all,

I tried to add features TextTableWidget based JTable.

(cell value is string only!)

;;; text-table function in text-table-demo.lsp did not change guiserver.lsp.

(gs:text-table ID action ["ColumnName 1" ...])
(gs:text-table ID row column "value")
(gs:text-table-get-cell ID row col)
(gs:text-table-get ID)
(gs:text-table-add-row ID [ColumnValue 1] [ColumnValue 2] ...)
(gs:text-table-add-column ID [Column Name 1] ...)
(gs:text-table-set-row-number ID boolean)
(gs:text-table-set-column ID ColumnNumber Width Justification)

replace java files and run make in guiserver directory, copy guiserver.jar c:Program Filesnewlisp.

It made on newlisp-10.2.13(working 10.2.15). other version need  change Dispatcher.java.



Please tell me if you have suggestions for implementation or function.



Thank you,
#5
Hello,



Java(guiserver.jar) need start option "-Dfile.encoding=UTF8".



I tried add setProperty() in guiserver(main), but NOT WORK.(Java BUG?)


System.setProperty("file.encoding", "UTF8") and "UTF-8"

Added java start option. the changed work font-name demo.



---- guiserver.lsp changed ----
(define (init (portIn 47011) (host "127.0.0.1") manual)
        ; check for server portIn and if this was started by java
        (if (main-args 2) (set 'portIn (int (main-args 2) portIn)))
        ; if guiserver.jar did not start this process then guiserver.jar
        ; still has to be started, except when manual parameter is true
        (if (and (not (= (main-args 3) "javastart")) (not manual))
                (if (= ostype "Win32")
                        ;(process (string "cmd /c " server-path " " portIn))
                        (process (string "javaw.exe -Dfile.encoding=UTF8 -jar " server-path " " portIn))

                        (= ostype "OSX")
                        ;(process (string "/usr/bin/java -jar " server-path " " portIn))
                        (process (string "/usr/bin/java -Dfile.encoding=UTF8 -jar " server-path " " portIn))

                        (env "JAVA_HOME")
                        ;(process (string (env "JAVA_HOME") "/bin/java -jar " server-path " " portIn))
                        (process (string (env "JAVA_HOME") "/bin/java -Dfile.encoding=UTF8 -jar " server-path " " portIn))

                        ;(process (string "/usr/bin/java -jar " server-path " " portIn))
                        (process (string "/usr/bin/java -Dfile.encoding=UTF8 -jar " server-path " " portIn))

                )
        )
   ....

   ....
----


thanks,
#6
Hello All,



gs: key-event, gs-set-text when you use a password because you have to build on a string, you may get a little annoying.



JPasswordField using the text-field guiserver tried changing features.



Thanks,



---- Ex 1 ----

(gs:text-field 'PassField 16)

(gs:set-echo-char 'PassField "*")



---- Ex 2 ----

(gs:text-field 'PassField 16 "*")



---- Clear Text ----

(gs:unset-echo-char 'PassField)
#7
Because a tag of utf8(utf8 version newlisp) was not made in xml-parse, I made a patch.



pathed newlisp work in this for the time being.



But please teach it because this revision method does not understand whether it is a right method for newlisp.



(translated by http://honyaku.yahoo.co.jp/transtext">http://honyaku.yahoo.co.jp/transtext)



---- example.xml ----
<?xml version="1.0" ?>
<DATABASE name="example.xml">
<!--This is a database of fruits-->
    <果物>
        <名前>リンゴ - apple</名前>
        <色>赤 - red</色>
        <価格>0.80</価格>
    </果物>

    <果物>
        <名前>オレンジ - orange</名前>
        <色>オレンジ - orange</色>
        <価格>1.00</価格>
    </果物>

    <果物>
       <名前>バナナ - banana</名前>
       <色>黄色 - yellow</色>
       <価格>0.60</価格>
    </果物>
</DATABASE>
---- example.xml ----

---- after patched ----
(first (xml-parse (read-file "example.xml") (+ 1 2)))
("ELEMENT" "DATABASE" (("name" "example.xml")) (("COMMENT" "This is a database of fruits")
  ("ELEMENT" "果物FRUIT" (("ELEMENT" "名前" (("TEXT" "リンゴ - apple"))) (
     "ELEMENT" "色"
     (("TEXT" "赤 - red")))
    ("ELEMENT" "価格" (("TEXT" "0.80")))))
  ("ELEMENT" "果物FRUIT" (("ELEMENT" "名前" (("TEXT" "オレンジ - orange")))
    ("ELEMENT" "色" (("TEXT" "オレンジ - orange")))
    ("ELEMENT" "価格" (("TEXT" "1.00")))))
  ("ELEMENT" "果物FRUIT" (("ELEMENT" "名前" (("TEXT" "バナナ - banana")))
    ("ELEMENT" "色" (("TEXT" "黄色 - yellow")))
    ("ELEMENT" "価格" (("TEXT" "0.60")))))))
---- after patched ----


$ diff -crN nl-xml.c.org nl-xml.c
*** nl-xml.c.org        Mon Nov 23 02:45:16 2009
--- nl-xml.c    Fri Feb 26 16:59:46 2010
***************
*** 441,451 ****
 
  ++source; /* skip '/' */
 
! while(*source <= ' ' && source < endSrc) ++source; /* skip whitespace */
 
  tagStart = source;
  tagLen = 0;
! while(*source > ' ' && source < endSrc) ++source, ++tagLen; /* find tag end */
 
  attributes = parseAttributes(endSrc);
  if(optionsFlag & OPTION_SXML_ATTRIBUTES)
--- 441,451 ----
 
  ++source; /* skip '/' */
 
! while((unsigned char)*source <= ' ' && source < endSrc) ++source; /* skip whitespace */
 
  tagStart = source;
  tagLen = 0;
! while((unsigned char)*source > ' ' && source < endSrc) ++source, ++tagLen; /* find tag end */
 
  attributes = parseAttributes(endSrc);
  if(optionsFlag & OPTION_SXML_ATTRIBUTES)
***************
*** 519,530 ****
 
  while(!xmlError && source < endSrc)
        {
!       while(*source <= ' ' && source < endSrc) source++; /* strip leading space */
        namePos = source;
        nameLen = 0;
!       while(*source > ' ' && *source != '=' && source < endSrc) source++, nameLen++; /* get end */
        if(nameLen == 0) break;
!       while(*source <= ' ' && source < endSrc) source++; /* strip leading space */
        if(*source != '=')
                {
                xmlError = "expected '=' in attributes";
--- 519,530 ----
 
  while(!xmlError && source < endSrc)
        {
!       while((unsigned char)*source <= ' ' && source < endSrc) source++; /* strip leading space */
        namePos = source;
        nameLen = 0;
!       while((unsigned char)*source > ' ' && *source != '=' && source < endSrc) source++, nameLen++; /* get end */
        if(nameLen == 0) break;
!       while((unsigned char)*source <= ' ' && source < endSrc) source++; /* strip leading space */
        if(*source != '=')
                {
                xmlError = "expected '=' in attributes";
***************
*** 532,538 ****
                return nilCell;
                }
        else source++;
!       while(*source <= ' ' && source < endSrc) source++; /* strip spaces */
        if(*source != '"' && *source != ''')
                {
                xmlError = "attribute values must be delimited by " or ' ";
--- 532,538 ----
                return nilCell;
                }
        else source++;
!       while((unsigned char)*source <= ' ' && source < endSrc) source++; /* strip spaces */
        if(*source != '"' && *source != ''')
                {
                xmlError = "attribute values must be delimited by " or ' ";