Monday, 15 February 2010

mysql - SQL Update using values from other columns in same table -


मेरे पास एक SQL तालिका है, "डेटा", निम्न कॉलम के साथ: id (int), date1 (datetime), date2 (Datetime), अंतर (फ्लोट)

मैं इस तालिका को अपडेट करना चाहूंगा ताकि "अंतर" कॉलम में फरवरी (एक फ्लोट के रूप में) की तारीख 2 और दिनांक 1 के बीच अंतर हो, केवल जब date2 '0000-00-00 00:00:00' के बराबर नहीं है

मैं लाइनों के साथ कुछ की सोच रहा था

  अद्यतन डेटा m SET difference = datediff (" Hh ", m.date2, m0.date1) / 8765 - प्रति वर्ष 8765 घंटे हैं इसलिए यह मुझे मेरी फ्लोट से डेटा M0 WHERE देना चाहिए एमएड = एम 0.आईडी और एम डीटीटी 2 & lt; & gt; '0000-00-00 00:00:00';  

फिर भी जब मैं कोशिश करता हूं मुझे "SQL वाक्यविन्यास त्रुटि बताते हुए एक त्रुटि मिलती है। पास के डेटा का उपयोग करने के लिए सही वाक्य रचना के लिए अपना MySQL सर्वर संस्करण जांचें SET अंतर = दिनांकित (" hh, m.date2 , M0.date10 / 8765) लाइन से 1 '' से ''

वांछित परिणाम पाने के लिए मैं अपने एसक्यूएल स्टेटमेंट को कैसे संशोधित करूं?

संपादित करें:

मैं इस एसक्यूएल स्टेटमेंट को चलाने के लिए xampp के phpMyAdmin इंटरफ़ेस का उपयोग कर रहा हूं

बयान प्रपत्र पर होना माना जाता है:

  अद्यतन तालिका SET कॉलम 1 = अभिव्यक्ति 1, स्तंभ 2 = अभिव्यक्ति 2, ... कहां स्थितियां;  

आपका से खंड इस प्रकार है अप्रासंगिक।

आप अन्य तालिकाओं से लिंक करने के लिए शामिल और उप चयन करें -कुहारों का उपयोग कर सकते हैं।

- यह कैसे प्राप्त करें (वास्तव में, एक पूर्ण डुप्लिकेट):

  अद्यतन टैबिये एक जॉइन टैबिल बी पर a.join_colA = b.join_colb SET a.columnToUpdate = [कुछ]  

c# - How to return custom error message to View? -


