Scientific Programming Thread

Discuss scientific computation and programming ITT. Keep insubstantial language wars to a minimum.

What are you programming scientifically, Veeky Forums?

Other urls found in this thread:

Veeky
youtube.com/watch?v=YnWhqhNdYyk
incredibuild.com/
ieeexplore.ieee.org/document/1554676/
arxiv.org/abs/1710.05101
github.com/LandonPowell/zext
wolframalpha.com/input/?i=Z/sqrt(x)
wolframalpha.com/input/?i=PRIME^-1
wolframalpha.com/input/?i=(sqrt(2)^-1)^n
wolframalpha.com/input/?i=sqrt(7) sqrt(5) sqrt(3) sqrt(2) sqrt(i) sqrt(-1)
twitter.com/NSFWRedditVideo

>no Excel

Veeky Forums i need to learn c++/to program in two months dafuq do i do?

...

Veeky Forums-science.wikia.com/wiki/Computer_Science_and_Engineering#Basic_Programming_.26_Data_Structures

>Veeky Forums-science.wikia.com/wiki/Computer_Science_and_Engineering#Basic_Programming_.26_Data_Structures
thank you wise user

>Veeky Forums related programming
>Keep insubstantial language wars to a minimum
>puts every fucking language that exist in the picture

/MatSci/ user here
Wanna start programming as a hobby. I learned some very basic c++ stuff in HS and somewhat enjoyed it even though we were just solving some relatively easy mathematical problems. Which language should I start with? Continue with C-->c++ or just start from the beginning with python/java?

1 Java is horrible and not worth learning unless you really need to.
2 There's no need to learn C before C++. Stop listing to /g/
youtube.com/watch?v=YnWhqhNdYyk

It doesn't really matter.

>listing
*listening

I know jack shit about programming languages and it's just I've read on a couple of chans anons claiming that it's best to start with some c-like subset of java or something.
Fuck it python seems the most attractive one out there.

Speaking only from experience, I'm not a CS major, I don't think starting with C++ is too bad. Just make sure you start with a modern book that teaches you modern, standard C++11 (and newer) concepts. The 4th edition of the C++ book by Bjarne is as comprehensive as it gets, but it will be a bit too dense if you're rusty.
Python is decent if you don't care about performance, but managing the packages and dealing with two versions of python drives me up the fucking wall. I don't want to spend an entire day trying to get an environment to work, it's one of the reasons why I hate CS, that time wasted fucking around on the terminal trying to get shit to work. So, take my advise if you're going to learn python, and get Spyder with the Anaconda Navigator. It just werks without having to do anything.
I wouldn't suggest Java for science, if you want more specialized things then maybe try Matlab, R or Julia.

>Fuck it python seems the most attractive one out there.
Go for it

Just don't fall for the CS freshman/code monkey trap of constantly switching between languages and endlessly wondering if the one you're on right now is the PERFECT one for you while never making it beyond fizzbuzz with any of them. That's what people who like the idea of programming more than actually programming do, and it's pathetic (see: /g/).

Now pick some subject matter or projects that you're interested in or find a decent "scientific computing with Python" textbook and just do the work.

Friend of mine studying CS recommends pycharm 3.2 so I guess I'll have him guide me in the 101. C++ looks terryfing desu
Thanks for the help, anons.

If you're alright with it just go for it, but personally I wouldn't want to manually deal with packages ever again. Spyder is the popular choice for non-CS scientists for a reason.
C++ is a strange thing, the code looks impenetrable at first but when you get used to it the language can hook you.

>some c-like subset of java or something
There is no c-like subset of java.
>Friend of mine studying CS recommends pycharm 3.2 so I guess I'll have him guide me in the 101. C++ looks terryfing desu
But you said you already learned it, no?

C++ isn't scary once you realize you don't have to learn all of it.

I just learned the basics till loops and functions and it's been a while since then.

