Re: RFR 8003421: NPG: Move oops out of InstanceKlass into mirror

2013-05-21 Thread Stefan Karlsson

Hi Coleen,

Good to see all these oops moving to the mirrors. I think the changes 
look good. I let someone else review the SA changes


Some comments below:

On 05/21/2013 12:39 AM, Coleen Phillimore wrote:
Summary: Inject protection_domain, signers, init_lock into 
java_lang_Class


Net footprint change is zero except that these fields are in Java heap 
rather than metaspace.


There should be some memory saved since we now use compressed oops for 
the embedded fields.


This helps a little with InstanceKlass size which is in fixed size 
space with UseCompressedKlassPointers. Included serviceability because 
there were SA changes to code that I don't know is used.


Future work is to remove the signers field and the unused 
SetProtectionDomain function.


open webrev at http://cr.openjdk.java.net/~coleenp/8003421/
bug link at http://bugs.sun.com/view_bug.do?bug_id=8003421


http://cr.openjdk.java.net/~coleenp/8003421/src/share/vm/oops/instanceKlass.hpp.patch

   // protection domain
-  oop protection_domain()  { return _protection_domain; }
-  void set_protection_domain(oop pd)   { 
klass_oop_store(_protection_domain, pd); }
+  oop protection_domain() const;
+  void set_protection_domain(Handle pd);
...
   // signers
-  objArrayOop signers() const  { return _signers; }
-  void set_signers(objArrayOop s)  { klass_oop_store((oop*)_signers, 
s); }
+  objArrayOop signers() const;
+  void set_signers(objArrayOop s);

You don't really need the setters on the InstanceKlass anymore. They are 
only used in jvm.cpp where they take a couple of unnecessary 
indirections: mirror - IK - mirror-set_protection_domain/set_signers.


http://cr.openjdk.java.net/~coleenp/8003421/src/share/vm/oops/arrayKlass.cpp.udiff.html

-  java_lang_Class::create_mirror(k, CHECK);
+  java_lang_Class::create_mirror(k, Handle(NULL), CHECK);

You use NULL here since typeArrays always return a NULL pd, and 
objArrays always returns the pd of the bottom klass?


http://cr.openjdk.java.net/~coleenp/8003421/src/share/vm/oops/instanceKlass.cpp.patch

-void InstanceKlass::oops_do(OopClosure* cl) {
-  Klass::oops_do(cl);
-
-  cl-do_oop(adr_protection_domain());
-  cl-do_oop(adr_signers());
-  cl-do_oop(adr_init_lock());
-
-  // Don't walk the arrays since they are walked from the ClassLoaderData 
objects.
-}

If we could move ArrayKlass::_component_mirror into the j.l.Class, then 
_java_mirror would be the only oop in the klasses and we could make 
Klass::oops_do non-virtual ...


Another thing. If we could direct-allocate the java mirrors in the old 
gen, then we wouldn't have to walk all the klasses during the young GCs. 
This would make the GCs a bit less complicated and we could get rid of 
these fields in Klass:


  // Remembered sets support for the oops in the klasses.
  jbyte _modified_oops; // Card Table Equivalent (YC/CMS 
support)

  jbyte _accumulated_modified_oops; // Mod Union Equivalent (CMS support)

thanks,
StefanK



Tested with vm.quick.testlist, JPRT, jtreg java/security tests and 
jck8 tests.


Thanks,
Coleen




Re: RFR 8003421: NPG: Move oops out of InstanceKlass into mirror

2013-05-21 Thread Stefan Karlsson

On 21 maj 2013, at 16:12, Coleen Phillimore coleen.phillim...@oracle.com 
wrote:

 
 On 05/21/2013 05:11 AM, Stefan Karlsson wrote:
 Hi Coleen,
 
 Good to see all these oops moving to the mirrors. I think the changes look 
 good. I let someone else review the SA changes
 
 Yes, I'm hoping for someone to review the SA changes.
 
 Some comments below:
 
 On 05/21/2013 12:39 AM, Coleen Phillimore wrote:
 Summary: Inject protection_domain, signers, init_lock into java_lang_Class
 
 Net footprint change is zero except that these fields are in Java heap 
 rather than metaspace.
 
 There should be some memory saved since we now use compressed oops for the 
 embedded fields.
 
 That's right.
 
 This helps a little with InstanceKlass size which is in fixed size space 
 with UseCompressedKlassPointers. Included serviceability because there were 
 SA changes to code that I don't know is used.
 
 Future work is to remove the signers field and the unused 
 SetProtectionDomain function.
 
 open webrev at http://cr.openjdk.java.net/~coleenp/8003421/
 bug link at http://bugs.sun.com/view_bug.do?bug_id=8003421
 
 http://cr.openjdk.java.net/~coleenp/8003421/src/share/vm/oops/instanceKlass.hpp.patch
  
 
   // protection domain
 -  oop protection_domain()  { return _protection_domain; }
 -  void set_protection_domain(oop pd)   { 
 klass_oop_store(_protection_domain, pd); }
 +  oop protection_domain() const;
 +  void set_protection_domain(Handle pd);
 ...
   // signers
 -  objArrayOop signers() const  { return _signers; }
 -  void set_signers(objArrayOop s)  { 
 klass_oop_store((oop*)_signers, s); }
 +  objArrayOop signers() const;
 +  void set_signers(objArrayOop s);
 
 You don't really need the setters on the InstanceKlass anymore. They are 
 only used in jvm.cpp where they take a couple of unnecessary indirections: 
 mirror - IK - mirror-set_protection_domain/set_signers.
 
 I left these accessor functions in with a comment that JVMTI spec defined 
 these fields in InstanceKlass and we have to simulate that they are still 
 there for compatibility.

Where in the spec does it mention InstanceKlasses?

I still see no reason to keep the setters.

 
 http://cr.openjdk.java.net/~coleenp/8003421/src/share/vm/oops/arrayKlass.cpp.udiff.html
  
 
 -  java_lang_Class::create_mirror(k, CHECK);
 +  java_lang_Class::create_mirror(k, Handle(NULL), CHECK);
 
 You use NULL here since typeArrays always return a NULL pd, and objArrays 
 always returns the pd of the bottom klass?
 
 Yes.
 http://cr.openjdk.java.net/~coleenp/8003421/src/share/vm/oops/instanceKlass.cpp.patch
  
 
 -void InstanceKlass::oops_do(OopClosure* cl) {
 -  Klass::oops_do(cl);
 -
 -  cl-do_oop(adr_protection_domain());
 -  cl-do_oop(adr_signers());
 -  cl-do_oop(adr_init_lock());
 -
 -  // Don't walk the arrays since they are walked from the ClassLoaderData 
 objects.
 -}
 
 If we could move ArrayKlass::_component_mirror into the j.l.Class, then 
 _java_mirror would be the only oop in the klasses and we could make 
 Klass::oops_do non-virtual ...
 
 That would add a field to all mirrors though.

Unless we reuse the pd field, which isn't used for the arrays. But that's a 
hack.

  It's a bit harder but it would be nice to have smaller mirrors for array 
 klasses vs. instanceKlasses.

The size of the mirrors are already of variable size, because of the static 
fields, so this would probably be a good idea. Something for the Embedded team 
to pursue maybe?

 
 
 Another thing. If we could direct-allocate the java mirrors in the old gen, 
 then we wouldn't have to walk all the klasses during the young GCs. This 
 would make the GCs a bit less complicated and we could get rid of these 
 fields in Klass:
 
  // Remembered sets support for the oops in the klasses.
  jbyte _modified_oops; // Card Table Equivalent (YC/CMS support)
  jbyte _accumulated_modified_oops; // Mod Union Equivalent (CMS support)
 
 Yes, we want to move in this direction!  Not with this change though.

Of course. I'm fine with your current changes as they are.

StefanK

 
 Coleen
 thanks,
 StefanK
 
 
 Tested with vm.quick.testlist, JPRT, jtreg java/security tests and jck8 
 tests.
 
 Thanks,
 Coleen
 


Re: RFR(XXS): 8008391: Incorrect metadata for event based tracing

2013-04-02 Thread Stefan Karlsson

Seems reasonable.

StefanK

On 03/25/2013 10:17 PM, Erik Gahlin wrote:

Hi,

Could you please review these small metadata changes for the event 
tracing framework:


- Promotion Failed - objectCount has the datatype BYTES64, which 
implies that it is a size. It is not, and the type should be an 
unsigned long.


- Thread Park, Java Monitor Enter and Java Monitor wait should have 
relational ids, so it's possible to see that the information is 
related (java/monitor/address)


- The field caller in ExecuteVMOperation should not have a TO field 
but a FROM field, indicating from which thread the transition came 
from.


The reason the review for 8007150 is handled seperately is because it 
modifies the structure of the data,  while these changes are strictly 
cosmetical.


http://cr.openjdk.java.net/~egahlin/8008391_1/

Thanks
Erik




Re: RFR(XXS): 8007150 Event based tracing is missing truncated field in stack trace content type

2013-04-02 Thread Stefan Karlsson

Looks good.

StefanK

On 03/25/2013 09:13 PM, Erik Gahlin wrote:

Hi,

Could you please review this small change to the metadata for 
StackTrace content type, used by the event tracing framework. A 
boolean flag has been added so it's possible to see if a stack trace 
has been truncated (not all frames included).


http://cr.openjdk.java.net/~egahlin/8007150_1/

The fix is targeted for hs24.

Thanks
Erik




hg: jdk8/tl/jdk: 8009427: Re-enable tests that were disable to ease complicated push

2013-03-27 Thread stefan . karlsson
Changeset: caafe6dca35d
Author:ehelin
Date:  2013-03-21 20:35 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/caafe6dca35d

8009427: Re-enable tests that were disable to ease complicated push
Reviewed-by: sla, mchung, dcubed
Contributed-by: Erik Helin erik.he...@oracle.com

! test/ProblemList.txt



hg: jdk8/tl/jdk: 2 new changesets

2013-03-25 Thread stefan . karlsson
Changeset: 470232a8e89d
Author:stefank
Date:  2013-03-22 15:01 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/470232a8e89d

8005116: NPG: Rename -permstat option for jmap in jdk8 to -clstats
Reviewed-by: jmasa, sla
Contributed-by: Erik Helin erik.he...@oracle.com

! src/share/classes/sun/tools/jmap/JMap.java

Changeset: 518d6087e01f
Author:stefank
Date:  2013-03-22 15:01 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/518d6087e01f

8004172: Update jstat counter names to reflect metaspace changes
Reviewed-by: mchung
Contributed-by: Erik Helin erik.he...@oracle.com

