Web application with Node.js and WPF client-side - is it viable? - javascript

I'll take part in a beginner Node.js course in a month and since I want to make myself at least a bit familiar with Node in advance, I'm wondering what client-side technology to use with Node(mainly for studying and fun). While javascript would be an obvious answer, I'm kind of more interested in using WPF to create a client application. Since I'm far from an expert in both fields, I have the following questions:
Is it meaningful to use WPF and Node.js together?
What are the pros and cons to a WPF/Node combination?

Related

javascript library in my Java project?

I am working on a project in Java that involves designing a speedometer. I am looking for any libraries that I can possibly use. However, I found a lot of such "gauge libraries" for javascript. Is there any way I can implement this javascript library in my project Java?
I think its all depend on the architecture of your application, for example building a reactive application on the JVM, using a technology like Vert.x will allow you to do that.
I strongly recommend vert.x, you will find a lot of magic there

Clientsided data-cleaning and analysis with sturts2

right now I'm trying to implement a webapp that does data cleaning and analysis and I have already a prototype written in Java. For the analysis part I tend to use WEKA (http://www.cs.waikato.ac.nz/ml/weka/). Because of performance reasons I thought it might be a good idea to let the client do most of the work. I started to learn struts2 and I have no experience using JavaScript. My questions are:
Is struts2 the right choise for this task?
Should I write a Java Applet or can it also be done by Java Script?
I don't have enough experience nor have I found a good solution searching the internet. Can you perhaps post some tutorials or websites that might help me with my questions?
If you want to do it client-side then you need to distribute an app, or use an applet. JavaScript is not Java, and you can't use the browser's JavaScript to run Weka.
If you want to do it client-side, why are you trying to implement a web app?
Struts 2 is fine, but it depends on what you're actually doing. There are many JVM-based web frameworks: Spring MVC, Grails, Play, etc. If you want to move analysis onto the client it probably doesn't matter what framework you use, but it's impossible to say from the info you've provided.

rapidly create webpage front end

Exposition:
I'm familiar with C/C++/Scheme & OpenGL. I have this client/server program written in Clojure that serves as a todo-list/wiki/forum. The server is written in Clojure. The client is written in Clojure and uses SWT.
Question:
I want to rapidly create a web client version of this. What is the best way to do this? (I Don't use anything complicated, like OpenGL rendering in SWT; just standard widget stuff) I just want something accessible via Safari/Firefox -- and no, I don't want to run it as a Java Applet.
Thanks!
Take a look at Ruby on Rails, allows you to create very basic CRUD applications quickly. Personally I am looking more a Grails a very similiar framework but for a Java platform
Ruby On Rails - http://rubyonrails.org/
Failing either of those PHP is a good alternative and very quick to get started with
Adobe Flex/Actionscript is a pretty good approach for applications that require rich user interaction.
Google Web Kit allows writing of Java code (since server is in Clojure) to create AJAX api.

Starting out with rails. Suggestions for SDKs plug-ins etc?

I have 6 years of C# programming experience and I'm looking to broaden my horizons. I'm going to build a simple web app to demonstrate knowledge of Ruby on Rails so I can get my foot in a place that might want a Rails programmer. It's the hot new thing, so I want to be marketable.
Anyway, I have been playing around with solr and tomcat and I want to use solr as a search engine for a products database. This means that I will be using some java (tomcat and solr) and for the web app I will be using MSSQL because I'm using Windows. A friend suggested that I look into jRuby because if I'm going to be working with tomcat, it makes sense to put it all on one webserver. I want to use Eclipse as my editor. I hear that rails programmers typically use prototype as their java selector tool but I really like jQuery (or even mootools). I have also heard that jRails is something that ties jQuery to my ruby application.
Given that I use tomcat in conjunction with jRuby using Eclipse as the IDE, what would you suggest I use for handling javascript/ajax and what are some useful plug-ins, software, or tips you have for me that can help me get started on the right foot with ruby on rails?
I would stick with jQuery for your JS/ajax. My perception is that the RJS/Prototype is falling out of favor to jQuery but that could be just me. Where jRails would fit in is if you want to use RJS to generate JavaScript from Ruby code. My personal preference is to keep all of my JavaScript in application.js and keep it unobtrusive.
Some plugins I like are Authlogic, Nifty Generators, Paperclip, ssl_requirement, subdomain-fu, and QueryTrace.
A couple good resources for starting out are Rails Guides and Railscasts. I think it's a good idea to learn the language itself before learning the framework, but I'm sure it's possible to develop a simple Rails application with minimal Ruby knowledge.
As for your application stack, I would recommend reconsidering deploying a Rails app to Windows. Even developing a Rails app on Windows will likely be painful. If you can, I'd get a VM (or old machine) running with Ubuntu and use MySQL. If you're looking for a full text search on Rails you could use Thinking Sphinx - here's a Railscast if you're interested. I'd also give a gentle nudge into trying a Text Editor instead a full blown IDE - I like TextMate on OS X and gedit on Linux.
I also had a Microsoft background when I decided to learn Rails. There was a lot for me to take in - Not having the framework pretend the web is stateful (asp.net), learning a new language, learning a new framework, getting stronger css/html/javascript skills, new OSes (OS X and Linux for me), learning new databases. Overall I'm very happy I did. I'm a better developer for it.
If you want to be marketable, I'd start with learning the lowest common denominator, the default Rails stack, to get broad appeal. Then maybe consider acquiring some more niche skills to raise your value to a subset of potential clients/employers.
That pretty much means targeting MRI 1.8.6/7, Rails 2.3.4 (consider learning at least HAML and rspec in addition to erb and test/unit) and MySQL in an Apache *nix world.
I wouldn't recommend learning much about deploying to a Windows stack - the target for servers is overwhelmingly Linux or perhaps some other *nix flavour. For development web server purposes, Mongrel works fine on Windows.
Build on Windows by all means - I do, without too much pain - but be aware that the visible part of the Ruby/Rails community (the people who mostly develop the libraries and frameworks and most of those who write about it online) are predominantly OSX or Linux users, so there's often a delay in the trickle-down to Windows users, especially where OS interaction is called for or where there are compiled elements to libraries. Also, I'm reliably informed that Rails startup is much slower on Windows. I don't want to confirm it personally - I might get upset.
MSSQL works fine with Rails, but I'd be cautious about using any platform-specific features for reasons mentioned above: you're unlikely to find a site that will be happy to deploy to a mixed Win-*nix environment. The MSSQL ActiveRecord code may also not be quite as hardened as MySQL or SQLite - the one bug I ever found in any version of any Rails-related code was in there. That said, if you don't use any MS-specific features you'll find porting easy. But then if you don't use any extra stuff, why not skip it completely? There are enough differences (the query "optimizer" in MySQL for one takes some getting used to) that you're probably better off learning the platform you're most likely to be targeting.
As for Eclipse, it's obviously a mature development environment but I'm not sure how good the Rails plugins are (and as a hostage to Lotus Notes I'm allergic to using Eclipse any more than absolutely necessary). If you can't live without an IDE (and I'd recommend that you try - you'll learn more) then there are several SO questions that cover the alternatives.
Using Solr in your project doesn't require that you have a Java stack for running the actual Rails app. There are quite a few Ruby libraries out there that would help you easily interface with the Solr backend. A few to look at:
solr-ruby – This is the official client library included with the Solr distribution. It's lower-level than some of the other alternatives, but gives you some good flexibility in accomplishing what you need to.
rsolr – Another lower-level library that looks like a replacement to solr-ruby. At first glance it appears to be more frequently updated.
sunspot – I have not used this, but it looks like it's currently the most popular Solr => Ruby object mapping library. The acts_as_solr library was once an option, but I think that it has since fallen out of favor.
I agree with the other posters that you would want to target a C Ruby / *NIX environment, but if using Tomcat/JRuby helps you learn this faster, go for it.

Will server-side JavaScript take off? Which implementation is most stable? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Does anyone see server-side JavaScript taking off? There are a couple of implementations out there, but it all seems to be a bit of a stretch (as in, "doing it BECAUSE WE CAN" type of attitude).
I'm curious to know if anyone actually writes JavaScript for the server-side and what their experiences with it have been to date.
Also, which implementation is generally seen as the most stable?
I like to read Googler Steve Yegge's blog, and recently I came across this article of his where he argues that Mozilla Rhino is a good solution for server-side JS. It's a somewhat sloppy transcript, you might prefer to watch the video of the talk. It also offers a little bit of insight on why he thinks server-side JS is a good idea in the first place (or rather, why he thinks that it's a good idea to use a dynamic language to script Java). I thought the points he makes were convincing, so you might want to check it out.
A while earlier, he also posted something about dynamic languages in general (he's a big fan of them), just in case you were wondering why to use JS at all.
Why would you want to process
something in Javascript when you can
process it in PHP or ASP.NET which are
designed specifically for this task?
Perhaps because JavaScript is a more powerful programming language than those two? For example, it has functions as first-class data types and support for closures.
Steve Yegge has blogged about porting Ruby on Rails to server-side JavaScript as an internal project within Google ("Rhino on Rails"). He did it because he likes Rails but using Ruby isn't allowed within Google.
Before it was acquired by Google, JotSpot used server-side JavaScript to let you query their database and display your pages. They used Rhino to do it. CouchDB uses server-side JavaScript to create views of their database.
As you can see from these examples, a great way to use JavaScript on the server is for plugins. One of the reasons it's used is that you can create a very isolated sandbox for people to run their code in. Also, because of the way that JavaScript as a language works, you can provide a user tooling specifically honed to the tasks your users need to complete. If you do this right, users don't need to learn a new language to complete their tasks, a quick glance at your API and examples is enough to get them on their way. Compare this to many of the other languages and you can see why using server-side JavaScript to provide a plugin architecture is so enticing.
A secondary popular solution, one which can be seen through a project like Jaxer, is that a common problem of web applications that do client-side validation is that, since JavaScript is easily bypassed in the browser, validation has to be run once again on the server. A system like Jaxer allows you to write some validation functionality that is reusable between both server and client.
Support for JS on the server has been getting stronger and the number of frameworks is getting bigger even faster.
Just recently the serversideJS group was founded. They have a lot of smart people that have been working on serverside JS for years (some of them more then 10).
The goal for this project is to create
a standard library that will
ultimately allow web developers to
choose among any number of web
frameworks and tools and run that code
on the platform that makes the most
sense for their application.
to the people who say "why would you choose JS over java or any other language?" - you should read this Re-Introduction by Crockford and forget about the DOM - the DOM is superugly, but that's not JS fault and JS is not the DOM.
I've never even heard of this, but it strikes me as using the wrong tool for the job. Since programming languages are just tools designed to help us solve some problem.
Why would you want to process something in Javascript when you can process it in PHP or ASP.NET which are designed specifically for this task?
Sure you can pound a nail in with a screw driver, but a hammer works much better because it was actually designed for it...
So no, I don't see it taking off.
Well, plain ol' ASP supported JavaScript server-side years ago and everyone onad their dog used VBShiate instead. But I have to agree with the others: JS does not seem to be the right tool here - and I love to do client-side JS :)
I personally did a whole site in server side JavaScript using ASP. I found it quite enjoyable because I was able to have some good code reuse. This included:
validation of parameters
object modeling
object transport
Coupled with a higher-level modeling tool and code gen, I had fun with that project.
I have no numbers on perf unfortunately, since it is used only on an intranet. However, I have to assume performance is on par with VBScript backed ASP sites.
It seems like most of you are put off by this idea because of how unpleasant the various client-side implementations of Javascript have been. I would check out existing solutions before passing judgment, though, because remember that no particular SS/JS solution is tied to the JS implementations currently being used in browsers. Javascript is based on ECMAScript, remember, a spec that is currently in a fairly mature state. I suspect that a SS/JS solution that supports more recent ECMA specs would be no more cumbersome than using other scripting languages for the task. Remember, Ruby wasn't written to be a "web language" originally, either.
Does anyone see Server-side Javascript
taking off?
Try looking at http://www.appjet.com a startup doing hosted JavaScript applications to get a feel for what you can do. I especially like the learning process which gently nudges the user to build things with a minimal overhead ~ http://appjet.com/learn-to-program/lessons/intro
Now it might seem a weird idea at the moment to use JavaScript but think back when PC's started coming out. Every nerd I knew of was typing away at their new Trash-80's, Commodore64's, Apple ]['s typing in games or simple apps in BASIC.
Where is todays basic for the younger hacker?
It is just possible that JavaScript could do for Web based server side apps as BASIC did for the PC.
XChat can run Javascript plugins.
I've some accounting software completely written in Javascript.
There's this interesting IO library for V8: http://tinyclouds.org/node/
CouchDB is a document database with 'queries' written in Javascript (TraceMonkey).
Considering this, i believe, server-side Javascript did take off.
Server-side programming has been around for a lot longer than client side, and has lots of good solutions already.
JavaScript has survived and become popular purely because developers have very little choice in the matter - it's the only language that can interact with a DOM. Its only competition on the client side is from things like Flash and Silverlight which have a very different model.
This is also why JavaScript has received so much effort to smart it up and add modern features. If it were possible for the whole browser market to drop JavaScript and replace it with something designed properly for the task, I'm sure they would. As it stands Javascript has strange prototype-based objects, a few neat functional programming features, limited and quirky collections and very few libraries.
For small scripts it's fine, but it's a horrible language for writing large complicated systems. That things like Firefox and Gmail are (partly) written in it is a heroic accomplishment on their part, not a sign that the language is ready for real application development.
Flash Media Server is scripted by using Server Side Action Script, which is really just javascript (ECMAScript). So, I do it a lot. In fact, most of my day was dealing with SSAS.
And I hate it. Though to be fair, a bunch of that is more related to the (not so great) codebase I inherited than the actual language.
I think server-side Javascript is guarenteed to take off. Its only a matter of time.
Mozilla, Google, and Adobe have so much vested interest for Javascript that it would take a miracle to dislodge it from the browser world. The next logical step is to move this into the server-side.
This is a step towards moving away from the hodge podge of Internet technology that usually includes all of these
HTML
CSS
Javascript
Serverside Language J2EE/ASP/Ruby/Python/PHP
SQL
I haven't heard much about the current state of Javascript Server frameworks, except that they are mostly incomplete.
I see server-side js will offer considerable advantages in future applications. Why? Web apps that can go offline, client-side db store, google gears, etc...
Following this trend, more and more logic are moving into the client-side. Use an ORM that works for client-side, and use another on server-side (be it PHP / Ruby / whatever), write your synchronization logic twice in two different languages, write your business logic twice in two different languages?
How about use js on the client AND the server side and write the code once?
Convincing?
Personaly i've been developing and using my own JavaScript framework for about 4 years
now.
The good thing about JS on serverside is that implemented in ASP Classic you don't need
any other plugin or software installed, besides i'm also using my javascript (client)
framework on my server, that allows me to enjoy of the same functionality and proven
performance of my functions at both environments client and serverside.
Not only for data validation, but also lets say HTML or CSS dynamic constructions
can be done client or serverside, at least with my framework.
So far it works fast, i have nothing to complain or regret except its great usability
and scalability that i have been enjoying during this past 4 years, until the point
that i'm changing my ASP Classic code to javascript code.
You can see it in pratice at http://www.laferia.com.do
Node.js has taken off and proven that server-side JavaScript is here to stay =)
I can't see most developers getting over their distaste for client-side JavaScript programming. I'd rather go to Java for server-side stuff before choosing JavaScript.

Categories

Resources