Learn PythonI don't know any of thise.
Since I have alot of time on y hands, which should i do first?
I don't know any of thise.
Since I have alot of time on y hands, which should i do first?
I don't know any of thise.
Since I have alot of time on y hands, which should i do first?
Well, switching isn't always trivial. The first switch between langages that use names/references and those that use variables can feel a bit strange, the first encounter of functional feels like you don't know what you do anymore.I wouldn't dwell too much on choosing a language, it turns out once you know one switching to another is pretty trivial. Just learn one first, and then decide where to go from there.
Almost 15 years of being a programmer, and I'm done.
Started out doing ASP, then PHP/JS/HTML/CSS and loved it. The job then moved in C#/ASP.NET which I didn't get on with, and I've since moved to a different company and I'm really struggling (despite them apparently being really happy with me, to the point of me being in line for a promotion)
Anyhow, today I had the chance to do a bit of work in Javascript (just helping out a friend, non-paid) and jumped at the chance to try to help out, and also do something I was more confident with... and even then I was completely overcome with feelings of helplessness looking through the code and felt completely overwhelmed.
It's been a long time coming I think, but I'm handing in my notice on Monday, and couldn't feel more relieved. Sorry for the rant![]()
How do I code sign a generic binary on MacOS? I have a developer license.
Well, there's javascriptMaybe you just gotta try something new for programming to be fun again. I don't see any functional languages in your list
http://learnyouahaskell.com/
Beat Shenzhen I/O then code a game in it.I graduated with a degree in CS from a p reputable engineering school this year and am currently working for a company that does various web dev contracting, primarily regarding the telecom industry. it's been fun and i've learned quite a bit about web design/photoshop i didn't already know, but it's also extremely easy. I'm looking for a challenge, but i've also realized that I'm incredibly out of touch when it comes to a lot of programming principles, having been 6-8 months since I've seriously developed something from the ground up (outside of basic web stuff and google/shell scripts for process improvement things at work).
so i've been doing more online challenges and reading 'cracking the code' to prep for some technical interviews and it's definitely helping bring a lot to stuff back fairly quickly. I'm trying to lock down what I actually want to do with my degree and coming up short, however. I definitely enjoyed the systems level / comp org classes the most throughout the school as they offered a healthy challenge, but i don't think i'd actually be interested in a full-time job based around that.
what i need to do is find some cool and personal medium-scale programming projects to work on over the next month or so. I've been toying around with some vive development via unity and that's fun, but I'd also like to build some stuff that isn't gaming related. I know once i have something to work on I'll enter my coding flowstate and just grind it out and enjoy the work, but I'm struggling to think of a good project to build. Any ideas?
Annoying doesn't even come close, I just can't do it. Not sure whybut if the change from PHP to C# felt annoying, the jump to Haskell will seem like starting from scratch again![]()
Well, I'd say that you were interested in the creating/building part, not by the algorithmic part behind. When programming is mostly a tool, I'm not surprised you can lose interest in it, and be annoyed at changes.Annoying doesn't even come close, I just can't do it. Not sure why![]()
Can't say I'm surprised, I thought you were after more than a different, fresher way to look at algorithmicsJust looking at Haskell now also, and nope.
Hey, sometimes learning something completely different is all it takes to make programming fun again. And you can't make functions without fun.Can't say I'm surprised, I thought you were after more than a different, fresher way to look at algorithmics![]()
My internship is requiring that I do unit testing on all of my code. I've never done unit testing before. My work is being done in Python. I get the idea of unit testing after reading up on it, but I'm not sure how to execute it all. Primarily, I am unsure when it comes to unit testing void methods. A method that has a return statement seems pretty easy to unit test. You assert that some given input should return some specified output and let the test check as your method changes on a test set. But a void method will typically have side effects instead of return values. How is unit testing a void method typically done?
v = vector() // initial capacity is 2, for the sake of illustration
VERIFY(v.capacity() == 2);
VERIFY(v.size() == 0);
v.add(1);
VERIFY(v.capacity() == 2);
VERIFY(v.size() == 1);
v.add(2);
VERIFY(v.capacity() == 2);
VERIFY(v.size() == 2);
v.add(3);
VERIFY(v.capacity() == 4);
VERIFY(v.size() == 3);
std::vector<int> v; // initial capacity is 16
VERIFY(v.capacity() == 16);
VERIFY(v.size() == 0);
for (int i=0; i < 16; ++i)
v.push_back(i);
VERIFY(v.capacity() == 16);
VERIFY(v.size() == 16);
v.push_back(16);
VERIFY(v.capacity() == 32);
VERIFY(v.size() == 17);
Well, let's say you had a void sort method that didn't return a sorted vector, but instead was an instance method that sorted the vector internally. How would a unit test for that look like?A non-void method can have side effects just as easily as a void method. Forget about return values, you should be thinking about "does the function actually do what it's supposed to do?" That includes verifying return values and side effects.
For example, maybe you're writing a vector class that doubles its capacity once it has to overflow. So you do something like this:
Code:v = vector() // initial capacity is 2, for the sake of illustration VERIFY(v.capacity() == 2); VERIFY(v.size() == 0); v.add(1); VERIFY(v.capacity() == 2); VERIFY(v.size() == 1); v.add(2); VERIFY(v.capacity() == 2); VERIFY(v.size() == 2); v.add(3); VERIFY(v.capacity() == 4); VERIFY(v.size() == 3);
OTOH, maybe it's better to try a higher number, since there can be edge cases around small numbers. So you might try something like this.
Code:std::vector<int> v; // initial capacity is 16 VERIFY(v.capacity() == 16); VERIFY(v.size() == 0); for (int i=0; i < 16; ++i) v.push_back(i); VERIFY(v.capacity() == 16); VERIFY(v.size() == 16); v.push_back(16); VERIFY(v.capacity() == 32); VERIFY(v.size() == 17);
This is a contrived example since you're not going to be writing unit tests for STL functions, but if you were the author of STL, you might write a unit test like to verify that your vector class is standards' compliant, for example.
Well, let's say you had a void sort method that didn't return a sorted vector, but instead was an instance method that sorted the vector internally. How would a unit test for that look like?
std::vector<int> actual = {3, 1, 2, 4, 6, 7, 5, 8, 9, 0};
std::vector<int> expected = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
actual.sort();
VERIFY(actual == expected);
Code:std::vector<int> actual = {3, 1, 2, 4, 6, 7, 5, 8, 9, 0}; std::vector<int> expected = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; actual.sort(); VERIFY(actual == expected);
I see. Should unit tests always rely on some sort of language-native comparator? Like, would it be bad to create an isSorted method since that would have to be tested too?
I see. Should unit tests always rely on some sort of language-native comparator? Like, would it be bad to create an isSorted method since that would have to be tested too?
I see. Should unit tests always rely on some sort of language-native comparator? Like, would it be bad to create an isSorted method since that would have to be tested too?
Quoted for emphasis... There's a dedicated module for this in Python, I'd say it's the way to go.Not sure about other languages but Python's unittest class has comparator methods in it where you pass the expected and the actual result values. The methods are not straight up equality test; some if greater than, less than, if it raises an exception or not etc.
Well, I feel like the problem lies in programming not being the reason of the fun from the go.Hey, sometimes learning something completely different is all it takes to make programming fun again. And you can't make functions without fun.![]()
About this...1) It's not good to clutter up a class's interface with code whose sole purpose is to aid in testing. Adding tests is supposed to increase your code coverage, not reduce it.
Might try getting back into more regular coding at home in my spare time and pick up a book or two. Any good recommendations on a language (and book) to start picking things back up with? C++? C#? Something else? I've been out of the coding game too long.
About this...
In Python, nothing is private. Bad or not, at least, that makes tests easy to perform (and easy to break).
But let's return into C++ for example. You can create tests that check the good behavior of all public functions and methods.
When you've declared part of the class private (for example because implementation can change, and you want to be sure that people won't rely on it), should you totally avoid creating tests that check the good behavior of the current implementation part, and only check the public part?
Because I don't see how you can nicely test the behavior of the private part.
class Foo {
public:
void bar() { baz(); }
private:
void baz();
};
// Foo.h
class Foo {
public:
void bar();
};
// Foo.cpp
#include "Foo.h"
static void baz(Foo &F) {}
void Foo::bar() {
baz(*this);
}
Interesting... I used this, but I haven't thought about this possibility.because for technical reasons this can often be optimized better by the compiler. Even friendship doesn't work now.
Well, I agree, but when the implementation under the hood make some complex tasks, you can for example have a test that will create a segfault, showing an issue, but lacking tests with lower granularity on the actual, current implementation will make finding the error harder...For this reason, I often don't write tests for these types of functions. I mean, the whole reason for writing code like this anyway is that it's an implementation detail, and implementation details by definition are fragile and subject to change at any time, and so are not good candidates for writing a unit test.
Indeed... I was just checking there weren't a well-known solution for this...Still, there's no One Rule. I admit I've used friendship before for testing as well, it's just something you have to figure out on a case by case basis and use your judgement to decide whether a test is really warranted.
Interesting... I used this, but I haven't thought about this possibility.
Well, I agree, but when the implementation under the hood make some complex tasks, you can for example have a test that will create a segfault, showing an issue, but lacking tests with lower granularity on the actual, current implementation will make finding the error harder...
Somehow, I would like to have public unit tests, and (possibly a bit hidden) unit tests that check some implementation details. Of course, those tests are not future proof like the others, but I think they have their value for development purposes.
For example, in a class that handle a tree, I may have a list that holds nodes and list their parents. I may want to check whether all nodes have a living parent, but at the same time, I may avoid having a function that give access to the node list, since I may want to represent the tree differently later.
It's just that I don't know where to put those tests (I've even used a #include that add code in the file that define the class, a #include that will be remove when "shipping" the library"... I don't like it, but I didn't know what to do, and at least you don't pollute the code)
Indeed... I was just checking there weren't a well-known solution for this...
They're going to say, "use a language of your choice" or "use pseudo code"I figured this would be the place to ask.
I'm going in for my first interview for a job in data processing and management. They said there would be a brief programming task and I'm not sure what to expect or how to prepare. The research team works almost exclusively in SAS, although the recruiter is aware that I don't know the language. Would it be safe to assume that the task would be in SAS?
So I shouldn't waste time learning SAS in a week?They're going to say, "use a language of your choice" or "use pseudo code"
No idea - I don't even prepare for job interviews because who knows what they'll ask. But if this is your first programming interview ever maybe it's not a bad idea! Know the difference between array, array list, linked list, hashtable, and binary search tree. And the answer to any sorting question is probably "N log(N)."So I shouldn't waste time learning SAS in a week?Any tips on what I should do to prepare?
Just noticed you got your name changed back cpp_is_king. Happy for you, that shit was terrible.
Guys, any tips about singleton template on multiples shared libraries(linux)?
Googled a bit but couldn't find solutions onLinux. The problem is that I'm getting one singleton instance for each shared library...
EDIT: I'm talking about C++...lol
I am trying to figure out where I should go next with my learning. I have been using more coding lately and learning that I absolutely love it. I even think I might like to do it for a job eventually. I also am leaning toward trying to program my own games. I have a very Physics and Applied Math based knowledge of programming. I know how to use C++, ROOT and R for Monte carlo, statistics and a bit of machine learning. I have also done some assembly coding with microcontrollers. My actual comp sci knowledge is limited to one first year course and what I have picked up doing physics programming.
Hey all.. I'm having some problems with Java 8, Time, and Thread Concurrency (maybe?). Can anyone here help, please?
Thanks !!