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

#16
newLISP in the real world /
September 18, 2007, 12:36:09 PM
Hmmmm..  It looks like WindowServer is started by mach_init way before any global shell stuff is executed.  Just check to make sure your custom wrapper hasn't been nuked after a software upgrade.



So does OS X distribute your forked procs over all the processors?  :-)
#17
newLISP in the real world /
September 18, 2007, 12:11:01 PM
You can stick the command ulimit -u 256 (or whatever number) in bashrc (or lower) and then all user privilege level shells and child processes will inherit that limit for the lifetime of the process.
#18
newLISP in the real world /
September 18, 2007, 11:50:28 AM
There are a number of subsystems that have configurable settings at startup.  You can run the command sysctl -a to see all of them.



Everything is called from the /etc/rc file and it is usually a good idea to place your custom changes in the appropriate file called by rc such as (in this instance) sysctl.conf rather than editing rc as it is one of those files that may be overwritten by Apple during a software update.
#19
newLISP in the real world /
September 18, 2007, 10:35:52 AM
The default number of procs per user session in OS X is 100.  There is a configuration parameter maxprocperuid in a .conf file over in /etc (i forget which) that you can set to override this limit.
#20
newLISP in the real world /
September 18, 2007, 10:08:15 AM
Why do you find it necessary to use a macro for this?
#21
Anything else we might add? /
August 24, 2007, 09:23:09 AM
The SATA drive should not be a factor either as War and Peace will easily fit into RAM.



I know you are thrilled as all get out by your toy, but frankly I'm not impressed.  Given the current state of OSX and the available compilers, using a quad core for anything but a server seems pretty silly to me.  



Here is a processor that shows evidence of some real engineering talent - i.e. 1 watt @ 500 mhz:



http://www.linuxdevices.com/news/NS2399097703.html">//http://www.linuxdevices.com/news/NS2399097703.html



But then again, I liked the Mac Cube and prefer the Prius to the MurciƩlago.
#22
Anything else we might add? /
August 24, 2007, 08:05:57 AM
Quote from: "Jeff" Interestingly enough, it takes about the same amount of time (assuming we are still talking about war and peace) on a quad-core g5.


That's because it is only using one processor.
#23
Anything else we might add? /
August 15, 2007, 09:22:30 AM
Quote from: "Jeff"Is there no way to iterate quickly over the chars in a string?  What is newLisp's internal representation of a string like?


Strings and text appear as contiguous areas of memory in newLISP.  Fastest iteration I've found while staying in newLISP is to index into them from the base address:



(time (setq buf (dup "00" 3000000)))

(time (for (x 0 (- (length buf) 1)) (get-char (+ (address buf) x))))

#24
newLISP newS /
July 20, 2007, 04:40:36 PM
Don't let that computer just sit there.  Generate some cpu cycles!


> (map eval (transpose (append (transpose (dup (list (sym (char 42)) 2) 10)) (list (rest (index string? (explode "C++  sucks!")))))))

(2 4 6 8 10 12 14 16 18 20)

---
#25
newLISP newS / Re: Loop that collects results?
July 19, 2007, 02:20:41 AM
> (rest (filter (lambda (x) (= (% x 2)0)) (sort (unique (rand 21 210)))))

(2 4 6 8 10 12 14 16 18 20)

---
#26
newLISP newS /
July 19, 2007, 02:14:14 AM
Quote from: "Jeff"int main
{
    int seq[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
    int result[10];
    int i;
    for (i = 0; i < 10; i++)
    {
        result[i] = seq[i] * 2;
    }
    return 0;
}


I think I see what you mean!



---
#27
newLISP newS /
July 16, 2007, 02:08:31 PM
Unfortunately Java 1.5 is not compatible with versions of OSX earlier than 10.4.5.  After further research I find that there are two main approaches for compiling 1.4 compatible Java apps.



1) Use 1.5 (or 1.6!) javac compiler with the earlier -target and -source options.



or



2) Use the 1.4 javac compiler which you should still have in your /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Commands

directory unless you explicitly deleted it.  I find that my Mac has three previous versions of Java going back to 1.2.  The javac, java etc... programs in /usr/bin are sym linked to the latest version (in my case that would be 1.4.2_12.



Apple has some documentaion about this here:



http://developer.apple.com/documentation/Java/Conceptual/Java14Development/index.html">//http://developer.apple.com/documentation/Java/Conceptual/Java14Development/index.html



The downside to approach 1 from what I can gather is that javac 1.5 will still compile certain 1.5 constructs/syntax that you may have in your application specific source code even when the -source and -target options for javac 1.5 are 1.4 libraries.  This could still lead to run time errors.  An example of this problem I have seen referred to is the different implementation of the enum keyword in 1.5 versus 1.4.  



However, the Java spec supposedly guarantees that apps compiled under previous versions should be upwardly runtime compatible with newer JVM's.  So if guiserver.jar is built with javac 1.4 (assuming that you don't use new 1.5 methods and classes) it should execute correctly when invoked by java 1.5.



At any rate, if guiserver.jar compiles and runs under Java 1.4.2 on Windows, it should compile and run under Java 1.4.2 on the Mac as long as it is pointed at the right framework should it not?

.
#28
newLISP newS /
July 16, 2007, 12:32:36 PM
This version still doesn't work with Java 1.4.2 on the Mac.
#29
After putting guiserver.lsp and guiserver.jar in /usr/share/newlisp I get the following error message when trying to run either guiserver.jar from the command line or when trying to run button-demo.lsp from the command line or inside of newLISP:



jrh$ ./button-demo.lsp
Exception in thread "main" java.lang.UnsupportedClassVersionError: guiserver (Unsupported major.minor version 49.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)


Other Java apps run fine.  I have newLISP 9.1, GUI-server 0.995, and my Java version is:
jrh$ java -version
java version "1.4.2_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_12-270)
Java HotSpot(TM) Client VM (build 1.4.2-70, mixed mode)


If there are any Java jockeys out there who could help me with this problem I would appreciate any advice you might have.
#30
Whither newLISP? /
July 14, 2007, 09:52:51 AM
OK, I see your point.  After considering it it also makes sense to me because I often build the sym name I use for a context "object" dynamically so  breaking it down in two steps has a certain symmetry.