• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 21:49
CEST 03:49
KST 10:49
  • 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 HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
Weekly Cups (July 27-Aug 2): SHIN's big week0SC4ALL II: Brood War - $2500 - Dec 5-66SC4ALL II announced - $10,000 prize pool, Dec 5-64PIG STY FESTIVAL 8.0! (13 - 23 August)11Neeb returns to progaming; rejoins ONSYDE15
StarCraft 2
General
SC4ALL II: StarCraft 2 Player Announcement 2/8 Balance hotfix patch 5.0.16b (July 16) August World Ranking: Clem climbs to #2 Daily SC2 Player Grid - feedback wanted Weekly Cups (July 27-Aug 2): SHIN's big week
Tourneys
SC4ALL II announced - $10,000 prize pool, Dec 5-6 Sparkling Tuna Cup - Weekly Open Tournament PIG STY FESTIVAL 8.0! (13 - 23 August) RSL Revival: Season 6 - Qualifiers and Main Event INu's Battles #19 2-Days Event
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
The PondCast: SC2 News & Results Mutation # 537 Hostile Territory Mutation # 536 Railroad Switch Mutation # 535 Assembly of Vengeance
Brood War
General
[Personal Project Share] Terran Defense v0.60 BW Drama: Terror's Debt Incident + C9 disbanding BW General Discussion Recent recommended BW games ASL22 General Discussion
Tourneys
[Megathread] Daily Proleagues 2v2v2v2 Tournament SC4ALL II: Brood War - $2500 - Dec 5-6 Escore Tournament - Season 3
Strategy
Any training maps people recommend? Fighting Spirit mining rates Simple Questions, Simple Answers Odyssey Mineral Stack Saturation
Other Games
General Games
General RTS Discussion Thread ZeroSpace Early Access is Now Live! Nintendo Switch Thread Stormgate/Frost Giant Megathread Beyond All Reason
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank TL Mafia Community Thread NeO.D_StephenKing vs This Guy From 1 Million Dance
Community
General
European Politico-economics QA Mega-thread Russo-Ukrainian War Thread US Politics Mega-thread Artificial Intelligence Thread Things Aren’t Peaceful in Palestine
Fan Clubs
The Clem Fan Club INnoVation Fan Club The Scarlett Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! Series you have seen recently... [Req][Books] Good Fantasy/SciFi books
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion MLB/Baseball 2023 McBoner: A hockey love story
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Simple Questions Simple Answers FPS when play League Of Legend on laptop
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Please support my new stand…
Peanutsc
What is a Gamer?
TrAiDoS
Hello guys!
LIN1s
ASL S22 English Commentary…
namkraft
Poker (part 2)
Nebuchad
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2943 users

The Big Programming Thread - Page 931

Forum Index > General Forum
Post a Reply
Prev 1 929 930 931 932 933 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.
Manit0u
Profile Blog Joined August 2004
Poland17820 Posts
Last Edited: 2017-12-16 10:51:26
December 16 2017 10:49 GMT
#18601
On December 16 2017 03:15 phar wrote:
sequential write speed of your SSD (what, 500MB/s or higher now?)


NVMe SSDs do > 2GB write and > 3.5GB read. Times, they are a changing

http://www.samsung.com/semiconductor/minisite/ssd/product/consumer/ssd960.html
Time is precious. Waste it wisely.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
December 16 2017 19:38 GMT
#18602
What IDE would y'all recommend for working with SpringBoot? I've been using Spring Tool Suite but it has been very annoying and doesn't seem that great. It seems like Intellij IDEA only works for Spring if you get the paid edition. Are there any other good choices that I've missed?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Manit0u
Profile Blog Joined August 2004
Poland17820 Posts
December 16 2017 20:01 GMT
#18603
Intellij is the best. Other than that you're left with free options, none of which are really that good.
Time is precious. Waste it wisely.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
December 16 2017 22:37 GMT
#18604
Fuck. That's what I was thinking but I'm not willing to drop money on it when I'm just doing this to see if I like Spring Boot.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Manit0u
Profile Blog Joined August 2004
Poland17820 Posts
Last Edited: 2017-12-16 23:00:03
December 16 2017 22:58 GMT
#18605
On December 17 2017 07:37 WarSame wrote:
Fuck. That's what I was thinking but I'm not willing to drop money on it when I'm just doing this to see if I like Spring Boot.


