• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:14
CET 01:14
KST 09:14
  • 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] Finals Preview: Sweet Victory!12[ASL22] Ro4 Preview: Mirror Mirror6[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5
Community News
Weekly Cups (Oct 26 - Nov 1): MaxPax, herO, Solar win0Weekly Cups (October 19-25): Clem triples first in 5.0.175Evil Geniuses - shutting down23ISSL (IntoTheTV x SOOP SC2 League): Premier7Weekly Cups (October 12-18): 5.0.17 era begins1
StarCraft 2
General
[D] Hacker peak in sc2 ? No more SC2 streamers on team liquid? Liquibets sc2 season 30 Evil Geniuses - shutting down Weekly Cups (Oct 26 - Nov 1): MaxPax, herO, Solar win
Tourneys
SC4ALL: II Venue Change Announcement! Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays ISSL (IntoTheTV x SOOP SC2 League): Premier Stellar Fest TWO the Moon (Dec 16-20)
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[G] How to playtest arcade maps Starcraft 2 Advance [D] the control group Simple Questions/Answers
External Content
Mutation # 550 Graveyard Shift The PondCast: SC2 News & Results Mutation # 549 Endless Sparkles Mutation # 548 Shining Bright
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Rollback Netcode in Brood War SC4ALL: II Venue Change Announcement! Ziemie's Starcraft 1 Prequel Campaign 🇺🇦 Ukrainian StarCraft:BroodWar community reborn
Tourneys
[$1250] International ShieldBattery League [Megathread] Daily Proleagues Small VOD Thread 2.0 KCM Race Survival 2026 Season 4
Strategy
50,000-Word Terran Builds Memo 2026-10-22 Cliff Jump Revisited (1 in a 1000 strategy) Simple Questions, Simple Answers
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Deus Ex 3!? Mobile Legends: Bang Bang Armies of Exigo - YesYes?
Dota 2
Dota 2 Champions League Season 3 Begins April 25!
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Dating: How's your luck? Trading/Investing Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
Fan Club Resource Thread Reynor Fan Club The Flash Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece
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
Recent Gifted Posts
Blogs
Why I built Repalyzer (1.1.…
BlueStar
Innovate or Game Over?
TrAiDoS
ShieldBattery on Mac
Kraekkling
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
Can Bots Beat Pros?? Starcr…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 9575 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
Spain18488 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
Spain18488 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
Germany12076 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
Poland4769 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
Spain18488 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
Poland4769 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
Poland4769 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
PSISTORM Gaming Misc
09:00
FSL season 12 opener: HM vs ST
Freeedom13
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SpeCial 25
StarCraft: Brood War
Britney 7748
Dota 2
PGG 215
League of Legends
Doublelift4592
JimRising 703
Counter-Strike
jkaem74
Other Games
summit1g9002
gofns8726
Grubby2221
shahzam444
PiGStarcraft308
C9.Mang0259
Day[9].tv237
syndereN189
XaKoH 97
Maynarde68
Fuzer 64
NeuroSwarm53
ViBE41
Railgan20
KnowMe19
PPMD19
JuggernautJason3
Organizations
Other Games
gamesdonequick318
BasetradeTV176
Counter-Strike
PGL89
[ Show 18 non-featured ]
StarCraft 2
• Hupsaiya 63
• RyuSc2 37
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Laughngamez YouTube
• Migwel
StarCraft: Brood War
• HerbMon 34
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis3286
• Jankos3195
• Scarra895
Other Games
• imaqtpie624
• Day9tv237
• Shiphtur173
Upcoming Events
IntoTheTV X SOOP
10h 46m
Reynor vs Solar
ByuN vs SHIN
Clem vs MaxPax
herO vs Rogue
IPSL
16h 46m
WorsT vs nOmaD
Dewalt vs andersOn
AI Arena Tournament
18h 46m
IntoTheTV X SOOP
1d 10h
IPSL
1d 16h
Azhi_Dahaki vs ggnore13
Double vs WIZARD
Replay Cast
1d 22h
Replay Cast
2 days
Sparkling Tuna Cup
3 days
WardiTV Invitational
3 days
YoungYakov vs Lambo
SHIN vs TBD
Percival vs Shameless
Solar vs TBD
PiGosaur Cup
4 days
[ Show More ]
The PondCast
5 days
KCM Race Survival
5 days
WardiTV Invitational
5 days
Liquipedia Results

Completed

Proleague 2026-11-05
Blizzard Classic Cup 2026
HCC Season 3

Ongoing

Acropolis #5
KCM Race Survival 2026 Season 4
International ShieldBattery League
BSL Season 23
IPSL Winter 2026-27
Calamity Cup Div. A Season 8
IEM Beijing 2026
PGL Masters Bucharest 2026
Stake Ranked Episode 5
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
FISSURE Playground #3
BLAST Open Fall 2026

Upcoming

Sector 951
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Underdog Cup 2026 Div 2-3
PGL Bucharest 2027
BLAST Bounty Winter 2027
eXTREMESLAND 2026
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals 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...

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.