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
Shaggar
Apr 26, 2006
just data-bind the class to an observable in your viewmodel and then update the observable when you want 2 change class.

Adbot
ADBOT LOVES YOU

Pittsburgh Fentanyl Cloud
Apr 7, 2003


Shaggar posted:

just data-bind the class to an observable in your viewmodel and then update the observable when you want 2 change class.

actually, if I want to change class I just go visit Bahamut.

Stringent
Dec 22, 2004


image text goes here

FamDav posted:

no i mean like lets say i do some some poo poo like

$(selector).removeClass(class0).addClass(class1)

can i make any guarantees on the page never showing those elements w/out class1 or what

just so we can have the full scope of how bad your situation is, why are you trying to do that in javascript instead of css or html?

Asshole Masonanie
Oct 27, 2009

by vyelkin

Shaggar posted:

just data-bind the class to an observable in your viewmodel and then update the observable when you want 2 change class.

this is correct. also use angular.

Asshole Masonanie
Oct 27, 2009

by vyelkin

Citizen Tayne posted:

actually, if I want to change class I just go visit Bahamut.

Shaggar
Apr 26, 2006

HTML5 posted:

this is correct. also use angular.

angular looks stupid and overly complicated.

Plastic Snake
Mar 2, 2005
For Halloween or scaring people.

Shaggar posted:

angular looks stupid and overly complicated.

it is. if you have to write a javascript use knockout

Soricidus
Oct 21, 2010
freedom-hating statist shill
I'd sooner starve tbqh

FamDav
Mar 29, 2008
I just picked the smallest example of modifying a document.

GameCube
Nov 21, 2006

lol i'm trying to fix the javascript of some long-gone shitbird and that is exactly the line i'm encountering. looks like this guy was just following the jquery tutorial too

GameCube
Nov 21, 2006

he works for apple now

GameCube
Nov 21, 2006

anyway, somebody teach me javascript, please.

more like dICK
Feb 15, 2010

This is inevitable.
is OSGI something I should know about if I'm doing java? Neither the wikipedia page or the official homepage offer a good explanation of what it actually is.

double sulk
Jul 2, 2010

Werthog 95 posted:

anyway, somebody teach me javascript, please.

http://jquery.com/

Notorious b.s.d.
Jan 25, 2003

by Reene

more like dICK posted:

is OSGI something I should know about if I'm doing java? Neither the wikipedia page or the official homepage offer a good explanation of what it actually is.

osgi was an attempt to standardize a lot of the things left un-finished in j2se and/or botched in j2ee: classloader details, dependent components, application lifecycle

like all attempts to standardize it is really complicated. i have worked on osgi applications and i can't really explain osgi to you, like 90% of the code ended up a single bundle

tef
May 30, 2004

-> some l-system crap ->

more like dICK posted:

is OSGI something I should know about if I'm doing java? Neither the wikipedia page or the official homepage offer a good explanation of what it actually is.

osgi is a generic plugin architecture where you can both import/export services.It lets you communicate across the plugin boundary through a service registry.

it's been ~5 years since i had to write any osgi, i wrote an osgi wrapper for jython

Notorious b.s.d.
Jan 25, 2003

by Reene

tef posted:

i wrote an osgi wrapper for jython

he's seen j-beams glitter off the tannhauser gate
things you wouldn't believe

tef
May 30, 2004

-> some l-system crap ->
ask me about eclipse internals



did i ever tell you about using swt? it was bad enough that it was littered with pre 1.5 isms, so we had a ton of boilerplate around it to convert things to Arrays from Lists

the widget set was 'cross platform', which meant everything worked differently across platforms.

the vertical slider went from 0 to 100 on two platforms, and 100 to 0 on another

tooltips couldn't be displayed on a secondary display if it was left of the primary monitor

if you tried to have an updating tooltip, on one platform you could update the text, and it worked. on another platform, you had to use two tooltips and flick between them like some horrible throwback to double buffering

Notorious b.s.d.
Jan 25, 2003

