This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int gcd( int a, int b) | |
| { | |
| int temp; | |
| while(b>0) | |
| { | |
| if(a>b) | |
| {temp=a; | |
| a=b; | |
| b=temp;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function threepoints(a,b,c) | |
| if( length(a) ~= 3 || length(b) ~= 3 || length(c) ~= 3 ) | |
| error('invalid points. points are like (x,y,z)'); | |
| end; | |
| v1 = b - a; | |
| v2 = c - a; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function interpolation(x,y) | |
| boyut = length(x); | |
| for i=1:boyut | |
| for j=1:boyut | |
| if( j==1) mat(i,j) = 1; | |
| continue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function y = distance(a,b) | |
| if length(a) == length(b) | |
| size = length(a); | |
| if size < 2 | |
| error('The vectors size must greater than one'); | |
| end; | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function y = dot(a,b) | |
| if length(a) == length(b) | |
| size = length(a); | |
| if size < 2 | |
| error('The vectors size must greater than one'); | |
| end; | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'net/http' | |
| Net::HTTP.get_print_rsl('SİTENİNFULLADRESİ', 'SİTENİN DİZİNİ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'net/http' | |
| puts "Enter the site adress you want to suck: | |
| Note that, directory must be specified | |
| For example: http://regularlambda.github.com/blabla | |
| or simply http://regularlambda.github.com/" | |
| a = gets | |
| url = URI.parse(a.chomp!) | |
| response = Net::HTTP.start(url.host, url.port) do |http| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd ~/scala | |
| sudo ln -s scala scala | |
| cd /usr/local/bin | |
| sudo ln -s ~/scala/bin/scala scala | |
| sudo ln -s ~/scala/bin/fsc fsc | |
| sudo ln -s ~/scala/bin/scalac scalac | |
| sudo ln -s ~/scala/bin/scaladoc scaladoc | |
| cd ~ | |
| scala |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Newbie programmer | |
| def factorial(x): | |
| if x == 0: | |
| return 1 | |
| else: | |
| return x * factorial(x - 1) | |
| print factorial(6) | |
| #First year programmer, studied Pascal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Newbie programmer | |
| $input=<>; | |
| sub factorial { | |
| $s=1; | |
| $r=1; | |
| while ($s <= $input) { | |
| $r *= $s; | |
| $s++; | |
| } | |
| if($input == 0) |
OlderNewer