MIS 431 – ADO.NET

April 24th, 2012 No comments

A couple bits of ADO.NET

IsuStore04242012_2

Categories: Misc Tags:

MIS 431 – ASP.NET Tags

April 19th, 2012 No comments

I was about to start compiling a list of ASP.NET tags for reference, but the work has already been done!
http://naspinski.net/post/inline-aspnet-tags-sorting-them-all-out-(3c25242c-3c253d2c-3c252c-3c252c-etc).aspx

Thanks, naspinski!


I’ve copied the examples here for my own reference. See the above link for more detailed information.

Categories: ASP.NET Tags:

MIS 431 – ASP.NET (VB) shopping cart. Auth/ACL and custom SiteMapProvider

April 19th, 2012 No comments

IsuStore04192012

This project includes all the features I demoed in class along with a custom SiteMapProvider and Server component tag (<isu:IsuRepeater …)

It also uses the “ADO.NET Entity Data Model” for managing persistence. Please see: http://msdn.microsoft.com/en-us/library/e80y5yhx.aspx

I’ll discuss ADO.NET for managing the data tier next Tuesday in class if time allows.

Categories: ASP.NET, VB.NET Tags:

MIS 431 – ASP.NET simple layout

April 17th, 2012 No comments
Categories: ASP.NET, VB.NET Tags:

Simple string permutations in PHP

April 11th, 2012 No comments

I wrote this as part of a small project and quickly realized it had other entertaining uses.

Categories: Algorithms, PHP Tags:

How to count weekend days between two dates

February 6th, 2012 No comments

This VB.NET method returns the total number of weekend days between two dates.

It works by multiplying the number of full weeks by 2, then it takes the leftover days and calculates how many of those days overlap the weekend.

For example:
Sunday = 0, Monday = 1, Tuesday = 2 …(and so on)

Let’s say FromDate is Wednesday, and the total number of days to ToDate is 18:

FromDate = Wednesday = 3
TotalDays = 18

TotalWeeks = Math.Floor(18 / 7) = 2
LeftoverDays = (TotalDays Mod 7) = (TodalDays – (TotalWeeks * 7)) = 4
DaysUntilSaturday = (Saturday – CheckInDate) = (6 – 3) = 3
DaysThatOverlapSaturday = (LeftoverDays – DaysUntilSaturday) = (4 – 3) = 1

Saturday is overlapped by 1 day, so we add 1 to the total number of weekend days.

WeekendDays = ((TotalWeeks * 2) + DaysThatOverlapSaturday) = (4 + 1) = 5

Of course if DaysThatOverlapSaturday < 1, don’t add anything.

If TotalDays = 19, then there would be 2 days that overlap Saturday. Since we know Sunday is the next day, we add both days.
If TotalDays = 20, then there would be 3 days that overlap Saturday, but that third day is Monday, so we only add 2.
If TotalDays = 21, then that’s 3 full weeks, and we know that 3 full weeks will always contain 6 weekend nights, so there’s nothing more to do.

The only other case is if the total number of days aren’t divisible by 7 and the Check-In date is Sunday. Since we know the remaining number of days are less then 7, we only have to add 1 for that Sunday.

Categories: VB.NET Tags:

Go board with canvas tag

July 7th, 2011 4 comments

Here’s my first attempt at a Go board with javascript and the canvas tag.

Categories: Javascript, 囲碁 Go Tags:

Resetting a Mac’s hardware

March 4th, 2009 No comments

There are a lot of little hidden support features built in to a Mac that you’ll only ever find out if you dig deep or call Apple tech support directly. One quite useful procedure I recently learned of is how to reset all hardware in your mac. This may be useful if you are experiencing odd behavior that doesn’t seem software related.

Step 1: Shut down the Mac normally.
Step 2: Remove all power and peripherals. (Pull every last cord out of the back)
Step 3: Hold the power button in for 10 seconds. (I believe this is to ensure that all power is thoroughly drained from the system as there are certain electronic components that can hold on to a charge for quite some time.)
Step 4: Plug everything back in.
Step 5: Turn on the power and hold command+alt+p+r
Keep these keys held until you hear the boot up chime ring twice. There may be a slight pause between chimes.

Once this is complete, resume using the Mac normally and see if your problems have been solved. (If not, don’t despair. This is after all only one of a number of possible troubleshooting steps)

Categories: Misc Tags: ,

Fantastic Frameworks

February 16th, 2009 No comments

Perhaps I’ll write more about this later, but for now I’ll just say that I’ve been using a lot of the Zend Framework and Ext Javascript library. I enjoy writing code with these fantastic tools.
Zend Framework
Ext Javascript Library

Categories: Javascript, PHP Tags: ,

Useful Javascript – Countdown timer

January 22nd, 2008 No comments

Javascript isn’t always the easiest stuff to write. Browser issues, debugging (at least before the days of firebug), etc. Anybody who’s tried anything more than a simple alert() knows this. So I’m always happy when I come across a free pre-written library for accomplishing tasks that would have otherwise taken me more than a few minutes to do myself. Here’s one that just happened to gracefully meet my every need for a countdown timer:

Countdown Pro

Categories: Javascript Tags: