Search Results

Search found 21001 results on 841 pages for 'spelling check'.

Page 175/841 | < Previous Page | 171 172 173 174 175 176 177 178 179 180 181 182  | Next Page >

  • Is there a standard Cyclic Iterator in C++

    - by Hippicoder
    Based on the following question: Check if one string is a rotation of other string I was thinking of making a cyclic iterator type that takes a range, and would be able to solve the above problem like so: std::string s1 = "abc" ; std::string s2 = "bca" ; std::size_t n = 2; // number of cycles cyclic_iterator it(s2.begin(),s2.end(),n); cyclic_iterator end; if (std::search(it, end, s1.begin(),s1.end()) != end) { std::cout << "s1 is a rotation of s2" << std::endl; } My question, Is there already something like this available? I've check Boost and STL doesn't have one. I've got a simple hand-written one but would rather use an already made/tested implementation.

    Read the article

  • Design Pattern for Server Emulator

    - by adisembiring
    I wanna build server socket emulator, but I want implement some design pattern there. I will described my case study that I have simplified like these: My Server Socket will always listen client socket. While some request message come from the client socket, the server emulator will response the client through the socket. the response is response code. '00' will describe request message processed successfully, and another response code expect '00' will describe there are some error while processing the message request. IN the server there are some UI, this UI contain check response parameter such as. response code timeout interval While the server want to response the client message, the response code taken from input parameter response form UI check the timeout interval, it will create sleep thread and the interval taken from timeout interval input from UI. I have implement the function, but I create it in one class. I feel it so sucks. Can you suggest me what class / interface that I must create to refactor my code.

    Read the article

  • How to manage multiple versions of the same record

    - by Darvis Lombardo
    I am doing short-term contract work for a company that is trying to implement a check-in/check-out type of workflow for their database records. Here's how it should work... 1) A user creates a new entity within the application. There are about 20 related tables that will be populated in addition to the main entity table. 2) Once the entity is created the user will mark it as the master. 3) Another user can make changes to the master only by "checking out" the entity. Multiple users can checkout the entity at the same time. 4) Once the user has made all the necessary changes to the entity, they put it in a "needs approval" status. 5) After an authorized user reviews the entity, they can promote it to master which will put the original record in a tombstoned status. The way they are currently accomplishing the "check out" is by duplicating the entity records in all the tables. The primary keys include EntityID + EntityDate, so they duplicate the entity records in all related tables with the same EntityID and an updated EntityDate and give it a status of "checked out". When the record is put into the next state (needs approval), the duplication occurs again. Eventually it will be promoted to master at which time the final record is marked as master and the original master is marked as dead. This design seems hideous to me, but I understand why they've done it. When someone looks up an entity from within the application, they need to see all current versions of that entity. This was a very straightforward way for making that happen. But the fact that they are representing the same entity multiple times within the same table(s) doesn't sit well with me, nor does the fact that they are duplicating EVERY piece of data rather than only storing deltas. I would be interested in hearing your reaction to the design, whether positive or negative. I would also be grateful for any resoures you can point me to that might be useful for seeing how someone else has implemented such a mechanism. Thanks! Darvis

    Read the article

  • Using install_name_tool what's going wrong?

    - by 0x80
    I'm trying to change the install path of a dylib after it has been build. I use "otool -L" to check what the current path is. And then I do: $ install_name_tool -change /my/current/path/libmine.dylib /my/new/path/libmine.dylib libmine.dylib I don't get an error, but nothing changes. If I check the path again the old one is still there. Also the new path is a lot shorter then the old one, so no problem there, and I think the lib is even compiled with extra flag for more filepath space. Any ideas?

    Read the article

  • Load page, wait, log any JavaScript errors to file?

    - by David
    I would like to check a large number of HTML files with inline JavaScript for JavaScript errors. What I'm envisioning doing is this: Script a browser to load a given page, wait a few seconds, and finally check the browser logs. I'm unsure though both on how to script a browser to load a given page and on how to access the JavaScript error log. I think the type of errors I'm worried about should show up in any modern browser so I would just go with whatever makes it most convenient. I'd be working either under Mac OS X or Linux. Anybody already tackle a similar problem? I've thought a bit about hacking something together based on a unit testing framework -- generate a trivial (assertTrue(true)) test for each page and rely on the errors making it fail -- but I'm hoping for something more elegant. Thank you.

    Read the article

  • Changes to the User Permissions Not saving

    - by anru
    I am use drupal 6. it seems like permission page can not save too many settings. I have try to save permission setting, but it is just not saved into DB. I have found out this is due to "too many fields". (use content permission module). if i uncheck some fields, and then checking lesser fields, permission will be saved. for example, if I am unchecking 2 check boxes, then checking one check box, permission will be saved. does any one know which function the permission page used to insert result into db? my php memory limit is 256M.

    Read the article

  • Can't get message body of certain emails from inbox using the Zend framework?

    - by Ali
    Hi guys I'm trying to read through an email inbox for my application - I'm using the zend framework here. The problem is that I'm unable to retrieve the message body for certain emails. The following is my code as to how I'm doing this: $mail = new Zend_Mail_Storage_Imap($mail_options); $all_messages = array(); $page = isset($_GET['page'])?$_GET['page']:1; $limit = isset($_GET['limit'])?$_GET['limit']:20; $offset = (($page-1)*$limit)+1; $end = ($page*$limit)>$c?$c:($page*$limit); for ($i=$offset;$i<=$end;$i++){ $h2t = new html2text(); $h2t->set_allowed_tags('<a>'); if(!$mail[$i]) break; else{ $one_message = $mail->getMessage($i); $one_message->id = $i; $one_message->UID = $mail->getUniqueId($i); $one_message->parts = array(); $one_message->body = ''; $count = 1; foreach (new RecursiveIteratorIterator($mail->getMessage($i)) as $ii=>$part) { try { $tpart = $part; //$tpart->_content = ''; $one_message->parts[$count] = $tpart; $count++; // check for html body if (strtok($part->contentType, ';') == 'text/html') { $b = $part->getContent(); if($part->contentTransferEncoding == 'quoted-printable') $b = quoted_printable_decode($b); $one_message->html_body = $b; $h2t->set_html($b); $one_message->body = $h2t->get_text(); } //check for text body if (strtok($part->contentType, ';') == 'text/plain') { $b = $part->getContent(); if($part->contentTransferEncoding == 'quoted-printable') $b = quoted_printable_decode($b); $one_message->text_body = $b; $one_message->body = $b;//$part->getContent(); } } catch (Zend_Mail_Exception $e) { // ignore } } $all_messages[] = $one_message; } } The problem is that randomly some messages don't return even a textbody or an html body. Even though if I check using a webvmail client those emails have a message body as well. WHat am I missing here?

    Read the article

  • How to force HtmlUnit to save page?

    - by booroondook
    Hello. I'm using HtmlUnit to click on a HtmlElement that triggers Javascript action: currentPage = ((HtmlElement) currentPage.getByXPath("//*[contains(@onclick, 'check();')]").get(0)).click(); The element is: <a href="#" onclick="check(); return false;"> The page returned is quite similar to the page, containing that element: same URL, mostly same HTML, but there are some minor differences in the HTML and HtmlUnit doesn't save the new page. I'm using HttpAnalyzer to sniff the traffic and I see that the Webclient correctly handles JS and send the right request. The response is also correct, but when I dump the contents of the currentPage to a file, I see that the actual page didn't change. How can I fix it?

    Read the article

  • Git branch strategy for small dev team

    - by Bilal Aslam
    We have a web app that we update and release almost daily. We use git as our VCS, and our current branching strategy is very simple and broken: we have a master branch and we check changes that we 'feel good about' into it. This works, but only until we check in a breaking change. Does anyone have a favorite git branch strategy for small teams which meets the following requirements: Works well for teams of 2 to 3 developers Lightweight, and not too much process Allows devs to isolate work on bug fixes and larger features with ease Allows us to keep a stable branch (for those 'oh crap' moments when we have to get our production servers working) Ideally, I'd love to see your step-by-step process for a dev working on a new bug

    Read the article

  • Nested ng repeat not working

    - by Rodrigo Fonseca
    Ok, i've two ng-repeat working here, the first(board in boards) is working good, no problem, but the second(task in tasks), when i try to get "{{task.title}}" i don't get anything but i can display all the style from it... here is my model: $scope.tasks = [{boardIndex: 0, title: "test"}, {boardIndex: 1, title: "test2"}]; Here is my code(it's in jade, ok?) section(data-ng-repeat="board in boards", ng-cloak) .board_header div(data-ng-controller="AddTaskBtnController") i.add_task_btn.fa.fa-plus-square-o.fa-2x(ng-click='setSelected(board.id)', ng-class="{icon_add_hover: isSelected(board.id)}") h2(data-ng-bind="board.title") .content_board .task(data-ng-repeat="task in tasks", data-ng-if="task.boardIndex == board.id", data-ng-controller='TaskController', data-ng-hide='modeTask', data-ng-init='setTaskId()') .user_icon_task i.fa.fa-user.fa-3x.icon-user-not-selected .quest_task .puzzle_task(data-ng-hide='modeTask') i.fa.fa-check-circle-o.fa-lg h2 {{task.title}} ul.icons_details_task_wrapper li i.fa.fa-check-circle-o span.icon_counter li.pull_left i.fa.fa-puzzle-piece span.icon_counter ul.task_details_wrapper li.task_priority(data-ng-show='goal.selectedDrawAttention', data-ng-click='toggleSelected()', data-ng-class='{draw_attention_selected: goal.selectedDrawAttention }', style='cursor: inherit;') i.fa.fa-eye li.task_priority i.fa .task_time_ago span(am-time-ago='message.time')

    Read the article

  • Large number of UPDATE queries slowing down page

    - by Bryan Lewis
    I am reading and validating large fixed-width text files (range from 10-50K lines) that are submitted via our ASP.net website (coded in VB.Net). I do an initial scan of the file to check for basic issues (line length, etc). Then I import each row into a MS SQL table. Each DB rows basically consists of a record_ID (Primary, auto-incrementing) and about 50 varchar fields. After the insert is done, I run a validation function on the file that checks each field in each row based on a bunch of criteria (trimmed length, isnumeric, range checks, etc). If it finds an error in any field, it inserts a record into the Errors table, which has an error_ID, the record_ID and an error message. In addition, if the field fails in a particular way, I have to do a "reset" on that field. A reset might consist of blanking the entire field, or simply replacing the value with another value (e.g. replacing the string with a new one that has all illegals chars taken out). I have a 5,000 line test file. The upload, initial check, and import takes about 5-6 seconds. The detailed error check and insert into the Errors table takes about 5-8 seconds (this file has about 1200 errors in it). However, the "resets" part takes about 40-45 seconds for 750 fields that need to be reset. When I comment out the resets function (returning immediately without actually calling the UPDATE stored proc), the process is very fast. With the resets turned on, the pages take 50 seconds to return. My UPDATE stored proc is using some recommended code from http://sommarskog.se/dynamic_sql.html, whereby it uses CASE instead of dynamic SQL: UPDATE dbo.Records SET dbo.Records.file_ID = CASE @field_name WHEN 'file_ID' THEN @field_value ELSE file_ID END, . . (all 50 varchar field CASE statements here) . WHERE dbo.Records.record_ID = @record_ID Is there any way I can help my performance here. Can I somehow group all of these UPDATE calls into a single transaction? Should I be reworking the UPDATE query somehow? Or is it just sheer quantity of 750+ UPDATEs and things are just slow (it's a quad proc server with 8GB ram). Any suggestions appreciated.

    Read the article

  • Is it better to comment out unneeded code or delete it?

    - by Matt Connolly
    For web applications under maintenance, assuming you have source control, when you need to remove part of the UI and the associated code, do you delete the code and check in, or do you comment out the old code? Arguments in favor of deleting: cleaner code, can still see deleted code in source control history, no worrying about refactoring code that might be uncommented some day. Arguments in favor of commenting: sometimes you need to add the feature back in and the developer adding it back in may not know to check source control history, sometimes the code represents unique functionality that can be a handy reference, seeing it all in one place can help provide clues to deciphering the active code.

    Read the article

  • How to set initial checked values of rich tree leaf node.

    - by Ajay99
    Hi, How to set the initial the leaf node values. -----------------------Stations.xml AAAAAAAAAAAA BBBBBBBBBBBB CCCCCCCCCC DDDDDDDDDDDD EEEEEEEEEEEEEE Hall Oates - Kiss On My List David Bowie - Let's Dance Lyn Collins - Think (About It) Kim Carnes - Bette Davis Eyes KC the Sunshine Band - Give It Up //inital check values --------------------Libray.java---------------- public class Library { private TreeNode treeData; private List menus=null; public Library()throws Exception { menus=new ArrayList(); //it's initial selection of the check box vardata.attributes.selection("---key1---); vardata.attributes.selection("---key2---); vardata.attributes.selection("---keyn---); yoursuggestedcode.attribute.selection("key"); //I need your suggestion code. FacesContext context = FacesContext.getCurrentInstance(); treeData = XmlTreeDataBuilder.build(new InputSource(getClass().getResourceAsStream("/Stations.xml"))); } public TreeNode getTreeData() { return treeData; } public void setTreeData(TreeNode treeData) { this.treeData = treeData; } public List getMenus() { return menus; } public void setMenus(List menus) { this.menus = menus; }

    Read the article

  • Python list as *args?

    - by Cap
    I have two Python functions, both of which take variable arguments in their function definitions. To give a simple example: def func1(*args): for arg in args: print arg def func2(*args): return [2 * arg for arg in args] I'd like to compose them -- as in func1(func2(3, 4, 5)) -- but I don't want args in func1 to be ([6, 7, 8],), I want it to be (6, 7, 8), as if it was called as func1(6, 7, 8) rather than func1([6, 7, 8]). Normally, I would just use func1(*func2(3, 4, 5)) or have func1 check to see if args[0] was a list. Unfortunately, I can't use the first solution in this particular instance and to apply the second would require doing such a check in many places (there are a lot of functions in the role of func1). Does anybody have an idea how to do this? I imagine some sort of introspection could be used, but I could be wrong.

    Read the article

  • document.getElementByID - checking whether an element has been found or not

    - by be here now
    Hi, guys. Here's a sample code, that opens an internet explorer window, navigates to google, and gets some element on the page by its unique id: set ie = CreateObject("InternetExplorer.Application") ie.navigate("www.google.com") ie.visible = true while ie.readystate <> 4 wscript.sleep 100 WEnd set some_object = ie.document.getelementbyid("xjsc") MsgBox some_object.tagname, 0 This sample brings me a DIV popup, which satisfies me completely. But at the next step I'd like to check whether some id exists in the page, or not. Unfortunately, I can't just be, like, set some_object = ie.document.getelementbyid("some_non_existant_id") if some_object.tagname = "" then ... because it gives me the following error: ie.vbs(12, 1) Microsoft VBScript runtime error: Object required: 'some_object' So, what's the best practice to check whether an element has been found or not?

    Read the article

  • Why is crontab giving "No such file or directory" error when the file DOES exist?

    - by fettereddingoskidney
    I am getting the following three lines in an error message in /var/mail/username after the following job runs in crontab... 15 * * * * /Applications/MAMP/htdocs/iconimageryidx/includes/insertPropertyRESI.php Errors: /applications/mamp/htdocs/iconimageryidx/includes/insertpropertyRESI.php: line 1: ?php: No such file or directory /applications/mamp/htdocs/iconimageryidx/includes/insertpropertyRESI.php: line 3: syntax error near unexpected token `'initialize.php'' /applications/mamp/htdocs/iconimageryidx/includes/insertpropertyRESI.php: line 3: `require_once('initialize.php'); The PHP script I am trying to execute DOES in fact exist, and I have made absolutely sure the spelling is correct several times. I ran a crontab on another script before and it worked just fine...any ideas?? The 2nd & 3rd Errors are from line 3 in the following script (the one I am trying to run with the crontab): <?php require_once('initialize.php'); require_once('insertPropertyTypes.php'); $sDate; if(isset($_GET['startDate'])) { $sDate = $_GET['startDate']; } else { $sDate = ''; } $insertResi = new InsertPropertyTypes('Listing', $sDate, 'RESI'); ?> When I run my script insertPropertyRESI.php in the browser, it runs just fine???? Also, initialize.php and insertPropertyTypes.php are in the same directory as insertPropertyRESI.php I am using MAMP with PHP 5.3.5 thakns for the help :?

    Read the article

  • Server Emulator Design Pattern

    - by adisembiring
    I wanna build server socket emulator, but I want implement some design pattern there. I will described my case study that I have simplified like these: My Server Socket will always listen client socket. While some request message come from the client socket, the server emulator will response the client through the socket. the response is response code. '00' will describe request message processed successfully, and another response code expect '00' will describe there are some error while processing the message request. IN the server there are some UI, this UI contain check response parameter such as. response code timeout interval While the server want to response the client message, the response code taken from input parameter response form UI check the timeout interval, it will create sleep thread and the interval taken from timeout interval input from UI. I have implement the function, but I create it in one class. I feel it so sucks. Can you suggest me what class / interface that I must create to refactor my code.

    Read the article

  • determine if a restaurant is open now (like yelp does) using database, php, js

    - by vee
    i was wondering if anyone knows how yelp determines what restaurants are "open now"? i'm developing a similar application using html/javascript/php. i was going to have a column in my database for each day, with comma separated hours written in "2243" format (10:43 pm). so for example if a restaurant is open for lunch and dinner it might be "1100,1400,1700,2200". then i'd check (using js) if the current time falls in one of the ranges for the current day. i'd also like to be able to determine if a restaurant is "open tonight", "open late", etc. for those i guess i'd check whether the open range overlaps with certain ranges. is there a better way to do this? particularly, how to store the hours in the database and then determine if they overlap with a given set of hours. thanks.

    Read the article

  • sql insert query needed

    - by masfenix
    Hey guys, so I have two tables. They are pictured below. I have a master table "all_reports". And a user table "user list". The master table may have users that do not exist in the user list. I need to add them to the user list. The master table may have duplicates in them (check picture). The master list does not contain all the information that the user list requires (no manager, no HR status, no department.. again check picture).

    Read the article

  • jQuery UI, detect if options have been entered?

    - by Val
    does any one know how to check if the called ui (custom) has also options inputed or using the defaults? for example: $('#selector').myUI();//does not have options. $('#selector').myUI({option:'foo',{op:'bar'}});//ui has options. $('#selector').myUI('value');//ui has options. so if i was on: (function($) { $.widget("ui.myUI", { options = this.options; //check if options have been entered or the default values have been used? }) }); Hope that i am not 2 confusing :) thnks

    Read the article

  • Broken Python installation on CentOS 5.8

    - by Beckett
    I already searched for solution to my problem via Google and stackoverflow's search facility, but haven't found anything related specifically to it. Here's the problem: I needed python 2.7.3 on CentOS 5.8 machine which has only python 2.4.3 preinstalled. Also neither there's the suitable version in it's repositories nor I can upgrade installed version. That's why I decided to build python from source code. But I've made a mistake: instead of make altinstall I did make install thus changing default version of the current installation. It was before I found this article - How to install Python 2.7.3 on CentOS 6.2 . I guess 5.8 and 6.2 versions aren't different to the extent this article is inapplicable. After installation of new python version I installed pip, but once I tried to invoke it, I got "No module named pkg_resources" error. In order to solve this issue I installed setuptools from repository. But it had only led to another error: "Distribution Not Found". My final step was to follow the guide I posted the link to, but I was unable to perform last step: easy_install-2.7 virtualenv command threw "-bash: /usr/local/bin/easy_install-2.7: .: bad interpreter: Permission denied" error. Now when I try to invoke pip or pip-2.7 both commands raise the same error with different names of binaries after "-bash:". Is there any way to fix this problem, so I could install new python version (2.7.3) alongside with the preinstalled one (2.4.3) according to the guide? Any help will be appreciated. P.S.: yum is working fine, although it needs python to function, so I hope the damage I unknowingly caused isn't very severe. Also I'm not a native English speaker, so I apologize for possible occasional grammatical and/or spelling errors.

    Read the article

  • Logical Matrix .... Solution

    - by Sanju
    Suppose you have an NxN matrix and you have to check whether it's a upper diagonal matrix or not. Is there any generic method to solve this problem? I am elaborating my question: Some thing is like this: Suppose you have NXN matrix having the value of N=4 then matrix will look like this: |5 6 9 2| |1 8 4 9| |5 8 1 6| |7 6 3 2| Its a 4X4 square matrix and again if it's upper triangle matrix it will look something like this: |5 6 9 2| |1 8 4 0| |5 8 0 0| |7 0 0 0| I need to generate a generic program in any language to check wether a square matrix is upper trailgle or not.

    Read the article

< Previous Page | 171 172 173 174 175 176 177 178 179 180 181 182  | Next Page >