1,299 karma · joined September 27, 2013
In either case you constantly consult the language reference and standard libraries until you find something that works. The C reference at https://reference.cs50.net/ looks perfectly good.
To be honest I don't know how I would load a CC# into an array to compute Luhn's algorithm on it in C. In Python I know there are easy ways of doing that, because strings are automatically arrays in the first place (same as that Caesar cypher problem, Python makes it much easier to work with strings). I don't even know if that's the "right" way to do it, but that's what I would do in Python: Convert the number to a string, operate on it as an array, converting each character to an int as it goes, running the algorithm as given in the problem, back-converting to string and then back again to int as needed (like if I need to add the digits of a number together). Fine I suppose I could avoid doing that by taking modulos and if I didn't know what a modulo was I would divide by 10 for instance and then take a floor to get the first digit of a 2-digit number.
I have no idea if any of these methods are "correct", I would just hammer away at the code until the acceptance tests passed. It would take over an hour for each of these solutions, after getting into the zone, so let's say 2 hours. There you go, 4 hours of work to get through these two problems in C, let's add on a lunch break and we have a full work day. That will be $325 thank you. Oh I don't get paid to study computer science in my free time? Oh ok. I guess I will just bookmark CS50 and come back to it... some day.
Your wife is lucky she gets to study this stuff. Don't be so hard on yourself.
Ultimately you are betting that the company will one day buy back stock, be acquired, issue dividends, etc.
[0]: https://en.wikipedia.org/wiki/List_of_countries_by_GDP_(PPP)...
One thing that struck me about Brazil compared to the U.S. is the huge number of people standing around doing nothing. You will never see that in the U.S.: if someone is loitering here, they are a teenager or homeless. But it was huge in Brazil. I am assuming this is because of the extreme unemployment and lack of opportunity.
Unfortunately, seeing so much despondency is likely to affect everyone in the society. You tend to change your outlook on things. I have heard there is an "everyone does it" attitude with regard to paying bribes, stealing services like electricity, etc. This also drags down society.
My wife is Brazilian and she is a very timely person, living in the U.S. Partly due to acculturation but also because of the "I wasn't born here but got here as fast as I could" effect.
Question for IP experts: now that I have heard of the existence of WaveNet and a rough idea of how it works (training a neural network to decode low-bitrate speech data with as much fidelity as possible to the original), would I be prohibited from selling a similar product built with the same technique? How about if I had never heard of WaveNet and went about doing the same thing?
What's more, you could be product focused and still produce bad products. I just left a startup that seemed to have really bad decision making in areas like "what feature should we build first/second/third", and major areas needing design and careful thought were instead treated as an afterthought. But the tech was solid and lots of work was getting done, so... good enough?
https://news.ycombinator.com/item?id=17022963
Which is heartening IMO. People who deal with computers all day should be the ones most skeptical of technology.
Sorry I think you sometimes get too heavy handed around here.
Verse 15 hints at how you might want to interpret these verses as compared to the references you cited: "Do not regard them as enemies, but warn them as believers." You see, a Christian has rather different conduct when he is dealing with a believer or a non-believer. If someone is your brother in Christ, it's ok to be a little hard on him. Same way you have the right to be a little harder on your own family members than I would. It's all supposed to be done in love, of course.
Hope that helps.