Free Utilities#

Here is another list of some great freeware products, free browsers, anti-virus, anti-spyware etc.

http://www.techsupportalert.com/best_46_free_utilities.htm#9

Categories: Software | Utilities
Monday, September 18, 2006 2:51:20 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Extending the Atlast AutoComplete Extender#

I have been looking at the new "Atlas" controls, which MS has brilliantly (sarcasm) decided to rename "ASP.NET AJAX".

The one control I have been most interested in is the autocomplete extender.

I want to use something like this, not to help populate a textox, but instead to allow the user to type a few characters in to narrow down the list of options, rather than showing them a dropdown of 10,000 items.

In otherwords, when they are done with the control, I don't want the text in the textbox, I want the database ID value behind it, and i also don't want to let them type in just anything they want, but rather limit their options to what is in the autocomplete options.

I found another blog post where someone is extending the autocomplete behavior:

http://aspadvice.com/blogs/garbin/archive/2006/01/02/14518.aspx

 

Categories: Programming | .Net | ASP.Net
Monday, September 18, 2006 1:39:31 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Debug = true in web.config files#
Categories: Programming | .Net | ASP.Net
Thursday, September 14, 2006 2:22:27 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Performance of Web Services / Remoting / Enterprise Services#

I had previously read and heard in presentations by Rocky Lhotka that performance comparisons between Web Services and Remoting showed that they were basically the same, and that when talking about RPC protocols ES killed them both so badly (order of magnitude) that it wasn't worth fretting over the small diff between WS and remoting.

Rocky kinda explains this position in this post:
http://www.lhotka.net/weblog/RemotingVsWebServicesVsESCOMDCOM.aspx

However, I actually tracked down the white paper on Microsofts website:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebsrv/html/asmxremotesperf.asp

Much to my suprise the giant performance improvement when using ES was only seen when calling empty functions.  In otherwords, it was basically a test of the transport.  Some "real world" tests showed ES performing faster than most other methods, but sometimes something like Remoting TCP Binary would outperform it as well.

In the tests that actually did something, the performance across the board was usually fairly comperable.  I guess this makes sense.  If you liken the round trip of an RPC call to a person going on a business trip, the speed of the airplane is less important that the time it takes the person to do the job at the end of the trip.  So even if your plane takes 3 hours instead of 2 hours, if your going to be staying for a week then that 1 hour isn't a big deal.

The major conclusion is to not pass datasets.  Datasets are serialized as XML even if you are using the binary serializer.  I have posted some stuff on this topic as well on my blog so you can search for it if you want. 

Categories: Programming | .Net | .Net Framework | Architecture | WebServices
Thursday, September 14, 2006 9:12:30 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

"Updating" a SQL Inner Join Query#

I frequently get asked how you can update a join statement in SQL.  Of course, the UPDATE syntax doesn't allow for you do actually perform an update directly against a JOIN statement, but there are some things you can do to work around this problem.

Probably the best way is to do the update like the example below:

UPDATE Job_Opportunities
SET AwardedId = 1
WHERE JobOpportunityId = (
    SELECT JO.JobOpportunityId
    FROM Job_Opportunities JO
    INNER JOIN
    Job_results JobResults
    ON BO.JobOpportunityID = BR.Job_id
    AND JR.is_us = 1
    AND JR.rank = 1
    AND JO.JobOpportunityId = Job_Opportunities.JobOpportunityId
)

This example is updating the Job_Opportunities table, but in the WHERE clause we can use a join to make sure that the only rows that are updated are those that meet the criteria of the join.
Categories: Programming | Database
Wednesday, September 13, 2006 2:09:02 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Data Driven Checkbox (Horizontal) Lists#

This control is pretty cool.  It makes it pretty easy to databind data into a list of checkboxes.

http://developer.coreweb.com/articles/Default6.aspx

Categories: Programming | .Net | ASP.Net | DataBinding
Wednesday, September 06, 2006 5:54:56 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Rocky Lhotka and Csla.Net/Asp.Net on DnrTV#

Rochy Lhotka appeared again on DNR-TV for 2 more segments focusing on CSLA in ASP.Net and WebServices:

http://www.dnrtv.com/default.aspx?showID=32

http://www.dnrtv.com/default.aspx?showID=33

Having successfully completed a CSLA.Net project for Wilson Sporting Goods I am interested to see what is different in the web side vs the winform side.

Categories: Programming | .Net | ASP.Net | DataBinding
Wednesday, September 06, 2006 4:39:48 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Checking an objects type or implemented interfaces#

A common thing people might want to do is check if a object is a certain type, or inherits a type, or implements a type.

This can be done in VB.Net with the following code:

