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
Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Question and sorry if this seems dumb but what's the use of using a ORM to set up schema and tables over a tool like DBeaver?

Adbot
ADBOT LOVES YOU

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Empress Brosephine posted:

Question and sorry if this seems dumb but what's the use of using a ORM to set up schema and tables over a tool like DBeaver?

People design their models in different ways. Some like to code the app first, some like to do data modelling, some like to design databases.

With an ORM like entity framework, you can take a code-first approach and write your application domain logic first, and generate the database through that (e.g. write the domain logic in C#, and get the database just by providing type annotations for entity framework.) You can also generate the database using a model-first approach (e.g. use EF editor to create the data model, and generate the database from that.) EF can also go the other way and take an existing database, and generate model classes from that.

Goal is to only have to create your model once using whichever way you're most comfortable with (e.g. code/model/db) and have the other representations be generated automatically, rather than manually translating your data model into code and database work.

smackfu
Jun 7, 2004

Some people want to pretend that the details of their data store don’t matter. This usually works out very badly, eventually.

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
That makes sense and its nice to hear that I guess you can use what is easiest. I’m teaching myself Prisma but I’m not really understanding the concept of this:

code:
 model Post {
  id        Int     @default(autoincrement()) @id
  title     String
  content   String?
  published Boolean @default(false)
  author    User?   @relation(fields: [authorId], references: [id])
  authorId  Int?
}

model User {
  id            Int       @default(autoincrement()) @id
  name          String?
  email         String?   @unique
  createdAt     DateTime  @default(now()) @map(name: "created_at")
  updatedAt     DateTime  @updatedAt @map(name: "updated_at")
  posts         Post[]
  @@map(name: "users")
}
Compared to just going into dbeaver and doing a foreign key match etc….but I don’t really understand Prismas language and wtf a “@@map” is.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Empress Brosephine posted:

That makes sense and its nice to hear that I guess you can use what is easiest. I’m teaching myself Prisma but I’m not really understanding the concept of this:

code:
 model Post {
  id        Int     @default(autoincrement()) @id
  title     String
  content   String?
  published Boolean @default(false)
  author    User?   @relation(fields: [authorId], references: [id])
  authorId  Int?
}

model User {
  id            Int       @default(autoincrement()) @id
  name          String?
  email         String?   @unique
  createdAt     DateTime  @default(now()) @map(name: "created_at")
  updatedAt     DateTime  @updatedAt @map(name: "updated_at")
  posts         Post[]
  @@map(name: "users")
}
Compared to just going into dbeaver and doing a foreign key match etc….but I don’t really understand Prismas language and wtf a “@@map” is.

Probably should start here: https://www.prisma.io/docs/concepts/overview/what-is-prisma

The quoted text is a prisma schema. This schema is used by the prisma client to understand the content of your database (so you can use the api to query against it). You can get this automatically from an existing database by calling "prisma introspection", or you can create it yourself if need be.

For @@map specifically:
App developers like camel case (e.g. createdAt), whereas database people like snake case (e.g. "created_at"). @@map in the above example makes it so the "createdAt" field in the schema maps to "created_at" column in the database - e.g. in this case, prisma client api would have "createdAt" in any returned User objects, but the field in the database would still be labeled "created_at".

Bruegels Fuckbooks fucked around with this message at 16:50 on Feb 21, 2021

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Thank you for explaining @@map because their docs didn’t from what I could see. That makes sense though.

I did manage to figure the rest out, although I screwed myself over because I didn’t realize SQLite doesn’t support lists lol rip.

I guess I could do a row entry for every “feature” I need to log of the item, but lists would make it more concise :v.

Thanks for all the help

Deffon
Mar 28, 2010

If you only have a single database and no users you can just change the database directly if you want.
One thing Prisma gives you is automation: it can create the schema on application startup if it doesn't exist, or migrate the schema if it isn't up-to-date.
This matters more when you have multiple developers each with their own local database, and when you have test environments where new features can be tested before being released to the public.
By keeping it in source control you can change the data model and code together.

Note that you don't need an ORM just for the automation part.
You can instead write SQL migration files describing schema changes over time, and keep the database up to date using a library like https://github.com/aaronabramov/node-sql-migrations.

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Huh I didn’t even think of that and keeping it all up to date, I figured developers just hosted the DB on a site like AWS and everyone just accessed it. Thats good to know though, thank you all for the help. I’m learning Prisma better now even within the last ~2 hours :D

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



hbag posted:

I'd prefer to do it with either bash or perl, but it's good to know I've got that as a backup.

https://catonmat.net/introduction-to-perl-one-liners you can do all this with Perl, if you want

Yaoi Gagarin
Feb 20, 2014

Would people be interested in a thread for talking about language design and implementation? That would include compilers, interpreters, parsing, code gen, similar stuff.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

VostokProgram posted:

Would people be interested in a thread for talking about language design and implementation? That would include compilers, interpreters, parsing, code gen, similar stuff.

I'd be into that, but I don't often hunt for new threads.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


VostokProgram posted:

Would people be interested in a thread for talking about language design and implementation? That would include compilers, interpreters, parsing, code gen, similar stuff.

:justpost:

Yaoi Gagarin
Feb 20, 2014

Alright, I will attempt to write an OP

JawnV6
Jul 4, 2004

So hot ...

VostokProgram posted:

Would people be interested in a thread for talking about language design and implementation? That would include compilers, interpreters, parsing, code gen, similar stuff.

here u go https://forums.somethingawful.com/showthread.php?threadid=3481275

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Now there's a thread with a coherent topic!

Vitamin Me
Mar 30, 2007

Looking for a fellow goon to help me out in CheatEngine..I've spent days trying to create a hack that's supposed to be real easy :saddowns:

Away all Goats
Jul 5, 2005

Goose's rebellion

Regarding CSS, is it possible to assign values to a particular tag, within a div tag?

For example I have a
code:
#favorites {
color: white;
   position: fixed;
   bottom: 0;  } 
