def Posts[] postsList = Posts.withCriteria { eq ( 'user', userObj ) postTags { 'in' ('name', userFilter.postsTags.toArray()*.name ) } }
Author: robert
Mark Ruffalo – Josh Fox – Sky Is Pink
I am so delighted that Mr. Ruffalo has decided to speak out against fracking.
I saw him on Bill Maher and the Colbert Report, and he mentioned this new short film by Josh Fox: The sky is pink.
My Decision to stop using paypal
I’m looking at my bank statements. And I can’t tell head from tails as to what these paypal withdrawls are for!
They are cryptic, and make book keeping an even more difficult task.
Not to mention they are scary. And could be potentially concealing a security breach.
Great. Now I need to call them and verify each transaction and corresponding ACH withdrawal.
So I say good bye to my paypal addiction. Convenience, I think not, more like nuisance during tax time.
Anime Network – High School of The Dead
Saw the first three in English.
Great show on Anime Network / Time Warner Cable.
Goodbye JavaScript
Hello Google Dart
Can’t we just embed a lite JVM into the browser, so I can write groovy.
Whats with all the parentheses.
main(){
var callbacks=[];
for(var i =0; i callbacks.add(() => print(i));
}
callbacks.forEach((c) => c());
}
Sorry, I think groovy is more elegant, with a step in the right direction to remove awkwardly typed characters like the ( and )
From Bill Maher’s Blog
The Endth Degree
By Bill Maher
Is going to college still even worth it? College grads are coming out with degrees, yes – and herpes – but also with student loan debt totaling $60,000, $80,000, $100,00. These kids haven’t even gotten started in their careers and they’re already saddled with what’s tantamount to a full mortgage. In this sucky economy, graduates find themselves back in their old bedrooms at their parents’ homes, taking jobs in the service industry that they could have gotten without a college degree.
…
Wouldn’t a bright, industrious kid be better off in this economy to just jump into the job market and try to excel through merit?
Grails Service to do file system, sftp, and ftp file operations
So I’ve been preparing this module to do sftp / ftp / and file system manipulations in groovy.
I’ve got it running as a service in grails, with a page setup for testing.
Its really important that if your testing this class out in windows, you turn off your firewall.
I wasted like 2 hours trying to figure out why I kept getting errors.
Now I would like to turn this functionality into a .jar for standalone execution and injection into other projects.
You will need the ant-jsch.jar and jsch-0.1.33.jar, google guave, and apache commons net.
I some how automagically installed the ant-jsch and jsch jars in a way that doesn’t require import statements.
Credit due to
https://gist.github.com/1135043 for FTP code.
http://groovy-almanac.org/scp-with-groovy-and-antbuilder/ for SCP with ANT trick.
and an article I don’t recall the URL to on google guava for file system manipulation
import groovy.util.AntBuilder import com.google.common.io.* import org.apache.commons.net.ftp.FTPClient class FileService { def boolean fileSystemMove(String from, String to){ try{ Files.move( new File(from), new File(to) ) }catch(Throwable t){ println 'filesystem error' + t; return false } return true; } def boolean fileSystemCopy(String from, String to){ try{ Files.copy( new File(from), new File(to) ) }catch(Throwable t){ return false } return true; } def boolean sftpCopyTo( String host, String user, String passwd, String destination, String fileurl ){ def ant = new AntBuilder(); ant.scp( file: fileurl, todir:"${user}@${host}:${destination}", trust:true, verbose:true, password:passwd) } def boolean sftpCopyFrom( String host, String user, String passwd, String destination, String fileurl ){ def ant = new AntBuilder(); ant.scp( file: "${user}@${host}:${fileurl}" , todir: destination, verbose:true, trust:true, password:passwd) } def boolean ftpCopyFrom( String host, String user, String passwd, String destination, String fileurl ){ try{ def String fileName = fileurl.split('/')[-1]; new FTPClient().with { connect host //enterLocalPassiveMode() type(BINARY_FILE_TYPE) login user, passwd changeWorkingDirectory destination def incomingFile = new File(fileurl) incomingFile.withOutputStream { ostream -> retrieveFile fileName, ostream } disconnect() } true }catch (Throwable t) { false } } def boolean ftpCopyTo( String host, String user, String passwd, String destination, String fileurl ){ try{ def String fileName = fileurl.split('/')[-1]; def FTPClient ftp = new FTPClient(); ftp.connect host ftp.type(ftp.BINARY_FILE_TYPE) ftp.login user, passwd ftp.changeWorkingDirectory destination def InputStream input = new FileInputStream(fileurl); ftp.storeFile(fileName , input) ftp.disconnect() true } catch ( Throwable t ) { false } } }
creating jar files with groovy
So I saw recently that its quite simple to compile down a groovy script into a .jar file.
http://groovy.codehaus.org/WrappingGroovyScript
I guess that hello world .class file looked something like this in groovy
class HelloWorld { static main( args ){ println "Hello World!" } }
So does that mean I can write code as groovy, and then import the jar as a dependency into a Java project?
I am assuming the answer is yes, because groovy compiles down to the same byte code as Java.
Now the question is, is it better to deliver a stand alone .jar file to my co-worker to execute on the command line, or import into his project as a dependency and call methods on it?
I see finally Java has copied a feature of .NET. All .NET languages compile down to the same byte code.
Convincing my wife to move to Cupertino!
I really, really, really need to get my honey bunny to be cool, man.
She is just so attached to Glendale, and the Armenian community there-in.
It has made it impossible for me to get her to agree to move up to Silicon Valley.
Just last year, I took her to San Francisco to check out the area, and see if she would like to live there.
Well, today I received yet another job offer from the area, and the magnetic pull to join the other Engineer’s and inovators there is becoming to strong to resist.
Wish me luck, Interwebs, as I try yet again, to convince my honey bunny to be cool.
mnogosearch
Finally got mnogosearch indexing and installed the php front end.
The PHP front end is very ugly. And not even functional! Not sure what I am supposed to do to get it working right.
The worst part is, the search engine server is loud. So I have a noisy machine, mostly useless, sitting in my office, until I get this up and running.