runjaj, to random Spanish
@runjaj@mastodon.social avatar

Calcular una integral numérica usando la regla de Simpson con #julialang es tan fácil como usar esta función:

∫(x, y) = (x[2]-x[1])/3*(y[1] + 4*sum(y[2:2:end-1]) + 2*sum(y[3:2:end-2]) + y[end])  

Por ejemplo, la integral del seno entre 0 y π es:

x = LinRange(0, π, 7) # 7 puntos entre 0 y π  
y = sin.(x) # Cálculo del seno para los 7 puntos  
∫(x, y) # Integración

2.000863189673536  

El valor realizando la integral simbólicamente es 2. Todo bien sencillo.

juandesant,
@juandesant@astrodon.social avatar

Para calcular la integral definida usando esa función, tenemos que definir algo parecido a linspace:

def linspace(start,stop,count):  
 return [x*(stop-start)/(count-1)+start for x in range(0,count)]

from math import pi, sin  
x = linspace(0,pi,7)  
y = [sin(y) for y in x]  
print(simp_int(x,y))  

El resultado es 2.0008631896735363, un 0.04% más que el valor real.

#integracion #ReglaDeSimpson #calculo #Julia #Python

juandesant,
@juandesant@astrodon.social avatar

Por supuesto, una forma más sencilla de usar la regla de Simpson sobre una función cualquiera es definir algo como:

def simpson_func_int(f,start,stop,count):  
 x = linspace(start,stop,count)  
 y = [f(x) for x in x]  
 return simp_int(x,y)

simpson_func_int(sin,0,pi,7)  

#integracion #ReglaDeSimpson #calculo #Julia #Python

juandesant, (edited )
@juandesant@astrodon.social avatar

Eso nos permite evaluar funciones arbitrarias, como por ejemplo la función sombrero entre 0 y 1:

def hat(x,start=0.0,end=1.0):  
 return 1.0 if x >= start and x <= end else 0.0

simpson_func_int(hat,0,1,100)  

devuelve aproximadamente 0.9933 (el resultado real debería ser 1). Cambiando los límites, mientras incluyamos [0,1], debería dar resultado parecido:

simpson_func_int(hat,-3,3,100)  

da 1.0101

#integracion #ReglaDeSimpson #calculo #Julia #Python

amarchivepub, to Julia
@amarchivepub@mastodon.social avatar

On this week's episode of "Julia" on Max, cooking icon Julia Child and the WGBH crew go to Washington to film inside the White House kitchens.

Watch the real visit from back in 1968: https://americanarchive.org/catalog/cpb-aacip_15-ft8df6mf00

OldAintDead, to Julia
@OldAintDead@mastodon.sdf.org avatar

Best thing I've seen in the last two weeks is any episode of #Julia about #JuliaChild. Here's a #review of episode 1, but they all shine. https://oldaintdead.com/julia-s2-e1-loup-en-croute/

jda, to Julia
@jda@social.sdf.org avatar

Anyone doing #AdventOfCode ? I start with the best of intentions but have never finished it. Last year, I did it in #Julia. I was thinking I would try it again but then I thought perhaps I should go for it in #CSharp. I've been doing a lot of work in C# and I have been enjoying it and need to get better at it. Any other language you would suggest? I only have 2 requirements - it must have threading baked in and it has to have an easy way to pull stuff from the Internet.

https://adventofcode.com

bocs, to raku
@bocs@toot.wales avatar

For the first day of living in UTC+0, I actually have to be up at stupid o'clock anyway. In the interests of speed, which I usually do not care about, given the opportunity I shall start day 1 in in which the thing will take moments. I'll clean it up into because, well, one ought to. I'll then start again in because that's what I want to learn this time around.
I see a lot of exotic things, or rust, or R. Where's my perl tribesfolk?!

OldAintDead, to Julia
@OldAintDead@mastodon.sdf.org avatar
OldAintDead, to Julia
@OldAintDead@mastodon.sdf.org avatar

about and starring the fabulous is back on Max. I'll be blabbing about this series episode by episode, so here we go with S2.E1 Loup en Croûte.
https://oldaintdead.com/julia-s2-e1-loup-en-croute/

maltimore, to python
@maltimore@social.tchncs.de avatar

This morning, out of nowhere, I decided enough is enough. Python existed for over 30 years, so the following issue just shouldn't exist anymore:

>>> 0.1 + 0.2 == 0.3
False

So I after people tried to convince me of julia for many years because it supposedly handles numbers much better, I finally tried it.

julia> 0.1 + 0.2 == 0.3
false