and I would like images that I add to this div element to be a certain size, without affecting any of the other images in the page.

I can't do
code:
#favorites {
   color: white;
   position: fixed;
   bottom: 0;
   img {
      width: 50px;
      height: 50px;
   }   
}
So what would be an alternative way to accomplishing this?

Away all Goats fucked around with this message at 23:47 on Feb 23, 2021

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'

Away all Goats posted:

Regarding CSS, is it possible to assign values to a particular tag, within a div tag?

For example I have a
code:
#favorites {
color: white;
   position: fixed;
   bottom: 0;  } 
and I would like images that I add to this div element to be a certain size, without affecting any of the other images in the page.

I can't do
code:
#favorites {
   color: white;
   position: fixed;
   bottom: 0;
   img {
      width: 50px;
      height: 50px;
   }   
}
So what would be an alternative way to accomplishing this?

code:
#favorites {
   color: white;
   position: fixed;
   bottom: 0;
}

#favorites img {
      width: 50px;
      height: 50px;
}

nielsm
Jun 1, 2009



dupersaurus posted:

code:
#favorites {
   color: white;
   position: fixed;
   bottom: 0;
}

#favorites img {
      width: 50px;
      height: 50px;
}

This, and the topic you should read up on is called CSS Selectors.

hbag
Feb 13, 2021

i thought all you could do with cheatengine was change memory values

you can write poo poo for it?

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
You can write scripts that automate the process of changing specific memory values, yeah.

So that the next time you want to cheat at a particular game, you don't need to mess around figuring out how to change that specific thing - or you can share it with someone else, so that they can mess around with those values without even needing to find the right locations themselves.

smackfu
Jun 7, 2004

Away all Goats posted:

Regarding CSS, is it possible to assign values to a particular tag, within a div tag?

For example I have a
code:
#favorites {
color: white;
   position: fixed;
   bottom: 0;  } 
and I would like images that I add to this div element to be a certain size, without affecting any of the other images in the page.

I can't do
code:
#favorites {
   color: white;
   position: fixed;
   bottom: 0;
   img {
      width: 50px;
      height: 50px;
   }   
}
So what would be an alternative way to accomplishing this?

Also, SCSS lets you do exactly this but you then have to run it through a processing step to get the CSS.

Away all Goats
Jul 5, 2005

Goose's rebellion


nielsm posted:

This, and the topic you should read up on is called CSS Selectors.

Thank you!

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'
Baby's first machine learning question:

I've made a camera to watch my bird feeder, and now I want to get some automatic identification going on. I grabbed this pre-trained model for Tensor Flow, and it works great on birds, but it's also pulling birds out of thin air from no-bird images. I haven't yet dug into the evaluating prediction confidence (if that's even a thing), but it got me thinking about training for null cases. The model has a label "background", and I'm wondering: what's going to happen if I add some training using my own pictures, including feeder-only shots classified as "background"? Would it help, or is it going to confuse things since the feeder is always going to dominate the picture?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Try it and see.

