Showing posts with label ultra. Show all posts
Showing posts with label ultra. Show all posts

Friday, March 25, 2022

Ultra light Linux = MiYO Linux distro

 https://sourceforge.net/projects/miyolinux/

https://gosamples.dev/read-file/#:~:text=The%20simplest%20way%20of%20reading,by%20line%20or%20in%20chunks.

https://stackoverflow.com/questions/37122401/execute-another-go-program-from-within-a-golang-program

https://zetcode.com/golang/exec-command/

https://gist.github.com/hyg/9c4afcd91fe24316cbf0

https://www.instructables.com/Complete-Guide-for-Tech-Beginners/


Working on Golang:

package main

import (
    "fmt"
    "log"
    "os/exec"
    "runtime"
)

func openbrowser(url string) {
    var err error

    switch runtime.GOOS {
    case "linux":
        err = exec.Command("xdg-open", url).Start()
    case "windows":
        err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
    case "darwin":
        err = exec.Command("open", url).Start()
    default:
        err = fmt.Errorf("unsupported platform")
    }
    if err != nil {
        log.Fatal(err)
    }

}

func main() {

    openbrowser("d:/go/dokument.htm")

}



Working on TCC:


#include <stdio.h>
#include <wchar.h>
#include <stdlib.h>
#include <locale.h>
int main ()
{
  setlocale(LC_ALL, "en_US.UTF-8");
  FILE * fin;
  FILE * fout;
  wint_t wc;
  fin=fopen ("in.txt","r");
  fout=fopen("out.txt","w");
  while((wc=fgetwc(fin))!=WEOF){
        // work with: "wc"
        putchar(wc);
        fprintf(fout,"%c",wc);
  }
  fclose(fin);
  fclose(fout);
  printf("File has been created...\n");
  return 0;
}

https://www.calculate-linux.org/


https://www.howtogeek.com/howto/windows-vista/enable-the-hidden-administrator-account-on-windows-vista/

??:



#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>

int main(void)
{
FILE *stream;
wchar_t wcs[100];

if (NULL == (stream = fopen("fgetws.dat", "r"))) {
printf("Unable to open: \"fgetws.dat\"\n");
exit(1);

}

errno = 0;
if (NULL == fgetws(wcs, 100, stream)) {
if (EILSEQ == errno) {
printf("An invalid wide character was encountered.\n");
exit(1);

}

else if (feof(stream))
printf("End of file reached.\n");
else
perror("Read error.\n");
}
printf("wcs = \"%ls\"\n", wcs);
fclose(stream);
return 0;

/************************************************************
Assuming the file fgetws.dat contains:
This test string should not return -1
The output should be similar to:
wcs = "This test string should not return -1"
************************************************************/

}


int sqlite3_exec16(
sqlite3 *db, /* The database on which the SQL executes */
const short *zSql, /* The SQL(16) to be executed */
sqlite3_callback16 xCallback, /* Invoke this callback routine */
void *pArg, /* First argument to xCallback() */
short **pzErrMsg /* Write error messages here */
){
int rc = SQLITE_OK;
const short *zLeftover;
sqlite3_stmt *pStmt = 0;
short **azCols = 0;

int nRetry = 0;
int nCallback;

if( zSql==0 ) return SQLITE_OK;
while( (rc==SQLITE_OK || (rc==SQLITE_SCHEMA && (++nRetry)<2)) && zSql[0]
){
int nCol;
short **azVals = 0;

pStmt = 0;
rc = sqlite3_prepare16_v2(db, zSql, -1, &pStmt, &zLeftover);
assert( rc==SQLITE_OK || pStmt==0 );
if( rc!=SQLITE_OK ){
continue;
}
if( !pStmt ){
/* this happens for a comment or white-space */
zSql = zLeftover;
continue;
}

nCallback = 0;

nCol = sqlite3_column_count(pStmt);
azCols = sqliteMalloc(2*nCol*sizeof(const short *) + 1);
if( azCols==0 ){
goto exec_out;
}

while( 1 ){
int i;
rc = sqlite3_step(pStmt);

/* Invoke the callback function if required */
if( xCallback && (SQLITE_ROW==rc ||
(SQLITE_DONE==rc && !nCallback && db->flags&SQLITE_NullCallback))
){
if( 0==nCallback ){
for(i=0; i<nCol; i++){
azCols[i] = (short *)sqlite3_column_name16(pStmt, i);
}
nCallback++;
}
if( rc==SQLITE_ROW ){
azVals = &azCols[nCol];
for(i=0; i<nCol; i++){
azVals[i] = (short *)sqlite3_column_text16(pStmt, i);
}
}
if( xCallback(pArg, nCol, azVals, azCols) ){
rc = SQLITE_ABORT;
goto exec_out;
}
}

if( rc!=SQLITE_ROW ){
rc = sqlite3_finalize(pStmt);
pStmt = 0;
if( rc!=SQLITE_SCHEMA ){
nRetry = 0;
zSql = zLeftover;
while( iswspace((unsigned char)zSql[0]) ) zSql++;
}
break;
}
}

sqliteFree(azCols);
azCols = 0;
}

exec_out:
if( pStmt ) sqlite3_finalize(pStmt);
if( azCols ) sqliteFree(azCols);

rc = sqlite3ApiExit(0, rc);
if( rc!=SQLITE_OK && rc==sqlite3_errcode(db) && pzErrMsg ){
*pzErrMsg = sqlite3_malloc(1+strlen(sqlite3_errmsg16(db)));
if( *pzErrMsg ){
strcpy(*pzErrMsg, sqlite3_errmsg16(db));
}
}else if( pzErrMsg ){
*pzErrMsg = 0;
}

assert( (rc&db->errMask)==rc );
return rc;
}




