FAQ Database Discussion Community


How to extract hashtags (or other Arrays) from Twitter Tweets in Apache Spark

json,twitter,apache-spark,apache-spark-sql,arraybuffer
I am trying to do analysis on Twitter Tweet data with Apache Spark from a file of JSON Tweet objects. Here's how I'm loading it in with Spark's jsonFile method: val sqc = new org.apache.spark.sql.SQLContext(sc) val tweets = sqc.jsonFile("stored_tweets/*.json") tweets.registerTempTable("tweets") Next, I sample only the hashtag entities with the following...

preparing and sending binary data to javascript for webgl

javascript,c#,asp.net-mvc,arraybuffer
I have a very long list of points (lat/long) in my C# program and I need to pass it to my webgl code. I have done it before using json but I thought I could reduce the bandwidth if I sent the data in binary format. Based on my research,...

Store typed array in ArrayBuffer

javascript,endianness,arraybuffer,typed-arrays
I have an ArrayBuffer of data which is composed of Uint8s. Each is in network byte order (big-endian). My goal is to convert each Uint8 into little-endian order, but then put them back in the ArrayBuffer. I know I can easily separate the individual Uints by using a typed array,...

Scala which data structure is most efficient for my intended operations?

scala,arraybuffer,listbuffer
I am running a dynamic programming function where I carry a list of strings throughout the process. Over time, I append new strings to the end of this list, and occasionally I may remove the last element. Right now I am currently using a mutable ListBuffer, doing += for the...

Output a Uint8ClampedArray buffer as a stream of bytes

javascript,phantomjs,arraybuffer
In a PhantomJS script, I have a Uint8ClampedArray (image data from a HTML canvas) that I would like to output to stdout as a byte stream. In Node.js I would do: buf = new Buffer(...); process.stdout.write(buf); How would I go about doing the same thing in PhantomJS? I can't just...

Create HTML canvas from Ajax Arraybuffer response type

javascript,ajax,canvas,arraybuffer,putimagedata
I am doing a Ajax call to Server for a Jpeg file. I have the data returned as Array buffer. Now how can I render this Array buffer on the canvas. Now please dont suggest any answer like setting the source url to the image. I want to hold the...

Slice ArrayBuffer with Safari and play it

safari,web-audio,arraybuffer
I need to load a mp3, slice and play it using web audio , on firefox a slice mp3 any where and decode work fine, but on safari an error with null value occurs. Exist a trick or a way do slice the ArrayBuffer on Safari? player.loadMp3 = function(url, callback)...

Javascript: Sending arrayBuffer using XMLHttpRequest

javascript,xmlhttprequest,multipartform-data,arraybuffer
I want to send a multipart form using XMLHttpRequest. The file I want to attach is a jpg file. Appending the file to the FormData object works fine. But I'd like to process the image file before sending it. Therefore I have a library that takes a Uint8Array as input...