server-side

Using Excel OleDb to get sheet names IN SHEET ORDER

本秂侑毒 提交于 2019-11-26 11:11:17
I'm using OleDb to read from an excel workbook with many sheets. I need to read the sheet names, but I need them in the order they are defined in the spreadsheet; so If I have a file that looks like this; |_____|_____|____|____|____|____|____|____|____| |_____|_____|____|____|____|____|____|____|____| |_____|_____|____|____|____|____|____|____|____| \__GERMANY__/\__UK__/\__IRELAND__/ Then I need to get the dictionary 1="GERMANY", 2="UK", 3="IRELAND" I've tried using OleDbConnection.GetOleDbSchemaTable() , and that gives me the list of names, but it alphabetically sorts them. The alpha-sort

Pagination: Server Side or Client Side?

旧街凉风 提交于 2019-11-26 10:18:58
问题 What is it best to handle pagination? Server side or doing it dynamically using javascript? I\'m working on a project which is heavy on the ajax and pulling in data dynamically, so I\'ve been working on a javascript pagination system that uses the dom - but I\'m starting to think it would be better to handle it all server side. What are everyone\'s thoughts? 回答1: The right answer depends on your priorities and the size of the data set to be paginated. Server side pagination is best for: Large

Meteor: Debug on server side

感情迁移 提交于 2019-11-26 06:18:08
问题 Does anyone know a good method to debug server side code? I tried enable Node.js debug then use node-inspector but it does not show any of my code. I end up using console.log but this is very inefficient. Update: I found the following procedure works on my Linux machine: When you run Meteor, it will spawn two processes process1: /usr/lib/meteor/bin/node /usr/lib/meteor/app/meteor/meteor.js process2: /usr/lib/meteor/bin/node /home/paul/codes/bbtest_code/bbtest02/.meteor/local/build/main.js -

How to handle multiple submissions server-side

不羁的心 提交于 2019-11-26 05:29:13
问题 We all know the good old \"disable the submit button\" trick but what are the best ways to handle multiple submissions server side? I have an application where it is absolutely critical that a form only be sent once - it processes a credit card. I didn\'t write how it is right now but as a quick fix I threw on the disable-on-submit technique, however some impatient users that have javascript disabled are still getting charged twice. So, what are ways to avoid this? I can think of a few - I

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

房东的猫 提交于 2019-11-26 05:24:23
问题 I\'ve been using this site for a long time to find answers to my questions, but I wasn\'t able to find the answer on this one. I am working with a small group on a class project. We\'re to build a small \"game trading\" website that allows people to register, put in a game they have they want to trade, and accept trades from others or request a trade. We have the site functioning long ahead of schedule so we\'re trying to add more to the site. One thing I want to do myself is to link the

How to detect server-side whether cookies are disabled

最后都变了- 提交于 2019-11-26 03:22:05
问题 How can I detect on the server (server-side) whether cookies in the browser are disabled? Is it possible? Detailed explanation: I am processing an HTTP request on the server. I want to set a cookie via the Set-Cookie header. I need to know at that time whether the cookie will be set by the client browser or my request to set the cookie will be ignored. 回答1: Send a redirect response with the cookie set; when processing the (special) redirected URL test for the cookie - if it's there redirect

How do I parse a HTML page with Node.js

情到浓时终转凉″ 提交于 2019-11-26 02:17:51
问题 I need to parse (server side) big amounts of HTML pages. We all agree that regexp is not the way to go here. It seems to me that javascript is the native way of parsing a HTML page, but that assumption relies on the server side code having all the DOM ability javascript has inside a browser. Does Node.js have that ability built in? Is there a better approach to this problem, parsing HTML on the server side? 回答1: You can use the npm modules jsdom and htmlparser to create and parse a DOM in

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

淺唱寂寞╮ 提交于 2019-11-26 01:10:04
问题 I\'m working with socket.io and node.js and until now it seems pretty good, but I don\'t know how to send a message from the server to an specific client, something like this: client.send(message, receiverSessionId) But neither the .send() nor the .broadcast() methods seem to supply my need. What I have found as a possible solution, is that the .broadcast() method accepts as a second parameter an array of SessionIds to which not send the message, so I could pass an array with all the

Why is client-side validation not enough?

落花浮王杯 提交于 2019-11-26 00:55:40
问题 I saw here that: As you probably already know, relying on client-side validation alone is a very bad idea. Always perform appropriate server-side validation as well. Could you explain why server-side validation is a must? 回答1: 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

Why is client-side validation not enough?

◇◆丶佛笑我妖孽 提交于 2019-11-25 22:21:23
I saw here that: As you probably already know, relying on client-side validation alone is a very bad idea. Always perform appropriate server-side validation as well. Could you explain why server-side validation is a must? 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 guarantee that what arrives server side, is