csammis
Aug 26, 2003

Mental Institution
My hunch is that shots of just the feeder as background would help the classifier differentiate between “a feeder” and “a feeder with a bird at it” but really just

ultrafilter posted:

Try it and see.

Macichne Leainig
Jul 26, 2012

by VG
It's a totally legit thing to add background-only images to your training dataset. Images that have the target classes in them are often called "positive" samples and background-only are "negative" samples. Some neural network architectures fare better with the addition of negative samples in the training dataset, but ultimately like everyone else said, you won't really know if it helps unless you try it yourself.

Head Bee Guy
Jun 12, 2011

Retarded for Busting
Grimey Drawer
How can I find a good boot camp? I won’t be attending until I can do it in person, but i’ve been learning javascript (a mix of codecademy, exercism, and weekly lessons from a friend in the biz) for the past couple months, and I wanna take it to the next level so I can make this a career. It’ll most likely be for some kind of webdev, although maybe cyber security—i’m still pretty early on this journey and just figuring out what I’m into.

What sorts of things should I look for or avoid? What’s a reasonable price?

I’m located in NYC fwiw.

Slimy Hog
Apr 22, 2008

Head Bee Guy posted:

How can I find a good boot camp? I won’t be attending until I can do it in person, but i’ve been learning javascript (a mix of codecademy, exercism, and weekly lessons from a friend in the biz) for the past couple months, and I wanna take it to the next level so I can make this a career. It’ll most likely be for some kind of webdev, although maybe cyber security—i’m still pretty early on this journey and just figuring out what I’m into.

What sorts of things should I look for or avoid? What’s a reasonable price?

I’m located in NYC fwiw.

I graduated from a bootcamp in 2016 and have a good job, but #1 my bootcamp doesn't exist any more #2 I've heard that bootcamps in general have changed a BUNCH since I graduated. I suggest reaching out to recent grads from the various bootcamps and see what they have to say.

Head Bee Guy
Jun 12, 2011

Retarded for Busting
Grimey Drawer

Slimy Hog posted:

I graduated from a bootcamp in 2016 and have a good job, but #1 my bootcamp doesn't exist any more #2 I've heard that bootcamps in general have changed a BUNCH since I graduated. I suggest reaching out to recent grads from the various bootcamps and see what they have to say.

I heard something similar from my tutor. I feel like I’m at a loss as to how to actually research this, as most of the google results I find are SEO sponcon garbage

Slimy Hog
Apr 22, 2008

Head Bee Guy posted:

I heard something similar from my tutor. I feel like I’m at a loss as to how to actually research this, as most of the google results I find are SEO sponcon garbage

I have a friend who did "Fullstack Academy" a couple of years ago and is happy where she landed

CarForumPoster
Jun 26, 2013

⚡POWER⚡

dupersaurus posted:

Baby's first machine learning question:

I've made a camera to watch my bird feeder, and now I want to get some automatic identification going on. I grabbed this pre-trained model for Tensor Flow, and it works great on birds, but it's also pulling birds out of thin air from no-bird images. I haven't yet dug into the evaluating prediction confidence (if that's even a thing), but it got me thinking about training for null cases. The model has a label "background", and I'm wondering: what's going to happen if I add some training using my own pictures, including feeder-only shots classified as "background"? Would it help, or is it going to confuse things since the feeder is always going to dominate the picture?

Because birds are part of Imagenet its gonna be super duper easy to pull them out of a webcam feed. I'd go at this like others are suggesting with a potential multilabel classification

I find fastai extremely good for getting something up and running in a day or two to see fi this will be a hard problem or not. They have tutorials and make it super easy to use pretrained models.

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'

This project’s been one leeroy jenkins after another, so yeah why stop now

I’ll check fastai out too. Though I got something out of tensor flow, it feels a bit too obtuse for starting from scratch.

1550NM
Aug 31, 2004
Frossen fisk
Binary time. I'm trying to mangle an output from a Mifare cardreader in Python, to convert the output from it to all the possible formats needed. The original software can only read one format at a time, can only run single instanced and needs to restart for each format change.


Raw tag is E267F805, output from reader is 05F867E2.

My problem is the third format, which after reading in from the reader gets converted somewhere in the bowels of the original program to 091BF2E2.

Besides my example tag here, as the reader reverses the card UID, 0A2B4C6D -> 6D4C2B0A
and creates the third format, the rightmost byte get preserved.


