## Search found 29 matches

Tue Oct 14, 2008 10:59 am UTC
Forum: Coding
Topic: HBITMAP structure to array of bytes (C)
Replies: 2
Views: 1641

### Re: HBITMAP structure to array of bytes (C)

Wed Sep 10, 2008 3:19 pm UTC
Forum: Coding
Topic: C++ competency
Replies: 16
Views: 2192

### Re: C++ competency

I would make a distinction between programming logic, and programming language. once you 'get' programming logic the language simply becomes a means of expression. to become proficient with a language you should understand not just how to use it, but how it works -- fundamentally, the logic behind e...
Wed Sep 03, 2008 10:53 am UTC
Forum: Coding
Topic: One MIDI. Many PCs.
Replies: 16
Views: 2581

### Re: One MIDI. Many PCs.

lawlz. I did this as well on the computers in our mediatheek, except for mine every couple computers played a part in the opening ~5/6 lines of Beethoven's 9th symphony (2nd movement, I think it was; that really dramatic one ). it had the potential to be really cool, what with all the screens flashi...
Mon May 05, 2008 3:30 pm UTC
Forum: Logic Puzzles
Topic: The Sum of all Digits Between One and One Million
Replies: 28
Views: 9722

### Re: The Sum of all Digits Between One and One Million

I probably did this wrong, but I got a different answer from 4=5... # palindrones 1-1000000 = # 6 digit palindrones (w/ 0s) + # 5 digit palindrones (w/ 0s) (then -2 technically, b/c all 0s don't 'count', but for digit distributions they do) so sum of digits = 45*1...
Sun Mar 09, 2008 8:07 pm UTC
Forum: Coding
Topic: Sudoku
Replies: 23
Views: 4175

### Re: Sudoku

here's one in C that takes on avg ~0.00011s per sudoku ( 47621 puzzles in ~5.078s) on my laptop. it uses basic logic and a few educated guesses. it could be made a lot more 'intelligent', so to speak, but I figured since it only needs to guess one or two times (if that) checking for however many spe...
Fri Jan 11, 2008 11:12 pm UTC
Forum: Logic Puzzles
Topic: Cipher, Cypher, its the same thing.
Replies: 10
Views: 4733

### Re: Cipher, Cypher, its the same thing.

could be a playfair cipher...
Mon Jan 07, 2008 9:35 pm UTC
Forum: Logic Puzzles
Topic: Google Maps puzzle: around the world
Replies: 4
Views: 2235

### Re: Google Maps puzzle: around the world

no not really, otherwise I probably would've gotten stuck
Mon Jan 07, 2008 9:32 pm UTC
Forum: Logic Puzzles
Topic: Colored Divisions
Replies: 19
Views: 2750

### Re: Colored Divisions

lol I stand correct, there is a better solution
Mon Jan 07, 2008 7:01 pm UTC
Forum: Logic Puzzles
Topic: Colored Divisions
Replies: 19
Views: 2750

### Re: Colored Divisions

Spoiler:
heh I had done the same way as you skeptical, so that's as 'nice' as I was thinking of I'm not sure that there is a more elegant/closed solution -- as it seems to be both recursive and related to factors of numbers -- but I'd be happily proven wrong
Mon Jan 07, 2008 6:53 pm UTC
Forum: Logic Puzzles
Topic: Google Maps puzzle: around the world
Replies: 4
Views: 2235

### Re: Google Maps puzzle: around the world

Spoiler:
all those cities have the same number of characters in their name as their country name (at least in english) except one, so I'm going to say rivas, nicaragua
Mon Jan 07, 2008 6:24 pm UTC
Forum: Logic Puzzles
Topic: Colored Divisions
Replies: 19
Views: 2750

### Re: Colored Divisions

it's not an arrangement of colors; each sector has 5 possible colors. maybe I should make that more explicit...
Mon Jan 07, 2008 5:58 pm UTC
Forum: Logic Puzzles
Topic: Colored Divisions
Replies: 19
Views: 2750

### Colored Divisions

here's sort of an interesting one, might be too easy (apologies if something like this has already been done): you have a freely-rotatable circle divided into 6 equal sectors, and you color each sector one of 5 colors (ie. the same 5 possible colors for each division). how many unique circles can yo...
Thu Dec 06, 2007 4:02 pm UTC
Forum: Coding
Topic: C++ control of system SOUND volume.
Replies: 13
Views: 10346

### Re: C++ control of system volume.

waveOutGetVolume
waveOutSetVolume
...mayhaps?

@yakk: "The low-order word contains the left-channel volume setting, and the high-order word contains the right-channel setting. A value of 0xFFFF represents full volume, and a value of 0x0000 is silence."
Tue Nov 20, 2007 8:25 pm UTC
Forum: Science
Topic: Plant respiration at night
Replies: 17
Views: 15196

### Re: Plant respiration at night

I don't see why they couldn't survive under continual light conditions, at least as far as photosynthesis/respiration is concerned. After a little while cyclic phosphorilation would be mainly occuring in the light dependant phase of photosynthesis (becuase of the rate differences), but it's not like...
Sun Nov 11, 2007 8:10 pm UTC
Forum: Mathematics
Topic: Infinite Geometric Series
Replies: 17
Views: 1879

### Re: Infinite Geometric Series

I think a clearer derivation is looking at the limit as n -> inifinity in the equation for the sum of a geometric series: lim n -> infinty (a - ar^n)/(1 - r) where it's obvious that ar^n will explode if |r| > 1, whereas if |r| < 0 the term will converge to 0, yielding a/(1 - r). ...just seems a tad ...
Sun Nov 11, 2007 6:50 pm UTC
Forum: Mathematics
Topic: Techniques and Resources on Solving Functional Equations
Replies: 5
Views: 1147

### Re: Techniques and Resources on Solving Functional Equations

well what I would do for things like f(f(n)) = 16n + x (to use your example) would be to first identify the coefficient of n. In this case it'd be 16^(1/2) = +/- 4 (as you're nesting the function 2 deep). Sorting out the 'x' component would be relatively simple from there, as you know what you're mu...
Mon Oct 29, 2007 8:30 pm UTC
Forum: Mathematics
Topic: A regular pentagon
Replies: 4
Views: 2028

### Re: A regular pentagon

wouldn't it just be ( r * cos( (p_i - 1) * 360 / n ) , r * sin( (p_i - 1) * 360 / n ) ), where p_i is the current point, n the number of sides and r the radius?

edit: just realized you'd want to turn it 90 degrees. in that case you'd just add whatever rotation offset to each angle.
Mon Oct 29, 2007 6:38 pm UTC
Forum: Mathematics
Topic: IB extended essay
Replies: 7
Views: 3345

### Re: IB extended essay

haha, wow you're stuck with that as well? Mine's hanging over my head like nobody's business; due this thursday :-/ My topic was (excuse the lousy pun): 'Generalizing Napoleon's Theorem (and further Conquest)'. If you end up doing yours in math I'd recommend just going with what interests you (say, ...
Mon Oct 29, 2007 6:03 pm UTC
Forum: Coding
Replies: 11
Views: 2949

*hits self on head my program had a bug in it... but still, upon fixing that anything above 3 has a max of 1260 (9, 7, 5, 4); max for 3 is 630 (10, 9, 7). so now we have four cases instead of three :-P how could it end up in an infinite loop, though? each letter is mapped by exactly one other (and h...
Sun Oct 28, 2007 9:48 am UTC
Forum: Coding
Replies: 11
Views: 2949

Heh, you have the same algorithm that I came up with, except my implementation was in C: #include <stdio.h> #include <math.h> #include <stdlib.h> #define IS_PRIME(x) (!(prime_arr[(x) / 8] & 1 << ((x) % 8))) #define MAX_BIT_NUM 512 //let's make ...
Sun Oct 28, 2007 9:38 am UTC
Forum: Coding
Topic: C++ and a universal system("cls")?
Replies: 14
Views: 6934

### Re: C++ and a universal system("cls")?

generally speaking you should avoid calling external programs to do such trivial things as clearing the screen. in windows I believe you could something like this: void clearscreen(void) { DWORD bla; CONSOLE_SCREEN_BUFFER_INFO cbi; HANDLE conh; COORD start = {0, 0}; conh = GetStdHandle(STD_OUTPUT_HA...
Sun Oct 28, 2007 9:28 am UTC
Forum: Coding
Topic: Net Send in C#
Replies: 7
Views: 5485

### Re: Net Send in C#

you should use mailslots. write the data to \\recieving_computer_name\MAILSLOT\messngr in the form sender alias\0reciever alias\0message. I can give you an example in C if you want, but there're plenty online.
Sun Oct 07, 2007 9:49 pm UTC
Forum: Science
Topic: Temperature.
Replies: 26
Views: 2752

### Re: Temperature.

Temperature is not a measure of internal energy, it is a measure of the average velocity of the molecules. There's no way to measure the rate at which a particle is spinning using a thermometer. This is wrong. A glass of water traveling at 100 km/h is not hotter than a glass of water standing still...
Sun Aug 26, 2007 1:21 pm UTC
Forum: Science
Topic: Software to draw up simple graphs
Replies: 14
Views: 8321
I did all my economics graphs in Inkscape, it works great for 'qualitative' graphs and diagrams. Here's an exampe of one of the graphs I made with it: http://img210.imageshack.us/img210/3378 ... mandj8.png
Sat Aug 11, 2007 2:05 pm UTC
Forum: Coding
Topic: Ways to practice
Replies: 9
Views: 2422
http://online-judge.uva.es/problemset/ ?
http://projecteuler.net/ ?
at least one of those should give you some inspiration
Sun May 27, 2007 9:58 am UTC
Forum: Mathematics
Topic: Favorite math jokes
Replies: 1452
Views: 480668
what do you call an occupied restroom in an airplane?
- a hypotenuse

har. har.
Mon Apr 02, 2007 3:43 pm UTC
Forum: Coding
Topic: Fizzbuzz!
Replies: 81
Views: 222439
aha, 81 chars:

Code: Select all

`main(i){while(printf(i%5?i%3?"%d\n":"Fizz\n":"FizzBuzz\n"+4*!!(i%3),i),i++<100);}`
Sun Apr 01, 2007 6:01 pm UTC
Forum: Coding
Topic: Fizzbuzz!
Replies: 81
Views: 222439
woot, 95 chars: main(i){while(i<101)printf("Fizz\n\0Buzz\n\0FizzBuzz\n\0%d\n"+(i%15?i%3?i%5?22:6:0:12),i),i++;} btw Yakk your code dosn't really work. you'd have to dereference the address a+!(i%3)+2*!(i%5) (eg. a[!(i%3)+2*!(i%5)] ), because printf...
Sun Apr 01, 2007 4:25 pm UTC
Forum: Coding
Topic: Fizzbuzz!
Replies: 81
Views: 222439
Chances are there's an even briefer way to do this, but this seems to be as small as I can get it in C (101 chars): main(i){while(i<101)!printf("%s%s","\0Fizz"+!(i%3),"\0Buzz"+!(i%5))&&printf("%d",i)...