• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 16:06
CET 22:06
KST 06:06
  • 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
[ASL22] Finals Preview: Sweet Victory!12[ASL22] Ro4 Preview: Mirror Mirror6[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5
Community News
Weekly Cups (October 19-25): Clem triples first in 5.0.175Evil Geniuses - shutting down21ISSL (IntoTheTV x SOOP SC2 League): Premier7Weekly Cups (October 12-18): 5.0.17 era begins1[$1250] International ShieldBattery League99
StarCraft 2
General
How do you feel about the mass reverts in the 5.0.17 PTR? No more SC2 streamers on team liquid? Behind the Blue - Team Liquid History Book 5.0.17 Patch Notes - October 7, 2026 Evil Geniuses - shutting down
Tourneys
ISSL (IntoTheTV x SOOP SC2 League): Premier Stellar Fest TWO the Moon (Dec 16-20) Sparkling Tuna Cup - Weekly Open Tournament RSL goes to London! 2026 Offline Finals Nov 21-22 RSL 2026 Offline Finals LCQ Sign-Ups
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[D] the control group Simple Questions/Answers [G] How to playtest arcade maps [A] Nemrods 1/4 players
External Content
Mutation # 550 Graveyard Shift The PondCast: SC2 News & Results Mutation # 549 Endless Sparkles Mutation # 548 Shining Bright
Brood War
General
How SKT1 S-Tiers Felt To Be Swept By Flash Rollback Netcode in Brood War Top Players of October 2026 (EBPD Rankings) BW General Discussion Sagi.gg Launcher Released
Tourneys
[Megathread] Daily Proleagues 2v2v2v2 Tournament Stage 1: Community Poll [IPSL] IPSL Winter 26-27 Ro24 is HERE! [$1250] International ShieldBattery League
Strategy
50,000-Word Terran Builds Memo 2026-10-22 Cliff Jump Revisited (1 in a 1000 strategy) Simple Questions, Simple Answers
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Deus Ex 3!? Mobile Legends: Bang Bang Armies of Exigo - YesYes?
Dota 2
Dota 2 Champions League Season 3 Begins April 25!
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread The Chess Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
Fan Club Resource Thread Reynor Fan Club The Flash Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts
Blogs
Why I built Repalyzer (1.1.…
BlueStar
Innovate or Game Over?
TrAiDoS
ShieldBattery on Mac
Kraekkling
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
Can Bots Beat Pros?? Starcr…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 10869 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
Poland17868 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
Poland17868 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 1h 54m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 966
Nina 529
TKL 439
SteadfastSC 193
StarCraft: Brood War
Bisu 1128
Dewaltoss 131
ProTech90
HiyA 47
Shinee 38
Aegong 26
Dota 2
qojqva2841
monkeys_forever260
PGG 171
capcasts65
Counter-Strike
allub291
Heroes of the Storm
Grubby3963
Liquid`Hasu856
Other Games
tarik_tv6150
Liquid`RaSZi3118
Mlord499
C9.Mang0205
XaKoH 178
Mew2King68
Organizations
Counter-Strike
PGL598
Other Games
BasetradeTV34
StarCraft: Brood War
lovetv 7
[ Show 16 non-featured ]
StarCraft 2
• Reevou 9
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Laughngamez YouTube
• Migwel
StarCraft: Brood War
• Eskiya23 17
• Pr0nogo 3
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis3641
Other Games
• imaqtpie702
• Shiphtur676
• WagamamaTV383
Upcoming Events
Replay Cast
1h 54m
Rogue vs Classic
Patches Events
15h 54m
PiGosaur Cup
1d 3h
Kung Fu Cup
1d 13h
Replay Cast
2 days
The PondCast
2 days
KCM Race Survival
2 days
IntoTheTV X SOOP
4 days
Reynor vs Solar
ByuN vs SHIN
Clem vs MaxPax
herO vs Rogue
WardiTV Invitational
4 days
IPSL
4 days
WorsT vs nOmaD
Dewalt vs andersOn
[ Show More ]
IntoTheTV X SOOP
5 days
WardiTV Invitational
5 days
IPSL
5 days
Azhi_Dahaki vs ggnore13
Double vs WIZARD
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-11-01
Blizzard Classic Cup 2026
HCC Season 3

Ongoing

Acropolis #5
KCM Race Survival 2026 Season 4
International ShieldBattery League
BSL Season 23
IPSL Winter 2026-27
Proleague 2026-11-02
Calamity Cup Div. A Season 8
IEM Beijing 2026
PGL Masters Bucharest 2026
Stake Ranked Episode 5
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026

Upcoming

1xBet Invitational
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
BLAST Bounty Winter 2027
eXTREMESLAND 2026
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 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.