• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 01:02
CET 07:02
KST 15:02
  • 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
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies3ComeBackTV's documentary on Byun's Career !11Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2
StarCraft 2
General
ComeBackTV's documentary on Byun's Career ! Team TLMC #5: Winners Announced! What's the best tug of war? The Grack before Christmas Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies
Tourneys
OSC Season 13 World Championship $5,000+ WardiTV 2025 Championship $100 Prize Pool - Winter Warp Gate Masters Showdow Sparkling Tuna Cup - Weekly Open Tournament Winter Warp Gate Amateur Showdown #1
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement
Brood War
General
How soO Began His ProGaming Dreams Klaucher discontinued / in-game color settings BGH Auto Balance -> http://bghmmr.eu/ Recommended FPV games (post-KeSPA) BW General Discussion
Tourneys
[BSL21] WB & LB Finals - Sunday 21:00 CET [BSL21] LB SemiFinals - Saturday 21:00 CET Small VOD Thread 2.0 [Megathread] Daily Proleagues
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Current Meta Fighting Spirit mining rates
Other Games
General Games
Mechabellum Nintendo Switch Thread Stormgate/Frost Giant Megathread Beyond All Reason Path of Exile
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 Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
12 Days of Starcraft US Politics Mega-thread The Games Industry And ATVI Russo-Ukrainian War Thread How Does UI/UX Design Influence User Trust?
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced Where to ask questions and add stream?
Blogs
National Diversity: A Challe…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1179 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
Poland17546 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
Poland17546 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
Poland17546 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
Poland17546 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
Poland17546 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
Poland17546 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
Replay Cast
01:00
StarCraft Evolution League #17
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft565
RuFF_SC2 255
Nina 183
StarCraft: Brood War
Rain 7274
Shuttle 406
Leta 131
scan(afreeca) 69
Mong 45
Hm[arnc] 24
Dota 2
monkeys_forever427
NeuroSwarm117
LuMiX1
League of Legends
JimRising 710
C9.Mang0472
Counter-Strike
summit1g7933
minikerr49
Heroes of the Storm
Khaldor150
Other Games
fl0m740
ViBE152
KawaiiRice3
Organizations
Other Games
gamesdonequick879
BasetradeTV51
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• practicex 23
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Diggity5
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1332
• Rush1172
• HappyZerGling109
Other Games
• Scarra1555
Upcoming Events
BSL 21
13h 58m
Sziky vs eOnzErG
Sparkling Tuna Cup
1d 3h
Krystianer vs TBD
TriGGeR vs SKillous
Percival vs TBD
ByuN vs Nicoract
OSC
1d 11h
BSL 21
1d 13h
Cross vs Dewalt
Replay Cast
2 days
Wardi Open
2 days
OSC
3 days
Solar vs MaxPax
ByuN vs Krystianer
Spirit vs TBD
OSC
6 days
Korean StarCraft League
6 days
Liquipedia Results

Completed

Escore Tournament S1 - W1
WardiTV 2025
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL Season 21
CSL Season 19: Qualifier 2
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025

Upcoming

CSL 2025 WINTER (S19)
Escore Tournament S1 - W2
Escore Tournament S1 - W3
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
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 © 2025 TLnet. All Rights Reserved.