Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

Valentin Crettaz

Author & Gold Digger
+ Follow
since Aug 26, 2001
Valentin likes ...
IntelliJ IDE Java
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Valentin Crettaz

Thanks for having us here!

Congratulations to the winners!
2 years ago
In the book, event streaming is introduced with a very simple example that leverages NSQ, a popular distribted pub/sub messaging platform, so yes it is definitely possible.

However, an interesting aspect of event streaming is the ability to process AND re-process it (in different ways by different components at different times), which pub/sub messaging platforms have a hard time achieving since when a message has been consumed by all subscribers/consumers, it's gone forever, unless you store it somewhere and can reinject it later.

So Kafka and Kinesis are popular because the production of messages and their consumption are completely decoupled and messages are kept on the log for a configurable time, which makes it possible for consumers to process and reprocess messages/events as many times as they'd like.
2 years ago

Yury Nebieridze wrote:Question: is Kinesis better platform than Kafka?

The quick answer is: neither one is better, each has its pros and cons. For instance, one of the biggest difference is that Kafka provides eternal retention, while Kinesis (only) at most one week.

Kinesis is better connected to all the other AWS services, even though it is now possible to easily spin up a Kafka cluster in AWS using AWS Managed Streaming for Kafka instead of having to install a vanilla Kafka on EC2 all by yourself.

You can find plenty of good comparisons between both technologies, for instance
2 years ago
Hi Raghunatha,

Please note that posts in this welcome thread are not eligible for the drawing, and should be reserved for welcoming the author. Questions posted in this topic are subject to removal.

So I invite you to create another thread in the forum with your question.

Thanks for your understanding
2 years ago
Very happy to be around for this week's book promo! Thanks Javaranch!

Go ahead and shoot all the questions you have! Yeeehaaa!!!
2 years ago
will it work if I simply group this regex as follows:

Nope, the ()* must be within the regular expression, i.e. within the /.../

Try this
For trimAll, I would take special care if the function is applied on a string that contains HTML tags, because the space(s) between attribute values are going to be removed.

"<table border='0' class='myTable'>".trimAll();
would yield
which is not good.

Instead, I would declare trimAll as follows:
String.prototype.trimAll = function(replaceStr) {
return this.replace(/\s+/g,replaceStr || "");

That way, if replaceStr is provided, the spaces will be replaced by it otherwise, the empty string is used by default.

"<table border='0' class='myTable'>".trimAll(" ");
correctly yields
<table border='0' class='myTable'>

Of course, if you have left and/or right spaces, you'd have to left/right-trim them as well
The links contain both a solution for IE and FF.

Your code, however, won't work if Flash is not available or cannot be installed for security reasons (i.e., in highly secure intranets!)
I'm backing Bear here. We've been developing a huge ebanking system for a famous private banking institution and there is a good load of Ajax in there Of course, there are more things to think about when using Ajax because there are more possible execution paths, but in the end if you do your analysis correctly, this should not be a problem.
You can either use a hidden field as Bear proposes, but you can also make your button behave that way using:

<button type="submit" name="command" value="READ">Read</button>
<input type="submit" name="command" value="READ" />
Yes, basically the dot is used to denote a CSS class name in a selector. The only way around is to do how Bear proposes, i.e. to escape the dot.
For what it's worth, what bothers me most with GWT are the following issues.

1. It is very difficult to have a graphical designer working on the team. The problem here is that GWT generates everything (HTML, CSS, JS) for you and the only place where you have a hand on is setting a CSS class name for a given GWT component. You don't get to tweak the HTML, CSS or JS, even though you can bring your own CSS and JS files into the GWT mix. On one project we started last year, we had to turn down GWT for this very reason. We had a graphical designer and an HTML integrator (who is not a Java developer!) on the team and we could not think of a consistent and productive way to work with them using GWT. Designing new graphical components that are not in the base library will require efforts on the part of your Java developers . And, well... Java developers are not the best persons to do this kind of things (Fact: 90% of Java developers, myself included, suck a graphical design!). Usually, a graphical designer does that and an HTML integrator transforms the Photoshop sketches into HTML/CSS/JS. With GWT, you can send the HTML integrator guy at home and ask a Java developer to do it in its place... or teach the HTML integrator guy to develop in Java...

2. You have to decide in advance what gets generated. That is, GWT will generate a huge amount of files depending on your needs. For each browser and each language to support, there is going to be a copy of the website. For instance, if you have to support IE6, IE7, FF, Opera, Safari and Konqueror in English, French, German and Chinese, you're going to have 24 web sites generated for you. Then all the magic happens when the user connects to your site. GWT detects the user agent and the language and serves the correct files to the user. This has the advantage of having a ~100% compatible website for every user, but adds some runtime and compile-time overhead.

3. Everyone looking at the source will know that your website has been generated by GWT (a META tag says which Java class is backing up the page being viewed). Looking at it from a security perspective, I personally can't stand the fact that users know what kind of technology is used behind my application. The more they know, the easier they will find out what kind of security issues your website is vulnerable to.

Thus, my personal opinion on GWT is that it is fine to use it if:
- you don't have to care too much about global UI constraints and pixel-precise look&feel accuracy
- you don't have too many browsers and languages to support
- security is not of primary concern to you
[ September 23, 2007: Message edited by: Valentin Crettaz ]