Search is not available for this dataset
content stringlengths 0 376M |
|---|
<reponame>LaudateCorpus1/RosettaCodeData
' Read a file line by line
Sub Main()
Dim fInput As String, fOutput As String 'File names
Dim sInput As String, sOutput As String 'Lines
Dim nRecord As Long
fInput = "input.txt"
fOutput = "output.txt"
On Error GoTo InputError
Open fInput For Input As ... |
<gh_stars>1-10
Set objXMLDoc = CreateObject("msxml2.domdocument")
Set objRoot = objXMLDoc.createElement("CharacterRemarks")
objXMLDoc.appendChild objRoot
Call CreateNode("April","Bubbly: I'm > Tam and <= Emily")
Call CreateNode("<NAME>","Burns: ""When chapman billies leave the street ...""")
Call CreateNode("Emily","... |
<reponame>LaudateCorpus1/RosettaCodeData<filename>Task/Zhang-Suen-thinning-algorithm/VBA/zhang-suen-thinning-algorithm.vba<gh_stars>1-10
Public n As Variant
Private Sub init()
n = [{-1,0;-1,1;0,1;1,1;1,0;1,-1;0,-1;-1,-1;-1,0}]
End Sub
Private Function AB(text As Variant, y As Integer, x As Integer, step As Integer... |
Public q() As Long
Sub make_q()
ReDim q(2 ^ 20)
q(1) = 1
q(2) = 1
Dim l As Long
For l = 3 To 2 ^ 20
q(l) = q(q(l - 1)) + q(l - q(l - 1))
Next l
End Sub
Public Sub hcsequence()
Dim mallows As Long: mallows = -1
Dim max_n As Long, n As Long
Dim l As Long, h As Long
make_q
... |
<filename>Task/Sorting-algorithms-Bogosort/VBScript/sorting-algorithms-bogosort-1.vb
sub swap( byref a, byref b )
dim tmp
tmp = a
a = b
b = tmp
end sub
'knuth shuffle (I think)
function shuffle( a )
dim i
dim r
randomize timer
for i = lbound( a ) to ubound( a )
r = int( rnd * ( ubound( a ) + 1 ) )
if r <>... |
WScript.Echo ScriptEngine(), ScriptEngineBuildVersion (), ScriptEngineMajorVersion(), ScriptEngineMinorVersion ()
|
VERSION 5.00
Begin VB.Form NewFaxDialog
Caption = "New Fax Document"
ClientHeight = 1800
ClientLeft = 6300
ClientTop = 5355
ClientWidth = 6045
LinkTopic = "Form1"
ScaleHeight = 1800
ScaleWidth = 6045
Begin VB.CommandButton Ca... |
Sub FizzBuzz()
Dim i As Integer
Dim T(1 To 99) As Variant
For i = 1 To 99 Step 3
T(i + 0) = IIf((i + 0) Mod 5 = 0, "Buzz", i)
T(i + 1) = IIf((i + 1) Mod 5 = 0, "Buzz", i + 1)
T(i + 2) = IIf((i + 2) Mod 5 = 0, "FizzBuzz", "Fizz")
Next i
Debug.Print Join(T, ", ") & ", Buzz"
End... |
<gh_stars>1-10
'Option Base 1
Private Function gauss_eliminate(a As Variant, b As Variant) As Variant
Dim n As Integer: n = UBound(b)
Dim tmp As Variant, m As Integer, mx As Variant
For col = 1 To n
m = col
mx = a(m, m)
For i = col + 1 To n
tmp = Abs(a(i, col))
... |
<filename>admin/wmi/wbem/scripting/test/vbscript/privilege/privilege_ps3.vbs
on error resume next
const wbemPrivilegeDebug = 19
set service = GetObject ("winmgmts:{impersonationLevel=impersonate}")
service.security_.privileges.Add wbemPrivilegeDebug
if err <> 0 then
WScript.Echo Hex(Err.Number), Err.Descrip... |
'//+----------------------------------------------------------------------------
'//
'// File: newver.frm
'//
'// Module: pbadmin.exe
'//
'// Synopsis: The dialog for publishing phonebooks in PBA
'//
'// Copyright (c) 1997-1999 Microsoft Corporation
'//
'// Author: quintinb Created Header 09/02/9... |
10 REM SIMPLE PAINT PROGRAM
20 REM BY VECTRONIC
100 HOME : GR
110 X = 20 : Y = 20 : C = 9 : K = 160
120 COLOR = C: PLOT X, Y
130 GOSUB 2000
150 XP%=PDL(0): FOR PX = 1 TO 10 : NEXT: YP%=PDL(1): FOR PY =1 TO 10: NEXT
160 K = PEEK(-16384)
170 IF XP% > 130 THEN 300
180 IF XP% < 120 THEN 400
190 IF YP% > 130 THEN 500
200 IF... |
Private Function sumto(n As Integer) As Double
Dim res As Double
For i = 1 To n
res = res + 1 / i ^ 2
Next i
sumto = res
End Function
Public Sub main()
Debug.Print sumto(1000)
End Sub
|
<gh_stars>10-100
Set objSet = GetObject("winmgmts:").ExecQuery(_
"select * from Win32_ShadowStorage")
for each obj in objSet
WScript.Echo "VolumeRef: " & obj.Volume
WScript.Echo "DiffVolumeRef: " & obj.DiffVolume
WScript.Echo "MaxSpace: " & obj.MaxSpace
WScript.Echo "UsedSpace: " & obj.UsedSpace
WScri... |
' Queue Definition - VBScript
Option Explicit
Dim queue, i, x
Set queue = CreateObject("System.Collections.ArrayList")
If Not empty_(queue) Then Wscript.Echo queue.Count
push queue, "Banana"
push queue, "Apple"
push queue, "Pear"
push queue, "Strawberry"
Wscript.Echo "Count=" & queue.Count
Wscript.Echo pull(queue) & " ... |
<filename>Task/Matrix-multiplication/VBScript/matrix-multiplication.vb
Dim matrix1(2,2)
matrix1(0,0) = 3 : matrix1(0,1) = 7 : matrix1(0,2) = 4
matrix1(1,0) = 5 : matrix1(1,1) = -2 : matrix1(1,2) = 9
matrix1(2,0) = 8 : matrix1(2,1) = -6 : matrix1(2,2) = -5
Dim matrix2(2,2)
matrix2(0,0) = 9 : matrix2(0,1) = 2 : matrix2(0... |
<filename>Task/Return-multiple-values/VBA/return-multiple-values-4.vba
Function List() As String()
Dim i&, Temp(9) As String
For i = 0 To 9
Temp(i) = "Liste " & i + 1
Next
List = Temp
End Function
'For use :
Sub test_List()
Dim myArr() As String, i As Integer
'Note : you don't need to Dim your arr... |
set locator = CreateObject("WbemScripting.SWbemLocator")
WScript.Echo TypeName(locator)
set locatorex = CreateObject("WbemScripting.SWbemLocatorEx")
WScript.Echo TypeName(locatorex)
set objectpath = CreateObject("WbemScripting.SWbemObjectPath")
WScript.Echo TypeName(objectpath)
WScript.Echo TypeName(objectpat... |
<reponame>puthukkaden/SystemSetup
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\windows_startup_scripts\work_programs.bat" & Chr(34), 0
Set WshShell = Nothing
|
Private Function OddWordFirst(W As String) As String
Dim i As Integer, count As Integer, l As Integer, flag As Boolean, temp As String
count = 1
Do
flag = Not flag
l = FindNextPunct(i, W) - count + 1
If flag Then
temp = temp & ExtractWord(W, count, l)
Else
temp = temp & R... |
Function GetUTC() As String
Url = "http://tycho.usno.navy.mil/cgi-bin/timer.pl"
With CreateObject("MSXML2.XMLHTTP.6.0")
.Open "GET", Url, False
.send
arrt = Split(.responseText, vbLf)
End With
For Each t In arrt
If InStr(t, "UTC") Then
GetUTC = StripHttpTags(t... |
<gh_stars>1-10
' Align columns - RC - VBScript
Const nr=16, nc=16
ReDim d(nc),t(nr), wor(nr,nc)
i=i+1: t(i) = "Given$a$text$file$of$many$lines,$where$fields$within$a$line$"
i=i+1: t(i) = "are$delineated$by$a$single$'dollar'$character,$write$a$program"
i=i+1: t(i) = "that$aligns$each$column$of$fields$by$ensuring$th... |
<gh_stars>10-100
'This script displays all currently stopped services
WScript.Echo "The following service are currently stopped:"
WScript.Echo "==========================================="
WScript.Echo ""
for each Service in _
GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _
("Select ... |
'------------------------------------------------------------------------------
' <copyright from='1997' to='2001' company='Microsoft Corporation'>
' Copyright (c) Microsoft Corporation. All Rights Reserved.
' Information Contained Herein is Proprietary and Confidential.
... |
<filename>admin/wmi/wbem/scripting/test/vbscript/processr.vbs
for each Process in GetObject("winmgmts:{impersonationLevel=impersonate}!//alanbos2").InstancesOf ("Win32_Process")
WScript.Echo Process.Name
next |
<filename>small_basic.bas
TextWindow.WriteLine ( "Hello, World!" )
|
Option Explicit
Public myForm As Object
Public Fram As MSForms.Frame
Public Dico As Object
Public DicoParent As Object
Public TypeObjet As String
Public Mine As Boolean
Public boolFind As Boolean
Private strName As String
Private cNeighbours() As cMinesweeper
Public WithEvents myButton As MSForms.CommandButton
Private... |
<reponame>LaudateCorpus1/RosettaCodeData
Option Base 1
Public Enum attr
Colour = 1
Nationality
Beverage
Smoke
Pet
End Enum
Public Enum Drinks_
Beer = 1
Coffee
Milk
Tea
Water
End Enum
Public Enum nations
Danish = 1
English
German
Norwegian
Swedish
End Enum
Publ... |
Public Sub LoopsWhile()
Dim value As Integer
value = 1024
Do While value > 0
Debug.Print value
value = value / 2
Loop
End Sub
|
<filename>admin/wmi/wbem/scripting/test/whistler/pcache/getas.vbs
' Get a disk
set disk = GetObject ("winmgmts:win32_logicaldisk='C:'")
wbemCimtypeSint8 = 16
wbemCimtypeUint8 = 17
wbemCimtypeSint16 = 2
wbemCimtypeUint16 = 18
wbemCimtypeSint32 = 3
wbemCimtypeUint32 = 19
wbemCimtypeSint64 = 20
wbemCimtypeUint6... |
'----------------------------------------------------------------------
'
' Copyright (c) Microsoft Corporation. All rights reserved.
'
' Abstract:
' prnqctl.vbs - printer control script for WMI on Whistler
' used to pause, resume and purge a printer
' also used to print a test page on a printer
'
' Usag... |
Public Function RReverse(aString As String) As String
'returns the reversed string
'do it recursively: cut the string in two, reverse these fragments and put them back together in reverse order
Dim L As Integer 'length of string
Dim M As Integer 'cut point
L = Len(aString)
If L <= 1 Then 'no need to reverse
... |
Option Explicit
Public Sub AmicablePairs()
Dim a(2 To 20000) As Long, c As New Collection, i As Long, j As Long, t#
t = Timer
For i = LBound(a) To UBound(a)
'collect the sum of the proper divisors
'of each numbers between 2 and 20000
a(i) = S(i)
Next
'Double Loops to test the am... |
VERSION 5.00
Begin VB.Form frmFileViewer
Caption = "File Viewer Extension"
ClientHeight = 4185
ClientLeft = 60
ClientTop = 345
ClientWidth = 5130
LinkTopic = "Form1"
ScaleHeight = 4185
ScaleWidth = 5130
StartUpPosition = 3 ... |
Option Explicit
Main
Sub Main
Dim oCluster
Dim oNode
Dim sCluster
Set oCluster = CreateObject("MSCluster.Cluster")
sCluster = InputBox( "Cluster to open?" )
oCluster.Open( sCluster )
MsgBox oCluster.Name
MsgBox "Node count is " & oCluster.Nodes.Count
for each oNode in oCluster.Nodes
... |
<filename>tools/bp_conv/bp_conv.bas
Dim r (0 To 7) As Ubyte
dim as string fn, fn256, fn16, fn4, fn1
dim as ubyte x,y,z,c
? "Enter file name > ";:input fn
fn256=fn+"x256.bin"
fn16=fn+"x16.bin"
fn4=fn+"x4.bin"
fn1=fn+"x1.bin"
fn=fn+".raw"
open fn For Binary Access Read As 1
open fn256 For Binary Access Write As 2
op... |
<gh_stars>1000+
' IsMember2.vbs
' VBScript program demonstrating the use of Function IsMember.
'
' ----------------------------------------------------------------------
' Copyright (c) 2002-2010 <NAME>
' Hilltop Lab web site - http://www.rlmueller.net
' Version 1.0 - November 10, 2002
' Version 1.1 - February 19, 2003... |
<reponame>LaudateCorpus1/RosettaCodeData<gh_stars>1-10
class topological
dim dictDependencies
dim dictReported
dim depth
sub class_initialize
set dictDependencies = createobject("Scripting.Dictionary")
set dictReported = createobject("Scripting.Dictionary")
depth = 0
end sub
sub reset
dictReported.rem... |
<reponame>npocmaka/Windows-Server-2003
Attribute VB_Name = "modMain"
Option Explicit
' The idea demonstrated in this app is controlled access to KP files,
' more precisely access to the auth protocol retry counter
' A special (some kind of administrator) KP named "pinrc" is created.
' His auth protocol is this R... |
set drives = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _
("select DeviceID from Win32_LogicalDisk where DriveType=3")
for each drive in drives
WScript.Echo drive.DeviceID
next |
sub swap( byref a, byref b)
dim tmp
tmp = a
a = b
b = tmp
end sub
function selectionSort (a)
for i = 0 to ubound(a)
k = i
for j=i+1 to ubound(a)
if a(j) < a(i) then
swap a(i), a(j)
end if
next
next
selectionSort = a
end function
|
<reponame>LaudateCorpus1/RosettaCodeData<filename>Task/Caesar-cipher/VBA/caesar-cipher.vba
Option Explicit
Sub Main_Caesar()
Dim ch As String
ch = Caesar_Cipher("CAESAR: Who is it in the press that calls on me? I hear a tongue, shriller than all the music, Cry 'Caesar!' Speak; Caesar is turn'd to hear.", 14)
D... |
<filename>Task/Floyds-triangle/VBA/floyds-triangle-1.vba
Option Explicit
Dim o As String
Sub floyd(L As Integer)
Dim r, c, m, n As Integer
n = L * (L - 1) / 2
m = 1
For r = 1 To L
o = o & vbCrLf
For c = 1 To r
o = o & Space(Len(CStr(n + c)) - Len(CStr(m))) & m & " "
... |
<gh_stars>10-100
VERSION 5.00
Begin VB.Form frmLiveHelpFileImage
Caption = "Live Help File Image Creation Utility"
ClientHeight = 4155
ClientLeft = 5625
ClientTop = 6060
ClientWidth = 6600
LinkTopic = "Form1"
ScaleHeight = 4155
ScaleWid... |
'strip block comment NESTED comments
'multi line comments
'and what if there are string literals with these delimeters?
'------------------------
'delimeters for Block Comment can be specified, exactly two characters each
'Three states: Block_Comment, String_Literal, Other_Text
'Globals:
Dim t As String 'target string
... |
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4905
ClientLeft = 60
ClientTop = 345
ClientWidth = 9240
LinkTopic = "Form1"
ScaleHeight = 4905
ScaleWidth = 9240
StartUpPosition = 3 'Windows Default
Be... |
<gh_stars>10-100
' The following sample retrieves the associators of an instance
' of the class Win32_LogicalDisk that are associated via the class
' Win32_LogicalDiskToPartition
Set objServices = GetObject("cim:root/cimv2")
Set objEnum = objServices.AssociatorsOf _
("Win32_LogicalDisk=""C:""", "Win32_LogicalDis... |
Attribute VB_Name = "DuplicateCode"
Option Explicit
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Sub PopulateCboWithSKUs( _
ByVal i_cbo As ComboBox, _
Optional ByVal blnListCollectiveSKUs As Boolean = False _
)
... |
<filename>admin/pchealth/authtools/prodtools/applets/xpathtester/module1.bas
Attribute VB_Name = "Module1"
Public Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As LARGE_INTEGER) As Long
Public Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As LARGE_INTEGER) As Lon... |
<reponame>LaudateCorpus1/RosettaCodeData
Sub Main() 'usage of the above
Const Text$ = "Given$a$text$file$of$many$lines,$where$fields$within$a$line$" & vbLf & _
"are$delineated$by$a$single$'dollar'$character,$write$a$program" & vbLf & _
"that$aligns$each$column$of$fields$by$ensuring$that$word... |
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 6585
ClientLeft = 1080
ClientTop = 1440
ClientWidth = 8685
LinkTopic = "Form1"
PaletteMode = 1 'UseZ... |
<reponame>LaudateCorpus1/RosettaCodeData
MsgBox("Goodbye, World!")
|
<gh_stars>10-100
' Windows Installer utility to manage installer policy settings
' For use with Windows Scripting Host, CScript.exe or WScript.exe
' Copyright (c) Microsoft Corporation. All rights reserved.
' Demonstrates the use of the installer policy keys
' Policy can be configured by an administrator using the ... |
<reponame>npocmaka/Windows-Server-2003
set disk = GetObject ("winmgmts:win32_logicaldisk='C:'")
for i = 1 to 100000
WScript.Echo Disk.FreeSpace
disk.Refresh_
next |
<gh_stars>10-100
'
' Copyright (c) 1997-1999 Microsoft Corporation
'
' This script lists the ADSI path to the user objects
' that a given group contains
' This is a routine that prints the users in a group
Sub FindGroupMembership ( objService , theGroup )
On Error Resume Next
Dim objInstance
Dim objE... |
Function IsPrime(n)
If n = 2 Then
IsPrime = True
ElseIf n <= 1 Or n Mod 2 = 0 Then
IsPrime = False
Else
IsPrime = True
For i = 3 To Int(Sqr(n)) Step 2
If n Mod i = 0 Then
IsPrime = False
Exit For
End If
Next
End If
End Function
For n = 1 To 50
If IsPrime(n) Then
WScript.StdOut.Write n & ... |
<filename>inetsrv/iis/svcs/nntp/adminsso/scripts/rserver.vbs
REM
REM LOCALIZATION
REM
L_SWITCH_OPERATION = "-t"
L_SWITCH_SERVER = "-s"
L_SWITCH_INSTANCE_ID = "-v"
L_SWITCH_CL_POSTS = "-c"
L_SWITCH_CL_SOFT = "-l"
L_SWITCH_CL_HARD = "-h"
L_SWITCH_FD_POSTS = "-f"
L_SWITCH_FD_SOFT = "-i"
L... |
Option Base 1
Public Enum sett
name_ = 1
initState
endState
blank
rules
End Enum
Public incrementer As Variant, threeStateBB As Variant, fiveStateBB As Variant
'-- Machine definitions
Private Sub init()
incrementer = Array("Simple incrementer", _
"q0", _
"qf", _
"B", _
... |
<reponame>LaudateCorpus1/RosettaCodeData<filename>Task/Repeat-a-string/Visual-Basic/repeat-a-string-2.vb
Public Function StrRepeat(sText As String, n As Integer) As String
StrRepeat = Replace(String(n, "*"), "*", sText)
End Function
|
<filename>Task/Hofstadter-Figure-Figure-sequences/VBA/hofstadter-figure-figure-sequences.vba<gh_stars>1-10
Private Function ffr(n As Long) As Long
Dim R As New Collection
Dim S As New Collection
R.Add 1
S.Add 2
'return R(n)
For i = 2 To n
R.Add R(i - 1) + S(i - 1)
For j = S(S.Cou... |
' 8 lines 3 code 3 comments 2 blanks
Dim MyStr1, MyStr2
MyStr1 = "Hello"
' This is also a comment
MyStr2 = "Goodbye"
REM Comment on a line
|
FilePath = "<SPECIFY FILE PATH HERE>"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(FilePath,1)
Do Until objFile.AtEndOfStream
WScript.Echo objFile.ReadLine
Loop
objFile.Close
Set objFSO = Nothing
|
Sub Main()
'testing the above functions
Dim i As Integer
For i = 1750 To 2150
Debug.Assert IsLeapYear1(i) Eqv IsLeapYear2(i)
Next i
End Sub
|
<filename>inetsrv/iis/img/scripts/iisext.vbs
'
' Copyright (c) Microsoft Corporation. All rights reserved.
'
' VBScript Source File
'
' Script Name: IIsExt.vbs
'
Option Explicit
On Error Resume Next
' Error codes
Const ERR_OK = 0
Const ERR_GENERAL_FAILURE = 1
'''''''''''''''''''''
' Mes... |
<gh_stars>1-10
appname = App.EXEName 'appname = "MyVBapp"
|
Imports System
Public Module HelloWorld
Public Sub Main()
HelloWorld()
End Sub
Sub HelloWorld()
Console.WriteLine("Hello, world!")
End Sub
End Module
|
on error resume next
Set Locator = CreateObject("WbemScripting.SWbemLocator")
Set Services = Locator.ConnectServer(, "root\CIMV2")
If IsObject(Services) Then
Set objSet = Services.InstancesOf("Win32_OperatingSystem")
For Each obj In objSet
WScript.Echo (obj.Path_)
Set objItem = objSet.Item(o... |
Function strip_comments(s,char)
If InStr(1,s,char) > 0 Then
arr = Split(s,char)
strip_comments = RTrim(arr(0))
Else
strip_comments = s
End If
End Function
WScript.StdOut.WriteLine strip_comments("apples, pears # and bananas","#")
WScript.StdOut.WriteLine strip_comments("apples, pears ; and bananas",";")
|
Sub CountOctal()
Dim i As Integer
i = 0
On Error GoTo OctEnd
Do
Debug.Print Oct(i)
i = i + 1
Loop
OctEnd:
Debug.Print "Integer overflow - count terminated"
End Sub
|
<reponame>LaudateCorpus1/RosettaCodeData
Sub Main()
Const nmax = 12, xx = 3
Const x = xx + 1
Dim i As Integer, j As Integer, s As String
s = String(xx, " ") & " |"
For j = 1 To nmax
s = s & Right(String(x, " ") & j, x)
Next j
Debug.Print s
s = String(xx, "-") & " +"
For j = 1... |
<gh_stars>1-10
Option Explicit
Public Sub Main_Anagram()
Dim varReturn
Dim temp
Dim strContent As String
Dim strFile As String
Dim Num As Long
Dim i As Long
Dim countTime As Single
'Open & read txt file
Num = FreeFile
strFile = "C:\Users\" & Environ("Username") & "\Desktop\unixdict.txt"
Open strFile F... |
<gh_stars>1-10
Function Zeckendorf(n)
num = n
Set fibonacci = CreateObject("System.Collections.Arraylist")
fibonacci.Add 1 : fibonacci.Add 2
i = 1
Do While fibonacci(i) < num
fibonacci.Add fibonacci(i) + fibonacci(i-1)
i = i + 1
Loop
tmp = ""
For j = fibonacci.Count-1 To 0 Step -1
If fibonacci(j) <= num A... |
Sub SiftDown(list() As Integer, start As Long, eend As Long)
Dim root As Long : root = start
Dim lb As Long : lb = LBound(list)
Dim temp As Integer
While root * 2 + 1 <= eend
Dim child As Long : child = root * 2 + 1
If child + 1 <= eend Then
If list(lb + child) < list(lb + child + 1) Then
child = child ... |
Sub Rosetta_AB()
Dim stEval As String
stEval = InputBox("Enter two numbers, separated only by a space", "Rosetta Code", "2 2")
MsgBox "You entered " & stEval & vbCr & vbCr & _
"VBA converted this input to " & Replace(stEval, " ", "+") & vbCr & vbCr & _
"And evaluated the result as " & Evaluate(Replace(stEval, "... |
<filename>Task/File-modification-time/VBScript/file-modification-time.vb
WScript.Echo CreateObject("Scripting.FileSystemObject").GetFile("input.txt").DateLastModified
|
<filename>admin/wmi/wbem/scripting/test/vbscript/badmoniker.vbs
on error resume next
Set Services = GetObject("winmgmts:?")
if err <> 0 then
Wscript.Echo Err.Description, Err.Source, Err.Number
end if |
'
' test2.vbs
'
' device lists
'
Dim WshSHell
Dim DevCon
Dim AllDevs
Dim DelDev
Dim Dev
set WshShell = WScript.CreateObject("WScript.Shell")
set DevCon = WScript.CreateObject("DevCon.DeviceConsole")
set AllDevs = DevCon.AllDevices()
Count = AllDevs.Count
Wscript.Echo "Enum, Count="+CStr(Count)
FOR ... |
<filename>admin/pchealth/upload/client/uploadmanager/unittest/test8_poweroff.vbs
'stop
Set oArguments = wscript.Arguments
If oArguments.length > 0 then
Id = oArguments.Item(0)
End If
If oArguments.length > 1 then
File = oArguments.Item(1)
End If
History = 2
Compressed = false
PersistToDisk = ... |
'********************************************************************
'*
'* File: GETRAM.VBS
'* Created: July 1998
'* Version: 1.0
'*
'* Main Function: Lists the size of RAM on a machine.
'* Usage: GETRAM.VBS [/S:server] [/U:username] [/W:password] [/Q]
'*
'* Copyright (C) 1998 Micros... |
Attribute VB_Name = "CabsAndHHTs"
Option Explicit
Public Const PKG_DESC_FILE_C As String = "package_description.xml"
Private Const PKG_DESC_HHT_C As String = "HELPCENTERPACKAGE/METADATA/HHT"
Private Const PKG_DESC_HHT_ATTRIBUTE_FILE_C As String = "FILE"
Public Const E_FAIL As Long = &H80004005
Public Function... |
<filename>Task/Binary-search/VBA/binary-search-1.vba
Public Function BinarySearch(a, value, low, high)
'search for "value" in ordered array a(low..high)
'return index point if found, -1 if not found
If high < low Then
BinarySearch = -1 'not found
Exit Function
End If
midd = low + Int((high - low) / 2) ' ... |
Public Q(100000) As Long
Public Sub HofstadterQ()
Dim n As Long, smaller As Long
Q(1) = 1
Q(2) = 1
For n = 3 To 100000
Q(n) = Q(n - Q(n - 1)) + Q(n - Q(n - 2))
If Q(n) < Q(n - 1) Then smaller = smaller + 1
Next n
Debug.Print "First ten terms:"
For i = 1 To 10
Debug.Pr... |
<reponame>djgoku/RosettaCodeData
Set FSO=CreateObject("Scripting.FileSystemObject")
Function FileExists(strFile)
if FSO.fileExists(strFile) then
FileExists=true
else
FileExists=false
end if
end function
Function folderExists(strFolder)
if FSO.folderExists(strFolder) then
folderExists=true
else
folderexists=false
end i... |
<filename>ips/mbist/READONLY_LVISION_MBISTPG_CTRL.vb
/*
----------------------------------------------------------------------------------
- -
- Copyright Mentor Graphics Corporation -
- All Rights R... |
<reponame>npocmaka/Windows-Server-2003
Set obj = CreateObject( "Wmi.XMLTranslator" )
obj.QualifierFilter = 0
obj.HostFilter = True
obj.DeclGroupType = 2
'res = obj.ExecQuery( "root/cimv2", "select * from WIN32_LogicalDisk" )
'res = obj.ExecQuery( "root/cimv2", "select * from WIN32_ProgramGroup" )
res =... |
/*
----------------------------------------------------------------------------------
- -
- Copyright Mentor Graphics Corporation -
- All Rights Reserved ... |
<filename>b/basic.bas
10 REM Fuck You Github in BASIC
20 PRINT "Fuck You Github"
|
<filename>Task/Return-multiple-values/VBA/return-multiple-values-1.vba
Type Contact
Name As String
firstname As String
Age As Byte
End Type
Function SetContact(N As String, Fn As String, A As Byte) As Contact
SetContact.Name = N
SetContact.firstname = Fn
SetContact.Age = A
End Function
'For us... |
For i=1 To 8
WScript.StdOut.WriteLine triples(10^i)
Next
Function triples(pmax)
prim=0 : count=0 : nmax=Sqr(pmax)/2 : n=1
Do While n <= nmax
m=n+1 : p=2*m*(m+n)
Do While p <= pmax
If gcd(m,n)=1 Then
prim=prim+1
count=count+Int(pmax/p)
End If
m=m+2
p=2*m*(m+n)
Loop
n=n+1
Loop
triples = ... |
Debug.Print VBA.StrReverse("Visual Basic")
|
Debug.Print Chr(97) 'Prints a
Debug.Print [Code("a")] ' Prints 97
|
Function multiply(a As Integer, b As Integer) As Integer
multiply = a * b
End Function
|
<filename>Task/QR-decomposition/VBA/qr-decomposition-1.vba
Option Base 1
Private Function vtranspose(v As Variant) As Variant
'-- transpose a vector of length m into an mx1 matrix,
'-- eg {1,2,3} -> {1;2;3}
vtranspose = WorksheetFunction.Transpose(v)
End Function
Private Function mat_col(a As... |
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX"
Begin VB.Form DeviceWindow
BorderStyle = 3 'Fixed Dialog
Caption = "Fax Device"
ClientHeight = 6705
ClientLeft = 45
ClientTop = 330
ClientWidth = 7785
BeginPrope... |
set TimeZones = GetObject("winmgmts:{impersonationLevel=impersonate}").instancesof("Win32_TimeZone")
for each TimeZone in TimeZones
WScript.Echo "Standard Name = " & TimeZone.StandardName
WScript.Echo "Bias = " & TimeZone.Bias
WScript.Echo "Standard Bias = " & TimeZone.StandardBias
WScript.Echo "Standard Y... |
<reponame>LaudateCorpus1/RosettaCodeData
Private Function lngHalve(Nb As Long) As Long
lngHalve = Nb / 2
End Function
Private Function lngDouble(Nb As Long) As Long
lngDouble = Nb * 2
End Function
Private Function IsEven(Nb As Long) As Boolean
IsEven = (Nb Mod 2 = 0)
End Function
|
<reponame>LaudateCorpus1/RosettaCodeData
Function min(x As Integer, y As Integer) As Integer
If x < y Then
min = x
Else
min = y
End If
End Function
Function levenshtein(s As String, t As String) As Integer
Dim ls As Integer, lt As Integer
Dim i As Integer, j As Integer, cost As Integer
... |
'***************************************************************************
'This script tests the ability to set up instances with keyholes and read
'back the path and key
'***************************************************************************
On Error Resume Next
while true
Set Locator = CreateObject("... |
<gh_stars>1-10
' Read the list of paths (newline-separated) into an array...
strPaths = Split(WScript.StdIn.ReadAll, vbCrLf)
' Split each path by the delimiter (/)...
For i = 0 To UBound(strPaths)
strPaths(i) = Split(strPaths(i), "/")
Next
With CreateObject("Scripting.FileSystemObject")
' Test each path segment...... |
<reponame>npocmaka/Windows-Server-2003<gh_stars>10-100
'***************************************************************************
'This script tests the enumeration of instances
'***************************************************************************
On Error Resume Next
for each Disk in GetObject("winmgmts... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.