|
On September 09 2017 09:01 eieio wrote:comment on my pic u shit
just checked my company's interview calendar for no reason and it turns out we're interviewing a highschool friend of mine on monday lol Man that's sick! What sort of job, same as you? Or is that confidential?
|
On September 09 2017 09:02 intotheheart wrote:Show nested quote +On September 09 2017 09:01 eieio wrote:On September 09 2017 09:00 PassiveAce wrote: Yeah it rules comment on my pic u shit
just checked my company's interview calendar for no reason and it turns out we're interviewing a highschool friend of mine on monday lol Man that's sick! What sort of job, same as you? Or is that confidential? ya a dev job, there's nothing wrong with saying that 
the set of questions I wouldn't answer about work mostly involves how we actually make money, and on the internet probably the names of people I work with xd
|
On September 09 2017 09:05 eieio wrote:Show nested quote +On September 09 2017 09:02 intotheheart wrote:On September 09 2017 09:01 eieio wrote:On September 09 2017 09:00 PassiveAce wrote: Yeah it rules comment on my pic u shit
just checked my company's interview calendar for no reason and it turns out we're interviewing a highschool friend of mine on monday lol Man that's sick! What sort of job, same as you? Or is that confidential? ya a dev job, there's nothing wrong with saying that  the set of questions I wouldn't answer about work mostly involves how we actually make money, and on the internet probably the names of people I work with xd You mean playing games all day and shortly before deadline outsource to India? Saw right through you!
|
I'd love that sort of job. Where do I sign up?
|
On September 09 2017 09:12 Artisreal wrote:Show nested quote +On September 09 2017 09:05 eieio wrote:On September 09 2017 09:02 intotheheart wrote:On September 09 2017 09:01 eieio wrote:On September 09 2017 09:00 PassiveAce wrote: Yeah it rules comment on my pic u shit
just checked my company's interview calendar for no reason and it turns out we're interviewing a highschool friend of mine on monday lol Man that's sick! What sort of job, same as you? Or is that confidential? ya a dev job, there's nothing wrong with saying that  the set of questions I wouldn't answer about work mostly involves how we actually make money, and on the internet probably the names of people I work with xd You mean playing games all day and shortly before deadline outsource to India? Saw right through you! I mean I have been paid to play cards for ~6 hours this week
|
Because you finished early or because recreational activities are part of corporate policy or something top secret?
|
On September 09 2017 09:26 Artisreal wrote: Because you finished early or because recreational activities are part of corporate policy or something top secret? we use a card game (you could compare it to poker) to teach trading concepts. It's part of the class I'm taking at work about how to trade
A big chunk of the class this week was playing cards
I can't remember if I mentioned it here or not but I played an ex-MTG Pro (a hall of famer!) who works here now and I got rekt lol
we also play plenty of games after trading hours or w.e. but this was like a thing that I was officially required to do
|
i'm really hating printf right now. Keeps saying illegal format precision exception, but when i look online that's mostly people trying to convert a decimal to a double, but I'm trying to do decimal to float. Thought my issue was being on an android but it turns out that wasn't the problem.
No idea what's going on with the program. My professor had some really screwy format things going on but it turned out he set the wrong requirements online until 3pm today, and he set the due date to midnight tonight. I emailed and asked for an extension because the reference he's using was wrong and this was covered in the span of 3 sentences in class. (I got it, but I'm positive my whole class is beyond baffled right now).
|
On September 09 2017 09:01 eieio wrote:comment on my pic u shit
just checked my company's interview calendar for no reason and it turns out we're interviewing a highschool friend of mine on monday lol Lookin fly homie
|
On September 09 2017 10:55 Nevuk wrote: i'm really hating printf right now. Keeps saying illegal format precision exception, but when i look online that's mostly people trying to convert a decimal to a double, but I'm trying to do decimal to float. Thought my issue was being on an android but it turns out that wasn't the problem.
No idea what's going on with the program. My professor had some really screwy format things going on but it turned out he set the wrong requirements online until 3pm today, and he set the due date to midnight tonight. I emailed and asked for an extension because the reference he's using was wrong and this was covered in the span of 3 sentences in class. (I got it, but I'm positive my whole class is beyond baffled right now). post code
On September 09 2017 11:00 PassiveAce wrote:Show nested quote +On September 09 2017 09:01 eieio wrote:On September 09 2017 09:00 PassiveAce wrote: Yeah it rules comment on my pic u shit
just checked my company's interview calendar for no reason and it turns out we're interviewing a highschool friend of mine on monday lol Lookin fly homie  i aint fat dood
|
On September 09 2017 11:00 eieio wrote:Show nested quote +On September 09 2017 10:55 Nevuk wrote: i'm really hating printf right now. Keeps saying illegal format precision exception, but when i look online that's mostly people trying to convert a decimal to a double, but I'm trying to do decimal to float. Thought my issue was being on an android but it turns out that wasn't the problem.
No idea what's going on with the program. My professor had some really screwy format things going on but it turned out he set the wrong requirements online until 3pm today, and he set the due date to midnight tonight. I emailed and asked for an extension because the reference he's using was wrong and this was covered in the span of 3 sentences in class. (I got it, but I'm positive my whole class is beyond baffled right now). post code Show nested quote +On September 09 2017 11:00 PassiveAce wrote:On September 09 2017 09:01 eieio wrote:On September 09 2017 09:00 PassiveAce wrote: Yeah it rules comment on my pic u shit
just checked my company's interview calendar for no reason and it turns out we're interviewing a highschool friend of mine on monday lol Lookin fly homie  i aint fat dood + Show Spoiler [code] +import java.util.Scanner;
public class bu { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.println("Enter employee's name: "); String eName = input.nextLine(); System.out.println("Enter number of hours worked in a week: "); double hoursWorked = input.nextDouble(); System.out.println("Enter hourly pay rate: "); double hourPay = input.nextDouble(); System.out.println("Enter state tax withholding rate: "); double stateTaxr = input.nextDouble(); double grossPay; grossPay = hoursWorked*hourPay;
double fedTaxr;
if (grossPay < 100.00){ fedTaxr = 0; } else if (grossPay >=100.00 && grossPay <200.00){ fedTaxr = .05; } else if (grossPay >=200.00 && grossPay <300.00){ fedTaxr = .10; } else if (grossPay >=300.00 && grossPay <400.00){ fedTaxr = .15; } else if (grossPay >=400.00){ fedTaxr = .20; } else { System.out.println("Invalid input"); fedTaxr = 0.00; } double stateDed = (grossPay*stateTaxr); double fedDed = (grossPay*fedTaxr);
double netPay; netPay = grossPay-(stateDed)-fedDed; double totalDed = fedDed + stateDed;
//to make it possible to use printf double fedTaxrPercent = fedTaxr*100; double stateTaxrPercent = stateTaxr*100;
System.out.println("Employee Name: "+ eName); System.out.println("Hours Worked: " + hoursWorked); System.out.println("Pay Rate: " + "$"+ hourPay); System.out.println("Gross Pay: " + "$"+ grossPay); System.out.println("Deductions:"); System.out.printf("%s %2.2%% %.2f\n", "Federal Withholding " , fedTaxrPercent , fedDed); System.out.println(" State Withholding " + "("+ stateTaxrPercent+"%" +")"+ ":" + " $" + stateDed); System.out.println(" Total Deduction: " +"$"+ totalDed); System.out.println("Net Pay: " + "$"+ netPay); input.close(); } }
It's a really simple program, except that I'm coding on a tablet with a bluetooth keyboard and only had 4 hours to write it lol.
It collapses at federal withholding with the error. I had it worked out almost perfectly with println, but the issue is that mimir wants the deduction area to be listed with two decimal points, and I'm pretty sure that requires printf. (the textbook example he gave didn't, but when I emailed him he wanted me to use printf ... or at least I think that's what he meant).
edit: not sure how to post the nice code format in bbcode
|
On September 09 2017 11:00 eieio wrote:Show nested quote +On September 09 2017 10:55 Nevuk wrote: i'm really hating printf right now. Keeps saying illegal format precision exception, but when i look online that's mostly people trying to convert a decimal to a double, but I'm trying to do decimal to float. Thought my issue was being on an android but it turns out that wasn't the problem.
No idea what's going on with the program. My professor had some really screwy format things going on but it turned out he set the wrong requirements online until 3pm today, and he set the due date to midnight tonight. I emailed and asked for an extension because the reference he's using was wrong and this was covered in the span of 3 sentences in class. (I got it, but I'm positive my whole class is beyond baffled right now). post code Show nested quote +On September 09 2017 11:00 PassiveAce wrote:On September 09 2017 09:01 eieio wrote:On September 09 2017 09:00 PassiveAce wrote: Yeah it rules comment on my pic u shit
just checked my company's interview calendar for no reason and it turns out we're interviewing a highschool friend of mine on monday lol Lookin fly homie  i aint fat dood Come to Paris and prove it to me
|
On September 09 2017 11:06 Nevuk wrote:Show nested quote +On September 09 2017 11:00 eieio wrote:On September 09 2017 10:55 Nevuk wrote: i'm really hating printf right now. Keeps saying illegal format precision exception, but when i look online that's mostly people trying to convert a decimal to a double, but I'm trying to do decimal to float. Thought my issue was being on an android but it turns out that wasn't the problem.
No idea what's going on with the program. My professor had some really screwy format things going on but it turned out he set the wrong requirements online until 3pm today, and he set the due date to midnight tonight. I emailed and asked for an extension because the reference he's using was wrong and this was covered in the span of 3 sentences in class. (I got it, but I'm positive my whole class is beyond baffled right now). post code On September 09 2017 11:00 PassiveAce wrote:On September 09 2017 09:01 eieio wrote:On September 09 2017 09:00 PassiveAce wrote: Yeah it rules comment on my pic u shit
just checked my company's interview calendar for no reason and it turns out we're interviewing a highschool friend of mine on monday lol Lookin fly homie  i aint fat dood + Show Spoiler [code] +import java.util.Scanner;
public class bu { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.println("Enter employee's name: " ; String eName = input.nextLine(); System.out.println("Enter number of hours worked in a week: " ; double hoursWorked = input.nextDouble(); System.out.println("Enter hourly pay rate: " ; double hourPay = input.nextDouble(); System.out.println("Enter state tax withholding rate: " ; double stateTaxr = input.nextDouble(); double grossPay; grossPay = hoursWorked*hourPay;
double fedTaxr;
if (grossPay < 100.00){ fedTaxr = 0; } else if (grossPay >=100.00 && grossPay <200.00){ fedTaxr = .05; } else if (grossPay >=200.00 && grossPay <300.00){ fedTaxr = .10; } else if (grossPay >=300.00 && grossPay <400.00){ fedTaxr = .15; } else if (grossPay >=400.00){ fedTaxr = .20; } else { System.out.println("Invalid input" ; fedTaxr = 0.00; } double stateDed = (grossPay*stateTaxr); double fedDed = (grossPay*fedTaxr);
double netPay; netPay = grossPay-(stateDed)-fedDed; double totalDed = fedDed + stateDed;
//to make it possible to use printf double fedTaxrPercent = fedTaxr*100; double stateTaxrPercent = stateTaxr*100;
System.out.println("Employee Name: "+ eName); System.out.println("Hours Worked: " + hoursWorked); System.out.println("Pay Rate: " + "$"+ hourPay); System.out.println("Gross Pay: " + "$"+ grossPay); System.out.println("Deductions:" ; System.out.printf("%s %2.2%% %.2f\n", "Federal Withholding " , fedTaxrPercent , fedDed); System.out.println(" State Withholding " + "("+ stateTaxrPercent+"%" +" "+ ":" + " $" + stateDed); System.out.println(" Total Deduction: " +"$"+ totalDed); System.out.println("Net Pay: " + "$"+ netPay); input.close(); } } It's a really simple program, except that I'm coding on a tablet with a bluetooth keyboard and only had 4 hours to write it lol. It collapses at federal withholding with the error. I had it worked out almost perfectly with println, but the issue is that mimir wants the deduction area to be listed with two decimal points, and I'm pretty sure that requires printf. (the textbook example he gave didn't, but when I emailed him he wanted me to use printf ... or at least I think that's what he meant). edit: not sure how to post the nice code format in bbcode
i fixed it for you use [code] tags
|
I believe "%2.2%%" should be "%2.2f%%"
I also think your federal tax calculation is wrong. You're applying the highest marginal tax rate to all income instead of only applying it to the portion of income that should be taxed at that rate.
|
On September 09 2017 11:11 eieio wrote:I believe "%2.2%%" should be "%2.2f%%" I also think your federal tax calculation is wrong. You're applying the highest marginal tax rate to all income instead of only applying it to the portion of income that should be taxed at that rate. that's what the example called for with the tax rate :p but yeah you're right on both counts.
Now to figure out how to get ( ) to surround the second number. I guess I could just do a shitload of printf statement
|
I forgot that in most languages printf isn't type-safe: that is, you only catch incorrect printf statements at runtime
One cool thing about ocaml printf is that the compiler can check at compile-time and make sure that your print statement is valid and being called with the right types and stuff
On September 09 2017 11:24 Nevuk wrote:Show nested quote +On September 09 2017 11:11 eieio wrote:I believe "%2.2%%" should be "%2.2f%%" I also think your federal tax calculation is wrong. You're applying the highest marginal tax rate to all income instead of only applying it to the portion of income that should be taxed at that rate. that's what the example called for with the tax rate :p but yeah you're right on both counts. Now to figure out how to get ( ) to surround the second number. I guess I could just do a shitload of printf statement not sure exactly what you mean about the parens but I think all your print statements are gonna look better with printf if you're inserting variables
Also you can use \t instead of the tab character to shrink your lines 
ALSO it turns out code to calculate a marginal rate properly is ugly O_O
+ Show Spoiler [code??] + # something like this?! def extract_dollars_to_be_taxed(pay, rate_min, rate_max): if pay > rate_min: total_taxable_dollars = rate_max - rate_min return min(total_taxable_dollars, pay - rate_min) else: return 0 def apply_marginal_rate(pay, rate, rate_min, rate_max): if rate_max is None: dollars_to_be_taxed = max(pay - rate_min, 0) else: dollars_to_be_taxed = extract_dollars_to_be_taxed(pay, rate_min, rate_max)
return dollars_to_be_taxed * rate
# rate, min, max # you can peg the min rate to the previous rate's max but then the below code is ugly lol rates = [(0, 0, 100 ), (.05, 100, 200), (.10, 200, 300), (.15, 300, 400), (.2, 400, None)] def calculate_federal_tax(pay): return sum(apply_marginal_rate(pay, rate, rate_min, rate_max) for (rate, rate_min, rate_max) in rates)
man idk how I wrote python for years, no type safety or variants is NUTS
For the curious I think I'd write the ocaml roughly like this: + Show Spoiler [ocaml why am i doing this] + let apply_marginal_rate ~pay ~rate ~min ~max = let taxable_dollars = match min, max with | None , None -> pay | Some min , None -> Float.max(0, pay -. min) | None , Some max -> Float.min(pay, max) | Some min , Some max -> if pay <. rate_min then 0 else Float.min(max -. min, pay -. rate_min) in rate *. taxable_dollars ;;
let tax ~pay = let rates = [ 0. , Some 100. ; 0.05 , Some 200. ; 0.10 , Some 300. ; 0.15 , Some 400. ; 0.2 , None ] in List.fold rates ~init:(0, None) ~f:( fun (total, min) (rate, max) -> total + (apply_marginal_rate ~pay ~rate ~min ~max)) |> fst ;;
|
marginal rate is ugly as fuck on paper too, there's no wonder it's so commonly misunderstood by people thinking about getting a paycut due to taxes while making a dollar more.
I got it all working though, thanks for the catch. I kept thinking it was the first statement that was the issue. I converted all the print's to printf because it was necessary for formatting correctly anyways, but i was trying to get one working before trying the others.
|
nope i am not getting sucked into talking about codes outside of work
On September 09 2017 02:34 PoulsenB wrote: I feel really down today for some reason, being a Comeh alt is not that great apparently huh yep yep
that's why it's called comeh alt
|
So between 250 passengers
It was COMPLETELY RANDOM that they would pick the SA guy with Palestine name/lastname + beard + arabic face
Yah, completely random 🤦🏻♂️
|
On September 09 2017 15:19 Faruko wrote: So between 250 passengers
It was COMPLETELY RANDOM that they would pick the SA guy with Palestine name/lastname + beard + arabic face
Yah, completely random 🤦🏻♂️ I once saw a pic of a Sikh wearing a shirt that said "100% randomly searched on airports" xD
Did they waterboard you or did a full-cavity?
|
|
|
|
|
|