Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 6th, 2008, 07:24 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default clever clogs' required - apply within!!

ok guys 'n' gals,

i'm working on a routine to take a database 'flag' which is basically a sum (to the power of 2 - i.e. bitwise operations) of an enumeration that is defined in my app and used the same way in the SQL. I've worked out a pretty neat routine (which i've demo'd in the link below) which will tell me what enum values 'compose' my final number. I'll describe this below to give a flavour:

if my final value in the 'flag' is:

23 - my enum values are 1,2,4,16 (i.e. those add up to 23)
49 - 1,16,32
153 - 1,8,16,128
260 - 4, 256

etc, etc...

All is great, however, i can't help but feel that my method could be a bit more 'streamlined' and capable of doing a bit of reflection (to figure out the min/max of the enum) to make things a bit more generic. to this end, i invite you folks to dissect and reassemble my code to fulfil the brief above.

happy headaches all :D

www.originaltalent.com/downloads/bitwise.zip


jimi

http://www.originaltalent.com
__________________
jimi

http://www.originaltalent.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
apply if condition at session gaurav gupta ASP.NET 2.0 Basics 0 July 9th, 2008 01:58 AM
how to apply condition at session value gaurav gupta ASP.NET 2.0 Basics 0 July 9th, 2008 01:29 AM
CANNOT APPLY INDEXING WITH [] pallone .NET Framework 2.0 7 April 8th, 2008 06:40 AM
Apply changes to more than one file bcogney XML 11 March 6th, 2007 07:02 PM
Templates Won't Apply neilac333 XSLT 5 October 26th, 2006 01:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.