by Reene
i tried to write a non-portable swt app, targeting only x11 (my entire userbase was linux), and failed. like, just failed. couldn't fix my own bugs, couldn't find anyone who could help.

there's a good reason only two applications have ever used swt. the look and feel is way nicer than swing but that's not enough

tef
May 30, 2004

-> some l-system crap ->
have a look at this swt issue would you ?

Nomnom Cookie
Aug 30, 2009



more like dICK posted:

is OSGI something I should know about if I'm doing java? Neither the wikipedia page or the official homepage offer a good explanation of what it actually is.

you know how app containers basically don't work? osgi is an attempt to solve this by adding lots of complexity

Valeyard
Mar 30, 2012


Grimey Drawer
OSGI is the one topic in the big lovely class i had this year that absolutely nobody understood, it was horrible

GameCube
Nov 21, 2006

so i'm trying to fix this javascript and i've never javascripted before

using the firefox debugger and it keeps breaking and offering no obvious reasoning as to why it broke. i have no breakpoints set so i assume it's an unhandled exception but i don't see any information about exceptions and i don't even know if javascript has exceptions

help

Pittsburgh Fentanyl Cloud
Apr 7, 2003


Werthog 95 posted:

so i'm trying to fix this javascript and i've never javascripted before

using the firefox debugger and it keeps breaking and offering no obvious reasoning as to why it broke. i have no breakpoints set so i assume it's an unhandled exception but i don't see any information about exceptions and i don't even know if javascript has exceptions

help

Javascript is completely unrelated to Java, which owns. haha.

Valeyard
Mar 30, 2012


Grimey Drawer

Werthog 95 posted:

so i'm trying to fix this javascript and i've never javascripted before

using the firefox debugger and it keeps breaking and offering no obvious reasoning as to why it broke. i have no breakpoints set so i assume it's an unhandled exception but i don't see any information about exceptions and i don't even know if javascript has exceptions

help

ctrl-z your code and keep executing till you find a point where it doesnt break, then figure out what line you added that broke it!!!

Notorious b.s.d.
Jan 25, 2003

by Reene

Kevin Mitnick P.E. posted:

you know how app containers basically don't work? osgi is an attempt to solve this by adding lots of complexity

the complexity was aleays there but often hidden.

debugging classloader issues is hell. porting apps between j2ee implementations is sometimes effortless and sometimes bottomless suffering. osgi gets really specific about classloader behavior and the order in which things get instantiated, because j2ee didn't

GameCube
Nov 21, 2006

i mean "break" as in the debugger broke u dork. why is the debugger breaking.

Notorious b.s.d.
Jan 25, 2003

by Reene
i don't really understand osgi but i understand at least one of their design goals

Share Bear
Apr 27, 2004

Werthog 95 posted:

so i'm trying to fix this javascript and i've never javascripted before

using the firefox debugger and it keeps breaking and offering no obvious reasoning as to why it broke. i have no breakpoints set so i assume it's an unhandled exception but i don't see any information about exceptions and i don't even know if javascript has exceptions

help

what is breaking in this sense? it stops running at a certain point? is there an ajax call or something that is asynchronous that fails?

the non-debugger browser console (not the web console) does not show an error either?

Share Bear fucked around with this message at 17:08 on Jun 5, 2014

GameCube
Nov 21, 2006

Share Bear posted:

what is breaking in this sense? it stops running at a certain point? is there an ajax call or something that is asynchronous that fails?

the non-debugger browser console (not the web console) does not show an error either?

the debugger breaks in a callback from a jquery function but the particular line it breaks on seems fine. no errors in the browser console anyway

oh and removing a comment fixed it :pwn:

Valeyard
Mar 30, 2012


Grimey Drawer
its hard to track down stuff when you have 1000 lines of code wrapped up in one function, then when something fails it just reports the problem being at like line 26 where the outside function starts, helpful!


Werthog 95 posted:

oh and removing a comment fixed it :pwn:

ive had this happen with C code before lol

GameCube
Nov 21, 2006