Monday, October 15, 2018

MySQl, Excel, SQlite

26 slova engleskih
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z

CREATE TABLE excel (
A VARCHAR(40),
B VARCHAR(40),
C VARCHAR(40),
D VARCHAR(40),
E VARCHAR(40),
F VARCHAR(40),
G VARCHAR(40),
H VARCHAR(40),
I VARCHAR(40),
J VARCHAR(40),
K VARCHAR(40),
L VARCHAR(40),
M VARCHAR(40),
N VARCHAR(40),
O VARCHAR(40),
P VARCHAR(40),
Q VARCHAR(40),
R VARCHAR(40),
S VARCHAR(40),
T VARCHAR(40),
U VARCHAR(40),
V VARCHAR(40),
W VARCHAR(40),
X VARCHAR(40),
Y VARCHAR(40),
Z VARCHAR(40)
);

studenti.db
Select * FROM isplata where iznos>0
rb, oznaka, ime, adresa, iznos, broj_racuna


="UPDATE ispalata SET oznaka = 1, ime='"&C2&"', iznos='"&F2&"', broj_racuna='"&E2&"' WHERE rb=1;"

="UPDATE isplata SET oznaka = '"&A2&"', ime='"&C2&"', iznos='"&F2&"', broj_racuna='"&E2&"' WHERE rb=1;"


="UPDATE isplata SET oznaka = '"&A6&"', ime='"&B6&"', iznos='"&G6&"', broj_racuna='"&F6&"', adresa='"&C6&"' WHERE rb=1;"

="UPDATE isplata SET oznaka = '"&A2&"-"&B2&"', ime='"&C2&"', iznos='"&J2&"', broj_racuna='"&H2&"' WHERE rb=1;"



xxx-xxxxxxxx-xx



="INSERT INTO table_name VALUES('"&A1&"','"&B1&"','"&C1&"')"

INSERT INTO tbl_sample(first_name, last_name) VALUES('ime','prezime');


