« first day (42 days earlier)      last day (2766 days later) » 

12:40 AM
@Manish Works perfectly.
Hey, either @Manish or @Undo : where's the code in the repo for the top-bar site switching thingy?
 
1:19 AM
@hichris in base.php in one of the functions - I think NavBar()
(I'm in Internet land for the night)
 
@Undo Wow, step up!
Trying to figure out why switching sites adds a %27 onto the URL.
 
1:59 AM
@Manish It's letting me flag comments on posts that have been deleted.
 
 
1 hour later…
3:02 AM
@ManishEarth We need to somehow get you pull capability on main.
Maybe a PHP script that takes a key in the URL or something?
(pulled)
@hichris123 You can actually do that from the UI if you can see deleted posts.
 
@Undo I don't have 10K.
 
I know.
So you just got another privilege - 'flag comments on deleted posts if they show up in Charcoal'
gtg
 
3:25 AM
back
 
@Undo Hola
 
Hola!
 
Nice privilege I got there.
 
Hehe
 
Hurry, add it to the page.
 
3:27 AM
@hichris123 Which page?
 
/privileges
 
We could pester Shog to add it to the privs page, but the chances of that happening are somewhere between 0 and 0
 
Divide by 0 then.
 
Ok
 
4:26 AM
@ManishEarth moved your code thingy to a bootstrap modal
 
 
2 hours later…
6:15 AM
@Undo Nice idea. I had planned to figure out how to do something along those lines earlier, but didn't think of modal then
@Undo yeah, /pull.php?password=manishisaveryawesomeguy or something :P
@hichris123 the mods are gonna be angry for that :P
@hichris123 yay! no bugs! woooooooo
 
 
7 hours later…
1:08 PM
@Undo: That JSON.parse line.. WTF?
{fkey: StackExchange.options.user.fkey, otherText: ''}
100% less crappy!
 
 
3 hours later…
3:56 PM
@ThiefMaster Me no write that. @Manish write that :P
 
Indian programmers.... STEREOTYPE MET ONCE AGAIN! :D
 
Hehe
 
4:15 PM
@ManishEarth sent you an email with your pull.php key on main ;)
gtg
 
5:02 PM
@ThiefMaster Ah, there are issues with javascript objects in the Chrome Console. However, they work fine in multiline code I think so I probably can fix that
So...JSON.parse :P
@Undo I like the key :P
 
5:43 PM
@Manish The bug still is there with the site-switching. It's because a %27is added to the URL.
 
6:12 PM
@hichris123 seems to be an issue with the site switcher and not the commentcollector thingy. I'll have a look
 
@Manish I was looking through the code, but didn't find anything that might be the problem. You may have better luck, though. :)
 
@hichris123 probably an errant space
figured it out
 
Was it a space?
 
Sometime you or @Undo will have to let me commit to it.
 
6:16 PM
fixed
@hichris123 Feel free to pull request and spam issues in the meantime
commit access is Undo's decision :)
 
@Manish You know I will. :)
Is it auto-pulled to the website?
Or does Undo have to do a manual git-pull?
@Manish How can I pull the latest version of the repo into my fork I made a week or so ago?
I guess I just pull request on my repo. Weird.
@Undo It's pretty bad when I've memorized my Charcoal password.
 
6:53 PM
@hichris123 I have a way to make it git pull
3 hours ago, by Undo
@ManishEarth sent you an email with your pull.php key on main ;)
 
Ah.
 
1
Q: "SyntaxError: Unexpected token :" when inputting { "a": "", "b": "" } json in console

morgancodesI'm getting errors, in both chrome and firefox developer tools, when trying to evaluate the following: { "a": "", "b": "" } jsonlint.com tells me it's valid. Putting this code in an actual javascript file and running it works fine. The strangeness shows up only when I run this in the c...

@ThiefMaster however, this only occurs when it's not part of something bigger, so fixable
I've just grown a habit of not typing JSON directly into the console and instead typing with a parse. I knew that I had to remove the parse in the code eventually, but I kept it there for testing purposes (because if I modify the code sometimes chrome throws errors again) and forgot to fix it.
 
hmm at least in the title of that question there are typographic quotes which are most likely not considered quotes at all in js
 
7:10 PM
@ThiefMaster No, try {a:1,b:2} in the console
 
