|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
x => parseInt(x) Does the trick already since 10 is the default radix. And apparently this actually makes sense. Not that I appreciate the whole pass-n-parameters-into-a-function-accepting-m-parameters nonsense... Or the lack of an exception for radix 0.
|
On January 13 2018 08:44 spinesheath wrote:x => parseInt(x) Does the trick already since 10 is the default radix. And apparently this actually makes sense. Not that I appreciate the whole pass-n-parameters-into-a-function-accepting-m-parameters nonsense... Or the lack of an exception for radix 0.
At least MDN still recommends [1] always using an explicit radix parameter. I'm not sure what implementations don't have the standard radix behavior though.
An alternative is to use parseFloat because it's all just numbers in JS anyway. That doesn't really communicate the intent though.
[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
|
On January 13 2018 06:54 sc-darkness wrote: How many interviews does it take you to get a job offer and how many years of experience do you have?
For my first job (internship really) I went to 5 or 6 interviews and got one finally (had pretty much 0 experience and no schooling in CS or engineering). After 3 months I ended my internship and got hired, 6 months later I've changed jobs because there weren't many perspectives for growth in this first job. After that I've went through 5 jobs in 4 years.
I'm at the point where I no longer need to look for a job since I'm getting 3-5 new job offers every week. Even if I ignore them I know that if I don't want to work for my current company any more I can just quit and find a new job within a week. All this considering I live in a rather small city (350k), if I took into consideration larger cities this would be even easier and I'd be literally spoiled for choices when it comes to the job.
Web dev has its benefits. It's everywhere right now.
|
28079 Posts
How many projects did you have if you had no experience/school beforehand?
|
On January 13 2018 18:22 TheEmulator wrote: How many projects did you have if you had no experience/school beforehand?
I did one small freelance project in C#, a bit of freelance front-end in css/html and I had a bit of experience by working on a MUD in LPC. I kind of winged it as I was completely switching my profile (was working for 7 years in HR beforehand and programming was pretty much just my hobby). That's why it was so hard for me to get in since I didn't have any real experience in how you actually program at work in real projects. This first job was all I needed though - I've learned my first framework, got experience with cvs, teamwork, agile and such and after that it was a breeze.
Edit: In those past 4 years, thanks to switching jobs I've worked on so many projects and went through so much stuff that I managed to go up to senior PHP developer and then senior Ruby developer (our current project is so far out of the scope of regular Rails now, you know you're diving down the deep end when you start to use methods like "with_transaction_returning_status" and "reflect_on_all_associations" to achieve what you need).
|
On January 13 2018 06:54 sc-darkness wrote: How many interviews does it take you to get a job offer and how many years of experience do you have?
I am still in university, but I realized as soon as you list some private / hobby projects in your resume you are almost guranteed to be invited for an interview at least. I machinegunned out applications without any success when looking for a job on the side. Then a friend of mine told me to list some of stuff I did in my own time which wasnt even really noteworthy and I spend a semester taking part in some of his private projects. After that I even got reoffers after declining jobs, even though my grades are average even in some of the lectures relevant to my job (programming / softwareengineering), as well as me taking longer for my bachelors degree. My friend who let me take part in some of his projects was even crazier, though admittedly he also has amazing grades. At least here in germany companies are sometimes quite aggressively trying to hire you as soon as you show signs that you are genuinely interested in CS and you don't fit in the typical stereotype of a student that fails a fizzbuzz because he can only do lecture 101 stuff (Though at least the univerisites I know are already including lots of pracitcal exercises so this cliche might be dead soon).
|
On January 13 2018 18:18 Manit0u wrote:Show nested quote +On January 13 2018 06:54 sc-darkness wrote: How many interviews does it take you to get a job offer and how many years of experience do you have? For my first job (internship really) I went to 5 or 6 interviews and got one finally (had pretty much 0 experience and no schooling in CS or engineering). After 3 months I ended my internship and got hired, 6 months later I've changed jobs because there weren't many perspectives for growth in this first job. After that I've went through 5 jobs in 4 years. I'm at the point where I no longer need to look for a job since I'm getting 3-5 new job offers every week. Even if I ignore them I know that if I don't want to work for my current company any more I can just quit and find a new job within a week. All this considering I live in a rather small city (350k), if I took into consideration larger cities this would be even easier and I'd be literally spoiled for choices when it comes to the job. Web dev has its benefits. It's everywhere right now.
How is it easier in larger cities? You have more job adverts, but also more competitors.
|
Show nested quote +On January 09 2018 01:08 Manit0u wrote:On January 08 2018 22:32 tofucake wrote: Because WarSame has absolutely no idea how security works and despite being told multiple times not to do this because he doesn't understand it, still made this app
Not to mention the fact that his authenticity check not only passes around plain password as String but also possible account match is retrieved by using LIKE on email... Also, why would he retrieve encrypted password and salt in two separate queries, when he needs both to check for password match is beyond me. How am I supposed to avoid passing the password as plain text? It needs to be put into the text field as plain text, and passed on from there to get encrypted so it needs to get passed around at least a little. I followed up on this, converting to char[] for safety. When doing this, you have to get the value from an edittext field in Android as a String. I am doing so but immediately converting it to a char array(and not assigning it to a variable). Is that safe? Reading online the main danger of Strings seems to be that you can't overwrite them and you can't rely on garbage collection, but this should be safe because it never gets assigned, correct?
|
On January 13 2018 06:54 sc-darkness wrote: How many interviews does it take you to get a job offer and how many years of experience do you have? My first internship and my first job out of uni both at small local defense contractors had essentially no interview. I mean they interviewed me, but when I got there they basically said "you're hired" and proceeded to explain the problem space.
I interviewed at Amazon shortly after undergraduate and had three phone interviews (was out of the country for 3 mo so they just kept scheduling more), and then an on-site with ~5 interviews. Got an offer, but instead went for my current employer:
At my current employer I interviewed once during undergrad, had a phone interview and then ~4 on-sites, and faaaaiiillled horribly. Then years later I flew directly out for on-sites, had 5-6 of them, and passed. That was ~7 (8?) yrs ago and I haven't interviewed anywhere since. (Though I have conducted ~100 interviews and sit on a hiring committee now)
So to get my current job it took me 2 years and >10 interviews
As for general tips on failing algos during an interview, it sounds like you need more practice solving problems quickly in code. Cracking the coding interview (?) the book, and places like topcoder or similar can be useful.
Even if you don't know what reverse polish notation is, you should be able to bang out a solution in ~30 minutes if you have a good mental grasp of all the basic data structures.
|
Thanks phar. I've started solving challenges on HackerRank to improve my problem solving and ability to deal with algorithms. Would you say this is good enough or do you think TopCoder is better?
|
On January 14 2018 02:59 sc-darkness wrote:Show nested quote +On January 13 2018 18:18 Manit0u wrote:On January 13 2018 06:54 sc-darkness wrote: How many interviews does it take you to get a job offer and how many years of experience do you have? For my first job (internship really) I went to 5 or 6 interviews and got one finally (had pretty much 0 experience and no schooling in CS or engineering). After 3 months I ended my internship and got hired, 6 months later I've changed jobs because there weren't many perspectives for growth in this first job. After that I've went through 5 jobs in 4 years. I'm at the point where I no longer need to look for a job since I'm getting 3-5 new job offers every week. Even if I ignore them I know that if I don't want to work for my current company any more I can just quit and find a new job within a week. All this considering I live in a rather small city (350k), if I took into consideration larger cities this would be even easier and I'd be literally spoiled for choices when it comes to the job. Web dev has its benefits. It's everywhere right now. How is it easier in larger cities? You have more job adverts, but also more competitors.
It's easier to find a job with 10000 competitors for 10000 jobs (actually more like 10000 competitors for 20000 jobs when it comes to IT atm) than there is to find a job with 1 opening and 1 competitor. In the latter you either have more experience than the other guy and get it, or you're out of luck. In a city there's always another firm, another interview, and another first impression to make. In rural places it's entirely possible to simply run out of firms to apply at. And people talk a lot more.
|
On January 14 2018 04:12 sc-darkness wrote: Thanks phar. I've started solving challenges on HackerRank to improve my problem solving and ability to deal with algorithms. Would you say this is good enough or do you think TopCoder is better? Yea they should be equivalent-ish. I've not actually used either (except to check whether questions I ask have been leaked). But from looking at questions, they appear to be about on point. Some of them are a bit too math-focused or trivia-like, but there's a bunch of good ones too. (Also depending on where you interview, you might get aforementioned math-focused or trivia-like questions, so it's not a bad idea to be prepared)
Also RE >How is it easier in larger cities? You have more job adverts, but also more competitors.
Way, way, way easier in larger cities. Also depends on the specific city, but there's a lot more options, lets you apply to a lot more places in parallel. Also depending on the city, the pay can be way better. I make literally 4x out west than I would back home in the midwest.
|
I would like some opinion on this change.
My app previously had 2 db adapters, one for the Account table called AccountDbAdapter, one for the Eth table called EthDbAdapter, both of which extended a basic DbAdapter. Clearly that was bad design because I only should need 1 DB Adapter. However, now the size of my DbAdapter has exploded, and my functions and table definitions(so my DDL and DML I guess) are all in the same file.
How can I reduce it down to 1 adapter properly without this increased load on 1 file? One solution I can see is to leave the DDL in the adapter and extend it with my DML. Does that seem like a reasonable solution?
|
On January 14 2018 11:53 WarSame wrote:I would like some opinion on this change.My app previously had 2 db adapters, one for the Account table called AccountDbAdapter, one for the Eth table called EthDbAdapter, both of which extended a basic DbAdapter. Clearly that was bad design because I only should need 1 DB Adapter. However, now the size of my DbAdapter has exploded, and my functions and table definitions(so my DDL and DML I guess) are all in the same file. How can I reduce it down to 1 adapter properly without this increased load on 1 file? One solution I can see is to leave the DDL in the adapter and extend it with my DML. Does that seem like a reasonable solution?
I cant fathom why you'd think having two adapters, especially when they're already extensions of another class, is bad design. Bad design is exactly what you've done by thinking you've fixed it and put it all in the same class
|
There's a few reasons, though I'm not sure how valid they are. First, I was under the impression that only having 1 db adapter could simplify access to the DB. Second, it seemed pointless to have 2 classes that extend a third and only contain functions, with no values of their own. Third, it simplifies queries that want more than 1 table at once because I don't need to instantiate a db adapter for the other table. Instead I can just directly access it.
Those may be stupid reasons, or not worth the tradeoff, but that's why I did it.
|
On January 15 2018 01:09 WarSame wrote: There's a few reasons, though I'm not sure how valid they are. First, I was under the impression that only having 1 db adapter could simplify access to the DB. Second, it seemed pointless to have 2 classes that extend a third and only contain functions, with no values of their own. Third, it simplifies queries that want more than 1 table at once because I don't need to instantiate a db adapter for the other table. Instead I can just directly access it.
Those may be stupid reasons, or not worth the tradeoff, but that's why I did it.
Ok I might have misunderstood, so let's clear things up. I agree that the last layer, aka whatever actually does the connection to the DB, should be only one class (Let's call that DbApi). Simply because it might be used a lot of places and it's easier to debug and fix one class than 10x copies of one class. However it should also be extremely simple. It shouldn't hold any preference as to what type of data it asks or sends. That's where you need adapters or controllers or whatever you want to call it. Ie: One class does the connections to DB, then you have a Eth adapter and a account adapter which actually tells it what to get. If you've done this, then you've done it correctly. If you find yourself realizing that you never ask for one type of data without simultaneously asking for the other, then it's acceptable to combine these two adapters. Is that what you're asking? If you so you can either not worry about a long class (I know some unwritten rules specify that you should never have long classes but..pff, I don't care), or split functions into static helper classes.
If you are worried about having too many singular database queries, and want to combine them, you should do that in the DbAPI class by having it collect queries and run them at a specific rate. I honestly wouldn't worry tho. At my work we have something like several hundred queries to the db every second and it doesn't affect performance at all. All done on regular run of the mill laptops.
|
lol well, im an idiot
finally debugged my latest algorithm after like 4 hours I have now learned that python's copy.copy isn't actually a deep copy, it only creates a new top level object, all internal references stay the same. I was using it like a deep copy, and when values of internal lists or sets started being wrong it was not easily trackable why and pretty much looked like my algorithms were failing to solve the problem
unfortunately, this bug could have caused my last 5 or so algorithms I have been working on to fail when they may have potentially been smashing successes.
|
Welcome to high level languages where everything is hidden from you. :D That's why I like C++, you have control over what is happening.
|
DIFFICULT QUESTION:
I am doing more graph stuff. I want to maintain a history of any traversed sub-cycles, of varying sizes. So if I have hit (5, 4, 7, 5) - I want to save it. If I've hit (1,2,3,4,5,9,11,317,1), I want to save it. If I have hit (8,9,8), I want to save it.
I believe that I cannot store this information in the form of individual points. If I do this, then for say, (5,6,7,8,5), I will also potentially need to create and store (6,7,8,5,6), (7,8,5,6,7), and (8,5,6,7,8). The situation becomes even worse for bigger and bigger subcycles.
So, I choose to store them as edges. This way, if I store ((5,6),(6,7),(7,8),(8,5)) it covers all of the situations in the last paragraph. But, only if it's stored in a way where order doesn't matter (a set?).
So then, I would have a set for every path. I don't really see a reasonable alternative to this, but if there is an alternative then please let me know.
Continuing on, how can I store my sets? I am using python, where afaik sets can only immutable objects, not other sets. So, I could use a list... but then I run into other problems. Which are my primary questions
1.) Is there no more efficient alternative? I don't want to have to traverse a list to check every set in it. 2.) If I do use a list... how do I efficiently check if the current set I want to add is already in it.
thanks
|
Other solution:
You write a function that reorders a circle, so that the lowest ID is first. (Also if you save nodes instead of edges, don't save the returning node twice...) (6,7,8,5) -> (5,6,7,8) (5,6,7,8) -> (5,6,7,8)
etc. This means you have to store every circle only once.
If you need some quick access to know if there are circles starting at a given ID, make an additional map of lists/vectors of pointers, with the ID as mapkey, and the pointers pointing to all circles containing that ID. In case of the IDs used in circles being dense, make it an array of lists/vectors of pointers
|
|
|
|