What kind of computers do you guys use?

I have a good laptop. 8gb RAM, i7 processor but every program i write that isnt a super simple 1styear physics student-tier program takes a while to compile. Besides cleaner code, any tips to speed it up?

What is the best python editor/compiler?

Best c++ editor? Tried eclipse but its a hassle to setup

Also can anyone point me to a starting point to learn parallel programming? In c++ probably. Fortran is kill isnt it? Anyway, I want to learn cluster computing.

i'm a bitcoin core developer.

>any tips to speed it up?
incredibuild.com/

>What is the best python editor/compiler?
Like I said above, I personally like Spyder. As far as compiling I don't see any reason to compile python code, it won't run any faster.

>Best c++ editor
Personally I like Visual Studio with the VAssistX plugin, which turns VS from crap to God tier. With IncrediBuild I can compile changes to huge programs in seconds (obviously after the first-time big compile)
Some old school programmers will use emacs or vim, not me.
I use XCode on my laptop but I haven't tried it on big projects.

>Also can anyone point me to a starting point to learn parallel programming?
Not sure but I would look for books on Amazon and check the reviews

Thanks for the info

>Also can anyone point me to a starting point to learn parallel programming? In c++ probably

C++ Concurrency in Action: Practical Multithreading by Williams

from
Veeky Forums-science.wikia.com/wiki/Computer_Science_and_Engineering#Parallel_Programming

Pytorch

for the love of all fuck please someone tell me a lighter tex editor than texstudio other than autistic vim

sublime with tex plugins

What are some neat physics projects in C++?

I've started studying Coq in my downtime.
Existing skills are in C, Erlang and Clojure. I'm liking the principle of what Coq offers but man, it takes a while to produce anything useful.

Notepad++

Is Julia a meme?

>Prgramming
Fix your shit, OP.

Gummi
gedit with latex plugin

Python + Pycharm is the best way to be productive. You're making tools that will only run few times. Prioritize your dev time over application performance.

What's wrong with Haskell?

Geany

>Java is horrible and not worth learning
Unless you want a job.

Im using python.
Image processing and measurements of computed tomography data regular images, processing of triangle meshes, measurements on topology data lately.

Finite element solver to visualize the heat equation.

I use emacs and love it

Coq is great fun to use, especially in emacs

Why System Verilog and not regular Verilog?

yes

>Documents prettier and faster than MS Word
TeXmacs
>Mathematical software easier than MATLAB
Maxima
>Modeling like Simulink
OpenModelica
>Easy prototyping and scientific programming
Perl Data Language
>Statistical package like SPSS
PSPP

By the way, TeXmacs has Maxima CAS integration. You should try them sometime.

>TeXmacs has Maxima CAS integration
Sounds very un-UNIX

Not sure if this is Veeky Forums or /g/ material, but I'm trying to make a neural-network play 2048. I already successfully did so with tic-tac-toe, but that was quite straightforward: 27 input neurons (3 bits for every square, O has it, X has it, or nobody has it, make it 1 if true and 0 if false) and 9 output neurons: Which square to pick next. Training was also quite straightforward; use a policy-gradient-ish way of learning where you log all the moves for a game. For the winner you backpropagate that the chosen output should've been one, for the loser it should've been zero. The earlier the move, the lower the gain.

