[QUOTE=swift and shift;37266272]that's because you're parsing with regex....[/QUOTE]
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.
[QUOTE=Lexic;37266669]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.[/QUOTE]
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.
[QUOTE=Lexic;37266669]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.[/QUOTE]
Use [url=http://www.inf.puc-rio.br/~roberto/lpeg/]LPeg[/url].
[QUOTE=danharibo;37266802]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.[/QUOTE]
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.
[QUOTE=Deco Da Man;37266815]Use [url=http://www.inf.puc-rio.br/~roberto/lpeg/]LPeg[/url].[/QUOTE]
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)
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?
[QUOTE=TheEyes;37267801]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?[/QUOTE]
[code]
total = 0
1.upto(100_000_000) { |n| total += n }
puts total
[/code]
[code]
% time ruby sum.rb
5000000050000000
real 0m11.905s
user 0m11.869s
sys 0m0.015s
[/code]
[QUOTE=swift and shift;37267859][code]
total = 0
1.upto(100_000_000) { |n| total += n }
puts total
[/code]
[code]
% time ruby sum.rb
5000000050000000
real 0m11.905s
user 0m11.869s
sys 0m0.015s
[/code][/QUOTE]
Is that with file I/O? As I did it where it would write every number to a file.
[QUOTE=swift and shift;37267859][code]
total = 0
1.upto(100_000_000) { |n| total += n }
puts total
[/code]
[code]
% time ruby sum.rb
5000000050000000
real 0m11.905s
user 0m11.869s
sys 0m0.015s
[/code][/QUOTE]
[code]local t0 = os.clock()
local total = 0
for i=1, 100000000 do
total = total + i
end
print(total, os.clock() - t0 .. "s")[/code]
[code]5.00000005e+015 0.177s[/code]
[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]
[code]
% time ./sum
5000000050000000
real 0m0.254s
user 0m0.251s
sys 0m0.002s
[/code]
:suicide:
[QUOTE=TheEyes;37267899]Is that with file I/O? As I did it where it would write every number to a file.[/QUOTE]
You didn't mention file I/O.
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.
[QUOTE=Lexic;37268152]You didn't mention file I/O.[/QUOTE]
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.
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
[QUOTE=swift and shift;37268412]ahahahaha
[code]ruby threaded asm[/code]
declaring myself the winner of this pissing contest[/QUOTE]
:colbert:
[editline]16th August 2012[/editline]
[QUOTE=victormeriqui_1;37266228]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.[/QUOTE]
wow, brings 360 noscope wheat picking to actual fruition, gg wp
[QUOTE=Sartek;37266618]Finally got it to compile Naelstrom/Naelstrof...[/QUOTE]
Wow nice! It looked like a strugglestorm to compile it properly on Windows. Glad you got it working!
[img]http://puu.sh/VU39[/img]
Working on the bomberman thing still.
multiplayer code is breaking my brain.
Animation bugs are many.
Effort... dwindling.
GAH.
[QUOTE=Deco Da Man;37266815]Use [url=http://www.inf.puc-rio.br/~roberto/lpeg/]LPeg[/url].[/QUOTE]
What he said.
[QUOTE=Infectious;37272989]What he said.[/QUOTE]
Please use ratings ([img]http://www.facepunch.com/fp/ratings/tick.png[/img]) instead of making posts like that.
[code]def add_up_to(n):
return 0.5 * n * (n + 1)
print(add_up_to(100000000))[/code]
Runs in constant time. May not be in the spirit of the problem, but I think that solves it best!
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 [I]does[/I] 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]));[/code]
I'm fairly happy with the net result, however:
[img]http://i.imgur.com/Cn1Oc.png[/img]
(the other tabs are placeholders)
Comments on the UI?
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.
I feel ever so sorry for you :(
I'm glad I'm not the one genes decided to piss on.
[editline]16th August 2012[/editline]
Is there any reason why you didn't get pain today?
[QUOTE=COBRAa;37274334]I feel ever so sorry for you :(
I'm glad I'm not the one genes decided to piss on.
[editline]16th August 2012[/editline]
Is there any reason why you didn't get pain today?[/QUOTE]
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.
[IMG]https://dl.dropbox.com/u/27714141/entities.png[/IMG]
[B]Mwahahaha[/B]. (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.
[QUOTE=r0b0tsquid;37273691][code]def add_up_to(n):
return 0.5 * n * (n + 1)
print(add_up_to(100000000))[/code]
Runs in constant time. May not be in the spirit of the problem, but I think that solves it best![/QUOTE]
[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)[/code]
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 [i]can[/i] add up to "n".
[editline]17th August 2012[/editline]
Also that might not strictly respect Wolfram|Alpha's terms of use so don't actually use it
I worked on the collision-system. Now I can push things sideways against each other.
(Not really smooth, but it works!)
[vid]http://videos.monky-town.de/Game2.webm[/vid]
Oh! And I don't hang in the air anymore. I can now just walk off. :v:
I finally made some videos of stuff I've been working on.
[video=youtube;MyRk-8Z6o1M]http://www.youtube.com/watch?v=MyRk-8Z6o1M[/video]
[video=youtube;cUM-BgbDb1o]http://www.youtube.com/watch?v=cUM-BgbDb1o[/video]
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.
Sorry, you need to Log In to post a reply to this thread.