Skip to content

Instantly share code, notes, and snippets.

@klemenzarn
klemenzarn / 4 vaja SP
Created March 20, 2013 14:13
kak delaš pa to...
sql stavki v bazi
-stored procedures -add new procedure
alter procedure dbo.blogvrnil(@A int, @B nvarchar(255), @c datetime)
AS
begin
insert into blog (naziv,opis,id) values (@A, @B,@C)
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int stElementov = 0;
int vrednosti = 0;
void napolniPolje(int polje[], int stElementov, int vrednosti){
//php klic servisa
$client = new SoapClient(null, array('location' => "http://localhost/vaja2/service.php",'uri' => "http://test-uri/"));
$output = $client->getSeznam($niz);
echo $output;
@klemenzarn
klemenzarn / gist:5227293
Created March 23, 2013 10:49
klic procedure
SqlCommand command = new SqlCommand("isci", con);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@iskalnivzorec", SqlDbType.NVarChar);
command.Parameters["@iskalnivzorec"].Value = iskalni_vzorec;
//klic .net servica
$client = new SoapClient("http://localhost:54149/Service.asmx?wsdl");
$args=new stdClass();
$args->iskalni_vzorec=$niz;
$result = $client->getSeznamDatotek($args);
echo $result->getSeznamDatotekResult;
<?php
function Sestej($a, $b){
return $a+$b;
}
$server = new SoapServer(null,array('uri' => "urn://tyler/res"));
$server->addFunction('Sestej');
$server->handle();
/* execute multi query */
if (mysqli_multi_query($link, $query)) {
do {
/* store first result set */
if ($result = mysqli_store_result($link)) {
while ($row = mysqli_fetch_row($result)) {
printf("%s\n", $row[0]);
}
mysqli_free_result($result);
}
@klemenzarn
klemenzarn / druga.sh
Created April 6, 2013 17:29
druga naloga za ocene
#!/bin/bash
function procentiOcena(){
if [[ $1 < 100 && $1 > 90 ]]; then
echo 10
elif [[ $1 < 90 && $1 > 80 ]]; then
echo 9
elif [[ $1 < 80 && $1 > 70 ]]; then
echo 8
elif [[ $1 < 70 && $1 > 60 ]]; then
@klemenzarn
klemenzarn / cetrta.sh
Created April 6, 2013 18:13
četrta naloga na kolokviju 2013
#!/bin/bash
mapa=$(pwd) #trenuten direktori
for i in $mapa/* #za vsak file v tem direktoriju
do
if [ -f $i ] #preverimo če je navadn file (da ni mapa)
then
informacija=$(lsof $i) #z lsof preverimo kateri proces uporablja to datoteko
if [[ -n $informacija ]]; then #če je -n (not null mislim da...) potem vidimo da je v izvajanju
echo "Datoteka je v izvajanju: "$i #izpišemo
fi
bits 32
global main
extern printf
section .bss
manjse resb 100
len resb 1
section .data
izpis db "Vpiši besedo: ", 0