Delete cookies for a single site or domain in all browsers

Cookies-Delete

Sometimes when debugging a web site you are working on, you want to clear out cookies for a single site however you don’t want to clear out all of your cookies.  Some cookies you want to leave there, like your cookies that are set by Gmail/Facebook/Twitter/Outlook.com for 2 factor authentication or many other reasons.  Up until now I have cleared them all out each time I need to clear cookies for a single web site I am working on.  Here’s how you can clear cookies for a single domain and keep those time saving cookies.

IE

  • Hit F12
  • Click on Network
  • Click Clear Cookies for domain

Chrome

  • Click the Chrome menu Chrome menu on the browser toolbar.
  • Select Settings.
  • Click Show advanced settings.
  • In the “Privacy” section, click the Content settings button.
  • In the “Cookies” section, you can change the following cookies settings:
  • To delete a specific cookie, hover over the site that issued the cookie with your mouse, then click the X that appears on the right corner.

Firefox

  • Click the menu button and choose Options
  • Select the Privacy panel.
  • Set Firefox will: to Use custom settings for history.
  • Click Show Cookies…. The Cookies window will appear.
  • In the Search: field, type the name of the site whose cookies you want to remove. The cookies that match your search will be displayed.
  • Select the cookie(s) in the list to remove and click Remove Cookie.

Safari

  • Choose Safari > Preferences, and then click Privacy.
  • Click Details.
  • Select one website that stores cookies, and then click Remove
  • When you finish removing websites, click Done.

Our trip to Banff, Alberta Canada

A little off topic but I just wanted to share some pictures and a video of our trip to Banff.  We flew in to Edmonton, drove to Banff, Lake Louise, and stayed on Canmore.  We go to see quite a bit the few days we were there.  After a long weekend, we flew back to the States out of Calgary, Alberta.

 

 

 

This is a collection of videos from my phone that I captured while in Banff, Alberta – Canada.  Everything was taken using my Lumia 1020 Windows Phone.

 

How to Cache Output in ASP.NET Web API 2

ASP.NET Web API is a simple way to create a pretty nice and robust API.  I have a need for a simple API and ASP.NET fit the bill.  I created an API for my Space Weather application for all of my clients to connect to.  The API is pretty simple, it just feeds the clients objects in JSON for them to parse and bind to the UI.  After rebuilding my Azure virtual machine, I decided to add some caching to the results.  Since Web API doesn’t include an easy way to cache output like MVC did I had to find a solution. For me, the best (an easiest) solution was OutputCaching.  It’s super simple to set up.

Get the NuGet Package

Grab Filip W’s CacheOutput library.  I am using WebAPI 2.  I used package manager to get it:

This handles 90% of it.

Add the Attribute

The rest is just decorating your controllers just like you would for MVC.

In my example,  I am telling it to cache the results for both client and server-side for 600 sec (10 min).  There isn’t a whole lot of science behind choosing 10 minutes, and I could have written some fancy code to figure out when my scheduled job ran last but I wanted to keep it simple.

Test

So, did it really work?  Let’s fire up Fiddler and find out. Hit your web endpoint, and take a look:

Sure enough, you can see the client is told to cache for a max of 600 and you can see the ETag letting you know that the server is caching.

Conclusion

So why do I choose to cache my output?  Simple.  I have a micro virtual machine on Azure and I didn’t want each and every web request to retrieve results from my database creating lots of churn and processing resulting in more disk activity and slower results.  Before going and implementing this I suggest you first evaluate your needs.  My needs are to return slow changing results to mobile clients as fast as possible without creating a lot of churn on the server.  I don’t want my customers to wait for results, especially if the result is the same.  My results change 4 times an hour and so caching this is the right thing to do in my scenario.  With that being said, I think this NuGet package help me meet this goal.

(Hanselman recommends Cache.Cow, although I like the simplicity and familiarity of decorating my Web API controllers with attributes using CacheOutput.)

Did a recent Windows update break setting an iframe source in Windows 8.1 apps?

I have a Windows 8.1 application that is a wrapper around a web site. I have 3 versions of the site that the user can switch between with a control I built. The control sets the iframe source to the respective site.  It seems like a recent Windows update  broke this (not sure if it was 05/2014 or 06/2014). Here is how I set the iframe’s source:

Nothing odd here.  Just some plain old JavaScript setting the window location.  The window location never changes but I do see an error.

Here is the error I get in the JavaScriptConsole:

APPHOST9624: The app cant use script to load the https://www.example.com/ url because the url launches another app. Only direct user interaction can launch another app.

I have even tried adding the site to the ApplicationContentUriRules in the manifest but it didn’t fix it.

Truth be told, the user is not interacting with the app on this specific event, the control is in a settings flyout and is invoked when the selection changes.  BUT, technically it is not launching another app (if I take the error message as is).  I’m not  launching a new window with that location, I am setting the current window to a new location. It works when the app loads for the first time but not when I hook into an event that is driving from a selection control item changed event.  It still works if I target Windows 8.0.  I am hoping this is a bug and it will be reversed, otherwise I will have to come up with another solution for changing sites.

Is anyone else setting an iframe source this way in a Windows 8.1 app?  Is there a better way to do this?

Our First Garden

 

Usually I post about tech things in my life but this one is a little different.  It doesn’t involve any technology at all, well maybe low tech if you count the Visio diagram!  Here is our first garden that we planted in our back yard.  It is not a vegetable garden, but a flowing garden that will hopefully produce some flowers over the next few years.   We got a bit of a late start but hopefully the perennials grow some deep roots before the cold Minnesota winter comes.  Here is a diagram with all the plants we used.

I’ll try to post some photos after it grows a little bit more.

Building Space Weather 4.0

After a few weeks of working on an updated version of Space Weather I have finally released 4.0.  This update is the product of a redesign from Microsoft and Nokia.  A few months ago I won a trip to San Francisco where I met a Senior UX and Design consultant from Microsoft who helped me redesign my application.  The result was a great new UI and a lot of work added to the backlog.

The last few weeks I had quite a few decisions on my hands.  It is one thing to mock up a great looking UI, and it is another to actually implement the UI and bind data to it while still pleasing all of my existing customers.  So little by little I started making some of the changes and creating small prototypes and compiling them into a bigger functional application.  At first I thought that there wasn’t a way to present all of the data that previous versions had.  I even wrested with the idea of turning this update into its own application, a second “lite” app (thanks for talking me out of it Peter) but then I found a way to logically break up all of the information I was presenting.  It sounds simple and makes a lot of sense when looking at it now but when I first started re-writing Space Weather 4.0 it was a little overwhelming.

So i broke it down into 5 main parts or pivot.  Some pivots have more information that the user can drill into if they choose to.

Aurora Forecast

In this pivot I show the likelihood of seeing an aurora based on the Kp index.  The Kp index is on a 10 point scale (0-9) and is updated regularly.  The ellipse will move based on the Kp index and will also change colors. 0 is gray, 1-3 is green, 4 is yellow, 5-7 is red, and 8-9 is purple.  If it even turns purple we are in for a show!

I also display the most current space weather information.  For most people this pivot is all you need to see to get a glimpse of current space weather conditions and if it is likely to see an aurora (Northern Lights).

I used the Flickr API to display images that match the search term “aurora borealis” and filter the results based on images that can be used commercially.  The Flickr API was pretty easy to use and there is a NuGet package for this.

Aurora Forecast

 Alerts

In the alerts pivot, I show the active alert count in the pivot header and the alert details on the main page. You can drill into one of the Alert item details to read more about it.    Again, on this pivot item’s main page I used the same Flickr API mentioned above but grab a different image.

Alerts

Forecast

The forecast section shows the forecast for the next 24 hours. There are different categories for each of the predictions.  The image I use in the background is from the Solar Dynamics Observatory (SDO).

Forecast

Forecast

Last 24h

This pivot shows space weather over the last 24 hours.  It shows the same categories that the forecast shows however this is past activity.  The image shown here is the past Kp index.

Last 24h

Last 24h

 Explore

This is the last section but contains the most information.  The Explore pivot is a hub where you can get more information if you like.  It contains many images, movies, RSS feeds, and even real-time generated charts for you to explore.  Each section is a gallery of media where you can find web cam images, the current solar wind, and even movies of the sun.

Explore

Explore

 

Live Tiles

After getting my pivots organized and the data wired up I decided to focus on my Live Tiles.  Prior to this updates my Live Tiles were live, but not alive.  What I mean by this is that the feature was enabled but it showed an image that was hard to make out and didn’t really give the user any valuable information or a sense that it was alive.  I decided to surface the Kp index to my Live Tiles, using the same look and feel from the main pivot.  I also update the counter based on how many active alerts there are.  As an added bonus, if you are using Windows Phone 8.1 they support transparency!

 

There are a few things I intentionally left out of this release.  One is the lockscreen image.  I wanted to be sure that I did this feature some justice instead of just cobbling in a few random images like I was doing before.  I also left out the current status of each type of space weather reading/storm. I haven’t found an elegant way to do this yet but I have some ideas.

