Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 07-13-08   #31 (permalink)
Photography nut
 
dangerousHobo's Avatar
 
amd nvidia

Join Date: Dec 2005
Location: ~/
Posts: 3,485

Rep: 409 dangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven member
Unique Rep: 215
FAQs Submitted: 7
Trader Rating: 0
Default

If we use some of the ACM challenges I don't think it'll matter that the answers can be found. You would be able to tell if they and you can find the answers to a lot of small programming problems with some searching.
If you have some challenges that could be used, then please post them or provide a link so we can start organizing everything!
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn

Try out the latest Programming Challenge
Quote:
Originally Posted by Melcar
Only one reasonable way to solve this... a dance off.

CPU-Z Validation
@ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15


Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More

System: Anomaly
CPU
Athlon 3700 SD(KACAE)0546 @3.02ghz
Motherboard
DFI UT nF4 Ultra-D
Memory
G.Skill 2x512 UTT(BH-5)
Graphics Card
evga 6800gs
Hard Drive
Maxtor 300GB + WD 250GB
Sound Card
onboard
Power Supply
Ultra 500w V-series
Case
one from Ultra
CPU cooling
Big Typhoon
GPU cooling
80mm fan mounted on
OS
Arch64 & Slackware 12.1
Monitor
Acer AL2216W 22" WS LCD
dangerousHobo is offline Overclocked Account dangerousHobo's Gallery   Reply With Quote
Old 07-14-08   #32 (permalink)
Bifford
 
BFRD's Avatar
 
intel nvidia

Join Date: Dec 2004
Location: Carrollton, TX
Posts: 5,100

FAQs Submitted: 8
Folding Team Rank: 94
Hardware Reviews: 2
Trader Rating: 12
Default

Please send all suggestions via PM to Hobo or myself. If we post them here members will be able to get a head-start and potentially ruin a time based challenge. Hopefully we can get this rolling again.
__________________
Helpful Posts (Hopefully )
Overclocker's Calculator
Photo Editing - B&W w/Color Accents

System: Main Rig
CPU
E6700 Conroe
Motherboard
Abit QuadGT
Memory
2GB G.Skill PC2 8000 (HZ)
Graphics Card
EVGA 8800GTX
Hard Drive
150 GB Raptor X / 300GB Storage
Sound Card
Audigy 2 ZS
Power Supply
PCP&C Silencer 750
Case
Rocketfish
CPU cooling
Stock (for now)
GPU cooling
Stock
OS
Vista Ultimate
Monitor
Dual Samsung 204b
Overclock.net - 2009 Chimp Challenge Champions 2 Million+ Folding at Home points
BFRD is offline I fold for Overclock.net Overclocked Account BFRD's Gallery   Reply With Quote
Old 07-17-08   #33 (permalink)
Programmer
 
Join Date: Jul 2008
Location: USA
Posts: 30

Rep: 1 Sonic7145 Unknown
Unique Rep: 1
Trader Rating: 0
Default

If you guys are interested in more programming challenges for the time being, check out www.hackthissite.org and click on "Programming" missions on the left hand side.
Sonic7145 is offline   Reply With Quote
Old 07-20-08   #34 (permalink)
4.0ghz
 
ouroboros1827's Avatar
 
intel

Join Date: Nov 2004
Location: Northern VA
Posts: 2,400

Rep: 258 ouroboros1827 is a proven memberouroboros1827 is a proven memberouroboros1827 is a proven member
Unique Rep: 190
Hardware Reviews: 2
Trader Rating: 0
Default

