Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

William Kempf wkempf
  • Impressions of Windows 8

    , Jason818 wrote

    Wow. your a positive person. You come here often?

    Way too often, resurfacing every time he's banned.

  • Bill Gates sure that Google Glass will be successful

    , 00010101 wrote

    http://www.geekwire.com/2014/bill-gates-vs-glassholes-pending-patent-thwart-video-snooping/

    He's so sure he's started patenting third party add-ons. In this case a "anti" add-on.

    When Bill Gates starts feeling the FOG or fear of Google, I'd say MS in massive trouble in the forward compatibility department.

    appft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PG01&p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.html&r=1&f=G&l=50&s1=%2220140078164%22.PGNR.&OS=DN/20140078164&RS=DN/20140078164

    The question I am left asking is why?

    Why didn't they just partner with eyewear makers, and other wearable brands and do it themselves. Why do they have to lag behind on tablets, smart phones and every other manner of technology only to have to catch up later.

    It's like PC Junior over and over again, except they never repeated the initial success.

    The worst part of it is they have every resource in the world not to take that strategy.

    I know you're trolling but.

    1. Microsoft was first with tablets.

    2. Microsoft was first with smart phones.

    3. Microsoft was first with wearables.

    4. Microsoft is rumored to have been working on some sort of "glass" like device long before Google was.

    5. The article you link is full of hyperbole and connects dots that may not be connected. It's a stupid fluff piece.

  • Getting a property name as a string.

    Numerous times, but not really to my liking. Here's one blog post about it. http://blogs.msdn.com/b/ericlippert/archive/2009/05/21/in-foof-we-trust-a-dialogue.aspx?PageIndex=2

     

  • Getting a property name as a string.

    @boxtype: Like I said, old code. On the blog there's a ReflectOn<T> that I believe will allow you to do the same thing via ReflectOn<Test>.GetProperty(x => x.Name).Name.

    @GreyLensman's code does the same basic thing as the code on the blog, with different syntax. It all uses Expression to do "static reflection". In the end, you use no hard coded strings. There is a runtime cost, and a significant one. Not a big deal if you can cache the string for reuse, but simply using it in place of a hard coded string will often lead you to very poor performance and isn't a good idea.

    Roslyn is an interesting tool. However, unless you're willing to write non-standard code it's not a direct answer for what you want to do. It's unfortunate, but the language doesn't have any compile time Symbol concept, like Ruby has (http://www.ruby-doc.org/core-1.9.3/Symbol.html). People have been asking for this for some time, but the language designers are reluctant.

  • Getting a property name as a string.

    Ahh... sorry, the code on the blog is older than the code I use :).

    string nameProperty = Reflect.GetProperty((Test x) => x.Name).Name; // Returns "Name"

    That should do the trick, though I've not compiled the full code. The code I have now has a GetName that does basically that (though it uses GetMember instead of GetProperty, so that you can get the name of any property, field or method).

  • Win Phone 8.1 beef.

    , Dr Herbie wrote

    Have you checked the app settings in Battery Saver settings?  Is it possible that the allow run in background is switched off?   I haven't had a problem using the podcast app while driving.

     

    I wasn't aware there was a setting for that. I don't see any such thing under Battery Saver. Regardless, the phone was fully charged when this happened.

    , LaBar wrote

    My alarm didn't go off today... set for 7:00am and nothing. I did have volume at 0, but I use to have volume at 0 prior to the update and it would still always go off. I tested the alarm again when I got to work. Set it to 1 min from current time and it worked fine (phone not locked). Maybe since at 7am the phone was locked it's related to what wkempf was seeing. I'll check app settings as Dr Herbie suggests.

    The first day after updating I had the same problem. Today the alarm went off fine. This may indeed be related, or it may be two separate bugs.

    , MasterPi wrote

    There are quite a lot of glitches and bugs in this update... I think I'm able to get my phone to restart if I confuse it some way (like entering a pass code before the lock screen has slid up completely). I've been looking around and there's some suspicion that this update might not be RTM. There's also some thought that the phone's firmware needs an update.

    Yep. This is a developer preview. Although last time everything was "perfect", we shouldn't expect such previews to be without problems. So, I'm not an angry consumer talking here. I'm actually not angry, and I am a developer who understood the risks when I updated. These still are nasty bugs, though, that need to be brought to the attention of the developers, and since no real site exists for submitting such bugs... :)

  • Getting a property name as a string.

    Using Reflect from my blog page.

    string nameProperty = Reflect.GetName((Test x) => x.Name); // Returns "Name"

    IntelliSense gives you help when you type "x." in the above example.

  • Win Phone 8.1 beef.

    Just found a nasty bug. I was using the new Podcast app on my drive into work. Suddenly, audio stopped. I unlocked the phone to see what was going on and audio started back up. Figured I just hit a glitch in the audio file. But after a while, it happened again. And again, as soon as I unlocked the phone it started to play again. So, this time I paid attention, and sure enough, as soon as the phone went to sleep the audio stopped, and as soon as I unlocked the phone, it started again. Curious, I navigated to the start screen, and the audio stopped. Audio was no longer playing in the background. When I arrived at work I took the time to reboot the phone and test, and things are once again playing in the background. Don't know if it's an OS problem in general, or a problem with the new Podcast app, but that bug is nasty and needs to be found and fixed ASAP.

  • Getting a property name as a string.

    OK, we're both confused. In your example code, Test is not static. Nor is Test.Name. The code you posted won't even compile.

    Reflection, especially "static" reflection, is an advanced topic. The blog post I wrote and linked to in this thread does a fairly good job explaining static reflection, but maybe not at a newbie level. In the case of static reflection, static does not mean the same thing as the static keyword. Someone coined the term "static reflection", and it simply means that you interrogate the type system via compile time information, using Expression, rather than with runtime information, using Type. Both types of reflection use several querying constructs to interrogate metadata about types that's produced by the compiler. These queries are relatively expensive, which is why I recommended caching the results. If this is all a bit confusing, I might suggest sticking with the strings. It's simple, understandable, and efficient. The downsides, being easy to type wrong with no compile time checking and no refactoring support, are probably not that big a deal while your coming to grips with the more complex topics of C# programming.

  • Win Phone 8.1 beef.

    @spivonious: My phone is mounted near the review mirror. Since it's a Nokia device, a double tap wakes it and a single swipe unlocks it. With a decent interface from there it would be a swipe or two for anything necessary. All without the need to look at the phone, even. All in all, as safe as turning up the volume on the radio. I actually do this with audible today, but I have to "prime" the phone first before I start driving. I want the phone to do this for me when it enters driving mode.

    Voice control is nice, and in many cases will be even better than having to tap, tap, swipe, swipe. Of course, today you still have to reach out and activate voice. It might be smart for Cortana to enter an "always listening" state when in driving mode. Of course, some people would like always listening to be the behavior all the time, like on some Motorola Android phones. "Cortana, call my wife" without having to even take the phone out of my pocket or press any buttons on my Bluetooth radio when I'm connected. That would be nice.