Posts

node.js - Prevent direct access to html page in node js -

I would like to stop the user from typing directly in the URL of the page and going to the page. How do I get this functionality in node? I know that they do not have direct access to web applications in web applications to keep files under file. If you are using, then you can check the referrer in the middleware like this in the middleware, Which you can further customize as necessary for your exact purposes: var Express = requirement ('Express') var app = express () allowed lamp = ['localhost' '127.0.0.1']; // which can link here? App.use (function (req, res, next) {var i = 0, notfound = 1, referer = req.get ('referrer'); if ((req.path === '/') || (req .path === '')) Next (); // pass call '/' always if (referrer) {while ((I and LT; permission lamp lamp) & amp; amp; not; found =) (Notfound = (referer.indexOf permission linker [i]) === - 1); i ++;}} if (notfand) {res.status (403) .seend ('protected area. Enter ...

ajax - How can I run a vb function every minute in jquery -

My question is simple, how can I set a timer to run and execute a function in jquery ? For example, for example, I want a vb function to execute every minute. How do I do it in jquery? The following code executes the function once. How do I want to execute it every minute? $ (window) .load (function () {$ .ajax ({type: "POST", url: "Default.aspx / CheckPending", data: '{}', ContentType : "Application / Jason; Charset = UTF-8", Datatype: "Jason", Success: Alert ("Success"), Error: Warning ("Error")}}}); It runs only once because you run it on the window.load event. To run more frequently than this, use this function. window.setInterval ("JavaScript function", milliseconds); In this case: $ (vs Do) .load (function () {window.setInterval ($ .ajax ({type: "POST", Url: "Default.aspx / CheckPending", data: '{}', contentType: "application / json; charset =...

Why is the "this" keyword final in Java? -

इस सवाल का पहले से ही एक उत्तर है: 6 उत्तर ऐसा लगता है कि लगभग एक बात कोई भी महसूस नहीं किया है, लेकिन जावा में "यह संदर्भ" अंतिम है सामान्य प्रोग्रामिंग दिन में मैंने सोचा था कि मैं इस संदर्भ को अपने वर्ग के अंदर रीफाईफिफ कर पूरे उदाहरण को फिर से परिभाषित कर सकता हूं: सार्वजनिक शून्य विधि () {यह = नया MyObject ("arg1", arg2, arg3); // यह एक कंपाइल त्रुटि फेंकता है} यह संदर्भ जावा में अंतिम क्यों है? समस्या यह नहीं है कि यह एक अंतिम संदर्भ है - यह स्वयं बिल्कुल भी संदर्भ नहीं है यह एक कीवर्ड है जो "उस मान को दर्शाता है जो उस ऑब्जेक्ट का संदर्भ होता है जिसके लिए उदाहरण विधि या डिफ़ॉल्ट पद्धति लागू की जाती है" ()। इसके अलावा, यह समझ में नहीं आता कि इसे एक पुन: सौंपा जा सकता है। याद रखें कि किसी संदर्भ को दोबारा सौंपना केवल उस संदर्भ को बदलता है, और अन्य संदर्भ नहीं जो एक ही ऑब्जेक्ट को इंगित कर सकते हैं। इसलिए यह पुनर्सिंचित करना केवल पागल नहीं बल्कि बेकार भी होगा।

sockets - how to use the ruby analytical receive binary stream from the TCP -

I am going to the device received on data, but these data are binary streams, I keep these data collections, then Read it to display them correctly, is there a better way? requires a 'socket' server = TCPA.org.open (2000) loop {thread.start (server.accept) do. Client | File.open ("tmp", "w") {| File | File.write (client.gets)} file.open ("tmp"). Every do F | | Puts f.unpack ('h *') end client.puts (Time.now.ctime) # Send time to customer customer. Line "connection closed. Bye!" Client.close # Disconnect from the end of the customer} Received data like this: xx ^ q ^ a ^ hb0 @ lt; 90 & gt; 26 2 ^ b ^ @ & lt; 83 & gt; Ev I would like to: 787811010862304020903236202032020001c26c0d0a Sorry for my poor English ?? Using a temporary file with a name will cause a problem if many clients are sending data Are; The temporary file will overwrite. You do not need to use a temporary file. Requires a '...

Java Packages importing .inc file -

As in the case of JSP, do I use the .inc file to import all the necessary sections of any third party There is no way to do libraries in Java class Any concept of adding .nic file to Java classes is not. You can always include project lib directory, external jars or libraries inside JR. You can click on the correct project - & gt; Properties - & gt; Java Build Path - & gt; Library tab And then import imported class from the included jar by using the import details.

apple push notifications - Pushnotfication not wroking with distributed profile -

I follow this link. The Push Notification is fully working with the Development Profile, successfully sending and receiving information Send successfully notification with distributed profiles but do not receive any notifications on the device. And I have seen that in my 2 profile my device token is different. How do you think your device token is different? Push Notification will work if you make sure that you actually make the provision and you make an app with the ADACH version where you had added the UDID of your device.

php - How can i use Salt with a password in codeigniter when retrieving salt from the db -

This is my model, I am querying the database, it needs to be retrieved which I want, then the comparison I am doing Excluding the query is not a column of salt as a column name, but as a string, which is fine, except that it is treating the salt word as a string, there is no data from the database. How can i come function login ($ username, $ password) {$ this- & gt; Db- & gt; Query ("choose firstname, user name, password, salt with table_name WHERE user name = '$ username' AND password = 'sha1 (salt password' '); $ this-> db-> border ( 1); `$ query = $ this- & gt; db- & gt; mill (); if ($ query-> Num_rows () == 1) {return- $ query-> results (); // data is true} and {return false; // data is wrong}} There are some things to play here: First of all, you are adding ' to hash. . does not use the operator. Try the following: Try the following: First name, user name, password, salt from table_name WHERE user name = ...