Skip to content

Instantly share code, notes, and snippets.

<?php
use Nette\Application\Presenter;
abstract class BasePresenter extends Presenter{
//put your code here
public $oldLayoutMode = FALSE;
public function beforeRender() {
$this->template->menuItems = array(
'Domů' => 'Default',
<?php
require_once 'facebook_crap_init.php';
$facebook->api('/137924592933057/likes', 'POST');
?>
@simekadam
simekadam / gist:934030
Created April 21, 2011 09:08
Metoda pro rozparsovani textu pred encryptaci
void prepareStringToEncrypt() {
this.pairsToEncrypt = new HashMap<Integer, String>();
String alterTextToEncrypt = this.textToEncrypt.replaceAll(" ", "");
alterTextToEncrypt = Normalizer.normalize(alterTextToEncrypt, Form.NFD).replaceAll("[^\\p{ASCII}]", "");
alterTextToEncrypt = alterTextToEncrypt.replaceAll("[^A-Z]", "");
//System.out.println( "e "+this.password+" "+alterTextToEncrypt);
int increment = 0;
int index = 0;
if (alterTextToEncrypt.length() % 2 != 0) {
alterTextToEncrypt = alterTextToEncrypt.concat("X");
@simekadam
simekadam / gist:934062
Created April 21, 2011 09:28
Upravena metoda pro parsovani textu
void prepareStringToEncrypt() {
this.pairsToEncrypt = new HashMap<Integer, String>();
String alterTextToEncrypt = this.textToEncrypt.replaceAll(" ", "");
alterTextToEncrypt = Normalizer.normalize(alterTextToEncrypt, Form.NFD).replaceAll("[^\\p{ASCII}]", "");
alterTextToEncrypt = alterTextToEncrypt.replaceAll("[^A-Z]", "");
//System.out.println( "e "+this.password+" "+alterTextToEncrypt);
int increment = 0;
int index = 0;
if (alterTextToEncrypt.length() % 2 != 0) {
alterTextToEncrypt = alterTextToEncrypt.concat("X");
//ramp-speed - play with this value until satisfied
final float kFilteringFactor = 0.0f;
//last result storage - keep definition outside of this function, eg. in wrapping object
float accel[] = new float[3];
float result[] = new float[3];
//acceleration.x,.y,.z is the input from the sensor
//result.x,.y,.z is the filtered result
public class SpeechHelper implements OnInitListener {
private static TextToSpeech mTts;
private String text; //data to speech
private static SpeechHelper helper;
public static SpeechHelper getInstance(){
if(helper == null){
helper = new SpeechHelper();
}
@simekadam
simekadam / gist:1397671
Created November 27, 2011 15:08
mapy.cz
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Brno, Nové sady 40 - Mapy.cz</title><meta name="description" content="Nejpoužívanější mapový portál www.mapy.cz umožňuje podrobné hledání na mapách České republiky i celé Evropy. Nabízí plány všech českých měst a obcí, plánovač tras a nejúplnější databázi bodů zájmu (firem) na českém internetu. Obsahuje automapu, turistická mapu s turistickými trasami a cyklostezkami, fotomapu (letecké snímky) a historické mapy."><meta name="application-name" content="Mapy.cz"><link href="/css/userweb.css?62" rel="stylesheet" type="text/css"><link href="/css/jak/lightbox.css?62" rel="stylesheet" type="text/css"><link href="/css/jak/suggest2.css?62" rel="stylesheet" type="text/css"><link href="/css/print.css?62" rel="stylesheet" type="text/css" media="print"><script type="text/javascript" src="http://api4.mapy.cz/loader.js"></script><script type="text/javascript">try {Loader.load();} catch(e){alert(e)}</sc
@simekadam
simekadam / gist:1466350
Created December 12, 2011 10:06
config file
<?xml version="1.0" encoding="UTF-8"?>
<panorama>
<!-- Pano2VR 3.1.2 panorama configuration -->
<view fovmode="0">
<start pan="158" tilt="-0.5" fov="90"/>
<min pan="0" tilt="-90" fov="55"/>
<max pan="360" tilt="90" fov="140"/>
</view>
<input tilesize="1250" tilescale="1.008" tile0url="pano_images/001_hall1_o_0.jpg" tile1url="pano_images/001_hall1_o_1.jpg" tile2url="pano_images/001_hall1_o_2.jpg" tile3url="pano_images/001_hall1_o_3.jpg" tile4url="pano_images/001_hall1_o_4.jpg" tile5url="pano_images/001_hall1_o_5.jpg" />
<altinput screensize="1000" tilesize="800" tilescale="1.008" tile0url="images/001_hall1_o_800_0.jpg" tile1url="images/001_hall1_o_800_1.jpg" tile2url="images/001_hall1_o_800_2.jpg" tile3url="images/001_hall1_o_800_3.jpg" tile4url="images/001_hall1_o_800_4.jpg" tile5url="images/001_hall1_o_800_5.jpg" />
Iterator it1 = left.oneStepRewrite().iterator();
while(it.hasNext()){
s.add(new Addition(it.next(), right));
}
Iterator<Expr> it2 = right.oneStepRewrite().iterator();
while(it.hasNext()){
s.add(new Addition(left, it.next()));
}
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import java.util.HashSet;
import java.util.Set;
interface FJExpression {
}