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

01-13-2014 , 11:45 AM
Quote:
Originally Posted by Shoe Lace
Dave, a while back it was usually much cheaper to assemble your own and you walk out with not only a cheaper machine but higher quality parts too. Before C2Ds it was usually a good idea to overclock your machine too because it resulted in a real difference in day to day use and that usually required very specific parts.

Once you've done it a few times it only takes about 20 minutes to put together.
Ya. I built my current home machine 9 years ago. It's first gen i5 processor with some upgrades over time (SSD, video card, memory). The new Intel chips don't leave much overclocking room and it's not worth investing hundreds of dollars on powerful OC friendly boards anymore.

Didn't think I'd ever say this, but honestly my next machine might be macbook pro. With baby at home it is just more convenient to get stuff done. I will prob turn my current machine into a server running multiple VMs for dev work.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-13-2014 , 11:57 AM
I present the language in the context of past projects I've done with it. So it's clear, even though I haven't done Java in 5 years the last project was on scale X.

For interview questions there are 3 standard books with the common questions.

- cracking the coding interview (covers standard stuff)
- programming interviews exposed (similar to cracking, but older and better coverage of some areas like databases and threading).
- elements of programming interviews (harder questions than first 2. Some will take you a year literally. Focus on algorithms and scalability. If you wanna work at Google, Amazon, Netflix, Facebook etc this will be useful).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-13-2014 , 01:29 PM
clown,

no one is giving you fizzbuzz to see where you put the semicolons. they want to see whether you understand very basic programming.

