Posts

What is the difference between REST and HTTP protocols? -

REST प्रोटोकॉल क्या है और यह HTTP प्रोटोकॉल से क्या भिन्न है? / Ul> डेटा यूआरएल के द्वारा विशिष्ट रूप से संदर्भित है और एचटीएमएच ऑपरेशन (GET, PUT, POST, DELETE, आदि) का उपयोग करने पर कार्य किया जा सकता है। माइम प्रकार की एक विस्तृत विविधता संदेश / प्रतिक्रिया के लिए समर्थित होती है लेकिन XML और JSON सबसे आम हैं। उदाहरण के लिए एक ग्राहक के बारे में डेटा पढ़ने के लिए, आप URL के साथ एक HTTP प्राप्त कार्य का उपयोग कर सकते हैं। यदि आप उस ग्राहक को हटाना चाहते हैं, तो उसी URL के साथ ही HTTP हटाएं कार्रवाई का उपयोग करें। नीचे दिए गए जावा कोड HTTP प्रोटोकॉल पर एक अस्थाई कॉल बनाने का तरीका दर्शाता है: स्ट्रिंग uri = "http://www.example.com/customers/1"; यूआरएल यूआरएल = नया यूआरएल (यूरी); HttpURL कनेक्शन कनेक्शन = (HttpURL कनेक्शन) url.openConnection (); connection.setRequestMethod ( "GET"); Connection.setRequestProperty ("स्वीकार करें", "एप्लिकेशन / एक्सएमएल"); JAXBContext जेसी = JAXBContext.newInstance (ग्राहक.क्लाश); InputSt...

Calculating sums of columns in CSV file using C++ -

How can I count the column amount from a CSV file using C ++? My CSV file ago 22 45 33 8 50 70 4 60 88 And I want to do something like this in a array Text "> #include & lt; Iostream & gt; # Include & lt; Fstream & gt; Int main (int argc, char * argv []) {std :: ifstream in; Int array [3] = {0, 0, 0}; If (RGCC & lt; 2) return 1; In.open (argv [1], std :: ifstream :: in); While (in.good ()) {int one, two, three; In & gt; & Gt; One & gt; & Gt; Two & gt; & Gt; three; Array [0] + = one; Array [1] + = two; Array [2] + = three; } Std :: cout & lt; & Lt; Array [0] & lt; & Lt; '' & Lt; & Lt; Array [1] & lt; & Lt; '' & Lt; & Lt; Array [2] & lt; & Lt; Std :: endl; In.close (); Return 0; } Something like this?

mysql - Java Sanitize Input for Database without PreparedStatement -

I have read the easy way to clean user input in a database with Java using PreparedStatement But I was wondering if there was any other way to sanitize the user input or to sanitize input and then the return value of the input to be prepared was made? created space nothing clears your level of persistence It is binding and valid before receiving it. Do you want to do that. Why objection to the created state ? It does not matter to me much.

operator overloading c++ / where to put my code? -

आज मैं & lt; & lt; मेरी कक्षाओं में से एक में ऑपरेटर: #ifndef TERMINALLOG_HH # परिभाषित नामस्थान std; TERMINALLOG_HH; क्लास टर्मिनलॉग {सार्वजनिक: टर्मिनलॉग (); Terminallog (int); वर्चुअल ~ टर्मिनलॉग (); टेम्पलेट & lt; कक्षा T & gt; टर्मिनलॉग एंड ऑपरेटर & lt; & lt; (कॉन्स्ट टी एंड वी); निजी:}; #endif जैसा कि आप देख सकते हैं मैं अपनी हेडर फाइल में अतिभारित ऑपरेटर को परिभाषित करता हूं और मैं इसे अपने .cc फ़ाइल में कार्यान्वित कर रहा हूं: // छीन लिया गया कोड टेम्पलेट & lt; class T & gt; टर्मिनलॉग एंड टर्मिनलॉग :: ऑपरेटर & lt; & lt; (कॉन्स्ट टी & amp; v) {cout & lt; & lt; endl; इस- & gt; मांगपत्र (); Cout & lt; & lt; v; वापसी * ​​यह; } // छांटे गए कोड इसके बाद मैंने अपने नए वर्ग का उपयोग कर एक main.cpp फ़ाइल बनाई: # शामिल "inc / terminallog.hh" int main () {टर्मिनलॉग रोकना (3); रोकना & lt; & lt; "Bla"; रोकना & lt; & lt; "Bla"; वापसी 0; } और मैं compilying पर चल...

android - SQLiteDatabases and Cursors -

I was thinking that someone could give me a brief overview of the Android cursor, some specific questions: public static cursor getVehicles () {SQLiteDatabase db = vehicleData. GetReadableDatabase (); Cursor cursor = db.query (TABLE_NAME, GET_VEHICLES_FROM_CLAUSE, empty, empty, empty, empty, ORDER_BY); Return cursor; } To do housekeeping, I tried db.close () before the return statement. However, the cursor did not have any rows returned due to this. Why is this? 2 - What is the difference between closing a cursor and closing the database? - Do I have to call the cursor if this is a local variable, or can I leave garbage collector to clean it? 4 - My database is small and only used by my application - can I keep it open? The cursor is simply an indicator for the data obtained from your query, in which all the data from your query will be included. It is not included to increase performance / efficiency (big results are not read at one time - & gt; low memory is u...

C# - Generic HashCode implementation for classes -

I see how to make the best hashcode for a class and I see some algorithms. I have seen this one: It seems that the .NET classes havehashcode methods are the same (see by showing the code). So the question is, why not to create a static class above, the hashcode automatically passes through the field, we consider it as a "key". // Older version, Public static class HashCodeBuilder {public static int hash (params object [] keys) Edit {if (Object.Reference Aquals (keys, blank)) {Return 0 ; } Int number = 42; Check (for {int i = 0, length = keys.labee; i and use it like this: // Edit the old version, public sealed section View: Equitable & lt; A & gt; {Public A () {} Public String Key1 {get; Set; } Public string key2 {get; Set; } Public string value {get; Set; } Public override bull par (object obje) {Return to it. Eclairs (ABZA); } Public bool par (another) {if (object.ReferenceEquals (other, empty))? Incorrect: Key1 == Other Kay 1 & amp; Amp; Key2 == ...

windows - Batch Delete a line in a text file? -

I am pulling my hair by finding a simple example of a dose batch file which removes the first line of several thousand txt Save files with files and original file names. After a batch process by another program, I have to add the removed line (a text string that includes "X, Y, Z") at the beginning of each file after external processing. You use more + 1 to leave the first line of the file can do. You can then pipe it temporarily (you can not edit the text file in the place): for% (* .txt) in% x (plus + 1% X "& gt; tmp You can then use the same technique to add the first line again: % for% (* .txt) in x (* .xx, x, y, z and type "% x")> tmp and move / u tmp "% x") Use them in a batch file, % signals two Get here: @echo off for %% x (* .txt) (for more + "%% x in (* .txt) Run your utility here (Exo, Y, Jade, gt; Tmp type "% x" & gt; X% is OK, apparently more does not work with very large files, which ...