• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 02:45
CEST 08:45
KST 15:45
  • 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
[ASL20] Ro24 Preview Pt2: Take-Off6[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature4Team Liquid Map Contest #21 - Presented by Monster Energy9uThermal's 2v2 Tour: $15,000 Main Event18
Community News
Weekly Cups (Aug 18-24): herO dethrones MaxPax5Maestros of The Game—$20k event w/ live finals in Paris30Weekly Cups (Aug 11-17): MaxPax triples again!13Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195
StarCraft 2
General
Weekly Cups (Aug 18-24): herO dethrones MaxPax What mix of new and old maps do you want in the next 1v1 ladder pool? (SC2) : A Eulogy for the Six Pool Geoff 'iNcontroL' Robinson has passed away 2v2 & SC: Evo Complete: Weekend Double Feature
Tourneys
WardiTV Mondays Maestros of The Game—$20k event w/ live finals in Paris RSL: Revival, a new crowdfunded tournament series Sparkling Tuna Cup - Weekly Open Tournament Monday Nights Weeklies
Strategy
Custom Maps
External Content
Mutation # 488 What Goes Around Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below
Brood War
General
No Rain in ASL20? BW General Discussion Flash On His 2010 "God" Form, Mind Games, vs JD BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ro24 Preview Pt2: Take-Off
Tourneys
[ASL20] Ro24 Group E [ASL20] Ro24 Group F [Megathread] Daily Proleagues [IPSL] CSLAN Review and CSLPRO Reimagined!
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates [G] Mineral Boosting Muta micro map competition
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread General RTS Discussion Thread Dawn of War IV Path of Exile
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine US Politics Mega-thread The year 2050 European Politico-economics QA Mega-thread
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
High temperatures on bridge(s) Gtx660 graphics card replacement Installation of Windows 10 suck at "just a moment"
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
Evil Gacha Games and the…
ffswowsucks
Breaking the Meta: Non-Stand…
TrAiDoS
INDEPENDIENTE LA CTM
XenOsky
[Girl blog} My fema…
artosisisthebest
Sharpening the Filtration…
frozenclaw
ASL S20 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1965 users

The Big Programming Thread - Page 200

Forum Index > General Forum
Post a Reply
Prev 1 198 199 200 201 202 1031 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 States17250 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 States3701 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 States17250 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 States17250 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 States17250 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 States3701 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
Zurich15343 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 States3701 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
Germany2577 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
Zurich15343 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 States3701 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 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 3h 15m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SteadfastSC 96
StarCraft: Brood War
Sea 2591
Horang2 1685
Backho 631
ggaemo 248
Stork 239
Tasteless 225
Larva 184
Pusan 140
PianO 140
Nal_rA 111
[ Show more ]
Icarus 10
Dota 2
NeuroSwarm81
Counter-Strike
m0e_tv1280
Stewie2K745
semphis_34
Other Games
summit1g8553
tarik_tv7449
singsing625
WinterStarcraft500
C9.Mang0300
SortOf80
Organizations
Other Games
gamesdonequick637
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Berry_CruncH355
• Sammyuel 15
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush1253
• Lourlo948
• Stunt487
Upcoming Events
Afreeca Starleague
3h 15m
hero vs Alone
Royal vs Barracks
Replay Cast
17h 15m
The PondCast
1d 3h
WardiTV Summer Champion…
1d 4h
Clem vs Classic
herO vs MaxPax
Replay Cast
1d 17h
LiuLi Cup
2 days
MaxPax vs TriGGeR
ByuN vs herO
Cure vs Rogue
Classic vs HeRoMaRinE
Cosmonarchy
2 days
OyAji vs Sziky
Sziky vs WolFix
WolFix vs OyAji
BSL Team Wars
2 days
Team Hawk vs Team Dewalt
BSL Team Wars
2 days
Team Hawk vs Team Bonyth
SC Evo League
3 days
TaeJa vs Cure
Rogue vs threepoint
ByuN vs Creator
MaNa vs Classic
[ Show More ]
Maestros of the Game
3 days
ShoWTimE vs Cham
GuMiho vs Ryung
Zoun vs Spirit
Rogue vs MaNa
[BSL 2025] Weekly
3 days
SC Evo League
4 days
Maestros of the Game
4 days
SHIN vs Creator
Astrea vs Lambo
Bunny vs SKillous
HeRoMaRinE vs TriGGeR
BSL Team Wars
4 days
Team Bonyth vs Team Sziky
BSL Team Wars
4 days
Team Dewalt vs Team Sziky
Monday Night Weeklies
5 days
Replay Cast
5 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

CSLAN 3
uThermal 2v2 Main Event
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 1
Acropolis #4 - TS1
CSL Season 18: Qualifier 2
SEL Season 2 Championship
WardiTV Summer 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

CSL 2025 AUTUMN (S18)
LASL Season 20
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
RSL Revival: Season 2
Maestros of the Game
EC S1
Sisters' Call Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
MESA Nomadic Masters Fall
Thunderpick World Champ.
CS Asia Championships 2025
Roobet Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
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 © 2025 TLnet. All Rights Reserved.