Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
gonadic io
Feb 16, 2011

>>=
hi im gonadic io and im a terrible programmer. my current hobby project is rust code running on an arduino which is talking to a magnetometer

Final plan is a physical compass(a la pirates of the carribbean) that points towards the nearest open coffee shop. yes this would be 10 million times easier as an app but that's not the terrible programmer way

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=

cinci zoo sniper posted:

im just being terrible coworker and audibly giggling as the fallout from deleted prod database seeps in

like is that it? end of the company?

gonadic io
Feb 16, 2011

>>=

JawnV6 posted:

why do you need a magnetometer at all?

so that the compass knows which way it's pointing, and then (along with its gps coords and those obtained from goog maps) can turn the arrow to point the right direction. in theory.

given that i'm doing it the odd lunchtime here and there i aim to be complete in 10 years or so. then i'll start on the drone/amateur rocketry dream which is why i'm doing all this poo poo in the first place

gonadic io
Feb 16, 2011

>>=

cinci zoo sniper posted:

another cjs: our developers on a different product don’t know why double digit % of records in one of they key tables of their database have their updated_at field changed each night when the records otherwise are unaltered

sounds like a nightly backup process to me :q:

gonadic io
Feb 16, 2011

>>=

Deep Dish Fuckfest posted:

at least that skips the step where you look up the doc, read it, and then realize that the actual design has changed completely since then and no one bothered to update the doc

and then don't bother to update the doc yourself

gonadic io
Feb 16, 2011

>>=
jabascript is becoming a dangerous reality for us because we would like to use gce's functions where js (and ts) are the only options. i dunno if we'd care enough to use wasm or scalajs or make a native module that the js calls

gonadic io
Feb 16, 2011

>>=

MALE SHOEGAZE posted:

seriously considering giving school another go atm. obviously to pursue at least a masters but if i'm gonna do it i guess i should do a phd. i'd have to do most of undergrad though, which would be costly. and weird.

"I guess i should do a PhD" you should not do a PhD.

4 years of bullshit, being under appreciated under paid and like 60% of PhD thesiseses are never read after completion means that you have to be really self motivated and really want a PhD in order to complete it. "I guess" is what 2 year dropouts (like myself) said

gonadic io fucked around with this message at 08:32 on Jul 18, 2018

gonadic io
Feb 16, 2011

>>=
my boss last week: how long will this thing take to do?
me: 1 day
boss: okay don't do it just keep working on current stuff

my boss today: hey we need that thing for our investor demo in 1 hour can you do it?

gonadic io
Feb 16, 2011

>>=

correct. i even gave it a go but got nowhere near.

gonadic io
Feb 16, 2011

>>=

Shaggar posted:

hard tabs only, old man style.

gonadic io
Feb 16, 2011

>>=

carry on then posted:

please remember to perform all development activities on Microsoft Windows, which is the standard

do you prefer powershell or good old DOS prompt?

i've been using zsh in bash in cmd lately, and I really like how you right click to paste, and ctrl-c to both kill current process AND copy the selected text

gonadic io
Feb 16, 2011

>>=

MALE SHOEGAZE posted:



Feels like some compiler hjinks to me, but it's not really surprising that iterators would be optimized around the simple computation i'm giving it.

Probably gets vectorised if the compiler can prove its a flat array yeah

gonadic io
Feb 16, 2011

>>=
Circleci goes down during us trying to hotfix prod. Fml.

gonadic io
Feb 16, 2011

>>=

Peeny Cheez posted:

Codier Than Thou.


This is amazing I'm stealing it

gonadic io
Feb 16, 2011

>>=

cinci zoo sniper posted:

as a data scientist in europe, the paycheck bit is true but with physics degree i don’t feel confidently competitive (wrt “hard skills”) with folks who have degree in math or stats or bioinformatics or something like that. cs degree in data science is more of a red flag, honestly, unless it’s a machine learning specifically (and even then it’s debatable) - there’s noticeable stigma that cs graduate have tunnel vision and need to be herded around.

Lol I studied monads, complex analysis, graph theory, and crypto and not much else in my math degree. Better watch out I'm coming for all your stats jobs!

gonadic io
Feb 16, 2011

>>=

MALE SHOEGAZE posted:

tef's posts always remind me that i need to never work on distributed systems.

gonadic io
Feb 16, 2011

>>=

jit bull transpile posted:

Can someone explain what is meant by "composability"? It's a term that is used itt all the time but I've never encountered it elsewhere.

