« first day (400 days earlier)      last day (3148 days later) » 
00:00 - 19:0019:00 - 00:00

7:00 PM
> - [ ] Track which memory positions are used or not
 
The attribution text should only be present on non-PD files, correct?
 
> It does seem to work for me. This method is both run after each test in ServerConnectionTest and with the exit command. Under which circumstances would it raise ConcurrentModificationException?
> Never mind, that will happen if another thread is adding a client at the same time, right?
[Cardshifter/Cardshifter] jacwah pushed commit f550baba to develop: Fix concurrency issue in Server::stop
 
7:16 PM
> ConcurrentHashMaps support a set of sequential and parallel bulk operations that, unlike most Stream methods, are designed to be safely, and often sensibly, applied even with maps that are being concurrently updated by other threads
Hmm
 
[Cardshifter/Cardshifter] build for commit f550baba on develop: The Travis CI build passed
> I was under the impression that client.close(); removed the client from the clients collection, that's why I expected it. Perhaps that occasion is taken care of by the concurrent hash map though.
> I did forEach on a copy anyway in the next commit.
[Zomis/BrainDuck] Zomis pushed commit 06575863 to master: added summary for memory reads and memory writes
[Zomis/BrainDuck] Zomis pushed commit a57cc35c to master: using Groovy assertions in BrainTest
 
7:40 PM
Man, I wish there was a way to just loop over those image links and just get the damn attribution text :|
 
There is, if you have the time to figure it out :)
You could get each page and scrape it for the attribution
 
<input type="text" readonly="" id="stockphoto_attribution" onclick="select()" value="By Asia Society created the file. Artwork created by an anonymous ancient source. [Public domain], via Wikimedia Commons">
Meh, that only appears after you click the link. Curse you, dynamic HTML!
 
:S
Time to whip out selenium!
 
??
 
7:52 PM
> Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well.
 
Ah, so I could "record" the action of opening the page, clicking the link, waiting, then getting the text from the pop-up box?
 
I don't actually know how it works, but I imagine there being an api
 
Worth a try, I'll get the IDE Firefox add-on and see what I can do
 
Let me know how it goes!
 
[Zomis/BrainDuck] Zomis pushed commit 5a85f607 to master: added tape summary output in Brainalyze
 
8:06 PM
[info] Playing test case Untitled
[info] Executing: |open | /wiki/File:Maitreya_Buddha%2C_Nubra.jpg | |
[info] Executing: |click | css=a[title="Use this file on the web"] > b | |
[info] Executing: |click | id=stockphoto_attribution_html | |
[info] Executing: |click | id=stockphoto_attribution | |
[info] Test case passed
[info] Test suite completed: 1 played, all passed!
Now, if I can just get the actual script, I might be able to loop over each URL, but I'd still need a way to copy the actual text in that field
 
Maybe this helps?
Or this
 
Hey, do you know any Python?
Looks like the script can be exported in a number of formats
 
I do
 
# -*- coding: utf-8 -*-
from selenium import selenium
import unittest, time, re

class Wikimedia UseThisFile(unittest.TestCase):
    def setUp(self):
        self.verificationErrors = []
        self.selenium = selenium("localhost", 4444, "*chrome", "https://commons.wikimedia.org/")
        self.selenium.start()

    def test_wikimedia _use_this_file(self):
        sel = self.selenium
        sel.open("/wiki/File:Maitreya_Buddha%2C_Nubra.jpg")
        sel.click("css=a[title=\"Use this file on the web\"] > b")
Guess I could also do Java...
Though I don't think you can just run a Java script, can you
 
You have to compile java first
 
8:15 PM
package com.example.tests;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import java.util.regex.Pattern;

public class Wikimedia UseThisFile {
	private Selenium selenium;

	@Before
	public void setUp() throws Exception {
		selenium = new DefaultSelenium("localhost", 4444, "*chrome", "https://commons.wikimedia.org/");
		selenium.start();
	}

	@Test
	public void testWikimedia UseThisFile() throws Exception {
 
Anyway you should get rid of the unit testing things
sel = selenium("localhost", 4444, "*chrome", "https://commons.wikimedia.org/")
sel.start()
for link in links:
    sel.open(link)
    sel.click("css=a[title=\"Use this file on the web\"] > b")
    sel.click("id=stockphoto_attribution_html")
    sel.click("id=stockphoto_attribution")
    # get text etc
sel.stop()
 
public void testWikimedia UseThisFile() throws Exception {
how is that not a syntax error? o.o
(haven't use java in a nage)
 
It probably is. I had a space in my test name
 
@ARedHerring Same thing with the python code: IDK
 
8:22 PM
@ARedHerring I don't see the problem That should be a syntax error
 
I'll pop up the Java version in IDEA and see how far I get
 
Good luck!
 
Or would Python be simpler? ;D
 
It probably won't be if you don't know the language, but maybe the time has come? :)
 
Error:(3, 1) java: package com.thoughtworks.selenium does not exist
 
8:25 PM
You have to install the dependencies
Which is easy for python ;)
 
Meh. Can IDEA run Python?
 
Disclaimer: You should be on Linux ;)
Else Python will be somewhat less fun
@Phrancis PyCharm can, also a JetBrains product
 
I just use the console
 
@jacwah Do what?
 
Alt-F12 in IDEA
pip install selenium to install dependencies
If you don't have pip you can install it with Homebrew
 
8:29 PM
@Phrancis it's easy to install dependencies if you're using Gradle or Maven.
 
Hey look IDEA has a Python plugin :D
OK
 
@jacwah and if you don't have Homebrew... ;)
 
@SimonForsberg If @Phrancis doesn't have Homebrew then how does he survive?
 
@jacwah I don't code a lot, that's how ;)
 
Homebrew is a package manager for OS X, it's veeeery useful for installing a keeping software up to date
Like apt-get for Debian
 
8:32 PM
And like /dev/null for Windows
 
Indeed how do you survive?
 
@jacwah I don't
I'm a Zombie now
 
Install any FOSS: brew install <name>
Update all install packages: brew upgrade
<afk back="soon">
 
So, anyways. It was a breeze to get that Java dependency with Maven
 
[Cardshifter/HTML-Client] SirPython pushed commit a2130a00 to server-stats: fixed issue where refresh button was not becoming disabled
 
8:39 PM
@Phrancis Nice! I didn't know how much you knew how to use Maven or not.
 
4:38:22 PM Error running WikimediaUseThisFile: Class 'com.example.tests.WikimediaUseThisFile' not found in module 'JavaSandbox'
@SimonForsberg I know how to read documentation, that's all :)
I don't even have that reference in the code, wtf
 