Okay then.

motoridersd, to random
@motoridersd@pug.ninja avatar

I am now remembering more of S1 of Julia, mostly because Sarah Lancashire

motoridersd,
@motoridersd@pug.ninja avatar

Rachel Bloom has entered the show #Julia

krz, to python German

Here‘s another interesting , , comparison: „count the number of vowels in a string“. uses an anonymous function as an argument to count(), iterates over the string using list comprehension, does the same but in a vectorized way

OldAintDead, to Julia
@OldAintDead@mastodon.sdf.org avatar

Sarah Lancashire as Julia Child! See her in on Max starting Thursday.

MagicLike, (edited ) to Julia
@MagicLike@mstdn.social avatar


{
cuteness: 100% !important;
}

@julia

robinlovelace, to python
@robinlovelace@fosstodon.org avatar

I'm thinking about porting functionality in the {stats19} #rstats package into #Python and possibly other languages. Are you an #OpenSource developer with an interest in #DataScience for policy, sustainability + good? If so please check this issue and let us know your thoughts on taking this project to the next level 🚀 https://github.com/ropensci/stats19/issues/230
@rOpenSci @mszll + all any thoughts on best practices welcome also 🙏

luis_de_sousa,
@luis_de_sousa@mastodon.social avatar

@robinlovelace @martinfleis

"Great language" is merely a subjective statement. #R has long dropped outside the top 20 of the most used languages in the world and the trend only points downwards. It is in the bottom half of #StackOverflow 's admiration ranking and scores less than 4% in the desirable ranking. In contrast, recent languages like #Flow, #Julia, #Mojo, etc yield pretty much the opposite dynamics at the moment.

https://survey.stackoverflow.co/2023/#technology

me, to facepalm
@me@social.taupehat.com avatar

I love how -c told me it was OK

mjgardner,
@mjgardner@social.sdf.org avatar

@me It’s just a comment to #Perl. The same happens with #Nim, #RakuLang, #PHP, #PowerShell, #Python, #Ruby, #Rstats, #make, #Elixir, #Julia

macleod, to haskell

Various thoughts on too many programming languages, for no discernible reason.

I have been interested in Go since it's very initial release, but their dependence on Google is uncharming to say the least. I still haven't made up my mind on its GC, but its definitely better than most.

I used to do some ML work in .NET and if it wasn't dependent on Microsoft it would be a heavy contender for a great language, but it has far too many Microsoft-isms to ever really go much farther.

Rust is great, I enjoy beating my head against a brick wall battling with the compiler, and their safety is great, but overly complicated and feature-creep is a real problem on that entire project. I do a lot of work these days in Rust, for better (mostly) or worse (mostly-ish).

C is my bread-and-butter, as is Javascript for quick prototyping.

Elixir is great, but Erlang is unwieldy, the community is growing, but not fast enough - and I just can't get my mind to enjoy the syntax no matter how nice it is.

D is a lot of fun, but their GC can be slow at times, and the community is very small and packages are often broken and unmaintained.

Python was my first true love, but I really can't stand the whitespace, again love the language, hate the syntax.

Zig is fun, but just that. Fast, nimble, but early days, a bit confusing, could replace my insistence on C for core projects, but again, early days. I love to use them as a compiler for C, much faster than the defaults on any of the others.

Odin is one I love to keep an eye on, I wish I could get behind using it for more things. When I first took notice ~4 years ago the documentation was a bit scattered, but it looks much better now. The developer behind it is incredibly cool, could be seen as the next Dennis Ritchie imo. Runes are dope. The syntax is by far my favourite.

Julia, I love Julia, but performance last I tested was a bit of a miss, and by miss, it required a decent chunk of compute for basics, but when you gave it the system to throttle, it would be insanely productive to write in. Javascript is something that I prototype even syscalls in, but Julia is just the same but much better and more productive (and less strange) in many regards. I am really hoping this takes over in the ML/Data world and just eats Python alive. I've heard there has been major work in the perf department, but I haven't had reason to try it out lately.

Ada, memory safety before Rust! Great language, especially for critical applications, decades of baggage (or wisdom), slow moving language, insanely stable, compilers are all mostly proprietary, job market is small, but well paid, great for robotics, defense, and space industry types, but the syntax is... rough. Someone should make a meta-language on top of Ada like Zig/Nim/Odin do for C, or Elixir does for Erlang.

