• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 20:29
CET 02:29
KST 10:29
  • 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
ByuL: The Forgotten Master of ZvT28Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
Weekly Cups (Feb 16-22): MaxPax doubles0Weekly Cups (Feb 9-15): herO doubles up2ACS replaced by "ASL Season Open" - Starts 21/0258LiuLi Cup: 2025 Grand Finals (Feb 10-16)46Weekly Cups (Feb 2-8): Classic, Solar, MaxPax win2
StarCraft 2
General
Terran AddOns placement How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game? Nexon's StarCraft game could be FPS, led by UMS maker ByuL: The Forgotten Master of ZvT Oliveira Would Have Returned If EWC Continued
Tourneys
PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) Sparkling Tuna Cup - Weekly Open Tournament SEL Doubles (SC Evo Bimonthly) WardiTV Team League Season 10 RSL Season 4 announced for March-April
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026] Map Editor closed ?
External Content
The PondCast: SC2 News & Results Mutation # 515 Together Forever Mutation # 514 Ulnar New Year Mutation # 513 Attrition Warfare
Brood War
General
Soma Explains: JD's Unrelenting Aggro vs FlaSh Recent recommended BW games TvZ is the most complete match up BGH Auto Balance -> http://bghmmr.eu/ ACS replaced by "ASL Season Open" - Starts 21/02
Tourneys
BWCL Season 64 Announcement The Casual Games of the Week Thread [Megathread] Daily Proleagues [LIVE] [S:21] ASL Season Open Day 1
Strategy
Soma's 9 hatch build from ASL Game 2 Fighting Spirit mining rates Simple Questions, Simple Answers Zealot bombing is no longer popular?
Other Games
General Games
Battle Aces/David Kim RTS Megathread Diablo 2 thread Nintendo Switch Thread Path of Exile Beyond All Reason
Dota 2
The Story of Wings Gaming 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
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine UK Politics Mega-thread YouTube Thread Mexico's Drug War
Fan Clubs
The IdrA Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece [Req][Books] Good Fantasy/SciFi books Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion TL MMA Pick'em Pool 2013
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Inside the Communication of …
TrAiDoS
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2021 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
Spain18224 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
Spain18224 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
Germany11756 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
Poland4742 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
Spain18224 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
Poland4742 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
Poland4742 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 7h 31m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 186
UpATreeSC 85
StarCraft: Brood War
Sea 5982
GuemChi 1354
Artosis 800
Shuttle 285
Moletrap 10
Dota 2
monkeys_forever432
League of Legends
JimRising 821
goblin14
Counter-Strike
Fnx 1800
taco 656
Super Smash Bros
hungrybox2520
Heroes of the Storm
Khaldor222
Other Games
summit1g11764
C9.Mang0266
Maynarde186
JuggernautJason21
Organizations
Other Games
gamesdonequick1203
Counter-Strike
PGL147
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Hupsaiya 204
• davetesta20
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 24
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21762
League of Legends
• Doublelift4040
Upcoming Events
Replay Cast
7h 31m
Wardi Open
10h 31m
Monday Night Weeklies
15h 31m
Replay Cast
22h 31m
Replay Cast
2 days
Replay Cast
2 days
The PondCast
3 days
KCM Race Survival
3 days
Replay Cast
3 days
Ultimate Battle
4 days
Light vs ZerO
[ Show More ]
Replay Cast
4 days
CranKy Ducklings
5 days
Replay Cast
5 days
Sparkling Tuna Cup
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Acropolis #4 - TS5
PiG Sty Festival 7.0
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Jeongseon Sooper Cup
Spring Cup 2026
WardiTV Winter 2026
Nations Cup 2026
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025

Upcoming

ASL Season 21: Qualifier #1
ASL Season 21: Qualifier #2
ASL Season 21
Acropolis #4 - TS6
Acropolis #4
IPSL Spring 2026
CSLAN 4
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
NationLESS Cup
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
FISSURE Playground #3
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
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.