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

03-20-2015 , 04:41 AM
Quote:
Originally Posted by RogerKwok
is there a standard way to handle user information in the frontend?

what we have been doing is on every route change, we hit the DB for user info. so if we go to the groups page, there's 1 request to get user PK, and another request to get related groups by that PK.

i thought it'd be better to store the PK in a service (Angular), then on each route change, only hit DB if PK is undefined.

so everything works...unless the user is already on the groups page and refreshes the page. then the PK is undefined, and while a request goes to fetch it, a second request has been made to get related groups, which won't work.

is there a standard approach here? i can put wait before the second request, but seems clunky, since there's a lot of pages that get related objects.
How much user information are we talking? I have been doing this **** recently. The gold standard is to use OpenID Connect and obtain a JWT identity token. The token is digitally signed by the issuing party in a manner that can be verified by client-side libraries. It's designed for identity information to be used by phone apps and stuff in an offline condition.

Stuff like the id of the user can be included as a claim.

Edit: The JWT gets persisted between requests as a cookie, obviously.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 10:30 AM
Quote:
Originally Posted by jmakin
... I'm gonna do that again this time, but maybe a little more intensive, because I feel like my group may get a C on this project so I need my tests to count...
I had an experience very similar to this while doing my MBA. When I was doing comp sci as an undergrad, our classes were so small that I never had a group project where I was saddled with slugs.

This accounting class I had (non-majors taking it as a requirement, by and large) had a group project component. Fine. Basically, most of our classes had group work, because that mimics how it is "in the real world." We were ASSIGNED groups. We did not have any say so, whatsover. The professor's reasoning was that he was spreading people by their concentrations (majors), so that each group would be diverse by skill set.

Within one minute of breaking into these groups, one of the guys says "I am satisfied with working towards a B." Everyone but me snap-agreed. I tried to motivate the group to achieve better than that, but I was shut down, outvoted, etc.

We do the project. I present my part. The professor says in front of the class that I was one of the best natural public speakers that he had ever seen. I am not THAT good, but what I am is usually natural, and compared to someone who is actually "better" than me, but stiff, it plays very well.

As a group we got a B. Or was it a B+? Can't remember that part.

I got an A- or A on EVERYTHING I turned in that I had anything to do with besides that damn project.

Guess what grade I got? Yep. The points were close, but I got my only B+ that semester because of something I had NO control over. I didn't pick the group. I tried to motivate them (professional tutor for 12 years). I performed my contribution to the group at the highest level in the class, as far as the prof was concerned.

I met with the prof later, and he stood by his grading system. I told him that if his system allowed for someone in my situation (see above) to receive a B, then it was flawed, even if slightly. He politely disagreed, and I respectfully re-disagreed. Mucked.

jmakin = Do everything in your power to get max points on everything you touch for the rest of the term. Wouldn't want you to join this club. Haha!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 10:53 AM
Going all analysis paralysis again. How much does stuff like this matter? At all? If you're just starting out should it be something to consider?

This article got me thinking about if I made the right choice going into c++. Embedded systems/financing not really areas that interest me all that much. Is that where most c++ programmers end up if they're beginners? (Well, probably not finance, as they want lots of experience, but you know what I mean)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 11:17 AM
So sprites are basically a giant image of images that you use CSS to select certain parts of each time you need a specific image? basically like:

imageA [
starts at width: 10px
ends at width: 20 px
height: 20 px
]

So anytime you need to change a single image you replace the giant image of sprites?

I guess I understand why this is useful in video games, but why the **** would you ever do this in business applications? I dunno, I'm just not seeing an advantage to ever doing this.

Actually, I get conceptually how it would result in faster page loads because you are making less HTTP requests for images, and only making one call to the large image and then using the CSS to parse out individual images.

Would definitely be something you don't want to over use though because making changes would be a bitch.

Last edited by Larry Legend; 03-20-2015 at 11:26 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 11:25 AM
Quote:
Originally Posted by Larry Legend
So sprites are basically a giant image of images that you use CSS to select certain parts of each time you need a specific image? basically like:

imageA [
starts at width: 10px
ends at width: 20 px
height: 20 px
]

So anytime you need to change a single image you replace the giant image of sprites?

I guess I understand why this is useful in video games, but why the **** would you ever do this in business applications? I dunno, I'm just not seeing an advantage to ever doing this.
It's an http performance optimization. If you have a bunch of little images, your browser only needs to make a single request this way, rather than 50 separate requests for little files.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 11:31 AM
Quote:
Originally Posted by Anais
Going all analysis paralysis again. How much does stuff like this matter? At all? If you're just starting out should it be something to consider?

This article got me thinking about if I made the right choice going into c++. Embedded systems/financing not really areas that interest me all that much. Is that where most c++ programmers end up if they're beginners? (Well, probably not finance, as they want lots of experience, but you know what I mean)
I can't speak to the career opportunities of C++, but I am certain it wasn't the right choice, because C++ is pure evil.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 11:36 AM
So my people tell me we don't use sprites that much anymore, but have done it in the past, and have done it on occasion when it makes sense to. We don't often build sites with tons of little images.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 11:38 AM
It's not like you can't learn almost any language in a few weeks anyway.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 12:00 PM
I seem to remember using sprites for buttons a lot so that you'd get really fast response times or something. It was awhile ago though.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 12:06 PM
Quote:
Originally Posted by Larry Legend
So my people tell me we don't use sprites that much anymore, but have done it in the past, and have done it on occasion when it makes sense to. We don't often build sites with tons of little images.
Css has the ability to do what most background sprites did anyway, the gradient effect. Except it scales/stretches better and with less effort and worry.

It's sad that a single html/css class was all it took for me to be able to make more professional looking backgrounds than what some of our software suppliers use.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 12:12 PM
LOL g_m & jj, I'm sober now

Quote:
Originally Posted by Anais
Going all analysis paralysis again. How much does stuff like this matter? At all? If you're just starting out should it be something to consider?

This article got me thinking about if I made the right choice going into c++. Embedded systems/financing not really areas that interest me all that much. Is that where most c++ programmers end up if they're beginners? (Well, probably not finance, as they want lots of experience, but you know what I mean)
If you're a beginner, you're not really a "C++ programmer" as far as the job market is concerned. You're a programmer with some knowledge of C++. Languages you know don't have much to do with your employability at that level because:

Quote:
Originally Posted by jmakin
It's not like you can't learn almost any language in a few weeks anyway.
This changes at a senior level because simply being able to code in a language is no longer enough.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 01:01 PM
Unit test epic dragon battle day 4 update: I found out a lot of our angular components are setting window.localStorage directly (instead of using a mockable service like $window). It's never a good sign when you duplicate a test file, run both the original and duplicate in sequence, and one passes and while the other fails. I guess we all naively assumed that karma/phantom would reset itself between each test file.

Further compounding the problem is that the call to set localStorage seems to be happening asynchronously - so a certain number of tests in the second test file will pass until one fails. At one point I had 3 identical test files - two would pass and the 3rd failed. I finally figured out what was going on by putting console.logs in all the angular methods in the service.

Debugging someone else's test, who's brand new to unit testing, which is testing a 3rd person's angular code written 2 years ago - is fun.

I tried to fix one of the angular components by injecting $window and changing everything over to use that, but kept getting weird results. So I added a beforeEach that clears localStorage and sessionStorage after every test. No idea if this is the best solution but it seems to be helping with stability.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 01:11 PM
That sounds brutal. Sorry you have to deal with that crap.

Does anyone have advice on asking for a raise? Advice in the general sense would be helpful but even better would be discussing my situation specifically. Obviously I don't want to post lots of private information publicly, but I'm happy to discuss over PM
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 01:31 PM
Quote:
Originally Posted by candybar
If you're a beginner, you're not really a "C++ programmer" as far as the job market is concerned. You're a programmer with some knowledge of C++. Languages you know don't have much to do with your employability at that level because:



This changes at a senior level because simply being able to code in a language is no longer enough.
The local code mill I think finds appropriate places for people based off what they focused on in school. My school technically has multiple paths to a degree, with focuses on c++ or Java. Just not sure which I'd prefer, which would have more job opportunities, or if it really matters at all.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 01:38 PM
Quote:
Originally Posted by Anais
The local code mill I think finds appropriate places for people based off what they focused on in school. My school technically has multiple paths to a degree, with focuses on c++ or Java. Just not sure which I'd prefer, which would have more job opportunities, or if it really matters at all.
It depends a lot on the particular field(s) you are interested in.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 01:42 PM
Quote:
Originally Posted by blackize5
That sounds brutal. Sorry you have to deal with that crap.

Does anyone have advice on asking for a raise? Advice in the general sense would be helpful but even better would be discussing my situation specifically. Obviously I don't want to post lots of private information publicly, but I'm happy to discuss over PM
Understand where you stand and what your best alternatives are.
Understand where they stand and what their best alternatives are.
Come up with a figure that's equitable from a bargaining perspective.
Optionally, if you suffer from an impostor syndrome, spend time getting yourself to believe that you're worth this much, so that you don't come across as someone who's asking for something they don't feel they deserve.
Learn how to present this in more of a fairness argument that makes sense from their perspective, even if it's irrelevant from a pure bargaining perspective.
Present the case.
Get used to a bigger paycheck.
Repeat as necessary.

