Displaying 20 results from an estimated 22 matches for "tojson".
Did you mean:
to_json
2010 Dec 11
2
toJSON question
Hello,
I am trying to use RJSONIO
I have:
x <- c(0,4,8,9)
y <- c(3,8,5,13)
z <- cbind(x,y)
Any idea how to convert z into the JSON format below?
I want to get the following JSON output to put into a php file.
[[0, 3], [4, 8], [8, 5], [9, 13]]
Thank you.
2007 Jun 14
4
How to convert a table to JSON (or to Javascript array)
Is there a way to retrieve an HTML table in javascript and convert it
to JSON using prototype?
I''m stumped :(
phil
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To
2020 May 12
1
Segfault on read.socket with long message
...w the information about how to join the
bugzilla site was not available at bugzilla and buried in the CRAN web
site instructions on reporting bugs (which pointed me at Bugzilla and
not the page you showed me).
The example is pretty minimal.? I left the tracing statements
(flog.trace()) and the toJSON, fromJSON in as I thought they might
provide some context for another method of approaching my problem.
It looks like I'm getting better results using socketConnection() rather
than read.socket(), so I'll pursue that solution (but still file a bug
report, as it seg faults are never good...
2020 May 11
2
Segfault on read.socket with long message
...r()
repeat {
inlen <- read.socket(sock,loop=TRUE)
flog.trace("Got message of length %s",inlen)
if (inlen=="quit") break
inmess <- fromJSON(read.socket(sock,as.integer(inlen)),false)
outmess <- doProcess(inmess)
output <- toJSON(outmess)
flog.trace("Sending message of length %s",nchar(output))
write.socket(sock,paste(nchar(output),"\n"))
write.socket(sock,output)
}
}
}
doProcess() is the payload, but it is not getting that far. Instead I get:
> listenerloop(12525)
TRA...
2006 Apr 25
2
JRS problem
Hi all,
I''m playing with the new RJS stuff. Very cool!
But I have a problem. The following code works ok:
page.select(''div.blogcomment'').each do |element|
page.visual_effect :highlight, element
end
All div''s with class blogcomment are highlighted correctly. But I just
want the last elemen to be hightlighted. The following code is not
working:
2009 Jan 19
1
pass ruby array to javascript function
Im wondering how to go about passing a ruby array to a javascript
function. I was able to do this the other way around and pass a
javascript array to an action using JSON and convert it back to a ruby
array:
Object.toJSON(<%= array_or_string_for_javascript(@array) %>
then in the action I was able to do:
ruby_array = JSON.parse(params[:array])
But this time I want to pass an array to a javascript function through
a function call within :update
render :update do |page|
page << "s...
2016 Jan 14
2
JDataFrame API
...#39;s a partial example which demonstrates what the API looks like:
String result = new JDataFrameBuilder()
.addColumn("Code", new Object[] {"WV", "VA", })
.addColumn("Description", new Object[] {"West Virginia", "Virginia"})
.toJson();
and in R script we would need to do this:
temp <- RJSONIO::fromJSON(json)
tempDF <- as.data.frame(temp)
which yields a data frame that looks like this:
> tempDF
Description Code
1 West Virginia WV
2 Virginia VA
It is my intention to deploy this project to Maven Central...
2009 Jul 05
2
JSON data not decoded in Rails
...Javacript:
<a href="#" onclick=''send();return false;''>click</a>
<script>
function send() {
var send_data_url = "/pages/change";
var json_parameters = $H({name: ''Violet'', occupation: ''character'', age:
25 }).toJSON();
new Ajax.Request(send_data_url, {
method: ''post'',
parameters: json_parameters,
contentType: ''application/json;''
});
}
Rails:
def change()
debugger
my_json = ActiveSupport::JSON.decode(params["_json"])
render :text => my_json
end
I'&...
2016 Jan 15
2
JDataFrame API
...s what the API looks like:
>>
>> String result = new JDataFrameBuilder()
>> .addColumn("Code", new Object[] {"WV", "VA", })
>> .addColumn("Description", new Object[] {"West Virginia", "Virginia"})
>> .toJson();
>>
>> and in R script we would need to do this:
>>
>> temp <- RJSONIO::fromJSON(json)
>> tempDF <- as.data.frame(temp)
>>
>> which yields a data frame that looks like this:
>>
>>> tempDF
>> Description Code
>> 1 West V...
2016 Jan 15
0
JDataFrame API
...e which demonstrates what the API looks like:
>
> String result = new JDataFrameBuilder()
> .addColumn("Code", new Object[] {"WV", "VA", })
> .addColumn("Description", new Object[] {"West Virginia", "Virginia"})
> .toJson();
>
> and in R script we would need to do this:
>
> temp <- RJSONIO::fromJSON(json)
> tempDF <- as.data.frame(temp)
>
> which yields a data frame that looks like this:
>
>> tempDF
> Description Code
> 1 West Virginia WV
> 2 Virginia VA
&...
2020 May 12
0
Segfault on read.socket with long message
...???? inlen <- read.socket(sock,loop=TRUE)
> ????? flog.trace("Got message of length %s",inlen)
> ????? if (inlen=="quit") break
> ????? inmess <- fromJSON(read.socket(sock,as.integer(inlen)),false)
> ????? outmess <- doProcess(inmess)
> ????? output <- toJSON(outmess)
> ????? flog.trace("Sending message of length %s",nchar(output))
> ????? write.socket(sock,paste(nchar(output),"\n"))
> ????? write.socket(sock,output)
> ??? }
> ? }
> }
>
> doProcess() is the payload, but it is not getting that far. Instead I
&...
2007 Jul 19
0
ASP.NET AJAX Web Services and Prototype Version 1.5.1.1
...changes:
Replace this at line 1047:
this.body = this.method == ''post'' ? (this.options.postBody ||
params) : null;
this.transport.send(this.body);
With this:
if (this.options.contentType.indexOf(''json'') >= 0) {
this.transport.send(Hash.toJSON(this.options.postBody));
} else {
this.body = this.method == ''post'' ? (this.options.postBody ||
params) : null;
this.transport.send(this.body);
}
Replace this at line 1145:
evalJSON: function() {
try {
var json = this.getHeader(''X-JSON...
2007 Sep 21
1
Weird data from evalJSON
...) { return this.inject([], (function (array, value,
index) {if (0 == index || (sorted ? array.last() != value : !
array.include(value))) {array.push(value);}return array;})); }
function () { return [].concat(this); }
function () { var results = []; this.each((function (object) {var
value = Object.toJSON(object);if (value !== undefined)
{results.push(value);}})); return "[" + results.join(", ") + "]"; }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" gr...
2012 Dec 11
2
Writing escaped unicode
I'd like to write unicode strings using the "\u" escape syntax. According to the documentation, print.default or encodeString will escape unicode using the \u convention. In practice, I can't make it work.
> b="Unicode character: \ufffd"
> print.default(b)
[1] "Unicode character: ?"
> encodeString(b)
[1] "Unicode character: ?"
I want to
2011 Nov 05
2
install.packages problem
...de_Mutex.o JSONStream.o
JSONValidator.o JSONWorker.o JSONWriter.o JSON_Base64.o JSON_parser.o
RJSON.o internalJSONNode.o libjson.o rlibjson.o -L/usr/lib/R/lib -lR
installing to /home/eric/R/i486-pc-linux-gnu-library/2.13/RJSONIO/libs
** R
** inst
** preparing package for lazy loading
in method for ?toJSON? with signature ?"AsIs"?: no definition for class
"AsIs"
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded
* DONE (RJSONIO)
ERROR: dependency ?RCurl? is not available for package ?rdatamarket?
* removing ?/home/eri...
2016 Jan 15
0
JDataFrame API
...ks like:
>>>
>>> String result = new JDataFrameBuilder()
>>> .addColumn("Code", new Object[] {"WV", "VA", })
>>> .addColumn("Description", new Object[] {"West Virginia", "Virginia"})
>>> .toJson();
>>>
>>> and in R script we would need to do this:
>>>
>>> temp <- RJSONIO::fromJSON(json)
>>> tempDF <- as.data.frame(temp)
>>>
>>> which yields a data frame that looks like this:
>>>
>>>> tempDF
>&g...
2008 Jan 17
4
JSON query problems
I am constructing a JSON object that is an array of products. Using a
select box, I want to find the object in the array that has an ID that
matches the value from the selectedIndex of the select box and return
the price.
Here is the JSON script:
var products = [{''ID'': 16378, ''Cost'': 100.00},{''ID'': 16377,''Cost'':
2007 Apr 28
6
RESTful web service tutorial?
Hi,
I would like to turn some of our simulation codes
out to pasture and string some of them together
by draping them in web services.
I''m looking for a RESTful Camping tutorial to get
started ... pointers appreciated.
Some simple example applications:
airfoil force calculator: feed it an airfoil
geometry, an angle of attack, and a Mach number,
and it returns the lift, drag, and
2007 Jul 10
6
Having trouble using data returned by Ajax.request
Hello everyone, I''m new here.
I''ve been working with prototype and plotr for about a month now, off
and on, and I have pretty much hit the wall on using the data returned
by Ajax.Request.
I''m using some php code to return a string:
{''foo'': [[0,0.0865334429075127], [1,0.0828179861705063],
[2,0.0828173042602942], [3,0.0841707718624196]]}
But I keep
2012 Jun 19
0
Error with RJSONIO installation
...JSON" no definition for
class: “AsIs”
Warning in matchSignature(signature, fdef, where) :
in the method signature for function "isValidJSON" no definition for
class: “connection”
Error in conformMethod(signature, mnames, fnames, f, fdef, definition) :
In method for function "toJSON": formal arguments omitted in the method
definition cannot be in the signature (.escapeEscapes = "NA")
Error : unable to load R code in package 'RJSONIO'
ERROR: lazy loading failed for package ‘RJSONIO’
* removing ‘/usr/local/lib/R/site-library/RJSONIO’
The downloaded packag...