Mysterious “File Access Denied” in Windows 8

by pthok 19. November 2012 17:26

Often times in the past, I try to delete a file or folder only to be presented with a message kindly reminding me that I can’t delete because it has been locked by another application. So I find the program that has the file open and close it. That’s fine with me because I understand the kernel needs to protect the file to maintain stability.

Today, I ran into something new and irksome. Bear with me as I retrace my steps. I was in Visual Studio 2010 and packaged an Azure deployment project. VS creates the app.publish folder and puts the actual deployment package and configuration files in it. So far so good. I make my way over to the Windows Azure Management with my shiny new files. I upload my files and several minutes later, my site is updated and happy.

But as life goes, before I have time to bask in my awesomeness, another change to the site comes down the pipeline. No problem. Just rinse and repeat. Make change, compile, package…PACKAGE FAIL!? Hmm..VS is telling me it can’t delete the app.publish folder because it’s not empty. Ok, I’ll help it out. I go to delete the two files inside and...FILE ACCESS DENIED!? “You require permission from the computer’s administrator to make changes to this file.” But….I…am….administrator… As far as my PC is concerned, I’m king of the castle…master of the manor.

After bashing the Try Again button repeatedly, I try something else. I go to the file’s properties and the Security tab presents me with “You must have Read permission to view the properties of this object”. Really? I can’t even open the file? So I try it and sure enough, I get an Error dialog: “Cannot open…”. Back to Properties, Security Tab and clicked Advanced. “Owner: Unable to display current owner.” Maybe that’s the issue, it’s confused about who owns it. Being the responsible owner, I click the Change button to claim it. It responds with “You do not have permission to view this object’s security properties, even as an administrative user.” At this point I’m at a loss for words. My computer has gone mad!

One last attempt. Open a command prompt window as Administrator, navigate to app.publish and delete. Nope. That didn’t work either.

Ok, time to restart. I start to close my windows…Notepad, SSMS, IE….hmm…the last time the file was accessed was with IE to upload to Azure. There’s no way IE locked the file. Could it? After killing the IE process, I go back to VS to package again. SUCCESS! But what the heck just happened. When did IE start locking files? This never happened before? But I did just upgrade to Windows 8 and IE 10. I did some quick sleuthing online to see if anyone else had the same issue but found done. I tried to repro with Firefox and Chrome but either of them were as deviant. My only guess is IE 10 (or at least the Azure Management site) somehow uses HTML 5 upload or local storage in a funky way. And by funky, I really mean ridiculously annoying.

Debugging jQuery plugins

by pthok 9. July 2012 23:30

We can probably all agree that jQuery is pretty awesome. It makes writing client side code a piece of cake and there are tons of plugins to do what you need or at least to get you started. But with all the plugins, comes more code you need to debug if you need to tweak or modify the plugin. Recently, I used a plugin that converted a bunch of check boxes to a multi-select dropdownlist. In the background it added several new DOM elements to the page and attached events. I needed to intercept a click event but I didn't know which of the many elements it was attached to.

Luckily I found Visual Event created by the fine people at SpryMedia. Visual Event is a piece of JavaScript you drag to your browser's bookmark bar. When you want to see the events on the page, simply click the Visual Event on your bookmark bar and it'll overlay markers next to the elements. Mouse over the markers and info about the event pops up. A pretty awesome tool for a pretty awesome framework*.

 

 

*Visual Events works with other frameworks as well. But I have an affinity towards jQuery :)

SoCalCodeCamp Last Weekend

by vyurtyn 4. February 2012 00:00

Last weekend I attended SoCal Code Camp sessions at CalState Fullerton.