Feel free to pm me.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 01:56 PM
Note the above may not apply to most large corporations. At my company (and the other large company I worked for) it's "threaten to quit and be serious about it". When the promotion finally comes it's take it or leave it, no negotiation. At least at my level.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 02:04 PM
Quote:
Originally Posted by Anais
The local code mill I think finds appropriate places for people based off what they focused on in school. My school technically has multiple paths to a degree, with focuses on c++ or Java. Just not sure which I'd prefer, which would have more job opportunities, or if it really matters at all.
Where are you located? Big metro area or somewhere much smaller? Unless you're limited to just a few employers and you happen to know exactly what they are looking for, I don't think any of this really matters. There are lots of jobs. Just do what you find interesting, become actually good at programming and worry about employability later.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 02:31 PM
Quote:
Originally Posted by suzzer99
Note the above may not apply to most large corporations. At my company (and the other large company I worked for) it's "threaten to quit and be serious about it". When the promotion finally comes it's take it or leave it, no negotiation. At least at my level.
Yeah, the situation you get stuck sometimes in a large bureaucracy is that your boss has no ability to get a raise for you and the guy who does, doesn't know you. But I'm not sure if that situation is the norm even in a large corporation. It's more likely that you were already at or near the top of the pay grade for your level, which makes this a difficult fight for your boss or someone is playing a calculated gamble that you will back down.

Btw, I'm talking in a roundabout way (because that's generally how you should threaten to quit in a negotiation with most normal people) but if a raise is equitable from a bargaining perspective, that usually means you should be willing to quit if you don't get the raise. I'd absolutely say something like:

"Of course I want to stay here and wouldn't go interview and try to get offers or anything like that but you know I talk to a lot of people in the industry and it seems that my salary at $X is just too far below the standard. Something like $Y would be I could get at a lot of places. But I clearly value working here and I want to keep building on top of what I've accomplished, for example the AAA and BBB projects that I delivered last year and I absolutely wouldn't want to quit on the CCC project that I'm working on because it's really important to me personally and I don't want to jeopardize it. So I'm willing to work at $Z and you know I'm going to work to make sure the value I deliver would easily exceed that.

Any reasonable manager would absolutely get the point.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 02:34 PM
My boss's wife works in finance and someone in her group printed off a resume and left it on the printer for an entire day.

It worked for this person, but ymmv.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 03:06 PM
Quote:
Originally Posted by candybar
Yeah, the situation you get stuck sometimes in a large bureaucracy is that your boss has no ability to get a raise for you and the guy who does, doesn't know you. But I'm not sure if that situation is the norm even in a large corporation. It's more likely that you were already at or near the top of the pay grade for your level, which makes this a difficult fight for your boss or someone is playing a calculated gamble that you will back down.

Btw, I'm talking in a roundabout way (because that's generally how you should threaten to quit in a negotiation with most normal people) but if a raise is equitable from a bargaining perspective, that usually means you should be willing to quit if you don't get the raise. I'd absolutely say something like:

"Of course I want to stay here and wouldn't go interview and try to get offers or anything like that but you know I talk to a lot of people in the industry and it seems that my salary at $X is just too far below the standard. Something like $Y would be I could get at a lot of places. But I clearly value working here and I want to keep building on top of what I've accomplished, for example the AAA and BBB projects that I delivered last year and I absolutely wouldn't want to quit on the CCC project that I'm working on because it's really important to me personally and I don't want to jeopardize it. So I'm willing to work at $Z and you know I'm going to work to make sure the value I deliver would easily exceed that.

