|
«« Previous
Next »»
|
A while back, Rebecca Murphey started posting some interesting thoughts about what enterprise Javascript applications are and how they should be structured. One of her posts that really got me thinking was one titled, " On Rolling Your Own ". In that particular post (with reference to a few others), Rebecca questions the logistics of rolling your own appl ... Read More »...
Posted by Ben Nadel on Sep 08, 2010
|
Were you having a tough time deciding between attending RIA Unleashed in Boston or 360|Flex in DC? Did your boss say the budget only fit one of the two? Well, it's time to relax because now you can tell your boss that for a measly extra $50 you can get all 4 days of 360|Flex and 2 days of RIA Unleashed. The best part is you can get all the pre-MAX good stuff at 360|Flex and then catch up on all the newly announced stuff from MAX at 360|Flex. Plus, you can't beat the extra opportunities to have a beer with your fellow developers - but we don't need to tell your boss that part. For all the details on how to purchase the combined ticket, go to http://www.360flex.com/blog/2010/09/360flex-and-riaunleashed-2-great-events-great-together/.
...
Posted by Brian Rinaldi on Sep 08, 2010
|
Location – East Providence, RI Duration: Contract 4+ months Rate: $48 on W2 Candidates must have 5+ years of ColdFusion development. Hasbro is looking to fill a ColdFusion Developer position on our internal development team, working on systems supporting Hasbro’s business processes. This person will work with our team of analysts and developers to plan, [...]...
Posted by Ricardo Parente on Sep 08, 2010
|
Demonstrated the experience of writing the stable and scalable web applicationsPossesses the In-depth knowledge of the types of JDBC technology drivers and choose the proper JDBC driver for the best application performance.Working with Oracle or Microsoft SQL server is absolutely a requirement while Sybase experience will be a big plus.System Administrative Sills: Have several years [...]...
Posted by Ricardo Parente on Sep 08, 2010
|
Coldfusion Developer Please let me know if you have a Coldfusion Developer available for a 3-9 month contract in Danvers, MA. Rate 40/hr. Coldfusion developer to augment their development team and work on an Order Management System. This role will be a 50-50 mix of development as well as production support so all candidates need [...]...
Posted by Ricardo Parente on Sep 08, 2010
|
Job Title: Sr. Application Engineer – ColdFusion / Java Profession: Computer Engineering and Information Technology US Oncology has an exciting opportunity for a Sr. Application Engineer responsible for application development utilizing Java and ColdFusion. This position is based at our headquarters office in The Woodlands, TX. SCOPE:Under minimal supervision, implements, maintains, and resolves problems with [...]...
Posted by Ricardo Parente on Sep 08, 2010
|
I’ve been dying to check out @font-face and so I popped over to Font Squirrel to see what they offered. Originally, I thought it was going to be a paid service but the cool thing is that they offer 100% “free for commercial use” fonts! They even have some nice font kits already setup. The [...]
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin....
Posted by Rey Bango on Sep 08, 2010
|
More than anything, these series of posts are some notes and tidbits I've learned as we move our large Verity collection over to Solr. These notes apply to CF 9.0.1.
Rule #1 – Adobe Docs suck. Be creative in your searches. I found answers for question in the following places:
Blogs: including but not limited to Ray Camden's blog and various Adobe Engineer blogs.
Adobe Press Releases, Release Notes, and Change Logs – Whether a feature is enabled has been hidden away.
Apache Solr's docs
Google – Sorry, I mean Scroogle.org.
Rule #2 -Tune your Solr Install. Just like your CF instance, modify the solr.lax file under the solr-install root directory. Look for two lines.
lax.nl.java.option.additional – this line contains the JVM args. We upped memory to 1024 from 256.
lax.nl.current.vm – we pointed this to the latest \bin.javaw.exe file under a 64-bit jdk. 64-bit Solr? You bet!
Rule #3 – Increase Buffer Size – In CF Administrator, go to Solr Server -> Show Advanced Settings. Change Solr Buffer Limit from 40 to 80. For the why on this, use Scroogle.
Rule #4 – Default Operator – When we used Verity, searching for 'fire water' would in effect search for 'fire and water'. With Solr, 'fire water' searches for 'fire OR water'. If you need to change the default operator between words in keyword searches, don't despair. Go to where your solr data is located (the root directory of it), and go to \conf\schema.xml. Around line 528...
Posted by Sam Hoda on Sep 07, 2010
|
You
can tell MAX is around the corner since a significant portion of the
posts this week come from Adobe Platform Evangelists. This week included
tons of activity in the mobile space but also a quite a few great Flash
and ActionScript 3 posts. As always, if you have something you’d like
me to share in upcoming weeks, feel free to email me, post in he
comments or dm/reply to me on Twitter.Cool Mobile StuffOne
of my personal favorite posts this week came from Mark Doherty, an
Adobe Platform Evangelist. It is a follow-up post to a prior post that
demonstrates an AIR for Android application that allows peer to peer video calling integrated with geolocation and
an impressive use of maps. In his video he establishes a call between
his laptop and his mobile phone. He does share the code for his
application.Adobe’s
Christophe Coenraets continues to deliver some exciting AIR for Android
sample applications, particularly focusing on the collaboration
possibilties opened up by the LiveCycle Collaboration Service. He offered two examples, one featuring a multi-player game (Tic-Tac-Toe in this example) featuring live video and another sharing GPS location data using Google Maps also featuring live video and audioDaniel Koestler, also from Adobe posts a video showing an application he has built using Flex 4.5
(condenamed “Hero”) which accesses the camera API’s and accelerometer.
While he only shows the code via the video for the moment, he plans on
sharing code on his blo...
Posted by Brian Rinaldi on Sep 07, 2010
|
I’ve often said that I have no idea how I developed web sites before the Firebug extension for Firefox came along. I think it’s the single tool that I use the most. It’s also the reason that I’m still using Firefox for my development browser, even though Chrome is now faster and my browser of [...]Posted from kay lives hereFirebug Lite–for every browser...
Posted by Kay Lives Here on Sep 07, 2010
|
So, a few weeks ago Twitter replaced Basic Auth for OAuth in their APIs. I was aware of this of course, but it never occurred to me to worry about it as I don't actually work on a Twitter client myself. However, I forgot that one of my sites, CFBloggers.org, makes use of the Twitter API to tweet new blog entries it aggregates. When I tweeted about this today I got a lot of recommendations, but for the most part, the advice, and the docs, focused on applications for humans. By that I mean, the assumption was that your Twitter automation was a tool that random users were using. The docs would explain how you could easily direct them to Twitter to authorize your application and how they would be sent back. That's great, but what about the case for Twitter bots? Nothing out there seemed to address that need. Luckily though I got some great help. In this blog post I'll explain exactly how I updated CFBloggers to post to Twitter. While this is a ColdFusion specific post it really could apply to anyone doing Twitter bots. Credit for this goes to Todd Rafferty, Vic Carter, and Rob O'Brien (and specifically his blog post here: Integrating Twitter and OAuth with ColdFusion)
[More]
...
Posted by Ray Camden on Sep 07, 2010
|
I'm a big fan of CFQuickDocs.com and I use it often for referring the attributes and parameters of the ColdFusion tags and functions. CFQuickDocs is already having plug-ins for Firefox and IE but not for the Google Chrome browser. So the Idea came yesterday to me that Instead of going to the CFQuickDocs site every time to refer something on ColdFusion why don't I create a Chrome Extension for it? So to make it simple I created the ColdFusion QuickDocs Google Chrome extension. [More]...
Posted by Akbarsait ColdFusion Web Log on Sep 07, 2010
|
Adobe evangelist Greg Wilson just asked me the following on IM and I thought it would be good to share with others. I also think it's something that folks may have strong opinions on so I'd like to see what kind of debate this can cause. Here is his question:
I've got a CFC method that returns a static structure. Basically it creates the struct on the fly and returns it. The data in the structure is all hard coded - no dynamic portion at all. Does it make sense to cache that data?
[More]
...
Posted by Ray Camden on Sep 07, 2010
|
Modern browsers are making it much easier to build web applications with offline capabilities. Between the application cache manifest and the SQLite databases , the web as a platform can now be used to deploy "native feeling" applications ... Read More »...
Posted by Ben Nadel on Sep 07, 2010
|
Our MAX Unawards widget is proving to be both fun and popular (if you have yet to give yourself an Unaward, go do so now, really!).
The widget is the brainchild of fellow Adobe Platform Evangelist Serge Jespers, and he has just posted a couple of entries (Part 1, Part 2) on how the project was put together....
Posted by Ben Forta on Sep 07, 2010
|
Announcing a new Meetup for The Online ColdFusion Meetup! What: “Using jQuery as a Proxy to ColdFusion”, with Hal Helms Our 12pm (US ET) talk on Thursday Sep 9 will be “Using jQuery as a Proxy to ColdFusion”, with Hal Helms. TOPIC DESCRIPTION: (provided by the speaker) ColdFusion’s tag enabled ColdFusion developers to tie client-side JavaScript [...]...
Posted by Ricardo Parente on Sep 06, 2010
|
Announcing a new Meetup for The Online ColdFusion Meetup! What: “Digging Into The Developer Toolbox”, with Jim Priest Our 6pm (US ET) talk on Thursday Sep 9 will be “Digging Into The Developer Toolbox”, with Jim Priest. TOPIC DESCRIPTION: (provided by the speaker) Every developer has their basic toolset – a robust IDE, source control and [...]...
Posted by Ricardo Parente on Sep 06, 2010
|
I got my copy of the ColdFusion 9 Developer Tutorial by John Farrar and I took this long weekend to read it. As far, so good. John has a very nice way of explaining the language, either for starters or for experienced ColdFusion developers. The book starts with a general basic view of the ColdFusion [...]...
Posted by Ricardo Parente on Sep 06, 2010
|
Location: Lexington, MA and Maynard, MA Salary: $50,000 – $75,000 Education: Bachelor of Science Category Information Technology Experience Required: At least 2 Years Short Description: Front End Web Developer- Coldfusion Developer- Web Engineer Required Skills: Coldfusion Developer, Web Engineer, Front End Web Developer, JavaScript, AJAX, Flash, AS3, w3c, Web Developer, Software Developer Here is the [...]...
Posted by Ricardo Parente on Sep 06, 2010
|
For the past week I've been using a new Android phone, the Samsung Galaxy S (and specifically, the AT&T version of it branded Samsung Captivate). In general, the Galaxy S is a really nice phone, and is a very welcome addition to the growing list of high end Android devices. It's running Android 2.1 for now, but the 2.2 OTA update is scheduled for some time in September, so Froyo goodness and the ability to run Flash is right around the corner.
So, after using the Google Nexus One since it came out, how does the Galaxy S compare? Here's the scoop:
Pros
The phone is fast, really really fast. It has a 1GHz processor, just like the Nexus One, but is unquestionably faster, and is far more responsive. And everything is faster, from web browsing to switching apps to scrolling contacts to Google Gestures reindexing, it's all fast fast fast.
I'm also not experiencing any of the jumps or lags that Nexus One suffers from, that's huge!
The Samsung Galaxy S is a big phone, it's taller and wider than both the Nexus One and iPhone. But it's also really thin, and has a very pleasing contoured back that makes it very comfortable to hold.
The 4-inch Super AMOLED screen is spectacular, as good as HTC EVO and iPhone 4, maybe even better.
Call quality (yep, I do use phones for calls sometimes) is superb. And far fewer dropped calls.
Bluetooth support is just about perfect, and call quality via Bluetooth is one of the best of any phone I have used.
Wi-Fi on the Galaxy S is superb. Side b...
Posted by Ben Forta on Sep 06, 2010
|
ClojureDocs - Not only will this be useful if you're learning Clojure but it is an awesome example of online documentation! Easy to navigate (drill into Clojure Core and scroll down - the ToC stays visible), everything is categorized, drilling into any function shows examples and you can click to expand the actual source code of the function!...
Posted by Sean Corfield on Sep 04, 2010
|
Leiningen is a build tool for Clojure that handles all of your project / library dependencies and makes it easy to work in a more test-driven development style. Once you've installed Leiningen, you can start a new project, on the command line, by typing lein new myproject and it will automatically create a project folder structure with a source tree (src/) and a test tree (test/). Leiningen will download and manage all of your library dependencies transparently, just by typing lein deps. Then you can develop you tests and your code and just type lein test to run all your tests to ensure your code is working. When you're ready, you can package up your project as a JAR file, with or without the Clojure runtime, with lein jar or lein uberjar. Leiningen does a lot more, but that's the basic outline.
Because Leiningen assumes a particular directory structure, I have updated cfmljure to work more easily with Leiningen projects and I have updated the examples that come with cfmljure to be a Leiningen project, complete with unit tests so you can see how things work. I've also updated the installation instructions in the cfmljure README on github to show you how to set things up via Leiningen.
Take cfmljure for a spin and let me know if the new installation process, with Leiningen, works for you!
Learn more about Leiningen on github....
Posted by Sean Corfield on Sep 04, 2010
|
So one of the cooler features of Adobe AIR is it's ability to work with the user's microphone. I whipped up a quick sample of this feature today that demonstrates this. In this first entry we are simply going to monitor the user's audio and in the next entry I'll discuss how you can actually save the recording.
[More]
...
Posted by Ray Camden on Sep 03, 2010
|
When users can interact with your website by submitting content, it opens your site up to potential harm. In the worst case scenario, this might provide malicious hackers with a way to execute Cross-Site Scripting (XSS) attacks; in the best "bad" case scenario, it might simply mess up your site's layout and lead to a poor user experience. All of these outcomes can be avoided if you understand how data output gets rendered, where it needs to be escaped, and how to escape it. When it come ... Read More »...
Posted by Ben Nadel on Sep 03, 2010
|
There's a discussion on the Clojure mailing list about how to learn to "think in Clojure" (or think in Lisp or, really, think in functional programming terms). A prominent recommendation is The Joy Of Clojure by Michael Fogus and Chris Houser, which everyone says is a great book, but here are a couple of free online books that were also recommended:
Structure and Interpretation of Computer Programs by Abelson, Sussman, and Sussman. It's the "entry-level subject in computer science at the Massachusetts Institute of Technology" and it uses a dialect of Lisp called Scheme, not Clojure, but it provides a good grounding in both computer science and functional programming.
How to Design Programs by Felleisen, Findler, Flatt and Krishnamurthi. This is another introduction to programming / computer science style book that also uses Scheme for its examples.
Enjoy!...
Posted by Sean Corfield on Sep 03, 2010
|
If you follow me on Twitter, you'll have seen me posting about Clojure quite a bit recently. I really like the simplicity and elegance of Clojure. I like the function programming style. I like that it's a dynamic scripting language. I like that it can also be compiled to JVM bytecode and used in any mixed-language project on the JVM.
About a month ago I helped someone get some Clojure code compiled and integrated into CFML, like any other Java-based project, but that set me thinking about being able to just use raw Clojure scripts from CFML without needing to go thru the compilation and deployment process. I asked on the Clojure mailing list how to load and run scripts from Java and that gave me what I needed to create a simple CFC wrapper that lets you write Clojure scripts and dynamically load and execute them from inside CFML.
That's how cfmljure was born on github! It's very early days for the project - I consider this an 'experimental' version - but I've created a Google mailing list for cfmljure and it's also listed on RIAForge). I don't expect it to be crazy popular (like FW/1 for example) but I expect to use it on production projects and thought it would be good to put out there for others to experiment with and provide feedback on.
Things on the roadmap include making it more Leiningen friendly (Leiningen is the de facto standard build tool for Clojure and it definitely makes life simpler) as well as figuring out how to access Clojure variables from CFML. I may even ...
Posted by Sean Corfield on Sep 03, 2010
|
And you can too! :-)
...
Posted by Ben Forta on Sep 03, 2010
|
I urgently need to find a Coldfusion developer to work on a short term basis for one of our clients. For the right candidate this could develop into a permanent role. If you have skills in the following please apply: Coldfusion CSS HTML Any other web dev skills like .Net or PHP beneficial Here is [...]...
Posted by Ricardo Parente on Sep 03, 2010
|
Huxley Associates is an international Top recruitment agency specialised in IT and Finance. For one of my BEST clients situated in the Province og Limburg I am looking for a Coldfusion Specialist. The interviews are booked for next week and the decision to be made next week as well!!! Job Description: - Your task will [...]...
Posted by Ricardo Parente on Sep 03, 2010
|
Way back in January of this year I blogged about a little experiment I did parsing local traffic-related incidents in my home town. A local police department had posted their data in HTML and I used a combination of YQL and ColdFusion to parse it. This was done via a simple scheduled task. A second task turned street addresses into longitude and latitude pairs. Finally I made use of cfmap to display the results. All in all, I think it was pretty cool. The results matched with what I would have assumed were the busiest streets. But yesterday I discovered something cool. Apparently I left the process on and it ran for six months.
[More]
...
Posted by Ray Camden on Sep 03, 2010
|
Now this is a fun sight to wake up to. This ad is on page A9 of my Wall Street Journal. It's also running in other newspapers (including USA Today and New York Times).
If you can't read the text, here's what it says:
FLASH WEBSITES?
THERE'S A PHONE FOR THAT.
Introducing the new Droid 2 by Motorola.
Flash sites require Flash capabilities. Seemed pretty simple to us. That's why we created DROID 2. With Adobe Flash Player it gives you unrestrained access to Flash sites, videos and games. No more empty windows or half-loaded pages. And as a 3G Mobile HotSpot, it can connect up to 5 Wi-Fi enabled devices and conquer the World Wide Web. It's compromise-free web browsing. The way it should be....
Posted by Ben Forta on Sep 03, 2010
|
I'm very pleased to have been accepted as a speaker for Scotch on the Rocks 2011! Wow! What an incredible line up of speakers! It's going to be an awesome conference!
SOTR 2008 was incredible so I was very sorry to have missed SOTR 2009 - due to my wife breaking her ankle! Schedule and finances got in the way of me even considering SOTR 2010.
So what will I be speaking about?
To be honest, I don't know. Topics will be announced in about five or six weeks. I submitted three suggestions to the SOTR folks. I don't know what they'll pick.
But I want to open it up to everyone who'll be at SOTR 2011 - what would you like me to talk about? If there's a strong preference for a topic, even if it isn't one that I submitted, we'll see what we can do about accommodating your choice!...
Posted by Sean Corfield on Sep 02, 2010
|
Google announced the Second anniversary for its Chrome browser today and I'm sure that Chrome has entirely changed our browsing experience in many ways. I've been using Chrome as my default browser from the day of its release because it's faster than Firefox, it's starts quickly, light weight, number of very useful extensions for developers, utilize very less CPU memory and many more. [More]...
Posted by Akbarsait ColdFusion Web Log on Sep 02, 2010
|
Google announced the Second anniversary for its Chrome browser today and I'm sure that Chrome has entirely changed our browsing experience in many ways. I've been using Chrome as my default browser from the day of its release because it's faster than Firefox, it's starts quickly, light weight, number of very useful extensions for developers, utilize very less CPU memory and many more. [More]...
Posted by Akbarsait ColdFusion Web Log on Sep 02, 2010
|
you're like the herpes of the internet, theres 50000000 CF forums and everytime i read a thread going "ah this is the issue i have, i really don't want to do it this particular way" there you are answering why you should do it like that, very ann......
Posted by Charlie Griefer on Sep 02, 2010
|
Today I identified a subtle bug with the listObjects method of AmazonS3.cfc dealing with delimiters. If you supply a prefix that ends with a trailing delimiter, certain paths would be returned partially truncated. Removing the trailing delimiter solves the issue, so there's an easy workaround, but I've added a snippet to take care of that [...]...
Posted by barneyb.com on Sep 02, 2010
|
Today I was working on creating a CSV file that required numeric columns to be a fixed number of digits, using leading zeros to make up the difference. So, for example, if the column required 5 digits, the number 123 should show up as 00123. This is super simple using the NumberFormat() function in CFML, simply specify a mask like so:
#variables.myNum#
But, in my particular case, I had several columns that required 12 and 15 digit numbers.
[More]...
Posted by Eric Cobb on Sep 02, 2010
|
Does anyone else have this annoyance? Whenever I open a large file in CFBuilder (built on Eclipse), I see a little notice at the bottom saying "Refresh Content" and it always tends to freeze my IDE. It can occur several times per minute. I've search and found no solution.
aR_BgColor="";
aR_FgColor="";
aR_url="http://www.bytestopshere.com/post.cfm/eclipse-annoyance-refresh-content";
aR_title="Eclipse Annoyance: \"Refresh Content\"";
aR_StarType='0';
document.write('');
document.write('');
...
Posted by Sam Hoda on Sep 02, 2010
|
A buddy of mine who has the original Motorola Droid just got an Android OTA update, and thus Flash Player 10.1. Droid owners, rejoice!...
Posted by Ben Forta on Sep 02, 2010
|
I use jQuery…a lot. It just makes JavaScript development much easier for me. Every so often, I may come across a site where I want to poke around and see what’s going on under the hood. In many cases, jQuery is being used so it’s simple to spark up Firebug and leverage jQuery to work [...]
Related posts:Use ScriptSrc.net to Copy and Paste the Script tag for Your Favorite JavaScript Library One of the things I hate about using CDNs is...
Not Using jQuery JavaScript Templates? You’re Really Missing Out. In preparation for my upcoming talk on jQuery Templates, I’ve...
jQuery JavaScript Templates Tutorial: Nesting Templates In my last post, I presented an intro to how...
Related posts brought to you by Yet Another Related Posts Plugin....
Posted by Rey Bango on Sep 02, 2010
|
Check out the new MAX Unawards, a new way to reward yourself for all your hard work (or for the lack thereof, or whatever else tickles your fancy). Fun stuff!
...
Posted by Ben Forta on Sep 02, 2010
|
The other day, I was using CFThread to call a ColdFusion component method asynchronously. Typically, when I use CFThread, I define my CFThread tags in the controller. In this case, however, I was making the asynchronous call from within the context of the component itself. This works very well. But, but there are some minor variances in scope-behavior that depend on how the asynchronous method is invoked. Before we get into the CFThread / scope interaction caveats, however, I thought I' ... Read More »...
Posted by Ben Nadel on Sep 02, 2010
|
...
Posted by Ricardo Parente on Sep 02, 2010
|
...
Posted by Ricardo Parente on Sep 02, 2010
|
Well I've decided to start getting back to blogging after a year long hiatus. I really don't have a lot to say on this return post except that it's officially been one year since I've done any other writing and I figured that it's time to get back to the SEO Blog.
That's It.
:-)...
Posted by Edward Beckett on Sep 01, 2010
|
Ok, so this probably falls into the realm of "Obvious", but both myself and a reader were surprised by this. Credit for it goes to John Pansewicz. He pinged me earlier this week saying that ColdFusion 9's multi file uploader failed to work for him. No matter what he uploaded he got a bad result. I tried the same code on my machine and saw nothing wrong. Then John figured out that it was ColdFusion debugging breaking the response. Again - obvious - but I tend to only worry about debugging when running against CFCs and Ajax applications. The multi file uploader is a Flash application and it just didn't occur to me that I had to be concerned about it. However - if you look at the docs for the feature (see here) you can see that JSON must be output to the control for it to know how the files were processed. Anything that breaks that JSON (including ColdFusion debugging) will make the control think the files had an error during the upload.
Finally - don't forget that you can turn off debugging on a request by request basis. Don't think you must completely turn off the feature if you have one bit of JSON in your local project. Just make use of the cfsetting tag to disable it for that particular request.
...
Posted by Ray Camden on Sep 01, 2010
|
Typically, when we want to include an image in a web page, we use an IMG tag with a SRC value that points to a file located on the server (ex. my_image.jpg). Modern browsers, however, allow us to embed images directly in the page markup as Base64-encoded "data urls." For caching and performance reasons, you generally wouldn't want to use data urls to define your images; however, in some cases, it's tremendously useful to serialize and reference an image without needing an additional HTTP requ ... Read More »...
Posted by Ben Nadel on Sep 01, 2010
|
If your computer is like mine you have a host of things installed: ColdFusion Database server Web server Version control server Mail server ???? By default I always set all these services to disabled so when I boot my computer I don’t have to wait 30 minutes for everything to start up. And it’s possible [...]...
Posted by The Crumb on Sep 01, 2010
|
For those who haven’t installed the latest hotfix for ColdFusion 9.0.1 from Adobe, here is the link: http://kb2.adobe.com/cps/862/cpsid_86263.html...
Posted by Ricardo Parente on Sep 01, 2010
|
I spent quite a bit of time playing with Clojure over the weekend (including writing my first plugin and my first hook for Leiningen, Clojure's popular build tool) and I started experimenting with reading data from a database. I tweeted that I was pleased with myself for succeeding and Marc Esher asked "is reading data so hard in clojure that it warrants celebration?" so I figured I'd post my little example, so you could see how easy it is (or isn't, depending on your point of view).
(ns sean.core
(:use [clojure.contrib.sql :as sql])
(:gen-class))
This just declares a namespace for my code to live in - the file is sean/core.clj - and says I'm going to be using the library package clojure.contrib.sql under the alias sql. :gen-class says I want the file compiled to a Java class.
(def db {:classname "com.mysql.jdbc.Driver"
:subprotocol "mysql"
:subname "//127.0.0.1:3306/mydb"
:user "dbuser"
:password "secret"})
This declares the datasource I'm going to use, MySQL, locally, database 'mydb' with the credentials I'm using to login.
(defn print-users
[] (sql/with-connection db
(sql/with-query-results res
["SELECT * FROM user"]
(doseq [rec res]
(println rec)))))
This declares a function print-users taking no arguments [] which reads all users from the 'user' table and prints them out (they are automatically formatted as records with key: value pairs for columns). I'll explain this in more detail below...
Posted by Sean Corfield on Aug 31, 2010
|
|
«« Previous
Next »»
|
|