Monday, 15 April 2013

c# - Fill a List inside a known object with LINQ? -


I am quite new to Linux, but just wanted to ask how the list & lt; String & gt; An object using LINQ?

What to do to get all the URLs from a specific user. This data is stored in an Azure table

My code is:

  public IEnumerable & lt; UserTable & gt; GetUserImages (UserTable pUser) {var results = U in this.context.usersTableQuery where u.UserName == Select pUser.UserName u.PhotosUrl // Photo URL is a list of strings and I know that here are some results ; It seems as if you always give a query to a user, and you want him to use his  PhotosUrl  list when it's true:  
  var user = This.context.usersTableQuery.FirstOrDefault (u = & gt; u.UserName == pUser.UserName); & Lt; String & gt; result; If (user == faucet) result = new list & lt; String & gt; (); Other results = user.photo URL;   

If there is a chance that if more than one user inquires from the user's given username, then you have to use the extension method:

  List & lt; String & gt; Results = this.context.usersTableQuery Where (u = & gt; u.UserName == pUser.UserName). Selection multiple (U = & gt; u.PhotosUrl) .toList (); An Affiliate keyword was not found in   

Select Maya syntax based queries. list & lt; List & lt; String & gt; & Gt; List in & lt; String & gt; .

how to add sound in video with.avi extention in c#.net -


I am developing a project on videowatmarking using c # .net. I am creating a video from the .bmp file.

I am able to create video using the AV manager in the .avi extension, but is not able to add sound, the video is made without sound ... .wav extensions listen to the sound

Take a look at this, it can be helpful for you:



mysql - Running multiple queries in PHP insert erroneous values -


I have participated in a problem I've never seen before. The code is very large and there are many sections, so please do not forget me for too much details. The interesting bit is:

  $ copy = clone $ this; $ Copy-> Worker = $ new_workerid; If ($ copy-> mysql_create_row ($ this- & gt; pending)) $ per;   

It runs as expected when I go to the database, then a new entry appears in the table pending.

Every time I run many questions in succession: $ copy = $ $ this; $ Copy-> Worker = $ new_workerid; If ($ copy-> mysql_create_row ($ this- & gt; Pending)) If ($ this-> mysql_delete_row ($ this- & gt; Pending)) If $ ($-> this-> mysql_create_row ($ this- & Gt; cancelled_table); Copy $ per copy;

Then for some inevitable reasons, the wrong ID column is inserted on one of the table. $ Copy- & gt; Mysql_create_row, among other things, does this:

  if ($ con = db_connect ()) {$ res = mysqli_query ($ con, "IN $ IN INSERT $ table (` worker ' , `Time`,` location`, `work`) value ('$ this- & gt; worker', '$ this- & gt; datetime', '$ this- & location;', '$ this- & Gt; work '); ") or error_log (" mysql_create_row error: MySqli_error ($ con)); If ($ res) {$ this- & gt; Contactid = mysqli_insert_id ($ conn); Foreign currency (present as $ $-> $ et) {$ et-> __ set constituted income ($ this-> contracted); If (! $ Et-> mysql_create_row ($ this-> present-table)) {error_log ("contact-> mysql_create_row error: appearance does not create mysql line"); return false; }   

Object method $ att-> gt; The delegation works in the same way through mysql_create_row ($ this- & attendees_table), this is only the INSERT query.

Now this is where things do not make sense: where the new inserted copy is $ Copy-> Picks the correct ID on mysql_create_row, $ et-> Mysql_create_row does not !!! This inserts the old ID; Also, when I get $ at- & gt; I want to echo out queries from mysql_create_row, so this is true (new id) resonates!

But when I go to the actual database, then the old id. It does not fully understand me.

I have tried to create custom __clone () methods, try to make sure that I have copies and are not references (you are php), but it still generates the same error

The problem appears to be consistent with the questions, such as I do not remove or add new, I have no problem.

Delete works fine, and the second inclusion works fine without any errors.

What might possibly MySQLi support for the wrong ID include, while the query stares right? I can only talk about some kind of background / corrupt corruption, but since I have no control over such a thing, I do not even know how to solve the problem.

Att-> Mysql_create_row, I get:

Before the query ID: 305

'INSERT in XXXXXXXX . present ( contactid , title , forenames , alias , relationship < / Code>, gender , age , , ics_number supervised access , left The value ('305', 'Mr', 'Alex', 'Werner', '', 'M', '29 / 08/1981 ',' 0 ',' ',' ' ',' 0 '); '

After query id: 305

But when I actually go to database, the value entered is old ID value (294). The table column is not auto-increment, it is not unique or primary, it is only an integer (11).

What can this be on the earth?

Your problem may be that you get the last inserted line ID to get mysql_last_insert_id are using. As you are inserting multiple rows, it is possible that you can not find the correct ID. Change

mysql_last_insert_id with a select query returns the id of your last entry and see that your problem has been resolved.

django - post_save error Message' has no attribute -


I have tried to use the post_save signals for the first time I've read the documents, But still some advice is needed.

I am trying to designate my model area 'charge'.

  @receiver (post_save, sender = message) def my_handler (sender, ** kwargs): if not sender. Charge: Sender (sender) sender.save ()   

However, this error message gives' no attribute 'charge', but the charge exists in the message is!

sender here message is class, not Saving example. The actual example is passed in the form of keyword logic example . Also, with post_save , if you are not careful, you will get yourself in the infinite loop. pre_save . Better to use def my_handler (sender, ** kwargs) @receiver (pre_save, sender = message) to better: Example = kwargs ['instance'] If not for example. In charge: example.charge = instance.length () # There is no need to save, because we first press the database by slipping the value into #.

android - Activity return to Portrait when Screen is Locked -


संबंधित प्रश्न:


  • यह मेरी अजीब व्यवहार में एक अजीब व्यवहार है।

    पोर्ट्रेट मोड (यह सामान्य है)

    1. स्क्रीन लॉक दबाएं, गतिविधि: onPause ()
    2. स्क्रीन अनलॉक करें, गतिविधि: परप्रकाश ()

      लैंडस्केप मोड (यह अजीब है)

      1. स्क्रीन लॉक को दबाएं, गतिविधि: onPause () - & gt; ऑनस्टॉप () - & gt; ऑनडायरॉय () - & gt; OnCreate () - & gt; ऑनस्टार्ट () - & gt; पोर्ट्रेट लेआउट को लोड करता है;
      2. स्क्रीन अनलॉक करें, गतिविधि: onPause () - & gt; ऑनस्टॉप () - & gt; ऑनडायरॉय () - & gt; OnCreate () - & gt; ऑनस्टार्ट () - & gt;

        पोर्ट्रेट मोड: (उसी)

        लैंडस्केप मोड: (पोर्ट्रेट मोड की तरह काम करना चाहिए)

        1. स्क्रीन लॉक को दबाएं, गतिविधि: ऑन-पॉज़ () ;
        2. स्क्रीन को अनलॉक करें, गतिविधि: परप्रकाश ()

          तो मेरे प्रश्न:

          • मेरी गतिविधियां इस तरह से क्यों व्यवहार करती हैं?
          • आपकी गतिविधियों का व्यवहार कैसे होता है?

            मेरे प्रश्न का मूल पाठ वर्णन:

            जबकि मैं अपने लॉक स्क्रीन बटन को दबाता हूं फोन, जब मेरी गतिविधि अपने लैंडस्केप मोड में है, मैंने देखा (डिबग संदेश में मैं एक्लिप्स को आउटपुट) गतिविधि को उसके पोर्ट्रेट मोड में बनाया गया है (जब कि स्क्रीन बिल्कुल काला है)। तब जब मैं स्क्रीन को अनलॉक करने के लिए लॉक स्क्रीन बटन को फिर से दबाता हूं, तो गतिविधि को नष्ट कर दिया गया और उसके पोर्ट्रेट पर फिर से बनाया गया।

            मुझे याद है (हालांकि 100% यकीन नहीं है), और मैं क्या उम्मीद करता हूं , मेरी गतिविधि को केवल onSaveInstanceState () और onPause () से गुजरना चाहिए, जबकि लैंडस्केप मोड में लॉक स्क्रीन होना चाहिए, जैसे कि पोर्ट्रेट मोड में ऐसा होता है पोर्ट्रेट को फिर से बनाने और लैंडस्केप पर वापस जाने की बजाए।

            क्या यह है कि मैंने अपने फोन के साथ कुछ गड़बड़ कर दिया है? मैं इसे सामान्य रूप में कैसे ठीक कर सकता हूं?

            धन्यवाद!


            इस मुद्दे में योगदान देने के लिए धन्यवाद। अपने उपकरणों में मेरे लिए परीक्षण करने के अपने प्रयास के लिए विशेष रूप से धन्यवाद। और विशेष रूप से मेरे लिए इस मुद्दे के विषय में गहराई से चर्चा करने के लिए @ रघुुनंदन। धन्यवाद

            अब तक के सभी योगदानों का सारांश, मेरे पास निम्न निष्कर्ष हैं:

            1 यह एक सामान्य घटना है।

            ऐसा लगता है कि, मोबाइल फोन पर चलने वाली गतिविधियाँ, जो कि लैंडस्केप मोड में हैं, स्क्रीन लॉक पर पोर्ट्रेट मोड में बदल जाती हैं एक सामान्य व्यवहार है। कम से कम यह अभी तक परीक्षण किए गए फोन पर सच है। इसलिए हमें यह सुनिश्चित करना होगा कि हमारे जीवनचक्र कार्यकाल इस परिवर्तन को सुंदर ढंग से हमेशा ध्यान रख सकें।

            2 लगता है कि लॉक स्क्रीन में "डिफ़ॉल्ट अभिविन्यास" के कारण है।

            हमारे पास इस समस्या के बारे में दस्तावेज़ीकरण या कई संसाधन नहीं हैं। लेकिन धारणा है कि चलने वाली गतिविधियों स्क्रीन लॉक पर डिवाइस की "डिफ़ॉल्ट ओरिएंटेशन" पर वापस आ रही हैं, क्योंकि अधिकांश डिवाइसों में लॉक स्क्रीन पोर्ट्रेट में है, काफी तार्किक है।

            आगे का अध्ययन: < P> मुझे आश्चर्य है कि अगर हम एक लैंडस्केप लॉक स्क्रीन रखते हैं तो क्रियाकलाप कैसे व्यवहार करते हैं?

            आप रोक सकते हैं ओरिएंटेशन परिवर्तन पर पुनरारंभ करने की गतिविधि, लेकिन यह आम तौर पर एक बहुत बुरा विचार है।

            एंड्रॉइड प्रलेखन में

            नोट: कॉन्फ़िगरेशन परिवर्तन को संभालने से आप इसे अधिक कठिन बना सकते हैं वैकल्पिक संसाधनों का उपयोग करने के लिए, क्योंकि सिस्टम स्वचालित रूप से आपके लिए उन्हें लागू नहीं करता है

            एंड्रॉइड सामान्यत: केवल रोटेशन पर फिर से तैयार करने की सिफारिश करता है यदि आप डॉन 'डॉन' हैं, तो इस तकनीक को अंतिम उपाय माना जाना चाहिए, जब आप कॉन्फ़िगरेशन बदलाव के कारण पुनरारंभ से बचने के लिए आवश्यक हैं। टी वैकल्पिक संसाधनों की आवश्यकता और , अधिक महत्वपूर्ण बात, प्रदर्शन की आवश्यकता है एक अच्छी तरह से डिज़ाइन किए गए ऐप को ज्यादातर मामलों में ऐसा करने की आवश्यकता नहीं है।

            यदि आप डिफ़ॉल्ट एंड्रॉइड व्यवहार को रोकने के रास्ते पर जाने पर जोर देते हैं, तो मैं रघुनाथन के कोड को संशोधित करता हूं और एक स्क्रीन आकार विशेषता को कुंआ। एपीआई स्तर 13 के अनुसार, स्क्रीन आकार उन्मुखीकरण परिवर्तन पर बदलता है। तो आपको स्क्रीन साइज शामिल करना होगा जब तक कि आप केवल एपीआई 12 और नीचे को लक्षित नहीं कर रहे हों।

              & lt; गतिविधि एंड्रॉइड: name = "। MyActivity" एंड्रॉइड: configChanges = "orientation- screenSize" android: label = " @ स्ट्रिंग / app_name "& gt;    

How to make master-detail model / screen in Django? -


One thing that always strikes me is how to implement a master-extension application with Django. Example of customized invoices and invoice lines is.

Things to discuss are:

  • How to structure code for saving, loading etc. Master and expansion model
  • View: how to add files and templates, templates for detailed rows, dynamically
  • Autoclaimed fields (such as total on the original line), where this code goes?

    Edit / Addition:

    About the automated field, this is my first solution, will not it be better in the method of saving the model?

    The value needed from the master model is the expansion model (i.e. first to calculate yoga on each description, to save each line, and then to save and save the master) How is it made in more degenerations than calling the calling method?

    class = "post-text" itemprop = "text">
    • Master and detection models are two different models related to one. You must use model formatate (more) to include them in the same way.
    • To add dynamically to the rows you can think of
    • In the same field that applies to the automation, you can call it in pure javascript or an AJAX on "Action View" You can do this with a call (thus the code is in the template or in your thoughts, in the end the phone calls to other modules, like this, it really depends on you which calculation you are doing) < / Ul>

ruby on rails - Rspec Test Required parameters -


I am using factories and bucks for my test structure. I have a model on which its validates_presence_of verification contains an exam in the original format framework:

  Describe "with invalid paramet" "This is a newly created but unsafe type of disease. Provides @disease in "# trigger behavior occurs when invalid parameters are present. Although: (save). And_written (incorrect) Posted: Make: illness => {} Assigns (: disease). Be_a_new (disease) end of end   

Edit: diseases_controller.rb

  # POST / diseases # post / dishes.exml Can make DRF @ Dizzy = Disease. Answer (biog_prim) Reply-Respond | Format | If @set.safe format.html {redirect_to (@disease, notice = & gt; 'the disease was created successfully.'}} Format.xml {rendere: xml = & gt; @ Disease,: condition = & gt; : Created: Location = & gt; @deses} and format.html {Render: Action => "New"} format.xml {Render: xml = & gt; @ disease. Errors,: Status = & gt; : Unprocessable_entity} End End End Personal Def Disease: Params.require (Disease). Explicit (: name, omim_id,: description) end   

How does this test work with my application? Works. Instead of returning a new disease to the wrong post, it returns an error:

  missing the required parameter: illness   

Question # 1: I do not know What is being done with the rupee to see what the post is, in this case the response does not appear to be the object? Assigns print (: sickness) does not contain anything I previously sent an error message, which was sent to the right URL with empty data (which should be posted RSPAT) , But I do not know how PPC is getting back the post statement Question # 2: How do I check that reaction properly, which should be generated - get the error message by saying Literacy is missing a required parameter?

Edit: So my controller seems to indicate that it provides a new disease, but the test fails. If I try to present the missing parameter on the website, then it gives a flash notice that "name can not be empty". I'm not sure how to test in RSPC.

Edit # 2: The above code is included in the lower part of the controller as per the recommendations to use the disease_apadms strong_parameters gem

Thanks!

to answer Question 1 ("I do not know what's coming back with See "APC posts" to see) ... You can use the "put" statement within your digits (i.e. inside this block) for example, you can do something like You can try:

  "Describe" with invalid parameters "It provides @deses to a newly created but unsaved illness" # The poor behavior occurs when the invalid paramagazine has been submitted. Ay_instance.stub (: save) .and_return (false) post: create ,: disease = & gt; {} says: Assesses the disease (: disease). It should be _YU (disease) and end   

This is a valuable debugging tool. RSPC is running when the output will be in SS and FS in the terminal.

Question 2 For, I'm not sure what you want, but I do not know that you have given the disease as a disease I have been entrusted with pattern control spectacles in the following style (from which I have learned how to write controlling glasses) or to check it (or should).

Create a post example:

  Refer to "invalid attribute with" do not "hope to save new contact" {post: create, contact : Factory.Adits_For (: invalid_contact)} .to_not changes (contact, counting) it "reinstates new method" post: make, contact: factory.edits_forfor (: invalid_contact) response.should render_template: new end end ..   

You have a reason to better monitor the governing system. Can that I do not know about Don that case, please answer ignores my question and hope that my second answer is useful!

osx - Mac eclipse set workspace to dropxbox causes startup crash -


Eclipse was working fine until I decided to switch to workspace in my Dropbox folder. After this, the startup screen will be exposed soon to the people in an attempt to start eclipse, which states that "an error has occurred", in which there is a log file in context. I am pretty sure that when using dropbox as a workspace, I am able to run the eclipse again by going to the terminal and using ./eclipse -clean. I then again tested the problem by switching to my desktop and switching to the dropbox (for workspace) and the eclipse failed to start only when I had a dropbox in the form of a work area, so nobody knows why it is Or how to fix it? Thanks

The first 2008 Mountain Lion of MacBook Pro

that's not in the dropbox anybody Also the name of the binary file has changed, which is disputed in the .metadata folder. I had this problem and this was the reason.

javascript - Avoiding HTML and Scripts tags renders -


I am working in a chat box, I use Node.js + socket.io for client-server communication. I am unable to execute PHP code (I have read that this is possible, but it is not recommended and is difficult to obtain). When users send messages with HTML or Scripts tags, everything works fine.

I have tried to remove those tags from the functions that I found. It works fine, but only for HTML tags, so I thought: Okay, I can remove script tags first by using regular expressions. Something like

.replace (/ & lt; script. * & Gt;. * & Lt; / script / gt; / ims, "")

And then delete the HTML tags, but I'm not sure this method is hex proof, and this is a lot of process for each message.

text $ ("# div"). Attachment (message); Without HTML / Javascript code --- Print the text in the same way as if, in it, if you send a message with HTML / JS / PHP code, then the message Is printed in the same way.

Or, what is another way to delete the tag?

Thank you for your time.

Just add a text message as a set to the text.

  $ ("# div"). Attached ($ ("
"). Text (message));

javascript - Setting the Input Value attribute to a variable with space. -


I am trying to set the value of an input button in a string variable.ie "A guide to school bus" I am But when the HTML loads, only the first word comes in the button. My code is given below thanks for the help.

  var title = "A guide to school bus"; Var html string = "& lt; div class =" + title + "& gt;" + "& Lt; input type =" + "button" + "value =" + title + "onclic = loadbook ()>" + "& lt; / div & gt;"; $ (HtmlString) .appendTo (attachPoint);   

And the attachment is a reference in HTML which I am using the following.

  var attachpoint = document.query selector ('. Button at pointpoint');    

The problem is because you are not quitting around the attribute values, try it:

  var htmlString = '& lt; Div class = "'+ + +" "" gt; & lt; input type = "button" value = "' + + title" + "onclic =" loadbook () "& gt; & Lt; / Div & gt; ';   

You can either avoid " in your string, just like I did, just between ' and Switch ". " will be displayed as a normal character and ' is used to mark the beginning and end of the strings.

One As a side point, you probably want to put the t on title to class on div , because it is a different , So in your example, 6 sections will be added to the div.

mql - freebase - topic description/articles -


मैं कुछ फिल्म (" / फिल्म के लिए विषय विवरण पुनः प्राप्त करने का प्रयास कर रहा / रही हूं / फ़िल्म ") और फिल्म शैलियों (" फिल्म / फ़िल्म_जानेर ") इतालवी भाषा में

मुझे लगता है कि समस्या समान है दोनों मामलों में, इसलिए मैं MQL क्वेरी पोस्ट करता हूं जिसे मैं फिल्म शैली विवरण के लिए चलाने की कोशिश कर रहा हूं:


Mql क्वेरी

 < कोड [["" टाइप करें: "/ फिल्म / फ़िल्म_जानेर", "नाम": "फिल्म कल्टो", "/ सामान्य / विषय / आलेख": [{"id": null}]}]   

प्रतिक्रिया

  {"परिणाम": [{"प्रकार": "/ फिल्म / फ़िल्म_जानेर", "नाम": "फिल्म कल्टो" लेख आईडी के साथ ("" / आम / विषय / आलेख ": {{" id ":" / m / 01q0d "}]}]}   

/ M / 01q0d "), मैं" ट्रांस / रैप "सेवा () का उपयोग करेगा हालांकि, हालांकि मैं क्वेरी पैरामीटर "lang = it" का उपयोग करता हूं, लेख अंग्रेजी में है ...: (

कोई सुझाव? मैं पागल हो रहा हूं: डी

फ्रीबेस में गैर-अंग्रेजी नाम शामिल हैं, लेकिन यह अधिकांश भाग के लिए, अंग्रेजी के अलावा कुछ भी में वर्णन शामिल नहीं है। विषय एपीआई और वहां से लेख / विवरण प्राप्त करने के लिए इतालवी विकिपीडिया के लिए / आम / विषय / विषय_सफलता_वेबपृष्ठ प्राप्त करें, लेकिन संभवतया आपको सबसे निकटतम मिलेगा।

और , जैसा कि फिल ने कहा, api.freebase.com कुछ दिनों में दूर जा रहा है, इसलिए आपको नए एपीआई का उपयोग करना होगा।

How to replace letters with alt codes using JavaScript -


OK, so I want to create an HTML page with javascript. I want that whatever I put in the input bar, different translations are done, for example if I put a in the box then I would call it â <º I will. And if I type a word like halo then I'll call it a a "???" Line Line Line Line Line Line ¼ . Does anyone know how to do this?

Here is an example in jQuery:

The type of letter you want With that, you have to fill the replacement head. var replacement = {"A": ")", "b": "& gt;", "(" input ") {$ (" # translator "). Val (function (I, val) {val = val.split ('';; $ .eich (val, function (i, e) {val} = replacement [e] replacement [e]: e;}); return valve .Join ('');})}});

Source:

Passing a missing argument in R -


I am writing a function in R, except for other things, reduce data frames based on the vector of column names I do [. Trying to take advantage of the default behavior of Data.frame , which is missing the 'J' argument, if all the columns will return. Is there any way to pass a missing debate through my cover function? Here is an example of a bare bone:

  fixdata frames & lt; - If I do not specify a value for the column, then I want it to be < Code> [ function: "error is missing in column logic, error is available, no default").   

You can set a default for columns such that if nothing is given then it Catch all the columns. TRUE should be used

  fixDataFrames & lt; - Function (listOfDataFrames, columns = TRUE) drop in the form of {lapply (listOfDataFrames, function (x) x [, columns])} # (parameterfixdataframes & lt; - function (listOfDataFrames, columns = TRUE, drop = FALSE) To add FALSE, more prudent {lapply (listOfDataFrames, function (x) x [, columns, drop = drop])}    

mysql - Why variable is not being passed? -


I am using the select2 plugin to populate tags from mysql. So I'm passing the q variable on getdada.php But the problem is that

  1. q variable is not being sent to getdata.php. I want to pass this variable that I can get data related to it ( Maybe I'm not giving Q variable to the right place.)

    2. If I do not use Q variable, then only the last or first variable is retrieved. I want to populate all the results in the form of tag data (probably there is an error in my jsoncode formate in getdata.php)

    Plz help

      $ 2 ("# e8") to execute the request to use the convenient helper url of Select2. Select2 ({Placeholder: "Search for another concept", minimum input length: 1, multiple: right, Ajax: {//} Return: function (data, page) {return {result: (for example, page) Information}; }}});   

    Here is getdata.php

      $ sql = mysqli_query ($ db3, "select * o4_tags"); While ($ row = mysqli_fetch_array ($ sql)) {$ Tag = $ line ['tag_name']; $ Id = $ line ['id']; $ MyArray = array (array ("id" = & gt; "$ id", "text" => "$ tag"),); } Echo json_encode ($ myArray);    

    For a start, something is going wrong in your PHP script. You are currently retrieving a new $ myArray for each line. Only the last of these arrays is actually output as JSON. This code fixes the problem:

      $ sql = mysqli_query ($ db3, "SELECT * FROM o4_tags"); $ MyArray = array (); While ($ row = mysqli_fetch_array ($ sql)) {$ Tag = $ line ['tag_name']; $ Id = $ line ['id']; $ MyArray [] = Array ("id" => "$ id", "text" = & gt; "$ tag"); } Echo json_encode ($ myArray);   

    I'm not sure why you do not see the search term in your PHP script, but again, I do not see any code in PHP which is actually a search term Works with Have you tried $ _REQUEST dumping?

Django form with choice field not providing None as a choice -


मेरे पास एक विकल्प फ़ील्ड है जिसे

  REFERRAL_CHOICES = ((None, 'कृपया चुनें'), ('खोज', 'एक खोज इंजन से'), ('सामाजिक', 'एक सामाजिक नेटवर्क से'),) referral_source = forms.ChoiceField (विकल्प = REFERRAL_CHOICES)   

मेरे पास एक clean_company_size फ़ंक्शन है जो यह जांचता है कि फ़ील्ड एक अच्छा मान पर सेट है:

  def clean_company_size (स्वयं): company_size = self.cleaned_data अगर कंपनी का आकार कोई भी न हो तो: वैल्यूशन एरर बढ़ाएं ('कृपया कंपनी का आकार चुनें') वापसी कंपनी का आकार   

अगर मैं एक या company_size == ' कोई भी नहीं ' शर्त ऊपर की ओर कोई भी चेक, सभी अच्छी तरह से काम करता है। हालांकि, मैं उत्सुक हूं कि स्ट्रिंग के लिए कोई भी मान क्यों नहीं डाला जा रहा है। किसी फ़ील्ड क्षेत्र में डिफ़ॉल्ट संकेतों को पूरा करने का सबसे अच्छा तरीका क्या है और उस फ़ील्ड को आवश्यक होना चाहिए?

सभी POST और GET वेरिएबल्स, साथ ही Select HTML टैग मान को शुरू में तार के रूप में भेजा जाता है डीजेंगो उन्हें -सैरे- int में परिवर्तित करते हैं, जब यह मॉडल से कटौती योग्य होता है आपके मामले में "कोई नहीं" ऑब्जेक्ट से "कोई नहीं" स्ट्रिंग को अलग करना संभव नहीं है, वे दोनों संभव मूल्य हैं आप अपने REFERRAL_CHOICHES में कोई भी के बजाय "" का उपयोग करना पसंद कर सकते हैं

game engine - Messages Between Two Distant Classes In Java -


I am working on Java games for a few months now and I have a problem.

My player runs around a environment , which contains tiles, in which everyone has their own CollisionBox Just keep: When player s collision box matches any other collision box (like a box or something like that) , Then the player can not move. That part is taken care of.

I am trying to implement Interactive Tile s, in which player will be caused if something happens to a specific collision box , especially like stairs or doors, I want to be able to make a new environment if specific * interactive tile * s hits

I have the functionality of transition and collision maps, but I know O the collision event to become environment (which is not easily hierarchy code for the collision event).

I am familiar with the supervisor pattern, in which environment can "hear" this collision, but I do not really know how it will be implemented here, Or even if this is the right design pattern for this situation!

Even just ...

When Player.IsCollidingWithDoorLeadingToNewEnvironment is environment. New environment for protection ( New Environment) should be called, but they are far apart in code structure from each other.

More generally: How can I send messages between the two classes without the layers on the layers of the constructor / constructor injection?

Have you heard about model-view-controller models? It's nothing, but maybe it can help, basically your program will have three parts:

  1. Ideal - this is all the teetotal words you have in your question, some of that program Represent parts that interact to include it.
  2. View - Display; It is not as relevant here, it is absolutely fine like how things are prepared on the screen
  3. Controller - this is what I think will help you, it's a class that runs the whole show . This class controls all the parts generated in the model component of the program and allows it to communicate with them. I think the environment class in your case would be good for this.

    Your controller group may contain arrays / array lists, which are included in all parts that were created during the game, such as collision boxes for each collision box (I I am using an instance variable (maybe by calling this ID) which represents its position in the array (this index can be as simple as an integer). When two boxes collide, you can call a method in the controller class which takes two IDs, and these IDs will easily find where they are in the array. Of course, you can use other data structures, but I hope this will give you the original idea.

haskell - Where is the source code for ghc-prim? -


Finding repositories in Google or hackage was not easy.

Where can I find the source code?

<<> code> ghc-prim package is here:

(If that link breaks then see here).

Note that GHC.Prim module is defined internally for its own compiler, and does not conform to any .hs file.

ssms - How to connect to local instance of SQL Server 2008 Express -


I just installed the SQL Server 2008 Express on my Vista SP1 machine. I previously used it on 2005 and along with the old SQL Server Management Studio Express. I was able to connect with my PC-NAME \ SQLEXPRESS example (no, PC-NAME is not my computer name - -) with no problem.

I uninstalled the 2005 and SQL Server Management Studio Express. I then installed SQL Server 2008 Express on my machine and chose to install it to the SQL Server Management Studio Basic.

Now, when I try to connect to PC-NAME \ SQLEXPRESS (with Windows authentication, like I always did), I get the following message:

< Em> Can not connect to PC-NAME \ SQLEXPRESS. When creating a connection to SQL Server, a network related or instance-specific error has occurred. The server was not found or was not accessible. Verify that the example name is correct and SQL Server is configured to allow remote connection. (Provider: SQL Network Interface, Error: 26 - Server / Instance Specified Error) (Microsoft SQL Server, Error: -1) For help, click:

When I used SQL Server 2008 Installed, I used SQLEXPRESS as the local instance name. As far as I can tell, through SQL Server Configuration Manager, SQL Server is configured to allow remote connections.

When I went to the help link, the help page gives the following suggestions:

  • Make sure the SQL Server browser service is started on the server.
  • Use SQL Server to enable remote server connections to use SQL Server. For more information about the SQL Server Surface area configuration tool, see the Surface area configuration for services and connections.

    Well, as far as I can tell that my SQL Server Browser is not a service system (seen in MMC for one, can not get one).

    and SQL Server Surface Area Configuration Tool does not exist in SQL Server 2008. So help you with a good job, Microsoft; -).

    What I have to do now is the loss for me. After upgrading me in 2008, I had a lot of work to do till today (the person I am working with got it and got a problem And he told me that it would be easy - that's better than the database stuff I'm doing). Does anyone have any ideas that can be wrong? I really appreciate it. If I can not find this work in a few hours, then I'm going back to SQL Server 2005 (if it also works, gah ...).

    Edit: I closed the Windows firewall, and that did not help; Also, I saw that I do not have a "data" directory under my SQL Server 2008 installation directory tree - do I have to install it Could possibly have done something wrong?

    Please check the server name you provided. This username must match the name shown below in the text box, and that name will be \ SQLEXPRESS :

     connect dialog

sqlite - node.js and sqlite3 web app, corrupted unsorted chunks : / -


I am new to node and am trying on my Raspberry Pi. I have installed the latest version ()

and npm installed sqlite3 (created and also installed)

Now I am trying to run the following code:

  var http = ("http"); Var sqlite3 = expected ("sqlite3"). Verbose (); Var ports = 1337; Var ip = "192.168.2.15"; Http.createServer (function (req, res) {res.writeHead (200, {"Content-Type": "text / plain"}) var db = new sqlite3.Database (": memory:"); db.serialize (Function () {db.run ("Make Table Layram (Notice Text)"); console.log ("CREATE"); var stmt = db.prepare ("INSERT FORMEES (?)"); (Var I = 0 ; I & lt; 10; i ++) {stmt.run ("Ipsum" + i);} stmt.finalize (); console.log ("Start Selection ["]; db.each ("SELECT rowid as id , "Lerem", function (mistake, line) from the console {console.log (row.id + ":" + row.info);}); console.log ("] select end");}); console Log ("off"); db.close (); res.end ("hello world.");}). Listen (port, ip); console.log ("server is running http: //" + ip + ":" + Port);   

The output I get is:

  All Running http://192.168.2.15:12337 Select Start [] Choose Close Select 1: Ipsum 0 2: Ipsum 1 3: Ipsum 2 4: Ipsum 3 5: Ipsum 4 6: Ipsum 5 7: Ipsum 6 8: Ipsum 7 9: Ipsum 8 10: Ipsum 9 *** detected glibc *** node: free (): Non-corrupted chunks: 0x0072fe28 *** Canceled   

My impressions are that ether has a running position, even if I am using db.serialize or it is not working on PI (although sqlite3 compiled properly

thanks

Recently I faced this issue. I realized that I was not using a steady / recommended version of node. Js Resolved by downgrading 0.8.15

list - Trouble accessing child objects in Firebase -


I'm trying to drag a list of users connecting to a select dropdown in my firebase. It is that I am unable to use child objects properly.

Uses the user.UserName (see below code), but only for my own user data, it does not drag anything else. / P>

It was sort of changing "userListRef.on" from "myUserRef.on" and using something like "snapshot.child" ('username'). Should, but it just throws undefined. To do the same, "userListRef.on" ('child_added') goes to "connectedUsers.child.userName", I'm sure I'm missing something simple here.

In the code given below, the function (snapshot) "I can successfully add and remove user data from firebase, and log all objects into the console and when I drill the object, all the data looks fine. Just one way to access data So that I can remove all connected users in some selected dropdown or remove them when they disconnect

  on userListRef = new Firebase ('https://myaccount.firebaseIO.com/users / '); On myUserRef = userListRef.push (); // add userId = $ (' # myIdInput ') to the firebase on Val (); Username = $ (' # nameInput '); Val (); MyUserRef.push ({userId: .. userId, user name: uSERNAME}); // read user objects and fire adduser function myUserRef.on ('child_added', function (snapshot) {var connectedUsers = snapshot.val (); / / Adduser (connectedUsers; Console.log (adduser). UserId, connected user.assername);}); // Add user to SEL ECT dropdown function addUser (userId, userName) {var modSelect = $ ('# tsmmodsendto'); ModSelect.append ($ ('& lt; option & gt; & lt; / option & gt;'). Attr ("value", userId) .text (userName)); } USER objects and fire REMOVEUSER function myUserRef.on ('child_removed', function (snapshot) {var connectedUsers = snapshot.val () read //; console.log (removeUser); //removeUser (connected) users.userId, connectedUsers.userName );}); // User to delete user drop down function (user ID, username) {var modSelect = $ ('# tsmmodsendto'); ModSelect.append ($ ('& lt; option & gt; & lt; / option & gt;') RemoveAttr ("value", userId) .text (userName)); } // ON DisconnectNetRemove User Data FIREBASE myUserRef.onDisconnect (). Remove ();    

The code you write will not work properly because every user is typing Is:

/ user / PUSH_ID / PUSH_ID

and then listening:

/ users / PUSH_ID

so every customer will go Just listening for your data and never seeing anyone else's data, to see the data of other people, you should listen / write to everyone on the same path.

In your question, you mention that if you change the listening of the user / you can see "undefined" you can simplify your code, and use that approach, and Maybe I can provide a more helpful answer?

Or if I can not understand correctly, please make your questions simple and clear.

unix - how same key is used across processes to communicate each other using shared memory -


I have learned that to use shared memory, it is necessary to use the same key in both processes, in the sample code I saw , The key is difficult in both programs (sender, receiver). My suspicion is that in real time that two unexpected processes use the same key I have read about the photoc () function, but this file asks for the path as a logic. But how can this be possible in the situation below in real time

Assume that when a user prints the file command from Firefox, then thinking about creating another program such as ghostscript ps / pdf file (It shares shared memory). Here's how Firefox and Ghostscript will use shared memory

To define each other's unknown processes Need sharing shared memory simultaneously (and share) protocols And that protocol will need to include information about shared memory (for example, an integer value for a shmget call). Actually, it will need to define some "hard coded" identifier or some method to find it.

Without some types of protocols defining this information (what is in memory), it would not be possible to remove a process that is also installed in any memory location that was installed by another process Was there.

php - Using JSONmodel to try and fetch data from a server to ios device -


I am trying to use JSONmodel to get and receive data on my iOS device from my iOS device . I have installed my classes properly but for some reasons this URL is coming to the vacant place after calling. "Http: // http: //www.cs4768project.net76.net/untitled.php Action = getShops":

  feed = [[feed alloc] initFromURLWithString @ completion: ^ (JSONModel * Model, JSONModelError * err) {NSLog (@ "access"); // json received NSLogs (@ "shops:% @", feed .shops);   

Here is the model that holds the feed

  @interface feed: JSONModel @property (strong nonatomic) NSArray * stores; @end   

class my coffee shop

  @interface with the Coffeeshop: JSONModel @property (strong, nonatomic) NSString * name; @protecti (nonatomic) CL LocationDags latitude; @protecti (nonatomic) cl locationgates longitude; Jesaan output:  
  { "name": "Starshans", "latitude": "45", "Lettytud": "- 52"}   

I was trying to find a solution for a while and nothing came and I came to know why this is not working. Any help would be awesome.

OK, it looks like something wrong with JSON because I tried this code < / P>

  NSError * e; NSDictionary * S = [NSJSONSerialization JSONObjectWithData: [NSData dataWithContentsOfURL: [NSURL URLWithString: @ "http://www.cs4768project.net76.net/untitled.php?action=getShops"]] Options: NSJSONReadingMutableLeaves error: & amp; E]; NSLog (@ "% @", S); If (e) {nslog (@ "% @", e); }   

And it is

  domain = NSCocoaErrorDomain code = 3840 "Operation completed couldnâ ???? t. (Cocoa error 3840k)" (end garbage.) UserInfo = 0x1e0529f0 {NSDebugDescription = end trash.}   

so, if it is your website, I'll change the JSON to a valid format, or the owner Contact the website and inform them about the problem, the answer tells you what the problem is.

jquery - on() does not do the live() job for me -


This is outlined on the jQuery website .live () method is no longer recommended.
I was trying to use the .on () event but I hope it does not show up. Using .live for the following scenario, I have no problem.

I have found a field for which I use an autocomplete plugin:

What this does is, every time you are about to enter an entry, you Put it in a field (generated by the plugin) such that when you enter the first entry and it is completed, the second time you are entering the input, another new area is created with the same class:

  & lt; Li id = "select" & gt; & Lt; Input type = "text" autocomplete = "off" size = "0" square = "input" & gt; & Lt; / Li & gt;   

What I'm trying to do, is a generator on paste handler, so every time I paste something, that is the input, it's a tag with its tag The entry (which is not related to it, is the current issue anyway) when I use Live event works as expected, it not only handles my paste for the first time, but also for future pastes. But when I change it, it only works for the first paste. The following is my code:

  $ (document) .ready (function () {$ (".input"). Live ('paste', function (event) {var element = this; SetTimeout (function () {var text = $ (element) .val (); addItem (text);}, 10);});}); Can anyone explain why this is happening?   

P> You put it in the field (generated by the plugin), such as when you enter the first entry The second time when you are entering the input, another new area is created with the same class

It sounds like a dynamic element Using it, bubbling that event on document and then paste . The function was reworked when the input was on element.

By changing it like a simple () : $ (".input"). ('Paste', the function (event) {} will not be repeated.

This will be just a simple dam and as soon as the element is dynamically changed / added again It is, as soon as the element was removed, even then the bound events went away, even if it was added again.

To repeat live () for dynamic elements You must use the at () delegation, which will allow you to bind the event

) .ready (function () {$ (".input"). Live ('paste', function (event) {var element = this; setTimeout (function) (var text = $ (element ) .val (); AddItem (text);}, 10);});});

To use with this type of representative () :

  $ (document) .ready ( Function () {$ (document) .on ("paste", ".input", function (event) {var element = this; SetTimeout (function () {var text = $ (element) .val (); addItem ( Text;), 10);});});   

The above event is now bound to the document , but . Input element paste is given on code>.

Instead of document you should bind to the nearest static parent element, for example body or fixed parents with proximity, such as:

  $ ('body'). ("Paste", "Input", Function (Event) {...}   

Which is the closest stable parent of the .input element, However, the document or body will close the course.

python - Matplotlib invisible annotations -


I am currently adding some point to a graph and adding annotations to each specific point. However, on every attempt, only a subset of annotations actually appears on my screen. Other comments via debugging and prints are "there", but they are not visible for any reason right now. Is there something that I am doing wrong?

  import matplotlib.pyplot such as plt self.fig = plt.figure () self.ax = self.fig.add_subplot (111, projection = 'polar') = = [[0.2] , 1], [0.4, 1], [0.6, 1], [0.8, 1], [1, 1]] for x, y in li: point, = self.ax. The plot (x, y, marker = 'o', color = 'r', markarris = 12) annotation = self.ax.annotate ("comment goes here", xy = (x, y), xycoords = 'data' Xytext = (x, y), textcoords = 'data') self.fig.canvas.draw ()   

After some debugging, it seems that projection = 'polar ' fixes the problem and all the annotations appear. Is there something specific with polar graphs that will be due to buggy observations?

EDIT: In fact, I could increase the problem more and more .. I tried the simplified version of the program and it worked, I work on an existing structure built on the top of Matlotlib and gtk + I am doing this, so I may be unaware of some other hidden problem.

Editing 2: I have detected the problem. It seems that, in my update function, if I set the ylim for the graph (radius) to 1 (which is the same as all the points), then some annotations disappear. I do not know why, but if I leave it alone, then it works.

Enter image details here

matplotlib .__ version___ There is no repro for me at 1.3.x. Your annotation is shown in the specified position.

c++ - Accesing values of another program -


So, I was wondering how I could use values ​​of different programs with my C ++ code.

I understand that I know the memory location and it has to be accessed in some way but I really do not know how

we say that I have There is a game where I have a character with certain health and I want to read that health with my C ++ code (as you can read different values ​​with cheating engine).

How do I complete it?

For clarity: Operating System is Windows

You (/

  int * money = 0x00400000 + 0x00ABCDEF;  

If you are smart, you can inject a DLL, you can use the pointer in your code

  int * money = 0x00400000 + 0x00ABCDEF; / / Director's funding address * money = 5000; // Set Money 5000. If / If you want a DLL example, here are some:  

<

It can be "dangerous" in the context of the application.

When you access an indicator that indicates a protected memory area, inaccessible memory, not for luggage or an invalid location Your application may crash but I do not know how the cheat engine prevents it, but you have a few options, which I recommend:

  • Quit the application honestly and The user knows that You can not handle it
  • Instead try / handle the problem with the hold block?
  • Try exiting the application
  • Do nothing and let the app behave weird / accident
  • ... greater than

    I have also written a pointer to myself which handles dereferencing and an error (return zero)

      // tap automatically when the last parameter Stops as the "Dereferences" template stops & lt; Square T = DWORD, square S = DWORD & gt; Structure Pointer {Private: std :: vector & lt; S & gt; Parameter; S variable; Bull Motin One; Public: // tap "Dereferences" template automatically as the last parameter & lt; Class ... Args & gt; Pointer (RGS ... Args) {std :: arrays & lt; S, sizeof ... (args) & gt; List = {args ...}; For (auto i: list) params.push_back (i); If (params.size ()> 1) MoreThanOne = true; More tanone = false; } T Resolive Pointer () {variable = params [0]; If (MoreThanOne) return (t) variables; Try {auto it = params.begin (); This ++; (; It! = Params.end (); ++ it) {if (* reinterpret_cast & lt; S * & gt; (variable) == NULL) Fixed stat_cast & lt; T & gt; (NULL); Variable = * reinterpret_cast & lt; S * & gt; (Variable) + * this; }} Hold (...) {return static_cast & lt; T & gt; (NULL); } Return (t) variables; } T Operator () () {Return ResolvePointer (); }};   

    Usage:

      Unsigned long ipaddr = htonl (pointer & lt; unsigned long & gt; (0x00400000 + 0x008E3A74,0x04,0x38, NULL) ( )); / / Pointer to IP address if the players (ipaddr! = NULL) // .... ....    

javascript - customize terrain.js (three.js) Need to add lambert/wire material -


I have recently started playing with three.js, and I started the demo as a design project I am working on

I would like to add a hybrid shader "Wireframe / Lambert" by default. Only the wire comes with shader.

This is the code from the demo, the use of basic material:

  var matrix = new THREE.MeshBasicMaterial ({color: 0x10ce58, wireframe: true}); var geometry = new 3. plane gemetry (width, height, model width, model height); net = new three Aries (geometry, matrix); Mesh.double-side = false;   

And I tried to do something like this but I only provide "Lambert" and no lambert and wire combined, any ideas?

  darkmaterial = new three. Meshlem Bartmery ({Color: 0xffffff, Cinematography: three. FlatShading, Overdra: Ver wireframematerial = new THREE.MeshBasicMaterial ({color: 0x10ce58, wireframe: true, transparent: true}) var multimedia = [dark matter, wireframemetry] var geometry = new 3. plane gemetry (width, height, modelwidth , Modelhigh); trap = new three. Aries (geometry, multi-functional); Mesh.double-side = False;   

"post-text" itemprop = "text"> < P> This is the code that I use to content ()

  var geometry = new three. Plain gymetry (width, height, model length - 1, model length - 1, material); Content = [new three. Meshlem Bartmatti ({Color: 0xffffff, shading: THREE.FlatShading, overdraw: true}), New Three. Meshlembart content ({color: 0x10ce58, wireframe: true,})]; Var Aries = New Three. Aries (geometry); Object = three. Centiulate.Sant multimedia object (geometry, content);    

php - zend validation not working in populate (edit form) -


<पूर्व> UserController.php ------------- संपादित करें क्रिया (विधि) --- ------- $ UserInfo = सरणी ('hdn_uid' = & gt; $ UserResult ['user_id'], 'उपयोगकर्ता नाम' = & gt; $ UserResult ['user_name'], 'प्रथमनाम' = & gt; $ UserResult [ पहला नाम'], ); $ फार्म & gt; पॉप्युलेट ($ UserInfo); $ इस- & gt; दृश्य- & gt; फ़ॉर्म = $ रूप; फ़ॉर्म / यूज़र एडिट। PHP ------------------ $ elementDecoration = array ('ViewHelper', 'Description', 'Errors', सरणी (सरणी ('डेटा' = & gt; सरणी ('लेबल', सरणी ('टैग' = & gt; 'टीडी', 'प्लेसमेंट' = & gt; 'प्रीड')), अरै ('HtmlTag'), सरणी ('टैग' = & gt; 'td')) (सरणी ('पंक्ति' = & gt; 'HtmlTag'), सरणी ('टैग' = & gt; 'tr')),); $ Hdn_id = नया Zend_Form_Element_Hidden ('hdn_uid'); $ Hdn_id- & gt; एडफिल्टर ('इंट') - & gt; हटाएंडिकॉरेटर ('लेबल') - & gt; हटाएंडिकॉरेटर ('एचटीएमएलटैग'); $ इस- & gt; setName ( 'लॉग इन'); $ इस- & gt; setDecorators ($ formDecoration); $ उपयोगकर्ता नाम = नया Zend_Form_Element_Text ('उपयोगकर्ता नाम'); // इस उपयोगकर्ता नाम और नियंत्रक में $ UserInfo arr 'उपयोगकर्ता नाम' मिलान किया गया है ताकि टेक्स्ट फ़ील्ड में मौजूदा उपयोगकर्ता नाम तालिका से आबादी हो। $ Username- & gt; सेट लेबेल ('उपयोगकर्ता नाम') - & gt; सेट डीकोरेटर्स ($ elementDecoration) - & gt; सेटरूइज्ड (सच) - & gt; एडफिल्टर ('स्ट्रिपटैग') - & gt; एडफिल्टर ('स्ट्रिंगट्रिम'); $ Submit = नया Zend_Form_Element_Submit ('सबमिट'); $ Submit- & gt; setDecorators ($ buttonDecoration); $ इस- & gt; addElements (सरणी ($ hdn_id, $ उपयोगकर्ता नाम, $ पेश करें));

समस्या

  उपरोक्त स्निपेट में कुछ गलती के कारण सर्वर साइड सत्यापन काम नहीं कर रहा है   

विस्तृत जानकारी

  सर्वर पक्ष सत्यापन उपरोक्त कोड में काम नहीं कर रहा है, जब मैं उपयोगकर्ता नाम को साफ करता हूं और अगर मैं बटन सबमिट करता हूं तो प्रोग्राम मान्य नहीं होता है फ़ील्ड, इसके बजाय इसे खाली मान को तालिका में अपडेट किया गया   

नोट उपयोगकर्ता कोड के लिए काम करने वाला यह एक ही कोड है। लेकिन यह संपादन फॉर्म के लिए काम करने में विफल रहता है।

यहां एक प्रपत्र प्रसंस्करण के लिए बहुत ज्यादा मानक वर्कफ़्लो है ज़ेंड फ्रेमवर्क 1:

  सार्वजनिक फ़ंक्शन editAction () {// फॉर्म $ form = new Application_Form_UserEdit () सेट करें; $ फार्म & gt; setMethod ( 'पोस्ट'); $ फार्म & gt; setAction ( '/ उपयोगकर्ता / संपादन'); // test if for POST (if- & gt; getRequest) - & gt; isPost )) {// मान्य और फ़िल्टर्ड फ़ॉर्म मूल्य प्राप्त करें $ डेटा = $ फॉर्म- & gt; getValues ​​(); // कुछ सामान} // यदि फ़ॉर्म मान्य नहीं है तो इसे वर्तमान डेटा के साथ स्वचालित रूप से फिर से दिखाया जाना चाहिए अन्यथा {// यदि पोस्ट नहीं है खाली फ़ॉर्म $ प्रदर्शित करें- gt; & gt; दृश्य- & gt; फ़ॉर्म = $ फ़ॉर्म;}}   

मुझे आशा है कि इससे कुछ मदद मिलती है।

javascript - Angularjs: How to include empty option in select when using ng-option -


How can I add empty options in the beginning when I provide a predefined list of options to use ng-option in which Is not a blank included?

Select an example in Z

  (ng-model = "property.Value", ng-option = "item. Just select an option with an empty value in the property.) "   

Choose

  (ng-model = "property.Value", ng-option = "item.Value item. Property.name in item.Choices") option (value = "" )   

Here is an example -

Filepicker.io — Stop .pickMultiple From Automatically Storing File In S3 Bucket -


I am trying to use Filepicker.io as an uploader, but one for every file in the payload I have to fire the onSuccess event. Using Combination of pickMultiple and .store methods. Like:

  filepicker.pickMultiple (function (fpfiles) {for (var i = 0; i & lt; fpfiles.length; i ++) {// File name clean / check duplicate // S3 filepicker.store (fpfiles [i] .url, {location: 'S3', path: 'filepicker /' + fpfiles [i] .filename}, store the file on function (my_uploaded_file) {// some other Good stuff ...});}});   

(It is opposed to using the PickAndStore method, which will fire only one onSuccess event after the entire payload transmission is completed)

I have a problem It seems that with it it seems that it seems that PixMultiple method is 'Auto Magical' saving a copy of the file in the root of my S3 bucket; So I'm ending with two copies of the same file. For example:

For example:

If I am uploading my_file.png to a folder in my bucket called images then I should get the result

Which is , but I am also getting:

Anyone has to stop adding a file to their S3 bucket.

Thanks for any help.

For anybody else, that's the problem that can be the same. PickMultiple () one ???? & Gt; The .store () method is a dead end in the payload (only) way to get an onsite event for the every file to fire a vanilla and to get the FILES array of the on-site event element, and then loop through FILES and call for each file (Stars) from the array.

Example:

  $ ('# BTN_upload'). Change (function () {var files = $ (this) [0]. Files; // You can see that the console should upload the logs (JSON.stringify (files)); // each file on SA3 Loop the file array to store for (var i = 0; i & lt; files.length; i ++) {// All are good. Execute the store call filepicker.store (// file). To upload the [i], // file option // (I am storing files in files named 'my_folder' within my S3 Bucket) // it is also Is where you can rename your file, like {path: 'my_folder /' + [[i] .name}, // onsut function (FPFile) {console.log ("Store Success:", JSON .stringify (FPFile); // Now possibly call 'Remove to remove' () from the mp 'file FP.io), // the owner's function (FPError) {console.log (FPError.toString ()); }, // On Progress function (progress) {console.log ("Loading:" + Progress + "%"); }); }}); Filepicker.setKey ('MY_FP.IO_KEY');   

and HTML:

  & lt; Input ID = "BTN_upload" type = "file" />   

This example is not a finished product. You still need to roll your user feedback (like a queue display with progress bar), check duplicate, rename it. But this is all very easy stuff.

Note: I'm not sure how to integrate other sauces on the FOPO tap just for this local-to-S3 upload. perhaps you do?

c++ - pointer arithemetic while using an array of double -


Then I have an indicator for an array of doubles, what I have to do is let me move the cursor to the next position Array is, however, how can I not find any decent documents to do this?

This is my current line that it takes care that the temperature array is an indicator array that looks like this double * temperature = new double [honey of days];

  Cust & lt; & Lt; Setw (10) to be & lt; & Lt; Counter + 1 & lt; & Lt; Setup (10) & lt; & Lt; Temperature + counter & lt; & Lt; "\ 370 C" & lt; & Lt; Setup (10) & lt; & Lt; GetFahrenheit (temperature + counter) & lt; & Lt; "\ 370F" & lt; & Lt; Endl;    

right array element temperature range + counter Unfortunately, this is just an indicator instead of pointer whenever you want signs

> cout < & Lt; Setup (10) & lt; & Lt; Counter + 1 & lt; & Lt; Setup (10) & lt; & Lt; * (Temperature + counter) & lt; & Lt; "\ 370 C" & lt; & Lt; Setup (10) & lt; & Lt; GetFahrenheit (* (temperature + counter)) & lt; & Lt; "\ 370 F" & lt; & Lt; Endl;

Although it is counter-intuitive When you return this assignment, the array index; -).

  cout & lt; & Lt; Setup (10) & lt; & Lt; Counter + 1 & lt; & Lt; Setup (10) & lt; & Lt; Temperature counter [counter] & lt; & Lt; "\ 370 C" & lt; & Lt; Setup (10) & lt; & Lt; GetFahrenheit (temperature at [counter]) & lt; & Lt; "\ 370 F" & lt; & Lt; Endl;   

See pointers dereferencing in any decent C ++ book it should be there.

generics - Java: "implements operator?" -


I have some functions that contain a lot of calculated content using all calculation operators [], *, /, + and - Are done by If there are eyes and loops and tests, those same functions can be "used in any way" which implements those operators, e.g. Double, float, int, taller etc. For reasons of performance, I just use basic types. Is there any way to normalize it?

In addition to this, I think floats and injections should not be doubled and dipped in double. I want to calc in the integer integer, in float on float and in doubles, I only 3 Multiply does not want to write the same code, which just differs in the type used. For example, suppose you have

  public double doSomething (double A, double B) {return A * B + 1; }   

Of course, the actual FN does nothing more than this.

I think a move will be something like this. Public T DoSomething (TA, TB) {back staticAdd (staticMul (A, B), 1); }

one ?? | And define basic functions for static functions for all used types. But as they are not noticed, they will add another FN-call.

Is there any way in Java, like & lt; T applies, applies -> & gt; Recommendations for defining methods like staticAdd are not as bad as you think before. What the hotspot will do for you (when it's in the mood). If you define for those types of actions that you are worried, then you can achieve good performance.

He said, you are still going to tackle autoboxing, because you can not normalize the methods in the oldest. If performance is really important, you can get trapped in writing several method signing. Notice that, it is rumored that the old version may be in future versions of Java / JVM. Of course, the penalty is not zero to deal with the wrapped type, but it is negligible in many applications.

json - How to add another method in rails controller -


I'm having trouble adding a new method to the controller, here are the details:

matches_controller.rb

  DIF index @ matches = match. All rambler render: @mats and df current @ matches = match.fund_b_sql ("select * fade" Test start: rmat: @matches end   

routes.rb

  resources: matches, default: {format :: Json}, except: Edit, Edit: Current End and   

current .json.rabl

  Archive @ Match Features: ID: Live   

Rake Routes Match current_matches get / match / current (. Format) matches # current {: format = & gt;: json} match GIT / Mets (.: Format) match # index {: format = & gt; Json} POST / matches (. {Format = & gt;: json} new_match GET /matches/new(.:format) #new {: format = & gt ;: json} match GIT / Mets /: id (.: Fo rmat) match #shows {: format = & gt ;: json} PUT /matches/:id(.:format) match # update {: format = & gt ;: json} DELETE /matches/:id(.:format ) Delete matches #: {= format = & gt ;: json}

Error in log

  name error (undefined local variable or method `flash '# and lieutenant; For Match Controller: 0x0000000d7b2368>): Block in app / controller / application_controller.rb: 6: in & lt; Class: ApplicationController & gt;   

application.rb

  Class ApplicationController & lt; ActionController :: API ActionController :: MimeResponds includes CanCan :: ControllerAdditions rescue_from CanCan :: AccessDenied do | Exceptions | Flash [: Error] = Exception. Message Exceptions Message redirect_to root_url end DEF log_exception (exception) logger. Terror (Exception Message) Logger. Terror (Exceptions Backtrace.join ("\ n") End End   

I have done this in another application before, I do not know why this is not working.

You can also close Flash directly to rescue_from Can not access the blocked block. However, if you pass the symbol of the exception handler method, then you can reach Flash . For example:

  class ApplicationController & lt; ActionController :: API rescue_from CanCan :: AccessDenied, with: with> & gt; : Access_denied Private def access_denied (exception) Flash [: Error] = Exception. Redirect Message Root_Arnal End End   

For more information, see the section on rescue_from .

postgresql - simple postgres syntax issue -


I am new to postgres from SQL Server. I have written a function getSkill which takes an integer and from the "Skills" table. One type of "skill", now I want to feed the "integer" type integer from the "jobs" table. If I do this, the posters say that the syntax is error and ^ returns. Scott puts a little caret on. Choose "Select" from GetSkill (Select "SkidID" from "Jobs", where "Job ID" = "PosID") // Syntax Error ^ ^ getSkill

I'm pretty sure that () A statement is a postgres statement - but if I change it with an integer syntax error it moves away. By getting GetSkill ("0") //,

  selects an error saying that there is no line at position 0 in the DB, because it is still not complete   

This is misleading to me syntax error if I return an integer with a valid integer seems to take place to replace a valid postres statement.

Can anyone tell what is happening?

I think it should be

  GetSkill from jobs ( SkillID), where JobID = "posID"    

Android In-App Billing: Purchasing real items with test accounts without spending money? -


I have already tested my app billing code using a steady response code, but I'll take the next step I'm taking with my real app id

I have configured Aids in Google Play. My test accounts are set up. I

When I try to start a test, I am asked to provide credit card information ... is it going to charge me money ?

I hope the test account is used by a fake CC such as the stable Scass

During testing, you have to input a real CC as you said. When I tested in my app, I just went to my Developer Console and canceled the order by killing the "Cancel Complete Order" button. By doing so the money was returned to my card.

javascript - Why are objects not anchoring to prismatic joint(s) -


I am creating a bunch of random objects and fixed them with a fixed body (circle) with a prismatic joint Have to draw on the circle.

There is a problem - objects have to fall from the edges of joints because they do not seem anticipated.

What am I doing wrong

js bella:

js: (by going physics.prototype.connectToCenterWithJoint for joint code) < Pre> physics = (function () {physics physics} {this.bodies = []; this.testObjectCount = 30; this.w = new Box2D.Dynamics.b2World (New Box2D.Common.Math.b2Vec2 (0, 10), true); Stability = New Box2D.Dynamics.b2FixtureDef (); this.bodyDef = New Box2D.Dynamics.b2BodyDef (); this.bodyDef.type = Box2D.Dynamics.b2Body.b2_staticBody; this. BodyDef.position.x = 9; this.bodyDef.position.y = 13; fixture.shape = Box2D.Collision.Shapes.b2PolygonShape.AsBox (10, .5); this.w.CreateBody (this.bodyDef) .CreateFixture (Stability); this.bodyDef.Type = Box2D.Dynamics.b2Body.b2_dynamicBody; this.bodyDef = new Box2D.Dynamics.b2BodyDef (); this.bodyDef.type = Box2D.Dyna Mics.b2Body.b2_staticBody; this.bodyDef.Position.x = 10; This.bodyDef.position.y = 6; stability.spep = new box2d.collection size.bc.cyclal (1); var circle = this.w .CreateBody (this.bodyDef); Circle.CreateFixture (stability); This.c = circle; This.bodyDef.type = Box2D.Dynamics.b2Body.b2_dynamicBody; This.populate (); This.testJoints (); } Physics.prototype Protocol = function () {var stability = new box 2D. Dynamics.b2 fixstaff (); (Var i = 0; i & lt; this.testObjectCount; ++ i) for {var rnd = Math.random (); If (rnd> 0.7) {fixture.shape = Box2D.Collision.Shapes.b2PolygonShape.Asbox (Math.random () + 0.1, Math.random () + 0.1); } And if (rnd <.7 & amp; amp; rnd> .3) {fixture.shape = new Box2D.Colision.Shapes.b2CircleShape (Math.random (+ 0.1); } Else {var corner = [New Box2D.Common.Math.b2Vec2 (0.0, 0.0), New Box2D.Common.Math.b2Vec2 (1.0, 0.0), New Box2D.Common.Math.b2Vec2 (0.0, 1.0)]; Stability Size = Box 2D Coalition Shape. B2 polygon Shape.AsArray (corner); } This.bodyDef.position.x = Math.random () * 20; This.bodyDef.position.y = Math.Random () * 10; Var body = this.w.CreateBody (this.bodyDef); Body.CreateFixture (stability); This.bodies.push (body); }}; Physics.protitip.bindoconvas = function (canvas id) {var _this = this; Var debug draw = new box 2d. Dynamics.B2Debug Draw (); DebugDraw.SetSprite ((document.getElementById (canvasId) getContext ("2D").); DebugDraw.SetDrawScale (30.0); DebugDraw.SetFillAlpha (0.3); DebugDraw.SetLineThickness (1.0); Debug draw .setflag (box 2d. dynamics.b2dbugdra.a_shapbit | box 2d. dynamics.b2dbugdra.e_jointbit); This.w.SetDebugDraw (debugDraw); Window.setInterval (function () {_this.update ();}, 1000/60); }; Physics.protipip.connecttocentterwaterjoin = function (b) {var jd = new box 2d. Dynamics.juns.b2 paracetamistival def (); Var axis = box 2d. Common Math B2 Math Subtract VV (B.Getworld Center), this .. Gateworld center ()); Axis.Normalize (); Jd.Initialize (this.c, b, b.GetWorldCenter (), axis); Jd.lowerTranslation = -1; Jd.upperTranslation = 0; Jd.enableLimit = true; This.w.CreateJoint (JD); }; Physics.protipip.Testgiet = function (for (var i = 0; i & lt; this.testObjectCount; ++ i) {this.connectToCenterWithJoint (this. Bodies [i]);}}; physics.protipip ApplyTestFoce = function (for (var i = 0; i & lt; this.testObjectCount; ++ i) {this.bodies [i] .phyphorph (new Box2D.Common.Math.b2Vec2 (5000, 0), This. Bodies [i] .GetWorldCenter ());}}; Physics.protitip.update = function () {this.w.Step (1/60, 10, 10); this.w.DrawDebugData (); this. W.ClearForces ();}; Return Physics;});) The problem was that density should be set for prismatic joints to work.

OK:

fixture.density = .5;

Work here Do:

Spotify pagination controls for app API 1.0 -


I'm missing visuals and stylesheets for paging in documents for Spotify App API 1.0. Where can I get arithmetic control on the page?

The Spotfif API was a component named Pager in 0.x ( See). However, that component has never been publicly documented, and only the "What's New" page has used it.

That component is finally deprecated in API 1.0.

SQL statement to find for each match -


This IPL season is the following IPL match database relation:

Player (player, name , Playwright) : This includes details of each player and team that he plays.

Team (Timid, Team name) : Includes Team ID and team name.

PlayerBet (Playarid, Mitchell, Ransacked, Timid) : In every match the player has only one line for the run-run player, if the player plays in the match.

Playerball (player, michid, wicket stack, timid) : In each match a wicket-by-player includes only one line for the player, if the player plays in the match is.

Players match details (player, michid) : Includes the names of the players who have played in the match.

Using the above tables, type a SQL statement to search for each match, the total runs scored by each team, which have played at least one match.

Note 1: The result for displaying the column (s) should be matched in output or output and only runs.

Note 2: When writing a SQL query, you must type the table name in the form of a schema name. (For example employee.projectDetails where employee schemaname and projectDetails are tablename).

I have made some assumptions based on note 1 and note 2. Note 1: You only want match and match runs, but the statement says that every team has scored, so you also need the team in the output, so in my reply, There will be run out output. Note 2: You do not specify a schema name, so I think all tables are in schema named schemaame. You have to replace it with the correct schema name.

  SELECT pb.matchid, t.teamname, SUM (pb.runsscored) schemaname.Playerbat pb as run from INNER JOIN schemaname. T.teamid = pb.teamid GROUP BY pb.matchid, t.teamname ORDER BY t.teamname, pb.matchid    

java - Remove the HTTP Server header in Jetty 9 -


is that you hide the server version in Jetty 8:

  server server = New server port); Server.setSendServerVersion (wrong);   

How do you do it in JT 9? So now it should look like this?

  HTTP configuration config = new HTTP configuration (); Config.setSendServerVersion (wrong); // TODO: Associate with config server ??? Server server = new server (port);    

If some code works that works, it is not sure that it is correct , But at least this works (:

  for server server = new server (port); (connector y: server.getConnectors ()) {for (ConnectionFactory x: y. GetConnectionFactories ()) {if (x Example HttpConnectionFactory) {((HttpConnectionFactory) x) .getHttpConfiguration (). SetSendServerVersion ();}}}    

How to access element of a sigle row Mat in OpenCv? -


I have a seagull line mat of rows = 1, cols = 720 . Reduce the function in OpenCV but when I mat.at < Int & gt; (0, i) , then always claims that the file failed in the Fix Catechin at line 537 in the function in mat.hpp:

 < Code> Template & lt; Typename _Tp & gt; Inline _Tp & amp; Mat :: at (int i0, int i1) {cv_DbgAssert (dims & lt; = 2 & amp; and (unsigned) i0 <(unsigned) size [0] Unsigned) (I1 * DataType & lt; _Tp & gt;: Channel) & lt; (unsigned) (size p [1] * channel ()) & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; _mail_sIS1; 1 (datatype & lt; _Tp & gt; depth) == elemSize1 ()); Return ((_Tp *) (Data + step .p [0] * i0)) [i1]; }   

How to do it? Thank you.

If cv :: MAT is 1 dimensional (i.e. only one of its dimensions is larger) Just mat.at & lt; Int & gt; (I)

, but still the most likely reason is that the mat type is not int, as suggested by Skyschach.

Google Maps URL parameters - web mercator -


Is it possible to request Google Map tiles using anything other than Late / Long?

I want to pass X and Y as Web Mercator Prices. I am not using Google Maps API and it will be a custom tiled layer where the map object is in Web Mercator. I can not use standard Google Maps URLs because it only accepts letters / long values, which The Web Mercator does not fit properly on the map.

Thanks for any help

You do not use Google Maps tiles You can use unless you use it from the Google Maps API Terms of Use:

10.1.1. In addition to the general restriction (A) service Maps APIs (A) can not be accessed, in addition to the services provided in the service through the Map API or any content or through any content, You should not access or use through authorized means, for example, you can access the interface or channel other than the map API (including the Google interface without documentation) Map should not reach tiles or imagery.

google chrome - Html5 audio "preload="none" messes up pause() and currentTime() -


I have a very awkward problem in preventing and resetting the progression of html5 audio.

If I set Preload = "none", then "Pause"; And "current time = 0;" I will not execute at the moment I have already removed = "none", everything works.

This is my code. I fade in / out some pages, each page has an html5 audio element in the same location (intent), so when the user visits that page, Can run.

  $ ('.link'). ('Click', function (e) {$ ('.jpg container & gt; div'). Feodaut (); $ (this.getAttribute ("href"). Fadein (); stop audio);}); Stop the function stop audio () {// fade out and any current audio $ ('audio'). Anamat ({volume: 0}, 1000); SetTimeout (function () {$ .each ($ ('audio'), function () {this.currentTime = 0; this.pause (); Alert ('Audio is turned off and reset');}}} }, 1000 ()) $$ ('Play', function () {// when the volume was faded, then reset the amount when click on Play button $ ('Audio') . ({Volume: 1} 100);}); .... .... & lt; A href = "# page1" class = "link" & gt; Audio 1 & lt; / A & gt; & Lt; A href = "# page2" class = "link" & gt; Audio 2 & lt; / A & gt; & Lt; A href = "# page3" class = "link" & gt; Audio 3 & lt; / A & gt; & Lt; Div class = "page container" & gt; & Lt; Div id = "page1" & gt; // All three audio elements are exact same place. Click on the current audio and click on the link, and enter a new & lt; Audio control loop class = "sound" preload = "none" & gt; & Lt; Source src = "../../ site / music / music 1.mp3" /> & Lt; Source src = "../../ site / music / music 1. og" /> & Lt; / Audio & gt; & Lt; / Div & gt; & Lt; Div id = "page2" & gt; & Lt; Audio control loop class = "sound" preload = "none" & gt; & Lt; Source src = "../../ site / music / music 2.mp3" /> & Lt; Source src = "../../ site / music / music 2. og" /> & Lt; / Audio & gt; & Lt; / Div & gt; & Lt; Div id = "page3" & gt; & Lt; Audio control loop class = "sound" preload = "none" & gt; & Lt; Source src = "../../ site / music / music 3. mp3" /> & Lt; Source src = "../../ site / music / music 3.ogg" /> & Lt; / Audio & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

When I click on a link on any other page, I need to pause and reset all three audio elements. I am currently not shutting down, at the moment I I click the play button in the audio element, which contains a fade fade, I play two audiences at the same time. However the interesting thing is that the audio gets spoiled.

As I have already removed, if no "none" is removed, then the warning ('Audio has been shut down and reset'), and everything will work fine .

Do anyone know that I can load audio when needed (if I take preload = "none") then my website will not work in Chrome, almost 20 music files to all Will try to load on it hang Chrome for a while), but do my script work?

Thanks!

Setting the current time on an audio tag that triggers a DOM exception that has not been loaded yet So make sure the audio is loaded. Just try to set its current time.

  $ ("audio"). A ("load data", function ($ {$ (this). Data ("dataloaded", true);}); $ .each ($ ('audio'), function () {if ($ (this) .data ("Dataloaded")) {this.currentTime = 0; this.pause ();} Alerts ('Audio is turned off and reset');});    < / Html>

python - finding corresponding pixels before and after scipy.ndimage.interpolate.rotate -


I hope that it has not been answered already but I have not found it anywhere. My problem is quite simple: I am trying to calculate a partial profile of an image that uses smoky. One great way to do this is:

  1. Find this segment with which I want my profile to start and end my segment
  2. Remove the minimum image < / Li>
  3. Calculate the angle in which my image should be rotated so that a desired profile can be obtained with a good raw,
  4. The quote is called raw.

    This is the theory.

    I'm stuck on (4) now, because my profile should come in raw number array.shape [0] / 2 , but rotate data and columns below Below the lines of zeros sometimes add up. Thus the correct raw number can be transferred ...

    Is any idea to get the correct raw number, for example using the correspondence matrix used by Suspic?

    Thank you. After some time of debugging, I realized that on the basis of angle - usually more and more * n * 45

    Degree - SPP output adds one line and one column to the image.

    A simple examination of the angle connecting one in the index has solved my problem.

    I hope that this will help the future readers of this topic.

java - State Pattern using Spring DI -


Since I am new to spring, I face problem in changing the state of my state using plain Java Have to do Actually, I used to do a project using the state system, but I acknowledged this approach that each state does not consistently know it as a reference class.

There is an area in the reference class "current location", IState is the type, and its method is setstate (ISTAT state)

One method in ISAT is the GEEXtext (context reference).

And I have kept some time (keep) in the reference class. It is true now and in order to stop the processing, it has gone wrong in the ExtStState, I call currentState.goNext () in this loop.

Each state calls some database transactions and webservice and depending on its result, this theme sets the next state using thesetset (new statesfor ()) - for example

code sample:

  public interface istat {public zero is known ( 

context context);} public class StateOne IState {public void goNext (context Context) {// do some logic if (user.getTitle.equals ("manager") {context.setState (new StateThree ());} else if (User.getTitle.equals ("teamLead") {context.setState ( New StateTwo ());} Other { Context.setState (New ExitState ())}}}}}} Reference to public category {Private Boolean Keep = True; Private Istate Current State, Public Zero SetState (ISTAT State) {currentState = state; Now that I have Spring D Annotation- Based, I'm facing the problem, that the context is with "current state management" @ etooyer, but I need a spring container if I am in a state and "if statement Successful of " If three states are injected, then "state" inject two and otherwise inject the extestate.

If I use @quilifiers (value = "state on") it will only specify the first state that implements the interface, but the second condition that I set based on the condition is not me Know how to specify it in the spring.

Besides this, we need to specify org.springframework.core.Order to specify the order of beans, but I do not know the values ​​received in advance from the database or webservice, it is specified at runtime should be done.

Is it possible to change this plain Java with Spring D and how?

Sorry for any help and thanks to advance in advance.

You should use ApplicationContext . Example given below:

  // Inject context into your bean - @Autowired ApplicationContext applicationContext; // Get the Bean from Reference (@Atovair equivalent) applicationContext.getBean (Statute class);    

ibm mobilefirst - Sharing code between Worklight Adapters -


In most cases, I've done the Verlachla adapter implementation very trivial, with some lines of JavaScript.

On the existing project, using WL 5.0.6, we have many adapters, each of which has several processes. Our special backends require some general reasoning to set up and interpret responses. The Shared Library seems ideal for refactoring the common code for execution, as far as I can see that there is no "library" concept in the adapter environment, unless we want to drop in Java.

Is there a pattern for the code to be reused between the adapter?

I think that you are right There is currently no way to import custom javascript libraries.

Using the "load (xyz.js)" function, Mozilla Rhino is a way to include / load javascript files in the engine, but it is not uncommon for your widescreen adapter.

But I have noticed that it will make your virtualized adapter undeployable. If you deploy another * .js file inside an adapter, you will receive the following error message:

  Adapter Deployment Failed: The process was not implemented in the 'getstories' adapter's javascript file   

It seems that the warklight server can handle only one javascript file per adapter.

github - git did not pull my remote file and says Already up-to-date -


I pushed the last version of the project for the guit.

And I would like to make an experiment: I change a file development. RB

And I run git pull I hope my local file development.rb will be replaced by the remote file development.rb. But why is not it?

Not that how git works if you do this:

  git status   

You will see that you have a pending local change.

/ Html>

Ajax to php - directory is mising -


I just need the eyes of a fresh couple and this is something silly, but I have this problem:

I changed the name of the inline folder such as:

  $ (function () {$ (".name"). Dblclick (function (e) {e.stopPropagation ( ); Var currentEle = $ (this). Child ("a"); var value = current Ele.html (); update val (current idle, value);});}); Function updateVal (current id, value) {var is_file = 0; If (currentEle.hasClass ('file')) {is_file = 1; } Var rnm_dir = currentEle.attr ('href'); Rnm_dir = rnm_dir.replace ('? Dir =', ''); $ (Current id) .html ('& lt; input class = "thwl" type = "text" value = "' + value + '" />);); . $ (". ThVal") focus (); $ (". ThVal"). Key (function (event) {if (event.keyCode == 13) {var n_name = $ (". ThVal"). Val (); $ ('. ThVal'). Remove (); $ (currentEle) .html (N_name); $ .ajax ({cache: false, type: 'fetching' url: 'addfunctions.php', data: {'rnm_dir': rnm_dir, 'is_file': is_file, 'new_name': n_name, Function ':' rename '}, data type: "json", first send: function () {console.log (' ok ');}, success: function (response) {warning (response.name);}, error : Function (request, status, error) {warning (request.responseText);}}})}}); $ (Document). Click (function () {$ (current id) .html ($ (". ThVal"). Val ());}); }   

In the console I see:

  rnm_dir =% 3Fdir% 3Dpress / Blackfield / Blackfield% 25202 / joijuoi & amp; Is_file = 0 & amp; NEW_NAME = dcxfgdfxg & amp; = Function = rename   

but I get an error that the rename (, / dcxfgdfxg)

is missing in the root directory, but if I run the console directly to file the output:

  addfunctions.php rnm_dir =% 3Fdir% 3Dpress / Blackfield / Blackfield% 25202 / new% 2520Folder & amp; Is_file = 0 & amp; NEW_NAME = joijuoi & amp; Function = Rename   

This actually changes its name

My PHP is:

  $ is_file = $ _GET [' Is_file ']; $ Rnm_dir = urldecode ($ _ GET ['rnm_dir']); $ New_name = $ _GET ['new_name']; $ Rnm_dir = str_replace ('? Dir =', '', $ rnm_dir); If ($ is_file) {$ inf = pathinfo ($ rnm_dir); $ Ext = $ inf ['Extension']; $ Dir = $ inf ['dirname']; $ N_file = $ dir '/'. $ New_name '.' $ Ext. Rename ($ rnm_dir, $ n_file); $ '[' Name '] = $ n_file; Eco json_encode ($ out); } And {$ dir = dirname ($ rnm_dir); $ N_dir = $ dir '/'. $ New_name; Rename ($ rnm_dir, $ n_dir); $ '[Name'] = $ n_dir; Eco json_encode ($ out); }   

amendment to work code

believe me Is the issue ? Due to rnm_dir in place of GET key ? Rnm_dir . When the data passes in such a way, then ? is not required.

A quick way to open it in the future is using the PHP function print_r ($ _GET); To see the actual data collected on the server side.

select - how to copy an entry in a row to another row, but in the same column in mysql -


It may look like a trivial question but I have seen everywhere I have a table: There is no entry for id var1 1 2 9353

var1 where id = 1 and I want to duplicate the entry for Var1 from the other line to that place I have

  id var1 1 9 353 2 9 353   

I tried but failed from:

  Update table set var1 = (select var1 from table where id = 2) where it came Mr. = 1;   

Any advice? Thanks!

MySQL has its own ideas for multi-table updates (about syntax for A /) update ). It seems that except the following is necessary, I do not have MySQL to test.

  UPDATE t as t1, t as t2 SET t1.var1 = t2.var1 WHERE t1.id = 1 and t2.id = 2;   

Edit: I've changed the table name to t ; We do not want a reserved word there.

Autoplay HTML5 video after it loads -


I want to autoplay an HTML5 video after loading. When it loads, I would also like to make progress bar (GIF or CSS). Any help?

update 2 Oh, then this answer is a specific task of this scenario. (Only for a 12sec slow connection, the video should be run smoothly) However, it should fill your needs:

  $ (document) .ready (function () {_V_ ("Example_video_1") Ready (function () {var myPlayer = this; myPlayer.on ("Progress", Out_started);});}); Function Out-Started () {myPlayer = this; Var myTextArea = document.getElementById ('Buford'); BufferedTimeRange = myPlayer.buffered (); If (bufferedTimeRange.start (0) == 0) & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; & amp; (bufferedTimeRange.end (0) - bufferedTimeRange.start (0) & gt; 10)) {myPlayer.play (); }}   

Then there are some things, bufferedTimeRange can be more then a single rnge of time (but only with 12 seconds of video constraints. Documents made as one say only 1 ussualy) .. But there is no guarantee that there is no less, this is a link, it is expected that it helps! If the buffer is not enough for 10 seconds of the video, you can make a statement in 10 in a 12

Basic Answer I'm not sure why you want to do this ... but video.js makes it possible

If you have a video element called example_video_1 So you can write Javscript that looks like this (no it is you have an example to use Video.js which then I recommend setting up It is easy to see and actually choose to start it for setting up)

  VideoJS ("example_video_1") ready (function () {var MyPLAYER = this;. HowMuchIsDownloaded = myPlayer.bufferedPercent (); if (howMuchIsDownloaded == 1) {myPlayer.play (); start with some other video} // // setTimeout (Arguments.callee, 100);}});   

Update It appears that the above API call is currently broken for the video. JS (Report a bug) Here's a video when your video tag id "example_video_1"

  $ (document) .ready ( Function () {_V _ ("example_video_1"). Ready (the function is being buffer ending () {Var myPlayer = this; myPlayer.on ("loaded reddata", Done_download);});}); Function Done_download () {myPlayer = this; Var myTextArea = document.getElementById ('Buford'); Warning ("Video is fully buffer"); MyPlayer.off ("Loaded Reddit", Done_download); }   

Note Video.JS seems to be an internal mechanism that does not allow buffer to buffer a complete video stream before reaching a certain limit You will see this strange behavior here (with at least one .mp4 source) of the video ... ill to keep it on your test server for a few days

Cannot use the usb wireless card in virtualbox host:OSX guest:BT5 -


I have tried many solutions in the Internet and all the solutions do not work for me. I use the USB setting USB in the virtual box I set the filter, but it keeps a pop-up error for me



There are errors here:

USB devices Failed to attach the link to 54 msb ....... [0001] in virtual machine BT5.

The USB device 'Random 54 M.USB .......' with UIID (ID) is in use for someone else.

Code of Result: ns_arroarroarfelier (0x80004005)
Components: Host USBDevice: Interface: IHostUSBDevice
Callee: IConsole

< P> Can anyone help me?

VirtualBox for your extension Ralink are not allowed to attach it. I came to know that the Ralink wireless utility or driver will not release it on the Virtual OS on the guest OS. I deleted the cut (make sure I first supported it) and rebooted. Now after VirtualBox OS (BT5R3 in my case) compiling it for the driver, after using the Monrobb RT5370 ST and blacklisting other RT2x00 and RT 2800, it sees it under LSUSB.

ruby on rails - Controller not redirecting where I'm expecting it to -


I am a user tries to access a specific controller action to redirect to the registration page, but it works not doing.

In my users_controller.rb, I have:

  def pre_approved_with_code_action @code = params [: code] If Pram [: commode] = Cancel '' redirect_to root_url back end if parameter [committed] = 'Create account' flash [: notice] = 'Please end a new user as the register' redirect_to new_user_registration_path (: discount_code = & gt; @code) return if params [ : Commit] = 'Login and try again' redirect_to new_user_registration_path (: notice = & gt; please register as a new user ',: discount_code = & gt; ; @code) Return and end   

The log file says:

  2013-06-20 to 127.0.0.1 for POST "/ pre_approved_with_code_action" 10:05:43 -0700 processing user controller # pre_approved_with_code_action as HTML parameter: {"utf8" => "A" ??? "Pramanikta_tokn" = & Gt; "sWENK4ZhisSKHQswUZkDcq8ZxsXU + ym9wQqnYwgPIo4 =", "code" = & Http: // localhost: is redirected to 3000 /   

, Then it is being redirected to root_ url, not new_user_registration_path. any idea?

Simple mistake, you need to

instead of Params [: commit] = 'Cancel' should be if the question [: commod] == 'cancel'

java - Iterate through list of object array -


I am querying using the following code using the original SQL

  Private & Lt; T & gt; & Lt; T & gt; ExecuteNativeQuery (string query string, map & lt; string, object & gt; supreme, class & lt; T & gt; clues) {query query = entityManager.createNativeQuery (queryString); If (param! = Null & amp; param.size ()> gt; {for (Map.Entry & lt; string, object & gt; entry: param.entrySet ()) {query.setParameter (entry .getKey), entry .getValue ()); }} List & lt; T & gt; Result list = query.getResultList (); Return results list; }   

and getting database results.

  Seller name | IncidentID | IncidentStatus | Event day ------------------------------------------------ - ------ XYZ | 100 | Open | 02-Jun-2011 ABC 101 | Off | 03-Jun-2011 MNP | 102 | Open | 01-Jun-2011 LPQ | 103 | Open | 01-APR-2011   

To iterate this result, I am using the following approach

  Iterator iter = resultList.iterator () ; While (iter.hasNext ()) {object [] result = (object []) iter.next (); System.out.println ("vendor name -> gt; + result [0]); }   

Is there a better way to iterate in the list?

A "better way" (java 5+ for each) actually showed what you would translate , Using an iterator, but the syntax is good:

  for (object [] result: resultList) {// ...   < P> Another "better way" depends on the fact that you know the list size and you can use a counter in the loop:  
 for  (int i = 0; I & lt; resultList.size (); i ++) {object [] Inam = Prinamlistkget (i); // ... the rest ...   

In short, there are several ways to recycle through the list, but it is logical that there are "better" ways: this is the case- Case (if you are using that i counter for other things or you're using iterator to remove some elements from the list) or simply A taste case (low-level vs syntax-sugar)