Arnoldc interpreter using Clojure instaparse

Wow, I didn’t realize I had taken such a long sabbatical since my last post. I haven’t let off the coding gas while I was away 🙂 One of the many things I have been working on is writing a clojure Arnoldc interpreter. If you are unfamiliar with Arnoldc, ch…

Grails Starter Kit

After years of working with Grails, I thought I would put down in one place a few things I tend to use frequently in my Grails projects. These are things I thought might help others getting started with Grails. Templates > grails install-templates …

Grails LDAP integration with Active Directory via spring-security-ldap

The spring-security-ldap has great documentation. I put together a working example (at least in my environment) to complement the docs. When I was tasked with integrating our grails apps with Active Directory I remember there being a scarcity of examples.…

Add Map, Reduce, and Filter to Groovy with an Extension Module

Having just read Micha‚ Mally's blog that was posted on Google+, I was intrigued with two benefits listed in the blog: The idea of being able to augment Groovy with changes that would behave as "if they were a part of original GDK" support from…

Groovy Invoke Dynamic Support

The release of Groovy 2.1 comes with full Invoke Dynamic Support. Initially I had issues with trying to get a working example up and running as seen by the following message. > groovy –indy mergesort.groovy org.codehaus.groovy.control.MultipleCompilat…

Using Groovy closures to fake Python generators