Any reasonable manager would absolutely get the point.
We get a performance-based % raise every year which, along with our bonus, comes out of a fixed bucket for the entire department. My boss always tells me how he fought for me (which I'm sure he tells everyone). There is no such thing as a random raise in the middle of the year w/o a promotion. At least I've never heard of one. Agitating could help my yearly raise - maybe .5-1% max.

There are promotions which seem to come about every 3 years give or take 6 months for performance. My promotion came in Q3 last year. I know there is zero chance of getting another one in less than 2 years as it would completely upset the apple cart. If I'm still here after 2 years I'll have to start threatening to quit again, and they'll drag it out for several quarters.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 03:24 PM
Quote:
Originally Posted by MadTiger
I had an experience very similar to this while doing my MBA. When I was doing comp sci as an undergrad, our classes were so small that I never had a group project where I was saddled with slugs.

This accounting class I had (non-majors taking it as a requirement, by and large) had a group project component. Fine. Basically, most of our classes had group work, because that mimics how it is "in the real world." We were ASSIGNED groups. We did not have any say so, whatsover. The professor's reasoning was that he was spreading people by their concentrations (majors), so that each group would be diverse by skill set.

Within one minute of breaking into these groups, one of the guys says "I am satisfied with working towards a B." Everyone but me snap-agreed. I tried to motivate the group to achieve better than that, but I was shut down, outvoted, etc.

We do the project. I present my part. The professor says in front of the class that I was one of the best natural public speakers that he had ever seen. I am not THAT good, but what I am is usually natural, and compared to someone who is actually "better" than me, but stiff, it plays very well.

As a group we got a B. Or was it a B+? Can't remember that part.

I got an A- or A on EVERYTHING I turned in that I had anything to do with besides that damn project.

Guess what grade I got? Yep. The points were close, but I got my only B+ that semester because of something I had NO control over. I didn't pick the group. I tried to motivate them (professional tutor for 12 years). I performed my contribution to the group at the highest level in the class, as far as the prof was concerned.

I met with the prof later, and he stood by his grading system. I told him that if his system allowed for someone in my situation (see above) to receive a B, then it was flawed, even if slightly. He politely disagreed, and I respectfully re-disagreed. Mucked.

jmakin = Do everything in your power to get max points on everything you touch for the rest of the term. Wouldn't want you to join this club. Haha!
It's gonna happen to me too. I'm ready for it, but I'm certainly not going down without a fight. Group projects in school are the absolute worst and I have never been in one that wasn't a trainwreck.

Quote:
Originally Posted by Anais
The local code mill I think finds appropriate places for people based off what they focused on in school. My school technically has multiple paths to a degree, with focuses on c++ or Java. Just not sure which I'd prefer, which would have more job opportunities, or if it really matters at all.
You don't focus on a specific language in school - other than your few introductory programming classes, the rest is way, way different. Every other class expects you already know how to program and many of them don't care what language you do it in. The school I want to transfer to uses python for most things - but it's not like I'm gonna graduate and be completely unable to get a job that uses java or something. Languages are just tools to do a specific thing, proficiency in one tool or another is not gonna swing the scales a lot unless you're a languages expert or something which you probably aren't gonna be.

It's kind of like say, you're a pro baseball player about to get drafted, your whole career so far you've used aluminum bats, same brand - and obviously MLB is a wood bat league. It's not like you don't know how to swing that wood bat, it just takes adjustment. and it's not like you aren't gonna get drafted when you crush the ball for 400 ft with an aluminum bat.

kind of get what I'm saying? more knowledgeable people here can correct me if i'm way off but IME so far using other languages hasn't been problematic for me and I've dabbled with several. Once you get past the initial syntax and how a language does certain things (static/dynamic typing stuff like that) and familiarize yourself with the existing tools and libraries, it's not like you're gonna be massively handicapped if all you've used is C++ for years.

my 2c from a fellow noob
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 03:27 PM
As far as the sprites discussion goes - yea, this guy isn't thinking anything like that. he thinks he knows software architecture because he started developing his own crappy game using this platform or something. And games use a lot of sprites.

That's why he's planning on using a sprite for a blinking cursor. **** me in the ****ing ass this is gonna suck. My job now is to design the visual layout and flow of the log in screens and inventory screens. I have no idea what he wants of course but whatever I come up with he's inevitably not gonna like and he wants me to cut up my screens into individual png's so he can make them into sprites.

my GOD
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 04:22 PM
Quote:
Originally Posted by RogerKwok
is there a standard way to handle user information in the frontend?

what we have been doing is on every route change, we hit the DB for user info. so if we go to the groups page, there's 1 request to get user PK, and another request to get related groups by that PK.

i thought it'd be better to store the PK in a service (Angular), then on each route change, only hit DB if PK is undefined.

so everything works...unless the user is already on the groups page and refreshes the page. then the PK is undefined, and while a request goes to fetch it, a second request has been made to get related groups, which won't work.

is there a standard approach here? i can put wait before the second request, but seems clunky, since there's a lot of pages that get related objects.
How about one request per page then store the information in HTML5 session storage? You can check before making each request if the data you going to be requesting already exists in the session storage. If it does, load it from there, else follow through with the request.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-20-2015 , 04:32 PM
Yea, I can see where he is coming from in terms of having built a video game and now he sees everything through that lens.

I can also understand now why sprites are so popular in video games because everything is super visual in nature, so you end up with a ton of small images.

The thing I am not understanding is why you have so many images for a POS system. Seems like that is a pretty bad idea and he is over complicating the whole concept from a front-end perspective and making more work for the back-end.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m