Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

10-05-2020 , 12:00 AM
Quote:
Originally Posted by slenderhusband
Is somebody here well-versed in MongoDB? I need to do some stuff in it, but my previous background in non-relational database languages is pretty much non-existent and I'm having trouble transferring my knowledge from relational to non-relational domain.

As a simplified example of how Mongo joins would work, lets say we have three collections - person (includes id and name), occupation (id and occupation type), and a "junction" collection that has personId and occupationId where rows correspond to people and their occupations. How would I go about getting the list of all people in the "person" collection and their occupations? Or all of the people who work in some certain field? Or the occupation of a specific person?

All of this would be pretty trivial if I was using a relational system, but converting the entire database is not an option so I have to do with this.
Put the occupation in the person document. It likely shouldn't be separate. At the very least put the occupation id(s) on the person and remove the join table.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-08-2020 , 05:13 PM
I think that the recruitment process for eBays software engineers involves asking them if they can remember “Brown at the back, yeller at the front” when putting underwear on.

Evidence

1. eBays businesses model mainly involves people posting stuff to each other.
2. British postal codes all have the format “AA00 0AA”, uppercase letters.
3. The software does not check that the user has entered the code in this exact format. It allows lower case letters, the omission of the space or the replacement of the space with a punctuation mark such as a hyphen.
4. If you attempt to post something to someone who has made any of these simply correctable errors the software will detect the fault, offer to correct it, correct it on screen and then fail to process the payment for postage.

I think that the software guys may have been too busy congratulating themselves on their innovative use of the Enter key to mean “Please discard my manual entry and close the page” to fix the problem.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-11-2020 , 08:24 AM
So I started learning web development a while back and I feel like I've gotten a good grasp of basic front-end development (mainly Vue and Nuxt), but I'm having trouble understanding how can I "glue" everything together in a full-stack app.
To make it clearer, lets say I have the following Vue app:
Code:
<template>
  <div id="app">
    <p>{{message}}</p>
    <button @click="counter()">Increase</button>
    <p>{{num}}</p>
  </div>
</template>

<script>

export default {
  data(){
    return {
      message: "Sample text",
      num: 0
    }
  },
  methods: {
    counter: function () {
      return this.num++;
}
  }
}
However, instead of working with Vue methods, I now want to call some Java methods from a separate file. For example these:
Code:
    public String message() {
        return "This is some text";
    }

    public int counter(int num) {
        return num++;
    }
So what I'm asking is, how can I call the message() Java method from Vue and bind the return value of it to the message property so it could be displayed in the Vue app? Similarly, how would I go about calling the counter() Java method when clicking some button in Vue and then displaying the result back?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-11-2020 , 01:04 PM
sorry I don't know Vue but my first thought is you could turn your java program into a service and just send a http request to it to do its thing. It's probably not very hard to turn your java program into a listener on some port.

probably not the best solution though.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-11-2020 , 02:11 PM
Google ajax and vue ajax.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-12-2020 , 01:57 AM
slenderhusband;

You would want to do something like this, which is what I have in my homepage, with some redactions:

Code:
<template>
<div class="elems" v-html="this.info.data.html"></div>

<!-- "this.info" will include the result of the 
JSON response -->

</template>

<script>
  // axios consumes rest APIs.
import axios from 'axios'

export default ({
    // setup the initial data
    data () {
        return {
            info: null
        }
    },
    
    // use axios to make your call
    // there are many variations on this.
    // At times, you will need to use async / await
    // and sometimes use this.$nextTick()
    // Vue is Node, so you'll have to
    // learn how to cope with async and other things.
    
    mounted () {
        axios
            .get('http://127.0.0.1:3000/homepage')
            .then(result => (this.info = result));
    }
  })
</script>
I think Nuxt already has axios built in. I only use vue in the raw.

The java side will be an http endpoint. In the example above, it would be a GET. You wouldn't be sending back methods, you would run the functions in Java and send back the result in a JSON slug.

(there are more elegant ways to do this, but the above is pretty standard)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-12-2020 , 11:31 AM
And if you want to do java on the back end you probably want to look at tomcat

http://tomcat.apache.org/
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-13-2020 , 05:14 PM
Any iOS devs around here? I may have a side project.

It seems like a tiktok-ish thing, so I assume it would need serious animation, graphics, and sound integration skills. Which is why I'm not going to try to YOLO it myself.

Last edited by suzzer99; 10-13-2020 at 05:21 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-17-2020 , 08:42 PM
Hey guys, haven't been around for a while. What's new?

I got a job at a fortune 500 company 2 years back and got promoted in Feb to Engineering manager. Was going to try to dev on the side but that lasted about 3 months before I gave up. It's so hard to get any solid dev work in when your day is sliced to pieces by meetings. Being a people manager is interesting however. I immediately felt like people treated me differently. I notice more respect coming my way, but also I can't talk like I used to because my words have outsized weight now. I'm certainly not "one of the boys" anymore.

Had to fire an underperforming employee. That was interesting. Weirdly enough it wasn't as hard as everyone said it would be, but maybe because the final decision wasn't mine although I agreed with and took responsibility for it and was also the one that broke it to him. He didn't take it very badly either and was chill when he came to pick up his stuff so that helped. It was also a bit of a relief because he was causing tension in my team. He was higher level/salary than other devs which were outperforming him and everyone knew it.

Last edited by Wolfram; 10-17-2020 at 08:47 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-17-2020 , 09:04 PM
Quote:
Originally Posted by slenderhusband
... but I'm having trouble understanding how can I "glue" everything together in a full-stack app.

...

So what I'm asking is, how can I call the message() Java method from Vue and bind the return value of it to the message property so it could be displayed in the Vue app? Similarly, how would I go about calling the counter() Java method when clicking some button in Vue and then displaying the result back?
I think there's a slight gap in understanding here. When you make a full-stack app, you are using distributed computing. Your front end (vue) and back end (java) are running in separate machines in most cases and are de-coupled so they don't have access to each other's methods directly. What you do instead is pass messages between them through API calls, usually http REST calls.

So what you need to do is expose your java methods in a restful API, then have your front end send http requests to it and get responses. To send http requests in javascript you use Ajax.

I think you should start with learning how to make your java program listen and respond to api requests, run it on your machine and use a tool like curl or postman to manually send requests to it and see the response (don't worry, it's not that complex).

When you have that figured out, then add the necessary code to your vue to send the same type of request via ajax and voila, you're done.

The next step would be to set up a DB that the java program would connect to and persist the data from the requests in. And then you could try setting up servers for the back-end and db in a cloud provider, hook them up so they can communicate and run your vue on a web server in the cloud to get a step closer to the real-life scenario.

Here's a couple of howtos:
https://medium.com/bb-tutorials-and-...d-4e9d72bb8ce5
https://developer.okta.com/blog/2018...spring-and-vue

Btw, if you're not dead set on Java, might I suggest giving Golang a try. It's c-like and procedural so transitioning from java is a breeze. It's much more straight forward to set up a simple restful API and get it up and running. It compiles to a simple binary that you just execute. No need for all those extra frameworks like Springboot or Maven etc.

Hope this helps.

Last edited by Wolfram; 10-17-2020 at 09:22 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-17-2020 , 11:51 PM
Sup wolf? Did you plan on the managerial direction or just kinda of lean towards it when it was offered?

I’ve always planned to stay away from management but I assume there’s still interesting challenges included. Just different
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-18-2020 , 01:40 AM
The only thing I've known concretely in my 22 year dev career is I never want to go into management. Because a) I hate managing people and corporate BS and b) once you aren't up on the latest technical stuff it seems very had to get it back.

There is a technical dev manager route where you're still doing stuff - which I've seen work. But usually it's more like you hang up your spurs and just deal with HR crap.

One nice thing about being technical is that you can basically tell your company to **** off any time you want, and just go get a new job. They know that and treat you accordingly. Once you become a people person, most of your worth to the company is tied up in internal politics. That doesn't transfer to other jobs. So you can't just tell your boss to go to hell. Which of course he also knows, and consequently shits all over you.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-18-2020 , 02:40 AM
Quote:
Originally Posted by Wolfram
when he came to pick up his stuff
Coming into an office? What's that?!?!

A month or two ago I sent an email to a few people, one of whom is based in Europe, and got an OOO auto-response of "I'm traveling around Italy". I cried inside

(congrats on being a boss!)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-18-2020 , 08:37 AM
Quote:
Originally Posted by PJo336
Sup wolf? Did you plan on the managerial direction or just kinda of lean towards it when it was offered?

I’ve always planned to stay away from management but I assume there’s still interesting challenges included. Just different
I took over an important project as a dev and led it to completion, they noticed. We restructured our teams and needed more team managers so they offered me the position with the promise that I could always go back if I wanted.

I decided to try it out, mostly because I was curious and also because I thought I would do a good job and help out my office. We were a 100 person startup that was gobbled up by the fortune 500 and the culture there is very good so I do care about our success. I also felt that I'm getting older (45) and it would be a nice opportunity for professional and personal growth. I'm a big believer in anti-fragile.

Quote:
Originally Posted by goofyballer
(congrats on being a boss!)
Thanks

Last edited by Wolfram; 10-18-2020 at 09:06 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-18-2020 , 08:53 AM
Quote:
Originally Posted by suzzer99
But usually it's more like you hang up your spurs and just deal with HR crap.

One nice thing about being technical is that you can basically tell your company to **** off any time you want, and just go get a new job. They know that and treat you accordingly. Once you become a people person, most of your worth to the company is tied up in internal politics. That doesn't transfer to other jobs. So you can't just tell your boss to go to hell. Which of course he also knows, and consequently shits all over you.
So far, most of my work is involved in project management, not people management. I sit in meetings discussing features, improvements, and necessary bug fixes then write the tech specs and create tickets. After that there's a lot of delegation. The people management is also a part of it but I find that enjoyable. I'm talking to my guys, getting them motivated, helping them when they get stuck, making sure they're being heard up the ladder when something is off etc. I also get to give them bonuses when they do great work which is awesome.

I do get to play around with the tech, mostly for doing small POCs, mentoring or debugging issues. I've found that if I assigned a dev ticket to myself, it would get pushed back week after week cause I didn't have time to do all the nitty gritty work.

The main annoyance is the big recurring zoom meetings where there's 50 ppl there from multiple offices of our company and our faang partners (namedrop ) and usually only the same 3-4 ppl talk during an hour. So I just started skipping those and trusting my coworker to relay anything to me that I need to respond to.

I don't agree that people skills don't transfer to new companies. If you have a solid engineering resume before and then cap it with a manager role I think that speaks volumes to your capabilities.

Last edited by Wolfram; 10-18-2020 at 09:08 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-18-2020 , 11:50 AM
Wolfram,

Congratulations on your new position. Like suzzer, I never wanted to be management--too misanthropic and too low a tolerance for bullshit. Glad that it's working out for you.

Another positive you'll bring to management is an ability to not be snowed by technical people when they just don't feel like doing it right. You'll be able to call them on it, and even provide technical guidance if they truly don't understand.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-18-2020 , 12:24 PM
I went from a role similar to wolfram’s, now I am purely technical and I love it. I can’t quite tell my company to pound sand, but I don’t have to deal with bullshit and can just keep my head down and do my work and collect raises/bonuses fairly stress free. My boss is paid to stress out. It’s great, wish I had done it sooner
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-18-2020 , 01:43 PM
I've flip flopped back and forth from contributor to manager and I think the most important thing as far as happiness is what my boss is like. If you have a shitty boss being a manager is a complete beating. If you have a good boss being a manager is great. If I have a shitty boss I'd much rather just be a contributor.

My current boss is awesome and my team is great so I'm really happy I'm a manager and not coding. We are doing some complicated stuff with a lot of moving parts and I'm glad I have only had to learn the big picture stuff and not have to get into brass tacks and become an expert in a bunch of new technologies.

I'm old now so I'll probably just stick to management from here on out, but I did find out the hard way over the last few years it's often hard to get hired into someplace as a manager, sometimes you have to come in as a contributor and work your way back up.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-18-2020 , 02:14 PM
Quote:
Originally Posted by Wolfram
I think there's a slight gap in understanding here. When you make a full-stack app, you are using distributed computing. Your front end (vue) and back end (java) are running in separate machines in most cases and are de-coupled so they don't have access to each other's methods directly. What you do instead is pass messages between them through API calls, usually http REST calls.

So what you need to do is expose your java methods in a restful API, then have your front end send http requests to it and get responses. To send http requests in javascript you use Ajax.

I think you should start with learning how to make your java program listen and respond to api requests, run it on your machine and use a tool like curl or postman to manually send requests to it and see the response (don't worry, it's not that complex).

When you have that figured out, then add the necessary code to your vue to send the same type of request via ajax and voila, you're done.