Here is a quick example of faking python generators with Groovy. Please update the comments if you have a better approach. def (a,b,sent,acc) = [0,1,null,0] def fib={ (a,b) = [b,a+=b] a } while(true){ currFibValue = fib() if( currFibValue…

Clojure Soundex

In need of a quick program to force myself to dive in to clojure, I chose to implement a soundex program that I at one time had written in C++. It was a fun exercise to step back and look at how my thought process changed based on the language I used. H…

Simple Groovy project using Gradle

Hello fellow Groovyists 🙂 I have been kicking the tires on using Gradle for my Groovy projects. I had a few stumbles along the way and wanted to share what I came up with for getting a very simple example working. build.gradle apply plugin: 'groovy&#3…

Activiti GET/POST REST requests with Groovy

I have been working with Activiti lately and needed to test the REST API included with the demo. Below are the GET and POST requests I whipped up using Groovy. Hope you find this useful 🙂 //---Get Request @Grab(group='org.codehaus.groovy.modules.http…

POP3 Gmail access with Clojure and JavaMail

I recently had the need to access gmail using Clojure. I used JavaMail to accomplish this via pop3. Below is some code that I wrote to help me get emails. Hope you find it useful Enjoy 🙂 (use '[clojure.contrib.duck-streams]) (def props (System/getProp…

Writing a PayPal SOAP client with Java 6

I have always been mystified on the inner workings of SOAP. That was until I learned about the "wsimport" utility that comes with Java 6. It makes the entire process very easy. Below is an example of writing a SOAP client for PayPal’s Sandbox. T…

(def Bonjour-Clojure "Welcome to functional programming")

After the briefest of introductions to functional programming in college(a la Lisp) and dabbling with Scala, I took the functional plunge and started using Clojure recently. At this point, I have only written a couple of small programs and haven’t formed …

Login with Basic Authentication using Groovy

Hey there fellow Groovyists! I was recently in need of performing Basic Authentication on Apache using Groovy for a proof of concept. Below is what I was able to quickly put together. //Here is a quick groovy 1.7.4 Basic Auth Example @Grab(group=’org.code…

Fun with Python

Hey there fellow developers 😀 I have been working with Python lately(specifically Python3) and wanted to share some things I thought were pretty cool from an outsider’s(learning the language) perspective. I hope the following helps with getting to know th…

Ruby’s variable variables

Hello everyone, This is a quick post that should help developers new to Ruby. It may also help out those that have been away from the language for a while. Its just a quick reference to Ruby’s variables and their respective scopes. I know I had a chart to…

Windows GUI File Parser using Groovy

I find myself doing a lot of file parsing on my Windows XP machine lately. I decide to write a quick utility that would allow me to drag and drop files and search for the key words that I have identified. The utility doesn’t have the logic for searching u…

A Groovy Flickr API

A long time ago I wanted to write a desktop GUI interface for Flickr. At the time I had just learned Java and thought it would be really cool to write it using swing. Little did I know how not cool working with swing would be 🙁 About halfway through the p…

Adding and Resizing Images with Grails

Here is a quick post on how to upload images within your Grails project to your file system(rather than your database). It seems simple enough, but I ran into a few snags as I was working on one of my projects. Just wanted to provided a working example fo…

Mergesort and Quicksort with Dynamic Languages

The other day I was flipping through an algorithms book and came across a section on sorting. I remembered that I had a blast writing them c++ during my undergrad and thought it would be fun to write them in a couple of different languages. I settled on w…

Fun with Python and Gmail API

Yesterday I decided to play with Gmail's API in order to grab my contacts. To my surprise, it was a snap. Google has instructions for python Here, I wrote my example using Python 2.5 on OS X. Once I had unzipped the GData contents, I just changed to the G…

Ruby to Python Primer

If your like me, you bounce around between languages a lot. Lately, I have been writing python code. It’s not Ruby 😀 , but it can get the job done. Here is a quick list of similarities between the two languages. I hope it helps… don’t forget to this list …

Ruby HTTPS POST’ing

So for my own geeky pleasure, I decided to try writing cgi scripts with Ruby, Python, PHP, and Perl. All had readily accessible documentation on how to POST to a https URL but ruby. My first thought was to look at the Net:HTTP documentation found HERE. Th…

Recursive Directory Search with Ruby and Groovy

A while back I was bored and decided I need to brush up on my Ruby chops. I had been wanting to play with threads for quite some time and couldn’t think of anything that would be a fun project to do…until this crazy idea hit me. "Wouldn’t it be cool …

Proxy/ReverseProxy and Apache2

I recently configured Apache2 to be a ReverseProxy/Proxy and thought I would share my experiences while it was still fresh. Having never configured any kind of proxy, I found this webpage very informative. The scenario I would like to use for my example i…

Rotating Java Images

I am working on a swing flickr app and thought I would share some code to help those that are new to java gui programming(like me) and get them on their way to making their killer application. I'll start off with my first problem, How do I show an Image? …

BarCamp Omaha

I have just been informed/invited to Omaha’s BarCamp! According to the site, this is a "unconference born from the desire for people to share and learn in an open environment." The list of topics that have been submitted thus far are already eno…

File I/O Part 1

I love to learn and try new languages. Not only is learning a new language fun, many times it teaches me something new about a language that I am already familiar with. The only problem that I have with learning so many languages, is keeping them straight…

Handling Ruby’s String.each_char Iterator

Ahh the joys of iterators. I can't say enough about how much they make my life easier. They are just so darn handy. Life was good in my Ruby world until I needed to iterate through the characters in a string. Thinking to myself, "there has got to be …

su vs. 'su -' The Mystery Revealed

Inquiring minds want to know, what is this su - and why is it different than su? Well, if you are like me, you didn’t even know that su - existed. I ran into this problem when I was trying to add a new user to a new Linux machine. Remote root login was di…

Adding Functionality to Ruby Strings

Ok, here is the scoop. I was working on a project using Ruby and needed to grab three characters from a string skipping one character in between. ex –> "123456789" would become 234 and 567 I thought this would be a great opportunity to try ou…

MD5 goodness in Java

A while back I wrote a program which would compare multiple files based on their MD5 checksums. The program can run in Command-Line mode(more powerful, supports batch processing) and GUI mode. Running via command line with the '?' flag will allow the us…

About

My name is Juan Vazquez and this site is meant to act as my mental floss. I plan to use it to explore and express my ideas. Thanks to those that will help me on my journey with positive constructive feedback. home

Disclaimer

My name is Juan Vazquez and this site is meant to act as my mental floss. I plan to use it to explore and express my ideas. Thanks to those that will help me on my journey with positive constructive feedback. home