how to update stored data from url? - yql

After creating a record in yql's hosted storage using the following:
insert into yql.storage.admin (url) values ("http://hostingdomain.com/mytable.xml")
how can I update that record from a url ?
The documentation only shows:
update yql.storage set value="new value" where name="store://3cc85a99-6a89-4600-ade1-f7f83ecc4b83"
but this requires you to input the value directly instead of fetching it from a url.

For those who might be interested, I found the answer:
update yql.storage set url="[url]" where name="store://[updatename]"

Related

SQL Server report's saved URL as bookmark not working

I have report deployed on a SQL Server Reporting server. It has one multivalue parameter called 'Names' as a input for stored procedure which fetch data to display the result. In URL, I am adding all values selected for multivalue parameter are concatenating with '&' character.
I need to store this URL for further uses as a bookmark in my browser which is also working fine. Problem occurs when over a time one of the values for that parameter gets missing from the database then report comes blank.
Some points I would like to clear here:
Stored procedure is working fine even if some values are missing.
I could figure out that this might be because of that value is not present in the dropdown of 'Names' so it is unable to assign it before running the stored procedure. As a solution to this problem I tried to hide this parameter from report by clearing prompt box for 'Names', but I now get
The ''Names'' parameter is missing a value
When you upload the report (.rdl) into reporting server, make sure "Name" parameter has a default value, this way the stored procedure is able to get the default value even if the link is missing the "Name" parameter

Can we do simultaneous multiple operations in Redis like a Stored Procedure

I have a User's information which I have stored in a Hash. I have his permission information stored in a Set.
I want to test for a condition on the Set, retrieve the Key and then fetch the actual Value using the retrieved Key from the Hash.
How can I do this?
Do I have to use Lua scripting to achieve the above goal or is there any other way?
You'll have to do it using multiple requests in that case. While Lua appears to be the way, your requirements - namely fetch a key based on the value of another key - rule out a single script since key names should be passed explicitly.
I had the same requirement and I couldn't find any other way to do this. Redis pipeline and transaction functions are other tools to execute multiple commands in single step but for your situation where you want to get a value and execute a command based on it, the only way remains is LUA!!
you can use a hash to handle user information and his permissions (in the same hash). In this case, when you have a userId you can retrieve the permissions with one shot by using userId and permissionKey. See example below, I put the permissions as string (in your case put it as Set):
redis> HSET userId permissionKey "perm1, perm2, perm3"
redis> HGET userId permissionKey
"perm1, perm2, perm3"
Hope this help you.

Split datetime value received from external API in Rails app

I have a datetime value which comes from the API in this format: 2015-07-07T17:30:00+00:00. I simply want to split it up between the date and time values at this point. I am not using an Active Record model and I prefer not to use an sql database if I can.
The way I have set up the app means that the value is "stored" like this in my view: #search.dining_date_and_time
I have tried two approaches to solving this problem:
Manually based on this previous stackoverflow question from 2012: Using multiple input fields for one attribute - but the error I get is the attribute is "nil" even though I put a "try"
Using this gem, https://github.com/ccallebs/split_date_time which is a bit more recent and seems to be a more elegant solution, but after closely following the doc, I get this error, saying my Search model is not initalized and there is no method: undefined method dining_date' for #<Search not initialized>
This is when instead I put #search.dining_date in the view, which seems to be the equivalent of the doc's example (its not that clear). The doc also says the method will be automatically generated.
Do I need to alter my model so I receive the data from the API in another way? ie. not get the variable back as #search.dining_date_and_time from the Search model for any of this to work?
Do I need an Active Record model so that before_filter or before_save logic works - so i can (re)concatenate after splitting so the data is sent back to the API in a format it understands. Can I avoid this - it seems a bit of overkill to restructure the whole app and put in a full database just so I can split and join date/time as needed.
Happy to provide further details, code snippets if required.
As I am not using a conventional Rails DB like MySql Lite or Postgresql, I found that the best solution to the problem was by using this jQuery date Format plugin: https://github.com/phstc/jquery-dateFormat to split the date and time values for display when I get the data back from the API.
The Github docs were not too expansive, but once I put the simply put the library file in my Rails javascript assets folder, I just had to write a few lines of jQuery to get the result and format I wanted:
$(function() {
var rawDateTime = $('#searchDiningDateTime').html();
// console.log(rawDateTime);
var cleanDate = $.format.date(rawDateTime, "ddd, dd/MM/yyyy");
// console.log(cleanDate);
$('#searchDiningDateTime').html(cleanDate);
var cleanTime = $.format.date(rawDateTime, "HH:mm");
// console.log(cleanTime);
$('#searchTime').html(cleanTime);
});
Next challenge: rejoin the values on submit, so the API can read the data by sending/receiving a valid request/response. (The values can't be split like this when sent to the remote service).

Why posting new BuiltFileObject clears array of BuiltFileObject from built app? Did i miss anything?

I am fetching BuiltClass from my built app through SDK and I get list of built file objects in it like e.g: List<BuiltFileObject>
Below listed properties I get from BuiltFileObject:
app_user_object_uid, content_type,file_size,filename, tags[], uid ,url
Now if I upload any file then I get same BuiltFileObject with all properties and I inserted that file object in List<BuiltFileObject> and saved BuiltClass. But in response I don't get list of BuiltFile Objects.
Am I missing anything in save call?
You need to save the upload before your save your BuiltClass. See the documentation for Uploads.

Get value setted in GM_setValue from a custom Firefox extension

Do you know if a custom Firefox extension can read values setted calling GM_setValue() from a GraseMonkey user script?
These values exists in about:config, (enter "greasemonkey" in the filter).
Perhaps there exists an easier way to get them, though...
Since Greasemonkey 1.13 GM_setValue() uses an SQLite db to persist values.
This DB can be accessed directly (see https://github.com/greasemonkey/greasemonkey/blob/master/modules/miscapis.js).

Resources