no one worth their salt is forcing you to write solutions in a specific language. they'll let you pick a language (as long as they have some familiarity) and focus on how you solve the problem. questions like "er, i can't quite remember, what's the function call for casting an int to a string?" are only costing you points if you're way out in space (e.g. that guy davet posted about who didn't know DELETE or INSERT, or whatever it was).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-13-2014 , 02:19 PM
Quote:
Originally Posted by clowntable
I'm very curious about the answer for this question:

I "forget" stuff about languages pretty quickly if I don't use them for some time (syntax details, standard library etc.). I can always read code in a language just fine but I'm wondering what I put on my CV. I usually have something like "productive within a week" for say Java.
How long would you guess it takes to learn up to "can solve silly job interview stuff". I just tested myself and could write a FizzBuzz with no syntax errors right away. I'd guess it would take about a day to relearn some idioms and typical library stuff (for example I had to think a bit before remembering Integer.toString()...stuff like that) and well for actually writing decent quality code my guess is a week (including looking up the unit/functional etc. testing of the language and those things)

Also is there maybe a set of standard programming tests (i.e. FizzBuzz and maybe 3-5 others) where you can review how well you remember a language? Would like to run through that for all languages I used at one point (C/C++ for example)
If you already know a couple OO languages like Java or Python, you could probably also be productive in one you had never learned after a week. The internet makes learning the variations so easy. The answer is always just a 5 minute google away.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-13-2014 , 02:30 PM
Yeah maybe I worded it wrong I'm mostly curious if there's a set of say 5 typical programming tasks that you should feel comfortable solving right away and quickly to be able to say "I can program in that language". I kind of want to do it as a mental exercise to see how much I remember from each language.

I'm mostly getting a bit worried that I forget so much stuff :P Since my main language these days is a tad esoteric I'm not even sure I could bank on being able to use that in any given job interview.

My brain is certainly in the mindset you describe maxtower. "Why remember if you can google" it still worries me a bit that I probably couldn't just sit down and hack a 300 LOC program in most languages I have used quite a bit. Probably a sign that I haven' used anything deeply/long enough.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-13-2014 , 02:47 PM
I've been using index cards for syntax issues and to remember some commands. It's a tremendous help.

If I forget a somewhat common but not heavily used command that means I need to get out of programming mode, flip to a browser, Google it, find it, then either paste or write out the command.

Knowing it off the top of your head means you're done in 2 seconds without any context switching.

I can't remember the number of times I had to google on how to convert the human readable permissions in linux to the octal form but I had to use it a lot in my chef adventures.

Code:
stat -c %a <file or directory>
I have that just sitting on an index card and I don't think I'm going to forget it for a while because I looked at it like 8 times.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-13-2014 , 02:56 PM
I used to keep mindmaps (Freemind) of programming languages but never kept them up to date. Was somewhat useful because you could just c&p example code snippets in etc.
Maybe I should go back to that and really put in some effort
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-13-2014 , 07:02 PM
I've seen some web sites that let you paste in code snippets or random info on a programming language but it's tag oriented, not mind map'ish.

Would be kind of neat to make something like that in a graph DB. Make it, SAAS'alize it then mail me half your riches because I'm the idea man who clearly deserves half of the company!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 02:44 AM
Quote:
Originally Posted by NxtWrldChamp
Can someone help me with an excel problem I'm having

I copied a table from the web into excel and I'm trying to use the vlookup function.

For example the table may say

Tiger Woods 3

On another sheet I have Tiger Woods in cell A1 for example and I want A2 to display the number 3.

So I do =vlookup(A1,copy pasted table, 2, false) and I get an #NA response.

However if I go to the copy and pasted data, delete "Tiger Woods", and retype "Tiger Woods" manually into the cell the equation works.

I have a lot of data and obviously don't want to have to manually type in corrections for every name, what is going on? I've tried the Trim/Clean functions with 0 success.
Quote:
Originally Posted by daveT
Sounds like you pasted the data directly, which means you are attempting to compute HTML values.

When you copy paste from the web, you should always Right Click > Paste Special > Text.

If you already have the data on your spreadsheet, then highlight all, copy Paste Special and choose Values.
This unfortunately did not work. I copy and pasted the data from my spreadsheet using the paste Values option to no avail. Even when special pasting "match destination format" when I bring the data in from the source excel will not recognize these names. Any other ideas?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 03:23 AM
Quote:
Originally Posted by NxtWrldChamp
This unfortunately did not work. I copy and pasted the data from my spreadsheet using the paste Values option to no avail. Even when special pasting "match destination format" when I bring the data in from the source excel will not recognize these names. Any other ideas?
Do you have the website so we could try and reproduce the problem?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 09:58 AM
Quote:
Originally Posted by ItalianFX
Programming in C for the CS50 course.

I'm taking a userinput value as a float, say, .25 as a currency.

I need to convert it to an int. Is it acceptable to type:

float x;
x = round(.25 * 100);

I noticed before that while leaving it as a float, I was getting wrong answers when it was thinking that 0.00 was actually greater than 0 because within the float it was 0.00000000000002341000000. So when my loop should stop at 0.00, it was making one more loop when it shouldn't have.

When I check the solution through the terminal I'm now getting all green responses, which means I'm good, but I'd like to make sure there isn't a more standard way of conversion.
Bolder is most definitely NOT true.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 10:17 AM
Quote:
Originally Posted by Benholio
Floating point precision can be a pain. One solution is to compare to a really small number rather than zero. Since you are dealing with currency, you could do something like "if x < 0.001" and get the intended result.

You'll find some good reference by Googling "compare floating point number to zero".
There is no issue with floating point precision in his assignment. Maybe I don't understand the assignment but with a penny, a nickel, a dime, a quarter, a fifty cent piece being in the set of coins that can be returned doesn't bring about any precision issues. TBH not even sure why converting to ints is required.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 10:38 AM
Storing money as ints is a good practice.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 10:42 AM
I hate it when my change is an irrational number.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 11:01 AM
Quote:
Originally Posted by ItalianFX
Yeah you're right. I was thinking int because my other variables are ints.

I was trying to do some casting, but I don't know where to put it. I've been searching through Google, but none of it was relevant.

I guess it would be easier to talk about the program rather than trying to give examples.

I have to create a program that takes a userinput on how much money I owe them, for example, I owe you .18 (18 cents). The program then wants you to return the smallest amount of coins. So instead of giving you back 18 pennies, I'd give you 1 dime, 1 nickel, and 3 pennies.

The result they want is the total of those coins, which would be 5.

Functionally, my code works, or so it seems, but I don't know how to use casting in the proper way. They definitely don't want you to just truncate it from a float to an int because then you lose cents.
C has implicit casting as well as explicit casting. The implicit casting "rules" are readily available . Google implicit and explicit casting.

You probably didn't have to use ints to solve this problem.

If you end up working in the "real word" developing code in C, you won't be involved with floating point all that much. As you probably already know in the "real world " C language development is involved a lot in low level, close to the machine, time critical problem domains. When real numbers are involved in these problem domains fixed point arithmetic is used with a fixed binary point very often. If you have an interest in doing work in the problem domains where C is used, understanding how floating point numbers are implemented has a lot of benefits.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 11:02 AM
Quote:
Originally Posted by jjshabado
Storing money as ints is a good practice.
Ok elaborate I'm probably in agreement but not sure what the point you are making is .
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 11:22 AM
Storing money as ints is generally considered the best way to do it because its simpler and you don't have to deal with precision issues everywhere in your code. (http://stackoverflow.com/questions/3...esent-currency)

I didn't have any big point. You were wondering why he was converting to ints so I just mentioned that its pretty common when dealing with currency.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 11:34 AM
Quote:
Originally Posted by jjshabado
Storing money as ints is generally considered the best way to do it because its simpler and you don't have to deal with precision issues everywhere in your code. (http://stackoverflow.com/questions/3...esent-currency)

I didn't have any big point. You were wondering why he was converting to ints so I just mentioned that its pretty common when dealing with currency.
On this problem I would recommend using floating point exclusively to gain some further insight into working with floating point values. This is not at a slam on the Italainfx. His question about zero indicted to me that he would benefit a lot by using floating point to solve this problem. This problem has zero issues with precision , I will read the stack overflow article if I have a disagreement with it i will post here. Gots to go and fix some C code that is defective.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 11:47 AM
Quote:
Originally Posted by adios
Ok elaborate I'm probably in agreement but not sure what the point you are making is .
In general avoid floating point numbers if at all possible! They have so many weird issues in production systems.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 11:55 AM
Lol just found out accidentally that you can dock chrome developer tools to the right. That would have been useful 2 years ago...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 12:06 PM
lol adiosaments
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 12:15 PM
Quote:
Originally Posted by Grue
Lol just found out accidentally that you can dock chrome developer tools to the right. That would have been useful 2 years ago...
OMG, This is amazing!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 02:49 PM
Quote:
Originally Posted by jjshabado
Storing money as ints is a good practice.
Very much this.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 08:06 PM
Quote:
Originally Posted by Barrin6
Do you have the website so we could try and reproduce the problem?
Sure.
http://www.pgatour.com/stats/stat.02417.html#2014
Here is the website I'm trying to get data from. This page I linked however is not the exact data I need. This is displaying 2014 stats and I need 2013 stats. There is a drop down menu where you can change the year, so I change that to 2013 and get the following URL

http://www.pgatour.com/stats/stat.02417.html#2013

Now I have tried using Excel "get from web" option for importing data this data with 0 success. I enter the above URL(the 2013 data) into the Excel web query, select what I want imported and then import.

I can see the url procession when it takes me back to Excel for the import. I can see the 2013 at the end of the URL staring me in the face. Then when the data populates, it is the 2014 data. This is driving me bonkers

If anyone has any other recommendations for grabbing this data I'm all ears.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-14-2014 , 10:17 PM
May have found a work around. If I copy and paste special -> unicode text, I can then =Trim() the name at it works. Still kind of a pain in the butt, however at least I can use the data now.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m