I have created a Datasheet class, which returns an error if the selected date is in the past:

  Public category validated category: verification entry {public date time first date = date time today; // Get Public Datetime Secondend {Receive; Set; } Private contact string DefaultIncorrectDateMessage = "The date you entered is incorrect, please try again"; Public String Date InPastMessage {get; Set; } // Public String DateNote Orange Message {get; Set; } Protected Override Validation Result IsValid (Object Value, Validation Contact Validation Contact) {// Your Verification Logic If (Convert. DateTime (Value)> Date = Time Today) {Return Validation Results. Success; } And {new verification return (date input message ?? default incarnated date date message); }}}  

This is my view:

  [validated category (date inmemberm = "Your date is in the past. Select! ")] [Datatype (datatype.det)] Public Date Time Arrival Date {Received; Set; }  

This works correctly, though DateInPastMessage is now back in the form of a debug message, when the application fails on db.SaveChanges () is.

I want to see this message as a normal error message:

Enter image details here

How can I send my favorite error message to see? Can this be done without creating a custom jquery verification in each scene where I have a datepayer field?

You must error message in verification entry set on. I do not think that's why I do not see it.

  error message = default uncheck date messages;  

How to implement an home screen icon behaving as button in android? -


I am thinking for some and do not know how it is possible that this idea is there.

I want to create an icon on the home screen and when the user clicks on the icon light on it (the app is showing on) otherwise it is not.

Is any weather possible if yes, if yes! So how to implement it.

Thank you in advance.

Write applies your desired UI and functionality.


c# - Passing a copy of a class is altering the original copy -


I have some code that downloads the data to a class for storage and then creates a copy of that class Passed in a method that changes the data, in any way, my original class is also being changed and I am not sure what I am doing.

  calculation calc = new calculations (symbol, market); Calc.stockData = loadData (symbol, market); (Int j = calc.stockData.Count - 8; j & gt; = 0; j--) {Hypris = 0; / / 0 Latest // As you go higher in the index, this (int k = j + 1; k & lt; j + 8; k ++) {kIndex = k; JIndex = j; Decimal highwaycatcracker high = calculation CalculateReturnPercentageStatic (calc.stockData.ElementAtOrDefault (k). Close, calc.stockData.ElementAtOrDefault (j).); If (hybrid content hi hyperis) {hypermarkets = high content content hi; HighIndex = k; }} Test Test = New Test (); Test.returnPct = High Value; Test.date = calc.stockData.ElementAtOrDefault (highIndex) .det; Test.symbolClass = Symbols List. Alimentateof default (i); Calculation copy = calc; Test.ratingClass = DisplayGeneration (test.symbolClass, copy, test.date); // Sending a copy in the method to change the content. Add (test); // Here is a breakpoint and the original class (calc) has been changed}  

Let's move through your code so that you can understand what is happening here. (The words that you are asking to do are written in the comments.)

  // 1. Make a new example of the object 'calculation' on the heap / 2. Assign that example and assign it to variable 'calc' calculation calculator = new calculation (symbol, market); // 3. Create a variable called 'Copy', which indicates 'calculation' type objects. 4. Assign the value of 'Calc' (which is in the context of a lot of things); copy 'copy' = calc;  

Simply pointing to the same object in your code in the calc and copy memory. This is the reason that the change in copy is affecting calc what you need to do is clone your object so that you have a new object that is equal but memory Is different in


facebook - How can I get more data about an Instagram location-id? -


In my calls to the Instagram API, sometimes I will get this kind of location data:

 < Code> {"id": 641410285}  

As I understand, this is an Instagram location ID; I do not know what exactly it means - who handles the number? How has this been managed, and all this stuff is document anywhere? But, setting that question aside ...

There is an API to get more information about that ID. But when I call that API for this place, I get it:

  {"meta": {"code": 200}, "data": {"latitude "Wendy's"}}   

So it's probably Wendy's restaurant or someone's home, "Void", "id": "641410285", "longitude": blank, "name" Whose name is Wendy

I found what is related, if that is not the exact question, and I have got some instructions on how to start with Facebook or four squares locations / places. Go and find Instagram location-id, but does anyone have a way to learn more about an Instagram location-id?

Thanks for any indication!


python - weird issues with an IF loop -


I have a strange omission that with my loop it has the code given below:

 < Code> Diff Run_ Calculator (H, D, M, Y): If M == 01: While True: D = Calculate and Write Android (D, M, Y) if D = 31 31: Calculate and Write HDDIR (H, D, M, Y) D = 01 m = m + 1 y = y if m == 02: whereas true: d = calculate_and_write_hsdir (h, d, m, y) if d = 28 28: calculate_and_write_hsdir (h, d, M, y) d = 01 m = m + 1 if m == 03: is true: print "march" in loop "d = calculation and write / hsdir ( D, M, Y) if D == 31: calculation and write_HSDIR (H, D, M, Y) print "March complete" D = 01m = M + 1  

Basically what I am trying to do is lculate_and_write_hsdir every day, every 24 hours after it (1) i <1 p>

what I'm trying to do, turn it off As soon as it goes by the end of the month, although if I start it on 25th January then it will work properly, where this crash It was broken, but if I start it on February 01, it crashes on February 29

What am I doing wrong?

Here is how I am starting it

  h = 00 # hours d = 28 # day M = 8 # silence y = 2013 # year run_ calculate ( H, d, m, y) run_calculate (000101014) run_calculate (0001010101)  

Try, when your loop will end, because your statement requires you to make sure that when your work is done, you stop executing your existing block. You can also add a break;

  def run_calculate (h, d, m, y): if m == 01: while d & lt; = 31: d = calculate_and_write_hsdir (h, d, m, y) if d == 31: calculation and _late_hsdir (h, d, m, y) d = 01m = m + 1 y = y if m == 02: While D & lt; = 28: d = calculate_and_write_hsdir (h, d, m, y) if d = 28 28: calculate_and_write_hsdir (h, d, m, y) d = 01 m = m + 1 if m == 03: while d & lt; = 31: print "In March Loop" d = Calculation and _writing_HSDIR (H, D, M, Y) if D == 31: calculation and_writing_HSDIR (H, D, M, Y) print "March dan" D = 01 M = M + 1  

Apache File permissions issue in Ubuntu -


I am trying to use Apache to access the file on my documents folder.

I tried the following:

  sudo chown -r www-data: www-data / home / $ user / public_html sudo adduser $ USER www-data pseudo chmod- R 775 / home / $ USER / public_html  

As suggested by this post:

Although it works, I can not edit it now or The only solution to work in the form of a user (without the use of sudo ), despite being a member of the www-data group, the only solution to work in Using chmod-R 777 (which is not me In fact).

All that I had to do is restart the OS and it was sorted!