ugh
hm actually, i think it's the same thing in JS
you cannot put an object literal outside an expression
(that's also the reason why eval-based json parsers always wrap the json string in parentheses)
 
@ThiefMaster possibly
But the chrome console quirks on this in complicated expressions too
Never got the hang of it so I just JSON parse it till I finish coding, after which I bake in the unparsed one
(I fixed the one in charcoal)
 
7:46 PM
@Manish Do you know how to do the POST for the SE API in Java?
 
should be a normal post request, no?
 
@Manish I'm confused about where to put in the OAuth key/access token.
 
@hichris123 in a data param of the post
 
Do I just do accesstoken="myaccesstoken"?
 
yeah, in the url parameters
 
7:50 PM
Thanks.
@Manish Oh, and one more thing: is this the base URL, and the rest in the parameters "http://api.stackexchange.com"?
 
http://api.stackexchange.com/2.1/name-of-endpoint?....
 
Oh, that makes more sense. Thanks.
Hmm...
@Manish Any reason you can think of that I would be getting a 400 from this?
		    	String urlParameters = "key=oBhIoUA)i7UXiHOFqgMaPw((&site=stackoverflow&accesstoken=rr3C3fUFG55gg1S777k7rg))";
		    	String request = "http://api.stackexchange.com/2.2/questions/"+id+"/flags/options?";
		    	URL url = new URL(request);
		    	HttpURLConnection connection = (HttpURLConnection) url.openConnection();
		    	connection.setDoOutput(true);
		    	connection.setDoInput(true);
		    	connection.setInstanceFollowRedirects(false);
		    	connection.setRequestMethod("POST");
		    	connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
 
dunno
never used java httpurlconnections
 
And that's why I have a love/hate relationship with coding.
 
8:18 PM
you're just using the wrong language :P
 
@ThiefMaster And what do you suggest I use? hopes it's not Obj-C
 
python! (but i don't develop mobile apps, so i can choose among more languages ;))
 
Well, maybe I should use python. I do know some python...
 
docs.python-requests.org/en/latest - HTTP, "how to do it with pretty/readable code"
 
@ThiefMaster yes! exactly!
 
8:22 PM
Creating a new PyDev project now. :)
 
pydev? really?
Use PyCharm!
 
Nah, I can deal with Eclipse for now.
Too lazy to install another IDE.
 
@ThiefMaster I have not yet used a python ide; I just directly code in geany/nano/vim/gedit :P
want to try out idle though
 
I also didn't use python IDEs before, but pycharm is awesome
IDLE? i'd rather stay with gvim in that case
 
@ThiefMaster only ide that i remember :P
ooh, pycharm has django support. yay
 
8:27 PM
It's not that much of an IDE. More like a text editor with a few python things on top
And it has a great default theme (both UI and code highlighting)
 
@ThiefMaster idle or pycharm?
 
the latter of course
 
ah
I don't mind text editoryness, I've never really used IDEs much except for UIs so something similar to a text editor is fine. A good debugger is a bonus
 
Thanks for the library, @ThiefMaster
 
8:57 PM
@ThiefMaster In the Requests library, do you know how to encase a _ in the parameters so that it's a _ and you don't get UnicodeEncodeError: 'charmap' codec can't encode character '\u2666' in position 33: character maps to <undefined>?
 
use a proper underscore
_ is not u2666
>>> print u'\u2666'
♦
 
@ThiefMaster Then how can I get a proper underscore?
 
@ThiefMaster diamonds!
 
type it on your keyboard?
(dunno what key it is on the US Keyboard)
 
@ThiefMaster That's what I did, it's >> payload = {'access_token':
 
9:02 PM
weird, that looks perfectly fine
 
And if I take the _ out, it give me {"error_name":"access_token_required","error_message":"This method requires an access_token","error_id":401}
Oh, nevermind.
Figured out what's the problem.
@ThiefMaster In the response, it doesn't know how to parse the "Flag for ♦ mod"
 
Can you show the code + error traceback in a pastebin?
 
@ThiefMaster Why?
 
Because it's annoying to debug code without seeing it? :)
 
@hichris123 use an entity
 
9:14 PM
I think I can get it to decode it differently. Give me a sec, and if it doesn't work, I'll post it.
 
.decode('utf-8')
but I'd expect requests to decode it automatically if the server specifies an encoding
 
I'd think so to, but isn't.
Oh, and the traceback @ThiefMaster
 
r.encoding = 'UTF_8'
did you try without that line
 
Yeah, but default encoding is utf-8
Same error without.
 
hm maybe the response isn't valid utf-8?
 
9:22 PM
Response should be something like this:
 
print repr(r.content)
 
{
  "items": [
    {
      "title": "other (needs ♦ moderator attention)",
      "description": "This question needs a moderator's attention. Please describe exactly what's wrong.",
      "dialog_title": "I am flagging this question because",
      "option_id": 24731,
      "requires_comment": true,
      "requires_site": false,
      "requires_question_id": false
    }
  ],
  "quota_remaining": 9988,
  "quota_max": 10000,
  "has_more": false
}
@ThiefMaster Works if you do it like that.
 
Look at the backslash-escaped chars in that string.
anyway, you probably want r.json() since the response is JSON..
 
Thanks, @ThiefMaster
 

« first day (42 days earlier)      last day (2766 days later) »