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

Messages - unya

#1
Thank you Lutz,



I appreciate your advice, grateful for taking the time.



Have a nice weekend.
#2
Hello Lutz,



new PgSQL:query function - extended with parameter, and compatible.



;; Example execute
(PgSQL:query "select $1||$2" "abc" "def")
(PgSQL:fetch-all) ; -> (("abcdef"))

(PgSQL:query "select $1 + $2" 10 20)
(PgSQL:fetch-all) ; -> (("30"))

(PgSQL:query "select $1::timestamp + $2::interval" "2012-10-01 00:00:00" "123456 seconds")
(PgSQL:fetch-all) ; -> (("2012-10-02 10:17:36"))

(PgSQL:query "create table tbl (a integer, b integer)")
(dotimes (i 10) (PgSQL:query "insert into tbl values ($1, $2)" i (* i 2)))
;    a | b
;   ---+----
;    0 |  0
;    1 |  2
;    2 |  4
;    ...
;    9 | 18

(PgSQL:query "select * from tbl where a=$1 or a=$2" 2 9)
(PgSQL:fetch-all) ; -> (("2" "4") ("9" "18"))


Thanks,


[attachment=0]postgres-newquery.zip[/attachment]
#3
Thanks Lutz,



Thank you for adding, I took a look at the changes.



I think about the query and I wish I could propose Parameterized query function.
#4
Hi,



add more useful function PgSQL:fnumber added, with extend PgSQL:fetch-value.



PgSQL:fnumber - returns column number.

PgSQL:fetch-value - column number or column name.





"create table test (key integer, value text)"

 key | value

-----+-------

   1 | xx

   2 | yy



(PgSQL:query "SELECT * FROM test")





;; all cases returns "xx".

(PgSQL:fetch-value 0 1)
(PgSQL:fetch-value 0 (PgSQL:fnumber "value"))
(PgSQL:fetch-value 0 "value")


thanks.


[attachment=0]postgres.zip[/attachment]
#5
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]
#6
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]
#7
Thank you, Lutz.



"MBSC" is typo in CHANGES-10.3.1.txt, it's "MBCS".



Regards,
#8
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,
#9
Hello Lutz,



Windows Japanese Code Page is "MS932".



wrong code page in "newLISP-10.3-Release.html" -> "Bug fixes" -> "...Japanese language characters from Windows Code Page MS392 ....".



I noticed this time,too late sorry.



Thanks,
#10
Thank you Lutz,



it's nice.
#11
Thank you Lutz,



It was good that I can contribute a little.
#12
A similar problem occurred in my environment.



many java files are changed, because Asynchronous Java Listener action-handler event was to obtain data for the abnormal situation that had been run more than one.

Add a socket and asynchronous events run to solve the problem, I tried to separate the events to run simultaneously.



gs:listen - run only async event, Java Listener (key, mouse listener) send.

gs:check-event - function return



thanks,
#13
Thanks Lutz, for interest.



I modified code, and add function spec. (may be spec information is poor, sorry)
#14
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,
#15
thank you Lutz and Johu.