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
Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Cheen posted:

Isn't passport supposed to be creating a cookie for me? I have serializeUser and deserializeUser on my backend, and I know that serializeUser is getting called when I login.

Usually you'd ensure persistence of login via a session. Passport does do this automatically, but you need to configure it to play nice with whatever other frameworks you've got messing with the session. See step 3 here:
http://www.passportjs.org/docs/configure/

Adbot
ADBOT LOVES YOU

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Nakedyoghurt posted:

I'm trying to create a webscraper that fetches my hand history from a poker web app, using the selenium module with python. I'm passing js code to the selenium module to execute, but im getting kind of stuck.
so far i have been able to log in and navigate to the history page. But for some reason i can't seem navigate through the dates.

The snippet below works fine and takes me to the history page shown below:
code:
driver.execute_script("document.getElementsByClassName('menu-item')[3].click()")
checking class names


trying click() on the arrow classes. I have checked that the correct object/class was selected before trying the click() method.



Any help is appreciated.

I don't see any event handlers on either of those elements so it seems to me that whatever javascript is causing mouse clicks to trigger date changes is hidden somewhere else. Maybe have a look in their script code?

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

ulmont posted:

What is the current hotness in IDE for javascript? I've been bumbling through on my toy projects with emacs and the chrome console, but I think at some point I may want to upgrade a bit.

Vscode.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer
I'd suggest assessing the outcome of your different ideas using something like http://jsben.ch/ and then coming back to check if someone has a better idea than your best one, rather than frontloading the question like this. You should know by now that your way of doing things is always going to be weird to the rest of us so it's unlikely we'll have something ready off the shelf for you.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

LifeLynx posted:

That might not work because this is in a mapped array with sometimes dozens of images, and that won't work unless each has its own unique useState, right?

Is there a place I can show code for a critique/suggestion? I made something functional that I'm proud of, but I've only been teaching myself React for about a month so I'm sure I've made a bunch of mistakes or didn't do things the React way. It's been about two months since I've thought about using Javascript for more than simple DOM manipulation.

Jsfiddle or glitch.io are common places to put demo code, or github.io if you want it more associated with you.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Ola posted:

