September  1, 2004 12:36 PM
WAP Support

I added WAP support to AnalogousMember today. I followed a tutorial at Building a Better Wap Diary with the following exceptions:

  • I edited the link in the index template to the archive files to point to archives/wap/ folder. The link is now:

    <a href="<$MTBlogArchiveURL$>wap/<$MTEntryID pad="1"$>.wml">Read This Entry...</a>

  • The individual archive files are being saved to a wap/ folder which requires you to enter

    "wap/<$MTEntryID pad="1"$>.wml"

    for the archive filename

  • I added the following to my .htaccess file so WAP browsers will automatically be served the proper content:

    RewriteCond %{HTTP_ACCEPT} text/vnd.wap.wml
    RewriteRule ^$ /index.wml

  • Removed the hardcoded link to symbiandiares.com from the archive template and replaced it with <$MTBlogURL$>.

If you want to see this in action without using your phone, goto WapTiger WAP Emulator for a conventional browser based WAP emulator. Just enter http://www.analogousmember.com/ for the URL.

Posted by DrFooMod2 at 12:36 PM | Comments (0) | TrackBack (0)
August 27, 2004 10:56 AM
Overheard At the Water Cooler

• . ´¯` . • Brany • . ´¯` . • says:

okay. what's ^ in new york?

• . ´¯` . • Brany • . ´¯` . • says:

er, i think that's where you're from...

Dave Bitton (Gold Medal Coder) says:

ever listen to Black Eyed Peas?

Dave Bitton (Gold Medal Coder) says:

actually Jersey

Dave Bitton (Gold Medal Coder) says:

the biggest is the republican convention nxt wk

• . ´¯` . • Brany • . ´¯` . • says:

ah

• . ´¯` . • Brany • . ´¯` . • says:

bloggers are buzzing about the RNC

Dave Bitton (Gold Medal Coder) says:

NS

• . ´¯` . • Brany • . ´¯` . • says:

i saw pics of naked protestors

• . ´¯` . • Brany • . ´¯` . • says:

heh

Dave Bitton (Gold Medal Coder) says:

gotta love naked protest

• . ´¯` . • Brany • . ´¯` . • says:

lol

• . ´¯` . • Brany • . ´¯` . • says:

do you read gothamist?

Dave Bitton (Gold Medal Coder) says:

so long as they're not fugly

• . ´¯` . • Brany • . ´¯` . • says:

best.blog.ever.

• . ´¯` . • Brany • . ´¯` . • says:

lol, true..

Dave Bitton (Gold Medal Coder) says:

that;s quite a stmt

Dave Bitton (Gold Medal Coder) says:

link?

• . ´¯` . • Brany • . ´¯` . • says:

www.gothamist.com

• . ´¯` . • Brany • . ´¯` . • says:

it's all about new york

• . ´¯` . • Brany • . ´¯` . • says:

but so well written

Dave Bitton (Gold Medal Coder) says:

you do know i used to work a 1/2 block from the garden

Dave Bitton (Gold Medal Coder) says:

i would have taken nxt wk off

Dave Bitton (Gold Medal Coder) says:

i wouldn't be suprised if the oiffice is closed

• . ´¯` . • Brany • . ´¯` . • says:

oh, omg i lived 2 blocks from the garden!!

• . ´¯` . • Brany • . ´¯` . • says:

wierd

Dave Bitton (Gold Medal Coder) says:

i worked on 32 btw 6 and 7

• . ´¯` . • Brany • . ´¯` . • says:

ah

Dave Bitton (Gold Medal Coder) says:

"This is New York. Of course, we had seven naked people on Eighth Ave. What's the question?"

• . ´¯` . • Brany • . ´¯` . • says:

well it's more than 2 blocks... 33rd and ave of americas

• . ´¯` . • Brany • . ´¯` . • says:

hehehehe

• . ´¯` . • Brany • . ´¯` . • says:

did you see the fugly pedrestrian bridge they built for the rnc

Dave Bitton (Gold Medal Coder) says:

there's residential adjacent to herald sqr?

• . ´¯` . • Brany • . ´¯` . • says:

it's an eyesore

Dave Bitton (Gold Medal Coder) says:

i see

• . ´¯` . • Brany • . ´¯` . • says:

yep

Dave Bitton (Gold Medal Coder) says:

what st is that?

• . ´¯` . • Brany • . ´¯` . • says:

above stores...

• . ´¯` . • Brany • . ´¯` . • says:

know what I mean?

Dave Bitton (Gold Medal Coder) says:

yes

• . ´¯` . • Brany • . ´¯` . • says:

yeah.

• . ´¯` . • Brany • . ´¯` . • says:

it was a crappy place actually

Dave Bitton (Gold Medal Coder) says:

http://www.nytimes.com/2004/08/27/politics/campaign/27protest.html?ex=1251345600&en;=43f41670382a6a35&ei;=5090&partner;=rssuserland

