Comment by Thomas on Tokenize String for words including non-word characters
This works, I thought using word delimiters (\b) would be in a way more save, but I can't think of an edge case right now where this applies, so your solution should work totally perfect, thanks.
View ArticleComment by Thomas on Suddenly getting SQL Exceptions when using sql variables...
Good suggestion, I will try this. Strangely, in other parts of my application, the driver has no problems to prepare it in one step.
View ArticleComment by Thomas on Suddenly getting SQL Exceptions when using sql variables...
The actual statement is far more complex and has variable calculations in it, that can not just be set externally without prior calls.
View ArticleComment by Thomas on SQL Statement with bad performance, although using index
This seems to be right, when I use the SQL_NO_CACHE option the query always takes 20 seconds.
View ArticleComment by Thomas on SQL Statement with bad performance, although using index
This is what EXPLAIN shows: SIMPLE; key_event_reports; ref; report_model_id_2,get_latest_report; report_model_id_2; 4; const; 8873835; Using where, Using index
View ArticleComment by Thomas on SQL Statement with bad performance, although using index
Unfortunately this is used for real-time data, so execution time matters a lot in this case. We get a live feed of messages, which are analyzed in real-time with scores falling into different groups,...
View ArticleComment by Thomas on SQL Statement with bad performance, although using index
This solved the problem perfectly. Both queries are running very smoothly now. Thank you for saving my day!
View ArticleComment by Thomas on How to concatenate a list with conditional entries to...
Thanks for the answer. This is basically how I did it before and it's feasible when you have three columns, but not if you go beyond that.
View ArticleComment by Thomas on How to concatenate a list with conditional entries to...
I like the trim solution.
View ArticleComment by Thomas on How to run Tensorflow on CPU
@Crashalot: This is not true. Look for various benchmarks for interference, CPUs are an order of magnitude slower there too.
View ArticleComment by Thomas on How to reference the latest Stream of a DynamoDB table...
Thanks Laurent for your answer. Unfortunately, I don't have access to the original DynamoDB Cloudformation definition, when I need to reference the Stream ARN, those two things can happen in entirely...
View Article.apply without changing scope
I want to use the JavaScript .apply method to functions of a thrift compiled for Node.js. The thrift .js file has code like this:...var NimbusClient = exports.Client = function(output, pClass) {...
View ArticlePattern for continuous rule matching
I have a continuous stream of messages which are analyzed. The analysis returns different variables, like author, topic, sentiment, word-count and a set of distinct words. Users in the system are able...
View ArticleTokenize String for words including non-word characters
I want to tokenize Twitter messages including hash- and cash-tags. A correct example for tokenization would be like this:"Bought $AAPL today,because of the new #iphone".match(...);>>>>...
View ArticleSession lifetime in node.js with express and MongoDB
I am using node.js with the express framework. As a session store I am using MongoDB. How can I set the lifetime after which the session objects are removed from MongoDB. This is how I am doing the...
View ArticleWhy is my custom Error object converted to a String by the Express router?
I am using custom Error objects in node.js (0.8.12) with express (2.5.8). When errors occur, I want to route them to my custom error handler, but my custom Error objects are converted to Strings, while...
View ArticleHow to pass values to a callback function at the time of the request call?
I have the following situation:var foo = [ 0, 1, 2 ]for (var i in foo) { Asyncstuff.get(URI).on('response', function(res) { console.log(i); } });}Because the .on('response',...) is called in an...
View ArticleRemote monitoring of system stats with node.js
We have implemented a monitoring solution in node.js, which does some basic checks for database integrity and API up-time. We want to expand this system to collect basic system stats of our Linux...
View ArticleUsing a selfdefined ObjectId and avoiding double entries in Mongoose
I am getting JSON objects through an external API in node.js and want to store them in MongoDB. I defined a model like this:var Product = new Schema({ id: ObjectId, name: String});And now I'm trying to...
View ArticleHow to get the pure raw HTML of a page in HTMLUnit while ignoring JavaScript...
I just want the text content of page and I want the fetching to be as lightweight as possible. Can I turn off all the parsing and additional loading of JavaScript, CSS and other external content that...
View ArticleProblems with OAuth on node.js
I am trying to get OAuth to work on node.js. I found this in the documentation of node-oauth:var OAuth= require('oauth').OAuth;var oa = new...
View ArticleMake HTMLUnit less verbose
I am using HTMLUnit to crawl pages and my log keeps getting cluttered by HTMLUnit output. I.e. It send a whole pages HTML to the log if it returns a 403 status-code.I tried the following to put it...
View ArticleExcluding large sets of objects from a query on a table with fast changing order
I have a table of products with a score column, which has a B-Tree Index on it. I have a query which returns products that have not been shown to the user in the current session. I can't simply use...
View ArticleNon-blocking HTTP calls in Storm with php
I am evaluating to built a webcrawler using Storm (the real time framework, not the IDE). My Spout would deliver a Stream of URIs, which have to be called and retrieved in the first Bolt, which is...
View Articlelog4j kafka appender doesn't use defined ConversionPattern
I am running a Storm cluster which uses log4j for logging. I want to add a kafka appender in addition to the standard file-based logging. My log4j config file looks like this:log4j.rootLogger=INFO,...
View ArticleTool to visualize cloud architectures
Is there a good tool to draw diagramms of cloud architectures? I know pen and paper is a good way, but I need something to use in an article, so the output should look professional and well rendered.An...
View ArticleHow to preserve DOCTYPE declarations when manipulating xml with Jsoup
I have a XML document which starts the following way:<?xml version="1.0"?><!DOCTYPE viewdef [<!ENTITY nbsp " "> <!-- no-break space = non-breaking space U+00A0 ISOnum...
View ArticleHow to concatenate a list with conditional entries to one string with SQL
I need to create a csv file which includes a field, where different elements should be listed, based on a condition for each entry.In example I have this tableid col1 col2 col31 false false true2 true...
View ArticlePhpmyadmin blocks when executing a large query
I am using phpmyadmin for my MySQL administration. When I'm doing an expensive query, which takes several minutes, phpmyadmin seems to block all other activities going on in other tabs. I can still use...
View ArticleHow to make a delayed non-blocking function call
I want to call the add function of an HashSet with some delay, but without blocking the current thread. Is there an easy solution to achieve something like this:Utils.sleep(1000, myHashSet.add(foo));...
View ArticleCronjobs in node.js
Is there a possibility to periodically call functions at a specific time of the day in node.js? My first implementation was setInterval(functionName(),(24*60*60*1000));This is suboptimal, because it...
View ArticleWhich split testing tools can be used for ajax heavy sites?
I want to do split testing on my single page website. The website is written with node.js server-side and also relies on Javascript in the front-end. All the content is accessed through an API which is...
View Articleparsererror after jQuery.ajax request with jsonp content type
I am using jQuery Version 1.5.1 to do the following ajax call:$.ajax({ dataType: 'jsonp', data: { api_key : apiKey }, url: "http://de.dawanda.com/api/v1/"+ resource +".json", success: function(data) {...
View ArticleUse specific middleware in Express for all paths except a specific one
I am using the Express framework in node.js with some middleware functions:var app = express.createServer(options);app.use(User.checkUser);I can use the .use function with an additional parameter to...
View ArticleSave session as BSON instead of a String on node.js with MongoDB
I am using node.js with express and connect-mongo as session store. When I am checking my sessions collection in mongo, there is only the _id attribute a session attribute in each dataset. The value of...
View ArticleHow to reference the latest Stream of a DynamoDB table in a Cloudformation...
I am writing a plugin for the serverless framework, which references a DynamoDB Stream by its ARN. I can construct the DynamoDB tables ARN with the information I have at hand, but I don't know the...
View ArticleHow to paginate with Mongoose in Node.js?
I am writing a webapp with Node.js and mongoose. How can I paginate the results I get from a .find() call? I would like a functionality comparable to "LIMIT 50,100" in SQL.
View ArticleCallback function for expired session for connect-redis in node.js
I am using Connect on node.js with connect-redis as session store. Is there a way to attach a callback function to the the event when the session expires, so I can backup data from the session, before...
View Article