For 2048 it's fucking awful. The inputs aren't straightforward: Sure you can just give the value of every square but that really doesn't work at all. You'd like inputs to scale between 0 and 1, and same for the outputs (the way I've built it, you could also go for between -1 and 1). So what I do is I divide the inputs by the highest one. The outputs are simple: up, down, left, right. Highest output determines the move. Learning is also really not straightforward, except that you don't want it to make moves that don't do anything, so those are backpropagated as 'that move should've gotten score 0', but everything else, I have no clue. What I'm trying now is the same idea as with the tic-tac-toe game: log the outputs, change the chosen output to a value, and backpropagate. The value to be changed to is not that clear. You'd prefer to have it between 0 and 1, so I created a function which rates a score of 0 at 0 and a higher score higher, but with an asymptote at 1. The result is really fucking shitty; it's as if it's not learning anything. In my early attempts at tic-tac-toe (Q-learning instead of policy-gradient) it at least went from a winrate of 0.4 to a winrate of 0.7 (against random moves); and when I perfected it the winrate was 0.995. But with 2048 just nothing improves at all.

All programming languagues are basically fine. Java has its strengths and weaknesses. No languague wars, please.

Sounds like a good use-case for empowerment.

ieeexplore.ieee.org/document/1554676/
arxiv.org/abs/1710.05101

You can model the goal of 2048 as keeping your future options as open as possible, or maximizing the channel capacity of between action space and sensory inputs over some time horizon.

Took me a week to learn it for my job. Just start writing shit in C++. It's got a lot of shit in its standard library premade for you.

>being such a brainlet that you don't know what Ocaml is

github.com/LandonPowell/zext
>implying you're intelligent enough for Zext

You won't find a job in science with it.
>on Veeky Forums
>wants a job transcribing someone else's thoughts into code

Thanks for the links; I read the first paper but I don't really get any concrete ideas from it; the second one seems better in that respect but I'll have to look at it on less alcohol later. The idea of keeping future options open is an interesting one, I'll try that out; maybe I can use a simple heuristic like amount of empty squares, combined with amount of moves that actually do anything; something like that.

I feel that the way to provide input is also a big factor though; normalizing the values seems like a bad way to do it, but I'm not sure what else to use.

Rob, it's not the 70's anymore.

>tells people PSPP can substitute SPSS

kys yourself my man

Whats wrong with java, exactly?

yes

Yea Java isn’t that bad desu

Maxima is CAS, not numerical computation software imbecile.

>You won't find a job in science with it.
You likely wont find a job in science. You might not like that thought but it's the truth. In which case you'll be looking for the next best thing, that'll likely be some form of software dev position. So you'll almost certainly be using Java or something else, I'd advise you (and anyone else reading this) to learn it, if for no other reason than as a backup should all else fail (which it will).

slow for numerics, too verbose for academics

Irrelevant in scientific computation. I guess the second one is the original and some fag edited out R for Haskell. R makes more sense with the rest.

>being this retarded

>recommends an alternative to a tools he has never used

>implying you know

It's promising but nowhere near stable enough.

>to a tools
learn to speak, cunt

Yeah, I was thinking about the other tools as well as user I was replying to obviously has no idea what he is talking about.

You seem mad for some reason, maybe you shouldn't be posting on Veeky Forums. Take a break.

>maybe you shouldn't be posting on Veeky Forums
Once here, forever here.

So I only know Java and a bit of Python from uni, how do I get out of the Java trap? What’s the next best language?

>implying all computer algebra systems can't do number crunching
That poster should off himself.

This devolved into role-playing pretty quickly.

What the fuck are you talking about? You sound like a crazy person.

Depends on what you're doing. Python encompasses all but low-level stuff if you learn the right libraries. Symbolics (sympy), numerics (numpy), visualizations (matplotlib), stats (pandas) and specialized modeling is possible.

>Python encompasses all but low-level stuff if you learn the right libraries
Isn't that almost every programming language?

Not every language has those libraries you need. And those that do (certainly Java, C) aren't as easy to use as Python. it would be great to use Ada for everything but it isn't feasible.

Didn't Fortran have more libraries and also better suited and more optimized for scientific programming?

Java is just a more horrible version of C# with similar portability problems. It has 0 redeeming features.

...

>is just a more horrible version of C#
>similar portability problems
I don't expect high quality replies, but didn't expect lies either.

Fortran is good choice for numerical crunching such as in large-scale simulations. Also it is simpler to program in (no pointers and such) and has built-in matrices handling. Most big libraries target both Fortran and C/C++. In physics it is still in widespread usage (especially prevalent in meteorology and climate modeling) but so is C/C++. (Languages that are arguably usable in more cases.)

>Java is slow meme
Compared to what? C? Yes, it is slower. But it is faster than Lisps, Node and similar to Go.
>Java is insecure meme
The long dead browser plugin was insecure.

>What are you programming scientifically
I tried working on this idea I had a while back of a way to localize your position on a map of landmarks given noisy measurements of the landmarks in your immediate vicinity with the idea that it might be a good way of figuring out your position and orientation if you somehow find yourself lost in space with nothing but a database of stars and the estimated location of the stars around you.

I got as far as modelling the noisy measurements from the ship which are these rotated normal distributions with a variance in the direction of your ship that gets bigger the farther away the star is. My thought was that you'd be able to localize the transverse position of the stars pretty well just by looking at them but your estimate of the depth would be limited by the instruments you had on board.

With that and a model of the database as a bunch of normal distributions (since those measurements are known only to some finite precision) the way I figured you'd compare the current estimate of your position and orientation to another candidate estimate is by multiplying the estimate distributions with the databases' and integrating over the plane (working on the 2D case first) and just seeing which is bigger, but now I need a way of choosing candidates.

>t. has never tried running java from windows in unix or android

The JVMs are garbage.

>no R
>no Excel
>no GIS software

>Excel

monkeys are that way

...

So you went as far as replacing C++ in that picture for Java? It must be personal.

>Works the way a computer really works
Role-player

I like the JVM but not necessarily Java, plan on learning Clojure (and Clojurescript). Bytecode is greatly under appreciated.

wolframalpha.com/input/?i=Z/sqrt(x)

wolframalpha.com/input/?i=PRIME^-1

wolframalpha.com/input/?i=(sqrt(2)^-1)^n

I don't get it really.

Do you guys just want the fastest way to generate primes, or to check primes?

What do you want PRIME numbers for?

P.R.I.M.E. = Personally? Really, I Much Enjoy?

Primarily Return Integers Multiplication Emissions (By Back Propagation)
//
我不明白這一點真的。

難道你們只是想生成素,或檢查素數的最快方法?

你要素數是什麼?

P.R.I.M.E. =個人? 說真的,我非常喜愛?

>主要返回整數乘法排放(

nobody can read your moonrunes

I can, but it reads like a retard wrote it.

Then My Name Is nobody At This Point.

wolframalpha.com/input/?i=sqrt(7) sqrt(5) sqrt(3) sqrt(2) sqrt(i) sqrt(-1)

[math](-1)^(3/4) sqrt(210)[/math]

Then describe to me how you want this maths done. I have no difficulty in crafting it, it's just YOU guys have a hard time agreeing that the new world order is being crafted by some random shit-poster.

If anyone was gonna call the cops on me it would've been 'months' ago.

Align your fucking time streams with mine.

He just wants to be the next bacon rider

Ignore him

他只是想成為下一個熏肉騎手

不理他

西蒙主宰刺激通信(S'#'DAC)
西蒙按摩時間(SMT)

Simon Dominates Stimulation Communications (S'#'DAC)
Simon Modulates Stimulation (SMS)

>no GIS software
GIS generally relies on other languages for programming though. Like QGIS with python and C++ (also R with some packages).
I sure hope you're not an ESRI brainlet

so what if I like having a GUI?

I'm personally obsessed with C++ and it is the only programming language you will ever need. There is literally nothing the language cannot do. You can implement anything you want. Any weird convenient language feature that exists in other languages you can create in C++ in your own custom way

My favorite style of programming is C++ template metaprogramming in C style. It is the most performant and flexible code you can get. I help build machine learning infrastructure at my job and we do it this way with excellent performance results and agility

i fucking hate perl but it is used a lot in informatics.

it's free nigga