Search Results

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

Page 17/452 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Ternary operator in if-statement?

    - by Pindatjuh
    I've written the following if-statement in Java: if(methodName.equals("set" + this.name) || isBoolean() ? methodName.equals("is" + this.name) : methodName.equals("get" + this.name)) { ... } Is this a good practice to write such expressions in if, to separate state from condition? And can this expression be simplified?

    Read the article

  • The unary increment operator in pointer arithmetic

    - by RhymesWithDuck
    Hello, this is my first post. I have this function for reversing a string in C that I found. void reverse(char* c) { if (*c != 0) { reverse(c + 1); } printf("%c",*c); } It works fine but if I replace: reverse(c + 1); with: reverse(++c); the first character of the original string is truncated. My question is why would are the statements not equivalent in this instance? Thanks

    Read the article

  • post increment operator java

    - by srandpersonia
    I can't make heads or tails of the following code from "java puzzlers" by joshua bloch. public class Test22{ public static void main(String args[]){ int j=0; for(int i=0;i<100;i++){ j=j++; } System.out.println(j); //prints 0 int a=0,b=0; a=b++; System.out.println(a); System.out.println(b); //prints 1 } } I can't get the part where j prints 0. According to the author, j=j++ is similar to temp=j; j=j+1; j=temp; But a=b++ makes b 1. So it should've evaluated like this, a=b b=b+1 By following the same logic, shouldn't j=j++ be evaluated as, j=j j=j+1 Where does the temp come into picture here? Any explanations would be much appreciated. << I'm breaking my head over this. ;) Thanks in advance.

    Read the article

  • How To Delete Top 100 Rows From SQL Server Tables

    - by Gopinath
    If you want to delete top 100/n records from an SQL Server table, it is very easy with the following query: DELETE FROM MyTable WHERE PK_Column IN(     SELECT TOP 100 PK_Column     FROM MyTable     ORDER BY creation    ) Why Would You Require To Delete Top 100 Records? I often delete a top n records of a table when number of rows in the are too huge. Lets say if I’ve 1000000000 records in a table, deleting 10000 rows at a time in a loop is faster than trying to delete all the 1000000000  at a time. What ever may be reason, if you ever come across a requirement of deleting a bunch of rows at a time, this query will be helpful to you. Join us on Facebook to read all our stories right inside your Facebook news feed.

    Read the article

  • Delete key assigned to a keyboard shortcut and now doesn't work

    - by Erez Schatz
    I posted this to the ubuntuforums, but got no answer there, so I'm trying here: While going over the keyboard shortcuts (System Preferences Keyboard Shortcuts), I accidentally assigned the delete key to a shortcut. I backspaced and cancelled, but next time I pressed "delete" the key didn't work. I tried creating a new shortcut called Delete and this got me a weird pop up saying "Error while trying to run (Delete) which is linked to the key (Delete)". I removed the shortcut, but it's still assigned. I deleted the custom shortcut, but to no avail. Any ideas? this drives me bonkers, as it's such a used key

    Read the article

  • Is Operator Overloading supported in C

    - by caramel23
    Today when I was reading about LCC(windows) compiler I find out it has the implemention for operator overloading . I'm puzzled because after a bit of googling , it has been confirm that operator overloading ain't support in standard C , but I read some people's comment mentioning LCC is ANSI-compliant . So my real question is , is LCC really standard C or it's just like objective-c , a C variant with object-oriented feature ?

    Read the article

  • Secure Delete PCI-DSS Windows Environment

    - by Brennan Mann
    Hello, I have been reviewing a number of applications for securing deleting files. I understand the concepts of overwriting the file several times with zeros and random characters; however, I don't understand the concept of renaming the file up to thirty times before actually deleting the file. Any feedback would greatly be appreciated. I am currently working on a PCI DSS project. URL - SDELETE by Sysinternals http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx Thanks, Brennan

    Read the article

  • how to handle delete by illegal address

    - by Davit Siradeghyan
    Suppose we have a situation like this. How to handle this problem? How to protect code from crashes? I know about and use boost smart pointers. But what to do if we have this situation. struct Test { int a; int b; int c; }; Test global; int main() { Test *p = new Test; p->a = 1; p->b = 2; p->c = 3; p = &global; delete p; return 0; }

    Read the article

  • jQuery delete text onfocus

    - by phillip usa
    hey, ive been trying to have a default value in a text input, then with jQuery, when you "onfocus" the textbox, it makes the text black (default a light gray), and deletes the default value. I think you know what im talking about, so do you guys know how to accomplish this?

    Read the article

  • Delete query in Linq

    - by Ani
    I have this simple code but it shows error. I dont know where I am going wrong. I shows error in last line.."DeleteOnSubmit" linq_testDataContext db = new linq_testDataContext(); var remove = from aremove in db.logins where aremove.username == userNameString && aremove.Password == pwdString select aremove; db.logins.DeleteOnSubmit(remove); Thanks, Ani

    Read the article

  • has any simply way to delete a value in list of python

    - by zjm1126
    a=[1,2,3,4] b=a.index(6) del a[b] print a it show error: Traceback (most recent call last): File "D:\zjm_code\a.py", line 6, in <module> b=a.index(6) ValueError: list.index(x): x not in list so i have to do this : a=[1,2,3,4] try: b=a.index(6) del a[b] except: pass print a but this is not simple,has any simply way ? thanks

    Read the article

  • CodeIgniter Question: How to delete records using ActiveRecord with mySQL function as WHERE conditio

    - by Jhourlad Estrella
    I have a table named ChatSessions where I keep track of active users in the chatroom. I need to prune expired user sessions from the table every 10 minutes. Using pure php-mysql is plain simple but I'm totally clueless how to convert this into ActiveRecord in CodeIgniter. The plain SQL query is below: SELECT * FROM `ChatSessions` WHERE `SessionExpires` < DATE_SUB( NOW( ) , INTERVAL 10 MINUTE ) Can anybody tell me what is the equivalent code in CodeIgniter using ActiveRecord? Thanks in advanced.

    Read the article

  • How can I delete permanently My Folders in Windows 7?

    - by Rubens
    How can I delete permanently My Music/My Pictures/My Videos/etc. Folders in Windows 7? If you delete this folders manually, Windows Media Player 12 recreate all of them again, again and again! It's a nightmare. Anyone knows a registry hacking to get rid of these folders forever? Note 1: I know how to disable the Libraries feature in Windows 7, but I don't want this, I want to delete only the folders named above. note2: The "folders monitored" option doesn't exist in Windows Media Player 12.

    Read the article

  • Powershell wait for file to delete, then copy a folder

    - by user3317623
    Morning guys, I have a couple of scripts that have to sync a folder from the network server, to the local terminal server, and lastly into the %LOCALAPPDATA%. I need to first check if a folder is being synced (this is done by creating a temporary COPYING.TXT on the server), and wait until that is removed, THEN copy to %LOCALAPPDATA%. Something like this: Server-side script executes, which syncs my folder to all of my terminal servers. It creates a COPYING.TXT temporary file, which indicates the sync is in progress. Once the sync is finished, the script removes the COPYING.TXT If someone logs on during the sync, I need a script to wait until the COPYING.TXT is deleted I.E the sync is finished, then resume the local sync into their %LOCALAPPDATA%. do{cp c:\folder\program $env:LOCALAPPDATA} while(!(test-path c:\folder\COPYING.txt)) (So that copies the folder while the file DOESN'T exist, but I don't think that exits cleanly) I cannot format the above as code for some reason I'm sorry? Or: while(!(test-path c:\folder\COPYING.txt)){ cp c:\folder\program $env:LOCALAPPDATA\ -recurse -force if (!(test-path c:\folder\program)){return} } But that script quits if the COPYING.TXT exists. I think I need to create a function and insert that function within itself, or a nested while loop, but that is starting to make my head hurt. Any help would be greatly appreciated. Thanks guys.

    Read the article

  • Double Buffering for Game objects, what's a nice clean generic C++ way?

    - by Gary
    This is in C++. So, I'm starting from scratch writing a game engine for fun and learning from the ground up. One of the ideas I want to implement is to have game object state (a struct) be double-buffered. For instance, I can have subsystems updating the new game object data while a render thread is rendering from the old data by guaranteeing there is a consistent state stored within the game object (the data from last time). After rendering of old and updating of new is finished, I can swap buffers and do it again. Question is, what's a good forward-looking and generic OOP way to expose this to my classes while trying to hide implementation details as much as possible? Would like to know your thoughts and considerations. I was thinking operator overloading could be used, but how do I overload assign for a templated class's member within my buffer class? for instance, I think this is an example of what I want: doublebuffer<Vector3> data; data.x=5; //would write to the member x within the new buffer int a=data.x; //would read from the old buffer's x member data.x+=1; //I guess this shouldn't be allowed If this is possible, I could choose to enable or disable double-buffering structs without changing much code. This is what I was considering: template <class T> class doublebuffer{ T T1; T T2; T * current=T1; T * old=T2; public: doublebuffer(); ~doublebuffer(); void swap(); operator=()?... }; and a game object would be like this: struct MyObjectData{ int x; float afloat; } class MyObject: public Node { doublebuffer<MyObjectData> data; functions... } What I have right now is functions that return pointers to the old and new buffer, and I guess any classes that use them have to be aware of this. Is there a better way?

    Read the article

  • Windows XP: How to delete files that cannot be deleted?

    - by glenneroo
    I have a backup copy of my previous Documents and Settings folder which only contains my original user and within that, 2 directories (Favorites and Local Settings) which are visible in cmd shell but when I try to delete them, Windows gives me this error: If I try to delete the Documents and Settings folder, I receive this warning: I tried doing this in a cmd shell: attrib *.* -r -a -s -h /s But it did not help, nor did it return any errors/warnings. Unlocker 1.8.5 returns: No Locking handle found. Any ideas?

    Read the article

  • How do you pronounce the '...' operator

    - by Uri
    Now, in c++ '...' became a first class operator. In speech, how do you pronounce it? So far I've heard: dot dot dot triple dot ellipsis related: Is it OK to replace ... with ellipsis in writing? e.g. "The ellipsis operator expands the pack" EDIT (clarification): We are all aware that '...' as a punctuation mark is indeed called ellipsis. But in the context of C++ we don't pronounce the names of the punctuation mark. For example, the '&' operator, depends on the context is pronounced as 'and', 'bitwise and', 'address of', 'logical and' (when && is used), or 'reference'. It is rarely pronounced as 'ampersand'. In speeches, I've a feeling that 'dot dot dot' is used more often. For example: http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Variadic-Templates-are-Funadic (an excellent presentation about variadic templates). On the other hand, 'dot dot dot' is awkward hard to pronouce ('d' and 't' are both pronounce with the tongue). Can we pronounce it 'unpack'?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >