• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 11:44
CEST 17:44
KST 00:44
  • 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] Ro16 Preview: Holy Diver0[ASL22] Ro16 Preview: Rough Waters10[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915
Community News
StarCraft open world shooter announced at BlizzCon72Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism10Official StarCraft website teases new content ahead of BlizzCon?172Stellar Fest TWO the Moon (Dec 16-20)9Weekly Cups (August 24-30): Patches' balance mod takes over3
StarCraft 2
General
StarCraft open world shooter announced at BlizzCon How do you feel about the StarCraft shooter announcement at BlizzCon 2026? Balance hotfix patch 5.0.16b (July 16) Team Liquid Map Contest #22: Results and Winners Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament RSL goes to London! 2026 Offline Finals Nov 21-22 KSL Week #92 IntoTheTV X SOOP SC2 League : Weekly & Monthly 2026 GSTL Announcement
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
The PondCast: SC2 News & Results Mutation # 542 The Ascended Mutation # 541 Binary Choice Mutation # 540 Dodge This
Brood War
General
Official StarCraft website teases new content ahead of BlizzCon? [ASL22] Ro16 Preview: Holy Diver ASL22 General Discussion BGH Auto Balance -> http://bghmmr.eu/ Broodwar Prediction Market
Tourneys
[ASL22] Ro16 Group C [ASL22] Ro16 Group B [ASL22] Ro16 Group A Escore Tournament - Season 3
Strategy
Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation Game Theory for Starcraft
Other Games
General Games
Diablo IV Nintendo Switch Thread EVE Corporation [Maplestory Hardcore] Let's Play~!! General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
UK Politics Mega-thread US Politics Mega-thread Things Aren’t Peaceful in Palestine Trading/Investing Thread Russo-Ukrainian War Thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Diablo Animated Series on Netflix
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
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Virtual Romance, Real-Life C…
TrAiDoS
Regacy Esports:Our Goa…
regacyesports
Dreaming of BW patches (mod…
c3rberUs
LOCKPICKING NOOB
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7126 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
Poland17843 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
Poland17843 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 16m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 549
Rex 106
SHIN 51
Railgan 4
StarCraft: Brood War
Britney 45342
Calm 5619
Jaedong 935
PianO 733
firebathero 348
ggaemo 209
910 91
Bonyth 79
Sea.KH 68
Hyun 63
[ Show more ]
Mini 59
Mong 56
Liquid`Ret 45
sSak 38
Trap 32
Sharp 26
Rock 19
HiyA 19
Hm[arnc] 14
SilentControl 11
Shine 10
Dota 2
qojqva4283
syndereN896
Fuzer 264
LuMiX1
Super Smash Bros
Mew2King87
Heroes of the Storm
MindelVK4
Other Games
Grubby3360
singsing1452
Liquid`RaSZi1251
Hui .212
QueenE125
Organizations
Other Games
EGCTV1422
StarCraft: Brood War
Kim Chul Min (afreeca) 14
[ Show 15 non-featured ]
StarCraft 2
• StrangeGG 79
• Adnapsc2 33
• mYiSmile129
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• FirePhoenix9
• Michael_bg 9
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis3626
Other Games
• Shiphtur67
Upcoming Events
RSL Revival
16m
Serral vs Rogue
BlizzCon
2h 46m
IdrA vs MC
Afreeca Starleague
18h 16m
Light vs JyJ
Soulkey vs hero
WardiTV Weekly
19h 16m
Monday Night Weeklies
1d
Afreeca Starleague
1d 18h
Snow vs Shinee
Shine vs EffOrt
GSL
1d 19h
PiGosaur Cup
2 days
The PondCast
2 days
Kung Fu Cup
2 days
[ Show More ]
Replay Cast
3 days
KCM Race Survival
3 days
IntoTheTV X SOOP
3 days
Replay Cast
4 days
IntoTheTV X SOOP
4 days
Replay Cast
5 days
GSL
5 days
Replay Cast
6 days
GSL
6 days
Shopify Rebellion Sundays
6 days
Spirit vs Mixu
Liquipedia Results

Completed

Acropolis #5 - TRS
PiG Sty Festival 8.0
Big Dog Cup 2026 Div 1

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Acropolis #5
Blizzard Classic Cup 2026
Blizzard Classic Cup 2026
RSL Revival: Season 6
Calamity Invitational
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026

Upcoming

Acropolis #5 - GSA
Acropolis #5 - GSB
Acropolis #5 - GSC
SC4ALL II: Brood War
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
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
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.