Posts

ruby - Set-up Many-to-Many in Rails with destroy allowed for only one of the many -

I am trying to prepare a very simple system, but the railroad way to do this is to save me. There should be two institutions, one user and one son, one condition has two users and the user has many bets. I want to make this condition to be a user so that it can be solved (in any form of update) or remove it . In my initial thinking, there are two ways for a user, one can be the best choice of many associations in the rail as a better response or, keeping in mind that who is the owner of the model. But, then you are repeating the User ID twice. Thank you in advance! I think you want this: class users I am (beta,: foreign_kys => gt; bettor_id ',: class_name = & gt;' bet ') - medium (: responses, alien_key =>; responder_id' ',: class_name = (Bettor ,: class_name = & gt; 'user')) related_ to (: responder, class_name = & gt; 'user') end

c++ - std::vector overwriting final value, rather than growing? -

मुझे एक समस्या है जहां vector.push_back (value) का उपयोग करना अंतिम मान को ओवरराइट कर रहा है , अंत के लिए संलग्न करने के बजाय ऐसा क्यों हो सकता है? मेरे पास वेक्टर में एक नमूना आइटम है, इसलिए इसका आकार शून्य में कभी नहीं गिरता है नीचे कोड है .. शून्य अपडेटटैबल (वेक्टर & lt; माइस्ट्रेड & gt; * व्यक्तियों, माइस्ट्रेड एंट्री) {MyStruct someEntry; Bool isNewEntry = सच है; के लिए (इंट आई = 0; आई & lt; इंडिविजुज- & gt; आकार (); आई ++) {यदि (! (एसआरसीएमपी (व्यक्तियों-> (आई) पर। एसोसिएशन, एंट्री। स्रोत एड्डर))) {हैनईएनेंट्री = गलत; // धज्जी। यहाँ कुछ काम किया। }} If (isNewEntry) {व्यक्तियों- & gt; पुश_बैक (प्रविष्टि); }} यह मेरे पहले "नमूना" मूल्य में रहने दें, और वेक्टर में सिर्फ एक और आइटम की अनुमति देगा। संपादन: अधिक कोड, क्योंकि यह स्पष्ट रूप से मुद्दा नहीं है? शून्य * टैबलेट प्रबंधन (शून्य * आर्ग) {// एनडीपी तालिका में खोजे हुए उपकरणों को स्टोर करने के लिए। // नमूना डेटा की एक पंक्ति के साथ भरा वेक्टर के & lt; MyStruct & gt; d...

"There is no spoon" or: Unexpected error 0xdeadbeef in PHP -

I have some PHP code, listed below. I have a trap that tells that if the data does not match any test of input code ("no spoon is there", it says, cautious, what?). The problem occurs when the data - which is not unusual in any way that I can see , and for that matter, it is similar to the other data that this trap Avoid - does match any test in any way it makes it in any way. And of course, the "unexpected error" error outputs the data that was input, just to make sure. As far as I can tell, there is nothing wrong with that input data. First of all, there is output, which can be a bit easier to understand: For customer XXXXXXXXXXXX, DED 2010-01, the bill has already been sent to XXXXX2515 database before continuing Removing the last billing from this DID is a toll free number hence the trunk: 0.05 DID XXXXXX2515 starting billing for trancreate: 0.05 type: TFN 2010-01-22 15:45:15: Bilkax: 22bill Pisces: 1 source : XXXXXX0808 Destination: XXXXXX2515 Erro...

xml - How can I exclude elements with xsi:nil="true" from a transformation? -

I have some XML files that have been recently changed so that in some nodes Extra xsi: nil = "true" . I've got an XSLT style sheet that provides XML for HTML for quick-eye statistics. In order to make things easier for myself in the present time, I take the names out of XML before applying a style sheet. It worked fine till our last update. Now I am getting an error because XSL does not know how to handle XSL: Niil = "True". I can easily update the code so that all of my XSL: "true" matches in XML before zero, but I was thinking that it is possible to hide the XSLT style sheet, so that the XSIL is ignored Given / can not be the reason for failures of change, even if there is no name space XML I like to work like this because now I can make changes on the server, where I have to release a new web build, I have to jump through some internal hoops to deploy it. After I'm working on things (either XSL: by removing Neil before or after the trans...

sql server - Efficient SQL query for two updates and search queries -

I have such a query: SELECT TOP 1 ID, data, Other acknowledged date = @DATE After reading and using line data, I want to update that retrieval line and change it to a single column. (In other transactions). But as you see here I have searched for that line twice, is there any way that I remember the line and update without searching again. Thank you. I know its prevalent information but you can also update the status on the cursor. Use EMP_CURSOR Cursor to go to Northwind For the top 1 employee, the last name for the employee, where the final name for OpenData = '1 994-11-15' is open for updates EMPCRORATOR Eager EMPPORTS Update next to employee Employee NextName LastName = LastName + CAST (Datestart (MS, GateDate)) EMP_CURSOR EMP_CURSOR DEALLOCATE EMP_CURSOR

ffmpeg - Missing of image when conversion from flv to 3gp -

मैं ffmpeg के लिए कमांड लाइन में उपयोग करता हूं -i इनपुट। FLV-vcodec h263 - बी 256 के -आर 15-एस 320x240 -कोडोडिक लिबोपेंकोर_आमआरएनबी \ -ab 7.4k -ar 8000 -ac 1 -f 3gp Output.3gp नतीजे केवल ऑडियो-रहित है, बिना वीडियो। लेकिन जब 176x144, यह महान काम करता है। फ्रेम आकार (320x240) के उपयोग में क्या गलत है? और क्या समाधान है? क्या आप सुनिश्चित हैं कि परिणामस्वरूप आउटपुट में कोई वीडियो नहीं है .3gp फ़ाइल? क्या यह संभव है कि अंत डिवाइस 320x240 का समर्थन नहीं करता है? यह आपके प्रश्न में संपूर्ण FFmpeg आउटपुट को शामिल करने के लिए काफी मददगार होगा।

security - OAuth and phishing vulnerabilities, are they inexorably tied together? -

I've been doing a fair job with OAuth lately, and I have to say that I really like it. I like the concept, and I like that it provides insertion of a low blocker to connect your users' external data to your site (or to provide a data API for external access to you) private As a matter of fact, I have always attached sites that ask me to login directly to another website from me. And the Oath "Wallet key for web" approach resolves this well. The biggest problem I (and many others) with it though, standard oath work flow encourages the same type of behavior that phishing attacks use for their benefit, if you use your user It is common practice to be redirected to a site to provide login credentials, so it is easy for the phishing site to take advantage of general practice, but Means to redirect their clone site where they receive their username and password. Are you asking users to login and login to the available site? Did you do anything to reduce this pro...