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
| ''' | |
| calculate definite integral for given intervals and slices | |
| +startPoint+:: float | |
| +endPoint+:: float | |
| +numberofSlices+:: integer | |
| ''' | |
| def integral(startPoint,endPoint,numberofSlices) | |
| # change for each iteration | |
| deltaX = (endPoint-startPoint)/numberofSlices | |
| # total area and iteration area, must be defined here before used |
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
| #!/bin/bash | |
| numberoffiles=$1 | |
| for i in `seq 1 $numberoffiles` | |
| do dd if=/dev/zero of=`date +%N`.file bs=1024 count=16000 | |
| done |
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
| #!/bin/bash | |
| dirno=1 | |
| fileno=0 | |
| for i in `ls *.JPG` | |
| do | |
| mod=$(($fileno%40)) | |
| if [ "$mod" -eq "0" ] | |
| then | |
| dir="g$dirno" | |
| mkdir $dir |
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
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| func main() { | |
| for { | |
| fmt.Print("Enter text: ") |
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
| package main | |
| import ( | |
| "database/sql" | |
| "fmt" | |
| _ "github.com/mattn/go-sqlite3" | |
| "log" | |
| "time" | |
| ) |
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
| CREATE OR REPLACE FUNCTION fibonacci(num integer) | |
| RETURNS SETOF numeric AS $$ | |
| DECLARE | |
| a numeric := 0; | |
| b numeric := 1; | |
| BEGIN | |
| IF (num <= 0) | |
| THEN RETURN; | |
| END IF; | |
| RETURN NEXT 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
| :%s/^Uzunluk\(.*\)$/^I^IUzunluk\1/g |
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
| a file with hours:minutes:seconds | |
| 00:38:14 | |
| 16:31:37 | |
| 03:49:50 | |
| 04:14:06 | |
| 07:21:27 | |
| 03:10:47 | |
| 02:30:22 | |
| 01:45:49 |
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
| import turtle | |
| import random | |
| import sys | |
| def r(): | |
| return random.randint(0, 255) | |
| screen = turtle.Screen() | |
| screen.bgcolor("#fff") | |
| screen.colormode(255) |
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
| &{ ForEach ($esx in Get-VMHost) { | |
| $vCPU = Get-VM -Location $esx | Measure-Object -Property NumCpu -Sum | select -ExpandProperty Sum | |
| $esx | Select Name, | |
| @{N='pCPU cores available';E={$_.NumCpu}}, | |
| @{N='vCPU assigned to VMs';E={$vCPU}}, | |
| @{N='Ratio';E={[math]::Round($vCPU/$_.NumCpu,1)}}, | |
| @{N='CPU Overcommit (%)';E={[Math]::Round(100*(($vCPU - $_.NumCpu) / $_.NumCpu), 1)}} | |
| } } | Export-Csv report.csv -NoTypeInformation -UseCulture |
OlderNewer