• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:04
CET 16:04
KST 00:04
  • 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 - 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[ASL20] Finals Preview: Arrival13
Community News
[TLMC] Fall/Winter 2025 Ladder Map Rotation12Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA8StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7
StarCraft 2
General
Mech is the composition that needs teleportation t RotterdaM "Serral is the GOAT, and it's not close" RSL Season 3 - RO16 Groups C & D Preview [TLMC] Fall/Winter 2025 Ladder Map Rotation TL.net Map Contest #21: Winners
Tourneys
RSL Revival: Season 3 Sparkling Tuna Cup - Weekly Open Tournament Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle BW General Discussion What happened to TvZ on Retro? Brood War web app to calculate unit interactions [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] RO32 Group D - Sunday 21:00 CET [BSL21] RO32 Group C - Saturday 21:00 CET
Strategy
PvZ map balance Current Meta Simple Questions, Simple Answers How to stay on top of macro?
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread Clair Obscur - Expedition 33 Beyond All Reason
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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread Artificial Intelligence Thread Canadian Politics Mega-thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Dyadica Gospel – a Pulp No…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2289 users

The Big Programming Thread - Page 765

Forum Index > General Forum
Post a Reply
Prev 1 763 764 765 766 767 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.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
September 19 2016 21:45 GMT
#15281
Nah, your first version seems right. Apparently Comparable<T> is a generic interface, which makes sense. So, if you are implementing it for Hurricanes, it is reasonable to implement only the specific version Comparable<Hurricane> which only compares Hurricanes.
If you have a good reason to disagree with the above, please tell me. Thank you.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2016-09-19 23:59:42
September 19 2016 22:05 GMT
#15282
--- Nuked ---
Acrofales
Profile Joined August 2010
Spain18117 Posts
Last Edited: 2016-09-19 22:26:20
September 19 2016 22:25 GMT
#15283
No. Your initial code idea was correct. That is the most basic (and most common) way of working with generics.

Ninja'd by Nesserev.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2016-09-20 00:01:17
September 19 2016 23:59 GMT
#15284
ok thanks guys

it's just odd to me that it's called "generics" when it's actually wanting something specific?


edit: looked the word up. guess it's kinda falling under this definition: "of, applicable to, or referring to all the members of a genus, class...."
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
Last Edited: 2016-09-20 01:03:22
September 20 2016 00:56 GMT
#15285
On September 20 2016 08:59 travis wrote:
ok thanks guys

it's just odd to me that it's called "generics" when it's actually wanting something specific?


edit: looked the word up. guess it's kinda falling under this definition: "of, applicable to, or referring to all the members of a genus, class...."


The point of the generic interface is that any class can use it. It wants something more specific because you want the guarantee that your class can be ordered. However, every class should not be ordered in the same manner so each class should be able to implement the method in a way that makes sense to that specific class.

You can also use generics in the manner that makes more sense intuitively. See Collections like ArrayList or Maps where all the methods are implemented with generics because you will do the same thing for any type.
I'll always be your shadow and veil your eyes from states of ain soph aur.
mantequilla
Profile Blog Joined June 2012
Turkey779 Posts
Last Edited: 2016-09-22 15:01:34
September 22 2016 14:59 GMT
#15286
I'm a total java guy but boss says we might start a .net project, a web api and angularjs frontend. I have close to none info on asp.net besides a small website I wrote back in 2011.

what is the usual setup for a rest backend using .net these days? I'm reading something called .Net core, but it seems like an open source - reduced version of the original framework. What are the things used for, say serialization (json), authentication/authorization, ORM.. etc. in modern .net ecosystem? A book suggestion is also ok.

I followed some tutorials but .net is so vast it's hard to understand which stuff is recent, which is outdated. It's like googling for spring and finding those old tutorials using xml configs and such

Age of Mythology forever!
AKnopf
Profile Blog Joined March 2011
Germany259 Posts
September 22 2016 16:04 GMT
#15287
Hey mantequilla, I'm happy to provide our setup:

Backend: ASP.NET MVC
It's ok I guess. Defenitely worlds better than web forms (god that was aweful). Coming from ruby on rails, I am missing a few things though ;-)

JSON: Newtonsoft (http://www.newtonsoft.com/json)
It just worked like a charm and you can easily add it via nuGet

Authentication: MembershipReboot https://github.com/brockallen/BrockAllen.MembershipReboot
Since the built-in authentication is garbage, we decided for this open source one. It was a bit tricky to get to work at first but now works really well. It as plenty of features and you can see its built for extensability. It has a rather bad documentation, sadly. So if you want to add new notifications or translating existing ones use your own user class, you have to dive into the code and see where your entry points are. What's really nice about it, that is has no assumptions on your ORM and authentication storage (we used Owin, the default)
You will have a much easier time if you derive your user class from the MembershipReboot.RelationalUser

ORM: Entitiy framework
It's very important to use code first. There are quite some vital features you miss out on with model first or data base first. Also dont use annotations but prefer the fluent API, because there are some nasty bugs with optional relations getting validates as missing when you are using annotations.
Also think twice about connection handling. Throwing a 'using' everywhere will cost you performance. :-(

.Net core is a reduced library that is supped to be portable. Don't know much else about it though. (wasntme)


Unfortunately, .Net is relatively new to the open source scene and there are not as many good resources available as you might be used to. Sometimes it's hard to find more advanced discussion because a lot of the stuff you will find is rather basic. Personally, I didn't learn much from the official documentation but others found it rather useful. Maybe you can come back and report your experiences after a while? :-)
The world - its a funny place
Manit0u
Profile Blog Joined August 2004
Poland17432 Posts
September 22 2016 19:22 GMT
#15288
I urge everyone to play some Human Resource Machine. It's a lot of fun and optimization challenges definitely make you think differently about the code you write.
Time is precious. Waste it wisely.
mantequilla
Profile Blog Joined June 2012
Turkey779 Posts
Last Edited: 2016-09-22 20:59:03
September 22 2016 20:48 GMT
#15289
On September 23 2016 01:04 AKnopf wrote:
Hey mantequilla, I'm happy to provide our setup:

Backend: ASP.NET MVC
It's ok I guess. Defenitely worlds better than web forms (god that was aweful). Coming from ruby on rails, I am missing a few things though ;-)

JSON: Newtonsoft (http://www.newtonsoft.com/json)
It just worked like a charm and you can easily add it via nuGet

Authentication: MembershipReboot https://github.com/brockallen/BrockAllen.MembershipReboot
Since the built-in authentication is garbage, we decided for this open source one. It was a bit tricky to get to work at first but now works really well. It as plenty of features and you can see its built for extensability. It has a rather bad documentation, sadly. So if you want to add new notifications or translating existing ones use your own user class, you have to dive into the code and see where your entry points are. What's really nice about it, that is has no assumptions on your ORM and authentication storage (we used Owin, the default)
You will have a much easier time if you derive your user class from the MembershipReboot.RelationalUser

ORM: Entitiy framework
It's very important to use code first. There are quite some vital features you miss out on with model first or data base first. Also dont use annotations but prefer the fluent API, because there are some nasty bugs with optional relations getting validates as missing when you are using annotations.
Also think twice about connection handling. Throwing a 'using' everywhere will cost you performance. :-(

.Net core is a reduced library that is supped to be portable. Don't know much else about it though. (wasntme)


Unfortunately, .Net is relatively new to the open source scene and there are not as many good resources available as you might be used to. Sometimes it's hard to find more advanced discussion because a lot of the stuff you will find is rather basic. Personally, I didn't learn much from the official documentation but others found it rather useful. Maybe you can come back and report your experiences after a while? :-)



thx very much for answering. Is there anything newer you'd replace with there if you were starting a new project today?
Age of Mythology forever!
dsyxelic
Profile Joined May 2010
United States1417 Posts
September 22 2016 20:57 GMT
#15290
kinda random, but as noobs, how hard is making a simple game compared to making a simple app?

ex. simple tower defense game vs a simple app that kinda works like TL's event calendar, but on an app

my initial guess was the latter but just want to get more informed thoughts on it.

basically im the one who gets the last say on what our group does for our 6 month long project (its for a class). we have 2 guys who seem to really want to do the tower defense game off unity while the others want to do the app i described above. I just want whatever takes the least headaches and will be most useful for me to learn (im not interested in games and somewhat interested in mobile apps).

the members' experiences range from 0-2 years of programming/CS.

app might be too easy(?) but it's a 2 credit course and my schedule is quite loaded this fall.
TL/SKT
mantequilla
Profile Blog Joined June 2012
Turkey779 Posts
September 22 2016 21:06 GMT
#15291
On September 23 2016 05:57 dsyxelic wrote:
kinda random, but as noobs, how hard is making a simple game compared to making a simple app?

ex. simple tower defense game vs a simple app that kinda works like TL's event calendar, but on an app

my initial guess was the latter but just want to get more informed thoughts on it.

basically im the one who gets the last say on what our group does for our 6 month long project (its for a class). we have 2 guys who seem to really want to do the tower defense game off unity while the others want to do the app i described above. I just want whatever takes the least headaches and will be most useful for me to learn (im not interested in games and somewhat interested in mobile apps).

the members' experiences range from 0-2 years of programming/CS.

app might be too easy(?) but it's a 2 credit course and my schedule is quite loaded this fall.


I'm not very knowledgeable about game dev but I'd guess app is easier especially because of asset stuff in games, like sounds and sprites. But if you design a good architecture for the app like a backend api + frontend + database etc. it can be very instructional.
Age of Mythology forever!
shz
Profile Blog Joined October 2010
Germany2687 Posts
Last Edited: 2016-09-22 21:55:05
September 22 2016 21:54 GMT
#15292
On September 23 2016 05:57 dsyxelic wrote:
kinda random, but as noobs, how hard is making a simple game compared to making a simple app?

ex. simple tower defense game vs a simple app that kinda works like TL's event calendar, but on an app

my initial guess was the latter but just want to get more informed thoughts on it.

basically im the one who gets the last say on what our group does for our 6 month long project (its for a class). we have 2 guys who seem to really want to do the tower defense game off unity while the others want to do the app i described above. I just want whatever takes the least headaches and will be most useful for me to learn (im not interested in games and somewhat interested in mobile apps).

the members' experiences range from 0-2 years of programming/CS.

app might be too easy(?) but it's a 2 credit course and my schedule is quite loaded this fall.



Piggy backing on this a bit, how do you model "rules" for games? I want to work on a companion app that helps with gm'ing a game, but I have no idea how to model this rules so that they're changeable per game. I'd need to have some sort of model of a rule/setup to resolve rounds. Am I even using the correct terminology and is this even generalizable?
Liquipedia
Manit0u
Profile Blog Joined August 2004
Poland17432 Posts
September 22 2016 23:44 GMT
#15293
Making simple games with pygame library in Python is relatively easy (took me about 4 hours to make the memory game without any prior Python experience).

For your gm'ing companion app shz I'd suggest making a different app for different games. Start with simple stuff like dice rolls and most commonly done calculations (damage and stuff). You can then progress it to specific actions, where all the dice-rolling and calculation is done in the background.

For example, let gm store player character sheets in there and then add the option of choosing a character and an action. The app would provide the result of chosen character undertaking it (with showing the odds beforehand perhaps). This could definitely speed up any RP session by letting you bypass a lot of number tracking and tedious stuff.
Time is precious. Waste it wisely.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2016-09-23 01:39:30
September 23 2016 01:32 GMT
#15294
On September 23 2016 06:54 shz wrote:
Show nested quote +
On September 23 2016 05:57 dsyxelic wrote:
kinda random, but as noobs, how hard is making a simple game compared to making a simple app?

ex. simple tower defense game vs a simple app that kinda works like TL's event calendar, but on an app

my initial guess was the latter but just want to get more informed thoughts on it.

basically im the one who gets the last say on what our group does for our 6 month long project (its for a class). we have 2 guys who seem to really want to do the tower defense game off unity while the others want to do the app i described above. I just want whatever takes the least headaches and will be most useful for me to learn (im not interested in games and somewhat interested in mobile apps).

the members' experiences range from 0-2 years of programming/CS.

app might be too easy(?) but it's a 2 credit course and my schedule is quite loaded this fall.



Piggy backing on this a bit, how do you model "rules" for games? I want to work on a companion app that helps with gm'ing a game, but I have no idea how to model this rules so that they're changeable per game. I'd need to have some sort of model of a rule/setup to resolve rounds. Am I even using the correct terminology and is this even generalizable?


I would imagine it's just as simple as having a "rule" interface that you just change the implementation of or just a rule class that you change values of? What kind of rules are you talking about?
There is no one like you in the universe.
Acrofales
Profile Joined August 2010
Spain18117 Posts
September 23 2016 09:16 GMT
#15295
On September 23 2016 06:54 shz wrote:
Show nested quote +
On September 23 2016 05:57 dsyxelic wrote:
kinda random, but as noobs, how hard is making a simple game compared to making a simple app?

ex. simple tower defense game vs a simple app that kinda works like TL's event calendar, but on an app

my initial guess was the latter but just want to get more informed thoughts on it.

basically im the one who gets the last say on what our group does for our 6 month long project (its for a class). we have 2 guys who seem to really want to do the tower defense game off unity while the others want to do the app i described above. I just want whatever takes the least headaches and will be most useful for me to learn (im not interested in games and somewhat interested in mobile apps).

the members' experiences range from 0-2 years of programming/CS.

app might be too easy(?) but it's a 2 credit course and my schedule is quite loaded this fall.



Piggy backing on this a bit, how do you model "rules" for games? I want to work on a companion app that helps with gm'ing a game, but I have no idea how to model this rules so that they're changeable per game. I'd need to have some sort of model of a rule/setup to resolve rounds. Am I even using the correct terminology and is this even generalizable?


Presumably you want some type of GUI in which the user (GM?) can configure the rules for that game, and then an automated backend that makes sure they are followed (within the scope of the app)?

In that case, have a look at RuleML. It might be a bit too big for what you need (but some of the ideas in it might inspire your own solution), and I am not sure the types of rules it is meant to encode are exactly what you need (not sure on what type of rules you need in the first place), but it is the de facto standard for codifying (and interpreting) rules in Semantic Web research, and sees quite a bit of adherence in the development of automated planning systems, electronic institutions and other areas where adaptable, configurable rules are important.
solidbebe
Profile Blog Joined November 2010
Netherlands4921 Posts
September 23 2016 09:44 GMT
#15296
On September 23 2016 04:22 Manit0u wrote:
I urge everyone to play some Human Resource Machine. It's a lot of fun and optimization challenges definitely make you think differently about the code you write.

This game is a lot of fun and definitely pretty tough even for a programmer!
That's the 2nd time in a week I've seen someone sig a quote from this GD and I have never witnessed a sig quote happen in my TL history ever before. -Najda
Acrofales
Profile Joined August 2010
Spain18117 Posts
September 23 2016 09:45 GMT
#15297
On September 23 2016 04:22 Manit0u wrote:
I urge everyone to play some Human Resource Machine. It's a lot of fun and optimization challenges definitely make you think differently about the code you write.

Do you know if they are working on an Android version?
shz
Profile Blog Joined October 2010
Germany2687 Posts
September 23 2016 11:44 GMT
#15298
Thanks guys!

I think using the term GM was a bit ambiguous. I want to make a web-app to help you moderate Mafia games, in which different setups can have different rules (what role can do what, when does the scum have 1 or 2 kp etc.) And my question was if there is any way how to model stuff like this.

I'll take a look at RuleML :O
Liquipedia
Manit0u
Profile Blog Joined August 2004
Poland17432 Posts
September 23 2016 12:08 GMT
#15299
On September 23 2016 18:45 Acrofales wrote:
Show nested quote +
On September 23 2016 04:22 Manit0u wrote:
I urge everyone to play some Human Resource Machine. It's a lot of fun and optimization challenges definitely make you think differently about the code you write.

Do you know if they are working on an Android version?


No idea. There's PC/iOS for now.
Time is precious. Waste it wisely.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
September 23 2016 17:21 GMT
#15300
What happens if my class has a variable:

class {

int variable;

//and then the constructor takes a parameter with the same variable name and does this:

class(int variable){

this.variable = variable;
Prev 1 763 764 765 766 767 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 56m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 370
SteadfastSC 346
Reynor 49
mcanning 46
StarCraft: Brood War
Britney 33170
Rain 4067
actioN 1777
Horang2 1531
Jaedong 1212
Shuttle 535
Stork 467
EffOrt 291
firebathero 269
Leta 120
[ Show more ]
Barracks 105
ggaemo 93
Shinee 91
Hyun 86
PianO 73
LaStScan 67
JYJ49
Shine 48
Mong 31
Rock 24
Movie 24
ToSsGirL 23
Bale 19
zelot 14
soO 10
HiyA 9
sorry 8
Sacsri 6
Dota 2
Gorgc5504
qojqva1754
Dendi1127
XcaliburYe145
LuMiX0
Counter-Strike
oskar107
Heroes of the Storm
Khaldor113
Other Games
FrodaN4271
B2W.Neo1782
DeMusliM470
Hui .329
Lowko301
Pyrionflax236
Fuzer 206
febbydoto6
Organizations
Dota 2
PGL Dota 2 - Main Stream8720
PGL Dota 2 - Secondary Stream3207
Other Games
EGCTV67
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Berry_CruncH154
• StrangeGG 72
• IndyKCrew
• AfreecaTV YouTube
• intothetv
• Kozan
• sooper7s
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• Michael_bg 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 2112
• Ler59
League of Legends
• Nemesis3149
Other Games
• WagamamaTV236
Upcoming Events
IPSL
1h 56m
ZZZero vs rasowy
Napoleon vs KameZerg
OSC
3h 56m
BSL 21
4h 56m
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
Sparkling Tuna Cup
18h 56m
RSL Revival
18h 56m
Reynor vs sOs
Maru vs Ryung
Kung Fu Cup
20h 56m
Cure vs herO
Reynor vs TBD
WardiTV Korean Royale
20h 56m
BSL 21
1d 4h
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
IPSL
1d 4h
Dewalt vs WolFix
eOnzErG vs Bonyth
Replay Cast
1d 7h
[ Show More ]
Wardi Open
1d 20h
Monday Night Weeklies
2 days
WardiTV Korean Royale
2 days
BSL: GosuLeague
3 days
The PondCast
3 days
Replay Cast
4 days
RSL Revival
4 days
BSL: GosuLeague
5 days
RSL Revival
5 days
WardiTV Korean Royale
5 days
RSL Revival
6 days
WardiTV Korean Royale
6 days
Liquipedia Results

Completed

Proleague 2025-11-14
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
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
BLAST Open Fall 2025

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 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...

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.