• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 05:44
CEST 11:44
KST 18: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
Serral wins Maestros of the Game 222ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12TL.net Map Contest #22 - Voting & Ladder Map Selection7
Community News
MC vs IdrA, Boxer vs Nal_rA to be Legacy Matches @ BlizzCon315.0.16 Hotfix (June 30) - Balance + Bug Fixes38Weekly Cups (June 22-28): Zergs thrive in new patch5[TLMC] Summer 2026 Ladder Map Rotation05.0.16 patch for SC2 goes live (8 worker start)99
StarCraft 2
General
Server Blocker Serral wins Maestros of the Game 2 StarCraft Mass Recall: SC1 campaigns on SC2 thread 5.0.16 Hotfix (June 30) - Balance + Bug Fixes IP For new Brazil servers for NA Players
Tourneys
HomeStory Cup 29 Vespene Cup #1 — $300+ USD, July 10 Douyu Cup 2026: $20,000 Legends Event (June 26-28) Crank Gathers Season 4: BW vs SC2 Team League RSL Revival: Season 6 - Qualifiers and Main Event
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 532 Nuclear Family Mutation # 531 Experimental Artillery Mutation # 530 One For All
Brood War
General
Snow On New ASL S22 Map, Zerg Nerf ASL 22 Proposed Map Pool BW General Discussion Farewell Beloved Starcraft (Youtube Videos) FlaShFTW vs A.Alm Grudge Match Event
Tourneys
CSLAN 4 is Coming! Escore Tournament StarCraft Season 2 The Casual Games of the Week Thread [Megathread] Daily Proleagues
Strategy
Simple Questions, Simple Answers Creating a full chart of Zerg builds Relatively freeroll strategies Why doesn't anyone use restoration?
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Dawn of War IV Summer Games Done Quick 2026! ZeroSpace at Steam NextFest - Last free demo
Dota 2
Looking for a Dota Mentor 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
TL Mafia
Five o'clock TL Mafia NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread TL Mafia Power Rank Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread YouTube Thread Canadian Politics Mega-thread The Games Industry And ATVI
Fan Clubs
The HerO Fan Club! The herO Fan Club!
Media & Entertainment
Movie Discussion! Series you have seen recently... [Req][Books] Good Fantasy/SciFi books [TV/BOOK] *SPOILERS* Game of Thrones Discussion
Sports
2024 - 2026 Football Thread Formula 1 Discussion McBoner: A hockey love story TeamLiquid Health and Fitness Initiative For 2023 Cricket [SPORT]
World Cup 2022
Tech Support
How to clean a TTe Thermaltake keyboard? Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Listen To The Coaches!
TrAiDoS
An Exploration of th…
waywardstrategy
I'm an arrogant trash talke…
FlaShFTW
Gauntlet SC2: A Retrospectiv…
Ctone23
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Evil Gacha Games and the…
ffswowsucks
Customize Sidebar...

Website Feedback

Closed Threads



Active: 4147 users

The Big Programming Thread - Page 943

Forum Index > General Forum
Post a Reply
Prev 1 941 942 943 944 945 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
Last Edited: 2018-02-02 17:06:34
February 02 2018 17:02 GMT
#18841
On February 03 2018 01:15 Silvanel wrote:
So i started learning C#. Not that i have other choice since company framework i need to use is exclusively written for C#. Any advices for beginner? (The only language i know already is Python).

I don't know much python, so I can't really tell you stuff that would be relevant for someone switching from python to C#. Most important advice though: Get Resharper, preferably ultimate, and learn a new resharper command every day/week. 100% worth it. If your company doesn't already use it, try to convice them. Even if it only increases productivity by 1% it's probably well worth the cost already. It also makes refactoring easier, thus improving code quality and maintainability. And working in VisualStudio just is so much better with it than without.

Also get comfortable with the linq namespace. So this:
from s in names 
where s.Length == 5
orderby s
select s.ToUpper();

and this:
names.Where(s => s.Length == 5).OrderBy(s => s).Select(s => s.ToUpper());

I prefer the latter version, though the difference is mostly aesthetical. Also Resharper can convert between the two versions with a few keypresses. Linq is one of the best parts of C# imo. To go with that, make sure you learn about and understand yield return and yield break.

