• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 07:50
CEST 13:50
KST 20:50
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Serral wins HomeStory Cup 298Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
Weekly Cups (July 6 - 12): Protoss strike back2BSL Season 22 Full Overview & Conclusion7BSL Season 22 Full Overview & Conclusion7Weekly Cups (June 29-July 5): Solar Doubles0MC vs IdrA, Boxer vs Nal_rA to be Legacy Matches @ BlizzCon44
StarCraft 2
General
Weekly Cups (July 6 - 12): Protoss strike back Is the larve respawn broken? Serral wins HomeStory Cup 29 Serral wins Maestros of the Game 2 Reynor: GSL Loss Wasn't About Preparation Format
Tourneys
GSL CK #5 Race War WardiTV Summer Cup 2026 RSL Revival: Season 6 - Qualifiers and Main Event HomeStory Cup 29 Vespene Cup #1 — $300+ USD, July 10
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together Mutation # 532 Nuclear Family
Brood War
General
Pros Debate: Zerg Unfairly Nerfed? (ASL S22 map) ASL 22 Proposed Map Pool ASL22 General Discussion BSL Season 22 Full Overview & Conclusion BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[ASL22] Wildcard Qualifier IPSL Spring 2026 Top 4! [Megathread] Daily Proleagues CSLAN 4 is Coming!
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Creating a full chart of Zerg builds Relatively freeroll strategies
Other Games
General Games
General RTS Discussion Thread Stormgate/Frost Giant Megathread Path of Exile Summer Games Done Quick 2026! Nintendo Switch Thread
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread TL Mafia Power Rank Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread UK Politics Mega-thread YouTube Thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books Movie Discussion! Anime Discussion Thread Series you have seen recently...
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Tennis[sport] Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Simple Questions Simple Answers FPS when play League Of Legend on laptop How to clean a TTe Thermaltake keyboard?
TL Community
The Automated Ban List
Blogs
Major Shifts in the Gaming I…
TrAiDoS
An Exploration of th…
waywardstrategy
Gauntlet SC2: A Retrospectiv…
Ctone23
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Evil Gacha Games and the…
ffswowsucks
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7981 users

The Big Programming Thread - Page 200

Forum Index > General Forum
Post a Reply
Prev 1 198 199 200 201 202 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
ninjamyst
Profile Joined September 2010
United States1903 Posts
Last Edited: 2012-11-22 05:54:00
November 22 2012 05:53 GMT
#3981
On November 22 2012 10:09 Craton wrote:
I'm having issues with deserializing some json with C#.

Suppose this is a snippet of the json I'm being sent (repeated many times, but nothing else other than id/name):
[
{
"id":0,
"name":"N/A"
},
{
"id":1,
"name":"Annie"
},
{
"id":2,
"name":"Olaf"
}
]


If the top level was named, I'd do something like
    [DataContract]
public class ChampList
{
[DataMember(Name = "SOMENAME")]
public ElophantChamp[] ElophantChamps { get; set; }
}

[DataContract]
public class ElophantChamp
{
[DataMember(Name = "id")]
public int ID { get; set; }

[DataMember(Name = "name")]
public string Name { get; set; }

}


and then deserialize it by calling this:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(ChampList));
object objResponse = jsonSerializer.ReadObject(response.GetResponseStream());
ChampList jsonResults = objResponse as ChampList;


But in the case where there is no top level container object and I can't have blank datamember name, what do I do? I just get a null value if I leave the DataMember unnamed (i.e. leave it as [DataMember])


Why do you need ChampList? Just deserialize straight into List<ElophantChamp> . It's better to use List instead of Arrays so you get all the features of IList and Linq.
Craton
Profile Blog Joined December 2009
United States17294 Posts
Last Edited: 2012-11-22 07:12:42
November 22 2012 05:55 GMT
#3982
Couldn't figure out a way to do that.

[Edit]
I got help elsewhere.

The only change needed was:

DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(ElophantChamp[]));
object objResponse = jsonSerializer.ReadObject(response.GetResponseStream());
ElophantChamp[] jsonResults = objResponse as ElophantChamp[];


Basically all that was needed was to use the underlying class (ElophantChamp) and then declare the type used in the serializer as an array of that underlying class.

Thank you to ninjamyst for attempting to help.
twitch.tv/cratonz
Datz2Ez
Profile Joined May 2011
Canada76 Posts
November 22 2012 06:08 GMT
#3983
Hi TL programmers.

I have a big project in mind and I didn't know who I should turn to to ask questions about "where to start". Here is a short intro of me.

I am a 22 years old man that finish CEGEP in web programming / design (CEGEP is between university and high school). I just started university in computer engineer. I have a good project in mind however I need a low level language to achieve my goal.

After some research, I found out that C++ was the way to go. So I took a 10h tutorial on Lynda.com but that didn't really help me. It was more about what are types, how to declare a functions, and what a statement is. So i kept reading tutorials doing quiz here and there. The more I get into C++ the more loss i get. I feel like there is so much to know at the same time. So many way to acheive an objective and I'm never sure about what is the most effective way to handle my problem.

So basically i need some help about either a great book or so clever example to help me master all the native method that C++ offers.
Action is the real measure of intelligence.
tec27
Profile Blog Joined June 2004
United States3702 Posts
November 22 2012 06:10 GMT
#3984
On November 22 2012 14:53 Craton wrote:
I wouldn't have to grumble over non-answers if they were actual answers.

It took three posts just to force an angry reply out of you that what I'm using MIGHT not be able to do what I want. Instead, you got up on your "look at how great this thing I prefer is, change all your code to suit my personal preference" why? "because I personally feel the thing you're using is shit, but I'm not going to bother actually trying to help you"

If you don't want people getting "uppity," then provide actual answers. Exponentially so when I came out and explicitly said all I want to know is what I have to tweak and then got the exact same kind of non-answer.

I said nothing about my personal opinion. I specifically said that the library was shit, and recommended you use Json.NET. I think you'd find it easier and more accurate to simply click the 'Quote' link above my post next time instead of completely misquoting me and misrepresenting what my post said.

