Rajith Gamage

Greenhorn
+ Follow
since Jun 17, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rajith Gamage

Rob Spoor wrote:Pass -1 as the second argument to the split method. If I do that in John's example I get 26 for both input strings - that's including the empty string after the last |.



that will help .
7 years ago

Harsha Smith wrote:Trailing empty strings are not included using the split method that takes regex as argument



how can I solve it ?
7 years ago
In my code I split some string using vertical bar. But using the same code I got two results. Why is that ?

Here is my first code


the result i got is 24.

Here is my 2nd code (Only modification is after ER vertical line there is a space)



the result I got is 25

Why it give two result or am I missing some point ?
7 years ago

Sean Corfield wrote:To following on from Amit's pointer, Clojure has really good Java interop but exactly how you approach a problem depends on exactly what you need to do. For example, you can create an implementation of a Java interface on the fly with reify, you can wrap and extend Java objects with proxy and you can also generate regular .class files with gen-class and its buddies.

You're example is similar to the sort of thing shown in the Clojure community docs for proxy: mouse listener.

I recently blogged about generating .class files to write a log4j appender in Clojure which shows a very different approach.



thanks for the reply. Had to use $ sign instead of other things.
7 years ago

Amit Rathore wrote:Instead of attempting to write code here, check this page: Java Interop. Specifically look under "Implementing Interfaces and Extending Classes" and the proxy macro.



thanks for the reply . Found a way to solve it.
7 years ago
How can I get all values in Map?

suppose I have map like this.
({:a 1,:b 2}{:a 3,:b 6})

So I want to get the values of key 'a' . How can I get that ?
7 years ago
Hi,
How can do this in clojure ?




table is an instance of Table . addGeneratedColumn is an method of Table class.
ColumnGenerator is a static interface in Table class and it has a abstract method called generateCell.

How can convert the above code into clojure ?
7 years ago

John Todd wrote:Well no, sorry.
First I don't know Vaadin, second you can check Vaadin documentation to see how to add an image.



thanks for the reply
7 years ago

John Todd wrote:Clojure or no Clojure, how to add an image to a Vaadin app in the first place?



can you give some examples ?
7 years ago
Hi,

How to add a image to vaadin app in clojure ? Give me examples. I google it also but could not find the answer.

Thank You.
7 years ago
Hi,

I'm new to Spring So I'm develop some Spring MVC application. But I got 404 error. Here is the code.

HelloController.java



hello.jsp


web.xml



springapp-servlet.xml


ref : http://static.springsource.org/docs/Spring-MVC-step-by-step/part1.html

When I'm going to run on tomcat server I got the following Exception


What is the wrong with this code ? Please give a help to run this.
7 years ago

sri ramvaithiyanathan wrote:Phone number is the number which you want to send sms.
ie recipient number.

The string line1,line2,line3 are AT commands.Want to know more about AT commands google it.
Those AT commands are used to send sms.

Rest of the things you can easily understand.
Place jar files and dll files in right folder.Else it will create more problem.

Regards,
Sriram



thanks for your reply.but in the code why did you use if((portId.getName().equals("COM1"))) . what is the special with COM1 ? Do I have to change it ?
7 years ago

sri ramvaithiyanathan wrote:Hi,
I did this project.we bought modem for this and one sim card.
click this Link for sending sms through java program.

Regards,
Sriram



thanks for the link.. i go through your code... now i cannot test it because i do not have a dongle. In your code you declare a variable called phone number. so is it the sim number that you brought ? If you can explain the code it will be a big help for me.
7 years ago
How can I send free SMS from web based java application ? Is there a way to do that ? I have the code to do that but I want to know how to do that ? Because to send sms I want to bye the SMSC from like telco companies. Instead of doing that is there a way to do in free ?

Thanks
7 years ago