[Solved] “Little girl and maximum XOR”

If you read about __builtin_clzll in http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Other-Builtins.html — Built-in Function: int __builtin_clzll (unsigned long long x) Returns the number of leading 0-bits in x, starting at the most significant bit position. If x is 0, the result is undefined. From https://cs.stackexchange.com/a/29510, The maximum possible XOR of any two integers from an interval [l, r] can … Read more

[Solved] taking specific time then output result?

C++11 solution #include <iostream> #include <chrono> #include <thread> int main() { using namespace std::literals; std::this_thread::sleep_for(5s); std::cout << “Hello world” << std::endl; } Read more http://en.cppreference.com/w/cpp/thread/sleep_for solved taking specific time then output result?

[Solved] Finding commas inside a char array

clearing the array , which would have some values in it, would solve this, and this is because when you print it, and there are some other values in it, you get them printed too for( int i = 0; i < maxL; ++i ) newdata[i] = (char)0; solve it completely . EDIT: And to … Read more

[Solved] what happens on returning previous activity?

Activity A and Activity B, When you move from Activity A to Activity B the lifecycle is as follows Activity A ——————– onCreate() //A onStart() //A onResume() //A – here user can interact with UI(buttons,views), user click button and it moves to second activity onPause() //A ——————– onCreate() //Activity B onStart() //B onResume() //B ——————– … Read more

[Solved] Super Beginner Javascript

Looks to me like the script works just fine. How about trying to use it? I can’t do this on SO so here’s a Fiddle. Notice there is nothing in the fiddle but the script tag, just like I said in my commment. <script type=”text/javascript” src=”https://widget.parishesonline.com/publications?id=4380d54a4c312f854ea93f3520cf1bf2650642d9″></script> I guess I can do this on SO <script … Read more

[Solved] android.database.sqlite.SQLiteException: near “)”: syntax error (code 1): [closed]

change your query to this , you’re missing some spaces and also you must remove the last comma from the query @Override public void onCreate(SQLiteDatabase db) { String query = “CREATE TABLE ” + TABLE_PRODUCTS + “(” + COLUMN_ID + ” INTEGER PRIMARY KEY AUTOINCREMENT, ” + COLUMN_PRODUCTNAME + ” TEXT, ” + COLUMN_VENUE + … Read more

[Solved] Last digit of 2^n [closed]

If you look at the sequence of powers of two, you will se a pattern: 1 2 4 8 16 32 64 128 256 512 1024 2048 its always 2 -> 4 -> 8 -> 6 You can use this, to calculate the last digit int GetLastDigit(int power) { if (power == 0) return 1; … Read more

[Solved] App crashes when registration button is pressed

email and password should not be null or empty String email = mEmail.getText().toString(); String password = mPassword.getText().toString(); if(email.isEmpty() || password.isEmpty()) return; //you need to display message to the user mAuth.createUserWithEmailAndPassword(email, password) .addOnCompleteListener(CustomerLoginActivity.this, new OnCompleteListener<AuthResult>() { … }) solved App crashes when registration button is pressed

[Solved] How to disable Script on certain selected page

Its common problem if are using duplicate ids in different scripts. For egs, if you are using name as id in login script and the same id is used in search script, so definately these 2 would create conflits with the same id name Now, to reslove this you can have 2 options Add unique … Read more

[Solved] UIWebview loads with blank page [closed]

I resolved this issue, error in this below line destViewController.path = [documentsDirectory stringByAppendingPathComponent:[dirFiles objectAtIndex:indexPath.row]]; replaced it with below line destViewController.path = [inboxPath stringByAppendingPathComponent:[dirFiles objectAtIndex:indexPath.row]]; solved UIWebview loads with blank page [closed]

[Solved] MD5 with more than one parameter [closed]

Try this, basically you can concatenate the three strings as a single string and use the combined string as the input for the md5 function >>> import hashlib >>> value1 = “value1” >>> value2 = “value2” >>> value3 = “value3” >>> hashlib.md5(value1 + value2 + value3).hexdigest() ‘ceba206ca4802a60ca07a411905111b8’ solved MD5 with more than one parameter [closed]