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.
 
  • Locked thread
AWWNAW
Dec 30, 2008

HoboMan posted:

gently caress, I got this button that pops up a dialog that stops working if i change something unrelated in the html. what the hell?

lol ur a web developer now

Adbot
ADBOT LOVES YOU

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
clearly not. real web devs find this perfectly normal

JawnV6
Jul 4, 2004

So hot ...

CRIP EATIN BREAD posted:

i never did anything with verilog, just VHDL, and that was p. cool.

that was a decade ago, tho.

vhdl is verilog that you type out 3 times for no discernible reason

HoboMan
Nov 4, 2010

AWWNAW posted:

lol ur a web developer now

oh no you're right. when my boss asked if i know any javascript last week i should have just said "no" instead of "very little".

how is all of this so poo poo to work with? like IDEs exist because coders hated dealing with all the poo poo it handles for you, but no one ever thought to do this with web poo poo?

is there a way i can break on a button getting clicked despite not knowing what it does when you do? because this button does a thing despite it not referencing any functions.

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

HoboMan posted:

oh no you're right. when my boss asked if i know any javascript last week i should have just said "no" instead of "very little".

how is all of this so poo poo to work with? like IDEs exist because coders hated dealing with all the poo poo it handles for you, but no one ever thought to do this with web poo poo?

is there a way i can break on a button getting clicked despite not knowing what it does when you do? because this button does a thing despite it not referencing any functions.

What might be useful is pulling this up in Chrome, inspecting element, and in the view where it shows the CSS for that element, there is an event listeners tab, and you can go right to any jarvascript that is bound to that element.

Also, it's possible that there is a jquery snippet that is firing off a selector, and when you messed with the html, it made it invalid for that particular selector.

Have fun! :v:

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



HoboMan posted:

oh no you're right. when my boss asked if i know any javascript last week i should have just said "no" instead of "very little".

how is all of this so poo poo to work with? like IDEs exist because coders hated dealing with all the poo poo it handles for you, but no one ever thought to do this with web poo poo?

is there a way i can break on a button getting clicked despite not knowing what it does when you do? because this button does a thing despite it not referencing any functions.

Use chrome dev tools to see what has a click handler on the button, unless it's something that does it globally (I think jquery does it that way to cut down on the number of handlers?)

If it's not referencing anything in the HTML, something is referencing the selector for the HTML , check the ID and class for the button and see if anything is selecting and adding a handler off of those

You can use webstorm as an ide but I don't know how much it could help in this case

HoboMan
Nov 4, 2010

thanks guys, my mistake was trying to use ie for my debugger, I can already tell chrome's is way better

i will justify my use of ie by saying that's what the page is going to been seen in, 100% guaranteed


e: is this a mistake or some double assignment wizardry?
JavaScript code:
var search = document.getElementById("search").value = "Search";
e2: gently caress. my changes seem to be just fine and don't break anything in chrome

e3: annnnnd now ie has no problem with it either :confuoot:

HoboMan fucked around with this message at 22:58 on Apr 4, 2016

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

JawnV6 posted:

vhdl is verilog that you type out 3 times for no discernible reason

yeah i dont remember much about it other than i synthesized a vga controller, ram controller, NES controller adaptor (just a bit shifter) and made some silly tank game in pure hardware.

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



HoboMan posted:

thanks guys, my mistake was trying to use ie for my debugger, I can already tell chrome's is way better

i will justify my use of ie by saying that's what the page is going to been seen in, 100% guaranteed


e: is this a mistake or some double assignment wizardry?
JavaScript code:
var search = document.getElementById("search").value = "Search";
e2: gently caress. my changes seem to be just fine and don't break anything in chrome

e3: annnnnd now ie has no problem with it either :confuoot:

I could be wrong here but I think doing an assignment also returns the value that was assigned, so the local 'search' variable is set to document.BLAHBLAH.value which is set to "Search"

you may also want to set up some livereload thing and have ie and chrome side by side so they both refresh automatically when you make changes and you don't have to hope the ie version worked at the end

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

HoboMan posted:

So if you put just a function name or variable name in an if statement in javascript
e.g.
JavaScript code:
if (buttFunc)
this is a test for existence? also can I just negate this if I want a thing to happen if it don't exist?

e: the code i'm looking at seems to assume this is the case, but it's a broken mess so i want to double-check

dont do this, just do if(buttFunc === undefined)

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



HappyHippo posted:

dont do this, just do if(buttFunc === undefined)

won't work if it was deliberately set to null for a valid reason, doing == would work in that case but any linter would complain

it's perfectly fine to do if (fartFunction) {} if you know fartFunction will only ever be an object, function, or array

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

piratepilates posted:

won't work if it was deliberately set to null for a valid reason, doing == would work in that case but any linter would complain

it's perfectly fine to do if (fartFunction) {} if you know fartFunction will only ever be an object, function, or array

i would consider being set to null as existing but thats just me i guess

HoboMan
Nov 4, 2010

this looks interesting: http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrrldwideweb
can anyone recommend/condemn?

Arcsech
Aug 5, 2008

HoboMan posted:

this looks interesting: http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrrldwideweb
can anyone recommend/condemn?

for a long time, this was like The Javascript Book.

I'd think it's severely out of date these days, although that may be useful if you're working with a severely out of date code base

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

HoboMan posted:

this looks interesting: http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrrldwideweb
can anyone recommend/condemn?

176 blank pages :xd:

30 TO 50 FERAL HOG
Mar 2, 2005



HoboMan posted:

this looks interesting: http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrrldwideweb
can anyone recommend/condemn?

man thats a lot of money for a book with no pages

HoboMan
Nov 4, 2010