! src/share/classes/sun/tools/jstat/resources/jstat_options
! test/sun/tools/jstat/gcCapacityOutput1.awk
! test/sun/tools/jstat/gcCauseOutput1.awk
+ test/sun/tools/jstat/gcMetaCapacityOutput1.awk
! test/sun/tools/jstat/gcOldOutput1.awk
! test/sun/tools/jstat/gcOutput1.awk
- test/sun/tools/jstat/gcPermCapacityOutput1.awk
+ test/sun/tools/jstat/jstatGcMetaCapacityOutput1.sh
- test/sun/tools/jstat/jstatGcPermCapacityOutput1.sh
! test/sun/tools/jstat/lineCounts1.awk
! test/sun/tools/jstat/lineCounts2.awk
! test/sun/tools/jstat/lineCounts3.awk
! test/sun/tools/jstat/lineCounts4.awk
! test/sun/tools/jstat/options1.out
! test/sun/tools/jstat/options2.out
! test/sun/tools/jstat/timeStamp1.awk
! test/sun/tools/jstatd/jstatGcutilOutput1.awk



hg: jdk8/tl/jdk: 2 new changesets

2013-03-22 Thread stefan . karlsson
Changeset: 470232a8e89d
Author:stefank
Date:  2013-03-22 15:01 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/470232a8e89d

8005116: NPG: Rename -permstat option for jmap in jdk8 to -clstats
Reviewed-by: jmasa, sla
Contributed-by: Erik Helin erik.he...@oracle.com

! src/share/classes/sun/tools/jmap/JMap.java

Changeset: 518d6087e01f
Author:stefank
Date:  2013-03-22 15:01 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/518d6087e01f

8004172: Update jstat counter names to reflect metaspace changes
Reviewed-by: mchung
Contributed-by: Erik Helin erik.he...@oracle.com

! src/share/classes/sun/tools/jstat/resources/jstat_options
! test/sun/tools/jstat/gcCapacityOutput1.awk
! test/sun/tools/jstat/gcCauseOutput1.awk
+ test/sun/tools/jstat/gcMetaCapacityOutput1.awk
! test/sun/tools/jstat/gcOldOutput1.awk
! test/sun/tools/jstat/gcOutput1.awk
- test/sun/tools/jstat/gcPermCapacityOutput1.awk
+ test/sun/tools/jstat/jstatGcMetaCapacityOutput1.sh
- test/sun/tools/jstat/jstatGcPermCapacityOutput1.sh
! test/sun/tools/jstat/lineCounts1.awk
! test/sun/tools/jstat/lineCounts2.awk
! test/sun/tools/jstat/lineCounts3.awk
! test/sun/tools/jstat/lineCounts4.awk
! test/sun/tools/jstat/options1.out
! test/sun/tools/jstat/options2.out
! test/sun/tools/jstat/timeStamp1.awk
! test/sun/tools/jstatd/jstatGcutilOutput1.awk



hg: jdk8/tl/jdk: 2 new changesets

2013-03-22 Thread stefan . karlsson
Changeset: 470232a8e89d
Author:stefank
Date:  2013-03-22 15:01 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/470232a8e89d

8005116: NPG: Rename -permstat option for jmap in jdk8 to -clstats
Reviewed-by: jmasa, sla
Contributed-by: Erik Helin erik.he...@oracle.com

! src/share/classes/sun/tools/jmap/JMap.java

Changeset: 518d6087e01f
Author:stefank
Date:  2013-03-22 15:01 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/518d6087e01f

8004172: Update jstat counter names to reflect metaspace changes
Reviewed-by: mchung
Contributed-by: Erik Helin erik.he...@oracle.com

! src/share/classes/sun/tools/jstat/resources/jstat_options
! test/sun/tools/jstat/gcCapacityOutput1.awk
! test/sun/tools/jstat/gcCauseOutput1.awk
+ test/sun/tools/jstat/gcMetaCapacityOutput1.awk
! test/sun/tools/jstat/gcOldOutput1.awk
! test/sun/tools/jstat/gcOutput1.awk
- test/sun/tools/jstat/gcPermCapacityOutput1.awk
+ test/sun/tools/jstat/jstatGcMetaCapacityOutput1.sh
- test/sun/tools/jstat/jstatGcPermCapacityOutput1.sh
! test/sun/tools/jstat/lineCounts1.awk
! test/sun/tools/jstat/lineCounts2.awk
! test/sun/tools/jstat/lineCounts3.awk
! test/sun/tools/jstat/lineCounts4.awk
! test/sun/tools/jstat/options1.out
! test/sun/tools/jstat/options2.out
! test/sun/tools/jstat/timeStamp1.awk
! test/sun/tools/jstatd/jstatGcutilOutput1.awk



hg: jdk8/tl/jdk: 2 new changesets

2013-02-25 Thread stefan . karlsson
Changeset: c6d77b2b4478
Author:stefank
Date:  2013-01-22 13:53 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c6d77b2b4478

8006506: Add test for redefining methods in backtraces to java/lang/instrument 
tests
Reviewed-by: sspitsyn, coleenp

+ test/java/lang/instrument/RedefineMethodInBacktrace.sh
+ test/java/lang/instrument/RedefineMethodInBacktraceAgent.java
+ test/java/lang/instrument/RedefineMethodInBacktraceApp.java
+ test/java/lang/instrument/RedefineMethodInBacktraceTarget.java
+ test/java/lang/instrument/RedefineMethodInBacktraceTarget_2.java

Changeset: 0e93015e77f6
Author:stefank
Date:  2013-01-22 15:25 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0e93015e77f6

7140852: Add test for 7022100
Reviewed-by: sspitsyn, coleenp

+ test/java/lang/instrument/RedefineMethodWithAnnotations.sh
+ test/java/lang/instrument/RedefineMethodWithAnnotationsAgent.java
+ test/java/lang/instrument/RedefineMethodWithAnnotationsAnnotations.java
+ test/java/lang/instrument/RedefineMethodWithAnnotationsApp.java
+ test/java/lang/instrument/RedefineMethodWithAnnotationsTarget.java
+ test/java/lang/instrument/RedefineMethodWithAnnotationsTarget_2.java



hg: jdk8/tl/jdk: 2 new changesets

2013-02-22 Thread stefan . karlsson
Changeset: c6d77b2b4478
Author:stefank
Date:  2013-01-22 13:53 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c6d77b2b4478

8006506: Add test for redefining methods in backtraces to java/lang/instrument 
tests
Reviewed-by: sspitsyn, coleenp

+ test/java/lang/instrument/RedefineMethodInBacktrace.sh
+ test/java/lang/instrument/RedefineMethodInBacktraceAgent.java
+ test/java/lang/instrument/RedefineMethodInBacktraceApp.java
+ test/java/lang/instrument/RedefineMethodInBacktraceTarget.java
+ test/java/lang/instrument/RedefineMethodInBacktraceTarget_2.java

Changeset: 0e93015e77f6
Author:stefank
Date:  2013-01-22 15:25 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0e93015e77f6

7140852: Add test for 7022100
Reviewed-by: sspitsyn, coleenp

+ test/java/lang/instrument/RedefineMethodWithAnnotations.sh
+ test/java/lang/instrument/RedefineMethodWithAnnotationsAgent.java
+ test/java/lang/instrument/RedefineMethodWithAnnotationsAnnotations.java
+ test/java/lang/instrument/RedefineMethodWithAnnotationsApp.java
+ test/java/lang/instrument/RedefineMethodWithAnnotationsTarget.java
+ test/java/lang/instrument/RedefineMethodWithAnnotationsTarget_2.java



hg: jdk8/tl/jdk: 2 new changesets

2013-02-22 Thread stefan . karlsson
Changeset: c6d77b2b4478
Author:stefank
Date:  2013-01-22 13:53 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c6d77b2b4478

8006506: Add test for redefining methods in backtraces to java/lang/instrument 
tests
Reviewed-by: sspitsyn, coleenp

+ test/java/lang/instrument/RedefineMethodInBacktrace.sh
+ test/java/lang/instrument/RedefineMethodInBacktraceAgent.java
+ test/java/lang/instrument/RedefineMethodInBacktraceApp.java
+ test/java/lang/instrument/RedefineMethodInBacktraceTarget.java
+ test/java/lang/instrument/RedefineMethodInBacktraceTarget_2.java

Changeset: 0e93015e77f6
Author:stefank
Date:  2013-01-22 15:25 +0100
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0e93015e77f6

7140852: Add test for 7022100
Reviewed-by: sspitsyn, coleenp

+ test/java/lang/instrument/RedefineMethodWithAnnotations.sh
+ test/java/lang/instrument/RedefineMethodWithAnnotationsAgent.java
+ test/java/lang/instrument/RedefineMethodWithAnnotationsAnnotations.java
+ test/java/lang/instrument/RedefineMethodWithAnnotationsApp.java
+ test/java/lang/instrument/RedefineMethodWithAnnotationsTarget.java
+ test/java/lang/instrument/RedefineMethodWithAnnotationsTarget_2.java



Re: Review Request: 8006506: Add test for redefining methods in backtraces to java/lang/instrument tests

2013-02-01 Thread Stefan Karlsson

http://cr.openjdk.java.net/~stefank/8006506/webrev.03/

1) Reverted the ProblemList change, since the fix has already propagaged 
to jdk8/tl

2) Renamed do_redefine - doRedefine
3) Updated the .sh file with the bug number of the original CR instead 
of the test CR.


thanks,
StefanK

On 2013-01-22 14:11, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/8006506/webrev.00/

This test provokes the JVM crash described in bug: JDK-7174978.

I intend to push this to:
http://hg.openjdk.java.net/jdk8/tl/jdk

thanks,
StefanK






Re: Review Request: 7140852: Add test for 7022100

2013-02-01 Thread Stefan Karlsson

On 2013-02-01 09:50, serguei.spit...@oracle.com wrote:

Ship it.

Thanks!
StefanK



Thanks,
Serguei


On 1/31/13 11:50 PM, Stefan Karlsson wrote:

On 2013-02-01 00:15, Coleen Phillimore wrote:


Stefan,

I just read through this test and it looks like a good test to me 
(but I'm not an expert and it took a while to figure out how it 
worked).   I had two questions.  Why does the same definition for 
@interface ParameterAnnotation {} appear in both 
RedefineMethodWithAnnotationTarget*.java files?   Can't it be in 
it's own file and just once?  Or is it different (didn't see any 
differences).
I've moved it to its own file now and added the needed extra 
infrastructure to get test to work with that.




Also is do_redefine supposed to be doRedefine as per Java coding 
convention or is that a known variation?


