The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

Reading bytes from a file in Metro

Last post 11-20-2012 4:05 AM by dhromed. 48 replies.
Page 1 of 1 (49 items)
Sort Posts: Previous Next
  • 11-11-2012 7:28 AM

    Reading bytes from a file in Metro

     So, I have this Javascript/HTML-Metro-app which stores its user data as an array of (byte-sized) numbers. Naturally, at some point the app will be suspended so I have to write the data to disc beforehand.

    That's actually easy, once you've got the hang of this Chain of Promises thingie.

     

    saveData: function () {

      var applicationData = Windows.Storage.ApplicationData.current;

      var localFolder = applicationData.localFolder;

      localFolder.createFileAsync("test.dat", Windows.Storage.CreationCollisionOption.replaceExisting)

        .then(function (dataFile) {

        var content = Data.DB.exportData();

    return Windows.Storage.FileIO.writeBytesAsync(dataFile, content);

     

         }).done(function () { });

    }

    However, importing the whole thing is a bit complicated because of the lacking documentation. You see, there is no FileIO.readBytesAsync() - there's readLinesAsync() and readTextasync, but no such thing for bytes.

    Thus we have to use a Stream.

     

    restoreData: function () {

    var applicationData = Windows.Storage.ApplicationData.current;

    var localFolder = applicationData.localFolder;

    localFolder.getFileAsync("test.dat")

    .then(function (dataFile) {

    return Windows.Storage.FileIO.readBufferAsync(dataFile);

    }).then(function (buffer) {

    var dataReader = Windows.Storage.Streams.DataReader.fromBuffer(buffer);

    var content = new Array();

    //for (var i = 0; i < buffer.length; i++) {

    // content.push(dataReader.readByte());

    //}

    dataReader.readBytes(content);

    dataReader.close();

    return content;

    }).done(function (data) {

    Data.DB = SQL.open(data);

    }, function () {

    Data.DB = SQL.open();

    Data.DB.exec("CREATE TABLE ...);");

    });

    }

    Now, you're probably seeing the commented code: That's the one which actually works. The dataReader.readBytes(content) method is a WTF for three reasons:

    a) the documentation states that the argument has to be an array of numbers - Javascript is weakly typed, though. Best I can do is to create an array.

    b) it works on the argument itself, instead (like EVERY OTHER METHOD IN THIS CLASS!) of returning the proper value.

    c) it doesn't actually work, or at least I haven't figured out what else to do with this method. The for-loop works and yields the proper array. The readBytes method yields an empty array. Gah. Might be able to replace the for-loop with a while one. Might have to look into the return values for readByte().

    And sorry for the lack of indentation, this editor is ... sub-optimal.

  • 11-11-2012 12:03 PM In reply to

    Re: Reading bytes from a file in Metro

    Try var content = new Array(buffer.length); It looks like whoever designed this API was copying the API from a C-like language.
  • 11-11-2012 12:17 PM In reply to

    • jnz
    • Not Ranked
    • Joined on 10-04-2007
    • Posts 41

    Re: Reading bytes from a file in Metro

    Rhywden:
    the documentation states that the argument has to be an array of numbers - Javascript is weakly typed, though. Best I can do is to create an array.

    JavaScript has typed arrays now.  It probably requires one of those as the parameter.  And the documentation says "For efficient data transfer in JavaScript, pass a Uint8Array for the value parameter."  So I'd try passing one of those instead of a plain Array.

  • 11-11-2012 1:23 PM In reply to

    Re: Reading bytes from a file in Metro

    Great, I'll try that. Thanks!
  • 11-11-2012 2:49 PM In reply to

    Re: Reading bytes from a file in Metro

    Okay, that did it, indeed.

    var content = new Uint8Array(buffer.length);

    And we're done. Nice. Now, why in the seven unholy hells were they not able to describe that little tidbit in their docs at a more prominent place?

  • 11-11-2012 4:04 PM In reply to

    Re: Reading bytes from a file in Metro

    I'm shocked that Microsofts JavaScript supports typed arrays!
  • 11-12-2012 7:57 AM In reply to

    Re: Reading bytes from a file in Metro

    Somewhat off topic: Somebody please tell me there's a non-Javascript option for creating Metro apps. Because, really, just reading this made me feel mildly ill and concerned for the future of software development. I never imagined I might have to activate my alternate career plans because the march of "technological progress" was headed inexorably down a road where Javascript is the end-all-be-all language for doing everything except running on bare metal.

  • 11-12-2012 9:15 AM In reply to

    Re: Reading bytes from a file in Metro

    Weng:

    Somewhat off topic: Somebody please tell me there's a non-Javascript option for creating Metro apps. Because, really, just reading this made me feel mildly ill and concerned for the future of software development. I never imagined I might have to activate my alternate career plans because the march of "technological progress" was headed inexorably down a road where Javascript is the end-all-be-all language for doing everything except running on bare metal.

    I was under the impression that you can use Visual Studio 2012 to developer Metro apps in any .NET language, although I will admit that I don't have VS2012 to test it. Maybe I should download it since I have an MSDN account through work...
  • 11-12-2012 9:17 AM In reply to

    Re: Reading bytes from a file in Metro

    Rhywden:
    b) it works on the argument itself, instead (like EVERY OTHER METHOD IN THIS CLASS!) of returning the proper value.
    This looks like a pretty typical pattern inherited from C programming regarding operating on buffers.  It's common in C to require a caller to allocate a buffer that a library fills because of the naunces of C memory management.  That looks like what this method does (but the MSDN documentation is almost blank, so I can't tell for sure).  I would guess that if you passed in an array of length 100, it would block until it filled the array.  If you pass in a zero length array, it will return immediately and do nothing.

  • 11-12-2012 9:29 AM In reply to

    Re: Reading bytes from a file in Metro

    Weng:

    Somewhat off topic: Somebody please tell me there's a non-Javascript option for creating Metro apps. Because, really, just reading this made me feel mildly ill and concerned for the future of software development. I never imagined I might have to activate my alternate career plans because the march of "technological progress" was headed inexorably down a road where Javascript is the end-all-be-all language for doing everything except running on bare metal.

    I'm pretty sure that C# is an option, and possibly C++ as well.

    Granted Javascript is becoming the end-all-be-all.


    Information technology not available until further notice. The political trolls won. Wake me up when the discussion is more interesting then YouTube comments.

  • 11-12-2012 10:05 AM In reply to

    Re: Reading bytes from a file in Metro

    MiffTheFox:
    Granted Javascript is becoming the end-all-be-all.
    After trying out Ruby, I like JS even more than I did before.
      <-  I couldn't make my shit work, so here's a Godzilla head.
  • 11-12-2012 12:20 PM In reply to

    • ender
    • Top 50 Contributor
    • Joined on 04-27-2006
    • Sunny side of the Alps
    • Posts 1,445

    Re: Reading bytes from a file in Metro

    powerlord:
    I was under the impression that you can use Visual Studio 2012 to developer Metro apps in any .NET language, although I will admit that I don't have VS2012 to test it.
    You're not limited to .net either - C++ (the non-managed one) works as well.
    Because 10 billion years' time is so fragile, so ephemeral... it arouses such a bittersweet, almost heartbreaking fondness.
  • 11-13-2012 2:27 AM In reply to

    • Bulb
    • Top 500 Contributor
    • Joined on 07-29-2008
    • Prague, Czech Republic
    • Posts 220

    Re: Reading bytes from a file in Metro

    Weng:

    Somewhat off topic: Somebody please tell me there's a non-Javascript option for creating Metro apps. Because, really, just reading this made me feel mildly ill and concerned for the future of software development. I never imagined I might have to activate my alternate career plans because the march of "technological progress" was headed inexorably down a road where Javascript is the end-all-be-all language for doing everything except running on bare metal.

    Metro apps are created using "Windows Runtime", WinRT. That is a COM-based technology (happy now?) that can be used from C++ using new incarnation of ATL or using a special language extension, C++/CX, from any .NET language and from HTML/Javascript (I suspect it's running on .NET too but I am not sure).

    Desktop Windows 8 can still run old Win32 applications, but the Mobile/Tablet version only runs Metro/WinRT ones.

  • 11-13-2012 6:33 AM In reply to

    • ender
    • Top 50 Contributor
    • Joined on 04-27-2006
    • Sunny side of the Alps
    • Posts 1,445

    Re: Reading bytes from a file in Metro

    Bulb:
    Desktop Windows 8 can still run old Win32 applications, but the Mobile/Tablet version only runs Metro/WinRT ones.
    Actually, x86/x64 Windows 8 tablets run desktop applications just fine - just the ARM version (which is called Windows RT) is limited to Metro.
    Because 10 billion years' time is so fragile, so ephemeral... it arouses such a bittersweet, almost heartbreaking fondness.
  • 11-13-2012 12:53 PM In reply to

    Re: Reading bytes from a file in Metro

    ender:
    just the ARM version (which is called Windows RT) is limited to Metro.
    IIRC, Windows RT can only run Metro apps (it obviously can't run older desktop apps, with it being ARM and all), but it still has the desktop mode, which only lets you run built-in applications such as Explorer, MS Office, Paint and notepad.

    And then there's of course Windows Phone 8, which I believe is a completely different product designed to look like the other two.

  • 11-13-2012 8:25 PM In reply to

    Re: Reading bytes from a file in Metro

    spamcourt:
    but it still has the desktop mode, which only lets you run built-in applications such as Explorer, MS Office, Paint and notepad.
     

    The most usefull desktop environment ever! Does it include Calculator and Freecell?

    spamcourt:
    And then there's of course Windows Phone 8, which I believe is a completely different product

    I've heard about it, but I always assumed they were talking about WinRT 8 (don't confuse with Win 8 RT - I still didn't hear about RT8 Win or 8 WinRT, but they must not be far). Now that you say WP8 is indeed a different thing, please elucidate: Does it run any Metro apps? (I'm pretty sure it isn't called Metro anymore.) Windows Phone apps? And what about Windows applications?

     

  • 11-13-2012 9:11 PM In reply to

    • dtech
    • Top 50 Contributor
    • Joined on 11-13-2007
    • Dutchland
    • Posts 877

    Re: Reading bytes from a file in Metro

    Afaik windows Phone 8 is actually pretty similar to Windows 8, in the sense that it runs on the same kernel and uses a subset of the "standard" API's (WinRT) plus a few phone-specific extentions.
    It's almost the same as the iOS <> Mac OS X comparison, they've got a lot in common. (I don't know about android, but I think it only the kernel is shared with normal linux distributions)
  • 11-13-2012 11:35 PM In reply to

    Re: Reading bytes from a file in Metro

     

    spamcourt:
    ender:
    just the ARM version (which is called Windows RT) is limited to Metro.
    IIRC, Windows RT can only run Metro apps (it obviously can't run older desktop apps, with it being ARM and all), but it still has the desktop mode, which only lets you run built-in applications such as Explorer, MS Office, Paint and notepad.

    There are two releases for MS Surface. On the outside they will look identicle, as will their UI. But the one released now (ARM, Windows RT OS) is not the same as the Surface Pro, ETA Jan 2013 (Intel i5, Windows 8). The pro will be able to run any app that Windows 8 supports, including any desktop app (.exe's). The Surface that is out currently will only run native apps from the Windows store.

    That obviously doesn't include third party windows tablets, which I bet there will be plenty of both.

    spamcourt:
    And then there's of course Windows Phone 8, which I believe is a completely different product designed to look like the other two.

    Minor nitpick here: Windows 8 is imitating Windows Phone 7 turned 7.5... The reviews for the interface were excellent, and most of the features in windows 8 (People hub, live tiles) were release back in 2010 on Windows Phone 7. It's truly a wonderful way to get information on a phone platform. I haven't seen it on a tablet, and haven't used Windows 8 enough to see it's effect on a PC.


  • 11-14-2012 2:57 AM In reply to

    • Bulb
    • Top 500 Contributor
    • Joined on 07-29-2008
    • Prague, Czech Republic
    • Posts 220

    Re: Reading bytes from a file in Metro

    spamcourt:
    And then there's of course Windows Phone 8, which I believe is a completely different product designed to look like the other two.
    From all I know Windows Phone 8 is completely the same Windows RT for ARM. They are however somewhat different product from Windows Phone 7, which was completely different product from Windows Mobile 6.5 and was utterly useless because it didn't have many applications as the WM6 ones didn't work there.
    spamcourt:
    IIRC, Windows RT can only run Metro apps (it obviously can't run older desktop apps, with it being ARM and all), but it still has the desktop mode[…]
    Hm, probably depends on which variant (phone, tablet, "surface"). In any case app store will only have metro apps and I am not sure it will be possible to install manually on phones and tablets.
  • 11-14-2012 4:52 AM In reply to

    Re: Reading bytes from a file in Metro

    Weng:

    Somewhat off topic: Somebody please tell me there's a non-Javascript option for creating Metro apps. Because, really, just reading this made me feel mildly ill and concerned for the future of software development. I never imagined I might have to activate my alternate career plans because the march of "technological progress" was headed inexorably down a road where Javascript is the end-all-be-all language for doing everything except running on bare metal.

    Don't be a fool. Dynamic languages are a good thing and Javascript is actually one of the better ones. Like any language, it has its warts. But those warts are decidedly few considering that it was conceived in two weeks. Prototypes, closures, anonymous objects, etc. They're all things that any OOP developer should not only understand, but respect. They offer some very different ways of thinking of the rigid class/object implementation. LINQ being something directly influenced by them.

    If all you do is operate in a single programming language, you're not a "specialist", you're an easily antiquated pigeon roosting in its hole. Don't believe me? Think about all those C/C++ developers you like to laugh at from your Visual Studio workstations. And yes, you can create Metro apps in C# or any other managed language, so relax and bask in your own ignorance.

  • 11-14-2012 5:56 AM In reply to

    Re: Reading bytes from a file in Metro

    Soviut:
    Weng:

    Somewhat off topic: Somebody please tell me there's a non-Javascript option for creating Metro apps. Because, really, just reading this made me feel mildly ill and concerned for the future of software development. I never imagined I might have to activate my alternate career plans because the march of "technological progress" was headed inexorably down a road where Javascript is the end-all-be-all language for doing everything except running on bare metal.

    Don't be a fool. Dynamic languages are a good thing and Javascript is actually one of the better ones. Like any language, it has its warts. But those warts are decidedly few considering that it was conceived in two weeks. Prototypes, closures, anonymous objects, etc. They're all things that any OOP developer should not only understand, but respect. They offer some very different ways of thinking of the rigid class/object implementation. LINQ being something directly influenced by them.

    If all you do is operate in a single programming language, you're not a "specialist", you're an easily antiquated pigeon roosting in its hole. Don't believe me? Think about all those C/C++ developers you like to laugh at from your Visual Studio workstations. And yes, you can create Metro apps in C# or any other managed language, so relax and bask in your own ignorance.

    To be fair 90% of what's wrong with JavaScript is because it doesn't have a very decent standard library, DOM and Node.js being the two big ones (DOM dwarfing Node.js in terms of ubiquity and fail).

    My main irritation with JavaScript is that it's very lenient about errors (Reading an undefined value? No problem! I trust you not to make typos.) and that for a functional language, it takes a lot of characters to define a lambda.

    JS + WinRT looks pretty nice because it seems to have done the impossible: procedural JavaScript! I've never actually seen any WinRT JavaScript before outside this thread so I don't know what I'm getting myself into.

    That said, different languages are for different purposes and different coding styles. Sadly, JavaScript, alongside HTML, is being forced into purposes it has to place being. Did you know that HD-DVD menus were written in HTML!?

    HTML doesn't belong anywhere except document markup.


    Information technology not available until further notice. The political trolls won. Wake me up when the discussion is more interesting then YouTube comments.

  • 11-14-2012 7:55 AM In reply to

    Re: Reading bytes from a file in Metro

    Adanine:
    Minor nitpick here: Windows 8 is imitating Windows Phone 7 turned 7.5... The reviews for the interface were excellent, and most of the features in windows 8 (People hub, live tiles) were release back in 2010 on Windows Phone 7. It's truly a wonderful way to get information on a phone platform. I haven't seen it on a tablet, and haven't used Windows 8 enough to see it's effect on a PC.
    It's a nice feature on a tablet where most of the time you are interacting with the new start screen and Metro applications. But it's useless on a regular PC where you are mostly working in desktop mode so you never actually see the start screen. At least my desktop is organized in such a way that I don't need the start screen and I installed a 3rd party app that gives me the functionality of the "search" box directly on the desktop.

    It's... Monkey Piston's Frying Circle!
  • 11-14-2012 12:25 PM In reply to

    • ender
    • Top 50 Contributor
    • Joined on 04-27-2006
    • Sunny side of the Alps
    • Posts 1,445

    Re: Reading bytes from a file in Metro

    Bulb:
    Hm, probably depends on which variant (phone, tablet, "surface"). In any case app store will only have metro apps and I am not sure it will be possible to install manually on phones and tablets.
    Windows RT is what used to be called WOA (Windows on ARM) during development, and it strictly limits 3rd party applications to whatever-they-renamed-Metro-to. You won't be able to buy Windows RT in retail - only preinstalled on a device. Microsoft apparently aims for maximum confusion, because while Windows RT is an edition of Windows 8, WinRT is the runtime used by Metro^H^H^H^H^HModernUI^H^H^H^H^H^H^H^HWindows Store Apps, and WinRT is available in all Windows 8 and Server 2012 editions. Also, the x64-based tablets will run normal Windows 8 - not Windows RT.
    Because 10 billion years' time is so fragile, so ephemeral... it arouses such a bittersweet, almost heartbreaking fondness.
  • 11-14-2012 1:39 PM In reply to

    Re: Reading bytes from a file in Metro

    Windows "Metro" interface -- now called Windows Store apps -- have essentially three APIs, at least, the way Microsoft describes them:

    • COM / C++ -- Write it in C.  You also have DirectX available to you here, from what I understand (not my expert area)
    • Javascript / HTML -- makes it easy for onobarding or porting your HTML 5 app to a native app.
    • XAML / .NET -- Use any .NET language and this XAML varient to create your app.  I am just getting my feet wet with this one.  This makes the 4th XAML UI flavor - WPF / Silverlight / Silverlight for Phone / Metro.   I guess this is no different than all the different flavors of the framework now, and some APIs being supported on some platofrms and not others.

    They also have Visual Studio Express for Winows 8 that is free, but you have to be running Windows 8 to install.  Also, you can pick up your free copy of TFS Express for your source control and work item tracking, etc.

  • 11-14-2012 8:28 PM In reply to

    Re: Reading bytes from a file in Metro

    bjolling:

    Adanine:
    Minor nitpick here: Windows 8 is imitating Windows Phone 7 turned 7.5... The reviews for the interface were excellent, and most of the features in windows 8 (People hub, live tiles) were release back in 2010 on Windows Phone 7. It's truly a wonderful way to get information on a phone platform. I haven't seen it on a tablet, and haven't used Windows 8 enough to see it's effect on a PC.
    It's a nice feature on a tablet where most of the time you are interacting with the new start screen and Metro applications. But it's useless on a regular PC where you are mostly working in desktop mode so you never actually see the start screen. At least my desktop is organized in such a way that I don't need the start screen and I installed a 3rd party app that gives me the functionality of the "search" box directly on the desktop.

    I have Windows 8 without any mods installed, mainly to test to see if Microsoft's way truly works.

    At first I was having issues with muscle memory. I'd get lost because my first point of call had disappeared. It sucked :(.

    But after revising my desktop layout, pinned taskbar items, and Metro Live Tiles, I'm slightly more effecient then I was before. Barely. And that wasn't because of the metro live tiles or any windows 8 features, only because I sorted desktop icons.

    I didn't know the start screen (Metro UI) allows a keyboard to type into an invisable search prompt (Which pops up when you start typing a phrase). That search is functionally the same as the old search bar in windows 7.

    For me, the UI changes for Windows 8 haven't restricted me. Now it's just as easy to open something as it was in Windows 7, if not one click easier, since my major programs are pinned to the Metro UI. I wouldn't blame anyone for wanting the start bar back, but I kind of have to agree that it's now an ineffecient way of doing things. If nothing else, it reinforces a messy working place, where you don't -have- to maintain desktop icons and pins.

    All that said, I have been more updated with news headlines because of the "News" tile (Not actually clicking it, just glancing at it), then I have been in the past (Read: Not at all). Maybe there's some benefit in Metro/Modern for Desktop PCs? I doubt many people would agree, though. But atleast try to give it a chance. Restore the start menu if you want, but atleast try to use the Metro UI, before you write it off. If nothing else, it doesn't get in the way.

    There are major teething problems with going from Win7 to Win8 though. It's like the move everyone had to make from Office 2003 to 2007. It was more familiar and easier to stick to 2003, then to move to 2007. But after I did, it was easier to use in general.

     

  • 11-15-2012 12:31 AM In reply to

    Re: Reading bytes from a file in Metro

    Soviut:
    Don't be a fool. Dynamic languages are a good thing and Javascript is actually one of the better ones. Like any language, it has its warts. But those warts are decidedly few considering that it was conceived in two weeks. Prototypes, closures, anonymous objects, etc. They're all things that any OOP developer should not only understand, but respect. They offer some very different ways of thinking of the rigid class/object implementation. LINQ being something directly influenced by them.
    Yes. Javascript has some excellent ideas, but the execution of those ideas is borderline terrifying. And the lack of a standard library that isn't made of absolute fuck. And the fact that it's almost permanently married to HTML (which is an even bigger clustergrope) in the minds of the sorts of idiots that make architectural decisions these days. Bottom line, I don't like Javascript. I don't give a flying fuck what it's inspired, and I don't care to ever have to work with it every day. I don't do UI. I'm crap at it and don't like it.  Nobody has even come remotely close to convincing me that there's a good reason to run Javascript anywhere but on the client to do UI things. Fortunately, there's plenty of shit for computers to do on the actual thinky-stuff side, so while armies of "developers" fiddle around with HTML and Javascript to draw pretty pictures for people to touch on their fondleslabs, I'm quite happy to go write the things that those guys call out to when they decide they actually need something of substance to draw pictures of.

    Soviut:
    If all you do is operate in a single programming language, you're not a "specialist", you're an easily antiquated pigeon roosting in its hole.
    Who told you I operate in a single programming language? I PREFER a single language - C# - because it strikes me personally as the right balance between verbosity, performance, portability, language features and library features (that is good enough; good enough; mediocre; good enough; excellent) but the only experiences I refuse to repeat are COBOL and ABAP. Hell, I'm one of the world's leading experts in a completely bizarre, proprietary, interpreted, XML-based procedural language. Let that sink in for a minute.

     

    Soviut:
    Think about all those C/C++ developers you like to laugh at
    I think you mean COBOL developers. I don't think I actually know any C/C++ developers.

    Soviut:
    from your Visual Studio workstations.
    In the past six months, I've used Visual Studio as an IDE precisely five times. The rest of the time, it's a really nice XML editor.

    Soviut:
    And yes, you can create Metro apps in C# or any other managed language, so relax and bask in your own ignorance.
    k. I'll go back to not having time to give a flying fuck at a rolling donut with regards to the trials and tribulations of "App" development. After all, I have one-off homegrown production hardware to integrate with stonking huge towers of legacy COBOL running on IBM z-series big iron, sprawling FORTRAN monstrosities running on whatever IBM calls those things that replaced the AS/400, clever-perl-hacks-cum-business-critical-glue, homegrown proprietary development languages, squllions of dollars worth of third party software, libraries and APIs, all to produce stuff that I can prettymuch everyone has handled at least once today, and you probably have some of it within a few feet of you.

    I do real work. I do hard work. I do things that nobody outside my team does anywhere on the planet. I've had vendors tell me "Nobody has ever done anything remotely like that with our product before, and I'm not certain it's even possible" and salesgoons tell me "But I sold it! You have to make it! By the way, I know you said processing time would be six hours, but they wanted a thirty minute SLA. I negotiated them down to 45 minutes." I have shanghaied inexpensive SMB products into resilient, business-critical enterprise-grade solutions because some ignorant bastard decided I didn't really need the right tools. I have done the "impossible" more times than I care to recall. I can calculate exactly how much revenue my software has enabled in the past year. That number is big enough that, were it a country's GDP, it wouldn't be the smallest one.

    And on the whole, I get less respect from the software development community at large than some guy who developed Yet Another Twatter Widget because I don't have time to learn Ruby, and I give absolutely zero shits about Javascript, and I certainly don't do ANYTHING involving "Big Data" or "Social Networking" or "Metrics" (aside from the fact that I preside over a cache of personal data that certain companies involved in Big Data, Social Networking and Metrics would literally kill for). It seems that ever since the general public "got" tech, all the glory has gone to the programmers who work on the bits that the general public "got". Slick UIs, various flavor-of-the-month junk, etc. Nobody seems to give a damn about those of us who build infrastructure and facilitate the whole of civilized modern society. 

     And if I quit my job tomorrow, I'd have a new one doing much the same thing within two days. Guaranteed. Infrastructure never dies, and is a skillset completely divorced from the world of front end computing. If Javascript ever makes serious infrastructure inroads, I *WILL* leave the industry and become a trucker or something.

     

    tldr; I just worked 12 hours of overtime and felt like having a rant about ignorant UI-centric pricks who wouldn't last through basic training in my group.

  • 11-15-2012 3:01 AM In reply to

    • ender
    • Top 50 Contributor
    • Joined on 04-27-2006
    • Sunny side of the Alps
    • Posts 1,445

    Re: Reading bytes from a file in Metro

    Adanine:
    That search is functionally the same as the old search bar in windows 7.
    It isn't - instead of displaying all results on the same page, it has separate pages for Programs, Settings and Files, and it makes it cumbersome to switch between those pages with keyboard.
    Because 10 billion years' time is so fragile, so ephemeral... it arouses such a bittersweet, almost heartbreaking fondness.
  • 11-15-2012 5:15 AM In reply to

    Re: Reading bytes from a file in Metro

    Weng:
    It seems that ever since the general public "got" tech, all the glory has gone to the programmers who work on the bits that the general public "got". Slick UIs, various flavor-of-the-month junk, etc. Nobody seems to give a damn about those of us who build infrastructure and facilitate the whole of civilized modern society.
    A lot of the stuff that goes on around here reminds me of Dirty Jobs. People doing the required job of cleaning up after the metaphorical shit and keeping stuff running. But aside from maybe the bathrooms converted to server rooms, I don't think many of the posts would work for the show.
    I denounce myself for this post
  • 11-15-2012 6:53 AM In reply to

    Re: Reading bytes from a file in Metro

    ender:
    Adanine:
    That search is functionally the same as the old search bar in windows 7.
    It isn't - instead of displaying all results on the same page, it has separate pages for Programs, Settings and Files, and it makes it cumbersome to switch between those pages with keyboard.
    Oh, didn't think of it that way.

    It's still possible to switch between the catagories using only the keyboard, but it involves using the arrow keys and enter. Although you would use those normally... Still, it's slightly worse in that respect, I admit.

  • 11-15-2012 9:59 PM In reply to

    Re: Reading bytes from a file in Metro

    Weng:
    [well constructed rant] ... If Javascript ever makes serious infrastructure inroads, I *WILL* leave the industry and become a trucker or something.

    I take it you don't see node.js as serious... yet.

  • 11-15-2012 11:46 PM In reply to

    Re: Reading bytes from a file in Metro

    flabdablet:
    Weng:
    [well constructed rant] ... If Javascript ever makes serious infrastructure inroads, I *WILL* leave the industry and become a trucker or something.

    I take it you don't see node.js as serious... yet.

    Do you consider it... infrastructure?
  • 11-16-2012 12:56 AM In reply to

    • Zemm
    • Top 50 Contributor
    • Joined on 11-25-2007
    • Gold Coast, Australia
    • Posts 1,380

    Re: Reading bytes from a file in Metro

    boomzilla:
    A lot of the stuff that goes on around here reminds me of Dirty Jobs.
     

    Mike Rowe (isn't) soft!

     

    Filed Under: Can you think of something that talks, other than a person?
  • 11-16-2012 3:46 AM In reply to

    Re: Reading bytes from a file in Metro

     I am prejudiced against nodejs.


    In complex analysis, a meromorphic function on an open subset D of the complex plane is a function that is holomorphic on all D except a set of isolated points

    Filed under: ,
  • 11-16-2012 7:54 AM In reply to

    Re: Reading bytes from a file in Metro

    flabdablet:
    Weng:
    [well constructed rant] ... If Javascript ever makes serious infrastructure inroads, I *WILL* leave the industry and become a trucker or something.

    I take it you don't see node.js as serious... yet.

    Fact: I don't take anything as serious until I've met somebody that does it, and preferably worked somewhere their team is visible to me. If there's one thing programmers are universally good at, it's overstating their own importance.

     

  • 11-16-2012 10:58 AM In reply to

    Re: Reading bytes from a file in Metro

    Sutherlands:
    flabdablet:
    I take it you don't see node.js as serious... yet.
    Do you consider it... infrastructure?

    That does seem to be where it's attempting to position itself.

    I'm just glad we still have old-skool non-self-importance-overstating programmers like Weng to pour boiling oil on it from the ramparts.

  • 11-16-2012 10:16 PM In reply to

    Re: Reading bytes from a file in Metro

    flabdablet:
    I'm just glad we still have old-skool non-self-importance-overstating programmers like Weng to pour boiling oil on it from the ramparts.
    Did you miss what I said about programmers being really good at overstating how important we are? I do, in fact, have a tinge of self-awareness somewhere in here underneath the drunkenness.

    But yes, pouring boiling oil on it from the ramparts I am in fact. Really I don't care if it's good or not, it's Javascript and it needs to die for its sins.

     

    And since I'm drunk, I'm going to take apart the first example on the node.js website. It won't make sense because I lovebeer.

    var http = require('http');
    .... What? That's meta.
    http.createServer(function (req, res) {
    Okay. Gotcha.
      res.writeHead(200, {'Content-Type': 'text/plain'});
    So wait. Let me see if I'm tracking right here. there's a whole HTTP implementation in the fucking STANDARD LIBRARY? When did we get so hung up on HTTP that sentence started being plausible? HTTP is a fucking awful standard.
      res.end('Hello World\n');
    Hi!
    }).listen(1337, '127.0.0.1');
    Okay. you've got to be fucking kidding me. 1337? Really? REALLY? REALLY? What are we, twelve? And why the fucknuggets is the port number before the listen address? Let me guess, it's because some chucklefuck decided they wanted a default "LISTEN ON ALL!" function and therefore port comes first because they're a bunch of smegheads and Javascript makes it too difficult to reorder parameters in overloads, no matter how much sense it makes.
    console.log('Server running at http://127.0.0.1:1337/');
    LOOK AT MEEEEEEEE I HAVE CONSOLE OUTPUT JUST LIKE A REAL ENVIRONMENT!

     
  • 11-17-2012 12:43 AM In reply to

    • Ben L.
    • Top 10 Contributor
    • Joined on 12-21-2010
    • Inventor of the 186-hour work week
    • Posts 3,607

    Re: Reading bytes from a file in Metro

    Weng:
    there's a whole HTTP implementation in the fucking STANDARD LIBRARY? When did we get so hung up on HTTP that sentence started being plausible?
    Are you telling me you'd rather have eight billion HTTP implementations that don't work instead of one that does?

    I don't know about you, but I prefer having a standard library with actual useful things in it.

    Weng:
    console.log('Server running at http://127.0.0.1:1337/');
    LOOK AT MEEEEEEEE I HAVE CONSOLE OUTPUT JUST LIKE A REAL ENVIRONMENT!
    I suppose you'd be surprised to find out most browsers are also REAL ENVIRONEMNT!s.
  • Morbs is the smartest!
  • 11-17-2012 1:18 AM In reply to

    Re: Reading bytes from a file in Metro

    Weng:
    So wait. Let me see if I'm tracking right here. there's a whole HTTP implementation in the fucking STANDARD LIBRARY? When did we get so hung up on HTTP that sentence started being plausible? HTTP is a fucking awful standard.
    But it's not the worst thing.
  • 11-17-2012 2:53 AM In reply to

    Re: Reading bytes from a file in Metro

    flabdablet:
    Weng:
    So wait. Let me see if I'm tracking right here. there's a whole HTTP implementation in the fucking STANDARD LIBRARY? When did we get so hung up on HTTP that sentence started being plausible? HTTP is a fucking awful standard.
    But it's not the worst thing.
    Anybody who bitches about JavaScript is actually bitching about DOM, and too stupid to be able to tell the difference between the two. #truefacts
      <-  I couldn't make my shit work, so here's a Godzilla head.
  • 11-17-2012 9:25 AM In reply to

    Re: Reading bytes from a file in Metro

    Weng:
      res.writeHead(200, {'Content-Type': 'text/plain'});
    So wait. Let me see if I'm tracking right here. there's a whole HTTP implementation in the fucking STANDARD LIBRARY? When did we get so hung up on HTTP that sentence started being plausible?

    (I'm leaving out ASP from this discussion because I have no idea how it works behind the scenes.

    You see, Node.JS is designed to be a web language. Most modern web languages, PHP, Ruby on Rails, Python+Django, etc., run as their own daemon and talk to a web server such as Apache, Nginx, IIS, Lighttpd, etc., via a protocol called FastCGI.

    Node.JS on the other hand, is designed to be a web server. This of course only serves as a way to befuddle admins who are used to the traditional server/application divide, to remove any benefits that would come from different servers (Apache's extensibility, Nginx's prefornace, etc.), to the possibility of unfixable security holes because the web server is unupgradable independent from the runtime (in the not-exactly-rare chance that the application refuses to run on a newer runtime), and to make it impossible to serve static content, hindering performance.


    Information technology not available until further notice. The political trolls won. Wake me up when the discussion is more interesting then YouTube comments.

  • 11-17-2012 9:27 AM In reply to

    Re: Reading bytes from a file in Metro

    blakeyrat:
    Anybody who bitches about JavaScript is actually bitching about DOM, and too stupid to be able to tell the difference between the two. #truefacts
    Or maybe they don't really care. Like anybody who gushed about HTML5 and is actually gushing about CSS3, and even then is only gushing about Google and Mozilla's proprietary implementions of CSS3.

    Information technology not available until further notice. The political trolls won. Wake me up when the discussion is more interesting then YouTube comments.

  • 11-17-2012 6:36 PM In reply to

    Re: Reading bytes from a file in Metro

    blakeyrat:
    Anybody who bitches about JavaScript is actually bitching about DOM, and too stupid to be able to tell the difference between the two. #truefacts
    I hate how DOM inserts implicit semicolons and also how it requires me to call hasOwnProperty when doing a for[each].
    Signatures are stupid.
  • 11-18-2012 4:54 AM In reply to

    Re: Reading bytes from a file in Metro

    MiffTheFox:

    You see, Node.JS is designed to be a web language.

    Node.JS on the other hand, is designed to be a web server.

     

    Is it a language to develop applications in a web server, or it is a web server itself?

    /confused.

     

  • 11-18-2012 5:33 AM In reply to

    • ender
    • Top 50 Contributor
    • Joined on 04-27-2006
    • Sunny side of the Alps
    • Posts 1,445

    Re: Reading bytes from a file in Metro

    Cassidy:
    Is it a language to develop applications in a web server, or it is a web server itself?
    It's a web server with built-in JavaScript engine.
    Because 10 billion years' time is so fragile, so ephemeral... it arouses such a bittersweet, almost heartbreaking fondness.
  • 11-18-2012 9:07 AM In reply to

    Re: Reading bytes from a file in Metro

    Cassidy:

    MiffTheFox:

    You see, Node.JS is designed to be a web language.

    Node.JS on the other hand, is designed to be a web server.

     

    Is it a language to develop applications in a web server, or it is a web server itself?

    /confused.

     

    It's a web language that's also a web server. No other language I know of works like this (at least in production).


    Information technology not available until further notice. The political trolls won. Wake me up when the discussion is more interesting then YouTube comments.

  • 11-18-2012 2:39 PM In reply to

    Re: Reading bytes from a file in Metro

    Cassidy:
    Is it a language to develop applications in a web server, or it is a web server itself?

    /confused.

    Is Java a programming language or a virtual machine to run code from various programming languages? Oh it's both?

    You might be confused, but this naming isn't exactly new. Sun was confusing the fuck out of people back in 1995.

      <-  I couldn't make my shit work, so here's a Godzilla head.
  • 11-18-2012 9:00 PM In reply to

    Re: Reading bytes from a file in Metro

  • 11-19-2012 6:43 PM In reply to

    • Ben L.
    • Top 10 Contributor
    • Joined on 12-21-2010
    • Inventor of the 186-hour work week
    • Posts 3,607

    Re: Reading bytes from a file in Metro

    blakeyrat:
    Cassidy:
    Is it a language to develop applications in a web server, or it is a web server itself?

    /confused.

    Is Java a programming language or a virtual machine to run code from various programming languages? Oh it's both?

    You might be confused, but this naming isn't exactly new. Sun was confusing the fuck out of people back in 1995.

    Java is a programming language. The virtual machine is JVM. See that VM part? That means virtual machine.
  • Morbs is the smartest!
  • 11-20-2012 4:05 AM In reply to

    Re: Reading bytes from a file in Metro

    El_Heffe:
     

    It's not butter, though, which is a little hard to believe.


    In complex analysis, a meromorphic function on an open subset D of the complex plane is a function that is holomorphic on all D except a set of isolated points

    Filed under: ,
Page 1 of 1 (49 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems