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 - m35

#1
Anything else we might add? / Re: Hi! And Some Questions
November 22, 2011, 07:52:26 PM
Quote from: "kismert"1. I was interested in the Windows DLL, but it seems that you can only 'shell out' to newLISP. I was hoping for COM Automation, and while I found mention of it in the forum, I couldn't find anything current in the Modules section. What is the state of COM support in newLISP?


By "COM support in newLISP", do you mean newLISP's ability to work with COM objects, or being able to utilize the newLISP interpreter as a COM object(s)?
#2
This is a great clarification. Hopefully it encourages the spread of newLISP. :D
#3
Thanks for updating this!
#4
Design, create, and release a game before 30 July 2010 using any dialect of Lisp.



(multi-platform release is encouraged, but not required)



http://dto.github.com/notebook/2010expo.html">http://dto.github.com/notebook/2010expo.html
#5
Quote from: "axtens"
It seems a little weird to me doing the slice on the reverse of the bits but I couldn't find any bit_and functionality anywhere (quickly).

In case you haven't stumbled across them yet, http://www.newlisp.org/downloads/newlisp_manual.html#bit_operators">here are the bit operators.
#6
Quote from: "axtens"Wow, cool code!


QuoteIs there a reason you can't use the built in file-info function?


Perhaps I'm not seeing something that's right in front of me, but the manual doesn't say anything about returning the 'archive bit' status when using file-info.

Oh ok, then you're right to use the Win32 api to get that platform specific attribute.



Playing around with unicode on Windows can be tricky. Wish I could direct you to a good comprehensive source of info about how to deal with it, but I've never seen comprehensive info like that (had to figure it out on my own). Maybe http://newlispfanclub.alh.net/forum/viewtopic.php?f=9&t=1694">this thread I wrote years ago might also help a bit (the functionality described has since been integrated directly into newLISP, thus making it obsolete--but it's a nice reference).
#7
Is there a reason you can't use the built in file-info function?



If you have to use the GetFileAttributes function with unicode file names, you can use the UTF-8 version of newLISP, along with this function to convert the UTF-8 paths to UTF-16 which can then be passed to GetFileAttributesW.



(constant 'SIZEOF_WCHAR 2) ; assumption

(define (utf8->16 lpMultiByteStr , cchWideChar lpWideCharStr ret)

    ; calculate the size of buffer (in WCHAR's)
    (setq cchWideChar (MultiByteToWideChar
        CP_UTF8 ; from UTF-8
        0       ; no flags necessary
        lpMultiByteStr
        -1      ; convert until NULL is encountered
        0
        0
    ))
   
    ; allocate the buffer
    (setq lpWideCharStr (dup " " (* cchWideChar SIZEOF_WCHAR)))
   
    ; convert
    (setq ret (MultiByteToWideChar
        CP_UTF8 ; from UTF-8
        0       ; no flags necessary
        lpMultiByteStr
        -1      ; convert until NULL is encountered
        lpWideCharStr
        cchWideChar
    ))
    (if (> ret 0) lpWideCharStr nil)
)
#8
Thanks Cyril! It took me many years before I finally understood how to make a 'real' win32 application. Hopefully this will help others understand quicker than I did ;)
#9
Ultraedit seems to be a very popular editor. For kicks I tried to recreate Ultraedit in jEdit using my http://newlispfanclub.alh.net/forum/viewtopic.php?f=2&t=2552">newLISP mode and BufferTabs, ConfigurableFoldHandler (fixed beta version), and Whitespace plugins ;)



http://sites.google.com/site/erictheturtlefiles/jedit-like-ultraedit.png">
#10
May 15, 2010 version, page 20
QuoteThe カネ|box Engine requires every module to function properly, is it passes complex, (often)

encrypted information between modules

p26
QuoteCreating a new Training Set is requires a set of gathered traffic
#11
I coincidentally happen to be struggling with rounding issues at the same time as http://newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=3611">this topic pops up. I don't want to hijack that thread any further, plus my issue is a little different, so thus this thread.



I'm trying to write a generic algorithm for integer-only (no floating-point involved) division that includes rounding (rounding 0.5 away from zero) and avoids overflow. The function should basically work like this floating-point equivalent.
(define (int-div-round1 i1 i2)
  (round (div i1 i2))
)

I know that the typical solution is to add half the divisor to the numerator
(define (int-div-round2 i1 i2)
  (setq half2 (/ i2 2))
  (/ (+ i1 half2) i2)
)

Of course this version has two major problems:

(1) only accurate when i1 and i2 have the same sign (i.e. both positive or both negative)

(2) can overflow



#1 isn't too difficult to fix, but I haven't found an approach that avoid #2. All my brainstorming, trial-and-errors, and Googling have failed me.



Maybe a clever newLISPer has some thoughts?
#12
I have the newLISP web server locally serving up custom RSS feeds generated by a little newLISP cgi script. Of course having the newLISP server console window lingering on screen isn't very nice, so I found an easy fix. Add this to the httpd-conf.lsp script, and your newLISP web server console window will happily run in the background.
(import "kernel32.dll" "GetConsoleWindow")
(import "user32.dll" "ShowWindow")
(constant 'SW_HIDE 0)
(constant 'SW_SHOW 5)

(setq hwndConsole (GetConsoleWindow))
(if-not (zero? hwndConsole)
    (ShowWindow hwndConsole SW_HIDE)
)
#13
newLISP in the real world / Re: pcre instructions
April 01, 2010, 10:05:52 AM
Wow, it seems like we've been having a lot more newcomers to the forums these days. Awesome :D



Thanks for the observation John. Just searching through the current online manual for 'PCRE', I didn't notice any version number mentioned. I agree it might be worthwhile to include some added clarification on that point.
#14
I've been using newLISP for years now and I still forget about this behavior ^_^
#15
search
QuoteIf int-options is mot specified