The Official Status Thread



  • @Benjamin-Hall said in The Official Status Thread:

    leaning Swift

    You're attracted to Swift :wtf:



  • Status: Starting to learn some xamarin, but I'm already confused. This project I'm working on must be a few years old, because visual studio hasn't offered shared projects that compile their code into individual referencing projects in quite some time. It's still supported, but weird to see.

    Also, every view is named View and every ViewModel is named ViewModel. They're in folders with their actual names. This worries me almost as much as the amount of code-behind in this xaml project, but here we go!


  • I survived the hour long Uno hand

    @TimeBandit
    Kink shaming thread is :arrows:


  • Discourse touched me in a no-no place

    @Magus said in The Official Status Thread:

    I don't think anything else can be nearly as bad as Auth.

    Low level networking is worse. Just.



  • @Magus When I tried to figure out WTF Xamarin was all about a few years ago, the impression I had was that it was a version of .NET that didn't work for shit, with its own version of Visual Studio that didn't work for shit across multiple platforms.



  • @hungrier that was probably before it was bought be Microsoft, then. It's better than it was, for sure. I tried creating a new blank project, and that one had really great defaults, but this project I'm on now is weird. That's how it goes I guess.



  • Status: Tired of being spammed by fake Amazon recruiters on LinkedIn.

    Took another sick day. Ordered more storage containers, washed clothes, washed dishes. But mostly spun in circles not knowing how or where to start organizing this dump until I gave up and went back to WTDWTF or Deep Space 9.


  • Notification Spam Recipient

    @Zenith said in The Official Status Thread:

    went back to WTDWTF

    You'll never escape!



  • Status: Dealing with the fun of an "up-to-date" Windows 10 Mail app removing the setting that allowed me to specify the sender name for my accounts. I have two Google mail accounts set up, one for this pseudonym, one for my real name, but thanks to the update, now both send using the pseudonym like this:

    • ChaosTheEternal <so hard to guess@gmail.com>
    • ChaosTheEternal <my real name@gmail.com>

    Instead of:

    • ChaosTheEternal <so hard to guess@gmail.com>
    • Fname Lname <my real name@gmail.com>
      ­

    Mail version on my desktop is 16005.12430.20136.0. No official option to downgrade the app.

    Mail version on my tablet, which isn't broken like that, is 16005.12228.20410.0. Even better, my tablet doesn't think there's a Mail app update to get.

    Thanks Microsoft, for breaking something in a "minor" version update. Guess if I want to send emails and not always use my pseudonym, I'm logging into Gmail web or sending them from my tablet.


  • Notification Spam Recipient

    @ChaosTheEternal said in The Official Status Thread:

    I'm logging into Gmail web

    Speaking of, I've noticed that it never updates the messages list. Wonder what they fucked up...


  • Notification Spam Recipient

    Status: kinda excited for the Arduino firmware update I just finished for the joystick controllers. Now, you can connect to the serial port on the Arduino to configure it (currently only adjusting the joystick enumeration number is allowed) and view the inputs states.
    Additionally, the LEDs on the Arduino more accurately reflect status, such as if the serial port is open or not, whether there's joystick input being sent to the computer, and a idle blink counter to display the ID enumeration value without needing to connect the serial port.

    Only thing, apparently it stops being able to count after a while and continuously flashes the ID indicator LED, but everything else appears stable!


  • BINNED

    Status: Sent two business emails to customers this morning. Feeling exhausted now and like I've done enough for the day.



  • Status

    I'm motherfucking sick of these motherfucking snakes "helpful" format conversions in this motherfucking plane Excel!

    using System.Data;
    using System.Globalization;
    using System.IO;
    using System.Runtime.InteropServices;
    using CsvHelper;
    using Excel = Microsoft.Office.Interop.Excel;
    
    namespace CSV2Excel
    {
        class CSV2Excel
        {
            static void Main(string[] args)
            {
                var inputPath = args[0];
                var outputPath = Path.ChangeExtension(inputPath, "xlsx");
    
                // I should probably do some error handling to make sure you actually passed a csv as a parameter...
    
                // Read input CSV into Data Table
                var table = new DataTable();
                using (var reader = new StreamReader(inputPath))
                    using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
                        using (var dr = new CsvDataReader(csv))
                            table.Load(dr);
    
                // Load Excel COM interop
                var excel = new Excel.Application();
                var workbook = excel.Workbooks.Add();
                var worksheet = (Excel.Worksheet)workbook.Worksheets.Item[1];
    
                void WriteAndReleaseCell(Excel.Range cell, string value)
                {
                    cell.NumberFormat = "@"; // Force text format to prevent "helpful" format conversions
                    cell.Value = value; // Write value
                    Marshal.ReleaseComObject(cell); // Release the COM!
                }
    
                // Write Row 1: Column Headers
                for (var col = 0; col < table.Columns.Count; col++)
                    WriteAndReleaseCell((Excel.Range)worksheet.Cells[1, col + 1],table.Columns[col].ColumnName);
    
                for (var row = 0; row < table.Rows.Count; row++)
                    for (var col = 0; col < table.Columns.Count; col++)
                        WriteAndReleaseCell((Excel.Range)worksheet.Cells[row + 2, col + 1], table.Rows[row][col].ToString());
    
                workbook.SaveAs(outputPath);
                workbook.Close(true);
                excel.Quit();
                Marshal.ReleaseComObject(worksheet);
                Marshal.ReleaseComObject(workbook);
                Marshal.ReleaseComObject(excel);
            }
        }
    }
    

    And now that i've written this and posted this y'all are going to tell me there was an easier way to do it..... and critique my code style, telling me the way i wrote that was bad and ugly....aren't you....... well i have only one thing to say about that...... FUCKING BRING IT ON!



  • @Vixen said in The Official Status Thread:

    And now that i've written this and posted this y'all are going to tell me there was an easier way to do it

    LibreOffice 🤟



  • @Vixen said in The Official Status Thread:

    And now that i've written this and posted this y'all are going to tell me there was an easier way to do it..... and critique my code style, telling me the way i wrote that was bad and ugly....aren't you....... well i have only one thing to say about that...... FUCKING BRING IT ON!

    I'd just say the new using style is nice if you're able to use it. The whole using var x = blah type thing.


  • BINNED

    @Vixen said in The Official Status Thread:

    and critique my code style

    Not quite a criticism as I don't speak C#, but

                using (var reader = new StreamReader(inputPath))
                    using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
                        using (var dr = new CsvDataReader(csv))
    

    do you need all those usings? I'd naively assume only the outermost does file handling and is something that needs to be disposed, the rest can just be GC'd. (The chance of me guessing wrong is pretty high, though)


    EDIT: while we're at it, I'm surprised C# doesn't have enough magic built in that you have to do those Marshal.ReleaseComObject calls.



  • @topspin As I understand it, if it implements IDisposable you're basically required to wrap it in using or otherwise call .Dispose() yourself. You can get away with not doing that in some cases, especially toy apps or short-lived processes, but depending on what the object is doing over in native-land that could cause problems down the road if it keeps leaking OS resources.


  • BINNED

    @mott555 said in The Official Status Thread:

    @topspin As I understand it, if it implements IDisposable you're basically required to wrap it in using or otherwise call .Dispose() yourself. You can get away with not doing that in some cases, especially toy apps or short-lived processes, but depending on what the object is doing over in native-land that could cause problems down the road if it keeps leaking OS resources.

    Sounds reasonable. I assumed the inner two aren't even IDisposable, but that doesn't make sense since it probably wouldn't compile. (Ergo, I'm just wrong)
    But what do they Dispose do? The outer one obviously has the file handle to give back to the OS, but don't the others just work on the stream?



  • @mott555 IDisposeable simply indicates that you're dealing with an object that needs to be cleaned up properly. All of those types operate on a stream, so they all have it. Theoretically they all operate on the SAME stream and therefore only need one using, but they could be making some of their own as well. Most people do this to all of them just in case, which is probably for the best. They did make the syntax better about year ago, though.



  • @Vixen

    Interop

    office-disgusted.gif



  • Status: Picked up a work item on Monday, asked about it and got told to pick up a different one, so I did. Yesterday I got sidetracked helping with someone's web woes, which amounted to "just write the Ajax calls manually in jquery, whatever weirdness the last person did seems to require obnoxious contextual information" but I did ask about it a bit. Last night around 9pm, the guy who gave me the task checked in most of the stuff I was going to do once I figured out how to get to that page and test it, except with some changes left out that cause the project to not compile.



  • @topspin said in The Official Status Thread:

    do you need all those usings

    yes.... unfortunately. though given the short lifespan of the app i could just leak the IDisposeable and it would clean up on process teardown.

    @topspin said in The Official Status Thread:

    I'm surprised C# doesn't have enough magic built in that you have to do those Marshal.ReleaseComObject calls.

    surprised the fuck out of me too when I found out about the memoryleaks i was getting communicating with Windows Image Aquisition framework (their "current"? scanner interface) you'd think that would get released automatically when the variable went out of scope and was destructed....

    @hungrier said in The Official Status Thread:

    @Vixen

    Interop

    office-disgusted.gif

    tell me about it but the vendor needs xlsx files, if i give them CSVs they fuck up the format opening them in excel and they can't work out how to just make the SQl querieds or interact with their own 9admittedly ancient versions of) webservices toget the data directly... so i need xlsx files and.............. yep. interop seems the only way to do that and force text formatting..... that i've found so far anyway.


  • Discourse touched me in a no-no place

    @Vixen said in The Official Status Thread:

    interop seems the only way to do that and force text formatting..... that i've found so far anyway.

    I vaguely remember that there are others. The details have been IDisposed to help preserve what remains of my sanity.



  • Status: Windows Update cannot install updates until Windows is rebooted, however, Windows cannot reboot because Windows Update is busy.



  • @mott555 said in The Official Status Thread:

    Status: Windows Update cannot install updates until Windows is rebooted, however, Windows cannot reboot because Windows Update is busy.

    Ouch. Let us know how you resolve this.



  • @jinpa With the button labeled "Force Reboot" or whatever. This is a Windows 7 system, and those don't go nearly as screwy during updates as Windows 10.



  • @Vixen The MS Office SDK can work with the files directly, and should be able to format it however you like, but it's kind of a pain to work with



  • @Vixen Well you pretty much have to do that when you know that FromRecordSet() will fuck something up.

    :trwtf: is that this is a console application instead of a library function.

    Edit: Also, since I have to one-up everybody's fucked up work environments, I have been forced to write code like that. You see, when you export to Excel from the UI, ServiceHow silently cuts off around 20K records. Why was I exporting more than 20K records? Well, when your report builder is garbage that can't do anything but INNER JOINs and can't do calculated fields, what you end up doing is exporting the entire database or effectively UNIONing multiple datasets together, waiting an hour for the result to download as a CSV, and then using VS Express to process it down into something halfway usable. No charts, though, because I could never get it to pick up the ranges correctly...

    Edit More: Oh, and Office Automation does have a way to apply formats to entire rows or columns. I'd have to look it up to be sure but the Range object has EntireColumn and EntireRow structures that just repeat the cell styles. There are some corner cases but they work for most of the basic formatting and could be faster depending on how big the dataset you're copying is. Also, something I'd recommend is freezing the top row to help with readability for the poor soul that probably has to look at this spreadsheet after you're done.



  • Status: At home.
    bd541c28-9747-4105-8cd3-28033cbe0f3e-image.png

    The office Christmas party was delayed until today so I decided not to go into the office. Plus I had scheduled a doctor's appointment for 4PM. Despite having fuck all to do, there's still something of an inquisition if I cut out early. Look, I know the complex is haunted. Just stay out of the basement and they won't bother you. Or, better yet, go down there alone and make lots of noise.



  • @Zenith said in The Official Status Thread:

    is that this is a console application instead of a library function.

    I could make it that, but the reason i wrote it as a console app is I had a powershell script that was doing the same thing, except it took aproximately 5 years to create a single excel file because apparently Microsoft Interop COM interface just hates powershell. so i wrote the console app and shell out to it in powershell.

    I could have rewritten the whole powershell script to be the C# app, or i could have had it load the DLL and call the library function, but those were more effort.

    @Zenith said in The Official Status Thread:

    I'd have to look it up to be sure but the Range object has EntireColumn and EntireRow structures that just repeat the cell styles

    huh...... I should look into that.... it might speed things up a bit maybe....

    @Zenith said in The Official Status Thread:

    Also, something I'd recommend is freezing the top row to help with readability for the poor soul that probably has to look at this spreadsheet after you're done.

    not my problem. i made this shit for a vendor what can't work with CSV files nor well defined (albeit old and kinda crap) webservices that they provided us in the first place. if they want to freeze the top row then can damn well do it themselves. :-P


  • Considered Harmful

    @Zenith said in The Official Status Thread:

    The office Christmas party was delayed until today

    :wtf_owl:



  • Status

    “Roses are red Violets are blue, Unexpected ‘{‘ on line 32”
    -Link posted by @jinpa



  • @Applied-Mediocrity Just infrastructure neglect at work. The bathrooms were broken for almost two months. I wasn't too far from peeing in bottles.



  • I split the weird mobile app up a bit and managed to get it to a point where we could maybe set up individual builds for each platform. We'll see if anyone is interested in actually letting me do this on the real codebase.


  • Notification Spam Recipient

    @Vixen said in The Official Status Thread:

    yep. interop seems the only way to do that and force text formatting.....

    Well.... I can't say I haven't made a file import macro that forces text for files in my ExcelBookRunner macro suite, which is just a bunch of macros...


  • kills Dumbledore

    @Vixen said in The Official Status Thread:

    And now that i've written this and posted this y'all are going to tell me there was an easier way to do it

    I don't know if it's necessarily easier but I've quite a lot of programmatic opening of Office applications in software that made it on to servers and started mysteriously hanging when the office window ended up opening a modal dialogue. I'd always recommend using a library instead. I used SpreadsheetLight many years ago, which I remember as being fairly simple to use, and more recently I've used Aspose which is more fully featured


  • Notification Spam Recipient

    @Jaloopa said in The Official Status Thread:

    ended up opening a modal dialogue.

    Oh yeah, that's the fucking worst. IIRC I had a handler for that that would automatically log and close it using the default action (whatever it was). Such bullshit.



  • Status: Someone in an apartment above me once again dumped a metric butt-ton of rice down their kitchen sink, plugged up the building's main drain pipe, and now everyone's wastewater is backing up into my sink. 😒 Sometimes I think it's not worth having a ground floor apartment.


  • Notification Spam Recipient

    @mott555 said in The Official Status Thread:

    Sometimes I think it's not worth having a ground floor apartment.

    🔧



  • @Jaloopa said in The Official Status Thread:

    Office ... servers

    I seem to remember that the Office license explicitly prohibits that... Ah...

    Current licensing guidelines prevent Office applications from being used on a server to service client requests, unless those clients themselves have licensed copies of Office.

    From https://support.microsoft.com/en-us/help/257757/considerations-for-server-side-automation-of-office
    Which has a metric-shit-tonne of "problems you may have to deal with"...



  • @dcon :mlp_rolleyes: They've been saying that for years and it's no more true now than when they started. What you can't do is copy pasta five lines from Expert Sexchange and push it to production without testing. Just because the consequence is a dialog instead of an exception, people lose their minds. But I only generated hundreds of thousands of files through automation so what do I know.


  • Discourse touched me in a no-no place

    @Zenith You can know everything there is to know but it doesn't change the licensing.


  • Notification Spam Recipient

    Status: I love love LOVE how adding debug output lines causes problems to go away!!! :angry:



  • @loopback0 said in The Official Status Thread:

    but it doesn't change the licensing

    pie_flavor Just don't read it and you're good



  • @loopback0 The licensing change is recent (post Office 2010 at least, probably not until 0365), doesn't apply when users have Office installed on their workstations, and doesn't appear to cover non-interactive automation.


  • Notification Spam Recipient

    Status: Being asked if we have "a quick and easy way" to encrypt and package (and I assume virtualize) a Windows program, with a self-destruction capability. Oh, and it needs to be password protected too.

    None of that is quick or easy.

    Well, stuffing a directory full of shit (that may include an exe file) into an encrypted archive is relatively simple, pending destination compatibility, but it sounds like they want it to not be stored at any time decrypted, so whatever container is used needs to decrypt on-the-fly to RAM and nowhere else while running.


  • Considered Harmful

    @Tsaukpaetra Pure .NET assemblies can be loaded and run in memory, along with any such dependencies. It's not particularly difficult to make a rudimentary loader, no need to go tumbling down the VFS rabbithole. Someone with WinDbg will find what you're doing in seconds, however.

    Why don't you ask Denuvo? 🍘


  • Notification Spam Recipient

    @Applied-Mediocrity said in The Official Status Thread:

    It's not particularly difficult to make a rudimentary loader

    I'll pay you $0.00/hr to make an encrypted loader that will load a Unity package complete with data then. :mlp_shrug:

    Why don't you ask Denuvo? 🍘

    See above pricing. There's not a lot that can be done when I have a budget of "We'll pay you when you finish something."



  • @Tsaukpaetra Timing issues? I usually implement deferred debug printing the first thing on new projects just because of that.


  • Notification Spam Recipient

    @acrow said in The Official Status Thread:

    @Tsaukpaetra Timing issues? I usually implement deferred debug printing the first thing on new projects just because of that.

    Thing is, it shouldn't be a timing issue. One thing is executed after another.

    But, apparently, not, if there are no debug prints to prove it.

    I'm assuming some kind of optimization that has decided it's always okay to do X out of order or skip doing X. That's the only thing I can think of why this is happening...


Log in to reply