• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 17:29
CEST 23:29
KST 06:29
  • 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 2914Serral 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
Clem: "I don't have that much hope in Blizzard"2ZeroSpace Early Access is Now Live!20Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters2Balance hotfix patch 5.0.16b (July 16)89Reynor: GSL Loss Wasn't About Preparation Format17
StarCraft 2
General
Balance hotfix patch 5.0.16b (July 16) Reynor: GSL Loss Wasn't About Preparation Format How would you feel about frequent/monthly balance patches for SC2? Clem: "I don't have that much hope in Blizzard" Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters
Tourneys
IntoTheTV X SOOP SC2 League : Weekly & Monthly INu's Battles#18 - Cure, herO, Rogue & ByuN RSL Revival: Season 6 - Qualifiers and Main Event Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026
Strategy
[G] Having the right mentality to improve
Custom Maps
[M] (2) Industrial Park New Map Maker - Looking for Advice - Love or Hate
External Content
Mutation # 535 Assembly of Vengeance The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together
Brood War
General
BW General Discussion How Famous was FlaSh before his Debut? Animated Gateway BGH Auto Balance -> http://bghmmr.eu/ HORROR STARCRAFT MOVIE
Tourneys
Escore Tournament - Season 3 [Megathread] Daily Proleagues [IPSL] Spring 2026 Grand Finals - This Weekend! Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers PvT advise for noobs Fighting Spirit mining rates Creating a full chart of Zerg builds
Other Games
General Games
Path of Exile ZeroSpace Early Access is Now Live! Nintendo Switch Thread General RTS Discussion Thread Diablo IV
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Artificial Intelligence Thread Russo-Ukrainian War Thread How to buy a book - shipping from Korea to Europe The Games Industry And ATVI
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Anime Discussion Thread Series you have seen recently... Movie Discussion! [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion MLB/Baseball 2023 McBoner: A hockey love story
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Simple Questions Simple Answers FPS when play League Of Legend on laptop
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
How Games can Help with Majo…
TrAiDoS
Hello guys!
LIN1s
ASL S22 English Commentary…
namkraft
Poker (part 2)
Nebuchad
An Exploration of th…
waywardstrategy
Customize Sidebar...

Website Feedback

Closed Threads



Active: 4006 users

The Big Programming Thread - Page 483

Forum Index > General Forum
Post a Reply
Prev 1 481 482 483 484 485 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.
KaiserJohan
Profile Joined May 2010
Sweden1808 Posts
May 21 2014 06:33 GMT
#9641
On May 21 2014 02:49 Rels wrote:
Show nested quote +
On May 20 2014 23:37 Nesserev wrote:
To be honest, SDL seems to be a bit overkill for his project. SFML seems like the right tool for the job, everything you need to make a 2D game.

Also, there's a 'game development' book for SFML that introduces you to some aspects of game programming, like resourceholders, adding shaders, etc. : book (You can also find it on TPB).


Thanks! I'll give it a look.


SDL/SFML is a great start; if you want to go more low-level I suggest jumping on OpenGL directly, plenty of tutorials about. Does require some extra libraries though typically (GLEW, GLFW and later on ASSIMP)
England will fight to the last American
urboss
Profile Joined September 2013
Austria1223 Posts
May 21 2014 07:32 GMT
#9642
On May 21 2014 15:02 Release wrote:
In java, I cannot seem to create a generic array.

Task<T>[] t = new Task<T>[2];


however, a generic arraylist works;

ArrayList<Task<T>> t = new ArrayList<Task<T>>();


I'm not sure why as a Task<T> is just an object, and Object[] is usually a valid array declaration and Object[i] is usually a valid array of size i.

Array has a method called newInstance:
http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/reflect/Array.html#newInstance(java.lang.Class, int[])
iremnant3847
Profile Joined June 2012
Taiwan269 Posts
May 21 2014 07:40 GMT
#9643
Could anyone tell me if MATLAB is a useful language? I'm a first-year in college and I just finished taking a class that taught it. Prior to the spring semester, I had never heard of it, so I can't tell whether it's useful or necessary to know. I've got some spare time on my hands so if I determine it to be useful, I think I'll put in some time to learn it a bit more.
sluggaslamoo
Profile Blog Joined November 2009
Australia4494 Posts
May 21 2014 08:23 GMT
#9644
On May 21 2014 16:40 iremnant3847 wrote:
Could anyone tell me if MATLAB is a useful language? I'm a first-year in college and I just finished taking a class that taught it. Prior to the spring semester, I had never heard of it, so I can't tell whether it's useful or necessary to know. I've got some spare time on my hands so if I determine it to be useful, I think I'll put in some time to learn it a bit more.


Only if you intend to become a professor in science or something.
Come play Android Netrunner - http://www.teamliquid.net/forum/viewmessage.php?topic_id=409008
iremnant3847
Profile Joined June 2012
Taiwan269 Posts
May 21 2014 08:26 GMT
#9645
On May 21 2014 17:23 sluggaslamoo wrote:

Only if you intend to become a professor in science or something.


I figured as much. Oh well, it was only for a semester.
teamamerica
Profile Blog Joined July 2010
United States958 Posts
Last Edited: 2014-05-21 09:07:56
May 21 2014 08:36 GMT
#9646
On May 21 2014 17:26 iremnant3847 wrote:
Show nested quote +
On May 21 2014 17:23 sluggaslamoo wrote:

Only if you intend to become a professor in science or something.


I figured as much. Oh well, it was only for a semester.


I know of engineers and machine learning people who use it. It's fast for prototyping stuff, although for production you'd prolly hammer it out in c++/java once you got the algorithms down. There's also gnu octave but in school matlab should be easy to access.

To the guy asking about parameterized array, you should look up the generics tutorial on sun site. Lots of gotchas that maybe you don't expect otoh. It's related to type erasure and arrays being covariant and java used to not have generics so of arrays weren't covariant your code would be sad
RIP GOMTV. RIP PROLEAGUE.
Rollin
Profile Joined March 2011
Australia1552 Posts
May 21 2014 08:49 GMT
#9647
Matlab is used for modelling lots of systems for engineering solutions to real problems, not for creating software. As a mechatronic engineer, it is the most valuable tool by far.
Throw off those chains of reason, and your prison disappears. | Check your posting frequency timeline: http://www.teamliquid.net/mytlnet/post_activity_img.php
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-05-21 12:28:50
May 21 2014 12:27 GMT
#9648
On May 21 2014 17:26 iremnant3847 wrote:
Show nested quote +
On May 21 2014 17:23 sluggaslamoo wrote:

Only if you intend to become a professor in science or something.


I figured as much. Oh well, it was only for a semester.


no, it's used in industry as well. but i dunno if it's worth putting extra effort into.
conspired against by a confederacy of dunces.
MichaelEU
Profile Joined February 2011
Netherlands816 Posts
May 21 2014 12:34 GMT
#9649
For a software engineer, that one class that teaches you the basics should be enough. If you need it later, learn it later.
世界を革命する力を!― znf: "Michael-oniichan ( *^▽^*)ノ✩キラ✩"
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
May 21 2014 21:16 GMT
#9650
Can anyone explain the "on the fly model checking" as in Formal Methods? I understand that it does it at run-time, and that it doesn't have to construct/compile the whole product to check stuff but is that all?
Kambing
Profile Joined May 2010
United States1176 Posts
May 22 2014 01:22 GMT
#9651
On May 22 2014 06:16 darkness wrote:
Can anyone explain the "on the fly model checking" as in Formal Methods? I understand that it does it at run-time, and that it doesn't have to construct/compile the whole product to check stuff but is that all?


(Forewarning: I'm not a verification expert, so this is my own understanding based off my reading of the literature.)

With respect to SPIN:

Spin works on-the-fly, which means that it avoids the need to preconstruct a global state graph, or Kripke structure, as a prerequisite for the verification of system properties. This makes it possible to verify very large system models.


Verification engines work by modeling the possible states of a program in a finite state automata. With such a model, the problem of determining if the given program meets some specification is reduced to reachability in that automata. The state space for all but the most trivial of programs is too large to compute up front in its entirety. So on-the-fly analysis constructs only the part of the state space that is necessary to verify the property at hand.

The Model Checker SPIN: http://spinroot.com/spin/Doc/ieee97.pdf
Simple On-the-fly Automatic Verification of Linear Temporal Logic: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.51.2625
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-05-22 07:13:50
May 22 2014 05:11 GMT
#9652
Thanks! I've managed to find what my Formal Methods professor has said, and it's summed up as:
1) to help control how much of the product needs to be constructed by using the formula's negation
2) to help solve the main complexity (construction of full product)

