beogradsko programiranje
Thursday, July 27, 2017
Tuesday, July 25, 2017
Friday, July 21, 2017
Thursday, July 20, 2017
Surf Live Linux (the best one)
1) Surf Live Linux (the best one) ~94MB:
https://sourceforge.net/projects/cd-linux/
Veoma upotrebljiv na internetu, You Tube radi super, mnogo je bolji od svih live linuxa slične velicine.
2) Android for PC ~800MB:
http://www.jide.com/remixos-for-pc
Rade sve najnovije Android aplikacije.
3) Linux:
https://www.raspberrypi.org/blog/introducing-pixel/
Jos ga nisam probao, verovatno je ok.
https://www.linux.com/news/best-lightweight-linux-distros-2017
Wednesday, July 19, 2017
Tuesday, July 18, 2017
Tuesday, July 11, 2017
Monday, July 10, 2017
Friday, July 7, 2017
Zaista besplatan internet preko kratkih talasa shrot wave
Potreban Vam je neki od kratkotalasnih primo-predajnika (KT, SW), možete koristiti i UKT (UHF) na 27 MHz (CB).
Treba Vam kompjuter i instaliran linux, predpostavljam da ima i verzija za windows.
http://swling.com/blog/2014/04/airchat-long-distance-digital-communications-via-radio/
http://underlore.com/shortwave-distributed-internet/
Treba Vam kompjuter i instaliran linux, predpostavljam da ima i verzija za windows.
http://swling.com/blog/2014/04/airchat-long-distance-digital-communications-via-radio/
http://underlore.com/shortwave-distributed-internet/
Thursday, July 6, 2017
Wednesday, July 5, 2017
Kako se pravilno pune android uredjaji, telefoni tableti ?
1) Tablet ili telefon se moraju puniti originalnim punjačem. Nikako ne koristite neke druge punjače, auto-punjače ili power-bankove (jedino ukoliko baš nemate drugog izbora).
2) Indikator napunjenosti baterije treba da pokazuje uvek više od 50 %, a manje od 100%.
3) Kada punite ne morate postići baš 100%, ali je potrebno da bar svaki dan punite po sat vremena.
4) Nikada ne praznite uredjaj ispod 50%, a da ga niste priključili na punjač.
5) Možete i na punjaču obavljati neophodne poslove.
6) Kada radite "Turn Off" uredjaja tako da ga duže vreme nećete koristiti (recimo idete na godišnji odmor), onda obavezno napunite uredjaj na 100%.
Ako duže vreme nećete koristiti uredjaj baterija ne sme biti ispod 50%.
7) Ako je vaš uredjaj napunjen na 100%, onda ga otkačite sa punjača. Prepunjavanje je isto tako štetno kao i potpuno pražnjenje baterije. U svemu treba biti umeren, a to posebno važi kod punjenja baterija.
2) Indikator napunjenosti baterije treba da pokazuje uvek više od 50 %, a manje od 100%.
3) Kada punite ne morate postići baš 100%, ali je potrebno da bar svaki dan punite po sat vremena.
4) Nikada ne praznite uredjaj ispod 50%, a da ga niste priključili na punjač.
5) Možete i na punjaču obavljati neophodne poslove.
6) Kada radite "Turn Off" uredjaja tako da ga duže vreme nećete koristiti (recimo idete na godišnji odmor), onda obavezno napunite uredjaj na 100%.
Ako duže vreme nećete koristiti uredjaj baterija ne sme biti ispod 50%.
7) Ako je vaš uredjaj napunjen na 100%, onda ga otkačite sa punjača. Prepunjavanje je isto tako štetno kao i potpuno pražnjenje baterije. U svemu treba biti umeren, a to posebno važi kod punjenja baterija.
Tuesday, July 4, 2017
Kako napraviti dobar proizvod koji sam pravi pare ?
Kako napraviti dobar proizvod koji sam pravi pare ?
1) Najpre napraviti sekciju za logovanje preko interneta (u lazarusu), gde bi se nalazili svi brojevi hard diskova ljudi koji su preuzeli aplikaciju. Aplikacija treba da bez znanja korisnika ukoliko je na internetu preko http post ajaxa snimi broj lokalnog hard diska na web server (koristeći php).
2) Aplikacija bi radila mesec dana, a nakon toga bi proveravala da li serijski broj hard diska odgovara onom na internetu, ako ne odgovara, onda bi ponudila novi nivo zaštite tako da korisnik definiše lozinku koja bi se snimala na sajt, a proveravala svaki sledeći put da li se poklapa sa onom lokalno snimljenom na hard disku. Pored lozinke i serijskog broja, na internetu bi se u jednoj tabeli memorisale lozinke i serijski brojevi hard diskova, a u dodatnoj koloni bi se nalazio flag koji ukoliko je postavljen na 1, onda bi posle mesec dana upotrebe korisnik mogao da nastavi sa upotrebom aplikacije, ali ukoliko nema flega ili je fleg različit od 1, onda bi se aplikacija zakucala na reklamama koje upucuju da treba da se odradi registracija, i pokrenula bi se procedura za registraciju aplikacije.
3) U reklamama za registraciju u proceduri za registraciju (modulu za registraciju) treba jasno staviti prava korisnika i napomenu da ukoliko želi da bude registrovani korisnik sa lozinkom koju je dao, mora da uplati odredjenu sumu novca na tačno odredjen žiro račun, bitcoin, moneybookers ili neki sličan servis. Treba jasno naznačiti rok u kome treba odraditi uplatu i naglasiti da ukoliko nema uplate posle tog odredjenog roka će nalog (koji je korisnik kreirao i lozinka) biti obrisan sa web servera aplikacije.
Ova tri koraka obezbedjuju da aplikacija bude naplativa, odnosno da donosi dobit (neće baš svaki korisnik da plati, ali posle odredjenog vremena će svakako biti realizovanih uplata).
4) Napraviti aplikaciju koja veoma kvalitetno obavlja više korisnih aktivnosti, a nema konkurencije na tržištu.
5) Redovno dodavati nove funkcionalnosti i stalno usavršavati postojeće.
6) Forsirati besplatan i dostupan download novih verzija aplikacije.
7) Omogućiti neplatišama da ipak nastave korišćenje aplikacije, ali uz frustrirajuće reklame i razna ograničenja koja jasno i glasno treba naglašavati u reklamama.
8) Forsirati neprekidnu reklamu aplikacije na svim socijalnim mrežama i internet stranicama u vlasništvu.
1) Najpre napraviti sekciju za logovanje preko interneta (u lazarusu), gde bi se nalazili svi brojevi hard diskova ljudi koji su preuzeli aplikaciju. Aplikacija treba da bez znanja korisnika ukoliko je na internetu preko http post ajaxa snimi broj lokalnog hard diska na web server (koristeći php).
2) Aplikacija bi radila mesec dana, a nakon toga bi proveravala da li serijski broj hard diska odgovara onom na internetu, ako ne odgovara, onda bi ponudila novi nivo zaštite tako da korisnik definiše lozinku koja bi se snimala na sajt, a proveravala svaki sledeći put da li se poklapa sa onom lokalno snimljenom na hard disku. Pored lozinke i serijskog broja, na internetu bi se u jednoj tabeli memorisale lozinke i serijski brojevi hard diskova, a u dodatnoj koloni bi se nalazio flag koji ukoliko je postavljen na 1, onda bi posle mesec dana upotrebe korisnik mogao da nastavi sa upotrebom aplikacije, ali ukoliko nema flega ili je fleg različit od 1, onda bi se aplikacija zakucala na reklamama koje upucuju da treba da se odradi registracija, i pokrenula bi se procedura za registraciju aplikacije.
3) U reklamama za registraciju u proceduri za registraciju (modulu za registraciju) treba jasno staviti prava korisnika i napomenu da ukoliko želi da bude registrovani korisnik sa lozinkom koju je dao, mora da uplati odredjenu sumu novca na tačno odredjen žiro račun, bitcoin, moneybookers ili neki sličan servis. Treba jasno naznačiti rok u kome treba odraditi uplatu i naglasiti da ukoliko nema uplate posle tog odredjenog roka će nalog (koji je korisnik kreirao i lozinka) biti obrisan sa web servera aplikacije.
Ova tri koraka obezbedjuju da aplikacija bude naplativa, odnosno da donosi dobit (neće baš svaki korisnik da plati, ali posle odredjenog vremena će svakako biti realizovanih uplata).
4) Napraviti aplikaciju koja veoma kvalitetno obavlja više korisnih aktivnosti, a nema konkurencije na tržištu.
5) Redovno dodavati nove funkcionalnosti i stalno usavršavati postojeće.
6) Forsirati besplatan i dostupan download novih verzija aplikacije.
7) Omogućiti neplatišama da ipak nastave korišćenje aplikacije, ali uz frustrirajuće reklame i razna ograničenja koja jasno i glasno treba naglašavati u reklamama.
8) Forsirati neprekidnu reklamu aplikacije na svim socijalnim mrežama i internet stranicama u vlasništvu.
Monday, July 3, 2017
26 engleskih slova
--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;"
="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');
vbs TUTO txt
set shellobj = CreateObject("WScript.Shell")
shellobj.run "cmd"
wscript.sleep 100
shellobj.sendkeys "shutdown"
wscript.sleep 20
Shellobj.sendkeys " /s"
wscript.sleep 20
shellobj.sendkeys [ENTER]
------------------
x=msgbox("Would you like to open the Windows folder?" ,4, "Question:")
If x = vbNo Then Wscript.Quit(0)
If x = VbYes Then
Set WshShell = CreateObject("WScript.Shell")
X = WshShell.run("cmd /c explorer.exe ""C:\Windows""",0, true)
End If
------------------------
strMB = inputbox("Please enter your message here:")
Set WshShell = CreateObject("WScript.Shell")
WshShell.run "cmd /c @echo msgbox " & """" & strMB & """" & ",4096,""VBS2CMD2VBS:"">C:\Message.vbs",0, true
WshShell.run "C:\windows\system32\wscript.exe C:\Message.vbs",0, false
Wscript.Quit(0)
-----------------------------
strMB = inputbox("Please enter your message here:")
msgbox strMB, 4096, "Message"
------------------------
(A)
x=msgbox("Would you like to continue?" ,4, "Question:")
If x = vbNo Then MsgBox "You selected 'No'", 4096, "No:"
If x = VbYes Then MsgBox "You selected 'Yes'", 4096, "Yes:"
(B)
x=msgbox("Would you like to continue?" ,4, "Question:")
If x = vbNo Then
MsgBox "You selected 'No'", 4096, "No:"
Wscript.Quit(0)
End If
If x = VbYes Then
MsgBox "You selected 'Yes'", 4096, "Yes:"
Wscript.Quit(0)
End If
(C)
x=msgbox("Would you like to continue?" ,4, "Question:")
If x = vbNo Then
MsgBox "You selected 'No'", 4096, "No:"
Else
MsgBox "You selected 'Yes'", 4096, "Yes:"
End If
Wscript.Quit(0)
-------------------------
x=msgbox("Would you like to continue?" & VbCrLf & "If you select No, you will see NO" & VbCrLf & VbCrLf & "If you select Yes, you will see YES",4, "Question:")
If x = vbNo Then
MsgBox "NO", 4096, "No:"
Else
MsgBox "YES", 4096, "Yes:"
End If
--------------------------------------
Set WshShell = CreateObject("WScript.Shell")
x = WshShell.Popup("Would you like to continue?",5,"Title:",4)
If x = vbNo Then Wscript.Quit(0)
If x = VbYes Then
'Your script goes here
msgbox "you selected YES!", 4096, "Yes"
End If
--------------------------------------------
'************************************************
' File: Input.vbs (WSH sample in VBScript)
' Author: (c) G. Born
'
' Retrieving user input in VBScript
'************************************************
Option Explicit
Dim Message, result
Dim Title, Text1, Text2
' Define dialog box variables.
Message = "Please enter a path"
Title = "WSH sample user input - by G. Born"
Text1 = "User input canceled"
Text2 = "You entered:" & vbCrLf
' Ready to use the InputBox function
' InputBox(prompt, title, default, xpos, ypos)
' prompt: The text shown in the dialog box
' title: The title of the dialog box
' default: Default value shown in the text box
' xpos/ypos: Upper left position of the dialog box
' If a parameter is omitted, VBScript uses a default value.
result = InputBox(Message, Title, "C:\Windows", 100, 100)
' Evaluate the user input.
If result = "" Then ' Canceled by the user
WScript.Echo Text1
Else
WScript.Echo Text2 & result
End If
'*** End
'result = InputBox(prompt[, [title], [default], [xpos], [ypos]])
'The InputBox function has the following parameters:
'prompt A required parameter that defines the message shown in the dialog box. In Figure 8-1, this is the string Please Enter A Path.
'title An optional parameter that defines the title bar text for the dialog box.
'default An optional parameter that specifies the default value shown in the text box.
'xpos and ypos Optional parameters that define the position of the upper left corner of the dialog box.
'InputBox("Hello", "Test", , 100, 200)
'If result = "" Then ' Test for Cancel.
' WScript.Echo "Canceled"
'Else
' WScript.Echo "You entered: " & result
'End If
---------------------------------------
http://wsh2.uw.hu/ch08b.html
http://www.instructables.com/id/How-to-Make-a-message-box-using-VBScript/
---------------------
Set objFSO=CreateObject("Scripting.FileSystemObject")
' How to write file
outFile="c:\test\autorun.inf"
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.Write "test string" & vbCrLf
objFile.Close
'How to read a file
strFile = "c:\test\file"
Set objFile = objFS.OpenTextFile(strFile)
Do Until objFile.AtEndOfStream
strLine= objFile.ReadLine
Wscript.Echo strLine
Loop
objFile.Close
'to get file path without drive letter, assuming drive letters are c:, d:, etc
strFile="c:\test\file"
s = Split(strFile,":")
WScript.Echo s(1)
------------------------------
Option Explicit
Const fsoForReading = 1
Const fsoForWriting = 2
Function LoadStringFromFile(filename)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(filename, fsoForReading)
LoadStringFromFile = f.ReadAll
f.Close
End Function
Sub SaveStringToFile(filename, text)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(filename, fsoForWriting)
f.Write text
f.Close
End Sub
SaveStringToFile "f.txt", "Hello World" & vbCrLf
MsgBox LoadStringFromFile("f.txt")
------------------------------------
'You can create a temp file, then rename it back to original file:
Set objFS = CreateObject("Scripting.FileSystemObject")
strFile = "c:\test\file.txt"
strTemp = "c:\test\temp.txt"
Set objFile = objFS.GetFile(strFile)
Set objOutFile = objFS.CreateTextFile(strTemp,True)
Set ts = objFile.OpenAsTextStream(1,-2)
Do Until ts.AtEndOfStream
strLine = ts.ReadLine
' do something with strLine
objOutFile.Write(strLine)
Loop
objOutFile.Close
ts.Close
objFS.DeleteFile(strFile)
objFS.MoveFile strTemp,strFile
'Usage is almost the same using OpenTextFile:
Set objFS = CreateObject("Scripting.FileSystemObject")
strFile = "c:\test\file.txt"
strTemp = "c:\test\temp.txt"
Set objFile = objFS.OpenTextFile(strFile)
Set objOutFile = objFS.CreateTextFile(strTemp,True)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
' do something with strLine
objOutFile.Write(strLine & "kndfffffff")
Loop
objOutFile.Close
objFile.Close
objFS.DeleteFile(strFile)
objFS.MoveFile strTemp,strFile
------------------------------
http://stackoverflow.com/questions/1142678/read-and-write-into-a-file-using-vbscript
http://stackoverflow.com/questions/2198810/creating-and-writing-lines-to-a-file
--------------------------------------
The File System Object, generally used by VBScript developers to read and write text files, can read only ASCII or Unicode text files. You cannot use it to read or write UTF-8 encoded text files.
But, if you can use Microsoft ActiveX Data Objects (ADO), you can read UTF-8 encoded text files like this:
Dim objStream, strData
Set objStream = CreateObject("ADODB.Stream")
objStream.CharSet = "utf-8"
objStream.Open
objStream.LoadFromFile("C:\Users\admin\Desktop\test.txt")
strData = objStream.ReadText()
If you want to write a UTF-8 encode text file, you can do so like this:
Dim objStream
Set objStream = CreateObject("ADODB.Stream")
objStream.CharSet = "utf-8"
objStream.Open
objStream.WriteText "The data I want in utf-8"
objStream.SaveToFile "C:\Users\admin\Desktop\test.txt", 2
--------------------------------------
http://developer.rhino3d.com/guides/rhinoscript/read_write_utf8/
shellobj.run "cmd"
wscript.sleep 100
shellobj.sendkeys "shutdown"
wscript.sleep 20
Shellobj.sendkeys " /s"
wscript.sleep 20
shellobj.sendkeys [ENTER]
------------------
x=msgbox("Would you like to open the Windows folder?" ,4, "Question:")
If x = vbNo Then Wscript.Quit(0)
If x = VbYes Then
Set WshShell = CreateObject("WScript.Shell")
X = WshShell.run("cmd /c explorer.exe ""C:\Windows""",0, true)
End If
------------------------
strMB = inputbox("Please enter your message here:")
Set WshShell = CreateObject("WScript.Shell")
WshShell.run "cmd /c @echo msgbox " & """" & strMB & """" & ",4096,""VBS2CMD2VBS:"">C:\Message.vbs",0, true
WshShell.run "C:\windows\system32\wscript.exe C:\Message.vbs",0, false
Wscript.Quit(0)
-----------------------------
strMB = inputbox("Please enter your message here:")
msgbox strMB, 4096, "Message"
------------------------
(A)
x=msgbox("Would you like to continue?" ,4, "Question:")
If x = vbNo Then MsgBox "You selected 'No'", 4096, "No:"
If x = VbYes Then MsgBox "You selected 'Yes'", 4096, "Yes:"
(B)
x=msgbox("Would you like to continue?" ,4, "Question:")
If x = vbNo Then
MsgBox "You selected 'No'", 4096, "No:"
Wscript.Quit(0)
End If
If x = VbYes Then
MsgBox "You selected 'Yes'", 4096, "Yes:"
Wscript.Quit(0)
End If
(C)
x=msgbox("Would you like to continue?" ,4, "Question:")
If x = vbNo Then
MsgBox "You selected 'No'", 4096, "No:"
Else
MsgBox "You selected 'Yes'", 4096, "Yes:"
End If
Wscript.Quit(0)
-------------------------
x=msgbox("Would you like to continue?" & VbCrLf & "If you select No, you will see NO" & VbCrLf & VbCrLf & "If you select Yes, you will see YES",4, "Question:")
If x = vbNo Then
MsgBox "NO", 4096, "No:"
Else
MsgBox "YES", 4096, "Yes:"
End If
--------------------------------------
Set WshShell = CreateObject("WScript.Shell")
x = WshShell.Popup("Would you like to continue?",5,"Title:",4)
If x = vbNo Then Wscript.Quit(0)
If x = VbYes Then
'Your script goes here
msgbox "you selected YES!", 4096, "Yes"
End If
--------------------------------------------
'************************************************
' File: Input.vbs (WSH sample in VBScript)
' Author: (c) G. Born
'
' Retrieving user input in VBScript
'************************************************
Option Explicit
Dim Message, result
Dim Title, Text1, Text2
' Define dialog box variables.
Message = "Please enter a path"
Title = "WSH sample user input - by G. Born"
Text1 = "User input canceled"
Text2 = "You entered:" & vbCrLf
' Ready to use the InputBox function
' InputBox(prompt, title, default, xpos, ypos)
' prompt: The text shown in the dialog box
' title: The title of the dialog box
' default: Default value shown in the text box
' xpos/ypos: Upper left position of the dialog box
' If a parameter is omitted, VBScript uses a default value.
result = InputBox(Message, Title, "C:\Windows", 100, 100)
' Evaluate the user input.
If result = "" Then ' Canceled by the user
WScript.Echo Text1
Else
WScript.Echo Text2 & result
End If
'*** End
'result = InputBox(prompt[, [title], [default], [xpos], [ypos]])
'The InputBox function has the following parameters:
'prompt A required parameter that defines the message shown in the dialog box. In Figure 8-1, this is the string Please Enter A Path.
'title An optional parameter that defines the title bar text for the dialog box.
'default An optional parameter that specifies the default value shown in the text box.
'xpos and ypos Optional parameters that define the position of the upper left corner of the dialog box.
'InputBox("Hello", "Test", , 100, 200)
'If result = "" Then ' Test for Cancel.
' WScript.Echo "Canceled"
'Else
' WScript.Echo "You entered: " & result
'End If
---------------------------------------
http://wsh2.uw.hu/ch08b.html
http://www.instructables.com/id/How-to-Make-a-message-box-using-VBScript/
---------------------
Set objFSO=CreateObject("Scripting.FileSystemObject")
' How to write file
outFile="c:\test\autorun.inf"
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.Write "test string" & vbCrLf
objFile.Close
'How to read a file
strFile = "c:\test\file"
Set objFile = objFS.OpenTextFile(strFile)
Do Until objFile.AtEndOfStream
strLine= objFile.ReadLine
Wscript.Echo strLine
Loop
objFile.Close
'to get file path without drive letter, assuming drive letters are c:, d:, etc
strFile="c:\test\file"
s = Split(strFile,":")
WScript.Echo s(1)
------------------------------
Option Explicit
Const fsoForReading = 1
Const fsoForWriting = 2
Function LoadStringFromFile(filename)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(filename, fsoForReading)
LoadStringFromFile = f.ReadAll
f.Close
End Function
Sub SaveStringToFile(filename, text)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(filename, fsoForWriting)
f.Write text
f.Close
End Sub
SaveStringToFile "f.txt", "Hello World" & vbCrLf
MsgBox LoadStringFromFile("f.txt")
------------------------------------
'You can create a temp file, then rename it back to original file:
Set objFS = CreateObject("Scripting.FileSystemObject")
strFile = "c:\test\file.txt"
strTemp = "c:\test\temp.txt"
Set objFile = objFS.GetFile(strFile)
Set objOutFile = objFS.CreateTextFile(strTemp,True)
Set ts = objFile.OpenAsTextStream(1,-2)
Do Until ts.AtEndOfStream
strLine = ts.ReadLine
' do something with strLine
objOutFile.Write(strLine)
Loop
objOutFile.Close
ts.Close
objFS.DeleteFile(strFile)
objFS.MoveFile strTemp,strFile
'Usage is almost the same using OpenTextFile:
Set objFS = CreateObject("Scripting.FileSystemObject")
strFile = "c:\test\file.txt"
strTemp = "c:\test\temp.txt"
Set objFile = objFS.OpenTextFile(strFile)
Set objOutFile = objFS.CreateTextFile(strTemp,True)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
' do something with strLine
objOutFile.Write(strLine & "kndfffffff")
Loop
objOutFile.Close
objFile.Close
objFS.DeleteFile(strFile)
objFS.MoveFile strTemp,strFile
------------------------------
http://stackoverflow.com/questions/1142678/read-and-write-into-a-file-using-vbscript
http://stackoverflow.com/questions/2198810/creating-and-writing-lines-to-a-file
--------------------------------------
The File System Object, generally used by VBScript developers to read and write text files, can read only ASCII or Unicode text files. You cannot use it to read or write UTF-8 encoded text files.
But, if you can use Microsoft ActiveX Data Objects (ADO), you can read UTF-8 encoded text files like this:
Dim objStream, strData
Set objStream = CreateObject("ADODB.Stream")
objStream.CharSet = "utf-8"
objStream.Open
objStream.LoadFromFile("C:\Users\admin\Desktop\test.txt")
strData = objStream.ReadText()
If you want to write a UTF-8 encode text file, you can do so like this:
Dim objStream
Set objStream = CreateObject("ADODB.Stream")
objStream.CharSet = "utf-8"
objStream.Open
objStream.WriteText "The data I want in utf-8"
objStream.SaveToFile "C:\Users\admin\Desktop\test.txt", 2
--------------------------------------
http://developer.rhino3d.com/guides/rhinoscript/read_write_utf8/
Volume Delphi SET
var
MixerControl: TMixerControl;
MixerControlDetails: TMixerControlDetails;
MixerControlDetailsSigned: TMixerControlDetailsSigned;
Mixer: THandle;
MixerLine: TMixerLine;
MixerLineControls: TMixerLineControls;
PeakMeter: DWord;
Rslt: DWord;
SourceCount: Cardinal;
WaveOut: DWord;
I: Integer;
X: Integer;
Y: Integer;
begin
Rslt := mixerOpen(@Mixer, 0, 0, 0, 0);
if Rslt <> 0 then
raise Exception.CreateFmt('Can''t open mixer (%d)', [Rslt]);
FillChar(MixerLine, SizeOf(MixerLine), 0);
MixerLine.cbStruct := SizeOf(MixerLine);
MixerLine.dwComponentType := MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
Rslt := mixerGetLineInfo(Mixer, @MixerLine,
MIXER_GETLINEINFOF_COMPONENTTYPE);
if Rslt <> 0 then
raise Exception.CreateFmt('Can''t find speaker line (%d)', [Rslt]);
SourceCount := MixerLine.cConnections;
WaveOut := $FFFFFFFF;
for I := 0 to SourceCount - 1 do
begin
MixerLine.dwSource := I;
Rslt := mixerGetLineInfo(Mixer, @MixerLine,
MIXER_GETLINEINFOF_SOURCE);
if Rslt <> 0 then
raise Exception.CreateFmt('Can''t get source line (%d)', [Rslt]);
if MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT
then
begin
WaveOut := MixerLine.dwLineId;
Break;
end;
end;
if WaveOut = $FFFFFFFF then
raise Exception.Create('Can''t find wave out device');
FillChar(MixerLineControls, SizeOf(MixerLineControls), 0);
with MixerLineControls do
begin
cbStruct := SizeOf(MixerLineControls);
dwLineId := WaveOut;
dwControlType := MIXERCONTROL_CONTROLTYPE_PEAKMETER;
cControls := 1;
cbmxctrl := SizeOf(TMixerControl);
pamxctrl := @MixerControl;
end;
Rslt := mixerGetLineControls(Mixer, @MixerLineControls,
MIXER_GETLINECONTROLSF_ONEBYTYPE);
if Rslt <> 0 then
raise Exception.CreateFmt('Can''t find peak meter control (%d)',
[Rslt]);
PeakMeter := MixerControl.dwControlID;
// at this point, I have the meter control ID, so I can
// repeatedly query its value and plot the resulting data
// on a canvas
X := 0;
FillChar(MixerControlDetails, SizeOf(MixerControlDetails), 0);
with MixerControlDetails do
begin
cbStruct := SizeOf(MixerControlDetails);
dwControlId := PeakMeter;
cChannels := 1;
cbDetails := SizeOf(MixerControlDetailsSigned);
paDetails := @MixerControlDetailsSigned;
end;
repeat
Sleep(10);
Rslt := mixerGetControlDetails(Mixer, @MixerControlDetails,
MIXER_GETCONTROLDETAILSF_VALUE);
if Rslt <> 0 then
raise Exception.CreateFmt('Can''t get control details (%d)',
[Rslt]);
Application.ProcessMessages;
Inc(X);
Y := 300 - Round(300 * Abs(MixerControlDetailsSigned.lValue) /
32768);
with Canvas do
begin
MoveTo(X, 0);
Pen.Color := clBtnFace;
LineTo(X, 300);
Pen.Color := clWindowText;
LineTo(X, Y);
end;
until X > 500;
// don't forget to close the mixer handle when you're done
Rslt := mixerClose(Mixer);
if Rslt <> 0 then
raise Exception.CreateFmt('Can''t close mixer (%d)', [Rslt]);
end;
http://torry.net/pages.php?id=186
http://www.swissdelphicenter.ch/en/showcode.php?id=225
{1.}
uses
MMSystem;
procedure SetVolume(const volL, volR: Word);
var
hWO: HWAVEOUT;
waveF: TWAVEFORMATEX;
vol: DWORD;
begin
// init TWAVEFORMATEX
FillChar(waveF, SizeOf(waveF), 0);
// open WaveMapper = std output of playsound
waveOutOpen(@hWO, WAVE_MAPPER, @waveF, 0, 0, 0);
vol := volL + volR shl 16;
// set volume
waveOutSetVolume(hWO, vol);
waveOutClose(hWO);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
SetVolume(14000, 14000);
end;
{************************************************}
{2.}
{by Serhiy Perevoznyk}
uses
MMSystem;
function GetVolumeControl(aMixer: HMixer; componentType, ctrlType: Longint;
var mxc: TMixerControl): Boolean;
var
mxl: TMixerLine;
mxlc: TMixerLineControls;
rc: Longint;
begin
Result := False;
FillChar(mxl, SizeOf(TMixerLine), 0);
mxl.cbStruct := SizeOf(TMixerLine);
mxl.dwComponentType := componentType;
{Obtain a line corresponding to the component type}
rc := mixerGetLineInfo(aMixer, @mxl, MIXER_GETLINEINFOF_COMPONENTTYPE);
if rc = MMSYSERR_NOERROR then
begin
with mxlc do
begin
cbStruct := SizeOf(TMixerLineControls);
dwLineID := mxl.dwLineID;
dwControlType := ctrlType;
cControls := 1;
cbmxctrl := SizeOf(TMixerLine);
pamxctrl := @mxc;
pamxctrl^.cbStruct := SizeOf(TMixerControl);
end;
mixerGetLineControls(aMixer, @mxlc, MIXER_GETLINECONTROLSF_ONEBYTYPE);
rc := mixerGetLineControls(aMixer, @mxlc, MIXER_GETLINECONTROLSF_ONEBYTYPE);
Result := rc = MMSYSERR_NOERROR;
end;
end;
function SetVolumeControl(aMixer: HMixer; mxc: TMixerControl; volume: Longint): Boolean;
var
mxcd: TMixerControlDetails;
vol: TMixerControlDetails_Unsigned;
rc: MMRESULT;
begin
FillChar(mxcd, SizeOf(mxcd), 0);
with mxcd do
begin
cbStruct := SizeOf(TMixerControlDetails);
dwControlID := mxc.dwControlID;
cbDetails := SizeOf(TMixerControlDetails_Unsigned);
paDetails := @vol;
cMultipleItems := 0;
cChannels := 1;
end;
vol.dwValue := volume;
rc := mixerSetControlDetails(aMixer, @mxcd, MIXER_SETCONTROLDETAILSF_VALUE);
Result := rc = MMSYSERR_NOERROR;
end;
function InitMixer: HMixer;
var
Err: MMRESULT;
begin
Err := mixerOpen(@Result, 0, 0, 0, 0);
if Err <> MMSYSERR_NOERROR then
Result := 0;
end;
// Example:
procedure SetMasterVolumeToZero;
var
MyMixerHandle: HMixer;
MyVolCtrl: TMixerControl;
begin
MyMixerHandle := InitMixer;
if MyMixerHandle <> 0 then
try
FillChar(MyVolCtrl, SizeOf(MyVolCtrl), 0);
if GetVolumeControl(MyMixerHandle, MIXERLINE_COMPONENTTYPE_DST_SPEAKERS,
MIXERCONTROL_CONTROLTYPE_VOLUME, MyVolCtrl) then
begin
{The last parameter (0) here is the volume level}
if SetVolumeControl(MyMixerHandle, MyVolCtrl, 0) then
ShowMessage('Volume should now be set to zero');
end;
finally
mixerClose(MyMixerHandle);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
SetMasterVolumeToZero
end;
MixerControl: TMixerControl;
MixerControlDetails: TMixerControlDetails;
MixerControlDetailsSigned: TMixerControlDetailsSigned;
Mixer: THandle;
MixerLine: TMixerLine;
MixerLineControls: TMixerLineControls;
PeakMeter: DWord;
Rslt: DWord;
SourceCount: Cardinal;
WaveOut: DWord;
I: Integer;
X: Integer;
Y: Integer;
begin
Rslt := mixerOpen(@Mixer, 0, 0, 0, 0);
if Rslt <> 0 then
raise Exception.CreateFmt('Can''t open mixer (%d)', [Rslt]);
FillChar(MixerLine, SizeOf(MixerLine), 0);
MixerLine.cbStruct := SizeOf(MixerLine);
MixerLine.dwComponentType := MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
Rslt := mixerGetLineInfo(Mixer, @MixerLine,
MIXER_GETLINEINFOF_COMPONENTTYPE);
if Rslt <> 0 then
raise Exception.CreateFmt('Can''t find speaker line (%d)', [Rslt]);
SourceCount := MixerLine.cConnections;
WaveOut := $FFFFFFFF;
for I := 0 to SourceCount - 1 do
begin
MixerLine.dwSource := I;
Rslt := mixerGetLineInfo(Mixer, @MixerLine,
MIXER_GETLINEINFOF_SOURCE);
if Rslt <> 0 then
raise Exception.CreateFmt('Can''t get source line (%d)', [Rslt]);
if MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT
then
begin
WaveOut := MixerLine.dwLineId;
Break;
end;
end;
if WaveOut = $FFFFFFFF then
raise Exception.Create('Can''t find wave out device');
FillChar(MixerLineControls, SizeOf(MixerLineControls), 0);
with MixerLineControls do
begin
cbStruct := SizeOf(MixerLineControls);
dwLineId := WaveOut;
dwControlType := MIXERCONTROL_CONTROLTYPE_PEAKMETER;
cControls := 1;
cbmxctrl := SizeOf(TMixerControl);
pamxctrl := @MixerControl;
end;
Rslt := mixerGetLineControls(Mixer, @MixerLineControls,
MIXER_GETLINECONTROLSF_ONEBYTYPE);
if Rslt <> 0 then
raise Exception.CreateFmt('Can''t find peak meter control (%d)',
[Rslt]);
PeakMeter := MixerControl.dwControlID;
// at this point, I have the meter control ID, so I can
// repeatedly query its value and plot the resulting data
// on a canvas
X := 0;
FillChar(MixerControlDetails, SizeOf(MixerControlDetails), 0);
with MixerControlDetails do
begin
cbStruct := SizeOf(MixerControlDetails);
dwControlId := PeakMeter;
cChannels := 1;
cbDetails := SizeOf(MixerControlDetailsSigned);
paDetails := @MixerControlDetailsSigned;
end;
repeat
Sleep(10);
Rslt := mixerGetControlDetails(Mixer, @MixerControlDetails,
MIXER_GETCONTROLDETAILSF_VALUE);
if Rslt <> 0 then
raise Exception.CreateFmt('Can''t get control details (%d)',
[Rslt]);
Application.ProcessMessages;
Inc(X);
Y := 300 - Round(300 * Abs(MixerControlDetailsSigned.lValue) /
32768);
with Canvas do
begin
MoveTo(X, 0);
Pen.Color := clBtnFace;
LineTo(X, 300);
Pen.Color := clWindowText;
LineTo(X, Y);
end;
until X > 500;
// don't forget to close the mixer handle when you're done
Rslt := mixerClose(Mixer);
if Rslt <> 0 then
raise Exception.CreateFmt('Can''t close mixer (%d)', [Rslt]);
end;
http://torry.net/pages.php?id=186
http://www.swissdelphicenter.ch/en/showcode.php?id=225
{1.}
uses
MMSystem;
procedure SetVolume(const volL, volR: Word);
var
hWO: HWAVEOUT;
waveF: TWAVEFORMATEX;
vol: DWORD;
begin
// init TWAVEFORMATEX
FillChar(waveF, SizeOf(waveF), 0);
// open WaveMapper = std output of playsound
waveOutOpen(@hWO, WAVE_MAPPER, @waveF, 0, 0, 0);
vol := volL + volR shl 16;
// set volume
waveOutSetVolume(hWO, vol);
waveOutClose(hWO);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
SetVolume(14000, 14000);
end;
{************************************************}
{2.}
{by Serhiy Perevoznyk}
uses
MMSystem;
function GetVolumeControl(aMixer: HMixer; componentType, ctrlType: Longint;
var mxc: TMixerControl): Boolean;
var
mxl: TMixerLine;
mxlc: TMixerLineControls;
rc: Longint;
begin
Result := False;
FillChar(mxl, SizeOf(TMixerLine), 0);
mxl.cbStruct := SizeOf(TMixerLine);
mxl.dwComponentType := componentType;
{Obtain a line corresponding to the component type}
rc := mixerGetLineInfo(aMixer, @mxl, MIXER_GETLINEINFOF_COMPONENTTYPE);
if rc = MMSYSERR_NOERROR then
begin
with mxlc do
begin
cbStruct := SizeOf(TMixerLineControls);
dwLineID := mxl.dwLineID;
dwControlType := ctrlType;
cControls := 1;
cbmxctrl := SizeOf(TMixerLine);
pamxctrl := @mxc;
pamxctrl^.cbStruct := SizeOf(TMixerControl);
end;
mixerGetLineControls(aMixer, @mxlc, MIXER_GETLINECONTROLSF_ONEBYTYPE);
rc := mixerGetLineControls(aMixer, @mxlc, MIXER_GETLINECONTROLSF_ONEBYTYPE);
Result := rc = MMSYSERR_NOERROR;
end;
end;
function SetVolumeControl(aMixer: HMixer; mxc: TMixerControl; volume: Longint): Boolean;
var
mxcd: TMixerControlDetails;
vol: TMixerControlDetails_Unsigned;
rc: MMRESULT;
begin
FillChar(mxcd, SizeOf(mxcd), 0);
with mxcd do
begin
cbStruct := SizeOf(TMixerControlDetails);
dwControlID := mxc.dwControlID;
cbDetails := SizeOf(TMixerControlDetails_Unsigned);
paDetails := @vol;
cMultipleItems := 0;
cChannels := 1;
end;
vol.dwValue := volume;
rc := mixerSetControlDetails(aMixer, @mxcd, MIXER_SETCONTROLDETAILSF_VALUE);
Result := rc = MMSYSERR_NOERROR;
end;
function InitMixer: HMixer;
var
Err: MMRESULT;
begin
Err := mixerOpen(@Result, 0, 0, 0, 0);
if Err <> MMSYSERR_NOERROR then
Result := 0;
end;
// Example:
procedure SetMasterVolumeToZero;
var
MyMixerHandle: HMixer;
MyVolCtrl: TMixerControl;
begin
MyMixerHandle := InitMixer;
if MyMixerHandle <> 0 then
try
FillChar(MyVolCtrl, SizeOf(MyVolCtrl), 0);
if GetVolumeControl(MyMixerHandle, MIXERLINE_COMPONENTTYPE_DST_SPEAKERS,
MIXERCONTROL_CONTROLTYPE_VOLUME, MyVolCtrl) then
begin
{The last parameter (0) here is the volume level}
if SetVolumeControl(MyMixerHandle, MyVolCtrl, 0) then
ShowMessage('Volume should now be set to zero');
end;
finally
mixerClose(MyMixerHandle);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
SetMasterVolumeToZero
end;
vpn smb tunnel ssh
https://www.bitvise.com/file-sharing.html
http://www.nikhef.nl/~janjust/CifsOverSSH/VistaLoopback.html
http://www.ytechie.com/2008/05/set-up-a-windows-ssh-tunnel-in-10-minutes-or-less/
http://how-to.cc/setup-windows-filesharing-over-ssh
http://sshwindows.sourceforge.net/download/
http://fuguhub.com/tutorials/SmbTunnel.lsp
http://www.nikhef.nl/~janjust/CifsOverSSH/VistaLoopback.html
http://www.ytechie.com/2008/05/set-up-a-windows-ssh-tunnel-in-10-minutes-or-less/
http://how-to.cc/setup-windows-filesharing-over-ssh
http://sshwindows.sourceforge.net/download/
http://fuguhub.com/tutorials/SmbTunnel.lsp
Very Important Data Filter PHP
function data_filter($data)
{
// remove whitespaces from begining and end
$data = trim($data);
// apply stripslashes to pevent double escape if magic_quotes_gpc is enabled
if(get_magic_quotes_gpc())
{
$data = stripslashes($data);
}
// connection is required before using this function
$data = mysqli_real_escape_string($conn,$data);
return $data;
}
{
// remove whitespaces from begining and end
$data = trim($data);
// apply stripslashes to pevent double escape if magic_quotes_gpc is enabled
if(get_magic_quotes_gpc())
{
$data = stripslashes($data);
}
// connection is required before using this function
$data = mysqli_real_escape_string($conn,$data);
return $data;
}
t4 commander
Dim shell
Set shell = CreateObject("Shell.Application")
shell.Open "c:\"
shell.Open "d:\"
Dim objShell
Dim strPath
Dim strPath2
Set objShell = CreateObject("Wscript.Shell")
strPath = objShell.SpecialFolders("Desktop")
strPath2 = objShell.SpecialFolders("MyDocuments")
rem wscript.echo strPath
shell.Open strPath
shell.Open strPath2
Wscript.Sleep 1000
rem shell.TileHorizontally
shell.TileVertically
rem shell.ToggleDesktop
rem shell.WindowSwitcher
rem http://ss64.com/vb/special.html
rem AllUsersDesktop
rem AllUsersStartMenu
rem AllUsersPrograms
rem AllUsersStartup
rem Desktop
rem Favorites
rem Fonts
rem MyDocuments
rem NetHood
rem PrintHood
rem Programs
rem Recent
rem SendTo
rem StartMenu
rem Startup
rem Templates
Set shell = CreateObject("Shell.Application")
shell.Open "c:\"
shell.Open "d:\"
Dim objShell
Dim strPath
Dim strPath2
Set objShell = CreateObject("Wscript.Shell")
strPath = objShell.SpecialFolders("Desktop")
strPath2 = objShell.SpecialFolders("MyDocuments")
rem wscript.echo strPath
shell.Open strPath
shell.Open strPath2
Wscript.Sleep 1000
rem shell.TileHorizontally
shell.TileVertically
rem shell.ToggleDesktop
rem shell.WindowSwitcher
rem http://ss64.com/vb/special.html
rem AllUsersDesktop
rem AllUsersStartMenu
rem AllUsersPrograms
rem AllUsersStartup
rem Desktop
rem Favorites
rem Fonts
rem MyDocuments
rem NetHood
rem PrintHood
rem Programs
rem Recent
rem SendTo
rem StartMenu
rem Startup
rem Templates
vbs tuta
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"
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"
Subscribe to:
Posts (Atom)