I'm new to development, and I've got a job making a web app this summer (it might be mobile apps, but think it'll be web so far) and have some framework questions. Basically, do I need any? The user will be entering some data, some simple calculation from a static model will be output on the screen and saved to local storage, with the option of saving to JSON or Excel. So far I've figured I need to import some CSS templates since I suck at CSS, and an Excel library. Otherwise I think I can write everything myself, but should I? One relevant reason I can think of is it's nice to have a framework to namecheck on my CV.

To be honest, the answer to this question is: do you want to learn a framework? If not, vanilla JS should get you there no problem.

CV-wise, to be honest I would be more likely to hire someone who's skeptical of frameworks and has taken the time to figure out what actual JS can do than someone with a buzzword CV, but that's just me.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer
Alternatively, just use separate repos for your submodules and then use yarn/npm link to do symlinked development without having to push all the time?

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer
charray

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Cheen posted:

I'm tackling as my next ticket a refactor of an angular component. It's pretty big, over 1,000 lines, 60 variables are being stored, and a number of functions that I think I could refactor or remove. I'm considering strategies for how to go about this- I've never done a refactor like this before. Is there any reading that anyone would recommend or tips n' tricks for handling this?

Edit: I should add that the goal is not to refactor for refactoring's sake, but rather that this is one of the oldest views in the app and a lot of new functionality that is going to be added in the future is going to include it. I want to make it so that adding that new functionality is a lot easier than it currently is.

Move everything that's not directly acting on gui elements into services that you unit test, and then go you can hog wild with refactoring without worrying about breaking poo poo.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Boris Galerkin posted:

Thanks for the advice.


I’m using yarn because it’s available in macports and npm isn’t. I don’t use homebrew. Is there a compelling enough reason for me to install homebrew just to install npm over just using yarn?

No, yarn is superior last i checked.

Also I've never heard of a nodejs installation that doesn't come with npm, interesting.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer
There's always the option of just using the node-turn part as regular JS? Create your own wrapper interface with some any type overrides if you want to isolate that part from your typed code.

I may be missing something though, I'm only getting started with this stuff myself.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer
Look into webpack.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

The Fool posted:

I don’t have a lot to add to this conversation except that React functional components + hooks + typescript is super pleasant to work with

Amen. I love it.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Sous Videodrome posted:

I know this thread is dead, but I wrote a beginner tutorial. It walks you through creating a simple express server that adds meme text to images. The tutorial also shows how to host the app on heroku

https://jacobwicks.github.io/2020/08/10/make-memes-with-express-and-canvas.html

Is there a more lively javascript thread on the forums somewhere?

Very nice work. I feel like you pass a bit too quickly over some concepts like async/await which can be confusing, but it's a great jumping-off point for people to go learn about such things from. It reads a bit like something written by someone who's gotten far enough into a subject that they've forgotten what was initally difficult for them, if you see what I mean.

Somehow discussion of javascript is more diffuse across other threads rather than concentrated here (and mostly consists of disparaging / complaining, often justifiably).

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Boz0r posted:

I'm trying to use Microsoft Authentication Library to get an Azure token from a web resource written in typescript in Dynamics 365. These web resources are just embedded js files, and I'm not a javascript dev, so I don't know how to pack an npm package into a single js file. Also, when I copy the *.d.ts files to my project the import paths in those files are wrong.

Are you writing your own nodejs application, or are you trying to bundle a web application?

Typically if you're copying files around by hand you're doing something unusual, npm or yarn are used to manage dependencies on external code. If you then import from those dependencies it should also automatically grab any type definitions.

If you want to bundle a web application into a single js file, the most common approach is to use webpack.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer
I ain't helping with no bitcoin

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Roadie posted:

node-postgres is dead easy to use for a Node server.

JavaScript code:
const { Pool, Client } = require('pg')

// a  set of env vars will be used to initialize the connection
const pool = new Pool()

const res = await pool.query('SELECT $1::text', ["here's some text"])

// shut down the pool when stopping the server
await pool.end()



Yeah node postgres is fine. Don't connect directly to database from browser please.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

redreader posted:

You're going to laugh and laugh, but I just reversed a string in javascript and it was exactly the same as typescript. So lol, phew. Time to do some more basic-rear end exercises but that's the #1 interview screening question in my experience.

Typescript is literally a superset of ES6. They only added type stuff. Don't worry about it. Use babel to transpile to whatever javascript version your platform supports and you're good.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Chas McGill posted:

Any recommendations for a react rich text editor that can export to markdown? Currently looking at Draftail.

We've been happy enough with this one https://github.com/jpuri/react-draft-wysiwyg. Looks like both are built on top of draftjs either way.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

LifeLynx posted:

Alright, here it is: https://codepen.io/LyfeLynx/pen/ExgdmoM

It seems to work well. The only problem I have is that the order keeps going up and up. It assigns every item an order number at the start, and keeps incrementing the flex order by 1 every two seconds. The easiest thing I can think of is to periodically reset it by fading the carousel out, say if the flex order reaches 3000 because no one's looking at this for six minutes, doing the prepareCarousel, and then fading back in.

I think it's perfectly functional, but I'd definitely prefer coding and writing a different style where for example the images are not already hardcoded in the html but added from data in code, and where there's fewer globals. I definitely would rather be taking the head off the list of images and adding it to the tail rather than doing index math for example.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Empress Brosephine posted:

is there anyway to access the Dom and do javascript css manipulation with Express/Node?

Like say I want to have a conditional on a form, if you check this box open up these two fields from display:none to whatever?

I think I might be hitting a point in my project where PUG needs to be replaced with a full on front end system?

Thanks!

That's frontend js stuff, unless you do all your rendering server side in which case you'd send the state of the page back to the server for every action and get fresh html. Probably more complicated for a small use case than just having some frontend js

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer
Our approach is: end to end/integration tests against api endpoints, and untested thin handler functions that take the relevant data off requests and pass them to the actual logic functions which are unit tested, and return data which are then put on the responses again by the thin function.

Basically mocking requests is making your life more difficult in order to test mostly other people's code (express or whatever)

Osmosisch fucked around with this message at 13:14 on Mar 2, 2021

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Dancer posted:

Hi goons.

So, I'm a junior front end dev. I've had a total of 3 months of training, then managed to score a job right after, so feel free to explain things to me as if I'm stupid.

I am trying to get rid of a React warning, and I've managed to do it but I feel like my fix doesn't qualify as "good code", so I wanted to ask for advice.

The problem:

code:
  useEffect(() => {
    fetchGroups();
  }, []);
I get the react-hooks/exhaustive-deps warning.
If I add fetchGroups to the dependency array (and I add a silly console.log to the fetchGroups function) then I see that the function is triggered on every render, because although the function might be unchanged, its ref isn't.

This can be fixed with:

code:
  const fetchGroupsMemo = useCallback(fetchGroups, []);

  useEffect(() => {
    fetchGroupsMemo();
  }, []);
but I feel that this is a bad pattern, maybe? The compiler's inherent worry that "fetchGroups might change between renders" is not counteracted in any way by this. I just shift the dependency array from one hook to the other, and bypassing the array's function either way.

The in my mind best way to do this would be, because fetchGroups truly never changes, to move fetchGroups to a separate module and import it in (because that makes it non-mutable). Problem with this is I am using notistack to report whether the fetch has been successful, and notistack needs to be inside a component. This is also what's stopping me from moving the fetchGroups function inside the useEffect hook, because then I'd have to also add notistack's enqueueSnackbar as a dependency, and I feel like that would cause pure chaos in my app's memory, and would trigger who knows how many re-renders at weird times.

It depends a bit on context, but I think the case might be that there actually are dependencies that your useEffect should be relying on. If it's a completely stateless fetch, the current implementation is fine, but it's not all that necessary to fetch it in the component every time, and you might as well provide it from a context higher up.

Either way, I found this discussion on the linter rule pretty helpful when thinking about such things: https://github.com/facebook/react/issues/14920#issuecomment-471070149

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Lumpy posted:

I don't find it a pain at all. Again, could you provide a specific example of something that is giving you troubles? It's hard to help someone who is railing against vagaries.

In the meantime, how the large apps I have done handle things in a very general way:

* The bits of state that actually need to be global (ex: the User) are in contexts. The content of them can be accessed anywhere in the app with hooks, so I don't need to pass the user down as a prop all over the place. The same thing can be accomplished by using a state management solution like Redux, and connecting components that need the user to it.

* All other data lives as close to where it needs to render. If there is a complex tree / lots of different things might use the same data in one part of the app, another context is created and hooks are again used to expose that data as needed without crazy prop drilling.

* For complicated state changes in parts of the app due to lots of user interaction, useReducer is used to manage that state, again as close to the point it is needed as possible.


There are cases where all your data / state is better off being global. That's why Redux (or other global state managers) exist. There are cases when your data / state is highly compartmentalized. That's why contexts and useState exist. There are cases when your data is both. That's why you can use both together. That's why I like React.

This follows my experience as well, for what it's worth. Context and hooks + pure components work very well for us.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer
So for your layout example, you're saying that's the children need to notify the parent of their rendered size? What's wrong with having them just call a setter provided from the parent context? You can wrap that in a debouncer that aggregates calls if you want to minimize rerenders.

Rendered size is a weird part of application state that I'd not really considered part of actual informative state before, interesting.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Empress Brosephine posted:

Yeah weather is an array within an array so that should work. Tbh I would just map over it because that means at some point you're going to run into multiple weather's, so something like'



JavaScript code:

<Ul>
theWeather.weather.map(conditions => { <li><p>{conditions.main}</p></li>};)
</Ul>

Should get you what you want I believe

Yeah, just remember to set a key on each li.

In general, you can't just plonk any old object into a react jsx with curlies, it needs to be a primitive or an element itself.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Sab669 posted:

Hey dumb question - I just started a job yesterday that uses Angular, which I've never even so much as looked at before yesterday. I'm following along with the shopping cart tutorial on angular.io and on a previous step they had me add:

code:

[routerLink]="['/products', product.id]"

to an anchor tag.

On this step I'm up to now, the syntax they tell me to add to a button is:

code:

routerLink="/cart"



Why the brackets for the attribute / value in the first example and not the second? Does it not really matter and it's smart enough to infer what was meant?
It checks whether the argument is an array or string; in the first case, all elements beyond the first are passed in as route parameters.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Combat Pretzel posted:

Regarding React... or rather running a development server.

I've set up a React Typescript project, eventually linked my own libraries, when everything went to poo poo. It primarily got upset at the async keyword being present in my linked Typescript code, yapping something about loaders. Not being evident how to fix it in the template itself, I just upgraded to and set-up Webpack 5 et al from scratch. Now the React Router stuff doesn't entirely work. On the setup of the React template, refreshing the page in the browser, the site picked up where it should, whereas on Webpack's dev server, I just get an "Cannot get /a/b/c" error, if I load into anything other than /. Essentially, clicking my way through React Router links itself works fine, until I want to refresh the page in place.

I suppose this is just a configuration problem, since you'd probably want it to always load behind the scenes into / regardless of URL, but I don't see how. The same issue would probably happen on eventual deployment, so it'd be nice to know.

Not sure about the webpack dev server part, but on a live deployment you just make it so each backend route (outside of whatever custom API routes you have) serves the same SPA bundle, and have the react router handle the rest.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Saoshyant posted:

Anyone familiar with Angular? I was trying to help a student working with it and, boy howdy, am I not experienced with this framework enough to figure out what we are doing wrong here.

So, we get all content dynamically from a backend API. This works great up to a point. The main menu, for instance, is getting everything generated fine, but when we access the routerLink for a topic from this menu, on the first time it activates what's on ngOnInit and loads the data correctly (there's an Angular service call here, which gets the data from an Observable, which I gather is the correct way to do this), but after that, every other click on the menu does nothing even though the URL parameters change in the browser. ngOnInit is only called once and never again after the first click in the menu, even though we are accessing different pages in this route.

