Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Simple Prng

Name: Anonymous 2014-05-13 1:00


// uses/requires a seed between 0 & 1
// returns values in range -1 to +1
function randout = sprng(n, seed, offset = 10)
randout = sin( ([1:n] .+ (offset + seed)) .^ 2.0 );
endfunction;

Name: Anonymous 2014-05-13 9:57

>>1

.+ .^
Welcome to ML! Enjoy your brain damage.

Name: Anonymous 2014-05-13 10:23

I thought it was matlab for a sec there.

Name: Anonymous 2014-05-13 10:45

looks like matlab except for the comments

Name: Anonymous 2014-05-13 11:01

stronger entropy source sha1sum <( curl "4chan.org/b" )

Name: Anonymous 2014-05-13 11:12

looks like some GNU Octave spin-off.

Name: Anonymous 2014-05-13 11:15

>>4

A lot of bad Matlab clones were produced. Some use //-comments, other having ML-style (i.e. broken) typing.

for example, http://en.wikipedia.org/wiki/Scilab

Name: Anonymous 2014-05-13 12:41

Scilab render formulas in mathematical notation using its own Java-based rendering engine, JLaTeXMath, a fork of the JMathTeX project.
What the hell is this abomination?

Name: Anonymous 2014-05-13 12:44

>>8

enterprise quality turnkey solution

Name: Anonymous 2014-05-13 13:13

>>1
What is [1:n]?

Name: Anonymous 2014-05-13 13:18

>>10
Array from 1 to n with increments of one. I actually like matlab's syntax

Name: Anonymous 2014-05-13 15:59

>>11
It actually is a piece of shit. Go back to old /prog/, Luke.

Name: not 11 2014-05-13 16:23

How so? I haven't touched matlab in years but it seemed a fairly good language, at least for its domain.

Name: Anonymous 2014-05-13 16:54

>>13
Matlab is like jew pussy: it's ok.

Name: Anonymous 2014-05-13 18:59

I AM DA WICKEDLY WONDROUS WIZARD OF MATLAB. WITH FORTEEN DEGREEZ IN COMPOTER SCIENCE AND WRITING KODE IN SKEE MEE, AT THE END OF THE DAY I'M THE ONLY WAY.

GONE! GONE! GONE! ARE THE DAYS OF DEFNUBZ AND SKILLNUBS.

GONE! GONE! GONE! ARE THE DAYS WHEN VITALYZD WAS BOOM HEDSHOTTING ON COUNTERSTRIKE WITH THE REST OF US CONFUSED COWARDS.

Now look in the mirror and ask if your body is that of a female.

Name: Anonymous 2014-05-13 22:32

>>13
Its domain is making programming easier for retarded engineers who barely took programming 101.

Indices start at 1, retarded slicing syntax, everything is a matrix, most computations are numeric, shitty interfaces for people who actually know programming, It's a huge hack pulled out the ass of an electrical engineer.

If you want decent mathematical software that's able to do good symbolic manipulation, is homoiconic and doesn't suck as much Matlab/Scilab/Octave, try Mathematica.

Name: Anonymous 2014-05-13 22:36

A good mathematical language is R

Name: Anonymous 2014-05-13 23:07

R is shit too. Stop fooling yourself.

Engineers, scientists and mathematicians can't program for shit.

Name: Anonymous 2014-05-13 23:34

>>16
Mathematica is as worthless as lisp
MATLAB has real utility and not to mention the only IDE worth using.
It's innate ability to deal with matrices is exactly iys strong point. It makes real world simulations a snap. I rarely use MATLAB but for what it does, it does better than anything else.

In the real world, no one cares about your symbolic bullshit, we care about numerical methods

Name: Anonymous 2014-05-13 23:57

>>16
Indices should start at 1 though.

Name: Anonymous 2014-05-14 0:33

>>19
Mathematica is as worthless as lisp
http://mathematica.stackexchange.com/questions/8438/minimal-effort-method-for-integrating-c-functions-into-mathematica
http://mathematica.stackexchange.com/questions/8507/artistic-image-vectorization
http://mathematica.stackexchange.com/questions/5676/how-to-peel-the-labels-from-marmalade-jars-using-mathematica
http://mathematica.stackexchange.com/questions/11819/help-find-a-bright-object-on-mars
Useless indeed.

