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
import java.io.*; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipInputStream; | |
public class UnzipUtility | |
{ | |
/** | |
* Size of the buffer to read/write data | |
*/ | |
private static final int BUFFER_SIZE = 4096; |
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
import com.google.zxing.BinaryBitmap; | |
import com.google.zxing.EncodeHintType; | |
import com.google.zxing.MultiFormatReader; | |
import com.google.zxing.Result; | |
import com.google.zxing.client.j2se.BufferedImageLuminanceSource; | |
import com.google.zxing.common.HybridBinarizer; | |
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; | |
import javax.imageio.ImageIO; | |
import java.io.ByteArrayInputStream; |
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
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URL; | |
import java.nio.channels.Channels; | |
import java.nio.channels.ReadableByteChannel; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.UUID; |
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 | |
/** | |
* @param {Integer} $n number of fibonacci sequence items | |
* @return {String} fibonacci numbers calculated using iterative | |
*/ | |
function fibonacciNonRec($n){ | |
if($n == 1) return '1'; | |
if($n == 2) return '1, 1'; | |
else { | |
$ret = '1, 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
<?php | |
/** | |
* @param {Integer} $n number of fibonacci sequence items | |
* @return {String} fibonacci numbers calculated using recursion | |
*/ | |
function fibonacciRec($n, $a = array()){ | |
if(!isset($a[0]) || $a[0] != 1){ | |
$a[0] = 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
#!/bin/bash | |
if [[ -d $1 ]]; then | |
echo "$1 is a directory" | |
scp -r $1 [email protected]:/home/user/folderToUploadTo | |
elif [[ -f $1 ]]; then | |
echo "$1 is a file" | |
scp $1 [email protected]:/home/user/folderToUploadTo | |
else | |
echo "error $1 is not valid" | |
exit 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
function [singular, x] = gaussian(A, b) | |
rozmiar = size(A, 1); | |
zmiany = zeros(rozmiar, 1); | |
e = 1E-12; | |
eglowny = 0; | |
bool = 1; | |
for i=1:rozmiar | |
zmiany(i,1) = i; | |
//wybor elementu glownego |
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
function [value] = gauss_seidel(A, b, x0, n) | |
rozmiar = size(A,1); | |
suma1 = 0; | |
suma2 = 0; | |
r = x0; //kolejne przyblizenia | |
for k=1 : n //wykonaj n krokow metody | |
for w=1 : rozmiar //kolejne wspolrzedne rozwiazania w k-tym kroku metody | |
//wykorzystuje 'stare' r |
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
function [x] = minimal (A, b) | |
x = linsolve(A'*A,-(A'*b)) | |
endfunction |
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
function [result] = gauss_quadrature(f,lower, upper, n, intervals) | |
res = 0; | |
bigInterval = upper - lower; | |
smallInterval = bigInterval/intervals; | |
down = lower; | |
up = down + smallInterval; | |
for i=1:intervals | |
calk = 0; |
NewerOlder