Search Results

Search found 11297 results on 452 pages for 'delete operator'.

Page 50/452 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • Delete document with an empty ID

    - by Damien MATHIEU
    Hello, I have a CouchDB database in production. One of the documents has been edited (in Futon by an other developer). And it's lost it's ID (don't ask me how he did it). So now the document's id is an empty string, which makes it impossible to edit or delete via Futon. Is there a way I could hack into CouchDB to delete that document anyway ?

    Read the article

  • C# == operator in Immediate window behaves differently than at run-time

    - by Damiano
    Try the following in the Immediate window: object a1 = "a"; object a2 = "a"; a1==a2 // outputs false and you'll see that a1 == a2 outputs false. However, at runtime in either a window app or console, you'll get true: object t1 = "a"; object t2 = "a"; MessageBox.Show((t1 == t2).ToString()); // outputs true The runtime behavior is consistent with the definition for the == operator and strings. Does anybody know if this a bug in the Immediate window?

    Read the article

  • Logical xor operator in c++?

    - by RAC
    Is there such a thing? First time I encountered a practical need for it, but I don't see one listed in stroustrup. I intend to write: // Detect when exactly one of A,B is equal to five. return (A==5) ^^ (B==5); But there is no ^^ operator. Can I use bitwise ^ here and get the right answer (regardless of machine representation of true and false)? I never mix & and &&, or | and ||, so I hesitate to do that with ^ and ^^. I'd be more comfortable writing my own "bool XOR(bool,bool)" function instead.

    Read the article

  • Suppress error with @ operator in PHP

    - by Mez
    In your opinion, is it ever valid to use the @ operator to suppress an error/warning in PHP whereas you may be handling the error? If so, in what circumstances would you use this? Code examples are welcome. Edit: Note to repliers. I'm not looking to turn error reporting off, but, for example, common practice is to use @fopen($file); and then check afterwards... but you can get rid of the @ by doing if (file_exists($file)) { fopen($file); } else { die('File not found'); } or similar. I guess the question is - is there anywhere that @ HAS to be used to supress an error, that CANNOT be handled in any other manner?

    Read the article

  • vbsript and excel delete all worksheets except last one

    - by matthew moore
    I am trying to delete all worksheet in excel exept last one and save it then move its location. I can not get it took work as it deletes all other worksheets but errors out with and out of range error. Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True objExcel.DisplayAlerts = False Set objWorkbook = objExcel.Workbooks.Open("C:\M-tek 10-31-12_Tony.xlsx") i = objWorkbook.Worksheets.Count Do while i = i i = i - 1 objWorkbook.Worksheets(i).Delete Loop

    Read the article

  • How to replace a codebehind method with an aspx method using ternary operator

    - by user466663
    I have an asp:hyperlink control as part of a gridview template. The code in the aspx page is given below: asp:HyperLink runat="server" ID="lnkEdit" ToolTip="Edit article" NavigateUrl='<%# GetUrl(Eval("ID").ToString(), Eval("CategoryID").ToString()) %' ImageUrl="~/Images/Edit.gif" The NavigateUrl value is obtained from the codebehind method GetUrl(string, string). The code works fine and is as follows: protected string GetUrl(string id, string categoryID) { var CategoryID = string.Empty; if (!String.IsNullOrEmpty(Request.QueryString["CatID"])) { CategoryID = Request.QueryString["CatID"].ToString(); } else if (!String.IsNullOrEmpty(categoryID)) { CategoryID = categoryID; } return "~/TBSArticles/WriteOrEditArticle.aspx?ID=" + id + "&CatID=" + CategoryID; } I want to replace the code behind method by using a ternary operator within the aspx page. I tried something like below, but didn't work: asp:HyperLink runat="server" ID="lnkEdit" ToolTip="Edit article" NavigateUrl='<%# "~/TBSArticles/WriteOrEditArticle.aspx?ID=" + Eval("ID") + "&CatID=" + Eval(this.Request.QueryString["CatID"].ToString()) != ""? this.Request.QueryString["CatID"] : Eval("CategoryID")) %' ImageUrl="~/Images/Edit.gif" Any help will be greatly appreciated. Thanks

    Read the article

  • C++: Why does gcc prefer non-const over const when accessing operator[]?

    - by JonasW
    This question might be more appropriately asked regarding C++ in general, but as I am using gcc on linux that's the context. Consider the following program: #include <iostream> #include <map> #include <string> using namespace std; template <typename TKey, typename TValue> class Dictionary{ public: map<TKey, TValue> internal; TValue & operator[](TKey const & key) { cout << "operator[] with key " << key << " called " << endl; return internal[key]; } TValue const & operator[](TKey const & key) const { cout << "operator[] const with key " << key << " called " << endl; return internal.at(key); } }; int main(int argc, char* argv[]) { Dictionary<string, string> dict; dict["1"] = "one"; cout << "first one: " << dict["1"] << endl; return 0; } When executing the program, the output is: operator[] with key 1 called operator[] with key 1 called first one: one What I would like is to have the compiler choose the operator[]const method instead in the second call. The reason is that without having used dict["1"] before, the call to operator[] causes the internal map to create the data that does not exist, even if the only thing I wanted was to do some debugging output, which of course is a fatal application error. The behaviour I am looking for would be something like the C# index operator which has a get and a set operation and where you could throw an exception if the getter tries to access something that doesn't exist: class MyDictionary<TKey, TVal> { private Dictionary<TKey, TVal> dict = new Dictionary<TKey, TVal>(); public TVal this[TKey idx] { get { if(!dict.ContainsKey(idx)) throw KeyNotFoundException("..."); return dict[idx]; } set { dict[idx] = value; } } } Thus, I wonder why the gcc prefers the non-const call over the const call when non-const access is not required.

    Read the article

  • Unexpected error when attempting to delete a facebook story

    - by blueberryfields
    I'm attempting to delete a facebook story/action, like so: curl -F 'access_token=[valid_token]' -X DELETE https://graph.facebook.com/[action_id] Facebook is responding with an internal server error, like so: {"error": {"message":"An unexpected error has occurred. Please retry your request later.", "type":"OAuthException","code":2}} Is this an error caused by my actions, or something on Facebook's end? Additional info When I run curl -X GET https://graph.facebook.com/[action_id]?access_token=[valid_token] the result is "false"

    Read the article

  • How to delete child table records during the update of parent table using Hibernate

    - by Harsha
    I have a Parent Table A and child tables B,C with many to one relations. Lets say I have data like, for primary key 1 in parent table A I have 3 rows in child table B and 4 rows in child table C. Now if I want to delete the rows of the child table during an update of the parent table(that means Now, I want to update the table only with one row in each child tables and delete the other rows in them) then how to handle this scenario in hibernate?

    Read the article

  • Why operator= returns reference not const reference

    - by outmind
    The original question is related to overloading operator= and I like to share my findings as it was nontrivial for me to find them. I cannot imagine reasonable example to use (a=b) as lvalue. With the help of IRC and google I've found the next article: http://msdn.microsoft.com/en-us/magazine/cc301415.aspx it provides two examples. (a=b)=c f(T& ); f(a=b) but both a bit not good, as first violate associativity and I believe that it is bad practice. The second one give me the same feeling. Could you provide more good examples why it should be non constant?

    Read the article

  • How to delete a "Recurly" account completely from ruby api

    - by Subrahmanyam Konduri
    Can anyone please tell me how to delete a recurly account. As, I have tried with the following commands, r = Recurly::Account.find(account_code) r.delete And also, I have tried with "r.destroy". But, it only changing the state of recurly account from "active" to "closed" and not deleting the account completely. I am using rails 2.3.11 for this application. Thanks in advance. K. Subrahmanyam.

    Read the article

  • delete common dictionaries in list based on a value

    - by pythoonatic
    How would I delete all corresponding dictionaries in a list of dictionaries based on one of the dictionaries having a character in it. data = [ { 'x' : 'a', 'y' : '1' }, { 'x' : 'a', 'y' : '1/1' }, { 'x' : 'a', 'y' : '2' }, { 'x' : 'b', 'y' : '1' }, { 'x' : 'b', 'y' : '1' }, { 'x' : 'b', 'y' : '1' }, ] For example, how would I delete all of the x = a due to one of the y in the x=a having a / in it? Based on the example data above, here is where I would like to get to: cleaneddata = [ { 'x' : 'b', 'y' : '1' }, { 'x' : 'b', 'y' : '1' }, { 'x' : 'b', 'y' : '1' }, ]

    Read the article

  • How to delete "-" file from svn?

    - by ~brzeti
    Accidentally I have created file "-" (just a minus) in a directory and commited it. I have to delete it because its causing error on other machines: svn: Can't convert string from 'UTF-8' to native encoding: svn: ?\226?\128?\147 I can remove it from local directory using "rm -i *" or with python "os.remove('\xe2\x80\x93')" but those methods do not work with "svn rm". How to delete such file from svn repository?

    Read the article

  • how did i break :method -> :delete

    - by Tallboy
    i refactored my entire application and gave it a whole new design. The one thing that seems to be broken is all the original link_to methods I had which were :method = :delete are now getting sent as a GET request. The only thing I did that I can remember that might cause it is delete jquery-rails from the gemfile (I'm just getting it from google ajax). Does anyone have any other ideas what I could have deleted?

    Read the article

  • Restricting Edit and Delete

    - by phleet
    I want to be able to edit and delete resources myself, but not allow users of the application to do so. Is there an easy way of doing this in Rails? An incomplete solution would be just to remove the "delete" and "edit" buttons from the index view, but that doesn't disable their ability to do so via direct HTTP requests. Running Rails 2.2.2 and ruby 1.8.7

    Read the article

  • How does the increment operator (++) work on DateTime in C#

    - by sohtimsso1970
    What happens if you use the increment operator (++) on a DateTime type in C#? For instance, if I did this: DateTime blah = new DateTime(2010, 12, 24); blah++; What does blah become? Does that increment by a tick or a day? Or is that even legal? I don't have a dev environment around, and won't for a few days, or I would just try it and find out. I was too curious to wait so I figured I'd ask the community.

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >