New Blog Up

by rsutton 17. March 2010 23:59
I've never liked the fact that my domain randallsutton.net has the suffix .net instead of .com, so I've decided to move my blog to a new domain I aquired a while back randallbits.com.  I'm going to try and import all my posts and redirect all the links, but for now you can update your readers and such.

Tags:

Development | IT | Misc

Can’t access C$ share in Windows 7

by rsutton 15. May 2009 04:40

I kept trying to do the old \\mymachine\c$ to access the c drive of a machine in my network and it I couldn’t get it to work.  Now this machine was Windows 7 and ever since Vista file sharing has been really weird and in my opinion pretty messed up.  The solution of course was to DISABLE UAC.  That’s right.  If you disable User Account Control then this will work just fine.

Tags:

IT | Development

Remove wordpress search button

by rsutton 8. May 2009 23:57

After getting wordpress up and running I was sad to see that ugly search button next to my search widget, so here are some steps that I used to remove it and get a cool effect in the text box just like the theme samples.

  1. Open wordpress/wp-includes/widgets.php
  2. Search for the function wp_widget_search
  3. Find the line <input type="submit" value="<?php echo attribute_escape(__('Search')); ?>" /> (Second input tag in the div)
  4. Change type="submit" to type="hidden"
  5. (opt) Add a <br /> after the input tag so you have a space under your search box.
  6. (opt) Change the input tag right above the previous one to look like the one below to add the "To search,type and hit enter" effect. (First input tag in the div)

 

<input name="s" id="s" size="15" 
onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" 
onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" 
value="To search, type and hit enter" type="text" />


That's it. Save that bad boy and you should be up and running and have a much cooler search bar.

Tags:

Development | IT

JavaScript Speed Test – Safari 4, Firefox 3, Firefox 3.5, Chrome, IE7 and IE 8

by rsutton 7. May 2009 10:55

I recently downloaded TaffyDB a neat little JavaScript database.  Included in the download were a couple of files containing unit tests as well as a speed test, so I decided to run these speeds tests in Firefox, Chrome and Internet Explorer.  Here are my results.

 

Internet Explorer 7 (6th Place) 1983.8ms

Create and Fill Taffy, 69 milliseconds
Create and Fill Taffy, 65 milliseconds
Create and Fill Taffy, 61 milliseconds
Create and Fill Taffy, 62 milliseconds
Create and Fill Taffy, 62 milliseconds
Avg: 63.8 milliseconds

Do 80% record remove via lookup, 508 milliseconds
Do 80% record remove via lookup, 510 milliseconds
Do 80% record remove via lookup, 502 milliseconds
Do 80% record remove via lookup, 508 milliseconds
Do 80% record remove via lookup, 501 milliseconds
Avg: 505.8 milliseconds

Do a forEach Update, 260 milliseconds
Do a forEach Update, 254 milliseconds
Do a forEach Update, 256 milliseconds
Do a forEach Update, 262 milliseconds
Do a forEach Update, 258 milliseconds
Avg: 258 milliseconds

Find Every Record [1000], 448 milliseconds
Find Every Record [1000], 437 milliseconds
Find Every Record [1000], 430 milliseconds
Find Every Record [1000], 435 milliseconds
Find Every Record [1000], 428 milliseconds
Avg: 435.6 milliseconds

Find Record 900 [1], 26 milliseconds
Find Record 900 [1], 27 milliseconds
Find Record 900 [1], 27 milliseconds
Find Record 900 [1], 27 milliseconds
Find Record 900 [1], 27 milliseconds
Avg: 26.8 milliseconds

Sort by Value Desc, 688 milliseconds
Sort by Value Desc, 674 milliseconds
Sort by Value Desc, 681 milliseconds
Sort by Value Desc, 760 milliseconds
Sort by Value Desc, 666 milliseconds
Avg: 693.8 milliseconds

 

Internet Explorer 8 (5th Place) 993.8ms

Create and Fill Taffy, 30 milliseconds
Create and Fill Taffy, 30 milliseconds
Create and Fill Taffy, 32 milliseconds
Create and Fill Taffy, 31 milliseconds
Create and Fill Taffy, 31 milliseconds
Avg: 30.8 milliseconds

Do 80% record remove via lookup, 254 milliseconds
Do 80% record remove via lookup, 260 milliseconds
Do 80% record remove via lookup, 257 milliseconds
Do 80% record remove via lookup, 253 milliseconds
Do 80% record remove via lookup, 254 milliseconds
Avg: 255.6 milliseconds

Do a forEach Update, 119 milliseconds
Do a forEach Update, 119 milliseconds
Do a forEach Update, 123 milliseconds
Do a forEach Update, 116 milliseconds
Do a forEach Update, 120 milliseconds
Avg: 119.4 milliseconds

Find Every Record [1000], 287 milliseconds
Find Every Record [1000], 293 milliseconds
Find Every Record [1000], 297 milliseconds
Find Every Record [1000], 284 milliseconds
Find Every Record [1000], 283 milliseconds
Avg: 288.8 milliseconds

Find Record 900 [1], 14 milliseconds
Find Record 900 [1], 14 milliseconds
Find Record 900 [1], 13 milliseconds
Find Record 900 [1], 13 milliseconds
Find Record 900 [1], 13 milliseconds
Avg: 13.4 milliseconds

Sort by Value Desc, 286 milliseconds
Sort by Value Desc, 276 milliseconds
Sort by Value Desc, 294 milliseconds
Sort by Value Desc, 281 milliseconds
Sort by Value Desc, 292 milliseconds
Avg: 285.8 milliseconds

 

FireFox 3 (4th Place) 289.8ms

Create and Fill Taffy, 14 milliseconds
Create and Fill Taffy, 14 milliseconds
Create and Fill Taffy, 14 milliseconds
Create and Fill Taffy, 13 milliseconds
Create and Fill Taffy, 14 milliseconds
Avg: 13.8 milliseconds

Do 80% record remove via lookup, 79 milliseconds
Do 80% record remove via lookup, 81 milliseconds
Do 80% record remove via lookup, 81 milliseconds
Do 80% record remove via lookup, 83 milliseconds
Do 80% record remove via lookup, 79 milliseconds
Avg: 80.6 milliseconds

Do a forEach Update, 52 milliseconds
Do a forEach Update, 53 milliseconds
Do a forEach Update, 53 milliseconds
Do a forEach Update, 56 milliseconds
Do a forEach Update, 52 milliseconds
Avg: 53.2 milliseconds

Find Every Record [1000], 84 milliseconds
Find Every Record [1000], 86 milliseconds
Find Every Record [1000], 83 milliseconds
Find Every Record [1000], 84 milliseconds
Find Every Record [1000], 85 milliseconds
Avg: 84.4 milliseconds

Find Record 900 [1], 5 milliseconds
Find Record 900 [1], 5 milliseconds
Find Record 900 [1], 5 milliseconds
Find Record 900 [1], 4 milliseconds
Find Record 900 [1], 4 milliseconds
Avg: 4.6 milliseconds

Sort by Value Desc, 51 milliseconds
Sort by Value Desc, 50 milliseconds
Sort by Value Desc, 64 milliseconds
Sort by Value Desc, 51 milliseconds
Sort by Value Desc, 50 milliseconds
Avg: 53.2 milliseconds

 

FireFox 3.5 (3rd Place) 127.6ms

Create and Fill Taffy, 12 milliseconds
Create and Fill Taffy, 11 milliseconds
Create and Fill Taffy, 12 milliseconds
Create and Fill Taffy, 12 milliseconds
Create and Fill Taffy, 11 milliseconds
Avg: 11.6 milliseconds

