Search Results

Search found 753 results on 31 pages for 'mathematica frontend'.

Page 3/31 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Import and Export for CSV are both broken in Mathematica

    - by dreeves
    Consider the following 2 by 2 array: x = {{"a b c", "1,2,3"}, {"i \"comma-heart\" you", "i \",heart\" u, too"}} If we Export that to CSV and then Import it again we don't get the same thing back: Import[Export["tmp.csv", d]] Looking at tmp.csv it's clear that the Export didn't work, since the quotes are not escaped properly. According to the RFC which I presume is summarized correctly on Wikipedia's entry on CSV, the right way to export the above array is as follows: a b c, "1,2,3" "i ""heart"" you", "i "",heart"" u, too" Importing the above does not yield the original array either. So Import is broken as well. I've reported these bugs to [email protected] but I'm wondering if others have workarounds in the meantime. One workaround is to just use TSV instead of CSV. I tested the above with TSV and it seems to work (even with tabs embedded in the entries of the array).

    Read the article

  • Named arguments in Mathematica.

    - by dreeves
    What's the best/canonical way to define a function with optional named arguments? To make it concrete, let's create a function foo with named arguments a, b, and c, which default to 1, 2, and 3, respectively. For comparison, here's a version of foo with positional arguments: foo[a_:1, b_:2, c_:3] := bar[a,b,c] Here is sample input and output for the named-arguments version of foo: foo[] --> bar[1,2,3] foo[b->7] --> bar[1,7,3] foo[a->6, b->7, c->8] --> bar[6,7,8] It should of course also be easy to have positional arguments before the named arguments.

    Read the article

  • Combining graphs in Mathematica

    - by pizziaolo
    Any idea how I can overlay the following two functions to compare them? ln[1]:= p1 = Plot[(E^((Pi/6)^(1/3)/x) (Pi/6)^(2/3))/((-1 + E^((Pi/6)^(1/3)/x))^2 x^2), {x, -2.2, 2.2}] ln[2]:= p2 = Plot[(E^((Pi/6)^(1/3)/t) (Pi/6)^(2/3))/((-1 + E^((Pi/6)^(1/3)/t))^2 t^2), {t, 0, 2.0}] When I try Show[p1,p2] it doesn't work

    Read the article

  • How to solve recursion relations in mathematica efficiently?

    - by Qiang Li
    I have a recursion to solve for. f(m,n)=Sum[f[m - 1, n - 1 - i] + f[m - 3, n - 5 - i], {i, 2, n - 2*m + 2}] + f[m - 1, n - 3] + f[m - 3, n - 7] f(0,n)=1, f(1,n)=n However, the following mma code is very inefficient f[m_, n_] := Module[{}, If[m < 0, Return[0];]; If[m == 0, Return[1];]; If[m == 1, Return[n];]; Return[Sum[f[m - 1, n - 1 - i] + f[m - 3, n - 5 - i], {i, 2, n - 2*m + 2}] + f[m - 1, n - 3] + f[m - 3, n - 7]];] It takes unbearably long to compute f[40,20]. Could anyone please suggest an efficient way of doing this? Many thanks!

    Read the article

  • ForEach loop in Mathematica.

    - by dreeves
    I'd like something like this: ForEach[i_, {1,2,3}, Print[i] ] Or, more generally, to destructure arbitrary stuff in the list you're looping over, like: ForEach[{i_, j_}, {{1,10}, {2,20}, {3,30}}, Print[i*j] ] (Meta-question: is that a good way to call a ForEach loop, with the first argument a pattern like that?) ADDED: Some answerers have rightly pointed out that usually you want to use Map or other purely functional constructs and eschew a non-functional programming style where you use side effects. I agree! But here's an example where I think this ForEach construct is supremely useful: Say I have a list of options (rules) that pair symbols with expressions, like attrVals = {a -> 7, b -> 8, c -> 9} Now I want to make a hash table where I do the obvious mapping of those symbols to those numbers. I don't think there's a cleaner way to do that than ForEach[a_ -> v_, attrVals, h[a] = v] ADDED: I just realized that to do ForEach properly, it should support Break[] and Continue[]. I'm not sure how to implement that. Perhaps it will need to somehow be implemented in terms of For, While, or Do since those are the only loop constructs that support Break[] and Continue[]. If anyone interested in this wants to ask about that as a separate question, please do!

    Read the article

  • how to use sort function the same way as max or min in mathematica

    - by Qiang Li
    Please take a look at the following code: Sort[{1, y, x}, Greater] Max[{1, x, y}] x = 1 y = 2 Sort[{1, y, x}, Greater] Max[{1, x, y}] It is interesting to note that the first Sort always produce a definite result while the first Max does not, even when Greater is specified. Note I have not given any numerical values for x and y. Why is this and how can I have a Sort function behave the same way as the Max (or Min) function? Thanks!

    Read the article

  • Conditional Counting in Mathematica

    - by 500
    Considering the following list : dalist = {{1, a, 1}, {2, s, 0}, {1, d, 0}, {2, f, 0}, {1, g, 1}} I would like to count the number of times a certain value in the first column takes a certain value in column 3. So in this example my desired output would be: {{1,1,2}, {1,0,1}, {2,1,0}, {2,0,2}} Where the latest sublist {2,0,2} being read as: When the value is 2 in the first column, a corresponding value (same row in matrices world) in column 3 of 0 is present twice. I hope this is not to confusing. I added the second Column to convey the fact that the columns are distant to each other. If possible, no reordering should happen. EDIT : {1,2,3,4,5} {1,0} are the exact values taken by the columns I am actually dealing with in my data. I know I am missing the correct description. Please edit if you can and know it. Thank you

    Read the article

  • Two quick Mathematica questions

    - by sciguy
    How do I remove the numbers on the x-axis only not the y-axis? Is it possible to shift the y-axis without shifting the functions? What I mean is, instead of having the y-axis at x = 0, could I have it at x = -5?

    Read the article

  • How to use MythBuntu to send TV signal to a 2nd frontend

    - by Mark Preston
    I guess the a MythTV or MythBuntu backend acts as a "server" for the frontends. I have MythBuntu installed. It runs fine, I can tune live TV, hear the sound, etc. To get this to work, I had to config the Wired Network IP4V settings to Method: Link-Local Only. The Local Backend IP address is: 127.0.0.1 and the info (bottom of screen) says that if there is another frontend, that this IP add. must be changed. 1 - Does this mean changed to the IP address of the 2nd frontend? 2 - What "Method" do I use to make 2 or more frontends? 3 - I have an ethernet switch which currently "sees" the tv signal, sends it to the computer's ethernet port where Mythbuntu makes use of it. 4 - How do I set up the Myth to send it's output (the tv shows) to both televisions? If you know of a How-To, or website, please give the URL or identifying keywords.

    Read the article

  • Changing from Frontend Development to .Net

    - by Ivo
    On of my colleagues is going to change jobs from full time frontend developer(jquery, css,html) to 50% frontend 50% .Net (MVC 3 with razor) What are good techniques to get him up to speed asap. I have the following idea's myself Read Clean Code Read/Pratice with the book Pro ASP.NET MVC 3 Framework Watch Asp.net video's http://www.asp.net/mvc/videos Do the nerd dinner intro http://www.asp.net/mvc/videos Start building the json services from jQuery 0.5/1 day of pair programming with an experienced .Net developer each week Is this a good way to go? Is it totally wrong? Any other tips

    Read the article

  • Frontend development, where to start?

    - by glitch
    I've been stuck on the backend for years now, working on webservices, DBs, SDKs, APIs and all that jazz, and so that's an area that I have a decent grasp of, but I've absolutely no clue about how the frontend works. What's a good place to start for a backend monkey like me who wants to learn the best practices, latest technologies and the philosophy behind modern web page design and its interaction with the server? I want to be cool like all of the other javascript kids. Thanks!

    Read the article

  • How do I get Mathematica to thread a 2-variable function over two lists, using functional programmin

    - by Leah Wrenn Berman
    Lets say I have a function f[x_, y_], and two lists l1, l2. I'd like to evaluate f[x,y] where x runs over the list l1 and y runs over the list l2, and I'd like to do it without having to make all pairs of the form {l1[[i]],l2[[j]]}. (Motivation: I'm trying to implement some basic Haskell programs in Mathematica. In particular, I'd like to be able to code the Haskell program isMatroid::[[Int]]->Bool isMatroid b =and[or[sort(union(xs\\[x])[y]'elem'b|y<-ys]|xs<-b,ys<-b, xs<-x] I think I can do the rest of it, if I can figure out the original question, but I'd like the code to be Haskell-like. Any suggestions for implementing Haskell-like code in Mathematica would be appreciated.)

    Read the article

  • Why is process not being displayed by TOP

    - by drN
    I am running a Mathematica script (this question probably doesn't fit in Mathematica.SE however) and I know that it generally takes up a lot of RAM and loads up my cores. However, althought pgrep MathKernel is showing a pid, I find that top doesn't show this in the top processes, although I notice that it is taking up about 2.25GB of the 8GB available to me. pmap -x my_process_id total kB 2243132 1907404 1892108 AND ps aux | grep MathKernel dnaneet 20837 12.6 23.3 2234944 1907404 pts/1 Sl 09:23 8:01 /share/apps/mathematica/8.0.4/SystemFiles/Kernel/Binaries/Linux-x86-64/MathKernel -runfirst $TopDirectory="/share/apps/mathematica/8.0.4" -script ./dcm_10micrometer_2x -- ./dcm_10micrometer_2x ps aux shows that the process is taking about 12% (In asterisks) dnaneet 20601 0.0 0.0 68264 1660 pts/1 Ss 09:15 0:00 -bash **dnaneet 20837 12.2 23.3 2234944 1907404 pts/1 Sl 09:23 8:01 /share/apps/mat** dnaneet 21922 0.0 0.0 65604 948 pts/1 R+ 10:29 0:00 ps -aux Did this process fail and is the MathKernel just lingering?

    Read the article

  • Mathematica Plot3D does not produce a plot when graphing a user-defined function?

    - by pythonscript
    I'm writing a simple Mathematica implementation of the black-scholes model and using Plot3D to plot the pricing surface. However, when I run this code, no plot is produced. My call and put functions to produce correct values when run separately, but no plot is produced. Code: Clear[d1, d2, call, put, stockPrice, strikePrice, riskFreeRate, timeToExp, volatility] d1[stockPrice_, strikePrice_, riskFreeRate_, timeToExp_, volatility_] := (Log[stockPrice / strikePrice] + (riskFreeRate + 0.5*volatility^2)*timeToExp) / (volatility * Sqrt[timeToExp]) d2[stockPrice_, strikePrice_, riskFreeRate_, timeToExp_, volatility_] := d1[stockPrice, strikePrice, riskFreeRate, timeToExp, volatility] - volatility*Sqrt[timeToExp] call[stockPrice_, strikePrice_, riskFreeRate_, timeToExp_, volatility_] := stockPrice * CDF[NormalDistribution[0, 1], d1[stockPrice, strikePrice, riskFreeRate, timeToExp, volatility]] - strikePrice * Exp[-riskFreeRate*timeToExp] *CDF[NormalDistribution[0, 1], d2[stockPrice, strikePrice, riskFreeRate, timeToExp, volatility]] Plot3D[call[stockPrice, 500, 0.0030, timeToExp, 0.39], {stockPrice, 10, 1000}, {timetoExp, 0.0833333, 5}] Other plots, like this sample from the reference, do work. Plot3D[{x^2 + y^2, -x^2 - y^2}, {x, -2, 2}, {y, -2, 2}, RegionFunction -> Function[{x, y, z}, x^2 + y^2 <= 4], BoxRatios -> Automatic]

    Read the article

  • Mathematica quickie: About making cells Input cells by default.

    - by andrz
    I'm going through some lecture notes, Fundamentals of Mathematica Programming (see the .nb file there). I'd like to be able to do the exercises right there in the notebook; but for some reason I can't figure out how to make the default cell an Input cell. In other words, when I'm clicking in that notebook to create a new cell--in the exercises--the cell is by default a text cell. I'd like for it to be an Input cell so that I don't have to manually change it each time. Ideas?

    Read the article

  • Distinction between API and frontend-backend

    - by Jason
    I'm trying to write a "standard" business web site. By "standard", I mean this site runs the usual HTML5, CSS and Javascript for the front-end, a back-end (to process stuff), and runs MySQL for the database. It's a basic CRUD site: the front-end just makes pretty whatever the database has in store; the backend writes to the database whatever the user enters and does some processing. Just like most sites out there. In creating my Github repositories to begin coding, I've realized I don't understand the distinction between the front-end back-end, and the API. Another way of phrasing my question is: where does the API come into this picture? I'm going to list some more details and then questions I have - hopefully this gives you guys a better idea of what my actual question is, because I'm so confused that I don't know the specific question to ask. Some more details: I'd like to try the Model-View-Controller pattern. I don't know if this changes the question/answer. The API will be RESTful I'd like my back-end to use my own API instead of allowing the back-end to cheat and call special queries. I think this style is more consistent. My questions: Does the front-end call the back-end which calls the API? Or does the front-end just call the API instead of calling the back-end? Does the back-end just execute an API and the API returns control to the back-end (where the back-end acts as the ultimate controller, delegating tasks)? Long and detailed answers explaining the role of the API alongside the front-end back-end are encouraged. If the answer depends on the model of programming (models other than the Model-View-Controller pattern), please describe these other ways of thinking of the API. Thanks. I'm very confused.

    Read the article

  • Changing frontend cache

    - by Utsav
    Our architecture consists of a front-end cache that most read only users obtain their data from directly. The front-end cache sits in front of a farm of webservers that serve pages written in PHP. We need to be able to detect certain conditions at the front-end cache level and pass those values through to the back-end via HTTP headers. For example we would like to manually tag the carrier network based on the IP address. So, for incoming traffic if the user is say coming from an IP address in the range of "41.202.192.0"/19 we would tag them as being a Orange Cameroon user by setting the appropriate HTTP request header, e.g., X-Carrier = "Orange Cameroon". Based on the setting of this header we would like to vary the cache and serve a different banner to the end user. How would you go about doing this? Keep in mind that we don't want to pollute the cache and we also don't want to create too many small cache segments. Assumptions: You can assume that the X-Carrier has already been detected in our cache. So, for the purposes of your test you can just set this value manually in your example script.

    Read the article

  • What Conferences would you recommend for a UI / Frontend Web Developer in the next 6 months?

    - by rsturim
    Hello, I'm looking for a strong conference(s) to attend in the next 6 months. I may be able to attend one or two. I'm looking for something surrounding Frontend Web Development -- web standards, CSS3, html5, javascript, UX, and usability are strong interests of mine. I'm also starting to consider diving deep into designing for Mobile devices. I've discovered these 2 conferences so far -- they look very good -- but am I missing anything HUGE and/or obvious? An Event Apart - Wash DC (http://aneventapart.com/2010/dc/) Web Directions North - Altanta (http://north.webdirections.org/) Thoughts?

    Read the article

  • Separating admin and frontend sessions in magento

    - by Hugues ALARY
    Hello, Is it possible to have two different memcached server to separate admin sessions of the frontend sessions in magento ? It is actually possible to separate sessions and file cache, but it applies on both admin and frontend, which dissallow to clear, for example, only admin sessions. If you want to clear admin sessions, you have to clear all sessions : admin and frontend. Thanks, Hugues.

    Read the article

  • Best Hardware for a server attached to LCD TV displaying a Flash frontend

    - by DomingoSL
    Hello, i need a recomendation on what hardware (PC) to buy in order to achieve this task: I have a webserver (WAMP) running in my laptop, this server has a webapp who can manage information from a user. In a few words, a user enter in my webserver and a php script ask gim for a mensage who get store in a MYSql database, in other hand, inside the same PC there is a flash running with a frontend who take this mensages and shows it. My english is bad, maybe this diagram may help you: http://img689.imageshack.us/img689/2371/diagramav.png Well i want to connect the pc who runs all (Webserver, MySQL server, Flash front end) to a LCD TV in order to create something like an information spot that will be on almost all day (sometimes all day). Do you recomend to have the webserver and the frontend in the same pc? or to separate in two? What hardware do you recomend? i mean, type of pc, with fans or no, please cheap solutions but good. Thanks for your help.

    Read the article

  • Best Hardware for a server attached to LCD TV displaying a Flash frontend

    - by Domingo
    Hello, i need a recomendation on what hardware (PC) to buy in order to achieve this task: I have a webserver (WAMP) running in my laptop, this server has a webapp who can manage information from a user. In a few words, a user enter in my webserver and a php script ask gim for a mensage who get store in a MYSql database, in other hand, inside the same PC there is a flash running with a frontend who take this mensages and shows it. My english is bad, maybe this diagram may help you: Well i want to connect the pc who runs all (Webserver, MySQL server, Flash front end) to a LCD TV in order to create something like an information spot that will be on almost all day (sometimes all day). Do you recomend to have the webserver and the frontend in the same pc? or to separate in two? What hardware do you recomend? i mean, type of pc, with fans or no, please cheap solutions but good. Thanks for your help.

    Read the article

  • joomla: editing the mvc package for joomla component development

    - by PROFESSOR
    hi! i m new to joomla component development i hv just downloaded bunch of files from some jooomla mvc generater website.which llok like smthng like this hello.xml - frontend/index.html - frontend/hello.php - frontend/controller.php - frontend/models/index.html - frontend/models/hello.php - frontend/views/index.html - frontend/views/hello/index.html - frontend/views/hello/view.html.php - frontend/views/hello/metadata.xml - frontend/views/hello/tmpl/index.html - frontend/views/hello/tmpl/default.php - frontend/views/hello/tmpl/default.xml - frontend/assets/index.html - frontend/assets/images/index.html - backend/index.html - backend/admin.hello.php - backend/controller.php - backend/CHANGELOG.php - backend/views/index.html - backend/views/hello/index.html - backend/views/hello/view.html.php - backend/views/hello/tmpl/index.html - backend/views/hello/tmpl/default.php - backend/models/index.html - backend/models/hello.php - backend/assets/index.html - backend/assets/images/index.html - languages-front/en-GB/en-GB.com_hello.ini - languages-admin/en-GB/en-GB.com_hello.ini MVC Generator version 1.0.5 but dont know how to edit and where to edit those files pls help i m trying to make my only php based application to a joomla component

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >