Search Results

Search found 26523 results on 1061 pages for 'jack back'.

Page 146/1061 | < Previous Page | 142 143 144 145 146 147 148 149 150 151 152 153  | Next Page >

  • Long numbers. Division.

    - by user577395
    Hello, world! I have a problem. Today I tried to create a code, which finds Catalan number. But in my program can be long numbers. I found numerator and denominator. But i can't div long numbers! Also, only standard libraries was must use in this program. Help me please. This is my code #include <vector> #include <iostream> using namespace std; int main(int argc, char *argv[]) { const int base = 1000*1000*1000; vector <int> a, b; int n, carry = 0; cin>>n; a.push_back(n); for (int ii=n+2; ii!=(2*n)+1;++ii) { carry = 0; for (size_t i=0; i<a.size() || carry; ++i) { if (i == a.size()) a.push_back (0); long long cur = carry + a[i] * 1ll * ii; a[i] = int (cur % base); carry = int (cur / base); } } while (a.size() > 1 && a.back() == 0) a.pop_back(); b.push_back(n); for (int ii=1; ii!=n+1;++ii) { carry = 0; for (size_t i=0; i<b.size() || carry; ++i) { if (i == b.size()) b.push_back (0); long long cur = carry + b[i] * 1ll * ii; b[i] = int (cur % base); carry = int (cur / base); } } while (b.size() > 1 && b.back() == 0) b.pop_back(); cout<<(a.empty() ? 0 : a.back()); for (int i=(int)a.size()-2; i>=0; --i) cout<<(a[i]); cout<<" "; cout<<(b.empty() ? 0 : b.back()); for (int i=(int)b.size()-2; i>=0; --i) cout<<(b[i]); //system("PAUSE"); cout<<endl; return 0; } P.S. Sorry for my bad english =)

    Read the article

  • jquery animation problem using stop

    - by Flanders
    Hi! When running a Jquery animation like slideDown(), it looks like a number of element-specific css properties is set to be updated at a specific interval and when the animation is complete these properties are unset and the display property is simply set to auto or whatever. At least in firebug you can't see those temporary properties any more. The problem I've encountered is the scenario where we stop the slide down with stop(). The element is then left with the current temporary css values. Which is fine because it has to, but let us say that I stoped the slidedown because I have decided to slide it back up again a bit prematurely. It would look something like this: $(this).slideDown(2000) //The below events is not in queue but will rather start execute almost simultaneously as the above line. (dont remember the exact syntax) $(this).delay(1000).stop().slideUp(2000) The above code might not make much sense, but the point is: After 1 second of sliding down the animation is stopped and it starts to slide back up. Works like a charm. BUT!!! And here is the problem. Once it it has slid back up the elements css properties are reset to the exact values it had 1000ms into the slideDown() animation (when stop() was called). If we now try to run the following: $(this).slideDown(2000) It will slide down to the very point the prior slideDown was aborted and not further at half the speed (since it uses the same time for approximately half the height). This is because the css properties were saved as I see it. But it is not especially wished for. Of course I want it to slide all the way down this time. Due to UI interaction that is hard to predict everything might soon break. The longer animations we use increases the risk of something like this happening. Is this to be considered a bug, or am I doing something wrong? Or maybe it's just a feature that is not supported? I guess I can use a callback function to reset the css properties, but depending on the animation used, different css properties are used to render it, and covering your back would result in quite a not-so-fancy solution.

    Read the article

  • Nicer way to deploy a minified Chrome extension

    - by UVL
    When deploying an extension I follow various steps : copy to a temporary folder all the files, copy/paste back and forth the code to the on-line minifiers / obfuscators and create the zip to be uploaded. It's obvious that this could be simplified with scripting, but my experience on Windows scripting is very limited (most of my experience is server-side). Do I have to look back to the DOS .bat files like in the 90's or is there some cool tool or method I'm not aware?

    Read the article

  • What are you supposed to do with old SVN branches?

    - by John
    We had a SVN branch recently that had been merged back to trunk, and some more work on that feature/functional area was needed. I suggested using the same branch but was told you shouldn't re-use a branch once it has been integrated into trunk (a reference in SVN docs was given, I can't find it now). That suggests a branch is fairly useless once you merge back to trunk, so my question is once a branch is no longer needed, should it simply be deleted or kept?

    Read the article

  • How to get password html helper to render password on failed validation

    - by Max Schmeling
    I have a form for creating a new account and it has a password field in it. I'm using view models to pass data to the controller action and back to the form view. When the user enters their details in, and clicks submit, if validation fails and it returns them to the same view passing back in the view model, it won't default the password to what they entered. How can I get it to do this? Or should I even try?

    Read the article

  • How do you prevent a Hudson slave from archiving artifacts?

    - by Wilfred Springer
    It turns out our slaves spend a considerable amount of time moving the archived artifacts back to the master Hudson node. It at least triples the duration of the build. It would be nice if there would be a way to prevent it. However, setting the maximum number of builds to keep doesn't have an influence at all. Is there another way to prevent sending the results back to the central Hudson master?

    Read the article

  • Unity JS - simple if statements not behaving as expected?

    - by IHazABone
    I have a simple script (please no remarks on the fact that I'm not using a switch statement or better code, this is the earliest version and written this way by a peer, I am improving it) that takes an object and moves it back and forth. For some reason, the variable time gets stuck at 249. It is probably an obvious bug with this inefficient logic, but I cannot seem to find it. var speed = 1; private var time = 0; function Start() { } function Update() { if(condition == true)moveStuff(); } function moveStuff() { var timeSwitch = false; if(time == 0)timeSwitch = false; if(time == timeSet)timeSwitch = true; if(direction == 1) { if(timeSwitch == false) { transform.Translate(Vector3.up * (Time.deltaTime * speed)); time += 1; Debug.Log(time); }else if(timeSwitch == true) { transform.Translate(Vector3.up * ((Time.deltaTime * speed) * -1)); time -= 1; Debug.Log(time); } } else if(direction == 2) { if(timeSwitch == false) { transform.Translate(Vector3.down * (Time.deltaTime * speed)); time += 1; Debug.Log("Moved down. "); }else if(timeSwitch == true){ transform.Translate(Vector3.down * ((Time.deltaTime * speed) * -1)); time -= 1; } } else if(direction == 3) { if(timeSwitch == false) { transform.Translate(Vector3.forward * (Time.deltaTime * speed)); time += 1; Debug.Log("Moved forward. "); }else if(timeSwitch == true){ transform.Translate(Vector3.forward * ((Time.deltaTime * speed) * -1)); time -= 1; } } else if(direction == 4) { if(timeSwitch == false) { transform.Translate(Vector3.back * (Time.deltaTime * speed)); time += 1; Debug.Log("Moved back. "); }else if(timeSwitch == true){ transform.Translate(Vector3.back * ((Time.deltaTime * speed) * -1)); time -= 1; } } else if(direction == 5) { if(timeSwitch == false) { transform.Translate(Vector3.right * (Time.deltaTime * speed)); time += 1; Debug.Log("Moved right. "); }else if(timeSwitch == true){ transform.Translate(Vector3.right * ((Time.deltaTime * speed) * -1)); time -= 1; } } else if(direction == 6) { if(timeSwitch == false) { transform.Translate(Vector3.left * (Time.deltaTime * speed)); time += 1; Debug.Log("Moved left. "); }else if(timeSwitch == true){ transform.Translate(Vector3.left * ((Time.deltaTime * speed) * -1)); time -= 1; } } }

    Read the article

  • ASP page get current focused control

    - by Breander
    So what I have is a bunch of dynamically created textboxs that when the user enters some data and either tabs out or clicks out some calculations are done. After the page posts back control focus is lost. What I need is to be able to set focus back to the control that was tabbed to or clicked into not the control that data was entered into.

    Read the article

  • Save PHP variables to a text file

    - by Ajith
    I was wondering how to save PHP variables to a txt file and then retrieve them again. Example: There is an input box, after submitted the stuff that was written in the input box will be saved to a text file. Later on the results need to be brought back as a variable. So lets say the variable is $text I need that to be saved to a text file and be able to retrieve it back again. Hope it makes sense, Thanks in advance!!!

    Read the article

  • How does SO's form remember previous input values?

    - by user198729
    I've noticed that the Title or Body part is remembered if I come back to the Ask Question page by pressing Back button of my browser. This feature is available in all browsers I tested, but doesn't exist for the forms in my own projects. How can I approach that effect? UPDATE I still don't have any clue yet,but guess it that some kind of client cache enabled by http headers or javascript?

    Read the article

  • How to convert 3GP video for Android to view?

    - by RedNax
    Hi, I'm creating 3GP videos with the Android - however, when the 3GP files are posted on a site, the same Android phone cannot view it back. (The file works on the iPhone). What is right way to encode/resize the 3GP video so that the video player on Android can play it back? Thanks

    Read the article

  • Prevent monitor from powering on

    - by concretemixer
    I'm turning off the monitor using SendMessage(HWND_BROUADCART, WM_SYSCOMMAND, SC_MONITORRPOWER, 2). That works, but the monitor turns back on when someone touches the keyboard or mouse. I tried to get rid of this using the DevicePowerSetDeviceState function with DEVICEPOWER_CLEAR_WAKEENABLED for the keyboard and mouse: it returns no error, but has no effect either. How can I prevent the monitor from powering back on in Vista and Windows7?

    Read the article

  • What type of programs are C/C++ used for now?

    - by Ryan Detzel
    I started off with C in school, went to Java and now I primarily use the P's(Php, Perl, Python) so my exposure to the lower level languages have all but disappeared. I would like to get back into it but I can never justify using C over Perl or Python. What real-world apps are being built with these languages? Any suggestions if I want to dive back in, what can I do with C/C++ that I can't easily do with Perl/Python?

    Read the article

  • Question related to state maintainance

    - by user217572
    I have 10 views with UINavigationController in hiereachy now when i want to go back from 10 to 9 ,and so on by back button which method should i use? 1popviewCOntroller 2popToViewController I have set fixed value for all views.at application launch i get that value for that value i intialize rootviewController with use of UINavigationController and my rootviewcontroller is nothing but first view and after that on next line i'm pushing a particular view. plz help me out

    Read the article

  • MongoDB using NOT and AND together

    - by Stankalank
    I'm trying to negate an $and clause with MongoDB and I'm getting a MongoError: invalid operator: $and message back. Basically what I want to achieve is the following: query = { $not: { $and: [{institution_type:'A'}, {type:'C'}] } } Is this possible to express in a mongo query? Here is a sample collection: { "institution_type" : "A", "type" : "C" } { "institution_type" : "A", "type" : "D" } { "institution_type" : "B", "type" : "C" } { "institution_type" : "B", "type" : "D" } What I want to get back is the following: { "institution_type" : "A", "type" : "D" } { "institution_type" : "B", "type" : "C" } { "institution_type" : "B", "type" : "D" }

    Read the article

  • getting panel color

    - by user161004
    I have a program where i have a button to change the background color to red and another button to set back the default panel color. How do i get back the default color for panel??

    Read the article

  • Why does Application_Deactivated not get called on a pivot page?

    - by willmel
    For my Windows Phone 7 app, I have a main panorama page which opens up into a pivot control. The main panorama page correctly calls Activated/Deactivated, and restores correctly. But after visiting the pivot page, pressing the Windows key doesn't call Deactivated. When the app is relaunched with the back button, it goes right to how the page looked before tombstoning, but Activated is not called, and the page is not usable, and the back key doesn't work. Has anyone else experienced this problem before?

    Read the article

< Previous Page | 142 143 144 145 146 147 148 149 150 151 152 153  | Next Page >