Open Side Menu Go to the Top

12-29-2018 , 06:25 AM
Switch to Linux?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
12-29-2018 , 09:51 AM
Quote:
Originally Posted by suzzer99
Lol Time Machine - you mean that thing I have to plug in an external drive for and keeps telling me it's been 70 days or whatever?
Yeah, that thing that is the second easiest back-up system in existence, and I thought kept local copies until you connected then copied it over. Worth a shot if you had it turned on... I have a little USB powered hard drive I remember to plug in every month or so to my laptop, my desktop just has one connected all the time.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-29-2018 , 12:56 PM
Well, ok, first, you're comparing the utility code from the first example with the actual algorithm in the 2nd. The comparable algorithm in C++ if you ignore the utility code is

Code:
    auto triples = view::for_each(view::ints(1), [](int z) {
        return view::for_each(view::ints(1, z + 1), [=](int x) {
            return view::for_each(view::ints(x, z + 1), [=](int y) {
                return yield_if(x * x + y * y == z * z,
                    std::make_tuple(x, y, z));
            });
        });
    });
Presumably you'd have most of the ugly stuff you have there in a library somewhere.

Granted, I think it's terrible, just not quite as bad as you illustrated.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-29-2018 , 04:43 PM
So is finding a remote job and living in Hawaii a possibility these days or just a pipe dream?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-29-2018 , 04:45 PM
Quote:
Originally Posted by RustyBrooks
Well, ok, first, you're comparing the utility code from the first example with the actual algorithm in the 2nd.
Sorry, those two things (the article screenshot and the C# syntax) weren't meant to be direct comparisons - the C# thing was just something I hadn't seen before and thought was noteworthy.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-29-2018 , 05:00 PM
Quote:
Originally Posted by PJo336
So is finding a remote job and living in Hawaii a possibility these days or just a pipe dream?
I've got 3 days a week remote now. I have a few people who want websites - one I'm working on, and I get some working doing solar plans which is remote. I'm still doing solar installations for now as well, but I'm trying to make it possible to work remotely and wander the earth (part-time anyway) for my "retirement" (really means when my kids both at least out of HS) - not my only possibilities, but it's one of them.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-29-2018 , 06:35 PM
At my company apparently the senior engineer path is to work there a while then make some excuse to move away from HQ and become full time remote with the same salary.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-29-2018 , 10:58 PM
Much cheaper places to live remotely than Hawaii.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 12:44 AM
Quote:
Originally Posted by OmgGlutten!
Much cheaper places to live remotely than Hawaii.
I don't think cheap is the goal.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 12:56 AM
Quote:
Originally Posted by KatoKrazy
I don't think cheap is the goal.
Lol correct
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 05:25 AM
Haha yeah I meant more like value. But I’ve heard that Hawaii is beautiful...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 02:47 PM
Quote:
Originally Posted by PJo336
So is finding a remote job and living in Hawaii a possibility these days or just a pipe dream?
It's a possibility. I have worked with a couple of people who did this and seemed pretty happy with it although the time difference can make work a bit lonely.

The path seemed to start with Grue's approach as well as building a good enough network (at a strong enough shop) so that you can continue this even after changing jobs. I think it's going to be hard to do this without sticking to places were respected ex-colleagues are working presently and can vouch for you.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 03:15 PM
My place is unfortunately super anti remote work. I have a relationship with a remote only shop but they kind of suck (terrible code base and knowledge base)

Sounds like the general theme is that remote work isn't quite in the spot where you can commit to just moving somewhere with only internet and ride out a decent career, which I guess was more the crux or the question
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 03:26 PM
There are lots of places that advertise remote positions but I don't know of any place that consolidates those companies into one list you could work through looking for opportunities. So the first remote job may be easy to find, but the next one could be troublesome.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 03:28 PM
Without the Hawaii stipulation (so that you can commit to working the same hours as headquarters), it's even more possible.

But the handful of people I know doing that
1. started (and were successful) as a non-remote employee somewhere first
2. work at smaller/midsize companies where they had a strong inside referral
3. are willing to travel to the headquarters place on a quarterly/semiannual basis for a few days (depending on what their employer wants)

Basically, my experience is that places that allow remote work are a lot more common than places that actively seek out remote employees (for various reasons) so having a "sponsor" seems key.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 04:07 PM
We are mostly in office, but we have a small handful of full time remote contractors around the US who come to the office for a week a few times a year. I bet their pay level takes some kind of hit for getting to do that, but I guess I don't know for sure.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 05:41 PM
My first job is remote. But the company has an office in my city.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 07:16 PM
ok, react problem

I'm having problems with imageId here, but I'll show mainPicPath for contrast on how they behave.

variables are part of the state

Code:
class MainPic extends Component {
  constructor(){
    super();
    this.state = {
      mainPicPath : '',
      imageId: null,
    }
}
The values are changed here:

Code:
fetchData() {
  fetch( this.props.DATA_URI + "/getimage?selected_image=" + this.props.selectedImage)
    .then(response => response.json())
    .then(data =>  {
      this.setState( { 
        mainPicPath : data.imagePath,
        imageId : data.image_id,
       })
     })
     .catch(error => {
        console.log("error: ", error);
     })
}


componentDidMount() {
    this.fetchData();
}
inside the render function of this component I have this

Code:
render() {
  return(
    <div>
    <img src={ this.props.DATA_URI + this.state.mainPicPath } alt='whatisthis' /> 
    <Answers imageId={this.state.imageId} />
    </div>
   );
  }
}
Now the mainPicPath gets it's value and renders the image I want, but imageId doesn't get it. I believe what happens is that mainPicPath doesn't really get it at first, but when the fetch return it rerenders and it all looks fine. I think the Answers component just takes off with the null imageId and when I try to use it as a prop in that component it's not there yet and I end up sending null to another api/db call.

I've tried and failed with various and sundry.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 07:48 PM
To test your idea you could do:
{ this.state.imageid && <Answers imageID= ...}
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 08:09 PM
Concattating strings with pluses ITT.

If I was to guess, the value of "this" isn't what you think it is.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 08:21 PM
Quote:
Originally Posted by Grue
Concattating strings with pluses ITT.
Keeping format strings straight for every different language imaginable (C printf, Go, Python, etc) is such a pain in the ass, plus concatenation is elite
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 08:24 PM
don't use go, don't use python, write everything in C!

problem solved
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 08:55 PM
Quote:
Originally Posted by Larry Legend
To test your idea you could do:
{ this.state.imageid && <Answers imageID= ...}
Thanks. This fixed the problem.

I imagine when imageId becomes set when the fetch returns, react re-evaluates and re-renders "<Answers..>"?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 08:58 PM
There should be some way to add a lifecycle hook so that you re-render when the property updates, but it's been a couple years since I used React and I don't recall the details (re: your original code)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-30-2018 , 09:00 PM
What's the verdict on concatenation? People don't like "+" because it's not the same for different types?

I had no opinion other than typing + is easier and easier to remember than .concat, but looking it up:

https://developer.mozilla.org/en-US/.../String/concat

Quote:
It is strongly recommended that the assignment operators (+, +=) are used instead of the concat() method.
According to this performance test, the assignment operators are several times faster.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m