tbl_sample(first_name, last_name

CREATE TABLE IF NOT EXISTS eksel2 (
  id bigint(20) NOT NULL AUTO_INCREMENT,
  c01 text NULL,
  c02 text NULL,
  c03 text NULL,
  c04 text NULL,
  c05 text NULL,
  c06 text NULL,
  c07 text NULL,
  c08 text NULL,
  c09 text NULL,
  c10 text NULL,
  c11 text NULL,
  c12 text NULL,
  PRIMARY KEY (id)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;




INSERT INTO eksel2(c01,c02,c03,c04,c05,c06,c07,c08,c09,c10,c11,c12) VALUES('1','2','3','4','5','6','7','8','9','10','11','12');


SQLite...:


CREATE TABLE `godisnji` (
`rb` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
`ime` VARCHAR(40),
`jmbg` VARCHAR(13),
`po_osnovu_doprinosa_na_radu` INTEGER,
`po_osnovu_strucne_spreme` INTEGER,
`po_osnovu_godina_rada` INTEGER,
`po_osnovu_uslova_rada` INTEGER,
`po_osnovu_brige_o_deci` INTEGER,
`broj_maloletnih` INTEGER,
`broj_dece_do_14god` INTEGER,
`adresa` VARCHAR(80),
`telefon` VARCHAR(40),
`napomena` VARCHAR(80),
`datum_donosenja_resenja` VARCHAR(10),
`ukupno` INTEGER
);



CREATE TABLE `putnik` (
`oznaka` TEXT,
`ime` TEXT,
`ADRESA` TEXT,
`RODITELJ` TEXT,
`JMBG` TEXT,
`SKOLA` TEXT,
`GRAD` TEXT,
`relacija` INTEGER,
`naziv_relacije` TEXT,
`prvi_mesec` INTEGER,
`drugi_mesec` INTEGER,
`iznos` REAL,
`broj_racuna` TEXT,
`procenat` INTEGER,
`prvi_iznos` REAL,
`drugi_iznos` REAL
);


CREATE TABLE `osnovna_sredstva` (
`rb` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`naziv` VARCHAR(80),
`inventarski_broj` VARCHAR(20),
`serijski_broj` VARCHAR(80),
`model` VARCHAR(40),
`windows_key` VARCHAR(80),
`opis` VARCHAR(2000),
`sadrzaj` VARCHAR(2000),
`napomena` VARCHAR(200),
`vrednost` REAL,
`amortizacija` REAL,
`datum` VARCHAR(20),
`proizvodjac` VARCHAR(80),
`javna_nabavka` VARCHAR(200),
`revers` VARCHAR(200),
`trebovanje` VARCHAR(200),
`odgovorna_osoba` VARCHAR(60),
`storno` VARCHAR(40)
);



CREATE TABLE `finansije-glavna-knjiga` (
`rb` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
`naslov` VARCHAR(80),
    `duguje` REAL,
    `potrazuje` REAL,
    `saldo` REAL,
`konto` VARCHAR(20),
`partner-kupac-dobavljac` VARCHAR(40),
`napomena` VARCHAR(1000),
`datum` VARCHAR(10),
`storno` VARCHAR(10)

);

CREATE TABLE `kontni-plan` (
`rb` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
`sifra-konta` VARCHAR(20),
`naziv-konta` VARCHAR(80)
);

CREATE TABLE `partner` (
`rb` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
`sifra-partnera` VARCHAR(40),
`naziv-partnera` VARCHAR(80)
);


PRIMER praćenja sopstvenih troškova u prodavnici:






https://sr.wikipedia.org/sr-el/Dvojno_knjigovodstvo

http://informax.serveftp.com/progtools.asp









Saturday, October 13, 2018

Zaboravili ste WiFi lozinku, nema problema - za korisnike M$ Window$ 7,8,10

1 .startujte cmd.exe kao administrator i otkucajte ovo:
netsh wlan show profile

2. Kada ste saznali koja su sve imena za WiFi dostupna, kucaj ovo:
netsh wlan show profile WiFi-ime key=clear

Ovde je WiFi-ime ime tvog WiFi-ja za koji ti treba lozinka.

Dakle, prva naredba lista sva IMENA WIFI UREDJAJA, a druga naredba lista izmedju ostalog i LOZINKU koja te zanima.

Ako je nekome ovo pomoglo dajte mi neku pohvalu u komentar.



Tuesday, April 25, 2017

VBS dovoljan za skoro sve

___________________
File: tuta.vbs
Author: v$
________________


Option Explicit
Dim result, objFSO, outFile, objFile 
result = InputBox("zapisi ovo:", "title", "default unos", 100, 100)
WScript.Echo result  

'Set objFSO = CreateObject("Scripting.FileSystemObject")

' How to write file
'outFile="c:\test\probator.txt"
'Set objFile = objFSO.CreateTextFile(outFile,True)
'objFile.Write "test string: " & result & vbCrLf
'objFile.Close


Dim objStream
Set objStream = CreateObject("ADODB.Stream")
objStream.CharSet = "utf-8"
objStream.Open
objStream.WriteText result
objStream.SaveToFile "c:\test\probator.txt", 2



WScript.Echo "totovo"