I know what you're thinking--why would you want to use Oracle for your node backend when you have perfectly good options like mongo and the like? You know the old saying: "When in Rome, etc.". The business enterprise is quite likely Rome, and Rome likes its Oracle, baby.
My coding buddy Aaron Frost tamed this beast (to mix metaphors), so credit where it's due. I mostly watched and told him to use "sudo" in a couple of places. In this article we'll walk you through how he did it using one of two available drivers (as of ...
BusterJs is a still-in-beta library that allows for testing your Javascript. It's got a wealth of cool features. The browser capturing is awesome for running your Javascript directly in the browsers you choose from one runner. You can also execute within Node. In short, it rocks. But, how to get this rockin' with your project, specifically your AMD RequireJs with BackboneJs combo project is the lock that must be opened before daily buster love can be had.
When you run a shell script or some other process from NodeJs and want to get the output in a stream to a client, you can redirect or pipe the output from the process that originally outputs to stdout into your socketio stream.
NodeJs can do many things. It can even run things that it can't do itself. For instance, I have a shell script that I don't want to rewrite in Javascript, so I want my Node app to run the shell script. No problemo.
When you connect to a remote server, you're connecting over ssh or scp or a similar protocol. In each case, you may have to provide some authentication credentials to prove you are who you say you are. This can come in the form of a user/password combo, but if you're connecting a lot or if you're trying to setup a non-interactive connection, this can become either really monotonous or really problematic. Public/private keys will come to our rescue, and we'll never need to enter our password again.
Often when building a single-page app, you'll want to optimize all your js into a single asset. RequireJs is a great mechanism for managing your js dependencies. It also comes with a great build tool for doing the optimization (r.js). But sometimes you won't want to put all your js into a single asset. For instance, perhaps you only want to load a large chunk of code when the user interacts with the app so that you know he intends to use that functionality, and so you load it dynamically. But, you still want that dynamically-loaded set ...
The days of writing one version of an application are pretty much gone. Most likely you want to have your app run on a desktop and various mobile devices. Having said that, there are ways to make your app responsive to the screen size it will run on with a lot of code reuse.
Enter device detection and profiles with Sencha Touch 2.
Have you ever tried to start up a local dev server and attach it to a port only to find that the port says it's already in use. Here's a quick way to find those zombies and kill 'em good.
Through long-available browser quirks/features, javascript has been available for requests across disparate domains. But, other resources, such as text files (eg, handlebars templates) have had more restrictions placed on them. Recently, CORS support has enhanced the ability to make these requests. Here's how you get your text files from another domain via requirejs.
Don't you hate developing a blasted simple webpage that does some asynchronous requests that gets you into cross-origin policy trouble. If you just read a `.html` file off the file system, this will bite you. But, it's easy to get around. Just host your .html file on a simple http server. And it's easy to make that happen. Here's one way.
iPhone is so, like, yesterday. Is Boot2Gecko the future? Could be, if it's as easy to create apps for as the Boot2Gecko blog makes it out to be. Here is my experience with creating an HTML5 webapp, making it "installable" on Boot2Gecko, and installing it on my Nexus S phone running B2G. It really was pretty easy. Really.
Mozilla announced the Boot to Gecko project late last year. I picked up an unlocked Nexus S and took a weekend to build B2G and flash the the phone with it. I've distilled what I did down to a few easy-to-follow steps. Well, forget the 'few' part. And maybe the 'easy-to-follow'.
HandlebarsJs is a great Javascript templating engine. It's pretty much Mustache templates on steriods -- or Rogaine or something like that. Well, there's a great for loop, but it'd be cool if it had a loop index built in. It doesn't have one as of the current version (1.0.0.beta.6). But, we can make an easy helper.
When ordering a sequence of items in XQuery, sometimes it's desirable to be able to decide the order based on a parameter value (something dynamic). XQuery doesn't look extremely elegant when it comes to this feature, but depending on exactly what you want, you should be able to get the job done.
Windows7 allows you to create a homegroup for easy file sharing, printer sharing across all the computers on your network. However, apparently you are limited to a single homegroup on the network. What if you wanted to create a new one. Here's a little undocumented trick that I found out today.
BackboneJs is a great resource for creating rich UIs. Rich means interactive. Interactivity grows when the client can do more of the work of an application itself, becoming more reactive and dynamic to user feedback, able to be more event-driven, and hopefully more quick and responsive. Here's a short history of how we've been creating rich UIs and a simple example of a rich UI in backbonejs
In developing a mobile web application, it would be ridiculous to avoid writing javascript unit tests. After all, they are simple to write and run. Recently, I implemented running our already existing Jasmine tests using PhantomJs and integrated this process into our continuous build environment. Works smooth!
If you have to store your text strings for internationalization (i18n) on the server, that's one thing. But, if you can store them in Javascript, you might think about using RequireJs and its i18n plugin, because it makes it nice and easy.
Our app throws all sorts of exceptions. Well, it doesn't usually. It shouldn't normally. Er... But, when it does we want to put in some handling so that the app doesn't blow up in some unsuspecting user's face. And even then, sometimes we want special handling for certain exceptions and make sure others are just caught. And that's what we'll do with AccessDeniedException.
Spring Security (previously Acegi) gives you an awesome AOP way of locking down methods in your Java application. And well-placed lock down is a special power indeed. However, Spring disappoints a bit on this score because it turns out its default behavior is to 'or' the roles listed in @Secured annotation. You'd think the default would be the stricter 'and', but alas. But never fear, there is hope.