the IE debugger doesn't do it, lol. shaggar was right.

Nomnom Cookie
Aug 30, 2009



Notorious b.s.d. posted:

the complexity was aleays there but often hidden.

debugging classloader issues is hell. porting apps between j2ee implementations is sometimes effortless and sometimes bottomless suffering. osgi gets really specific about classloader behavior and the order in which things get instantiated, because j2ee didn't

right i mean making app containers work properly is super complex. osgi moves that complexity into the spec. hooray? i suppose someone has a use for it but i've never met them

Notorious b.s.d.
Jan 25, 2003

by Reene
the real answer to classloader/container hell: embed jetty in your app, run every component in its own jvm and its own unix service.

i used to poke fun at devs who did this until i tried it for myself in a hobby app. never, ever going back.

more like dICK
Feb 15, 2010

This is inevitable.

Notorious b.s.d. posted:

the real answer to classloader/container hell: embed jetty in your app, run every component in its own jvm and its own unix service.

i used to poke fun at devs who did this until i tried it for myself in a hobby app. never, ever going back.

I just started doing this as well. I got really sick of having to janitor Tomcat + WARs, so now every app is its own JAR that starts up jetty, and starts listening for HTTP connections from the load balancer. Surprisingly little code required to move from WAR + Tomcat to an embedded servlet container.

My opinion of Java really changed once I started doing this.

edit: I like a lot of Java now. I'm worried that makes me a bad or dumb person.

more like dICK fucked around with this message at 18:06 on Jun 5, 2014

tef
May 30, 2004

-> some l-system crap ->

Notorious b.s.d. posted:

the real answer to classloader/container hell: embed jetty in your app, run every component in its own jvm and its own unix service.

i used to poke fun at devs who did this until i tried it for myself in a hobby app. never, ever going back.

hold up, you mean people deploy java into shared environments like some horror from 90's web development?

Shaggar
Apr 26, 2006

tef posted:

ask me about eclipse internals



did i ever tell you about using swt? it was bad enough that it was littered with pre 1.5 isms, so we had a ton of boilerplate around it to convert things to Arrays from Lists

the widget set was 'cross platform', which meant everything worked differently across platforms.

the vertical slider went from 0 to 100 on two platforms, and 100 to 0 on another

tooltips couldn't be displayed on a secondary display if it was left of the primary monitor

if you tried to have an updating tooltip, on one platform you could update the text, and it worked. on another platform, you had to use two tooltips and flick between them like some horrible throwback to double buffering

swt is awful and is based firmly in 1.4. the eclipse org refuses to update it which is so aggravating.

Notorious b.s.d.
Jan 25, 2003

by Reene

tef posted:

hold up, you mean people deploy java into shared environments like some horror from 90's web development?

an application often has more than one component, and servlet containers make it easy to combine them in a single jvm

e.g.
api.war mounts at server:8080/api
web.war mounts at server:8080/web

since they're parts of the same application it often makes sense to keep them together in one host

unfortunately when you get a lot of components, or they depend on each other for rest/soap/xmlrpc/rmi web services, poo poo starts to get hairy. what if tomcat deploys a war in the wrong order, and one comes up before the other?

also the LB effort starts to get stupid, since you effectively have independent services listening on a single ip:port combination

in embedded jetty or w/ on-the-fly provisioning every servlet gets its own jvm and its own ip endpoint

Shaggar
Apr 26, 2006
people who have classloader problems in tomcat are people who hosed up their tomcat install and/or war layout. if you are putting jars anywhere under {tomcat}/common you should be murdered

Adbot
ADBOT LOVES YOU

Notorious b.s.d.
Jan 25, 2003

by Reene

Shaggar posted:

people who have classloader problems in tomcat are people who hosed up their tomcat install and/or war layout. if you are putting jars anywhere under {tomcat}/common you should be murdered

it's j2ee app servers with tons of custom classloaders that tend to gently caress things up, less tomcat. it still happens with tomcat but less often

see also: fucksticks who mess with oneJar and its ilk

  • Locked thread