Well, you can always just go with free evaluation for 30 days. After this runs out you can still use the IDE (it will just auto-close itself every so often - 30-45 minutes if I remember correctly) without a problem. You can also get your free evaluation and during that time sign up for the EAP, which will allow you to use this software for free until next stable release (should be about 3-4 months or so judging by their usual release cycles). My friend used to ride PHPStorm early access program for over 6 months without paying a dime.

Plenty of time to try stuff out
Time is precious. Waste it wisely.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-12-17 16:30:54
December 17 2017 16:26 GMT
#18606
Which of these setups sound faster to you guys?


Scenario: I have many large integer values, and tied to each one of those are several other key small values. Let's call these values V, A, B, C, and D.

I want to do arithmetic between the V values, but only if I can match their respective A values, or match their respective B values, or match one's A to the other's B(but not both), AND if the V values have certain things in common. After doing arithmetic, I will need to alter the values V, A, B, C, D, and get rid of duplicate Vs, keeping only the unique V entry with the highest C value. (im sorry if this is hard to follow).

Which sounds like a more efficient setup:


1.) A list of (V,A,B,C,D), and a hashmap with keys [A] and keys [B], where the keys point to indices of the list that have that A or B in their tuple. I will iterate the list, and for each tuple I will look up the indices that keys A and B point to, and make comparisons between those tuples and this tuple.

If they meet the criteria, I will perform arithmetic and put the new (V,A,B,C,D) into a NEW list. And create a NEW hashmap with keys A and B, these will be updated from all the arithmetic in this information. As I create the new list, I will look for duplicate V values by sorting the list as I go (inserting each V into an appropriate index so as to keep it sorted).


vs


2.) A hashmap of keys [V], where each key V points to a tuple (A,B,C,D). I then also have a hashmap of [A] and [B] keys, that each point to a list of Vs that have that A or B in their tuple. I will then iterate my hashmap of keys V, looking at each tuple. For each tuple, I will look up A and B in my hashmap. For each lookup, I will get a list of Vs. For each of those Vs, I will look up their tuple (A,B,C,D). I will then make comparisons.

If the criteria has been met, I will do arithmetic on the Vs and form an updated tuple (A,B,C,D), put the new V into a NEW hashmap as a key, and the new tuple as it's entry. Create another new hashmap, and the keys A and B in that tuple will point to a new list, with V as an entry in it. HOWEVER, when this process starts, if V was already a key in the new hashmap(signalling a duplicate), then I look up it's tuple and make comparisons. Then I can either replace the old one with the new, or simply not add the new one.



vs -

some other method entirely?


space and time are both a concern., but probably moreso time
thanks!
Manit0u
Profile Blog Joined August 2004
Poland17820 Posts
Last Edited: 2017-12-18 08:42:21
December 18 2017 08:23 GMT
#18607
On December 15 2017 02:57 Acrofales wrote:
I'm assuming the first two steps are performed simultaneously. If not (you first do the even numbers and after that the odd numbers, then modify accordingly. And if the operations are done inplace, that's another different solution. Can all still be done in the same loop, though:


+ Show Spoiler +


def dumbstuff():
values = list()
values.append(2)
values.append(1000000 + 2*999999)
foreach i in range(1, 1000000):
if i%2 == 0:
values.append(5*i)
else:
if floor(i/3)%2 == 0:
values.append(i/3)
avg = mean(values)
return sorted(filter(lambda v: abs(v - avg) > 1, values), reverse=True)


I hope I wasn't dumb there.

E: added code tags


1. After adding 2 values for the min and max ids your range should be 1..999999
2. You forgot to floor i/3 when appending

Tried your solution in ruby


ids = [2, (1_000_000 + 2 * 999_999)] + (1..999_999).inject([]) { |agg, x|
y = x.even? ? x * 5 : (x / 3).round
agg << y if y.even?
agg
}