Its not anyone's fault here but your own that you continually make horrible development choices, and you shouldn't be so pissy when someone points them out. You should notice that out of all the people that ask questions in here, you're the only one who consistently gets responded to with the sorts of answers you're bitching about (and you're also certainly the only one who bitches about people helping you in their free time when they could be off not assisting morons). You should think about that for a bit, and realize that you're the problem here, not anyone who has tried to help you. I would appreciate it if you would stop visiting this thread.
Can you jam with the console cowboys in cyberspace?
Craton
Profile Blog Joined December 2009
United States17294 Posts
Last Edited: 2012-11-22 06:44:15
November 22 2012 06:22 GMT
#3985
It's your own lack of comprehension that's getting you so angsty. You're welcome to leave at any time.

You told me to change all my code to support something else. I told you no, that I merely needed assistance finding what EXTREMELY MINOR mistake I had and have no interest in changing everything to support a new library at the last minute. That you think this is a "horrible development choice" is hilarious in and of itself, especially since you know absolutely jack shit about the size or scope of this project, but you assumed with tinted lenses nonetheless. At no point did you ever try to answer my actual question nor provide any backing whatsoever to your claims of how "bad" what this library is.

Someone else then came not 10 minutes later and repeated the exact same call to use a THIRD library, when I'd already expressly said that's not my question nor something I want, which is what I replied to. It's extraordinarily frustrating to have people continually ignore your actual question and respond with information you've said you don't want. But you were already off making assumptions and beginning your tirade.

You then got up on your high horse and went to ego-town and have continued to do so.

Despite all your ramblings and claims of how terrible this library is and how it can't even do what I want, it took not 5 seconds to make the adjustment I needed (read: what I had asked for multiple times). If I was looking for a "better" library or way to rewrite something, I would ask. My project is an extremely small personal one used only by myself and one other person; I have absolutely no need to rewrite swaths of code for trivial performance gains. Perhaps next time you should consider getting less inflamed over having a non-answer refused and spare us your childish ad hominems.
twitch.tv/cratonz
Fyodor
Profile Blog Joined September 2010
Canada971 Posts
November 22 2012 06:40 GMT
#3986
On November 22 2012 15:08 Datz2Ez wrote:
Hi TL programmers.

I have a big project in mind and I didn't know who I should turn to to ask questions about "where to start". Here is a short intro of me.

I am a 22 years old man that finish CEGEP in web programming / design (CEGEP is between university and high school). I just started university in computer engineer. I have a good project in mind however I need a low level language to achieve my goal.

After some research, I found out that C++ was the way to go. So I took a 10h tutorial on Lynda.com but that didn't really help me. It was more about what are types, how to declare a functions, and what a statement is. So i kept reading tutorials doing quiz here and there. The more I get into C++ the more loss i get. I feel like there is so much to know at the same time. So many way to acheive an objective and I'm never sure about what is the most effective way to handle my problem.

So basically i need some help about either a great book or so clever example to help me master all the native method that C++ offers.

http://www.amazon.com/Primer-5th-Edition-Stanley-Lippman/dp/0321714113/ref=sr_1_5?ie=UTF8&qid=1353566261&sr=8-5&keywords=C++

Best book out right now IMO. Using it right now and I'm learning really fast and thoroughly. Blasting through it and I'm learning the more advanced stuff right now.

It's even updated for the latest C++11 stuff. Just brilliant.
llllllllllllllllllllllllllllllllllllllllllll
Craton
Profile Blog Joined December 2009
United States17294 Posts
November 22 2012 06:42 GMT
#3987
Remind me on Monday and I'll be able to get the name of another good book.
twitch.tv/cratonz
phar
Profile Joined August 2011
United States1080 Posts
November 22 2012 06:47 GMT
#3988
Learning to assume that other people are right and working back through their logic instead of assuming that I'm right and trying to go from there has been the most valuable thing I've learned so far working in software development. Time and time again it has gotten me to quicker, cleaner, and easier to extend solutions, simply by taking the effort to figure out exactly why what someone was recommending is a good idea (or if it turns out to be a shitty idea, making absolutely sure it is). Even if that means re-writing something I just spent 60+ hours on. Really does suck when it comes down to that, but it's almost always just my fault for not fully figuring out the design and not enough talking with other people before I dove into coding.

The sooner you start coding, the longer it takes to write a program that works. (- Nell Dale)

Which is an excellent segue to:

On November 22 2012 15:08 Datz2Ez wrote:
Hi TL programmers.

+ Show Spoiler [rest of post] +
I have a big project in mind and I didn't know who I should turn to to ask questions about "where to start". Here is a short intro of me.

I am a 22 years old man that finish CEGEP in web programming / design (CEGEP is between university and high school). I just started university in computer engineer. I have a good project in mind however I need a low level language to achieve my goal.

After some research, I found out that C++ was the way to go. So I took a 10h tutorial on Lynda.com but that didn't really help me. It was more about what are types, how to declare a functions, and what a statement is. So i kept reading tutorials doing quiz here and there. The more I get into C++ the more loss i get. I feel like there is so much to know at the same time. So many way to acheive an objective and I'm never sure about what is the most effective way to handle my problem.

So basically i need some help about either a great book or so clever example to help me master all the native method that C++ offers.

Do you have lots of previous programming experience, and just need a solid c++ reference? If so there's a few links in the OP of this thread that could probably help you. If you need a text, something like this is probably a good buy:

http://www.amazon.com/dp/0201700735

If you've never really used C or C++ at all, something like Learn <X> the Hard Way may help you out more than a straight text: http://c.learncodethehardway.org/book/ or maybe this, if you know the basics already: http://www.amazon.com/dp/0763771562

In the end, the only way you're going to learn C++ is by writing a crap ton of C++.
Who after all is today speaking about the destruction of the Armenians?
Craton
Profile Blog Joined December 2009
United States17294 Posts
Last Edited: 2012-11-22 07:11:00
November 22 2012 07:09 GMT
#3989
On November 22 2012 15:47 phar wrote:
Learning to assume that other people are right and working back through their logic instead of assuming that I'm right and trying to go from there has been the most valuable thing I've learned so far working in software development. Time and time again it has gotten me to quicker, cleaner, and easier to extend solutions, simply by taking the effort to figure out exactly why what someone was recommending is a good idea (or if it turns out to be a shitty idea, making absolutely sure it is). Even if that means re-writing something I just spent 60+ hours on. Really does suck when it comes down to that, but it's almost always just my fault for not fully figuring out the design and not enough talking with other people before I dove into coding.

I agree. As an example, I've rewritten my current program twice for the sake of learning and improving and have plans to do it again in the future. I think new developers find that just about everyone has spent time writing and rewriting large amounts of code, if not entire programs from scratch just for the sake of figuring things out and getting better.

I would definitely never assume others are right, though. That's always a disaster waiting to happen. You should take what anyone says with a many grains of salt and do more research on it.

Connecting to the earlier conversation, though, I'll point out that using one library vs another doesn't really teach you much, even though it can take significant amounts of time to recode. I certainly agree that it's worth being familiar with the different solutions, just budget your time on areas where you actually need improvements (be it for performance, maintainability, shoring up ignorance, etc.)
twitch.tv/cratonz
Fyodor
Profile Blog Joined September 2010
Canada971 Posts
November 22 2012 07:10 GMT
#3990
Stroustrup's book is really outdated right now I think. Covers only C++98 which means you're learning some obsolete/deprecated things, missing important features. New edition in feb. though.
llllllllllllllllllllllllllllllllllllllllllll
Bigpet
Profile Joined July 2010
Germany533 Posts
November 22 2012 07:32 GMT
#3991
On November 22 2012 16:10 Fyodor wrote:
Stroustrup's book is really outdated right now I think. Covers only C++98 which means you're learning some obsolete/deprecated things, missing important features. New edition in feb. though.


The C++ Programming Language, 4th Edition is about to be released, which would be the quasi-official C++11 reference.

Programming: Principles and Practice Using C++ will probably be updated after the reference book is released. If you are looking for official recommendations then you could look at http://isocpp.org/ which is a fairly new website by the standards body.
I'm NOT the caster with a similar nick
tec27
Profile Blog Joined June 2004
United States3702 Posts
November 22 2012 07:34 GMT
#3992
On November 22 2012 16:09 Craton wrote:
Show nested quote +
On November 22 2012 15:47 phar wrote:
Learning to assume that other people are right and working back through their logic instead of assuming that I'm right and trying to go from there has been the most valuable thing I've learned so far working in software development. Time and time again it has gotten me to quicker, cleaner, and easier to extend solutions, simply by taking the effort to figure out exactly why what someone was recommending is a good idea (or if it turns out to be a shitty idea, making absolutely sure it is). Even if that means re-writing something I just spent 60+ hours on. Really does suck when it comes down to that, but it's almost always just my fault for not fully figuring out the design and not enough talking with other people before I dove into coding.

I agree. As an example, I've rewritten my current program twice for the sake of learning and improving and have plans to do it again in the future. I think new developers find that just about everyone has spent time writing and rewriting large amounts of code, if not entire programs from scratch just for the sake of figuring things out and getting better.

I would definitely never assume others are right, though. That's always a disaster waiting to happen. You should take what anyone says with a many grains of salt and do more research on it.

Connecting to the earlier conversation, though, I'll point out that using one library vs another doesn't really teach you much, even though it can take significant amounts of time to recode. I certainly agree that it's worth being familiar with the different solutions, just budget your time on areas where you actually need improvements (be it for performance, maintainability, shoring up ignorance, etc.)

You certainly *don't* get it, or you wouldn't have ever responded in the way you did. Its quite clear from all of your posts here that you would rather have crappy code that inexplicably works than something clean, succinct, and maintainable. Learning and improving isn't about continually rewriting the same piece of code over and over again, its about giving a fuck and looking for ways you can improve it while you're doing it. Its about being completely willing to get halfway through a project and say, "Hey, this part really sucks. I'm gonna throw that out and write something better."

You shouldn't assume people are 100% right, but you should learn to find value in things people tell you instead of just floccinaucinihilipilificating them away. You're acting like an arrogant, entitled prick in this thread, as if you own everyone else's time and efforts. No one owes you shit. The fact that your previous fix took you "five seconds" just means that you value your five seconds higher than everyone else's five minutes, because you decided to ask here and waste our time before trying out a simple fix. Doesn't that seem a tad entitled to you?

I never told you to rewrite your entire application, I told you to use a different serializer library. Your application code shouldn't be coupled to that anyway, and it would have seriously been a matter of adding a new import and replacing the already non-working deserialization code with the Json.NET equivalents. If you had actually considered my suggestion, you might have realized that, but of course your time is worth infinitely more than mine so you just dismissed it out of hand.

Now, I'll ask you again, please leave this thread and never come back. You provide no value here. No one should want to take your suggestions or advice because you clearly take no pride in your craft, and don't seek to improve it; and when you ask questions? Well we've all seen how that turns out.
Can you jam with the console cowboys in cyberspace?
zatic
Profile Blog Joined September 2007
Zurich15366 Posts
November 22 2012 09:38 GMT
#3993
Hey guys, maybe you can give me some ideas how to approach this:

I have a black box backend system that dynamically generates HTML forms. As far as I can tell it's J2EE with Struts 1. I have access to the JSP files, but I am asked to change as little as possible.

The generated forms have an auto-save functionality (all in Javascript) that basically just invokes a struts action to save the form in regular intervals. The change they want is to only trigger the auto-save when there has actually been a change since the last auto-save.

Ideally I would do this all in newly introduced Javascript, with only a few lines changed in the existing auto-save Javascript functionality.

My current approach is to dynamically add event listeners to all generated form elements. They would change a global variable on the change event. The autosave function would check if that variable has been changed before submitting.

Does this sound good? I vaguely remember that "change" doesn't capture all changes for all form elements. I might be wrong (or maybe it's only in IE?). Does it fire for changes on the value that are done by Javascript and not user interaction? Also needs IE < 9 compatibility so I am aware I need to write some of the code twice.
ModeratorI know Teamliquid is known as a massive building
topfpflanze
Profile Joined November 2011
Germany7 Posts
November 22 2012 09:52 GMT
#3994
On November 22 2012 18:38 zatic wrote:
My current approach is to dynamically add event listeners to all generated form elements. They would change a global variable on the change event. The autosave function would check if that variable has been changed before submitting.

