Page 25 of 43
Re: Programming, computers, etc. [Serious]
Posted: Fri May 17, 2013 12:12 am
by Shai'tan
Nice
If you were to read a file with a list of different words, split the words into m/n parts, where m is the number of words and n is a given argument, then sort those parts with n threads and finally merge them together with threads (same or new ones), how would you do it?
It was a task I was given not long ago, though I delivered I didn't feel like I could come up with a good answer… What would you do?
Re: Programming, computers, etc. [Serious]
Posted: Fri May 17, 2013 1:18 pm
by atomtengeralattjaro
did you have to do this in Java?
i'm not sure I fully understand the requirements..
say, there is a file with 100 words of text,
the user starts the program and gives 10 as an argument
so I have to sort ten batches of ten words, each on its own thread, and then merge them?
I'm not sure how the merging would work. You're supposed to get one perfectly sorted list, right? i think you'd have to wait for all the sorts to finish, and then use a single thread to merge the results. I haven't done anything similar, I doubt I could come up with an efficient solution, but i should try.
Re: Programming, computers, etc. [Serious]
Posted: Fri May 17, 2013 6:27 pm
by Shai'tan
atomtengeralattjaro wrote:did you have to do this in Java?
Yes.
atomtengeralattjaro wrote:
i'm not sure I fully understand the requirements..
say, there is a file with 100 words of text,
the user starts the program and gives 10 as an argument
so I have to sort ten batches of ten words, each on its own thread, and then merge them?
I'm not sure how the merging would work. You're supposed to get one perfectly sorted list, right? i think you'd have to wait for all the sorts to finish, and then use a single thread to merge the results. I haven't done anything similar, I doubt I could come up with an efficient solution, but i should try.
Yes exactly, only that it supposed to merge two parts whenever two threads are finished sorting them.
Re: Programming, computers, etc. [Serious]
Posted: Sun Jun 23, 2013 3:36 pm
by atomtengeralattjaro
uh, i kind of forgot about that. I might try to do it sometime though. I have a big exam on tuesday though.
Thread-relevant:
i just found a big collection of free microsoft ebooks:
http://blogs.msdn.com/b/mssmallbiz/arch ... erver.aspx
also a big collection of free Python ebooks:
http://pythonbooks.revolunet.com/
seems a good thing to bookmark and never check again, unless maybe still check it sometime and read and then become smart.
Re: Programming, computers, etc. [Serious]
Posted: Sun Jun 23, 2013 10:42 pm
by Shai'tan
Not to worry, I handed in the assignment ages ago and passed.
Re: Programming, computers, etc. [Serious]
Posted: Tue Jun 25, 2013 12:18 am
by p67738
Anonymously Famous wrote:Use this topic to talk about anything programming or computer related. Let's try to keep the number of concurrent discussions down to avoid confusion, and let's try to stay on topic.
So... Anyone have any programming-related stuff they want to talk about? I probably have a quick Python script to write later today, converting a tab-separated text file to an XML file...
I wrote a countdown timer that only so far goes up to 1 million seconds at the most.
Re: Programming, computers, etc. [Serious]
Posted: Wed Jun 26, 2013 6:56 pm
by atomtengeralattjaro
That's.. more than eleven days.
Re: Programming, computers, etc. [Serious]
Posted: Mon Jul 01, 2013 5:30 pm
by p67738
atomtengeralattjaro wrote:That's.. more than eleven days.
Oh well, I didn't think about it.
Just set it...
Re: Programming, computers, etc. [Serious]
Posted: Wed Jul 10, 2013 6:27 am
by Anonymously Famous
It hasn't been 11 days yet.
Re: Programming, computers, etc. [Serious]
Posted: Tue Jul 30, 2013 5:54 pm
by Anonymously Famous
My latest endeavor to learn a new language: Perl.
Odd thing about Perl: No arguments to functions, just the appearance of them.
This is a function in Perl:
Code: Select all
sub dostuff
{
my $argument1 = shift;
print "$argument1\n";
}
When you call dostuff("Hello World");, it places the string inside a default local array for the function (@_ is the name of the array). Also, parenthesis are not required, but are used for clarification, kind of like with Ruby.
Re: Programming, computers, etc. [Serious]
Posted: Sun Aug 18, 2013 8:26 pm
by assdef
What's an ebook? And is it pronounced "eb-book" or "eee-book"?
I prefer "eb-book."
Re: Programming, computers, etc. [Serious]
Posted: Sun Aug 18, 2013 10:20 pm
by Anonymously Famous
However you want to pronounce it.
Re: Programming, computers, etc. [Serious]
Posted: Sun Aug 18, 2013 11:12 pm
by ThingerDudes
It's pronounced ASDF
Re: Programming, computers, etc. [Serious]
Posted: Mon Aug 19, 2013 8:59 am
by atomtengeralattjaro
ThingerDudes wrote:It's pronounced ASDF
What isn't?
Re: Programming, computers, etc. [Serious]
Posted: Mon Aug 19, 2013 5:32 pm
by Anonymously Famous
Good thing it's still spelled differently. ASDF ASDF ASDF ASDF, ASDF ASDF ASDF ASDF.
Re: Programming, computers, etc. [Serious]
Posted: Mon Aug 19, 2013 8:41 pm
by atomtengeralattjaro
Asdf. ASDF ASDF AsdF?
Re: Programming, computers, etc. [Serious]
Posted: Mon Aug 19, 2013 9:03 pm
by Anonymously Famous
ASDF.
Quick programming question:
How many variants of "ASDF" can there be with uppercase and lowercase? (Of course, this is the same question as "How many numbers can be represented by a nibble?", but oh well...)
Re: Programming, computers, etc. [Serious]
Posted: Tue Aug 20, 2013 4:32 am
by ThingerDudes
2^4?
Re: Programming, computers, etc. [Serious]
Posted: Tue Aug 20, 2013 5:40 pm
by Anonymously Famous
Exactly.
Re: Programming, computers, etc. [Serious]
Posted: Fri Aug 30, 2013 10:24 pm
by atomtengeralattjaro
Today I learned that
is shorthand for
(C#)