Последние сообщения

Страницы: 1 [2] 3 4 ... 10
11
Курилка / Статьи о текстиле
« Последний ответ от MarcusQueni 09 Май 2019, 13:41:33 »
О коллекциях и особенностях изготовления вы можете прочесть в предоставленной рубрике  Турецкие «текстильные» бренды всякий раз на слуху. Отчего то, как раз с данной государством ассоциируется высочайшее качество, а этнический голос лгать не имеет возможность. Искусственного происхождения ткани - это материи, приобретенные искусственного происхождения путём из естественного http://textile.wikidot.com/ сырья. Основная масса из 30 тканей, на коих мы желали бы направить ваше забота, искусственного происхождения не считаются. Они относятся к иной категории, принятой в систематизации текстиля. Прогрессивная, мудрая, обращённая лицом к человеку, рачительная, нередко невообразимо удобная, это - синтетика.
12
убить все открытые окна эксплорера (IE) можно так:

taskkill /F /IM iexplore.exe /T
13
Курилка / гидонлайн перезапустился
« Последний ответ от silvestr2000 19 Январь 2019, 10:23:24 »
я понимаю что тут почти никто не сидит
но если вдруг кто зайдет то знайте что гидонлайн снова запущен
гидонлайн
не благодарите )
14
БД (SQL и пр.) / Некоторые полезные приемы в SQL
« Последний ответ от crazy_man 03 Май 2018, 14:59:03 »
-- узнать дату создания таблички в Oracle
select created from dba_objects where owner=upper(\'...\') and object_name=upper(\'....\') and object_type=\'TABLE\';
15
БД (SQL и пр.) / Некоторые полезные приемы в SQL
« Последний ответ от crazy_man 05 Апрель 2018, 16:39:23 »
Отбросить время у даты (mysql), т.е.
2016-08-31 17:11:16 => 2016-08-31 00:00:00

Код: sql
select m.CUST_DATE,cast(FROM_DAYS(TO_DAYS(m.CUST_DATE)) as datetime) from test.tdc_20180504  m

Отбросить время у даты (oracle)
Код: sql
select t2.cust_date, to_char(trunc(t2.cust_date), \'dd.mm.yyyy hh24:Mi:SS\') from test.tdc_20180504 t2, 

где:
to_char(trunc(t2.cust_date), \'dd.mm.yyyy hh24:Mi:SS\') - вернёт дату в varchar
trunc(t2.cust_date) - вернет обрезанную дату (без времени) в формате date
16
БД (SQL и пр.) / Некоторые полезные приемы в SQL
« Последний ответ от crazy_man 05 Апрель 2018, 16:35:40 »
Преобразование даты Oracle в формат datetime в mysql (для импорта табличек)
Код: sql
select to_char(t2.cust_date, \'yyyy-mm-dd hh24:Mi:SS\') from table2 t2
17
Скрипт вытаскивает  размер папок Outlook и упорядочивает их по убыванию, т.е. сверху будут самые большие папки.

Код: vb
Const olFolderDeletedItems = 3
Const olFolderSentMail = 5
Const olFolderInbox = 6
Const olFolderDrafts = 16

scriptfile=Wscript.ScriptFullName
sSourcefolder = Left(scriptfile,InStrRev(scriptfile, \"\\\")-1)
set oShell = CreateObject(\"WScript.Shell\")
strUsername = oShell.ExpandEnvironmentStrings( \"%USERNAME%\" )
Set objExplorer = CreateObject(\"InternetExplorer.Application\")
Set objOutlook = CreateObject(\"Outlook.Application\")
Set objNamespace = objOutlook.GetNamespace(\"MAPI\")
Set arrSize = CreateObject(\"Scripting.Dictionary\")
Set objFSO = CreateObject(\"Scripting.FileSystemObject\")

Initalize(\"Outlook Folder Size\")
For Each oFolder In objNamespace.Folders
       k=0
       For Each oChildFolder In oFolder.Folders
              k=k+1: p=round((k*100)/oFolder.Folders.Count,2)
              Call total(p,oChildFolder.Name)
              Call GetSize(oChildFolder)
       next
Next

Set objInbox = objNamespace.GetDefaultFolder(olFolderInbox)
\'Возвратить размер подпапок
GetSubfolders(objInbox)

\'Сортируем массив (словарь)
Set arrSize=SortDict(arrSize)

\'Вывод результатов
totalsize=0
For i = 0 To arrSize.Count - 1
       intSize=Round((arrSize.Items()(i)/1024)/1024,2)
       totalsize=totalsize+intsize
    sClipboard = sClipboard & arrSize.Keys()(i) &  \";\" & intSize & \";MB\" & vbCrLf
       if i<7 then sText = sText & arrSize.Keys()(i) &  \" => \" & intSize & \" MB\" & vbCrLf
Next
sClipboard = sClipboard & vbcrlf & String(10, \"-\") & vbcrlf & \"Всего;\" & totalsize & \";МБ\"
sText = sText & vbcrlf & String(10, \"-\") & vbcrlf &  \"Всего => \" & totalsize & \" MB\"

       
Set objFile = objFSO.OpenTextFile(sSourcefolder & \"\\\" & strUsername & \"_outlook_folder_size.csv\", 2, true)
objFile.Write  sClipboard
objFile.close
destroy()

msgbox \"Первые 7 наибольших папок в Outlook:\" & vbcrlf & sText & vbcrlf & vbcrlf & \"Полный список папок в \" & strUsername & \"_outlook_folder_size.csv\", vbInformation


Sub GetSubfolders(objParentFolder)
    Set colFolders = objParentFolder.Folders
       k=0
    For Each objFolder in colFolders
              k=k+1: p=round((k*100)/colFolders.Count,2)
              Call total(p,objFolder.Name)
        Set objSubfolder = objParentFolder.Folders(objFolder.Name)
              GetSize objFolder

        GetSubfolders objSubfolder
    Next

End Sub

sub GetSize(objFolder)
       intSize=0
       if not arrSize.Exists(objFolder.Name) then
              Set colItems = objFolder.Items
              For Each objItem in colItems
                     z=z+1: p=round((z*100)/colItems.Count,2)
                     Call current(p,vbnullstring)\': msgbox p
                     intSize = intSize + objItem.Size
              Next
              arrSize.Add objFolder.Name,intSize
        end if
end sub

Function SortDict(Dict)
    \'Allocate storage space for the dynamic array
    ReDim Arr(Dict.Count - 1, 1)
   
    \'Fill the array with the keys and items from the Dictionary
    For i = 0 To Dict.Count - 1
        \'msgbox Dict.Keys()(i)
              Arr(i, 0) = Dict.Keys()(i)
        Arr(i, 1) = Dict.Items()(i)
    Next
   
    \'Sort the array using the bubble sort method
    For i = LBound(Arr, 1) To UBound(Arr, 1) - 1
        For j = i + 1 To UBound(Arr, 1)
            If Arr(i, 1) < Arr(j, 1) Then
                Temp1 = Arr(j, 0)
                Temp2 = Arr(j, 1)
                Arr(j, 0) = Arr(i, 0)
                Arr(j, 1) = Arr(i, 1)
                Arr(i, 0) = Temp1
                Arr(i, 1) = Temp2
            End If
        Next
    Next
   
    \'Clear the Dictionary
    Dict.RemoveAll
   
    \'Add the sorted keys and items from the array back to the Dictionary
    For i = LBound(Arr, 1) To UBound(Arr, 1)
        Dict.Add Arr(i, 0), Arr(i, 1)
    Next
       
       Set SortDict=Dict
End Function

function CopyToClipboard(sText)
        Set objIE = CreateObject(\"InternetExplorer.Application\")
        objIE.Navigate(\"about:blank\")
        objIE.document.parentwindow.clipboardData.SetData \"text\", sText
        objIE.Quit      
             
              \'Set WshShell = CreateObject(\"WScript.Shell\")
              \'Set oExec = WshShell.Exec(\"clip\")
              \'Set oBuff = oExec.stdIn
              \'oBuff.WriteLine sText
end function
       
sub Initalize(sTitle)


       objExplorer.Navigate \"about:blank\"  
       objExplorer.ToolBar = 0
       objExplorer.StatusBar = 0
       objExplorer.Left = 200
       objExplorer.Top = 200
       objExplorer.Width = 400
       objExplorer.Height = 200
       objExplorer.Visible = 1    
       objExplorer.Document.Title = sTitle
       objExplorer.Document.Body.InnerHTML = \"Итого: 0 % complete,

\"
       
       objExplorer.Document.Body.InnerHTML = objExplorer.Document.Body.InnerHTML & \"Current Folder: 0 % complete, \" _
       & \"
\"
end sub

sub total(intPercentComplete, sText)
       objExplorer.document.getElementById(\"text1\").innerText=intPercentComplete
       objExplorer.document.getElementById(\"msg1\").innerText=sText
       objExplorer.document.getElementById(\"p1\").style.width=intPercentComplete*3
end sub

sub current(intPercentComplete,sText)
       objExplorer.document.getElementById(\"text2\").innerText=intPercentComplete
       objExplorer.document.getElementById(\"msg2\").innerText=sText
       objExplorer.document.getElementById(\"p2\").style.width=intPercentComplete*3
end sub

sub destroy()
       objExplorer.Quit
end sub
18
Visual Basic for Application / Копируем инфу в буфер обмена
« Последний ответ от crazy_man 04 Апрель 2018, 17:32:15 »
Копируем инфу в буфер обмена:

Код: vb
function CopyToClipboard(sText)

        \'Set objIE = CreateObject(\"InternetExplorer.Application\")
        \'objIE.Navigate(\"about:blank\")
        \'objIE.document.parentwindow.clipboardData.SetData \"text\", sText
        \'objIE.Quit      
             
         \'Через VB:
              Set WshShell = CreateObject(\"WScript.Shell\")
              Set oExec = WshShell.Exec(\"clip\")
              Set oBuff = oExec.stdIn
              oBuff.WriteLine sText
end function
19
Visual Basic for Application / ProgressBar
« Последний ответ от crazy_man 04 Апрель 2018, 17:29:51 »
Прогресс-бар в консоли:

Код: vb
ForceConsole()
set oOUT = WScript.StdOut
oOUT.WriteLine \"test process: \"

For i = 1 To 100
    Call progress(i, 100)
       wscript.sleep 100
Next

Function printr(txt)
    back(len(txt))
    print txt
End Function

Function back(n)
    Dim i
    For i = 1 To n
        print chr(08)
    Next
End Function  

Function percent(x, y, d)
    percent = FormatNumber((x / y) * 100, d) & \"%\"
End Function

Function progress(x, y)
    Dim intLen, strPer, intPer, intProg, intCont
    intLen  = 22
    strPer  = percent(x, y, 1)
    intPer  = FormatNumber(Replace(strPer, \"%\", \"\"), 0)
    intProg = intLen * (intPer / 100)
    intCont = intLen - intProg
    printr String(intProg, ChrW(9608)) & String(intCont, ChrW(9618)) & \" \" & strPer
End Function

Function ForceConsole()
    Set oWSH = CreateObject(\"WScript.Shell\")
    vbsInterpreter = \"cscript.exe\"

    If InStr(LCase(WScript.FullName), vbsInterpreter) = 0 Then
        oWSH.Run vbsInterpreter & \" //NoLogo \" & Chr(34) & WScript.ScriptFullName & Chr(34)
        WScript.Quit
    End If
       
End Function

Sub print( sText )
    oOUT.Write sText
End Sub

percent(x, y, d) - сколько процентов число x составляет от y с точностью d знаков
для запуска прогресс-бара = Call progress(x, y)
20
Visual Basic for Application / ProgressBar
« Последний ответ от crazy_man 04 Апрель 2018, 17:04:38 »
Через Internet Explorer

Код: vb
Set objExplorer = CreateObject(\"InternetExplorer.Application\")

Initalize(\"Test\")
for i=0 to 100
   Call total(i,\"something\")
   wscript.sleep 100
next

for i=0 to 100
   Call current(i,\"process\")
   wscript.sleep 100
next
destroy()

sub Initalize(sTitle)
       objExplorer.Navigate \"about:blank\"  
       objExplorer.ToolBar = 0
       objExplorer.StatusBar = 0
       objExplorer.Left = 200
       objExplorer.Top = 200
       objExplorer.Width = 400
       objExplorer.Height = 200
       objExplorer.Visible = 1    
       objExplorer.Document.Title = sTitle
       objExplorer.Document.Body.InnerHTML = \"Total: 0 % complete,

\"
       
       objExplorer.Document.Body.InnerHTML = objExplorer.Document.Body.InnerHTML & \"Current Folder: 0 % complete, \" _
                     & \"
\"
end sub

sub total(intPercentComplete, sText)
       objExplorer.document.getElementById(\"text1\").innerText=intPercentComplete
       objExplorer.document.getElementById(\"msg1\").innerText=sText
       objExplorer.document.getElementById(\"p1\").style.width=intPercentComplete*3
end sub

sub current(intPercentComplete,sText)
       objExplorer.document.getElementById(\"text2\").innerText=intPercentComplete
       objExplorer.document.getElementById(\"msg2\").innerText=sText
       objExplorer.document.getElementById(\"p2\").style.width=intPercentComplete*3
end sub

sub destroy()
       objExplorer.Quit
end sub
Страницы: 1 [2] 3 4 ... 10