Monday, November 16, 2015

filteri

Ovo verovatno niste znali...

Crkao Vam je hard disk, ali treba Vam kompjuter bar dok ne skupite pare za novi hard disk. Nema problema, otkačite svoj hard disk od matične ploče. Podesite BIOS da čita sa USB-a ili CD-a.

Preuzmite sa sledećih sajtova ZIP ili ISO datoteku, prva je za kopiranje na USB, a druga za narezivanje na CD.

Datoteke su oko 220 MB, a sadrže sve što vam treba:

https://www.slax.org/en/download.php

Ako ste nezajažljivi pa Vam treba još više, onda imate sve u "modulima", kao dodatnu višnju na torti:

https://www.slax.org/en/modules.php?

Naravno ovaj linux možete koristiti i pored Vašeg ispravnog hard diska, ali tada treba takodje podesiti BIOS kompjutera da se diže sa CD-a ili USB-a.

Treba naglasiti da upotrebom ovog linux-a, ne utičete na osnovni operativni sistem koji je na hard disku, a sve izmene se snimaju na USB.

Ova verzija je idealna kod upotrebe bankarskih web aplikacija, jer je sigurnija od "normalnog" operativnog sistema.

Druga prednost je da nema virusa i malvera.

Treća prednost je da ne morate instalirati neki veliki "ćudljivi" linux poput Ubuntu-a, koji možda i ne bude dobro radio posle kompletne instalacije. O Windowsu, ne vredi trošiti reči, instalacija Windows 8.1 je npr oko 4GB, a zahteva bar 20 GB na hard disku za neko normalno funkcionisanje, pa vi vidite gde ste ?

Programiranje ?

Thursday, November 12, 2015

local storage html5 simple way

var testObject = { 'one': 1, 'two': 2, 'three': 3 };

// Put the object into storage
localStorage.setItem('testObject', JSON.stringify(testObject));

// Retrieve the object from storage
var retrievedObject = localStorage.getItem('testObject');

console.log('retrievedObject: ', JSON.parse(retrievedObject));



//---------------------------

Storage.prototype.setObject = function(key, value) {
    this.setItem(key, JSON.stringify(value));
}

Storage.prototype.getObject = function(key) {
    var value = this.getItem(key);
    return value && JSON.parse(value);
}

x

2 HP Laser Jet 1010 kom 3.00 792.00 2,376.00 10.03.2015 o1 Angela

9 HP Laser Jet 1010 kom 1.00 792.00 792.00 12.03.2015 o4

23 HP Laser Jet 1010 kom 1.00 792.00 792.00 18.05.2015 angela

26 Canon LBP 3000 kom 2.00 780.00 1,560.00 02.06.2015 Vesna, HP1010 ?

49 HP Laser Jet 1010 kom 2.00 792.00 1,584.00 27.10.2015 Segi E

51 HP Laser Jet 1010 kom 2.00 792.00 1,584.00 28.10.2015 Vesna M- Canon LBP3000

working calendar with html5 local storage

HTML5 local storage

https://developers.google.com/web/updates/2011/08/Saving-generated-files-on-the-client-side?hl=en

https://scotch.io/tutorials/use-the-html5-file-api-to-work-with-files-locally-in-the-browser

http://www.html5rocks.com/en/tutorials/file/dndfiles/

--------------

http://www.noupe.com/design/html5-filesystem-api-create-files-store-locally-using-javascript-webkit.html


--------------

http://www.w3schools.com/html/html5_webstorage.asp




<!DOCTYPE html>
<html>
<body>

<div id="result"></div>

<script>
// Check browser support
if (typeof(Storage) !== "undefined") {
    // Store
    localStorage.setItem("lastname", "Smith");
    // Retrieve
    document.getElementById("result").innerHTML = localStorage.getItem("lastname");
} else {
    document.getElementById("result").innerHTML = "Sorry, your browser does not support Web Storage...";
}
</script>

</body>
</html>

Friday, November 6, 2015

kalendari

Delphi date week day functions

http://www.delphibasics.co.uk/RTL.asp?Name=DayOfWeek

http://delphi.about.com/library/rtl/blrtlDayOfWeek.htm


const Days: array[1..7] of string =
           ('Sunday', 'Monday', 'Tuesday',
            'Wednesday', 'Thursday',
            'Friday', 'Saturday')

ShowMessage('Today is  ' + Days[DayOfWeek(Date)]);

//Today is Monday

The DayOfWeek function returns an index number for the day of the week :
= Sunday
= Monday
= Tuesday
= Wednesday
= Thursday
= Friday
= Saturday


Example code : Show the day of the week for Christmas 2002
// Full Unit code.
// -----------------------------------------------------------
// You must store this code in a unit called Unit1 with a form
// called Form1 that has an OnCreate event called FormCreate.

unit Unit1;

interface

uses
  SysUtils,   // Unit containing the DayOfWeek command
  Forms, Dialogs;

type  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  end;

var
  
Form1: TForm1;

