Posts

Showing posts from June, 2014

ruby on rails - Is it possible to define ActionController::Base in many different controllers? -

If you had command control , can you define classes like this? Classroom Order Controller & lt; ActionController :: Base # End of stuff When I prepare a railroad scaffold, this is the only place that is being defined by ApplicationController (application_controller.rb) in, next to other controllers I have created class order controller & lt; ApplicationController # stuff end Is it right to use the first one? In which case? I can not find the correct answer. It is technically possible but is not advised. Read: Quoted from the page: By default, AppController is received by AppController :: Base in only one application. In return, all other controllers are deprived of the ApplicationController. It provides you with a class to configure in a way such as filing of forgery security and sensitive request parameters of the request. You can participate very well directly from ActionController :: Base. This is only a matter of class succession. Action Co

python - A dynamic load __import__ reports no module error -

Image
यह मेरी निर्देशिका संरचना है: फ़ाइल में keyword.py मैं लॉटरी को आयात करता हूँ। इस तरह से पहली पंक्ति में: लॉटरी से। लॉटर से आयात लॉटरी फ़ाइल में नियममैं लॉटरी का आयात करता हूं। गतिशील रूप से इसे पसंद करें: __import ('lottery.keyword') लेकिन यह "कोई मॉड्यूल लॉटर्या नहीं" त्रुटि की रिपोर्ट करता है। मुझे नहीं पता क्या करना है। कोई भी मदद कर सकता है? मैं गतिशील रूप से एक मॉड्यूल आयात करता है यहां एक समाधान है आपका प्रश्न। यह आयातित करने के लिए डायनामिक आयात का उपयोग करता है। ruly.py में आयात आयात करें यदि __name__ == '__main__': mKey = importlib.import_module ('lottery.keyword' ) MyKeyword = getattr (mKey, 'MyKeyword') k = MyKeyword () k.mPrint () में keyword.py लॉटरी से। लॉटर आयात लोटार्या क्लास MyKeyword (): def __init __ (स्वयं): पास डीईफ़ एमप्रिंट (स्वयं): प्रिंट 'हैलो, कीवर्ड' l = lotterya () l.lPrint () लॉटर्या में py वर्ग Lotterya: def __init __ (स्वयं): पास डीईफ़ lPrint (स्वयं): प्रिंट 'हैलो, लॉटरी&#

php - Yii: where does it store sessions -

I understand how to manage user authorization using the UI's built-in mechanism, but it is not clear to me that Where is the store session? / P> I do not see any new tables in my database, but the log-in remains, which means that continuous on a server-side to match a user ID to the user ID Is storage. Don is going to do anything without knowing how I know this, especially when talking about security issues. Can anyone explain Yii store sessions and how to configure it. As I know, the session is stored in Normaly files, if you have php.ini You can set the path in the file under session.save_path . If you want to get your rescue path, then you var_dump (session_save_path ()); In general, you can access the session code with Yii :: app () -> session If you want to store sessions, see

c# - Cookies dont work when page gets reloaded asp.net -

