<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user">
    <title>gmane.comp.lang.groovy.user</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61916"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61915"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61914"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61913"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61912"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61911"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61910"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61909"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61908"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61907"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61906"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61905"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61904"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61903"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61902"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61901"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61900"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61899"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61898"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61897"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61916">
    <title>[groovy-user] in-consistence :)</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61916</link>
    <description>&lt;pre&gt;Hello there,

I've bumped into one slight inconsistence with 'in' -- is this the presumed behaviour?

groovy:000&amp;gt; String in Class
===&amp;gt; false
groovy:000&amp;gt; String instanceof Class
===&amp;gt; true
groovy:000&amp;gt; 

Thanks,
OC


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



&lt;/pre&gt;</description>
    <dc:creator>OC</dc:creator>
    <dc:date>2013-05-21T09:40:41</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61915">
    <title>[groovy-user] Re: Get variable value from Java</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61915</link>
    <description>&lt;pre&gt;Cédric Champeau wrote

Is it possible to get value of typed variable using some kind of Groovy
debugging facilities?



--
View this message in context: http://groovy.329449.n5.nabble.com/Get-variable-value-from-Java-tp5715167p5715490.html
Sent from the groovy - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



&lt;/pre&gt;</description>
    <dc:creator>akula barakula</dc:creator>
    <dc:date>2013-05-21T07:45:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61914">
    <title>[groovy-user] ClassLoaders and garbage collection</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61914</link>
    <description>&lt;pre&gt;Hello everyone,
I'm not that big expert of garbage collection and classloaders, but there's
something that puzzles me and it's very important for me to find an answer
to this.
I've been told that a class can be collected when 
1) all the instances of that class have lost all references. Hence, they're
marked for collection
2) all the classes loaded by the same classloader have no referenced
instances
3) the classloader that loaded is no referenced anymore

I'm experiencing an unexpected behavior with the groovyclassloader.
Let's take this sample code:


We have 2 classloaders extending GroovyClassLoader. the XClassLoader loads a
java.util.Date, while the WoodClassLoader parses a class on the fly.
Both classloaders override finalize() to give us a hint the classloader is
marked for collection.
Finally the instance overrides finalize() as well to let us now the object
is marked for collection as well.

I would expect to see:
- dead instance
- Death of wood class loader
- Death of X class laoder

I've read fact&lt;/pre&gt;</description>
    <dc:creator>theirish81</dc:creator>
    <dc:date>2013-05-21T06:33:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61913">
    <title>[groovy-user] Re: Is there a groovy way to change a string bit please?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61913</link>
    <description>&lt;pre&gt;Hi.
As Dinko Srkoc and Jochen Theodorou's say, I know what is my mistake,
I chose a wrong java type.

I will try the BitSet.

Thanks for all above again!

2013/5/21 Jochen Theodorou [via Groovy]
&amp;lt;ml-node+s329449n5715487h84-hR7aq8U8IYVl57MIdRCFDg&amp;lt; at &amp;gt;public.gmane.org&amp;gt;:



&lt;/pre&gt;</description>
    <dc:creator>xunitc</dc:creator>
    <dc:date>2013-05-20T21:58:06</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61912">
    <title>Re: [groovy-user] Re: Is there a groovy way to change a string bit please?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61912</link>
    <description>&lt;pre&gt;Am 20.05.2013 17:00, schrieb xunitc:

sounds like genetic algorithm you are trying to do.

How about simply using a byte[], boolean[] or well... BitSet has been 
named already?

Otherwise.. why not just define a new class, that has the String with 
the code and supports all the operations you want?

bye blackdrag

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



&lt;/pre&gt;</description>
    <dc:creator>Jochen Theodorou</dc:creator>
    <dc:date>2013-05-20T19:10:16</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61911">
    <title>Re: [groovy-user] Re: Is there a groovy way to change a string bit please?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61911</link>
    <description>&lt;pre&gt;
In that case, instead of using Strings, you might try `java.util.BitSet`.

Cheers,
Dinko


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



&lt;/pre&gt;</description>
    <dc:creator>Dinko Srkoc</dc:creator>
    <dc:date>2013-05-20T15:47:16</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61910">
    <title>[groovy-user] Re: Is there a groovy way to change a string bit please?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61910</link>
    <description>&lt;pre&gt;Hi.

Thanks for tim yates-2 and ysb33r.

I am trying about a simple genetic algorithm, it need change the
binary string codes like '111000111000'.

It need mutation, crossover a bit or more bits in the string.
So I think is there a simple way to do this? I do not need the old
string yet, only need the new string.

A java way like:

String str = "111000";
char[] c = str.toCharArray();
c[0] = '0';
String newStr = new String(c);

I hope the groovy way is :
String.metaClass.putAt = {i, c-&amp;gt;
    def cs = delegate.toCharArray();
    cs[i] = c;
    println(cs);
    // I know this maybe can not work.
    delegate = new String(cs);
}

def str = '111000';
str[0] = '0';
println(str);

I think, can the String be extends and support putAt?
But I really do not know whether I should do this.

