• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 14:49
CET 20:49
KST 04: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
Behind the Blue - Team Liquid History Book15Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8herO wins SC2 All-Star Invitational14
Community News
LiuLi Cup: 2025 Grand Finals (Feb 10-16)8Weekly Cups (Feb 2-8): Classic, Solar, MaxPax win2Nexon's StarCraft game could be FPS, led by UMS maker7PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar)12Weekly Cups (Jan 26-Feb 1): herO, Clem, ByuN, Classic win2
StarCraft 2
General
How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game? Behind the Blue - Team Liquid History Book Weekly Cups (Jan 12-18): herO, MaxPax, Solar win Rongyi Cup S3 - Preview & Info Nexon's StarCraft game could be FPS, led by UMS maker
Tourneys
LiuLi Cup: 2025 Grand Finals (Feb 10-16) PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) Sparkling Tuna Cup - Weekly Open Tournament RSL Season 4 announced for March-April WardiTV Mondays
Strategy
Custom Maps
Map Editor closed ? [A] Starcraft Sound Mod
External Content
The PondCast: SC2 News & Results Mutation # 512 Overclocked Mutation # 511 Temple of Rebirth Mutation # 510 Safety Violation
Brood War
General
Gypsy to Korea Liquipedia.net NEEDS editors for Brood War ACS replaced by "ASL Season Open" - Starts 21/02 Recent recommended BW games [ASL21] Potential Map Candidates
Tourneys
Small VOD Thread 2.0 Escore Tournament StarCraft Season 1 [Megathread] Daily Proleagues KCM Race Survival 2026 Season 1
Strategy
Fighting Spirit mining rates Zealot bombing is no longer popular? Simple Questions, Simple Answers Current Meta
Other Games
General Games
Diablo 2 thread Nintendo Switch Thread Battle Aces/David Kim RTS Megathread ZeroSpace Megathread EVE Corporation
Dota 2
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
Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread Ask and answer stupid questions here! Russo-Ukrainian War Thread Sex and weight loss Canadian Politics Mega-thread
Fan Clubs
The herO Fan Club! The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
ADHD And Gaming Addiction…
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1482 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
Poland17660 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
Poland17660 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
Poland17660 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
Poland17660 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
Poland17660 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
Poland17660 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 4h 11m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 711
IndyStarCraft 201
SteadfastSC 154
UpATreeSC 133
BRAT_OK 89
ForJumy 27
StarCraft: Brood War
Shuttle 904
Larva 471
Light 202
Mini 151
nyoken 112
Sharp 105
firebathero 70
Movie 44
Mong 42
Hm[arnc] 31
[ Show more ]
NaDa 9
Dota 2
Gorgc5466
NeuroSwarm102
League of Legends
C9.Mang067
Counter-Strike
pashabiceps2381
fl0m1922
Heroes of the Storm
Liquid`Hasu324
Khaldor153
Other Games
Grubby3591
Sick322
ToD148
ArmadaUGS123
Trikslyr67
Mew2King58
KnowMe25
MindelVK19
Organizations
Other Games
BasetradeTV19
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Shameless 25
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• 80smullet 23
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV418
League of Legends
• imaqtpie2219
• TFBlade1595
• Shiphtur372
Upcoming Events
Replay Cast
4h 11m
Escore
14h 11m
LiuLi Cup
15h 11m
Serral vs Zoun
Cure vs Classic
Big Brain Bouts
21h 11m
ByuN vs GgMaChine
Serral vs Jumy
RSL Revival
1d 7h
RSL Revival
1d 12h
LiuLi Cup
1d 15h
uThermal 2v2 Circuit
1d 16h
RSL Revival
1d 22h
Replay Cast
2 days
[ Show More ]
Sparkling Tuna Cup
2 days
LiuLi Cup
2 days
Replay Cast
3 days
Replay Cast
3 days
LiuLi Cup
3 days
Wardi Open
3 days
Monday Night Weeklies
3 days
OSC
4 days
WardiTV Winter Champion…
4 days
Replay Cast
5 days
WardiTV Winter Champion…
5 days
Replay Cast
6 days
The PondCast
6 days
KCM Race Survival
6 days
WardiTV Winter Champion…
6 days
Liquipedia Results

Completed

Proleague 2026-02-10
Rongyi Cup S3
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
LiuLi Cup: 2025 Grand Finals
Nations Cup 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8

Upcoming

Escore Tournament S1: W8
[S:21] ASL SEASON OPEN 1st Round
[S:21] ASL SEASON OPEN 1st Round Qualifier
[S:21] ASL SEASON OPEN 2nd Round
[S:21] ASL SEASON OPEN 2nd Round Qualifier
Acropolis #4
IPSL Spring 2026
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
WardiTV Winter 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 Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 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.