• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 20:46
CET 02:46
KST 10:46
  • 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 Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
RSL Offline FInals Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship Constellation Cup - Main Event - Stellar Fest RSL Revival: Season 3
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
BW General Discussion Which season is the best in ASL? Data analysis on 70 million replays BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[BSL21] RO16 Group D - Sunday 21:00 CET [BSL21] RO16 Group A - Saturday 21:00 CET [Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
ZeroSpace Megathread Stormgate/Frost Giant Megathread Nintendo Switch Thread The Perfect Game 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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread US Politics Mega-thread The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
James Bond movies ranking - pa…
Topin
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1604 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
Poland17496 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
Poland17496 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
Replay Cast
00:00
WardiTV Mondays #62
CranKy Ducklings126
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft500
elazer 141
Nathanias 68
CosmosSc2 44
StarCraft: Brood War
Artosis 678
Larva 182
Bale 31
Noble 24
Dota 2
monkeys_forever904
NeuroSwarm62
League of Legends
C9.Mang0335
JimRising 61
Counter-Strike
Foxcn271
Other Games
summit1g12968
tarik_tv5100
FrodaN1404
Day[9].tv772
shahzam509
Maynarde112
Mew2King91
ViBE49
ToD26
Organizations
Other Games
gamesdonequick805
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Hupsaiya 66
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• RayReign 44
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• Ler51
League of Legends
• Doublelift4759
Other Games
• imaqtpie1522
• Day9tv772
Upcoming Events
The PondCast
8h 14m
OSC
14h 14m
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
22h 14m
Korean StarCraft League
2 days
CranKy Ducklings
2 days
WardiTV 2025
2 days
SC Evo League
2 days
BSL 21
2 days
Sziky vs OyAji
Gypsy vs eOnzErG
OSC
2 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
3 days
[ Show More ]
WardiTV 2025
3 days
OSC
3 days
BSL 21
3 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
4 days
Wardi Open
4 days
StarCraft2.fi
4 days
Monday Night Weeklies
4 days
Replay Cast
4 days
WardiTV 2025
5 days
StarCraft2.fi
5 days
PiGosaur Monday
5 days
StarCraft2.fi
6 days
Tenacious Turtle Tussle
6 days
Liquipedia Results

Completed

Proleague 2025-11-30
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 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.