Wednesday, July 02, 2008

Check out Flock

I've just come across an excellent tool for managing all of my social networking, blogging, media and other accounts.

It's called Flock and you can find it at

http://flock.com

Basically it is an internet browser that includes tools to facilitate managing all of these other resources such as gmail, flickr, yahoo mail, blogger, wordpress and livejournal blogs, twitter, facebook and pownce.

I've only started using this today, and I am already impressed by how easy it is to set up and use. This may be THE application.

In fact, I am writing this blog post using Flock, right now, and I've already used it to post a blog on my other blog site http://unusualthoughts.wordpress.com

So check it out when you get a chance.

Blogged with the Flock Browser

Wednesday, October 10, 2007

A flat sales tax

This is an issue that has come up recently in presidential debates, and it has gotten me thinking quite a bit.

I have to admit, there was a time when I would have been dead set against a flat tax, where all taxes are sales tax.

My main reasoning was that for most folks out there, human necessities are about the same, so for a very rich man, the amount he would be paying on a sales tax would seem minuscule, while the poor man would find it very difficult to pay for that tax. Essentially, it seemed like a tax on the poor, and that seemed wrong to me.

After thinking about it for a while, though, I'm beginning to change my mind. Here is my current thinking on the matter. Let's say that we eliminated income tax and only had sales (and perhaps luxury) tax. In the beginning, things might go out of whack, simply because it's not a way that our system is used to working, but over time, I think things would actually normalize.

Think about it. When you buy something now, your paying a sales tax that you aren't even aware of. Do you think when a company marks the price on its products, it isn't considering the cost of its income taxes? Sure it is, and it's passing those costs down to the consumer. So first of all, we are all paying a high sales tax, it's just way more complicated at the moment.

I think, over time, the prices on goods would meet what the market would bear, keeping sales taxes in mind. So, if something costs 2.00 right now, and sales tax is around 7%, then the total cost on that would then be 2.14. If we enacted a flat tax where sales tax would take up all tax collection, the tax might be, let's say 40%, so the price would be 2.80. Well, maybe at first, but 2.80 might be too much for people, so they will rethink whether they really wanted that item or not. Demand will go down as a result of the inflated price, but, people would not be getting taxed on their earnings, so, for many, they would already have more to spend, so maybe a total price of 2.25 would seem reasonable. Of course the company making the product would not be paying income taxes either, and with that lower overhead, it might determine that it could or should drop the price of that item down to about 1.60 (only a 20% decrease), instead of 2.00 making the total cost after tax 2.24. Essentially, we wouldn't be paying any more than we are already are.

So at this point, I believe it actually wouldn't cost the average consumer more than they are currently paying for goods and services. Some will probably go up, and others may actually go down in price.

So, if things are staying the same, why do a different tax at all. Well, here's where a flat tax might actually make a lot of sense, for most people. Since all tax is coming in through sales tax, then it would be much harder to evade taxation (This would hurt more of the people who are not currently paying taxes, but it would actually benefit many of us who are honest).

Certainly businesses would still be required to report sales and taxes and send taxes to the IRS, or whoever collects those taxes, but the rules seem like they would be pretty simple over all, so the chance of evading taxation seems even lower.

Of course this means that this might not be the best solution for people who are benefiting from all the confusion over taxes, such as tax preparation companies, law firms and perhaps even the IRS, not to mention those shrewd people who have earned their wealth by finding loopholes in the current tax laws. It would even be harder for illegal immigrants to avoid paying taxes. In time, this could actually alleviate the tax burden even further, and actually make certain issues moot. Why worry about illegal aliens, for instance, if they are, in fact, paying taxes.

If we are concerned about overtaxing the poor, I don't really know, but it at least seems like it might be feasible for putting a higher sales tax on the upper 50 percentile costing items or imposing some other sort of luxury tax on items that only wealthy folks would buy anyway. So an economy car that costs 15K would have the traditional tax imposed on it, but a luxury car costing more than 30K might have an additional tax of 5 to 10% imposed on it or something.

It's just a thought. I'm actually not a proponent of high taxes and government waste, but to me, this might be a way of cutting down on some of that waste as well as many costs that are intrinsic in our current tax model. It seems quite likely to me that a flat tax would actually lower the amount of taxes we pay in the end.

This is the way I feel at the moment, anyway. I would be open to comments and suggestions on this matter.

Monday, October 08, 2007

Visual Studio To Support .Net Source Code debugging

I just found out about this, and I had to say something.

Apparently, the new version of Visual Studio 2008, due for release in the next few months sometime, is supposed to have support for debugging right down into the .Net Framework code base.

Awesome!!!

Granted, I would probably be just as happy if Microsoft had better (much better) documentation, but this is an excellent start.

Microsoft has a reference license, which allows developers to view the code base. It's not open source, but it's still viewable, and that really helps. Well, anyway, being able to debug the source code of Microsoft's .Net framework assemblies that my code uses will make it much easier to understand what is not working, and more importantly, why.

See Scott Guthrie's Blog post here to find out more.

Way to go Microsoft

Friday, September 28, 2007

Now using labels

Okay, I know this feature has been around for a while, but I've only recently come on board with the whole idea.

Even though I don't have a whole lot of posts yet, you probably know by now that I have a few different topics of interest.

It occurred to me that a lot of folks visiting my site don't have all those same interests, and may not want to wade through all of the content looking for those items that actually interest them.

I was considering creating separate blogs for each of my interests, and then it occurred to me that blogger has this awesome feature called labels.

With labels, rather than having multiple blogs, I can simply label each blog entry as a certain type, and if you only like a particular type of topic, then you can always filter it by that label. Example: http://theintrospectivemind.blogspot.com/search/label/Coding

This makes it easy to bookmark, only what interests you.

Now, I've been playing with the RSS feed for this, and it doesn't seem quite a simple. If I am unable to find out how to make this label thing work, I may, indeed, create a separate blog for just my technology related stuff.

Otherwise, I hope this helps folks out.

Wednesday, September 26, 2007

Encrypting web.config using asp.net 2.0 on Server 2003

Okay,

This is one that has caused me lots of angst, and while there were a number of items that seemed to key in on various concepts that seemed to help, I continued to have problems.

Let me explain the problem as I experienced it first.

I set up the web site on a windows server 2003 OS. We don't like to put the root web into the c:\inetpub directory, so we set the directory of the root web to a different drive and location on the server. The web site was up and running, and everything was working fine, so I decided it was time to apply encryption to the web.config file.

All my research (and experience on my local PC) showed me that I could encrypt the string using the following command


C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pe "connectionStrings"


So, I ran this on the server, and got the "success" feedback that I craved so much.

I ran the web, and nothing happened. Eventually my browser timed out and told me something was wrong, I looked at the application logs, and got an error like the following (# characters used to mask irrelevant or private data):



Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1310
Date: #########
Time: #########
User: N/A
Computer: #########
Description:
Event code: 3008
Event message: A configuration error has occurred.
Event time: #########
Event time (UTC): #############
Event ID: 9dc3f709f3e74c61a16c4a29f3883def
Event sequence: 13
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/782218475/Root-2-128352878489375000
Trust level: Full
Application Virtual Path: /
Application Path: ##############
Machine name: #############

Process information:
Process ID: 2948
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
Exception type: ConfigurationErrorsException
Exception message: Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The RSA key container could not be opened. (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\web.config line 75)

Request information:
Request URL: #############
Request path: ################
User host address: ############
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
Thread ID: 1
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Web.Configuration.RuntimeConfig.GetSectionObject(String sectionName)
at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
at System.Web.Configuration.RuntimeConfig.get_RoleManager()
at System.Web.Security.Roles.get_Enabled()
at System.Web.Security.RoleManagerModule.Init(HttpApplication app)
at System.Web.HttpApplication.InitModulesCommon()
at System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers)
at System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context)
at System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context)
at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)