Fixed. It was the name used in the test that I copied the code from.

http://cr.openjdk.java.net/~stefank/7140852/webrev.01/

thanks,
StefanK


Thanks,
Coleen

On 01/22/2013 09:39 AM, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/7140852/webrev.00/

This test provoked the bug in:
7022100: Method annotations are incorrectly set when redefining 
classes


thanks,
StefanK










Re: Review Request: 8006506: Add test for redefining methods in backtraces to java/lang/instrument tests

2013-02-01 Thread Stefan Karlsson

On 2013-02-01 10:22, serguei.spit...@oracle.com wrote:

Nice test!
It looks good.

Thanks for reviewing!


As the original bug and the test are non-trivial, it'd make sense to 
add a comment to
the class RedefineMethodInBacktraceApp and explain a little bit what 
the test is doing,

and what behavior is expected.

http://cr.openjdk.java.net/~stefank/8006506/webrev.04/

Tell me if you think this is good enough.

thanks,
StefanK



Thanks,
Sergueri


On 2/1/13 12:13 AM, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/8006506/webrev.03/

1) Reverted the ProblemList change, since the fix has already 
propagaged to jdk8/tl

2) Renamed do_redefine - doRedefine
3) Updated the .sh file with the bug number of the original CR 
instead of the test CR.


thanks,
StefanK

On 2013-01-22 14:11, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/8006506/webrev.00/

This test provokes the JVM crash described in bug: JDK-7174978.

I intend to push this to:
http://hg.openjdk.java.net/jdk8/tl/jdk

thanks,
StefanK










Re: Review Request: 8006506: Add test for redefining methods in backtraces to java/lang/instrument tests

2013-02-01 Thread Stefan Karlsson

On 2013-02-01 12:11, serguei.spit...@oracle.com wrote:

On 2/1/13 1:57 AM, Stefan Karlsson wrote:

On 2013-02-01 10:22, serguei.spit...@oracle.com wrote:

Nice test!
It looks good.

Thanks for reviewing!


As the original bug and the test are non-trivial, it'd make sense to 
add a comment to
the class RedefineMethodInBacktraceApp and explain a little bit what 
the test is doing,

and what behavior is expected.

http://cr.openjdk.java.net/~stefank/8006506/webrev.04/

Tell me if you think this is good enough.


It is good.

Nit: it'd be enough if it is more specific. :)
This method is a key point:
   90 private static void touchRedefinedMethodInBacktrace(Throwable 
throwable) {
   91 throwable.getStackTrace();
   92 }
Is it true that the test expects the getStackTrace() does not crash nor
throw an exception which would happen if the old/obsolete method is gc'ed?


I see. I'll add a comment that we shouldn't crash.

Thanks,
StefanK



Thanks,
Serguei




thanks,
StefanK



Thanks,
Sergueri


On 2/1/13 12:13 AM, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/8006506/webrev.03/

1) Reverted the ProblemList change, since the fix has already 
propagaged to jdk8/tl

2) Renamed do_redefine - doRedefine
3) Updated the .sh file with the bug number of the original CR 
instead of the test CR.


thanks,
StefanK

On 2013-01-22 14:11, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/8006506/webrev.00/

This test provokes the JVM crash described in bug: JDK-7174978.

I intend to push this to:
http://hg.openjdk.java.net/jdk8/tl/jdk

thanks,
StefanK














Re: Review Request: 8006506: Add test for redefining methods in backtraces to java/lang/instrument tests

2013-02-01 Thread Stefan Karlsson

On 2013-02-01 12:17, Stefan Karlsson wrote:

On 2013-02-01 12:11, serguei.spit...@oracle.com wrote:

On 2/1/13 1:57 AM, Stefan Karlsson wrote:

On 2013-02-01 10:22, serguei.spit...@oracle.com wrote:

Nice test!
It looks good.

Thanks for reviewing!


As the original bug and the test are non-trivial, it'd make sense 
to add a comment to
the class RedefineMethodInBacktraceApp and explain a little bit 
what the test is doing,

and what behavior is expected.

http://cr.openjdk.java.net/~stefank/8006506/webrev.04/

Tell me if you think this is good enough.


It is good.

Nit: it'd be enough if it is more specific. :)
This method is a key point:
   90 private static void touchRedefinedMethodInBacktrace(Throwable 
throwable) {
   91 throwable.getStackTrace();
   92 }
Is it true that the test expects the getStackTrace() does not crash nor
throw an exception which would happen if the old/obsolete method is 
gc'ed?


I see. I'll add a comment that we shouldn't crash.


http://cr.openjdk.java.net/~stefank/8006506/webrev.05/

StefanK



Thanks,
StefanK



Thanks,
Serguei




thanks,
StefanK



Thanks,
Sergueri


On 2/1/13 12:13 AM, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/8006506/webrev.03/

1) Reverted the ProblemList change, since the fix has already 
propagaged to jdk8/tl

2) Renamed do_redefine - doRedefine
3) Updated the .sh file with the bug number of the original CR 
instead of the test CR.


thanks,
StefanK

On 2013-01-22 14:11, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/8006506/webrev.00/

This test provokes the JVM crash described in bug: JDK-7174978.

I intend to push this to:
http://hg.openjdk.java.net/jdk8/tl/jdk

thanks,
StefanK
















Re: Review Request: 8006506: Add test for redefining methods in backtraces to java/lang/instrument tests

2013-02-01 Thread Stefan Karlsson

On 2013-02-01 12:48, David Holmes wrote:

Hi Stefan,

This part of the test:

  86 private static void doClassUnloading() {
  87 // This will clean out old, unused redefined methods.
  88 System.gc();
  89 }

seems to make assumptions about System.gc() and class unloading. Are 
we relying on knowledge of hotspot internals here?
Yes, we do. This is a regression test trying to provoke one very 
specific bug in HotSpot, so I figured that would be OK. I don't know any 
JVM agnostic way to do this.


I don't have a good suggestion to avoid this. This topic came up on 
another thread today regarding weak references. For that case we can 
typically add a loop and sleep until we see the reference clear, but 
here ... how can you check that class unloading occurred? Actually is 
that really what is happening - I don't see how any class unloading 
will occur here. I can imagine that GC might cleanup unreferenced 
methods.


I guess the name is not strictly correct, but we do the cleanup from the 
do_unloading code:

 ClassLoaderData::free_deallocate_list()
  ClassLoaderDataGraph::do_unloading
   SystemDictionary::do_unloading

StefanK



David

On 1/02/2013 9:27 PM, Stefan Karlsson wrote:

On 2013-02-01 12:17, Stefan Karlsson wrote:

On 2013-02-01 12:11, serguei.spit...@oracle.com wrote:

On 2/1/13 1:57 AM, Stefan Karlsson wrote:

On 2013-02-01 10:22, serguei.spit...@oracle.com wrote:

Nice test!
It looks good.

Thanks for reviewing!


As the original bug and the test are non-trivial, it'd make sense
to add a comment to
the class RedefineMethodInBacktraceApp and explain a little bit
what the test is doing,
and what behavior is expected.

http://cr.openjdk.java.net/~stefank/8006506/webrev.04/

Tell me if you think this is good enough.


It is good.

Nit: it'd be enough if it is more specific. :)
This method is a key point:
   90 private static void 
touchRedefinedMethodInBacktrace(Throwable throwable) {

   91 throwable.getStackTrace();
   92 }
Is it true that the test expects the getStackTrace() does not crash 
nor

throw an exception which would happen if the old/obsolete method is
gc'ed?


I see. I'll add a comment that we shouldn't crash.


http://cr.openjdk.java.net/~stefank/8006506/webrev.05/

StefanK



Thanks,
StefanK



Thanks,
Serguei




thanks,
StefanK



Thanks,
Sergueri


On 2/1/13 12:13 AM, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/8006506/webrev.03/

1) Reverted the ProblemList change, since the fix has already
propagaged to jdk8/tl
2) Renamed do_redefine - doRedefine
3) Updated the .sh file with the bug number of the original CR
instead of the test CR.

thanks,
StefanK

On 2013-01-22 14:11, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/8006506/webrev.00/

This test provokes the JVM crash described in bug: JDK-7174978.

I intend to push this to:
http://hg.openjdk.java.net/jdk8/tl/jdk

thanks,
StefanK


















Re: Review Request: 7140852: Add test for 7022100

2013-01-31 Thread Stefan Karlsson

On 2013-02-01 00:15, Coleen Phillimore wrote:


Stefan,