implementation
{$R *.dfm} // Include form definitions

procedure TForm1.FormCreate(Sender: TObject);

var
  myDate : TDateTime;
  day    : string;

begin
  myDate := EncodeDate(2002, 12, 31);

  day := LongDayNames[DayOfWeek(myDate)];

  ShowMessage('Christmas day 2002 is on a '+day);
end;

end.

   Christmas day 2002 is on a Tuesday

PHP date functions

https://daveismyname.com/show-working-days-of-a-month-excluding-weekends-with-php-bp

http://www.calendar-12.com/working_days/2016


<?php 
echo date("d")." "; 
echo date("m")." "; 
echo date("Y")." "; 
echo date("h:i:s A"); 

ECHO ' <br/>'; 
echo jddayofweek ( cal_to_jd(CAL_GREGORIAN, date("m"),date("d"), date("Y")) , 1 ); 

$day_of_week = date('N', strtotime('Monday'));

$tm = localtime($timestamp, TRUE);
$dow = $tm['tm_wday'];

$daynum = date("w", strtotime("wednesday"));

$daynum = date("N", strtotime("wednesday"));


$days = [
  1 => 'Sunday',
  2 => 'Monday',
  3 => 'Tuesday',
  4 => 'Wednesday',
  5 => 'Thursday',
  6 => 'Friday',
  7 => 'Saturday'
];

echo $days[date('N')];

$year = 2015;
$feb = (($year%100)and !($year%4)or !($year%400))+28;
echo $feb;



//Day in year should like this :

$month= array(0,31,$feb,31,30,31,30,31,31,30,31,30,31);

0=0, 1=January,2=February,....


$dayOfWeek = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
echo $dayOfWeek[2]."<br />";
echo $dayOfWeek[8%7];
echo $dayOfWeek[date('N')];

//-------
$dayofweek = date('w', strtotime($date));
$result    = date('Y-m-d', strtotime(($day - $dayofweek).' day', strtotime($date)));

//-------------

function getWeekday($date) {
    return date('w', strtotime($date));
}

echo getWeekday('2012-10-11'); // returns 4

//-------------

echo 'Belgrade Date/Time: '._date("Y-m-d | h:i:sa", false, 'Europe/Belgrade').'<br>';

//-------
function getWeekForDate($date, $weekStartSunday = false){

    $timestamp = strtotime($date);

    // Week starts on Sunday
    if($weekStartSunday){
        $start = (date("D", $timestamp) == 'Sun') ? date('Y-m-d', $timestamp) : date('Y-m-d', strtotime('Last Sunday', $timestamp));
        $end = (date("D", $timestamp) == 'Sat') ? date('Y-m-d', $timestamp) : date('Y-m-d', strtotime('Next Saturday', $timestamp));
    } else { // Week starts on Monday
        $start = (date("D", $timestamp) == 'Mon') ? date('Y-m-d', $timestamp) : date('Y-m-d', strtotime('Last Monday', $timestamp));
        $end = (date("D", $timestamp) == 'Sun') ? date('Y-m-d', $timestamp) : date('Y-m-d', strtotime('Next Sunday', $timestamp));
    }

    return array('start' => $start, 'end' => $end);
}

//-----

public function getWeek($date){
    $date_stamp = strtotime(date('Y-m-d', strtotime($date)));

     //check date is sunday or monday
    $stamp = date('l', $date_stamp);      
    $timestamp = strtotime($date);
    //start week
    if(date('D', $timestamp) == 'Mon'){            
        $week_start = $date;
    }else{
        $week_start = date('Y-m-d', strtotime('Last Monday', $date_stamp));
    }
    //end week
    if($stamp == 'Sunday'){
        $week_end = $date;
    }else{
        $week_end = date('Y-m-d', strtotime('Next Sunday', $date_stamp));
    }        
    return array($week_start, $week_end);
}


//-----------




?>


Monday, November 2, 2015

IoT - Internet of Things

Sve što vam treba imate u ovoj prodavnici (mislimo na hardver):

http://www.saperel.com/Raspberry%20Pi


Sve što vam treba od softvera i raznih primera, kontrola led dioda, robota, pametne kuće, inteligentni nadzor prostora i slično, obratite se meni lično:

xtremezx2002@yahoo.com


Više informacija iz inostranstva:

https://www.hackster.io/platforms


https://deals.sourceforge.net/sales/vocore-mini-linux-computer

VoCore je mali linux kompjuter sa WiFi, USB, Lan priključcima za samo 39$.

VoCore je manji od Raspberry-ja, ali ovaj drugi je popularniji jer može da pokreće Windows 10 for IoT.

Iako je Raspberry imicijalno Linux mašina, mnogi ga koriste sa Windows 10 OS-om.

Microsoft je ozbiljno shvatio da je IoT budućnost, tako da je posvetio dosta pažnje, kako OS za njega, tako i raznim razvojnim alatima koji prate IoT. 

qr android libs

qr code generator php

qr code detector php