avg = ids.reduce(:+) / ids.count

puts ids.select { |x| (x - avg).abs > 1 }.sort.reverse.count


Oddly enough the resulting array has 1 extra id compared to my previous solution. I'll have to dig deeper into it
Time is precious. Waste it wisely.
sc-darkness
Profile Joined August 2017
856 Posts
Last Edited: 2017-12-19 22:45:48
December 19 2017 22:45 GMT
#18608
I've recently studied common sorting algorithms. I've not bothered to learn how to reproduce them, but I'm wondering if just having an idea how they work is enough. Also, Big O notation as well. Are you guys the same?
phar
Profile Joined August 2011
United States1080 Posts
December 19 2017 22:50 GMT
#18609
You should at least code up solutions for the main sorting algorithms yourself once, just to prove you can.

Who knows, you might end up interviewing at a place which asks it as a (crappy) interview question.
Who after all is today speaking about the destruction of the Armenians?
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-12-20 22:51:21
December 20 2017 22:40 GMT
#18610
edit: nevermind. found the bug. thats annoying. somehow a pair of ints had squirmed their way into what was supposed to be a list of arrays
graNite
Profile Blog Joined December 2010
Germany4434 Posts
Last Edited: 2017-12-21 01:09:57
December 21 2017 00:08 GMT
#18611
Im building a chess programm in python that i want to be able to also solve chess puzzles like this: + Show Spoiler +
Place two Knights, two Rooks, two Bishops and two Kings on a 4x4 chessboard, so that:

1) The Kings are not attacked at all.

2) All other pieces are attacked exactly once.

Ignore color, so every piece attacks every other piece whose square it can move to, including the Kings.

currently, my board looks like this:

 8  [r] [n] [b] [q] [k] [b] [n] [r] 
7 [p] [p] [p] [p] [p] [p] [p] [p]
6 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
5 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
4 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
3 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
2 [P] [P] [P] [P] [P] [P] [P] [P]
1 [R] [N] [B] [Q] [K] [B] [N] [R]
# A B C D E F G H


I just print it to the output, but I dont like it really much. You cant tell what a black or white square is and using caps and lower case letters is also not that great. Do you guys maybe have a better idea of how to visualize the board in a better way without using third party libraries?

I tried the chess unicode characters and colorization in the console, but that doesnt work on windows.
"Oink oink, bitches" - Tasteless on Pigbaby winning a map against Flash
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
December 21 2017 04:52 GMT
#18612
I think Turtle is built into Python, not a third party libraries. Just import turtle.

https://docs.python.org/2/library/turtle.html
There is no one like you in the universe.
Manit0u
Profile Blog Joined August 2004
Poland17820 Posts
December 21 2017 16:22 GMT
#18613
https://www.pakyow.org/

Wow. I'll be definitely checking this thing out. It's a web framework that lets you do dynamic pages (angular-like) all in the back-end. Some of their solutions are pretty neat. Won't work for older browsers though, since it's all based on web sockets (I wonder how's performance with many dynamic properties in a view). The idea is really neat, I think it could be much better if Ruby were concurrent though.

Another thing I have to test is the phoenix framework since I already have to learn Elixir for work.
Time is precious. Waste it wisely.
Neshapotamus
Profile Blog Joined May 2006
United States163 Posts
December 21 2017 17:37 GMT
#18614
On December 21 2017 09:08 graNite wrote:
Im building a chess programm in python that i want to be able to also solve chess puzzles like this: + Show Spoiler +
Place two Knights, two Rooks, two Bishops and two Kings on a 4x4 chessboard, so that:

1) The Kings are not attacked at all.

2) All other pieces are attacked exactly once.

Ignore color, so every piece attacks every other piece whose square it can move to, including the Kings.

currently, my board looks like this:

 8  [r] [n] [b] [q] [k] [b] [n] [r] 
7 [p] [p] [p] [p] [p] [p] [p] [p]
6 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
5 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
4 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
3 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
2 [P] [P] [P] [P] [P] [P] [P] [P]
1 [R] [N] [B] [Q] [K] [B] [N] [R]
# A B C D E F G H


I just print it to the output, but I dont like it really much. You cant tell what a black or white square is and using caps and lower case letters is also not that great. Do you guys maybe have a better idea of how to visualize the board in a better way without using third party libraries?

I tried the chess unicode characters and colorization in the console, but that doesnt work on windows.


Do you need to visualize in the console?

Easiest thing is to make HTML and view in the browser. Write some css and html and you will get everything you want.

8x8 table with height and width. CSS Style for black and white squares and borders.
Each piece would be an entry in the table. Style this with an img or a glyhicon.

If you want to go overboard. You might want to include a javascript file.

Write your output as json. Something along the lines of the position and piece and player.


[
{
row: 1,
col: 1,
player: White,
piece: Knight
},
{
row: 2,
col: 2,
player: White,
piece: King
}
...
]


Write some javascript to ingest the file.
Use that to dynamically update your board (HTML + CSS)

And if you really want to go overboard. You can make your game output the chess algebraic notation.
https://en.wikipedia.org/wiki/Algebraic_notation_(chess)

And you would write a parser.


graNite
Profile Blog Joined December 2010
Germany4434 Posts
December 21 2017 18:45 GMT
#18615
thats a good idea, although that would much more wore than i was planning to do :D

i wanted to use the console because that is the thing i have the easiest access to. i dont want to use external libraries because i want to do it "on my own"
"Oink oink, bitches" - Tasteless on Pigbaby winning a map against Flash
TMG26
Profile Joined July 2012
Portugal2017 Posts
December 21 2017 21:37 GMT
#18616
On December 22 2017 01:22 Manit0u wrote:
https://www.pakyow.org/

Wow. I'll be definitely checking this thing out. It's a web framework that lets you do dynamic pages (angular-like) all in the back-end. Some of their solutions are pretty neat. Won't work for older browsers though, since it's all based on web sockets (I wonder how's performance with many dynamic properties in a view). The idea is really neat, I think it could be much better if Ruby were concurrent though.

Another thing I have to test is the phoenix framework since I already have to learn Elixir for work.

Any reason for choosing elixir instead of erlang?
Supporter of the situational Blink Dagger on Storm.
Manit0u
Profile Blog Joined August 2004
Poland17820 Posts
Last Edited: 2017-12-22 12:21:42
December 22 2017 12:19 GMT
#18617
On December 22 2017 06:37 TMG26 wrote:
Show nested quote +
On December 22 2017 01:22 Manit0u wrote:
https://www.pakyow.org/

Wow. I'll be definitely checking this thing out. It's a web framework that lets you do dynamic pages (angular-like) all in the back-end. Some of their solutions are pretty neat. Won't work for older browsers though, since it's all based on web sockets (I wonder how's performance with many dynamic properties in a view). The idea is really neat, I think it could be much better if Ruby were concurrent though.

Another thing I have to test is the phoenix framework since I already have to learn Elixir for work.

Any reason for choosing elixir instead of erlang?


Rails is our primary technology stack. It'll be easier for people to move to Elixir than Erlang. We might move down the stack later but I hardly see a reason since Ruby has like the best syntax ever and it utilizes the Erlang VM anyway so it's more about how you write your code because it's compiled to Erlang code anyway.

Time is precious. Waste it wisely.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-12-22 15:25:46
December 22 2017 15:24 GMT
#18618
On December 21 2017 09:08 graNite wrote:
Im building a chess programm in python that i want to be able to also solve chess puzzles like this: + Show Spoiler +
Place two Knights, two Rooks, two Bishops and two Kings on a 4x4 chessboard, so that:

1) The Kings are not attacked at all.

2) All other pieces are attacked exactly once.

Ignore color, so every piece attacks every other piece whose square it can move to, including the Kings.

currently, my board looks like this:

 8  [r] [n] [b] [q] [k] [b] [n] [r] 
