This file contains 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
<?php | |
/** | |
* by Adrian Statescu <adrian@thinkphp.ro> | |
* Twitter: @thinkphp | |
* G+ : http://gplus.to/thinkphp | |
* MIT Style License | |
*/ | |
This file contains 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
<!DOCTYPE html> | |
<head> | |
<title>HTML Layout</title> | |
<style> | |
* { | |
box-sizing: border-box; | |
} | |
body { |
This file contains 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
Un element HTML este definit printr-un: | |
START TAG - content - END TAG | |
start content end tag | |
<h1 attributes> my first heading </h1> | |
<p> my first p </p> |
This file contains 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
''' | |
Reverse the order of the items in the array. | |
@thinkphp | |
MIT Style License | |
''' | |
arr = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31] | |
def reverse(arr): | |
m = len(arr) / 2 | |
n = len(arr) - 1 | |
for i in range(m): |
This file contains 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
''' | |
sin(x) = x-x^3/3!+x^5/5!-x^7/7!+..- | |
''' | |
import math | |
def fact(n): | |
if n==0: | |
return 1 | |
else: | |
return n*fact(n-1) |
This file contains 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
''' | |
Computes SQuare RooT in Python SQRT | |
s = (s+nr/s)1/2 | |
Twitter : http://twitter.com/thinkphp | |
Website : http://thinkphp.ro | |
Google Plus : http://gplus.to/thinkphp | |
MIT Style License | |
''' |
This file contains 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
/** | |
* | |
* Author : Adrian Statescu mergesortv@gmail.com http://adrianstatescu.com | |
* | |
* C program to compute the value of PI using formula's Leibniz. | |
* PI approximate 4 ( 1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11... | |
* | |
* MIT License | |
* | |
*/ |
This file contains 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
#Luhn Python checksum for credit card validation | |
import sys | |
def luhn(n): | |
sum = 0 | |
alt = 0 | |
i = len(n) - 1 |
This file contains 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
;Test if a number is prime or NOT. | |
;Adrian Statescu <mergesortv@gmail.com> | |
;License | |
;MIT | |
;Cheers! | |
(defun forall(L P) | |
(if (null L) | |
T | |
(and (FUNCALL P (cAR L)) (forall (CDR L) P) ) |
This file contains 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{f(x) g'(x) \ dx} = fg - \int{ g(x) f'(x) \ dx}$ | |
$\int{cos^2x \ dx} = \int{cos \ x \ cos \ x \ dx} = \int{cos \ x \ (sin \ x)' \ dx} = cos \ x \ sin \ x - \int{sin \ x \ (cos \ x)' \ dx} = cos \ x \ sin \ x - \int{sin \ x \ sin \ x \ dx} = cos \ x \ sin \ x - \int{sin^2 \ x \ dx} = sin\ x \ cos \ x + \int{sin^2 \ x \ dx} = sin\ x \ cos \ x + \int{ (1 - cos^2 \ x) \ x \ dx} = sin\ x \ cos \ x + \int{ 1 \ dx} - \int{ cos^2 \ x \ dx} = sin\ x \ cos \ x + x - \int{ cos^2 \ x \ dx} => \int \cos ^2x\,dx=\frac{x+\sin x\cos x}{2}+C. $ |
NewerOlder