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
/** | |
* Copyright (c) 2013 Janis Rublevskis - koko@xit.lv | http://nobody.lv | |
* Licensed under MIT. | |
* @author Janis Rublevskis | |
* @version 1.0.0.0 | |
*/ | |
(function ($) { | |
$.fn.checkFocus = function() { | |
var obj = $(this); | |
obj.each(function(){ |
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
#.htaccess for CI projects | |
RewriteEngine on | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php?/$1 [QSA,L] |
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
commit 50a863b945151d050e99580bbfe8993e35f2318a | |
Author: Janis Rublevskis <janis@xit.lv> | |
Date: Tue Sep 23 22:05:25 2014 +0300 | |
pabeigtas migraacijas, admin posti | |
- migraacijas ar visiem datiem | |
- izraveeti liekie kontrolieri (jaa taadi bija) | |
- migraacijas postu un komentaaru tabulaam | |
- postu un komentaaru kontrolieri un modelji |
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
ir ul li koks ar zariem, kas izveidojas dinamiski un dziļums var būt dažāds! | |
Vajag ar css pamainīt dziļākā ul fontu. | |
piemērs: | |
<style> | |
ul li { font-weight: bold} | |
</style> | |
<ul> | |
<li> | |
Pirmais |
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
RewriteEngine On | |
RewriteBase /201504hokejaeksperti/ | |
# Redirect Trailing Slashes... | |
RewriteRule ^(.*)/$ /$1 [L,R=301] | |
# Handle Front Controller... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ index.php [L] |
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
Problēmas apraksts: ir doti random skaits vienāda veida kvadrāti. Šos kvadrātus jāsakārto taisnstūra laukumā tā, lai būtu aizpildīts pilns taisnstūris un pāri paliktu pēc iespējas mazāk kvadrātu. Maksimālais X un Y dimensiju lielums ir 200 kvadrāti katrā dimensijā. | |
Piemērs: | |
Pieņemsim, ka max X un Y lielums ir 6. | |
Ir doti 10 kvadrāti. | |
Labākais sakārtošanas vieds būtu 5 kvadrāti pa vienu asi un 2 kvadrāti pa otru (pārpalikuma nav). | |
Ja liks pilnu 6x2, tad pāri paliks 4 kvadrāti. Ja liks 4x2, tad pāri palis 2 kvadrāti un līdzīgi. | |
Risinājums: vajadzētu daudz maz optimālu algoritmu, lai noteiktu vajadzīgās dimensijas, atmetot pēc iespējas mazāk kvadrātus. |
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 hid | |
import re | |
class Relay: | |
def __init__(self, debug=False): | |
# USBrelay<relay-count> | |
self.vendor_id = 0x16c0 | |
self.product_id = 0x05df | |
self.debug = debug |
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 Adafruit_DHT | |
while True: | |
try: | |
humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.DHT11, 4) | |
print "Temperature: " + str(temperature) | |
except (KeyboardInterrupt, SystemExit): | |
print "\nInterrupted by user" | |
break |
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 time | |
import datetime | |
import Adafruit_DHT | |
from relay import Relay | |
from subprocess import check_output | |
# te es definēju vēlamās temperatūras (DHT11 mēdz kļūdīties par +/- 1 grādu pēc Celsija) | |
maxTempNormal = 23 | |
maxTempHollyday = 20 |
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
#!/usr/bin/bash | |
cd /home/pi/teirproga | |
sudo python ./termo-regulation.py |
OlderNewer