it's when it's easy to use two different things together. name comes from function composition i.e. g(f(x)) how it's easy to compose the functions f and g. the opposite would be when two different things are real hard to use together, like how if you had to do some large conversion on the result f(x) before you could call g on it.

gonadic io
Feb 16, 2011

>>=

Bloody posted:

I would blog if I had anything interesting to talk about at all that wasn't just straight up violating ndas

I'm going to blog coffee compass when (if) I ever finish it. Right now it involves reading papers on how to convert uT to some sort of direction/compass bearing. Given that it's done by presumable 99% of people who are using magnetometers like this I'm sure there's common enough libraries I can translate into rust

gonadic io
Feb 16, 2011

>>=

Bloody posted:

i just want to write rust and get paid for it

ask me about writing a rust wrapper for the azure iot c sdk in my 5% time at work

or at least i would be continuing with it if i ever got any these days

gonadic io
Feb 16, 2011

>>=
rust magnetometer ststus: done and it calculates the angle from (magnetic) North it seems consistent but I have ordered a magnetic compass to check. This is much easier because I live on the Greenwich line so don't have to really correct for geographic vs magnetic north lol

It also calculates the angles between two (hard coded) GPS coords now too but I have to be careful not to check my address into my public github repo. Next up: loving around with stepper motors

gonadic io
Feb 16, 2011

>>=

ComradeCosmobot posted:

yeah magnetic declination doesn’t exactly follow the Greenwich meridian, especially south of the equator



Ah I thought it was some gmt thing, good to know.

MALE SHOEGAZE posted:

how are you feeling about arduino as your choice for doing embedded stuff in rust? i'm super interested in learning more about embedded but i dont want to get super serious (yet).

Arduino is good because anything with that name is designed for beginners and all the breakout boards that namedrop arduino are also designed for beginners.

The IDE is okay for examples to copy from but useless to actually work in even for c. The arm arduino (zero, mkrzero, etc) are good but a bit less supported in terms of nice rust libraries than the bluepill devices (just because that's what the dude who is implementing most of this stuff has/prefers) . Avr rust support is technically existant but awful. Last time I looked yuu had to use a fork of rustc

gonadic io fucked around with this message at 17:24 on Jul 25, 2018

gonadic io
Feb 16, 2011

>>=
For reference with my mkrzero (samd21g18a) I now need no unsafe code and no pointer loving which is a million times better than it was a year ago: https://github.com/djmcgill/coffee-compass/blob/master/src/main.rs

I have all three of gpio, uart, and i2c being used in this crate, no big deal. Nowhere near stable though, all version 0.1 of libraries and I'm even using a dude's branch of a library because his pull request hasn't been accepted yet

gonadic io fucked around with this message at 17:30 on Jul 25, 2018

gonadic io
Feb 16, 2011

>>=

MALE SHOEGAZE posted:

nice yeah, i want to do this. that is such a departure from the code i've been writing. i think i have byte anxiety.

The main downside is that there's no working rust usb stack yet so you can't use the mkrzero's USB port to do serial logging, I bought a separate usart-to-USB device

gonadic io
Feb 16, 2011

>>=

VikingofRock posted:

I actually have that right now. The issue is that the fonts don't match, and one of the co-authors mentioned it in review.

Lol what a li'l bitch

gonadic io
Feb 16, 2011

>>=

redleader posted:

i once spent an hour on a friday afternoon coding in papyrus. it was somewhat amusing

Ex coworker used to chose in comic sans full time. Idk if he was doing it ironically, or as some kind of counter-culture thing? He said he found it easier to read maybe he just has lovely eyesight

gonadic io
Feb 16, 2011

>>=

cinci zoo sniper posted:

c tp s: i really don’t like working with relational data structures in pandas so im now experimenting with local mssql server installation to avoid committing war crimes to our dwh

Sqlite my friend, its exactly for small local uses like this

gonadic io
Feb 16, 2011

>>=

cinci zoo sniper posted:

basically each agent has a list of customers assigned to them. they log into customer management panel in the morning, and start going one by one, manually, through customer account pages. if they see that customer has an invoice due, they print out a blank invoice reminder letter form, open customer personal detail page, and write down their details, by hand, into the form, and the gold it into an envelope and write the customer’s address on it, by hand. two letters per customer. total volume of hundreds, if not thousand, per day.

If you wrote a thing that just told them which customers did have invoices, nothing else, you'd be lauded as a god

gonadic io
Feb 16, 2011

>>=
Five star c === five pass LaTeX?

gonadic io
Feb 16, 2011

>>=

Bloody posted:

ctps:
code:
using System.Linq;
using System.IO;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = File.ReadAllLines(@"C:\a.txt");
            var b = File.ReadAllLines(@"C:\b.txt");
            File.WriteAllText(@"C:\c.txt", b.Except(a).Aggregate("", (x, y) => x += y + "\r\n"));
        }
    }
}
there is probably a trivial tool for this, isn't there

have you tried `cat` op? (it's called `type`) in Windows cmd

gonadic io
Feb 16, 2011

>>=

TheCog posted:

At the risk of sounding ignorant, what is a p-lang?

All those dynamic "scripting" langs that start with a p. Perl, python, php, ruby

gonadic io
Feb 16, 2011

>>=

Peeny Cheez posted:

It's not the worst solution but as the files get larger it'll get poopy.

Also I forgot to put the '-f' in the example. I belong here.

Yeah I mean for large sets you'd want to set it up properly with a hash set and for Big Data you'd do, uh, a series of smaller hash set checks applied in parallel?

gonadic io
Feb 16, 2011

>>=

Bloody posted:

yeah for sure. the problem space is limited to four text files each a hundred lines long that I wanted to gently caress around with earlier today so I feel good

are you sure the lines you're matching will be exactly identical? better spend 6 months adding a machine learning solution imo

gonadic io
Feb 16, 2011

>>=

mystes posted:

I don't know, there's got to be a dumber rust/cats pun out there somewhere. Feral?

Rascall

gonadic io
Feb 16, 2011

>>=

Powerful Two-Hander posted:

what the gently caress sort of moon language is this

It started as rust, which has syntax not dissimilar from c++. It is now something very different however

gonadic io
Feb 16, 2011

>>=

eschaton posted:

does rust let you declare your own operators, using Unicode too?

because if not, there’s a project for shoegaze

get all APL up in here

https://github.com/rust-lang/rfcs/issues/818

quote:

I'm closing this RFC as most people seem to be aganist this idea. I admit that in general the usefulness of this feature is limited. I was writing parser combinators which is one of the few times custom operators could be useful.

gonadic io
Feb 16, 2011

>>=

MALE SHOEGAZE posted:

nice! i'll give that a shot.

e: I gave it a shot, it almost works but I'm stuck because it looks like you can only convert into a FutureObj from a Box<Future<Output=()>> (as opposed to Output=A)? that doesn't really make sense to me, hmm

you got
code:
impl<F: ?Sized + Future> Future for PinBox<F>
and
code:
impl<'a, T, F> UnsafeFutureObj<'a, T> for PinBox<F> where
    F: Future<Output = T> + 'a,

impl<'a, T> FutureObj<'a, T> {
    pub fn new<F>(f: F) -> FutureObj<'a, T> where
        F: Send + UnsafeFutureObj<'a, T>,  
}
which look to me like they work. incidentally this is one of the things that the rust docs need more work on, because it's really not clear how all the different To and From and blanket impls interact. a favourite one is how the Display trait gives you the ToString trait which gives you the to_string method, but ToString isn't directly implemented by the types so the to_string method doesn't show up anywhere on their documentation

gonadic io
Feb 16, 2011

>>=

Fergus Mac Roich posted:

code:
(State::first, time) if time > 5f32 => {}
This is called a match guard: https://doc.rust-lang.org/book/second-edition/ch18-03-pattern-syntax.html

you don't even need to include time in the match to have a condition on it in the guard:

code:
match state {
    State::first if time > 5f32 => {}
    State::first => {}
}

gonadic io
Feb 16, 2011

>>=

Fergus Mac Roich posted:

rust is awesome.

standard haskell feature to the point where this became a way to avoid a huge chain of if-else blocks:
code:
 case () of
    _ | 5 > 3 -> undefined
    _ | "next case" == "butt" -> undefined
    _ -> undefined
vv: also that, please excuse my haskellcentricism

gonadic io fucked around with this message at 22:11 on Jul 27, 2018

gonadic io
Feb 16, 2011

>>=
haskell is more "a cost between 2x and 2000x and you can't know ahead of time which it'll be" and trivial concurrency

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=
zero cost functor idea:

code:
macro_rules! map {
    ($x: expr, $f: expr) => $x.map($f)
}
:q:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply