WTF Bites


  • Notification Spam Recipient

    @Gąska said in WTF Bites:

    @DogsB just what kind of podcasts do you listen to that they're still legible at 4x speed!?

    A lot of the Americans and Canadians are. Most other accents become gibberish at anything above 3. Although a lot of anthologies like NoSleep are fine at 4 I find. Audio books are usually fine at 4. These speeds are usually fine when I'm excerising, doing chores or leveling up in games. Otherwise I have to fall back to 2x. During work I don't listen to podcasts. It's usually the radio or if I need to really concentrate I use nature sounds like raining or the tide.

    YouTube on the other hand I max out at 2 usually just 1.5. TV shows and movies I max at 1.5 or it becomes gibberish. Subbed anime 2x at best if I just want to get to the end.


  • BINNED

    @Gąska I have the same reservation.
    Best I can come up with is "can [still] be made out"


  • Banned

    @DogsB you must listen to some very theatrical audiobooks. Normal speech - which is what I'm used to - becomes mostly impossible to make out. That, or you have excellent hearing and voice processing skills (or I suck at both and never even realized).


  • Notification Spam Recipient

    @Gąska said in WTF Bites:

    @DogsB you must listen to some very theatrical audiobooks. Normal speech - which is what I'm used to - becomes mostly impossible to make out. That, or you have excellent hearing and voice processing skills (or I suck at both and never even realized).

    Just try what I did. Start at 1.1x and add .1 a week until it becomes complete gibberish. Then dial it back to where you're comfortable and relisten to the couple weeks of complete gibberish. It can be a ball ache to organise your podcasts by speed though.


  • Banned

    @DogsB oh, like boiling a frog alive!



  • @Gąska said in WTF Bites:

    @kazitor what's the word for legible but for audio?

    'intelligible' could be used, though not specific to audio and plenty of podcasts aren't to begin with.



  • Somehow, despite Hyper-V providing a "Hyper-V-specific video device" for Linux, none of the "officially supported" distros I've tried is able to let me set the screen resolution to anything other than 1152x864 without having to manually edit Xorg.conf.

    Needless to say, proper mouse integration, keyboard integration, file transfer, and all those other helpful features are but distant dreams.



  • @DogsB said in WTF Bites:

    @dkf said in WTF Bites:

    @Lorne-Kates said in WTF Bites:

    If you think any of the above sql statements are badly written

    Well, I did see a plain select * from someTable which is considered to be poor style in production code…

    On the bright side some intern will have the point hammered home when they're asked to fix the performance issues the senior developer just introduced.

    I work with one database (filemakerpro) that has over 1000 columns. No need to worry about select * cause that's guaranteed (at least via ODBC) to run out of memory.



  • @kazitor said in WTF Bites:

    @Gąska I have the same reservation.
    Best I can come up with is "can [still] be made out"

    comprehensible?


  • Banned

    @dcon that's a step too far. Take @Gribnit's post for example - legible, but not comprehensible.



  • @Gąska said in WTF Bites:

    @dcon that's a step too far. Take @Gribnit's post for example - legible, but not comprehensible.

    Intelligible (yes, I know :hanzo:'d)

    https://www.reddit.com/r/whatstheword/comments/1plb3w/is_there_a_word_like_legible_but_for_audio/

    (should have known the internet had the answer...)


  • Discourse touched me in a no-no place

    @dkf said in WTF Bites:

    Allegations that Search has ever worked correctly here are totally without foundation.

    .. on any of the three forum platforms...


  • Discourse touched me in a no-no place

    @Gąska said in WTF Bites:

    @DogsB just what kind of podcasts do you listen to that they're still legible at 4x speed!?

    Dunno about him, but I listen to most of mine at around that speed. I find Ask a Manager, for example, to be particularly slow and drawling at 1x (and the copious adverts she slips in the middle of it don't last too long at 4x...)

    @Gąska said in WTF Bites:

    @kazitor what's the word for legible but for audio?

    Comprehensible. But :hanzo:. And irregardless of /r/whatstheword has to say.



  • Status: tried to edit OneNote through the web. Got a mysterious "can't sync your changes" error. So I loaded the desktop OneNote on the same page

    0_1544300612803_909540fa-9a92-4dd6-aadc-cbe371445c3e-image.png

    Oh dear... well it says "OneNote might be able to fix it", so hopefully it can just throw away any new changes.

    OK, so what do I do now? Where's the "attempt to fix it" button? Is it hidden somewhere? Do I just wait?

    Nope, there's no "fix corrupted file" feature. You're just supposed to copy the section and delete the previous version.






  • Considered Harmful

    @dcon said in WTF Bites:

    database (filemakerpro)

    Disclaimer: Not a database.


  • Banned

    @sweaty_gammon horse glitches are like rage comics. They used to be funny once upon a time.


  • Considered Harmful

    @sweaty_gammon said in WTF Bites:

    https://imgur.com/pLGBIyZ

    of course, of course.



  • @PJH said in WTF Bites:

    I find Ask a Manager, for example, to be particularly slow

    They're managers, what did you expect?



  • WTF of my day: So, Apache Cordova coupled with React. What a ClusterfuckTM.

    1st Order of the Day: Get a picture from the camera. This works from the start, albeit with this weird iOS-quirk that I'm only getting square pictures - I can see the whole picture but there's always a crop-to-square-overlay over the preview which I can move but will always return to the origin afterwards. Oh, well.
    Returns a FILE_URI (I could also get a DATA_URI but that's frowned upon for memory reasons). However, because this whole app is living inside a WebView simply plonking this FILE_URI into an <img /> tag is verboten. Not that the error messages would tell you that outright, no, they'll lead you on a merry chase for CORS and other assorted security shenanigans.
    Just call the FILE_URI_to_absolute_file_path(you_fool) function and then you can plonk this thing directly into the <img src="parp" />. Now you can see the image in your app. Great!

    Meanwhile, you also want to do the equivalent for the users using the browser - so you'll gain access to the webcam and take a picture from there. Since you need to access the DOM for that you simply use one of the lifecycle-methods of React (namely componentHasMounted) to make sure that the browser actually rendered the video player before trying to pipe the webcam through to it.

    What do you mean, player is null? It's right there!

    Ah, okay, React frowns on using getElementById so I should use ref instead.

    player is still null? Yeah. Oh, wait, when I click on the element in the console it tells me that it exists now?

    In the end, problem solved by using a delay(init, 1000) to make sure that React cannot lie to me about having rendered shit while it totally didn't. Now I can take pictures with both mobile cameras and webcams!

    Okay. Now let's save those images!

    Well, for the browser variant the easiest way is to use a DATA_URI from a <canvas /> you rendered a snapshot of the player to. Piped that through to my server method, stored the picture, done.

    The mobile version? Well, I have the absolute path. That doesn't do jackshit because I apparently need a FileEntry first. Where do I get that from? Well, the documentation has plenty of examples but not a list of the actual API and does not cover my use case with their examples (because who would ever take a picture and then try to save it, right? Crazy!)

    Finally figured that one out (just call window.resolveLocalFileSystemURL because of course we need to make the Cordova API global!) aaand we're good? Wait, error code 5 - invalid encoding? Ah, I see, I need to prepend a file:// to my path string. Yes, that immediately comes to mind when seeing that error code.

    Okay, prepended the shit out of that string ... and error code 1? File Not Found? Wat.

    Turns out that my original path was absolute and thus, when I prepended file://, I now had file:///foo/bar/baz and you see, three slashes in a row are just one too many slashes (some people might argue that one Slash is already one too may but I digress)
    0_1544391805753_a8c7f0c9-c85e-4b45-9896-acfe538d1e9a-image.png

    And now it works.

    But Jesus Christ, what an abominable documentation...



  • 0_1544392207423_e2b0cddf-dfdd-488c-b171-031431086223-image.png

    Exporting a text file with 200,000 entries. Looks like I am going to have to dig through why it is using so much memory.


  • Considered Harmful

    @Rhywden likely the delay() is a bug waiting to happen. likely React has a lifecycle method you should be using.



  • @Gribnit I searched for it but didn't find the ComponentHasMountedForRealThisTime lifecycle method.



  • @Rhywden From my previous experience with mobile applications that exist in a WebView. While it is frustrating you were quite lucky it was only that. Though I was using Vanilla JS and the Titanium.

    May I ask as you are using React, why you aren't using something like React native?



  • @sweaty_gammon Because I wanted one codebase for browser and mobile.



  • @Rhywden Fair enough. What you will find is that it isn't quite that straight forward. One of the hardest things is trying to get the web view to refresh the application code across devices.



  • @Rhywden said in WTF Bites:

    I now had file:///foo/bar/baz and you see, three slashes in a row are just one too many slashes (some people might argue that one Slash is already one too may but I digress)

    Now this bit sounds really strange. URL is schema, colon and two slashes, then host and then path separated with another slash and while file schema has no host, it still has the place there for it, so it is normally followed by three slashes. This is true even on Windows where absolute paths don't start with slash, because the slash separates the path from the host rather than being indicator of absolute path.

    Now if you said it doesn't like four slashes, that would make sense, because URLs don't like extra slashes in general.

    Actually, file schema might have host, in case of Windows network shares, but what happens in practice in most software is that the file:/// prefix is prepended to the UNC path with backslashes converted to forward slashes, resulting in whopping five slashes.



  • The WTF was me. Just spent an hour trying to figure out why I couldn't map from one object to another using Automapper.

    I hadn't actually created the mapping profile :facepalm:



  • @Bulb Yeah, but otherwise I don't get it to work on both iOS and Android...


  • Discourse touched me in a no-no place

    @Bulb said in WTF Bites:

    Now this bit sounds really strange. URL is schema, colon and two slashes, then host and then path separated with another slash and while file schema has no host, it still has the place there for it, so it is normally followed by three slashes.

    It does have a(n implicit) host. localhost. Which is omitted.

    file://localhost/foo/bar/baz -> file:///foo/bar/baz

    Which is basically rephrasing what you were saying, so


  • Notification Spam Recipient

    @sweaty_gammon said in WTF Bites:

    0_1544392207423_e2b0cddf-dfdd-488c-b171-031431086223-image.png

    Exporting a text file with 200,000 entries. Looks like I am going to have to dig through why it is using so much memory.

    Not using a stream?

    Edit: Nevermind



  • @Tsaukpaetra I've got it down back to something more sensible. It is Entity Framework plus a lot of rows and a lot of custom mappers.

    The export is for a legacy system. So I have about 2 layers of mapping. One to flat map it to a set something that is a data row (there will be other exports in the future from the same system) and then another mapper for a particular export format.



  • @Rhywden said in WTF Bites:
    Web development sounds like being barefoot in a dark room, and endlessly banging your small toe against furniture.



  • @Zerosquare It isn't web development. It is using a web view on a mobile device.

    The supposed promise of it is that you can use the same code on the web and mobile applications. This is partially true.

    What happens that whatever is wrapping the webview will give you an api wrapper to native functions much like the browser but they are work slightly differently.

    You then even up writing code both to extend the wrapper itself and also writing JS code to adhere to the wrapper. So it isn't much better than polyfilling the browser.

    Back in the old days when there were about 100 different versions of Android/Phone combo and they all worked slightly differently. This meant we had a massive switch statement on user agent for configurations that didn't quite work as they should do.

    It was a nightmare.



  • Found out the other reason why it wasn't mapping is that I had to add the mapping profile to the startup file. FFS, so many place to just add one thing.


  • And then the murders began.

    @sweaty_gammon said in WTF Bites:

    Found out the other reason why it wasn't mapping is that I had to add the mapping profile to the startup file. FFS, so many place to just add one thing.

    There's a reason the docs tell you how to set up assembly scanning for Profiles. 🙂



  • @Unperverted-Vixen said in WTF Bites:

    @sweaty_gammon said in WTF Bites:

    Found out the other reason why it wasn't mapping is that I had to add the mapping profile to the startup file. FFS, so many place to just add one thing.

    There's a reason the docs tell you how to set up assembly scanning for Profiles. 🙂

    I didn't set it up. I assumed it was correctly setup before I was working on it.


  • area_can

    @DogsB said in WTF Bites:

    Although a lot of anthologies like NoSleep are fine at 4 I find

    doesn't that ruin the tension? :sadface:



  • @Gąska said in WTF Bites:

    @kazitor that explains why random non-programming plain English words are getting highlighted, but other (and even the same) plain English words don't.

    You can hint to the highlighter which type of language is being used by putting the name of the language immediately after the triple backticks:

    plain text
        ```text
            my plain text
        ```
    
        my plain text
    
    SQL
        ```sql
            select * from my_sql_table
            where mst_id = '555-1234'
        ```
    
        select mst_val1, mst_val2 from my_sql_table
        where mst_id = '555-1234'
    
    C source
        ```c
            #include <stdio.h>
            #define SWAP(a,b) do { a^=b; b^=a; a^=b; } while(0)
            int main(int arc, char** argv)
            {
                int x = 5, y = 12;
                SWAP(x, y);
                printf("x = %d; y = %d", &x, &y);
                return 0;
             }
        ```
    
        #include <stdio.h>
        #define SWAP(a,b) do { a^=b; b^=a; a^=b; } while(0)
        int main(int arc, char** argv)
        {
            int x = 5, y = 12;
            SWAP(x, y);
            printf("x = %d; y = %d", &x, &y);
            return 0;
         }
    
    Java snippet
        ```java
            import com.mybiz.SpecialServiceFactory;
            import java.util.List;
            ...
            SpecialServiceFactory specialServiceFactory = new SpecialServiceFactory();
            List<ServiceType> serviceTypeList = serviceTypeFactoryFactory.getServiceTypeFactory().getAllServiceTypes();
            for(ServiceType serviceType : serviceTypeList) {
                SpecialService ss = specialServiceFactory.getSpecialService(serviceType);
                ss.doSpecialServiceOperation();
            }
    
        import com.mybiz.SpecialServiceFactory;
        import java.util.List;
        ...
        SpecialServiceFactory specialServiceFactory = new SpecialServiceFactory();
        List<ServiceType> serviceTypeList = serviceTypeFactoryFactory.getServiceTypeFactory().getAllServiceTypes();
        for(ServiceType serviceType : serviceTypeList) {
            SpecialService ss = specialServiceFactory.getSpecialService(serviceType);
            ss.doSpecialServiceOperation();
        }
    


  • @djls45 there isn't really a "text" type... that's basically just the default style when your language hint isn't a language it recognizes and knows how to highlight.

    It works, though.


  • Considered Harmful

    @djls45 And of course, very few languages people actually use are in our highlighter, and there are quite a few that are but people don't.



  • @anotherusername said in WTF Bites:

    @djls45 there isn't really a "text" type... that's basically just the default style when your language hint isn't a language it recognizes and knows how to highlight.

    It works, though.

    Ah, true. It seems the list of supported languages in a variety of styles is here.



  • Soo, there is a guy I know wtill working on one of my old projects. It was a unicorn project for that customer, since it was deployed on time (well, 2 weeks late) and "it actually worked!" when deployed.
    It weighs in at about 1.5 MLOC, so it's fairly hefty. There are some fairly complex business rules to it. and it handles graphs of stuff.
    The whole thing is (or rather used to be) written in JavaEE, using JAX-RS and all that fancy stuff for marshalling XML from REST resources.
    Apparently, the new Indian consultant team that have taken over and found that it was too complex, and are rewriting it in SpringBoot, using none of that strange magic marshalling/serializing.
    These same indians told me when they started that recursive is too hard, and they don't want to learn.
    They said the same about the then new Java Streams API.

    public class StoreJsonParser {
    
        public static final String NAME = "StoreJsonParser";
        @Autowired
        @Qualifier(StoreOrderConfiguration.NAME)
        private StoreOrderConfiguration configuration;
    
        /**
         * parse response from store to fetch the item name
         *
         * @param storeResponse
         * @param itemNumber
         * @return itemData
         */
        public ItemData retrieveItemResponse(String storeResponse, final String itemNumber) {
            JsonParser parser = JsonParserFactory.getJsonParser();
            Map<String, Object> map = parser.parseMap(storeResponse);
            ItemData itemData = new ItemData();
            itemData.setItemNumber(itemNumber);
            for (Map.Entry<String, Object> entry : map.entrySet()) {
                if ("content" == entry.getKey()) {
                    Object content = entry.getValue();
                    List<Object> ja = (List<Object>) entry.getValue();
                    Object jb = ja.get(0);
                    Map<String, Object> jc = (Map<String, Object>) jb;
                    for (Map.Entry<String, Object> entry1 : jc.entrySet()) {
                        if ("objects" == entry1.getKey()) {
                            Object content1 = entry.getValue();
                            List<Object> ja1 = (List<Object>) entry.getValue();
                            Object jb1 = ja1.get(0);
                            Map<String, Object> jc1 = (Map<String, Object>) jb1;
                            for (Map.Entry<String, Object> entry2 : jc1.entrySet()) {
                                if ("objects" == entry2.getKey()) {
                                    Object content2 = entry2.getValue();
                                    List<Object> ja2 = (List<Object>) entry2.getValue();
                                    Object jb2 = ja2.get(5);
                                    Map<String, Object> jc2 = (Map<String, Object>) jb2;
                                    for (Map.Entry<String, Object> entry3 : jc2.entrySet()) {
                                        if ("type" == entry3.getKey()) {
                                            if ("item_full_name".equalsIgnoreCase(entry3.getValue().toString())) {
                                                continue;
                                            } else {
                                                break;
                                            }
    
                                        }
                                        if ("values" == entry3.getKey()) {
                                            List<Object> ja3 = (List<Object>) entry3.getValue();
                                            Object jb3 = ja3.get(0);
                                            Map<String, Object> jc3 = (Map<String, Object>) jb3;
                                            for (Map.Entry<String, Object> entry4 : jc3.entrySet()) {
                                                if ("value" == entry4.getKey()) {
                                                    itemData.setPartName(entry4.getValue().toString());
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return itemData;
        }
    }
    

    Just from memory I can say that this code is broken, and will fail edge cases. But, fuck if it doesn't feel good that I bowed out of that gig when those idiots joined. But apart from that, 5 nested for loops? For/ifs? I feel dirty just reading it.


  • BINNED

    @Carnage said in WTF Bites:

                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    

    Lovely.


  • 🚽 Regular

    @Carnage I found the lack of empty lines disturbing, before I even started reading the variable names.

    Edit: wait, so they do know about the continue keyboard, they just chose to use it only in the inner-most loop? :O



  • @Zecc said in WTF Bites:

    @Carnage I found the lack of empty lines disturbing, before I even started reading the variable names.

    Edit: wait, so they do know about the continue keyboard, they just chose to use it only in the inner-most loop? :O

    Yeah, the code is a wrongness fractal. New stupid just keeps popping up the longer you look at it.


  • Java Dev

    @djls45 said in WTF Bites:

    @anotherusername said in WTF Bites:

    @djls45 there isn't really a "text" type... that's basically just the default style when your language hint isn't a language it recognizes and knows how to highlight.

    It works, though.

    Ah, true. It seems the list of supported languages in a variety of styles is here.

    That's all supported styles. Not all of those are enabled.


  • BINNED

    @Carnage Wait, so they hired some highlylowly paid consultants to replace (apparently) working, well-designed code with buggy shit written from scratch? Why?



  • @topspin said in WTF Bites:

    @Carnage Wait, so they hired some highlylowly paid consultants to replace (apparently) working, well-designed code with buggy shit written from scratch? Why?

    TLDR: They aren't paid to do that, they are paid to maintain it. They interpret this as "Rewrite it in the only platform we know" and management is incompetent and spineless and don't know how to say no nor evaluate consultants.

    Full rant;
    They were already working on some tiny projects (like a few thousands of lines of code) that break on a weekly basis, but those projects and the mammoth I worked on got put under the same spineless manager. And he liked his indians so much that he put them in charge of everything he could. Even of hiring new indian consultants.
    The first part they did for the system I worked on took them several months to do and was a complete fucking mess that had a higher bug count than line count, and the line count was pretty blown up. Because of this, two of us not from L&T had to clean that shit up, by reimplementing it completely more or less.
    And that was some sort of sign to the manager that the rest of us were not team players, so two of the competent consultants were sent home.

    And, well, the L&T guys came in and took over their responsibilities, and turned everything they touched to shit. One by one the proper coders left, including me. A year in greener pastures later they begged on their knees for me to come back, so I did. I was told I'd implement some new stuff, but I spent 2 years fixing all the shit that had been broken pretty much, and then I left again. About a year later, they took that as the signal to go into overdrive with the inverted midas touch I guess.

    The managers that were responsible for the development of the system just shake their heads, dumbstruck by the massive fuckups.
    The really interresting bit is, this system is a critical system that handles highly sensitive data and as such, it was mandated from the very top of the organisation (a very large one) that this particular code must not be touched by non european developers, nor must it ever be offshored.


Log in to reply