code:
11100010 01100111 11111000 00000101 Raw tag uid, E267F805, format: linear
00000101 11111000 01100111 11100010 From reader, reversed, 05F867E2, format, linear reversed
00001001 00011011 11110010 11100010 Third format, rightmost byte preserved 091BF2E2, 
Usually I can spot the pattern, but in this case I'm lost.

yippee cahier
Mar 28, 2005

I spent far too long looking at that. You’ve got an extra bit in there so its not purely shifting stuff around. A brief look at various card standards shows use of parity bits, maybe there’s some other clues in your reader program or documentation for the type of card this is that can help.

CarForumPoster
Jun 26, 2013

⚡POWER⚡

dupersaurus posted:

This project’s been one leeroy jenkins after another, so yeah why stop now

I’ll check fastai out too. Though I got something out of tensor flow, it feels a bit too obtuse for starting from scratch.

FastAI's whole deal is to get subject matter experts using ML and DL without having to know much about it to make something useful. Especially for image recognition, they make it trivially easy to use pretrained models. The Hobby Coin Project (TM) in my red text was actually built w/fastai in a jupyter notebook which started with ImageNet.

1550NM
Aug 31, 2004
Frossen fisk

yippee cahier posted:

I spent far too long looking at that. You’ve got an extra bit in there so its not purely shifting stuff around. A brief look at various card standards shows use of parity bits, maybe there’s some other clues in your reader program or documentation for the type of card this is that can help.

Thanks, its good to know its not blindingly obvious as my pool of eyeballs on this little side project consists of only me. Have to pour over my dump of multiple tags again to see if there is some constant to the madness. Only clue from the access control program is that the last format is called block read. As a sidenote it mangles both Mifare and prox tags in the same way, and changing formats does not affect whats comes in over the virtual com port.

turd in my singlet
Jul 5, 2008

DO ALL DA WORK

WIT YA NECK

*heavy metal music playing*
Nap Ghost
sale on Udemy for new users (it'll be over soon though). i picked up a comprehensive Python course and a machine learning course for $26, should keep me busy for a while

E: I have been informed that it's their business model to have everything on sale all the time and this isn't anything special lol

Still it was nice to find some courses in my unemployed rear end's budget tho, everything else I've seen was significantly more expensive so I was just using free courses

turd in my singlet fucked around with this message at 15:33 on Mar 3, 2021

Away all Goats
Jul 5, 2005

Goose's rebellion

I'm learning C# and I can't figure out this exception ("IndexOutOfRangeException: Index was outside the bounds of the array.").

The program is supposed to read a text file, parse it one line at a time and then split the line into from/to/body/tag/id sections. It says index was outside the bounds of the array but it should be fine?

This is the parse method that's supposed to split the line it gets fed:
code:
public static TweetParse(string line)
        {            
            string[] values = line.Split(new char[] { '\t' });
            string from = values[0];
            string to = values[1];                
            string body = values[2];            
            string tag = values[3];                
            string id = values[4];             
            
            Tweet newTweet = new Tweet(from, to, body, tag, id);
            return newTweet;
        }
An example of the line of text in the file its supposed to read
code:
Raptors	Drake	Obama	Go Raptors! Go! 10001
Here's the full code:
http://pastie.org/p/2Y7EPCCYEjXOTCvVRtuK5f

What am I doing wrong?

Adbot
ADBOT LOVES YOU

Volguus
Mar 3, 2009

Away all Goats posted:

I'm learning C# and I can't figure out this exception ("IndexOutOfRangeException: Index was outside the bounds of the array.").

The program is supposed to read a text file, parse it one line at a time and then split the line into from/to/body/tag/id sections. It says index was outside the bounds of the array but it should be fine?

This is the parse method that's supposed to split the line it gets fed:
code:
public static TweetParse(string line)
        {            
            string[] values = line.Split(new char[] { '\t' });
            string from = values[0];
            string to = values[1];                
            string body = values[2];            
            string tag = values[3];                
            string id = values[4];             
            
            Tweet newTweet = new Tweet(from, to, body, tag, id);
            return newTweet;
        }
An example of the line of text in the file its supposed to read
code:
Raptors	Drake	Obama	Go Raptors! Go! 10001
Here's the full code:
http://pastie.org/p/2Y7EPCCYEjXOTCvVRtuK5f

What am I doing wrong?

I cannot open pastie.org for some reason, but the sample text you posted only has 3 tabs at most. It would fail by the time you want to get the tag.

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