This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- our test data will simulate 10 machines that make 100 total | |
| -- connections per day that last between 1 and 300 seconds. | |
| -- this sample log is stores three items, the box name, what | |
| -- happened (start/stop) and a timedatestamp | |
| -- this data is supposed to happen in a sequence mostly. there | |
| -- could be overlapping time events with the machines, but since | |
| -- we would just eliminate that in a sort by machine later anyway | |
| -- i am not going to worry about that and we will do everything in | |
| -- one long sequence. our start date will be getdate() if there is | |
| -- no date already in the table. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using(TextWriter tw = new StreamWriter(@"uppercase.txt",false)) { | |
| int i = 0; | |
| var q = File.ReadAllLines(@"lowercase.txt").Take(1000); | |
| foreach(var v in q) { | |
| tw.WriteLine("{0}", v.ToUpper()); | |
| //print status on every 100th record |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :setup | |
| @echo off | |
| set serverlistfile=serverlist | |
| set outputtsvfile=output.tsv | |
| set iteration=5 | |
| goto :main | |
| :main | |
| call :build_header |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub datetimename() | |
| ' in word 2007 for this to work you have to go to | |
| ' tools/references and add a reference to word | |
| Dim d As Word.Document | |
| Dim s As Word.Selection | |
| Dim v As String | |
| v = vbCrLf & Format(Now(), "yyyy-MM-dd HH:mm:ss AM/PM") & " EST | Roy Ashbrook | " | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'soap/wsdlDriver' | |
| require 'digest/md5' | |
| u = "user" | |
| p = Digest::MD5.hexdigest("password") | |
| ua = {"user_name" => u,"password" => p} | |
| wsdl = "http://yoursite.com/soap.php?wsdl" | |
| #create soap | |
| s = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare @s nvarchar(max) | |
| while ( | |
| select | |
| count(*) | |
| from | |
| sys.objects obj | |
| join sys.schemas s | |
| on (s.schema_id=obj.schema_id) | |
| where |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Text; | |
| using System.Xml; | |
| using cc = System.Net.CredentialCache; | |
| using c = System.Console; | |
| using e = System.Environment; | |
| using d = System.Xml.XmlDocument; | |
| namespace todo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'some vars | |
| url = "http://<yoursitegoeshere>/_vti_bin/Lists.asmx" | |
| list = "<yourlistgoeshere>" 'can be GUID too | |
| id = 2 | |
| title = wscript.arguments(0) | |
| 'the caml | |
| batch = "<Batch OnError='Continue' ListVersion='1'>" | |
| batch = batch + " <Method ID='1' Cmd='New'>" | |
| batch = batch + " <Field Name='ID'>New</Field>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Stack q = new Stack(); | |
| q.Push(argument); | |
| while (q.Count > 0) | |
| { | |
| string d = q.Pop().ToString(); | |
| Console.WriteLine(d); | |
| foreach (string sd in Directory.GetDirectories(d)) | |
| q.Push(sd); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Text.RegularExpressions; | |
| namespace LineCounter | |
| { | |
| class LineCounter | |
| { |