Does this sound good? I vaguely remember that "change" doesn't capture all changes for all form elements. I might be wrong (or maybe it's only in IE?). Does it fire for changes on the value that are done by Javascript and not user interaction? Also needs IE < 9 compatibility so I am aware I need to write some of the code twice.


Will you be able to use 3rd party libraries like jquery? This would solve you compatibility problems. Also with it's selectors it will be quite easy to install your event-handler on all relevant elements. See:
- http://api.jquery.com/change/
- http://api.jquery.com/category/selectors/

Depending on your specification "change" might be the right solution. Change is only fired on text-input-elements, when they lose focus. So if you need to save "unfinished" text-elements, change might not be what you are looking for.


Tobberoth
Profile Joined August 2010
Sweden6375 Posts
November 22 2012 09:53 GMT
#3995
On November 22 2012 18:38 zatic wrote:
Hey guys, maybe you can give me some ideas how to approach this:

I have a black box backend system that dynamically generates HTML forms. As far as I can tell it's J2EE with Struts 1. I have access to the JSP files, but I am asked to change as little as possible.

The generated forms have an auto-save functionality (all in Javascript) that basically just invokes a struts action to save the form in regular intervals. The change they want is to only trigger the auto-save when there has actually been a change since the last auto-save.

Ideally I would do this all in newly introduced Javascript, with only a few lines changed in the existing auto-save Javascript functionality.

