• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 17:48
CEST 23:48
KST 06:48
  • 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
Code S Season 1 - RO8 Preview3[ASL21] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10
Community News
Maestros of The Game 2 announcement and schedule !4Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event12Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25
StarCraft 2
General
Code S Season 1 - RO8 Preview Behind the Blue - Team Liquid History Book Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results
Tourneys
Maestros of The Game 2 announcement and schedule ! GSL Code S Season 1 (2026) Sea Duckling Open (Global, Bronze-Diamond) RSL Revival: Season 5 - Qualifiers and Main Event Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
Do we have a pimpest plays list? BGH Auto Balance -> http://bghmmr.eu/ (Spoiler) Asl ro8 D winner interview BW General Discussion AI Question
Tourneys
[ASL21] Ro8 Day 4 Small VOD Thread 2.0 [BSL22] RO16 Group Stage - 02 - 10 May [ASL21] Ro8 Day 3
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Stormgate/Frost Giant Megathread Dawn of War IV Nintendo Switch Thread OutLive 25 (RTS Game) Daigo vs Menard Best of 10
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
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 TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread The Letting Off Steam Thread Russo-Ukrainian War Thread 3D technology/software discussion
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
How EEG Data Can Predict Gam…
TrAiDoS
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2241 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
Poland17743 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
Poland17743 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 12m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Hui .186
JuggernautJason75
CosmosSc2 24
StarCraft: Brood War
ggaemo 141
Dewaltoss 85
NaDa 16
League of Legends
Doublelift2506
Reynor92
Counter-Strike
fl0m1936
Super Smash Bros
PPMD61
Other Games
tarik_tv5320
Grubby3159
Liquid`RaSZi2102
FrodaN852
shahzam481
syndereN212
monkeys_forever209
Liquid`Hasu168
ArmadaUGS98
Mew2King67
ViBE36
Organizations
Other Games
gamesdonequick2109
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 17 non-featured ]
StarCraft 2
• musti20045 24
• Adnapsc2 15
• Reevou 2
• Kozan
• AfreecaTV YouTube
• sooper7s
• intothetv
• IndyKCrew
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• blackmanpl 44
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• imaqtpie2174
Other Games
• Scarra823
• Shiphtur389
Upcoming Events
Replay Cast
2h 12m
Escore
12h 12m
The PondCast
12h 12m
WardiTV Invitational
13h 12m
Zoun vs Ryung
Lambo vs ShoWTimE
Big Brain Bouts
18h 12m
Fjant vs Bly
Serral vs Shameless
OSC
1d
Replay Cast
1d 2h
CranKy Ducklings
1d 12h
RSL Revival
1d 12h
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
1d 13h
Krystianer vs TriGGeR
Cure vs Rogue
[ Show More ]
uThermal 2v2 Circuit
1d 17h
BSL
1d 21h
Artosis vs TerrOr
spx vs StRyKeR
Replay Cast
2 days
Sparkling Tuna Cup
2 days
RSL Revival
2 days
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
2 days
BSL
2 days
Dewalt vs DragOn
Aether vs Jimin
GSL
3 days
Afreeca Starleague
3 days
Soma vs Leta
Wardi Open
3 days
Monday Night Weeklies
3 days
OSC
4 days
CranKy Ducklings
4 days
Afreeca Starleague
4 days
Light vs Flash
Replay Cast
5 days
Replay Cast
6 days
The PondCast
6 days
Liquipedia Results

Completed

Proleague 2026-05-05
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026

Upcoming

Escore Tournament S2: W6
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
YSL S3
Escore Tournament S2: W7
Escore Tournament S2: W8
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 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.