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
The Fool
Oct 16, 2003


Ape Fist posted:

Interacting with Docker for the first time is as unpleasant or perhaps more unpleasant than interacting with Git.

I disagree, but I come from an ops background.

Adbot
ADBOT LOVES YOU

Cheen
Apr 17, 2005

I have experience in Node + Deployment + Postgres, but am looking to create a front end project for portfolio purposes. I was considering using localStorage/IndexedDB for some sort of permanence (and so I could possibly just host it on a GitHub Pages.) Has anyone used localStorage/IndexedDB for this purpose and have feelings about it?

Cheen fucked around with this message at 17:16 on Oct 22, 2019

marumaru
May 20, 2013



Ape Fist posted:

Interacting with Docker for the first time is as unpleasant or perhaps more unpleasant than interacting with Git.

as someone who does not come from an ops background, i agree with this statement
i'll even go as far as to say that git is many degrees easier to get started with than docker.

ConanThe3rd
Mar 27, 2009
Gonna have to be that guy. As someone who has a LAMP stack and whatever node backend stuff going on my dev environment I have no clue why on god’s green earth I would use docker and having to gently caress with my bios for it is just pants.

HexiDave
Mar 20, 2009
When Docker does what it's supposed to do, it's pretty pleasant and easy to manage. When it doesn't, it's like working with a live grenade.

The Fool
Oct 16, 2003


It’s not like when I gently caress up with docker I can’t just rebuild my image.

If I gently caress up with git I risk my entire commit history.

Private Speech
Mar 30, 2011

I HAVE EVEN MORE WORTHLESS BEANIE BABIES IN MY COLLECTION THAN I HAVE WORTHLESS POSTS IN THE BEANIE BABY THREAD YET I STILL HAVE THE TEMERITY TO CRITICIZE OTHERS' COLLECTIONS

IF YOU SEE ME TALKING ABOUT BEANIE BABIES, PLEASE TELL ME TO

EAT. SHIT.


The Fool posted:

If I gently caress up with git I risk my entire commit history.

Thay would take some serious incompetence though.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Docker, like git, is pretty easy for the 90 percent use case if you take the time to read the docs thoroughly instead of just Googlin for the one thing you think you need to do.

Understanding how it works makes everything much easier.

Docker, like git, has a bad user interface that interferes with its usage in the 10 percent use case.

I think most devs should be using a docker-compose file. It makes life much easier.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Thermopyle posted:

Docker, like git, is pretty easy for the 90 percent use case if you take the time to read the docs thoroughly instead of just Googlin for the one thing you think you need to do.



I think I found the problem. :v:

NotWearingPants
Jan 3, 2006

by Nyc_Tattoo
Nap Ghost

Thanks!

NotWearingPants
Jan 3, 2006

by Nyc_Tattoo
Nap Ghost
I was contacted by an old client that I did a php/mysql application for over 12 years ago. They wanted a few updates. I was completely amazed that not only is the app still running, but they are still using it at the core of their business.

Among the things I found was a comment before a debugging library include that read // REMOVE THIS IN PRODUCTION!!!!

and apparently my pagination scheme did not stand the test of time:

Vincent Valentine
Feb 28, 2006

Murdertime

Genuinely curious: Are you going to provide a Few Updates™?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I built an Access 93 database for a small business when I was a teenager.

I heard a few years ago they were still using it on a Windows 95 machine.

NotWearingPants
Jan 3, 2006

by Nyc_Tattoo
Nap Ghost

Vincent Valentine posted:

Genuinely curious: Are you going to provide a Few Updates™?

already done. You'd think that with an app like that they would need serious changes, but it was stuff like "update our address and logo on the invoices" and "add a new code in the codes dropdown" and "this one date is always 4 hours off". They didn't mention the pagination thing so I didn't touch it.

It was a little scary. The server hasn't been updated in around 8 years, and I didn't want to start doing updates because then everything might have stopped working. There's no source control at all. I was thinking of installing git, but I figured I'd probably need to do an apt-get update to install it.

The Dark Souls of Posters
Nov 4, 2011

Just Post, Kupo
I know Docker just enough to not break it, but definitely use it via CLI and my understanding is that most standard docker builds are up at docker-hub.

https://hub.docker.com/

Now that I use it regularly and switch between different micro services the company I work for maintains, all with different versions of rails, ruby, and Postgres, I find it absolutely critical.

Roadie
Jun 30, 2013

Awesome Animals posted:

Now that I use it regularly and switch between different micro services the company I work for maintains, all with different versions of rails, ruby, and Postgres, I find it absolutely critical.

I've always felt like the software world being ridiculously terrible at versioning compatibility like this is 95% of why Docker exists.

underage at the vape shop
May 11, 2011

by Cyrano4747
Hey, I wanna build a website for myself while I'm between jobs/semesters at uni. I really don't know all that much about whats popular and in demand at the moment and would look good to an employer. I was thinking of going with react because I'd done a bit of that before, but not for a while

Ape Fist
Feb 23, 2007

Nowadays, you can do anything that you want; anal, oral, fisting, but you need to be wearing gloves, condoms, protection.
Vue is easy.