Do 80% record remove via lookup, 18 milliseconds
Do 80% record remove via lookup, 18 milliseconds
Do 80% record remove via lookup, 18 milliseconds
Do 80% record remove via lookup, 19 milliseconds
Do 80% record remove via lookup, 17 milliseconds
Avg: 18 milliseconds

Do a forEach Update, 47 milliseconds
Do a forEach Update, 49 milliseconds
Do a forEach Update, 49 milliseconds
Do a forEach Update, 51 milliseconds
Do a forEach Update, 48 milliseconds
Avg: 48.8 milliseconds

Find Every Record [1000], 15 milliseconds
Find Every Record [1000], 14 milliseconds
Find Every Record [1000], 14 milliseconds
Find Every Record [1000], 14 milliseconds
Find Every Record [1000], 14 milliseconds
Avg: 14.2 milliseconds

Find Record 900 [1], 3 milliseconds
Find Record 900 [1], 3 milliseconds
Find Record 900 [1], 3 milliseconds
Find Record 900 [1], 3 milliseconds
Find Record 900 [1], 3 milliseconds
Avg: 3 milliseconds

Sort by Value Desc, 31 milliseconds
Sort by Value Desc, 32 milliseconds
Sort by Value Desc, 31 milliseconds
Sort by Value Desc, 32 milliseconds
Sort by Value Desc, 34 milliseconds
Avg: 32 milliseconds

 

Chrome (2nd Place) 86.8ms

Create and Fill Taffy, 6 milliseconds
Create and Fill Taffy, 3 milliseconds
Create and Fill Taffy, 4 milliseconds
Create and Fill Taffy, 3 milliseconds
Create and Fill Taffy, 3 milliseconds
Avg: 3.8 milliseconds

Do 80% record remove via lookup, 24 milliseconds
Do 80% record remove via lookup, 25 milliseconds
Do 80% record remove via lookup, 27 milliseconds
Do 80% record remove via lookup, 24 milliseconds
Do 80% record remove via lookup, 24 milliseconds
Avg: 24.8 milliseconds

Do a forEach Update, 27 milliseconds
Do a forEach Update, 28 milliseconds
Do a forEach Update, 27 milliseconds
Do a forEach Update, 29 milliseconds
Do a forEach Update, 29 milliseconds
Avg: 28 milliseconds

Find Every Record [1000], 11 milliseconds
Find Every Record [1000], 11 milliseconds
Find Every Record [1000], 11 milliseconds
Find Every Record [1000], 12 milliseconds
Find Every Record [1000], 11 milliseconds
Avg: 11.2 milliseconds

Find Record 900 [1], 1 milliseconds
Find Record 900 [1], 1 milliseconds
Find Record 900 [1], 1 milliseconds
Find Record 900 [1], 2 milliseconds
Find Record 900 [1], 1 milliseconds
Avg: 1.2 milliseconds

Sort by Value Desc, 17 milliseconds
Sort by Value Desc, 18 milliseconds
Sort by Value Desc, 17 milliseconds
Sort by Value Desc, 18 milliseconds
Sort by Value Desc, 19 milliseconds
Avg: 17.8 milliseconds

 

Safari 4 (1st Place) 75ms

Create and Fill Taffy, 7 milliseconds
Create and Fill Taffy, 5 milliseconds
Create and Fill Taffy, 5 milliseconds
Create and Fill Taffy, 5 milliseconds
Create and Fill Taffy, 4 milliseconds
Avg: 5.2 milliseconds

Do 80% record remove via lookup, 22 milliseconds
Do 80% record remove via lookup, 22 milliseconds
Do 80% record remove via lookup, 21 milliseconds
Do 80% record remove via lookup, 22 milliseconds
Do 80% record remove via lookup, 21 milliseconds
Avg: 21.6 milliseconds

Do a forEach Update, 19 milliseconds
Do a forEach Update, 19 milliseconds
Do a forEach Update, 17 milliseconds
Do a forEach Update, 18 milliseconds
Do a forEach Update, 18 milliseconds
Avg: 18.2 milliseconds

