Pagination: Server Side or Client Side?

The right answer depends on your priorities and the size of the data set to be paginated. Server side pagination is best for: Large data set Faster initial page load Accessibility for those not running javascript Client side pagination is best for: Small data set Faster subsequent page loads So if you’re paginating for primarily … Read more

Meteor: Debug on server side

In Meteor 0.5.4 this has become a lot easier: First run the following commands from the terminal: npm install -g node-inspector node-inspector & export NODE_OPTIONS=’–debug-brk’ meteor And then open http://localhost:8080 in your browser to view the node-inspector console. Update Since Meteor 1.0 you can just type meteor debug which is essentially a shortcut for the … Read more

Pulling data from a webpage, parsing it for specific pieces, and displaying it

This small example uses HtmlAgilityPack, and using XPath selectors to get to the desired elements. protected void Page_Load(object sender, EventArgs e) { string url = “http://www.metacritic.com/game/pc/halo-spartan-assault”; var web = new HtmlAgilityPack.HtmlWeb(); HtmlDocument doc = web.Load(url); string metascore = doc.DocumentNode.SelectNodes(“//*[@id=\”main\”]/div[3]/div/div[2]/div[1]/div[1]/div/div/div[2]/a/span[1]”)[0].InnerText; string userscore = doc.DocumentNode.SelectNodes(“//*[@id=\”main\”]/div[3]/div/div[2]/div[1]/div[2]/div[1]/div/div[2]/a/span[1]”)[0].InnerText; string summary = doc.DocumentNode.SelectNodes(“//*[@id=\”main\”]/div[3]/div/div[2]/div[2]/div[1]/ul/li/span[2]/span/span[1]”)[0].InnerText; } An easy way to obtain the XPath … Read more

Send message to specific client with socket.io and node.js

Ivo Wetzel’s answer doesn’t seem to be valid in Socket.io 0.9 anymore. In short you must now save the socket.id and use io.sockets.socket(savedSocketId).emit(…) to send messages to it. This is how I got this working in clustered Node.js server: First you need to set Redis store as the store so that messages can go cross … Read more

Why is client-side validation not enough?

Client-side validation – I assume you are talking about web pages here – relies on JavaScript. JavaScript powered validation can be turned off in the user’s browser, fail due to a scripting error, or be maliciously circumvented without much effort. Also, the whole process of form submission can be faked. Therefore, there is never a … Read more

tech