My current approach is to dynamically add event listeners to all generated form elements. They would change a global variable on the change event. The autosave function would check if that variable has been changed before submitting.

Does this sound good? I vaguely remember that "change" doesn't capture all changes for all form elements. I might be wrong (or maybe it's only in IE?). Does it fire for changes on the value that are done by Javascript and not user interaction? Also needs IE < 9 compatibility so I am aware I need to write some of the code twice.

Would you be allowed to use jQuery? Because from my experience, jQuery tends to standardize actions like that, so it's possible that the jQuery "change" event includes more actions than the "default" one.
tec27
Profile Blog Joined June 2004
United States3702 Posts
November 22 2012 10:11 GMT
#3996
On November 22 2012 18:38 zatic wrote:
Hey guys, maybe you can give me some ideas how to approach this:

I have a black box backend system that dynamically generates HTML forms. As far as I can tell it's J2EE with Struts 1. I have access to the JSP files, but I am asked to change as little as possible.

The generated forms have an auto-save functionality (all in Javascript) that basically just invokes a struts action to save the form in regular intervals. The change they want is to only trigger the auto-save when there has actually been a change since the last auto-save.

Ideally I would do this all in newly introduced Javascript, with only a few lines changed in the existing auto-save Javascript functionality.

My current approach is to dynamically add event listeners to all generated form elements. They would change a global variable on the change event. The autosave function would check if that variable has been changed before submitting.

