rubycas-server response - ruby-on-rails-3

This is the data that I get back from the rubycas server.
{
"cn"=>"--- - Toby Joiner",
"sn"=>"--- - Joiner",
"mail"=>"--- - tobyjoiner#xxxxxx.xxx",
"memberof"=>"---
- CN=All Users,OU=AllUsers,DC=bnw,DC=local
- CN=Administrators,CN=Builtin,DC=bnw,DC=local
- CN=Remote Desktop Users,CN=Builtin,DC=bnw,DC=local",
"givenname"=>"--- - Toby"
}
I am wondering if there is a way I am supposed pull this data out, right now I am doing:
first_name = session[:cas_extra_attributes][:sn].gsub('-','')
to remove the dashes. I am hoping I am just missing the built in way to get the extra data out from the rubycas server.

That looks like YAML escaped data. You should be able to get rid of it by first parsing it through YAML.load and then processing it as you wish.
As a small aside, I've personally re-implemented the basic functions of rubycas-server as a Rails engine called cassy. However, I don't think it supports sending through extra attributes at the moment.
I just thought I'd mention it as it gives you an alternative to try if rubycas-server doesn't work out.

Related

How to add medianet with Prebid and Google Ad Manager

I am implementing Prebid.js. I am trying to work with Medianet. I keep getting an error response from the Medianet server: {"ext":{"nbr":"server_err_cfg"}}.
Support from Media.net hasn't responded yet. Any ideas on what can be the best solution to this? Also, do I need to have hb_pb for the key value in DFP (Google Ad Manager) or do I need to setup the line items with hb_pbmedianet?
Thanks.
You don't need separate key values for medianet (hb_pbmedianet) unless you are using sendAllBids configuration with Prebid.
Sounds like the IDs you are passing to the Media.net adapter are incorrect.
I would check them again again and be sure you are passing the right parameters to the ad unit. According to the Medianet docs, you need a cid and crid, both strings. Make sure these are 100% correct.

Is there way to select only id from parentReference

Request
GET /drive/root/children?select=name,size,parentReference
returns, for parentReference, for example,
"parentReference:{
"driveId":"3e2dd398785a81d",
"id":"3E2DD398785A81D!103",
"path":"/drive/root:"
}
Is there way that parentReference in reponse contains only id:
"parentReference:{
"id":"3E2DD398785A81D!103",
}
Ideally you should be able to ?select=name,size,parentReference/id but that currently doesn't work (it'll behave like ?select=name,size,parentReference). We aim to fix that at some point though, and so you're more than welcome to use the former syntax and it should start working when we fix it. Until then you'll just get back some extra things you don't actually care about.

How to fix TypeError: transform(...) is null

Another individual said this error is generally caused by "a widget template that is referencing a property via ${...} that doesn't actually exist in the widget."
I've researched and can't seem to find a way to resolve this error. Any advice or leads to help solve this issue? How do you FIND this bit of code to correct the issue?
Got some assistance from SitePen.
Here's the trace Stack -
**string.substitute/<()string.js (line 147) string.substitute()string.js
(line 141) ._updatePaginationStatus()Pagination.js (line 395)
.gotoPage/
return transform(value, key).toString();
instrum...tion.js (line 20)**
The Pagination was failing - potentially trying to pull data before it was actually there.
"Code is trying to do a string.substitute call, but the transformation you're trying to do isn't valid. It looks like the Pagination extension is failing on this. Given the number of steps related to Deferreds, it looks like something is trying to parse data before that data is available. For example, you have an async call, but are treating the data synchronously.
That said, when using the Pagination extension, I think you use the normal Grid rather than the OnDemandGrid."
I switched from OnDemandGrid to Grid - left pagination. Error still there. Switched back to OnDemandGrid - eliminated Pagination. Error Gone.
Also found this little note that I had overlooked in documentation: "Note that the Pagination extension is incompatible with OnDemandGrid, since each has its own way of dealing with collection ranges. Pagination should be mixed into Grid, not OnDemandGrid."
http://dgrid.io/tutorials/0.4/grids_and_stores/
thankyousitepen

Whats wrong with Neo4j 2.0 Query?

I am trying to understand why the data is not showing up in my query. I was wondering if there is any way to troubleshoot whats going on.
Here is the current issue:
I have populated some data from existing test database to check the performance with a relation like this : (e:Event)-[:FOR_USER]->(u:User) when I get all the users and look at the property, I can see the data, but when I query the users using same data it says 0 records found.
Below image shows the 2 query:
Can some one please help me understand how to debug such issue in neo4j
EDIT
Issue is that the Browser is somehow truncating the multiple spaces in the result. Like in this case "User-May<space>1 2013 1:18AM" was displayed on both webadmin and new browser, but in reality it should have been "User-May<space><space>1 2013<space><space>1:18AM"
So no matter what I do I can't query the value as looks like duplicate space is truncated somewhere.
Tabular data as Micheal suggested is as below
{"id":"75307","labels":["User"],"properties":{"Name":"User-May 1 2013 1:18AM"}}
and what we are seeing is User-May 1 2013 1:18AM
Regards
Kiran
Use the following Cypher syntax in the browser:
MATCH (user:User { Name: "User-May 1 2013 1:18AM" })
RETURN user.Name as Name
As far as the rendering of multiple spaces being trimmed, that is a browser specific functionality. See screenshot below for example:
The text itself is preserved as it is returned from the Neo4j server. As you can see when I analyze the HTML element of the browser using Firebug, the redundant spaces are indeed there.
So again, this doesn't seem to be a bug with Neo4j, it's how the browser you are using renders the text. The browser expects redundant spaces to be encoded as like so: "Testing testing" which is HTML encoded as Testing testing

Preventing YQL from URL encoding a key

I am wondering if it is possible to prevent YQL from URL encoding a key for a datatable?
Example:
The current guardian API works with IDs like this:
item_id = "environment/2010/oct/29/biodiversity-talks-ministers-nagoya-strategy"
The problem with these IDs is that they contain slashes (/) and these characters should not be URL encoded in the API call but instead stay as they are.
So If I now have this query
SELECT * FROM guardian.content.item WHERE item_id='environment/2010/oct/29/biodiversity-talks-ministers-nagoya-strategy'
while using the following url defintion in my datatable
<url>http://content.guardianapis.com/{item_id}</url>
then this results in this API call
http://content.guardianapis.com/environment%2F2010%2Foct%2F29%2Fbiodiversity-talks-ministers-nagoya-strategy?format=xml&order-by=newest&show-fields=all
Instead the guardian API expects the call to look like this:
http://content.guardianapis.com/environment/2010/oct/29/biodiversity-talks-ministers-nagoya-strategy?format=xml&order-by=newest&show-fields=all
So the problem is really just that the / characters gets encoded as %2F which I don't want to happen in this case.
Any ideas on how this can be achieved?
You can also check the full datatable I am using:
http://github.com/spier/yql-tables/blob/master/guardian/guardian.content.item.xml
The URI-template expansions in YQL (e.g. {item_id}) only follow the version 3 spec. With version 4 it would be possible to simply (only slightly) change the expansion to do what you want, but alas not currently with YQL.
So, a solution. You could bring a very, very basic <execute> block into play: one which adds the item_id value to the path as needed.
<execute><![CDATA[
response.object = request.path(item_id).get().response;
]]></execute>
Finally, see the diff against your table (with a few other, minor tweaks to allow the above to work).