Not to beat a dead horse, but I just noticed this thread (haven't been on this site in months). Tried the first one; took a while, mostly because it's haha, my first python program (learning, after years of java). Not perfect but working and...readable

Code:
import sys

input = "1,2,3,5,10,11,12,13,25,26"

if len(sys.argv) > 1:
    input = sys.argv[1]

list = input.split(",")

output = ""
run = 0

for i in range(0, len(list)):
    if i == 0 or output[-1] == ",":
        output += list[i]

    elif int(list[i]) == int(list[i-1]) + 1:
        run = 1
        pass

    else: 
        if run:
            output += "-" + list[i-1]
        output += "," + list[i]
        run = 0

if run:
    output += "-" + list[-1]

print output
__________________
Overclocking in a nutshell: CyberDruid's BOOK | EvilXP's List of OCing Guides | DeathONator's Ultimate Overclocking Guide | The TOS
Quote:

In other words: Removed code is debugged code, and it certainly doesn't use any memory or CPU time; so even better if you don't write it.

System: Macbook
CPU
Core 2 Duo 2Ghz
Motherboard
Apple
Memory
4Gb
Graphics Card
GMA 950
Hard Drive
80Gb
Sound Card
Intel HD Audio (?)
Case
White & Shiny
OS
OS X 10.5
Monitor
13.3" 1280x800
ouroboros1827 is offline Overclocked Account   Reply With Quote
Old 07-20-08   #35 (permalink)
4.0ghz
 
ouroboros1827's Avatar
 
intel

Join Date: Nov 2004
Location: Northern VA
Posts: 2,400

Rep: 258 ouroboros1827 is a proven memberouroboros1827 is a proven memberouroboros1827 is a proven member
Unique Rep: 190
Hardware Reviews: 2
Trader Rating: 0
Default

Ok I did the third one (screw pascal, hehe).

First time I went through all the numbers divisible by that big factor, then checked each for palindromicityness Took FOREVER...

Code:
def isPalindrome(num):
    return str(num) == str(num)[::-1]

factor = 11*13*17*19*23*29
max = 99999999999999999999

quotient = max / factor
num = factor * quotient

while not isPalindrome(num):
    quotient = quotient - 1
    num = factor * (quotient)
    print "testing " + str(num)

print "found it: " + str(num)
Second time I went through all the palindromes and checked for division...MUCH quicker...

Code:
import sys

factor = 11*13*17*19*23*29

for a in range(9,0,-1):
    for b in range(9,0,-1):
        for c in range(9,0,-1):
            for d in range(9,0,-1):
                for e in range(9,0,-1):
                    for f in range(9,0,-1):
                        for g in range(9,0,-1):
                            for h in range(9,0,-1):
                                for i in range(9,0,-1):
                                    for j in range(9,0,-1):
                                        num = 10000000000000000001 * a + 
                                               1000000000000000010 * b + 
                                                100000000000000100 * c + 
                                                 10000000000001000 * d + 
                                                  1000000000010000 * e + 
                                                   100000000100000 * f + 
                                                    10000001000000 * g + 
                                                     1000010000000 * h + 
                                                      100100000000 * i + 
                                                       11000000000 * j;
                                        if num % factor == 0:
                                            print "found it: " + str(num)
                                            sys.exit(0)
Code:
$ time p 2a.py
found it: 99976239844893267999

real    0m7.547s
user    0m7.506s
sys     0m0.033s
__________________
Overclocking in a nutshell: CyberDruid's BOOK | EvilXP's List of OCing Guides | DeathONator's Ultimate Overclocking Guide | The TOS
Quote:

In other words: Removed code is debugged code, and it certainly doesn't use any memory or CPU time; so even better if you don't write it.

System: Macbook
CPU
Core 2 Duo 2Ghz
Motherboard
Apple
Memory
4Gb
Graphics Card
GMA 950
Hard Drive
80Gb
Sound Card
Intel HD Audio (?)
Case
White & Shiny
OS
OS X 10.5
Monitor
13.3" 1280x800
ouroboros1827 is offline Overclocked Account   Reply With Quote
Old 07-20-08   #36 (permalink)
Photography nut
 
dangerousHobo's Avatar
 
amd nvidia

Join Date: Dec 2005
Location: ~/
Posts: 3,485

Rep: 409 dangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven member
Unique Rep: 215
FAQs Submitted: 7
Trader Rating: 0
Default

Quote:
Originally Posted by ouroboros1827 View Post
Not to beat a dead horse, but I just noticed this thread (haven't been on this site in months). Tried the first one; took a while, mostly because it's haha, my first python program (learning, after years of java). Not perfect but working and...readable

Code:
import sys

input = "1,2,3,5,10,11,12,13,25,26"

if len(sys.argv) > 1:
    input = sys.argv[1]

list = input.split(",")

output = ""
run = 0

for i in range(0, len(list)):
    if i == 0 or output[-1] == ",":
        output += list[i]

    elif int(list[i]) == int(list[i-1]) + 1:
        run = 1
        pass

    else: 
        if run:
            output += "-" + list[i-1]
        output += "," + list[i]
        run = 0

if run:
    output += "-" + list[-1]

print output
For fun I did the first one too. Used ruby
Code:
#!/usr/bin/env ruby

org = ARGV.to_s.split(/,s*/).map {|n| n.to_i}.sort.uniq
con = org.first.to_s
one = true
for n in 1...org.size.to_i
    if org[n].to_i > org[n-1]+1
        con.concat "#{org[n-1]},#{org[n]}" if not one
        con.concat ",#{org[n]}" if one
        one = true 
    elsif one
        con.concat "-" and one = false
    end    
end
p con
Code:
anomaly  [~]  
$ time ruby convert.rb 1,2,8,4,12,34,15,17,16
"1-2,4,8,12,15-17,34"

real    0m0.004s
user    0m0.000s
sys     0m0.004s
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn

Try out the latest Programming Challenge
Quote:
Originally Posted by Melcar
Only one reasonable way to solve this... a dance off.

CPU-Z Validation
@ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15


Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More

System: Anomaly
CPU
Athlon 3700 SD(KACAE)0546 @3.02ghz
Motherboard
DFI UT nF4 Ultra-D
Memory
G.Skill 2x512 UTT(BH-5)
Graphics Card
evga 6800gs
Hard Drive
Maxtor 300GB + WD 250GB
Sound Card
onboard
Power Supply
Ultra 500w V-series
Case
one from Ultra
CPU cooling
Big Typhoon
GPU cooling
80mm fan mounted on
OS
Arch64 & Slackware 12.1
Monitor
Acer AL2216W 22" WS LCD
dangerousHobo is offline Overclocked Account dangerousHobo's Gallery   Reply With Quote
Old 07-21-08   #37 (permalink)
Photography nut
 
dangerousHobo's Avatar
 
amd nvidia

Join Date: Dec 2005
Location: ~/
Posts: 3,485

Rep: 409 dangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven member
Unique Rep: 215
FAQs Submitted: 7
Trader Rating: 0
Default

Just to give everyone a bit of a heads up, I plan to post a challenge Thursday (July 24) around 8pm EST. The dead line then I'm still not sure on. More details will come when the challenge is posted. I just wanted to give a heads up so no one (hopefully) sees the challenge at the last minute.
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn

Try out the latest Programming Challenge
Quote:
Originally Posted by Melcar
Only one reasonable way to solve this... a dance off.

CPU-Z Validation
@ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15


Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More

System: Anomaly
CPU
Athlon 3700 SD(KACAE)0546 @3.02ghz
Motherboard
DFI UT nF4 Ultra-D
Memory
G.Skill 2x512 UTT(BH-5)
Graphics Card
evga 6800gs
Hard Drive
Maxtor 300GB + WD 250GB
Sound Card
onboard
Power Supply
Ultra 500w V-series
Case
one from Ultra
CPU cooling
Big Typhoon
GPU cooling
80mm fan mounted on
OS
Arch64 & Slackware 12.1
Monitor
Acer AL2216W 22" WS LCD
dangerousHobo is offline Overclocked Account dangerousHobo's Gallery   Reply With Quote
Old 07-22-08   #38 (permalink)
4.0ghz
 
hometoast's Avatar
 
intel nvidia

Join Date: Sep 2007
Location: Pennsylvania
Posts: 2,147
Blog Entries: 3

Rep: 164 hometoast is acknowledged by manyhometoast is acknowledged by many
Unique Rep: 132
Hardware Reviews: 3
Trader Rating: 16
Default

Quote:
Originally Posted by dangerousHobo View Post
Just to give everyone a bit of a heads up, I plan to post a challenge Thursday (July 24) around 8pm EST. The dead line then I'm still not sure on. More details will come when the challenge is posted. I just wanted to give a heads up so no one (hopefully) sees the challenge at the last minute.

will you post to this thread so we can get a subscription email?

System: foot warmer
CPU
Q9550
Motherboard
EP45-UD3P
Memory
OCZ 2x2Gb ddr2-1066
Graphics Card
GTX260 700/1509/1000
Hard Drive
WD 320 AAKS
Power Supply
PP&C 610W Silencer
Case
CM Cosmos 1000
CPU cooling
Xig Dark Knight
OS
#7
Monitor
Samsung 204BW
hometoast is offline Overclocked Account   Reply With Quote
Old 07-22-08   #39 (permalink)
Photography nut
 
dangerousHobo's Avatar
 
amd nvidia

Join Date: Dec 2005
Location: ~/
Posts: 3,485

Rep: 409 dangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven member
Unique Rep: 215
FAQs Submitted: 7
Trader Rating: 0
Default

Quote:
Originally Posted by hometoast View Post
will you post to this thread so we can get a subscription email?
Yes, I will post the challenge here in this thread.
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn

Try out the latest Programming Challenge
Quote:
Originally Posted by Melcar
Only one reasonable way to solve this... a dance off.

CPU-Z Validation
@ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15


Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More

System: Anomaly
CPU
Athlon 3700 SD(KACAE)0546 @3.02ghz
Motherboard
DFI UT nF4 Ultra-D
Memory
G.Skill 2x512 UTT(BH-5)
Graphics Card
evga 6800gs
Hard Drive
Maxtor 300GB + WD 250GB
Sound Card
onboard
Power Supply
Ultra 500w V-series
Case
one from Ultra
CPU cooling
Big Typhoon
GPU cooling
80mm fan mounted on
OS
Arch64 & Slackware 12.1
Monitor
Acer AL2216W 22" WS LCD
dangerousHobo is offline Overclocked Account dangerousHobo's Gallery   Reply With Quote
Old 07-24-08   #40 (permalink)
Photography nut
 
dangerousHobo's Avatar
 
amd nvidia

Join Date: Dec 2005
Location: ~/
Posts: 3,485

Rep: 409 dangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven memberdangerousHobo is a proven member
Unique Rep: 215
FAQs Submitted: 7
Trader Rating: 0
Default

Hey everyone, here is the new challenge. This one did not sound to difficult, but I don't know what everyones skill level here is.

The challenge:
Create a program to convert a given dollar amount to written amounts. For example, the input $72.61 would output "seventy two dollars and sixty one cents". The dollar amount will be under $1000.00, so your program should be able to handle any dollar amount smaller then that.

Creativity, efficiency and elegance are weighed to decide the winner.

Any language is welcome.

It does not matter how you let someone enter an amount to your program, just as long as it has a dollar sign($) and a decimal point.



Deadline:
Wednesday July 30th at 11:59pm EST.

Wait to post your solutions till it's closer to the deadline. You don't want to give away how you solved it!
(We'll wait for a 24 hour challenge to see who can solve something first)

I plan to post another challenge then next Thursday at the same time (8:00pm ish EST).


Post any questions you have.

If this is too easy or too hard then please let me know!
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn

Try out the latest Programming Challenge
Quote:
Originally Posted by Melcar
Only one reasonable way to solve this... a dance off.

CPU-Z Validation
@ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15


Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More

System: Anomaly
CPU
Athlon 3700 SD(KACAE)0546 @3.02ghz
Motherboard
DFI UT nF4 Ultra-D
Memory
G.Skill 2x512 UTT(BH-5)
Graphics Card
evga 6800gs
Hard Drive
Maxtor 300GB + WD 250GB
Sound Card
onboard
Power Supply
Ultra 500w V-series
Case
one from Ultra
CPU cooling
Big Typhoon
GPU cooling
80mm fan mounted on
OS
Arch64 & Slackware 12.1
Monitor
Acer AL2216W 22" WS LCD

Last edited by dangerousHobo : 07-24-08 at 09:50 PM
dangerousHobo is offline Overclocked Account dangerousHobo's Gallery   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -5. The time now is 10:00 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.16212 seconds with 9 queries