• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 16:21
CEST 22:21
KST 05:21
  • 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
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL49Weekly Cups (June 23-29): Reynor in world title form?12FEL Cracov 2025 (July 27) - $8000 live event16Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
The SCII GOAT: A statistical Evaluation Statistics for vetoed/disliked maps Esports World Cup 2025 - Final Player Roster How does the number of casters affect your enjoyment of esports? Weekly Cups (June 23-29): Reynor in world title form?
Tourneys
RSL: Revival, a new crowdfunded tournament series [GSL 2025] Code S: Season 2 - Semi Finals & Finals $5,100+ SEL Season 2 Championship (SC: Evo) FEL Cracov 2025 (July 27) - $8000 live event HomeStory Cup 27 (June 27-29)
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Flash Announces Hiatus From ASL [ASL19] Finals Recap: Standing Tall BGH Auto Balance -> http://bghmmr.eu/ Player “Jedi” cheat on CSL Help: rep cant save
Tourneys
Small VOD Thread 2.0 [Megathread] Daily Proleagues [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET The Casual Games of the Week Thread
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile What do you want from future RTS games? Beyond All Reason
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Trading/Investing Thread The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread NBA General Discussion Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 663 users

The Big Programming Thread - Page 931

Forum Index > General Forum
Post a Reply
Prev 1 929 930 931 932 933 1031 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
Poland17243 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
Poland17243 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
Poland17243 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
Poland17243 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
Poland17243 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
Poland17243 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 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 3h 39m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
JuggernautJason94
StarCraft: Brood War
Britney 14084
Dewaltoss 192
Aegong 46
GoRush 12
yabsab 6
IntoTheRainbow 6
Dota 2
Gorgc7367
League of Legends
Dendi1298
JimRising 443
Counter-Strike
fl0m1900
flusha398
Foxcn398
sgares196
Super Smash Bros
Mew2King154
Heroes of the Storm
Liquid`Hasu613
Other Games
summit1g6033
FrodaN2371
tarik_tv1655
RotterdaM161
Pyrionflax116
ViBE93
Sick67
Trikslyr63
PPMD13
Liquid`Ken11
Organizations
Other Games
BasetradeTV36
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• musti20045 2
• intothetv
• IndyKCrew
• sooper7s
• AfreecaTV YouTube
• Migwel
• LaughNgamezSOOP
• Kozan
StarCraft: Brood War
• blackmanpl 38
• 80smullet 29
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Doublelift2827
• Jankos2268
• masondota2495
Other Games
• imaqtpie847
• Shiphtur189
Upcoming Events
Replay Cast
3h 39m
RSL Revival
13h 39m
herO vs SHIN
Reynor vs Cure
OSC
16h 39m
WardiTV European League
19h 39m
Scarlett vs Percival
Jumy vs ArT
YoungYakov vs Shameless
uThermal vs Fjant
Nicoract vs goblin
Harstem vs Gerald
FEL
19h 39m
Korean StarCraft League
1d 6h
CranKy Ducklings
1d 13h
RSL Revival
1d 13h
FEL
1d 19h
Sparkling Tuna Cup
2 days
[ Show More ]
RSL Revival
2 days
FEL
2 days
BSL: ProLeague
2 days
Dewalt vs Bonyth
Replay Cast
4 days
Replay Cast
4 days
The PondCast
5 days
Replay Cast
6 days
RSL Revival
6 days
Liquipedia Results

Completed

Proleague 2025-06-28
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025
YaLLa Compass Qatar 2025

Upcoming

CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
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.