I just read through this test and it looks like a good test to me (but 
I'm not an expert and it took a while to figure out how it worked).   
I had two questions.  Why does the same definition for @interface 
ParameterAnnotation {} appear in both 
RedefineMethodWithAnnotationTarget*.java files?   Can't it be in it's 
own file and just once?  Or is it different (didn't see any differences).
I've moved it to its own file now and added the needed extra 
infrastructure to get test to work with that.




Also is do_redefine supposed to be doRedefine as per Java coding 
convention or is that a known variation?


Fixed. It was the name used in the test that I copied the code from.

http://cr.openjdk.java.net/~stefank/7140852/webrev.01/

thanks,
StefanK


Thanks,
Coleen

On 01/22/2013 09:39 AM, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/7140852/webrev.00/

This test provoked the bug in:
7022100: Method annotations are incorrectly set when redefining classes

thanks,
StefanK






Re: Review Request: 7140852: Add test for 7022100

2013-01-31 Thread Stefan Karlsson

On 2013-02-01 01:34, serguei.spit...@oracle.com wrote:

Stefan,

Looks good.
Agreed with Coleen: do_redefine = doRedefine.
I guess, this name was taken from one of old tests. :)
I'm Ok with two definitions of the interface ParameterAnnotation.


Thanks for the review,
StefanK


Thanks,
Setguei


On 1/31/13 3:15 PM, Coleen Phillimore wrote:


Stefan,

I just read through this test and it looks like a good test to me 
(but I'm not an expert and it took a while to figure out how it 
worked).   I had two questions.  Why does the same definition for 
@interface ParameterAnnotation {} appear in both 
RedefineMethodWithAnnotationTarget*.java files?   Can't it be in it's 
own file and just once?  Or is it different (didn't see any 
differences).


Also is do_redefine supposed to be doRedefine as per Java coding 
convention or is that a known variation?


Thanks,
Coleen

On 01/22/2013 09:39 AM, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/7140852/webrev.00/

This test provoked the bug in:
7022100: Method annotations are incorrectly set when redefining classes

thanks,
StefanK








Re: Review Request: 8006506: Add test for redefining methods in backtraces to java/lang/instrument tests

2013-01-28 Thread Stefan Karlsson

On 01/25/2013 04:40 PM, Coleen Phillimore wrote:


I think if you wait a week, you won't need to have it in the problem 
list.
This test passes with my backtrace changes which were pushed to 
hotspot-main this week.

The test looks great and was really helpful!


OK. I'll wait for your fix to propagate up to jdk8/tl.

thanks,
StefanK



Thanks!!
Coleen

On 1/22/2013 8:11 AM, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/8006506/webrev.00/

This test provokes the JVM crash described in bug: JDK-7174978.

I intend to push this to:
http://hg.openjdk.java.net/jdk8/tl/jdk

thanks,
StefanK






Review Request: 8006506: Add test for redefining methods in backtraces to java/lang/instrument tests

2013-01-22 Thread Stefan Karlsson

http://cr.openjdk.java.net/~stefank/8006506/webrev.00/

This test provokes the JVM crash described in bug: JDK-7174978.

I intend to push this to:
http://hg.openjdk.java.net/jdk8/tl/jdk

thanks,
StefanK




Re: Review Request: 8006506: Add test for redefining methods in backtraces to java/lang/instrument tests

2013-01-22 Thread Stefan Karlsson

http://cr.openjdk.java.net/~stefank/8006506/webrev.02

After some feedback from Alan Bateman, I've updated to how the java 
classes are compiled, to match the behavior of similar jtreg tests.


thanks,
StefanK

On 01/22/2013 02:11 PM, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/8006506/webrev.00/

This test provokes the JVM crash described in bug: JDK-7174978.

I intend to push this to:
http://hg.openjdk.java.net/jdk8/tl/jdk

thanks,
StefanK






Review Request: 7140852: Add test for 7022100

2013-01-22 Thread Stefan Karlsson

http://cr.openjdk.java.net/~stefank/7140852/webrev.00/

This test provoked the bug in:
7022100: Method annotations are incorrectly set when redefining classes

thanks,
StefanK


hg: hsx/hotspot-rt/hotspot: 8004823: Add VM support for type annotation reflection

2012-12-20 Thread stefan . karlsson
Changeset: 35431a769282
Author:stefank
Date:  2012-12-20 10:22 +0100
URL:   http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/35431a769282

8004823: Add VM support for type annotation reflection
Reviewed-by: dholmes, coleenp
Contributed-by: joel.fra...@oracle.com

! make/bsd/makefiles/mapfile-vers-debug
! make/bsd/makefiles/mapfile-vers-product
! make/linux/makefiles/mapfile-vers-debug
! make/linux/makefiles/mapfile-vers-product
! make/solaris/makefiles/mapfile-vers
! src/share/vm/classfile/classFileParser.cpp
! src/share/vm/classfile/classFileParser.hpp
! src/share/vm/classfile/javaClasses.cpp
! src/share/vm/classfile/javaClasses.hpp
! src/share/vm/classfile/vmSymbols.hpp
! src/share/vm/oops/annotations.cpp
! src/share/vm/oops/annotations.hpp
! src/share/vm/oops/instanceKlass.cpp
! src/share/vm/oops/instanceKlass.hpp
! src/share/vm/oops/method.cpp
! src/share/vm/oops/method.hpp
! src/share/vm/prims/jvm.cpp
! src/share/vm/prims/jvm.h
! src/share/vm/prims/jvmtiRedefineClasses.cpp
! src/share/vm/runtime/fieldDescriptor.cpp
! src/share/vm/runtime/fieldDescriptor.hpp
! src/share/vm/runtime/reflection.cpp



workqueues in suspend

2012-08-22 Thread Stefan Karlsson
Hello,

I wonder what happens to non-freezable workqueues during suspend. I can't see 
that they are mentioned anywhere in the kernel with respect to suspend.

/Stefan___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


hg: hsx/hotspot-rt/hotspot: 7022100: Method annotations are incorrectly set when redefining classes

2012-01-30 Thread stefan . karlsson
Changeset: 26a08cbbf042
Author:stefank
Date:  2012-01-27 13:46 +0100
URL:   http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/26a08cbbf042

7022100: Method annotations are incorrectly set when redefining classes
Summary: Changed to the correct annotation arrays
Reviewed-by: kamg, dholmes, sla

! src/share/vm/oops/instanceKlass.hpp



Re: Review request (XS): 7022100: Method annotations are incorrectly set when redefining classes

2012-01-29 Thread Stefan Karlsson

On 2012-01-27 14:30, David Holmes wrote:

On 27/01/2012 11:12 PM, Stefan Karlsson wrote:

Here's a fix for a simple copy-n-past bug in the handling of
annotations, affecting only class redefinition.

http://cr.openjdk.java.net/~stefank/7022100/webrev.00/

7022100: Method annotations are incorrectly set when redefining classes
Summary: Changed to the correct annotation arrays
Reviewed-by: TBD1, TBD2


Looks perfectly logical, but begs the question as to how this has not 
been discovered. Are there no tests in this area?


I don't think so. This code is only exercised if you redefine a class 
under the following conditions:

1) The class has overloaded functions,
2) these functions have parameter annotations,
3) the redefined class has swapped the order of these functions (or 
added another overloaded function).


I've managed to write a test for the set_method_parameter_annotations, I 
just need to figure out how to push it to a suitable test suite.


I couldn't come up with a test case fore the 
set_method_default_annotations case. These annotations are only used 
together with methods in an Annotation class. Since annotation methods 
are not allowed to have parameters, I can't induce condition (3) above.


thanks,
StefanK



David




Review request (XS): 7022100: Method annotations are incorrectly set when redefining classes

2012-01-27 Thread Stefan Karlsson
Here's a fix for a simple copy-n-past bug in the handling of 
annotations, affecting only class redefinition.


http://cr.openjdk.java.net/~stefank/7022100/webrev.00/

7022100: Method annotations are incorrectly set when redefining classes
Summary: Changed to the correct annotation arrays
Reviewed-by: TBD1, TBD2


hg: hsx/hotspot-rt/hotspot: 7130476: Remove use of #ifdef TRACE_DEFINE_KLASS_TRACE_ID from klass.hpp

2012-01-27 Thread stefan . karlsson
Changeset: 34e2e90e7182
Author:rbackman
Date:  2012-01-24 14:48 +0100
URL:   http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/34e2e90e7182

7130476: Remove use of #ifdef TRACE_DEFINE_KLASS_TRACE_ID from klass.hpp
Reviewed-by: kamg, phh, dsamersoff
Contributed-by: Rickard Backman rickard.back...@oracle.com

! src/share/vm/oops/klass.cpp
! src/share/vm/oops/klass.hpp
! src/share/vm/trace/traceMacros.hpp



Re: Review request (s): 7116081: USE_PRECOMPILED_HEADER=0 triggers a single threaded build of the JVM

2011-11-30 Thread Stefan Karlsson

Looping in build-dev and build-infra-dev.

StefanK

On 11/29/2011 09:47 AM, Stefan Karlsson wrote:

David,

Thanks for the review.

All,

Updated webrev: http://cr.openjdk.java.net/~stefank/7116081/webrev.2/

The rationale for this change is inlined:

On 11/29/2011 12:48 AM, David Holmes wrote:

Hi Stefan,

On 29/11/2011 12:34 AM, Stefan Karlsson wrote:

http://cr.openjdk.java.net/~stefank/7116081/webrev/

Turning off the precompiled headers is somewhat broken. It triggers a
single threaded build even when HOTSPOT_BUILD_JOBS has been set. With
this fix the compile times went from around 14 minutes to 2.5 minutes,
on an 8 core machine.


Took me a while to figure out why this was the case :)


This affects both Linux and BSD builds, but has only been tested on
Linux. It would be great if someone with access to a BSD machine could
verify this fix.


The problem here was using

ifdef USE_PRECOMPILED_HEADER

when defining it to 0 is used to turn it off - so it seems to me the 
better fix here was to simply change to:


ifeq ($(USE_PRECOMPILED_HEADER),1)


I've changed the conditional to check USE_PRECOMPILED_HEADER instead.

While doing that I found another issue. In gcc.make we try to redefine 
USE_PRECOMPILED_HEADER:


 88 ifneq ($(USE_PRECOMPILED_HEADER),0)
 89 USE_PRECOMPILED_HEADER=1


That doesn't work, so setting USE_PRECOMPILED_HEADER=arbitrary string 
(not 0) on the command line will leave the precompiled headers on, 
but later logic:


 219 ifneq ($(USE_PRECOMPILED_HEADER),1)
 220 CFLAGS += -DDONT_USE_PRECOMPILED_HEADER

will empty the precompiled.hpp file. From precompiled.hpp:

// Precompiled headers are turned off for Sun Studion,
// or if the user passes USE_PRECOMPILED_HEADER=0 to the makefiles.
#ifndef DONT_USE_PRECOMPILED_HEADER

In the new webrev I've changed all places where we read 
USE_PRECOMPILED_HEADER to always compare against 0.


thanks,
StefanK




The removal of:

PrecompiledOption = -DUSE_PRECOMPILED_HEADER

seems okay.

Cheers,
David








hg: jdk7/hotspot-rt/hotspot: 7006659: temporary adlc files are added to the build variables

2010-12-15 Thread stefan . karlsson
Changeset: e7ad5f6f4d29
Author:stefank
Date:  2010-12-15 05:43 -0800
URL:   http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/e7ad5f6f4d29

7006659: temporary adlc files are added to the build variables
Summary: Don't recurse into sub-directories when looking for source files.
Reviewed-by: never, brutisso

! make/linux/makefiles/vm.make
! make/solaris/makefiles/vm.make
! make/windows/create_obj_files.sh



hg: jdk7/hotspot-rt/hotspot: 2 new changesets

2010-12-03 Thread stefan . karlsson
Changeset: c760f78e0a53
Author:stefank
Date:  2010-12-01 15:04 +0100
URL:   http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/c760f78e0a53

7003125: precompiled.hpp is included when precompiled headers are not used
Summary: Added an ifndef DONT_USE_PRECOMPILED_HEADER to precompiled.hpp. Set up 
DONT_USE_PRECOMPILED_HEADER when compiling with Sun Studio or when the user 
specifies USE_PRECOMPILED_HEADER=0. Fixed broken include dependencies.
Reviewed-by: coleenp, kvn