public class Wikimedia UseThisFile {
 
I see an extra space ^^
 
I got rid of that, see updated in the pastebin
 
8:42 PM
make sure that there are no other crap-characters hidden there. Delete that text and re-write it just to be sure
 
@jacwah What is Homebrew?
 
[Zomis/BrainDuck] Zomis pushed commit a00bf724 to master: added some more special chars, to avoid bad output
 
@Phrancis you're missing a package declaration at the top of the file
 
Ah. How do I know what package to declare?
/Users/francisveilleux-gaboury/IdeaProjects/JavaSandbox/src/WikimediaUseThisFile‌​.java
 
hmm... then it shouldn't have a package it seems
6 mins ago, by Phrancis
4:38:22 PM Error running WikimediaUseThisFile: Class 'com.example.tests.WikimediaUseThisFile' not found in module 'JavaSandbox'
but that ^^ seems to expect a package, dunno why
have you moved the file or something?
also, you are using Maven now, aren't you?
 
8:47 PM
I created a class in my JavaSandbox project and copied the code into it simply
 
hmm
I think Maven might be expecting the file in src/main/java/
 
But yes, I am using Maven, I believe that's on by default for Java in IDEA
Oh, let me try that
Haha I have no idea what I'm doing
The original script has package com.example.tests;
I deleted that but for some reason it appears to be looking for it anyways
 
Is Maven like Gradle, in that it's a build tool?
 
@SirPython yes
 
@SimonForsberg Regarding your comment to #93, which possible issue should be addressed? If I remember correctly, handling the second possible issue is being dealt with (or, it was being dealt with before).
 
9:01 PM
@SirPython both should be dealt with.
It is very bad that the client doesn't disconnect from the server after checking if it is online
 
java.lang.UnsupportedOperationException: Catch body broken: IOException from cmd=open&1=%2Fwiki%2FFile%3AMaitreya_Buddha%252C_Nubra.jpg -> java.net.ConnectException: Connection refused
Am I being sandboxed? Wonder why connection refused
 
I'd also prefer that you sent a ServerQueryMessage to the server to query it for its status. I added support for that not long ago. That should give you a summary of available mods, and online players.
@Phrancis or because of invalid URL? Looks like it might be missing http://commons.wikimedia.org there?
 
Yes, that will be dealt with soon. Right now, I want to make sure that the client disconnects.
 
java.lang.UnsupportedOperationException: Catch body broken: IOException from cmd=open&1=https%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FFile%3AMaitreya_Buddha%252C_Nubra.jpg -> java.net.ConnectException: Connection refused
	at com.thoughtworks.selenium.HttpCommandProcessor.executeCommandOnServlet(HttpCommandProcessor.java:85)
	at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:68)
	at com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:222)
	at WikimediaUseThisFile.testWikimediaUseThisFile(WikimediaUseThisFile.java:19)
I changed the URL to add that in, but still getting errors
 
9:06 PM
> Allow users to be able to see all defined cards that exists in a mod, in a pretty big size.

This would both provide users with the information about the available cards (even tokens), which in itself is interesting. But it could also allow users to print out the cards and play with them as physical cards, if they would want to.
 
</afk>
 
@Duga Print as physical cards? Now that's an interesting idea
 
@Duga Doesn't the deck builder show all the cards in a mod?
Or, am I misinterpreting?
 
I think this might be a good one to relate to that other one about the alternative view of deck builder. Although, deck builder does not show non-selectable cards (i.e., token() cards)
 
@SirPython "Homebrew - the missing package manager for OS X" link
 
9:10 PM
@SirPython deck builder a) does not show cards graphically at the moment, only as text. b) if shown as graphics, it would need to show all the information, not hide things behind an effects button, c) does not show tokens, it only shows cards that can be included in the deck.
@Phrancis feature-request by a friend of mine who is quite interested in Cardshifter.
@Phrancis okay, I do not know why that happens.
 
Ah, I see what you are saying. However, the deck builder should already show the cards graphically.
 
it should? Have I missed something?
 
I remember adding it in long ago... it must've been lost in a conflict or a deleted branch.
 
ah, if you click the name of the card it is shown graphically
 
Oh, did you mean, show the card rather than the name?
 
9:13 PM
@Phrancis I agree.
 
@SirPython the "alternative view of deck builder" that we mean would be like this: media.mmo-champion.com/images/news/2013/march/hs2-full.jpg
 
Ah, I see. Yes, this would be a good idea.
 
Titan says "Hi"
 
Hi Titan!
 
9:15 PM
@Phrancis Hey!
Cool and slightly related: HTML5 Deck of cards
2
 
That is cool!
Which reminds me, I do want to make a mod that includes actual regular cards at some point
 
[Zomis/BrainDuck] Zomis pushed commit ecff8004 to master: added total memory used count in analysis output
[Zomis/BrainDuck] Zomis pushed commit 2c7a4a37 to master: reduced tape summary output to only include the range of the tape that actually has been visited
 
@jacwah holy crap that looks useful
nevermind, not as useful anymore... github.com/pakastin/deck-of-cards/blob/master/LICENSE
 
I think the cards can be made draggable by adding draggable to the card element, but there may be some more steps (like adding properties to the places where they can be placed).
 
9:28 PM
initial commit 4 days ago and 1300+ stars on github?
the draggability (nice word, huh?) isn't what I like most, it's the animations I really like.
 
