Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a2642dfced8aee28

Jump to content

Wikipedia:Reference desk/Archives/Computing/2016 January 12

From Wikipedia, the free encyclopedia
Computing desk
< January 11 << Dec | January | Feb >> January 13 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


January 12

[edit]

BFS MATLAB

[edit]

hello, I am an Israeli student for ‏‎Information System Engineering‎‏, and I have a question in matlab. I have to change this code in order to suit it for any size (any n*n)

 Preceding unsigned comment added by 132.73.205.93 (talk) 09:51, 12 January 2016 (UTC)reply

Hello. What is your question? (I have formatted and collapsed your code.) -- ToE 13:08, 12 January 2016 (UTC)reply

I have to change this code for suit it to any N*N size instead of 5*5. 132.73.202.96 (talk) 13:30, 12 January 2016 (UTC)reply

That is understandable. What is the problem? Do you know how to variable-length array or vector? 199.15.144.250 (talk) 14:00, 12 January 2016 (UTC)reply
No. I don't know.132.72.232.249 (talk) 14:17, 12 January 2016 (UTC)reply
It is rather simple. Assume I used a=[] to create an empty vector. I want to add a value of 7 to it. I use a=[a ; 7];. That resets a to be equal to a with 7 shoved onto the end. I can add 3 to it with a=[a ; 3];. Now my vector holds 7 in the first index and 3 in the second index. Once you've filled the vector, you can loop over it just as you did with your fixed arrays. 199.15.144.250 (talk) 15:40, 12 January 2016 (UTC)reply
Right, but the declaration of obstacles will also have to be refactored a bit. OP will have to do something to deal with turning 5 definitions into N many. I would probably declare N at the start, then load in the obstacle input from another file into a correctly sized array within the algorithm. The algorithm can be adapted to arbitrary N, but only if the N inputs are known in advance. SemanticMantis (talk) 15:19, 13 January 2016 (UTC)reply

null-environment in R5RS Scheme

[edit]

I'm confused about the difference between null-environment and scheme-report-environment in R5RS. I thought that (scheme-report-environment 5) basically returned the same environment that a program sees at startup (before any define), and that (null-environment 5) returned an environment in which only the syntax was defined, but not plain functions (per Null-environment returns a specifier for an environment that is empty except for the (syntactic) bindings for all syntactic keywords defined in this report from R5RS). But:

> (eval display (null-environment 5))
==> #<procedure:mdisplay>

in Racket/R5RS, and likewise

> (eval display (null-environment 5))
$1 = #<procedure display (_ #:optional _)>

in Guile, i.e. both of the languages return environments with bindings for the standard function. Can somebody enlighten me? Thanks! --Stephan Schulz (talk) 18:17, 12 January 2016 (UTC)reply

Sorry - got it! Of course it has to be
 > (eval 'display (null-environment 5))
...otherwise the variable gets evaluated in the outer environment before it ever gets into the eval. --Stephan Schulz (talk)
[edit]

Can users who buy a software license "sublet" the software? That is, offer it as a subscription service? --Bickeyboard (talk) 19:52, 12 January 2016 (UTC)reply

It depends on the license. If the license says you cannot rent the software, you can't. If it says you can, you can. For example, Microsoft licenses do not allow renting except when they specifically state that you can as in this MS announcement. 199.15.144.250 (talk) 20:15, 12 January 2016 (UTC)reply
  • The question is also if the law allows them to curtail the liberty of the buyers in such way. Copyright holders might try to restrict the use of their products. There was a similar case concerning CDs/DVDs. I know that the United States Supreme Court had to decide whether CDs/DVDs can be re-sold. Basically, the question is if the buyers are owners somehow, and of what. --Bickeyboard (talk) 21:43, 12 January 2016 (UTC)reply
If you are talking about commercial software (and not some variant of open source) I'm fairly certain that it would be safe to assume the answer is NO in almost all cases. Vespine (talk) 20:39, 12 January 2016 (UTC)reply
OK, but I go to an Internet café where they have several programs installed, including MS Office, many games, Photoshop and other stuff. I am just paying £1 per hour. Am I renting the software? Or just paying for the internet connection + hardware use? Obviously, many people go there for the software. --Bickeyboard (talk) 21:39, 12 January 2016 (UTC)reply
I'm a programmer, and I have some interest in copyright, especially in the digital realm. Your observation is astute. In a sense, I guess you could say you are "renting" the software, although this term isn't actually used in the law and contracts. It's usually only called "renting" when talking about tangible property. Places like computer cafes have to purchase site licenses for proprietary software. The licenses set out what they're allowed to do with the software, and they can be audited to ensure they're complying with the license. "Personal" software licenses that you get with "personal" editions of software usually don't allow you to do things like charge people for using the software. Go and read a license agreement for some big proprietary software package like Microsoft Office to get an idea of all the restrictions. Purely from a financial perspective, part of the money you pay is going towards the licensing fees of all the software. Of course we're assuming everyone's doing things legally. In less-developed countries with lax legal systems it's often the case that most computer cafes and similar places just ignore copyrights, but in countries with a stronger rule of law it's harder to get away with. --71.119.131.184 (talk) 23:09, 12 January 2016 (UTC)reply
"Commercial software" and "open source" are not mutually exclusive. --71.119.131.184 (talk) 23:09, 12 January 2016 (UTC)reply
That's true, however most "commercial" open source software does not make money selling software licenses, which is what the OP was asking about. Vespine (talk) 01:55, 13 January 2016 (UTC)reply
A license can be tied to a specific single user, to an organization, or to a machine. They can also limit the number of copies that run simultaneously or limit the use, forcing a no-commercial-use policy, or only for educational purposes. Combinations among these models exist. Each licensing agreement is different. Renting hardware with a legal version of the software installed seems to be a different legal question. Indeed, this seems to be a question that generates long legal battles, if it became an issue between providers and consumers. Scicurious (talk) 00:33, 13 January 2016 (UTC)reply

It seems to me that this question is asking for legal advice, in which case we are not allowed to answer it here. In any case the answer may well vary according to what country we are talking about. --76.69.45.64 (talk) 21:38, 13 January 2016 (UTC)reply