Compressing as Individual Files in Folder

Let’s see how long it takes Jim Christopher to jump in with a better PowerShell solution.  :) I had a directory full of .avi files that contains RAW, uncompressed data at 60fps from a camera (for astroimaging).   Even capturing just a few minutes of data amasses  over 10GB of data: No wonder my drive filled up so quickly.  For archiving the data, I wanted to zip each file into its own file, not into a folder.  Because I had about 50GB of videos to do, I wanted a simple cmd to do it for each folder.  This is pretty easy to do with 7-Zip.  Bring up a command prompt in the folder you’d want each file to be individually zipped:     Assuming you have 7-Zip installed in its default location, use a command like: for %I in ("*.avi") do "c:\Program Files\7-Zip\7z.exe" a "%I.zip" "%I" -mx=5 -mmt=4 –tzip   You’ll see the progress in the command prompt: You can, of course, tweak that as necessary.   This compresses each file nicely, now consuming about 1.6GB.    This is a handy way to zip up large number of files into individual archives!

Primer: The Windows Store Certification Process for Windows Phone Developers

As I travel around, I’ve met many people who are familiar with the Windows Phone application certification and submission process – it’s been around for a couple of years now!   Perhaps not surprising, though, is that few people I’ve met have the same comfort level with understanding the Windows 8 Store and understanding how that differs from traditional desktop applications and web applications. In this post, I’m looking not so much at converting an app (that will be another post) but instead looking at the certification process and any other gotchas I’ve experienced. Windows Phone 7 If you’ve stumbled on this post and haven’t considered Windows Phone development, here’s a quick way to get started.  Download Visual Studio Express for free, develop/test your app keeping the certifications in mind, create your MSDN App Hub account ($99/year), and submit your app.  I’ve been on both sides of the fence: as a developer, developing Windows Phone applications like Squeakbox, and as a tester, helping the WP app certification team test a few apps built to control Sonos music systems.   (My role as an app tester was only honorary – I’ve got a pretty big Sonos installation and could easily/eagerly try out the apps!).  Based on my experience and feedback from other developers and internal discussions, the biggest problems developers typically run into with application certification requirements relates to interfering with phone functionality, small app violation policies, and of course, technical certification requirements. Phone functionality is pretty easy to test for but often overlooked … how does the app respond when a phone call comes in?  How does it look in a light vs dark theme?    What about the back button?  App violation policies are often easily correctable – for example, with push notifications, the app must have the user opt-in and provide a way for the user to opt-out if they later change their mind.  Occasionally, there is some confusion over application capabilities, or app cap. Each application has a manifest file that includes metadata for the application – one of which lists all the capabilities the app needs.  This is important because these capabilities are displayed to the end user.  So, for example, Squeakbox allows you to record sound clips, play sound clips from the media library, respond to sensors, and uses push notifications (among other caps).  All of these are listed on the application page so the user may feel uncomfortable, say, if a simple app wants to use the phone contacts, for example. The confusion, though, is understandable and here’s why.  According to this document: For Windows Phone applications, you should specify the capabilities required by your application, such as networking, the location sensor, or the camera. If you do not accurately specify the capabilities, your application might not work correctly or it might fail the submission process to the Windows Phone Marketplace. You specify the application capabilities in the application manifest file (WMAppManifest.xml). Depending on whether you are targeting Windows Phone OS 7.1 or Windows Phone OS 7.0, you can use the Marketplace Test Kit or the Windows Phone Capability Detection Tool to detect the application capabilities. Seems simple enough.   But the manifest doc says: The application manifest file is generated in Visual Studio, and you should not edit the file manually.  <snip> Some of the values in the manifest file will be updated automatically after you submit your application to the Windows Phone Marketplace. Examples include the Author, Publisher, and ProductID attributes, and the CAPABILITIES element. So, you shouldn’t change the capabilities yourself, Visual Studio should handle it.  And even if it doesn’t, the Marketplace should be able to tell what capabilities are required, and override what you put in your manifest.  Some final considerations when testing:  It’s possible that one tester misses something another tester won’t.  That happened to me.   Above I mentioned that Squeakbox allows the user to record sound clips.  The app can also run while the screen is locked.  If you combine those features, you’re app can go into some possible eavesdropping territory.   It was something I never thought of, and something that didn’t get caught in the first submission.  So, consider how users might use your application. Finally, be sure to run the Windows Phone Marketplace Test Kit.  If nothing else, it will quickly determine if the core requirements have been met.   This can save you a LOT of time.  Links: Windows Phone App Hub (Where your account will be) Application Certification Requirements (Stuff your app will have to do, or not do!) Visual Studio Express for Windows Phone (Develop your app, if you don’t have Visual Studio) Windows 8 First off, there is no immediate way to get an app in the Windows Store, but you can create an account here to register applications for notifications.   However, if you have an app in development and would like to get it into the store, contact me.   Many apps are getting into the store via a gated review with a premiere field engineer -- a few weeks ago at TechEd, we helped do this for many people in our App Accelerator area.  The first step, though, is to have your app under development. If you haven’t seen the Windows Store yet (and why not?  You’re running the latest release, right?) then check out this video: From a certification standpoint, many of the requirements are spelled out in this document.   Most of these, particularly for WP7 developers, are expected… app mustn’t crash, limitations on advertising, opt-in consent, etc.   Some of the requirements that might require a little more thought: 3.5 Your app must fully support touch input, and fully support keyboard and mouse input Your app must provide visual feedback when users touch interactive elements. Your app must not use an interaction gesture in a way that is different from how Windows uses the gesture. The Windows 8 touch language is described in Touch interaction design. The Touch Interaction Design, which part of the UX Guidelines, does a good job of illustrating this. And: 3.6 Your app must use the mechanisms provided by the system for those features that have them Your app must support a snapped layout. In landscape orientation, your app’s functions must be fully accessible when the app’s display size is 1024 x 768. Your app must remain functional when the customer snaps and unsnaps the app. Your app must neither programmatically close nor offer UI affordances to close it. Windows 8 Process Lifetime Management closes Metro style apps automatically. Your app must suspend and resume to a reasonable state. If your app implements an app bar, that bar must show up with a bottom-up swipe. If your app implements a navigation bar, that bar must show up with a top-down swipe. Doesn’t the one about not offering a way to close itself ring a familiar bell from the Windows Mobile and Pocket PC days?  I remember the arguments then.    But seriously, having applications snap to one side is a great feature of Windows 8 and something you’ll need to keep in mind.  Some apps, like email, calendar, twitter client, etc., are naturals for this type of behavior, others are a bit more difficult.  Check out what some of the applications are doing today when you snap them beside another app. Another easy to miss requirement but not surprising, for apps that use streaming data: 4.5 Your app must protect customers from unintentional large data transfers over metered networks Notifications If you’re used to notifications in Windows Phone, there’s good news and bad news.  The good news:  conceptually, it’s the same.  Tile notifications to update the live tiles with relevant data, toast notifications that presents the info to the user that allows them to interact, and raw notifications to send data directly to the application.    Conceptually (hat tip to Nick Harris for the pic), nothing is really different: Your app requests a notification URI.  Presumably, you’ll have a web service running somewhere (preferably in Windows Azure!) that receives the channel URI and any relevant information for your app (username, zip code, twitter handle) in order to tie the channel URI to a specific user (bear in mind a user might have multiple channels if they have multiple machines). However, instead of simply requesting and using a channel URI to send a notification, you’ll need to register the application first and authenticate, via an OAUTH token, to the push notification service.  This provides a good security layer to prevent notifications from untrusted services and authenticates you as the application owner. Nick Harris has a good rundown of the procedure on his blog.  Links: Win8 App In 30 Days Generation App Windows 8 Dev Center Windows 8 Certification Requirements Windows 8 Touch Design Windows 8 Performance Best Practices