I found it on the trending page
 
@jacwah Um yes
Should I use Python 2.7 or 3.4?
 
Python 3 is better
But I still use python 2 because that's what I learned intially
There are some libraries that don't have support for Python 3 yet, which is the only downside really
@SimonForsberg Still good source of inspiration :)
The animations all use cubic-bezier
 
[Zomis/BrainDuck] Zomis pushed commit 2c16dcf7 to master: adjusted the BF code according to the Review by Rubberduck, codereview.stackexchange.com/a/61717/31562
 
9:54 PM
Come on man
The selenium library is right there, why do you tell me you can't find it
 
Use pip :)
 
➜ Wikimedia UseThisFile Python script.py0.tmp pip install -U selenium
zsh: command not found: pip
 
Did you install pip first?
 
Apparently not :)
What was that other thing you use to install pip?
 
I use it to install lots of software
 
10:03 PM
FINE you win, getting Homebrew now :)
So, I got Homebrew, now I just need to install pip with it
 
brew install pip
Then pip install selenium
 
Good grief... pastebin.com/SBzFaMEb
Always something lol.
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/selenium'
 
Run sudo pip install selenium
You need to be the root user to write to that directory
 
Looks like that worked. How do you know all this stuff? ;p
 
This is the world I live in :)
sudo = super-user do
 
10:10 PM
OK, now I have a problem with the code itself
error: [Errno 61] Connection refused
Same thing I got from the Java version
Good thing is, now I have Python working in IDEA lol.
 
Always something!
 
# -*- coding: utf-8 -*-
from selenium import selenium
import unittest, time, re

class WikimediaUseThisFile(unittest.TestCase):
    def setUp(self):
        self.verificationErrors = []
        self.selenium = selenium("localhost", 4444, "*chrome", "https://commons.wikimedia.org/")
        self.selenium.start()

    def test_wikimedia_use_this_file(self):
        sel = self.selenium
        sel.open("/wiki/File:Maitreya_Buddha%2C_Nubra.jpg")
        sel.click("css=a[title=\"Use this file on the web\"] > b")
Someone said something about removing tests or whatever. I don't really know anything of what's happening in this script
 
That was me
 
Oh, right
 
Basic python: indentation is scope. Instead of {} we use four spaces
WikimediaUseThisFile is a class that extends unittest.TestCase, i.e. it's a unit test object
Each method of a TestCase that begins with test is run as a test case
 
10:15 PM
OK
 
setUp is run before each test and tearDown after
if __name__ == "__main__":
    unittest.main()
^ Run the tests if invoked on its own (not imported)
self is like this in Java
 
Gotcha
 
The only difference being that methods explicitly receive it as an argument
 
OK. Now, with this thing it's just doing unit tests, so the script doesn't actually "do" anything does it?
There were a few other options to export, maybe I just have the wrong one
 
What it does is get a page and click on a couple of things and then assert that there were no errors
 
10:22 PM
 
Seems like it's just using another api to do the same thing. Looks cleaner IMO.
 
Do you think the connection being refused comes from Wikimedia?
 
Probably. Try to see if you can get a more verbose message.
It might be that they try to block Selenium through UserAgent or something
 
How would I go about doing that? I got a full error from the console
/usr/bin/python "/Users/francisveilleux-gaboury/Library/Application Support/IdeaIC14/python/helpers/pycharm/utrunner.py" /Users/francisveilleux-gaboury/Documents/WikimediaUseThisFile.py true
Testing started at 6:26 PM ...

Process finished with exit code 0

Error
Traceback (most recent call last):
  File "/Users/francisveilleux-gaboury/Documents/WikimediaUseThisFile.py", line 9, in setUp
    self.selenium.start()
  File "/Library/Python/2.7/site-packages/selenium/selenium.py", line 202, in start
 
conn.request("POST", "/selenium-server/driver/", body, headers)
That doesn't look like it has anything to do with wikimedia
 