TypeOf someObject Is ClassName

This works for inheritance heirarchy as well as checking for interface implementation.

Here is a sample app showing it in practice.

imports Microsoft.VisualBasic
imports System
Imports System.Collections.Generic

public module MyModule
    sub Main
dim o as new subclass
        WL(typeof o is subclass)
        WL(typeof o is baseclass)
        WL(typeof o is IWhatever)
        RL()
    end sub

    #region "Helper methods"

    sub WL(text as object)
        Console.WriteLine(text)
    end sub

    sub WL(text as object, paramarray args as object())
        Console.WriteLine(text.ToString(), args)
    end sub
        
    sub RL()
        Console.ReadLine()
    end sub
    
    sub Break()
        System.Diagnostics.Debugger.Break()
    end sub

#end region

end module


public interface IWhatever
end interface
public class BaseClass

end class

public class SubClass
inherits BaseClass
implements IWhatever

end class
Categories: Programming | .Net | VB.Net
Wednesday, September 06, 2006 4:35:02 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

SQL Server Decimal/Money/Float datatypes#

When dealing with money, or numbers, sql server provides a few different datatypes: Decimal, Money, Float among others.

The main difference is that Decimal and Money datatypes are "exact", as opposed to Float which is a "Floating Point Representation".

When dealing with Floats, you can get some odd mathematical results:
http://www.chrismay.org/2005/09/29/BinaryRepresentationOfDecimalValues.aspx

e.g.
0.4 - 0.1 = 0.30000000000000000000004
1.4-1.1 = 0.29999999999999999999998

So when a number is going to represent money, you should use the Decimal or Money datatypes.  Money is (19,4) which means 19 total digits, 4 of which are right of the decimal point.  Decimal can be setup however you want, like Decimal(10,2).

SmallMoney can also be used, which can represent money values under 1,000,000 w/ 4 decimal places.

 

Categories: Programming | Database | SQL Server
Wednesday, September 06, 2006 9:40:48 AM (Central Daylight Time, UTC-05:00) #    Comments [1]  | 

 

PostBackUrl And SmartNavigation Bug?#
I have a page with SmartNav, that contains a linkbutton with a
PostBackUrl.

I have found that the page that is the target of the PostBackUrl will
have it's postback property fired 2 times, and unfortunately, the 2nd
time it is fired the "PreviousPage" is set to Nothing.

I have posted a few places to see if someone from MS can confirm this is a bug, but  I am betting they are going to tell me to not use smartnav.

Categories: Programming | .Net | ASP.Net
Thursday, August 31, 2006 10:30:38 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Rutgers Tennis#

A good friend of mine and a guy I hit with all the time played at Rutgers.  Now it looks like they are going to cancel the program.

A website has been created to raise some money to help their program.

http://saverutgerstennis.org/

Categories: Thoughts
Wednesday, August 30, 2006 8:28:00 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

SQL Server Merge Replication#

One of the challenges in doing merge replication in SQL Server is dealing with IDENTITY columns.

One of the tricks you can use is "automatic identity range management". 

Basically you tell DB 1 to start at seed 1 and DB 2 to seed at 20,000, and when DB 1 reaches 16,000 or DB 2 reaches 36,000 it will reset those seeds to 40,000 and 60,000.

http://msdn2.microsoft.com/en-us/library/ms152543.aspx

http://msdn2.microsoft.com/en-us/library/ms146907.aspx

It appears to work well.

Categories: Programming | Database | SQL Server
Tuesday, August 29, 2006 2:55:35 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Getting IE To Print Backgrounds And Cell Colors#

I was having a small problem getting some reports to print the way I wanted.

I turns out that to get the table cells colored backgrounds to print, click on the browser’s Tools menu. Select Internet Options, then click on the Advanced tab. Scroll down to find the Printing heading and check the box called Print Background Colors and Images. This setting affects both page backgrounds and table cell backgrounds.

Categories: Programming | HTML
Saturday, August 26, 2006 6:57:53 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Using XSD.exe#

.Net has a tool called the XML Schema Definition Tool (XSD.EXE) which can turn XSD schemas into classes.  Also, it will try to make it so those classes will conform to the schema when serialized as XML.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpconxmlschemadefinitiontoolxsdexe.asp

xsd.exe pathToXSD.xsd /classes /language:VB /outputdir:C:\output

You can then serialize and deserialize the object into/from XML.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlSerializationXmlSerializerClassTopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlSerializationXmlSerializerClassDeserializeTopic.asp

 

 

Categories: Programming | .Net | XML
Friday, August 25, 2006 3:10:35 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Is The Date On The Weekend#

