## Closed Thread Subscribe

1. farmings rly hard
Funny x 45 Winner x 2 (list)

2. Cleaned up the code a bit and completely redid variables to conform to ECMA-55.
This shit is all turning out rather more complicated than I was expecting it to be. I dread the numeric operators.
that's because you're parsing with regex....
Funny x 7 Agree x 2 Disagree x 1 (list)

3. Finally got it to compile Naelstrom/Naelstrof...
Programming King x 4 Winner x 1 (list)

4. that's because you're parsing with regex....
The patterns aren't what's making it complicated, complying to the ECMA-55 standard is the main bugger.
That said, the demands of ECMA-55 are going to make pattern parsing the numeric operators significantly more annoying than they otherwise could be. I'm going to have to use one big patten to grab all of them and then use smaller ordered patterns inside the callback of that one. Fun fun.

5. The patterns aren't what's making it complicated, complying to the ECMA-55 standard is the main bugger.
That said, the demands of ECMA-55 are going to make pattern parsing the numeric operators significantly more annoying than they otherwise could be. I'm going to have to use one big patten to grab all of them and then use smaller ordered patterns inside the callback of that one. Fun fun.
Well, parsing a language using regex for anything more than identifying tokens is a little awkward, since there's a lot of things you don't have control over.
Agree x 1 (list)

6. The patterns aren't what's making it complicated, complying to the ECMA-55 standard is the main bugger.
That said, the demands of ECMA-55 are going to make pattern parsing the numeric operators significantly more annoying than they otherwise could be. I'm going to have to use one big patten to grab all of them and then use smaller ordered patterns inside the callback of that one. Fun fun.
Use LPeg.
Agree x 1 (list)

7. Well, parsing a language using regex for anything more than identifying tokens is a little awkward, since there's a lot of things you don't have control over.
Ah but that's the nice thing about ECMA-55 BASIC. The only unregular thing about it is arithmetic expressions. Everything else has to happen exactly one way with no trailing lines or anything silly like that.

Thanks, but I think I'll stick with what I've got for now. It's less of a challenge if I start using libraries that make everything easier. (Plus that looks like a bugger to learn how to use)
Agree x 1 (list)

8. Created a python number cruncher performace tester. Runs a for loop for counting up to 100 million, adding the numbers together, adds it to total

But that doesn't work very well, so it just counts to 100million. My computer can do it in 80 seconds.

Anybody want to try and beat me?
Informative x 1 (list)

9. Created a python number cruncher performace tester. Runs a for loop for counting up to 100 million, adding the numbers together, adds it to total

But that doesn't work very well, so it just counts to 100million. My computer can do it in 80 seconds.

Anybody want to try and beat me?
Code:
total = 0
1.upto(100_000_000) { |n| total += n }
puts total
Code:
% time ruby sum.rb
5000000050000000

real	0m11.905s
user	0m11.869s
sys	0m0.015s
Winner x 3 Artistic x 1 (list)

10. Code:
total = 0
1.upto(100_000_000) { |n| total += n }
puts total
Code:
% time ruby sum.rb
5000000050000000

real	0m11.905s
user	0m11.869s
sys	0m0.015s
Is that with file I/O? As I did it where it would write every number to a file.

11. Code:
total = 0
1.upto(100_000_000) { |n| total += n }
puts total
Code:
% time ruby sum.rb
5000000050000000

real	0m11.905s
user	0m11.869s
sys	0m0.015s
Code:
local t0 = os.clock()

local total = 0
for i=1, 100000000 do
total = total + i
end

print(total, os.clock() - t0 .. "s")
Code:
5.00000005e+015	0.177s
Winner x 1 Programming King x 1 (list)

12. Code:
global _main
extern _printf
extern _exit

fmt: db "%ld", 10, 0

_main:
and rsp, ~15
mov rcx, 100000000
xor rsi, rsi
.sum:
add rsi, rcx
loop .sum
mov rdi, fmt
call _printf
xor rdi, rdi
call _exit
Code:
% time ./sum
5000000050000000

real	0m0.254s
user	0m0.251s
sys	0m0.002s
Agree x 2 Funny x 1 (list)

13. Is that with file I/O? As I did it where it would write every number to a file.
You didn't mention file I/O.
Agree x 2 (list)

14. Over the last 3 days I have been working on a program, that can download the latest in-game auction house data from a specific World of Warcraft realm. My goal is to create an easy way to spot good market opportunities and to have a better historical overview of the market. I get the data from Blizzard's community API which allows you download a lot of in-game data in JSON format.
So far I am able download the latest data, parse the JSON and write the data to a SQL database. Now, the thing is that I am working with quite huge amounts of data here (7-8 MB) and I feel I am storing too much in memory at once. When I am parsing the JSON I normally have about 70000 auctions stored temporarily in memory as C# objects before I pass them on to the database. I am wondering if there is a better way to do this because I know it is going to be much worse, when I start updating the data in the database. Much of this can probably be done in the SQL server but I am not that much into it yet.
The exiting part of this project is that I am a very inexperienced programmer so I am the first to admit, that this project might be bigger than I am able to handle.

15. You didn't mention file I/O.
Regardless, it'd probably make a lot of sense to first generate the numbers in-RAM and then dump the whole thing onto the disc at once.
Agree x 2 (list)

16. why would git give: error:
RPC failed; result=55, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

17. ahahahaha

Code:
% nasm -f macho64 -o tsum.o threaded_sum.asm && gcc -o tsum tsum.o
% time ./tsum
5000000050000000

real	0m0.030s
user	0m0.084s
sys	0m0.002s
Code:
global _main
extern _printf
extern _exit
extern _pthread_create
extern _pthread_exit
extern _pthread_join

%define WORKERS 4

worker:
and rsp, ~15
mov rax, rdi
.loop:
add rdi, WORKERS
cmp rdi, 100000000
jg .end
add rax, rdi
jmp .loop
.end
mov rdi, rax
call _pthread_exit

fmt: db "%ld", 10, 0

_main:
and rsp, ~15

xor rbx, rbx
.spawn_workers:
mov rdi, rbx
sal rdi, 4
mov rsi, threads
add rdi, rsi
xor rsi, rsi
mov rdx, worker
mov rcx, rbx
call _pthread_create
inc rbx
cmp rbx, WORKERS
jl .spawn_workers

xor rbx, rbx
.join_workers:
mov rdi, rbx
sal rdi, 4
mov rsi, threads
add rdi, rsi
mov rsi, rdi
add rsi, 8
mov rbp, rsi
mov rdi, [rdi]
call _pthread_join
mov rax, [rbp]
mov rsi, sum
add [rsi], rax
inc rbx
cmp rbx, WORKERS
jl .join_workers

mov rdi, fmt
mov rsi, sum
mov rsi, [rsi]
call _printf

xor rdi, rdi
call _exit

section .data
sum: dq 0
tmp: dq 0
threads:
times (WORKERS * 2) dq 0
declaring myself the winner of this pissing contest
Funny x 20 Winner x 6 Programming King x 3 (list)

18. What the fuck
Agree x 9 Funny x 1 (list)

19. ahahahaha

Code:
ruby threaded asm
declaring myself the winner of this pissing contest
:colbert:

Edited:

I made a bot for minecraft that automatically places/destroys easy one hit break type blocks when I hold down a key.
It also interacts with doors, buttons, levers etc but that's not automatic right now and still a wip.

It works fine on non regular terrain too, I was just in a flat map.
wow, brings 360 noscope wheat picking to actual fruition, gg wp
Funny x 2 (list)

20. Finally got it to compile Naelstrom/Naelstrof...
Wow nice! It looked like a strugglestorm to compile it properly on Windows. Glad you got it working!

21. Working on the bomberman thing still.
multiplayer code is breaking my brain.
Animation bugs are many.
Effort... dwindling.

GAH.
Friendly x 5 Dumb x 1 (list)

22. What he said.
Dumb x 14 Informative x 1 (list)

23. What he said.
Please use ratings () instead of making posts like that.
x 28 x 1 x 1 x 1 x 1 (list)

