Search Results

Search found 73 results on 3 pages for 'occurences'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Visual Studio C++ list iterator not decementable

    - by user69514
    I keep getting an error on visual studio that says list iterator not decrementable: line 256 My program works fine on Linux, but visual studio compiler throws this error. Dammit this is why I hate windows. Why can't the world run on Linux? Anyway, do you see what my problem is? #include <iostream> #include <fstream> #include <sstream> #include <list> using namespace std; int main(){ /** create the list **/ list<int> l; /** create input stream to read file **/ ifstream inputstream("numbers.txt"); /** read the numbers and add them to list **/ if( inputstream.is_open() ){ string line; istringstream instream; while( getline(inputstream, line) ){ instream.clear(); instream.str(line); /** get he five int's **/ int one, two, three, four, five; instream >> one >> two >> three >> four >> five; /** add them to the list **/ l.push_back(one); l.push_back(two); l.push_back(three); l.push_back(four); l.push_back(five); }//end while loop }//end if /** close the stream **/ inputstream.close(); /** display the list **/ cout << "List Read:" << endl; list<int>::iterator i; for( i=l.begin(); i != l.end(); ++i){ cout << *i << " "; } cout << endl << endl; /** now sort the list **/ l.sort(); /** display the list **/ cout << "Sorted List (head to tail):" << endl; for( i=l.begin(); i != l.end(); ++i){ cout << *i << " "; } cout << endl; list<int> lReversed; for(i=l.begin(); i != l.end(); ++i){ lReversed.push_front(*i); } cout << "Sorted List (tail to head):" << endl; for(i=lReversed.begin(); i!=lReversed.end(); ++i){ cout << *i << " "; } cout << endl << endl; /** remove first biggest element and display **/ l.pop_back(); cout << "List after removing first biggest element:" << endl; cout << "Sorted List (head to tail):" << endl; for( i=l.begin(); i != l.end(); ++i){ cout << *i << " "; } cout << endl; cout << "Sorted List (tail to head):" << endl; lReversed.pop_front(); for(i=lReversed.begin(); i!=lReversed.end(); ++i){ cout << *i << " "; } cout << endl << endl; /** remove second biggest element and display **/ l.pop_back(); cout << "List after removing second biggest element:" << endl; cout << "Sorted List (head to tail):" << endl; for( i=l.begin(); i != l.end(); ++i){ cout << *i << " "; } cout << endl; lReversed.pop_front(); cout << "Sorted List (tail to head):" << endl; for(i=lReversed.begin(); i!=lReversed.end(); ++i){ cout << *i << " "; } cout << endl << endl; /** remove third biggest element and display **/ l.pop_back(); cout << "List after removing third biggest element:" << endl; cout << "Sorted List (head to tail):" << endl; for( i=l.begin(); i != l.end(); ++i){ cout << *i << " "; } cout << endl; cout << "Sorted List (tail to head):" << endl; lReversed.pop_front(); for(i=lReversed.begin(); i!=lReversed.end(); ++i){ cout << *i << " "; } cout << endl << endl; /** create frequency table **/ const int biggest = 1000; //create array size of biggest element int arr[biggest]; //set everything to zero for(int j=0; j<biggest+1; j++){ arr[j] = 0; } //now update number of occurences for( i=l.begin(); i != l.end(); i++){ arr[*i]++; } //now print the frequency table. only print where occurences greater than zero cout << "Final list frequency table: " << endl; for(int j=0; j<biggest+1; j++){ if( arr[j] > 0 ){ cout << j << ": " << arr[j] << " occurences" << endl; } } return 0; }//end main

    Read the article

  • Count subset of binary pattern ..

    - by mr.bio
    Hi there . I have a A=set of strings and a B=seperate string. I want to count the number of occurences in from B in A. Example : A: 10001 10011 11000 10010 10101 B: 10001 result would be 3.(10001 is a subset of 10001,10011,10101) So i need a function that takes a set and string and returns an int. int myfunc(set<string> , string){ int result; // My Brain is melting return result ; }

    Read the article

  • You do not have sufficient permissions to access this page.

    - by WmasterJ
    I recently set up a local copy of Wordpress, added some content and created a child theme. Then I moved it to my webserver, changed the config file, changed the "localhost" occurences in my SQL file to my online URL. I also changed my database prefix from what I had locally on all tables and in the config file. Everything works well on the outside. But then as I log-in is get the: You do not have sufficient permissions to access this page.

    Read the article

  • Counting the instances of customers

    - by Mikae Combarado
    Say that I have a table with one column named CustomerId. The example of the instance of this table is : CustomerId 14 12 11 204 14 204 I want to write a query that counts the number of occurences of customer IDs. At the end, I would like to have a result like this : CustomerId NumberOfOccurences 14 2 12 1 11 1 204 2 14 1 I cannot think of a way to do this.

    Read the article

  • When your field-terminating char appears within field values

    - by Jonathan Sampson
    I've had a very colorful morning learning the innerparts of Linux's sort command, and have come across yet another issue that I can't seem to find an answer for in the documentation. I'm currently using -t, to indicate that my fields are split by the comma character, but I'm finding that in some of my files, the comma is used (between double-quotes) within values: Jonathan Sampson,,[email protected],0987654321 "Foobar CEO,","CEO,",[email protected],, How can I use a comma to terminate my fields, but ignore the occurences of it within values? Is this fairly simple, or do I need to re-export all of my data using a more-foreign field-terminator?

    Read the article

  • OpenLDAP server logs filled with "TLS negotiation failure"

    - by WildVelociraptor
    I recently migrated an old OpenLDAP setup to a newer server, with a more robust certificate setup. Currently, most hosts are required to verify the cert matches the host: tls_checkpeer yes TLS_REQCERT always In the server logs, there are multiple occurences of: Nov 6 10:45:08 <servername> slapd[1773]: conn=2785646 fd=35 closed (TLS negotiation failure) These errors appear from multiple hosts, but there don't seem to be any issues actually logging into those servers with an LDAP account. Does anyone know what would cause these errors? The server is running Ubuntu 12.04.2, and OpenLDAP version 2.4.28. The cert was generated using GnuTLS.

    Read the article

  • OOM-Killer called every now and then..

    - by SpyrosP
    Hello there, i have a dedicated server where i've installed apache2, as well as Rails Passenger. Although i have 2GBs of RAM and most times about 1,5GB is free, there are some random times when i lose ssh and generic connectivity because oom-killer is killing processes. I suppose there is a memory leak but i cannot find out where it comes from. oom-killer kills apache2, mysql, passenger, whatever. Yesterday, i did a "cat syslog | grep -c oom-killer" and got 57 occurences ! It seems that something seriously destroys the memory. Once i reboot, everything comes back to normal. I suspect that it can be related to Passenger, but i'm still trying to figure it out. Can you think of anything else, or do you have anything to suggest that will make the leak identification procedure easier ? (i was even thinking of writing a bash script, to be run with cron for like every 5 minutes).

    Read the article

  • have list of emails to be deleted from sheet A col D [on hold]

    - by Peta
    Thank you for your comments guys & now that CharlieRB has suggested "Match entire cell contents" I'll give it a better go. No I do not expect people to do my work for me & I'm sorry if it came over that way - just didn't know where to start. Would love some help please, I've limited VBA & function knowledge & I'm not sure where to start. If someone can point me in the right direction it would be appreciated. I have a list of email addresses on sheet "B" col A (but I could put them on sheet A if it would make it easier / faster) that I want deleted from sheet "A" col D (may be 2 or more occurences of the same email). I can't just record a find & delete macro and edit because for example [email protected] will also pick up [email protected] which I may not want deleted. thanks very much Peta

    Read the article

  • clear contents from matched column of data in another sheet

    - by Peta
    I have a column of email addresses on sheet 2 col A (but I could put them on sheet 1 if it would make it easier / faster) that I want to remove from sheet 1 col D if matched (there may be 2 or more occurences of the same email to be removed/cleared). (1000s of rows in each sheet). After all day searching forums I’m getting more confused & can't find what I'm looking for. Not sure whether to use .match or .find & .ClearContents & the syntax for iterating through. Thanks very much in anticipation Peta

    Read the article

  • Is Oracle certified to run on VMWare?

    - by Mike Dietrich
    This question in similar occurences gets asked during every Upgrade Workshop at least once. People would like to know if they can run an Oracle Database or Oracle Real Application Clusters or Oracle Grid Control or Oracle Fusion Middleware or ... in an VM environment with VMWare's virtualisation products. And the answer is: Yes, you can!! But ... there's a fine print you should take care on before setting up virtual environments with a different solution than XEN based Oracle VM. Please read Note:942852.1 - VMWare Certification for Oracle Products and Note:249212.1 - Support Position for Oracle Products Running on VMWare Virtualized Environments for further details: Support Status for VMware Virtualized Environments Oracle has not certified any of its products on VMware virtualized environments. Oracle Support will assist customers running Oracle products on VMware in the following manner: Oracle will only provide support for issues that either are known to occur on the native OS, or can be demonstrated not to be as a result of running on VMware. If a problem is a known Oracle issue, Oracle support will recommend the appropriate solution on the native OS. If that solution does not work in the VMware virtualized environment, the customer will be referred to VMware for support. When the customer can demonstrate that the Oracle solution does not work when running on the native OS, Oracle will resume support, including logging a bug with Oracle Development for investigation if required. If the problem is determined not to be a known Oracle issue, we will refer the customer to VMware for support. When the customer can demonstrate that the issue occurs when running on the native OS, Oracle will resume support, including logging a bug with Oracle Development for investigation if required. NOTE: Oracle has not certified any of its products on VMware. For Oracle RAC, Oracle will only accept Service Requests as described in this note on Oracle RAC 11.2.0.2 and later releases.

    Read the article

  • What are the common techniques to handle user-generated HTML modified differently by different browsers?

    - by Jakie
    I am developing a website updater. The front end uses HTML, CSS and JavaScript, and the backend uses Python. The way it works is that <p/>, <b/> and some other HTML elements can be updated by the user. To enable this, I load the webpage and, with JQuery, convert all those elements to <textarea/> elements. Once they the content of the text area is changed, I apply the change to the original elements and send it to a Python script to store the new content. The problem is that I'm finding that different browsers change the original HTML. How do you get around this issue? What Python libraries do you use? What techniques or application designs do you use to avoid or overcome this issue? The problems I found are: IE removes the quotes around class and id attributes. For example, <img class='abc'/> becomes <img class=abc/>. Firefox removes the backslash from the line breaks: <br \> becomes <br>. Some websites have very specific display technicalities, so an insertion of a simple "\n"(which IE does) can affect the display of a website. Example: changing <img class='headingpic' /><div id="maincontent"> to <img class='headingpic'/>\n <div id="maincontent"> inserts a vertical gap in IE. The things I have unsuccessfully tried to overcome these issues: Using either JQuery or Python to remove all >\n< occurences, <br> etc. But this fails because I get different patterns in IE, sometimes a ·\n, sometimes a \n···. In a Python, parse the new HTML, extract the new text/content, insert it into the old HTML so the elements and format never change, just the content. This is very difficult and seems to be overkill.

    Read the article

  • Is it justified to use project-wide unique function and variable names to help future refactoring?

    - by kahoon
    Refactoring tools (like ReSharper) often can't be sure whether to rename a given identifier when, for example refactoring a JavaScript function. I guess this is a consequence of JavaScript's dynamic nature. ReSharper solves this problem by offering to rename reasonable lexical matches too. The developer can opt out of renaming certain functions, if he finds that the lexical match is purely accidental. This means that the developer has to approve every instance that will be affected by the renaming. For example let's consider we have two Backbone classes which are used completely independently from each other in our application: var Header = Backbone.View.extend({ close: function() {...} }) var Dialog = Backbone.View.extend({ close: function() {...} }) If you try to rename Dialog's close method to for example closeAndNotify, then ReSharper will offer to rename all occurences of Header's close method just because they are the same lexically prior to the renaming. To avoid this problem, please consider this: var Header = Backbone.View.extend({ closeHeader: function() {...} }) var Dialog = Backbone.View.extend({ closeDialog: function() {...} }) Now you can rename closeDialog unambiguously - given that you have no other classes having a method with the same name. Is it worth it to name my functions this way to help future refactoring?

    Read the article

  • MSSQL EXPRESS 2008 Stored Procedure execution time spikes periodically

    - by user156241
    I have a big stored procedure on a MSSQL 2008 Express SP2 database that gets run about every 200 ms. Normal execution time is about 50ms. What I am seeing is large inconsistencies in this run time. It will execute for while, say 50-100 times at 40-60ms which is expected, then seemingly at random the same stored procedure will take way longer, say 900ms or 1.5 seconds to run. Sometimes more than one call of the same procedure in a row will take longer too. It appears that something is causing sql server to slow down dramatically every minute or so, but I can't figure out what. There is no timing pattern between the occurences. I have the same setup on two different computers, one of which is a clean XP Pro load with no virus checking and nothing installed except SQL server. Also, The recovery options for all the databases are set to "Simple".

    Read the article

  • multiline perl search and replace (one-liner)

    - by yaya3
    I want to perform the following vim substitution as a one-liner in the terminal with perl. I would prefer to allow for any occurences of white space and/or new lines, rather than explicitly catering for them as I am below. %s/blockDontForget">\n*\s*<p><span><a\(.*\)<\/span>/blockDontForget"><p><a\1/g I've tried this: perl -pi -e 's/blockDontForget"><p><span><a(.*)<\/span>/blockDontForget"><p><a$1/msg' I presume I am misinterpreting the flags. Where am I going wrong? Thanks. EDIT: The above example is to strip the spans out of the following html: <div class="block blockDontForget"> <p><span><a href="../../../foo/bar/x/x.html">Lorem Ipsum</a></span></p> </div>

    Read the article

  • How to prevent Closure Compiler from renaming "true", "false" and "null"

    - by Armagan Amcalar
    Google Closure Compiler renames all "true", "false" and "null" occurences in code like; var s = true, x = null, V = false; and uses these shorthands instead; in conditions such as; if (someVariable == s) now; Google Analytics code defines it's own "s" variable; overriding the value "true"; and as you can see this causes a lot of problems. I don't want to change GA code; I just want Closure Compiler to quit renaming true etc. Externs do not work. Do you know any way to accomplish this?

    Read the article

  • Have different fallback language than the keys used in NSLocalizedString(@"Text aka. key",@"Descript

    - by Allisone
    I use everywhere NSLocalizedString(@"Text in deutsch",@"das Textfeld Text in deutsch") I have two Localizable.strings files. One for german and one for english. What I realized now is. If you have a german iPhone, you get the german text, if you have your iPhone set to english you get the english text. But if you have lets say french, then you would get the german text, too because I use german as the keys, right ? Is there a way to set english as fallback language instead of the german one used everywhere in my code ? (I have so many occurences of NSLocalizedString that it would be a pain to change the keys now everywhere (in code, in Localized.string.en and in Localized.string.de))

    Read the article

  • Longer Form Fields in Drupal

    - by Slinger Jansen
    I have a really silly problem that has cost me a load of time already. I have created a content template with a URL in there. When I look at the HTML code for it, I see a big fat "maxlength=256" in the form tag. I'd like to expand the length of this field, because my customer wishes to enter really long links (over 500 characters). Any idea how I can change it? When I do a generic search through the code I see so many occurences of 256, but the length might just as well be in the database somewhere. I have of course made the database field a longer varchar (1024 sounded poetic to me), so that's something I don't have to worry about. I think it's silly, but the customer's always right, as we know. I am using Drupal 6.14.

    Read the article

  • Why are the interpreters of all popular scripting languages written in C (if not in C at least not i

    - by wndsr
    I recently asked a question on switching from C++ to C for writing an interpreter for speed and I got a comment from someone asking why on earth I would switch to C for that. So I found out that I actually don't know why - except that C++ object oriented system has a much higher abstraction and therefore is slower. Why are the interpreters of all popular scripting languages written in C and not in C++? If you want to tell me about some other language where the interpreter for it isn't in C, please replace all occurences of popular scripting languages in this question with Ruby, Python, Perl and PHP.

    Read the article

  • SQL Server Express 2008 Stored Procedure execution time spikes periodically

    - by user156241
    I have a big stored procedure on a SQL Server 2008 Express SP2 database that gets run about every 200 ms. Normal execution time is about 50ms. What I am seeing is large inconsistencies in this run time. It will execute for while, say 50-100 times at 40-60ms which is expected, then seemingly at random the same stored procedure will take way longer, say 900ms or 1.5 seconds to run. Sometimes more than one call of the same procedure in a row will take longer too. It appears that something is causing sql server to slow down dramatically every minute or so, but I can't figure out what. There is no timing pattern between the occurences. I have the same setup on two different computers, one of which is a clean XP Pro load with no virus checking and nothing installed except SQL server. Also, The recovery options for all the databases are set to "Simple".

    Read the article

  • Use LINQ to count the number of combinations existing in two lists

    - by Ben McCormack
    I'm trying to create a LINQ query (or queries) that count the total number of occurences of a combinations of items in one list that exist in a different list. For example, take the following lists: CartItems DiscountItems ========= ============= AAA AAA AAA BBB AAA BBB BBB CCC CCC DDD The result of the query operation should be 2 since I can find two combinations of AAA and BBB (from DiscountItems) within the contents of CartItems. My thinking in approaching the query is to join the lists together to shorten CartItems to only include items from DiscountItems. The solution would be to find the CartItem in the resulting query that occurs the least amount of times, thus indicating how many combinations of items exist in CartItems. How can this be done? Here's the query I already have, but it's not working. query results in an enumeration with 100 items, far more than I expected. Dim query = From cartItem In Cart.CartItems Group Join discountItem In DiscountGroup.DiscountItems On cartItem.SKU Equals discountItem.SKU Into Group Select SKU = cartItem.SKU, CartItems = Group Return query.Min(Function(x) x.CartItems.Sum(Function(y) y.Quantity))

    Read the article

  • PHP Regex Question

    - by oyerli
    Hi, I am developing an application using PHP but I am new to regular expressions, I could not find a solution to my problem. I want to replace all occurences of #word with a link, i have written a preg_match for this: $text=preg_replace('~#([\p{L}|\p{N}]+)~u', '<a href="/?aranan=$1">#$1</a>', $text); The problem is, this regular expression also matches the html character codes like &#039; and gives corrupt output. I need to exclude the words starting with &# but i do not know how to do that using regular expressions. Thanks for your help.

    Read the article

  • Replace token in ANTLR

    - by user1019710
    I want to replace a token using ANTLR. I tried with TokenRewriteStream and replace, but it didn't work. Any suggestions? ANTLRStringStream in = new ANTLRStringStream(source); MyLexer lexer = new MyLexer(in); TokenRewriteStream tokens = new TokenRewriteStream(lexer); for(Object obj : tokens.getTokens()) { CommonToken token = (CommonToken)obj; tokens.replace(token, "replacement"); } The lexer finds all occurences of single-line comments, and i want to replace them in the original source too.

    Read the article

  • Qt and finding partial matches in a QList

    - by ExpatEgghead
    I have a struct viz: struct NameKey { std::string fullName; std::string probeName; std::string format; std::string source; } which are held in a QList: QList<NameKey> keyList; what I need to do is find an occurence in keyList of a partial match where the search is for a NameKey that only has two members filled. All the keyList entries are full NameKey's. My current implementation is , well, boring in the extreme with too many if's and conditions. So, If I have a DataKey with a fullName and a format I need to find all the occurences in keyList which match. Any useful Qt/boost things available?

    Read the article

  • How can I search for the dot character using the search command?

    - by lk
    I'm trying to use the Search command in Vim: :Rs/F/T/X R = range F = text to find T = text to replace with X = options But, when I want to search for the "." (dot character) I'm getting some problems. The task: Replace all occurences of " ." (space dot) for "" (greater-than) So, first I tried this: :%s/ ./>/g But this changed me all the " ." (space ANY-CHARACTER) to the "" character. Then I remembered that the dot character is a special one, so I tried this: :%s/ \./>/g But vim threw me an error: E486 Can't find pattern " \." And finally I tried this crazy thing: :%s/" ."/>/g and this :%s/" \."/>/g But I got the same result: E486 Can't find pattern... So, how can I search for the dot character using the search command? PS: Sorry for my poor Enlish.

    Read the article

< Previous Page | 1 2 3  | Next Page >