It's innate ability to deal with matrices is exactly iys strong point.
Being good at something doesn't mean that something should be your default data type. For instance, being good at manipulating floats doesn't mean you should store every single number as a float, no matter what the best representation for that number is. Mathematica won't choke in a bag of nigger cocks if you tell it to do matrix operations.

Having a matrix based language makes abstraction unnecessarily harder, for you are required to be careful with the dimensions of the matrices being manipulated instead of thinking in terms of function composition.

Since numerical methods are its main strength, you're fucked if you ever need something like an indefinite integral for an specific application (Fourier analysis is a good example) and you're left with a bunch of shitty limited precision data.

Go be a ``practical engineer'' somewhere else.

>>21
Lua is shit.

Name: Anonymous 2014-05-14 0:37

If you seriously cant calculate what you need to calculate in your head I have bad news for you....

Name: Anonymous 2014-05-14 0:42

>>21
I agree, zero based is a holdover from low level languages where you have shit like pointer arithmetic. Any decently abstracted language will count the way humans do.

Name: Anonymous 2014-05-14 0:48

>>21,24
freedom zero faggots, thread over

Name: Anonymous 2014-05-14 1:08

>>22
Grasping at fucking straws with those links. No matter how many links you find of people solving problems with it, MATLAB has been used to solve more problems easier.

There is an obvious correlation between matlabs ease of matrix manipulation and matrices being used as the default data type. One example, you can turn any number into a matrix by appending elements to it because it was already a matrix to begin with. This doesn't sound useful until you've used it enough.

as for your one based comment, we all know by now that zero indices are a relic of pointer offsets. I agree that array indicates should start with 0, but only because of convention. It makes sense to start with 1.

Its funny that you mention Fourier analysis as a potential weak point of MATLAB. I posted code on old /prog/ showing just how simple it is to do Fourier analysis with it. No one actually cares about indefinite integrals. its not a real problem until you have the parameters to calculate the integral. MATLAB actually does have a symbolic toolbox but its not well developed because real engineers solving real problems don't masturbate to symbolic programming languages.

Name: Anonymous 2014-05-14 2:52

>>26
You're so fucking stupid that you cant calculate in your head and you still cant even grasp lisp.

Engineer? rofl

Name: Anonymous 2014-05-14 15:30

>>22
The "bright-object-on-mars" looks awesome, but you can use any other DSP package with builtin image processing for that.

Name: Anonymous 2014-05-14 16:17

Indices should start at 1. touhou[1] = 'reimu'; because she is the first. The index number should be treated as an ordinal, but even when treated as a cardinal, it still fucks up cardinality. There is no good reason to have arrays start at 0 when literally every memory allocation method allocates based on a number of bytes. If C-style language's indices started at 1, it would remove 90% of bugs made by shitty programmers who can't reason (though, it was a mistake to give them anything more than VB6 to make GUIs in anyway).

Name: Anonymous 2014-05-14 17:03

>>29
As opposed to figuratively every memory allocation method?

Name: Anonymous 2014-05-14 17:10

>>30
`Literally', in this context, ESL-kun, means that I am not using hyperbole when I say that every other memory allocator uses a magnitude to get memory.

Now please, go back to reddit.

Name: Anonymous 2014-05-14 17:19

>>31
What's reddit?

Name: Anonymous 2014-05-14 17:25

>>32
Your homepage, which means you can't be here. Our idol, Abelson-san, murdered the founder of Reddit.

Name: Anonymous 2014-05-14 17:27

>>33
Actually, my homepage is on geocities.jp

Name: Anonymous 2014-05-14 22:36

It is actually just octave with // comments ^^
How many points do you think you'd need to solve for a random seed & offset?

Name: Anonymous 2014-05-14 22:41

>>35
are you luke?

Name: Anonymous 2014-05-14 23:16

yasouh?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List