Re: [ANN] ring-transit-middleware 0.1.1
Hi Sven, What is the difference to ring-transit ring-transit-middleware doesn't silence exceptions. Also the three points I listed in my original message. But _essentially_ they both do the same thing. On Sat, Oct 31, 2015 at 11:41 PM, Sven Richter wrote: > Hi Atamert, > > Thanks for your work. I am curious. What is the difference to ring-transit > (https://github.com/jalehman/ring-transit). Both libraries seem to have > the same goal. > > Best Regards, > Sven > > > Am Samstag, 31. Oktober 2015 14:30:21 UTC+1 schrieb Atamert Ölçgen: >> >> Hi, >> >> I've just released ring-transit-middleware 0.1.1 to clojars. >> >> - It has sane defaults, most of the time you just need to wrap with >> ring.middleware.transit/wrap-transit >> - Allows customisation (see API docs) >> - Is Aleph-aware (handles deferred responses) >> >> https://github.com/muhuk/ring-transit-middleware >> >> Your feedback & contributions are welcome. >> >> >> -- >> Kind Regards, >> Atamert Ölçgen >> >> ◻◼◻ >> ◻◻◼ >> ◼◼◼ >> >> www.muhuk.com >> > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Kind Regards, Atamert Ölçgen ◻◼◻ ◻◻◼ ◼◼◼ www.muhuk.com -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] ring-transit-middleware 0.1.1
Hi Atamert, Thanks for your work. I am curious. What is the difference to ring-transit (https://github.com/jalehman/ring-transit). Both libraries seem to have the same goal. Best Regards, Sven Am Samstag, 31. Oktober 2015 14:30:21 UTC+1 schrieb Atamert Ölçgen: > > Hi, > > I've just released ring-transit-middleware 0.1.1 to clojars. > > - It has sane defaults, most of the time you just need to wrap with > ring.middleware.transit/wrap-transit > - Allows customisation (see API docs) > - Is Aleph-aware (handles deferred responses) > > https://github.com/muhuk/ring-transit-middleware > > Your feedback & contributions are welcome. > > > -- > Kind Regards, > Atamert Ölçgen > > ◻◼◻ > ◻◻◼ > ◼◼◼ > > www.muhuk.com > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: automatically convert java to clojure
The output of this is: (def key1 "") (def key2 "") (def factory (new TwitterFactory key1 key2)) (def twitter (.getInstance factory)) (def user (.verifyCredentials twitter)) (def statuses (.getHomeTimeline twitter)) (def screenName (.getScreenName user)) (def text (.getText status)) On Sat, Oct 31, 2015 at 1:37 PM, Asim Jalis wrote: > The code got mangled in the posting. Here it is again. > > TEST=$(cat <<"END" > String key1 = ""; > String key2= ""; > TwitterFactory factory =new TwitterFactory(key1,key2); > Twitter twitter = factory.getInstance(); > User user = twitter.verifyCredentials(); > List statuses = twitter.getHomeTimeline(); > screenName = user.getScreenName(); > text = status.getText(); > END) > echo "$TEST" | > perl -ne ' > s/=/ = /g;# Put spaces around = > s/\s+/ /g;# Remove multiple spaces > s/^\s+|\s+$//g; # Trim > s/,/ /g; # Remove commas > > # Handle var = new Obj(); > # Handle var = obj.method(); > # Handle var = value; > > s/.*?(\S+) = new (\S+)\(([^\)]*)\);/(def $1 (new $2 $3))/; > s/.*?(\S+) = (\S+)\.(\S+)\(([^\)]*)\);/(def $1 (.$3 $2 $4))/; > s/.*?(\S+) = (.*);/(def $1 $2)/; > > s/\s+\)/)/g; # Cleanup > print qq{$_\n};' > > > On Sat, Oct 31, 2015 at 1:35 PM, Asim Jalis wrote: > >> On Wednesday, June 18, 2008 at 4:32:01 PM UTC-7, kyle smith wrote: >>> >>> Is it possible to automatically convert java code to clojure? If so, >>> would someone like to volunteer to write it? >> >> >> I frequently want to quickly translate code snippets from Java to Clojure >> to test out an API. >> >> For example Twitter4J has some code snippets in Java that would be more >> useful for me in Clojure. >> >> For this I use a Perl one-liner to translate the kind of simple code that >> occurs in API snippets. >> >> Here is the Perl translator with a simple test case. >> >> TEST=$(cat <<"END" >> >> String key1 = ""; >> >> String key2= ""; >> >> TwitterFactory factory =new TwitterFactory(key1,key2); >> >> Twitter twitter = factory.getInstance(); >> >> User user = twitter.verifyCredentials(); >> >> List statuses = twitter.getHomeTimeline(); >> >> screenName = user.getScreenName(); >> >> text = status.getText(); >> >> END) >> >> echo "$TEST" | >> >> perl -ne ' >> >> s/=/ = /g;# Put spaces around = >> >> s/\s+/ /g;# Remove multiple spaces >> >> s/^\s+|\s+$//g; # Trim >> >> s/,/ /g; # Remove commas >> >> >> >> # Handle var = new Obj(); >> >> # Handle var = obj.method(); >> >> # Handle var = value; >> >> >> >> s/.*?(\S+) = new (\S+)\(([^\)]*)\);/(def $1 (new $2 $3))/; >> >> s/.*?(\S+) = (\S+)\.(\S+)\(([^\)]*)\);/(def $1 (.$3 $2 $4))/; >> >> s/.*?(\S+) = (.*);/(def $1 $2)/; >> >> >> >> s/\s+\)/)/g; # Cleanup >> >> print qq{$_\n};' >> >> >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: automatically convert java to clojure
The code got mangled in the posting. Here it is again. TEST=$(cat <<"END" String key1 = ""; String key2= ""; TwitterFactory factory =new TwitterFactory(key1,key2); Twitter twitter = factory.getInstance(); User user = twitter.verifyCredentials(); List statuses = twitter.getHomeTimeline(); screenName = user.getScreenName(); text = status.getText(); END) echo "$TEST" | perl -ne ' s/=/ = /g;# Put spaces around = s/\s+/ /g;# Remove multiple spaces s/^\s+|\s+$//g; # Trim s/,/ /g; # Remove commas # Handle var = new Obj(); # Handle var = obj.method(); # Handle var = value; s/.*?(\S+) = new (\S+)\(([^\)]*)\);/(def $1 (new $2 $3))/; s/.*?(\S+) = (\S+)\.(\S+)\(([^\)]*)\);/(def $1 (.$3 $2 $4))/; s/.*?(\S+) = (.*);/(def $1 $2)/; s/\s+\)/)/g; # Cleanup print qq{$_\n};' On Sat, Oct 31, 2015 at 1:35 PM, Asim Jalis wrote: > On Wednesday, June 18, 2008 at 4:32:01 PM UTC-7, kyle smith wrote: >> >> Is it possible to automatically convert java code to clojure? If so, >> would someone like to volunteer to write it? > > > I frequently want to quickly translate code snippets from Java to Clojure > to test out an API. > > For example Twitter4J has some code snippets in Java that would be more > useful for me in Clojure. > > For this I use a Perl one-liner to translate the kind of simple code that > occurs in API snippets. > > Here is the Perl translator with a simple test case. > > TEST=$(cat <<"END" > > String key1 = ""; > > String key2= ""; > > TwitterFactory factory =new TwitterFactory(key1,key2); > > Twitter twitter = factory.getInstance(); > > User user = twitter.verifyCredentials(); > > List statuses = twitter.getHomeTimeline(); > > screenName = user.getScreenName(); > > text = status.getText(); > > END) > > echo "$TEST" | > > perl -ne ' > > s/=/ = /g;# Put spaces around = > > s/\s+/ /g;# Remove multiple spaces > > s/^\s+|\s+$//g; # Trim > > s/,/ /g; # Remove commas > > > > # Handle var = new Obj(); > > # Handle var = obj.method(); > > # Handle var = value; > > > > s/.*?(\S+) = new (\S+)\(([^\)]*)\);/(def $1 (new $2 $3))/; > > s/.*?(\S+) = (\S+)\.(\S+)\(([^\)]*)\);/(def $1 (.$3 $2 $4))/; > > s/.*?(\S+) = (.*);/(def $1 $2)/; > > > > s/\s+\)/)/g; # Cleanup > > print qq{$_\n};' > > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: automatically convert java to clojure
On Wednesday, June 18, 2008 at 4:32:01 PM UTC-7, kyle smith wrote: > > Is it possible to automatically convert java code to clojure? If so, > would someone like to volunteer to write it? I frequently want to quickly translate code snippets from Java to Clojure to test out an API. For example Twitter4J has some code snippets in Java that would be more useful for me in Clojure. For this I use a Perl one-liner to translate the kind of simple code that occurs in API snippets. Here is the Perl translator with a simple test case. TEST=$(cat <<"END" String key1 = ""; String key2= ""; TwitterFactory factory =new TwitterFactory(key1,key2); Twitter twitter = factory.getInstance(); User user = twitter.verifyCredentials(); List statuses = twitter.getHomeTimeline(); screenName = user.getScreenName(); text = status.getText(); END) echo "$TEST" | perl -ne ' s/=/ = /g;# Put spaces around = s/\s+/ /g;# Remove multiple spaces s/^\s+|\s+$//g; # Trim s/,/ /g; # Remove commas # Handle var = new Obj(); # Handle var = obj.method(); # Handle var = value; s/.*?(\S+) = new (\S+)\(([^\)]*)\);/(def $1 (new $2 $3))/; s/.*?(\S+) = (\S+)\.(\S+)\(([^\)]*)\);/(def $1 (.$3 $2 $4))/; s/.*?(\S+) = (.*);/(def $1 $2)/; s/\s+\)/)/g; # Cleanup print qq{$_\n};' -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
clojure webapp with webpack frontend
Hi everyone! I'm new to the clojure and the webpack world so forgive me if I say something stupid. I'd like to build a webapp using clojure as backend and angular (or any other js framework) as frontend. For the frontend part, I'd like to use webpack so I can do a better job providing frontend code ready for production. My question is if it's possible to use lein and webpack together to create a jar that contains all my production code without having to do things manually like using webpack and then uberjar. Any help or feedback is appreciated. Thanks! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ANN] ring-transit-middleware 0.1.1
Hi, I've just released ring-transit-middleware 0.1.1 to clojars. - It has sane defaults, most of the time you just need to wrap with ring.middleware.transit/wrap-transit - Allows customisation (see API docs) - Is Aleph-aware (handles deferred responses) https://github.com/muhuk/ring-transit-middleware Your feedback & contributions are welcome. -- Kind Regards, Atamert Ölçgen ◻◼◻ ◻◻◼ ◼◼◼ www.muhuk.com -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: If a Java function seems to never return, how do I test?
> > > What could we do to make the Exception visible, assuming there is one? > > Exceptions are ALWAYS visible, the only way they get lost is the try/catch blocks you added in your code which effectively swallow and ignore them. The JVM will not randomly lose an Exception, it is always code you write that decided to handle them in some way. If you do not know how to handle an exception do not catch it, printing its stacktrace and ignoring it is never a good idea. In your case since you say that the function never returns I'd put my guess on an infinite loop. There is no exception that gets lost, your code is just still running. If your JVM is running locally you can attach to it via jvisualvm [1] and get a quick overview of what the JVM is doing. If you look at the thread information you'll see if something is still running or dead-locked somehow. You can also use a debugger and step through the java code step by step. Also, consider coding against interfaces in java (eg. java.util.List and java.util.Map instead of java.util.Collection), it will save you tons of conversion calls. HTH /thomas [1] https://visualvm.java.net/ -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.