Dave Bitton (Gold Medal Coder) says:

even w./ that pic i still can;t firgure the st

Dave Bitton (Gold Medal Coder) says:

duh

Dave Bitton (Gold Medal Coder) says:

says 8th

Dave Bitton (Gold Medal Coder) says:

oh, and btw

Dave Bitton (Gold Medal Coder) says:

bush can't stop aids

Dave Bitton (Gold Medal Coder) says:

3rd world developing nations with more than 50% of their population infected need to stop aids

• . ´¯` . • Brany • . ´¯` . • says:

yes!

• . ´¯` . • Brany • . ´¯` . • says:

i agree

• . ´¯` . • Brany • . ´¯` . • says:

and aids infected ppl need to stop f*cking

• . ´¯` . • Brany • . ´¯` . • says:

(excuse the blunt language)

Dave Bitton (Gold Medal Coder) says:

and ya know what? i don;t the usa should do a damn thing about problems in any other nation besides our own

• . ´¯` . • Brany • . ´¯` . • says:

that's so true

• . ´¯` . • Brany • . ´¯` . • says:

we have poor ppl here...

• . ´¯` . • Brany • . ´¯` . • says:

sick ppl

• . ´¯` . • Brany • . ´¯` . • says:

mental ppl

• . ´¯` . • Brany • . ´¯` . • says:

everything everyone else has

Dave Bitton (Gold Medal Coder) says:

i'm sorry, but it;s USA 1st, the world 2nd

• . ´¯` . • Brany • . ´¯` . • says:

yeah

• . ´¯` . • Brany • . ´¯` . • says:

are you a dem or rep?

Dave Bitton (Gold Medal Coder) says:

here;s something that needs to happen _before_ any group gets help, their needs to be an economic insentive to helping them

• . ´¯` . • Brany • . ´¯` . • says:

true...

Dave Bitton (Gold Medal Coder) says:

what economix incentive does a corporation have to help tjhe poor? none.

• . ´¯` . • Brany • . ´¯` . • says:

then again,. some countries have nothign to give

Dave Bitton (Gold Medal Coder) says:

and in case you haven't taken a business class, but the number 1 objective of any employee is to increase shareholder equity

Dave Bitton (Gold Medal Coder) says:

and you don;t increase share holder equity by giving shit away for free

• . ´¯` . • Brany • . ´¯` . • says:

true.

Dave Bitton (Gold Medal Coder) says:

and until such time as there is a return on investment for helping the disadvantaged, it'll have to accomplished by the fed, and that is as good as nill.

Dave Bitton (Gold Medal Coder) says:

i'll give you a great exampole

• . ´¯` . • Brany • . ´¯` . • says:

are you a big economics guy?

Dave Bitton (Gold Medal Coder) says:

ever look at your phone bill?

• . ´¯` . • Brany • . ´¯` . • says:

you really seem to know your stuff.

• . ´¯` . • Brany • . ´¯` . • says:

umm... kinda. i don't pay for it so...

Dave Bitton (Gold Medal Coder) says:

there's something called a Universal Service Fee

• . ´¯` . • Brany • . ´¯` . • says:

okay, i've seen it

Dave Bitton (Gold Medal Coder) says:

that;s was a tax imposed by the fed to help pay for telecommunications for poor and remote regions of the country

• . ´¯` . • Brany • . ´¯` . • says:

oohh....

• . ´¯` . • Brany • . ´¯` . • says:

so some poor ppl don't pay to have a phone?

Dave Bitton (Gold Medal Coder) says:

why you ask? because there is no economic incentive for telecom providers to do it themselves, and therefore the fed had to step in

Dave Bitton (Gold Medal Coder) says:

it's more has to do w/ infrastructure

• . ´¯` . • Brany • . ´¯` . • says:

oh i see

Dave Bitton (Gold Medal Coder) says:

the fed gives that money back to the telecoms to aid in the build-out of infrastructure that they otherwise would not have implemented because it doesn;t make economic sense. the ROI would be negative, and that is a no-no

• . ´¯` . • Brany • . ´¯` . • says:

right

• . ´¯` . • Brany • . ´¯` . • says:

they won't sacrifice anything

Dave Bitton (Gold Medal Coder) says:

yeah, sure, there's _some_ economic incentive to finding an HIV vacine, someone gets to sell it

Dave Bitton (Gold Medal Coder) says:

why would/should they?

• . ´¯` . • Brany • . ´¯` . • says:

but the research, i think would cost oodles more than the money they'll make of the meds

Dave Bitton (Gold Medal Coder) says:

your absolutely right, and that is why it's taking the time that it is

Dave Bitton (Gold Medal Coder) says:

the fed doesn;t have the $, and therefore hiv research is beholdent upon private donations and some pharama $

Dave Bitton (Gold Medal Coder) says:

pharma

• . ´¯` . • Brany • . ´¯` . • says:

yes...

Dave Bitton (Gold Medal Coder) says:

i should blog this conversation verbatim

• . ´¯` . • Brany • . ´¯` . • says:

heheh

Posted by DrFooMod2 at 10:56 AM | Comments (0) | TrackBack (0)
August 23, 2004 04:57 PM
Compare datetime Fields By Year Month and Day

datetime comparisons in T-SQL aren't always a walk in the park. One of the most annoying things that someone would need to overcoming is filtering solely on the year, month, and day component of a datetime field. This is further complicated by how .NET initializes a DateTime object.

When a DateTime object is instantiated without secifying the time, it is set to 12:00AM (midnight). When you pass the DateTime object to an SqlParameter, the following is sent over the wire:


     exec GetContracts @CreationDate = 'Aug 13 2004 12:00:00:000AM'

A further complication is that even if you pass creationDate.ToShortDateString() (assuming of course that your DateTime object in code is 'creationDate') to the Value of your SqlParameter, the afortementioned value is still passed to the stored procedure. This is because the stored procedure parameter is typed as datetime. Now, how do you overcome this?

With values in the table such as '2004-08-13 13:02:44.767', you'll never be able to match 'Aug 13 2004 12:00:00:000AM', and therefore no rows will be returned. The way I have overcome this problem is to make use of DATEDIFF and the dayofyear DATEPART. By using the following in your WHERE clause:


     DATEDIFF(dayofyear, @CreationDate, Contracts.CreationDate) = 0

This will return 0 whenever the day of the year is the same in both the table, and the stored procedure parameter. Any other day will either cause DATEDIFF to return a non-zero value. You can also use this if you want everything from this date and on (or before) by changing the comparitor to > or < as appropriate.

Sproc on!

Posted by DrFooMod2 at 04:57 PM | Comments (0) | TrackBack (0)
August 21, 2004 08:25 AM
Electoral Vote Predictor 2004

Electoral Vote

Posted by DrFooMod2 at 08:25 AM | Comments (0) | TrackBack (0)
August 13, 2004 12:16 PM
Return a Subset of Data From a Table

The ability to page in SQL Server is one of those things that everyone wants, but can't quite seem to get from Microsoft. Many ideas have been posted, each claiming to be _the_ way to do it. In the spirit of mine is better than yours, I've implemented my own paging scheme.

A feature that is in the upcoming version of SQL Server is the ability to supply a variable to the TOP keyword. Well, as it turns out, this functionality does exist in SQL Server 2000. The only difference is the syntax. To limit the number of rows returned from a query based on a variable is to use SET ROWCOUNT @Foo. Don't forget, however, to reverse that after the query by setting ROWCOUNT to 0.

The principle of which this works is that I return all of the primary keys in a table into a table datatype up to and including the record that i want to start at. Then I grab that value by selecting the TOP 1 from that temp table, ordering by the value, descending. Now I have the starting primary key value.

At this point, it's a matter of looping through the records, row by row until I have filled my cache table with a single page's worth of data. Once that is complete, I return the contents of the cache table. In addition, in the form of an OUTPUT param, I return the total number of rows in the table. I have this value as a result of a sanity check that stops the proc if we are requesting a page of data that is past the end of the table.

I hope this sproc finds you well.

Posted by DrFooMod2 at 12:16 PM | Comments (1) | TrackBack (0)
September 2004
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Search


Archives
September 2004
August 2004
July 2004
June 2004
May 2004
Recent Entries
WAP Support
Overheard At the Water Cooler
Compare datetime Fields By Year Month and Day
Electoral Vote Predictor 2004
Return a Subset of Data From a Table
MT-Do
Pet Peeves
Regenerate Deleted Forms Designer .resx File
The Ultimate in Massivity
Ya Know, It's Funny
Recent Commentators
debbie
Marina
Lorainne
another_disgruntled@ci
Branille
DrFooMod2
Rings
<< ? MT blog # >>
<<  ? BlogxPhiles #  >>
<<  ? NJ Bloggers #  >>
<<  ? MT #  >>
<<  ? GeekLog #  >>

Contact
DrFooMod2
Syndicate this site (XML)
Powered by
Movable Type 3.1
Webcam
Featured Links
Stop The Bear Hunt in New Jersey
Microsoft Windows XP - Command-line reference A-Z
Angry Driver Bumper Stickers
Black History Minute
Forgot that connectionstring?   You will find it right here!  
Funny Microsoft Q Articles
XtraVerticalGrid Suite
jimmiehatz.com
ADO Connection String Samples
Color scheme

Blogroll
Blogroll Me!

Miscellany
No Monkey Business. Just Good Code.
Prices Down.  Servers Up.
PC Weenies
Lockergnome
Proud to be a member of BlogSnob!
deviantART dot com; where ART meets application!


blogchalk: Dave/Male/26-30. Lives in United States/West New York/New Jersey and speaks English. Spends 80% of daytime online. Uses a Faster (1M+) connection.