Windows 8 Developer Camps and Hackathons – Coming July to September

A new series of Windows 8 developer events are coming soon!  These are special two-day events, with a DevCamp on day one featuring a full day of sessions plus an InstallFest, followed on day two by a Hackathon with Lightning Talks where you can bring app ideas to life with Microsoft and community experts on hand to help. Windows 8 changes everything. Combining the broad reach of Windows, best-in-class developer tools, a re‑imagined user experience, support for new chipsets, and a built-in store with industry-leading business terms, Windows 8 is the largest developer opportunity – ever. Join us for free events with new sessions and hands-on opportunities designed to help you start building Metro-style applications for Windows 8 – today. We'll show you how to use Visual Studio to code fast, fluid, immersive, and beautiful Metro-style applications in HTML5/JavaScript, XAML/C# and C/C++. Your existing investments in these languages carry forward, making Windows a no-compromise platform for developers. Attend just one day or join us for two full days of learning. It's your choice. DevCamp - Day 1 Events run from 9:00AM – 8:00PM   Our DevCamp covers Windows 8 Release Preview from top to bottom, featuring sessions that run from introductory to intermediate as the day unfolds. These sessions will be followed by an InstallFest to prepare your system for hands-on app development.   Hackathon - Day 2 Events run from 9:00AM – 9:00PM Our Hackathon is an open Windows 8 code fest, where you'll put what you've learned into practice. Code to your heart's content, with Windows 8 experts available to guide you through every step of the process. It's the perfect opportunity to get your dream application underway, or to finish that app you've already started. This full-day event will be filled with coding, sharing, plenty of food, and the occasional Lightning Talk on topics determined by your apps and questions. Bring your own laptop installed with Windows 8 Release Preview, your apps and your cool ideas and get ready to create! Cities and Dates       Separate registration for DevCamps and Hackathons is required The choice is yours to join us for either or both days, but please register for each separately. Seating is limited, so click the date links below (or call 1-877-MSEVENT) to reserve your seat today!   Location DevCamp Hackathon Manhattan, NY 14-Jul 15-Jul St Louis, MO 16-Jul 17-Jul Brooklyn, NY 19-Jul 20-Jul Nashville, TN 19-Jul 20-Jul Los Angeles, CA 20-Jul 21-Jul Rochester, NY 27-Jul 28-Jul Mountain View, CA 27-Jul 28-Jul Atlanta, GA 3-Aug 4-Aug Ft. Lauderdale, FL 3-Aug 4-Aug Redmond, WA 3-Aug 4-Aug Dallas, TX 7-Aug 8-Aug Chevy Chase, MD 10-Aug 11-Aug Denver, CO 10-Aug 11-Aug Irvine, CA 17-Aug 18-Aug Boston, MA 17-Aug 18-Aug Raleigh, NC 17-Aug 18-Aug Reston, VA 17-Aug 18-Aug Orlando, FL 17-Aug 18-Aug Minneapolis, MN 23-Aug 24-Aug Houston, TX 24-Aug 25-Aug San Francisco, CA 24-Aug 25-Aug Downers Grove, IL 28-Aug 29-Aug Phoenix, AZ 7-Sep 8-Sep Malvern, PA 14-Sep 15-Sep   Register today and join us for these fantastic (and free) developer opportunities.

Windows Azure Dev Camps Soon!

It’s that time – Windows Azure Dev Camps are coming really soon.  Here’s the schedule: Date Location   May 24th, 2012 Alpharetta, GA Register May 30th, 2012 Reston, VA Register May 31st, 2012 Iselin, NJ Register We’re pretty excited to mix up the format a little, with some time to jump into some new areas we haven’t typically talked about in our previous shows: 1. The Azure Platform – An Overview (60 minutes) Let’s start off the day with a dive into Windows Azure. We’ll talk about what Windows Azure offers, from hosting applications to durable storage. We’ll look at Windows Azure roles types, hosting web applications and worker processes. We’ll also cover durable storage options, both traditional relational database that is offered as SQL Azure, or more cloud-centric offerings in Windows Azure Storage for files, semi-structured data, and queues. 2. Hands on @home with Azure (120 minutes) For this hands-on portion of the day, we’ll work on the @home with Windows Azure project. The @home project will give you a solid understanding of using Windows Azure in a project that contributes back to Stanford’s Folding@home distributed computing project. We’ll walk through the code, provisioning an account, and getting the application deployed and running. 3. Caching – A Scalable Middle Tier (45 minutes) Creating a stateless application is a difficult but fundamental aspect of building a scalable application in the cloud. In this session, we’ll talk about the Windows Azure Cache service and using it as a middle tier to maintain state and cache objects that can be shared by multiple instances. 4. SQL Azure, Data Sync, and Reporting (45 minutes) SQL Azure offers a scalable database as a service without having to configure and maintain hardware. We’ll look at the subtle differences between on premises SQL Server databases and SQL Azure, and how Data Sync can be used to synchronize data between multiple databases both in the cloud and on premises. We’ll also look at SQL Azure Reporting. 5. Windows 8 and Azure – Better Together (60 minutes) The consumer preview of Windows 8 is out, and it’s the perfect time to ramp up on developing native Metro-style applications. In this session, we’ll give an overview of Windows 8, and delivering a richer user experience by leveraging a cloud backend.