2013/5/20 ysb33r [via Groovy] &amp;lt;ml-node+s329449n5715484h91-hR7aq8U8IYVl57MIdRCFDg&amp;lt; at &amp;gt;public.gmane.org&amp;gt;:



&lt;/pre&gt;</description>
    <dc:creator>xunitc</dc:creator>
    <dc:date>2013-05-20T15:00:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61909">
    <title>Re: [groovy-user] Re: Is there a groovy way to change a string bit please?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61909</link>
    <description>&lt;pre&gt;Are you by any change trying to manipulate string-presentations of 
binary values ? If so, then there are helper methods such as

    def str= "100111011"
    Long bi =Long.parseLong(str,2) &amp;lt;&amp;lt; 2
    assert "10011101100" == Long.toString(bi,2);



On 20/05/2013 13:38, xunitc wrote:


&lt;/pre&gt;</description>
    <dc:creator>Schalk Cronjé</dc:creator>
    <dc:date>2013-05-20T13:30:51</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61908">
    <title>Re: [groovy-user] Re: Is there a groovy way to change a string bit please?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61908</link>
    <description>&lt;pre&gt;String is immutable in Java and Groovy, so no you can't change an existing
string

Maybe if you can give an example of what you need to, we can come up with a
more readable solution?


On 20 May 2013 13:38, xunitc &amp;lt;xunitc-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Tim Yates</dc:creator>
    <dc:date>2013-05-20T12:45:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61907">
    <title>[groovy-user] Re: Is there a groovy way to change a string bit please?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61907</link>
    <description>&lt;pre&gt;Hi.
Thanks a lot, tim yates-2!
As the simple example it can works good.
But I think, in my app, there is some things like:

for(int i = begin; i &amp;lt; end; i++) {
    for (int j = i+1; j &amp;lt; limit; j++) {
        str[i] = str2[j]; str[i-1] = 0; str2[j+1] = 0;// and many
other operations.
    }
}

I think it is a little cumbersome, sorry to say that.
I know I can change the string to character array and do every thing
then change back,
but is there a way to change it on the string? or future version can do this?

2013/5/20 tim yates-2 [via Groovy] &amp;lt;ml-node+s329449n5715481h98-hR7aq8U8IYVl57MIdRCFDg&amp;lt; at &amp;gt;public.gmane.org&amp;gt;:



&lt;/pre&gt;</description>
    <dc:creator>xunitc</dc:creator>
    <dc:date>2013-05-20T12:38:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61906">
    <title>Re: [groovy-user] Is there a groovy way to change a string bit please?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61906</link>
    <description>&lt;pre&gt;Or you could do a regular expression to match a final '0' and replace that:

str = str.replaceAll( /0$/, '1' )



On 20 May 2013 12:52, Tim Yates &amp;lt;tim.yates-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Tim Yates</dc:creator>
    <dc:date>2013-05-20T11:53:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61905">
    <title>Re: [groovy-user] Is there a groovy way to change a string bit please?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61905</link>
    <description>&lt;pre&gt;Doh!..  I of course meant:

str = "${str.take( str.length() - 1 )}1"

or

str = "${str[ 0..-2 ]}1"

Sorry about that...





On 20 May 2013 12:51, Tim Yates &amp;lt;tim.yates-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Tim Yates</dc:creator>
    <dc:date>2013-05-20T11:52:18</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61904">
    <title>Re: [groovy-user] Is there a groovy way to change a string bit please?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61904</link>
    <description>&lt;pre&gt;Off the top of my head, you could do:

str = "${str.take( str.length() )}1"

or

str = "${str[ 0..-1 ]}1"

Tim


On 20 May 2013 12:45, xunitc &amp;lt;xunitc-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Tim Yates</dc:creator>
    <dc:date>2013-05-20T11:51:40</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61903">
    <title>[groovy-user] Is there a groovy way to change a string bit please?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61903</link>
    <description>&lt;pre&gt; Hi.

I have a string: 
def str = "111000";

And I want change the last bit to 1 (or other changes).
I know I can not use these under groovy 2.1.3:
str[-1] = '1';
str[0] = '0';
str[1..2] = '00';

So, is there a simple groovy way to do these please?



-----
Xunitc
--
View this message in context: http://groovy.329449.n5.nabble.com/Is-there-a-groovy-way-to-change-a-string-bit-please-tp5715478.html
Sent from the groovy - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



&lt;/pre&gt;</description>
    <dc:creator>xunitc</dc:creator>
    <dc:date>2013-05-20T11:45:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61902">
    <title>[groovy-user] arrays equals and hashCode</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61902</link>
    <description>&lt;pre&gt;Greetings,