oh god, if you forget the var in your variable declaration javascript not only doesn't complain but assumes you want a global variable?
who would ever think that's a good idea?

akadajet
Sep 14, 2003

HoboMan posted:

this looks interesting: http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrrldwideweb
can anyone recommend/condemn?

it's not a bad book but you can just watch this to get an idea.
https://www.youtube.com/watch?v=hQVTIJBZook

and yeah, you'll want to look into some of the newer features of the language afterwards.

also don't use jslint bc not all of douglas crockford's opinions are that great. jshint and eslint are much better.

akadajet fucked around with this message at 01:59 on Apr 5, 2016

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!

CRIP EATIN BREAD posted:

has any multi value return function returned an error on the left side?

The reason Left is errors/exceptions is because the Functor and Monad instances of Either a b operate on b, because it's the last variable in the type.

code:
fmap :: (a -> b) -> f a -> f b
-- fmap :: (a -> b) -> Either e a -> Either e b
fmap _ (Left e) = Left e
fmap f (Right a) = Right (f a)

return :: a -> f a
-- return :: a -> Either e a
return = Right

(>>=) :: f a -> (a -> f b) -> f b
-- (>>=) :: Either e a -> (a -> Either e b) -> Either e b
Left e >>= _ = Left e
Right a >>= f = f a
Either e is thus a Functor and a Monad, as well as a Foldable, Traversable, and other things. In the same way, when working on pairs, fmap and >>= operate on the second element, and so on.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

HoboMan posted:

oh god, if you forget the var in your variable declaration javascript not only doesn't complain but assumes you want a global variable?
who would ever think that's a good idea?

use strict

e: "use strict";

akadajet
Sep 14, 2003

Jabor posted:

use strict

e: "use strict";

yeah, and a linter will let you know real quick if you gently caress that up

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

HoboMan posted:

oh god, if you forget the var in your variable declaration javascript not only doesn't complain but assumes you want a global variable?
who would ever think that's a good idea?

you're talking about javascript. nobody put any thought into this.

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



HoboMan posted:

oh god, if you forget the var in your variable declaration javascript not only doesn't complain but assumes you want a global variable?
who would ever think that's a good idea?

javascript was made in the span of something like two weeks to be rushed out to market

anyway that should be gone with strict mode, also use a linter, use eslint

FamDav
Mar 29, 2008

HoboMan posted:

this looks interesting: http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrrldwideweb
can anyone recommend/condemn?

how the hell did you find that link? obidos is like two rendering platforms ago.

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

FamDav posted:

how the hell did you find that link? obidos is like two rendering platforms ago.

looks like it's from douglas crockford's website: http://javascript.crockford.com/ (it's the link on the picture)

i think it's also an affiliate link

brap
Aug 23, 2004

Grimey Drawer
crockford is not that good of a resource

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

HoboMan posted:

oh god, if you forget the var in your variable declaration javascript not only doesn't complain but assumes you want a global variable?
who would ever think that's a good idea?

"use strict";

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

HappyHippo posted:

dont do this, just do if(buttFunc === undefined)

only do this if you have to check that buttFunc is specifically undefined.

you can't call it anyway if it's null, false, 0 (edit: or NaN), so you are probably not interested in it being undefined, but "falsy"

Wheany fucked around with this message at 06:08 on Apr 5, 2016

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
I don't know if javascript: the good parts has had newer editions, but if it hasn't, remember that it describes the situation like 5 years ago. a lot has happened since then.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Though to be fair, you also can't call it if it's like, 2.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Jabor posted:

Though to be fair, you also can't call it if it's like, 2.

true. but if(something) is idiomatic.

Asshole Masonanie
Oct 27, 2009

by vyelkin
project manager said he knows enough SQL "to be dangerous" and i'm so excited for the future

Corla Plankun
May 8, 2007

improve the lives of everyone

Power Ambient posted:

project manager said he knows enough SQL "to be dangerous" and i'm so excited for the future

in my experience that means he knows how to do it but doesn't want to at all. its good

JawnV6
Jul 4, 2004

So hot ...

Wheany posted:

"use strict";
amazing use of sarcastic quotes

Wheany posted:

true. but if(something) is idiomatic.
of all the goofy corners of C to copy

FamDav
Mar 29, 2008

JawnV6 posted:

amazing use of sarcastic quotes

I don't know if you're being sarcastic but it's a string so it's backwards compatible with js engines that don't support strict mode.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

JawnV6 posted:

of all the goofy corners of C to copy

well it's not like c where everything is actually an int, it's just that everything coerces into any other type automatically

(not really)

Soricidus
Oct 21, 2010
freedom-hating statist shill
backwards compatibility is like 90% of the reason why webdev is such a shitshow

i mean, sure, there's no realistic alternative in the real world, but it's still true

Workaday Wizard
Oct 23, 2009

by Pragmatica
hi how do i start learning vhdl verilog c:lambda:ash when I don't know poo poo about hardware ee stuff? are there simulators for babbys?


I'm thinking about making a simple (LOL) network switch.

Bloody
Mar 3, 2013

Shinku ABOOKEN posted:

hi how do i start learning vhdl verilog c:lambda:ash when I don't know poo poo about hardware ee stuff? are there simulators for babbys?


I'm thinking about making a simple (LOL) network switch.

step one drink until house have cirrhosis of the liver

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

Basically everything in hardware land is a proprietary hellhole. for idiot spare time fuckery one of the cheap zedboards or similar zynq boards and the terrifying nightmare hellscape that is xilinx vivado is probably the way to go? I guess?

you could also use like icarus verilog if you strictly wanna gently caress with the languages

  • Locked thread