SoCal Code Camp (http://www.SoCalCodeCamp.com) is a regular event held at CalState, Fullerton facilities in wintertime and USSD, La Jolla in summertime. The event is free and is highly supported by software development community. If you are a good presenter and have some info to share with fellow programmers consider signing up as a speaker for the next event.

The topics were quite diverse: for every time slot in the schedule there were at least 2-3 sessions of my interest so the choice was tough. I ended up going to talks on XBox Kynect SDK, HTML 5, Microsoft MVC, T4 templates in VS2010, new Async in .Net 4.5, WordPress, and Tropo API (voice and SMS apps).

Usually all the talks at SoCalDevCamp fall into three categories. Some of them are useful for my current job assignments, covering technologies and practices currently in use by our development team. Other discuss new trends, latest and greatest, something our team might adopt in the future, as well as technologies outside of my current field of expertise (say, discussions on Java or PHP, since I currently work with .NET). There are also talks not directly related to programming. These may include project management, agile techniques and such (how about a talk on “Driving electric cars” – I’ve seen it in the schedule). 

A real gem in the last category was Gary Hoffman’s talk on Memory Improvement techniques. Gary is an excellent speaker. You can find his blog about code camp at http://theskillfulbrain.com/?p=101 with the link to his presentation at the end of his blog.

With huge leap in technology lately I find myself memorizing less and less facts and relying more and more on software tools to search for facts when I need them. That’s what we have google, bing and yahoo for, right? Why memorize the capitals if you can look them up online any moment? Why concentrate on the route to your friend’s house when you have a GPS?  So does this trend benefit our thinking process? Well, I’ve heard people saying: “Stop filling your head up with junk you don’t need!” But doesn’t our brain need facts and experience as base materials for creative thinking? How many times have you solved some problem you’ve been working on the whole day when driving home or loading your dishwasher or getting ready to go to bed? Vital question is “do we have access to search engines at that time”?

Gary explained several techniques that help you memorize lists of objects (Capitals, U.S. Presidents or WCF configuration settings – why not?), numbers (phone numbers, SSN, street numbers), and even content of the books you read, which is obviously a lot more complex method or rather a combination of several memory techniques.

CSS Compatibility Issue in Email

by sylviah 15. December 2011 11:55

Need to create a website-like email newsletter for your client’s campaign?

Or, an email report with specific layout?

Beware! Most email clients have far lower support for CSS and HTML than the web. Your beautiful design work might look great on one email client, but look undesirable on a different email client.

The best way to ensure your email looks great across all clients is to test on all of them. Unfortunately, it is a very time consuming process since there are over 30 email clients on the market. My suggestion is to pick a list of most popular email clients to test. You can narrow down the list by knowing which email clients your recipients will most likely to use.

Here are the top 10 most popular email clients (as of June 2011):

Outlook

iOS Devices (iPhone, iPad and iPod Touch)

Hotmail

Apple Mail

Yahoo! Mail

Gmail

Windows Mail

Android

AOL

Thunderbird

[From: http://www.campaignmonitor.com/stats/email-clients/]

My second suggestion is to code or design the email with the limitations in mind. There are some coding practices that will help creating a successful html email.

Use inline styles instead of external or embedded style sheets. Many email services cut everything above the body tag and disable external style sheets.

Never! I mean NEVER use JavaScript in an email. Your email will be marked as spam by most email services. Other elements that may not supported: HTML Forms, ActiveX components, Adobe Flash animations, animated GIFs.

Use table for layout instead of div. Tables are more consistently supported.

Declare width, cellpadding, and cellpsacing for all tables and table cells.

Do not use background images. Background colors are okay.

Do not use images for important content. Many email clients turn images off until it is allowed by the user.

Provide alt text and declare both width and height for all images.

Finally, test your email by sending samples to the selected email clients. To perform a more thorough test, check the samples on different operation systems.

If you want to learn more about this topic, website such as Campaign Monitor http://www.campaignmonitor.com/resources/) provides in-depth information and guides (see sample below) about CSS support in email. 

 

Other useful websites:

http://www.email-standards.org/clients/

References:

http://www.davidjrush.com/blog/2011/05/email-client-compatibility-html-friendly-emails/

http://assistenza.mailup.it/KB/a382/css-and-e-mail-clients-compatibility-issues.aspx

http://kb.mailchimp.com/article/how-to-code-html-emails

Adding parameters to an SSRS report.

by hayrettiny 2. December 2011 16:48

In this blog, I will show you how to add normal and cascading parameters to an SSRS report. I assume that you have already read my previous blog. I will continue from the end of that blog.

We have already done with SSRS report running without any parameters from our previous blog.

We are going to add two parameters. One is for customer country and the other one is for customer city. So, we will have two drop down items as parameters. When we select a value for country drop down, it will be a source for the other parameter and city drop down is going to load available cities related with selected country.

Click on design button and go to design view. On the left hand side panel, right click on Dataset folder and add a new dataset. Fill the opening window same as the picture below. We are using our existing Data Source which we added before. (Data Source has Customers and Orders tables.) Write the query and click OK.

Data Set is ready. After that, right click on Parameters folder and add a parameter. Fill out Name, and Prompt fields as “CountryParameter”. Click on Available Fields and select Get values from a query radio button. Select values same as the picture below.

For the second parameter, we need another Data Set. It is same as the previous one. The only difference is that when we write the query we will add the first parameter to the new Data Set. We need to get all cities which belong to a specific country. So, in the where clause, we should use “@CountryParameter”. You need to put @ before the parameter name to use it in Data Set.

What we did for CountryParamter, we need to do same thing for CityParameter. Right click on Parameters folder and a new parameter.

Last thing we need to do is that, implementing the city parameter into the main query. Right click on DataSet1 and select DataSet properties. Add where clause to query.  (Where Customers.City=@CityParameter)

You are done! Click OK and run the project.

Creating SSRS reports using Report Builder 3.0.

by hayrettiny 17. November 2011 12:30

If you want to create useful reports without spending too much time, you should definitely use SSRS reports. In this blog I will show you how to create reports using Report Builder. I will use Report Builder 3.0 version. You can use SQL Server Business Intelligence Development Studio as well.

After you run the Report Builder, select Table or Matrix Wizard under New Report tab. I will create a dataset, but you can use an existing dataset. Click on next and select the database which you want to connect.

Click OK and go to Design a query window. I am using Nortwind database. Under database view expand tables and select tables which you want to show in your report. I selected Customers and Orders table. You can use your own query instead of using the tool.

Then click on next button and go to Arrange fields window. At this point you are starting to select the fields for your report. Drag and drop the fields that you want to show in your report.

Click on next and finish the wizard. You can click on Run button and see what your report looks like.

You can play with the report settings and use expressions to make your report more flexible. I will show how to add dependable and individual parameters to your reports in my next blog.

A Free SQL Server Management Studio Add-In To Help Make You More Productive

by Robert 29. September 2011 01:42

So lately, I've been tasked with working with several databases where the number of tables and views within the databases number into the low thousands.  As you can imagine when working with any kind of long list, the amount of time spent scrolling and searching for the objects you are interested in proves to be a pain point after a while.  In SQL Server Management Studio (SSMS), you do have the ability to set filters, but they aren't persistent and they are limited in value.  For my purposes, the filters helped, but not nearly as much as I would have liked.  So, my first thought was that I wished there was a way that I could create a persistent "folder" structure.  After a quick search of the web, I wasn't able to find anything out there that was what I was looking for, but I did find code samples on creating SSMS add-ins.  I was pretty much resigned to trying to write an add-in myself to do what I wanted to do in SSMS.

After discussing my thoughts about this with a co-worker, he made me aware of a free add-in (SQL Treeo) created by Jakob Dvorak that does a lot of what I was looking for. It allows me to create persistent "virtual" folders as a hierarchy to organize the database objects into a far, far more manageable interface.  As noted in his forum, the add-in is an alpha version and still a work in progress.  I've used it now for a month and give it positive feedback.  There are some bugs and there are a couple modifications that would be nice to have, but all up, it is a solid piece of development and well worth a try (Note: currently it is only available for SQL Server 2008 R2 client).  If you're working with hundreds of tables within a database, it may just make you more productive (as it has for me) and reduce your frustration with constantly having to scroll up and down to find a table or view.

XAML Auto-Formatting in VS2010

by vyurtyn 23. September 2011 18:37

Remember those days when your HTML code was auto-formatted in early versions of Visual Studio? While I don’t miss this feature (who does? Smile) there is an auto-format option for XAML in Visual Studio 2010 I usually turn on as it improves readability of XAML.

The option is somewhat hidden in configuration of VS2010: select Tools >> Options >> Text Editor >> XAML >> Formatting >> Spacing >> and check “Position each attribute on a separate line”.

Now compare Snapshot A below showing default XAML code in VS 2010 editor (see how you have to scroll back and forth to make any sense of XAML) with the Snapshot B showing the formatted version of the same XAML.

Snapshot A: Default Formatting of XAML
Snapshot A

Snapshot B: Formatted XAML
 Snapshot B

To format a section of XAML just select it and either use the hot-keys “CTRL-E, F” or select Edit >> Advanced >> Format Selection in the Menu.

 

Quality Developers (and why average developers fail)

by BryanB 22. September 2011 00:39

This is a piece for the team at Exsilio, our clients, and partners to know what our internal expectations are.  Obviously, the title of this article is rather black and white, and it seemed to me of value to have a discussion on how Exsilio can be a challenging, yet very rewarding, place to work for reasons people may not immediately think of.  I'm going to speak specifically about developers, but the general concepts apply to all categories of our team. 

As a service based organization, people often believe that being successful in their job means having a specific technical skillset. For example, I'm a developer and I’m very good at programming in T-SQL and C#, so I should be successful. A strong technical skillset is a given, and honestly speaking, if your only asset is your technical knowledge then you're probably not going to succeed – at least not at Exsilio.

Let’s talk about what makes people succeed, get the level of appreciation they're looking for, and keep everyone else happy.  So think about the real purpose of your job.  Since I’m already using the example of a software developer, why do people want software developers, to write code obviously (this is the point where average developers begin to fail).  But there are more fun ways to spend money, so why are they spending their money on this project?  Fundamentally, at least in most cases at our company, it is to write code to create solutions which will make someone's life better or easier than it would have been otherwise.  And it’s a solid understanding of this where you move from an average developer to a quality developer.

If you're a software developer and you're not thinking every day, with every task, about how your solution will enhance, benefit, and dare I say "amaze" the end-user, then you're in the wrong profession. You’re certainly working for the wrong company, if you work at Exsilio. It goes further than the code you write, it is the way people interact with the product you build, it is the way you present your product, and the way people receive it. The end product should practically glow with the pride and efforts of the person who is delivering it. This comes from the person building it affirmatively answering all of the following: Does this make sense?  Do I know why I'm building this and understand the value it will be providing to people?  Is this something I'd want to use every day?  Am I proud of this product?  Is this something that is commercially worthy? 

I hear developers often say “I’m a developer not a creative designer.” I tend to translate this to, "It should be alright if I create something that looks like crap."  Professionally, this may be correct; however, people know what looks good and what doesn't.  While some make the excuse that it is subjective, most people would agree that Lamborghinis and Ferraris are truly stunning vehicles, they don’t need a creative designer had to tell them this. They know it based on basic senses.  The same rule applies if you’re a developer without a creative person on your team; build something that you're incredibly impressed by.  If you're incapable of doing this, then either you don't care about your project or you’re lacking in technical skills.

In the same regard as above, they often times say “I'm not a business analyst so I should just need a technical spec and not need to understand the business requirements”.  To that I say something very similar.  Simply put, if you're working on a project and you don't know the business rationale and use cases behind it, then 1. Your project is doomed from the start and 2. You probably should be working on it until you do.

At the end of the day, if the software you’ve written doesn’t make your users feel like they're being more successful and impressed both by function, feature, and general beauty, then the project was a failure.  Average developers, developers who shouldn't be working at Exsilio, simply take what was delivered to them on a technical specifications document and deliver on that.  Anyone who's been around me in meetings to review projects and status hopefully knows this.

While this piece was aimed at the developer, it conceptually crosses the boundaries for all of the delivery groups in our organization. It is really an honor that our customers have chosen to work with us on some truly amazing, incredibly high profile, and cutting-edge projects, but with that comes an awesome level of responsibly. With that level of responsibility come the intangibles that make people the best they can be. At times, these are the same things that can make Exsilio a tough place to work for reasons I think most wouldn't ever think of.  Over the six years, I’ve thought it is worth it, and honestly I have to believe the people who’ve stood the test of time have thought so as well.

Changing the default database in SQL Server 2008

by johnb 23. August 2011 11:10

When you open the SQL Server Management Studio and you are writing new queries the drop down lists of the database resets back to its default. Then you'll have to remember to change it or write "USE ..." in the SQL statement everytime. This can get frustrating. 

To change the default database follow these steps below:

Step 1 - In Object Explorer expand Security folder. Expand Logins folder and look for your Username.   

Step 2 - Right click on your User and select Properties

Step 3 - In the Login Properties look for "Default Database," choose the database and press the "Ok" button.  

That's it! :D

Tag cloud