geolocation.bindTo() is not defined - geolocation

I was following this guide. It executes normally when you visit the site but when I try to run it from my localhost it gives me the geolocation.bindTo() an error undefined. I read about it being the geolocation object is not yet created or the method executes asynchronously as far as i read here.
Here is the link:
https://openlayersbook.github.io/ch10-openlayers-goes-mobile/example-02.html
this is basically tracking the location of the user using openlayers 3 with openstreetmaps.

bindTo is depracted with ol.dom.Input. Use "propertychange" and other listeners.

Looks like bindTo was removed. Refer to this post: https://github.com/openlayers/ol3/pull/3472

Related

STRIPE integration

I'm using the REST Debugger as a first try at working with the stripe API. I can login and perform some basic creation and listing tasks.
When creating a customer the (postal) address elements are described as parameters that are of type 'dictionary'. The docs (https://stripe.com/docs/api/customers/create) refers to them as 'child parameters' with a notation address.line1, address.city etc. I'm lost as to what this means in terms of a Delphi friendly syntax. Anyone got any clues to move me forward? Many thanks
I took a look at the PHP client sources, and I found that the parameters were flattened with a key[subkey] scheme before being sent. So you should use the following parameter names for the address:
address[line1]
address[city]
address[country]
...

How to access a reddit post using redditkit in ruby?

I have a reddit post link here:
https://www.reddit.com/r/dankmemes/comments/6m5k0o/teehee/
I wish to access the data of this post throught the redditkit API.
http://www.rubydoc.info/gems/redditkit/
I have tried countless times and the docs don't make too much sense to me. Can someone help show how to do this through the ruby console? Or even an implementation of this in rails would be really helpful!
Looking at the #comment method on the gem, it takes a comment_full_name and performs a GET to api/info.json with that parameter as an id (seen by viewing the source for that method). If we look at the reddit api for api/info the id parameter is a full name for the object with a link to what a full name is.
Following that link, a full name for a comment is
Fullnames start with the type prefix for the object's type, followed by the thing's unique ID in base 36.
and
type prefixes
t1_ Comment
So now we know the comment_full_name should be t1_#{comment's unique id} which appears to be 6m5k0o. Here, I'm unsure if that's already base36 or if they want you to convert that into base36 before passing it. Without seeing what all you've tried, I would say
client = RedditKit::Client.new 'username', 'password'
client.comment("t1_6m5k0o")
and if that doesn't work
client.comment("t1_#{'6m5k0o' base36 encoded}")
For questions like this, it would be nice to see some of your code and what you tried/results they gave. For all I know, you've already tried this and have a reason it didn't work for you.
I would test this out for you, but I don't have a reddit account for the gem to sign in with, this is just my guess glancing at the documentation.

Hubot display url as link in Slack

I'm using hubot with the hubot-slack adapter.
I have a very long url that I'd like to write to the chatroom, and would like to display it as a link.
From this:
http://magnum-ci.oak.domain.com:8080/job/nick_test_success_build/44/console
To this:
Click here to view the console out
I'm using:
res.send "http://magnum-ci.oak.domain.com:8080/job/nick_test_success_build/44/console|link"
I haven't tried this recently with Hubot, but note that it doesn't work as a user.
Slack's docs make it look like you can use "labels" to display friendly URL names. See the last example on this page https://api.slack.com/docs/unfurling
You may be able to send the text
<http://mylink.com|Show this>
in a message and get the desired results.
I tried this a long time ago and don't remember if it worked.
#mshish is right, <http://mylink.com|Show this> should be the way to go.
You can test the output of your link using the Message Builder.
Unfortunately it looks like this is not currently supported by the hubot.
https://github.com/slackhq/hubot-slack/issues/114

Unable to post Attask custom data when creating a project

Trying to use the Attask API to post a new issue to a project. It works without posting cutom data. This works fine:
https://ourcompany.attask-ondemand.com/attask/api/task?projectID=&&status=NEW&priority=2&name=Test%20Project%20FOOBAR&description=test&estCompletionDate=2014-03-28T09:00:00:000-0700
However, I'm unable to post custom data. The url we use:
https://ourcompany.attask-ondemand.com/attask/api/task?projectID=&&status=NEW&priority=2&name=Test%20Project%20FOOBAR&description=test&estCompletionDate=2014-03-28T09:00:00:000-0700&DE%3ACUSTOMDATAFIELD=BLAH
The error we receive is:
{"error":{"class":"com.attask.common.InvalidParameterException","message":"category cannot be null","title":null,"msgKey":"exception.attask","attributes":[""],"code":0}}
I do not understand what it is asking. The Attask API documentation is not helpful here. What am I missing in my URL?
Thank you!
You need to also set the categoryID to the category which has the custom data field.
https://ourcompany.attask-ondemand.com/attask/api/task?projectID=&&status=NEW&priority=2&name=Test%20Project%20FOOBAR&description=test&estCompletionDate=2014-03-28T09:00:00:000-0700&DE%3ACUSTOMDATAFIELD=BLAH&categoryID=XXXX
This is also assuming that you are doing a POST action.

Passing state when using decorators (formencode) in pylons

I've met the same problem as this page:
http://www.mail-archive.com/pylons-discuss#googlegroups.com/msg14292.html
This is the main content from there:
I am using formencode to validate my
forms, and I've stumbled upon a
problem. When using tha validator
inside the controller action, I call
to_python() and I can pass the state
variable with any information I need
to the validators. Is it possible to
do the same with the validate
decorator?
From the answers of there, they said it has not been fixed in pylons, but that was several months agao. I wanna if there any solutions for it now?
pylons.decorators.validate(schema=None, validators=None, form=None, variable_decode=False, dict_char='.', list_char='-', post_only=True, state=None, on_get=False, **htmlfill_kwargs)
Note the state parameter. Full docs here (Pylons 1.0)

Resources