On Thursday, June 11, 2015 at 6:08:22 PM UTC+5:30, larry@gmail.com wrote:
> On Thu, Jun 11, 2015 at 8:35 AM, Joel Goldstick wrote:
> > but you aren't asking questions. You are having a conversation with
> > yourself on a public q/a list. Its unpleasant
>
> Well, he did mention masterbation i
On Thu, Jun 11, 2015 at 8:35 AM, Joel Goldstick
wrote:
> but you aren't asking questions. You are having a conversation with
> yourself on a public q/a list. Its unpleasant
Well, he did mention masterbation in another post.
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Jun 11, 2015 at 7:15 AM, Skybuck Flying wrote:
> Well it did help a little bit.
>
> Somebody asked if there was already a parser for it.
>
> I answered yes in C#.
>
> So I took a closer look at it... and learned something from it.
>
> Maybe I would have done that anyway... or maybe not...
Well it did help a little bit.
Somebody asked if there was already a parser for it.
I answered yes in C#.
So I took a closer look at it... and learned something from it.
Maybe I would have done that anyway... or maybe not...
Now we will never know... but I am happy that the parser is now ok,
On Wednesday, June 10, 2015 at 5:04:17 AM UTC+5:30, Michael Torrie wrote:
> On 06/09/2015 06:20 AM, Skybuck Flying wrote:
> > Euhm...
> >
> > My parser is already done... since today
> >
> > Loving it too
> >
> > Wrote it myself... based on the c# code technique explained somewhere in
> > this
On 06/09/2015 06:20 AM, Skybuck Flying wrote:
> Euhm...
>
> My parser is already done... since today
>
> Loving it too
>
> Wrote it myself... based on the c# code technique explained somewhere in
> this thread too
I'm glad you're having fun, and making good progress. And it's good to
hear of
Euhm...
My parser is already done... since today
Loving it too
Wrote it myself... based on the c# code technique explained somewhere in
this thread too
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Jun 9, 2015 at 12:30 PM, Skybuck Flying
wrote:
> Anyway... I am trying a more robust parser... because my own parser right
> now didn't work out for new inputs.
>
You should take a look at lrparsing:
https://pypi.python.org/pypi/lrparsing/1.0.11
Cheers
>
> It almost worked except for
I made it way too difficult on myself with that stupid dictionary bs...
What I really wanted was to know if the ref was already in the reflist.
Turns out python has a really nice simple operation for that:
if not (Ref in EntityRef):
EntityRef.append(Ref)
DONE ! =D
No need for dictionary.
Oh I think I forgot to mention... parser is now getting close to 1 second...
with tokenizer and such.
But I think this is still within acceptable performance level for now.
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list
Well... I must say I am impressed:
Python parsers the file/info I want in just:
Seconds: 0.013389648
For +/- 20.000 lines of input data/text.
This makes it very usuable cool !
Now I try the bigger file:
+/- 285.000 lines of input data/text:
Seconds: 0.092351501
Very impressive !
I
Ok problem found.
The data contains:
EntityRef EntityRef
So perhaps I screwed it up or perhaps the data is a bit bad.
I ll check on my web drive:
http://www.skybuck.org/Games/StartrekOnline/Parser/SpaceFleetAlertEnemyExample.demo
Firefox doesn't find it... so apperently I fucked up data a b
Something strange happens with: 36044817
near the update section... for some reason it doesn't copy it properly...
Hmm...
Maybe a bug in output or an additional new line or maybe something wrong...
Hmm..
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list
I feel my conclusion is a bit hasty... but using dictionaries is not easy
that for sure.
Apperently the problem is
DemoEntityInde is none ?
But why would it be none ?
Hmmm strange... maybe some refs are not in there... hmmm...
Yeah could be... I cutted some stuff out... so I better check for
get was tried but now new error somewhere else:
[error] TypeError ( list indices must be integers )
[error] --- Traceback --- error source first line: module ( function )
statement 133: main ( ProcessUpdateEntityDead )
DemoEntityDead[DemoEntityIndex] = Dead
Apperently the returned index from
On 06/04/2015 11:14 AM, Steven D'Aprano wrote:
> On Fri, 5 Jun 2015 03:02 am, Skybuck Flying wrote:
>
>> Yeah... my first nice parser for this kind of stuff...
>>
>> Python is really nice for this stuff...
>>
>> Piece a cake.. now I just need to stuff it in some dictionary and I am
>> done or so ;
Very nice code almost done.
Now I am trying to do the code correctly and fast, thus using a dictionary,
but I run into a little problem:
The dictionary is declared as:
DemoEntityRefIndex = {}
Pairs are added as:
DemoEntityRefIndex[Ref] = DemoEntityIndex
And now I try to retrieve the demo e
On Fri, 5 Jun 2015 03:02 am, Skybuck Flying wrote:
> Yeah... my first nice parser for this kind of stuff...
>
> Python is really nice for this stuff...
>
> Piece a cake.. now I just need to stuff it in some dictionary and I am
> done or so ;)
>
> Though a dictionary might be hard to traverse in
Yeah... my first nice parser for this kind of stuff...
Python is really nice for this stuff...
Piece a cake.. now I just need to stuff it in some dictionary and I am done
or so ;)
Though a dictionary might be hard to traverse in sequence...
A list is probably enough... assuming no duplicate
Yes these string processing techniques will work very nicely and very fast:
cut and pasted an example but should work... now I developed it a bit
further, bye ,bye.
BotDemoFolder = "C:\\Games\\Startrek Online\\Startrek Online\\Cryptic
Studios\\Star Trek Online\\Live\\demos"
BotDemoFile = "Sp
"MRAB" wrote in message
news:mailman.71.1433263397.13271.python-l...@python.org...
On 2015-06-02 05:45, Skybuck Flying wrote:
Example for python:
MyString = "Hello World"
print MyString.rfind("World")
if MyString.rfind("World"):
print "yes"
else:
print "no"
Pretty cool.
"
.rfind retur
On 2015-06-02 05:45, Skybuck Flying wrote:
Example for python:
MyString = "Hello World"
print MyString.rfind("World")
if MyString.rfind("World"):
print "yes"
else:
print "no"
Pretty cool.
.rfind returns the index if found, -1 if not found.
"World".rfind("World") returns 0, which will be tre
On 2015-06-02, Skybuck Flying wrote:
>
> {
>
>
>{
>
>}
> }
IOW, it's almost, but not quite, JSON.
--
Grant Edwards grant.b.edwardsYow! My vaseline is
at RUNNING...
gmai
Actually that's not true... messages not that interesting.
This C# parser does not parse what I want which is:
"updates"
and
"positions".
Thus I rejected this parser some days ago.
But it's technique could be handy.
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list
If some of this code could be made to work it could be of some use:
ParserEngine is the least important...
MessageParser is interesting.
class AbstractSectionsParser(AbstractParser):
# Provides a method to return a list of sections
def GetResult(self):
# Returns the list with the found resourc
Example for python:
MyString = "Hello World"
print MyString.rfind("World")
if MyString.rfind("World"):
print "yes"
else:
print "no"
Pretty cool.
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list
Hmm this parser uses an interesting technique:
if line.Contains("activePlayerRef"):
self._activePlayerRef =
Convert.ToInt64(line.Substring(line.LastIndexOf("activePlayerRef") + 16))
I'll see if python can do this as well... ;)
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/p
Together with this it's might be of some use:
http://codeconverter.sharpdevelop.net/SnippetConverter.aspx
It converts C# to Python pretty fast.
I'll give it a try to see if it can work.
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list
Here is a parser for sto demo files written in C# maybe it can be of some
use, check trunk folders:
http://sourceforge.net/p/stodemolauncher/code/HEAD/tree/
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list
On 02/06/2015 01:29, Skybuck Flying wrote:
Hello,
I need some kind of parser and some kind of way to access the data
contained in a file like the one below:
(text file):
http://www.skybuck.org/Games/StartrekOnline/Parser/SpaceFleetAlertEnemyExample.demo
I am interested in learning the entity
Perhaps the list.append operation is the cause of the slowdown, or perhaps
my algo is flawed.
No idea yet with slowdown of parser code so far.
Instead of trying to debug everything going to add some time outputs to the
whole thing to get to bottom of this ;)
Ok another sikuli failure... I ju
Apperently print speed has some exponential time issue in SikuliX kinda
weird.
But at least processing is high... however, debug console/print is only
thing I got to diagnose problems...
Could get time-wise nasty... hmmm...
Perhaps I should make a small little parser in Delphi and port it to
Test program shows, python/sikulix can handle about 3m chars per second so I
must continue with a parser attempt.
Apperently there is some bottleneck/slowdown in posted code...
I may have to slow down a bit take more time... and perhaps use global vars
or so... instead of parameters.
Maybe t
Test program shows, python/sikulix can handle about 3m chars per second so I
must continue with a parser attempt.
# test char processing speed.
# test if sikulix 1.1, python, jython/whatever is a piece of shit when it
comes to parsing dealing with characters, unicode processing bottleneck
theo
I tried running this in SikuliX 1.1
from pyparsing import Word, alphas
greet = Word( alphas ) + "," + Word( alphas ) + "!"
greeting = greet.parseString( "Hello, World!" )
print greeting
Doesn't seem to run pyparser module missing.
Another reason why not to use it, unfortunately.
Not sure if i
"Joel Goldstick" wrote in message
news:mailman.34.1433209315.13271.python-l...@python.org...
On Mon, Jun 1, 2015 at 9:31 PM, Skybuck Flying
wrote:
Yes this will work:
DemoChars = FileObject.read()
I think this is a cleaner solution. EOL can be ignored and focusses on { }
and stuff like
I am trying to rush it a bit but things are starting to go to hell.
SikuliX needs to be restarted continously to deal with bugs.
Plus Eclipse breakpoints cannot be set.
So both IDEs totally suck for any complex code development.
Plus I can already tell this is going to be insanely slow in pyth
On Mon, Jun 1, 2015 at 9:31 PM, Skybuck Flying wrote:
> Yes this will work:
>
> DemoChars = FileObject.read()
>
> I think this is a cleaner solution. EOL can be ignored and focusses on { }
> and stuff like that... when extracting information EOL could be used as
> well.
>
>
> Bye,
> Skybuck.
> --
On 06/01/2015 07:19 PM, Skybuck Flying wrote:
How hard would it be to encode that into pyparser ?
"
Check out the docs and you probably will get an idea. The only real way
to find out is to try it.
Is this file from a certain program? If so, it's possible someone has
already written a python
Nice char based code:
BotDemoFolder = "C:\\Games\\Startrek Online\\Startrek Online\\Cryptic
Studios\\Star Trek Online\\Live\\demos"
BotDemoFile = "SpaceFleetAlert.demo"
import time
def ParseDemoLines( ParaLines ):
print "Parsing " + str( len(ParaLines) ) + " lines."
for LineIndex in range(0,
Yes this will work:
DemoChars = FileObject.read()
I think this is a cleaner solution. EOL can be ignored and focusses on { }
and stuff like that... when extracting information EOL could be used as
well.
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list
Ok, so far so good, a little start has been made.
Text file is read into lines... I am not so sure if this is a good idea...
Maybe it's easier if the entire file is one gigant array of characters
instead of fragmented lines.
However I don't know yet exactly how to read as one gigant array of
On 06/01/2015 07:19 PM, Skybuck Flying wrote:
> How hard would it be to encode that into pyparser ?
Check out the docs and you probably will get an idea. The only real way
to find out is to try it.
Is this file from a certain program? If so, it's possible someone has
already written a python li
Since the file is probably ascii... not sure... I might come away with:
"
file.read([size])
Reads at most size bytes from the file (less if the read hits EOF before
obtaining size bytes).
"
The doc does not mention is size is optionally... I will try and leave it
out, see what happens, other
"Michael Torrie" wrote in message
news:mailman.31.1433207544.13271.python-l...@python.org...
On 06/01/2015 06:29 PM, Skybuck Flying wrote:
The parser should be able to parse a textfile of somewhere between 20.000
lines to 50.000 lines in about 1 to 2 seconds.
My environment is SikuliX 1.1
"
So far this is what I got... I like to name things for what they are so
FileObject I like better than something abstract/weird like "text file", my
code:
BotDemoFolder = "C:\\Games\\Startrek Online\\Startrek Online\\Cryptic
Studios\\Star Trek Online\\Live\\demos"
BotDemoFile = "SpaceFleetAler
On 06/01/2015 06:29 PM, Skybuck Flying wrote:
> The parser should be able to parse a textfile of somewhere between 20.000
> lines to 50.000 lines in about 1 to 2 seconds.
>
> My environment is SikuliX 1.1
I don't have any inclination to examine your input files, but you could
certainly mock up a
Readlines is indeed documented as reading EOF:
http://www.tutorialspoint.com/python/file_methods.htm
Bye,
skybuck.
"Skybuck Flying" wrote in message
news:37cda$556d009d$5419aafe$38...@news.ziggo.nl...
This will probably help:
http://stackoverflow.com/questions/14676265/how-to-read-text-fi
I really like this python help file, it has served me well so far:
http://www.tutorialspoint.com/python/python_functions.htm
It's unusually better than the rest on the net ;)
It matches nicely Sikuli's python's capabilities.
Bye,
Skybuck :)
--
https://mail.python.org/mailman/listinfo/python-l
Link looks a bit odd, home index link:
Nice python documentation/tutorial/help:
http://www.tutorialspoint.com/python/index.htm
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list
Except for the first bracket... it has no structure name.
Perhaps the demo filename could be used as structure name or just be left
empty.
Bye,
Skybuck.
"Skybuck Flying" wrote in message
news:aef84$556d00e7$5419aafe$39...@news.ziggo.nl...
From examining the demo file it seems each brac
From examining the demo file it seems each bracketted data sections if
pre-header/pre-fixed with it's name.
So it's somewhat similar to a C structure:
structure
{
}
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list
This can help with parsing the C like bracketted data:
http://stackoverflow.com/questions/1651487/python-parsing-bracketed-blocks
algo:
"
For each string in the array:
Find the first '{'. If there is none, leave that string alone.
Init a counter to 0.
For each character in the string:
This will probably help:
http://stackoverflow.com/questions/14676265/how-to-read-text-file-into-a-list-or-array-with-python
text_file = open("filename.dat", "r")
lines = text_file.readlines()
print lines
print len(lines)
text_file.close() Usually I like to consult officals docs though...Bye,
Sk
Some further information about the demo file:
It seems to be split up into "creation sections"
and "update" sections.
The update sections contain the positions.
The update sections also contain a reference number to the created entities.
(There is one empty creation section but that's because
I will try and help for as far as possible, maybe I will end up writing it
myself in the process.
The first problem seems to be, how to read a textfile into python all at
once... and then perhaps process them per line.
Bye,
Skybuck.
--
https://mail.python.org/mailman/listinfo/python-list
Hello,
I need some kind of parser and some kind of way to access the data contained
in a file like the one below:
(text file):
http://www.skybuck.org/Games/StartrekOnline/Parser/SpaceFleetAlertEnemyExample.demo
I am interested in learning the entity numbers:
"EntityRef "
and their position
57 matches
Mail list logo