It seems Groovy arrays don't obey the javadoc hashCode contract
(http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html#hashCode()).
Specifically, array equality is computed by comparing array elements,
but hashCode is computed based on the object reference. We ran into this
issue at work when trying to use byte arrays as keys in a HashMap
(instead of Strings). I do not see this unexpected behavior documented
anywhere, so I thought I'd post it here for discussion.

Below are some non-exhaustive test cases. Out of these, only the last
test, using Strings, passes. All others fail on the hashCode assertion.

Regards,
Paul

// ran with groovy 2.1.3, osx, jdk 1.6, junit 4

    &amp;lt; at &amp;gt;Test
    void testBytePrimitiveArray() {
        byte[] b1 = new byte[2]
        byte[] b2 = new byte[2]
        assert b1 == b2
        assert b1.hashCode() == b2.hashCode() //fails
    }

    &amp;lt; at &amp;gt;Test
    void testByteObjectArray() {
        Byte[] b1 = new Byte[2]
        Byte[] b2 = new Byte[2]
        assert b1 == b2
&lt;/pre&gt;</description>
    <dc:creator>Pawel Slusarz</dc:creator>
    <dc:date>2013-05-19T20:00:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61901">
    <title>Re: [groovy-user] Would it be possible to forbid auto-prefixing 'this.'?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61901</link>
    <description>&lt;pre&gt;Jochen,

On May 19, 2013, at 4:08 PM, Jochen Theodorou &amp;lt;blackdrag-BA+cFGlbTmA&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:


Do I recognize the implicit this from the explicit one? I didn't know that -- must have overlooked some attribute somewhere or so. In this case, of course, that's the best solution.

Thanks and all the best,
OC


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



&lt;/pre&gt;</description>
    <dc:creator>OC</dc:creator>
    <dc:date>2013-05-19T14:11:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61900">
    <title>Re: [groovy-user] Would it be possible to forbid auto-prefixing 'this.'?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61900</link>
    <description>&lt;pre&gt;Am 19.05.2013 14:35, schrieb OC:

that's a different kind of scoping, that would for example disable the 
binding in a script. Since you already use so many ast transformations, 
how about checking for the implicit this and give the error message 
yourself then?

bye blackdrag

&lt;/pre&gt;</description>
    <dc:creator>Jochen Theodorou</dc:creator>
    <dc:date>2013-05-19T14:08:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61899">
    <title>[groovy-user] Would it be possible to forbid auto-prefixing 'this.'?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61899</link>
    <description>&lt;pre&gt;Hello there,

would it be possible to tell the compiler _NOT_ to try "this.foo" when it compiles "foo"? So that "foo" would mean just a variable, and if there's none, fail. If I want to try for a property, I write "this.foo" anyway.

Thanks,
OC


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



&lt;/pre&gt;</description>
    <dc:creator>OC</dc:creator>
    <dc:date>2013-05-19T12:35:18</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61898">
    <title>Re: [groovy-user] NPE in invokeMethod</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61898</link>
    <description>&lt;pre&gt;Since I not get any replies for one week now, I created a bug report:
http://jira.codehaus.org/browse/GROOVY-6157

Regards, Erwin.

On Friday, May 10, 2013 11:53:12 PM you wrote:
&lt;/pre&gt;</description>
    <dc:creator>Erwin Mueller</dc:creator>
    <dc:date>2013-05-19T10:19:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61897">
    <title>Re: [groovy-user] AST-dump/browse a specific method or class of a big project?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61897</link>
    <description>&lt;pre&gt;You can try something like this:

|import groovy.transform.ASTTest||
||import static org.codehaus.groovy.control.CompilePhase.*||
||import groovy.inspect.swingui.ScriptToTreeNodeAdapter||
||import groovy.inspect.TextTreeNodeMaker||
||
||&amp;lt; at &amp;gt;ASTTest(phase=SEMANTIC_ANALYSIS,value={||
||   def maker = new ScriptToTreeNodeAdapter(null, true, true, true, new 
TextTreeNodeMaker())||
||   def tree = maker.make(node)||
||   println(tree.dump())||
||})||
||class Foo {||
||    int x||
||}||
|
Le 17/05/2013 16:07, OC a écrit :


&lt;/pre&gt;</description>
    <dc:creator>Cédric Champeau</dc:creator>
    <dc:date>2013-05-17T15:07:27</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.groovy.user/61896">
    <title>[groovy-user] AST-dump/browse a specific method or class of a big project?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.groovy.user/61896</link>
    <description>&lt;pre&gt;Hello there,

I sort of recall this was already debated, but can't find a solution.

Presumed I've got an AST transform which gets called in some compilation phase, is there an easy way to dump the AST tree of given method and/or a given class to string (or directly to output or whatever)? Or perhaps even to serialize out the AST tree in a format which some GUI AST browser, like the groovyConsole one, could read and display?

I suspect some of my AST transforms go wild and do things they definitely should not; such a dump/browser would help a lot. Note that since there's LOTS of the transforms, plus some preprocessing, plus a number of libraries needed etc., it is not really manageable to simply copy/paste the code in doubt into groovyConsole and press cmd-t :)

Of course it's always possible to DIY; I just wonder whether it's not already done somewhere on the libraries?

Thanks,
OC


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http:&lt;/pre&gt;</description>
    <dc:creator>OC</dc:creator>
    <dc:date>2013-05-17T14:07:10</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.groovy.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.groovy.user</link>
  </textinput>
</rdf:RDF>
