\n\nStart the Exercise\nWe just launchedW3Schools videos\nGet certifiedby completinga course today!\nIf you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:\nhelp@w3schools.com\nYour message has been sent to W3Schools."},"parsed":{"kind":"list like","value":[{"code":null,"e":63,"s":0,"text":"The z-index property specifies the \nstack order of an element."},{"code":null,"e":126,"s":63,"text":"When elements are positioned, they can overlap other elements."},{"code":null,"e":256,"s":126,"text":"The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others)."},{"code":null,"e":312,"s":256,"text":"An element can have a positive or negative stack order:"},{"code":null,"e":386,"s":312,"text":"Because the image has a z-index of -1, it will be placed behind the text."},{"code":null,"e":593,"s":386,"text":"Note: z-index only works on positioned elements (position: absolute, \nposition: relative, position: fixed, or position: sticky) and flex items \n(elements that are direct children of display: flex elements)."},{"code":null,"e":699,"s":593,"text":"Here we see that an element with greater stack order is always above an element with a lower stack order:"},{"code":null,"e":839,"s":699,"text":"If two positioned elements overlap each other without a z-index \nspecified, the element defined last in the HTML code will be shown on top."},{"code":null,"e":898,"s":839,"text":"Same example as above, but here with no z-index specified:"},{"code":null,"e":971,"s":898,"text":"Both the header and the paragraph are positioned at the top of the page."},{"code":null,"e":1032,"s":971,"text":"Make sure that the header is placed on top of the paragraph."},{"code":null,"e":1240,"s":1032,"text":"\n\n
\n
This is a heading
\n
This is a paragraph
\n
\n"},{"code":null,"e":1259,"s":1240,"text":"Start the Exercise"},{"code":null,"e":1292,"s":1259,"text":"We just launchedW3Schools videos"},{"code":null,"e":1334,"s":1292,"text":"Get certifiedby completinga course today!"},{"code":null,"e":1441,"s":1334,"text":"If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:"},{"code":null,"e":1460,"s":1441,"text":"help@w3schools.com"}],"string":"[\n {\n \"code\": null,\n \"e\": 63,\n \"s\": 0,\n \"text\": \"The z-index property specifies the \\nstack order of an element.\"\n },\n {\n \"code\": null,\n \"e\": 126,\n \"s\": 63,\n \"text\": \"When elements are positioned, they can overlap other elements.\"\n },\n {\n \"code\": null,\n \"e\": 256,\n \"s\": 126,\n \"text\": \"The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others).\"\n },\n {\n \"code\": null,\n \"e\": 312,\n \"s\": 256,\n \"text\": \"An element can have a positive or negative stack order:\"\n },\n {\n \"code\": null,\n \"e\": 386,\n \"s\": 312,\n \"text\": \"Because the image has a z-index of -1, it will be placed behind the text.\"\n },\n {\n \"code\": null,\n \"e\": 593,\n \"s\": 386,\n \"text\": \"Note: z-index only works on positioned elements (position: absolute, \\nposition: relative, position: fixed, or position: sticky) and flex items \\n(elements that are direct children of display: flex elements).\"\n },\n {\n \"code\": null,\n \"e\": 699,\n \"s\": 593,\n \"text\": \"Here we see that an element with greater stack order is always above an element with a lower stack order:\"\n },\n {\n \"code\": null,\n \"e\": 839,\n \"s\": 699,\n \"text\": \"If two positioned elements overlap each other without a z-index \\nspecified, the element defined last in the HTML code will be shown on top.\"\n },\n {\n \"code\": null,\n \"e\": 898,\n \"s\": 839,\n \"text\": \"Same example as above, but here with no z-index specified:\"\n },\n {\n \"code\": null,\n \"e\": 971,\n \"s\": 898,\n \"text\": \"Both the header and the paragraph are positioned at the top of the page.\"\n },\n {\n \"code\": null,\n \"e\": 1032,\n \"s\": 971,\n \"text\": \"Make sure that the header is placed on top of the paragraph.\"\n },\n {\n \"code\": null,\n \"e\": 1240,\n \"s\": 1032,\n \"text\": \"\\n\\n
\\n
This is a heading
\\n
This is a paragraph
\\n
\\n\"\n },\n {\n \"code\": null,\n \"e\": 1259,\n \"s\": 1240,\n \"text\": \"Start the Exercise\"\n },\n {\n \"code\": null,\n \"e\": 1292,\n \"s\": 1259,\n \"text\": \"We just launchedW3Schools videos\"\n },\n {\n \"code\": null,\n \"e\": 1334,\n \"s\": 1292,\n \"text\": \"Get certifiedby completinga course today!\"\n },\n {\n \"code\": null,\n \"e\": 1441,\n \"s\": 1334,\n \"text\": \"If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:\"\n },\n {\n \"code\": null,\n \"e\": 1460,\n \"s\": 1441,\n \"text\": \"help@w3schools.com\"\n }\n]"}}},{"rowIdx":18,"cells":{"title":{"kind":"string","value":"8051 Program to Subtract two 8 Bit numbers"},"text":{"kind":"string","value":"Here we will see how to subtract two 8-bit numbers using this microcontroller. The register A(Accumulator) is used as one operand in the operations. There are seven registers R0 – R7 in different register banks. We can use any of them as the second operand.\nWe are taking two number73H and BDH at location 20H and 21H, After subtracting the result will be stored at location 30H and 31H. \nMOVR0,#20H;set source address 20H to R0\nMOVR1,#30H;set destination address 30H to R1\n\nMOVA,@R0;take the value from source to register A\nMOVR5,A; Move the value from A to R5\nMOVR4,#00H; Clear register R4 to store borrow\n\nINCR0; Point to the next location\nMOVA,@R0; take the value from source to register A\nMOVR3,A; store second byte\nMOVA,R5;get back the first operand\nSUBBA,R3; Subtract R3 from A\n JNCSAVE\n INCR4; Increment R4 to get borrow\n MOVB,R4;Get borrow to register B\n MOV@R1,B; Store the borrow first\n INCR1; Increase R1 to point to the next address\n\nSAVE: MOV@R1,A; Store the result\nHALT: SJMP HALT ;Stop the program\nSo by subtracting 73H –BDH, the result will be B6H. At location 30H, we will get 01H. This indicates that the result is negative. The get the actual value from result B6H, we have to perform 2’s complement operation. After performing 2’s Complement, the result will be -4AH."},"parsed":{"kind":"list like","value":[{"code":null,"e":1320,"s":1062,"text":"Here we will see how to subtract two 8-bit numbers using this microcontroller. The register A(Accumulator) is used as one operand in the operations. There are seven registers R0 – R7 in different register banks. We can use any of them as the second operand."},{"code":null,"e":1452,"s":1320,"text":"We are taking two number73H and BDH at location 20H and 21H, After subtracting the result will be stored at location 30H and 31H. "},{"code":null,"e":2109,"s":1452,"text":"MOVR0,#20H;set source address 20H to R0\nMOVR1,#30H;set destination address 30H to R1\n\nMOVA,@R0;take the value from source to register A\nMOVR5,A; Move the value from A to R5\nMOVR4,#00H; Clear register R4 to store borrow\n\nINCR0; Point to the next location\nMOVA,@R0; take the value from source to register A\nMOVR3,A; store second byte\nMOVA,R5;get back the first operand\nSUBBA,R3; Subtract R3 from A\n JNCSAVE\n INCR4; Increment R4 to get borrow\n MOVB,R4;Get borrow to register B\n MOV@R1,B; Store the borrow first\n INCR1; Increase R1 to point to the next address\n\nSAVE: MOV@R1,A; Store the result\nHALT: SJMP HALT ;Stop the program"},{"code":null,"e":2384,"s":2109,"text":"So by subtracting 73H –BDH, the result will be B6H. At location 30H, we will get 01H. This indicates that the result is negative. The get the actual value from result B6H, we have to perform 2’s complement operation. After performing 2’s Complement, the result will be -4AH."}],"string":"[\n {\n \"code\": null,\n \"e\": 1320,\n \"s\": 1062,\n \"text\": \"Here we will see how to subtract two 8-bit numbers using this microcontroller. The register A(Accumulator) is used as one operand in the operations. There are seven registers R0 – R7 in different register banks. We can use any of them as the second operand.\"\n },\n {\n \"code\": null,\n \"e\": 1452,\n \"s\": 1320,\n \"text\": \"We are taking two number73H and BDH at location 20H and 21H, After subtracting the result will be stored at location 30H and 31H. \"\n },\n {\n \"code\": null,\n \"e\": 2109,\n \"s\": 1452,\n \"text\": \"MOVR0,#20H;set source address 20H to R0\\nMOVR1,#30H;set destination address 30H to R1\\n\\nMOVA,@R0;take the value from source to register A\\nMOVR5,A; Move the value from A to R5\\nMOVR4,#00H; Clear register R4 to store borrow\\n\\nINCR0; Point to the next location\\nMOVA,@R0; take the value from source to register A\\nMOVR3,A; store second byte\\nMOVA,R5;get back the first operand\\nSUBBA,R3; Subtract R3 from A\\n JNCSAVE\\n INCR4; Increment R4 to get borrow\\n MOVB,R4;Get borrow to register B\\n MOV@R1,B; Store the borrow first\\n INCR1; Increase R1 to point to the next address\\n\\nSAVE: MOV@R1,A; Store the result\\nHALT: SJMP HALT ;Stop the program\"\n },\n {\n \"code\": null,\n \"e\": 2384,\n \"s\": 2109,\n \"text\": \"So by subtracting 73H –BDH, the result will be B6H. At location 30H, we will get 01H. This indicates that the result is negative. The get the actual value from result B6H, we have to perform 2’s complement operation. After performing 2’s Complement, the result will be -4AH.\"\n }\n]"}}},{"rowIdx":19,"cells":{"title":{"kind":"string","value":"LISP - Lambda Functions"},"text":{"kind":"string","value":"At times you may need a function in only one place in your program and the function is so trivial that you may not give it a name, or may not like to store it in the symbol table, and would rather write an unnamed or anonymous function.\nLISP allows you to write anonymous functions that are evaluated only when they are encountered in the program. These functions are called Lambda functions.\nYou can create such functions using the lambda expression. The syntax for the lambda expression is as follows −\n(lambda (parameters) body)\nA lambda form cannot be evaluated and it must appear only where LISP expects to find a function.\nCreate a new source code file named main.lisp and type the following code in it.\n(write ((lambda (a b c x)\n (+ (* a (* x x)) (* b x) c))\n 4 2 9 3)\n)\nWhen you execute the code, it returns the following result −\n51\n\n\n 79 Lectures \n 7 hours \n\n Arnold Higuit\n Print\n Add Notes\n Bookmark this page"},"parsed":{"kind":"list like","value":[{"code":null,"e":2297,"s":2060,"text":"At times you may need a function in only one place in your program and the function is so trivial that you may not give it a name, or may not like to store it in the symbol table, and would rather write an unnamed or anonymous function."},{"code":null,"e":2453,"s":2297,"text":"LISP allows you to write anonymous functions that are evaluated only when they are encountered in the program. These functions are called Lambda functions."},{"code":null,"e":2565,"s":2453,"text":"You can create such functions using the lambda expression. The syntax for the lambda expression is as follows −"},{"code":null,"e":2592,"s":2565,"text":"(lambda (parameters) body)"},{"code":null,"e":2689,"s":2592,"text":"A lambda form cannot be evaluated and it must appear only where LISP expects to find a function."},{"code":null,"e":2770,"s":2689,"text":"Create a new source code file named main.lisp and type the following code in it."},{"code":null,"e":2842,"s":2770,"text":"(write ((lambda (a b c x)\n (+ (* a (* x x)) (* b x) c))\n 4 2 9 3)\n)"},{"code":null,"e":2903,"s":2842,"text":"When you execute the code, it returns the following result −"},{"code":null,"e":2907,"s":2903,"text":"51\n"},{"code":null,"e":2940,"s":2907,"text":"\n 79 Lectures \n 7 hours \n"},{"code":null,"e":2955,"s":2940,"text":" Arnold Higuit"},{"code":null,"e":2962,"s":2955,"text":" Print"},{"code":null,"e":2973,"s":2962,"text":" Add Notes"}],"string":"[\n {\n \"code\": null,\n \"e\": 2297,\n \"s\": 2060,\n \"text\": \"At times you may need a function in only one place in your program and the function is so trivial that you may not give it a name, or may not like to store it in the symbol table, and would rather write an unnamed or anonymous function.\"\n },\n {\n \"code\": null,\n \"e\": 2453,\n \"s\": 2297,\n \"text\": \"LISP allows you to write anonymous functions that are evaluated only when they are encountered in the program. These functions are called Lambda functions.\"\n },\n {\n \"code\": null,\n \"e\": 2565,\n \"s\": 2453,\n \"text\": \"You can create such functions using the lambda expression. The syntax for the lambda expression is as follows −\"\n },\n {\n \"code\": null,\n \"e\": 2592,\n \"s\": 2565,\n \"text\": \"(lambda (parameters) body)\"\n },\n {\n \"code\": null,\n \"e\": 2689,\n \"s\": 2592,\n \"text\": \"A lambda form cannot be evaluated and it must appear only where LISP expects to find a function.\"\n },\n {\n \"code\": null,\n \"e\": 2770,\n \"s\": 2689,\n \"text\": \"Create a new source code file named main.lisp and type the following code in it.\"\n },\n {\n \"code\": null,\n \"e\": 2842,\n \"s\": 2770,\n \"text\": \"(write ((lambda (a b c x)\\n (+ (* a (* x x)) (* b x) c))\\n 4 2 9 3)\\n)\"\n },\n {\n \"code\": null,\n \"e\": 2903,\n \"s\": 2842,\n \"text\": \"When you execute the code, it returns the following result −\"\n },\n {\n \"code\": null,\n \"e\": 2907,\n \"s\": 2903,\n \"text\": \"51\\n\"\n },\n {\n \"code\": null,\n \"e\": 2940,\n \"s\": 2907,\n \"text\": \"\\n 79 Lectures \\n 7 hours \\n\"\n },\n {\n \"code\": null,\n \"e\": 2955,\n \"s\": 2940,\n \"text\": \" Arnold Higuit\"\n },\n {\n \"code\": null,\n \"e\": 2962,\n \"s\": 2955,\n \"text\": \" Print\"\n },\n {\n \"code\": null,\n \"e\": 2973,\n \"s\": 2962,\n \"text\": \" Add Notes\"\n }\n]"}}},{"rowIdx":20,"cells":{"title":{"kind":"string","value":"Check if a File exists in C#"},"text":{"kind":"string","value":"Use the File.exists method in C# to check if a file exits in C# or not.\nFirstly, check whether the file is present in the current directory.\nif (File.Exists(\"MyFile.txt\")) {\n Console.WriteLine(\"The file exists.\");\n}\nAfter that check whether the file exist in a directory or not.\nif (File.Exists(@\"D:\\myfile.txt\")) {\n Console.WriteLine(\"The file exists.\");\n}\nLet us see the complete example to check if a file exists in C#.\n Live Demo\nusing System;\nusing System.IO;\nclass Demo {\n static void Main() {\n if (File.Exists(\"MyFile.txt\")) {\n Console.WriteLine(\"File exists...\");\n } else {\n Console.WriteLine(\"File does not exist in the current directory!\");\n }\n if (File.Exists(@\"D:\\myfile.txt\")) {\n Console.WriteLine(\"File exists...\");\n } else {\n Console.WriteLine(\"File does not exist in the D directory!\");\n }\n }\n}\nFile does not exist in the current directory!\nFile does not exist in the D directory!"},"parsed":{"kind":"list like","value":[{"code":null,"e":1134,"s":1062,"text":"Use the File.exists method in C# to check if a file exits in C# or not."},{"code":null,"e":1203,"s":1134,"text":"Firstly, check whether the file is present in the current directory."},{"code":null,"e":1280,"s":1203,"text":"if (File.Exists(\"MyFile.txt\")) {\n Console.WriteLine(\"The file exists.\");\n}"},{"code":null,"e":1343,"s":1280,"text":"After that check whether the file exist in a directory or not."},{"code":null,"e":1424,"s":1343,"text":"if (File.Exists(@\"D:\\myfile.txt\")) {\n Console.WriteLine(\"The file exists.\");\n}"},{"code":null,"e":1489,"s":1424,"text":"Let us see the complete example to check if a file exists in C#."},{"code":null,"e":1500,"s":1489,"text":" Live Demo"},{"code":null,"e":1943,"s":1500,"text":"using System;\nusing System.IO;\nclass Demo {\n static void Main() {\n if (File.Exists(\"MyFile.txt\")) {\n Console.WriteLine(\"File exists...\");\n } else {\n Console.WriteLine(\"File does not exist in the current directory!\");\n }\n if (File.Exists(@\"D:\\myfile.txt\")) {\n Console.WriteLine(\"File exists...\");\n } else {\n Console.WriteLine(\"File does not exist in the D directory!\");\n }\n }\n}"},{"code":null,"e":2029,"s":1943,"text":"File does not exist in the current directory!\nFile does not exist in the D directory!"}],"string":"[\n {\n \"code\": null,\n \"e\": 1134,\n \"s\": 1062,\n \"text\": \"Use the File.exists method in C# to check if a file exits in C# or not.\"\n },\n {\n \"code\": null,\n \"e\": 1203,\n \"s\": 1134,\n \"text\": \"Firstly, check whether the file is present in the current directory.\"\n },\n {\n \"code\": null,\n \"e\": 1280,\n \"s\": 1203,\n \"text\": \"if (File.Exists(\\\"MyFile.txt\\\")) {\\n Console.WriteLine(\\\"The file exists.\\\");\\n}\"\n },\n {\n \"code\": null,\n \"e\": 1343,\n \"s\": 1280,\n \"text\": \"After that check whether the file exist in a directory or not.\"\n },\n {\n \"code\": null,\n \"e\": 1424,\n \"s\": 1343,\n \"text\": \"if (File.Exists(@\\\"D:\\\\myfile.txt\\\")) {\\n Console.WriteLine(\\\"The file exists.\\\");\\n}\"\n },\n {\n \"code\": null,\n \"e\": 1489,\n \"s\": 1424,\n \"text\": \"Let us see the complete example to check if a file exists in C#.\"\n },\n {\n \"code\": null,\n \"e\": 1500,\n \"s\": 1489,\n \"text\": \" Live Demo\"\n },\n {\n \"code\": null,\n \"e\": 1943,\n \"s\": 1500,\n \"text\": \"using System;\\nusing System.IO;\\nclass Demo {\\n static void Main() {\\n if (File.Exists(\\\"MyFile.txt\\\")) {\\n Console.WriteLine(\\\"File exists...\\\");\\n } else {\\n Console.WriteLine(\\\"File does not exist in the current directory!\\\");\\n }\\n if (File.Exists(@\\\"D:\\\\myfile.txt\\\")) {\\n Console.WriteLine(\\\"File exists...\\\");\\n } else {\\n Console.WriteLine(\\\"File does not exist in the D directory!\\\");\\n }\\n }\\n}\"\n },\n {\n \"code\": null,\n \"e\": 2029,\n \"s\": 1943,\n \"text\": \"File does not exist in the current directory!\\nFile does not exist in the D directory!\"\n }\n]"}}},{"rowIdx":21,"cells":{"title":{"kind":"string","value":"override identifier in C++"},"text":{"kind":"string","value":"13 Jun, 2022\nFunction overriding is a redefinition of the base class function in its derived class with the same signature i.e. return type and parameters. But there may be situations when a programmer makes a mistake while overriding that function. So, to keep track of such an error, C++11 has come up with the override identifier. If the compiler comes across this identifier, it understands that this is an overridden version of the same class. It will make the compiler check the base class to see if there is a virtual function with this exact signature. And if there is not, the compiler will show an error. \nThe programmer’s intentions can be made clear to the compiler by override. If the override identifier is used with a member function, the compiler makes sure that the member function exists in the base class, and also the compiler restricts the program to compile otherwise.\nLet’s understand through the following example: \nCPP\n// A CPP program without override keyword, here// programmer makes a mistake and it is not caught#include using namespace std; class Base {public: // user wants to override this in // the derived class virtual void func() { cout << \"I am in base\" << endl; }}; class derived : public Base {public: // did a silly mistake by putting // an argument \"int a\" void func(int a) { cout << \"I am in derived class\" << endl; }}; // Driver codeint main(){ Base b; derived d; cout << \"Compiled successfully\" << endl; return 0;}\nCompiled successfully\nExplanation: Here, the user intended to override the function func() in the derived class but did a silly mistake and redefined the function with a different signature. Which was not detected by the compiler. However, the program is not actually what the user wanted. So, to get rid of such silly mistakes to be on the safe side, the override identifier can be used. Below is a C++ example to show the use of override identifier in C++.\nCPP\n// A CPP program that uses override keyword so// that any difference in function signature is// caught during compilation#include using namespace std; class Base {public: // user wants to override this in // the derived class virtual void func() { cout << \"I am in base\" << endl; }}; class derived : public Base {public: // did a silly mistake by putting // an argument \"int a\" void func(int a) override { cout << \"I am in derived class\" << endl; }}; int main(){ Base b; derived d; cout << \"Compiled successfully\" << endl; return 0;}\nOutput(Error)\nprog.cpp:17:7: error: 'void derived::func(int)'\nmarked 'override', but does not override\n void func(int a) override \n ^\nIn short, it serves the following functions. It helps to check if: \nThere is a method with the same name in the parent class.\nThe method in the parent class is declared as “virtual” which means it was intended to be rewritten.\nThe method in the parent class has the same signature as the method in the subclass.\nThis article is contributed by MAZHAR IMAM KHAN. If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to review-team@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.\nanshikajain26\nshivamgupta2\ncpp-virtual\nC++\nCPP\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},"parsed":{"kind":"list like","value":[{"code":null,"e":54,"s":26,"text":"\n13 Jun, 2022"},{"code":null,"e":657,"s":54,"text":"Function overriding is a redefinition of the base class function in its derived class with the same signature i.e. return type and parameters. But there may be situations when a programmer makes a mistake while overriding that function. So, to keep track of such an error, C++11 has come up with the override identifier. If the compiler comes across this identifier, it understands that this is an overridden version of the same class. It will make the compiler check the base class to see if there is a virtual function with this exact signature. And if there is not, the compiler will show an error. "},{"code":null,"e":932,"s":657,"text":"The programmer’s intentions can be made clear to the compiler by override. If the override identifier is used with a member function, the compiler makes sure that the member function exists in the base class, and also the compiler restricts the program to compile otherwise."},{"code":null,"e":981,"s":932,"text":"Let’s understand through the following example: "},{"code":null,"e":985,"s":981,"text":"CPP"},{"code":"// A CPP program without override keyword, here// programmer makes a mistake and it is not caught#include using namespace std; class Base {public: // user wants to override this in // the derived class virtual void func() { cout << \"I am in base\" << endl; }}; class derived : public Base {public: // did a silly mistake by putting // an argument \"int a\" void func(int a) { cout << \"I am in derived class\" << endl; }}; // Driver codeint main(){ Base b; derived d; cout << \"Compiled successfully\" << endl; return 0;}","e":1553,"s":985,"text":null},{"code":null,"e":1575,"s":1553,"text":"Compiled successfully"},{"code":null,"e":2012,"s":1575,"text":"Explanation: Here, the user intended to override the function func() in the derived class but did a silly mistake and redefined the function with a different signature. Which was not detected by the compiler. However, the program is not actually what the user wanted. So, to get rid of such silly mistakes to be on the safe side, the override identifier can be used. Below is a C++ example to show the use of override identifier in C++."},{"code":null,"e":2016,"s":2012,"text":"CPP"},{"code":"// A CPP program that uses override keyword so// that any difference in function signature is// caught during compilation#include using namespace std; class Base {public: // user wants to override this in // the derived class virtual void func() { cout << \"I am in base\" << endl; }}; class derived : public Base {public: // did a silly mistake by putting // an argument \"int a\" void func(int a) override { cout << \"I am in derived class\" << endl; }}; int main(){ Base b; derived d; cout << \"Compiled successfully\" << endl; return 0;}","e":2603,"s":2016,"text":null},{"code":null,"e":2617,"s":2603,"text":"Output(Error)"},{"code":null,"e":2744,"s":2617,"text":"prog.cpp:17:7: error: 'void derived::func(int)'\nmarked 'override', but does not override\n void func(int a) override \n ^"},{"code":null,"e":2812,"s":2744,"text":"In short, it serves the following functions. It helps to check if: "},{"code":null,"e":2870,"s":2812,"text":"There is a method with the same name in the parent class."},{"code":null,"e":2971,"s":2870,"text":"The method in the parent class is declared as “virtual” which means it was intended to be rewritten."},{"code":null,"e":3056,"s":2971,"text":"The method in the parent class has the same signature as the method in the subclass."},{"code":null,"e":3481,"s":3056,"text":"This article is contributed by MAZHAR IMAM KHAN. If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to review-team@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above."},{"code":null,"e":3495,"s":3481,"text":"anshikajain26"},{"code":null,"e":3508,"s":3495,"text":"shivamgupta2"},{"code":null,"e":3520,"s":3508,"text":"cpp-virtual"},{"code":null,"e":3524,"s":3520,"text":"C++"},{"code":null,"e":3528,"s":3524,"text":"CPP"}],"string":"[\n {\n \"code\": null,\n \"e\": 54,\n \"s\": 26,\n \"text\": \"\\n13 Jun, 2022\"\n },\n {\n \"code\": null,\n \"e\": 657,\n \"s\": 54,\n \"text\": \"Function overriding is a redefinition of the base class function in its derived class with the same signature i.e. return type and parameters. But there may be situations when a programmer makes a mistake while overriding that function. So, to keep track of such an error, C++11 has come up with the override identifier. If the compiler comes across this identifier, it understands that this is an overridden version of the same class. It will make the compiler check the base class to see if there is a virtual function with this exact signature. And if there is not, the compiler will show an error. \"\n },\n {\n \"code\": null,\n \"e\": 932,\n \"s\": 657,\n \"text\": \"The programmer’s intentions can be made clear to the compiler by override. If the override identifier is used with a member function, the compiler makes sure that the member function exists in the base class, and also the compiler restricts the program to compile otherwise.\"\n },\n {\n \"code\": null,\n \"e\": 981,\n \"s\": 932,\n \"text\": \"Let’s understand through the following example: \"\n },\n {\n \"code\": null,\n \"e\": 985,\n \"s\": 981,\n \"text\": \"CPP\"\n },\n {\n \"code\": \"// A CPP program without override keyword, here// programmer makes a mistake and it is not caught#include using namespace std; class Base {public: // user wants to override this in // the derived class virtual void func() { cout << \\\"I am in base\\\" << endl; }}; class derived : public Base {public: // did a silly mistake by putting // an argument \\\"int a\\\" void func(int a) { cout << \\\"I am in derived class\\\" << endl; }}; // Driver codeint main(){ Base b; derived d; cout << \\\"Compiled successfully\\\" << endl; return 0;}\",\n \"e\": 1553,\n \"s\": 985,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 1575,\n \"s\": 1553,\n \"text\": \"Compiled successfully\"\n },\n {\n \"code\": null,\n \"e\": 2012,\n \"s\": 1575,\n \"text\": \"Explanation: Here, the user intended to override the function func() in the derived class but did a silly mistake and redefined the function with a different signature. Which was not detected by the compiler. However, the program is not actually what the user wanted. So, to get rid of such silly mistakes to be on the safe side, the override identifier can be used. Below is a C++ example to show the use of override identifier in C++.\"\n },\n {\n \"code\": null,\n \"e\": 2016,\n \"s\": 2012,\n \"text\": \"CPP\"\n },\n {\n \"code\": \"// A CPP program that uses override keyword so// that any difference in function signature is// caught during compilation#include using namespace std; class Base {public: // user wants to override this in // the derived class virtual void func() { cout << \\\"I am in base\\\" << endl; }}; class derived : public Base {public: // did a silly mistake by putting // an argument \\\"int a\\\" void func(int a) override { cout << \\\"I am in derived class\\\" << endl; }}; int main(){ Base b; derived d; cout << \\\"Compiled successfully\\\" << endl; return 0;}\",\n \"e\": 2603,\n \"s\": 2016,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 2617,\n \"s\": 2603,\n \"text\": \"Output(Error)\"\n },\n {\n \"code\": null,\n \"e\": 2744,\n \"s\": 2617,\n \"text\": \"prog.cpp:17:7: error: 'void derived::func(int)'\\nmarked 'override', but does not override\\n void func(int a) override \\n ^\"\n },\n {\n \"code\": null,\n \"e\": 2812,\n \"s\": 2744,\n \"text\": \"In short, it serves the following functions. It helps to check if: \"\n },\n {\n \"code\": null,\n \"e\": 2870,\n \"s\": 2812,\n \"text\": \"There is a method with the same name in the parent class.\"\n },\n {\n \"code\": null,\n \"e\": 2971,\n \"s\": 2870,\n \"text\": \"The method in the parent class is declared as “virtual” which means it was intended to be rewritten.\"\n },\n {\n \"code\": null,\n \"e\": 3056,\n \"s\": 2971,\n \"text\": \"The method in the parent class has the same signature as the method in the subclass.\"\n },\n {\n \"code\": null,\n \"e\": 3481,\n \"s\": 3056,\n \"text\": \"This article is contributed by MAZHAR IMAM KHAN. If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to review-team@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.\"\n },\n {\n \"code\": null,\n \"e\": 3495,\n \"s\": 3481,\n \"text\": \"anshikajain26\"\n },\n {\n \"code\": null,\n \"e\": 3508,\n \"s\": 3495,\n \"text\": \"shivamgupta2\"\n },\n {\n \"code\": null,\n \"e\": 3520,\n \"s\": 3508,\n \"text\": \"cpp-virtual\"\n },\n {\n \"code\": null,\n \"e\": 3524,\n \"s\": 3520,\n \"text\": \"C++\"\n },\n {\n \"code\": null,\n \"e\": 3528,\n \"s\": 3524,\n \"text\": \"CPP\"\n }\n]"}}},{"rowIdx":22,"cells":{"title":{"kind":"string","value":"PLSQL | UPPER Function"},"text":{"kind":"string","value":"11 Oct, 2019\nThe PLSQL UPPER function is used for converting all letters in the specified string to uppercase. If there are characters in the string that are not letters, they are unaffected by this function.\nThe char to be converted can be any of the datatypes such as CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The value returned by the UPPER function is the same datatype as char. The database sets the case of the characters based on the binary mapping defined for the underlying character set.\nSyntax:\nUPPER( string )\nParameters Used:\nstring – It is used to specify the string which needs to be converted.\nReturn Value:The UPPER function in PLSQL returns a string value.\nSupported Versions of Oracle/PLSQL\nOracle 12cOracle 11gOracle 10gOracle 9iOracle 8i\nOracle 12c\nOracle 11g\nOracle 10g\nOracle 9i\nOracle 8i\nExample-1: Passing a string as an argument with first character in uppercase and rest of the characters in lowercase.\nDECLARE \n Test_String string(20) := 'Geeksforgeeks';\n \nBEGIN \n dbms_output.put_line(UPPER(Test_String)); \n \nEND; \nOutput:\nGEEKSFORGEEKS \nExample-2: Passing a string as an argument with all the characters in lowercase.\nDECLARE \n Test_String string(20) := 'geeksforgeeks';\n \nBEGIN \n dbms_output.put_line(UPPER(Test_String)); \n \nEND; \nOutput:\nGEEKSFORGEEKS \nExample-3: Passing a string as an argument with numeric values and characters in lowercase.\nDECLARE \n Test_String string(20) := '123geeksforgeeks123';\n \nBEGIN \n dbms_output.put_line(UPPER(Test_String)); \n \nEND; \nOutput:\n123GEEKSFORGEEKS123 \nAdvantage:The UPPER function accepts any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB in the input_string.\nSQL-PL/SQL\nSQL\nSQL\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},"parsed":{"kind":"list like","value":[{"code":null,"e":28,"s":0,"text":"\n11 Oct, 2019"},{"code":null,"e":224,"s":28,"text":"The PLSQL UPPER function is used for converting all letters in the specified string to uppercase. If there are characters in the string that are not letters, they are unaffected by this function."},{"code":null,"e":521,"s":224,"text":"The char to be converted can be any of the datatypes such as CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The value returned by the UPPER function is the same datatype as char. The database sets the case of the characters based on the binary mapping defined for the underlying character set."},{"code":null,"e":529,"s":521,"text":"Syntax:"},{"code":null,"e":545,"s":529,"text":"UPPER( string )"},{"code":null,"e":562,"s":545,"text":"Parameters Used:"},{"code":null,"e":633,"s":562,"text":"string – It is used to specify the string which needs to be converted."},{"code":null,"e":698,"s":633,"text":"Return Value:The UPPER function in PLSQL returns a string value."},{"code":null,"e":733,"s":698,"text":"Supported Versions of Oracle/PLSQL"},{"code":null,"e":782,"s":733,"text":"Oracle 12cOracle 11gOracle 10gOracle 9iOracle 8i"},{"code":null,"e":793,"s":782,"text":"Oracle 12c"},{"code":null,"e":804,"s":793,"text":"Oracle 11g"},{"code":null,"e":815,"s":804,"text":"Oracle 10g"},{"code":null,"e":825,"s":815,"text":"Oracle 9i"},{"code":null,"e":835,"s":825,"text":"Oracle 8i"},{"code":null,"e":953,"s":835,"text":"Example-1: Passing a string as an argument with first character in uppercase and rest of the characters in lowercase."},{"code":null,"e":1076,"s":953,"text":"DECLARE \n Test_String string(20) := 'Geeksforgeeks';\n \nBEGIN \n dbms_output.put_line(UPPER(Test_String)); \n \nEND; "},{"code":null,"e":1084,"s":1076,"text":"Output:"},{"code":null,"e":1099,"s":1084,"text":"GEEKSFORGEEKS "},{"code":null,"e":1180,"s":1099,"text":"Example-2: Passing a string as an argument with all the characters in lowercase."},{"code":null,"e":1304,"s":1180,"text":"DECLARE \n Test_String string(20) := 'geeksforgeeks';\n \nBEGIN \n dbms_output.put_line(UPPER(Test_String)); \n \nEND; "},{"code":null,"e":1312,"s":1304,"text":"Output:"},{"code":null,"e":1327,"s":1312,"text":"GEEKSFORGEEKS "},{"code":null,"e":1419,"s":1327,"text":"Example-3: Passing a string as an argument with numeric values and characters in lowercase."},{"code":null,"e":1547,"s":1419,"text":"DECLARE \n Test_String string(20) := '123geeksforgeeks123';\n \nBEGIN \n dbms_output.put_line(UPPER(Test_String)); \n \nEND; "},{"code":null,"e":1555,"s":1547,"text":"Output:"},{"code":null,"e":1576,"s":1555,"text":"123GEEKSFORGEEKS123 "},{"code":null,"e":1704,"s":1576,"text":"Advantage:The UPPER function accepts any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB in the input_string."},{"code":null,"e":1715,"s":1704,"text":"SQL-PL/SQL"},{"code":null,"e":1719,"s":1715,"text":"SQL"},{"code":null,"e":1723,"s":1719,"text":"SQL"}],"string":"[\n {\n \"code\": null,\n \"e\": 28,\n \"s\": 0,\n \"text\": \"\\n11 Oct, 2019\"\n },\n {\n \"code\": null,\n \"e\": 224,\n \"s\": 28,\n \"text\": \"The PLSQL UPPER function is used for converting all letters in the specified string to uppercase. If there are characters in the string that are not letters, they are unaffected by this function.\"\n },\n {\n \"code\": null,\n \"e\": 521,\n \"s\": 224,\n \"text\": \"The char to be converted can be any of the datatypes such as CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The value returned by the UPPER function is the same datatype as char. The database sets the case of the characters based on the binary mapping defined for the underlying character set.\"\n },\n {\n \"code\": null,\n \"e\": 529,\n \"s\": 521,\n \"text\": \"Syntax:\"\n },\n {\n \"code\": null,\n \"e\": 545,\n \"s\": 529,\n \"text\": \"UPPER( string )\"\n },\n {\n \"code\": null,\n \"e\": 562,\n \"s\": 545,\n \"text\": \"Parameters Used:\"\n },\n {\n \"code\": null,\n \"e\": 633,\n \"s\": 562,\n \"text\": \"string – It is used to specify the string which needs to be converted.\"\n },\n {\n \"code\": null,\n \"e\": 698,\n \"s\": 633,\n \"text\": \"Return Value:The UPPER function in PLSQL returns a string value.\"\n },\n {\n \"code\": null,\n \"e\": 733,\n \"s\": 698,\n \"text\": \"Supported Versions of Oracle/PLSQL\"\n },\n {\n \"code\": null,\n \"e\": 782,\n \"s\": 733,\n \"text\": \"Oracle 12cOracle 11gOracle 10gOracle 9iOracle 8i\"\n },\n {\n \"code\": null,\n \"e\": 793,\n \"s\": 782,\n \"text\": \"Oracle 12c\"\n },\n {\n \"code\": null,\n \"e\": 804,\n \"s\": 793,\n \"text\": \"Oracle 11g\"\n },\n {\n \"code\": null,\n \"e\": 815,\n \"s\": 804,\n \"text\": \"Oracle 10g\"\n },\n {\n \"code\": null,\n \"e\": 825,\n \"s\": 815,\n \"text\": \"Oracle 9i\"\n },\n {\n \"code\": null,\n \"e\": 835,\n \"s\": 825,\n \"text\": \"Oracle 8i\"\n },\n {\n \"code\": null,\n \"e\": 953,\n \"s\": 835,\n \"text\": \"Example-1: Passing a string as an argument with first character in uppercase and rest of the characters in lowercase.\"\n },\n {\n \"code\": null,\n \"e\": 1076,\n \"s\": 953,\n \"text\": \"DECLARE \\n Test_String string(20) := 'Geeksforgeeks';\\n \\nBEGIN \\n dbms_output.put_line(UPPER(Test_String)); \\n \\nEND; \"\n },\n {\n \"code\": null,\n \"e\": 1084,\n \"s\": 1076,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 1099,\n \"s\": 1084,\n \"text\": \"GEEKSFORGEEKS \"\n },\n {\n \"code\": null,\n \"e\": 1180,\n \"s\": 1099,\n \"text\": \"Example-2: Passing a string as an argument with all the characters in lowercase.\"\n },\n {\n \"code\": null,\n \"e\": 1304,\n \"s\": 1180,\n \"text\": \"DECLARE \\n Test_String string(20) := 'geeksforgeeks';\\n \\nBEGIN \\n dbms_output.put_line(UPPER(Test_String)); \\n \\nEND; \"\n },\n {\n \"code\": null,\n \"e\": 1312,\n \"s\": 1304,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 1327,\n \"s\": 1312,\n \"text\": \"GEEKSFORGEEKS \"\n },\n {\n \"code\": null,\n \"e\": 1419,\n \"s\": 1327,\n \"text\": \"Example-3: Passing a string as an argument with numeric values and characters in lowercase.\"\n },\n {\n \"code\": null,\n \"e\": 1547,\n \"s\": 1419,\n \"text\": \"DECLARE \\n Test_String string(20) := '123geeksforgeeks123';\\n \\nBEGIN \\n dbms_output.put_line(UPPER(Test_String)); \\n \\nEND; \"\n },\n {\n \"code\": null,\n \"e\": 1555,\n \"s\": 1547,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 1576,\n \"s\": 1555,\n \"text\": \"123GEEKSFORGEEKS123 \"\n },\n {\n \"code\": null,\n \"e\": 1704,\n \"s\": 1576,\n \"text\": \"Advantage:The UPPER function accepts any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB in the input_string.\"\n },\n {\n \"code\": null,\n \"e\": 1715,\n \"s\": 1704,\n \"text\": \"SQL-PL/SQL\"\n },\n {\n \"code\": null,\n \"e\": 1719,\n \"s\": 1715,\n \"text\": \"SQL\"\n },\n {\n \"code\": null,\n \"e\": 1723,\n \"s\": 1719,\n \"text\": \"SQL\"\n }\n]"}}},{"rowIdx":23,"cells":{"title":{"kind":"string","value":"How to Solve java.lang.NoSuchMethodError in Java?"},"text":{"kind":"string","value":"28 Jul, 2021\nA java.lang.NoSuchMethodError as the name suggests, is a runtime error in Java which occurs when a method is called that exists at compile-time, but does not exist at runtime. The java.lang.NoSuchMethodError can occur in case application code is partially compiled, or in case an external dependency in a project incompatibly changed the code (e.g. removed the calling method) from one version to another. It is as shown in the illustration below as follows:\nIllustration:\njava.lang\nClass NoSuchMethodError\n java.lang.Object\n java.lang.Throwable\n java.lang.Error\n java.lang.LinkageError\n java.lang.IncompatibleClassChangeError\n java.lang.NoSuchMethodError\nNote: All Implemented Interfaces is Serializable interface in Java.\nNow let us discuss the causes behind this exception in order to figure out how to resolve the same problem. java.lang. It occurs when a particular method is not found. This method can either be an instance method or a static method. The java.lang.NoSuchMethodError occurs when an application does not find a method at runtime. In most cases, we’re able to catch this error at compile-time. Hence, it’s not a big issue. However, sometimes it could be thrown at runtime, then finding it becomes a bit difficult. According to the Oracle documentation, this error may occur at runtime if a class has been incomparably changed. Hence, we may encounter this error in the following cases. Firstly, if we do just a partial recompilation of our code. Secondly, if there is version incompatibility with the dependencies in our application, such as the external jars.\nNote: NoSuchMethodError inheritance tree includes IncompatibleClassChangeError and LinkageError. These errors are associated with an incompatible class change after compilation.\nImplementation:\nNow we will be proposing two examples in which first we will illustrate the thrown exception and, in later example, resolve the same via clean java problems.\nExample 1\nJava\n// Java Program to Demonstrate NoSuchMethodError by // throwing it due to a breaking change // introduced within an application // Importingn I/O classesimport java.io.*; // Class 1// Helper classclass NoSuchMethodError { // Method 1 // Void demo method created to be called // in another class containing main() method public void printer(String myString) { // Print statement System.out.println(myString); }} // Class 2// Main classpublic class GFG { // Main driver method public static void main(String[] args) { // Creating object of class 1 NoSuchMethodError obj = new NoSuchMethodError(); // Now calling print() method which is not present // in NoSuchMethodErrorExample class, hence throwing // exception obj.print(\"Hello World\"); }}\nOutput:\nNow if we try to draw out conclusions about the possible solution to resolve the above error. For that, we need to take care of two parameters as listed: \nCall correct method which is present in class.\nCheck the name of the method and its signature which you are trying to call.\nExample 2\nJava\n// Java Program to Resolve NoSuchMethodError // Importing input output classesimport java.io.*; // Class 1// Helper classclass NoSuchMethodError { // Defined printer method public void printer(String myString) { // Print the string which will be passed // in the main() method System.out.println(myString); }} // Class 2// Main Classpublic class GFG { // Main driver method public static void main(String[] args) { // Creating object of above class in // main() method of this class NoSuchMethodError obj = new NoSuchMethodError(); // Calling printer() method which is present in // NoSuchMethodErrorExample class obj.printer(\"Hello World\"); }}\nHello World\n\nJava-Exception Handling\nPicked\nJava\nJava\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},"parsed":{"kind":"list like","value":[{"code":null,"e":53,"s":25,"text":"\n28 Jul, 2021"},{"code":null,"e":512,"s":53,"text":"A java.lang.NoSuchMethodError as the name suggests, is a runtime error in Java which occurs when a method is called that exists at compile-time, but does not exist at runtime. The java.lang.NoSuchMethodError can occur in case application code is partially compiled, or in case an external dependency in a project incompatibly changed the code (e.g. removed the calling method) from one version to another. It is as shown in the illustration below as follows:"},{"code":null,"e":526,"s":512,"text":"Illustration:"},{"code":null,"e":787,"s":526,"text":"java.lang\nClass NoSuchMethodError\n java.lang.Object\n java.lang.Throwable\n java.lang.Error\n java.lang.LinkageError\n java.lang.IncompatibleClassChangeError\n java.lang.NoSuchMethodError"},{"code":null,"e":855,"s":787,"text":"Note: All Implemented Interfaces is Serializable interface in Java."},{"code":null,"e":1712,"s":855,"text":"Now let us discuss the causes behind this exception in order to figure out how to resolve the same problem. java.lang. It occurs when a particular method is not found. This method can either be an instance method or a static method. The java.lang.NoSuchMethodError occurs when an application does not find a method at runtime. In most cases, we’re able to catch this error at compile-time. Hence, it’s not a big issue. However, sometimes it could be thrown at runtime, then finding it becomes a bit difficult. According to the Oracle documentation, this error may occur at runtime if a class has been incomparably changed. Hence, we may encounter this error in the following cases. Firstly, if we do just a partial recompilation of our code. Secondly, if there is version incompatibility with the dependencies in our application, such as the external jars."},{"code":null,"e":1890,"s":1712,"text":"Note: NoSuchMethodError inheritance tree includes IncompatibleClassChangeError and LinkageError. These errors are associated with an incompatible class change after compilation."},{"code":null,"e":1906,"s":1890,"text":"Implementation:"},{"code":null,"e":2064,"s":1906,"text":"Now we will be proposing two examples in which first we will illustrate the thrown exception and, in later example, resolve the same via clean java problems."},{"code":null,"e":2074,"s":2064,"text":"Example 1"},{"code":null,"e":2079,"s":2074,"text":"Java"},{"code":"// Java Program to Demonstrate NoSuchMethodError by // throwing it due to a breaking change // introduced within an application // Importingn I/O classesimport java.io.*; // Class 1// Helper classclass NoSuchMethodError { // Method 1 // Void demo method created to be called // in another class containing main() method public void printer(String myString) { // Print statement System.out.println(myString); }} // Class 2// Main classpublic class GFG { // Main driver method public static void main(String[] args) { // Creating object of class 1 NoSuchMethodError obj = new NoSuchMethodError(); // Now calling print() method which is not present // in NoSuchMethodErrorExample class, hence throwing // exception obj.print(\"Hello World\"); }}","e":2919,"s":2079,"text":null},{"code":null,"e":2927,"s":2919,"text":"Output:"},{"code":null,"e":3082,"s":2927,"text":"Now if we try to draw out conclusions about the possible solution to resolve the above error. For that, we need to take care of two parameters as listed: "},{"code":null,"e":3129,"s":3082,"text":"Call correct method which is present in class."},{"code":null,"e":3206,"s":3129,"text":"Check the name of the method and its signature which you are trying to call."},{"code":null,"e":3216,"s":3206,"text":"Example 2"},{"code":null,"e":3221,"s":3216,"text":"Java"},{"code":"// Java Program to Resolve NoSuchMethodError // Importing input output classesimport java.io.*; // Class 1// Helper classclass NoSuchMethodError { // Defined printer method public void printer(String myString) { // Print the string which will be passed // in the main() method System.out.println(myString); }} // Class 2// Main Classpublic class GFG { // Main driver method public static void main(String[] args) { // Creating object of above class in // main() method of this class NoSuchMethodError obj = new NoSuchMethodError(); // Calling printer() method which is present in // NoSuchMethodErrorExample class obj.printer(\"Hello World\"); }}","e":3972,"s":3221,"text":null},{"code":null,"e":3985,"s":3972,"text":"Hello World\n"},{"code":null,"e":4009,"s":3985,"text":"Java-Exception Handling"},{"code":null,"e":4016,"s":4009,"text":"Picked"},{"code":null,"e":4021,"s":4016,"text":"Java"},{"code":null,"e":4026,"s":4021,"text":"Java"}],"string":"[\n {\n \"code\": null,\n \"e\": 53,\n \"s\": 25,\n \"text\": \"\\n28 Jul, 2021\"\n },\n {\n \"code\": null,\n \"e\": 512,\n \"s\": 53,\n \"text\": \"A java.lang.NoSuchMethodError as the name suggests, is a runtime error in Java which occurs when a method is called that exists at compile-time, but does not exist at runtime. The java.lang.NoSuchMethodError can occur in case application code is partially compiled, or in case an external dependency in a project incompatibly changed the code (e.g. removed the calling method) from one version to another. It is as shown in the illustration below as follows:\"\n },\n {\n \"code\": null,\n \"e\": 526,\n \"s\": 512,\n \"text\": \"Illustration:\"\n },\n {\n \"code\": null,\n \"e\": 787,\n \"s\": 526,\n \"text\": \"java.lang\\nClass NoSuchMethodError\\n java.lang.Object\\n java.lang.Throwable\\n java.lang.Error\\n java.lang.LinkageError\\n java.lang.IncompatibleClassChangeError\\n java.lang.NoSuchMethodError\"\n },\n {\n \"code\": null,\n \"e\": 855,\n \"s\": 787,\n \"text\": \"Note: All Implemented Interfaces is Serializable interface in Java.\"\n },\n {\n \"code\": null,\n \"e\": 1712,\n \"s\": 855,\n \"text\": \"Now let us discuss the causes behind this exception in order to figure out how to resolve the same problem. java.lang. It occurs when a particular method is not found. This method can either be an instance method or a static method. The java.lang.NoSuchMethodError occurs when an application does not find a method at runtime. In most cases, we’re able to catch this error at compile-time. Hence, it’s not a big issue. However, sometimes it could be thrown at runtime, then finding it becomes a bit difficult. According to the Oracle documentation, this error may occur at runtime if a class has been incomparably changed. Hence, we may encounter this error in the following cases. Firstly, if we do just a partial recompilation of our code. Secondly, if there is version incompatibility with the dependencies in our application, such as the external jars.\"\n },\n {\n \"code\": null,\n \"e\": 1890,\n \"s\": 1712,\n \"text\": \"Note: NoSuchMethodError inheritance tree includes IncompatibleClassChangeError and LinkageError. These errors are associated with an incompatible class change after compilation.\"\n },\n {\n \"code\": null,\n \"e\": 1906,\n \"s\": 1890,\n \"text\": \"Implementation:\"\n },\n {\n \"code\": null,\n \"e\": 2064,\n \"s\": 1906,\n \"text\": \"Now we will be proposing two examples in which first we will illustrate the thrown exception and, in later example, resolve the same via clean java problems.\"\n },\n {\n \"code\": null,\n \"e\": 2074,\n \"s\": 2064,\n \"text\": \"Example 1\"\n },\n {\n \"code\": null,\n \"e\": 2079,\n \"s\": 2074,\n \"text\": \"Java\"\n },\n {\n \"code\": \"// Java Program to Demonstrate NoSuchMethodError by // throwing it due to a breaking change // introduced within an application // Importingn I/O classesimport java.io.*; // Class 1// Helper classclass NoSuchMethodError { // Method 1 // Void demo method created to be called // in another class containing main() method public void printer(String myString) { // Print statement System.out.println(myString); }} // Class 2// Main classpublic class GFG { // Main driver method public static void main(String[] args) { // Creating object of class 1 NoSuchMethodError obj = new NoSuchMethodError(); // Now calling print() method which is not present // in NoSuchMethodErrorExample class, hence throwing // exception obj.print(\\\"Hello World\\\"); }}\",\n \"e\": 2919,\n \"s\": 2079,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 2927,\n \"s\": 2919,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 3082,\n \"s\": 2927,\n \"text\": \"Now if we try to draw out conclusions about the possible solution to resolve the above error. For that, we need to take care of two parameters as listed: \"\n },\n {\n \"code\": null,\n \"e\": 3129,\n \"s\": 3082,\n \"text\": \"Call correct method which is present in class.\"\n },\n {\n \"code\": null,\n \"e\": 3206,\n \"s\": 3129,\n \"text\": \"Check the name of the method and its signature which you are trying to call.\"\n },\n {\n \"code\": null,\n \"e\": 3216,\n \"s\": 3206,\n \"text\": \"Example 2\"\n },\n {\n \"code\": null,\n \"e\": 3221,\n \"s\": 3216,\n \"text\": \"Java\"\n },\n {\n \"code\": \"// Java Program to Resolve NoSuchMethodError // Importing input output classesimport java.io.*; // Class 1// Helper classclass NoSuchMethodError { // Defined printer method public void printer(String myString) { // Print the string which will be passed // in the main() method System.out.println(myString); }} // Class 2// Main Classpublic class GFG { // Main driver method public static void main(String[] args) { // Creating object of above class in // main() method of this class NoSuchMethodError obj = new NoSuchMethodError(); // Calling printer() method which is present in // NoSuchMethodErrorExample class obj.printer(\\\"Hello World\\\"); }}\",\n \"e\": 3972,\n \"s\": 3221,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 3985,\n \"s\": 3972,\n \"text\": \"Hello World\\n\"\n },\n {\n \"code\": null,\n \"e\": 4009,\n \"s\": 3985,\n \"text\": \"Java-Exception Handling\"\n },\n {\n \"code\": null,\n \"e\": 4016,\n \"s\": 4009,\n \"text\": \"Picked\"\n },\n {\n \"code\": null,\n \"e\": 4021,\n \"s\": 4016,\n \"text\": \"Java\"\n },\n {\n \"code\": null,\n \"e\": 4026,\n \"s\": 4021,\n \"text\": \"Java\"\n }\n]"}}},{"rowIdx":24,"cells":{"title":{"kind":"string","value":"How to get list of parameters name from a function in Python?"},"text":{"kind":"string","value":"29 Dec, 2020\nIn this article, we are going to discuss how to get list parameters from a function in Python. The inspect module helps in checking the objects present in the code that we have written. We are going to use two methods i.e. signature() and getargspec() methods from the inspect module to get the list of parameters name of function or method passed as an argument in one of the methods.\nBelow are some programs which depict how to use the signature() method of the inspect module to get the list of parameters name:\nExample 1: Getting the parameter list of a method.\nPython3\n# import required modulesimport inspectimport collections # use signature()print(inspect.signature(collections.Counter))\nOutput:\n(*args, **kwds)\nExample 2: Getting the parameter list of an explicit function.\nPython3\n# explicit functiondef fun(a, b): return a**b # import required modules import inspect # use signature() print(inspect.signature(fun)) \nOutput:\n(a, b)\nExample 3: Getting the parameter list of an in-built function.\nPython3\n# import required modules import inspect # use signature() print(inspect.signature(len))\nOutput:\n(obj, /)\nBelow are some programs which depict how to use the getargspec() method of the inspect module to get the list of parameters name:\nExample 1: Getting the parameter list of a method.\nPython3\n# import required modulesimport inspectimport collections # use getargspec()print(inspect.getargspec(collections.Counter))\nOutput:\nArgSpec(args=[], varargs=’args’, keywords=’kwds’, defaults=None)\nExample 2: Getting the parameter list of an explicit function.\nPython3\n# explicit functiondef fun(a, b): return a**b # import required modules import inspect # use getargspec() print(inspect.getargspec(fun)) \nOutput:\nArgSpec(args=[‘a’, ‘b’], varargs=None, keywords=None, defaults=None)\nExample 3: Getting the parameter list of an in-built function.\nPython3\n# import required modules import inspect # use getargspec() print(inspect.getargspec(len))\nOutput:\nArgSpec(args=[‘obj’], varargs=None, keywords=None, defaults=None)\nPicked\nPython function-programs\nPython-Functions\nTechnical Scripter 2020\nPython\nTechnical Scripter\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here.\nHow to Install PIP on Windows ?\nPython Classes and Objects\nIntroduction To PYTHON\nPython OOPs Concepts\nPython | os.path.join() method\nHow to drop one or multiple columns in Pandas Dataframe\nHow To Convert Python Dictionary To JSON?\nCheck if element exists in list in Python\nPython | Get unique values from a list\nPython | datetime.timedelta() function"},"parsed":{"kind":"list like","value":[{"code":null,"e":53,"s":25,"text":"\n29 Dec, 2020"},{"code":null,"e":439,"s":53,"text":"In this article, we are going to discuss how to get list parameters from a function in Python. The inspect module helps in checking the objects present in the code that we have written. We are going to use two methods i.e. signature() and getargspec() methods from the inspect module to get the list of parameters name of function or method passed as an argument in one of the methods."},{"code":null,"e":569,"s":439,"text":"Below are some programs which depict how to use the signature() method of the inspect module to get the list of parameters name:"},{"code":null,"e":620,"s":569,"text":"Example 1: Getting the parameter list of a method."},{"code":null,"e":628,"s":620,"text":"Python3"},{"code":"# import required modulesimport inspectimport collections # use signature()print(inspect.signature(collections.Counter))","e":750,"s":628,"text":null},{"code":null,"e":758,"s":750,"text":"Output:"},{"code":null,"e":774,"s":758,"text":"(*args, **kwds)"},{"code":null,"e":837,"s":774,"text":"Example 2: Getting the parameter list of an explicit function."},{"code":null,"e":845,"s":837,"text":"Python3"},{"code":"# explicit functiondef fun(a, b): return a**b # import required modules import inspect # use signature() print(inspect.signature(fun)) ","e":987,"s":845,"text":null},{"code":null,"e":995,"s":987,"text":"Output:"},{"code":null,"e":1002,"s":995,"text":"(a, b)"},{"code":null,"e":1065,"s":1002,"text":"Example 3: Getting the parameter list of an in-built function."},{"code":null,"e":1073,"s":1065,"text":"Python3"},{"code":"# import required modules import inspect # use signature() print(inspect.signature(len))","e":1164,"s":1073,"text":null},{"code":null,"e":1172,"s":1164,"text":"Output:"},{"code":null,"e":1181,"s":1172,"text":"(obj, /)"},{"code":null,"e":1312,"s":1181,"text":"Below are some programs which depict how to use the getargspec() method of the inspect module to get the list of parameters name:"},{"code":null,"e":1363,"s":1312,"text":"Example 1: Getting the parameter list of a method."},{"code":null,"e":1371,"s":1363,"text":"Python3"},{"code":"# import required modulesimport inspectimport collections # use getargspec()print(inspect.getargspec(collections.Counter))","e":1495,"s":1371,"text":null},{"code":null,"e":1503,"s":1495,"text":"Output:"},{"code":null,"e":1568,"s":1503,"text":"ArgSpec(args=[], varargs=’args’, keywords=’kwds’, defaults=None)"},{"code":null,"e":1631,"s":1568,"text":"Example 2: Getting the parameter list of an explicit function."},{"code":null,"e":1639,"s":1631,"text":"Python3"},{"code":"# explicit functiondef fun(a, b): return a**b # import required modules import inspect # use getargspec() print(inspect.getargspec(fun)) ","e":1783,"s":1639,"text":null},{"code":null,"e":1791,"s":1783,"text":"Output:"},{"code":null,"e":1860,"s":1791,"text":"ArgSpec(args=[‘a’, ‘b’], varargs=None, keywords=None, defaults=None)"},{"code":null,"e":1923,"s":1860,"text":"Example 3: Getting the parameter list of an in-built function."},{"code":null,"e":1931,"s":1923,"text":"Python3"},{"code":"# import required modules import inspect # use getargspec() print(inspect.getargspec(len))","e":2024,"s":1931,"text":null},{"code":null,"e":2032,"s":2024,"text":"Output:"},{"code":null,"e":2098,"s":2032,"text":"ArgSpec(args=[‘obj’], varargs=None, keywords=None, defaults=None)"},{"code":null,"e":2105,"s":2098,"text":"Picked"},{"code":null,"e":2130,"s":2105,"text":"Python function-programs"},{"code":null,"e":2147,"s":2130,"text":"Python-Functions"},{"code":null,"e":2171,"s":2147,"text":"Technical Scripter 2020"},{"code":null,"e":2178,"s":2171,"text":"Python"},{"code":null,"e":2197,"s":2178,"text":"Technical Scripter"},{"code":null,"e":2295,"s":2197,"text":"Writing code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},{"code":null,"e":2327,"s":2295,"text":"How to Install PIP on Windows ?"},{"code":null,"e":2354,"s":2327,"text":"Python Classes and Objects"},{"code":null,"e":2377,"s":2354,"text":"Introduction To PYTHON"},{"code":null,"e":2398,"s":2377,"text":"Python OOPs Concepts"},{"code":null,"e":2429,"s":2398,"text":"Python | os.path.join() method"},{"code":null,"e":2485,"s":2429,"text":"How to drop one or multiple columns in Pandas Dataframe"},{"code":null,"e":2527,"s":2485,"text":"How To Convert Python Dictionary To JSON?"},{"code":null,"e":2569,"s":2527,"text":"Check if element exists in list in Python"},{"code":null,"e":2608,"s":2569,"text":"Python | Get unique values from a list"}],"string":"[\n {\n \"code\": null,\n \"e\": 53,\n \"s\": 25,\n \"text\": \"\\n29 Dec, 2020\"\n },\n {\n \"code\": null,\n \"e\": 439,\n \"s\": 53,\n \"text\": \"In this article, we are going to discuss how to get list parameters from a function in Python. The inspect module helps in checking the objects present in the code that we have written. We are going to use two methods i.e. signature() and getargspec() methods from the inspect module to get the list of parameters name of function or method passed as an argument in one of the methods.\"\n },\n {\n \"code\": null,\n \"e\": 569,\n \"s\": 439,\n \"text\": \"Below are some programs which depict how to use the signature() method of the inspect module to get the list of parameters name:\"\n },\n {\n \"code\": null,\n \"e\": 620,\n \"s\": 569,\n \"text\": \"Example 1: Getting the parameter list of a method.\"\n },\n {\n \"code\": null,\n \"e\": 628,\n \"s\": 620,\n \"text\": \"Python3\"\n },\n {\n \"code\": \"# import required modulesimport inspectimport collections # use signature()print(inspect.signature(collections.Counter))\",\n \"e\": 750,\n \"s\": 628,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 758,\n \"s\": 750,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 774,\n \"s\": 758,\n \"text\": \"(*args, **kwds)\"\n },\n {\n \"code\": null,\n \"e\": 837,\n \"s\": 774,\n \"text\": \"Example 2: Getting the parameter list of an explicit function.\"\n },\n {\n \"code\": null,\n \"e\": 845,\n \"s\": 837,\n \"text\": \"Python3\"\n },\n {\n \"code\": \"# explicit functiondef fun(a, b): return a**b # import required modules import inspect # use signature() print(inspect.signature(fun)) \",\n \"e\": 987,\n \"s\": 845,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 995,\n \"s\": 987,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 1002,\n \"s\": 995,\n \"text\": \"(a, b)\"\n },\n {\n \"code\": null,\n \"e\": 1065,\n \"s\": 1002,\n \"text\": \"Example 3: Getting the parameter list of an in-built function.\"\n },\n {\n \"code\": null,\n \"e\": 1073,\n \"s\": 1065,\n \"text\": \"Python3\"\n },\n {\n \"code\": \"# import required modules import inspect # use signature() print(inspect.signature(len))\",\n \"e\": 1164,\n \"s\": 1073,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 1172,\n \"s\": 1164,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 1181,\n \"s\": 1172,\n \"text\": \"(obj, /)\"\n },\n {\n \"code\": null,\n \"e\": 1312,\n \"s\": 1181,\n \"text\": \"Below are some programs which depict how to use the getargspec() method of the inspect module to get the list of parameters name:\"\n },\n {\n \"code\": null,\n \"e\": 1363,\n \"s\": 1312,\n \"text\": \"Example 1: Getting the parameter list of a method.\"\n },\n {\n \"code\": null,\n \"e\": 1371,\n \"s\": 1363,\n \"text\": \"Python3\"\n },\n {\n \"code\": \"# import required modulesimport inspectimport collections # use getargspec()print(inspect.getargspec(collections.Counter))\",\n \"e\": 1495,\n \"s\": 1371,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 1503,\n \"s\": 1495,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 1568,\n \"s\": 1503,\n \"text\": \"ArgSpec(args=[], varargs=’args’, keywords=’kwds’, defaults=None)\"\n },\n {\n \"code\": null,\n \"e\": 1631,\n \"s\": 1568,\n \"text\": \"Example 2: Getting the parameter list of an explicit function.\"\n },\n {\n \"code\": null,\n \"e\": 1639,\n \"s\": 1631,\n \"text\": \"Python3\"\n },\n {\n \"code\": \"# explicit functiondef fun(a, b): return a**b # import required modules import inspect # use getargspec() print(inspect.getargspec(fun)) \",\n \"e\": 1783,\n \"s\": 1639,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 1791,\n \"s\": 1783,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 1860,\n \"s\": 1791,\n \"text\": \"ArgSpec(args=[‘a’, ‘b’], varargs=None, keywords=None, defaults=None)\"\n },\n {\n \"code\": null,\n \"e\": 1923,\n \"s\": 1860,\n \"text\": \"Example 3: Getting the parameter list of an in-built function.\"\n },\n {\n \"code\": null,\n \"e\": 1931,\n \"s\": 1923,\n \"text\": \"Python3\"\n },\n {\n \"code\": \"# import required modules import inspect # use getargspec() print(inspect.getargspec(len))\",\n \"e\": 2024,\n \"s\": 1931,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 2032,\n \"s\": 2024,\n \"text\": \"Output:\"\n },\n {\n \"code\": null,\n \"e\": 2098,\n \"s\": 2032,\n \"text\": \"ArgSpec(args=[‘obj’], varargs=None, keywords=None, defaults=None)\"\n },\n {\n \"code\": null,\n \"e\": 2105,\n \"s\": 2098,\n \"text\": \"Picked\"\n },\n {\n \"code\": null,\n \"e\": 2130,\n \"s\": 2105,\n \"text\": \"Python function-programs\"\n },\n {\n \"code\": null,\n \"e\": 2147,\n \"s\": 2130,\n \"text\": \"Python-Functions\"\n },\n {\n \"code\": null,\n \"e\": 2171,\n \"s\": 2147,\n \"text\": \"Technical Scripter 2020\"\n },\n {\n \"code\": null,\n \"e\": 2178,\n \"s\": 2171,\n \"text\": \"Python\"\n },\n {\n \"code\": null,\n \"e\": 2197,\n \"s\": 2178,\n \"text\": \"Technical Scripter\"\n },\n {\n \"code\": null,\n \"e\": 2295,\n \"s\": 2197,\n \"text\": \"Writing code in comment?\\nPlease use ide.geeksforgeeks.org,\\ngenerate link and share the link here.\"\n },\n {\n \"code\": null,\n \"e\": 2327,\n \"s\": 2295,\n \"text\": \"How to Install PIP on Windows ?\"\n },\n {\n \"code\": null,\n \"e\": 2354,\n \"s\": 2327,\n \"text\": \"Python Classes and Objects\"\n },\n {\n \"code\": null,\n \"e\": 2377,\n \"s\": 2354,\n \"text\": \"Introduction To PYTHON\"\n },\n {\n \"code\": null,\n \"e\": 2398,\n \"s\": 2377,\n \"text\": \"Python OOPs Concepts\"\n },\n {\n \"code\": null,\n \"e\": 2429,\n \"s\": 2398,\n \"text\": \"Python | os.path.join() method\"\n },\n {\n \"code\": null,\n \"e\": 2485,\n \"s\": 2429,\n \"text\": \"How to drop one or multiple columns in Pandas Dataframe\"\n },\n {\n \"code\": null,\n \"e\": 2527,\n \"s\": 2485,\n \"text\": \"How To Convert Python Dictionary To JSON?\"\n },\n {\n \"code\": null,\n \"e\": 2569,\n \"s\": 2527,\n \"text\": \"Check if element exists in list in Python\"\n },\n {\n \"code\": null,\n \"e\": 2608,\n \"s\": 2569,\n \"text\": \"Python | Get unique values from a list\"\n }\n]"}}},{"rowIdx":25,"cells":{"title":{"kind":"string","value":"settextstyle function in C"},"text":{"kind":"string","value":"01 Dec, 2021\nThe header file graphics.h contains settextstyle() function which is used to change the way in which text appears. Using it we can modify the size of text, change direction of text and change the font of text. Syntax : \nvoid settextstyle(int font, int direction, int font_size);\n\nwhere,\nfont argument specifies the font of text,\nDirection can be HORIZ_DIR (Left to right) \nor VERT_DIR (Bottom to top).\nExamples : \nInput : font = 8, direction = 0, font_size = 5\nOutput : \nInput : font = 3, direction = 0, font_size = 5\nOutput : \nThe table below shows the fonts with their INT values and appearance:\nBelow is the implementation of settextstyle() function : \nCPP\n// C++ implementation for// settextstyle() function#include // driver codeint main(){ // gm is Graphics mode which is // a computer display mode that // generates image using pixels. // DETECT is a macro defined in // \"graphics.h\" header file int gd = DETECT, gm; // initgraph initializes the // graphics system by loading // a graphics driver from disk initgraph(&gd, &gm, \"\"); // location of text int x = 150; int y = 150; // font style int font = 8; // font direction int direction = 0; // font size int font_size = 5; // for setting text style settextstyle(font, direction, font_size); // for printing text in graphics window outtextxy(x, y, \"Geeks For Geeks\"); getch(); // closegraph function closes the // graphics mode and deallocates // all memory allocated by graphics // system . closegraph(); return 0;}\nOutput: \nHax4us\ntheshaunsaw\nc-graphics\ncomputer-graphics\nC Language\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},"parsed":{"kind":"list like","value":[{"code":null,"e":52,"s":24,"text":"\n01 Dec, 2021"},{"code":null,"e":273,"s":52,"text":"The header file graphics.h contains settextstyle() function which is used to change the way in which text appears. Using it we can modify the size of text, change direction of text and change the font of text. Syntax : "},{"code":null,"e":455,"s":273,"text":"void settextstyle(int font, int direction, int font_size);\n\nwhere,\nfont argument specifies the font of text,\nDirection can be HORIZ_DIR (Left to right) \nor VERT_DIR (Bottom to top)."},{"code":null,"e":468,"s":455,"text":"Examples : "},{"code":null,"e":525,"s":468,"text":"Input : font = 8, direction = 0, font_size = 5\nOutput : "},{"code":null,"e":582,"s":525,"text":"Input : font = 3, direction = 0, font_size = 5\nOutput : "},{"code":null,"e":652,"s":582,"text":"The table below shows the fonts with their INT values and appearance:"},{"code":null,"e":711,"s":652,"text":"Below is the implementation of settextstyle() function : "},{"code":null,"e":715,"s":711,"text":"CPP"},{"code":"// C++ implementation for// settextstyle() function#include // driver codeint main(){ // gm is Graphics mode which is // a computer display mode that // generates image using pixels. // DETECT is a macro defined in // \"graphics.h\" header file int gd = DETECT, gm; // initgraph initializes the // graphics system by loading // a graphics driver from disk initgraph(&gd, &gm, \"\"); // location of text int x = 150; int y = 150; // font style int font = 8; // font direction int direction = 0; // font size int font_size = 5; // for setting text style settextstyle(font, direction, font_size); // for printing text in graphics window outtextxy(x, y, \"Geeks For Geeks\"); getch(); // closegraph function closes the // graphics mode and deallocates // all memory allocated by graphics // system . closegraph(); return 0;}","e":1651,"s":715,"text":null},{"code":null,"e":1661,"s":1651,"text":"Output: "},{"code":null,"e":1668,"s":1661,"text":"Hax4us"},{"code":null,"e":1680,"s":1668,"text":"theshaunsaw"},{"code":null,"e":1691,"s":1680,"text":"c-graphics"},{"code":null,"e":1709,"s":1691,"text":"computer-graphics"},{"code":null,"e":1720,"s":1709,"text":"C Language"}],"string":"[\n {\n \"code\": null,\n \"e\": 52,\n \"s\": 24,\n \"text\": \"\\n01 Dec, 2021\"\n },\n {\n \"code\": null,\n \"e\": 273,\n \"s\": 52,\n \"text\": \"The header file graphics.h contains settextstyle() function which is used to change the way in which text appears. Using it we can modify the size of text, change direction of text and change the font of text. Syntax : \"\n },\n {\n \"code\": null,\n \"e\": 455,\n \"s\": 273,\n \"text\": \"void settextstyle(int font, int direction, int font_size);\\n\\nwhere,\\nfont argument specifies the font of text,\\nDirection can be HORIZ_DIR (Left to right) \\nor VERT_DIR (Bottom to top).\"\n },\n {\n \"code\": null,\n \"e\": 468,\n \"s\": 455,\n \"text\": \"Examples : \"\n },\n {\n \"code\": null,\n \"e\": 525,\n \"s\": 468,\n \"text\": \"Input : font = 8, direction = 0, font_size = 5\\nOutput : \"\n },\n {\n \"code\": null,\n \"e\": 582,\n \"s\": 525,\n \"text\": \"Input : font = 3, direction = 0, font_size = 5\\nOutput : \"\n },\n {\n \"code\": null,\n \"e\": 652,\n \"s\": 582,\n \"text\": \"The table below shows the fonts with their INT values and appearance:\"\n },\n {\n \"code\": null,\n \"e\": 711,\n \"s\": 652,\n \"text\": \"Below is the implementation of settextstyle() function : \"\n },\n {\n \"code\": null,\n \"e\": 715,\n \"s\": 711,\n \"text\": \"CPP\"\n },\n {\n \"code\": \"// C++ implementation for// settextstyle() function#include // driver codeint main(){ // gm is Graphics mode which is // a computer display mode that // generates image using pixels. // DETECT is a macro defined in // \\\"graphics.h\\\" header file int gd = DETECT, gm; // initgraph initializes the // graphics system by loading // a graphics driver from disk initgraph(&gd, &gm, \\\"\\\"); // location of text int x = 150; int y = 150; // font style int font = 8; // font direction int direction = 0; // font size int font_size = 5; // for setting text style settextstyle(font, direction, font_size); // for printing text in graphics window outtextxy(x, y, \\\"Geeks For Geeks\\\"); getch(); // closegraph function closes the // graphics mode and deallocates // all memory allocated by graphics // system . closegraph(); return 0;}\",\n \"e\": 1651,\n \"s\": 715,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 1661,\n \"s\": 1651,\n \"text\": \"Output: \"\n },\n {\n \"code\": null,\n \"e\": 1668,\n \"s\": 1661,\n \"text\": \"Hax4us\"\n },\n {\n \"code\": null,\n \"e\": 1680,\n \"s\": 1668,\n \"text\": \"theshaunsaw\"\n },\n {\n \"code\": null,\n \"e\": 1691,\n \"s\": 1680,\n \"text\": \"c-graphics\"\n },\n {\n \"code\": null,\n \"e\": 1709,\n \"s\": 1691,\n \"text\": \"computer-graphics\"\n },\n {\n \"code\": null,\n \"e\": 1720,\n \"s\": 1709,\n \"text\": \"C Language\"\n }\n]"}}},{"rowIdx":26,"cells":{"title":{"kind":"string","value":"Python – Convert Snake Case String to Camel Case"},"text":{"kind":"string","value":"01 Oct, 2020\nGiven a snake case string, convert to camel case.\nInput : test_str = ‘geeksforgeeks_is_best_for_geeks’ Output : geeksforgeeksIsBestForGeeks Explanation : String converted to Camel Case.\nInput : test_str = ‘geeksforgeeks_best_for_geeks’ Output : geeksforgeeksBestForGeeks Explanation : String converted to Camel Case. \nMethod #1 : Using split() + join() + title() + generator expression\nThe combination of above functions can be used to solve this problem. In this, we first split all underscores, and then join the string appending initial word, followed by title cased words using generator expression and title().\nPython3\n# Python3 code to demonstrate working of # Convert Snake Case String to Camel Case# Using split() + join() + title() + generator expression # initializing stringtest_str = 'geeksforgeeks_is_best' # printing original stringprint(\"The original string is : \" + str(test_str)) # split underscore using splittemp = test_str.split('_') # joining result res = temp[0] + ''.join(ele.title() for ele in temp[1:]) # printing result print(\"The camel case string is : \" + str(res)) \nThe original string is : geeksforgeeks_is_best\nThe camel case string is : geeksforgeeksIsBest\n\nMethod #2 : Using split() + join() + title() + map()\nThe combination of above functions can be used to solve this problem. In this, we perform the task of extending logic to entire strings using map(). \nPython3\n# Python3 code to demonstrate working of # Convert Snake Case String to Camel Case# Using split() + join() + title() + map() # initializing stringtest_str = 'geeksforgeeks_is_best' # printing original stringprint(\"The original string is : \" + str(test_str)) # saving first and rest using split()init, *temp = test_str.split('_') # using map() to get all words other than 1st# and titlecasing themres = ''.join([init.lower(), *map(str.title, temp)]) # printing result print(\"The camel case string is : \" + str(res)) \nThe original string is : geeksforgeeks_is_best\nThe camel case string is : geeksforgeeksIsBest\n\nPython string-programs\nPython\nPython Programs\nWriting code in comment?\nPlease use ide.geeksforgeeks.org,\ngenerate link and share the link here."},"parsed":{"kind":"list like","value":[{"code":null,"e":28,"s":0,"text":"\n01 Oct, 2020"},{"code":null,"e":78,"s":28,"text":"Given a snake case string, convert to camel case."},{"code":null,"e":214,"s":78,"text":"Input : test_str = ‘geeksforgeeks_is_best_for_geeks’ Output : geeksforgeeksIsBestForGeeks Explanation : String converted to Camel Case."},{"code":null,"e":346,"s":214,"text":"Input : test_str = ‘geeksforgeeks_best_for_geeks’ Output : geeksforgeeksBestForGeeks Explanation : String converted to Camel Case. "},{"code":null,"e":414,"s":346,"text":"Method #1 : Using split() + join() + title() + generator expression"},{"code":null,"e":644,"s":414,"text":"The combination of above functions can be used to solve this problem. In this, we first split all underscores, and then join the string appending initial word, followed by title cased words using generator expression and title()."},{"code":null,"e":652,"s":644,"text":"Python3"},{"code":"# Python3 code to demonstrate working of # Convert Snake Case String to Camel Case# Using split() + join() + title() + generator expression # initializing stringtest_str = 'geeksforgeeks_is_best' # printing original stringprint(\"The original string is : \" + str(test_str)) # split underscore using splittemp = test_str.split('_') # joining result res = temp[0] + ''.join(ele.title() for ele in temp[1:]) # printing result print(\"The camel case string is : \" + str(res)) ","e":1132,"s":652,"text":null},{"code":null,"e":1227,"s":1132,"text":"The original string is : geeksforgeeks_is_best\nThe camel case string is : geeksforgeeksIsBest\n"},{"code":null,"e":1282,"s":1227,"text":"Method #2 : Using split() + join() + title() + map()"},{"code":null,"e":1432,"s":1282,"text":"The combination of above functions can be used to solve this problem. In this, we perform the task of extending logic to entire strings using map(). "},{"code":null,"e":1440,"s":1432,"text":"Python3"},{"code":"# Python3 code to demonstrate working of # Convert Snake Case String to Camel Case# Using split() + join() + title() + map() # initializing stringtest_str = 'geeksforgeeks_is_best' # printing original stringprint(\"The original string is : \" + str(test_str)) # saving first and rest using split()init, *temp = test_str.split('_') # using map() to get all words other than 1st# and titlecasing themres = ''.join([init.lower(), *map(str.title, temp)]) # printing result print(\"The camel case string is : \" + str(res)) ","e":1965,"s":1440,"text":null},{"code":null,"e":2060,"s":1965,"text":"The original string is : geeksforgeeks_is_best\nThe camel case string is : geeksforgeeksIsBest\n"},{"code":null,"e":2083,"s":2060,"text":"Python string-programs"},{"code":null,"e":2090,"s":2083,"text":"Python"},{"code":null,"e":2106,"s":2090,"text":"Python Programs"}],"string":"[\n {\n \"code\": null,\n \"e\": 28,\n \"s\": 0,\n \"text\": \"\\n01 Oct, 2020\"\n },\n {\n \"code\": null,\n \"e\": 78,\n \"s\": 28,\n \"text\": \"Given a snake case string, convert to camel case.\"\n },\n {\n \"code\": null,\n \"e\": 214,\n \"s\": 78,\n \"text\": \"Input : test_str = ‘geeksforgeeks_is_best_for_geeks’ Output : geeksforgeeksIsBestForGeeks Explanation : String converted to Camel Case.\"\n },\n {\n \"code\": null,\n \"e\": 346,\n \"s\": 214,\n \"text\": \"Input : test_str = ‘geeksforgeeks_best_for_geeks’ Output : geeksforgeeksBestForGeeks Explanation : String converted to Camel Case. \"\n },\n {\n \"code\": null,\n \"e\": 414,\n \"s\": 346,\n \"text\": \"Method #1 : Using split() + join() + title() + generator expression\"\n },\n {\n \"code\": null,\n \"e\": 644,\n \"s\": 414,\n \"text\": \"The combination of above functions can be used to solve this problem. In this, we first split all underscores, and then join the string appending initial word, followed by title cased words using generator expression and title().\"\n },\n {\n \"code\": null,\n \"e\": 652,\n \"s\": 644,\n \"text\": \"Python3\"\n },\n {\n \"code\": \"# Python3 code to demonstrate working of # Convert Snake Case String to Camel Case# Using split() + join() + title() + generator expression # initializing stringtest_str = 'geeksforgeeks_is_best' # printing original stringprint(\\\"The original string is : \\\" + str(test_str)) # split underscore using splittemp = test_str.split('_') # joining result res = temp[0] + ''.join(ele.title() for ele in temp[1:]) # printing result print(\\\"The camel case string is : \\\" + str(res)) \",\n \"e\": 1132,\n \"s\": 652,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 1227,\n \"s\": 1132,\n \"text\": \"The original string is : geeksforgeeks_is_best\\nThe camel case string is : geeksforgeeksIsBest\\n\"\n },\n {\n \"code\": null,\n \"e\": 1282,\n \"s\": 1227,\n \"text\": \"Method #2 : Using split() + join() + title() + map()\"\n },\n {\n \"code\": null,\n \"e\": 1432,\n \"s\": 1282,\n \"text\": \"The combination of above functions can be used to solve this problem. In this, we perform the task of extending logic to entire strings using map(). \"\n },\n {\n \"code\": null,\n \"e\": 1440,\n \"s\": 1432,\n \"text\": \"Python3\"\n },\n {\n \"code\": \"# Python3 code to demonstrate working of # Convert Snake Case String to Camel Case# Using split() + join() + title() + map() # initializing stringtest_str = 'geeksforgeeks_is_best' # printing original stringprint(\\\"The original string is : \\\" + str(test_str)) # saving first and rest using split()init, *temp = test_str.split('_') # using map() to get all words other than 1st# and titlecasing themres = ''.join([init.lower(), *map(str.title, temp)]) # printing result print(\\\"The camel case string is : \\\" + str(res)) \",\n \"e\": 1965,\n \"s\": 1440,\n \"text\": null\n },\n {\n \"code\": null,\n \"e\": 2060,\n \"s\": 1965,\n \"text\": \"The original string is : geeksforgeeks_is_best\\nThe camel case string is : geeksforgeeksIsBest\\n\"\n },\n {\n \"code\": null,\n \"e\": 2083,\n \"s\": 2060,\n \"text\": \"Python string-programs\"\n },\n {\n \"code\": null,\n \"e\": 2090,\n \"s\": 2083,\n \"text\": \"Python\"\n },\n {\n \"code\": null,\n \"e\": 2106,\n \"s\": 2090,\n \"text\": \"Python Programs\"\n }\n]"}}},{"rowIdx":27,"cells":{"title":{"kind":"string","value":"How to set the dropdown button in the center?"},"text":{"kind":"string","value":"26 Aug, 2020\nDropdown menu is a menu that offers a list of options to choose from. The title of the menu is always in display and the rest of the items are hidden. It is a toggleable menu in which all the items can be shown by clicking on it.\nDropdown button can be positioned in the center of the page by setting the “text-align” property of dropdown div to center. The following example contains a simple Bootstrap dropdown menu with an added class “my-menu”. The property “text-align: center” is added to the class.\nExample: Here, the property “text-align: center” aligns the content of dropdown div to center, which sets the dropdown button to the center.\n