Takeaways

A huge takeaway that I discovered after redesigning my application  was to separate your business logic from your UI.  Luckily when I wrote my application I followed the  Model View ViewModel (MVVM) pattern, so ripping out the UI and starting all over was relatively easy. I reused 100% of my business logic for this update and only added new properties where I needed to.  Space Weather is almost 16,000 lines of code and I wanted to be sure I could reuse as much as possible.   Space Weather 4.0 looks drastically different than previous versions however since I followed the MVVM pattern almost all of the code behind the UI is the same.  I highly recommend following a pattern like this in case one day you decide to give your own app a face lift.

Overall the experience with Nokia and Microsoft was a welcomed one.  Dave Crawford pointed out that my design (or lack thereof) was really needing to be simplified and focused.  My application is information dense and he helped my break it apart by redesigning my layout into pivots.   This helped me organize related content and display it in a more consumable manner, which meant a better overall user experience for my customers.  Taking a mock up and advice from him really helped transform my application into the one it should be.  I wish I could work with him on refining some of the rough edges it still has however his advice and time was much appreciated and will continue to influence my future applications at home and at work.

You can download Space Weather here:

http://www.windowsphone.com/en-us/store/app/space-weather/a6f54073-41ac-e011-a53c-78e7d1fa76f8

You can see it in action below:

 

You can read more about the release here:

http://www.spaceweatherapp.com/blog/post/space-weather-app/space-weather-4-0-for-windows-phone-8-released/

 

Building my Intel NUC Media Center PC

For the last few months I have thought about building a replacement PC for one that’s connected to my TV.  This PC is running Windows 8 with Media Center and has been my DVR for some time.  I have run variations of Windows Media Center since around 2006, all the way back to Windows XP Media Center Edition 2005.  I still haven’t found a better solution than Windows Media Center for recording live TV, so I am continuing to stick with it.  I really hope Microsoft does something special and creates a Windows 8 modern app version of Media Center but I’m not holding my breath.

I’ve wanted to replace my current Media Center PC for some time.  It’s big, heavy, loud, and powerful.  Don’t get me wrong, I love powerful PCs but having this thing on for a good part of the day doesn’t sit well with me.  It uses quite a bit of power, which for a TV PC, isn’t necessary.  So I decided to slim down and search for a low power, quiet, and cost-effective PC that isn’t an eye sore.  I compared a few models before settling on this one.

My new PC is the Intel NUC D54250WYK.  It comes with  Core i5 processor on a motherboard in a nice little case.  It also includes an infrared sensor which is perfect for my existing remote.  The other components you have to buy separately.   I purchased a mSATA 120 GB hard drive, 8 GB of RAM, and a wireless network card that also provides Bluetooth connectivity.  This is perfect package for a small connect yet powerful PC.

I have personally built every PC i have ever owned (except for my very first) and I have to say this was the simplest one yet.  I built the thing in about 5 minutes.  I created a video to show how I did it. I will go into detail on another post about the configuration later after I have everything set up.

 

My design consultation with Nokia and Microsoft

WP_20140330_17_28_16_Pro

A few weeks ago I was notified that I won a design consultation from Nokia for my Windows Phone app, Space Weather.  I was offered a flight, hotel stay, and a one-on-one consultation with a senior Microsoft UX designer Dave Crawford. It was a great experience.  I haven’t had time to implement any of the changes that were discussed in this session, so I am documenting the days I spent in San Francisco for now.  Once I release a new version of the application with the proposed changes I will write all about it.

 

Day 1

I flew to San Francisco from Minneapolis and landed in 50 degree weather, a welcome change from the single digits we were having in Minnesota.  I was picked up from the airport with another winner, Darin, a the driver took us to the Sir Francis Drake Hotel which is right next to Union Square in San Francisco.

Sir Francis Drake Hotel

Day 2

On day 2 I went to the Microsoft office in San Francisco.  Here I met the Nokia / Microsoft / DVLUP team, as well as the film crew.  From here we all walked a few blocks away to film.  Here are some photos from that afternoon.

After the interviews, Darin and I went off exploring.  We didn’t have a ton of time so our destination was the Golden Gate Bridge.  I know, obvious right?  We used HERE Transit to get there.  This app didn’t disappoint!  It got us there without any issues.

I took some photos while I was there. (These were all taken with my Lumia 1020 Windows Phone)

I took a short video too.

 

That evening we had dinner with the team at the Marketbar.

Day 3