The next step would be to set up a DB that the java program would connect to and persist the data from the requests in. And then you could try setting up servers for the back-end and db in a cloud provider, hook them up so they can communicate and run your vue on a web server in the cloud to get a step closer to the real-life scenario.

Here's a couple of howtos:
https://medium.com/bb-tutorials-and-...d-4e9d72bb8ce5
https://developer.okta.com/blog/2018...spring-and-vue

Btw, if you're not dead set on Java, might I suggest giving Golang a try. It's c-like and procedural so transitioning from java is a breeze. It's much more straight forward to set up a simple restful API and get it up and running. It compiles to a simple binary that you just execute. No need for all those extra frameworks like Springboot or Maven etc.

Hope this helps.
Thanks for a thought-out post. I also did some research and found out about a library called Jackson which essentially lets to serialize Java objects into JSON and vice-versa. For the HTTP requests I initially used vue-resource, but even the creator of the framework suggests not using it so switched to Axios.

On another note, could anyone here who is well-versed in Vue explain to me why does the following code give me TypeErrors:
Code:
<template>
  <div id="app">
    {{ obj2.key }}
  </div>
</template>

<script>
export default {
  name: 'App',
  data() {
    return {
      obj1: {
        key: 'value'
      },
      obj2: {
        key: this.obj1.key
      }
    };
  }
};
</script>
And the warnings/errors that result:

It seems to stem from the fact that I'm assigning the value of the first object's property to another object's property and then trying to render it, but other than that I'm pretty much clueless. Is there any way to make this work?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-18-2020 , 11:20 PM
This isn't strictly TypeError; obj2 is undefined. The data object isn't instantiated until the first tick, so there is nothing bound to "this" until the next tick. This means you want to instantiate your object as null in data(), then bind them in other functions (if they aren't constants). In this case, you probably want to bind obj2 inside mounted().

The docs for VueJS are horrible, but this sort of gives an overview:

https://vuejs.org/v2/guide/reactivity.html#For-Objects
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-15-2020 , 09:42 PM
Hey there, I have the following situation.

I quit company A cause even the pay wasn't bad I felt underpaid cause it had a stressful working environment and also old tech, manual deployments, almost no automated test, etc. The new company where I'm working B, looks good so far, nice development process and nice environment, entrepreneurial style for being a big company and a 10% raise from company A.

But, in a few weeks in company B, for some reason, I got in touch with company A, and they offer me a substantial rise (30%) compared to company B, so I had to decide if go for money and stress or stay in company B where things look good so far.

I know for every person works differently, but curious to know what other people would do.

Last edited by DontGoft; 12-15-2020 at 09:59 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-15-2020 , 11:51 PM
I just realized you have to quit company B to go back to company A. Don't do that. It has to be a complete dumpster fire there if they're begging you to come back. You'd be expected to fix everything and they'd probably just fire you as soon as you do. No way that's worth an extra 30% imo. Plus it's a dick move to Company B

But only you can say what your price is.

It's also kinda important to know what level you're at. If this is junior dev where you jump from $50k to $100k in a few years, totally not worth it. If you're getting 30% over $150k - well...

But I wouldn't do it. It's not in me to tell Company B to buzz off.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-16-2020 , 06:54 AM
Well, I'm not from US, and the range for developers is a little different here. I'm not junior, but neither at the top, it's something in between. The salary that A is offering me is not that hard to find in the market, but it can take a while.
For being a dumpfire there, not sure, well, it's possible, but I think it is more that they have a hard time finding people. I saw some jobs offers on linkedin

But yeah, probably staying in B, apart from being a dick move if I left, I could lose both if I play it badly.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-16-2020 , 10:33 AM
I have to agree with suzzer, it's not worth the money to go to a known bad situation.

Reminds me of a "great opportunity" I was sent by a recruiting chimp the other day. The job's listed responsibilities were like:
  • Development
  • Testing
  • Deployment
  • Database
  • Networking

In other words, they're too cheap/incompetent to have DBA/QA/Developer/IT people, and want someone who can be "they guy that knows about computers."

Wouldn't touch that dumpster fire with a 10-foot pole.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-16-2020 , 11:53 AM
You could talk to your manager and explain your conundrum. Maybe they'd be willing to give you a small paybump that could lock up the decision for you.

It's risky though, they could take it the wrong way. Have to use judgment based on what kind of managers you have and your current relationship with them.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m