24. Code:
def add_up_to(n):
return 0.5 * n * (n + 1)
print(add_up_to(100000000))
Runs in constant time. May not be in the spirit of the problem, but I think that solves it best!
Agree x 4 Informative x 1 Disagree x 1 (list)

25. So I decided that I'd make use of the fact that Paizo published the spell list for Pathfinder (DnD 3.75) as a .csv file and build an offline spellbook so I don't have to use their slow as shit website. So first, I need to parse the .csv. Originally I assumed that the C# standard library would have it, because that's the sort of thing I would put in a programming language if I was building one.
Nope, no .csv parser. I find out, however, that the VB.NET standard library does have one, and my C# programs can access it. So yeah...
Then I need to turn each spell's entry in the .csv into a Spell struct, leading to the ugliest function call I've ever written:
Code:
new Spell(array[0], array[1], array[2], array[3], array[4], array[5], array[6], StrToBool(array[7]),
array[8], array[9],  array[10], array[11], array[12], StrToBool(array[13]),
StrToBool(array[14]), array[15], array[16], array[17], array[18], array[20],
StrToBool(array[21]), StrToBool(array[22]), StrToBool(array[23]), StrToBool(array[24]),
StrToBool(array[25]),
new LevelList(StrToShort(array[38]), StrToShort(array[39]), StrToShort(array[26]),
StrToShort(array[37]), StrToShort(array[27]), StrToShort(array[36]),
StrToShort(array[35]), StrToShort(array[34]), StrToShort(array[33]),
StrToShort(array[31]), StrToShort(array[30]), StrToShort(array[29]),
StrToShort(array[28]), StrToShort(array[32])), array[40],
StrToShort(array[41]), array[42], array[43], CategoryList.ParseArray(array.Skip(44).Take(25).ToArray()),
array[69], (ushort) StrToShort(array[70]));
I'm fairly happy with the net result, however:

(the other tabs are placeholders)

Comments on the UI?
Winner x 2 Useful x 1 (list)

26. What's the next best thing to getting a nice new pair of socks? A day of painless typing after struggling with RSI for 3 years.
Winner x 14 Friendly x 2 Informative x 1 (list)

