Page 19 of 19 FirstFirst ... 9171819
Results 181 to 186 of 186

Thread: Programmer's Den

  1. #181
    Meae Musae Servus Hephaestus's Avatar
    Type
    INTP
    Join Date
    Dec 2013
    Location
    Ceti Alpha V
    Posts
    13,262
    INTPx Award Winner
    I'm relearning C++, and it's a bit different than I remember in some ways. For clarity: my use of C++ is C plus classes, namespaces, and operator overloading--never delved into templates, or multiple inheritance.

    Consequently, it took me a minute to work out why I could do the following and get what I wanted rather than what I expected:

    Code:
    //I've got a couple little questions to throw in here while I'm at it.
    //This first include statement baffles me--I get the idea from looking it up.
    //What baffles me is my compiler behavior regarding it.
    //If I don't use it, the compiler throws an error and won't compile.
    //If I do use it, a mouseover tells me it can't find/open the file
    //but it does compile.
    //The cleanest solution to me is to track down whatever setting is throwing the error
    //and change it, then stop calling it--but it's fucking weird that Visual Studio
    //has it on as a default but doesn't have the file it needs to do it.
    
    #include  <stdafx.h>
    #include  <iostream>
    using namespace std;
    
    int main()
    {
    //auto is new feature that coming from Python I find amusing and dangerous. I used it to figure out
    //how to invoke a cleaner string I didn't have to typecast to get into cout. Thus I discovered
    //const char * var--which is what auto selected for me.
    	auto message = "Hello.\n\nTest\n\n";
    	
    	cout << message;
    	
    	message = "A new String\n\n";
    
    	cout << message;
    
    	
        return 0;
    }
    The interesting thing in this is being able to change the value of 'message'. I call it Pointer Trick #1. Your pointer is constant, the value it points to is not.

    What I'm trying to do is Pointer Trick #2. You instantiate a const. Then, you assign it's address to another pointer, and change the value at the address of the pointer, thereby also changing the value of the original const. Presently I'm trying to do it with a const char var[], but can't get the compiler to play ball. I don't know if I'm butting against the compiler or the language, though I'm planning to try the experiment again tonight with Notepad++ and GCC--unless someone can explain what my screwup is.

    Code:
    const char mark[] = "Test message 1\n\n";
    const char * sneak = mark;
    
    cout << mark;
    
    sneak = "New message!\n\n"
    
    cout << mark;
    I'm probably overlooking something simple and stupid, but it's part of the basic pointer hat-trick.
    Most of time, when people ask why something terrible happened, they don't realize they are looking for someone to blame.

    --Meditations on Uncertainty Vol ξ(x)

  2. #182
    Senior Member Tetris Champion notdavidlynch's Avatar
    Type
    INXP
    Join Date
    Dec 2013
    Location
    Los Angeles
    Posts
    2,291
    Dear God, why?

    I'm talking about myself. I posted once that I had transitioned from hipster JS dev to hipster Swift dev. I was about to post that I recently transitioned from that to a hipster sys-admin and ruby/rails developer, because that's my current gig, but I think that once you cross into any kind of sys-admin shit you may as well drop the "hipster" part.

    Sys-admin is fine, but dear lord does rails suck ass, and it sucks extra ass when the codebase you're working to get running was written by a large firm dependent on hella-automated deployment processes that break when you're not one of their employees.

  3. #183
    Senior Member
    Type
    intp
    Join Date
    Dec 2013
    Posts
    1,370
    So many people don't know what the fuck they're talking about. It would be okay if they just were aware of it.

    Had this problem with a http POST controller not working when called from the browser. "OPTIONS method not supported" whatever. Slightly more superior guys says "why is angular turning it into an OPTIONS request?" I didn't really know what the fuck he was asking. I sent him away while I fixed it.

    Later, I let him know "it works!" I made the controller thing handle the OPTIONS thing. Just a "options() { return null }" sort of thing. (could be a better way to do this, but fuck it. I'm outside my normal sphere)

    He says "that's really not a good solution."

    "did you read the discussion [link] I sent you?"

    I ask him why. Turns out he thinks I've just renamed "post() [whatever]" to "options() [whatever]" to fix this "weird" angular thing, and instead I should stop angular from "turning post into options". Like wtf mate?!

    So one of our slightly more senior developers, who works on APIs, is not aware that requests made between different servers send the options request sometimes. wtf.

    It's not too bad. But I am reluctant to let anyone know when I'm unsure of a particular error, as it may open me up to someone advising I do something stupid because they have no idea.

  4. #184
    Meae Musae Servus Hephaestus's Avatar
    Type
    INTP
    Join Date
    Dec 2013
    Location
    Ceti Alpha V
    Posts
    13,262
    INTPx Award Winner
    @scarydoor, I just wanted to thank you for making me aware of pluralsight. I haven't delved too deeply yet, but so far all the courses seem top notch--as in they give me that "I got the good teacher at uni" feeling. The interface has a klunk or two I plan on giving feedback on, but the content is so much better than say, Udemy.
    Most of time, when people ask why something terrible happened, they don't realize they are looking for someone to blame.

    --Meditations on Uncertainty Vol ξ(x)

  5. #185
    Senior Member Tetris Champion notdavidlynch's Avatar
    Type
    INXP
    Join Date
    Dec 2013
    Location
    Los Angeles
    Posts
    2,291
    The worst thing about being a freelancer is that I essentially turn into Johnny Mnemonic when taking on new jobs, stepping way beyond my reasonable limits and risking brain seepage and death. I got sick last night getting this server stack running -- dozens of substantially complex components working together in a way I'm sure the original development team of a dozen Polish dudes didn't entirely understand or bother to clean up. It's like one whimsical decision of (unnecessarily) adding elasticsearch starts a snowball effect of extra libraries and services to get it and keep it running (redis, sidekiq, etc) and even more complexity added just to manage the established complexity during deployments with Capistrano and Docker and custom Capistrano/Docker integration packages that were conveniently left out of what my client won from the "developers" (who outsourced to Poland) in a lawsuit.

  6. #186
    Senior Member
    Type
    intp
    Join Date
    Dec 2013
    Posts
    1,370
    Quote Originally Posted by Hephaestus View Post
    @scarydoor, I just wanted to thank you for making me aware of pluralsight. I haven't delved too deeply yet, but so far all the courses seem top notch--as in they give me that "I got the good teacher at uni" feeling. The interface has a klunk or two I plan on giving feedback on, but the content is so much better than say, Udemy.
    Awesome. Glad you enjoyed it too. Yeah the quality is great hey. Unfortunately, my three month free trial (from the microsoft developer subscription) runs out in just a few days. I think I will take a break from it for a month or two and then actually buy a year subscription.

    Which courses are you working through?

    ----

    So many interesting things to learn.
    - firebase. Dived in today. seems excellent. Real-time db syncing -- wow. Easy integration with all that authentication stuff, seo (I assume), other google stuff (I assume), just makes sense.
    - ng-content content projection in angular2+.
    - ngrx/store / redux pattern for ng 2. Got to learn it properly.
    - on Monday my boss said "hey can you figure out this Flutter thing" so I just dived in and made my first simple android app with that. It's like an abstraction on top of normal android apps, so you worry less about the ui, tell it what to do, and it'll pretty much do the google material design ui. Seems pretty good if you just want to pump out okay looking stuff without worrying about a bespoke thing.
    - dove into this nx workspaces angular 2+ thing. Hacked angular 2 so I can whip up multitudes of UIs with no fuss. Still need to work out details.
    - mozilla documentation / guides for all the web stuff is great.
    - all those random web APIs.

    I've got too much to do, but I like it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •