GoKibitz Alpha

Tell the community about tournaments, new go sites, software updates, etc.
User avatar
cloudbrows
Dies in gote
Posts: 34
Joined: Wed Apr 02, 2014 9:36 am
Rank: AGA 2 kyu
GD Posts: 0
KGS: cloudbrows
Location: Washington, DC
Has thanked: 12 times
Been thanked: 29 times
Contact:

Re: GoKibitz Alpha

Post by cloudbrows »

oca wrote:
cloudbrows wrote:
oca wrote:Hi, I just uploaded a game of mine, directly downloaded from IGS pandanet, but the players seems not to be found, both players are shown as "Anonymous"...
the upload sgf contains the player information like that :

Code: Select all

...
PW[Saute]WR[13k ]NW[16]
PB[oca]BR[13k ]NB[16]
...


the game is here : http://gokibitz.com/kifu/7JbW1_oX

and... if anyone want to comment that game... that's very welcome of course ;) I won that game by resignation, but I think I was not that much ahead... (I'm black)


I just saw that this morning and am a little confused: it doesn't seem to be affecting other games, so I'm wondering if it's a unique feature of the game you uploaded.

I did make a change last night that involved player name / rank display, so my first thought was that I'd introduced a bug, which is still a possibility, I guess. Anyway, I'll check it out!



[edit]I just attached here sgf I uploaded[/sgf]


Thanks for submitting the sgf! Luckily I can grab the raw SGF for any uploaded game, so I can try to troubleshoot when things go wrong. I've got a ticket in for your issue. https://github.com/neagle/gokibitz/issues/6

oca wrote:Just for information, on the kifu list, the name of the players are displayed correctly.


Yeah, those names get parsed in two different ways, which is why one works and one doesn't. One comes from my own db models (the kifu list) and the other from the WGo player (the game view itself).

oca wrote:BTW : Great App !


Thanks very much for saying so!
Nate Eagle

"You see, this is why go is so difficult. But also why go is so interesting." --Yuan Zhou
User avatar
cloudbrows
Dies in gote
Posts: 34
Joined: Wed Apr 02, 2014 9:36 am
Rank: AGA 2 kyu
GD Posts: 0
KGS: cloudbrows
Location: Washington, DC
Has thanked: 12 times
Been thanked: 29 times
Contact:

Re: GoKibitz Alpha

Post by cloudbrows »

pitirre wrote:how about the option to give a title to a game? sometimes a good title can attract reviewers


That's a cool idea; it's not something I had thought of. Let me add it as a feature request. It shouldn't be too hard.

https://github.com/neagle/gokibitz/issues/7
Nate Eagle

"You see, this is why go is so difficult. But also why go is so interesting." --Yuan Zhou
User avatar
oca
Lives in gote
Posts: 699
Joined: Wed Feb 19, 2014 2:53 am
Rank: DDK
GD Posts: 0
KGS: aco
IGS: oca
OGS: oca
Location: Switzerland
Has thanked: 485 times
Been thanked: 166 times

Re: GoKibitz Alpha

Post by oca »

cloudbrows wrote:...
I've got a ticket in for your issue. https://github.com/neagle/gokibitz/issues/6

oca wrote:Just for information, on the kifu list, the name of the players are displayed correctly.


Yeah, those names get parsed in two different ways, which is why one works and one doesn't. One comes from my own db models (the kifu list) and the other from the WGo player (the game view itself).
...


I just found the cause of the problem :