When my login button is clicked, it should create this cookie Secure zero Page_load (item sender, event events e) {if (! Ipostback) {HTTP cookie tester = new HTTP cookie ("User Inc."); Testcookie.Expires = DateTime.Now.AddDays (1); Response.Cookies.Add (testCookie); }} Safe Wide Navigation MenuUyUtemClick (Object Sender, MenuEventErgus E) {} Protected Zero Logon 1_AntinateTicket (Object Sender, OrientateEvent Events E) {} Safe Wide Log Inview 1_View Changed (Object Sender, EventAGRS E) {} Safe Wide BTNLog InCall (Object Sender, EventAgps E) {ifEmailEmailText == "example@hotmail.com" and & Textbox1.Text == "qwerty1") {HTTP cookie cookie = request. Cookies ["User Information"]; Cookie ["username"] = UserEmail.Text; Cookie ["boolean check"] = "true"; Response.Cookies.Add (cookie); Response.Redirect (Request.RawUrl); } else {ErrorMessage.Visible = true; ErrorEmail.Visible = true; Error password. Visible = true

Trying to understand SSL Handshake -

I have two servers communicating over SSL Server1 initiates an SSL connection from server 2 on SSL. Server 1 has a keystore with a key of 1k, while there is a keystore with 2K keying in Server 2 whether the SSL channel will be installed or will it fail? Where is this exchange or conversation actually in handshake? I have two servers communicating over SSL Server 1 on SSL Server 2 to SSL Connection begins. In this case server1 is the customer's server2. Server 1 has a keystore with a key of 1k, while Server 2 has a keystore with 2k chassis. The sizes are irrelevant. Will the SSL channel be installed or will it fail? Only with the information of this volume is it impossible to say what happened when you tried? The important thing is that there is an important pair in server2 and its keystore has a certificate that is trusted by server1's trust. Where exactly can this exchange or conversation happen? The error, handshake is , does not unders

python - how to read ,increment by one and write back value to a network file location -

I am trying to read a value from a file "build_ver.txt" at a network location, the value of one Increasing and increasing the "Build_ver.txt" to writing the new value back and running in the following error, can anyone provide suggetions to achieve this? open ('\\ network \ files \ build_ver with F = value = 1 value = 1 value_IC = open (' \ \ network \ files \ build_ver.txt ',' w + ' ) Value_inc.write (value) Error: - traceback (most recent call final): file "build_ver.py", line 1 , Open with the & lt; module & gt; F: IOError ('\\ network files \ build_ver.txt', 'w +'): [Eran 22] Invalid mode ('w +') or file name : '\\ network \ x0ciles \ x08uild_ver.txt' / Case> Avoid backslash special characters, In your case, '\ f': form-feed and '\ b': bell gives you some You will have to escape from the backslash with the backslash or use R '' - syntax. Next proble

c++ - Random number generator in a for loop gives same numbers each time -

इस सवाल का पहले से ही एक उत्तर है: < / p> 4 जवाब यह प्रोग्राम कार्य करना माना जाता है स्पिन के लिए तीन अलग-अलग "पहियों" के साथ एक सुंदर आदिम स्लॉट मशीन के रूप में। प्रत्येक पहियों में वर्णों की एक निर्धारित राशि होती है एक फ़ंक्शन प्रत्येक पहिया में एक सरणी स्थिति के रूप में असाइन करने के लिए एक यादृच्छिक संख्या उत्पन्न करता है, जो तब उस स्थिति के अनुरूप एक प्रतीक उत्पन्न करता है। मुझे जो समस्या आ रही है वह है कि बेतरतीब ढंग से जेनरेट की गई संख्या में परिवर्तन नहीं होता है लूप के लिए मेरे प्रत्येक चलना इसलिए मैं मूल रूप से हमेशा "X - X" या "X @ -" हर एक लूप-के माध्यम से प्राप्त कर रहा हूं। मैंने पहले पूछे जाने वाले प्रश्नों के माध्यम से तलाक लिया है और कई संबंधित लोगों को पाया है, लेकिन कोई भी मेरी विशेष समस्या को हल नहीं कर पाया। लम्बी कोड के लिए क्षमा चाहते हैं: #include & lt; iostream & gt; #include & lt; स्ट्रिंग & gt; # शामिल करें & lt; cstdlib & gt; # शामिल करें & lt; ctime & gt; नेमस्पेस एसटी

symfony - how to store customized Data for doctrine? -

I work with symfony2 and there I use theory as an example for my theory xml-file & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; Has a simple repository-class & lt; Principle-mapping xmlns = "http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" XI: schema location = "Http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> & Lt; Entity name = "Allgemein bundle \ object \ ObjektPosition" table = "objekt_position" repository-class = "Allgemein bundle \ repository \ ObjektPositionRepository" & gt; & Lt; Indexed & gt; & Lt; Index name = "id_objekt_subunternehmer_position_fk2_idx" column = "id_subunternehmer" /> & Lt; Index name = "id_objekt_objektposition_idx" column = "id_objekt" /> & Lt

node.js - Running Knex queries taking longer in files vs REPL -

I am trying to straighten any data into a database: / / Seeds js var Knex = Required ("knex"); Var database = requirement (". / Config"). Database; Var knex = Knex.initialize (database); Knex ("users") Insert ({first_name: "John", last_name: "doe"}) Exec (function (error, id) {console.log ("full", id);}); // Returns [1] My problem is that if I put it in a file and run it using node seed. Which Console.log Then it waits for a long time before returning a shell prompt (approximately 20 seconds) to do this in REPL so that the result is instantaneous. Is there any reason that my code will wait 20 seconds before I show it to the command prompt again if I open it and run it to run in RPL? By default node will not give you back the console unless the script is completely completely done. , While node repl inside because it returns the copy soon because the last line stops blocking. In the repl you actually focu

How to concatenate a character constant into a string. C -

If I have a constant character defined in C, can I include it in a line in the string ? #ifdef WIN32 # define SEP '\\' #define ALTSEP '/' #sese # define SEP '/' #define ALTSEP '\\' #endif #define SOME_STRING_LITERAL "foo "/ * code snippet * / / * desired string:" prefix_fu / bar "* / const four * path =" prefix_ "SOME_STRING_LITERAL SEP" bar "; Of course, this fails because sep is not defined as a string, but there is no way to sep Insert? Or would I need any other definition, such as #define SEP_STR "/" . I do not think you can do it in C. The main problem is that the " symbol is something original that it knows the pre-processor should do or do it as a pre-processing token. # Strings with operator will not help. Even if you #define STRINGINIZE (X) #x #define CHAR_TO_STR (ch) STRINGINIZE (ch) < / Pre> and then open it as const char * path = "prefix_" SO

javascript - How to prevent input fields from gaining keyboard focus? -

I'm having trouble implementing a modal dialog in HTML5: I have a programmatic form All background input fields I want to focus with, while the modal dialog is visible. Can the HTML input field be programmatically prevented from receiving keyboard focus? If you keep all input fields inside a form, then on the model dialog Try it var form = document.getElementById ("your_form_id"); Var element = form.elements; (Var i = 0, len = elements.length; i & lt; len; ++ i) {elements [i] .readOnly = true; }

php - How to check attributes belongs to specific product in opencart -

I'm trying to find products that have a multiplier specific attribute, I mean, I search for those products I want to have "type" = rings and "metal" = gold I tried with the operator IN , but this is the option of or operation. I need more operations. The product_attribute table only contains product_id, attribute_id, how do I do and how it works in mysql OpenCart version 1.5.4 I 'below Have tried the given question SELECT * fROM oc_product_attribute WHERE product_id = 42 and attribute_id = 15 and attribute_id = 17 Output is empty If you want a OR argument between attributes in the same group and AND / Li> function which You have to edit, that is public function getProducts ($ data = array), $ get_all = FALSE) { specified at the beginning of the function From the variable: $ validimi = false; $ Filter_groups = array (); Find this code: if (! $ Data ['filter_filter']) {$ Implode = array $ Filter =

How to import non-comma/tab separated ASCII numerical data and render into vector (in matlab) -

I want to import 100,000 points of PI in matlab and want to manipulate it as a vector. I have copied these points and pasted them and saved them in a text file. I am having trouble now to import these points and provide them as a vector. I have got the function which calculates the digits within the matlab, however, I also have difficulty in changing the output in a vector, which I could then, for example, Conspiracy (plus it is slower for at least 100,000 points on my computer.) textscan for: fid = fopen ('100000.txt', 'r'); PIT = TextScan (feeds, '% c', IF); Fclose (fid); PiT is a cell array, so convert it to a vector of characters: PiT = cell2mat (PiT ( 1)); Now, you want a vector of int, but you have to relinquish the decimal period to use standard work: Pi = cell2mat ( textscan (pit ([1,3: end]), '% 1d', ing); Note: If you manually delete this period, you can do it at once: fid = fopen (' 100000.txt ','

graph - what is the lowelink mean of Tarjan's algorithm -

I was reading the details to find strongly connected components in a dry graph. But I find it hard to understand the code snippet: if (w.index is undefined) // has not yet been reached to achieve success; Recurse at this: strongconnect (w) v.lowlink: = minutes (v.lowlink, w.lowlink) else if (in WS), then the successor is in w heap S. and hence in the current SCC v.lowlink: = minimum (V.lowlink, w.index) end if The fourth and seventh lines are different, it confuses me. And in my opinion, the seveth line can be written in the same way with the fourth line v.lowkink: = minutes (v.lowlink, w.index) I This test works well in my program, and for me, it is better that access to BCZ Wadex and Cloud has reached the root, but I could not do it IT_T i) a program that enumerates all the graphs of size 4, then each version (either Minutes (run with v.lowlink, w.index or written minutes (v.lowlink, wlowlink) if in ws) and compared to results. Were similar, though wlowink and

jQuery event can't trigger when the target position changed -

I met a strange issue when using the jQuery event, here's the thing: One The form needs to be valid, so we add a blurring event listener to the form for all inputs, when an input focus is lost, the listener will be valid if user input is valid, if Otherwise, an error message will appear below the input, thus pushing the HTML elements down . And we also force click the event for a button to submit the form. When you end the input in an input field, click the submit button directly. Expected Result: Check that user input is valid, if so, trigger the click event of the submit button. The actual result is: the blurring of the input will be triggered, but the click event will not be triggered whenever the user input is valid. I tried in JSField, and found that in the general case, the blurred event and click event will be triggered. But what's happened here is: Blurred in the event handler, we changed the page layout, the status of the submit button changed, thus

Unable to add Android manifest Permissions -

I am working on an Android Library Project for a week and there is no problem till now. But now I have implemented a bit code to check the network status as the following: Obtain a Public Boolean Network Stats (Activity Activity) {Connectivity Manager CM; NetworkInfo netInfo = Faucet; {Cm = (Connectivity Manager) Activity .getSystemService (context.CONNECTIVITY_SERVICE) Try it; NetInfo = cm.getActiveNetworkInfo (); } Hold (exception e) {log d. ("Mock", e); } If (netInfo! = Null & netInfo.isConnected ()) {return true; } return false; } My log D error returns that I'm missing ACCES_NETWORK_STATE permission. This is where the trouble starts .. When I opened my manifest. XML I'm not able to add a permission (already 3 others). When I click on adding it, a blank window says: Due to the random pigment, create a new element at the top level in the temporary descriptor. Trying to add permission to the manifest is not the work of ether. This code is not compl

compare - Java object compareto -

निजी तुलनात्मक [] आइटम = नया तुलनात्मक [1000000]; bubbleSort (आइटम); सार्वजनिक स्थैतिक & lt; टी तुलनात्मक विस्तारित & lt; T & gt; & gt; शून्य बबल सॉर्ट (टी [] सूची) {टी Temp; के लिए (int k = 1; k & lt; list.length; k ++) {// (इंट i = 0; i & lt; list.length - k; i ++) के लिए केथ पास करें {if (list [i] .compareTo (सूची [i + 1]) gt; 0) {temp = list [i]; सूची [i] = सूची [i + 1]; सूची [i + 1] = अस्थायी; }}}} मुझे जो समस्या है वह के साथ है (सूची [i] .compareTo (सूची [i]) & gt; 0) । मैंने सबकुछ टिप्पणी की है, एक समय में एक पंक्ति। यह केवल एक चीज है जो त्रुटि का कारण बनती है, और यह मुझे आउटपुट में स्पष्टीकरण नहीं देता। बस जो लाइनें है जो कि अगर होगा, और बुलबुला कोड को बुलाएगा। निजी तुलनात्मक [] आइटम = नया तुलनात्मक [1000000]; यह पंक्ति सरणी में कोई भी तत्व प्रारंभ नहीं करता है। आपके पास प्रत्येक स्लॉट में null है, इसलिए आपका NullPointerException । या हो सकता है कि आप इनिट कोड को पोस्ट न करें, लेकिन तब समस्या होगी ।

eclipse - Storing/ Exporting Selenium Webdriver Test Results -

I am using Eclipse - Testmag / WebDriver, and test your application and regress to get the test result. There is no such way. I can store test results (i.e., since printed output), can I export in any format XL file or HTML whenever I run the test? If your tests have been successfully executed, you can see the output in the location: Project-directory / test-test- View these files: index.html = & gt; Full TestNg HTML reports Impulse-report.html = html> Reports that can be easily printed and emailed testng-results.xml = & gt; TestNg results in XML format

mysql - updating db structure - new table or adding a field -

It may look like a silly question but it is here; I'm sure this has happened around someone, you prepare a web app with a DB structure per specification (php / mysql), but then the specs change slightly and you need to make changes in the DB to reflect it Here's a small example: order table - & gt; Order ID - & gt; User ID - & gt; Closed - & gt; Timestamp But because orders are paid in more than one different currency, which has been cited in DB, I need to add area exchange rate , Which is known not only on the entry of the record but also during the closure of the order. In this way I can either add a new field to the existing table, and leave it empty / empty when inserting it, and then update it if necessary; Or I can create a new table with the following structure: order exchange rate - & gt; Exchange ID - & gt; Order ID - & gt; Exchange rate Although I believe this letter is better because it is a less intrusive change, and the

javascript - Call .js file from another .js file -

I have a javascript program in my module; The statement is test1.js in it if..ELSEIF is my challenge that I differ based on the conditions located in the IF-ELSE statement I want to call the .js programs. TEST1.js looks - ----- if (Kando1) wants to call {// test2.js} }} And if (kando 2) {// want to call test3.js} how can I do this in javascript? if (cond1) {// test2.js want to call here var js = document.createElement ("script"); JSTP = "Text / JavaScript"; Js.src = "test2.js"; document.body.appendChild (js); } Else if (cond2) {// test3.js would like to call here var js = document.createElement ("script"); js.type = "text / javascript"; Js.src = "test3.js"; document.body.appendChild (js); }

javascript - Best way to wrap ember-data models with their controllers -

I have a custom view with the renderer function, which needs to be calculated, since I have all my performance logic and properties It is useful to "wrap" your model with the controller to manually get some modue properties, but there is a better / cleaner way No Land? The current code in view is: ... currentPage = pages.filterBy ('nr', pageNb) .get ('firstObject') currentPageCntl = @ cntl.get ('Controller page' ). Set ('model', current page) current page delimations = current page Cntl.get ('dimension') ... So if I understand you correctly, then you have the logic and the data that you do not want to include in your model, even if they are in some places together. I'm actually working on an issue just like this issue. I do not know that this is the best way to do the job, but the way I am doing this is to wrap the amber data model. It is such an object that offers the model more closely that you want. For example, what

How to get text out of TextView or ListView Android? -

I have a ListView This list loads this text / data from a URL / HTML code on a webpage I use: for (int i = 0; i <5; j ++) {// search and load text in the list.} But sometimes the webpage has 5 "textfields" but maybe a new post has been 8. So, I do not want to use 5 in the loop now. Want to loop which is loading and as long as Area does not have a specific line in the html code of the webpage. For example: if (maxload! = "& Lt; p & gt; end of textfield & lt; / p & gt;") {// The search and load text in the list, // unless there is a text between the text "found". Sometimes it has to be stopped after 3 textfields. But the second time it has to be stopped after 16 textfield. I hope I was quite clear. Thanks, PS All my codes are currently working. When I use the loop system, the textfield manually counts in HTML. Keep that value for the loop, then the code loads all the text fields .. but I want it to be automatically.

c++ - passing allocated pointer before it allocated -

I am studying open source project ROS when I saw strange code Server server (n, "do_dishes", boost :: bind (and executed, _1, and server), incorrect); The variable server is used before assigning it as server . Is this possible? At least, my Visual Studio 2010 Compiler does not understand that style of code. Please tell me whether this is actually a possible code or not. The original document of the code: --------- Added Thanks for your kindness, however, the "server" Found: The undisclosed identifier "error when I compile it." So I tested the simple code class TestCls {public: TestCls (TestCls * AA) {}}; int main (int argc , Char ** argv) {TestCls TT (& amp; टीटी);} This also creates the same error "TT: Undeclared identifier" am I forgetting something? Please Help me. This is legal when they are declared, then the variable is in the radius, this rule exists to create self-referenced data-structures in a row.

javascript - Stubbing event property in Jasmine Test -

I am very new to writing Jasmine tests and need some help. Actually, I call a function below one function and passes the event handler (so basically when the link is clicked on the page, then the context of the event will be replaced by any other function Is sent on so that I can recover the contents of the internal text content of the event): $ ('$ clickME'). Click (function (e) {return self.CallAnotherFunction (e);}); Function call endotherfunction (MyEvent) {myevent.preventDefault (); var source = myevent.target || myevent.srcElement; } Now in my jasmine test: this should be read ('clicked item text', function () {var event = {preventDefault : Jasmine .createSpy ()}; //event.source.innerText = "ff"; // act myObject.prototype.CallAnotherFunction (Event);}); The problem is that when I run the exam, it fails with the error below: Type error: 'undefined' is not an object (evaluation ' Source.innertext ') So it seems that I

c# - Configuring CurrentCulture and CurrentUICulture with different parameters -

I am using c # .3.33 and I want to define the decimal separator of the current culture setting from comma to dot I want to change, but at the same time I want the user to control the numeric password as the decimal separator. So I tried to change my culture setting below CultureInfo newUIculture = New CultureInfo ("tr-TR"); NewUIculture.NumberFormat.CurrencyDecimalSeparator = ","; NewUIculture.NumberFormat.CurrencyGroupSeparator = "."; NewUIculture.NumberFormat.NumberDecimalSeparator = ","; NewUIculture.NumberFormat.NumberGroupSeparator = "."; NewUIculture.NumberFormat.PercentDecimalSeparator = ","; NewUIculture.NumberFormat.PercentGroupSeparator = "."; // application Current uk agriculture = new uiculture; // This line giving error Thread Existing content Agriculture Eukulcher = new UICulture; // This line culture does not work in the Enix (New York) = New Culture Infoc ("TR-TR"); NewCulture.NumberF

Not able to return XML from classic ASP to ASP.NET WebAPI -

I have a classic asp project that is returning to XML. Now I have to post that XML to ASP.NET WebAPI. The code for classic ASP is below: dim test string thum xmlHTTP slow post url retarded responsexml dim responsespace test string = " Set this a test string "postUrl =" http: // localhost: 55823 / API / order / "feedback text =" "XMLHttp = server. Start again on Cryotobacter ("MSXML2.XMLHTTP") xmlHTTP.Open "POST", postUrl, false xmlHTTP.setRequestHeader "content type", "app / x-www-form-urxedged" error How do I call in WebAPI: XHTMLHTTP.send teststring response.write testString: [http post] public HTTPPRPS post message post ([sbdi ] String Test String {} But here teststuff is always null . I have also tried public string post . Can someone help me !! As you guys say, I teststring = " = It is a test string " And its use is working fine because someone has not posted it in the fo

c# - Calling stored function using user input variable -

Newbie here I am creating a web app in C # which uses the database to display results through a variable located within a dropdown. So far, I have a procedure that looks like the following; Use [Energy Expansion] Go SET ANSI_NULLS Go to go to the conversion process QUOTED_IDENTIFIER [dbo]. [getbysID] @SchoolID int select as * invoice from energy where dateID by schoolID = @ schoolID; My question is, can the "School ID" represent a variable from the webpage? For example, the user selects a school from the dropdown, which sends a variable of "schoolID = 1" to represent a specific school. Does SQL school interpret properly? Or should I do some different way? EDIT: Sorry for the awesome format here, I'm very new to this.

gnu make - using variables in multiline define in gnumake -

मेकफाइल: परिभाषित करें t1 a = $ 1 $ (info $ (a) - - $ (1)) endef list = xyz $ (foreach v, $ (सूची), $ (eval $ (call t1, $ (v)))) आउटपुट - xx - yy - z समस्या एक आह्वान द्वारा 'ए' के ​​मूल्य की देरी कर रही है यहां तक ​​कि a: = $ 1 एक ही मुद्दा दिखाता है कोई त्वरित सुधार? यह ग्नु बनाओ 3.81 है। यह एक साथ कॉल और eval का उपयोग करने के बारे में भ्रामक चीजों में से एक है: अतिरिक्त उद्धरण जोड़ने के लिए समस्या यह है कि कॉल फ़ंक्शन पहले लागू किया जाता है, और यह एक बार तर्क का विस्तार करेगा तब eval कहा जाता है और वह इसका तर्क ( कॉल से आउटपुट) का मूल्यांकन करता है। आपके उदाहरण में, कोड> जानकारी फ़ंक्शन का कॉल द्वारा पहली बार मूल्यांकन किया जा रहा है, और इसलिए उस स्थिति में a अभी तक सेट नहीं किया गया है (क्योंकि यह तब तक सेट नहीं है जब तक eval फ़ंक्शन चलाता है)। तो आपको उस फ़ंक्शन से बचने की आवश्यकता है, और a : को परिभाषित करें t1 a = $ 1 $$ (info $$ (a) - $ (1 )) Endef

nsview - Edit outlet from different class - Cocoa -

मुझे एक वर्ग के माध्यम से एक NSProgressIndicator के मूल्य को अद्यतन की आवश्यकता है Es: वर्ग में मैं NSProgressIndicator के लिए आउटलेट को परिभाषित करता हूं और इसे लिंक करता हूं। कक्षा में मेरे पास संकेतक के दोहरे मूल्य को अपडेट करने का एक तरीका है। कक्षा बी में .मैं कक्षा ए के एक अंश के माध्यम से कॉल करता हूं, विधि लेकिन कुछ भी नहीं होता । अगर मैं वही विधि वर्ग ए के भीतर कॉल करता हूं तो ठीक काम करता है । मुझे क्या याद आ रहा है? // अनुरोधित कोड: // कक्षा ए (ऐपडिलाएट) एएम // अन्य सामान - (शून्य) अपडेट_इंडिकेटर: (डबल) मान {/ / विधि संकेतक के मूल्य को अपडेट करता है [प्रगति_निर्देशक सेटड्यूडवैल्यू: (डबल) मान]; [प्रगति_निर्देशक सेटनएड्सडिसप्ले: हाँ]; } // कक्षा बी (ड्राइविंग क्लास - एनएसवी्यू का उपवर्ग) बीएम - (रिक्त) ड्रॉरेक्ट: (एनएसआरएक्ट) गंदा रेखांकित {[सुपर ड्राएक्ट: गंदारेक्ट]; // आईटेंस बनाएँ; ए * आइसटेंस = [[ए आवंट] इनिट]; // Alloc कक्षा ए और इसे init [एक update_indicator: 50.0]; // अन्य कोड ..} अजीब बात यह है कि अगर मैं - (शून्य) update_indicator को

python - Initialize different variables with different value in a single statement -

I have Python variable as shown below. I want to start all these variables with different values ​​in the same statement in the global A, B, C . Is this possible? a = b = c = Uuid.uuid1 () // to A, B and C call uuid.uuid1 () three times: a, b, c = Uuid.uuid1 (), uuid.uuid1 (), uuid.uuid1 () You can make it a loop, but for 3 fixed items Why bother? In addition, for such an unexpected assignment with only 2 or 3 elements with a CPithon compiler If you use a loop in any way (if you have some additional goals), then use the generator expression and avoid creating a list object: for xrange (8) a, b, c, d, e, f, g, h = (uuid.uuid1 ())

c# - Reading multiple lines of text if it starts with a specific token -

: 58 ए: / सी / 81000098099 सीएल सीएनबीएनएलएला: 72: / CODTYPTR / 012 / साफ / 0003 / एसजीआई / डीबीएलएनएनजीएलए ऊपर दिए गए तेज संदेश को पढ़ने की कोशिश कर रहा हूं, पंक्ति: 58 ए: और पंक्ति: 72:, एक छोटी सी समस्या है I मेरा कोड केवल लाइन : 58A: की तरह ही सी / 81000098099 सीएल पढ़ता है, लेकिन मैं इसे लाइन से पहले प्राप्त करने के लिए पंक्ति को पढ़ना चाहता हूं : 72: , संक्षेप में, आउटपुट को लाइन : 58A: C / 81000098099CL CBNINGLA के लिए होना चाहिए। लाइन के लिए भी : 72: , यह इसलिए है क्योंकि संदेश इस रूप में स्वरूपित होते हैं। यह नीचे मेरा कोड है अगर (रेखा। तारों (": 58 ए:")) {string [] narr = line.Split ('/'); इन्फ्लॉ 202.BENEFICIARY_INSTITUTION = narr [2]; } अगर (रेखा। तारों (": 72:")) {inflow202.RECEIVER_INFORMATION = पंक्ति। भुनाई (5); } आप : रिक्त स्थान (या रिक्त स्ट्रिंग) के साथ। स्ट्रिंग आउटपुट = रेगेक्स। बदलें (पाठ, @ "\ r? \ N (?! :) :)", ""); स्ट्रिंग [] लाइन = आउटपुट .प्लीट (नया [] {'\ r', '\ n'}

mysql - How to show Images calling from Database with PHP only one time -

When I paint images randomly, it loads them x times, but I want to show them only once I am $ random = array_rand (database :: query (select 'from ad')); $ Adv_sql = "Select 'from ad' where 'id` = $ random"; $ AdvResult = Database :: Single ($ adv_sql, $ random ['id']); $ AdvExplode = Explosion ('/', $ advResult ['Upload']); $ AdvLocation = 'url / location' end ($ advExplode); I can not understand your abstraction. Your second query has condition id = $ random , but you can tie parameters in your single () method: $ adv_sql , $ Random ['id'] . We do not know the way in our own way, you should have shown us their implementation. Anyway, is not a query better this? Select from to ( If you do not want to show a pre-filled image in the second request, you will need to log in to the image where it has been shown so far, based on the database, cookies or sessions < / P> Or, bind to

virtualbox - I cannot start virtual device in Genymotion? -

I downloaded the "Google Nexus S - 4.1.1-API 16-400x800" device in my generation player when I got the device When I try to start, the player starts loading Android and with almost a "pop up window for a half minute" message "player.exe stops working" without any problems from the virtual box Managed to get started Why can not I start the device from the Genomotion Player? Did you have the "virtual device path" in the Vbox folder? If not, then try vdp in C: \ users {comp} name} \ applet \ local / genomobile / genomotion / deployed /

layout - How to get the exact coordinate of a view in android? -

I want to make an app where users can add two text to a lesson; For example, when a user clicks in the left text view, and the app should automatically generate a line in the correct text view, the problem I have is to find out the exact coordination of two ideas that I received in the top ( ) Have tried to use. . But always the position of the arrow does not get in the right place, similarly similar onscin (); ... iv = (ImageView) findViewById (R.id.imageView1); D = getWindowManager () GetDefaultDisplay (); Float dw = d.getWidth (); Float DH = D.GHight (); Bit = bitmap.creditbetaMap ((int) dw, (int) DH, bitmap config. ARGb_8888); Can = new canvas (bit); Paint = new paint (); Paint.setColor (Color.BLACK); iv.setImageBitmap (bit); Button = (button) Find VibibIID (R.B. button 1); Click Button.setOnClickListener (New OnClickListener) {@Override Public Zero (see V) {button text = (button) findViewById (R.id.button2); can.drawLine (text.getLeft () + text.getWithth (), Text.getTop ()

html - How can we manipulate elements value in browser forms? -

How can we manipulate the element values ​​in browser forms. I have a signup form and I want to manipulate hidden mail data while submitting the form ... please help me. You can use the plugin 'firebug' in your browser, in this plugin you get the source code Through which you can manipulate the elements of your sign form and you can add elements such as the hidden elements such as authenticity tokens and other hidden values ​​and you can also change the data in your form fields. Press this URL for more details:

android - Bad result on shape recognition using invariant moments -

Image
itemprop = "text"> My project is the shape recognition of the leaf, in order to calculate the distance between the image and the image in the test image, I have the extraction facility and Use unchanging moments for City block distance. As a result, it is very difficult to meet me. I can say that the recognition is only 50% less of the match. For example: This is the test image Enter image details "> I convert that image to binary image in otsu threshold, so the image looks good on size. My question, is this normal? Or do I have an error in my coding? This is the city block distance coding using my: CityBlock [J] = Math.abs (bMom1 - DB.GetBentukMoment1 (j)) + Math.abs (bMom2 - DB.GetBentukMoment2 ( J)) + Math.abs (bMom3 - DB.GetBentukMoment3 (J)) + Math.abs (bMom4 - DB.GetBentukMoment4 (j)) + Math.abs (bMom5 - DB.GetBentukMoment5 (j)) + Math.abs ( BMom6 - DB.GetBentukMoment6 (j)) + Math.abs (bMom7 - DB.GetBentukMoment7 (j)); If I use the same imag

java - Files.walk(), calculate total size -

I am trying to calculate the size of files on my disk in Java 7 as shown in my reply can be done. However, if I want to use Java-8 streams, it will work for some folders, but not for everyone. Public static zero main (string [] args throws IOException {long size = files. Walk (path: ("C: /")). MapMong (MyMain :: count) .sum (); System.out.println ("size =" + size); } Fixed long counts (path path) {try files.size (path); } Grip (IOException | uncheckedioexpress e) {return 0; }} will work fine for the code path a: / files / , but for the c: / exception below this throw will exception in thread "main" java.io.UncheckedIOException: java.nio.file.AccessDeniedException: c: \ $ Recycle.Bin \ S-java on 1-5-20. nio.file on JavakutilkIteratorkforEachRemaining (unknown source) at java.util.Spliterators $ IteratorSpliterator.forEachRemaining .FileTreeIterator.fetchNextIfNeeded on JavakniokfilekFileTreeIteratorkhasNext (unknown source) Java (unknown s

PHP: issue with comparing variables -

I have two PHP variables that can either be empty (i.e. value = "" ) Or the name in the format Last, with a space between the first one comma and the last and first names (such as the mouse, Mickey) I want to do a simple check here and say if a variable is not empty and is equal to the second check the checkbox, but it does not work. Someone here can show me what I am doing (checkbox should be checked in the example below)? My problem is that the checkbox is always checked, even if the variable does not match. Example: $ poc1 = "Mouse, Mikey"; // $ poc2 = "Hard-coded for testing mouse, Mikey"; // Hard-coded for testing & lt; Input type = "checkbox" id = "check2" name = "Copy_POC" & lt ;? Php if (($ poc2! = "") & Amp; amp; & amp; amp; & amp; amp; & amp; amp; amp; amp; amp; amp; amp; amp; Amp; amp; amp; Poc1))) {resonant "check"; }? & Gt; / & Gt; Many thanks

android - Do not show notification if certain activity is being displayed. Execute this activity's method instead -

I downloaded the GCM example code and it works fine. I have added two activities and now your project contais the following files: GcmBroadcastReceiver (WakefulBroadcastReceiver extends) (original) GcmIntentService (IntentService extends) (original) MainActivity ActivityListView The original code when the GCM message arrives, the notification is always shown, but now I have to inform that when ActivityListView activity is not being displayed. If the app is displaying ActivityListView, the notification should not be shown and an ActivityListView method should be executed instead I mean I need some code like this. Secure void onHandleIntent {intent of intent} {bundle extras = intent.getExtras (); If (ActivityListView is being displayed) {ActivityListView.mymethod (additional); } Other {sendNotification ("Received:" + extras.toString ()); }} GcmIntentService now looks: Public class GcmIntentService extends IntentService {..... @Override zer

ruby on rails - I'm trying to create PDF's with Prawn, but I get: Prawn::Errors::UnrecognizedTableContent -

I am following this RailCags # 153, and I am trying to add table data to prawns. I keep getting this error: shrimp :: errors :: unchanging table content See, because prawns will be confused if your table contains a zero or non-string value. Try using the .to_s method. Example @ report.data.to_s

jquery - Page Scrolling Not Working on Android Device -

I am making cross platform mobile applications using the phonegap framework . The following code is used for page scrolling. .page {overflow-y: scroll; -webkit-overflow-scrolling: touch;} This is working well on iOS device. In Android devices, page scrolling is not working. Please guide me Script development started because mobile webkit (on iPhone, iPad, Android) has a fixed width / height element. Provide a basic way to scroll content inside then you use the plugin

javascript - Assigning numbers to ng-repeat directive's item name -

I have a recursive analogy instruction, which is nested in itself for a long time. The problem is that it is not working properly because the names of objects in ng-repeater are exactly the same as the external element. Understanding this is a bit difficult, so I will provide some simple code to display this problem: & lt; div ng-repeat = "item in item" & gt; & Lt; Div ng-repeat = "item in item" & gt; {{Item.value}} & lt; / Div & gt; & Lt; / Div & gt; The value of the item is external & lt; Div & gt; instead of an internal one. What numbers do I want, based on the nesting of a nest, (i.e. 0 - root ng-repeat, 0-1 - second child of root dior, 1-0, first child of second dier and this Like) when the instructions were displayed on a template named after each item: & lt; div ng-repeat = "item-1 item" & gt; & Lt; Div ng-repeat = "items -0-0 in items" & gt; {{Item.value}} & lt;

node.js - websocket.io is raising on method of undefined error -

कोड var एक्सप्रेस = require ('express'), wsio = require (' websocket.io '); / ** * एक्सप्रेस एप्लिकेशन बनाएं * / Var ऐप = express.createServer (); / ** * सुनो * / ऐप.लिटेन (3000); / ** * websocket सर्वर संलग्न करें * / Var ws = wsio.attach (एप); / ** * अपने कोड की सेवा * / app.use (express.static ('public')); / ** * कनेक्शन पर सुनना * / ws.on ('कनेक्शन', फ़ंक्शन (सॉकेट) {// संदेश ईवेंट पर सुनें और इसे वापस / socket.on ('message', function (msg) {// Console.log ('\ 033 [96mgot: \ 033 [3 9' + msg); // सॉकेट.send ('pong'); //});}); मुझे यह त्रुटि मिल रही है .io \ lib \ प्रोटोकॉल \ hybi-16.js: 39 .on ('text', फ़ंक्शन (पैकेट) ) {^ प्रकार: त्रुटि: ऑब्जेक्ट # और लेफ्टिनेंट; रिसीवर & gt; नए वेबसॉट पर कोई तरीका नहीं है (एच: \ wamp \ www \ प्रथाओं \ nodejs \ smashing \ chapter10-websocket \ node_modules \ websocket.io \ lib \ protocols \ hybi- 16.js: 39: 6) सर्वर पर .createClient (एच: \ wamp \ www \ प्रथाओं \ nodejs

visual studio 2010 - Run a batch file during installation -

I want to run a batch file - driver.bat - the application installation is completed Say it later. Visual Studio setup and deployment should be used during this package creation. , But the solution is giving me a problem: after the installation is complete, it is throwing like an error message: 'CMD.XA' should be excluded because its source file Windows File Protection This problem occurs when the file is protected on the Windows operating system Is marked as. You need to successfully execute the file with this protection. The following links will help you do this -

asp.net mvc 5 - Signing out External Cookies before Signing in ApplicationCookie - OWIN -

I am currently studying the new ASPNET identity and owin authentication so that I can customize it for my own use . I just created a default MVC 5 application and it came to this part of the code private async Task Sign InSync (ApplicationUser user, bool isPersistent) {AuthenticationManager.SignOut (DefaultAuthenticationTypes.ExternalCookie); /// Why?? Var identification = UserManager Wait for credentials async (user, default authentication.tap.exe); Authentication Manager Signin (new authentication credentials) (IDresistent = identifiers}, identification); Question Is there a security risk to leave the external cookie? This indicates that the purpose of that line is to disable the external cookie that is available from the third party provider I went. Since the user has to transfer the identity of the user from third parties to local identity. Not doing this keeps cookies valid even after the user is signed out.

sql - Counting number of non-trading days/days without price changes -

I have the closing value for bonds over time with compulsory structure: Bond_ID | Tdate | Price --------- + ------------ + ------- EIX1923 | 2014-01-01 | 100.12 EIX1923 | 2014-01-02 | 100.10Ex1923 | 2014-01-05 | 100.10Ex1923 | 2014-01-10 | 100.15 As you can see, I do not have the cost of every day - because the bond does not trade every day. I want to count that how often this happens in a given year and if the bond price has not changed between consecutive days, then I take it as the result. For one year with this N trading days (excluding weekends, excluding holidays), I essentially want to prepare a series of dates and calculate how many days The price of (1) is unchanged from the previous day or (2) is not returned to the day and divide it on N. I am using PostgreSQL, so I created the gener_series ('2014-01-01' :: timestamp, '2015-01-01' :: timestamp, '1 day' :: Interval) ; I can select from this series and take a WHERE to exclude the weeken

css - Display image and text in same line -

Image
I want to display the image and the text in a line such as tripadvisor.in / & Lt; Div style = "display: inline-block" & gt; & Lt; Div style = "display: inline; float: left" & gt; & Lt; A href = "CollegeProfile.php" class = "white" & gt; & Lt; H4 style = "margin-down: 10px; display: inline" & gt; Good college to study & lt; / H4 & gt; & Lt; / A & gt; & Lt; Br / & gt; & Lt; A href = "CollegeProfile.php" class = "white" & gt; Indian Institute of Management, Ahmedabad and LT; / A & gt; Read the review. & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div style = "display: inline-block" & gt; & Amp; Nbsp; & Lt; Img class = "shakeImage" src = "assets / img / author.jpg" style = "border: 1px solid white; height: 60px; display: inline" /> & Lt; / Div & gt; This image and te

javascript : check if JSON object exists in array -

Thought that it would be easy, but this is not ... I am trying to check that, for example , This Json object: var strs = {strprop: "VALUE_A", strsub: "VALUE_B", subsub: "VALUE_C"} an array regroup is present in thanks edit restructuring has this data: [{"strprop": "repand", "strub": "au bassik suvant:", "subscribe ":" Economyir son Carburant. "}, {" Keyword ":" Koine Cher "}, {" StropProp ":" Reports "," Strussb ":" Au Basic Sevent: "," Subsub ":" Economyir son Carburant. " }, {"Keyword": "carburant pollute"}] No normal Available methods for comparing objects in JS with other methods of the object. JSON.stringify (obj1) === JSON has suggested in this script instead of .stringify (obj2) In your case, for (var i = 0; i & lt; regroup.length; i ++) {// if the

java - Best practice solution to create a Web Service for an Android app -

I am planning to write a web service in Java that connects to a MySQL database And computes then a Android app will be connected to this web service and will process information. Initially I had thought about using the XML files, but I was advised that this is not the best way to practice, and part of the service is light weight Will not done. I should use JSON . What is the correct architecture and solution for my problem? In addition to this, the Java Web Service can be run without a tomcat, directly by java by jar? Any document or link will be useful. Yes, to make it better for Android, JSON, its original API (built) and its Apart from this, its recommendation has been recommended to use the restalts service for the same reasons (performance, lighter) Regarding the webservice without any laxity, I'm not sure that this It is possible because you always need a container so that you can manage and run your code Able to Here's a nice tutorial for

arrays splitting strings java -

I'm sure this is a fairly easy question for anyone, but I think it's the best way to do it as a relative. Tell me the beginners. I am dividing a large file (string temporary) into approximately 100 strings and setting it as an array, but I do not know the exact number of strings. string [] idf = temp.split ("==========="); String class 1 = IDF [0]; String class 2 = IDF [1]; String Class 3 = IDF [1]; e.t.c. What's the best way to ensure that I can split all the stars and store them in an array? Any suggestions or hints will be most thanked You can do this Are: string list = "hey, how are you"; String [] strarray = list.split ("\\ s +"); (String str: stray) {System.out.print (str); }

openerp - How do I make related field that fetches all one2many values -

मान लीजिए मेरे पास ऐसा कोड है: 'खर्च': fields.related ( 'Property_expense_preset', 'expense_preset', 'expenditure', type = "many2many", relation = "property.expense", स्ट्रिंग = "सामान्य व्यय", store = false), अब property_expense_preset एक 2many फ़ील्ड है, जिसका मतलब है कि बहुत से property_expense_preset s हो सकते हैं। लेकिन उपरोक्त कोड केवल पहले property_expense_preset के बच्चों को लाता है। मैं उन सभी को इसके बजाय दिखाना चाहता हूं। मैं ऐसा कैसे करूँ?

python - Newrelic not showing data on django -

I have established a new relay using these steps - Pip installs newrelic ( Newrelic to install newrel on my local machine) newrelic-admin generate-config MY_LICENSE_KEY newrelic.ini (I created a newrelic.ini file in the same folder, where my projects are arranged to manage) < / Li> NEW_RELIC_CONFIG_FILE = newrelic.ini newric-admin run-program python manage.py driver (command to start server on my local machine) that Area later when I tried to connect to your application loader is running, but nothing happens. This message shows - 'Waiting for data' is there anybody to help me .... Thanks Have you written that command? NEW_RELIC_CONFIG_FILE = newrelic.ini newric-admin run-program python manage.py driver "newric-admin" has a spelling error. Try instead: NEW_RELIC_CONFIG_FILE = newrelic.ini newrelic-admin run-program python manage.py driver In addition to this, Have tried to test new server residues? newrelic-admin valid-config newr

html - max-width in table td -

Image
I would like to set the max-width of my table. & lt; TD class = "showwindow details" & gt; & Lt; Div style = "width: 275px; white-space: aboper; word-wrap: break-word; font-size: 11px;" & Gt; 3 Dress Cover Eye (Advance Pink) 3 Dress Cover Eye (Advance Pink) 3 Dress Cover A (Hone Pin) & lt; / Div & gt; & Lt; / TD & gt; but can not return to the text line: simply remove "white-space: nowrap" div and Set max-width.

java - Custom deserializer for JodaTime not workin in Spring MVC -

after "text" itemprop = "text"> I use a custom jackson serializer to try JSON Joda's date time object to convert according to my desired format I am doing. Beam id = "jacksonmessageChanger" class = "org.springframework.http.converter.json; & lt: I would like to comment on every case so I can configure it globally MappingJacksonHttpMessageConverter "& gt; & Lt; Property Name = "Supported MediaTaps" value = "App / JSON" /> & Lt; Property name = "objectmapper" ref = "jackson objectmapper" /> & Lt; / Bean & gt; & Lt; Bean id = "Jackson ObjectMaper" class = "com.myapp.CustomJacksonObjectMapper" /> My custom map class: Public class CustomJacksonObjectMapper extends ObjectMapper {public CustomJacksonObjectMapper () {CustomSerializerFactory factory = new CustomSerializerFactory (); Factory.Educational Mapping (Datetime, Class, New Daytime

ssl - What could be the reason for ciphertext sanity check failed? -

I have an SSL connection with Java. It works well for almost every customer, but some of them I get javax.crypto.BadPaddingException for: ciphertext sanity check failed. After finishing it together with hand and sending and receiving application data in a previous request, it is happening. Then when I want to open a request from the client, I get an exception and a serious error: 40: Ciphertext sanity check failed Usage The cipher made is TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA. The clients that have failed are Mac Book and Windows 8 Wi-Fi Clients. I'm running Java version "1.7.0_25" Java (TM) SE runtime environment (build 1.7.0_25-B15) SUSE Linux Enterprise Server 11 (x86_64). Tell me if you need more information.

java - jqgrid not displaying rows -

JQGrid version - 4.6 JQuery version - 1.10 Rows are shown in HTML but jqgrid rows Does not display even one attempts to add a line instead. But I did not help. I'm new to JQRD. I'm just looking at these things in my code on the basis of examples on the Internet. I am completely unable to understand what is going wrong here. This is my jQuery code $ ("# tblStateTableData") jqGrid ({datatype: 'Local', width: 800, // specified width; optional callname: ['state code', 'state name', 'active y / n'], // define column name callmodel: [{name: 'Id', index: 'id', key: right, width: 100, hidden: false}, {name: 'stateNm', index: 'state nm', width: 150, hidden: false}, { Name:' Action ',' Active ', width: 100, ADDIT: "checkbox", hidden: false}], // Define column model pager:' #pager ', // Set your pager div id row: 10 , Sort name: 'id', // column according to which