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 FWAP() | |
| Dim OriginalPage As Visio.Page | |
| Set OriginalPage = ActivePage | |
| Dim PagObj As Visio.Page | |
| For Each PagObj In ActiveDocument.Pages | |
| ActiveWindow.Page = PagObj.Name | |
| ActiveWindow.ViewFit = visFitPage | |
| Next PagObj |
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
| --table with some test data | |
| select * into #mytable from ( | |
| select 1 [id],'one' [value] union all | |
| select 2,'two' union all | |
| select 3,'three' union all | |
| select 4,'four' union all | |
| select 5,'five') st | |
| --bad way passing raw csv string data in | |
| declare @csv varchar(50) |
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
| ' need tools/references and add a reference to word | |
| Sub InsertDateTime() | |
| ' strings to print | |
| Dim t, n, v, delim As String | |
| t = Format(Now(), "YYYY-MM-DD hh:mm:ss") & " EST" | |
| n = "Roy Ashbrook" | |
| delim = " | " | |
| Dim d As Word.Document |
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.Linq; | |
| using System.Net; | |
| using System.Net.Sockets; | |
| namespace SimpleSniffer | |
| { | |
| static class Program | |
| { | |
| static void Main() |
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
| import java.io.*; | |
| import java.util.*; | |
| import javax.crypto.*; | |
| import javax.crypto.spec.*; | |
| public class mcreco { | |
| public static void main(String[] args) throws Exception { | |
| String p = "Path To Your lastlogin file for minecraft"; | |
| String r = mcd(p); |
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 MyMacro() | |
| 'how to select adjacent cells - http://www.google.com/url?sa=t&rct=j&q=excel%20select%20adjacent%20cells%20vba&source=web&cd=1&ved=0CFoQFjAA&url=http%3A%2F%2Fwww.ozgrid.com%2Fforum%2Fshowthread.php%3Ft%3D89576&ei=iiLNT_bMHqmg2gW1o9yIAg&usg=AFQjCNEia4-TwdJPRit8MKRh69ITAEKpJg | |
| 'how to work with the table object - http://www.jkp-ads.com/Articles/Excel2007TablesVBA.asp | |
| 'how to loop over the cells in a range- http://www.vbaexpress.com/kb/getarticle.php?kb_id=563 | |
| 'how to work with only the visible cells - http://www.mrexcel.com/forum/showthread.php?t=66490 | |
| 'how to click the publish button - http://social.msdn.microsoft.com/Forums/en/tfsgeneral/thread/af266d3f-c288-41c1-8611-97994545afc6 | |
| 'how to get the name of the current list-http://www.pcreview.co.uk/forums/get-name-active-list-t3872389.html | |
| Dim t As String, w As Worksheet, col As Range, cell As Range, pb As CommandBarControl | |
| Set pb = Application.CommandBars.FindControl(Tag:="IDC_SYNC") 'grab the publish button |
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
| -- view all table sizes | |
| -- author: royashbrook - royashbrook@yahoo.com | |
| -- april 2005 | |
| select | |
| so.id as [OBJECT_ID], | |
| so.name as [OBJECT_NAME], | |
| coalesce(j_rows.rows,0) as [ROWCOUNT], | |
| coalesce(j_ru.sum_reserved,0) * cast(m.low as dec) / 1024 as [RESERVED (KB)], | |
| d.data * cast(m.low as dec) / 1024 as [DATA (KB)], | |
| (coalesce(j_ru.sum_used,0) - d.data) * cast(m.low as dec) / 1024 as [INDEX (KB)], |
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
| -- try and do dirty reads, and turn off the record counting unless you want | |
| -- spam in the middle of your prints below. you can also just do a select | |
| -- instead of a print. | |
| set transaction isolation level read uncommitted | |
| set nocount on | |
| -- vars to hold the commands to queue up and the command var for the one we'll run | |
| -- identity is used to preserve order in case we decide to have a particular order | |
| -- otherwise it will just run in the order we create the commands | |
| declare @command nvarchar(max), @id int |
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
| //meant to run in LINQPad | |
| void Main() { | |
| this.ExecuteCommand("set transaction isolation level read uncommitted"); | |
| string FindThis = "some text to find"; | |
| string q = @" | |
| select | |
| '[' + table_catalog + '].[' + table_schema + '].[' + table_name + ']' [t] |
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
| create table #t ( | |
| tablename sysname,row_count int, | |
| reserved varchar(50),data varchar(50), | |
| index_size varchar(50),unused varchar(50)) | |
| exec sp_msforeachtable 'insert #t exec sp_spaceused ''?''' | |
| select * from #t | |
| drop table #t |