The sgf contains a 'CoPyright' property that WGo cannot parse.
So the problem is not in your code. I suppose it's not even in WGo's code as property in SGF must be 2 uppercase letters (http://www.red-bean.com/sgf/sgf4.html) so the correct value must be just 'CP' in this case...

The code I used for my test :

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>View</title>
   <script type="text/javascript" src="../lib/ext/wgo/wgo.min.js"></script>
   <script type="text/javascript" src="../lib/ext/wgo/kifu.js"></script>
   <script type="text/javascript" src="../lib/ext/wgo/sgfparser.js"></script>
</head>
<body>
   See messages in the console.
   
   <script>
      var sgf_KO = "(;\
GM[1]EV[Internet Go Server game: Saute vs oca]\
US[Brought to you by IGS PANDANET]\
CoPyright[\
  Copyright (c) PANDANET Inc. 2015\
  Permission to reproduce this game is given, provided proper credit is given.\
  No warrantee, implied or explicit, is understood.\
  Use of this game is an understanding and agreement of this notice.\
]\
GN[Saute-oca(B) IGS]RE[B+Resign]\
PW[Saute]WR[13k ]NW[16]\
PB[oca]BR[13k ]NB[16]\
PC[IGS:  igs.joyjoy.net 6969]DT[2015-01-04]\
SZ[19]TM[600]KM[6.500000]LT[]\
RR[Normal])"

var sgf_OK = "(;\
GM[1]EV[Internet Go Server game: Saute vs oca]\
US[Brought to you by IGS PANDANET]\
CP[\
  Copyright (c) PANDANET Inc. 2015\
  Permission to reproduce this game is given, provided proper credit is given.\
  No warrantee, implied or explicit, is understood.\
  Use of this game is an understanding and agreement of this notice.\
]\
GN[Saute-oca(B) IGS]RE[B+Resign]\
PW[Saute]WR[13k ]NW[16]\
PB[oca]BR[13k ]NB[16]\
PC[IGS:  igs.joyjoy.net 6969]DT[2015-01-04]\
SZ[19]TM[600]KM[6.500000]LT[]\
RR[Normal])"
      
      var kifu;
      console.log("Not working, due to the 'CoPyright' tag")
      kifu = WGo.Kifu.fromSgf(sgf_KO);
      console.log(JSON.stringify(kifu.info));
      
      console.log("Working, as I changed 'CoPyright' to two letters tag 'CP'")
      kifu = WGo.Kifu.fromSgf(sgf_OK);
      console.log(JSON.stringify(kifu.info));      
   </script>
</body>

</html>
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
User avatar
cloudbrows
Dies in gote
Posts: 34
Joined: Wed Apr 02, 2014 9:36 am
Rank: AGA 2 kyu
GD Posts: 0
KGS: cloudbrows
Location: Washington, DC
Has thanked: 12 times
Been thanked: 29 times
Contact:

Re: GoKibitz Alpha

Post by cloudbrows »

Ah ha! Thanks for checking into that: it doesn't get any better than someone solving a bug for you. :clap:

It also clarifies why the listing page could still find the player names: to get those properties I'm using a simple regexp to grab exactly the property I'm looking for, rather than parsing the SGF entirely.

I'm be tempted to try to submit a pull request to WGo.js so that it could still handle this issue, but Pandanet's "CoPyright" property does go flatly against the spec: http://www.red-bean.com/sgf/sgf4.html#2.2
Nate Eagle

"You see, this is why go is so difficult. But also why go is so interesting." --Yuan Zhou
User avatar
oca
Lives in gote
Posts: 699
Joined: Wed Feb 19, 2014 2:53 am
Rank: DDK
GD Posts: 0
KGS: aco
IGS: oca
OGS: oca
Location: Switzerland
Has thanked: 485 times
Been thanked: 166 times

Re: GoKibitz Alpha

Post by oca »

cloudbrows wrote:Ah ha! Thanks for checking into that: it doesn't get any better than someone solving a bug for you. :clap:
It also clarifies why the listing page could still find the player names: to get those properties I'm using a simple regexp to grab exactly the property I'm looking for, rather than parsing the SGF entirely.

I'm be tempted to try to submit a pull request to WGo.js so that it could still handle this issue, but Pandanet's "CoPyright" property does go flatly against the spec: http://www.red-bean.com/sgf/sgf4.html#2.2


Thanks, I tried to dowload the project on github and to make it work on my computer and I'm not that far...
the only thing that I cannot get to work is styling... all css seems to be missing... but that's not really a surprise as I have an error when using gulp... any idea what could be wrong ?

Code: Select all

C:\Users\oca\Desktop\my\gokibitz-master-oca>gulp
[16:57:16] Using gulpfile ~\Desktop\my\gokibitz-master-oca\gulpfile.js
[16:57:16] Starting 'lint-server-js'...
[16:57:16] Starting 'sass-includes'...
[16:57:16] Finished 'sass-includes' after 2.57 ms
[16:57:16] Starting 'sass'...
[16:57:16] Starting 'browserify'...
[16:57:16] Bundling app.js...
[16:57:16] Starting 'fonts'...
[16:57:16] Starting 'js-assets'...
[16:57:16] Starting 'images'...
[16:57:16] Starting 'bootstrap-assets'...
[16:57:17] [gulp-sass] C:\Users\oca\Desktop\my\gokibitz-master-oca\client\src\sc
ss/lib/gokibitz:1: invalid top-level expression

[16:57:17] Finished 'sass' after 298 ms
[16:57:17] Finished 'js-assets' after 267 ms
[16:57:17] Finished 'bootstrap-assets' after 942 ms
[16:57:18] Finished 'lint-server-js' after 1.76 s
[16:57:29] Bundled app.js in 12 s
[16:57:29] Finished 'browserify' after 12 s
[16:57:29] Finished 'fonts' after 12 s
[16:57:29] gulp-imagemin: Minified 0 images
[16:57:29] Finished 'images' after 12 s
[16:57:29] Starting 'default'...
[16:57:29] Finished 'default' after 28 µs
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
xed_over
Oza
Posts: 2264
Joined: Mon Apr 19, 2010 11:51 am
Has thanked: 1179 times
Been thanked: 553 times

Re: GoKibitz Alpha

Post by xed_over »

cloudbrows wrote: but Pandanet's "CoPyright" property does go flatly against the spec: http://www.red-bean.com/sgf/sgf4.html#2.2

actually it doesn't... there are only two uppercase letters in the keyword "CoPyright". But, you are correct that these are old style SGF properties. But IGS has been around for a very long time and that code probably hasn't been touched for years.

for example, PlayerWhite (PW) or GameName (GN) are perfectly valid property identifiers -- using only the two capital letters.

edit: found it. yes, they are old style
http://www.red-bean.com/sgf/converting.html
redbean wrote:Property identifiers
In FF[1]-FF[3] lowercase letters where allowed in property identifiers, but in FF[4] only uppercase letters are allowed. I.e. the application has to remove all lowercase letters from the file.

Example: Black[qd];thisisaWhitemove[kk]bbrWyryrerwLerreoi[10.3] --> B[qd];W[kk]WL[10.3]


so if IGS/Pandanet is still using the old style property names but calling it FF[4], then yes, they are wrong.
User avatar
cloudbrows
Dies in gote
Posts: 34
Joined: Wed Apr 02, 2014 9:36 am
Rank: AGA 2 kyu
GD Posts: 0
KGS: cloudbrows
Location: Washington, DC
Has thanked: 12 times
Been thanked: 29 times
Contact:

Re: GoKibitz Alpha

Post by cloudbrows »

oca wrote:Thanks, I tried to dowload the project on github and to make it work on my computer and I'm not that far...
the only thing that I cannot get to work is styling... all css seems to be missing... but that's not really a surprise as I have an error when using gulp... any idea what could be wrong ?

Code: Select all

C:\Users\oca\Desktop\my\gokibitz-master-oca>gulp
[16:57:16] Using gulpfile ~\Desktop\my\gokibitz-master-oca\gulpfile.js
[16:57:16] Starting 'lint-server-js'...
[16:57:16] Starting 'sass-includes'...
[16:57:16] Finished 'sass-includes' after 2.57 ms
[16:57:16] Starting 'sass'...
[16:57:16] Starting 'browserify'...
[16:57:16] Bundling app.js...
[16:57:16] Starting 'fonts'...
[16:57:16] Starting 'js-assets'...
[16:57:16] Starting 'images'...
[16:57:16] Starting 'bootstrap-assets'...
[16:57:17] [gulp-sass] C:\Users\oca\Desktop\my\gokibitz-master-oca\client\src\sc
ss/lib/gokibitz:1: invalid top-level expression

[16:57:17] Finished 'sass' after 298 ms
[16:57:17] Finished 'js-assets' after 267 ms
[16:57:17] Finished 'bootstrap-assets' after 942 ms
[16:57:18] Finished 'lint-server-js' after 1.76 s
[16:57:29] Bundled app.js in 12 s
[16:57:29] Finished 'browserify' after 12 s
[16:57:29] Finished 'fonts' after 12 s
[16:57:29] gulp-imagemin: Minified 0 images
[16:57:29] Finished 'images' after 12 s
[16:57:29] Starting 'default'...
[16:57:29] Finished 'default' after 28 µs


That's awesome that you downloaded it and tried to get it running: I apologize for some messiness. I've been in "get this up and running!" mode and haven't spent any time on making it more hospitable for other devs.

Hmm... the only thing wrong is that the gulp-sass task is failing. Could you try pulling my most recent changes and running "gulp sass" on its own?

I haven't tried running this on a Windows computer, I don't know if that could possibly cause any issues. Feel free to hit me up on AIM (nateeagle5) if you'd like some help troubleshooting.
Nate Eagle

"You see, this is why go is so difficult. But also why go is so interesting." --Yuan Zhou
User avatar
oca
Lives in gote
Posts: 699
Joined: Wed Feb 19, 2014 2:53 am
Rank: DDK
GD Posts: 0
KGS: aco
IGS: oca
OGS: oca
Location: Switzerland
Has thanked: 485 times
Been thanked: 166 times

Re: GoKibitz Alpha

Post by oca »

cloudbrows wrote:I apologize for some messiness. I've been in "get this up and running!" mode and haven't spent any time on making it more hospitable for other devs.

No problem, the code I saw so far looks really good to me...

cloudbrows wrote:Hmm... the only thing wrong is that the gulp-sass task is failing. Could you try pulling my most recent changes and running "gulp sass" on its own?


First I must confess that I don't know anything about sass... but...

The problem seems to come from the file "client\src\scss\lib\_gokibitz.scss"
which contains a single line

Code: Select all

../../submodules/wgo.js/themes/gokibitz/src/scss/gokibitz.scss

but the folder "../../submodules/wgo.js" is empty...

I just tried to comment that line and that seems to work... the application is running and I didn't noticed any problem so far... I will now try to get a bit more familiar with the code... and see if I can somehow mix my "gobook project" with your code, as I think that would be funny to post comment in the gobook format to display some variations directly on the comment (in the same way you allready use markdown)
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
User avatar
cloudbrows
Dies in gote
Posts: 34
Joined: Wed Apr 02, 2014 9:36 am
Rank: AGA 2 kyu
GD Posts: 0
KGS: cloudbrows
Location: Washington, DC
Has thanked: 12 times
Been thanked: 29 times
Contact:

Re: GoKibitz Alpha

Post by cloudbrows »

Ah, it's a submodule issue. I'm such an idiot. Just run

Code: Select all

git submodule update --init --recursive
from the project root and you should be able to restore that line in _gokibitz.scss.

oca wrote:I will now try to get a bit more familiar with the code... and see if I can somehow mix my "gobook project" with your code, as I think that would be funny to post comment in the gobook format to display some variations directly on the comment (in the same way you allready use markdown)


I'd love to see what you come up with - I love your idea of using gobook format.
Nate Eagle

"You see, this is why go is so difficult. But also why go is so interesting." --Yuan Zhou
zorq
Beginner
Posts: 15
Joined: Mon Nov 25, 2013 8:26 pm
GD Posts: 0
Been thanked: 3 times

Re: GoKibitz Alpha

Post by zorq »

oca wrote:The sgf contains a 'CoPyright' property that WGo cannot parse. So the problem is not in your code. I suppose it's not even in WGo's code as property in SGF must be 2 uppercase letters (http://www.red-bean.com/sgf/sgf4.html) so the correct value must be just 'CP' in this case...

One should not assume that SGF is necessarily FF[4]. That latter standard is too strict and cannot be followed. There are many SGF files with the MULTIGOGM property. Also properties like KGSSB and KGSSW occur.
User avatar
oca
Lives in gote
Posts: 699
Joined: Wed Feb 19, 2014 2:53 am
Rank: DDK
GD Posts: 0
KGS: aco
IGS: oca
OGS: oca
Location: Switzerland
Has thanked: 485 times
Been thanked: 166 times

Re: GoKibitz Alpha

Post by oca »

zorq wrote:
oca wrote:The sgf contains a 'CoPyright' property that WGo cannot parse. So the problem is not in your code. I suppose it's not even in WGo's code as property in SGF must be 2 uppercase letters (http://www.red-bean.com/sgf/sgf4.html) so the correct value must be just 'CP' in this case...

One should not assume that SGF is necessarily FF[4]. That latter standard is too strict and cannot be followed. There are many SGF files with the MULTIGOGM property. Also properties like KGSSB and KGSSW occur.


I agree, in the spec, that sentence really make sense to me :

http://www.red-bean.com/sgf/sgf4.html wrote:Therefore, if one is writing a SGF reader, it is important to skip unknown properties. An application should issue a warning message when skipping unknown or faulty properties.
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
User avatar
cloudbrows
Dies in gote
Posts: 34
Joined: Wed Apr 02, 2014 9:36 am
Rank: AGA 2 kyu
GD Posts: 0
KGS: cloudbrows
Location: Washington, DC
Has thanked: 12 times
Been thanked: 29 times
Contact:

Re: GoKibitz Alpha

Post by cloudbrows »

Sounds like I should try to fix it in WGo.js, then. WGo's creator was very nice the last time I submitted a pull request. I'll just add it to my list of things to do... :roll:
Nate Eagle

"You see, this is why go is so difficult. But also why go is so interesting." --Yuan Zhou
User avatar
oca
Lives in gote
Posts: 699
Joined: Wed Feb 19, 2014 2:53 am
Rank: DDK
GD Posts: 0
KGS: aco
IGS: oca
OGS: oca
Location: Switzerland
Has thanked: 485 times
Been thanked: 166 times

Re: GoKibitz Alpha

Post by oca »

cloudbrows wrote:
I'd love to see what you come up with - I love your idea of using gobook format.


Just a quick picture of a quick, very dirty try to add gobook style comment...
2015-01-08_133210.jpg
2015-01-08_133210.jpg (44.18 KiB) Viewed 7765 times
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
User avatar
cloudbrows
Dies in gote
Posts: 34
Joined: Wed Apr 02, 2014 9:36 am
Rank: AGA 2 kyu
GD Posts: 0
KGS: cloudbrows
Location: Washington, DC
Has thanked: 12 times
Been thanked: 29 times
Contact:

Re: GoKibitz Alpha

Post by cloudbrows »

I'm really intrigued! This is kind of a different direction than I had been thinking for showing variations, but it's really interesting. The key for me, I think, would be finding a way to make it easy for commenters to generate that notation by interacting with the board.

(Thanks for caring enough about this to try something, btw! I appreciate it.)
Nate Eagle

"You see, this is why go is so difficult. But also why go is so interesting." --Yuan Zhou
User avatar
oca
Lives in gote
Posts: 699
Joined: Wed Feb 19, 2014 2:53 am
Rank: DDK
GD Posts: 0
KGS: aco
IGS: oca
OGS: oca
Location: Switzerland
Has thanked: 485 times
Been thanked: 166 times

Re: GoKibitz Alpha

Post by oca »

sure, to be usable, there should be a way to edit the variation by clicking on a goban, not by typing text...

There are also a few technical issue, as my engine is not "angular ready" and did the DOM manipulation by itself... so there would be some rework to make something that integrate with your app in a cleaner way.

Just to give you an idea, for now the commentBox directive is modified like that which somehow work, but that's not really clean...

Code: Select all

...
...
element.bind('keyup', function (event) {
   var key = event.keyCode || event.which;
   if (key === 27) {
      $scope.cancel();
   } else {
      
      if (element.val() !== text) {
         text = element.val();

         // [OCA]
         var content = text
         if (content.indexOf("::book") === 0) {
            
               var res = new GoBookParser().parse(content);
               var book = res.book;
               var engine = new GoBookEngine();
               var bridge = new GoBookBridge_WGO( $(".preview"), null);
               $(".preview").html("")
               engine.executeFromTo( book, bridge, "en", 0, 1);
            
         }
         //[/OCA]

         // Get an HTML preview of the markdown
         $http.post('/api/markdown/', {markdown: element.val()})
            .success(function (data) {
               $scope.preview = data.markup;
            });
      }
   }
});
...

...
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216
Post Reply