Open Side Menu Go to the Top

05-24-2015 , 02:17 PM
ok I'm just realizing you're going from c++ to java which is just back ****ing asswards so that's why there may be confusion:

in java a "literal" means exactly that. it is literally data, without any computation required.

for example when I write:

int a = 2;

the 2 is a literal data value. The reason for this distinction is because in Java, everything is an Object. Nearly everything. When you declare an int, it's not technically a primitive, like in c++. It uses a "wrapper" class called Integer to construct the object and uses the literal value 2 to construct it. In c++ this doesn't happen at all. an int is just that, an int. you could say all primitives in c++ would be literals in java.

anyone who can explain better feel free to correct me
** 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 **
05-24-2015 , 02:29 PM
Sorry i am mistaken. No Integer object is created. It's a primitive, called a "literal."
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-24-2015 , 02:46 PM
Quote:
anyone who can explain better feel free to correct me
This is certainly 1000% better of an explanation than what's in this book. :shrug:
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-24-2015 , 02:51 PM
Well, i'm wrong, so. Look up "java autoboxing" for more insight as to how java deals with literal values
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-24-2015 , 03:18 PM
So if I say int k = 0, that k is an object and the zero is converted to the wrapper class Int instead of being a lower case i int

Or something

Still not sure what that has to do with literals, but I'll keep reading. Appreciate the responses
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-24-2015 , 03:44 PM
You don't really need to get too hung up on literals in Java. The only time they matter is when you are distinguishing between different types.
You'll get a compiler error if you try to assign the wrong type of literal to a variable. For ex.
Long a = 12;
float b = 123.0;
produce compiler errors.

You should use a different literal instead to fix the problem:
Long a = 12L;
float b = 123.0f;
would compile because you're telling the compiler to explicitly use a long for the 12 and a float for the 123.0, where before they were interpreted as int and double.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 07:12 AM
It never fails to amaze me how many things take me years to finally see the significance.

First saw this at least 3 years ago, but had no clue what it all meant.
http://en.wikipedia.org/wiki/Exponentiation_by_squaring
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 09:27 AM
Quote:
Originally Posted by maxtower
You don't really need to get too hung up on literals in Java. The only time they matter is when you are distinguishing between different types.
You'll get a compiler error if you try to assign the wrong type of literal to a variable. For ex.
Long a = 12;
float b = 123.0;
produce compiler errors.

You should use a different literal instead to fix the problem:
Long a = 12L;
float b = 123.0f;
would compile because you're telling the compiler to explicitly use a long for the 12 and a float for the 123.0, where before they were interpreted as int and double.
what if i don't assign 12, but do a nextLong and the user inputs 12. Is that a problem, or does the runtime environment figure it out or whatnot?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 10:18 AM
Quote:
Originally Posted by daveT
It never fails to amaze me how many things take me years to finally see the significance.

First saw this at least 3 years ago, but had no clue what it all meant.
http://en.wikipedia.org/wiki/Exponentiation_by_squaring
Thanks for the link that caused my morning to spiral into an unending wiki dive into abstract algebra
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 11:36 AM
Quote:
Originally Posted by Low Key
what if i don't assign 12, but do a nextLong and the user inputs 12. Is that a problem, or does the runtime environment figure it out or whatnot?
Scanner.nextLong() attempts to parse the next token as a long. If the token can't be interpreted as long, it will throw an exception. No need for any runtime magic

Quote:
Long a = 12;
float b = 123.0;
produce compiler errors.
Just for completeness, the Long example fails because the autoboxing doesn't work from int to Long (int -> long -> Long), but int -> long does work fine implicitly.

Java generally allows implicit casting of primitives if there is no loss of accuracy, e.g.:

long a = 12;
double b = 123.0f;
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 12:06 PM
Oh man, don't even get me started on all that accuracy stuff. double 1.0 - 0.1 - 0.1 - 0.1 - 0.1 - 0.1 = 0.50000000001?

The **** is that ****?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 12:22 PM
Quote:
Originally Posted by Low Key
Oh man, don't even get me started on all that accuracy stuff. double 1.0 - 0.1 - 0.1 - 0.1 - 0.1 - 0.1 = 0.50000000001?

The **** is that ****?
http://en.m.wikipedia.org/wiki/Floating_point

http://en.m.wikipedia.org/wiki/Doubl...g-point_format

A trade off in representing a large range of the infinite size of the real numbers within the finite addressing/memory on the PC. The trade off is accuracy in your calculations.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 05:05 PM
Best resource I've ever seen for finding out about tech salaries: http://data.jobsintech.io/companies

Edit: Really fascinating! Not to toot my own horn of course.

Last edited by jjshabado; 05-27-2015 at 05:21 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 05:30 PM
Looking at avg of 70k where I want to work
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 07:56 PM
Quote:
Originally Posted by jjshabado
Best resource I've ever seen for finding out about tech salaries: http://data.jobsintech.io/companies

Edit: Really fascinating! Not to toot my own horn of course.
that is really cool

they weren't lying about Netflix salaries!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 09:10 PM
This is like Visa applications or something right? Not necessarily avg. salary?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 09:30 PM
It's H1-B applications. But those have to be posted in the workplace so they're typically the standard pay for the job title (otherwise existing employees are probably going to be jealous).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 09:37 PM
That's really useful data. I analyze data for a large tech firm and will be looking into using this. Thanks for posting jj.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 09:39 PM
Quote:
Originally Posted by jjshabado
It's H1-B applications. But those have to be posted in the workplace so they're typically the standard pay for the job title (otherwise existing employees are probably going to be jealous).
I'm wondering if they might be slightly lower because people needing a visa have a restricted job market (i.e. can't work for earlier stage startups) and require a large capital investment from the hiring firm (sponsoring the visa).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 09:41 PM
I'm pretty sure I read that the salaries must be comparable to existing salaries for the position. Check the wiki on h1b visas. That's what I was reading earlier.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 09:44 PM
Quote:
Originally Posted by sthief09
I'm wondering if they might be slightly lower because people needing a visa have a restricted job market (i.e. can't work for earlier stage startups) and require a large capital investment from the hiring firm (sponsoring the visa).
I believe the H1-B has to match the salary paid non H1-B employees in the same position and with the same experience.

My salary has always matched the salary posted for the equivalent position but I'm not an expert and I've always been on a different visa.

I'm not sure how bonuses/options compare though.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2015 , 09:52 PM
oh ok, makes sense. i guess that would be bad for everyone if it weren't that way.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-28-2015 , 12:51 AM
Quote:
Originally Posted by jjshabado
I believe the H1-B has to match the salary paid non H1-B employees in the same position and with the same experience.

My salary has always matched the salary posted for the equivalent position but I'm not an expert and I've always been on a different visa.

I'm not sure how bonuses/options compare though.
Well I checked my company and the number that comes up is about what we'd pay a contract project manager who's going to permanent. It's less than any dev makes afaik. It's about 60% of what I make, and there are a lot of devs that make more than me.

I think my company may give out a lot of H1Bs for SQA-type jobs.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-28-2015 , 02:20 AM
You can click on the year link and it will show you specific titles and salaries
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-28-2015 , 02:27 AM
Quote:
Originally Posted by jjshabado
Best resource I've ever seen for finding out about tech salaries: http://data.jobsintech.io/companies

Edit: Really fascinating! Not to toot my own horn of course.
Nice find and bookmarked.
Going to use this site to always gauge how much I ask for when questioned or when applying.
** 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