! make/linux/makefiles/gcc.make
! make/linux/makefiles/sparcWorks.make
! make/solaris/makefiles/gcc.make
! make/solaris/makefiles/sparcWorks.make
! make/windows/makefiles/debug.make
! make/windows/makefiles/fastdebug.make
! make/windows/makefiles/product.make
! make/windows/makefiles/vm.make
! src/share/vm/ci/ciCallProfile.hpp
! src/share/vm/ci/ciMethodHandle.hpp
! src/share/vm/classfile/placeholders.hpp
! src/share/vm/code/vtableStubs.hpp
! src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp
! src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp
! src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp
! src/share/vm/interpreter/oopMapCache.hpp
! src/share/vm/libadt/vectset.cpp
! src/share/vm/memory/threadLocalAllocBuffer.inline.hpp
! src/share/vm/precompiled.hpp
! src/share/vm/prims/jvmtiExport.hpp
! src/share/vm/prims/jvmtiImpl.hpp
! src/share/vm/runtime/objectMonitor.hpp

Changeset: 2968675b413e
Author:stefank
Date:  2010-12-02 20:01 +0100
URL:   http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/2968675b413e

7003786: sort Obj_Files before compiling
Summary: Reverted to old sort order on Linux and Solaris.
Reviewed-by: tonyp, coleenp

! make/linux/makefiles/vm.make
! make/solaris/makefiles/vm.make



[Linux-uvc-devel] Trying to add UVC support for Microsoft Lifecam Cinema to older 2.6.20 kernel fails...

2010-10-22 Thread Stefan Karlsson

Hello,

I have now struggled awhile on my own, and tried  v4l-dvb from mg and 
and picks from the backport repro, and all fails compiling against an 
2.6.20 kernel
(Yes.. I know .. use newer kernel , but there are other dependencies 
that makes me stuck with 2.6.20 for the time being.. :/  )


This are the errors (which according to Google I am alone in the 
universe to get...? ):

 CC [M]  /drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.o
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c: In function 
'v4l2_event_free':
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:92: warning: 
implicit declaration of function 'list_first_entry'
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:92: error: 
expected expression before 'struct'
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:92: warning: 
assignment makes pointer from integer without a cast
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:93: error: 
expected expression before 'struct'
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:93: warning: 
assignment makes pointer from integer without a cast
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:94: error: 
expected expression before 'struct'
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:94: warning: 
assignment makes pointer from integer without a cast
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c: In function 
'__v4l2_event_dequeue':
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:116: error: 
expected expression before 'struct'
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:116: 
warning: assignment makes pointer from integer without a cast
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c: In function 
'v4l2_event_queue':
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:193: error: 
expected expression before 'struct'
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:193: 
warning: assignment makes pointer from integer without a cast
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c: In function 
'v4l2_event_unsubscribe_all':
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:261: error: 
expected expression before 'struct'
/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.c:261: 
warning: assignment makes pointer from integer without a cast
make[3]: *** 
[/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l/v4l2-event.o] Error 1
make[2]: *** [_module_/drv2/usr/src/v4l-dvb/v4l-dvb-abd3aac6644e/v4l] 
Error 2


Can anyone please point me in the right direction or perhaps suggest an 
backport that is tagged to work with 2.6.20 ?

Thanks in advance!

Best regards,
Stefan Karlsson
___
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel


[Google Maps API v3] Re: MarkerCluster clickevent

2010-07-26 Thread Stefan Karlsson
Now the clickevent works fine but I'd also look for mouse over and
and right click event.

What I am about to implement is clustered markers that with mouse over
returns the titles of all the markers in that cluster.
Click zoom in as default.
Right click open a infowindow with information of the markers.

This could all be done if a similar function as:
google.maps.event.addListener(markerCluster, 'clusterclick',
function(cluster) {});  is implemented with clusterRightClick and
clusterMouseOver events and with access of: cluster.getCenter();,
cluster.getSize(); and  cluster.getMarkers(); 

Right now I don't have any public URL to show but I will add this in
the near future. Btw I was unsure if I was suppose to start a new
thread but I thought this was in a similar scope I hope this is ok
event though it is outside the scope of the topic.

Stefan

On 23 Juli, 08:36, Stefan Karlsson stefan.k.r.karls...@gmail.com
wrote:
 Y that is awesome, exactly what I was looking for.
 Thank you very much for this, you saved my day.

 Stefan

 On 23 Juli, 07:37, Luke Mahé lu...@google.com wrote:



  Hey Stefan,

  This is possible, but I just updated the MarkerClusterer to make it easier
  :) (So download the latest version 
  -http://code.google.com/p/google-maps-utility-library-v3/source/browse...
  )

  You can add an event listener to the markerClusterer 'clusterclick' event:
  google.maps.event.addListener(markerCluster, 'clusterclick',
  function(cluster) {});

  Then you can get info about theclusterwith:
   cluster.getCenter();
   cluster.getSize();
   cluster.getMarkers();

  Does that do what you need?

  -- Luke

  On Thu, Jul 22, 2010 at 6:56 PM, Stefan Karlsson 

  stefan.k.r.karls...@gmail.com wrote:
   Just started to use MarkerCluster and now i'm looking for handling
   clickevents on clustered markers. What I want is if clicked on a dual
   marker (or more) I'd like to open a infowindow with content for all
   markers in this click. So what i'm looking for is the clickevent on
   markers and also a method to return the markers within that click.
   Thoght it would be standard functionality that should exist but did
   not found it in the references for MarkerCluster.

   Stefan

   --
   You received this message because you are subscribed to the Google Groups
   Google Maps JavaScript API v3 group.
   To post to this group, send email to
   google-maps-js-api...@googlegroups.com.
   To unsubscribe from this group, send email to
   google-maps-js-api-v3+unsubscr...@googlegroups.comgoogle-maps-js-api-v3%2B
unsubscr...@googlegroups.com
   .
   For more options, visit this group at
  http://groups.google.com/group/google-maps-js-api-v3?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Maps JavaScript API v3 group.
To post to this group, send email to google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] Re: MarkerCluster clickevent

2010-07-26 Thread Stefan Karlsson
When added a infoWindow I had problems finding what was the MVCObject
to use with infoWindow.open(map, MVCObject). I made an implementation
of setPosition on the InfoWindow instead and that works fine
(infoWindow.open(map); infoWindow.setPosition(cluster.getCenter());).
But is there any way to do this in one step with something similar to:
infoWindow.open(map, cluster);?

Stefan

On 26 Juli, 10:51, Stefan Karlsson stefan.k.r.karls...@gmail.com
wrote:
 Now the clickevent works fine but I'd also look for mouse over and
 and right click event.

 What I am about to implement is clustered markers that with mouse over
 returns the titles of all the markers in thatcluster.
 Click zoom in as default.
 Right click open a infowindow with information of the markers.

 This could all be done if a similar function as:
 google.maps.event.addListener(markerCluster, 'clusterclick',
 function(cluster) {});  is implemented with clusterRightClick and
 clusterMouseOver events and with access of: 
 cluster.getCenter();,cluster.getSize(); and  cluster.getMarkers(); 

 Right now I don't have any public URL to show but I will add this in
 the near future. Btw I was unsure if I was suppose to start a new
 thread but I thought this was in a similar scope I hope this is ok
 event though it is outside the scope of the topic.

 Stefan

 On 23 Juli, 08:36, Stefan Karlsson stefan.k.r.karls...@gmail.com
 wrote:



  Y that is awesome, exactly what I was looking for.
  Thank you very much for this, you saved my day.

  Stefan

  On 23 Juli, 07:37, Luke Mahé lu...@google.com wrote:

   Hey Stefan,

   This is possible, but I just updated the MarkerClusterer to make it easier
   :) (So download the latest version 
   -http://code.google.com/p/google-maps-utility-library-v3/source/browse...
   )

   You can add an event listener to the markerClusterer 'clusterclick' event:
   google.maps.event.addListener(markerCluster, 'clusterclick',
   function(cluster) {});

   Then you can get info about theclusterwith:
    cluster.getCenter();
    cluster.getSize();
    cluster.getMarkers();

   Does that do what you need?

   -- Luke

   On Thu, Jul 22, 2010 at 6:56 PM, Stefan Karlsson 

   stefan.k.r.karls...@gmail.com wrote:
Just started to use MarkerCluster and now i'm looking for handling
clickevents on clustered markers. What I want is if clicked on a dual
marker (or more) I'd like to open a infowindow with content for all
markers in this click. So what i'm looking for is the clickevent on
markers and also a method to return the markers within that click.
Thoght it would be standard functionality that should exist but did
not found it in the references for MarkerCluster.

Stefan

--
You received this message because you are subscribed to the Google 
Groups
Google Maps JavaScript API v3 group.
To post to this group, send email to
google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to
google-maps-js-api-v3+unsubscr...@googlegroups.comgoogle-maps-js-api-v3%2B
 unsubscr...@googlegroups.com
.
For more options, visit this group at
   http://groups.google.com/group/google-maps-js-api-v3?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Maps JavaScript API v3 group.
To post to this group, send email to google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] Re: MarkerCluster clickevent

2010-07-23 Thread Stefan Karlsson
Y that is awesome, exactly what I was looking for.
Thank you very much for this, you saved my day.

Stefan

On 23 Juli, 07:37, Luke Mahé lu...@google.com wrote:
 Hey Stefan,

 This is possible, but I just updated the MarkerClusterer to make it easier
 :) (So download the latest version 
 -http://code.google.com/p/google-maps-utility-library-v3/source/browse...
 )

 You can add an event listener to the markerClusterer 'clusterclick' event:
 google.maps.event.addListener(markerCluster, 'clusterclick',
 function(cluster) {});

 Then you can get info about the cluster with:
   cluster.getCenter();
   cluster.getSize();
   cluster.getMarkers();

 Does that do what you need?

 -- Luke

 On Thu, Jul 22, 2010 at 6:56 PM, Stefan Karlsson 



 stefan.k.r.karls...@gmail.com wrote:
  Just started to use MarkerCluster and now i'm looking for handling
  clickevents on clustered markers. What I want is if clicked on a dual
  marker (or more) I'd like to open a infowindow with content for all
  markers in this click. So what i'm looking for is the clickevent on
  markers and also a method to return the markers within that click.
  Thoght it would be standard functionality that should exist but did
  not found it in the references for MarkerCluster.

  Stefan

  --
  You received this message because you are subscribed to the Google Groups
  Google Maps JavaScript API v3 group.
  To post to this group, send email to
  google-maps-js-api...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-maps-js-api-v3+unsubscr...@googlegroups.comgoogle-maps-js-api-v3%2B 
  unsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-maps-js-api-v3?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Maps JavaScript API v3 group.
To post to this group, send email to google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] Re: 有SSL API吗

2010-07-13 Thread Stefan Karlsson
Hi,
Chads answer translated back to chinese in gTranslate (i do not know
if this makes any sense or not since I know no chinese)
米格尔给出了答案:
你需要一个地图API许可证总理指出:http://www.google.com/enterprise/earthmaps/maps.html


Stefan

On 13 Juli, 00:59, Chad Killingsworth
chadkillingswo...@missouristate.edu wrote:
 Miguel gave the answer:

 You need a Maps API Premier license for 
 that:http://www.google.com/enterprise/earthmaps/maps.html

 Chad Killingsworth

 On Jul 12, 5:50 pm, Jonathanccwong jonathanccw...@gmail.com wrote:



  Let me try to help translate (as I do not know the answer to this
  question)
  the OP needs to use Google Maps Javascript API v3 in an SSL encrypted
  site but he/she is getting warnings that says some content on the page
  is unencrypted/not verified, etc.

  So the question is whether there is an API that will work in an SSL
  site.
  If not, are there any work-around?

  
  So would the Google Maps Premier work?
  But that does come with a cost.

  On Jul 7, 3:44 am, Miguel Angel Vilela mig...@google.com wrote:

   I don't understand Chinese but it looks like you want to use the Maps API
   over SSL (https).
   You need a Maps API Premier license for 
   that:http://www.google.com/enterprise/earthmaps/maps.html

   On Wed, Jul 7, 2010 at 11:50, 敢为所想 alx...@gmail.com wrote:
需要在SSL页面中使用Google Maps JavaScript API v3, 但是只有普通版本:
   http://maps.google.com/maps/api/js?sensor=true
这时会收到一个警告: 包含未验证内容!

不知道有没有SSL API? 例如:
   https://maps.google.com/maps/api/js?sensor=true

如果没有SSL API, 有其它的解决方法吗?
谢谢!

--
You received this message because you are subscribed to the Google 
Groups
Google Maps JavaScript API v3 group.
To post to this group, send email to
google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to
google-maps-js-api-v3+unsubscr...@googlegroups.comgoogle-maps-js-api-v3%2B
 unsubscr...@googlegroups.com
.
For more options, visit this group at
   http://groups.google.com/group/google-maps-js-api-v3?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Maps JavaScript API v3 group.
To post to this group, send email to google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] Re: markermanager in google maps API v3?

2010-07-07 Thread Stefan Karlsson
Hi,
It is not implemented into the core API yet but you can get it and use
it from 
http://code.google.com/p/google-maps-utility-library-v3/source/browse/#svn/tags/markermanager/1.0.
There you have both examples and doc.
Use API v.3

On 6 Juli, 20:56, edltech edlt...@gmail.com wrote:
 Hi there, I am building a new mapping application. We would like to
 use V3, but are confused about what is/isn't supported in V3 in terms
 of MarkerManager.  The V3 docs don't mention it.  I read through the
 group and saw some older posts, but could someone give me the latest
 on this and any recommendations on what API to go with for a new web
 app that needs to draw large number of polygons at close scale (but
 not at far scale)?

-- 
You received this message because you are subscribed to the Google Groups 
Google Maps JavaScript API v3 group.
To post to this group, send email to google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] KML with authentication

2010-06-28 Thread Stefan Karlsson
I'm creating a google maps application for a company with private
customer data. The program is build in java with an embedded browser
with a google map. How can I create a secure connection for my
customers to retrieve, and display, the data from the database in a
KML file in a secure way.
All examples I've seen have been made in http and with public
intentions but how can I secure the privacy in the best manner?

-- 
You received this message because you are subscribed to the Google Groups 
Google Maps JavaScript API v3 group.
To post to this group, send email to google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] Moving a marker with KML tail

2010-06-28 Thread Stefan Karlsson
I need help with ideas for a KML problem. I have a moving marker on
the map with up to 4000 tail objects following this marker. So when
the marker moves I'd like the last marker in its tail to disappear in
the same time as the new marker is constructed.

In my application the marker is first displayed and in every tenth
second the marker can change location on the map. With a user trigger
event the user shall be able to see where the marker has been located
in it's previously locations (the marker has a location even when the
map is not available). This previous locations can be retrieved and
displayed on the map with a generated KML file from the database. Next
I'd like to erase the last marker in the tail when the head marker
makes its next movement so that after the update there will be the
same fixed number of markers displayed on the map.

Solutions that I have considered are:
1. If the KML file could be dynamic and react to changes in it the
database should add the new location in the KML file and erase the
last object. But I am not aware if Google Maps API could handle
dynamic changes in the KML file? If the google maps sees the file as a
completely new file and have to render the whole file again I believe
this would be a waist of performance.
2. If I could import the KML layer and then erase the last objects one
by one when I receive new updates of the marker that would have been a
solution. But as I recall the KML layer is fixed when it has been
rendered by the map and not possible to dynamically change if I don't
parse the KML with my own parser.

I'd be glad if the solution was close to number 1 since I could then
make full use of the KML advantages. I'd be glad to read your ideas
and input to my problem. All help is appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
Google Maps JavaScript API v3 group.
To post to this group, send email to google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] Always display titel/tool tip of a marker

2010-06-17 Thread Stefan Karlsson
How can I make the title/tool tip of a marker(s) display permanent.
Instead of having the markers titel only to be displayed on mouse over
is there any way to change that property to always display it? If this
is not possible must I create a custom overlay instead?

Stefan

-- 
You received this message because you are subscribed to the Google Groups 
Google Maps JavaScript API v3 group.
To post to this group, send email to google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] Reverse geocode in description tag and extracting additional data from an KML file

2010-06-17 Thread Stefan Karlsson
Can I reverse geocode in the description tag?

Placemark
  name[Name]/name
  description
![CDATA[ Here I'd like to have the address of the cordinats
in Point
]]
  /description
  Point
coordinates
13.7, 56.4, 0
   /coordinates
  /Point
/Placemark
  /Document

I'd like to use the latlng in coordinates to display the address of
that perticular position, how can I do that?

Also I wonder if there exist any way to extract more info from a KML
file from my own defined tags. E.g:


Placemark
  name[Name]/name
  description
![CDATA[ description   ]]
  /description
  myTag importantData /myTag
  Point
coordinates
13.7, 56.4, 0
   /coordinates
  /Point
/Placemark
  /Document

I'd like to extract the value from the myTag e.g. with

google.maps.event.addListener(kmlLayer, 'click', function(kmlEvent) {
   alert(kmlEvent.featureData.myTag);
});

in a similar manner that I can reach the description tag with
kmlEvent.featureData.description.

-- 
You received this message because you are subscribed to the Google Groups 
Google Maps JavaScript API v3 group.
To post to this group, send email to google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



Re: Patch for updated swedish spell files

2010-05-28 Thread Stefan Karlsson
On 2010-05-25 14:08 -0700, MWinther wrote:

  I'd be happy to give them a go.
 
 Awesome! I think some of the stuff you patched has been fixed in the
 original

Wow, the new OO dictionary contains a lot of new words! That is good.

My changes mostly had to do with abbreviations. The new dictionary still
handles them badly, it seems.

I did contact the OO people at the time, but (if I remember correctly)
they were unable to get hold of the person who had contributed the
dictionary in the first place, so nothing came of it.

 if I've patched away anything that should be in there, let me know.

No, it all looks good to me. Thanks a lot for doing this.

If you have time (in some future patch), you could perhaps delete the
Removed by Stefan and Additions by Stefan that you inherited from my
patch. I think I forgot to delete them before sending them to Moolenaar.

-- 
Stefan

-- 
You received this message from the vim_dev maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: Patch for updated swedish spell files

2010-05-22 Thread Stefan Karlsson
On 2010-05-20 22:25 +0200, Mattias Winther wrote:

 /.../  My attempt to contact the original maintainer resulted in a
 mail bounce /.../

It was me that you were trying to contact -- sorry about that :-)

As I don't have much spare time these days, it's good that you take
over the Vim spelling-checking of The Language of Honour and Heroes.

 /.../ if anyone could help me with testing the patches themselves,
 and of course the patched files in themselves.

I'd be happy to give them a go. I'll use them at work (Windows XP)
and at home (Arch Linux X86_64); hopefully I'll be able to give some
feedback during the next week.

-- 
Stefan

-- 
You received this message from the vim_dev maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: applying patch under Win XP

2009-12-23 Thread Stefan Karlsson

On 2009-12-23 10:13 -0800, epanda wrote:

 patch -p works on unix.
 
 Where are instructions to do the same under Win XP?

http://gnuwin32.sourceforge.net/packages/patch.htm

-- 
Stefan

-- 
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php


Re: set path according to project

2009-09-19 Thread Stefan Karlsson

On 2009-09-20 03:02 +0800, Steven Woody wrote:

 /.../ so I want to set the 'path' variable in vim to something like
 'set path=.,Include',  but I only want to do this for the specific
 project, for other projects, the path may be set other ways.

Personally I prefer to use Vim sessions for this kind of stuff. How
sessions work is described in help section 21.4 (:h 21.4).

-- 
Stefan


--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: [Voyage-linux] Centralized management system (WUMPST) Mesh Networking

2008-10-12 Thread Stefan Karlsson

Dear Alex,

WUMPS and WisperMesh system is indeed for sale. Voyage Consultants is 
our partner for sales and marketing of the solution in the Asia Pacific 
Region. Contact is Punky Tse.


For EMEA region, you are welcome to contact us directly. We are looking 
for resellers/partners in other areas of the world

More information can be found at: www.devcom.nu and www.wisper.se

Kind regards,
Stefan Karlsson, CEO and Founder
Devcom Solutions AB / Sweden
[EMAIL PROTECTED]


Alex Jonceski skrev:
Hi, 


Does anybody can make a comment about centralized management system
(WUMPST)  Mesh Networking solution Voyage Web Store offers. Is the
software and centralized management system for sale. I have tried to
reach anybody from voyage web store but I have not received reply email.

Any information is welcomed.

Thank you
Alex


___
Voyage-linux mailing list
Voyage-linux@list.voyage.hk
http://list.voyage.hk/mailman/listinfo/voyage-linux
  


___
Voyage-linux mailing list
Voyage-linux@list.voyage.hk
http://list.voyage.hk/mailman/listinfo/voyage-linux


Re: vim.org refreshed mockup

2006-11-08 Thread Stefan Karlsson
Panos Laganakos wrote:
 I made a mockup of a refreshed version of vim.org, trying to maintain
 as much of the original look as possible:

 http://panos.solhost.org/mockups/vimorg-01.png

 vim tangofied icon by toZth


I think it looks very good. The only things I would like to change are:

1. The version info (à la Vim 7.0.162 is the current version) should be
   added.

2. The dates. Is 2006.11.03 really better than 2006-11-03?

3. The  to the right of the text in the navigation bar. I think it
   would look better with a  to the *left* of the text.

-- 
Stefan


Re: When I open foo.zcml I would like xml type syntax

2006-09-30 Thread Stefan Karlsson
On Friday 29 September 2006 12:53, you wrote:
 2006/9/29, Marc Weber [EMAIL PROTECTED]:
  On Fri, Sep 29, 2006 at 10:35:04AM +0200, KLEIN St?phane wrote:
   Hi,
  
   How can I configure vim to use XML syntax when I open *.zcml file ?
 
  See :h autocmd
 
  put this into a a file which is sourced on startup (eg .vimrc or a 
  plugin-file) autocmd BufRead,BufNewFile *.zcml :set ft=xml

 Thanks, it's working.

You could also put this kind of stuff in ~/.vim/filetype.vim. For example, 
this is how my filetype.vim looks:

if exists(did_load_filetypes)
  finish
endif

augroup filetypedetect
  au BufNewFile,BufRead *.ldsetf ld
  au BufNewFile,BufRead *.cmd   setf ld
  au BufNewFile,BufRead *.antlr setf antlr
  au BufNewFile,BufRead *.ttcn  setf ttcn
  au BufNewFile,BufRead *.mot   setf srec
  au BufNewFile,BufRead *.cmm   setf asm
  au BufNewFile,BufRead *.d setf make
  au BufNewFile,BufRead *.asy   setf asy
  au BufNewFile,BufRead *.cls   setf tex
augroup END

-- 
Stefan







Strange behavior of d_

2006-09-15 Thread Stefan Karlsson
I was expectig the normal mode command d_ (without count) to delete from the 
cursor position to the beginning of the line, but it seems to delete the 
entire line, i.e. even words /after/ the cursor.

Is this really the correct behavior?



Re: use '/' to find both upper and lower case instances

2006-08-17 Thread Stefan Karlsson

 I have a need to use '/' to find something in a file, but I wish it to
 ignore case.

 So say I'm looking for 'foo' then I want to find all instances for 'foo'
 and 'FOO'



Use \c (for instance /\cfoo). If you want this behavior most of the time 
you could set the 'ignorecase' option.

By the way, \C works oppositite to \c.

-- 
Stefan


Re: Batch file works where MAKE fails!

2006-07-24 Thread Stefan Karlsson
Have you tried using forward slashes instead of backslashes (in the search 
paths for the -I flag that is)? 

-- 
Stefan


___
Help-make mailing list
Help-make@gnu.org
http://lists.gnu.org/mailman/listinfo/help-make


Gvim for KDE

2006-07-12 Thread Stefan Karlsson
These two sections in the documentation seems contradictory:

 *gui-kde* *kde* *KDE* *KVim*
  There is no KDE version of Vim.  There has been some work on a port using
  the Qt toolkit, but it never worked properly and it has been abandoned.
  Work continues on Yzis: www.yzis.org.

 *gui-x11-kde*
  For Vim-KDE, you need at least Qt(=2.x) and the corresponding kdelibs.
  To compile, you must use the --with-qt-dir configure flag because QTDIR
  is not automatically detected yet. Giving KDE's directories to the configure 
  script may also help in some cases.

By the way, is there anyone out there that is working on a KDE version? I have 
tried Kyzis a bit, but didn't really like it ...

-- 
Stefan


Re: Autoselect language for spell

2006-07-12 Thread Stefan Karlsson
 Is there an easy way to autoselect language for the builtin
 spell checker in vim 7.0? Vimspell plugin has this functionality:
 the plugin looks for a specified number of lines and try to guess
 which language should it use.


Set spelllang -- yes there is three l in that option :-) -- to a 
comma-separated list of the languages you're interested in. Vim will figure 
out which of them to use.

For example, this is how I do it in my .vimrc (I want US English and Swedish):

  set spelllang=en_us,sv

-- 
Stefan


Re: Making :grep easier to use

2006-07-02 Thread Stefan Karlsson
A bit off-topic, but in addition to yank and paste (e.g. c-r) you can
use c-rc-w to insert the word under the cursor.

-- 
Stefan


Re: visual selection invisible in default color scheme when

2006-04-19 Thread Stefan Karlsson

Georg Dahn skrev:

Hi!

Vim 7.0e02 / Windows XP:

1. gvim -u NONE
2. colo desert
3. colo default

Then the visual selection is invisible and the error message
Warning: terminal cannot highlight is shown. This behavior
is reproducible with other color schemes than desert (like
morning, evening...).

However, doing 'colo desert' is not necessary. Just do

1. gvim -u NONE
2. colo default

and visual selection is invisible, too, and the error
message is shown again.

Best wishes,
Georg





Send instant messages to your online friends http://uk.messenger.yahoo.com


In case it helps you track down the problem: I don't see this behavior 
on Vim 7.0d02 BETA (12 april 2006).


--
Stefan


Make .o withe the same rule for both C and C++ files (newbie question)

2005-10-05 Thread Stefan Karlsson

Hello all,

I want to use the same rule for compiling both C and C++ files. Since I 
have a compiler with some peculiarities I cannot get away with just 
changing some variables and rely on the default rules.


Basically, instead of writing

 %.o: %.c
 the-rule

 %.o: %.cpp
 the-rule

I want to write something like

 %.o: %.c
 %.o: %.cpp
 the-rule


Is this possible? I'm a newbie, so please forgive me if this question is 
ultra-stupid.


--
Stefan Karlsson | [EMAIL PROTECTED]




___
Help-make mailing list
Help-make@gnu.org
http://lists.gnu.org/mailman/listinfo/help-make


Re: [NTG-context] Re: Problem with references

2003-03-09 Thread Stefan Karlsson
No .tuo file is produced -- should it (always) be? At processing, the 
following information is displayed:

systems: begin file pres at line 17
title  : - The title
subject: - A subject
references : unknown reference [][pointer1]
references : unknown reference [][pointer2]
[1.1{/usr/share/texmf/dvips/config/pdftex.map}]
Regards

/Stefan

Guy Worthington wrote:

Stefan Karlsson wrote:
 

I can't get references to work
   

 

[test file snipped]
   

I ran your file -- it outputs the correct page number on my system.  I
should however point out that I run a completely insecure system, with
ConTeXt and its tools able to perform shell commands, write and delete
files, and import scripts at will.  

It might be worthwhile checking the directory which contains your .tex
source file to see whether, ConTeXt has created the auxilliary files
(files with extensions .tuo and .tui).
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context
 



___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: Problem with references

2003-03-09 Thread Stefan Karlsson
After having reinstalled the tetex rpm packages it seems to be working 
(and the .tuo file is also produced).

Guy Worthington wrote:

Stefan Karlsson wrote:
 

I can't get references to work
   

 

[test file snipped]
   

I ran your file -- it outputs the correct page number on my system.  I
should however point out that I run a completely insecure system, with
ConTeXt and its tools able to perform shell commands, write and delete
files, and import scripts at will.  

It might be worthwhile checking the directory which contains your .tex
source file to see whether, ConTeXt has created the auxilliary files
(files with extensions .tuo and .tui).
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context
 



___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: Re: [NTG context] Swedish Keyboard

2002-11-17 Thread Stefan Karlsson
Thanks Jens, \enableregime[il1] did the trick!

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context



Re: [Webware-discuss] dumping MiddleKit database...

2002-03-20 Thread Stefan Karlsson

On 19 Mar 2002 13:16:05 -0600, Jason Hildebrand wrote:
On a number of occasions, I would have found it useful to be able to
dump the entire MiddleKit object database to a file which I could
later
reload.

I can do this with database tools (i.e. mysqldump, and later reload
the
file), but if I rearrange the ordering of the classes in my
classes.csv
file (for example by adding a new class), all the classids change, so
the object references don't line up anymore after I reload the data.

A solution would be to implement a dump which outputs the objects
in
the same format as the samples.csv file, so that MiddleKit can
easily
reload the objects, even if the classids change.  This dump could
also
be useful for making backups, or allowing the administrator to
tweak
data (or schema) and then reload it (which is useful in the
design/development phase).

I plan to implement this dump functionality -- but if someone has
already done this, please email me right away (to save me the
effort).

peace,
Jason

I have written such a dump routine for my internal project. Not
so general but maybe you can do something with it. I can e-mail
it if you want.

Note that if you have deleted any objects in the database the
standard Samples.csv format is not so good because the objects
always get consecutive ids from 1. You will loose the object
identities which may ruin object references.

Therefore I have added an id column like this (notice that
Foo with id 3 is deleted):

Foo objects
fooId,a
1,123
2,432
4,543

Bar objects
barId,foo
1,Foo.1
2,Foo.2
3,Foo.4

To make this new format work with MK I had to extend MySQLSQLGenerator.py.

/Stefan


___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



Re: [Webware-discuss] dumping MiddleKit database...

2002-03-20 Thread Stefan Karlsson

On 20 Mar 2002 09:46:54 -0600, Jason Hildebrand wrote:
On Wed, 2002-03-20 at 02:34, Stefan Karlsson wrote:
 A solution would be to implement a dump which outputs the
objects
 in
 the same format as the samples.csv file, so that MiddleKit can
 easily
 reload the objects, even if the classids change.  This dump
could
 I have written such a dump routine for my internal project. Not
 so general but maybe you can do something with it. I can e-mail
 it if you want.

Sorry I got your message too late -- I've already implemented this.
I
did the same thing (added id columns), and modified the
SQLGenerator.py
to accept this column if it exists.  I also took care of quoting
and
unquoting to protect strings which may contain special characters
(commas, newlines).

I'm going to clean up the code a bit, and then submit it as a patch
(because I think this functionality belongs in the MK itself).

Perfect!

/Stefan


___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



Re: [Webware-discuss] Dumb MiddleKit question

2002-01-04 Thread Stefan Karlsson

On Sun, 30 Dec 2001 20:14:33 -0800, Chuck Esterbrook wrote:
On Friday 28 December 2001 12:03 pm, Stefan Karlsson wrote:
 Tip: If you want to have very simple MK/MySQL support of
transactions
 you can do like this (at least it works for me :-).

 1) Subclass MySQLObjectStore and override saveChanges:

 class MyMySQLObjectStore(MySQLObjectStore):
   def saveChanges(self):
 self.executeSQL('BEGIN')
 try:
   MySQLObjectStore.saveChanges(self)
 except Exception, e:
   self.executeSQL('ROLLBACK')
   raise e
 else:
   self.executeSQL('COMMIT')

Should this also be a setting?

Maybe a good idea


'SQLSaveChanges': ['BEGIN', 'ROLLBACK', 'COMMIT'],

Or are these always the same? So then:

