Programming, computers, etc. [Serious]

All things asdf (and anything else)
User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
Posts: 26130
Joined: Fri Sep 14, 2007 12:14 pm
Location: Seven
Contact:

Re: Programming, computers, etc. [Serious]

Post by Shai'tan » Fri May 17, 2013 12:12 am

Nice :o

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?
Quote of the Ages:
atomtengeralattjaro wrote:The Forums of ASDF turn, and Pages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Page that gave it birth comes again. On one Page, called the Six Hundred and Ninety Fifth Page by some, a Page yet to come, a Page long past, a post was made by atomtengeralattjaro. The post was not the beginning. There are neither beginnings nor endings to the turning of the Forums of ASDF. But it was a beginning.

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 35622
Joined: Wed May 23, 2007 3:43 pm
Location: green
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Fri May 17, 2013 1:18 pm

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.
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
Posts: 26130
Joined: Fri Sep 14, 2007 12:14 pm
Location: Seven
Contact:

Re: Programming, computers, etc. [Serious]

Post by Shai'tan » Fri May 17, 2013 6:27 pm

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.
Quote of the Ages:
atomtengeralattjaro wrote:The Forums of ASDF turn, and Pages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Page that gave it birth comes again. On one Page, called the Six Hundred and Ninety Fifth Page by some, a Page yet to come, a Page long past, a post was made by atomtengeralattjaro. The post was not the beginning. There are neither beginnings nor endings to the turning of the Forums of ASDF. But it was a beginning.

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 35622
Joined: Wed May 23, 2007 3:43 pm
Location: green
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Sun Jun 23, 2013 3:36 pm

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.
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
Posts: 26130
Joined: Fri Sep 14, 2007 12:14 pm
Location: Seven
Contact:

Re: Programming, computers, etc. [Serious]

Post by Shai'tan » Sun Jun 23, 2013 10:42 pm

Not to worry, I handed in the assignment ages ago and passed.
Quote of the Ages:
atomtengeralattjaro wrote:The Forums of ASDF turn, and Pages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Page that gave it birth comes again. On one Page, called the Six Hundred and Ninety Fifth Page by some, a Page yet to come, a Page long past, a post was made by atomtengeralattjaro. The post was not the beginning. There are neither beginnings nor endings to the turning of the Forums of ASDF. But it was a beginning.

p67738
ASDF-ville inhabitant
ASDF-ville inhabitant
Posts: 5
Joined: Mon Jun 24, 2013 10:46 pm

Re: Programming, computers, etc. [Serious]

Post by p67738 » Tue Jun 25, 2013 12:18 am

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.

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 35622
Joined: Wed May 23, 2007 3:43 pm
Location: green
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Wed Jun 26, 2013 6:56 pm

That's.. more than eleven days.
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

p67738
ASDF-ville inhabitant
ASDF-ville inhabitant
Posts: 5
Joined: Mon Jun 24, 2013 10:46 pm

Re: Programming, computers, etc. [Serious]

Post by p67738 » Mon Jul 01, 2013 5:30 pm

atomtengeralattjaro wrote:That's.. more than eleven days.
Oh well, I didn't think about it.
Just set it...

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Wed Jul 10, 2013 6:27 am

It hasn't been 11 days yet.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Tue Jul 30, 2013 5:54 pm

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.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
assdef
JKL;'s Nightmare
JKL;'s Nightmare
Posts: 7050
Joined: Sat Jan 02, 2010 9:30 pm

Re: Programming, computers, etc. [Serious]

Post by assdef » Sun Aug 18, 2013 8:26 pm

What's an ebook? And is it pronounced "eb-book" or "eee-book"?

I prefer "eb-book."
Image

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Sun Aug 18, 2013 10:20 pm

However you want to pronounce it.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
ThingerDudes
ASDF Warlord
ASDF Warlord
Posts: 20868
Joined: Sun Apr 12, 2009 4:12 am
Location: close enough.

Re: Programming, computers, etc. [Serious]

Post by ThingerDudes » Sun Aug 18, 2013 11:12 pm

It's pronounced ASDF
Image

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 35622
Joined: Wed May 23, 2007 3:43 pm
Location: green
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Mon Aug 19, 2013 8:59 am

ThingerDudes wrote:It's pronounced ASDF
What isn't?
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Mon Aug 19, 2013 5:32 pm

Good thing it's still spelled differently. ASDF ASDF ASDF ASDF, ASDF ASDF ASDF ASDF.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 35622
Joined: Wed May 23, 2007 3:43 pm
Location: green
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Mon Aug 19, 2013 8:41 pm

Asdf. ASDF ASDF AsdF?
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Mon Aug 19, 2013 9:03 pm

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...)
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
ThingerDudes
ASDF Warlord
ASDF Warlord
Posts: 20868
Joined: Sun Apr 12, 2009 4:12 am
Location: close enough.

Re: Programming, computers, etc. [Serious]

Post by ThingerDudes » Tue Aug 20, 2013 4:32 am

2^4?
Image

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Tue Aug 20, 2013 5:40 pm

Exactly.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 35622
Joined: Wed May 23, 2007 3:43 pm
Location: green
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Fri Aug 30, 2013 10:24 pm

Today I learned that

Code: Select all

int? number;
is shorthand for

Code: Select all

Nullable<int> number;
(C#)
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

Post Reply