Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now
36

I am not sure, if one can separate one curve out of the image. There is, however, another possibility to do what you want. It is possible to get the curve points out of the image. I am not sure, if I have already published here this answer. I checked but did not find it. Hence, I am publishing it. The task is fulfilled by a copyCurve function first described ...


27

In the comments mfvonh correctly points out that the Wikimapia's URL in my question is a user interface URL, not a tile server URL. The tile server link template is documented in a message which appears when one sends incorrect request to the tile server: From the above it is clear that the StringTemplate should be as follows: StringTemplate["http://i<*...


26

Certainly. There have indeed been some changes to certain tags in the 2.1 API and also to the method to sort out how many pages to import. And, since we are now a full site under StackExchange, the server has changed and a site parameter was necessary. I did a bit of clean-up, hardened the code a little to accommodate connection failures, made the basic ...


25

Yes it is possible, but it is not natively supported. Therefore, the way through ImageCapture will not work here. Nevertheless, no one prevents you to use a library like opencv to access the webcam. With a MathLink wrapper you can write a routine to catch frames from the cam and transfer them as Image to Mathematica. When opencv is initialized and has ...


23

This small app allows you to select data points and put them in a bin. In that way you can manually select several curves. I imagine this might be useful to someone who has complex plots where lines might intersect, making it hard or impossible to extract the data programmatically. You first have to set the image at the first line. After that when you want ...


23

Here's a set of functions that allows to do this. The code uses many ideas found on this site and on other places on the web. It is a bit factorized already so it should be easily reusable. More on YQL and available tables here: https://developer.yahoo.com/yql https://github.com/yql Query test Edit: this API is great also and simple http://www.quandl.com/...


23

There is a neat application called Tasker, which allows for the automation of scripts (tasks) on the android phone, triggered by events, time or phone state changes. In this example, we'll simulate the "It's just metadata" approach by capturing some phone variables and pushing the values into the new DataDrop Universal accumulator via the web api. ...


22

To turn the camera off you could use the undocumented function IMAQ`StopCamera[]. Similarly IMAQ`StartCamera[] will turn it back on again. Alternatively you can use the On/Off button on the control interface returned by ImageCapture[]:


22

Mathematica can Import your file, and the result is a handy set of graphical primitives. So in this particular case we can do all the steps needed for data extraction without leaving Mathematica. I will not do the whole work for you but show the correct approach to the problem. First, you Import the file and check in what form the curves of interest are ...


19

Let's invent some data. The pulse rate will be 50 pulseRate = 50; sampleRate = 1000; data = Range[0, 1, 1/sampleRate] /. t_ :> Sin[2. Pi pulseRate t] + 8 Sinc[Pi t 2.]^2 // # + RandomReal[0.3 {-1, 1}, Length@#] &; ListLinePlot[data, DataRange -> {0, 200}, PlotRange -> Full] Plotting Fourier already shows it will be easy to extract the ...


19

The graphics we want are on page 50, but there are six prefatory pages labelled i through vi. So we will start by loading page 56 into memory: $url = "http://ediss.sub.uni-hamburg.de/volltexte/2004/1133/pdf/dissertation.pdf"; $page50 = Import[$url, {"Pages", 56}] // First We used First because importing PDF "Pages" returns of list of pages, in this case ...


18

Doing this with basic image processing can be done. In comparison to the post you have linked, your situation is more complicated because you have a monochrome image with no option to separate colors. Additionally, your graph is surrounded by a frame. Let's assume we want to separate not the line but the area under or over the line that is inside the frame. ...


17

