Posts

Showing posts from July, 2012

c++ - Passing inherited class type as argument -

Problems passing through the type of class inherited in the form of logic for the method that takes me to class squared has occurred. class base {...} Category derivative: public base {...} square container {vector & lt; Base * & gt; remaining part; // 1 public: zero addToCont (base x) {// 2 cont.push_back (& ​​amp; x); }} Int main () {Container C; c.addToCont (Derivative (P1, P2)); // 3} 1) I think I need the containers of points for objects to work 2) Error in conversion from derivative to base 3) I do not want to change this call. I tried derived D (P1, P2); C.addToCont (d); with addToCont (base and x) and it worked for me. My problem is that I have 3 derivative classes and I do not want to overload the add method 3 times. I think I have to add some virtual pattern or some type of structure to those classes, but I did not find anything about it I'm a newbie in heritage and I am very confused about this. Thank you for all of your help.

Mongodb-PHP app connection -

To add Mongodb with PHP application, I installed the Mozodb driver in Windows and the extension was enabled (phpinfo ()). Then I execute the kootpi php code & lt ;? Php // Config $ dbhost = 'localhost'; $ Dbname = 'test'; // Connect to test database $ m = new Mongo ("mongodb: // $ dbhost"); $ db = $ m- & gt; $ dbname; // archive $ collection = $ db- & gt; Select Show; // Drag a cursor query $ cursor = $ collection-> Search (); Foreign exchange ($ cursor $ document) {var_dump ($ document); }? & Gt; And this gives a serious error how can this solve it? Fatal error: 'Failed to connect with' MongoConnectionException 'message with unsolicited exception: Local Host: 27017: No connection can be made because the target machine is actively denied. In C: \ xampp \ htdocs \ check \ index.php: 7 stack trace: # 0C: \ xampp \ htdocs \ check \ index.php (7): Mongo Client-> __Construct ('Mongodb: // local.') # 1 {main} put i

JMeter: How to run test with rate of n concurrent requests per second -

I would like to run the test with the given execution rate per second. The next journey should start asynchronous in second seconds without completing the first walk. I tried with a continuous throughput timer, but it does not last until it reaches the next step until the response to the first thread throws. You can use 2 different for this (make sure you have Run the thread group continuously at the box level. Also see your configuration on the field, you can set different timers for each thread group By the way, there is more advanced element available through plugins, which will provide easy-read graph of display of load-patterns. / P> If you consider using a different thread group, remember that the area of ​​the JMATT variables is local in the thread group where they are defined, to use them in different thread groups. They have to be put in the JMIE properties in the "Global" area. See the guide for how to implement it.

php - reorder not setting the shipping method used last time -

I want to reorder a product program, I follow the answer: but I get an error message Please specify a shipping method. Why is not it set up the previously used shipping method? Still do not know if this is the shipping method Why does not I have the necessary code to add this to work below: $ reorder-> getQuote () - & gt; getShippingAddress () - & gt; Setting mode ($ order-> getShippingMethod ()) - & gt; Setting Shipping Rights (True) - & gt; Assemble Shipping Rights () - & gt; Collected Totals () - & gt; Save ();

Sharepoint 2013 Workflow - How to build String[] from a dynamic value -

How do I create a string with dynamic value? I have an introductory form that I collect email information and pass my workflow as an argument to type string function startupflow () {var wfParams = new object (); // Creating Objects Orange var emailUsers = new Array (); // View maudel via email (var i = 0; i & lt; videmodel.SelectedEmails (). Length; i ++) {var a = new object (); A ["email"] = ViewModel. Selected Email () [i]; emailUsers.push (a); } WfParam ['strSelectedEmailsHMgr'] = JSON.stringify (email user); ** It all works fine! ** In my SharePoint 2013 workflow, I am again creating a dynamic value variable called DVJSON. After this, I add a ParseDynamicValue Activity and set my variable DVYSON on my invanded logic wfParams ['strSelectedEmailsHMgr']. Next, I add a WirteToHistory activity here, the result is: The value of DVJSON [{"E-mail": "tom.daria@fhlbcin.com"}, {"email": "tom.daria @ Fhlbcin.com &qu

php - Loading data through scrolldown -

I have a web page that shows tabular data, and I want to know how to scroll data Load Down, Fax Style As such, loading 50 rows, and when you scroll to the end, load more than 50. I do not know how to specify the question, or else I would have searched with a question, "Maybe somewhere already", but I do not know if I have to use php, javascript or what do I have to Can you indicate? This is the question page: & lt; Html & gt; & Lt; Top & gt; & Lt; Script type = "text / javascript" & gt; Function Test (id) {window.open ("../ remover / removeemail.php? Id =" + id, 'Favorites', 'MenuBur, Recible, Width = 400, Height = 200'); } Function test2 (id) {window.location = ("../editar/editaemail.php?id=" + id); } & Lt; / Script & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" /> & Lt; / Head & gt; & Lt; Body & gt; & L

Retrieving 2 rows from one SELECT sql query with 2 tables PHP -

टेबल उद्धरण ----------------- QUOTE_ID_PK PICKUP_FROM_ID DROPOFF_TO_ID 1 4 3 2 2 3 3 1 1 4 1 2 5 3 2 टाउन टेबल --------------- TOWN_ID_PK DISTANCE NAME 1 34 दक्षिण मध्य 2 43 हवाई अड्डे 3 99 बस स्टेशन 4 66 ट्रेन स्टेशन < मुझे आदेश तालिका में ORDER_ID के लिए 2 पंक्तियाँ (दूरी के मूल्य के साथ) वापस करने की आवश्यकता है। / P> मुझे आदेश_id = 2 के परिणाम मिलते हैं, pickupfromdistance = 43, dropoffto = 99। मैंने इस साइट से कुछ विचारों की कोशिश की है, और यहां यह है कि मेरे पास लगभग काम करता है, लेकिन दूसरा दूरी मूल्य वापस नहीं करता है क्या मैं इस बारे में गलत तरीके से गया हूं? क्या मैं एक साधारण समस्या का एक जटिल समाधान कर रहा हूं? townID, town.distance दूरी के रूप में, town.name townName के रूप में, town.location स्थान, quotes.pickupfrom_id, शहर से quotes.dropoffto_id के रूप में के रूप में town.town_id_pk का चयन करें, उद्धरण कहां quotes.pickupfrom_id = town.town_id_pk और quotes.quote_id_pk = '140419420 यूनियन सभी townID, town.distance दूरी के रूप में, town.name townNam

authentication - Logging into Moodle via external site -

I am setting up a Moodle environment and I need users to log in using external credentials using their credentials. The that site will ideally go to that website, log in, and then click a button that will send them to Moodle with their account information. Once they become moodle, then Moodle will check to check whether the account information already exists. If so, this will be the login, otherwise this will create an account and login. I already have the Moodle environment installed, as well as the login site too. Moodle site is not allowed to access the database on the login site, and users should not re-enter their information at any time. I have already tried to work behind several hours, a plugin that achieves some similarities between Moodle and social networking sites (Facebook, Twitter, Google + etc.) but have not made any progress , As well as connected to a plug-in, is connected to Moodle, and I have searched here and for some other forums I could get the same as

css - Bootstrap 3 nav next to floated element -

I have a problem with Bootstrap 3. Setup is a simple 2-column page (sidebar and main content). Because I have a dropdown menu that can be an overlay from the main container, I can not use the visibility: hidden or auto move I use another technique which is to ignore the initial element A padding-left application is being made for the main container. . Sidebar {float: left; Width: 200px; } .man {padding-left: 210px; } Unfortunately, Bootstrap Nevals internally use a cleanfix, due to which the sidebars become larger in the form of a navbar inside the main Is there a clear conspiracy to include sidebar only in creating clear elements? Instead of trying to manually create columns, you can use built-in bootstrap classes instead of Do everything for you and be responsible. First, wrap everything with a div class = "container" and you have a div with class = "row" , then Use the appropriate col class' bootstrap grid page to see all instance

iron router - Meteor client side collection needs to have all data populated before anything else -

I'm trying to use the client side store as a site configuration system. I incorporate the documents representing my various pages, and using the iron-router and navigation tabs, they use all to determine which pages they are and their Which templates are presented by each page a {{& gt; ContentTemplate}} The Insertion Assistant has to load this relevant template. It all works great, when all the data is loaded. When I restart the app on some pages, the data is not loaded yet, and I get an exception from the Dipes Recomputing Function: Error: Expected faucet or template was found in exchange for the included function: Undefined < / code> error. Here is my javascript: Storyrere = [{Category: 'Teaching', Content Template: 'teachingHome', Title : 'Teaching Home'}, ...]; Stories = New Meteor. Compile (empty); Story More Year (function (story, index) {story._id = index + ''; storyjinst (story);}); // in main.js Template.teaching

How to exclude \n and \r from tell() count in Python 2.7 -

I want to keep track of the file pointer on a simple text file (just a few lines), readline () < / code> on it I saw that the tell () function also counts the end of the line. My question: How to instruct the code to leave the end of the line? How to do the first question without regard to the line completion type (only in the case of using a text file, \ n , or just \ r , or both)? tell is . This cursor is counted by number of bytes from the beginning of the file, it is counted as \ n and \ r \ / code> bytes, so they are counted. If you want to calculate the number of bytes, but do not want to count some characters, then you have to do it manually: data_read = â ?? | # The data that you have already read [l] [b] The bad news is that it is more annoying to do this just to see it at tell The good news is that it answers your questions. Or, I think you can yourfile.tell () - data_read .count ('\ r') - data_read.count ('\ n

algorithm - Big-O complexity for this loop -

What is the biggest complexity of the following loop: for each vertical? ??? C do it for every top ??? C and V & gt; U do What I'm doing here, imagine the following set {1,2,3,4} loop executes a function for all combinations of 2 elements of this number Is (1,2), (1,3), (1,4), (2,3), (2,4), (3,4). Is it = (n ^ 2) where is the number of elements in n set? Yes, this o (n ^ 2) , recognizes the function implemented O (1) , of course, and the iterator is also on the average repetition of o (1) (which is usually a valid assumption). Note that if you also customize it further, then select (n, 2) elements, and select (n, 2) = n ( N-1) / 2 , which is still O (n ^ 2) .

Get the list of files of particular extension using batch file -

I have files of special ext (.mtc) in a folder and I would like to count the number of files in the folder In this folder, the desktop \ folder name and an exe to run in the extract that each file accepts as the parameter. For example 1. a.mtc 2. abc.mtc 3.xyz.mtc For all the above files, I want my exe to be batch script Have to be run using. I also need to make sure to reset this count to 0 when I return the batch file to appreciate your feedback. . Try this: @echo offlocal pushd "on desktop Path "for / f" delims = "%% a in ('dir / b * .mtc') (your .exe" %% ~ nxa ") Popd

c# - JPEG , Bitmap , PNG printed in console -

I want to take every pixel and print it in the console so that I can see the picture in black and white. Is this also possible? I system it Tried to load with IO file, but it does not work Any suggestions? Thank you. No, this is not possible. Windows Command Prompt is strictly text based (essentially all command prompt / terminal are like this). Therefore, you can not display graphical content in the TEXT centric interface. Only conceivable methods (as far as I can tell) @Ericfin have inquired about this, possibly converting the image into ASCII-art and printing each line in the command line. If you want to move in ASCII direction, you may be able to modify.

jquery - How to fetch Finger Print using javascript(client side) -

I am trying to use my USB biometric device, using Javascript to fetch finger prints from customer side The way. My device is (U.A.U. 4500). You can not directly access USB peripherals via JavaScript or HTML because it is in any standard API Not included. If there is a signed Java applet available which displays some events and methods, you can interface to JavaScript to gain some level of interaction with Java Applet, but to get it in JavaScript / HTML mode Not the way.

android - Add XML content to a View -

im need to develop an application and I need to add elements dynamically. I wonder if I can get my current activity I can add elements (stored in XML file), such as internal HTML in Javascript I tried LayoutInflator but it changes all the content and I need to add. Thank you! The easiest way to do this is to use LayoutInflater as you said. I'm not sure how you were doing this (so I asked to see your inhaling code), but the simplest way to understand is to: LayoutInflater inflater = getLayoutInflater (); ViewToAppend = see inflater.inflate (R.layout.some_layout, tap); // Optional, create layout params and apply to see it with the // viewToAppend.setLayoutParams (parameter); mainView.addView (viewToAppend);

deployment - Deploy multiple WCF services? -

I have a large solution with 27 WCF services and 3 shared projects (DAL, model and core). Let's say something important in DAL changes. Now I have to publish all 27 WCF services, I currently manually do this by manually clicking and publishing each of 27 people. I have set up profiles published on each of the services as published methods using "file system". As you can imagine it is a lot of pain. I have created various solution configurations and the web. The configs are also converted. It allows me to publish output and test box with different configured content. Returning to the original issue, when there is a change in some low level in DAL and I need to republish 27 times, I actually re-publish the test box from 54 times, 27 and 27 on the live box. . How can you publish several WCF services or what are the best practices for doing something like this? I am using VS 2013 and TFS 2013. FYI - We are currently establishing and reading about the new Release M

c - allocating space for pointer to array of pointers -

Good day I have this: MAP_ITEM ** Maps that I think are pointers to points array (correct me If I am wrong) and I have to allocate the space for it I can allocate the space by using malloc for 1 pointer, but how does this know help will really be appreciated? An example here , four ** Written for use with, but you can modify for your purposes: allocMemory (char ** a, int numstrings, int maxstrlen) {int i; A = coloc (size * (* four *) * (numstrings + 1), sizeof (char *)); For (i = 0; i Call it this way : (For the array of 10 stars, the maximum maximum is 79 characters (zero position). For one)) four ** arrayOfString; ArrayOfString = allocMemory (arrayOfString, 10, 80); // you allocMemory unseen memory (core ** A, Intimate Numbering) is built with {int Free memory is required I (i = 0; i Call it like this : Freemori Saranifostings, 10);

regex - String with different operators in JavaScript match -

मेरे पास निम्न JS var है: var टोकन = str.match (/ \ [| \] | & lt; संख्या | \) | और | (? :(?! और) [^ \ [\]]) + / जी); टोकन बाद में एक स्विच () कथन में उपयोग किया जाता है। इस मैचों की घटनाएं: [ ] & lt; ) और (अंत में एक स्थान के साथ) हालांकि, मैं संख्या से पहले & lt; से पहले नहीं बल्कि अन्य ऑपरेटरों द्वारा संभवतः भी करना चाहता हूं। निम्नलिखित की जरूरत है: & gt; & gt; = तो मेल को भी देखने के लिए < कोड> & lt; संख्या , & lt; = number , & gt; संख्या , & gt; = संख्या । उदाहरण के लिए, क्या संभव ऑपरेटर के लिए वाइल्डकार्ड / वेरिएबल को परिभाषित करना एक त्वरित और आसान तरीका है? अभिव्यक्ति का प्रयोग करें [& lt; & gt;] =? । [& lt; & gt;] या तो या & gt; =? एक वैकल्पिक = संकेत है।

jquery - Initial value to textarea field in form tld -

I am using Spring MVC and in my jasp page I have a form with textarea. I want the text to be full of some text (this is an editing feature for the article). I tried the following. & lt; form: textarea id = "description" path = "article.description" value = "$ {article.description}" onKeyUp = "validation method ($ (this));" OnKeyDown = "validationmethod ($ (this));" / & Gt; but my text is still empty .. value = "" attribute & lt; Forms perfectly well for the form: If I try to put it above the tag then I get a warning "Form: Teddera should not be empty". Please help. When the form tag is used then there is no value property in the texterity. Path property is used for data binding. For example, before presenting the view you are using this teXteria, populate the model object with the data in your controller: @RequestMapping (value = " / readyArticleForm ") Public Mode

katana /owin middleware with parameter -

I try to create a parametric middleware, but I only get a error of http 504, it works fine without code parameter Any thoughts? Public Zero Configuration (IAppBuilder App) {app.Use & lt; MyMiddleware & gt; ("Hello"); } Classmilemware: Owen Mildware {Public Mimelevelware (OwinMiddleware Next, String Message): Base (Next) {Message = Message; } Public string message {get; Set; } Public override async Task Inococ (IOwinContext context) {context.Response.ContentLength = Message.Length; Context.Response.ContentType = "text / html"; Wait for the reference. reaction. Merger async (message); Wait for further }} OK I got this issue Content Length should be evaluated in UTF-8: encoding. UTF8.GetBytes (message). Unless C # uses UTF-16 encoding by default < / P>

objective c - Unrecognized selector when populating an NSManagedObject -

I have an iPad app using core data In my data model I have an object named Hubreb and using XCode NSManaged objects are generated. The generated object has the following code: Header: @class HubModel; @ Interface Hub Brand: NSManagedObject @property (nonatomic, retain) NSString * brandName; @property (nontomic, rETAIN) nsat * rallamoles; @end @ Interface Hubbrand (Cordata Generated Recipients) - (Zero) addRelModelsObject: (HubModel *) value; - Remove (zero )Reload Model object: (Hombodel *) value; - (zero) addRelModels: (NSSet *) value; - (zero) DeleteRailload Model: (NSSet *) value; @end Implementation: @implementation HubBrand @ dynamic brandName; @ Dynamic rellamos; @end I am trying to create an example of the HubBrand class and populate it using the foloowing code: HubBrand * brand = [ [HubBrand alloc] in this]; [Brand Set Brand Name: [NSString stringWithFormat: @ "_Custom:,% @", [_txtHubBrand text]]]; //brand.brandName = [NSString stringWithFormat: @

xcode - How to detect declared but undefined functions in C++? -

निम्न संकलन, लिंक और रन ठीक है (Xcode 5.1 / clang पर): #include & lt; iostream & gt; वर्ग C {int foo (); }; Int main (int argc, const char * argv []) {सी सी; Cout & lt; & lt; "नमस्ते दुनिया!"; } हालांकि, C :: foo () कहीं भी परिभाषित नहीं है, केवल घोषित मुझे किसी भी कंपाइलर या लिंकर चेतावनियां / त्रुटियां नहीं मिलीं, जाहिरा तौर पर क्योंकि सी :: एफू () कभी भी संदर्भित नहीं होता है। क्या कोई तरीका है जो मैं एक चेतावनी का उत्सर्जन कर सकता हूं पूरे कार्यक्रम में C :: foo () के लिए कोई परिभाषा मौजूद नहीं है यद्यपि इसे घोषित किया जाता है? एक त्रुटि वास्तव में बेहतर होगी। धन्यवाद! अच्छे कारण हैं यह आसानी से संभव नहीं है। हेडर फाइल का एक सेट कई कार्य घोषित कर सकता है, जिनमें से कुछ अतिरिक्त पुस्तकालयों द्वारा प्रदान किए जाते हैं आप इन सभी कार्यों का उपयोग किए बिना #include ऐसे हेडर चाहते हैं (उदाहरण के लिए, यदि आप केवल कुछ #define -d निरंतर का उपयोग करना चाहते हैं)। वैकल्पिक रूप से, हेडर फाइल द्वारा परिभाषित एपीआई का केवल एक उपशीर्षक ही

How to insert HTML tag in Python? -

मेरे पास ऐसा वर्ग है, जो हाइपरलिंक उत्पन्न करता है: class getLink (obj) : def __init __ (स्वयं, पाठ, url): self.text = self.Argument (text) self.url = self.Argument (url) def रेंडर (आत्म, प्रसंग): "% s% s"% (html लिंक (self.text (context), self.url (context)) def link (text, url): return mark_safe ('& lt; a href = "% s" & gt;% s & lt; / a & gt;'% (url) , शीर्षक)) फिर एक लिंक प्राप्त करने के लिए मैं ऐसा करता हूं: getLink (टेक्स्ट = _ ('टेस्ट'), fn.getUrl () ) HTML परिणाम: & lt; a href = "/ python / tests /" & gt; टेस्ट & lt; / a & gt; मैं & lt; div & gt; के अंदर लिंक को और एक और & lt; li & gt; टैग के अंदर लिंक लपेट करना चाहता हूं। मैंने टैग को सीधे getLink () में जोड़ने की कोशिश की लेकिन getLink ("& lt; div & gt;" + text = _ ('test'), fn.getUrl () + "& lt; / div & gt;") । मैं पायथन में नौसिखिया हूं इसलिए मुझे खेद है कि अगर

c++ - How to make a progress bar in console? -

मैंने इस तरह से कुछ किया है: #include & lt; thread & gt; Int main (int argc, char * argv []) {// ... std :: थ्रेड sad_thread (मेकमेफ़ील सदा (), पैराम्स); sad_thread.join (); // ... std :: थ्रेड खुश_थ्रेड (मेकमेफ़ेल (), परम); happy_thread.join (); // ...} < फ़ंक्शन MakeMeFeelSad और MakeMeFeelHappy प्रत्येक के बारे में 2 मिनट के लिए चलाता है, मुझे सीएमडी में कुछ करना चाहिए यह: मुझे उदास / मुबारक हो ..... (जबकि फ़ंक्शन चल रहे हैं) - और डॉट्स हमेशा 5 तक दिखाई देते हैं, फिर वे गायब हो जाते हैं, और फिर से दिखाई देते हैं। यह बिंदु के साथ प्रगति बार की तरह है मैं यह कैसे कर सकता हूं? ईटीए: मेरा मतलब है क्या मुझे कॉलबैक के साथ एक और धागे की आवश्यकता है? आप कुछ ऐसा प्रयोग कर सकते हैं: std :: भविष्य & lt; शून्य & gt; fut = std :: async (std :: launch :: async, MakeMeFeelSad, params); Std :: cout & lt; & lt; "मुझे उदास हो रहा है"; std :: chrono :: मिलीसेकेंड अवधि (100); जबकि (fut.wait_for (span) == std :: future_status :: समय समाप्त) s

3d - Is there a way to manipulate an STL's data points in Python? (Medical application) -

Newbie programmers who are trying to implement programming for medical research. I am conducting a biomechanical simulation made from CT scan of PYTHON and STL (3D format) patients. I am trying to measure a bone area by measuring the joint motion about an arbitrary axis and measuring the distance between the bonded insertion points, but it is being harmed by how to do it. I can import data from a STL file into a cloud in the cloud, and I can do basic operations there, but I do not know how to reconstruct STL. In a way, STL treatment should be treated as a structure and directly geometrical Changes are conducted? Based on the new locations, I am computing the length of an effective bond (originally from one point to the other point in the bone area). Based on these values, I am trying to "color" the STL and create a 3D "heat map", basically the high value is red, lower blue, etc. I can not really work the elusive, and I'm very slow to point and cloud in Point

find - Way to inspect element and see the PHP page it's on? -

Is there a way to inspect an element and view PHP page (template file) that element is coming? For example, using Google Chrome's Developer Tools, I can see which CSS page is using any element. I want to do this to find php files quickly. Edit: I know that doing this with just any browser tool can be a big security issue. So, whether a local debug tool or a script that I could install, allows me to do this, for example debug = true? If you are using eclipse then you can see that you actually step in the code You can follow the flow besides you may want to take a look at. I have not used it much for PHP, but this gives you a lot of signal for the rail - so I imagine it works well for PHP.

api - Capturing email reply messages in Python -

I have a web application in Python that allows anyone to post messages. When this happens, my application will automatically send an email to another user who is following "conversation / post", the user receives an email and receives an answer with a message like "OK". I want to receive this reply message on a post in my application. I see it in applications such as Assaman. How can I do this? Is there a service or API that I can use? Any email mailer mailed from the mail server if you want to receive it in a POST request , Then you have to write a separate application that receives email messages from the mail server and then sends those people to you in an HTTP request to your web server. You will then need to run your application in the form of a daemon / service, and it will periodically have to vote on the server for new messages (or usage) You will receive an e-mail You may want to use. Knowledge and administration will be required about the po

ruby on rails - ActionController::ParameterMissing Don't know whats wrong -

I am getting this error, I have not used Ruby in some time, so I do not know how to fix it. To do . Is missing on the ultimate or value is empty: sch removed source (around line # 72): 70 71 72 73 74 # Do not trust the criteria from scary internet, only through white list. def sch_params params.require (: sch) .permit (: date, time, user_id) end-end Rails.root: C: / sites / web application trace | Framework trace | Full Trace App / Controller / Scache_Controller RB: 72: `SCAPRAM 'app / controller / skill_controller RB: 27: Request parameter to 'create' in: {"UTF8" = "gtc:" A "???," Authentication_token "=> gt; cHq54V7aVCjeBz0udZAYjGiojgrqDANx / BS + OmQ + N +0 =", "Ski "= & gt; {"Date (1a)" =>, 2014 "," Date (2) "=>," 4 "," Date "(3i)" = & gt; " 21 "," time (1i) "= => = "," Time "," time "(" 4i "),

python - Understanding control flow in traversing through list -

Here I have a class that uses a node and a function that prints the node in reverse order: Category LLNode (object): def __init __ (self, data): '' '(LLNode, object) - & gt; None create a new node to hold '' 'type data self.data = data self.link = any def __str __ (self): return str (self.data) def reverse_list (L): If no one Returns head = L Tail = Head.link reverse_list (tail) print (head, end = '') list1 = LLNode (1) list1.link = LLNode (2) print (reverse_list (list1)) < / Pre> I do not understand that when the print statement runs, because is placed before the reverse_list (tail) , I think That look it I have been charged that if I change those two lines then the program will print the sequence in the link list, which I understand. How to reverse it after inserting print Prints in? I do not understand the flow here Because print ing After a recursive call, this happens when the calling function returns control, back up

Redis sorted set with multiple score "columns" -

I need a leaderboard where users are stored with scores and the percentage of level completion. I just need to be sorted by score and able to get points. ZADD Leaderboard: Gamemode1 100 user1 ZADD Leaderboard: gamemode1 300 user2 / Code> However, I am struggelig to figure out how to store the percentages related to the score of 100 and 300 . I should do something like this: ZADD Leaderboard: gamemode1 100 user1: 29.45 Where : 29.45 is the percentage for user1's score in 100 gamemode1 ? I think it will be later complicated to update user1's score for gamemode1. Should I make a hashable as a book-maintenance mechanism instead, which stores scores and percentages of all users for all game mades? My concern about the Hashtable approach is that if I want to show ~50 user leaderboards with my score and percentage values, then ask me 50 times for the hashtable percentage after dragging me Top 50 scores with ZRANGE Do anyone have any input to make t

sql - How to perform such join tables in ActiveRecord? -

I need help to include using ActiveRecord relationship models: Select "Access_urls" Eddie "," Kantrolr_arls. "" controller "," Akshn_rlls "." Akshn_rlls "from" action "internal" Niyntrk_arls "are included in" Niyntrk_arls "." id "=" access_urls "." Kantrolr_ril_aid "inner "Action" = "access_rl" on join_action_action "action_arles" "Akshn_ril_aidi" where I have access URL, Akshnuarel and controller URL model Class AccessUrl & lt; ActiveRecord :: Base is_to: controller_url belongs_to: action_url and class actionUrl & lt; ActiveRecord :: Base is_my: access_urls is valid: action, presence: true, specification: {message: "já encontra-se em uso." } End Class Controller URL & lt; ActiveRecord :: Base has_many: access_urls valid controller, presence: the truth, specificity: {message: "já encontra-se

How to make custom windowBackground theme style work on all Android devices? -

Image
I am trying to make all my activities a custom theme style that should look like this: < P> This theme works on many devices, including Nexus 7, Samsung Galaxy S4, and Samsung Dodge Charge (Gingerbread is running) However, on other devices, such as HP slate 7 and Motorola Diarrhea Razor, it ends in appearance like this: I have the following in my AndroidManifest.xml in the application tag: Android: Theme = "@ Style / Aaptim" topic res / values ​​/ styles.xml occurs in: & lt; Style name = "appbashtheme" parent = "@ Android: style / theme.light.field Bayer" & gt; & Lt; / Style & gt; & Lt; Style name = "Aaptim" parent = "@ style / appbashtheme" & gt; & Lt; Item name = "android: windowBackground" & gt; @color / background & lt; / Item & gt; & Lt; / Style & gt; I've also added res / values-v11 under styles.xml . Here's the style applied:

c# - XML not filtering out results from file in Windows Phone -

यह नमूना XML है जो मुझे मिला है: & lt; ArrayOfService & gt; & lt; सेवा z: आईडी = "i1" xmlns: z = "http://schemas.microsoft.com/2003/10/Serialization/" & gt; & LT; primaryUrl & gt; http: //www.buses.co.uk/1A< / primaryUrl & gt; & LT; relativePosition & gt; 2 & lt; / relativePosition & gt; & Lt; serviceDescription & gt; व्हाइटहाक - काउंटी अस्पताल - सिटी सेंटर - होव - पोर्ट्सलेड - माइल ओक & lt; / सेवा विवरण & gt; & LT; serviceId & gt; 1150 & lt; / serviceId & gt; & LT; SERVICENAME & gt; 1 ए & lt; / SERVICENAME & gt; & Lt; सेवा नोट / & gt; & lt; सेवा पाठ & gt; व्हाइटहाक - माइल ओक & lt; / सेवा टेक्स्ट & gt; & lt; serviceUrls / & gt; & Lt; / सेवा & gt; & Lt; / ArrayOfService & gt; यह कोड है: XDocument loadedData = XDocument.Load ("services.xml"); // XNamespace ns = "http://schemas.datacontract.org/2004/0

objective c - Stop releasing NSMutableArray in ARC when inserting large data -

In my ARC project, NSMutableArray was automatically released when large data is inserted during XML parsing. //MainViewController.h: @Portfolio (non-dynamic, strong) NSMutableArray * arrayData; //MainViewController.m: viewWillAppear {self.arrayData = [[NSMutableArray alloc] init]; } -didEndElement {[self.arrayData addObject: @ "SomeData"]; // data successfully inserted NSLog ("Count:% i", [Auto Eradida count]); // calculation is displayed correctly} -numberOfRowsInSection {return [self.arrayData count]; // Return zero! } How can I stop releasing or maintaining it or accepting large data for buffer? Update: The code data is working is small in NSMutableArray, but if I put large data, then it will be released, so problem in the size of the data! Define your "head" as a "strong" asset, and The ARC should retain it on the runtime. It will not be released automatically until the property is "weak". It also wants to assign a &

python - Organizing data in mix of comma-separated, tab-separated format -

I am a complete newbie in Python, if you can help me then it would be great that my data format is somewhat like this I'm glad if someone can help me. Car Trans + 1,4,6,8 aircraft trans + 3,5,79,4,3 train trans - 2,4,6,7 bus trans - 1,3, 4,5,6,7,8 Out of the comma-separated values, I'm just trying to remove "Event" numbers (2, 4, 6, 8) , 10th, etc.) is presenting it out and the value of the third column on the basis of + or -. I want to move "Event" numbers with data separated by commas if it is "+", then the number goes to the fourth column and adds that value to 1, then it will be 5th column Keep in If it is "-", then the number holds the value of the fifth column and the value of zero to the fourth column. I know that this is really an explanation of the explanation, but it would be great if someone can give me an idea from where I can start Thanksgiving car.1 trans + 4 5 car .2 Trans + 8 9 Plan 1 Trans + 5 6 Plane 2 Tra

function - Java boolean isSymmetric -

For now I have to write a java boolean, the simetric () fusion that returns right if the incotting matrix is ​​a symmetrical matrix; Otherwise it is wrong, can anyone help me start with the code here or where? Any answer would be appreciated. All you need is Google. There were so many replies. But all you have to do is that if (A, B) is equal (B, A). Public static boolean symmetric (int [] [] array) {for (int a = 0; a & lt; array.length; a ++) {for (int b = 0; b & lt; array.length; b ++) {if (array [one] [b]! = array [b] [a]) {return false; }}} Be true; } In this method goes through the outermost lines for the loop and the loop is going through the internal column. You have to go through each element in the matrix. If the array [A] [B] == array [B] [A] then you can check the next one. If they are not identical then this matrix is ​​not symmetric.

Rails 4 nil or empty argument with two forms creating new -

I have two forms to create a new image. I want them to go to both_image_path, but with the @image variable. gets this error: The first argument in the form is zero or below Can not be one form: & lt;% = form_for @image, url: new_sm_image_path (@image). F | & Gt%; Other: & lt;% = form_for @image, url: new_lrg_image_path (@image) do | F | & Gt%; My route: get "/ sm_image": "image # new_sm", like: "new_sm_image", "/ lrg_image", get For: "images # new_lrg", as such: "new_lrg_image" My index.html.erb has two buttons: & Lt;% = link_to 'lrg_image', id: "new_button"%> set the example variable @image in your controller's action Are rendering these forms are currently @image is zero, therefore you get an error because the first argument in the form can not be included in the vacuum or may be empty . According to the comment, I have two bu

What are the rules for implicit adjustment of hrefs in Polymer elements? -

मैंने पाया है कि & lt; a & gt; तत्व पर href विशेषता स्वतः में समायोजित हो जाती है एक पॉलिमर तत्व की परिभाषा, लेकिन मैंने कभी भी उस दस्तावेज को नहीं देखा है ज्यादातर समायोजन हानिरहित होते हैं, लेकिन कभी-कभी यह बगों का एक सूक्ष्म स्रोत होता है। देखें। दस्तावेज़ में दो लिंक हैं, प्रकाश DOM में और & lt; polymer-element & gt; के अंदर। दोनों बिंदु को href = ".." (या तो उत्पादन क्रोम या कैनरी में) चलाने के बाद, पहला लिंक अछूता रहता है, लेकिन दूसरा यह है कि वह (कोई गंतव्य नहीं) में चुपचाप संशोधित है। हालांकि यह उदाहरण का योगदान है, मेरे पास कुछ पृष्ठ घटक हैं जो विभिन्न कारणों से अपने स्वयं के लिंक का निरीक्षण करना चाहते हैं। ये रहस्यमय ढंग से संशोधित किए गए href्स उस कोड को विफल करने के लिए पैदा कर रहे हैं उदाहरण के लिए, अगर फ़ूओ नामक पेज पर एक लिंक होता है, तो href में लिंक गंतव्य चुपचाप निकाल दिया जाता है। क्या यह href संशोधन एक बग या सुविधा है? और अगर यह जानबूझकर है, तो नियम किस प्रकार संशोधित किए गए हैं और मैं इसे बंद कर सकता हूं? आयात पुनर

jquery - Toggle icon on collapse events -

I have asked this a few times, but I think there can be no work to do for me, I think That's for some answers or older versions of bootstrap in this forum. First of all I should tell that I am still learning JS and not good at it, but my position is here. I have an emergency style collapse on which I am trying to change the class when the group is either open or closes, in this way the icon I am using is open from an open icon Switch will be. This is my markup: & lt; div class = "panel-group" id = "accordion" & gt; & Lt; div class = "panel-panel-default" & gt; & Lt; div class = "panel-title" & gt; & Lt; H4 square = "panel-title" & gt; & Lt; Data-toggle = "fall" data-parent = "# accordion" href = "# collapseOne" & gt; & Lt; span class = "accordion-up" & gt; & Lt; / Span & gt; Title & lt; / A & gt; & Lt; / H4 & gt

ios - Where to set and layout a TableView footer -

I am trying to add a footer to my table view. The problem I have is: If I set the footer in viewWillLayoutSubviews , then due to this it will be called viewWillLayoutSubviews and we will call an infinite loop . Instead I set the footer in the viewDidLoad and calculate it and its subviews frame in viewWillLayoutSubviews , the footer at the top Ends my first part of the table view is covered. I can not calculate the frame in the viewDidLoad because the table view limit is not correct (My app only supports landscape mode). I can create and layout the footer in viewWillLayoutSubviews by using a Boolean instance variable, but only when it is called for the first time, but it seems incorrect Then the frames will not be counted again. There should be a better way. Just create them in viewDidLoad and assign tableViewHeader and tableViewFooter properties, in that way the tableview will handle their position.

enums - C++ calling a method from another class -

Image
I have 2 squares with their header files, which are lexer.cpp and lexer.h, token.cpp And tokens are called .h It is necessary to make them the compiler. I'm still lexmeas currently, dividing and reading tokens. Now I have a method that will load each character from the file, and for example it shows that this is an integer, it will return a token (which is token.cpp in the token) Problem: .cpp in tokk I have an enum class token that contains all tokens which can be read by my compiler (Coding will be given below) Now Lexer.cpp is to call this class (Enum class token in Token.cpp ) token.h I have just declared the name of the class Lexer.h wrote the name of the method which should be used in Lexer.cpp But they are creating some errors. Error: Code: Lexer.cpp Token Lexer :: MillTextToken (four CH ) {Return Token :: Vacuum; } lexer.h #ifndef lexer #define lexer #include "token.h" square laser {public: Four readrets ();

python - Printing a two dimensional list -

To represent the four connecting console game I am trying to print a two-dimensional list. Should look like: 1 2 3 4 5 6 7. . . . . . . . . . . . . . . . . . . . . . . R. . . . . Y r . . RR Y Y It is far from me, and I can not seem to work for it, I am saying "index error", "Trouble index out of range". Keep in mind, in the module Connect_for, BOARD_ROWS is equal to 6 and BOARD_COLUMNS is 7. None is red, 'R', and Yellow is 'Y' In addition, the game_state is a named object object with two fields, which is the first time Is the game board (list of strings). def print_board (game_state) - & gt; None: For printing in "range" (connect_four.BOARD_COLUMNS): "Print of the game board given game game" for one (connect_four.BOARD_ROWS) in "" "" print ("1 2 3 4 5 6 7") range. : If the game_state [b] [a] == connect_four.NONE: print ('.', End = '') elif game_state [b] [a] == connect

list - Python CSV export writing characters to new lines -

I am using multiple code snippets to create a solution that allows me to write a list of players in a football team Will give a CSV file. import csv data = [] string = input ("team name:") fName = string.replace ('', '') + ".csv" print ("when you all Players have entered, then hit enter.) # While the loop will continue to enter the players, when it will not be done: a = input ("player name:") if any == "": true Second: String + = A + ',' String + = Input ("Age:") + ',' String + = Input ("Status:") Print (string) file = Open (Fnm, 'W') Output = Csv.writer (file) for the row in the row: tempRow = line output.writerow (tempRow) file.close () print ("Team written in file.") me Like to export CSV file to appear like this: player 1, 25, striker player 2, 27, midfielder and so on.However, When I check the Export CSV file, it looks like this: player, 2 5 and

map - Hazelcast IMap.get() throws HazelcastSerializationException, but IMap.put() works fine -

I have a Hazelcast server example running on a VJ. Data can be found in the MAP < Integer, User & gt; is considered to be stored in, where the user class occurs as follows: Public class user tools com.hazelcast.nio Serialization.DataSerializable {Private Integer ID; The name of the private string; Private string Nick; Private boolean sex; // Miller & amp; Amp; Setters @ Override Public Virus ListData (Object Data Out) throws IOException {out.writeInt (id.intValue ()); Out.writeUTF (name); Out.writeUTF (Nick); Out.writeBoolean (sex); } @ Override throws Public Wide Reddata (ObjectDetinput) IOException {id = (integer) in.readInt (); Name = in.readUTF (); Nick = in. Rottief (); Sex = in.readBoolean (); } I connect to this server with a client instance and try to add an object to that map: System.out.println ("Map size:" + Map.size ()); map.put (1, user); System.out.println ("map size:" + map.size ()); System.out.println (map.containsKey (1)? &

php - Building a regex from a set of logical expressions -

I have created a simple grammar for logical expressions, using boolean operators and stars as their operand, which I want to pass as a URL query string I present it in another string in the $ query string, which is named $ text , to match the strings I'm going to use it for Consider the following example (in PHP): function search ($ text, $ query) // $ text, $ query string {// returns true If the logical expression is generated from the $ query $ true for the test string // otherwise the wrong result returns $ query: // query contains $ 1 (variable) variable between parentheses and operators: // (2) Operators are: & amp; = And, | = Or,! = No // (3) The priority of the logical functions is defined by the parenthesis: () // (4) variable = true if substring is present in $ text, then it is not wrong /} Example: $ text1 = 'str4 str3 Blalbablastr2 '; $ Text2 = 'str4whichherere str3str5'; // str5 current or str1 exists $ simpleQuery = 'str5 | str1 '

php - OOP issue: Call to a member function prepare() on a non-object -

I am trying to use the PDO and so I am putting it into a waiter in my database class: class database {// DSN, username and password private $ mysql; Public function __ composition () {$ mysql = new PDO ($ this- & gt; DSN, $ this-> dbUsername, $ this- & gt; dbPassword); $ mysql- & gt; Set Attribution (PDO :: ATTR_UMLamp PREPARES, Incorrect); $ mysql- & gt; Set attribute (PDO :: ATTR_ERRMODE, PDO :: ERRMODE_EXCEPTION); $ This- & gt; mysql = $ mysql; } Public Function Database () {Return $ this- & gt; Mysql; }} and I'm calling the database method such as: class router database {public function login () {$ query = $ this extends ) - & gt; mysql () - & gt; Prepare ('SELECT * ...'); $ Query-> But execute (array (...)); ...} Although I keep the following error: Fatal error: Call a member function (on non-object) / Code> I have asked more knowledgeable people about myself, although I am still confused about why this will

IOS to PHP POST parameters? -

इस सवाल का पहले से ही एक उत्तर है: < / p> 7 जवाब 2 जवाब मैं ' हमसे संपर्क करें ' ViewController बनाने की कोशिश कर रहा हूं, जो एक ई-मेल भेज सकता है, लेकिन मैं MFMailComposeViewController का उपयोग नहीं करना चाहते क्योंकि मैं ई-मेल पता सेट करना चाहता हूं जो संदेश प्राप्त करता है। ऐसा .. मैंने कोशिश की एक दृश्य नियंत्रक बनाएं जो उपयोगकर्ता से सभी संदेश डेटा लेते हैं और इसे एक PHP पृष्ठ पर भेजते हैं जो बाकी की प्रगति करेंगे, इसलिए मैंने इन मानकों का उपयोग करके पैरामीटर भेजने का प्रयास किया PHP पृष्ठ पर विधि प्राप्त करें , जो छोटे पैरामीटर जैसे 'नाम' या 'फ़ोन नंबर' , लेकिन मैं इस विधि का उपयोग लंबे समय तक नहीं कर सका पाठ जैसे 'संदेश सामग्री' इसलिए मैंने POST विधि का उपयोग करने का निर्णय लिया है, लेकिन मुझे ऐसा तरीका नहीं मिल सका है जो कि POST विधि का उपयोग करके अपने ऐप से डेटा को PHP भेज सकता है। मैं < PHP < / p> & lt;? php $ msgTitle = $ _POST ['शीर्षक']; $ संदेशसिटी = $ _POST [&

javascript - Meteor two way data binding for form validation -

I've read a lot of resources about Blaze allowing reactive rendering Meteor 0.8, but for me it No solution can be found, my simple problem is below. I have my form I am trying to validate input simplicity, I say that I am your {{message}} would change when a form is submitted. The approach taken in client.js is simply giving a new value for the assist variable. How did I work with AngularJS in this way, but more than just changing the bus in the meteor, how do I take it? - index.html & lt; Template name = "user" & gt; & Lt; Form & gt; & Lt; Input type = "text" id = "name" & gt; & Lt; P & gt; {{Message}} & lt; / P & gt; & Lt; Button class = "submit" onclick = "return false;" & Gt; Submit & lt; / Button & gt; & Lt; / Form & gt; & Lt; / Template & gt; - client.js Template.user.message = ""; Template.user.events = {'click .submit' = fu

html - Horizontal scroll appears on bootstrap -

I do not understand why I can get horizontal scroll in this bootstrap website, someone can tell me I am not quite able to understand what I am doing. jsfiddle.net/8aAUP/ The problem is, you can get this DOM Using: .row .container .row The line is a square located in . Conatiner , so if you remove the external .row , then it will work for you.

python - Matplotlib not listening to font choices -

I am unable to avoid an error about the font option in matplotlib. Whenever I try to plot a remote machine in Linux, I get the following error: /home/josh/anaconda/envs/py27/lib/python2.7/site- packages / matplotlib / Font_manager.py:1236: User Alert: Search: Font Family ['Aerial'] was not found. Beatstream Vera Sons (Prop. Family.), SfFemily [Fontx]) I have edited my .matplotlibrc file (just in case, two places ): .matplotlib / .matplotlibrc .config / matplotlib / .matplotlibrc Where I add the following lines: Backend: Agg font. Family: Serif font cyirief: Times, Palatino, New Century Schoolbook, Bookman, Computer Modern Roman Font Breath - Serif: Helvetica, Avant Garde, Computer Modern Sans serif font. Creative: Zapf Punch Font Monospace: Courier, Computer Modern Typewriter Text Yussext: True However, there is a complaint about matplotlib arial . Why? (Note that when a script is running, which does not include an IP address, with python my_sc

Can Chef Attributes be referenced from within the same attributes file? -

अगर मेरे पास एक विशेषता है: डिफ़ॉल्ट [: mycookbook] [: attr_foo] = "Foo" क्या मैं इसे उसी फाइल में देख सकता हूं, ऐसा कुछ: डिफ़ॉल्ट [: mycookbook] [: attr_bar] = डिफ़ॉल्ट [ : Mycookbook] [: attr_foo] यह संभव है, हालांकि सही सिटकैक्स है: डिफ़ॉल्ट [: mycookbook] [: attr_bar] = "# {डिफ़ॉल्ट [: mycookbook] [: attr_foo]}" .. अनिवार्य रूप से विशेषता इसके साथ लिपटे गए हैं: "# {}"

ios7 - Accessing battery level of battery powered iBeacon devices (mainly kontakt io ones)? -

I am currently trying to find a way to reach the battery level with my beacon through an iOS application. I am using iBeacon devices of contact. I browsed Estimot iOS SDK and they provide a method to achieve it. I was wondering if this is capable of reaching the raw beacon packet and since I manually removed the data, I know the beacon packet structure and the information is here. How to obtain this method The raffle is from kontakt.io. First of all, I thank you for choosing you, it means a lot to us. Battery level dissemination is not standard for iBeacons nor is it in any official iBeacon documentation, therefore you can find the value using custom SDK battery level promotion in our iBeacons scan response packet The iOS can be searched using the CoreBluetooth API. There is a byte value at 23 bytes in the level packet. Hope this helps :)