This is my first time writing a Swing+Groovy application that successfully inserts data to SQL tables. It may look like example code, but it is more test code, as I will eventually expand this to a much bigger application, and would like to see if I can improve it before expanding it.
What it d...
Not enough downvotes.
The only questions I see with a negative score are questions that are either on hold, closed, deleted, or accumulating close votes on their way to being put on hold.
Frequently, I'll find that my downvote is the only downvote on a post.
Often times, I feel that a post's s...
@Vogel612 Now that I think about it, validating data before shoving it into a SQL table might be a good idea. If you have any ideas on that, it would certainly make for some useful answer :)
But it's impossible to tell the difference between a post that's great, a post that's good, a post that's completely mediocre, and a post that's bad but not technically wrong...
A different approach than this question, this time without using arithmetic progression. The README specs both sumOfMultiples and sumOfMultiplesDefault and the code passes the test suit.
module SumOfMultiples
(sumOfMultiples
,sumOfMultiplesDefault
) where
sumOfMultiples :: [Integer] ->
@Hosch250 Thanks for the vote. But I am why to blunt and not diplomatic enough dont take criticism well hate other people too much like trolling and just a bad person, not good traits for a moderator.
programming - that is what the site is about. Are we going to tag every question with it?
practice - we all need practice. On a serious note, I don't see how this tag adds any value to the site either. Perhaps if someone created a tag wiki I would understand it better, but I have a hard time ...
@LokiAstari That looks like something a code golfer would use.
@SirPython Creates an empty lambda then calls it. The variable list is bound by reference and thus is used. So you no longer get the "unused variable" warning.
Found an article http://sourcefrog.net/weblog/software/languages/C/unused.html that explains UNUSED. Interesting that the author also mangles the unused variable name so you can't inadvertently use it in the future.
Excerpt:
#ifdef UNUSED
#elif defined(__GNUC__)
# define UNUSED(x) UNUSED_ ## x...
Before I used reflection to invoke a state based on the string. It looked like this.
public void setState (String state) {
try {
this.state = (State) Class.forName("state"+state).getConstructor().newInstance();
} catch (Exception e) {
System.out.println ("Tried to set sta...
Given a list of tuples of the form, (a, b, c), what are some ways of calculating the average of all the c's with pySpark?
ds = sc.parallelize([(1,2,3), (4,5,6), (7,8,9)]
total = (ds
.map(lambda (a,b,c): d)
.reduce(lambda x, y: x + y)
num = ds.count()
average = total / num
# in...