prom candy
Dec 16, 2005

Only I may dance
Tech can be kind of regional so check job boards around you but I think React is still the most in demand. Gatsby is probably the best way to build a personal site with React.

The Dark Souls of Posters
Nov 4, 2011

Just Post, Kupo

Roadie posted:

I've always felt like the software world being ridiculously terrible at versioning compatibility like this is 95% of why Docker exists.

I think you’re right on. It’s the exact reason it’s encouraged at my place of employment.

Vincent Valentine
Feb 28, 2006

Murdertime

Same for us. You need specific versions of both Java and Node running for each of our projects, so we just dumped everything into docker containers that mimic production servers and it solved a ton of problems.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Vincent Valentine posted:

Yeah that's been my experience. If you want someone's username and password, just ask. They'll tell you.

If they don't, suggest that they have to move five feet and spend 30 seconds typing in a username and password. They'll be so frightened of work they'll write them down for you!

The number of passwords I know from not-even-intentional social engineering is immense.

Vincent Valentine
Feb 28, 2006

Murdertime

PT6A posted:

If they don't, suggest that they have to move five feet and spend 30 seconds typing in a username and password. They'll be so frightened of work they'll write them down for you!

The number of passwords I know from not-even-intentional social engineering is immense.

The guy in the seat next to me told me his password once. I didn't ask him for it. I told him to log in on his machine and check a bug out, to see if it was account specific. He just goes "Oh log in with mine, my username is my first and last name and my password is Capital-P Password123"

I just kinda went "uhhhhhhhhhhhhhhhhhhhhhhhhhhhh, well, it's a good thing we change those every 60 days." "Oh I just change it to the same thing every time. If you put a whitespace character at the end it counts it as different, but then trims it off on submission."

edit: Password123 was his actual password by the way.

Vintersorg
Mar 3, 2004

President of
the Brendan Fraser
Fan Club



Can we ask Vue questions here? I am stumbling and I am not sure what to do.

I have a calendar that is being used with a min-date prop that goes to today. How would I set it up that it allows you to pick up to 7 days in the past too?

code:
<v-date-picker
mode='range'
v-model='selectedDate'
:min-date='new Date()'
is-inline
is-required
show-caps>
</v-date-picker>
I tried adding something to my computed area but it just kept erroring out. I can't find much online for this. :(


E: Solution, ugh, why didn't I try this earlier.

code:
:min-date="new Date(Date.now()-604800000)"
Date calculated using milliseconds.

Vintersorg fucked around with this message at 16:09 on Oct 25, 2019

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Vintersorg posted:



code:
:min-date="new Date(Date.now()-604800000)"
Date calculated using milliseconds.

/me eagerly awaits daylight savings time derail

The Fool
Oct 16, 2003


Lumpy posted:

/me eagerly awaits daylight savings time derail

How about we just skip all of that and I just post this video now:
https://www.youtube.com/watch?v=-5wpm-gesOY

Vintersorg
Mar 3, 2004

President of
the Brendan Fraser
Fan Club



:lol:

Well, poo poo - what to do? Just leave it? This calendar is only ever gonna be used in our place - but we do recognize DST. :3:

The Fool
Oct 16, 2003


Just use a library like moment

Ape Fist
Feb 23, 2007

Nowadays, you can do anything that you want; anal, oral, fisting, but you need to be wearing gloves, condoms, protection.

The Fool posted:

Just use a library like moment

That's not going to solve all your problems trust me.

prom candy
Dec 16, 2005

Only I may dance
ban all time zones

Vincent Valentine
Feb 28, 2006

Murdertime

Ape Fist posted:

That's not going to solve all your problems trust me.

Well, all he needs to do is select seven days ago. For that purpose it will. It's just a matter of moment(new Date).subtract(7,"days"). You get all the time zone stuff for free.

It's probably not ideal for public facing international appointment based business, but for what they're describing, it's sufficient.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

prom candy posted:

ban all time zones

Everyone laughs at me when I tell them I’m on Swatch internet time.

uncle blog
Nov 18, 2012

Hi guys. Our React app loads some data from a graph db. We are currently using Apollo for this, and I'm a bit unsure of best practices and how this service is supposed to work with states.

We load a list of different "goals" a user can choose from. This is done in the App.tsx component, which contains routes all the other pages. We also have a state object for which "goal" the user has chosen. We initially loaded all the goals from a static json, and would initialize the chosen goal state object from this json list. But now we need to set this as one of the loaded goals, when useQuery has finished loading the data. So I figured I would use useEffect for this. But this isn't working properly and feels wrong, like I'm missing something about how Apollo should be used?

code:
const App = () => {
  const {
    loading: goalListLoading,
    error: goalListError,
    data: goalListData
  } = useQuery(GOAL_LIST_QUERY, {});

 const [userGoal, setGoal] = useState({ id: "", Description: "", Name: "" });

 useEffect(() => {
    if (goalListData && goalListData.contexts) {
      setGoal(goalListData.contexts[0]);
    }
  }, [goalListData]);

Also, to handle errors on the page where the goals can be selected, I wanted to pass in the error object from useQuery as a prop. But again, this feels like I'm working against the conventions of Apollo and that I'm doing a bunch of hacky poo poo?
code:
<Route
          exact
          path="/goal"
          render={props => (
            <GoalPage
              prevPath="role"
              nextPath="obstacle"
              isError={goalListError ? true : false}
              onGoalChange={handleGoalChange}
              {...props}
            />
          )}
        />

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

uncle blog posted:

Hi guys. Our React app loads some data from a graph db. We are currently using Apollo for this, and I'm a bit unsure of best practices and how this service is supposed to work with states.

We load a list of different "goals" a user can choose from. This is done in the App.tsx component, which contains routes all the other pages. We also have a state object for which "goal" the user has chosen. We initially loaded all the goals from a static json, and would initialize the chosen goal state object from this json list. But now we need to set this as one of the loaded goals, when useQuery has finished loading the data. So I figured I would use useEffect for this. But this isn't working properly and feels wrong, like I'm missing something about how Apollo should be used?

code:
const App = () => {
  const {
    loading: goalListLoading,
    error: goalListError,
    data: goalListData
  } = useQuery(GOAL_LIST_QUERY, {});

 const [userGoal, setGoal] = useState({ id: "", Description: "", Name: "" });

 useEffect(() => {
    if (goalListData && goalListData.contexts) {
      setGoal(goalListData.contexts[0]);
    }
  }, [goalListData]);

Also, to handle errors on the page where the goals can be selected, I wanted to pass in the error object from useQuery as a prop. But again, this feels like I'm working against the conventions of Apollo and that I'm doing a bunch of hacky poo poo?
code:
<Route
          exact
          path="/goal"
          render={props => (
            <GoalPage
              prevPath="role"
              nextPath="obstacle"
              isError={goalListError ? true : false}
              onGoalChange={handleGoalChange}
              {...props}
            />
          )}
        />

Seems to me the query and state are one level up from where they should be. GoalPage should care about that stuff, not App. If for some reason the whole app does care about that, you could use Context to make common state shared, or keep it in @client in the Apollo store and have queries inside components that care about it (or just have them duplicate the apps useQuery if it is cached)

Lumpy fucked around with this message at 17:17 on Oct 28, 2019

Tei
Feb 19, 2011

My experience with docker (and a opinion about Python):

I am carefull about anything build around Python. Python is great, amazing even, and the people that develop systems under Python generally know what they are doing, but Python itself is poorly integrated in the OS. Is almost as if Python where designed to work inside a virtual machine, but somebody changed the design the last minute. On Linux, updating Python often present different paths and tools (apt, pip, ...) I have seen python use multiple pip versions for multiple Python versions.
On top of that theres some system to "generate a custom made enviroment" for a single Python app so this enviroment have version X and version Y of libraries.

Python comes with the batteries included, but sometimes it comes with 8 different types of batteries and you have to negotiate the volt levels not to break something.
Also breaking Python on a Debian based system is scary because apt is build with Python.

Before I was getting accustomed to editing Dockerfile files, I was introduced to docker-compose.yml. Dockerfile is not a right-mind name for a config file, but Okay, I accept your playerstyle, but docker-compose.yml is a completely different scheme of name conventions. The whole thing feels like trying to give a massage to mister elastic.

Getting things to work with Docker don't seems specially hard, and once everything works is like magic. Interacting with docker is overly complex, with many layers of obfuscation you have to understand.

I am a idiot. I design systems that are easy to understand by a idiot. My problem with Python and some tools generated in python is that are designed by smart people and they leak abstractions and present powerfull but complex enviroments that also may break in hard to fix ways.

Docker is great, thanks to the developers that made it real!.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

You should never use the system python unless it's a system script.

Always use virtual environments.

Every language has the same leaky abstractions problem.

Python has a bad packaging/dependencies story.

Vitual envs are an ok solution to that.

Tei
Feb 19, 2011

Thermopyle posted:

You should never use the system python unless it's a system script.

Always use virtual environments.

Every language has the same leaky abstractions problem.

Python has a bad packaging/dependencies story.

Vitual envs are an ok solution to that.

Yea, the last time I used somebody program made in Python, it hosted it inside a virtualenv. Easier that way.

Docker is kind of the same idea, for loving everything.

Newf
Feb 14, 2006
I appreciate hacky sack on a much deeper level than you.
Is it possible via CSS to disable autofocus from child elements? If not CSS, any suggestions for another avenue?

Vintersorg
Mar 3, 2004

President of
the Brendan Fraser
Fan Club



Thanks for all the suggestions. :) We do have moment built in already I learned which is rad and I will adapt this to use that.

Adbot
ADBOT LOVES YOU

Roadie
Jun 30, 2013

Lumpy posted:

Seems to me the query and state are one level up from where they should be. GoalPage should care about that stuff, not App. If for some reason the whole app does care about that, you could use Context to make common state shared, or keep it in @client in the Apollo store and have queries inside components that care about it (or just have them duplicate the apps useQuery if it is cached)

Yeah, part of the whole reason to use GraphQL is that you can just staple read-only queries to whatever specific UI components are using that data, and it will then (if you have it set up right) debounce all the query stuff globally.

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