Posts

Showing posts from August, 2013

c++ - is there a boost or stl function that implements conditional accumulation? -

I want to apply a code that adds a certain range, as long as it matches a certain condition Do not here my code is: int x [5]; Int Gateindex (Int. Valle) {Int Eye; Int xtotal = 0; For (i = 0; i <5; ++ i) {if (xtotal> break) break; Xtotal + = x [i]; } Came back; } I am using c ++ 03 function I came across the stall but I do not want to add everything. I want to add value until it is more than the input. The array is just an example and it can change a vector or whatever. You can write your own here template & lt; Typename InputIterator, TypeName ElementType, TypeName PRECIC & gt; Const Element Type Cache (if first (finally (* first)) init + = * first; (first; = last; ++ before); (first; InputIterator; return init;} He also has one that takes a binary operation, if you want to do something extra besides.

Efficient synchronization algorithm -

Let me find a large sort of node_a (+ 10 MB, + 650k lines) There is a dataset and there is no master version of the dataset dataset at node_b , which means there may be some pieces in the node that are not available for other nodes. My goal is to synchronize content with node_b with the contents of node_a . What is the most effective way to do this? Common sense solution will be: node_e: here I have everything ... (sends the entire dataset) node_b: this is what you have Is not ... (sends missing part) But this solution is not perfect at all. To try to synchronize it every <+> 10 + (10 MB) is required to send node_a . By using a little bronchitis at this time, I can start a partition of a dataset, only sending it Can you think of any better solution? <div class = "post for a synchronization: </ strong> </ p> <p> Break the dataset into arbitrary parts, together with each (for example, ), And send through the hash values ​​inste

How to apply query on List objects in java -

I am doing some project in Java. I need some help on applying query / filters on the list object in Java. Like we can inquire in C # i.e. list & lt; Replica Manager Custom & gt; Replicamanager; Replicamanager.where (x => x.Id> 6) I want to make my search easier on the list object in Java. Please help me out You have to do it manually, do it manually. To wit. In Java, if already using the if-else structures in Java. In Java 8 you can use the stream with lambda. Apart from this, you can use Google archive, its functional style has an API to manage collections

python - BeautifulSoup: Search from leaf to root to get the "deepest" elements first? -

As for a research project, I want to remove all the "documentation units" of a document unit in Python documentation A class (DL class: class) A (DL class: method) section (div squares: section) < P> And as you can guess, they should be nested in such a manner: There are many classes in a section, which have many methods but in reality it is very irregular Is. Example 1: If there are many classes and methods in one section: I want to get each method alone and each class without methods (which I have already received) and Without the classes (which I already have in that case) and methods (which I already have), but with the rest (as there are too many additional things) Example2: If there is no method or no section in the class In which they appear, so I have described above them and do not forget them. Note: This is not easy, but I would like to get them all into a list which has the same command as the original documentation. I tried it with a

N-ary Generic Tree -- Java Interview -

Please forgive me if this question has already been asked. I recently took an interview for a job after completing a code evaluation that was based on the use of N-Arya tree and amp; Two traversal methods As most examples of this site, I have used generics to define my tree / node data type so that I can apply strict use of any type of data type , Which I declare with tree type. Okay, to reduce a long story, my results were fine but the interviewer asked me why I used generics for my tree data structure, because I told them it is because of any kind of use in my evaluation The best way to implement the data type of the tree was. I also told them that I have created a similar data structure before, and recalled how it implemented it. Is my first question far? : The code using generics has many advantages over non-normal code Is: Check on strong compile time. A Java compiler applies normal code to a strong type of probe and issues errors if code violates security of type

regex - I need regular expression to replace everything than certain text -

I want to write a regular expression which can extract time data in the form in the following examples: 2 hours 2 hours 2 hours 30 minutes 2.5 hours I am trying to get it written and written in regular expressions - [^ 0-9 \ s ( H | h) in our (m | m)]. But when I test it - this letter matches 'our' and 'in' separately. I want to match only the words 'bell' and 'bell' and their Do not want subsets of characters Maybe try to do something like that? (\ d + (?: \. \ D +)?) \ S (?: H | h) ours? (?: \ S (\ d +) \ s (?: M | m) inutes?)? The first group will be the number of hours, the second group is the number of minutes

php - redirect typed-in url to new url BUT using some of typed-in data -

What I want to achieve is the following: I want people to type in this way : Although this URL is not actually in existence, and then make sure that it is redirected to a correct URL but still keep 1 in the end of the URL or a URL at the end. The goal is to enable people to enter a small URL such as: and still they are ending on the right page, and the content is counted with number 12 Any suggestions? Thank you very Sam You can use Apache / NGNX You can see URL rewrite for location handling in Nginx, which is most configurable for your webserver, which may be Apache. RiverEngine Recharge rule ^ ([0- 9] +) $ index .php? Number = $ 1 source:

CasperJS - Form fill() returns a 401 -

I am trying to test the original authentication web page. I have it so far: var casper = require ('casper'). Make ({verbose: true, logLevel: 'debug'}); Casper.options.viewportSize = {width: 1366, height: 667}; Casper.start (); Casper.open ('http: //internal/page.php', {method: 'get', headers: {'authorization': 'Basic' + btoa ('Username: Password')}}). Response) {this.fill ('form [action = "page2.php"]', {cattype: 'BLAH2', needdate: '04 / 21/2014 '}, true);}); Casper.then (function () {this.capture ('screenshot-form-entry.png');}); Casper.run (function () {this.exit ();}); The page opens properly (no authentication problems). Form fields are set correctly. The problem is a form submission. This is called status = failed . I see the server log and it gives a 401. Why are not the certificates passed along with the submission of the form? Or maybe the question should b

javascript - How to compare bold text -

देखो = document.getElementsByTagName ('b') के लिए (var i = 0; i & lt; = look.length ; I ++) {if (i [।] .text == "कुछ") {....}} मैं सोच रहा था कि मैं कैसे बना सकता हूँ (अगर [ i] .text == "कुछ") {....} काम? क्या मुझे आंतरिक पाठ की तरह कुछ और .text की आवश्यकता है? इसका बोल्ड के साथ कुछ नहीं करना है । आप बस पाठ को पकड़ने की कोशिश कर रहे हैं तत्व के पाठ (केवल पाठ) प्राप्त करने के लिए textContent का उपयोग करें look = document.getElementsByTagName ('b') के लिए (var i = 0; i & lt; = look (एलआईडीटीईएक्स): (i.i. ++) {if (i [।] .textcontent == "कुछ") {चेतावनी ("अंदर")}} JSFiddle: MDN संदर्भ:

Issue With Content Security Policy in Chrome Extension -

यह मेरे क्रोम एक्सटेंशन से है। "अनुमतियाँ": ["भंडारण" "https://app.socialschools.nl/*", "http: //*.google.com/", // http://goo.gl/CPeqK http://goo.gl/U3Vev "देखें बुकमार्क्स ", // http://code.google.com/chrome/extensions/bookmarks.html" chrome: // favicon / "," क्लिपबोर्ड रीड ", // document.exec कॉमांड ('पेस्ट')। "क्लिपबोर्ड लिखें", // document.execCommand ('copy' OR 'cut') "contextMenus", //http://cod.google.com/chrome/extensions/contextMenus.html "कुकीज़", // http: //code.google.com/chrome/extensions/cookies.html // "experimental", // http://code.google.com/chrome/extensions/dev/experimental.html "fileBrowserHandler", // http: //goo.gl/GqbrP "जियोलोकेशन", // http://dev.w3.org/geo/api/spec-source.html "इतिहास", // http://code.google.com/chrome/ एक्सटेंशन / इतिहास.html "निष्क्रिय", // http://code.google.com/

javascript regex pattern with an array -

I want to create a regex pattern which should be able to search through an array. We say: var arr = ["first", "second", "third"]; var match = text.match (/ & lt; ara & gt; /); who should only be able to match & lt; First & gt; Or & lt; Seconds & gt; Or & lt; Third & gt; ...... but should ignore & lt; ffirst & gt; Or & lt; Dummy & gt; I need an efficient approach. Any help would be great thanks You (a | b | c) should search for a particular word . . has been created from arr by joining the values ​​as < var arr = ["first", "second", "third"]; var match = text.match (new regxp ("& lt; (?:" + arr.join ("|") + "))");); // mail & lt; First & gt; & Lt; Second & gt; And & lt; Third & gt; Note that if your "source" words contain regular characters of regular expressions - you

Javascript prototype - object.create issue -

I am trying to learn about object.create and prototype inheritance and the following is: employee = {'attributes': {}, getAttributes: function () {this.attributes return; }, addAttribute: function (attribute) {if (! this.attributes.hasOwnProperty (attribute)) {this.attributes.extend (attribute); }}}; Var OfficeEmployee = Object Create (employee); var OfficeEmployeeInstance = Object Create (OfficeEmployee, {'attributes': {'id': 123, 'name': 'Bob'}}); console.log (OfficeEmployeeInstance.attributes); OfficeEmployeeInstance.addAttribute ({'Salary': '100'}); console.log (OfficeEmployeeInstance.getAttributes ()); This works because I hope it should be and throws errors: console.log (OfficeEmployeeInstance.attributes); is undefined and console.log (OfficeEmployeeInstance.getAttributes ()); returns the error: Uncort type error: The method of undefined tester.js can not call 'hasOwnProperty': 39 Staff: ad

compass sass - gulp.js: 'gulp.watch' is not really watching changes -

I'm having trouble using gulp.watch to check changes in my .scss and images files. Only then is working when I create or edit the javascript file, so 'clock' is working, but this is my code only for javascript files: var gulp = require ('gulp'), concat = need ('gulp-concat'), uglify = require ('gulp-uglify'), rename = require ('Gulp-rename'), compass = ('gulp-compass '), minify CSS = 'Required' ('Gullup-Minivity-CSS'), ImageMenu = ('Gulp-Imageman'), notify = notify '), Clear = requires (' Gullp-Clean ') Requires filesize = ('files-files'); Gulp.task ('scripts', function () {return gulp.src (' src / js / *. Js') .pipe (concat ('main.js')) .Pipe (gulp.dest (' build / dev / Js')) .pipe (files ()) .pipe (euglif ()) .pipe (gulp.dest ('build / production / js')) .pipe (file ()) .Pipe (notify ({message : 'Javascript function complete'}));}); Gu

scripting - Bash variables not acting as expected -

I have a bass script that parses a file line by line, a cut command And then make a folder using that date, however, it seems that my variable is not being populated properly Do I have a syntax issue? Any help or direction for external resources has been highly appreciated. #! / Bin / bash ls | Grep .mp3 | Cut-D '. -f 1 & gt; Philostomomed Cat Filestabiva | While reading the line varYear = $ line | Cut-D'_ '-f3 varMonth = $ line | Cut-D'_ '-f4 varDay = $ line | Cut-D'_ '-f5 Buzz $ varMonth mkdir $ varMonth' _ '$ varDay' _ '$ varYear cp ./$line'.mp3' ./$varMonth'_'$varDay'_'$'varYear/$ Line '. Mp3 'done' You have many errors and non-suggested behavior codes. Try the following: f * * .mp3; Do f = $ {f %%} *} IFS = _read _ _ var var $ $ varMonth mkdir -p "$ $ varMonth} _ $ {varDay} _ $ {varYear}" cp "$ f.mp3" "$ $ {varMonth} _ $ {varDay} _ $ {varYear} / $ reson

sql - UPDATE statement -

I a and where do Update on the table from both the primary key Am trans_nbr . My statement has been posted below. I was able to get in as an error "is a syntax error" primary key is the only link between the two tables with the same amount of lines I first but then I showed sequenceID on brev_efile_user_doc_stats table is how different XML review process, which depends on handled is why a corrected_seq_id column in the same table. update brev_efile_user_doc_stats.reviewed_event_code, SET brev_efile_user_doc_stats.corrected_seq_id brev_efile_user_doc_stats.reviewed_event_code, brev_efile_user_doc_stats.corrected_seq_id = (select brev_efile_review.reviewed_event_code, brev_efile_review. Where sequence_id from brev_efile_review brev_efile_review.trans_nbr = brev_efile_user_doc_stats.trans_nbr) < / code> in search of that what you are: Update in SQL server; brev_efile_user_doc_stats SET brev_efile_user_doc_stats.reviewed_event_code = R.reviewed_e

ruby on rails - Result of time subtraction? -

How do I get the result of subtraction in words like "7 seconds"? StuffTime is not working because the result is fiction. a = time.nough: b = time.new # a few seconds later b - a # 7.17584 (seconds) < div class = "post-text" itemprop = "text"> If you are using rail, you can use it: from_time = time.one distance_of_time_in_words (Se_time, se_time + 15 seconds, included_scond: true) less than # 20 seconds

assembly - Differences in OllyDbg and IDA PRO for MOVSX EDX, BYTE PTR [ESP+ECX+8] command -

जबकि OllyDbg और IDA PRO का उपयोग करते हुए एक ही प्रोग्राम को अलग करना I के पास अलग-अलग तरीकों से कोड की एक पंक्ति अलग-अलग है। < MOVSX EDX, BYTE PTR [ESP + ECX + 8] आईडीए: MOVSX ईडीएक्स, [ईएसपी + ईसीएक्स + 68 एच + स्ट्रिंग] क्या कोई ये बता सकता है कि आईडीए प्रो इसका क्या मतलब है? मैं यहाँ 68h + स्ट्रिंग भाग से निराश हूँ। क्या मैं मान सकता हूँ कि 68 एच + स्ट्रिंग का हमेशा मतलब BYTE PTR? आईडीए को STRING को घोषित करना चाहिए था कार्य / प्रक्रिया की शुरुआत में -60 घ के मान के साथ एक लोकल वैरिएबल हो (68 + STRING) == (68 + (- 60)) == (68-60 ) == 8 यह वही है जो ollydbg दिखाता है 00405712 8B4424 30 MOV EAX, DWORD पीटीआर एसएस: [ईएसपी + एसएएस] 30] आईडीए दिखाएगा जबकि टेक्स्ट: 00405712 mov eax, [esp + 1ch + arg_4] > क्योंकि समारोह ida की शुरुआत में arg_4 को .text: 004056E0 arg_4 = dword ptr 14h के रूप में परिभाषित किया गया है 14h + 1ch == 30 घंटे अगर आप आईडीए सिंटैक्स पसंद नहीं करते हैं लेकिन आप एक सीधा [esp + 30] देखना चाहते हैं यह स्क्रि