So nothing is actually said about 'run-time', haha.
3FFA
Profile Blog Joined February 2010
United States3931 Posts
May 22 2014 11:53 GMT
#9653
I'm planning to purchase a an erasable white board for use in college so I can more easily work out problems and also get used to the feel of a white board. Any chance you guys have any recommendations for the best white board/markers to get? Thanks in advance.
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
Kambing
Profile Joined May 2010
United States1176 Posts
May 22 2014 15:06 GMT
#9654
On May 22 2014 14:11 darkness wrote:
Thanks! I've managed to find what my Formal Methods professor has said, and it's summed up as:
1) to help control how much of the product needs to be constructed by using the formula's negation
2) to help solve the main complexity (construction of full product)

So nothing is actually said about 'run-time', haha.


Yeah, there are classes of verification tools that run at runtime. These typically operate over traces of computation rather than models of the state space. And there are, of course, hybrid approaches that use trace information to prune the state space.
Manit0u
Profile Blog Joined August 2004
Poland17799 Posts
Last Edited: 2014-05-22 19:33:29
May 22 2014 15:55 GMT
#9655
I need some help with JS. I'm designing a custom rating widget because all of the available jQuery plugins either don't meet the specs or are under shitty license.

Code (mixed with pseudocode):

<div class="x">
// ----- before
<span class="y" onclick="func(this)"></span>
<span class="y" onclick="func(this)"></span>
// ----- here we call func (for example)
<span class="y" onclick="func(this)"></span>
// ----- after
<span class="y" onclick="func(this)"></span>
<span class="y" onclick="func(this)"></span>
</div>

<script>
function func(elem) {
if (!elem.hasClass("z")) {
elem.addClass("z");
}

$var belems = elements before called element;
$var aelems = elements after called element;

for belems as elem {
if (elem.hasClass("z")) {
elem.removeClass("z");
}
}

for aelems as elem {
if (!elem.hasClass("z")) {
elem.addClass("z")
}
}
}
</script>


The problem I'm facing is actually getting the required elements. <div> "x" is not unique on the page (there are many of them), neither are its children ("y") but I must find specific y's in specific x...

With getElementById it would be piss simple, like this it's not and unfortunately I can't give unique id to the x divs (very ugly).

Any help?
Time is precious. Waste it wisely.
urboss
Profile Joined September 2013
Austria1223 Posts
Last Edited: 2014-05-22 16:26:06
May 22 2014 16:12 GMT
#9656
You are using the same variable name "elem" twice.
Once when you pass it to the function and once when you iterate over it.
Ah I guess that's just pseudo code.

In jquery you have .prev() and .next()

In pure JavaScript there is a property of elem, something like .previousSibling and .nextSibling
Manit0u
Profile Blog Joined August 2004
Poland17799 Posts
May 22 2014 19:28 GMT
#9657
I'll look into it.
Time is precious. Waste it wisely.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-05-22 19:36:03
May 22 2014 19:32 GMT
#9658
Is anyone familiar with the Z notation? I'm getting really confused by bags (multisets). Glossary can be found here: https://www.st.cs.uni-saarland.de/edu/se/2005/zedglossary.pdf

For example, S == [[Flash, Stork, Bisu, JaeDong]] <-- this is a bag

i. S [bag union symbol from glossary] [[Bisu]] = [[Flash, Stork, Bisu, JaeDong, Bisu]] <-- no problem here, should be correct

ii. S ⊕ {Bisu -> 3} = [[Flash, Stork, Bisu, JaeDong, Bisu, Bisu]] <-- no problem, Bisu has to occur 3 times

iii. S U {NaDa -> 3} = ? <--- how do you solve this? I thought bag union should be used rather than simple union, but I've been told the answer is [[Flash, Stork, Bisu, JaeDong, NaDa, NaDa,NaDa]]. Is 'U' indeed valid for bags? Isn't this a job for the bag union instead?
ZenithM
Profile Joined February 2011
France15952 Posts
Last Edited: 2014-05-22 19:45:49
May 22 2014 19:44 GMT
#9659
On May 23 2014 04:32 darkness wrote:
Is anyone familiar with the Z notation? I'm getting really confused by bags (multisets). Glossary can be found here: https://www.st.cs.uni-saarland.de/edu/se/2005/zedglossary.pdf

For example, S == [[Flash, Stork, Bisu, JaeDong]] <-- this is a bag

i. S [bag union symbol from glossary] [[Bisu]] = [[Flash, Stork, Bisu, JaeDong, Bisu]] <-- no problem here, should be correct

ii. S ⊕ {Bisu -> 3} = [[Flash, Stork, Bisu, JaeDong, Bisu, Bisu]] <-- no problem, Bisu has to occur 3 times

iii. S U {NaDa -> 3} = ? <--- how do you solve this? I thought bag union should be used rather than simple union, but I've been told the answer is [[Flash, Stork, Bisu, JaeDong, NaDa, NaDa,NaDa]]. Is 'U' indeed valid for bags? Isn't this a job for the bag union instead?

The difference between multiset sum and union is showcased in examples at the end of this section here: http://en.wikipedia.org/wiki/Multiset#Multiplicity_function

Edit: In your case, [Bisu, NaDa] [bag union symbol] [NaDa -> 3] = [Bisu, NaDa -> 4]
while [Bisu, NaDa] U [NaDa -> 3] = [Bisu, NaDa -> 3]
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
May 22 2014 19:58 GMT
#9660
So in this case, [[Bisu, Nada]] U [[Nada -> 3]] is kind of like [[Bisu, Nada]] ⊕ {Nada -> 3}?
Prev 1 481 482 483 484 485 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 2h 31m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 771
Railgan 76
StarCraft: Brood War
Calm 2370
Yoon 16
HiyA 16
League of Legends
Doublelift3053
KnowMe22
Counter-Strike
fl0m4777
minikerr10
Heroes of the Storm
Liquid`Hasu471
Other Games
gofns9495
tarik_tv4207
summit1g4154
Grubby2875
Beastyqt783
Mlord442
XaKoH 430
shahzam287
Livibee234
UpATreeSC172
C9.Mang0153
ZombieGrub107
ToD55
NeuroSwarm50
elazer36
Trikslyr34
ViBE25
SteadfastSC17
JuggernautJason12
Organizations
Other Games
BasetradeTV231
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 17 non-featured ]
StarCraft 2
• Hupsaiya 52
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• blackmanpl 58
• RayReign 29
• iopq 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• TFBlade989
Other Games
• imaqtpie662
• Shiphtur399
Upcoming Events
Replay Cast
2h 31m
Escore
12h 31m
CrankTV Team League
13h 31m
WardiTV Summer Champion…
14h 31m
Big Brain Bouts
18h 31m
Soulspirit vs goblin
TriGGeR vs Bunny
OSC
1d
Korean StarCraft League
1d 5h
Afreeca Starleague
1d 6h
RSL Revival
1d 11h
Serral vs SHIN
herO vs Solar
Online Event
1d 17h
[ Show More ]
Replay Cast
2 days
RSL Revival
2 days
Clem vs ByuN
Rogue vs Lambo
OSC
2 days
WardiTV Weekly
3 days
Sparkling Tuna Cup
4 days
INu's Battles
4 days
Cure vs herO
ByuN vs Rogue
PiGosaur Cup
5 days
The PondCast
5 days
Kung Fu Cup
5 days
Patches Events
5 days
Replay Cast
6 days
CrankTV Team League
6 days
Liquipedia Results

Completed

Proleague 2026-07-22
HSC XXIX
Eternal Conflict S2 E3

Ongoing

CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
BLAST Bounty Summer Qual
Stake Ranked Episode 3
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

Upcoming

Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
ASL Season 22: Qualifier #1
ASL Season 22: Qualifier #2
CSLAN 4
ASL Season 22
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
ESL Pro League Season 24
Stake Ranked Episode 4
Logitech G Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 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.