Find Every Record [1000], 9 milliseconds
Find Every Record [1000], 8 milliseconds
Find Every Record [1000], 8 milliseconds
Find Every Record [1000], 9 milliseconds
Find Every Record [1000], 9 milliseconds
Avg: 8.6 milliseconds

Find Record 900 [1], 3 milliseconds
Find Record 900 [1], 2 milliseconds
Find Record 900 [1], 2 milliseconds
Find Record 900 [1], 2 milliseconds
Find Record 900 [1], 1 milliseconds
Avg: 2 milliseconds

Sort by Value Desc, 21 milliseconds
Sort by Value Desc, 18 milliseconds
Sort by Value Desc, 19 milliseconds
Sort by Value Desc, 20 milliseconds
Sort by Value Desc, 19 milliseconds
Avg: 19.4 milliseconds

 

I’m not surprised Chrome was the winner, but I was surprised IE8 did so poorly.

UPDATED: Looks like Safari is a little quicker.

UPDATED: Added Firefox 3.5

UPDATED: Added IE7

Tags:

IT | Development

Web applications going by the wayside

by rsutton 18. March 2009 06:53

So lately have been really been feeling like the whole web application (not website) thing hasn’t been working out so well.  While it is true that JavaScript and it’s accompanying frameworks are getting better, it is still plagued with slowness and browser issues.  For me the experience of a desktop app is still a thousand times better and I doubt that will ever go away no matter how good browsers get (sorry Google).  In my opinion browsers are not application platforms.  The two examples that have lead me to this conclusion are one the iPhone.  When it was originally introduced there was no notion of third-party applications.  I watched the keynote and it seemed that the buzz they wanted to created was around being able to have a decent web browsing experience on a phone.  While they did accomplish this in my opinion, far better than anyone else I must say, what people really wanted to do was harness the iPhone platform, ie install applications.  Now looking at where most people spend their time today, you will see them using the apps not the browser.  I feel this is the same with Twitter.  Sure you can use the browser to make posts and follow people, but who wants to do that when you can have an app that gives you a much better experience.

Tags:

IT | Development

It's time to party like it's 1234567890 – 'cause it is!

by rsutton 14. February 2009 04:14

You gotta love this.

http://www.1234567890day.com/

Tags:

IT | Development

Script to grant all permissions for a user to a SQL 2005 database

by rsutton 11. February 2009 00:57