10:30 PM
    def do_command(self, verb, args):
        conn = http_client.HTTPConnection(self.host, self.port, timeout=self.http_timeout)
        try:
            body = 'cmd=' + urllib_parse.quote_plus(unicode(verb).encode('utf-8'))
            for i in range(len(args)):
                body += '&' + unicode(i+1) + '=' + \
                        urllib_parse.quote_plus(unicode(args[i]).encode('utf-8'))
            if (None != self.sessionId):
                body += "&sessionId=" + unicode(self.sessionId)
That's the method that triggers the error
 
"Content-Type":
                "application/x-www-form-urlencoded; charset=utf-8"
Can those be on separate lines without a `\`?
 
What's the output of the other script? I think that's the more recent api
 
> 6:33:36 PM Error running WikimediaUseThisFile2: Executable is not specified
Must be an IDEA issue
Ah there we go
 
It's T for me TGTB
Good luck @Phrancis!
 
lol
 
10:41 PM
Have a good night!
 
Later @jacwah thx for the help :)
 
fixed problem where refreshing created blank users

Fixes #92
 
@SimonForsberg ^^
 
Aug 11 at 1:22, by Phrancis
I hope there's not a "You'll need it!" implied ;)
 
10:50 PM
Looks like the exported script is partially broken, with a few modifications I think it should work
And now, all of a sudden, the "Use this file" link is gone :|
That may at least explain this new errpr
NoSuchElementException: Message: Unable to locate element: {"method":"css selector","selector":"a[title=\"Use this file on the web\"] > b"}
Stacktrace:
    at FirefoxDriver.prototype.findElementInternal_ (file:///var/folders/3p/280bq1w12zg37n1145v3_1mm0000gn/T/tmpC5shWo/extensions/fxdriver@googlecode.com/components/driver-component.js:10667)
    at fxdriver.Timer.prototype.setTimeout/<.notify (file:///var/folders/3p/280bq1w12zg37n1145v3_1mm0000gn/T/tmpC5shWo/extensions/fxdriver@googlecode.com/components/driver-component.js:623)
 
[Zomis/BrainDuck] Zomis pushed commit 4bceb12a to master: loop was always performed exactly twice, which meant that cursor moved 2xLeft, and then 2xRight, which means it was useless
[Zomis/BrainDuck] Zomis pushed commit ffe3549b to master: boolean is always one because it was set to always be one, which means that a +- combination can be simplified
[Zomis/BrainDuck] Zomis pushed commit 1c272490 to master: added a better test of Brainfuck FizzBuzz to make sure that nothing breaks
[Zomis/BrainDuck] Zomis pushed commit fa616611 to master: loop was always done 5 times, which lead to >>><<<<<>> which can be simplified away
[Zomis/BrainDuck] Zomis pushed commit 0e9471a0 to master: while loop always done twice, simplifying
[Zomis/BrainDuck] Zomis pushed commit 5243aac8 to master: changed comment for why [>] is used
[Zomis/BrainDuck] Zomis pushed commit 3a4b7e0a to master: loop was always done only once, simplifying
[Zomis/BrainDuck] Zomis pushed commit a22b4e3e to master: >>-<+> is the same as >+>-, simplified
[Zomis/BrainDuck] Zomis pushed commit 49828042 to master: the boolean is reset at the end of each loop, no need to do it at the beginning as well
[Zomis/BrainDuck] Zomis pushed commit f7d8f860 to master: small change to make the "Go forward to the start position 255 marker" loop always be performed twice (earlier was [1, 2 * 99] ), this will open up possibility for simplification
[Zomis/BrainDuck] Zomis pushed commit 715ebd70 to master: loop was always performed twice, simplifying
[Zomis/BrainDuck] Zomis pushed commit b5ee5eca to master: when pointer is already at the countdown, it is not necessary to go to the 255 marker just to go to the countdown
 
11:07 PM
I can't believe I just refactored Brainfuck code...
3
 
I can't believe it either
This selenium web driver looks cool, I bet we could use it for testing on the web client, or some thing or other, at some point
 
@Phrancis the sudo thing is a classic. Whenever you get Permission Denied in a unix-like system, you just try to run the same thing again with sudo :)
@SirPython yay!
 
> This is the server part of https://github.com/Cardshifter/HTML-Client/issues/92 :

The server currently seems to send out User Info Messages even for users that are not logged in, that is not what is supposed to happen.
 
@Phrancis what URL?
 
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

browser = webdriver.Firefox()

browser.get('http://www.yahoo.com')
assert 'Yahoo!' in browser.title

elem = browser.find_element_by_name('p')  # Find the search box
elem.send_keys('seleniumhq' + Keys.RETURN)

browser.quit()
 
> Sometimes a user may want to connect to a server that is not in the list of servers. Therefore, they will have to select "other" in the drop down list of the login page and then enter their custom server's address.

However, this can be tedious, especially if the user commonly uses multiple servers that are not on the list. As a fix for this, I think it would be nice to add a feature for saving "other servers" so they can be easily selected from the drop down list (perhaps under a label "Oth
 
It's as if that little box with the link is actually not part of the document. If you click the X it's just gone. Not found in the HTML source either
 
@Phrancis I still see the link
 
driver.find_element_by_css_selector("a[title=\"Use this file on the web\"] > b").click() # this fails, no such element
 
11:21 PM
maybe it's added and removed dynamically with JavaScript?
 
Could very well be the case. What a hassle
 
although I think Selenium should be able to handle that
but... ("a[title=\"Use this file on the web\"] > b") what kind of CSS selector is that? a[title=....] > b ? Why the > b ?
 
Good question. It just put that code there when it was recording my actions
 
there is no b that I am aware of, I think that is what fails.
 
Hm let me remove that and see
Huh, you were right, that worked
Now, I just need to get it to copy the text after doing that, and then put all the photo URLs in a list and loop over that
0
A: Select Text Using DoubleClick from WebDriver Java

Ajayyour code is perfect instead of trying to "double click" the web element you've given try some other element try this code WebDriver driver = new FirefoxDriver(); driver.navigate().to("http://jsbin.com/obeyu4/3"); WebDriverWait wait = new WebDriverWait(driver, 30); Actions act = n...

 
11:31 PM
Very nice answer on the "Hello Brainfuck" question, @SimonForsberg.
 
thanks, @SirPython.
I think I will post a selfie to my BF FizzBuzz question some time in a future not too far away.
 
[Zomis/BrainDuck] Zomis pushed commit 95be9904 to master: the the
> See github.com/Zomis/BrainDuck/commit/… and a couple of parent commits for optimizations and the reasoning behind them
200_success vs. janos: 15026 diff. Year: -4574. Quarter: -1653. Month: +122. Week: +75. Day: +75.
200_success vs. rolfl: 3490 diff. Year: +2743. Quarter: +3077. Month: +160. Week: +205. Day: +205.
Loki Astari vs. Simon Forsberg: 3116 diff. Year: -2660. Quarter: -1064. Month: +193. Week: -25. Day: -25.
Mat's Mug vs. Simon Forsberg: 1399 diff. Year: +2289. Quarter: +785. Month: +284. Week: -5. Day: -5.
 
11:47 PM
@SimonForsberg Are you good at fixing merge conflicts?
 
quite good, yes
 
how do you toString in python?
    my_text = driver.find_element_by_id("stockphoto_attribution")
    print "Result: " + my_text # TypeError: cannot concatenate 'str' and 'WebElement' objects
Got it print "Result: " + my_text.text
However, now my only problem is that there's no text to print :D
Which that basically seems to tell me that there is nothing in the element, but rather that the displayed text is something different (and attribute maybe?)
Ah I bet it's the value attribute
 
> Easiest way to hang the program: `+[>+<]`

Make the Brainfuck runner run in a separate thread, to avoid blocking the UI thread, also include a stop button.
 
00:00 - 19:0019:00 - 00:00

« first day (400 days earlier)      last day (3148 days later) »