Writing ... or Just Practicing?

Random Disconnected Diatribes of a p&p Documentation Engineer

  • Writing ... or Just Practicing?

    In England's White and Pleasant Land


    I received an invitation to attend a "highly recommended" course this week on how to maximize use of Office Communicator, Live Meeting, and the Office Conferencing System. Specially timed, no doubt, to coincide with the rather interesting weather we are currently experiencing here in Britain. And obviously a really vital event to reduce the need for travel during this period of meteorological uncertainty.

    Great, I thought, really useful - must sign up and watch the remote presentation! Except that, oddly, it's only being held in London and Reading (both some 180 miles away from me) and is not being networked. So I have to travel to see a presentation about reducing the need to travel. I suppose they assume that, until you see it, you won't know how to view it remotely. Maybe these photos of our usually green and pleasant land will indicate why I'm likely to miss it...

    Derbyshire snow
    Derbyshire snow Derbyshire snow
    Derbyshire snow Derbyshire snow
    Derbyshire snow Derbyshire snow
  • Writing ... or Just Practicing?

    Let Them Eat Cheese


    When you think about it, it's clear that software architects and developers should rule the world. Not that - in reality - they don't already. Let's face it, almost everything that goes on in the world today, from air traffic control to motor cars to the microwave oven in your kitchen is powered by software. But what's becoming clearer over time is that they should be running the Government as well.

    Here's the justifications:

    1. Software developers manage usage of their primary resource, memory, knowing that there is a finite limit to the amount available. At some point you'll run out of slots to plug more in. You can't just print more memory for your application to use. Governments, meanwhile, have no idea how to manage their primary resource, which is, of course, money. They just keep spending it until there is none left, then print some more, and then discover that there still isn't enough to keep their economy running. Examples: Government debt and the financial crisis.

    2. Software developers realize that efficiency is the key to making an application work well, and for generating income that allows them to prosper and build even more software. Individual components of the application are accurately targeted, fine-tuned for performance, and only instantiated when required. Governments, meanwhile, work on the principle that the best way to promote efficiency is to appoint more people to watch the people who are already watching other people who are trying to do something. Efficiency in Government consists of using maximum resources to manage input, instead of minimizing resource usage whilst achieving the required output. Examples: taxation systems and nationalized health services.

    3. Software architects design systems based on known and tested mechanisms and patterns, thinking ahead to avoid applying limitations that will inhibit any future changes or extensions to the system; and considering interoperability, effectiveness, and reuse. Governments, meanwhile, design systems based on ideology and with no consideration of impact and unintended consequences; and usually based on untried practices and unproven assumptions. Examples: health and safety regulations and the Human Rights Act.

    4. Software developers implement comprehensive testing regimes for their products, and provide an efficient feedback mechanism that allows them to discover faults and improve quality before the application is deployed. Governments, meanwhile, implement new systems with no prior testing and have no effective feedback mechanism that supports changes when glaring errors or omissions are discovered. Faults are either ignored, or result in changes that make things worse. Examples: the European Union and the single currency.

    5. Software architects and developers innovate rapidly, meet constantly changing requirements, and fulfill aspirations in a fast moving market with regular new paradigms. Governments, meanwhile, plan for yesterday and strive to maintain power and the status quo. Examples: Doha trade negotiations and global environmental summits.

    6. When a fault in a system is detected, software developers apply effective patches and updates to resolve the issue. Governments, meanwhile, prevaricate and apply wildly unpredictable and often unsuitable or unsatisfying fixes that often make things worse. Example: Cheddar cheese.

    OK, so that last one might seem a rather strange example. But if you read about how the Irish Government is responding to the disastrous ramifications of its membership of the European Union last week, you'll understand. They've decided that the best way to counter the effects of running out of money is to give everyone in the country a nice soothing block of cheese to take their mind off the crisis (see Let Them Eat Cheese). A move that Jeremy Paxman on Newsnight rather neatly summed up as "quantitative cheesing".

    But at least Wallace and Grommit would have approved (though Wensleydale would have been even better)...

  • Writing ... or Just Practicing?

    So Far, So Near...


    So here's the problem with the Internet. They say it's supposed to bring everyone closer together and make the world a smaller place. But actually, at least in a virtual sense, the opposite is happening. Things that are geographically "next door" now seem like they are hundreds of miles away. It's all a bit like looking down the wrong end of a telescope.

    OK, so you are probably wondering what kind of weird tangent I've gone off on this week. Maybe, as a friend commented on my blog a week or so ago, I'm on either too much (or too little) medication. As justification for my wild allegation, therefore, I'll materialize my virtual procrastinations by explaining the actual scenario that played itself out this week. It all started with wooden delivery pallets, tarpaulins, cats, and jumble sales...

    The basic problem is that our local cat sanctuary raises money to look after a considerable number of waifs and strays though a variety of events, of which my wife is an active participant. A major one of these events is the bi-monthly jumble sale, which requires the accumulation of large volumes of assorted bric-a-brac, clothes, toys, and all kinds of other assorted saleable items. And, therefore, somewhere to store them.

    Having exceeded the capacity of our current storage facilities, the only option now is to store non-delicate materials under tarpaulins on wooden pallets in the yard. However, even summer weather here in our wild and desolate corner of England often consists of rain and gales, and keeping the tarpaulins secured to the pallets is a problem. So my wife decided that she needed a big box of those hefty clamps that market traders use to secure the covers on their stalls, which seem able to withstand all kinds of inclement weather.

    No problem! That's just what the Internet is for. OK, so finding a supplier required some frenetic application of various sets of search terms, but after a period of concentrated Binging we'd located a couple of suppliers. And having chosen the ones she wanted at a specialist market trader supplier's site, we flashed the plastic (including a not inconsiderable amount for next day delivery) and sat back to await arrival.

    And, lo and behold, the next day a big van pulled up and deposited the goods on our doorstep. Strangely, the name on the van (different, of course, from that on the website) seemed oddly familiar. The reason only became apparent, however, when some loud and entirely unladylike language began to emanate from the kitchen where my better half had just read the delivery note and discovered that the name of the supplier we purchased from is actually a trading name, not the real name of the company.

    Yes, you guessed it - the reason that the name on the van seemed familiar was that the company is located on a local industrial estate only about a mile and half away from us. My wife had peered down the wrong end of a telescope and paid nine pounds for the privilege of doorstep delivery from a company that she assumed was hundreds of miles away. And my mentioning that the site did have a "collect from warehouse" option as well as an "expensive next day delivery" option on the purchase page didn't really help...

    Yet you only have to visit a search engine, mapping web site, or one of those sites that tests your connection speed to discover it's possible to determine your location from just your IP address. And I guess it's even easier on a phone that has a location capability built in. So here's a suggestion for the IE development team: as well as protecting users by checking the validity of the site's certificate and displaying a nice padlock if it's OK, how about also popping up a dialog that says "It would be cheaper just to walk down the road and fetch it"...

  • Writing ... or Just Practicing?

    Getting Knitted


    So it's been an interesting couple of weeks. I've been enthralled by some ancient mechanical technology, discovered that I can no longer buy a very ordinary item of computing equipment, pondered on the business logic inside foreign ATM cash dispensers, and become very familiar with ladies stockings.

    OK, so maybe I should start by explaining the last of these to head off any rumors. Some friends of ours run a company that manufactures high quality fully fashioned nylon stockings for sale all over the world. It's a fairly specialist product and so volumes are small, and they only employ a few people. However, a recent minor disaster in their factory meant that they were way behind with dispatching orders. So they called in favors from friends, which is why we spent a weekend helping to pack stockings for a major customer of theirs in the US. It certainly made playing with computers seem a much more attractive career. Mind you, my code often morphs into equally complex tangled heaps; though thankfully it doesn't usually, like 15 dernier nylons, stubbornly adhere to the desk, the walls, my gloves and tee-shirt, and every other faintly static-charged surface.

    But what really fascinated me about their factory was the knitting machines. If, in the improbable case that you venture into the vaguarities of my blog on a regular basis, you'll know that I'm a devotee of historical mechanical engineering technologies. So being able to watch a 10 ton, 60 foot long machine concurrently knitting 30 stockings to some incredibly complex pattern without any input from computers (or, in fact, any source of control other than an experienced operator and a huge variety of cogs, chains, pulleys, and levers) was absolutely fascinating. More than 10,000 miniature needles moving in unison, some 100 reels of yarn steadily unwinding, dozens of shafts and cogs spinning, the delightful aroma of hot oil and ancient machinery, and more noise than a road repair gang at work. Amazing.

    If you want to see a picture of knitting machines similar to these, check out this page.

    So what has all this to do with our hi-tech industry? Well, how about this: I'm reasonably sure that the ATM machine I used while in Cyprus doesn't depend for its logic or programming on a series of cogs, levers, and chains. It's all some very clever computerized mechanism that is obviously more reliable and less prone to weird behavior than a 60-year old mechanical knitting machine. So why, when I wanted to withdraw some Eurothings in cash, did it execute the following process:

    1. Select a display language. Makes sense - I select English.
    2. Select an account. Again a sensible step, even though the only available option is "checking", which I select.
    3. Select an amount. The options are (strangely) 22.46, 67.39, 112.32, and 224.62. I actually wanted 100, so I select 112.32.
    4. Display an error message "The amount you have chosen cannot be dispensed". Well I'm not really surprised ... I've yet to see an ATM that gives out loose change. I press "OK".
    5. Display a message "Do you want to select a different amount?". I press "OK" again.
    6. Display a message "Enter the amount". I type 100 and press "OK" for the third time.
    7. The machine rumbles and groans for a few seconds (obviously there are some cogs, levers, and chains inside) and finally ejects five crisp new 20 Euronote things.

    I'm going to take an educated guess that it figured I was English from my language selection, assumed that all English people come from England, and that they all use real money (Pounds sterling). So it helpfully converted the usual nominal dispensing amounts from Pounds to Euros - even though it knows that it can dispense only 20 and 10 Euro notes. An interesting usability feature they probably paid some developer thousands of Pounds (or Euros) to implement within the software...

    And then, arriving home from our holiday, I discover that the 15" LCD monitor in my server cabinet has decided that displaying stuff (other than as a blurry mass of colors) is no longer part of its remit. So I pop over to the website of one of my regular suppliers to order a replacement. Have you tried to buy a 15" monitor lately? Probably not, but I can tell you that you needn't bother. They're even rarer than hen's teeth. None of the numerous sites I tried, including several of those annoying shopping comparison sites, could locate one. But nothing larger will fit inside my server cabinet unless I chuck out most of the servers first.

    And this is where I have to issue an apology to Amazon.co.uk. I've moaned in the past that they are damaging their brand visibility by allowing people who work from their spare bedroom to get equal prominence on the Amazon site, when I really only want to buy stuff from Amazon themselves. But now they do allow you to filter out merchant associates when showing products. And, better than that, one of their associates sold me a reconditioned 15" monitor at very reasonable price. Perhaps I should buy three so I have plenty of spares.

    Or maybe I could just ask our hosiery friends to knit me a picture of the Windows Server 2008 desktop...

  • Writing ... or Just Practicing?

    When Did the Web Get a Small "w"?


    Here in England, the well-known and much loved actress Emma Thompson recently started a debate about the use by kids of slang terms that only serve to make them sound stupid. She cites things such as "yeahbut", "like", "innit" (perhaps an abbreviated form of "I'm a nitwit"), and use of the word "well" in phrases such as "I'm well tipsy". Or even "I'm well ill". Somebody even wrote to the newspaper to say that, as his train was pulling into Sevenoaks station, one of a group of teenage girls sitting opposite asked "Is this like Sevenoaks station?" - to which he replied "Yes, though the amazing similarity is probably due to the fact that it IS Sevenoaks station..."

    But is does seem as though our vocabulary is changing at an increasing rate these days. At one time we had a "World Wide Web", and then we just had a "Web", and now - according to the latest version of the Microsoft Manual of Technical Style that all us technical writers have to abide by - we just have a "web". And they even make us miss out the spaces now, so we have a "website" rather than a "Web site". But I suppose it saves on paper and network bandwidth.

    And I guess it just mirrors the way that "the Internet" became "the 'Net", then just "the net". And "E-mail" morphed to "e-mail" and then to "email". It's happened in the past to things like "Biro" (invented by Ladislas Biro) and to "Hoover" (named after William H. Hoover, who started the company that perfected earlier designs). And then, once they get to be lower-cased and spaceless, we start creating our verb derivations - such as "emailing" and "hoovering". So how long will it be before we hear about people "webbing" and "netting". The fact that our wealth of newly-derived words often already have a proper meaning seems to be irrelevant these days.

    One wonderful line from some obscure poem I read ages ago, supposedly about the noises that emanate from an upstairs apartment, was "The moving hoover hooveth, and having hoov'd moves on".

    But what's interesting is if the real reason we had to get rid of "World Wide Web" was because it started with the wrong letters. Having to repeatedly say "doubleyew doubleyew doubleyew dot..." each time you read out a website URL was a pain. Though, thanks to George Dubya Bush, we can now generally get away with just "dub dub dub dot...". Though I always find that hearing it conjures up visions of a nursery rhyme.

    Perhaps if Tim Berners-Lee had started out by calling it the "Random Resources Repository", we'd still have a proper name for it. I mean, it would be easy to say "arrrrrrrgh dot...", and everyone would understand that the extended length of the arrrrrrrgh signified three of them. And I doubt that even our linguistic regulation people here at Microsoft would decide we had to call the stuff on servers "reposites". Plus, we could have arrrrrrrghlogs and arrrrrrrghmail and arrrrrrrghpplications (though that just sounds like somebody posh saying "application").

    But I suppose it would only encourage more pirate jokes (what did the doctor say to the pirate with a bad leg? "It looks like you've got arrrrrrrghthritis")...

  • Writing ... or Just Practicing?

    Invoking the Dark Side (using a cassette player)


    I previously thought that the reason you used to see miles of cassette taped entwined in the bushes at the side of motorways was because the driver discovered that his or her Mother had accidently put a "James Last Plays Christmas Carols" tape back in the driver's Black Sabbath or Pink Floyd cassette box. Needless to say, that kind of disaster when hurtling along the M1 could obviously engender a malicious and wholly illegal "chuck it out of the window" process. But it seems I was mistaken.

    According to the Surrey Advertiser newspaper (a local rag available in the southern part of England) nefarious devil worshippers are intentionally recording dark and dangerous spells on cassette tape and then diligently encircling sections of the Queen's Highway with it to initiate a huge crop of accidents and other unfortunate occurrences. In particular, at junction 9 of the M25 they have prompted a noticeable increase in the number of motoring accidents and suicides from people jumping off the footbridge. A group of believers from the Pioneer Engage Church even organized regular vigils and prayer meetings to "cleanse the benighted interchange".

    Now I'm fairly open to wild new theories and improbable suggestions. I mean, I even accept that information technology can create a paperless office. And that sat-navs actually do use satellites circling way above the earth rather than reading the location from barcodes in the white lines on the road. But I'm finding it hard to believe that the magnetic properties of cassette tape are sufficient to overcome the Earth's residual magnetism at a level sufficient to affect human behavior. Especially as we're repeatedly told that holding a powerful microwave transmitter right next to your ear is not the least bit dangerous.

    As an aside, I just watched a program by Stephen Hawking about how time works that said the clocks in the GPS satellites need to be manually adjusted as they gain a billionth of a second every day. This is, it seems, because the effects of gravity make time run slower close to the Earth than at the satellites' altitude. Supposedly, if they didn't do it, your sat-nav would be out by six miles every day. Maybe the reason I still get lost some days is because the guy who winds the knobs took a day off sick.

    So, anyway, the Surrey Advertiser soon received several disbelieving responses to its article, including one from a reader who (perhaps through intimate knowledge of the practice) pointed out that most evil spirits these days use MP3 players because they are far smaller and more convenient to carry when crossing into the dark realm and back again. More likely is that, when our intrepid band of believers analyzed the contents of the tape, they accidently played it backwards and by sheer luck hit upon the bit in Led Zeppelin's Stairway to Heaven that supposedly includes satanic phrases recorded in reverse.

    But maybe it's the reason that people hang old CDs on strings to scare birds away from their vegetable plots. It probably works best with heavy rock music ones. I suppose I could subject the theory to scientific test by burying a hard drive containing all the satanic album tracks I've collected over the last forty or so years under the hedge at the front of our garden, and counting the number of people who fall over as they pass by...

  • Writing ... or Just Practicing?

    Joie de VB-er


    Well I'd have to say I haven't had so much fun for ages. Playing with familiar stuff (and some less familiar stuff) has revived my joy of writing complicated algorithms and creating useful utilities. It's almost like being back in the old days of creating COM components for classic ASP web sites to do the things that VBScript couldn't do. I even got to write some more VBScript - and, yes, it was a politically correct circumstance 'cos I was executing it through Windows Script Host.

    Over the past few months I've been revisiting some old utilities I created - in some cases years ago - that would actually be useful again. For example, I now have a dual failover Internet connection (ADSL and cable) so if the ADSL fails, which it does fairly regularly, I don't get to know that the local village and parish web sites I host are offline until the condescending emails start to arrive.

    So I revived an old web site checking utility and updated it to VS 2008. By running it on an internal machine, and going out on the cable and back on ADSL, it gives me a proverbial nudge when the ADSL line is down. It just needed some fettling to resolve a few poor code practices applied at the time, a few extensions to make it do additional things, and a UI makeover to make it seem less amateur (though with my design skills, I probably only managed to make it contemporary with the late 20th century).

    However, prompted by this flush of success, I expanded the log file monitor that I threw together some time ago to try and fend off the DNS amplification attacks I was suffering at the time. Now it monitors DNS, WWW, and SMTP logs with a broad range of search options. It can also send email notifications and execute scripts or programs. I use this feature to execute the aforementioned VBScript script to automatically create and manage IP address blocking rules in Windows Firewall (WFWAS).

    Finally, I decided to tackle the problem of synchronizing specific sets of files between two machines. Yes, I know there are several ways you can do it in the O/S and with other utilities, but I wanted to be able to view and control the process in several specific ways. It comes about because I have a computer that contains the set of folders and files synchronized with Team Foundation Server (TFS), but I tend to work on other computers with individual subsets of these files. It's also made more complex by the fact that the files are read-only in TFS when not checked out, and the file date controls whether files are updated in TFS when you synchronize.

    The idea was to be able to see the two sets of files (local and TFS) with information about the date/time, archive status, relative path, read-only setting, and easily see which were newer than the equivalent in the other location. I also wanted to be able to copy, synchronize, merge, delete, and set the last-modified date with one click. The result saves me loads of time and effort, and probably helps to avoid errors when managing the files. OK, so I probably won't be subjecting the source to a proper code review, but there are only a few bits left in there that I'm embarrassed about.

    If you want a copy of any of these, you can download them here. I've even included the VS2008 source code so you can see what they are doing - as long as you promise not to show it to anyone (or laugh)...

    But I suppose the real reason for all this rambling scribble is that, during the process, I realized just how much fun basic task programming really is. It's like discovering the old home computers all over again, but much easier this time round. It really is amazing how .NET and the powerful framework classes save a ton of effort. I'm by no means a virtuoso programmer compared to most of my learned colleagues, but having things like complex conditional statements, capabilities such as generic lists, and features such as simple file and folder handling functions available really makes it easy to concentrate on the algorithmic logic rather than worrying about file modes and array indexes.

    And, because my history in languages pretty much follows the evolution of Pascal, Delphi, classic ASP, VB for Applications, and Visual Basic as far back as version 1.0, I'm still most comfortable using VB.NET. While almost everything I do in my p&p day-to-day work is C#, I still find VB easier to read and write, and I love the way it does all the magic indenting and formatting for me. And, of course, it runs just as fast as C# (as long as you write good code) so I now only feel like a one-and-a-halfth-class citizen in our wonderful world of technology, rather than the second-class citizen I was before the advent of .NET.

    What continues to amaze me, however, is how - after I agonize about every minor instruction I need to add to make the algorithms work, and every extra conditional statement they require to cope with the increasing complexity as I decide to add yet another configuration option or code tweak - they still seem to execute in the blink of an eye. I mean, you'd expect that parsing a web log file when the decision tree takes up a whole page in Visio would take a week to run. Or than reading two folder trees to build the lists of files and doing all kinds of comparisons before displaying them in two DataGridView controls would leave you time to make coffee, eat the remains of that cold pizza, and finish the crossword as well.

    But, with the memory and processing speed available on modern computers, everything just seems to fly. I'm expecting it to splutter and crawl like a caterpillar in custard, but instead it dances like a cat on a hot tin roof. Even my VBScript script that updates Windows Firewall runs so fast that the screen update can't keep up with it. I ran it three times wondering why it wasn't working, and only discovered it was when I looked at the log file...

    Maybe I'm picking up some good programming habits from the plethora of clever code I encounter every day in my proper job. Perhaps the constant exposure to design patterns, extensible code techniques, and the latest features of the framework are gradually permeating my aging brain. Or is it just that a quad-core Xeon box with 8 GB of memory can eat any code I throw at it without even blinking? Does replacing my complex sets of arrays with generic lists of custom classes, and my Ands with AndAlsos in the appropriate places, really have any discernable effect on execution time? Or am I just pandering to the typical programmers' paranoia of wasting any of those valuable execution cycles?

    But there is always that wonderful warm glow inside when, after pondering over recalcitrant algorithmic constructs for ages, it all works as though it was written by somebody who actually knows what they're doing. And, anyway, I have to stop writing now. I need to think up some more exciting new and totally unnecessary features to add...

  • Writing ... or Just Practicing?

    In At The Depend


    Which is the best way to prevent intrusion attacks on your server from the network? What is the largest size of application XAP file you can deploy to a Windows Phone 7 device? When should you cache the data used by your application in memory? How many magicians does it take to change a rabbit? Obviously the correct answers are "Unplug the network cable", "400 MB", "Always", and "None, it's just a trick".

    Or are they technically "correct"? Can you equate "best" with "basically, the server's not working any more"? Certainly it's the most positive and reliable way to protect your server, but it's somewhat lacking in practicality in terms of a non-broken network. And what about Windows Phone 7 users who rely solely on their phone supplier for connectivity? The maximum size of a XAP file you can download without using Wi-Fi or a USB cable is 20 MB. And, of course, caching a 3 GB collection of data transfer objects when your computer has only 2 GB of memory may not provide better performance...

    All this comes about because we decided to include the now highly fashionable "Check Your Understanding" section in all of the chapters of our new Windows Phone 7 Developer Guide. I can't say I'm a huge fan of these sections as they add to the effort of creating the guidance - though I do agree they are useful. I used the ones in our recent Parallel Programming with Microsoft .NET guide to figure out if I actually did understand any of the topics in each chapter. Mostly I patently didn't, but that's a different issue for which I can't blame the authors.

    So, anyway, having agreed to include them in our latest tome I had to figure out the appropriate style and content. I started by watching some TV programs that supplement their income by offering cash prizes for answering a simple question. Based on this, we'll be including a knowledge check such as:

    Which of the following is a well-known computer operating system?

    1. Portholes
    2. Skylights
    3. Windows
    4. Double glazing

    OK, maybe more research is required. So I check out the program for people who want to be millionaires. How about:

    What does the computing abbreviation "AMLCD" stand for?

    1. American Music Lovers Compact Disk
    2. Anti-static Mat for Laying Computers Down
    3. Active Matrix Liquid Crystal Display
    4. All Men Like Counting Ducks

    So, you see, it's not as easy as it might seem. And how many questions should there be? How difficult should I make the questions? Will they actually help people to understand the content of the chapters? Can I include one or two stupid answers to liven it up? Will all this asking questions about questions finally result in a stack overflow error?

    In the end we decided on six questions per chapter, multiple choice from four possible answers, and medium-level in terms of difficulty or obscurity. Such as:

    Which of the following programming techniques are permitted in a Windows Phone 7 application?

    1. The application can terminate if the phone does not have extended memory installed.
    2. The code can use PInvoke or COM interop to execute native code.
    3. The application can use code that is not type safe if this is absolutely necessary.
    4. The application can use reflection to discover and invoke types that require security permissions.

    The next step is to provide the answers. Annoyingly, I haven't found a way to display them upside down at the foot of page 97 using HTML - but that's the production department's problem, not mine. All I need to do is supply the text for the answer. And it's obvious that the answer to the previous question is "None of the above". Easy! And I've reinforced the reader's understanding by checking that they will remember these limitations when they start designing their Windows Phone 7 applications.

    But, unfortunately, the dreaded cyclic dependency factor now comes into play. One of the major things I learned from working on the Microsoft Application Architecture Guide guide a year or so ago was that, for any question you ask an architect, the answer will always be "it depends". And the same applies, it seems, to most other computing-related stuff.

    Looking back at the question above, you would have to agree that "a" is not permitted. The requirements for Windows Marketplace certification clearly state that your application must work on any device that meets the Windows Phone 7 specification, and extended memory is an optional feature of the phone. Except, elsewhere, it says that the maximum memory usage for a WP7 application is 90 MB unless the device has more than 256 MB of memory installed. But then it says that the application must run anyway, and only take advantage of extended memory when it is available. So, in a round-about way, it seems that "a" actually is not permitted.

    What about "b" and "c"? These are both definitely not permitted, so we're OK there. Except that I was told that OEMs developing Windows Phone 7 devices can use C++ and native (so technically unsafe) code. So if you were feeling picky, you could dispute that part of the answer we provide. But, in general, we're still OK I reckon.

    And so, finally, is "d" permitted or not? Well, it seems the issue is that the Marketplace submission process unpacks the XAP file you provide, scans the code to determine the security permissions it requires (for things like using the microphone, camera, location service, etc.), and then recreates the manifest file in the XAP so that it lists only those actually used by the application. This means that Marketplace can list the phone features the application uses with confidence that only these can be used in the code.

    But the Marketplace code scan does not find types that are discovered and instantiated using reflection. Therefore, if you use this approach to locate and instantiate a type that requires security permission, and the application manifest does not include that permission, your application will fail with a security permission error. However, if you have already referenced the type using the normal approach the manifest will contain the required permission, and so the app will run. Technically, the programming technique described in "d" is not "not permitted", but rather it's "discouraged" because it is likely to cause the application to fail in most cases.

    So, even though I wrote the question, I actually got the answer wrong. I told you this was harder than it looked...

Page 25 of 41 (323 items) «2324252627»