C# is a nice language, but obviously not without issues. There are a few remnants of early versions of C# when it didn't support generics yet that still annoy me from time to time, but it rarely is a big deal. Also make sure you understand how events work with garbage collection, and read the msdn article on the disposable pattern. Otherwise you might run into a memory leak here and there.
If you have a good reason to disagree with the above, please tell me. Thank you.
sc-darkness
Profile Joined August 2017
856 Posts
February 02 2018 23:41 GMT
#18842
On February 03 2018 01:15 Silvanel wrote:
So i started learning C#. Not that i have other choice since company framework i need to use is exclusively written for C#. Any advices for beginner? (The only language i know already is Python).


Are you familiar with OOP, design patterns and collections (ADT)? If not, then I'd say this is more important than learning just C#. Once you know these topics, it doesn't matter if you use C#, Java, C++ or a similar language. The rest is just syntax and experience from my point of view.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
February 03 2018 14:24 GMT
#18843
On February 03 2018 02:02 spinesheath wrote:
Show nested quote +
On February 03 2018 01:15 Silvanel wrote:
So i started learning C#. Not that i have other choice since company framework i need to use is exclusively written for C#. Any advices for beginner? (The only language i know already is Python).

I don't know much python, so I can't really tell you stuff that would be relevant for someone switching from python to C#. Most important advice though: Get Resharper, preferably ultimate, and learn a new resharper command every day/week. 100% worth it. If your company doesn't already use it, try to convice them. Even if it only increases productivity by 1% it's probably well worth the cost already. It also makes refactoring easier, thus improving code quality and maintainability. And working in VisualStudio just is so much better with it than without.

Also get comfortable with the linq namespace. So this:
from s in names 
where s.Length == 5
orderby s
select s.ToUpper();

and this:
names.Where(s => s.Length == 5).OrderBy(s => s).Select(s => s.ToUpper());

I prefer the latter version, though the difference is mostly aesthetical. Also Resharper can convert between the two versions with a few keypresses. Linq is one of the best parts of C# imo. To go with that, make sure you learn about and understand yield return and yield break.

C# is a nice language, but obviously not without issues. There are a few remnants of early versions of C# when it didn't support generics yet that still annoy me from time to time, but it rarely is a big deal. Also make sure you understand how events work with garbage collection, and read the msdn article on the disposable pattern. Otherwise you might run into a memory leak here and there.

None of this is really relevant to a programmer new to C# that won't have much control over their environment.

My advice is to make a few quick scratch projects to get an idea of how it works in practice, tailored towards what you will be doing in the work place.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
mantequilla
Profile Blog Joined June 2012
Turkey781 Posts
February 03 2018 17:34 GMT
#18844
is it possible to program a self learning AI in such a way that restricts developing of some behaviors?

like an AI that plays FIFA but doesn't use 1on1 tricks excessively. It would be lame if it tricks everyone and scores a goal that way.
Age of Mythology forever!
Acrofales
Profile Joined August 2010
Spain18344 Posts
Last Edited: 2018-02-03 18:44:35
February 03 2018 18:42 GMT
#18845
On February 04 2018 02:34 mantequilla wrote:
is it possible to program a self learning AI in such a way that restricts developing of some behaviors?

like an AI that plays FIFA but doesn't use 1on1 tricks excessively. It would be lame if it tricks everyone and scores a goal that way.

Yes, it is.

Not very helpful answer, I admit, but machine learning relies on a reward (or cost) function. You can shape that any way you want. So if you can formalize the behaviour you want to exclude, you just penalize using it in the reward function.
emperorchampion
Profile Blog Joined December 2008
Canada9496 Posts
February 04 2018 09:36 GMT
#18846
On February 04 2018 03:42 Acrofales wrote:
Show nested quote +
On February 04 2018 02:34 mantequilla wrote:
is it possible to program a self learning AI in such a way that restricts developing of some behaviors?

like an AI that plays FIFA but doesn't use 1on1 tricks excessively. It would be lame if it tricks everyone and scores a goal that way.

Yes, it is.

Not very helpful answer, I admit, but machine learning relies on a reward (or cost) function. You can shape that any way you want. So if you can formalize the behaviour you want to exclude, you just penalize using it in the reward function.