7 [p] [p] [p] [p] [p] [p] [p] [p]
6 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
5 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
4 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
3 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
2 [P] [P] [P] [P] [P] [P] [P] [P]
1 [R] [N] [B] [Q] [K] [B] [N] [R]
# A B C D E F G H


I just print it to the output, but I dont like it really much. You cant tell what a black or white square is and using caps and lower case letters is also not that great. Do you guys maybe have a better idea of how to visualize the board in a better way without using third party libraries?

I tried the chess unicode characters and colorization in the console, but that doesnt work on windows.


use jupyter notebook. it's pretty straightforward and easy. You can now use html and view through your browser.


and then, if you want even more:

https://pypi.python.org/pypi/python-chess

(you don't need to use all his code of course, since you want to do it yourself. you could just steal his board and pieces)
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
December 24 2017 17:11 GMT
#18619
I've been working on Spring Boot. I've got OAuth2 working but my client secret is in my application.properties file. This will get added to github when I push. I could just .gitignore my application.properties file but there are other important values in there. How do I separate out my client secret/id from application.properties?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
berated-
Profile Blog Joined February 2007
United States1134 Posts
Last Edited: 2017-12-24 17:24:28
December 24 2017 17:23 GMT
#18620
On December 25 2017 02:11 WarSame wrote:
I've been working on Spring Boot. I've got OAuth2 working but my client secret is in my application.properties file. This will get added to github when I push. I could just .gitignore my application.properties file but there are other important values in there. How do I separate out my client secret/id from application.properties?


Spring properties can be configured to read from multiple files. By default it also reads from system properties and environment variables. There are a lot of options for you, just have to figure out what works for you and what your deployment looks like.

One example of reading from multiple files

Spring boot guide
Prev 1 929 930 931 932 933 1032 Next
Please log in or register to reply.
Live Events Refresh
PiGosaur Cup
00:00
#93
PiGStarcraft538
CranKy Ducklings85
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft550
RuFF_SC2 39
Temp0 27
StarCraft: Brood War
Rain 4112
GuemChi 2713
Calm 797
Artosis 633
Terrorterran 1
Dota 2
LuMiX2
League of Legends
Doublelift5088
Counter-Strike
summit1g13050
Fnx 728
minikerr288
Other Games
Day[9].tv749
C9.Mang0446
JimRising 435
Maynarde152
JuggernautJason112
ViBE72
CosmosSc2 13
Organizations
Other Games
gamesdonequick1318
StarCraft: Brood War
UltimateBattle 28
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 17 non-featured ]
StarCraft 2
• davetesta43
• EnkiAlexander 20
• Mapu19
• CranKy Ducklings SOOP7
• LaughNgamezSOOP
• sooper7s
• Migwel
• IndyKCrew
• Kozan
• intothetv
• AfreecaTV YouTube
StarCraft: Brood War
• RayReign 14
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21354
Other Games
• Day9tv749
Upcoming Events
Replay Cast
7h 11m
Kung Fu Cup
9h 11m
Replay Cast
22h 11m
The PondCast
1d 8h
INu's Battles
1d 9h
Percival vs Cure
Classic vs Clem
Replay Cast
1d 22h
Escore
2 days
IntoTheTV X SOOP
2 days
RSL Revival
3 days
herO vs SHIN
Clem vs Solar
Serral vs Rogue
RSL Revival
4 days
[ Show More ]
WardiTV Weekly
5 days
The Patches Monday
5 days
Sparkling Tuna Cup
6 days
PiG Sty Festival
6 days
PiGosaur Cup
6 days
Liquipedia Results

Completed

Proleague 2026-08-03
CranK Gathers Season 4: BW vs SC2 Team League
Eternal Conflict S2 Finale

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
Acropolis #5
RSL Revival: Season 6
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026

Upcoming

Escore Tournament S3: W6
Escore Tournament S3: W7
CSLAN 4
ASL Season 22
Escore Tournament S3: W8
Acropolis #5 - TRS
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
PiG Sty Festival 8.0
Big Dog Cup 2026 Div 1
Thunderpick World Champ.
ESL Pro League Season 24
Stake Ranked Episode 4
Logitech G Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 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.