Antimalware in the Windows Azure

On most (or perhaps even all?) of the production servers I’ve worked on, antivirus/antimalware detection apps are often not installed for a variety of reasons – performance, risk of false positives or certain processes getting closed down unexpectedly, or the simple fact most production machines are under strict access control and deployment restrictions. Still, it’s a nice option to have, and it’s now possible to set this up easily in Windows Azure roles.   Somewhat quietly, the team released a CTP of Microsoft Endpoint Protection for Windows Azure, a plug in that makes it straightforward to configure your Azure roles to automatically install and configure the Microsoft Endpoint Protection (MEP) software.  The download includes the necessary APIs to make it simple to configure.  Upon initial startup of the VM, the Microsoft Endpoint Protection software is installed and configured, downloading the binaries from Windows Azure storage from a datacenter of your choosing.  Note: *you* don’t have store anything in Windows Azure Storage; rather, the binaries are kept at each datacenter so the download time is fast and bandwidth-free, provided you pick the datacenter your app resides in. So, to get started, I’ve downloaded and installed the MSI package from the site.    Next, I’ve added the antimalware module to the ServiceDefinition file like so: <?xml version="1.0" encoding="utf-8"?><ServiceDefinition name="MEP" xmlns="http://schemas.microsoft.com/ServiceHosting /2008/10/ServiceDefinition"> <WebRole name="WebRole1" vmsize="ExtraSmall"> <Sites> <Site name="Web"> <Bindings> <Binding name="Endpoint1" endpointName="Endpoint1" /> </Bindings> </Site> </Sites> <Endpoints> <InputEndpoint name="Endpoint1" protocol="http" port="80" /> </Endpoints> <Imports> <Import moduleName="Antimalware" /> <Import moduleName="Diagnostics" /> <Import moduleName="RemoteAccess" /> <Import moduleName="RemoteForwarder" /> </Imports> </WebRole></ServiceDefinition> Specifically, I added Antimalware to the <imports> section.  The other modules are for diagnostics (not needed necessarily but useful, as you’ll see in a bit) and remote access, so we can log into the server via RDP.   Next, the ServiceConfiguration will configure a bunch of options.  Each setting is spelled out in the document on the download page:   <?xml version="1.0" encoding="utf-8"?><ServiceConfiguration serviceName="MEP" xmlns="http://schemas.microsoft.com/ ServiceHosting/2008/10/ServiceConfiguration" osFamily="1" osVersion="*"> <Role name="WebRole1"> <Instances count="1" /> <ConfigurationSettings> <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="xxx" /> <Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.ServiceLocation" value="North Central US" /> <Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.EnableAntimalware" value="true" /> <Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.EnableRealtimeProtection" value="true" /> <Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.EnableWeeklyScheduledScans" value="true" /> <Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.DayForWeeklyScheduledScans" value="1" /> <Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.TimeForWeeklyScheduledScans" value="120" /> <Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.ExcludedExtensions" value="txt|log" /> <Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.ExcludedPaths" value="e:\approot\custom" /> <Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.ExcludedProcesses" value="d:\program files\app.exe" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="xxx" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="xxx" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2013-03-21T23:59:59.000-04:00" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" /> </ConfigurationSettings> <Certificates> <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="xxx" thumbprintAlgorithm="sha1" /> </Certificates> </Role></ServiceConfiguration> Many of these settings are self-explanatory, but essentially, we’re setting up weekly scans at 2am on Sunday, excluding app.exe, and everything in e:\approot\custom.   We’re also skipping txt and log files.  Also, the MEP bits will be pulled from the North Central US datacenter.  It’s not a big deal if your app is outside of North Central– it’s just that the install takes a few moments longer (the default is South Central).  (And, technically, since bandwidth going into the datacenter is currently free, the bandwidth isn’t an issue.)  If we log into the box (the role must be RDP enabled to do this) we’ll see these settings reflected in MEP. Weekly scans: Excluding app.exe:   And skipping txt and log files: Finally, we can also set up the Windows Azure Diagnostics agent to transfer relevant event log entries to storage – in this example, we’re just adding the antimalware entries explicitly, though getting verbose information like this is probably not desirable: private void ConfigureDiagnosticMonitor() { DiagnosticMonitorConfiguration diagnosticMonitorConfiguration = DiagnosticMonitor.GetDefaultInitialConfiguration(); diagnosticMonitorConfiguration.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1d); diagnosticMonitorConfiguration.Directories.BufferQuotaInMB = 100; diagnosticMonitorConfiguration.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1d); diagnosticMonitorConfiguration.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose; diagnosticMonitorConfiguration.WindowsEventLog.DataSources.Add("Application!*"); diagnosticMonitorConfiguration.WindowsEventLog.DataSources.Add("System!*"); diagnosticMonitorConfiguration.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(1d); //Antimalware settings: diagnosticMonitorConfiguration.WindowsEventLog.DataSources.Add( "System!*[System[Provider[@Name='Microsoft Antimalware']]]"); diagnosticMonitorConfiguration.WindowsEventLog.ScheduledTransferPeriod = System.TimeSpan.FromMinutes(1d); PerformanceCounterConfiguration performanceCounterConfiguration = new PerformanceCounterConfiguration(); performanceCounterConfiguration.CounterSpecifier = @"\Processor(_Total)\% Processor Time"; performanceCounterConfiguration.SampleRate = System.TimeSpan.FromSeconds(10d); diagnosticMonitorConfiguration.PerformanceCounters.DataSources.Add( performanceCounterConfiguration); diagnosticMonitorConfiguration.PerformanceCounters.ScheduledTransferPeriod = TimeSpan.FromMinutes(1d); DiagnosticMonitor.Start(wadConnectionString, diagnosticMonitorConfiguration); } To filter the event logs from MEP, we can add some filtering like so (adding the Level 1, 2, and 3 to the filter so we’re skipping the verbose level 4 stuff): diagnosticMonitorConfiguration.WindowsEventLog.DataSources .Add("System!*[System[Provider[@Name='Microsoft Antimalware'] and (Level=1 or Level=2 or Level=3)]]"); After deploying the role and waiting a few minutes, the entries are written into Azure table storage, in the WADWindowsEventLogsTable.  In this case, I’m looking at them using Cloud Storage Studio (although, for diagnostics and performance counters, their Azure Diagnostics Manager product is fantastic for this kind of thing): While not everyone needs or desires this functionality, it’s a great option to have (particularly if the system is part of a file intake or distribution system).  

My Apps

Dark Skies Astrophotography Journal Vol 1 Explore The Moon
Mars Explorer Moons of Jupiter Messier Object Explorer
Brew Finder Earthquake Explorer Venus Explorer  

My Worldmap

Month List