• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 16:31
CET 22:31
KST 06:31
  • 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
No more SC2 streamers on team liquid? [D] Hacker peak in sc2 ? 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
[Megathread] Daily Proleagues Small VOD Thread 2.0 [$1250] International ShieldBattery League 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: 12353 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
Poland17871 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
Poland17871 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
Poland17871 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
Poland17871 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
Poland17871 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
Poland17871 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
Next event in 13h 29m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nathanias 71
Nina 52
Vindicta 24
EmSc Tv 18
StarCraft: Brood War
Britney 11934
Shuttle 429
Shinee 44
Dota 2
PGG 176
League of Legends
Doublelift2192
Counter-Strike
apEX2915
zeus393
Heroes of the Storm
Liquid`Hasu604
Other Games
tarik_tv6014
summit1g3246
Grubby2192
FrodaN1040
shahzam393
PiGStarcraft299
C9.Mang0212
Fuzer 201
syndereN164
XaKoH 130
NeuroSwarm56
KnowMe43
ZombieGrub36
ViBE30
Railgan26
JuggernautJason20
Organizations
Other Games
BasetradeTV190
Counter-Strike
PGL119
StarCraft 2
EmSc Tv 18
EmSc2Tv 18
[ Show 18 non-featured ]
StarCraft 2
• Adnapsc2 12
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Laughngamez YouTube
• Migwel
StarCraft: Brood War
• Azhi_Dahaki38
• Michael_bg 5
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV727
League of Legends
• Nemesis2504
• Jankos2211
• Scarra123
Other Games
• imaqtpie820
• Shiphtur412
Upcoming Events
IntoTheTV X SOOP
13h 29m
Reynor vs Solar
ByuN vs SHIN
Clem vs MaxPax
herO vs Rogue
IPSL
19h 29m
WorsT vs nOmaD
Dewalt vs andersOn
AI Arena Tournament
21h 29m
IntoTheTV X SOOP
1d 13h
IPSL
1d 19h
Azhi_Dahaki vs ggnore13
Double vs WIZARD
Replay Cast
2 days
Replay Cast
3 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.