27. I feel ever so sorry for you :(

I'm glad I'm not the one genes decided to piss on.

Edited:

Is there any reason why you didn't get pain today?

28. I feel ever so sorry for you :(

I'm glad I'm not the one genes decided to piss on.

Edited:

Is there any reason why you didn't get pain today?
Eh, I'm trying a different chair with different posture compared to my old ones, and in relation to desk height and stuff. I'm not sure if it's placebo yet.
Informative x 1 Winner x 1 (list)

29. Mwahahaha. (Live editing is not implemented yet though)

Already tested basic animation of GUI elements through the entity system and it works. Now to physics/rendering of entities.

The PhysicsManagerSystem will know nothing of what it's updating, all it has to do is manipulate a TransformComponent which eventually gets applied to a GeometryComponent and rendered to the screen.

30. Code:
def add_up_to(n):
return 0.5 * n * (n + 1)
print(add_up_to(100000000))
Runs in constant time. May not be in the spirit of the problem, but I think that solves it best!
Code:
import httplib
import re

def add_up_to(count):

url = "/input/?i=\sum_+(k%3D1)+^{0}+k".format(count)
match = "\"stringified\": \"sum.*?\""
match2 = " = (.*?)\""
oracle_failure = "impossible to know"

client = httplib.HTTPConnection("www.wolframalpha.com")
client.request("GET", url)
response = client.getresponse()

if response.status != 200:
client.close()
return oracle_failure

data = response.read()
client.close()

l1 = re.findall(match, data)

if len(l1) == 0:
return oracle_failure

l2 = re.search(match2, l1[0])
if l2 == None:
return oracle_failure

return l2.group(1)
this, too, runs in constant time. but i don't know how long it takes to run

unfortunately it's apparently impossible to know how much is the sum from 1 to 100000000. however it can add up to "n".

Edited:

Also that might not strictly respect Wolfram|Alpha's terms of use so don't actually use it
Funny x 6 Winner x 1 (list)

31. I worked on the collision-system. Now I can push things sideways against each other.
(Not really smooth, but it works!)

Oh! And I don't hang in the air anymore. I can now just walk off.
Winner x 5 (list)

32. I finally made some videos of stuff I've been working on.

Programming King x 4 Winner x 2 (list)

33. Spent today making classes for various functions such as skybox, textures, shaders etc. Before it was kind of messy to be honest.

I've also fixed my camera so that it is now possible to look directly up and down fluently and also move perfectly fluent. It's also possible to strafe now.

34. Spent today making classes for various functions such as skybox, textures, shaders etc. Before it was kind of messy to be honest.

I've also fixed my camera so that it is now possible to look directly up and down fluently and also move perfectly fluent. It's also possible to strafe now.
What in? (OGL, OTK, DX, SDX...)
Agree x 1 (list)

35. I'm making a dictionary library for C (just for fun) and I got a problem: theres no compile error, he executes normal. If you see in the picture, the first key will return with the value, but the 2nd, 3rd, 4th.... does not return as I want, it returns a "not a number". And also, when I want to destroy the dictionary (struct), he does not show that the dictionary is empty. Maybe the problem is with memory allocation for string, I dunno.

Look the prompt. (I wrote "Abacato", sorry, it's "avocado")

This is my code

Code:
typedef struct dictionary {
char *key;
double value;
struct dictionary *next;
} DICTIONARY;
typedef DICTIONARY* DICT; /* Pointer for struct DICTIONARY */

void dictInit(DICT *elem) /* Initialize the Dictionary */
{
*elem = NULL;
}

void destroyDict(DICT *elem) /* Destroy all elements from dictionary */
{
DICTIONARY *temp = *elem;

if (*elem == NULL);
return; /* No elements */
*elem = (*elem)->next;
free(temp);
destroyDict(&(*elem)->next);
}

void insertElement(DICT *elem, char *keyInput, double valueInput) /* Insert a new element to the dictionary */
{
if (*elem == NULL)
{
*elem = (DICT) malloc(sizeof(DICTIONARY));
if (*elem == NULL)
{
fprintf(stderr, "Error: could not insert allocate a new element to dictionary");
return;
}
(*elem)->key = (char *) malloc(strlen(keyInput)+1);
strcpy((*elem)->key, keyInput);
(*elem)->value = valueInput;
(*elem)->next = NULL;
}
else
insertElement(&(*elem)->next, keyInput, valueInput);
}

void showDict(DICT elem) /* Show the elements of dictionary one by one */
{
if (elem == NULL)
return; /* No elements */
printf("\"%s\": %.4f\n", elem->key, elem->value);
showDict(elem->next); /* Show the next dictionary element */
}

double showKeyVal(DICT elem, char *keyInput) /* Show the value from the specific key */
{
if (elem == NULL)
return; /* No elements */
if (strcmp(elem->key, keyInput) == 0)
return elem->value;
showKeyVal(elem->next, keyInput);
}

int isDictEmpty(DICT elem)
{
return (elem == NULL);
}
Thanks for help. And sorry for post here, but no one saw my question :)
Disagree x 1 (list)

36. A little buggy but you get the idea..

Winner x 13 Funny x 2 Informative x 1 Artistic x 1 (list)

37. utterly flawless puzzle design
Funny x 17 Agree x 4 Dumb x 1 (list)

38. utterly flawless puzzle design
Oh hey synthiac. Yeah I didn't pay much attention to the puzzle design, I was just showing off the (buggy) mechanic.
Funny x 5 Agree x 4 (list)

39. It is so on.

Seriously, though, I'm interested to see where you take the idea. I guess I'm still building the basic engine. The finished product I'm aiming for is quite a long way away.
Hah, well, I kind of abandoned that project about 1 year ago.

40. so I've been working on this game in javascript and html5 in my free time recently, it's based on the old game Missile Command.
it isn't at all done, and I still need to have a start button and a scoreboard and the function of actually dying.

http://qwook.github.com/meteorsmash/

not looking for feedback yet, just showing you guys what I have done.
Programming King x 3 (list)