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
~/D/Camera Uploads ❯❯❯ IFS=$'\n'; for f in $(ls | cat) | |
do | |
folder=$(echo $f | sed "s/\(\) \([0-9][0-9]\.[0-9][0-9]\.[0-9][0-9].*\)/\1/g" | sed "s/-/_/g") | |
echo "Moving $f to $folder" | |
mv $f ~/BACKUP/$folder | |
done |
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
/* Begin Images */ | |
p img { | |
padding: 0; | |
max-width: 100%; | |
} | |
/* Using 'class="alignright"' on an image will (who would've | |
thought?!) align the image to the right. And using 'class="centered', | |
will of course center the image. This is much better than using | |
align="center", being much more futureproof (and valid) */ |
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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package ostap.chyselni; | |
/** | |
* | |
* @author Ostap.Andrusiv | |
*/ |
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
/* | |
При фиксированном значении k биномиальные коэффициенты могут быть вычислены по рекуррентной формуле | |
(n k) = n/(n-k) * (n-1 k) | |
с начальным значением (k k) = 1. Для вычисления значения этот метод требует O(1) памяти и O(n) времени. | |
*/ | |
package ua.org.pifostap; | |
import java.io.*; | |
import java.util.Scanner; |
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.math.BigDecimal; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import processing.core.PApplet; | |
import processing.core.PVector; | |
/** | |
* | |
* @author Ostap |
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
Procedure to mount ISO images under Linux | |
1) You must login as a root user, if not root user then switch to root user using following command: | |
$ su - | |
2) Create the directory i.e. mount point: | |
# mkdir -p /mnt/disk | |
3) Use mount command as follows to mount iso file called disk1.iso: | |
# mount -o loop disk1.iso /mnt/disk |
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
#include <iostream> | |
#include <string> | |
#include <fstream> | |
//#include <stdlib.h> | |
using namespace std; | |
int* generateHeightArray(int h, int mesLen) { | |
int* idxs = new int[mesLen]; |
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
static public final float map(float value, | |
float istart, float istop, | |
float ostart, float ostop) { | |
return ostart + (ostop - ostart) * ((value - istart) / (istop - istart)); | |
} |
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
#include <iostream> | |
using namespace std; | |
int gcd(int a,int b) { | |
if (!b) { | |
return a; | |
} | |
cout<<a<<"="<<b<<"*"<<a/b<<"+"<<a%b<<endl; | |
return gcd(b, a%b); |
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
http://homepages.gold.ac.uk/rachel/Mods.doc | |
To compute x^n mod p | |
Initialise y=1; u=x mod p; | |
Repeat | |
If n is odd then y:=(y*u) mod p; | |
n:=n div 2; | |
u:=(u*u) mod p; | |
Until n==0; |
OlderNewer