This function will figure out if the given date lands on a weekend.

    Public Shared Function IsWeekend(ByVal dateOfInterest As DateTime) As Boolean
Dim d, m, y, w As Integer
d = dateOfInterest.Day
m = dateOfInterest.Month
y = dateOfInterest.Year


If m = 1 Or m = 2 Then
m += 12
y -= 1
End If


w = CInt((d + 2 * m + 3 * (m + 1) / 5 + y + y / 4 - y / 100 + y / 400) Mod 7)
If w <> 6 And w <> 7 Then
Return False
Else
Return True
End If
End Function

Another function to do the weekend check could be this:

    Private Const ERR_INVALID_DATE = 20000
Private Const ERR_INVALID_DATE_MSG = "Date Required"

Public Function IsWeekend(ByVal DateValue As Object) As Boolean

Dim dDateValue As Date

If Not IsDate(DateValue) Then
Err.Raise(ERR_INVALID_DATE, ERR_INVALID_DATE_MSG)
Exit Function
End If

dDateValue = CDate(DateValue)
IsWeekend = (Weekday(dDateValue) Mod 6 = 1)

End Function
Categories: Programming | .Net
Friday, August 25, 2006 12:33:23 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Using Postbacks in ASP.NET From showModalDialog pages.#

If you have an ASP.NET page (.aspx) opened with the JavaScript showModalDialog() function and inside that page there is a form doing PostBack, when the PostBack is being done the page loads in another (popup) window. The easiest way to prevent this is to add the following tag inside the <HEAD></HEAD> tags of the ASP.NET page:

<base target="_self">

From: http://www.geekpedia.com/Question23_Using-showModalDialog()-with-an-ASP.NET-page-that-does-PostBack-opens-another-window.html

Categories: Programming | .Net | ASP.Net
Thursday, August 24, 2006 2:52:59 PM (Central Daylight Time, UTC-05:00) #    Comments [1]  | 

 

Databinding "Bind()" in ASP.NET#

If you used the developemt tools to create a datagrid in ASP.NET 2.0, it will show something like:

NavigateUrl='<%# Bind("EmployeeId") %>'

But what if you wanted to do something more complicated that just ge the EmployeeId into the field, like for example if you wanted to run a JS function.  Then you have to do away with Bind and use the more verbose DataBinder method like this: 

NavigateUrl='<%# "javascript:UseThisJobIndex(" & DataBinder.Eval(Container.DataItem,"JobIndex") & ")" %>'

That's all there is to it.

 

Categories: Programming | .Net | ASP.Net | DataBinding
Thursday, August 24, 2006 1:16:56 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

My Very Educated Mother Just Said Uh-oh No Pluto!!#
http://msnbc.msn.com/id/14489259/

I wish I coudl take credit for that line, but it was from Colbert.

So now Pluto is going to be a Drawf Planet, along with UB313 (Xena) and Ceres.


To see the full image you might need to expand your window or use the scrollbar at the bottom of this article.

UB313 is larger than Pluto, and farther out in orbit.

I kinda liked the idea of calling Pluto and Charon a "dual planet," as Charon is so large that it was somewhat unfair to say that it orbits Pluto, but they aren't going to do that.

Ceres is the largest asteroid in the Asteroid Belt but because it hasn't swept the area clear of other asteroids (and I guess it never will b/c of its close proximity to Jupiter) it will never meet the new definition of a planet:

“a celestial body that is in orbit around the sun, has sufficient mass for its self-gravity to overcome rigid body forces so that it assumes a nearly round shape, and has cleared the neighborhood around its orbit.”

Categories: Cool | Science
Thursday, August 24, 2006 11:20:08 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Backup/Restore Cisco Pix Configuration#

To do this you

  1. Need a TFTP server running (solarwinds)
  2. Need to telnet into the device
  3. Need to be in enable mode

First to make the backup:

write net 192.168.1.2:MyBackup.pixconfig

where the IP is the IP of your TFTPserver

Then to restore it later, you need to enter config terminal mode first and then restore the file:

config term
configure net 192.168.1.2:MyBackup.pixconfig

and there you have it...

The changes will take immediate effect, but you will still need to write them into the non volatile memory, or the changes will be lost when you reboot the device.

 

Categories: Networking | Firewall | Security
Friday, August 11, 2006 4:55:29 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Fountain of Time#
Categories: Cool
Friday, August 11, 2006 10:55:47 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

All content © 2010, Christopher May, Inc
Open Job Positions
On this page
Google Ads
This site
Calendar
<September 2006>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567
Archives
Sitemap
Blogroll OPML
Disclaimer

Powered by: newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts


Pick a theme: