|
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. |
Well me asking that question was pretty indicative of how I did on the final.
Somehow I managed to stay ahead of the curve on all the midterms, and yet i absolutely BOMBED this final. I feel embarrassed and stupid, I had no idea how to answer about half of the questions. I largely blame the course itself (... the professor/lectures). Even if I pass this class (c-) I am not going to feel good after this final. I feel like I know nothing now.
(I had 85% in the class going into the final. I expect that I got maybe... 30-35% on it?)
My final for my C class feels like I went fine, though.
I had those 2 finals back to back today, and I am sick right now  pretty worn out, but glad it's over
|
Don't sweat it too much. While various areas of math (linear algebra/graph theory/combinatorics/etc) are important for certain fields of software (e.g. networking, graphics, maybe some parts of compiler/ast crap, etc), it's not gonna tank your career if you're not great at it or anything. Lot of fully competent software people who don't have good math chops.
That said, basically everything in programming does require logical attention to all the details, so make sure you read questions/code fully and understand all the parts. If you understand one part fully (one-to-one), don't necessarily immediately jump to the first connection in your head as the final answer without realizing the importance of all the other parts.
Right but don't get too caught up on the specific example (bijectivity, linear, etc), more on the tendency to jump to conclusions.
As long as you learn from your mistakes, and just get gradually more and more careful/precise, it'll be ok.
|
|
Lol, I got scared there for a sec since I recently started using nginx on linux (for rtmp streaming; less delay than using, say, twitch).
|
On May 15 2017 05:39 phar wrote: Don't sweat it too much. While various areas of math (linear algebra/graph theory/combinatorics/etc) are important for certain fields of software (e.g. networking, graphics, maybe some parts of compiler/ast crap, etc), it's not gonna tank your career if you're not great at it or anything. Lot of fully competent software people who don't have good math chops.
Unfortunately what I want to do seems to require decently high math knowledge, with linear algebra definitely being important. I actually won't be sad if it turns out I failed the class, it will be a chance to take it again and redeem myself.
Clearly my study habits were off. It's hard when I am running solo though, since I live so far from the school I don't have people to study with. I honestly should have just followed the MIT open courseware class instead of my own class. I went through the essence of linear algebra videos someone posted in this thread and they were great, but it only helps so much, because those are short so they aren't particularly comprehensive.
If i did pass, I take "applications of linear algebra" in the fall, so I'll study some more this summer and then use that class as an opportunity to get real good at it.
I don't really know what my problem is with these math classes. I always thought I was good at math, but I guess there is a big difference between being good at doing elementary operations in my head and understanding concepts.
At least I am doing well in this discrete math class, which most of my peers say is one of the hardest classes a CS student takes here (which is not my experience at all - I feel like it's way overhyped). My final in that is tomorrow. Studying all day today! then I am done for the semester.
|
I have an assignment to implement setjmp and longjmp in c without use of assembly/asm/built ins. I did some googling and im seeing some posts about how assembly is needed? Im confused. I might just be dumb since I dont have much experience with c(only did an intro to c++). Any pointers(ha) for this? My initial thought was just return an address in the function but that sounds too naiive.
|
What is the exact assignment? Are you sure you are reading it correctly?
We never even covered this in my class but it looks like it's literally saving the values in the registers into an array.
I guess that must mean it can only be usable within a local scope because otherwise your stack will get messed up and you can't restore the previous state.
Anyways, is that something your teacher taught you to do without assembly? I don't even know of that being possible without assembly.
Are you sure you aren't supposed to use inline assembly (assembly in your C program) ? I am guessing there probably is some library for getting register addresses in C but then you aren't really doing it yourself anyways and I don't see why your teacher wouldn't want you to use assembly.
|
The assignment is this:
For this assignment, you will write the code of two C functions called setjmp and longjmp which will allow a program to transfer control directly from one function to another without returning to the function that called them. These two functions are available in the standard library but here you will write your own version.
All code must be written in C. The following are not allowed: -Assembly language instructions -Using asm capabilities of gcc -Calling builtin functions of gcc such as __builtin_return_address and __builtin_frame_address
Then he gives an example of how the functions would work (skeleton) given that we provide the correct code.
I'm pretty sure this isn't supposed to be difficult given that he said we will only be using basic C (we don't spend any time learning C, we have to self learn it if we didn't learn it before) in this class. So far we've done basic assembly, some tracing of C programs, VHDL and basic digital logic. We didn't learn how to do this without assembly, or at least I don't think we did... this is confusing me and making me question if I was learning properly lol.
I think I'm understanding correctly that we aren't to use assembly. Am I missing something here?
edit:
the skeleton we were given:
main() { int r; r=setjmp(r); if(r==0) { fun1(); return(0); } else { print_str("error\n"); return(2); } } setjmp (v) int v; { /* ..... */ return(0); } longjmp (v) int v; { /* ..... */ return(1); } fun1 () { print_str("start fun1\n"); fun2(); return(0); } fun2 () { int d; print_str("start fun2\n"); longjmp(d); return(0); }
|
|
On May 16 2017 08:54 Nesserev wrote:First of all, format the code in a way so that an actual human can parse it. That said... is this a real copy/paste code example? The code makes no sense, uses no proper function prototyping, setjmp and longjmp clearly work very differently and are improperly used, wtf is this? setjmp (v) int v; { ... } Is this some archaic C dialect, what's going on?
here's a screenshot if it helps tabs got left out from pdf copy paste
+ Show Spoiler +
also I have no idea, I was pretty sure C functions weren't defined that way but that's how it's written
|
On May 15 2017 23:11 travis wrote: Unfortunately what I want to do seems to require decently high math knowledge, with linear algebra definitely being important. I actually won't be sad if it turns out I failed the class, it will be a chance to take it again and redeem myself.
Right, but what you want to do right now and what you'll eventually end up getting paid to do might not be the same thing. The set of software jobs out there that don't require significant linear algebra skills massively dwarfs the set of software jobs that do require significant linear algebra skills.
On May 15 2017 23:11 travis wrote: Clearly my study habits were off. It's hard when I am running solo though, since I live so far from the school I don't have people to study with. I honestly should have just followed the MIT open courseware class instead of my own class. I went through the essence of linear algebra videos someone posted in this thread and they were great, but it only helps so much, because those are short so they aren't particularly comprehensive.
If i did pass, I take "applications of linear algebra" in the fall, so I'll study some more this summer and then use that class as an opportunity to get real good at it. Yea that's a fair approach. I got a not-so-great job in my first architecture course (which I still, do this day, maintain was the fault of the grading TAs, not mine), but then took like three more architecture courses after that and aced them. And then learned that it didn't matter 'cus in order to actually get employed in that field you need a PhD, so woops. As long as you figure out how to learn it, doesn't really matter that it took you a course or two to do so.
On May 15 2017 23:11 travis wrote: I don't really know what my problem is with these math classes. I always thought I was good at math, but I guess there is a big difference between being good at doing elementary operations in my head and understanding concepts.
Yea here's the problem. In US highschool they don't teach math. They teach rote computation and memorization. The "math" you do in highschool is extremely basic. E.g. nobody actually calculates a derivative or an integral in the real world, they use computers for that. The actual math classes - analysis, algebra (groups, rings, lattices, not y=ax+b), topology, combinatorics, etc... you don't even know what those classes are until you're in Uni here. There's basically no similarity between the two.
So again, don't sweat it too much, a lot of people are in the same situation as you, figuring out that actual math is a giant scary clusterfuck and actually they're not that good at it. I didn't figure it out until like my 2nd year, at which point I somehow got past one course on manifolds, differential forms, and I don't even remember what else, and then talked with my professor and agreed that I'd nope the fuck out of the whole field.
Fortunately, it turns out that the vast majority of engineering and comp sci don't need anything more fancy than basic computational math. Got those multivar calc formulas memorized? Know basic matrices (or at least how to plug it into a friggin' computer)? Good to go.
On May 15 2017 23:11 travis wrote: At least I am doing well in this discrete math class, which most of my peers say is one of the hardest classes a CS student takes here (which is not my experience at all - I feel like it's way overhyped). My final in that is tomorrow. Studying all day today! then I am done for the semester.
Yea totally different ball game. If/when you get to computational theory (e.g. automota theory) it might be a tad bit more difficult than basic discrete math, but not too bad. (Also depending on your program, it might be billed as a comp sci course not a math course, and be relatively easy)
I should point out, my bro is actually really good at real math, got through like 3 years of graduate level math courses, and now has a job that doesn't use math at all in any way shape or form, because well, it turns out there aren't any jobs that use that kind of real math.
I'll just leave this here
https://lh5.googleusercontent.com/-ot8tqQZBfgU/USWNJiwtjnI/AAAAAAAAJ-4/wvYt7ZYUADs/w800-h800/multiple-choice.jpg
Also incidentally, turns out that a phd in physics actually DOES yield gainful employment... on wall street (wut?).
|
On May 16 2017 08:54 Nesserev wrote:First of all, format the code in a way so that an actual human can parse it. That said... is this a real copy/paste code example? The code makes no sense, uses no proper function prototyping, setjmp and longjmp clearly work very differently and are improperly used, wtf is this? setjmp (v) int v; { ... } Is this some archaic C dialect, what's going on?
It's C89/90: https://software.intel.com/en-us/articles/old-style-c-function-argument-declarations-are-supported
Also, the code is formatted really bad even in the PDF. I guess someone has been teaching C for a long time and never bothered to actually track changes to the language or educate themselves past the initial point... Doesn't bode well.
Edit:
Here's the code brought up to a bit more modern standards (but it still doesn't make much sense):
#include <stdio.h>
int setjmp(int v); int longjmp(int v); int fun1(void); int fun2(void);
int main(void) { int r = setjmp(r);
if (r != 0) { printf("error\n");
return 2; }
fun1();
return 0; }
int setjmp(int v) { /* ... */ return 0; }
int longjmp(int v) { /* ... */ return 1; }
int fun1(void) { printf("start fun1\n");
fun2();
return 0; }
int fun2(void) { int d;
printf("start fun2\n");
longjmp(d);
return 0; }
|
On May 16 2017 11:15 phar wrote: Also incidentally, turns out that a phd in physics actually DOES yield gainful employment... on wall street (wut?).
This is because equations used in nuclear physics to model diffusion have the same form as the ones used for pricing derivatives. In other words, both fields use stochastic calculus. I used to work in that R&D and my boss was a former researcher at the CERN.
|
I got a somewhat programming related question. I know that you use excel to create tables in a database as well to create excel tables from a database, I am unsure though to what extend. Would I be able to some extend retrieve data in a similar capacity to SQL-Queries, without having the person using the excel sheet having to deal with the SQL. Of course I would have to write the needed SQL-statements at some point, the whole idea is that the person using this wouldn't have to deal with it. I intend to create this for some people that can handle excel but not SQL so they can profit from a database. Something along the lines of: + Show Spoiler +![[image loading]](http://i.imgur.com/LluVknw.png) * Input Mask is for feeding Data to the Database. Everything in there will be added to a table/create a table. This part seems clear and definitely possible, the only exception I got is, how would I go about adding additional attributes to an item? If I just add another column, for example manufacturer, would it just get added in the database? How about calculations, could I define another field "value of storage" where I simply calculate the value by quantity*value and then push it back into the database to update the table? Like the good ol’ ‘=B3*C3’ excel calculation **Select Mask is the part I am most concerned about. Basically, I want the user to be able to specify what he wants to see. In this case he wants all products where there are 7 in storage and who are black. He just types the values in the correct fields and the corresponding result of "select * from products p where p.quantity = 7 AND p.color = black" gets displayed below.
Especially for the **-part I couldn't really find any info, most stuff I found dealt exclusively with retrieving/feeding whole tables into databases. Input Mask and select Mask doesn’t have to be in the same excel sheet ofc.
So far the process they use is their data comes in an excel table, they then would use the sort function to sort by one table and then look by hand for what they are looking. For my example, they would let excel sort the table by quantity/color and then check for the other attribute by hand/search function. Of course their excel sheets are a lot bigger and they have to search for more than just 2 attributes. I also know that it would probably be a lot easier (for me) to simply write a small tool, but after a lot of consideration and evaluating, excel+DB seems to be the best/most realistic solution for the people who will use it afterwards.
|
Well I passed linear algebra with a C+. My grade on the final wasn't nearly as atrocious as I expected.
I still don't feel like I learned enough, so I will have to fix that!
|
On May 17 2017 01:45 Artesimo wrote:I got a somewhat programming related question. I know that you use excel to create tables in a database as well to create excel tables from a database, I am unsure though to what extend. Would I be able to some extend retrieve data in a similar capacity to SQL-Queries, without having the person using the excel sheet having to deal with the SQL. Of course I would have to write the needed SQL-statements at some point, the whole idea is that the person using this wouldn't have to deal with it. I intend to create this for some people that can handle excel but not SQL so they can profit from a database. Something along the lines of: + Show Spoiler +![[image loading]](http://i.imgur.com/LluVknw.png) * Input Mask is for feeding Data to the Database. Everything in there will be added to a table/create a table. This part seems clear and definitely possible, the only exception I got is, how would I go about adding additional attributes to an item? If I just add another column, for example manufacturer, would it just get added in the database? How about calculations, could I define another field "value of storage" where I simply calculate the value by quantity*value and then push it back into the database to update the table? Like the good ol’ ‘=B3*C3’ excel calculation **Select Mask is the part I am most concerned about. Basically, I want the user to be able to specify what he wants to see. In this case he wants all products where there are 7 in storage and who are black. He just types the values in the correct fields and the corresponding result of "select * from products p where p.quantity = 7 AND p.color = black" gets displayed below. Especially for the **-part I couldn't really find any info, most stuff I found dealt exclusively with retrieving/feeding whole tables into databases. Input Mask and select Mask doesn’t have to be in the same excel sheet ofc. So far the process they use is their data comes in an excel table, they then would use the sort function to sort by one table and then look by hand for what they are looking. For my example, they would let excel sort the table by quantity/color and then check for the other attribute by hand/search function. Of course their excel sheets are a lot bigger and they have to search for more than just 2 attributes. I also know that it would probably be a lot easier (for me) to simply write a small tool, but after a lot of consideration and evaluating, excel+DB seems to be the best/most realistic solution for the people who will use it afterwards. Excel has a Data ribbontab, with External Data and other options that will allow you to specify a database connection (ODBC for example) to retrieve data form a database.
In general however, you don't want Excel writing to the database (and especially not dropping and creating tables). Create a simple import task in the database instead.
|
On May 17 2017 03:13 supereddie wrote: Excel has a Data ribbontab, with External Data and other options that will allow you to specify a database connection (ODBC for example) to retrieve data form a database.
In general however, you don't want Excel writing to the database (and especially not dropping and creating tables). Create a simple import task in the database instead. So everything I described is possible? I know that my idea is more of a hacked solution, I got some experience with JPQL etc, but in this case I don’t really have the ability to influence the available resources and as it looks right now, I won’t be able to do much more than having a database with read/write access and excel. In short, there are a bunch of factors which make it acceptable having to wipe the database if someone fucked up and feed the data again. Pretty much all of it will become obsolete every 3month or so anyways. It is basically a poor and glorified way to sort/search the data for multiple criteria and to make it more accessible. This obviously isn’t anything that I am getting paid for or anything like that.
|
Also, maybe you don't need a database at all and just use Excel's data tables? Just put the 'source data' on a seperate sheet . Also also, you can enable 'Filter' on rows and columns (just select the rows/columns in Excel and press Filter): possible filter values will be available in a dropdown.
|
I'm currently going through tutorials of elixir and phoenix framework and I have been reading it like "Oh shit" "Oh it's nice" "Oh shit this is nice" "Damn this is good" "Hell yeah, this shit is awesome" "Oh my god" "Oh wow" and such. Shit is so easy to learn too. Does anyone here have real world production experience of elixir and phoenix?
|
Hyrule18977 Posts
I've never even heard of them. What language are they for?
|
|
|
|