• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 00:50
CET 06:50
KST 14: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
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets3$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)15Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns7[BSL21] Non-Korean Championship - Starts Jan 103SC2 All-Star Invitational: Jan 17-1823
StarCraft 2
General
Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets SC2 All-Star Invitational: Jan 17-18 When will we find out if there are more tournament SC2 Spotted on the EWC 2026 list? Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns
Tourneys
$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) $25,000 Streamerzone StarCraft Pro Series announced WardiTV Winter Cup WardiTV Mondays SC2 AI Tournament 2026
Strategy
Simple Questions Simple Answers
Custom Maps
Map Editor closed ?
External Content
Mutation # 508 Violent Night Mutation # 507 Well Trained Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes
Brood War
General
[ASL21] Potential Map Candidates Potential ASL qualifier breakthroughs? A cwal.gg Extension - Easily keep track of anyone BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion
Tourneys
[Megathread] Daily Proleagues [BSL21] Grand Finals - Sunday 21:00 CET [BSL21] Non-Korean Championship - Starts Jan 10 SLON Grand Finals – Season 2
Strategy
Game Theory for Starcraft Simple Questions, Simple Answers Current Meta [G] How to get started on ladder as a new Z player
Other Games
General Games
Beyond All Reason Nintendo Switch Thread Awesome Games Done Quick 2026! Mechabellum Stormgate/Frost Giant Megathread
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread European Politico-economics QA Mega-thread Trading/Investing Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced
Blogs
My 2025 Magic: The Gathering…
DARKING
Physical Exercise (HIIT) Bef…
TrAiDoS
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2008 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 States17274 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 States17274 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 States17274 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 States17274 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
Zurich15358 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
Germany2589 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
Zurich15358 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
PiGosaur Cup
01:00
#64
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft452
Livibee 162
StarCraft: Brood War
Britney 25888
Stork 358
BeSt 159
EffOrt 60
Mind 30
ZergMaN 16
Icarus 13
Noble 12
Bale 8
Dota 2
monkeys_forever881
LuMiX0
League of Legends
JimRising 738
C9.Mang0584
Super Smash Bros
hungrybox444
Mew2King109
Other Games
summit1g6853
XaKoH 219
RuFF_SC2141
minikerr38
Organizations
Other Games
gamesdonequick2588
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• Berry_CruncH37
• IndyKCrew
• sooper7s
• AfreecaTV YouTube
• Migwel
• intothetv
• LaughNgamezSOOP
• Kozan
StarCraft: Brood War
• RayReign 25
• Diggity5
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Rush1466
• Lourlo1402
• Stunt344
Other Games
• Scarra2692
• Shiphtur193
Upcoming Events
WardiTV Invitational
6h 10m
The PondCast
1d 4h
OSC
1d 6h
OSC
2 days
All Star Teams
2 days
INnoVation vs soO
sOs vs Scarlett
uThermal 2v2 Circuit
3 days
All Star Teams
3 days
MMA vs DongRaeGu
Rogue vs Oliveira
Sparkling Tuna Cup
4 days
OSC
4 days
Replay Cast
5 days
[ Show More ]
Wardi Open
5 days
Liquipedia Results

Completed

Proleague 2026-01-13
Big Gabe Cup #3
NA Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL 21 Non-Korean Championship
CSL 2025 WINTER (S19)
OSC Championship Season 13
Underdog Cup #3
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025

Upcoming

Escore Tournament S1: W4
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Rongyi Cup S3
Thunderfire SC2 All-star 2025
Nations Cup 2026
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
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.