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.
Has anyone read it? Any thoughts? People say it's really good.
That book is called CLR(S), it is the canonical algorithms text. If you are going to read one algorithms book, that is the one to read.
Could you recommend any chapters please? I have an interview at the beginning of January, and they may ask me about algorithms. They usually deal with office suite (kind of like Microsoft Word, Excel, etc). So I'm thinking data structures and string matching algorithms. Anything else? I doubt I'll read the entire book by then though. It's 1000+ pages. I could try to read as much as I can though.
On December 01 2017 01:23 Acrofales wrote: Dumb question:
I have a stupid problem where I have to correct a whole load of stuff. And it's going to be fastest to do this with a long list of radio buttons where I can mark "right" "half right" or "wrong". However, I don't know exactly how many radio buttons I need beforehand because it's loaded dynamically from the database.
I have my code for loading this stuff in python, but wtf do I use to generate the UI? I was looking at guidata, but it seems to want a fixed number of items up front, rather than being able to add them at runtime.
Am I incredibly stupid to think a simple and fast way of doing this is by simply generating a webpage, hosting it with flask and then saving the answers back into the database on a form submission?
You can using tkinter, I did a similar thing using a grid and an ordered dict then iterating over the dict and adding items to the grid.
It will look something like:
Load names from database For i, n in enumerate(names): In col 0 row i, put the name In col 1 row i, put the button
Then have a save button to read and write the data from the buttons
On December 01 2017 01:23 Acrofales wrote: Dumb question:
I have a stupid problem where I have to correct a whole load of stuff. And it's going to be fastest to do this with a long list of radio buttons where I can mark "right" "half right" or "wrong". However, I don't know exactly how many radio buttons I need beforehand because it's loaded dynamically from the database.
I have my code for loading this stuff in python, but wtf do I use to generate the UI? I was looking at guidata, but it seems to want a fixed number of items up front, rather than being able to add them at runtime.
Am I incredibly stupid to think a simple and fast way of doing this is by simply generating a webpage, hosting it with flask and then saving the answers back into the database on a form submission?
You can using tkinter, I did a similar thing using a grid and an ordered dict then iterating over the dict and adding items to the grid.
It will look something like:
Load names from database For i, n in enumerate(names): In col 0 row i, put the name In col 1 row i, put the button
Then have a save button to read and write the data from the buttons
Sounds easier than using an HTML front-end. I'll give it a go. Thanks!
On November 30 2017 17:15 Silvanel wrote: My company has around 26000 employees dunno if its is large or small for You. Granted the recruiting scheme is different depending on location (so can be different say in German, USA or in India and i would say it most certainly is). Still it works fine for our location i think (Poland). The project i work currently in has around 600 engineers spread around the globe. For sure some of them are overqualified for their postion, some underqualified and some are exactly where they need to be. But i would say its more because of the size than recruiting scheme.
Sure, that's not small at all. How many engineers, like 10k, or are you more sales oriented? If you've got 10k eng you must be getting a lot of applicants beyond just referrals and some headhunters. And at that point someone has to be screening for the dishonest idiots... or else there's some sizeable number of eng there who can't actually write code...
Has anyone read it? Any thoughts? People say it's really good.
That book is called CLR(S), it is the canonical algorithms text. If you are going to read one algorithms book, that is the one to read.
Could you recommend any chapters please? I have an interview at the beginning of January, and they may ask me about algorithms. They usually deal with office suite (kind of like Microsoft Word, Excel, etc). So I'm thinking data structures and string matching algorithms. Anything else? I doubt I'll read the entire book by then though. It's 1000+ pages. I could try to read as much as I can though.
Depends on where the interview is. If it's Amazon I would take care to not neglect graph algorithms lol.
On November 30 2017 17:15 Silvanel wrote: My company has around 26000 employees dunno if its is large or small for You. Granted the recruiting scheme is different depending on location (so can be different say in German, USA or in India and i would say it most certainly is). Still it works fine for our location i think (Poland). The project i work currently in has around 600 engineers spread around the globe. For sure some of them are overqualified for their postion, some underqualified and some are exactly where they need to be. But i would say its more because of the size than recruiting scheme.
Sure, that's not small at all. How many engineers, like 10k, or are you more sales oriented? If you've got 10k eng you must be getting a lot of applicants beyond just referrals and some headhunters. And at that point someone has to be screening for the dishonest idiots... or else there's some sizeable number of eng there who can't actually write code...
Has anyone read it? Any thoughts? People say it's really good.
That book is called CLR(S), it is the canonical algorithms text. If you are going to read one algorithms book, that is the one to read.
Could you recommend any chapters please? I have an interview at the beginning of January, and they may ask me about algorithms. They usually deal with office suite (kind of like Microsoft Word, Excel, etc). So I'm thinking data structures and string matching algorithms. Anything else? I doubt I'll read the entire book by then though. It's 1000+ pages. I could try to read as much as I can though.
Depends on where the interview is. If it's Amazon I would take care to not neglect graph algorithms lol.
If it's not, then what algorithms or chapters do you recommend based on what I mentioned?
I would guess that its mostly engineers in my company. But its really hard to say since i dont know that much (only few) facilities outside the one i work in. Anyway i work for Harman www.harman.com if that helps. For Connected Services division to be precise.
On November 29 2017 02:31 sc-darkness wrote: I'd applied for a C++ job and I got test questions. Guess what! ANSI C questions instead. Yay! :D I can manage it, it's just not expected. I feel way more comfortable with C++ though. I'm going to tell recruiter that as well.
Honestly I just don't get why people still bother with these tests. They show exactly nothing of what you're capable of beyond the basic "Yes, I know what a for loop is". I had a run in January where I applied for a bunch of jobs and needed to do 4 of these tests. 3 of them was so easy I finished them in half of the allotted time, and the last one was so damn badly explained I couldn't understand how to even get the input they were suppose to provide, so I just ended up winging it and, according to them, failed because my "score" wasn't high enough. Honestly seemed like they didn't even bother looking at the code itself. And none of them had the remotest connection to the jobs I actually applied for.
Yes, codewar type challenges can be fun, but they don't provide any reasonable idea of how someone actually functions in a job.
There are many recruiters and professionals complaining that a lot of gradutes can barely program. Those test are just a filter, so they don't have to spend 30 min talking to a guy that can't implement a fixzbuzz like problem.
On November 30 2017 17:15 Silvanel wrote: My company has around 26000 employees dunno if its is large or small for You. Granted the recruiting scheme is different depending on location (so can be different say in German, USA or in India and i would say it most certainly is). Still it works fine for our location i think (Poland). The project i work currently in has around 600 engineers spread around the globe. For sure some of them are overqualified for their postion, some underqualified and some are exactly where they need to be. But i would say its more because of the size than recruiting scheme.
Sure, that's not small at all. How many engineers, like 10k, or are you more sales oriented? If you've got 10k eng you must be getting a lot of applicants beyond just referrals and some headhunters. And at that point someone has to be screening for the dishonest idiots... or else there's some sizeable number of eng there who can't actually write code...
Has anyone read it? Any thoughts? People say it's really good.
That book is called CLR(S), it is the canonical algorithms text. If you are going to read one algorithms book, that is the one to read.
Could you recommend any chapters please? I have an interview at the beginning of January, and they may ask me about algorithms. They usually deal with office suite (kind of like Microsoft Word, Excel, etc). So I'm thinking data structures and string matching algorithms. Anything else? I doubt I'll read the entire book by then though. It's 1000+ pages. I could try to read as much as I can though.
Depends on where the interview is. If it's Amazon I would take care to not neglect graph algorithms lol.
If it's not, then what algorithms or chapters do you recommend based on what I mentioned?
Go through all the chapters of sorting algorithms. The math is dry, I don't think following the precise complexity analysis is super important. But be able to write the algorithms on your own if you can, or at bare minimum know how all of them work well enough that you can likely replicate it on your own if you really try.
In regards to data structures, you should know what all of the basic ones are. You should know how to traverse them. You should have a decent grasp of their advantages and disadvantages. You should understand depth first search, breadth first search, pre-order, post-order, in-order. You should understand why a hash table works and at least know conceptually how you could make one.
You should know trees very well. In particular you need to know heaps, and search trees. If there is one data structure to study I think that it is trees.
On December 01 2017 01:23 Acrofales wrote: Dumb question:
I have a stupid problem where I have to correct a whole load of stuff. And it's going to be fastest to do this with a long list of radio buttons where I can mark "right" "half right" or "wrong". However, I don't know exactly how many radio buttons I need beforehand because it's loaded dynamically from the database.
I have my code for loading this stuff in python, but wtf do I use to generate the UI? I was looking at guidata, but it seems to want a fixed number of items up front, rather than being able to add them at runtime.
Am I incredibly stupid to think a simple and fast way of doing this is by simply generating a webpage, hosting it with flask and then saving the answers back into the database on a form submission?
You can using tkinter, I did a similar thing using a grid and an ordered dict then iterating over the dict and adding items to the grid.
It will look something like:
Load names from database For i, n in enumerate(names): In col 0 row i, put the name In col 1 row i, put the button
Then have a save button to read and write the data from the buttons
Sounds easier than using an HTML front-end. I'll give it a go. Thanks!
It should be easy once you get the hang of tkinter. Probably in total <50 lines.
Okay, I have a difficult problem I am trying to solve. Let's see if I can explain it properly.
I want to take a simple polygon. The polygon is determined by a series of points, which make up it's vertices. For simplicity of explanation, let's say a square.
Internal to the polygon (square), are points.
I want to take each point of the polygon, and I want to take the direction of line segments that are coming out of them, and consider them to be rays. So, in this case, 2 rays coming out from each corner of the square, 8 in all, which overlap with the line segments of the square.
I want to take these rays, and I want to rotate them INWARDS (for each point, it's rays rotate towards the other ray that comes off a given point). I will have all rays rotating at the same rate.
I am confident I can do all this. The problem is the next part.
I want to use these rays to "scan" for the points internal to the square. When a ray hit's a point inside the square, I want to be able to stop all rotations, mark that the point was found, and which ray found it. I also need as much precision as possible. I can't use something like rasterization because I will lose precision.
My question is, how the heck do i do this! In what method can I represent these lines as data, and monitor their interaction with euclidean space? Is there some technique in linear algebra that I can use to do this?
At this point the only option I can see is to do something like: rotate each ray some appropriately small portion of one degree, iterate over every point and see if the ray went through that point. If more than one ray went through a point (or a ray went through more than one point), backtrack if appropriate and take a smaller step. Repeat until you get it down to just one point (or multiple points along a single line).
This seems like a lot of work to be doing. I'd rather avoid it if there is a simpler way.
Is what I am asking for understandable?
Thanks!
edit(I guess I could slightly improve the above by recording all possible rays between points into a set beforehand (in the form of (origin,slope), and checking for when we've found a match. But that still seems suboptimal.)
I think I'm a little confused about what exactly you're describing. It would help if you could give a more precise example of your problem (preferably with numbers?). From what you've written, it sounds like you want to find the smallest angles for which your 'rays' intersect with the interior points?
If that's the case, then I don't believe you need any simulation of rays or rotation. Instead, you could do something like the following, in pseudo-code:
(Disclaimer, my geometry is super rusty)
for each point p: min_angle = 360 edge = null
for each vertex pair (a,b) in the polygon: # ab edge, assume clock-wise order angle_1 = compute the angle between AB and AP vectors angle_2 = compute the angle between BA and BP vectors
if 180 - angle_1 < min_angle: min_angle = 180 - angle_1 edge = (a, b)
if 180 - angle_2 < min_angle: min_angle = 180 - angle_2 edge = (b, a)
closest 'ray' to point p is given by edge, after rotating min_angle degrees
I think this is close to what you're trying to do? There might be some extra steps based on other problem constraints. Basically, we find the interior angles to all the points, and use that to find the 'ray' which will have to rotate the least to reach the point and the angle of rotation needed.
I'm sure there's a nicer algorithm for this, and I might also be completely misunderstanding you. Hope this helps.
On December 02 2017 14:12 Mr. Wiggles wrote: I think I'm a little confused about what exactly you're describing. It would help if you could give a more precise example of your problem (preferably with numbers?). From what you've written, it sounds like you want to find the smallest angles for which your 'rays' intersect with the interior points?
If that's the case, then I don't believe you need any simulation of rays or rotation. Instead, you could do something like the following, in pseudo-code:
(Disclaimer, my geometry is super rusty)
for each point p: min_angle = 360 edge = null
for each vertex pair (a,b) in the polygon: # ab edge, assume clock-wise order angle_1 = compute the angle between AB and AP vectors angle_2 = compute the angle between BA and BP vectors
if 180 - angle_1 < min_angle: min_angle = 180 - angle_1 edge = (a, b)
if 180 - angle_2 < min_angle: min_angle = 180 - angle_2 edge = (b, a)
closest 'ray' to point p is given by edge, after rotating min_angle degrees
I think this is close to what you're trying to do? There might be some extra steps based on other problem constraints. Basically, we find the interior angles to all the points, and use that to find the 'ray' which will have to rotate the least to reach the point and the angle of rotation needed.
I'm sure there's a nicer algorithm for this, and I might also be completely misunderstanding you. Hope this helps.
nope, this is exactly right(though there are some added constraints, like you say), and I realized last night I could do it this way. The algorithm will also need to compare the angles of each "closest ray" after each outter for loop completes, since I only want the one smallest angle.
Maybe it would be easier to calculate differences in slope than differences in angle?
On December 02 2017 16:23 spinesheath wrote: Is this basically just computing the convex hull of a polygon? If so, then there are algorithms for that. What is your actual objective?
Nope, the convex hull is the starting point. The objective is to tighten the convex hull into a polygon that iteratively includes more and more points. (I am playing around with TSP again).
I know this kind of strategy is common for TSP, but I wanted to play around with it myself.
Does anyone know how job adverts work when they say N+ years? Because if they say 3+ years, then they may as well have someone with 3 years work experience against someone with 10+.
From what I've heard it's a wishlist. When they say "must have 3+ years" that's ideal, but they will accept less if they don't get an ideal candidate. Generally they'd pick the more experienced person, but it depends on what they're looking for.
Does anyone know any way to convert ETH into CAD(or other denominations) easily? I am attracted to the possibility of easily transferring value with ETH, but it has problems if you want to hold on to it. It fluctuates, it is not understood by the public, etc. It seems easy to buy cryptocurrencies with fiat, but getting fiat back from the crypto seems much harder. I know tethers are a thing but then you still need to convert it into fiat from there.
On December 03 2017 07:03 sc-darkness wrote: Does anyone know how job adverts work when they say N+ years? Because if they say 3+ years, then they may as well have someone with 3 years work experience against someone with 10+.
I've been to job interviews with much much less than 3+ years of experience. It's one of those "weed out the newbies" things, but if you have the right experience it can be worth more than many years of the wrong (Ie: If they're looking for a web designer/javascript your 1 year of experience might beat out someone with 5 years of backend c++ experience)
Agree with above post somewhere stating to start with sorting algos. Definitely a good starting spot (and if you can wrap your head around it, the Knuth book on sorting and searching algos complements clrs nicely). Also your original idea to do string algos is also good cus a lot of places ask such questions.
You wanna be pretty well rounded though. Have good working useful knowledge of graph, string, search, sorting algos. Nothing too fancy. Have good working knowledge of arrays/lists, graphs, hash map / dictionaries, heaps, queues & stacks, and then maybe some slightly more esoteric things like search trees, tries, dynamic programming algos. And be able to code problems using these approaches and structures, from scratch without any reference internet.
On December 03 2017 07:03 sc-darkness wrote: Does anyone know how job adverts work when they say N+ years? Because if they say 3+ years, then they may as well have someone with 3 years work experience against someone with 10+.
Yea the correlation between what the job posting says and what is actually required is loose at best.
Eli TheComputerGuy on YouTube had a good video explaining it: