<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>It's not a blog, It's a feature &#187; Uncategorized</title>
	<atom:link href="http://javazquez.com/juan/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://javazquez.com/juan</link>
	<description>Juan A. Vazquez</description>
	<lastBuildDate>Wed, 16 Nov 2011 02:45:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Simple Groovy project using Gradle</title>
		<link>http://javazquez.com/juan/2011/11/15/simple-groovy-project-using-gradle/</link>
		<comments>http://javazquez.com/juan/2011/11/15/simple-groovy-project-using-gradle/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 02:40:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[Gradle]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://javazquez.com/juan/?p=378</guid>
		<description><![CDATA[Gradle is a fantastic tool and I hope this article helps show the ease of getting a project set up.]]></description>
			<content:encoded><![CDATA[<p>Hello fellow Groovyists <img src='http://javazquez.com/juan/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>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.</p>
<p>build.gradle<br />
<code><br />
apply plugin: 'groovy'<br />
version = "1.0-${new Date().format('yyyyMMdd')}"</p>
<p>manifest.mainAttributes("Main-Class" : "com.javazquez.HelloThere")</p>
<p>repositories {<br />
    mavenCentral()<br />
	mavenRepo urls: "http://groovypp.artifactoryonline.com/groovypp/libs-releases-local"<br />
}<br />
dependencies {<br />
	groovy group: 'org.codehaus.groovy', name: 'groovy-all', version: '1.8.4'<br />
	groovy group: 'org.mongodb', name: 'mongo-java-driver', version: '2.6.5'<br />
	groovy group: 'com.gmongo', name: 'gmongo', version: '0.9.1'<br />
	testCompile "org.spockframework:spock-core:0.5-groovy-1.8"<br />
}</p>
<p>jar {<br />
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }<br />
}<br />
</code></p>
<p>below is the the HelloThere.groovy file located src/main/groovy/com/javazquez/HelloThere<br />
<code><br />
package com.javazquez<br />
public class HelloThere {</p>
<p>    public static void main(String []args) {<br />
        println "Hello coders!"</p>
<p>    }    </p>
<p>}<br />
</code></p>
<p>after running <strong>gradle build</strong>, I can navigate to the build/libs directory and run <strong>java -jar HelloThere-1.0-20111115.jar </strong> and get the following ouptut</p>
<p>Hello coders!</p>
<p>Gradle is a fantastic tool and I hope this article helps show the ease of getting a project set up.</p>
]]></content:encoded>
			<wfw:commentRss>http://javazquez.com/juan/2011/11/15/simple-groovy-project-using-gradle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Login with Basic Authentication using Groovy</title>
		<link>http://javazquez.com/juan/2010/11/01/login-with-basic-authentication-using-groovy/</link>
		<comments>http://javazquez.com/juan/2010/11/01/login-with-basic-authentication-using-groovy/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 02:21:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://javazquez.com/juan/?p=278</guid>
		<description><![CDATA[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=&#8217;org.codehaus.groovy.modules.http-builder&#8217;, module=&#8217;http-builder&#8217;, version=&#8217;0.5.0&#8242; ) def authSite = new groovyx.net.http.HTTPBuilder( &#8216;http://10.110.201.115/~juanvazquez/basicAuth/&#8217; ) authSite.auth.basic &#8216;user&#8217;, &#8216;pwd&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>Hey there fellow Groovyists! I was recently in need of performing Basic Authentication on <a href="http://www.webreference.com/programming/apache_authentication/">Apache</a> using Groovy for a proof of concept. Below is what I was able to quickly put together.</p>
<p>//Here is a quick groovy 1.7.4 Basic Auth Example<br />
@Grab(group=&#8217;org.codehaus.groovy.modules.http-builder&#8217;, module=&#8217;http-builder&#8217;, version=&#8217;0.5.0&#8242; )</p>
<p>def authSite = new groovyx.net.http.HTTPBuilder( &#8216;http://10.110.201.115/~juanvazquez/basicAuth/&#8217; )<br />
authSite.auth.basic &#8216;user&#8217;, &#8216;pwd&#8217;<br />
println authSite.get( path:&#8217;testAuth.html&#8217; )</p>
]]></content:encoded>
			<wfw:commentRss>http://javazquez.com/juan/2010/11/01/login-with-basic-authentication-using-groovy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with Python</title>
		<link>http://javazquez.com/juan/2010/08/31/python-quickstart/</link>
		<comments>http://javazquez.com/juan/2010/08/31/python-quickstart/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 03:28:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://javazquez.com/juan/?p=240</guid>
		<description><![CDATA[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&#8217;s(learning the language) perspective. I hope the following helps with getting to know this great language.. Enjoy #construct a tuple using() t=(1,2,3) #contruct a list using [] lst= [1,2,4] #iterate [...]]]></description>
			<content:encoded><![CDATA[<p>Hey there fellow developers <img src='http://javazquez.com/juan/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
I have been working with Python lately(specifically Python3) and wanted to share some things I thought were pretty cool from an outsider&#8217;s(learning the language) perspective.  I hope the following helps with getting to know this great language.. Enjoy </p>
<pre>
<code>
#construct a tuple using()
t=(1,2,3)

#contruct a list using []
 lst= [1,2,4]

#iterate a string and print each character
for i in "This is a String":
	print(i)

#getting the length of a string
print ("length is",len("12345"))	

#test x is in a range
x=6
if(3< x <10 ):
	print( "I am true")
else:
	print( "I am false")

#test membership

if "2" in "1234":
	print("I am in the string")
if int("2") in [1,2,3,4]:
	print( "I am in the list")

#replication
print( "hithreetimes, "*3)

#using math class
import math
print(math.sqrt(4))

#print all methods
print(dir(math))

#named Tuples
import collections
Movie = collections.namedtuple("Movie","title rating")
collection =[Movie("Jaws", 4.0)]
collection.append(Movie("Toy Story", 5.0))
for movie in collection:
	print("I watched {0} and gave it {1} stars".format(movie.title,movie.rating))

#sequence unpacking
head, *rest = [1,2,3,4,5]
print("head is {0} and rest is {1}".format(head,rest))

#passing and unpacking parameters
def fullname(f,m,l):
	print("First Name ="+f)
	print("Middle Name ="+m)
        print("Last Name  ="l)

fakenamelist =["Homer","J","Simpson"]
fullname(*fakenamelist)		

#list comprehensions (print all odd numbers from 0 to 99)
print( [item for item in range(0,100) if item % 2])

#named parameters
def count_animals(number,*,	animal="ducks"):
	return "{0} {1}".format(number,animal)
print( count_animals(3,animal="cows"))
print( count_animals(3))

print(sorted([-1,2,-3],key=abs)) #same order

line = input("enter something.. ")
print("your line was " ,line)

</code>
</pre>
<p>I have been using python for web requests and recommend using the <a href="http://code.google.com/p/httplib2/">httplib2 library</a>. It has a lot of really nice features. </p>
]]></content:encoded>
			<wfw:commentRss>http://javazquez.com/juan/2010/08/31/python-quickstart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby to Python Primer</title>
		<link>http://javazquez.com/juan/2008/12/16/ruby-to-python-primer/</link>
		<comments>http://javazquez.com/juan/2008/12/16/ruby-to-python-primer/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 16:44:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby Questions]]></category>

		<guid isPermaLink="false">http://javazquez.com/juan/?p=35</guid>
		<description><![CDATA[Here is a quick list of similarities between the two languages.
#ruby
puts s.methods 

#python
print dir(s)
]]></description>
			<content:encoded><![CDATA[<p>If your like me, you bounce around between languages a lot. Lately, I have been writing python code. It&#8217;s not Ruby <img src='http://javazquez.com/juan/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  , but it can get the job done. Here is a quick list of similarities between the two languages. I hope it helps&#8230; don&#8217;t forget to this list in the comments section <img src='http://javazquez.com/juan/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<code><br />
#-----find object methods-----<br />
s="hello, I am a string"</p>
<p>#ruby<br />
puts s.methods </p>
<p>#python<br />
print dir(s)</p>
<p>#find out more about a method using python<br />
help(s.split)</p>
<p>#-----view object's class-----<br />
#ruby<br />
s.class </p>
<p>#python<br />
s.__class__</p>
<p>#------Iterate hashes-------</p>
<p>#ruby<br />
h.each{|key,value| puts "#{key}, #{value}"} </p>
<p>#python<br />
for key,value in h.iteritems():<br />
  print key, value</p>
<p>#---ternary operators</p>
<p>#ruby<br />
condition ? var = x : var = y</p>
<p>#python.. not exactly an operator, but you get the meaning<br />
#---- var = y  if condition is false<br />
var = x if condition else y     </p>
<p>#----lengths------<br />
#ruby<br />
s="hello, I am a string"<br />
puts "Length of string is #{s.length} or #{s.size}" </p>
<p>h={:one=>2,:three=>4}<br />
puts "Length of hash is same as string, #{h.length} or #{h.size} "</p>
<p>#python<br />
print("This is the length of a string %s" % len("string"))<br />
print("number of key/value pair= %d" % len({'one':1,'two':2}))</p>
<p>#---slicing lists/arrays<br />
l=[1,2,3,4,5]</p>
<p>#ruby<br />
l[1..3] #=>[2,3]</p>
<p>#python<br />
l[1:3] #=>[2,3]</p>
<p>#--print string multiple times-----</p>
<p>#ruby<br />
4.times{print "hello"} #=> hellohellohellohello</p>
<p>#python<br />
print("hello" * 4) #=> hellohellohellohello</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://javazquez.com/juan/2008/12/16/ruby-to-python-primer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