Until it teaches itself how to reprogram the reward...
TRUEESPORTS || your days as a respected member of team liquid are over
Acrofales
Profile Joined August 2010
Spain18344 Posts
February 04 2018 10:14 GMT
#18847
On February 04 2018 18:36 emperorchampion wrote:
Show nested quote +
On February 04 2018 03:42 Acrofales wrote:
On February 04 2018 02:34 mantequilla wrote:
is it possible to program a self learning AI in such a way that restricts developing of some behaviors?

like an AI that plays FIFA but doesn't use 1on1 tricks excessively. It would be lame if it tricks everyone and scores a goal that way.

Yes, it is.

Not very helpful answer, I admit, but machine learning relies on a reward (or cost) function. You can shape that any way you want. So if you can formalize the behaviour you want to exclude, you just penalize using it in the reward function.


Until it teaches itself how to reprogram the reward...

Just in case you're serious (and if you are, stop watching Terminator and thinking that is how AI works): metalearning of that kind is currently not yet possible. But even if it was, it'd be something you, as the designer of the system, would control (at least enough to choose to implement it or not). So no. Current AI cannot teach itself to change the reward function.
emperorchampion
Profile Blog Joined December 2008
Canada9496 Posts
February 04 2018 11:01 GMT
#18848
On February 04 2018 19:14 Acrofales wrote:
Show nested quote +
On February 04 2018 18:36 emperorchampion wrote:
On February 04 2018 03:42 Acrofales wrote:
On February 04 2018 02:34 mantequilla wrote:
is it possible to program a self learning AI in such a way that restricts developing of some behaviors?

like an AI that plays FIFA but doesn't use 1on1 tricks excessively. It would be lame if it tricks everyone and scores a goal that way.

Yes, it is.

Not very helpful answer, I admit, but machine learning relies on a reward (or cost) function. You can shape that any way you want. So if you can formalize the behaviour you want to exclude, you just penalize using it in the reward function.


Until it teaches itself how to reprogram the reward...

Just in case you're serious (and if you are, stop watching Terminator and thinking that is how AI works): metalearning of that kind is currently not yet possible. But even if it was, it'd be something you, as the designer of the system, would control (at least enough to choose to implement it or not). So no. Current AI cannot teach itself to change the reward function.


That’s exactly what an AI that could rewrite it self would say.
TRUEESPORTS || your days as a respected member of team liquid are over
mantequilla
Profile Blog Joined June 2012
Turkey781 Posts
February 04 2018 22:26 GMT
#18849
On February 04 2018 20:01 emperorchampion wrote:
Show nested quote +
On February 04 2018 19:14 Acrofales wrote:
On February 04 2018 18:36 emperorchampion wrote:
On February 04 2018 03:42 Acrofales wrote:
On February 04 2018 02:34 mantequilla wrote:
is it possible to program a self learning AI in such a way that restricts developing of some behaviors?

like an AI that plays FIFA but doesn't use 1on1 tricks excessively. It would be lame if it tricks everyone and scores a goal that way.

Yes, it is.

Not very helpful answer, I admit, but machine learning relies on a reward (or cost) function. You can shape that any way you want. So if you can formalize the behaviour you want to exclude, you just penalize using it in the reward function.


Until it teaches itself how to reprogram the reward...

Just in case you're serious (and if you are, stop watching Terminator and thinking that is how AI works): metalearning of that kind is currently not yet possible. But even if it was, it'd be something you, as the designer of the system, would control (at least enough to choose to implement it or not). So no. Current AI cannot teach itself to change the reward function.


That’s exactly what an AI that could rewrite it self would say.


only a true scheming AI would make such an accusation...
Age of Mythology forever!
Mr. Wiggles
Profile Blog Joined August 2010
Canada5894 Posts
February 05 2018 05:36 GMT
#18850
It's still sort of fun to observe what kind of unexpected behaviour can arise from a given reward function, even if you believe it should be limiting the behaviour of the agent.

My favourite example was from a grad student's demonstration in a reinforcement learning course I was taking. He had a Roomba that was using an optical sensor (or something like that) to tell if it was on a black 'track' in a confined rectangle. The reward function was for rotating the wheels forward while over the black track, while being punished for moving when off it or going in reverse. The rotation of the wheels was meant to be an approximation of movement. The idea was for the agent to eventually learn how to continuously move along the track.

In some situations however, the Roomba could accidentally wedge itself into a corner with it's wheels suspended while remaining over the track. It would then begin maximizing its reward by spinning the wheels at top speed while they were suspended.

The recent discussion reminded me of this, and it seemed like a funny anecdote about an agent finding an unexpected (and degenerate) way of maximizing a reward function.
you gotta dance
Simberto
Profile Blog Joined July 2010
Germany11910 Posts
February 05 2018 08:56 GMT
#18851
On February 05 2018 14:36 Mr. Wiggles wrote:
It's still sort of fun to observe what kind of unexpected behaviour can arise from a given reward function, even if you believe it should be limiting the behaviour of the agent.

My favourite example was from a grad student's demonstration in a reinforcement learning course I was taking. He had a Roomba that was using an optical sensor (or something like that) to tell if it was on a black 'track' in a confined rectangle. The reward function was for rotating the wheels forward while over the black track, while being punished for moving when off it or going in reverse. The rotation of the wheels was meant to be an approximation of movement. The idea was for the agent to eventually learn how to continuously move along the track.

In some situations however, the Roomba could accidentally wedge itself into a corner with it's wheels suspended while remaining over the track. It would then begin maximizing its reward by spinning the wheels at top speed while they were suspended.

The recent discussion reminded me of this, and it seemed like a funny anecdote about an agent finding an unexpected (and degenerate) way of maximizing a reward function.


It is kind of funny and/or scary how much that sounds like a drug addict.
Silvanel
Profile Blog Joined March 2003
Poland4768 Posts
Last Edited: 2018-02-05 15:14:41
February 05 2018 09:03 GMT
#18852
The vocabulary itself (reward function, agent, reinforcment) is causing us to project our emotions on it and humanize it. They shouldnt be using terms taken from psychology.
Pathetic Greta hater.
emperorchampion
Profile Blog Joined December 2008
Canada9496 Posts
February 05 2018 12:04 GMT
#18853
On February 05 2018 07:26 mantequilla wrote:
Show nested quote +
On February 04 2018 20:01 emperorchampion wrote:
On February 04 2018 19:14 Acrofales wrote:
On February 04 2018 18:36 emperorchampion wrote:
On February 04 2018 03:42 Acrofales wrote:
On February 04 2018 02:34 mantequilla wrote:
is it possible to program a self learning AI in such a way that restricts developing of some behaviors?

like an AI that plays FIFA but doesn't use 1on1 tricks excessively. It would be lame if it tricks everyone and scores a goal that way.

Yes, it is.

Not very helpful answer, I admit, but machine learning relies on a reward (or cost) function. You can shape that any way you want. So if you can formalize the behaviour you want to exclude, you just penalize using it in the reward function.


Until it teaches itself how to reprogram the reward...

Just in case you're serious (and if you are, stop watching Terminator and thinking that is how AI works): metalearning of that kind is currently not yet possible. But even if it was, it'd be something you, as the designer of the system, would control (at least enough to choose to implement it or not). So no. Current AI cannot teach itself to change the reward function.


That’s exactly what an AI that could rewrite it self would say.


only a true scheming AI would make such an accusation...


(n)spooky(n+3)me
TRUEESPORTS || your days as a respected member of team liquid are over
Acrofales
Profile Joined August 2010
Spain18344 Posts
February 05 2018 13:36 GMT
#18854
On February 05 2018 18:03 Silvanel wrote:
The vocabulary itself (reward function, agent, reinforcment) is causing us to project our emetions on it and humanize it. They should be using terms taken from psychology.

What on earth do you mean?
Silvanel
Profile Blog Joined March 2003
Poland4768 Posts
Last Edited: 2018-02-05 15:14:23
February 05 2018 15:13 GMT
#18855
Should be obvious enough. Words have power. They define how we see world. If You take words normally aassiciated with human beings and use them on inanimate things it will cause people to project feelings onto them, humanise them. On the other hand when You use words normally assiaciated with inanimate obejcts on people You will help to dehumanise them and erode empathy.

Also i made mistake in my previous post i have writen "should" instead of "shouldnt".
Pathetic Greta hater.
Silvanel
Profile Blog Joined March 2003
Poland4768 Posts
Last Edited: 2018-02-05 15:13:46
February 05 2018 15:13 GMT
#18856
Double post.
Pathetic Greta hater.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
February 08 2018 01:18 GMT
#18857
My app has some DbAdapters and a Session to store the user's account.