Custom event details:

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.




I decided to check the web.config file too, and strangely enough, it wasn't even encrypted, so that was even more confusing (Up until now, I still haven't been able to discover exactly what WAS encrypted, but it wasn't the web.config of the default app, nor was it the web.config in the 2.0 framework directory -- even though there is no connectionStrings section in that web.config, I know it did not encrypt, since I was encrypting other sections too that also happened to be in that web.config and which were not encrypted).

I decided to unencrypt using:


C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pd "connectionStrings"


and the web site seemed to start working again, at least, but the sections were obviously still not encrypted.

Needless to say, I was confused, but determined to figure this out.

I tried the encryption again attempting to be more specific and used this


C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pe "connectionStrings" -app "/"


but got the same results

After some research, I found that I could encrypt my web.config more directly by giving a file location with code like this:


C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pef "connectionStrings" "d:\SomeWebRoot\SomeWebApp"


Again, I got the "success" message I wanted to see. This time I checked my web.config right away. Yes! Now it was encrypted. I checked the web site, and again, it just hung there. I looked at the logs and got essentially the same error as before.

I was stumped again.

I looked around a bit and found this post:

http://www.codeproject.com/aspnet/WebFarmConnStringsNet20.asp

It helped give me some ideas. I thought, what if I go ahead and create my own key container. Maybe that will work better, so I tried that.

First I added this to my web.config file:




<configprotecteddata>
<providers>
<add name="EncryptionKey" type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL" keycontainername="SomeWebEncryptionKey">
</add>
</providers>
</configprotecteddata>




Then I created the key container using :

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pc "SomeWebEncryptionKey" -exp


Then I noticed something else I didn't realize before when I added the last step for this:


C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pa "SomeWebEncryptionKey" "ASPNET"


This is when I realized I might need to give some sort of special access to the ASPNET account to the key. Since I was already doing it here, I decided to just go with this new key and continue the process, so I encrypted the web config using the new key. I tried:


C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pe "connectionStrings"


Doh!, same problem as before. It says it's encrypting, but it's not. I checked out the web site and it was hanging again (by the way, I had decrypted the last test prior to all of this).

So I figured out how to use the key with the specific file again.

Here's how to do it:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pef "connectionStrings" "d:\SomeWebRoot\SomeWebApp" -prov "SomeWebEncryptionKey"


Okay, this succeeded in encrypting my web.config, but alas, I'm still having the same issues with the web site hanging and the error.

So I decrypt and keep researching.

Finally I come across this entry, which was somewhat helpful in understanding what was going on:

http://blogs.msdn.com/mosharaf/archive/2005/11/17/protectedConfiguration.aspx

This is when I learned how to apply the rights to the default RSA encryption key:


C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pa "NetFrameworkConfigurationKey" "ASPNET"


I really thought I was on to something now. I ran encryption on the web.config file using -pef again, and everything encrypted just fine again, but again, the web would hang.

Sheesh! now I'm really starting to get frustrated, but on a whim, I decided to look at the comments on the blog page and noticed one person said:


I'd just add the command for 2003:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT Authority\Network Service"
- Igor


DOH!

I had actually seen the Microsoft site for this here:

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

and had run across this, and somehow I hadn't put two and two together.

The answer was in the error message and somehow I managed to miss it every time. So I ran the following line of code:


C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT Authority\Network Service"


Then I encrypted again and Voila! Success! the web was working again.

Hopefully this will help some poor unfortunate soul out there like myself to save a bit of time.

Here is a representation of my final batch file:


C:\Windows\Microsoft.Net\Framework\v2.0.50727\aspnet_regiis -pa "NetFrameworkConfigurationKey" "ASPNet"
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT Authority\Network Service"
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pef "connectionStrings" "d:\SomeWebRoot\SomeWebApp""