|
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. |
On February 05 2014 16:14 icystorage wrote: in the future, what do you guys think of a stay-home programmer dad? like just do freelance or similar-work in the house?
I thought it would be cool to work at home as a contractor but the reality can be quite different.
The most important thing I think is to only care about yourself, most of the guys that hire you are just out there to get a buck and don't give a crap about you. Also be absolutely 100% clear about EVERYTHING, if there's ever a time to be OCD, now is the time.
Only do the work that is outlined. If he asks you for more work after the scope has been signed, amend the scope/contract and charge more or reject it. Otherwise you will end up doing more work, and he will expect you to have no delays on the original work as well and then may tear the contract if you slow down too much.
The last contractor I worked with I felt used and abused. I was still in university but I had a good CV honestly I just wanted some work experience. I thought that if I didn't charge a lot and worked hard he would be happy (and I would be happy), nope, he just gave me more work to do and if I didn't do it he'd call me up.
He ended up giving me a weeks notice to do a lot of things that he never mentioned that he wanted (e.g full test coverage, when I asked him about tests and said I would charge more if he said yes, he didn't reply that he wanted them only that they were important but were secondary to time-frame, basically if the time allows for it and he kept the charge the same).
I ended up leaving the project halfway through, and he tried his best to pay me the minimal amount of money possible. At one point he said he owed me $2,000, and then when I said this was unfair because this assumes we aren't up to QA yet which means the features hes asking me to do aren't valid yet. He was basically trying to get rid of me because I hadn't finished QA features, but then he's paying me for phases before that point. Then he said ok we will pay you $1,500 because as you said, not up to QA phase yet. Wowwww really? He knew I was young and was charging almost nothing in the first place, literally like stealing candy from a baby. What a fucking tool.
I made LOTS of mistakes in this project, as you can see but I was young and naive. There were lots of warning signs, the contract needed amending 3 times through a lawyer before it was satisfactory, I could have been fucked over big time with the original contract (originally I was liable for more than what the project was worth, so I could lose $50k even though they would only pay me $6k for the full job).
Another is even though I asked him a lot of stuff up front he gave me a lot of vague answers (e.g tests are "important", only do them if "time allows"). This is never good, always confirm an absolute YES or NO with a straight up binding hollar dollar cash money figure on every single feature.
If the contract needs fixing, don't even bother with that company, its literally not worth the pain that will inevitably follow. If they're willing to give you a shitty contract, they're probably shitty people.
On February 05 2014 18:02 WolfintheSheep wrote:Show nested quote +On February 05 2014 16:14 icystorage wrote: in the future, what do you guys think of a stay-home programmer dad? like just do freelance or similar-work in the house? Far more viable for positions like Web Designers or UI Designers, where you create something to a client's liking and then hand it over 100%. The more you become involved in software or other back-end development, the more your role involves maintenance and upkeep, which inevitably leads to demand for physical presence. Like all careers, though, anything's possible if there's a demand, and if you sell yourself properly.
This as well, if you do lots of freelance projects eventually you are going to be overwhelmed with maintaining all of them.
You have two options, In the contract you should assume no responsibility for the project after it is finished Or know that they are willing to pay bucket loads of cash for easy maintenance Or both
|
I've been working for a company that had a lot of freelancers in its developer team (not because they didn't want to "properly" employ them but because the guys preferred to be freelancers). It seemed to me as it was very relaxed for the freelancers as the company and them trusted each other. Basically they just had to show up and do their work as everyone else and the employer trusted them to do their best. And they actually did, because we worked very closely together as a team.
What I'm trying to say is: Yes, you can end up like sluggaslamoo (indeed a friend of mine stopped freelancing because he ran into that kind of project too often) and have terrible contract partners. But there are also nicer opportunities. I believe the best is to ask friends and colleges if they have experience with this person/company. You wont always have that luxury though and then its good to have a clear contract and to communicate that extra service will cost extra.
|
On February 05 2014 16:14 icystorage wrote: in the future, what do you guys think of a stay-home programmer dad? like just do freelance or similar-work in the house?
As a dad, I'm thinking this is pretty much the most miserable thing I can think of. It might be possible once your kids are grown, but when you are taking care of your kid you don't have the attention to be able to focus on your programming -- and I only have one.
So I think to pull this off your day would look something like, get up at like 5 am and work until the kid gets up. Then wait until your kid goes to bed and then put in the rest of your day. You might be able to get an hour or two in when they are napping, assuming there isn't any work to do around the house since you're the stay at home parent. Maybe you could have your wife watch the kid when she gets off work, but then when are you going to spend any time with her? So now you're working (yes taking care of the kid is work) like 15 hour days, if your wife only works 8 hours and you only work 8 hours. You could work on the weekend, but now you're working weekends.
This does assume that you want to progress in your career, and not just pick up an odd job to make a few bucks here or there. Hopefully you find a sugar momma or don't really mind living week to week.
Put the kid in daycare for a half day, get a nanny, or just be a stay at home dad.
If you have kids already, then you're insane, if you don't have kids already, please come back in the future and let us know how crazy you were
|
On February 05 2014 14:14 sluggaslamoo wrote:Show nested quote +On February 05 2014 05:03 Vorenius wrote:On February 05 2014 03:40 Animzor wrote:On February 05 2014 03:21 ThatGuy wrote: Of course, there could be a ton of other things happening here. Maybe you don't set the stock value on a newly created stock. Maybe you're using a copy constructor and another Stock with an empty Stock value. You'll either need to debug deeper or be more open with the question to actually isolate whether that block of code is indeed causing your issues. Sorry, I didn't want to be an asshole and post too much code. Anyway, what I have is a Person class and a Stock class. Every Person includes an arraylist which can contain a bunch of items, like Stock. In the Stock class I have a method setStockValue that looks like this + Show Spoiler +public void setStockValue(int price) { this.price = price; } I assume that by changing the price in the Stock class, I am changing it permanently. But I can't think of another way to do it. A small tip unrelated to your question: + Show Spoiler +If your function sets the price, then name it setPrice. If the price is actually the stock value, then rename that variable to stockValue or something similar. Having a function called setStockValue that doesn't modify anything called stockValue is quite confusing  As for your problem, feel free to post more of your code. Where are you creating your stocks? When are you running your for-loop?  I disagree. Programs should model the Business Rules, in this case it is more correct this way. In the future the prices may change but the stock values may be slightly different (or vice-versa), but in the end we want the list of stock prices not values (or vice-versa). However stock price may mostly rely on the value given, so the stock price right now would be the value of the stock, but maybe not later. From a maintenance and design perspective the way he has done it is actually better. Although there still could be some improvement, so it is not as side-effect prone. Be careful not to carpet bomb your's and other's code with conventions purely for the sake of convention. Every convention has a context, be aware of the context, in many contexts you would be correct, but not in this one. I see it all the time in this thread. When you model the business rules with your logic, the code is much easier to maintain, than faux clean code because you followed all the conventions. The latter will cause all sorts of headaches for you when your client decides he wants some "simple changes". When your code aligns with the business rules, the clients suggestions become much simpler to understand and implement.
I think you're over thinking this a bit. While I agree that convention for the sake of convention is a bad thing, we all had to start somewhere and learn. I'm guessing the guy who posted his code can't be more than a year (maybe two) into his development experience. You have to understand the conventions first to be able to make informed decisions about breaking them or when to use them.
The original post of his shows that he had the method named setStockValue(int price) that was setting the price, but then a getStockValue() that was returning amount * price.
If I'm a developer working on this code, I'm going to be confused as hell when I see a domain object that has a matching getter/setter that doesn't return the same value with the getter after I call the setter. That isn't encapsulating business logic, it's some guy learning how to program.
The changed version that he posted later on with a setStockPrice(int price) and getStockValue() { return amount * price } makes a lot more sense.
|
On February 05 2014 20:16 berated- wrote:Show nested quote +On February 05 2014 16:14 icystorage wrote: in the future, what do you guys think of a stay-home programmer dad? like just do freelance or similar-work in the house? As a dad, I'm thinking this is pretty much the most miserable thing I can think of. It might be possible once your kids are grown, but when you are taking care of your kid you don't have the attention to be able to focus on your programming -- and I only have one. So I think to pull this off your day would look something like, get up at like 5 am and work until the kid gets up. Then wait until your kid goes to bed and then put in the rest of your day. You might be able to get an hour or two in when they are napping, assuming there isn't any work to do around the house since you're the stay at home parent. Maybe you could have your wife watch the kid when she gets off work, but then when are you going to spend any time with her? So now you're working (yes taking care of the kid is work) like 15 hour days, if your wife only works 8 hours and you only work 8 hours. You could work on the weekend, but now you're working weekends. This does assume that you want to progress in your career, and not just pick up an odd job to make a few bucks here or there. Hopefully you find a sugar momma or don't really mind living week to week. Put the kid in daycare for a half day, get a nanny, or just be a stay at home dad. If you have kids already, then you're insane, if you don't have kids already, please come back in the future and let us know how crazy you were 
I fully agree with this.
I'm a stay-at-home-dad at the moment (1yr old daughter) and I like to do hobby-programming in my free time, but between taking care of my daughter and doing general household chores there is very little time for focussed work. My kid sleeps 3-4 hours during the day in 1-2 naps, which allow for some time, but other than that it's only after she's gone to bed for the night. Sure there are plenty of moments while she's awake where she's playing on her own and I can get some time on the computer, but these are highly irregular and you don't really have time to properly focus on a project.
I like being a stay-at-home-dad (for now at least). I like working on software development related things. I'd go crazy if I tried both at the same time.
|
I want to create a new website with Java. When I was messing around a bit with Java in 2008 it was with JSP and JPA and trying to use MVC. What technologies and/or frameworks are hip nowadays? And where can I find some tutorials? I read something about JSF being the 'successor' of JSP, but are there other/better things out there? I also read something about AOP. Is that useful for a fairly simple website?
(I have 10+ years experience in C# ASP.Net programming and would like to try Java. And I don't care about PHP/Ruby/Python/Perl/everythingelsenotJava).
|
On February 06 2014 03:24 supereddie wrote: I want to create a new website with Java. When I was messing around a bit with Java in 2008 it was with JSP and JPA and trying to use MVC. What technologies and/or frameworks are hip nowadays? And where can I find some tutorials? I read something about JSF being the 'successor' of JSP, but are there other/better things out there? I also read something about AOP. Is that useful for a fairly simple website?
(I have 10+ years experience in C# ASP.Net programming and would like to try Java. And I don't care about PHP/Ruby/Python/Perl/everythingelsenotJava). I wasn't aware Java programming was a thing until a few weeks ago. Google hasn't been too helpful but I hear Amazon's website runs on Java backend. Can anyone add details about this?
|
On February 06 2014 03:24 supereddie wrote: I want to create a new website with Java. When I was messing around a bit with Java in 2008 it was with JSP and JPA and trying to use MVC. What technologies and/or frameworks are hip nowadays? And where can I find some tutorials? I read something about JSF being the 'successor' of JSP, but are there other/better things out there? I also read something about AOP. Is that useful for a fairly simple website?
(I have 10+ years experience in C# ASP.Net programming and would like to try Java. And I don't care about PHP/Ruby/Python/Perl/everythingelsenotJava). JSF is pretty much the MVC of Java server backends. JSF is the MVC server framework, which uses Facelets for views, but you can also use JSP for views if you want (it's a much older technology though). JSF is probably the way to go.
|
We are using java backend at where i work. We use eclipse with maven and SVN for development, spring framework for backing beans, spring data with mongodb for our data, solr for indexing, spring security for our security/roles/acl, jsf/primefaces for our webpages and tomcat server to deploy the project. It works nice, but i don't have much experience with other stuff so i can't compare. For simple stuff, mkyong and krams915 has a lot of tutorials and spring has good documentation
|
On February 05 2014 21:10 berated- wrote:Show nested quote +On February 05 2014 14:14 sluggaslamoo wrote:On February 05 2014 05:03 Vorenius wrote:On February 05 2014 03:40 Animzor wrote:On February 05 2014 03:21 ThatGuy wrote: Of course, there could be a ton of other things happening here. Maybe you don't set the stock value on a newly created stock. Maybe you're using a copy constructor and another Stock with an empty Stock value. You'll either need to debug deeper or be more open with the question to actually isolate whether that block of code is indeed causing your issues. Sorry, I didn't want to be an asshole and post too much code. Anyway, what I have is a Person class and a Stock class. Every Person includes an arraylist which can contain a bunch of items, like Stock. In the Stock class I have a method setStockValue that looks like this + Show Spoiler +public void setStockValue(int price) { this.price = price; } I assume that by changing the price in the Stock class, I am changing it permanently. But I can't think of another way to do it. A small tip unrelated to your question: + Show Spoiler +If your function sets the price, then name it setPrice. If the price is actually the stock value, then rename that variable to stockValue or something similar. Having a function called setStockValue that doesn't modify anything called stockValue is quite confusing  As for your problem, feel free to post more of your code. Where are you creating your stocks? When are you running your for-loop?  I disagree. Programs should model the Business Rules, in this case it is more correct this way. In the future the prices may change but the stock values may be slightly different (or vice-versa), but in the end we want the list of stock prices not values (or vice-versa). However stock price may mostly rely on the value given, so the stock price right now would be the value of the stock, but maybe not later. From a maintenance and design perspective the way he has done it is actually better. Although there still could be some improvement, so it is not as side-effect prone. Be careful not to carpet bomb your's and other's code with conventions purely for the sake of convention. Every convention has a context, be aware of the context, in many contexts you would be correct, but not in this one. I see it all the time in this thread. When you model the business rules with your logic, the code is much easier to maintain, than faux clean code because you followed all the conventions. The latter will cause all sorts of headaches for you when your client decides he wants some "simple changes". When your code aligns with the business rules, the clients suggestions become much simpler to understand and implement. I think you're over thinking this a bit. While I agree that convention for the sake of convention is a bad thing, we all had to start somewhere and learn. I'm guessing the guy who posted his code can't be more than a year (maybe two) into his development experience. You have to understand the conventions first to be able to make informed decisions about breaking them or when to use them. The original post of his shows that he had the method named setStockValue(int price) that was setting the price, but then a getStockValue() that was returning amount * price. If I'm a developer working on this code, I'm going to be confused as hell when I see a domain object that has a matching getter/setter that doesn't return the same value with the getter after I call the setter. That isn't encapsulating business logic, it's some guy learning how to program. The changed version that he posted later on with a setStockPrice(int price) and getStockValue() { return amount * price } makes a lot more sense.
You're right. I guess because I was replying to your reply I didn't know the context.
|
On February 06 2014 03:24 supereddie wrote: I want to create a new website with Java. When I was messing around a bit with Java in 2008 it was with JSP and JPA and trying to use MVC. What technologies and/or frameworks are hip nowadays? And where can I find some tutorials? I read something about JSF being the 'successor' of JSP, but are there other/better things out there? I also read something about AOP. Is that useful for a fairly simple website?
(I have 10+ years experience in C# ASP.Net programming and would like to try Java. And I don't care about PHP/Ruby/Python/Perl/everythingelsenotJava).
I can't really compare with other frameworks but this is a thing: http://www.playframework.com/
I've only worked with it in Scala though and that worked out somewhat ok.
|
@the dad replies
what if the kids are at school? like going to elementary or highschool? that gives you more time to work at home right?
|
On February 06 2014 08:54 icystorage wrote: @the dad replies
what if the kids are at school? like going to elementary or highschool? that gives you more time to work at home right?
sure it makes it much more feasible, but for me personally I need the office time. I enjoy human interaction. I find working from home I'm able to rationalize why I need a break much more often. others thrive I guess, it's just not for me.
I think when you work in the office you're more likely to separate work life and home life. you're able to give work all you have when you're there and all to your family when you're home. when I work from home I always feel like I have something to do for both sides so I'm not really giving my full attention to either.
|
Hey guys: I am trying to do a quick analysis in pandas. Its that Kaggle question, how to predict if you live or die in the Titanic sinking. So here are the steps I took: import data into a data frame scan data frame for gender and class if gender is female and class is 1 and 2, survived if gender is female and class is 3, 50/50 chance using randomint to see if you survive or not if male, dead.
survived/dead is 1/0. Prior to the scan I create an empty dictionary, the key is each individual's Id and the value is the 1/0 that I add in after the scan through. Seems reasonable?
|
Did a quick implementation of merge sort in Perl, it sometimes works but bugs out unpredictably, randomly merging the subarrays into two sorted mini-lists instead of one continuous list and adding superfluous elements. I know that it only happens when $index1 overflows past $mid+1, but I'm not sure what in turn causes that or how to fix it. Any ideas?
+ Show Spoiler + #!perl
use strict;
sub mergesort { # Pointer to main array, pointer to work array, start index, ending index my ($array, $work_array, $start, $end) = @_; die "Error: need array and work_array as arguments\n" unless @_ >= 2;
($start, $end) = (0, $#$array) if !defined($start) or !defined($end);
if ($end - $start > 0) {
my $mid = int(($start + $end) / 2);
&mergesort($array, $work_array, $start, $mid); &mergesort($array, $work_array, $mid+1, $end);
my ($index1, $index2, $indexm) = ($start, $mid+1, 0);
while ($index1 <= $mid or $index2 <= $end) {
if ($index2 > $end or $$array[$index1] < $$array[$index2]) { $$work_array[$indexm] = $$array[$index1]; ++$index1;
} elsif ($index1 > $mid or $$array[$index1] >= $$array[$index2]) { $$work_array[$indexm] = $$array[$index2]; ++$index2;
} else { die "Error\n"; }
++$indexm; }
$$array[$start+$_] = $$work_array[$_] for (0..$indexm-1);
} }
my @array1 = (); my @array2 = (); push @array1, int rand(100) - 3 for 1..10;
print "Pre-sort:\n@array1\n"; mergesort(\@array1, \@array2); print "Final results:\n@array1";
|
On February 07 2014 12:22 Sub40APM wrote: Hey guys: I am trying to do a quick analysis in pandas. Its that Kaggle question, how to predict if you live or die in the Titanic sinking. So here are the steps I took: import data into a data frame scan data frame for gender and class if gender is female and class is 1 and 2, survived if gender is female and class is 3, 50/50 chance using randomint to see if you survive or not if male, dead.
survived/dead is 1/0. Prior to the scan I create an empty dictionary, the key is each individual's Id and the value is the 1/0 that I add in after the scan through. Seems reasonable?
Seems fine. Although I'd possibly add more randomness to it by shuffling the array before selecting a random entry from it (to simulate the chaos of people rushing to the lifeboats while being at different locations of the ship).
Just one more easy step and it adds a whole new dimension:
srand((unsigned int) time(0)); // generate random seed
mixed arr[] = { stuff, goes, here, ... }; int n = sizeof(arr);
for (int i = 0; i < n; i += 1) { int s = random(n); mixed tmp = arr[i];
arr[i] = arr[s]; arr[s] = tmp; }
|
On February 07 2014 22:21 Manit0u wrote:Show nested quote +On February 07 2014 12:22 Sub40APM wrote: Hey guys: I am trying to do a quick analysis in pandas. Its that Kaggle question, how to predict if you live or die in the Titanic sinking. So here are the steps I took: import data into a data frame scan data frame for gender and class if gender is female and class is 1 and 2, survived if gender is female and class is 3, 50/50 chance using randomint to see if you survive or not if male, dead.
survived/dead is 1/0. Prior to the scan I create an empty dictionary, the key is each individual's Id and the value is the 1/0 that I add in after the scan through. Seems reasonable? Seems fine. Although I'd possibly add more randomness to it by shuffling the array before selecting a random entry from it (to simulate the chaos of people rushing to the lifeboats while being at different locations of the ship). + Show Spoiler +Just one more easy step and it adds a whole new dimension: srand((unsigned int) time(0)); // generate random seed
mixed arr[] = { stuff, goes, here, ... }; int n = sizeof(arr);
for (int i = 0; i < n; i += 1) { int s = random(n); mixed tmp = arr[i];
arr[i] = arr[s]; arr[s] = tmp; }
Can you explain that? Assuming an uniform distribution (off the PRNG) shuffling the array before selecting a random entry shouldn't add any randomness.
|
On February 05 2014 11:37 WarSame wrote:On Ubuntu one of the recent updates apparently messed up gcc(or I may have messed it up when I was trying to get an old version of gcc for something that required it). I am trying to compile and link together a skeleton assembly file. I can compile all the files with gcc no problem. However, when I go to link them together into an executable it complains that it "Cannot find crt1.o". Looking online suggests that this was moved in a recent update, and gcc doesn't know where it is. The 2 suggestions I saw were this workaround which doesn't work for me and this one which I don't trust. So I would like some advice on how to handle this. So far I have tried the first workaround, and have also tried reinstalling gcc(which states all 11 were unchanged) using the command sudo apt-get install gcc. If anyone can give me advice on what else would be worth trying I would appreciate it. Alternatively, I may move to using g++ in order to compile/link the files, but this is partly for an assignment due in a week so I'd rather not have to do that. Thank you for reading. A classmate told me about this fix: use sudo apt-get install gcc-multilib.
|
Bisutopia19299 Posts
Every time I see this thread title I think we should put a project on SVN and give everyone access. Then we can all just jump in and add to the game whenever we have free time. C++ of course (my preference) and built from the ground up. I'd totally put together a frame for a game to jump start this.
|
it's in glibc i think warsame.
|
|
|
|
|
|