The next day was the design consultation.  This is where I met one-on-one with Dave Crawford and he helped me redesign my app.  There were interviews before and after.

Dave helped re-imagine my app, Space Weather, in drawings and even a prototype application.  Here are some of the sketches.  We were given these awesome sketchpads along with icon stencil to help mock up our UI in the future.

Time to go home

Overall this was a great experience.  It was nice to get some feedback on the application from someone who is an expert in this field.  Dave really took the time to understand the experience I was trying to deliver in my application and through this new design will help me to share it with my customers.   After the consultation I left feeling re-energized about my app.  There is a lot of work to do but I think it will be worth it in the end.  I am not going to go in to detail on what we discussed but his ideas will be incorporated in my app in a future release.  Thank you Nokia, Microsoft, DVLUP, Kavita, Ali, Brad, Kyle and the film crew, and especially Dave!

(Obligatory street car shots)

Build an app in 5 minutes or less… coding skills optional

app studio

 

Today I taught around 60 students from Minneapolis area high schools how to build a Windows Phone application in 5 minutes or less.  My goal was to show them how easy it was to get started building applications for mobile devices.  I did stress to them that leaning programming is a valuable skill to have and that it teaches you many problem solving skills however, I didn’t want them to feel discouraged by this roadblock.  I wanted them to see that sometimes programming is just a means to an end.  Sure, I like programming and I think it is fun however, sometimes this can be a barrier to entry.  This barrier might just block the next big thing.  Today I tried to help remove that barrier using App Studio from Microsoft.  Here’s how we built an app for Windows Phone and Windows 8 in less than 5 minutes, without writing a single line of code.

Let’s Get Started

Here are the requirements for the application:

  • Personal
  • Connected to the internet
    • Plays videos
    • News feed
    • Flickr image gallery
  • Installs on my phone
  • No coding required
  • Finish in 5 minutes or less

We headed over to App Studio http://appstudio.windowsphone.com/

Clicked on Start new project > Empty App

create app

 

Title

We set the App title and icon.  We called ours “Nintendo News” and the the icon to a 1-up.

app title

 

Main Sections

About

We added an about section to welcome our app users.  Added HTML section called “about”

We added the text:

Hi. This is our application about Nintendo. Did you really think we could build this in 5 minutes?

We also turned on the text-to-speech option and bound our text to this speech control.

page extras

 

News

Next we added an RSS feed (to pull in news)

We called the section “news” and pasted the Nintendo news URL http://www.nintendo.com/feed

Videos

We added a YouTube section called “videos” and chose the user “Nintendo”.

Images

Added a Flikr section and called it “images”.  Searched for the term “super mario”.

Saved our application.

Here is what it looked like so far.

main sections

 

Themes

Clicked on the themes tab.  From the custom Style we chose a background image and chose to color the app bar red.  Here is what our theme looks like:

themes

 

Tiles

We chose the same icon for each tile, just to keep it simple.  Here is what our tiles look like:

select your tiles

 

Splash & Lock

We also set a Splash & Lock screen:

lock and splash

 

Publish Info

We updated the publish info, however we didn’t need to.  I had a minute to spare.

update publish info

 

Generate the app

I generated the app and chose to build it for both Windows Phone and Windows 8.

generate app

 

Don’t forget to install the certificate that is emailed to you.  You will need to do this before scanning the QR code to install your app.

build your app

 

We scanned the QR code using the built in scanner in Bing Search.

scan the code

 

Beam my screen to the TV

All done! From here I duplicated my phone’s screen using Nokia Beamer to show them the application we just built on the TV screen.   Nokia Beamer is an awesome way to share your screen with anyone using only a web browser.   Here’s our app, beamed from my phone to a web browser on a TV so all of the students could see.

beam the app

 

 One minute to spare…

There you have it.  We built an application from start to finish with one minute to spare.  Most of the students were impressed, as was I since I didn’t think it was possible when I first had the idea for the presentation. It wasn’t until I timed it that I knew that this was possible.  Remember that although this is just a simple example using Nintendo, you can choose any subject you like to create your application.  There are many starter templates to get you going in App Studio.

If you want to check out this application, you can download it below.  I might even post this app in the Windows App Store so you can check it out. This application is open source.  I have posted the code contents to GitHub.  You can find the repository here:

https://github.com/timothystewart6/NintendoNews

 

You can download the app for Windows Phone here:

http://www.windowsphone.com/en-us/store/app/nintendo-news/92a76eac-272f-488d-bba2-d9d0d4a2e53e

As an added bonus, this app also runs on Windows 8 using the same solution file.  Enjoy!

windows8