'SQLCommitOrRollBack': 1,

(Most of my experience is with MySQL so I'm less familar with other
db's.)

BEGIN, ROLLBACK and COMMIT also work in Postgres, don't know about other db's.



 3) Edit GeneratedSQL/Create.sql and add TYPE=InnoDB after every
 create table:

 create table MyClass (
   myClassId                        int not null primary key
 auto_increment, ) TYPE=InnoDB;


 The last step must be repeated every time you generate your SQL
files
 from the object model :-(
 But if we ask Chuck kindly he might fix this in the MK generate
stuff
 :-). It would be perfect if one could set an option in
 Settings.config, like 'MySQLTableType':'InnoDB'.


I agree that a setting is the way to go. Is there a notion of table
type in any other flavor of SQL? Perhaps the setting should just be
SQLTableType.

I think this is not standard. I only know MySQL having table types.

/Stefan


___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



Re: [Webware-discuss] Dumb MiddleKit question

2001-12-28 Thread Stefan Karlsson

On Wed, 26 Dec 2001 00:30:40 -0500, Edmund Lian wrote:
I'm wondering how MiddleKit users are dealing with the issue of
transactions. As far as I can tell, the notion of commits and
rollbacks are
not fully implemented in ObjectStore.py--methods like
revertChanges(self)
raise NotImplemented errors).

Why I ask is because I'm used to the traditional RDBMS notions of
transactions (and ACIDity) and not at all used to using an
object-relational layer. I think that there might be situations
where one
wants to commit several objects to persistant storage atomically, but
without support for transactions in MiddleKit (or MySQL for that
matter),
how does everybody cope? Do you really drop down to unwinding your
..saveChanges() method calls by hand (i.e., with code)? Isn't this a
bit
icky?

Tip: If you want to have very simple MK/MySQL support of transactions you can
do like this (at least it works for me :-).

1) Subclass MySQLObjectStore and override saveChanges:

class MyMySQLObjectStore(MySQLObjectStore):
def saveChanges(self):
self.executeSQL('BEGIN')
try:
MySQLObjectStore.saveChanges(self)
except Exception, e:
self.executeSQL('ROLLBACK')
raise e
else:
self.executeSQL('COMMIT')

2) Make sure that your MySQL server supports transactions, i.e install InnoDB.
You don't need 4.0 to do this, a recent 3.23 is OK. The prebuilt Windows
binaries already have InnoDB installed but on Linux you may have to install
it separately. Read more about this on http://www.mysql.com/.

3) Edit GeneratedSQL/Create.sql and add TYPE=InnoDB after every create table:

create table MyClass (
myClassIdint not null primary key auto_increment,
) TYPE=InnoDB;


The last step must be repeated every time you generate your SQL files from
the object model :-(
But if we ask Chuck kindly he might fix this in the MK generate stuff :-).
It would be perfect if one could set an option in Settings.config, like
'MySQLTableType':'InnoDB'.

/Stefan


___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



[Webware-discuss] Middlekit Object References

2001-12-03 Thread Stefan Karlsson

There seems to be a bug in how MK stores objects references.

Look at this code:

store = MySQLObjectStore(host='localhost')
store.readModelFileNamed('Middle/test')

foo = Foo()
bar = Bar()
store.addObject(foo)
store.addObject(bar)
foo.setBar(bar)

store.saveChanges()

foo = store.fetchObjectsOfClass(Foo)[0]
bar = foo.bar() # This row gives the WARNING
print foo:, foo, bar:, bar

Here's the output:

WARNING: Zero serial number. Obj ref = 2.
foo: Middle.Foo.Foo instance at 0x814aae4 bar: None

The problem is that when foo is saved to the SQL database,
bar has no serial number yet, and so foo's reference to
bar gets zero in the database (Bar doesn't get a serial
number until it gets saved to the database).

Calling saveChanges() before the attribute is set works,
because after saveChanges() every new object have there
serial numbers. But calling saveChanges() several times is
not an elegant solution; I would rather call saveChanges()
just once and have all data manipulation in one single
database transaction if this is possible.

How can this be solved more elegant?

Why not let the store keep a list of all zero-reference-objects
saved to the database during commitInserts(), that is, when
the new objects get inserted to the database. After that, update
all the objects in the list to the database, now with the correct
references, because now we know the serial numbers of all objects.

/Stefan
___
 Stefan Karlsson ([EMAIL PROTECTED]) +46 (0)90 77 10 30
 Everynet Consulting AB, www.everynet.se  (0)73 986 84 20


___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



[Zope-dev] Design explanation (Was: SkinScripts instantiating new objects)

2001-02-19 Thread Stefan Karlsson

At 16:21 2001-02-16, Steve Alexander wrote:
Stefan Karlsson wrote:

 
 BTW is it possible to save the ProjektHandler instance persistently
 in the attribute? Is there an easier way than creating a separate
 specialist for the ProjektHandler class and storing the instances there?

I think you're getting design and implementation confused here.

Should ProjektHandlers be a Dataskins? If so, they should live in their own Rack.
Or, does a ProjectHandler really belong as a part of the instance of something else?
In this latter case, you could add a ProjectHandler as an attribute.
As to whether this is a wise thing to do; well, I can't say, as I don't know what 
problem you're trying to solve.

I have found a workaround for the 'Error computing attribute' problem by 
instantiating the ProjektHandler object directly in __bobo_traverse__:

def __bobo_traverse__(self, REQUEST, name):
if name=='projekt': return self.getNewProjektHandler(self,id, 
'Projektagare').__of__(self)
else: return getattr(self, name)

For those of you that are interested in a long explanation of how I 
designed the system, read on...

A ProjektHandler is a ZPHandler that is a "virtual folder" that 
looks like a normal Zope folder but doesn't store any objects in itself. 
Instead the storage is delegated to ZPatterns. There is also an OMHandler
class that implements the same interface as ZPHandler but stores the 
objects in itself like ObjectManager, but that's another story.

In each class that has an aggregate to another class I instantiate
a handler for that other class. As an example, look at the 
UML class diagram below. We can see that both A and C has an 
aggregate to class B, that is, a one-to-many relationship. 
A also has an aggregate to D.

X=diamond=aggregate

+-+   * +-+
!  A  !X!  D  !
+-+ +-+
   X
   !
   ! *
+-+
!  B  !
+-+
   ! *
   !
   X
+-+
!  C  !
+-+

So what we need is a handler class that manages objects of class B,
so we create a BHandler by simply subclassing ZPHandler and telling
it what objects to handle. One BHandler instance is put into A and 
another is put into C. Both instances are called 'bs'. We also need a 
DHandler that is put into A.

The nice thing is that it is very easy to get management tabs
for B:s and D:s in A and B:s in C in the management interface.
Another nice thing is that B instances actually seems to exist 
in multiple parents! And all objects seems to exist as normal 
Zope objects even if the are stored in SQL database. 

Now instantiate objects of type A, B and C and call them a1, b1, c1.
 From python we can write a1.bs.getItem('b1) to get the b1 object.
We can of course also write c1.bs.getItem('b1') and get the same object.

The handler attribute bs is instantiated by a ZPatterns 
skinscript as a new object when they are first accessed in
every transaction

Now wouldn't it be nice to access this URL:
http:/server/path/to/a1/bs/manage_workspace
to get the management interface for the B objects belonging to A?

But here comes the problem! This doesn't work for me. I get the
'Error computing attribute' in ZPatterns. I have also
tried calling self.a.bs.getItem('b1') in __bobo_traverse__ but
get the same error. 

As I said I have found a workaround but I suspect it's a bug in ZPatterns...

Anyway, this was the way I designed this system and it would be nice
to have some comments.

Thanks Steve for your help!

/Stefan Karlsson
 Everynet Consulting




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] SkinScripts instantiating new objects

2001-02-16 Thread Stefan Karlsson

Hi,

I want my SkinScript to instantiate a new object of type ProjektHandler
and put it into an attribute called projekt. For this I have created
an external method, returning a new object of type ProjektHandler (simplified):

def getNewProjektHandler(self, parentId, parentClass):
h = ProjektHandler()
return h

The skinscript look like this:
WITH self.getNewProjektHandler(self.id, 'Projektagare') COMPUTE projekt=RESULT

This works if I call it from python, e. g
print self.mySpecialist.getItem('foo').projekt

But it does not work when I call it from the web, e. g
http://server/mySpecialist/foo/projekt (see the traceback from the log file below)

Has anyone an idea why this doesn't work?

Zope 2.3.0b2
ZPatterns 0.4.3b1

/Stefan Karlsson


--
2001-02-16T11:28:35 PROBLEM(100) ZPatterns Error computing attribute projekt
Traceback (innermost last):
  File /home/stefan/myzope/zope2/lib/python/Products/ZPatterns/AttributeProviders.py, 
line 311, in _
AttributeFor
(Object: GAPMixin)
  File Products/ZPatterns/Expressions.py, line 122, in eval
  File DocumentTemplate/DT_Util.py, line 336, in eval
(Object: self . getNewProjektHandler ( self . id , 'Projektagare'  ))
(Info: self)
  File string, line 0, in ?
  File DocumentTemplate/DT_Util.py, line 140, in careful_getattr
AttributeError: getNewProjektHandler



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] SkinScripts instantiating new objects

2001-02-16 Thread Stefan Karlsson

At 14:31 2001-02-16, Steve Alexander wrote:
Stefan Karlsson wrote:

  Hi,
 
  I want my SkinScript to instantiate a new object of type
  ProjektHandler and put it into an attribute called projekt.

In your example, there is no sense of the ProjektHandler instance being 
saved persistently in the attribute. A new object is created for each 
transaction. Is this what you want?

Yes, that was my intention.

BTW is it possible to save the ProjektHandler instance persistently
in the attribute? Is there an easier way than creating a separate
specialist for the ProjektHandler class and storing the instances there?


  For this I have created
  an external method, returning a new object of type ProjektHandler

Where have you put this external method? That is, where in the ZODB?

I have put it in the rack, the specialist and higher up in the hierarchy. 
Makes no difference.



  The skinscript look like this:
 
  WITH self.getNewProjektHandler(self.id, 'Projektagare')
COMPUTE projekt=RESULT
 
  This works if I call it from python, e. g print
  self.mySpecialist.getItem('foo').projekt
 
  But it does not work when I call it from the web, e. g 
http://server/mySpecialist/foo/projekt

That's as I expect. Generally, you call methods from URLs, you don't 
retrieve the values of attributes.

So, what do you suggest, should I implement __bobo_traverse__ or
something in foo to make the URL work?

/Stefan Karlsson



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



<    2   3   4   5   6   7