My assumption is that ngOnInit is not supposed to be used in this way, then. The Angular tutorials I found don't seem to point out what we should be doing instead though, and what few StackOverflow answers I found were people hacking and hammering things around this limitation.

ngOnInit is only ever called once according to the docs. It looks like you're trying to respond to the routing data changing? I'm not quite clear what your desired behaviour is exactly. Please provide a bit more detail about the app structure, and what changes/actions you expect to propagate.

Maybe have a look here: https://ultimatecourses.com/blog/exploring-angular-lifecycle-hooks-onchanges

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

LifeLynx posted:

Alright, I'm trying to do this the React way and not seeing a good way to do it. In the non-React world, I've done things like this:

code:
<p data-anim="fade-in">This will fade in when it's in view.</p>
With an IntersectionObserver watching for the data-anim attribute and giving/taking away the classname specified with data-anim. I use querySelectorAll for this. In React, that's harder to do because of the virtual DOM, but I want to make it work the same way. I found [url="https://"""]react-intersection-observer[/url] but it's stumping me because it keeps only triggering if everything with useInView or InView is visible, which is very not what I want.

What I want is to be able to do something like this:

code:
<p data-anim="fade-in" className={ `is-page-height ${inView}` }>First Element</p>
<p data-anim="fade-in" className={ `is-page-height ${inView}` }>Second Element</p>
(For the sake of argument, .is-page-height is min-height: 110vh or something to make sure they're not both on the screen at the same time.)

Am I thinking about this the wrong way? It took me a while to accomplish my previous goal of getting WPGraphQL to cooperate, so my brain is mush.

Maybe throw up a fiddle/codepen with the minimal attempt you describe above? In general setting classes and other properties via react isn't an issue, and the hook listed in the package you linked should do what you want.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer
Sequelize is by far the most popular ORM, but I'd advise against using it, and instead use a nice query builder like knex so you have control and don't need to learn yet another ORM plus its pitfalls.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

LifeLynx posted:

I've been teaching myself Next + Sanity.io, and I'm stuck in a similar place I was last time I tried to work with a data set.

code:
{movieData.map((item, i) => {
  <span key={i}>{item.title}</span>
}
...but when I try anything like that it tells me it found an object with keys instead of an array.

I don't know next or sanity, but this code block is missing a return statement, or should not have curly braces around the span.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Combat Pretzel posted:

Help me understand the default theme of Material UI. Is it intentional that none of the components have any padding/margin/spacing by default?

Say if I create a Paper element with three buttons inside, it's all caked together without any whitespace at all. I'm using createTheme, ThemeProvider and even CssBaseline. From what I can tell, it's applying the default theme, because colors change if I say modify it in createTheme.

You can specify your layout and any padding/spacing with Grid components.

If that's overkill, take a look at the spacing properties: https://material-ui.com/system/spacing/

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Kwolok posted:

Unfortunately an API is too slow for how frequently we need these calculations done. The front end must be incredibly responsive.

If you need a very responsive UI that also does a lot of complex calculations I have to say a python/JS combo is not where I would have gone, but instead opted for something native.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

gbut posted:

Speaking of http/2/3, is anyone following the latest Firefox fiasco? Apparently telemetrics are interfering with its http/3 implementation, so you need to disable one or another to get a functioning browser. I was wondering what was going on and blamed it on my ISP the last few days.

e: it manifest as random dropped/hanging requests

gently caress so that's what's going on, thanks. Was driving me crazy.

Looks like it wasn't telemetrics per se actually
https://bugzilla.mozilla.org/show_bug.cgi?id=1749908#c21

Osmosisch fucked around with this message at 15:07 on Jan 13, 2022

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

gbut posted:

Yeah, seems like telemertics might have just triggered the issue. loving Mozilla. Now I have to look for another browser.

Eh, one morning of weird issues until they fixed their poo poo is not sufficient to switch to one of the even more evil browsers.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

echinopsis posted:

ok so I am a baby,

on a webpage, what's the accepted way to do an infinite loop

this page is a game, a idle game, so I am constantly calculating countdowns etc

Just use while(true) if you're just getting the hang of things.

Or put a stop condition like pressing escape in the while condition.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer
Agreeing that following your progress has been fun!

You could look into hosting on glitch, they have a lot of features for free pet projects like this one, up to and including dbs/logins as I understand it.

Time to rack up some more notoriety.

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer
I'm also happy to hop on and help, though I'm on CET. Plenty of time this weekend, or most evenings my time.

Adbot
ADBOT LOVES YOU

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer

Sab669 posted:

I wasn't really sure how to define just like an array of arrays, or an array of generic objects.


JavaScript code:

T[][]
Should work in a generic context. Your mistake was nesting the brackets.

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