 So, hello everyone. My name is Yoko Harada. Today I'm going to talk about Rujens to Jamie Lange. So, I'm not so good at English. I try to speak English and I will speak slowly so that you can understand my English. But maybe my presentation will finish early, so if you have a question, please come to me. That's good to answer your question. Anyway, my presentation slide is here. So, regarding point dash point that I thought that comes last slide show, this is a JLV on Rails application. My presentation itself is on JLV on Rails on Google App Engine. Yes. Let me introduce myself briefly. Currently, I'm a career of JLV project. I mainly contribute to embedding API. I talk about this API today. And also, I'm a career of another JLV project. I work for pure JLV implementation of Nakagiri. So, thank you. So, I write Java code every day. Not Ruby, but everything is for Ruby. And my blog is here. That blogspot.com. My career idea is JLV. Okay. First, I can speak about the idea. What is Rujens to Jamie Lange? All of you know JLV has a nice Java universal feature. Yes? Yes. Okay. Maybe you have used Java in your own Ruby. But an opposite. How about opposite? Ruby from Java. Maybe only some of you have used Ruby code from Java. Maybe. But Ruby from Java is also JLV's nice Java integration feature. You can use Ruby from Java. So, we think about it. This Java, this Java. Maybe I can request this Java to JLV languages. And one more. Maybe I can request this Ruby by Rujens. And if I write specific language name, it could be Rujens from Clojure, Groovy, Gison, Scala. It might look complicated like this rocket science. I took this picture at Kennedy Space Center. So, it is actually rocket science. But this integration is not like rocket science. It's rather easy. Because like JLV, JLV languages has Java integration feature. It means you can use Java API from Clojure, Java API from Groovy, Java API from Gison, Scala. So, JLV is Java application. Of course, JLV has bunch of Java API. So, I can request Java API by JLV API. So, it might be JLV API from Clojure, JLV API from Scala, Gison, Groovy. Yes, JLV has Java API for that. It is a very API. The name of API is Redbridge. I will talk about Redbridge later. So, let's look at this idea here. This is the idea. And JLV speaks Java with JLV languages using Redbridge API. And JLV runs RubyGems as usual. So, we can use RubyGems from JLV languages. We can integrate both JLV languages and RubyGems. So, let's look at how JLV languages can integrate, can use Ruby API. This is Clojure code. Universally, you need to identify a generator to Clojure. Yes, Clojure can do this. This line is import. Clojure can import JLV API or JLV.ended scripting container. This scripting container is Redbridge. And next line is instantiation. This is Clojure real instantiation with Clojure instantiate Redbridge. Then this one script method is scripting container method. And it evaluates Ruby code. So, this part is Ruby. Clojure evaluates to require. Then Clojure evaluates this timestamp create method and print. Next example is groovy. UUID gen2 groovy. Of course groovy can do this. Groovy can import scripting container and instantiate scripting container and evaluates to require to import, to require to regions. And then evaluates this timestamp create method and print. Next line is json. Json import scripting container, instantiate, evaluates to require, evaluates timestamp create method and print. Next one is Scala. Of course Scala can do this. Import scripting container, instantiate scripting container and evaluates to require and evaluates timestamp create and print. Next is jeroovy. Of course jeroovy can do this. But Ruby gen2 over Java API from Ruby code. It is of course funny and people don't do this. But this code actually works. If you have time try this. If I have time I'm going to show you this demonstration there. Next is RedBridge. RedBridge embedding API. RedBridge, what kind of bridge is it? RedBridge is not Golden Gate Bridge like huge stuff. RedBridge is this kind of small, lovely bridge. It is a small Java API. And RedBridge is just a nickname of old jeroovy and that's the packaging. Okay, RedBridge is a part of jeroovy. If you have jeroovy, you have RedBridge. You don't have any extra Java archive or engines for that. And yes, jeroovy, RedBridge's test cases are included in jeroovy. So RedBridge is tested as a part of jeroovy. So internal changes of jeroovy API are observed by the RedBridge. So you can use RedBridge without any worry. RedBridge is a Java friendly API. Some of you might know JSR223. It is a scripting API. It is included in JDK6 and standard API. But JSR223 is common to all JD languages and a bit short to use jeroovy. So jeroovy can do this, do that. But JSR223 often doesn't have such a method. But jeroovy is designed for jeroovy. RedBridge leverages jeroovy's ability more and more. Next, RedBridge is a clean API. RedBridge cleanly starts up JV runtime, cleanly run unicode, cleanly shut it down. So some of you might have used jeroovy's internal API. But internal API might be changing without saying anything. If you use internal API, you are responsible to that changes. But RedBridge is, as I talked before, RedBridge absorbs such an internal change. For example, jeroovy's main method is not for users. So if you have used internal API, please use RedBridge. RedBridge is simple. This is a great advantage of RedBridge. Basically, there are just two things to do. First, install shared scripting container. Second, evaluate unicode. Sorry, this is a Java code. Since RedBridge is a Java API, this is the basic form of usage. And RedBridge is a powerful API. RedBridge has three types of context models. Singleton, Singlet, Sweatsafe. RedBridge has a bunch of configuration methods. I'm going to show you some of them later. RedBridge has four types of evaluation sources. Input string, reader, string, and path type. RedBridge has four types of sharing variable models. Transient, persistent, local-global, BSF, arm, and on and on. So here's RedBridge with a save. If you have internet connection, please visit the website. So, Wiki is a very good source to learn how to use RedBridge. API docs, I'm going to show you this one. This is on my PC. Sorry about Java API. RedBridge is here, and script container is here. So scripting container has this kind of bunch of API. And I write about RedBridge to my blog. Other resources are here. Community page of Jerry. Okay, then I'm going to show you four examples. And talk about RedBridge API more. First one is data map forward to closure. This is a simple example. Basically, this closure does two things. Instance, a scripting container, and evaluate, evaluate, evaluate, evaluate. Something new is this path type. Path type is specified how to load Ruby code. Let's see this API. So path type is here. And this is a Java and type. And it has absolute and claspas and realty. I use claspas here. So, let's see. Sorry, okay. I have closure example here. The first one is... This is the data map for the model definition. I evaluate it. And this is closure way of creating new models. Now both path is here. It is same as this code. Okay, then I kind of run closure. I must be here. It takes a couple of seconds, so we see what code. So, this model is showed up here. So, closure could use a data map again. Next one, maybe. I can show you this demo since Internet connection is off. This is a Twitter gene to scholar. I use Twitter gene from scholar here. This code is also simple. Just in such a scripting container. And evaluate, evaluate. In this example, I set gen pairs here. Let's see differently here. I have all Twitter genes here. So, I specify this gen pairs like this. And this is scholar's motorline string. I just evaluate this code. Maybe this won't work. Okay. And next example is cucumber from Gifon. This is bit complicated. In this example, I used two configuration methods. One is set argument value. Another one is set error. So, when we use cucumber, we type cucumber space feature-founding. This feature-founding is argument value. So, I picked up that feature value. And here, this is a Python way of taking the argument value. This is the Python object. So, I set this Python object to scripting container. In Ruby, argument value should be a list of strings. This is equivalent to that one. And next one, I set Java string writer to set error. This one is Java's object. This is because I want to capture standard error into this string writer. And I wanted to control that. At this line, I used a Python absolute. This is absolute path to cucumber command. And I evaluate this cucumber. But this cucumber raised exception. So, I capture here and add this command. This demo. So, Java feature. Oh, let's see. Before that, I'm going to show you victory 3 here. I have a feature here. And here is Python code I showed you. Okay. Cucumber words. So, I successfully started cucumber from Python. But we got a lot of pending and exception method, exception message. This exception message is I wanted to capture. And this pending message is because cucumber doesn't support Python on... Cucumber doesn't support Python on JLV. But opposite to... We can focus on JSON's Java API from JLV. For example, this is Ruby code to run Python. Python has web switch like API. This is similar to scripting container. And JSON container can activate Python code on JLV. So, like if we do this kind of thing, cucumber... Python support on JLV might be possible using JSON and JLV. So, this is a last example. Race to Ruby. Maybe this is a fancy example. This Ruby has nice subred wrapper. So, this example is not so complicated, not so difficult, rather easy one. But a whole code doesn't fit into one page of my slide. So, I divided two parts. This is initializer. Ruby instantiate race. And the next one is dispatcher. This fire up this controller. So, let's see this initializer. In this example, I use sharing variable feature of RedBridge. This put, put, put is for sharing variable. Let's see directory 3 here. This is JLV web application structure. It has web directory and web directory. Under directory, I have race application. This blow is web application. I have dispatcher and initializer here. One controller is here and here to index of HTML. You are familiar, I think you are familiar with this. So, first I set load path. This is a path to load web application. And next one is jump path. To get started, we need two things. So, jump home and path to jump file. If I set this to environment and set path to load, we can start up rails by this country environment. So, let's start this one. I have Tomcat here and is the directory to link to the directory I showed here. Let's start Tomcat first. This Tomcat has started. Web application is started. Race, initializer, race is up and running. Then, I will invoke this home controller. I am using Rack3. So, Rack3 really embraces Rack application. Every controller has Rack interface, this call method. So, I invoke this call method with environment variable. This environment variable is minimum to start index method. And this call environment method returns Rack response. You know Rack response. So, first value of RA, first element of RA is response code. And second element of Rack response is response header. And third element is body path. So, I take this body path and using body method. So, this is an actual HTML response. So, I write response right here. Give it in really fast. So, it might be trashed. Okay, it showed up. And I let's edit a little bit. Wish it appeared. So, it is working really well. Thank you. So, do I have time? What kinds of variables can you pass in and retrieve out of the RedBridge API? So, what kinds of objects, types? Any object. Yeah. So, JLB proxies Java object to Ruby. JLB has that ability. Internally, JLB proxies and wraps every object into Ruby object. So, you can pass any JLB object. Yeah. Okay. May I ask you about number theory? Oh, yes, sure. Can you give us, like, which parts are written in Java? You know, what external libraries are you using? How does the interplay of Ruby string objects versus Java string objects work? And are there any gotchas we should look for? Also, I have to set the arrow that I'm encountering, and I don't know if I could ask you later. Okay. So, as for number theory, pure Java, we use Ruby code as much as possible. Many, almost all Ruby code is used. And, we use this with XML. So, I write with XML part in Java using javascript, javascript, javascript, javascript, javascript, javascript, javascript, javascript, javascript. And string is, it's often type change to Java string and Ruby string. Yeah. It is, we frequently often do conversion. Yeah. Does it converge often? Yeah. Every time it converge to Java and Ruby. But internally, that happened, but I don't think you don't need to worry about this, because pure Java no-gui-ui passes almost all no-gui-ui test cases. Yeah, so if you are using a no-gui-ui API, you don't need to worry about internal implementation. Sorry, I didn't get your question, really, but okay, almost all things done by JLV itself, let's put it just in the case to Java and JLV, so if you talk about active recall, that JLV covers, yeah, so did I answer your question? Okay, sharing dialogue mechanism that covers that part. So RedBridge itself has the dialogue map in it, and maybe it is needed to push that dialogue into JLV. Yeah, so JLV has global variable instance, local and constant, and so global variable can control, actually, because it is global, and it should be on the Ruby runtime always, but local variable is just one-time variable, and if you need local variable, put it in the container and JLV use it, then it is exported. And instance variable is lifetime instance variable scope. Yeah, such scope is actually same as Ruby ideal, so Java part saves those variable, but on Ruby runtime, it is same as Ruby ideal, exactly same as Ruby. Yeah, is it? Yes. Okay, thank you. Yeah, so packaging is one problem. Recently, I liked about the packaging of my blog, so if you are interested in, please see that. In my blog, I use Bangla and install some directory, all gents in some directory, and packages in JLV, and to see gents, we need set load path. I showed you some, for example, script container has load set load path, this method. Using this method, if you set load path to that gen, each gen, then your application can see gen query, integer, gen integer, so you like that you can package them. And maybe other rollout or some other packaging too might work, but I haven't used that. So I just, oh, check. Maybe this is a question for the guy in the back. Do you have any insight as to when 1.9 might be working in JRV, and when it does, will no query work the right way or will it involve reporting, and how is, what is the purpose of that itself? So you want to ask about Ruby 1.9 more? Yeah. Right? I'll just ask. Thank you, Tom. The question was, will no query work out of the box with the 1.9 mode, or will there be any code changes recorded? Yeah. Yeah, I occasionally use no query on 1.9 mode, but no problem. Okay. Yeah. So you want to know about return-dominant elevation? Oh, yes. Yeah. So, okay. I didn't talk about this code method at all, but these are the methods to call Ruby's method. So if you evaluate some Ruby class first, then later you just call method many times. You can do that with this method. Another question? How about the performance? I don't have an actual benchmark, but performance is a bit worse than using simple J-Ruby because it has overall to Java code to J-Ruby. But performance got better than first release. Yeah. Thank you. So maybe my time is this time. Okay. I think it's 12, right? Yeah, it's time to lunch as well.