this code produces the three lists of data that you want orange,blue and green s = Import["https://i.stack.imgur.com/bR8Gg.gif"]; t = ImageData@s; h = Union@Flatten[t, 1]; p = FindClusters@h; F[x_] := (# - {20, 29}) {3/350, 3/100} & /@ Select[Flatten[PixelValuePositions[s, RGBColor[#]] & /@ p[[x]], 1], #[[1]] > 20 && #[[2]] > 29 &...


16

Comment This was originally answered on Oct 2, 2012 using V8. The performance can be dramatically improved using V9's URLFetchAsynchronous, as now shown below. Fortunately, we needn't download all the tiles at once. We can use Dynamic to set up a little pan-and-zoom explorer. The first load takes a bit and zooming out takes a bit. Panning and zooming ...


13

Mathematica 10 has support for a serial device which greatly simplifies things. I am capturing byte data from an XBEE on a usb card being sent from an arduino with an XBEE transmitter. In Mathematica the only commands needed to plot 200 points on a Mac are... port = "/dev/tty.usbserial-DA00X00E" dev = DeviceOpen["Serial", {port, "BaudRate" -> 9600}] ...


13

The airport utility on your mac (which is not very widely known) gives you programmatic access to all your wireless information. I wrote a fun answer on Ask Different using this command line utility. To get the information about wireless devices around you, use the -s flag. Here's a simple function to automate it: getSSID[] := With[{data = Import["!/System/...


12

I was finally able to connect to the serial port by using the package SerialIO created by Rob Raguet-Schofield found here http://library.wolfram.com/infocenter/Demos/5726/ and then following the instructions and testing the Arduino program that William Turkel posted in his blog. http://williamjturkel.net/2011/12/25/connecting-arduino-to-mathematica-on-mac-...


12

Another way is to make use of the second argument of Dynamic. When given as a list of two functions, the first element of the second argument will be evaluated when the mouse is dragged, and the second one at the moment that the mouse is released, so in this case the the final value of the slider will be added to dataList. pt = {1, 1}; dataList = {pt}; ...


12

Alternatively, you may use LocatorAutoCreate, which adds the oportunity of adding, moving and removing points "a piaccere": DynamicModule[{pts = {{-1, 1}/2, {1, 1}/2}}, Column[{LocatorPane[Dynamic[pts], Framed@Graphics[{}], LocatorAutoCreate -> All], Dynamic@pts}]] Usage sample: i = Import@ "http://worldmapsonline.com/images/OutlineMaps/Flags/...


12

I wrote code for data acquisition with the Adafruit 10-DOF sensor a while back. I will share that code, with explanation, so that you can adapt it yourself. Mathematica + Adafruit == TRUE It's awesome and easy to connect to an Arduino with Mathematica: Open a connection to Arduino and specify the paths to the Adafruit libraries (I put the library folders ...


11

This is a job for EventHandler: EventHandler[ Slider2D[Dynamic[{x, y}], {{0, 0}, {5, 8}, {1, 2}}], {"MouseUp" :> AppendTo[datalist, {x, y}]}, PassEventsDown -> True ] Follow the data acquisition with a Dynamic: Dynamic[datalist] {{1,1},{3,4},{2,2},{2,4}} PassEventsDown -> True is necessary to prevent EventHandler from eating up the ...


11

If this device support NI-VISA (as I understood from your reference to LabVIEW), then you can use following way: Install the VISA engine (available at National Instruments' web-site) Use the following code. Needs["NETLink`"] lib = LoadCOMTypeLibrary[ "C:\\Program Files (x86)\\IVI \Foundation\\VISA\\VisaCom\\GlobMgr.dll"] mgr = NETNew["Ivi.Visa.Interop....


11

Here's something to get you started down to path of scraping the somewhat larger individual pictures from the Nobel website: links = Import[ "https://www.nobelprize.org/nobel_prizes/physics/laureates/index.html?images=yes", "Hyperlinks"]; individualpagelinks = Select[ links, StringMatchQ[ "https://www.nobelprize.org/nobel_prizes/physics/...


10

This appears to be working: Do[tab = RandomReal[{0, 1}, 10]; PutAppend[tab, "test123.csv"], {5}] ReadList["test123.csv", Expression] You may also wish to look at WriteString which will allow for complete control of what is written. In a comment Ajasja makes an excellent point regarding performance. If your application is anything like the dummy above, ...


10

I recently discovered SocketLink bundled with Mathematica. It's not documented, but super straightforward: << "SocketLink`" port = 1234; s = CreateClientSocket["host", port] {inputStream, outputStream} = OpenSocketStreams[s]; This returns a binary InputStream and OutputStream that you can read/write like any other Mathematica stream with BinaryRead ...


10

Here is my sample code using JLink. It's not a foolproof code, but if someone know haw to do better, please let me know. The following code let Mathematica connect with T3Open Trading Software (Italian Broker WeBank), it expose some api that you can call with tcp socket. In this example I'm going to pass a list of options code (Terna Call) and take the ask/...


9

Since Mathematica 10 it's possible to pull data from Google Analytics using ServiceConnect and ServiceExecute. I refer you to the documentation for all the details, but here is a small sample. Establish a connection: ga = ServiceConnect["GoogleAnalytics"] Get the number of visitors and the number of sessions over the last ten days: req1 = ServiceExecute[...


9

If the problem is only to remove the grid, that's relatively easy. You just remove everything but the grid, then take the difference. You can use Closing with a rectangular structuring element to remove everything but the horizontal / vertical grid lines, like this: img = Import["http://i.stack.imgur.com/TkvSR.png"]; hFilter = Closing[img, BoxMatrix[{...


9

You have misunderstood how this works. What happens is that JavaScript calls a server-side script which returns the data, and the data is subsequently inserted into the HTML. The data cannot be found in the HTML document (in the HTML or in the JavaScript) to begin with. The most straightforward way to get the data is to monitor the network and observe what ...


8

You're looking for Skip. This does not check for an EndOfFile condition, and should use something like BlockStream to handle aborts, but the following should work: strm = OpenRead["filename"]; (* Repeat the following until done *) Skip[strm, String, A]; AppendTo[ results, Read[strm, String]] (* String just gets the entire line. If the number of ...


Only top voted, non community-wiki answers of a minimum length are eligible