Hi everyone @Science !

I'm in the process of writing (and hopefully aggregating contributions for) short scripts to help academics/researchers do various things more effectively. This is still very much in its infancy, but considering how often I tend to automate things, I expect it to grow at a pretty steady pace.

Current examples include short API wrappers to query different journals for given search terms and date ranges to pull pdfs directly, and a modular RSS helper to redirect to papers directly from your feeds. I'm currently working on scripts for remote cluster execution, traversing and executing code on git experimental branches and more!

I've started a repo here github.com/johnabs/ASR, and if anybody has ideas for scripts that researchers could use to help with their workflow, that would be awesome, and it would be great if people are willing to contribute.
#Science #research #coding #automation

For any ruby :ruby: devs out there, wanted to share a neat little open-source :opensource: module I wrote to solve a common problem. Keep in mind ruby is not my main language so if there is a batter approach here I'm all ears.

Basically right now I have a game (text based mud) and in normal and expected fashion objects in the game are created when their objects get initialized, such as a new player being created. The system then periodically saves the universe by marshalling all the object into some serialized format and saves it to a file from time to time. As tends to be the case with serialization, however, when an object is restored, such as a previous player logging out and back in, then the class is created directly without the initialize method getting called , its class and instance variables are simply populated directly.

This is where problems can arise if you change the system and add new features (such as a new variable to an object). New objects that are created will populate the new variable correctly through the initialize method however already existing players will not have that variable set at all (it won't be nil, it simply wont be set, which is a distinctly different state). This is the problem I solved.

What I did was created a mix-in module that lets you set default values for variables, once a class is reinstated from storage it checked if any variables that have defaults are unset (nil variables are considered set) and then applies the default value to them. In this way legacy objects will be able to update to new code changes automatically when it loads. To prevent duplicating code you can even intentionally leave it out of the initialize method and rely on the defaults when it is appropriate to do so.

Moreover the defaults do not have to be static values but can be determined based on the existing state of the object, which makes them dynamic and flexible... a class that uses the mixin could look like this:

require 'defaults'

class Foo
include Defaults

# @bar defaults to @baz*2
default(:bar) { |this| this.baz * 2 }
# @faaboo defaults to 178
default(:faaboo) { 178 }

def initialize
@baz = 13

#this line can be ommited
@bar = 26
# if you add this line instead
load_defaults
#either work fine
end
end

Here is a link to the module:

git.qoto.org/aethyr/Aethyr/-/b

You can see a class that utilizes this new feature here:

git.qoto.org/aethyr/Aethyr/-/b

#Ruby #RubyLang #Programming #Coding #software #ComputerScience @Science #code #source #sourcecode #opensource #oss #game #gaming #gamedev #QotoJournal

@Science

I really do love heat map visualizations of data, there is a certain beauty to it when seeing patterns emerge.

The following is a chart from a study that shows how peoples mobility in parks has been affected by covid. Original study can be found here:

openriskmanagement.com/2021-02

#Science #Data #DataScience #Statistics #math #maths #Mathematics #COVID #COVID19 #Corona #coronavirus

In case anyone wants to check it out, this is my dev computer. I work on massively parallel algorithms a lot of the time so I need some really heavy duty GPUs for GPGPU (those are 4 watercooled Radeon Vega Frontier Edition GPUs) and a 32 core Ryzen 3.7 Ghz threadRipper CPU, and 64 gigs of the fastest ram around. this baby is a **beast**

inb4 why the Radeon GPUs and not NVIDIA or an Intel chip... simple, they are better for many/most applications but not all. The CPU and motherboard supports the full number of channels to maximize throughput into and out of the GPUs. So while they have fewer cores compared to a Tesla the cores dont tend to be the bottleneck, the I/O is, so i sacrificed cores to max out the I/O channels where the bottleneck tends to be. AMD and Ryzen ThreadRipper CPU were the only ones doing that.

#GPGPU #Parallel #Parallelism #GPU #programming #AI #MachineLearning #Algo #algos #Algorithms @Science

@Science

A project I did a while back for shits and giggles was a neural network that learned off random photos what natural coloring looked lik for various objects and faces. Then you could feed it random black and white photos and it would try to color them. Only spent a few days on it for fun, and as you can see the results were not perfect (had some artifacts). but the results were surprisingly good if you ignore the blemishes.

#machineLearning #AI #NeuralNetworks #imageProcessing #Science

@funny

I'm pretty sure this is an actual picture of me right before one of my ex girlfriends broke up with me.

#funny #joke #jokes #humour #humor #science @Science #chemistry

Can we please stop talking about a geomagnetic reversal as if it is some sort of extinction level event. There have been at least 25 geomagnetic pole reversals since humans evolved 6 million years ago and we are still here. If it happens it may cause all sorts of technological challenges and perhaps some ecological ones, but it will not be anything close to an extinction level event.

#Science @Science #Space #Astronomy #Apocolypse

Man I wish the American economy still had small stores like this... Radioshack put them all out of business then stopped selling it when places like digikey put THEM out of business.. now you can only order from a catalog and its just not as satisfying.

ledpixelart.com/shenzhen/

#Electronics #EE #Engineering #ElectricalEngineering #Science
@Science

Threw together a parameter optimization algorithm for my stock trading algorithm last night. Nothing too ground breaking but hell-a useful and cool all the same.

There are about a dozen variables, some of which have some limited dependence on each other. I suspect the search space however is relatively simple based on my expiernce os optimizing it by hand with trial and error.

The challenge is the possible valid range of these variables is huge, most bounded at 0 but with a max that is in the hundreds of thousands.

The other challenge is that each test takes a few minutes to perform (simulated over a years worth of data one minute per data point). So even with some extreme multi-core usage and optimization it is too slow for a naive search algorithm to just do a random walk across the problem space.

So the search pattern had to be an exponential one that pulls back on overshoot in a decaying exponential form as well. Identifies the boundaries and then halves each side of the boundary until the boundaries are narrow enough to find a solution. Then it moves onto the next attribute and repeats, after it optimizes them all it does another run through and another (to account for interdependence) until none of the parameters are significantly adjusted.

All this takes several hours to run at least. Still cool to see its working as it drops the error rate significantly and gets to the point where it makes fairly good predictions about how a stock is likely to change in the near future (the value measuring the error against)... in fact i'm amazed just how powerful an accurate this algorithm is at predicting stocks right now.

#Stocks #Stockmarket #investment #quant #Quantitative #math #Science #MachineLearning #AI #ML @Science

@funny

This pretty much sums up how I pickup women... or I should say, how I imagine my attempts to pick up women will go.

#Funny #humor #humour #joke #jokes #meme #science @Science

@Science
Interesting fact of the day:

Despite popular belief it is not really correct to say the speed of light is a universal speed limit in the universe. It would be more correct to say one object can never go faster, relative to another object by the speed of light.

In other words, no matter what speed I am going relative to the earth (or anything else) doesn't matter; if there is some object going the same speed and direction as me I can still accelerate up to the speed of light faster than it.

All that matters is that nothing can go faster than the speed of light relative to me the observer.

#Science #Physics #Relativity #SpecialRelativity #Einstein #Space #astronomy #Astrophysics

Outlier looks pretty exciting. At first glance it appears to be something like Masterclass but for STEM, plus it counts as actual college credits for anyone in university. basically it is university level courses taught by famous experts in the field.

Also gets some brownie points from me for highlighting Hannah Fry as one of the instructors. She is awesome and has done a lot of great stuff over the years. I got to talk to a her a few times and she helped me out with some problems I was working on once or twice (not through outlier)... so cool they snatched her up.

outlier.org/ is the link for anyone who wants to check it out.

#Science #Math #Mathematics #learning #elearning @Science @math

Ok so yesterdays algorithm took a little more extra work than I had hopped to finally get into its final form but I **think** its there. I just need to run it through some tests to know for sure.

#programming #algorithms @math @Science

Could you imagine going back in time and telling Newton that we put a man on the moon. Then after all his excitement just going "Yea but that was before I was even born, we are way more advanced than that by the time I was born and grew up!"

@Science #science #physics #astronomy

Show more
QOTO Managed Groups

The fediverse's first open managed group server.

brought to you by QOTO

No hate. Be kind, be respectful