The others: Carbon, haven't tried; Nim, prefer when they were "Nimrod" (cue Green Day), decent but not my style; Crystal, seems cool, but not for me; Scala, great FP language, but JVM; Haskell, I'm not a mathematician, but my mathematician friends love it. I see why, but not my thing as much as I love functional languages. I'll try it again, eventually. I did not learn Haskell a great good.

I tend to jump from language to language, trying everything out, it's fun and a total timesuck.

[ # ] :: #c #d

_wurli, to random

Genuine question: are there any tools outside of #RStats that come close to dplyr + tidyr + purrr for data wrangling?

JorisMeys,
@JorisMeys@mstdn.social avatar

@_wurli LOL. There's TidierData.jl in #julia, but that's a rather recent development and there's subtle (and less subtle) differences too.

https://github.com/TidierOrg/TidierData.jl

I know you have plotnine in #python as a grammar of graphics implementation, but its' not even close to ggplot2. There's the siuba package as well, but also that is far less extensive (kudos to Michael Chow though, it's a great effort).
https://github.com/machow/siuba

josi, to python

The Spatial Data Science Across Languages event was very thought provoking!

Recapped some of my lessons and thoughts here: https://josiahparry.com/posts/2023-09-20-sdsl/
#rstats #python #julia #spatial #gis

franco_vazza, to Astronomy
@franco_vazza@mastodon.social avatar

Other "new" nice renderings of the growth of simulated clusters of galaxies by my former student Matteo Angelinelli, who kindly left all these gems in an hard disc!

#astronomy
#astrodon

(all this was used for his papers studying turbulence and clumps in the ICM:
https://ui.adsabs.harvard.edu/abs/2021A%26A...653A.171A/abstract
https://ui.adsabs.harvard.edu/abs/2020MNRAS.495..864A/abstract

using ENZO runs I produced years earlier on the ITASCA supercluster in Minneapolis - hence the "Itasca" simulation name)

video/mp4

franco_vazza,
@franco_vazza@mastodon.social avatar

other cluster rendering
(all done in @julialang #Julia #Julialang )

video/mp4

martinfleis, to python
@martinfleis@fosstodon.org avatar

I am coming back from Spatial Data Science across Languages workshop organised by @edzer, who managed to get devs from #RSpatial, #Python and #Julia to one room to talk. It was great and while sitting on a train, I jotted down a few quick thoughts while they're still fresh in my mind 👉 https://martinfleischmann.net/a-note-on-spatial-data-science-across-languages-vol.1/

r_ivorra, to programming

Here's a list of 9 #programming languages which are supposedly "heading for extinction". But, are they? It includes #R, #Haskell, #Perl / #Raku, #Pascal, #COBOL or #Fortran...

https://www.makeuseof.com/programming-languages-heading-for-extinction/

vmagnin,

@r_ivorra
Yes, stands for "Formula Translator". It is still one of the major language in the scientific field. But has also been adopted a lot for computation (often using Fortran libraries) on the desktop. is also using a lot of Fortran libraries. And there are also #C++ and .
Being a compiled language, Fortran programs can run fast, as C and C++.
For example, many climate models are written in Fortran or use Fortran libraries.

nosherwan, to rust
@nosherwan@fosstodon.org avatar

🔥 😎
Popular Programming Languages:

So according to the latest Tiobe index:

Python is No.1
Rust is now in Top 20
And Julia just entered Top 20

The claims are Julia is faster than Python and targets the same market as Python.

https://www.tiobe.com/tiobe-index

#rust
#julia
#python
#popular
#language
#programming
#development

kalankaboom, to webassembly

Hey everyone, I just made something cool!
I wrote a fractal viewer in C++, compiled it to #Wasm using #Emscripten, and put it on my website (https://kalankaboom.net/).

I wrote an article on how I made it, and I would love for you to check it out and give me all the feedback you can!

Here's the article :
https://kalankaboom.net/articles/rewrite_it_in_wasm.html

And here's the tool :
https://kalankaboom.net/projects/mandelwasm/

@cpp
#fractal #mandelbrot #julia #webdev #cpp #art #article

kbroman, to Julia
@kbroman@fosstodon.org avatar

Looking forward to the online AmStat mini Stat Comp symposium on 2023-11-04, with keynote by Simon Urbanek and "Data Jamboree" with analysis of NYC 311 data in , , and (HaiYing Wang, Shannon Neeley-Tass, and @lucystats, respectively) https://asa-ssc.github.io/minisymp2023/program/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • provamag3
  • GTA5RPClips
  • tacticalgear
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • ethstaker
  • Leos
  • anitta
  • cisconetworking
  • megavids
  • lostlight
  • All magazines