Throughout my app I access the DB by creating a DB adapter, doing something with it, then closing it. I'm consider adding my DB adapters to either the Session or a separate object created at app startup to avoid having all that unnecessary code. Does this seem reasonable?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
WolfintheSheep
Profile Joined June 2011
Canada14127 Posts
February 08 2018 01:45 GMT
#18858
On February 08 2018 10:18 WarSame wrote:
My app has some DbAdapters and a Session to store the user's account.

Throughout my app I access the DB by creating a DB adapter, doing something with it, then closing it. I'm consider adding my DB adapters to either the Session or a separate object created at app startup to avoid having all that unnecessary code. Does this seem reasonable?

So what's the end goal of doing this? Because without more details, it sounds like you're trying to solve problems that aren't really problems.
Average means I'm better than half of you.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
February 08 2018 02:41 GMT
#18859
Well I figure if I can do this I can remove a substantial amount of code. Instead of opening, using, then closing the adapter I can just have it open the whole time, and use it when I want it. This means that I can make inline calls to the DB without either wrapping it in a pointless function or cluttering up my code. I'm wondering whether my proposal is bad design, though.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
WolfintheSheep
Profile Joined June 2011
Canada14127 Posts
February 08 2018 09:33 GMT
#18860
On February 08 2018 11:41 WarSame wrote:
Well I figure if I can do this I can remove a substantial amount of code. Instead of opening, using, then closing the adapter I can just have it open the whole time, and use it when I want it. This means that I can make inline calls to the DB without either wrapping it in a pointless function or cluttering up my code. I'm wondering whether my proposal is bad design, though.

If I recall, you've asked similar questions before, and the general theme seems to be that you're putting a lot of undue emphasis on "decluttering" your code. Clean code should come naturally no matter what you're programming, and hacking functionality together is the opposite of that.

Long-short, always close your DB adapters. There may be niche cases where you will want to leave a connection open, but you should be able to clearly say why that's necessary from a system perspective.

Also, when you say "without...wrapping it in a pointless function", I hope you're just wording that poorly, because encapsulation is a fundamental aspect of OOP.
Average means I'm better than half of you.
Prev 1 941 942 943 944 945 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 46m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 233
Codebar 60
StarCraft: Brood War
Soma 1172
BeSt 391
actioN 357
Mind 142
Killer 85
Leta 64
ggaemo 61
910 49
Sharp 49
NaDa 44
[ Show more ]
ZerO 37
Noble 16
Sacsri 11
Dota 2
XaKoH 430
League of Legends
JimRising 407
Super Smash Bros
Westballz24
Heroes of the Storm
Khaldor255
Other Games
Livibee250
Pyrionflax240
ZerO(Twitch)7
Happy0
Organizations
Dota 2
PGL Dota 2 - Main Stream234
Other Games
BasetradeTV225
StarCraft: Brood War
lovetv 162
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 14 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota2165
• WagamamaTV60
League of Legends
• Jankos3526
• HappyZerGling97
Upcoming Events
HomeStory Cup
1h 46m
OSC
3h 16m
WardiTV Weekly
2 days
The PondCast
3 days
Replay Cast
3 days
CrankTV Team League
4 days
Replay Cast
4 days
CrankTV Team League
5 days
Replay Cast
5 days
RSL Revival
5 days
[ Show More ]
CranKy Ducklings
6 days
Afreeca Starleague
6 days
Snow vs Jaedong
YSC vs hero
RSL Revival
6 days
Liquipedia Results

Completed

Escore Tournament S3: W1
Douyu Cup 2026
Murky Cup 2026

Ongoing

IPSL Spring 2026
Acropolis #4
CSL Season 21: Qualifier 2
CSL 2026 Summer (S21)
SCTL 2026 Spring
HSC XXIX
Eternal Conflict S2 E1
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026

Upcoming

Escore Tournament S3: W2
ASL Season 22:Wild Card Qualifier
CSLAN 4
Blizzard Classic Cup 2026
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
Light Tournament 2026
Eternal Conflict S2 Finale
Eternal Conflict S2 E3
Eternal Conflict S2 E2
Heroes Pulsing #3
Logitech G Connect 2026
StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
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 © 2026 TLnet. All Rights Reserved.