GRANT ALTER TO theuser
GRANT ALTER ANY APPLICATION ROLE TO theuser
GRANT ALTER ANY ASSEMBLY TO theuser
GRANT ALTER ANY ASYMMETRIC KEY TO theuser
GRANT ALTER ANY CERTIFICATE TO theuser
GRANT ALTER ANY CONTRACT TO theuser
GRANT ALTER ANY DATABASE DDL TRIGGER TO theuser
GRANT ALTER ANY DATABASE EVENT NOTIFICATION TO theuser
GRANT ALTER ANY DATASPACE TO theuser
GRANT ALTER ANY FULLTEXT CATALOG TO theuser
GRANT ALTER ANY MESSAGE TYPE TO theuser
GRANT ALTER ANY REMOTE SERVICE BINDING TO theuser
GRANT ALTER ANY ROLE TO theuser
GRANT ALTER ANY ROUTE TO theuser
GRANT ALTER ANY SCHEMA TO theuser
GRANT ALTER ANY SERVICE TO theuser
GRANT ALTER ANY SYMMETRIC KEY TO theuser
GRANT ALTER ANY USER TO theuser
GRANT AUTHENTICATE TO theuser
GRANT BACKUP DATABASE TO theuser
GRANT BACKUP LOG TO theuser
GRANT CHECKPOINT TO theuser
GRANT CONNECT TO theuser
GRANT CONNECT REPLICATION TO theuser
GRANT CONTROL TO theuser
GRANT CREATE AGGREGATE TO theuser
GRANT CREATE ASSEMBLY TO theuser
GRANT CREATE ASYMMETRIC KEY TO theuser
GRANT CREATE CERTIFICATE TO theuser
GRANT CREATE CONTRACT TO theuser
GRANT CREATE DATABASE DDL EVENT NOTIFICATION TO theuser
GRANT CREATE DEFAULT TO theuser
GRANT CREATE FULLTEXT CATALOG TO theuser
GRANT CREATE FUNCTION TO theuser
GRANT CREATE MESSAGE TYPE TO theuser
GRANT CREATE PROCEDURE TO theuser
GRANT CREATE QUEUE TO theuser
GRANT CREATE REMOTE SERVICE BINDING TO theuser
GRANT CREATE ROLE TO theuser
GRANT CREATE ROUTE TO theuser
GRANT CREATE RULE TO theuser
GRANT CREATE SCHEMA TO theuser
GRANT CREATE SERVICE TO theuser
GRANT CREATE SYMMETRIC KEY TO theuser
GRANT CREATE SYNONYM TO theuser
GRANT CREATE TABLE TO theuser
GRANT CREATE TYPE TO theuser
GRANT CREATE VIEW TO theuser
GRANT CREATE XML SCHEMA COLLECTION TO theuser
GRANT DELETE TO theuser
GRANT EXECUTE TO theuser
GRANT INSERT TO theuser
GRANT REFERENCES TO theuser
GRANT SELECT TO theuser
GRANT SHOWPLAN TO theuser
GRANT SUBSCRIBE QUERY NOTIFICATIONS TO theuser
GRANT TAKE OWNERSHIP TO theuser
GRANT UPDATE TO theuser
GRANT VIEW DATABASE STATE TO theuser
GRANT VIEW DEFINITION TO theuser

Tags:

Development | IT

Pasting into IRB from the command prompt

by rsutton 27. January 2009 06:28

I regularly use irb for debugging my Watir scripts, and have always disliked the fact that I can't paste anything into it.  Well that is no more because I today I figured out if I turn on quick edit mode in my command prompt I can paste right into irb.  Wahoo!

quickedit 

NOTE: You might actually have to set this setting while you are in the irb.

pasted

Tags:

Development | IT

Huge Tempororary ASP.NET Files and WinDirStat

by rsutton 20. January 2009 00:42

This morning I found out about WinDirStat a nifty little utility that allows you to easily see how all your hard drive space is utilized.  After doing some cleanup I noticed that the Mircorosft.NET directory in my Windows directory was huge!  After drilling down I came across the culprit. The directory inside the "Tempororay ASP.NET Files" directory for the project I work on all day during the week had grown to over 24 gig.

TempFiles

These directories are safe to delete, so with I quick (sorta) delete I recovered 24 gig of space.

Tags:

Development | IT

Imaging a partition with dd over the network

by rsutton 9. January 2009 02:48

Here are some commands that will allow you to do the imaging discussed in my previous post over a network using port 1234. If you are using Slax you will need to download the netcat module because it isn't included.

NOTE: Make sure you start the target machine first!

Source machine:

dd if=/dev/sda1 bs=16065b | netcat 192.168.0.1 1234

Target machine:

netcat -l -p 1234 | dd of=/data/w2008_20080109.img bs=16065b

NOTE: You can check the status using the "kill -USR1 PID" like before but only on the source machine and make sure you use the PID of the dd command.

Using a direct server to server cable over gigabit ethernet I'm getting ~46MB/s which is really good in my opinion. I haven't figured out how to gracefully close the netstat process after the transfer is complete so that is something you'll have to figure out on your own.

Tags:

IT

Powered by BlogEngine.NET 1.4.5.0
Theme by Extensive SEO

Profile

Member of the Church of Jesus Christ of Latter-Day Saints, Developer and IT Professional