How to find a car pool buddy

by rsutton 26. February 2009 06:51

If you are like me and would prefer to do something other than drive during your commute give this site a shot http://mycarpoolrocks.com/.  This site matches you up with and helps you find other potential car poolers. It is run by my buddy Tim.  Just think you never have to drive to work again…well…unless it is your turn to drive :)

Tags:

Misc

OnMouseOver and OnMouseOut without an extra JavaScript function

by rsutton 26. February 2009 06:15

I was just browsing for a quick and easy way to do an image rollover (I haven’t done it for a looooong time ;), and all I found were examples that included creating a function somewhere that figures out what to do, etc.  All I wanted to do was change the images when the onmouseover and onmouseout events occur.  So I came up with this.

 

 

<img src="images/MouseOut.png" onmouseover="javascript:this.src='images/MouseOver.png'" onmouseout="javascript:this.src='images/MouseOut.png'">

 

I’m not sure how fancy this is, but I thought it was odd that I didn’t find an example like this right away.  Perhaps I am missing something…

Tags:

Development

Cordless screwdriver that charges in 90 seconds

by rsutton 26. February 2009 04:58

There are some exciting new developments in the ultra capacitor world.  They have been working on these for some time and only now are we starting to see some real products.  Check this one out.

http://www.colemanflashcellscrewdriver.com/

coleman-flashcell-screwdriver3

So long batteries :)

Tags:

Misc

Action delegate with a method that contains no arguments

by rsutton 25. February 2009 01:55

I think I remember reading some time ago that somebody said that you couldn’t use an Action delegate with a method that contains no arguments.  Well if my memory serves me correctly that person was incorrect.

Normal usage.

 

void HelloWithArgs(bool isTrue)

{

    // Do something.

}

 

void NormalUsage(Action<bool> hello)

{

    hello(true);

}

 

void doit()

{

    NormalUsage(HelloWithArgs);

}

 

No Args.

 

void HelloNoArgs()

{

    // Do something.

}

 

void NoArgsUsage(Action hello)

{

    hello();

}

 

void doit()

{

    NoArgsUsage(HelloNoArgs);

}

Tags:

Development

Use string.concat() to inject code

by rsutton 18. February 2009 01:34

One thing I have been doing lately is injecting custom crafted html and javascript into pages.  I have found that a great way to do this is to use string.concat() because not only can you indent lines easily to get good code formatting, but you can also easily comment out lines.  I wish there was a better way, but so far this is the best I’ve found.  If anyone knows of a better way please let me know.

private string GetWidgetScript()

{

    return string.Concat(

        "<script type=\"text/javascript\">",

            "$(document).ready(function() {",

                    "$('#",ClientID,"_WidgetHeader').click(function () {",

                    "$('#",ClientID,"_Widget').slideToggle('normal');",

                "});",

            "});",

        "</script>"

        );

}

 

private void BeforeInitControls()

{

    Controls.Add(new LiteralControl(

                     string.Concat(

                         //GetWidgetScript(),

                         "<div id=\"",ClientID,"_WidgetHeader\" class=\"widgetHeader\">",Header,"</div>",

                         "<div id=\"",ClientID,"_Widget\" class=\"widget\">"

                         )));

}

 

Tags:

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

Auto format your code in Visual Studio

by rsutton 13. February 2009 06:22

Just press Ctrl+K,D

Tags:

Development

Add HTTP Modules defined in App_Code to the web.config

by rsutton 12. February 2009 00:27

Thanks to Resharper I just learned how to properly reference HttpModules that are defined in the App_Code directory.  This can be useful if you have a module that doesn’t warrant an entire assembly.  I assume this will also work for HttpHandlers, but I haven’t tried it.

<add type="MyWebsite.MyModule, App_Code, Culture=neutral" name="MyModule" />

Tags:

Development

Set security on specific ASP.NET pages and directories

by rsutton 12. February 2009 00:00

    1 <location path="RecoverPassword.aspx">

    2   <system.web>

    3     <authorization>

    4       <allow users="?"/>

    5     </authorization>

    6   </system.web>

    7 </location>

    8 <location path="Register.aspx">

    9   <system.web>

   10     <authorization>

   11       <allow users="?"/>

   12     </authorization>

   13   </system.web>

   14 </location>

   15 <location path="App_Themes">

   16   <system.web>

   17     <authorization>

   18       <allow users="?"/>

   19     </authorization>

   20   </system.web>

   21 </location>

location Element (ASP.NET Settings Schema)

Tags:

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

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