Does this sound good? I vaguely remember that "change" doesn't capture all changes for all form elements. I might be wrong (or maybe it's only in IE?). Does it fire for changes on the value that are done by Javascript and not user interaction? Also needs IE < 9 compatibility so I am aware I need to write some of the code twice.

Change will fire only on user-made changes, not stuff done through JavaScript (if you want them to fire from JavaScript changes, you have to trigger the event yourself). You shouldn't need to add an event handler on every form element, a single event handler at the form level should work fine since all the events on the inputs will bubble up. Also keep in mind that a change event on a text box will only fire *after* the textbox has lost focus. So this can cause some problems if they can manually submit the form and you want to auto-save, because their submission will happen as you try to send the auto-save data and most browsers will cancel the AJAX request.

jQuery might make the compatibility for IE<9 easier, but other than that I think it would be straightforward without it.
Can you jam with the console cowboys in cyberspace?
AmericanUmlaut
Profile Blog Joined November 2010
Germany2595 Posts
Last Edited: 2012-11-22 10:43:40
November 22 2012 10:36 GMT
#3997
@zatic

It's hard to know exactly what handlers would be necessary without knowing what sorts of "changes" are possible, and when exactly your global variable needs to be set (IE, if I'm in the process of typing in a field, should the text I'm typing be auto-saved?).

My instinct says that you should be able to use a single event handler bound to the keydown (assuming your forms contain text fields and you want to save in-progress changes) and change events. Like tec27 wrote, you shouldn't need to bind the handlers to every form field, just to the form itself, unless you have event handlers already in place that prevent the event from bubbling up.

Edit to add: You're out of luck as far as I know in terms of an event that will fire when content is changed via javascript. You'll either have to fire the events from the functions that make the changes or just set your global variable in those functions.

There is one idea that would let you do everything in a single function: Create a polling function that runs on load and every X ms therafter. It stores the values of every field in the form (conceivably you could just store formObj.innerHTML if it's not obscenely large) and if the values have changed, it sets your global variable.
The frumious Bandersnatch
zatic
Profile Blog Joined September 2007
Zurich15366 Posts
November 22 2012 11:56 GMT
#3998
Thanks guys. "Change" should be enough, I won't need to keep entered but unfinished text elements before they change focus.

AmericanUmlaut: Yeah what I am afraid is that their UI uses tons of Javascript already and might do some of the changes to form elements programmatically. I'll know more when I am onsite.

The polling thing might actually run into performance issues as the forms that are generated are huge (take several hours to complete).
ModeratorI know Teamliquid is known as a massive building
tec27
Profile Blog Joined June 2004
United States3702 Posts
November 22 2012 13:18 GMT
#3999
You shouldn't need to poll. The change event should do everything you need.
Can you jam with the console cowboys in cyberspace?
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2012-11-22 21:53:20
November 22 2012 21:51 GMT
#4000
On November 22 2012 16:09 Craton wrote:I would definitely never assume others are right, though. That's always a disaster waiting to happen. You should take what anyone says with a many grains of salt and do more research on it.

Yea, I meant assume other people at my work are right, not in some random online forum. At work I'm surrounded by people who are significantly better than me at programming and smarter in general, so it's a pretty safe bet. Even if they do end up being wrong, I stand by what I initially said. It works more often than not to start from their position and go from there, working through the logic.
Who after all is today speaking about the destruction of the Armenians?
Prev 1 198 199 200 201 202 1032 Next
Please log in or register to reply.
Live Events Refresh
WardiTV Weekly
11:00
WardiTV Mondays #95
IntoTheiNu 579
WardiTV518
TKL 193
Rex113
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko436
TKL 193
Ryung 158
Rex 110
SHIN 72
herO (SOOP) 65
DenverSC2 27
StarCraft: Brood War
Calm 6309
Sea 2395
Bisu 1441
Shuttle 990
Jaedong 537
Hyuk 503
firebathero 437
BeSt 341
Mini 323
EffOrt 191
[ Show more ]
Light 159
Soulkey 159
Stork 159
Larva 156
Snow 144
Soma 126
ggaemo 122
ToSsGirL 103
Sharp 74
Mong 71
ZerO 66
Pusan 63
Free 59
PianO 50
[sc1f]eonzerg 41
910 40
sorry 40
Rush 39
hero 38
Sea.KH 38
soO 38
Bale 33
scan(afreeca) 31
Hm[arnc] 29
Killer 25
Sexy 24
Aegong 22
JYJ 21
yabsab 20
Icarus 17
sSak 17
IntoTheRainbow 15
Shine 11
Yoon 10
Noble 9
Movie 8
Barracks 8
Dota 2
Gorgc4409
Dendi428
syndereN85
League of Legends
JimRising 382
Counter-Strike
x6flipin142
markeloff40
Other Games
B2W.Neo767
crisheroes235
RuFF_SC216
ZerO(Twitch)9
Organizations
Other Games
gamesdonequick2594
BasetradeTV275
StarCraft: Brood War
lovetv 10
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 13 non-featured ]
StarCraft 2
• LUISG 38
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• TFBlade640
• HappyZerGling83
Upcoming Events
The PondCast
22h 10m
Replay Cast
1d 21h
CrankTV Team League
1d 23h
Replay Cast
2 days
CrankTV Team League
2 days
Replay Cast
3 days
RSL Revival
3 days
Clem vs Lambo
Scarlett vs Cure
CranKy Ducklings
3 days
IPSL
4 days
Dragon vs Hawk
RSL Revival
4 days
Classic vs Trap
herO vs SHIN
[ Show More ]
Sparkling Tuna Cup
4 days
IPSL
5 days
Bonyth vs Ret
WardiTV Weekly
5 days
Monday Night Weeklies
6 days
Liquipedia Results

Completed

YSL S3
HSC XXIX
Eternal Conflict S2 E2

Ongoing

IPSL Spring 2026
Acropolis #4
CSL 2026 Summer (S21)
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026

Upcoming

Escore Tournament S3: W3
ASL S22 SEASON OPEN Day 1
Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
CSLAN 4
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
Eternal Conflict S2 E3
Logitech G Connect 2026
StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Disclosure: This page contains affiliate marketing links that support TLnet.

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.