Custom Method Validation Error in Rails Controller -

I'm new in the rail so please lend this question. I ran into a problem lately and if someone can help in finding the right solution I would be grateful. I want to add this custom method to my approval. The user must have received a start date which has been submitted before an expiration date, with an error class request & lt; ActiveRecord :: Base verifies: start_date,: to_date, presence: true is valid: checkin_date_cannot_be_in_the_past def check_data_account_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ condition: if & gt; Unless this custom method does not work for me as described in the document and one of my controllers Error in (error syntax error, unexpected end-input, keyword_and is expected): def new @request = Request.new end after search I can not find the right solution to spend some time in it, so I hope there is help to anyone here. Can? Cheers This must be valid to validate custom validation class request & lt; ActiveRecord

javascript - Add function to the plugin js without actually modifying js file -

I want to add the 'setInputDataId' function to the same level because the existing function 'selection' is actually in the plugin without js file Modifying the file itself so I would like to know how I can add a new function, I appreciate the help. Existing code in the plugin: _select: Select function (data) {this .input.setQuery (datum.value); This.input.setInputValue (datum.value, true); this._setLanguageDirection (); this.eventBus.trigger ("selected", datum.raw, datum.datasetName); this.dropdown.close (); _.defer (_bind (this.dropdown.empty, this.dropdown)); }, I need the new code: _select: Select function (data) {this.input.setQuery (datum.value); This.input.setInputValue (datum.value, true); This.input.setInputDataId (datum.raw); this._setLanguageDirection (); this.eventBus.trigger ("selected", datum.raw, datum.datasetName); this.dropdown.close (); _.defer (_bind (this.dropdown.empty, this.dropdown)); }, And the 'setInputDa

jquery - Dynatable callback function not working -

I'm trying to generate the event dynatable , I have tried < code> $ ('# my-final-table hr'). On ("click", function () {warning ("foo");}); "}, {" Band ":" chaalel "," song ":" family system "}]; $ ('# My-final-table') dynatable ({dataset: {record: jsondata}}) .bind ('dynatable: afterprocess', function () {warning ('foo')}); But this does not work, no warning is shown after loading. JSFiddle: In the example, they manually call post process from the dynatable website Let's run it for the first time. Something looks like this for your code: var processingComplete = function () {alert ('foo')}; $ ('# My-final-table') dynatable ({dataset: {record: jsondata}}). Bind ('dynatable: afterprocess', processing complete); // Process manually for the first time (); If you want to see it in Bela, check here: If you are interested i

r - Adding multiple columns to a data frame -

मेरे पास एक डेटा फ्रेम है df जैसे: अब एक विशिष्ट पंक्ति के काम करने के लिए एक एकल कॉलम जोड़ना: डीएफ [4, "डी"] & lt; - 5 डीएफ # एबीडी # 1 1 101 एनए # 2 2 102 एनए # 3 3 103 एनए # 4 4 104 5 # 5 5 105 एनए लेकिन कई कॉलम एक साथ जोड़ नहीं! df [3, c ("b", "f", "g")] & lt; - c (6,7, 8) # त्रुटि `* टीएमपी * '[[जे]]: पुनरावर्ती अनुक्रमण स्तर 2 पर असफल रहा क्या देता है? इसे प्राप्त करने का लंबा रास्ता, अर्थात, है: df [3, "b"] & lt; - 6 df [3, "f"] & lt; 7 df [3, "g"] & lt; - 8 लेकिन यह वास्तव में सबसे आसान (और सही) तरीका है? इस प्रकार प्राप्त करने का एक और स्वचालित तरीका निम्नानुसार है: df & lt; - data.frame (a = 1: 5, b = 101: 105) cols & lt; -c ("ई", "एफ", "जी") vals & lt; - c (6, 7, 8) sapply (1: लंबाई (कॉलम), फ़ंक्शन (i) df [3, cols [i]] & lt; & lt ; - vals [i]) df जो देता है: abefg 1 1 101 NA NA NA 2 2 102

android - Best field type to store PhoneGap's device.uuid in MySQL -

What is the best field type and length for the device UUID to store PhoneGap? What I have learned so far, it is that 64 character string is the best option. However: Phonegap, This is quite unknown to me, what is the length of device UIID under iOS devices, went away This plugin introduces another format for layers and devices such as tezane, In case of uniting this problem in various mobile devices, " even more mess " To make things even more complicated, I learned from my own examples , Although according to Fongap, Uuaidi 64 characters long hexadecimal string, present it. If it is hexadecimal string, then the field type must be clearly string in MySQL. But, what length should I use to make sure that I will be able to record the correct device UUID on any type of mobile device, which is supported by PhoneGap, and that I can get more space in my database Do not waste (like I do this, when using a 64-character long string for storage of 16-character hexa

php - Attempting to copy a file from one directory to another in codeigniter -

I try to do some theme structure in my CMS, where you can select a theme for the front-end website I am doing. It is a part of my code below, as a certain topic is active, it is an idea that it means that the files copy the file folder into a folder in the folder from the theme directory (in some upload directory); Idea in codeigniter It's not really codeigniter specific, but I'm still trying to copy my files and copy existing theme files and keep the file here even if it does not exist. $ ->; Data ['main_url'] = FAPAT 'property / topics' $ name; foreach ($ (this- & gt; data- $ ['main_url'] '$ /' as file $ '/.php')) {if (file_exists ($ file)) {if (basename (file $) == ' _main_layout.php '|| basename ($ file) ==' _login_layout.php '|| basename ($ file) ==' _register_layout.php) '(ideas /' basename ($ file) {copy $ file, APPPATH. ' .); } And {$ this- & gt; Data ['Errors'] [] =' P

javascript - Shared footer between different pages (When using data-role="page" in JQuery) -

I have a shared div footer that all its internal elements should be similar to both pages. & lt; Div id = "page1" data-role = "page" & gt; & Lt; / Div & gt; & Lt; Div id = "page2" data-role = "page" & gt; & Lt; / Div & gt; & Lt; Div id = "bar" data-roll = "footer" class = "shared slides" & gt; & Lt; / Div & gt; Later, I will replace Page 1 using $ .mobile.navigate ('# page2') and I do not want to share the shared foot footer to the page's functionality and styles. (#bar) How is this possible? jQuery mobile has two page templates. Each page is placed in the same HTML file, as in your case it is also called a multipage template. Others have 1 HTML page per 1 HTML file. And this is called Multi-HTML Template. Read more about them. What you need is a multi-templates templates. Here's an example of working: HTML 1 - index.html: &

Unable to interact with content over HTML5 video in iOS -

I have been given a design to implement a lightbox in which there is some content that contains the link, it is all right And when it comes to iOS, except work in addition, it is not possible to interact with the contents of the lightbox if its position is at the top of any video. It is acting as if the video lightbox is at the top of the content - even if it is behind. This problem is also very simple barebones with HTML HTML stripped back: Associated stripped styling: #lightbox {status: absolute; Top: 0; Left: 0; Width: 100%; Height: 100%; Background: RGBA (255,255,255,0,5); } # Lightbox & gt; A {display: inline-block; Background: Red; Padding: 20px; } #Think {margin-top: 400px; / * I have inserted a that contains some js which warnings s when You have successfully clicked a link. On desktop browsers, it is possible to click both links, it is possible to click on the second only on iOS It is worth noting that the problem arises whether the lightbox is pr

sql server - Index was outside the bounds of the Array. (Microsoft.SqlServer.smo) -

I am using SQL Server 2008 R2 I'm working fine but still In the same, I have changed my hosting server and I came to know that they have installed on SQL Server 2012 server. Now, the issue is that from the server database to SQL Server 2008 R2 , when I click on a table name or stored procedure, I get the error: index Array was out of range (Microsoft SQL Server .so) Is there any problem with my side or server side ??? And how can I stop this issue? Upgrade your SQL Server Management Studio from 2008 to 2012 or SqlServer Download and update the management pack of the management studio Maybe you can solve the solution You can download SQL Server Management Studio 2012 from the link below http : ///www.microsoft.com/en-us/download/details.aspx?id=29062

android - Extract image from URL using Jsoup -

I have tried to remove an image from other websites with the following code and I have no problem, but they have other websites Tried with and nothing happend came no image. Secure voice downline background (Zero ... parameter) {Connect to web site {// Connect Document Document = Jsoup.connect (https: //www.indiegogo com / Project / Detective-cam-peek-me / embedded) .get (); // Use Elements to get the class data elements img = document.select ("div.i-project-card i-embedded img [src]"); // src attribute string imgSrc = img.attr ("src") find out; // image input image download image input = new java.net.URL (imgSrc) .openstream (); // decode bitmap bitmap = bitmapfender Aodestream; } Hold (IOException e) {e.printStackTrace (); } Return tap; } Finally managed to capture y image. image src Insert attribute data within a div such as source- (& lt;) div class = "image" data- src = "image.jpg" gt; gt; So I had to call the squar

Why does this java code return no output? -

This is a question on quiz. The question asks is whether the output is given when this code is run. I do not understand why anybody is not producing anything, can anyone explain? My understanding of if / else is that if the statement fails and the statement runs, why does the other statement not run? Code: int age = 10; Four registered = 'n'; If (age and gt; = 18) {if (registered == 'Y') {System.out.println ("you can vote!"); } else {System.out.println ("You are not old enough");}} Because this real code (correctly indented): if (age> = 18) {if (registered ==) 'y') {System.out.println ("You can vote!"); } else {System.out.println ("You are not old enough"); }} age is less than 18 , so the outermost if -statement is executed nothing. (I think this is a horrible quiz question, to be honest. This is nothing more than a trick with a bracket - it does not actually test your knowledge of Java.) &

javascript - Google weather widget on my website -

I want to show weather on my website. I saw all weather widgets that I could find online, none of them Google's Not as good (when I search for the weather for my city) and I did not find any documents to embed it on my website. I would like to know that if there is any way I can do the exact Google widget plugin on my website. (When I search for the weather) The service is calling and there is another option to create a whole widget, I have some APIs and it seems like a lot of work (Yahoo) APIs 30 different states give to the states.) It is for educational purposes and therefore I do not intend to spend so much time on this. If anyone has used Google's weather widget, please let me know. The Google Weather Info Box is part of the search results page and so can not be obtained independently (AAAIIAC). It is possible to remove information from the results page. It can be done on a web server, or in the browser (JavScript or Extensions / Plugins). It is possible to emb

c++ - Splitting string in specific format which was created from int vector -

I have written a program that creates a comma-separated string outside the intersector's vector as follows: < pre> studs :: vector and lieutenant; Unsigned Integrated & gt; Vec; Vec.push_back (50); Vec.push_back (60); Vec.push_back (10); Vec.push_back (20); Vec.push_back (30); Vec.push_back (2); Vec.push_back (1); Std :: stringstream linemomstring; lineNumString.str (std :: string ()); LineNumString.clear (); std :: copy (Vec.begin (), Vec.end (), std :: ostream_iterator & lt; unsigned int> (linum string, ",")); std :: string string string (lineNumString.str ()); Line string = linestrings. substr (0, linestring.length () - 1); Std :: cout & lt; & Lt; Std :: endl & lt; & Lt; LineString; If you see the output of the program above: `50,60,10,20,30,2,1` < / pre> But I want to change my output in a slightly different format. I have to keep the maximum of three numbers on one line and the next line next. Like the below: 50

Reading a custom XML String with asp.NET in VB -

OK, I have a custom XML string that changes the structure to see it as an important value pair here Is, therefore, unable to provide I want to be able to hold attribute value and allocate them in a variable, so I finish something like that. String = "SomeName" as thsValueTwo string = "SOMEFILE.jpg" as thsValueThree string = "SOMEALT" as thsValueFour = string = "SOMEFILE.jpg" SomeClass " I have tried to do something similar to this with a destiny xDocument = XDocument.Parse (" here is my XML Sting ") thsValueOne = xDoc.Descendants (" Key.AttributeValue "). Go (0). Take (1). Ostring I am thinking that I am not close. Well, this XML was based on the answer to the question was easy to answer was able to dim xDoc form XDocument = XDocument.Parse (thsXmlContent) thsValueOne = xDoc.Root.Descendants & Lt; Key & gt; (0) @ AttributeValue thsValueTwo = xDoc.Root.Descendants & Lt ;. Key &

assembly - Disecting x86 stack frame set up Visual C++ (Visual Studio 2010) -

On this very simple function, there are just some query questions that connect two numbers together. Here is the aortic distribution (with the question code are marked ???) here is a function int add (int x, int y) {int additionAnswer = 0 ; AdditionAnswer = x + y; Return extra job; } There is disassembly (DEBUG BUILD) with my aesthetics and questions int add (int x, int y) {push ebp; Base Pointer Move Ebap, ASP; Move the base pointer to start the stack frame for this function sub ESP, 0CCh; ??? It preserves the place on the heap for the local; Variable .204bytes looks extremely !!! ebx / push ??? Why is it the preservation of EBX, SEI and EDI ESI? This function does not explicitly use it! Push ed lia ed, [ebp-0chh]; ??? Why is it loading the top address of the stack in the EDE? Mov ecx, 33h; ??? What is that ex, 0 ccccccc; ??? What are the reps that are dword ptr es: [edi]; ??? What is that mov dword ptr [additionAnswer], 0; Int Additional Answers = 0 mov eax, dword ptr

ios - Post path must match exactly with RKResponseDescriptor pathPattern -

The current service follows the formatting of the following URL so that I am using something to update So this is the code that I had placed there. Roughly speaking. [Object Manager address descriptor: [RKRSponseSpecifydepotrator descriptormathding: EventResponsMapping Method: RKRquenventgate Pathpartne: @ "/ GetStaff" Keypath: Zero Status Code: RKStatus Codex Execution Class (RKestatus code class successful)]]; // I want to add an item to the URL, but the criteria parameter only goes to the post body, if I add the object in the path "@ GetStuff /? Parm = Stuff and parm2 = stuff2" then the response will not be properly mapped [Object Manager Post Object: Object Path: @ "/ GateStuff" Parameter: Parameters Success: Zero Failure: Zero]; It seems that RestKit requires that the object to which the object is posted and the path used to make the RKDescriptor should be an exact match. Is there a way to compare the risk kit with such a comparison that ig

.net - LibTiff.net Not able to update EXIF_USERCOMMENT field -

I just want to update the tif image on the EXIF_USERCOMMENT field I am making The call to SetField fails. Not sure what I'm doing wrong Here's my very simple code. Any help would be appreciated. {TIFF tiffdoc = Tiff.Open ("C: \ temp \\ ~ tempCapture.tif", "RW"); Bool bSetField = tiffdoc.SetField (TiffTag.EXIF_USERCOMMENT, "Test Comment Field"); Tiffdoc.WriteDirectory (); Tiffdoc.close (); } Unfortunately, it seems that LibTiff.Net only read EXIF ​​tags Can not write them and write them (original libtiff can not write EXIF ​​tag either) That's why it's why. Here are some quotes from the discussion: // FIXME - We currently do not support writing EXIF ​​fields. In TIFF // theory this allows the use of the custom IFD directory, but at present, it seems that libtiff only supports readings / IFD readings, not written to them. Leonard Rossenthal: I really do not think Liberif really wants to start metadata "Ra

java - Google multimap sorts keys automatically -

मैंने इस तरह से बहुमूल्य बनाया: निजी लिस्टमल्टीमैप & lt; स्ट्रिंग, इंट [] & gt ; TerrainMap = ArrayListMultimap.create (); {टेरिएनमैप.पूट ("टेरिएन। ग्राउंड", नया इंट [] (0, 100,300,0}); terrainMap.put ("Terrain.Ground", नया इंट [] (300,200,400,0}); terrainMap.put ("Terrain.Ground", नया इंट [] {400,250,800,0}); TerrainMap.put ("Terrain.Ground", नया इंट [] (800,500,810,0}); इलाका Map.put ("Terrain.DestroyableBlock", नया इंट [] {100,200,150,150}); इलाका Map.put ("टेरिएन.डिस्टॉयबलब्लॉक", नया इंट [] (500,400,600,350}); }; और मैं इसे इस विशिष्ट क्रम में प्रदर्शित करना चाहता हूं, लेकिन जब मैं ऐसा करने के लिए foreach पाश का उपयोग करता हूं: के लिए (नक्शा। एंटी एंड लेफ्टिनेंट; स्ट्रिंग, int [] & gt; प्रविष्टि: terrainMap.entries ()) {System.out.println (entry.getKey ()); } मुझे निम्नलिखित परिणाम मिलते हैं: इलाके। नाशपाती इलाक़ा इलाक़ा। नाशपाती इलाक़ा terrain.Ground Terrain.Ground Terrain.Ground Terrain.Gro

Java - Deleting word in trie (pseudo code) -

I am trying to figure out how to remove words from the tree. I have an implementation that uses a one-dimensional array on the node that holds the next letter for a word. I understand how I can get rid of a whole word, but not in the big words, which contain small words so that the word "bat", "war", "like" and "any" end of word ) And excluding "Battery", "Battlefield", "Ask" and "Any": root / \ a bat * -tery * / \ | Ns * -k * l-e * -f-i-e-l-d * | Y * -w-h-o * Below I have trie implemented in this way: public class TrieNode {protected char letter = ';; Secure TrieNode parentNode = null; Protected boolean full word = false; Protected Treeode [] Children = New Treeode [26]; Public triode (four letter, triangle parent node) {this.letter = letter; This.parentNode = parentNode; } Children of Public Boolean () {int index = 0; While (index & lt; children.length) {if (children [index]! = Null)

css - Google Web Fonts not working with nested LESS -

The question already posted on this topic did not solve my problem: I used I am trying to do Google Web Fonts in a bootstrap website which collects CSS with a less preprocessor. I am importing all the relevant style sheets at the top of my frontend.less as follows: @import 'base.less'; @import '/bower_components/fontawesome/less/font-awesome.less'; @import (lower) '/app/assets/less/superslides.css'; @import url (http://fonts.googleapis.com/css?family=Dancing+Script); I can currently apply web fonts to tag at a global, non-nested level: h2 {font-family: 'Dancing script', cursor; } However, when I try to use 'all at h2 -tags then #slideshow , a specific device The web font is not working within, for example: #slideshow {h2 {font-family: 'dance script', cursor; }} or #slideshow h2 {font-family: 'dance script', cursor; } Is this a bug or how do you implement font types correctly in nested cum? I hav

reporting services - How to replace nonNumeric value in Column value with 0 in SSRS -

I have a column in which there are percent values, I have an infinite symbol in the form of infinite value. But I need to change all the non-numeric values ​​with 0 How do I change all non-numeric values ​​to 0? = Iif (Isnumeric (field! JulyReview.value / fields! Julyquota.vala), (field! JulyReview thanks in advance I do not recommend converting infinity But I think that you need something like this: = iif (field! Julquata value = 0, 0, (field! JulyReview.value / field! Julyquota.valella)) < / code>

android - LayoutInflater doesnt work -

I am building a building like a chat app, so when I go into my current view, the elements (user pictures and messages) I want to add. The problem is in the show's message ceremony, notchings happen, but there is no error. Here's my code: Chat Activity - & gt; ShowMessage: relative layout ri = new relative layout (chatactivity.es); rly.setLayoutParams (new layoutprim (layout perm. WRAP_CONTENT, layout para. WRAP_CONTENT)); LayoutInflator Inflar = Match-Layout Inflator (); ViewToAppend = see inflater.inflate (R. layout. Message, blank); rly.addView (viewToAppend); Messages XML: & lt; Android: layout_heid = "40 dp" Android: layout_linkpoint left = "true" android: layout_language = "true" android: src = "@ drauble / Feed "/> & Lt; Android: layout_height = "wrap_content" android: layout_centerVertical = "true" android: layout_marginLeft = "10dp" Android: layout_toRightOf = "@ + ID

java - gson serialization and deserialization of an ArrayList -

मेरी सेट अप की तरह है: सार्वजनिक enum AnimalType {CAT (1), कुत्ता (2); निजी फाइनल इंट वैल्यू; एनिमल टाईप (इंट वैल्यू) {this.value = value; } सार्वजनिक पूर्ण मूल्य () {वापसी मूल्य; }} सार्वजनिक वर्ग डॉग {पशु प्रकार प्रकार = AnimalType.DOG; स्ट्रिंग का नाम; int आईडी; // अन्य गुण बिंदु यह एक बिल्ली वस्तु से अलग है } सार्वजनिक वर्ग की बिल्ली {AnimalType type = AnimalType.CAT; स्ट्रिंग का नाम; स्ट्रिंग रिक; इंट उम्र; } सार्वजनिक श्रेणी प्रतिक्रिया {ArrayList & lt; ऑब्जेक्ट & gt; myResponseObject; } यहां एक उदाहरण दिया गया है कि कैसे एक प्रतिक्रिया वस्तु दिखाई दे सकती है: ArrayList & lt; Object & gt; arr = नया ArrayList & lt; Object & gt; (); कुत्ता कुत्ता = नया कुत्ता ("माइनोम", 0); बिल्ली बिल्ली = नया कैट ("माइनोम", "माइनिकनाम", - 1); Arr.add ("मेरे पास है"); arr.add (बिल्ली) arr.add ("और"); arr.add (कुत्ता) प्रतिक्रिया प्रतिक्रिया = नया प्रतिक्रिया (arr); और मैं इस तरह से धारावाहिक रहा हूँ: जीएसन

parallel processing - recursive function calls and queuing in python -

मेरे पास मेरे कोड का स्केच निम्नानुसार है: def func1 (c): (ए, बी) func2 (ए, एक्स) func2 (बी, एक्स) रिटर्न xx = [] वाई = Func2 (c, x) समस्या, जैसा कि आप कोड से पता लगा सकते हैं, यह है कि मुझे func2 (b) की गणना करना होगा func2 (a) के साथ समानांतर a से a को a < > func2 (क) । लेकिन मेरे एल्गोरिथ्म के अनुसार, यह स्पष्ट रूप से नए बी की वजह से नहीं हो सकता है। मुझे लगता है कि ऐसी समस्या समानांतर कंप्यूटिंग दृष्टिकोण के लिए बिल्कुल सही हो सकती है। लेकिन, मैंने इसे पहले प्रयोग नहीं किया था और इसके बारे में मेरा ज्ञान काफी सीमित था। मैंने सुझाव की कोशिश की, हालांकि, लेकिन मुझे ऊपर दिए गए स्केच जैसा ही परिणाम मिला। चेतावनी: थ्रेडिंग आपके लिए समानांतर नहीं हो सकता है ( ग्लोबल इंटरप्रेटर लॉक पर ध्यान दें ) है, इसलिए आपको इसके बजाय मल्टीप्रोसेसिंग लाइब्रेरी का उपयोग करना पड़ सकता है।)। ... तो मैंने धोखा दिया / किया- आलसी & amp; एक धागा / प्रक्रिया तटस्थ शब्द "नौकरी" का इस्तेमाल किया आपको "नौकरी" का उपयोग करने वाले हर जगह के लिए थ्रेडिंग या

javascript - jQuery SlideDown() is not waiting for delay on animation -

I use the jQuery function, which should animate the widget (slide down and up) like a dynamic menu or something. Problems I'm setting delay () - even when the mouse moves over it, it does not matter how long the cursor lives on a division, it is slow and up Will go. To clarify if I put a mouse on some device, it works well, it waits for a delay and then slides it. But if I go faster in the example of all divs, then it will give a weird feedback, as the divisions start to slide down, but then suddenly it stops and can go up. Try my bella and you will see. This is jQuery ("Subdiv") to hide (); ("Mydiv"). Hover (function () (.find (". Subdiv"). Stop (). Delay (800) .slideDown ("slow");}, function () {jQuery (this) .find (". subdiv "). stop (). delay (200) .slideUp (" slow ");}); then something like this: Hide the jQuery ("subdiv."). JQuery (".mydiv"). Hover (function () (jQuery (&qu

How to abort JavaScript async functions? -

For example, you have a web music player app when a user clicks the play button, then a fire Is looking for MP3 data, installation of player etc., but then the user changes his mind and clicks on another track, is there any way to completely cancel the previous function? I know that you can end XHRequests, but I mean that the entire function might be JS promise? A synchronous function in JavaScript will run to complete. It will not be interrupted by any other user action. Therefore, if any function in your scenario sets fire to the player and the player is set, then that function will be run to complete before proceeding to the next user event. Therefore, you can not stop a synchronization function in Javascript and there will be no way anyway (except the web audience that we are not discussing here), javascript is a single thread, until the function is turned on , Will run it to complete and no other user event will be processed. If, however, that function contains some kin

JSP Forwarding in Mobile dosn't work -

I have created an application in two versions for personal and mobile browsers. Simply, the customer login at page login.jsp was registered in the authorization servlet.jsp . If the authorization was correct, then the customer was running on page dane.jsp, otherwise he was going to page login. Unfortunately, forwarding in the first and second versions did not work in 100%. After the good authorization, the customer sees the contents of the page dane.jsp but he still has the page changed to the auto.jsp. For personal browsers, I changed the method from request.getRequestDispatcher ("dane.jsp"). Forward (request, response); to response.sendRedirect ("dane.jsp"); and it worked, but I have no idea for the mobile version. Will SB save me? You can check user-agent type and if the gypsum page is served on the server before. Yes ... can loop and redirect. Plus check it for more info.

Admob interstitials not clickable on Nexus 5 (Android 4.4.2) -

Image
Do you know about a problem due to Admob not being able to click on interstitial ads and therefore on Nexus 5 devices Have not brought any revenue? Fact: It does not have intermediate ads - some clickable, but mostly no . It comes with the old standalone Google Admob SDK and with the new Google Play Services SDK. It is on Nexus 5 with Android 4.4.2 , but it is possible that other devices are also affected. This happens in many programs in the Google Play Store - I'm not only with my application. For example, you can not Galaxy Nexus (Nexus 3), Galaxy S, on the HTC One. Below is a screenshot that opens the small info button in the clickable below the ad and OK, the Close X button also looks working properly , Though clicking on the ad does not happen - like it does not exist or something on it. Do you know of any solutions or possible solutions to the problem? Thanks! --- Update - - This activity declaration is: & amp; Activity Activity:

asp.net mvc 4 - MVC4 - Controller Scaffolding, Custom Data context class issue: Unable to retrieve metadata -

When I try to make a controller from the scaffold, I get the following error: Unable to retrieve, Metadata specified schema for 'turkeyup.models.admin.catcousview model' is not valid Errors: mapping of CLR type EDM is unclear because many CLR types match EDM type 'coursework'. Here is the code for model: Using the system ComponentModel.DataAnnotations; Using System.Web.Mvc; Namesphere TorkUp.Models.Admin {Public Classroom CreateCourseViewModel {[HiddenInput (DisplayValue = false)] Public Ent ID {get; Set; } [Required] public string title {get; Set; }}} Custom Data Reference Class: using System.Data.Entity; Using System.Linq; Using TorkUp.ClassLibrary; Using TorkUp.ClassLibrary.Admin; Using TorkUp.ClassLibrary.User; Nameshot TorkUp Infrastructure {University of Public Sector DB: DBCTTENT, IUniversityDataSource {Public University DB (): Base ("Default Concession") // Admin Data Public DBAet & Lt; Curriculum & gt; Course {Get; Set; } Publ

jquery - Filter element stored in variable by class -

I have elements stored in a variable (var body). Take the form of these elements: & lt; p class = 'txt' & gt; & Lt; / P & gt; Or & lt; p class = 'img' & gt; & Lt; / P & gt; I will have to pass like a 'body' in a function and only return that element if its class is 'IMG'. If I correctly understand: $ (body ) .hasClass ('img'); Or maybe: $ (body) .filter ('. Img');

android - Change color of button -

How do I change the color of a button using XML files? I tried to use android: background = "@ android: color / black" but it works only for black and white as much as I can tell. Can someone explain this to me. Why not android: background = "@ android: color / blue" ? You can do this with a selector file like this: & lt; item android: state_pressed = "true" & gt; & Lt; Size & gt; & Lt; Shield Android: startColor = "@ android: Color / Yellow" Android: endColor = "@ Android: Color / Yellow" Android: Angle = "270" /> & Lt; Stroke Android: width = "3dp" Android: Color = "@Android: Color / Gray" /> & Lt; Corners Android: Radius = "3dp" /> & Lt; padding android: left = "10dp" Android: top = "10dp" Android: right = "10dp" Android: bottom = "10dp" /> & Lt; / Size & gt; & Lt; / Item & gt; &am

functional programming - Scala expression evaluation -

I'm amazed with the following Scala compiler behavior when I declare the type unit function, but still the body has a function Provides an evaluation for an int, Scala compiler is fine with it. Def add (x: int, y: int) = x + y def main (arguments: array [string]): unit = {add (args (0) .toInt, args ( 0) .toInt)} The same is not true with other types, such as def afunc: string = {1} // type mismatch ; Found: int (1) requirement: string with this if I def afunc: unit = {1} or DIF main (args: array [string]): unit = {2 + 2} // which is the first addition above In both cases I get the following warning: A pure expression does nothing in the state of the statement; You may have to leave the required brackets There are 2 questions in one sense. What is the difference between the difference of a function that evaluates int and expression 2 + 2? Then why does the compiler not complain on the Earth that there is a function for evaluation of the unit which eval

How to execute a procedure from time to time in delphi? -

मैं अपना प्रोग्राम ShowMessage ('Hello world!') चाहता हूं; हर एक मिनट, मैं यह कैसे कर सकता हूँ? सब से पहले मैं MessageDlg () फ़ंक्शन के साथ ShowMessage () को बदलता हूं। MessageDlg () के साथ आप पढ़ सकते हैं कि संवाद विंडो बंद हो गई थी और एक ही समय में कई संवाद बक्से दिखाने से आवेदन ब्लॉक किया गया था। कोड को समय-समय पर निष्पादित करने के लिए TTimer घटक का उपयोग करें। 60'000 मिलीसेकेंड के लिए अंतराल सेट करना हर मिनट कोड निष्पादित करेगा। प्रक्रिया TForm1.FormCreate (प्रेषक: टूबैक्साइड); टाइमर शुरू करें। अंतराल: = 60000; समाप्त; TTimer घटक के ऑन-टिमर इवेंट हैंडलर में MessageDlg () कोड जोड़ें। डायलॉग बॉक्स बंद करने के बाद TTimer exectution बंद करें और डायलॉग बॉक्स बंद होने के बाद वापस लें। प्रक्रिया TForm1.Timer1Timer (प्रेषक: टूबैक्ट); शुरू टाइमर 1। सक्षम: = गलत; अगर MessageDlg ('test', mtConfirmation, [mbOK], 0) & lt; & gt; 0 तब टाइमर 1। सक्षम: = सत्य; समाप्त;

Replacing a key value in python -

I have a dictionary that looks like something my_dictionary = {("Today I have been trying to make it so that the user would like to change the value P> value = my_dictionary [item_1, item_2} I tried to use it def new ( ): Global choice global change option = input ("Would you like to change one value?") If preferred == "yes": change = input ("which Conditions? ") If my_dictionary: value = float (Input (" Enter value ":)) my_dictionary [change] = value else: print (" word does not exist. ") < P> But this does not work, it takes me directly to the word 'does not exist'. I have never coded anything that is replaced by a dictionary, by adding, if someone has any ideas then I would be very much appreciative. Thank you. So it goes: Would you like to change a value? Yes, what are the conditions? Today it is today, the period does not exist. It happens with and without commas, even if I just type o

c# - How can I get a certificate for a smart device application in windows mobile? -

Does anyone know how to get a certificate for the Windows Mobile application? I am using a test certificate to install my application on a Windows Mobile device, but I also want to publish my app, so I do not know how to get the certificate because M2M program (Which is an application certification program). Any ideas or suggestions do not exist anymore? I think you can call Verisign and buy PFX. But, if you are signing yourself on a certificate, you can make yourself yourself. Then, such a post-build phase for your project Install: "$ (SolutionDir) installer \ signtool.EXE" sign / f "$ (SolutionDir) certificate \ my_company.pfx" / t http://timestamp.verisign.com /scripts/timstamp.dll "$ (ProjectDir) obj \ $ (ConfigurationName) \ *. Exe" "$ (SolutionDir) installer \ cabwiz exe" "$ (SolutionDir) installer \ my_company. $ (ConfigurationName) .INF" / prexml "$ (SolutionDir) certificate \ my_company.prexml.xml"

Will Flurry for Android balance start/end Session calls? -

प्रत्येक गतिविधि कॉल के लिए onSessionStart (context, apikey); और onSessionEnd (संदर्भ); और गतिविधियों के दौरान एक सत्र का ट्रैक रखने के लिए यह ठीक है यहां तक ​​कि टुकड़े भी ऐसा कर सकते हैं, लेकिन जब कोई सेवा शामिल होती है (और आप मानते हैं कि सेवा समाप्त हो रही है, तो सत्र समाप्त नहीं हो रहा है), तो निम्न परिदृश्य में क्या होगा: गतिविधि ऑनस्टार्ट () - & gt; चक्कर शुरू (गतिविधि संदर्भ) सेवा चालू करें - & gt; सेवा। कुछ आकलन हो रहा है () - & gt; चक्कर शुरू (सेवा प्रसंग) गतिविधि () -> & gt; चंचल रोक (गतिविधि संदर्भ) सेवा अभी भी चल रहा है - & gt; कॉल सेवा। कुछ अन्य एक्शन () - & gt; चक्कर शुरू (सेवा प्रसंग) सेवा समाप्त - & gt; बहस रोक (सेवा संदर्भ)। तो शेष राशि (कोई आदेश नहीं): गतिविधि प्रारंभ। गतिविधि अंत। यह ठीक है। सेवा आरंभ। सेवा समाप्ति। अब, क्या आपको कॉल को संतुलित करने के लिए चौथे समय समाप्ति को कॉल करने की आवश्यकता है? (याद रखें कि संदर्भ एक ही था, सेवा को दो बार शुरू किया गया था, लेकिन यह एक बार अंत में बुला रहा