• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:22
CET 01:22
KST 09:22
  • 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
SC2 All-Star Invitational: Tournament Preview5RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2
Community News
BSL Season 2025 - Full Overview and Conclusion6Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets4$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)16Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns7[BSL21] Non-Korean Championship - Starts Jan 105
StarCraft 2
General
Stellar Fest "01" Jersey Charity Auction SC2 All-Star Invitational: Tournament Preview Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets When will we find out if there are more tournament SC2 Spotted on the EWC 2026 list?
Tourneys
SC2 All-Star Invitational: Jan 17-18 Sparkling Tuna Cup - Weekly Open Tournament SC2 AI Tournament 2026 $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) OSC Season 13 World Championship
Strategy
Simple Questions Simple Answers
Custom Maps
Map Editor closed ?
External Content
Mutation # 509 Doomsday Report Mutation # 508 Violent Night Mutation # 507 Well Trained Mutation # 506 Warp Zone
Brood War
General
Video Footage from 2005: The Birth of G2 in Spain [ASL21] Potential Map Candidates BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ BSL Season 2025 - Full Overview and Conclusion
Tourneys
[Megathread] Daily Proleagues [BSL21] Non-Korean Championship - Starts Jan 10 Small VOD Thread 2.0 Azhi's Colosseum - Season 2
Strategy
Soma's 9 hatch build from ASL Game 2 Simple Questions, Simple Answers Game Theory for Starcraft Current Meta
Other Games
General Games
Stormgate/Frost Giant Megathread Beyond All Reason Awesome Games Done Quick 2026! Nintendo Switch Thread Mechabellum
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
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Canadian Politics Mega-thread European Politico-economics QA Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
My 2025 Magic: The Gathering…
DARKING
Physical Exercise (HIIT) Bef…
TrAiDoS
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1417 users

The Big Programming Thread - Page 1012

Forum Index > General Forum
Post a Reply
Prev 1 1010 1011 1012 1013 1014 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.
kalitoma40
Profile Joined November 2019
Italy1 Post
Last Edited: 2019-11-05 21:20:58
November 05 2019 21:20 GMT
#20221
Bot edit.

User was banned for this post.
roma
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
Last Edited: 2019-11-07 17:36:17
November 07 2019 17:35 GMT
#20222
When designing an API where you have child objects, how do you send your responses?

Say I have a Debate, which has children Arguments.

  1. I could pass back all Arguments in a list back with my Debate, but I could have a large number of Arguments.
  2. I could pass back Argument IDs, then query each Argument separately.
  3. I could pass nothing, then query for all arguments of my particular Debate


What is your preferred method?

Currently I'm trying 3, and using an endpoint like /api/d/<debate_id>/a/ to query it. Is there a potentially better URI format to use?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
tofucake
Profile Blog Joined October 2009
Hyrule19189 Posts
November 07 2019 18:58 GMT
#20223
generally you want to be as verbose as possible, you don't want people to have to guess at what an endpoint is for, so
/api/debate/<debate_id>/argument/<argument_id>/<action>


What I'd do in this particular situation would be something like
GET /api/argument
Headers: debate_id, date, time, for, against, etc, where each is a different property that an Argument can have
Return: a filtered list with all arguments that match all filters, where passing no filters returns all arguments, and having debate_id be required

GET /api/argument/<argument_id>
Headers: debate_id, date, time, for, against, etc, where each is a different property that an Argument can have
Return: a filtered list with all arguments that match all filters, where passing no filters returns all arguments, and having debate_id be required, as well as having the specified argument_id

Liquipediaasante sana squash banana
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
November 08 2019 00:56 GMT
#20224
I think if you include the action you move from REST more towards RPC. Ideally I'd keep this all RESTful.

By headers are you referring to query params? I could do that but I'm not sure why I should prefer that vs. a fully qualified URI.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
tofucake
Profile Blog Joined October 2009
Hyrule19189 Posts
November 08 2019 02:17 GMT
#20225
Headers are just cleaner, imo. You can do request params instead, if you'd prefer, I was just saying how I'd do it. Detaching the argument from the debate allows you to do stuff like "give me all arguments made by person X" instead of having to loop over all debates with person X, then getting all the arguments with person X.
Liquipediaasante sana squash banana
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
November 08 2019 04:07 GMT
#20226
Hmmmm, I see what you're getting at. Thanks! I'll consider that too. There's a lot to consider when building an API!
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Silvanel
Profile Blog Joined March 2003
Poland4740 Posts
November 11 2019 11:03 GMT
#20227
What security concerns should i take into account before rolling out my webpage for limited use for my close friends on a private server?
Pathetic Greta hater.
Manit0u
Profile Blog Joined August 2004
Poland17610 Posts
November 12 2019 14:38 GMT
#20228
On November 11 2019 20:03 Silvanel wrote:
What security concerns should i take into account before rolling out my webpage for limited use for my close friends on a private server?


Standard XSS, SQL injection etc. For sure you want to encrypt passwords if you store them.
Time is precious. Waste it wisely.
Manit0u
Profile Blog Joined August 2004
Poland17610 Posts
November 12 2019 14:38 GMT
#20229
Time is precious. Waste it wisely.
ShoCkeyy
Profile Blog Joined July 2008
7815 Posts
November 12 2019 15:38 GMT
#20230
On November 08 2019 13:07 WarSame wrote:
Hmmmm, I see what you're getting at. Thanks! I'll consider that too. There's a lot to consider when building an API!


You should also take a look into GraphQL, for readability it’s far far superior than REST.
Life?
Excludos
Profile Blog Joined April 2010
Norway8231 Posts
Last Edited: 2019-11-12 18:52:13
November 12 2019 18:50 GMT
#20231
On November 12 2019 23:38 Manit0u wrote:
Show nested quote +
On November 11 2019 20:03 Silvanel wrote:
What security concerns should i take into account before rolling out my webpage for limited use for my close friends on a private server?


Standard XSS, SQL injection etc. For sure you want to encrypt passwords if you store them.


The one and only solution for any programmer that doesn't work in a large corporation with their own needs: Never ever store user credentials. There's just too many fall pits. Just use OAuth instead.

If you're at the point where you're unsure how you should store user details, and then go ahead and do it anyways, I can promise you will hack your website within the hour. What I can do from there just depends on how many mistakes you've done.
Manit0u
Profile Blog Joined August 2004
Poland17610 Posts
Last Edited: 2019-11-12 21:04:36
November 12 2019 21:01 GMT
#20232
On November 13 2019 03:50 Excludos wrote:
Show nested quote +
On November 12 2019 23:38 Manit0u wrote:
On November 11 2019 20:03 Silvanel wrote:
What security concerns should i take into account before rolling out my webpage for limited use for my close friends on a private server?


Standard XSS, SQL injection etc. For sure you want to encrypt passwords if you store them.


The one and only solution for any programmer that doesn't work in a large corporation with their own needs: Never ever store user credentials. There's just too many fall pits. Just use OAuth instead.

If you're at the point where you're unsure how you should store user details, and then go ahead and do it anyways, I can promise you will hack your website within the hour. What I can do from there just depends on how many mistakes you've done.


For simple stuff storing user creds is perfectly fine. Especially that most major frameworks have pretty good libraries to handle that (where they encrypt your passwords - default is bcrypt, don't show them in logs etc.), even for API development you have libraries to handle JWT and other authentication methods. There are also plenty of libraries for authorization, but that's another matter.

If he's new to that it'll be easier to use such things than setting up OAuth and integrating with third party authentication providers (where you add more traffic, need to set things up on the third party's side of things, have to think about stuff like how to revoke tokens, different authentication flows and the like, it's not beginner level endeavour).
Time is precious. Waste it wisely.
Excludos
Profile Blog Joined April 2010
Norway8231 Posts
Last Edited: 2019-11-13 07:46:17
November 13 2019 07:45 GMT
#20233
On November 13 2019 06:01 Manit0u wrote:
Show nested quote +
On November 13 2019 03:50 Excludos wrote:
On November 12 2019 23:38 Manit0u wrote:
On November 11 2019 20:03 Silvanel wrote:
What security concerns should i take into account before rolling out my webpage for limited use for my close friends on a private server?


Standard XSS, SQL injection etc. For sure you want to encrypt passwords if you store them.


The one and only solution for any programmer that doesn't work in a large corporation with their own needs: Never ever store user credentials. There's just too many fall pits. Just use OAuth instead.

If you're at the point where you're unsure how you should store user details, and then go ahead and do it anyways, I can promise you will hack your website within the hour. What I can do from there just depends on how many mistakes you've done.


For simple stuff storing user creds is perfectly fine. Especially that most major frameworks have pretty good libraries to handle that (where they encrypt your passwords - default is bcrypt, don't show them in logs etc.), even for API development you have libraries to handle JWT and other authentication methods. There are also plenty of libraries for authorization, but that's another matter.

If he's new to that it'll be easier to use such things than setting up OAuth and integrating with third party authentication providers (where you add more traffic, need to set things up on the third party's side of things, have to think about stuff like how to revoke tokens, different authentication flows and the like, it's not beginner level endeavour).


Easier, yes, but vulnerable. If it's just for fun and you don't care about potentially being hacked, then by all means go ahead. We've all made sites like that. As long as you know it's vulnerable and have nothing to lose.
R1CH
Profile Blog Joined May 2007
Netherlands10341 Posts
November 13 2019 15:42 GMT
#20234
On November 12 2019 23:38 Manit0u wrote:
Show nested quote +
On November 11 2019 20:03 Silvanel wrote:
What security concerns should i take into account before rolling out my webpage for limited use for my close friends on a private server?


Standard XSS, SQL injection etc. For sure you want to encrypt passwords if you store them.

You should be hashing passwords using a modern algorithm like Argon2id, not encrypting them. Big difference.
AdministratorTwitter: @R1CH_TL
TL+ Member
JimmyJRaynor
Profile Blog Joined April 2010
Canada17187 Posts
November 17 2019 18:24 GMT
#20235
The Casualty Actuaries I work for are laughing at all the money wasted on dumb Data Science projects.

Ray Kassar To David Crane : "you're no more important to Atari than the factory workers assembling the cartridges"
Manit0u
Profile Blog Joined August 2004
Poland17610 Posts
November 17 2019 20:13 GMT
#20236


Really fun watch. Made me chuckle really hard.
Time is precious. Waste it wisely.
Manit0u
Profile Blog Joined August 2004
Poland17610 Posts
November 18 2019 10:41 GMT
#20237
This cracked me up:

https://twitter.com/chrisalbon/status/1196136359636815872?s=20
Time is precious. Waste it wisely.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
November 21 2019 22:06 GMT
#20238
I had an assignment in my security class. Part of it was to implement openssl in C and encrypt a message file. Then we also hash that file using SHA.

I missed both of those parts. Apparently an automated script was checking the hash and ciphertext, and it didn't catch stuff like whitespace or newlines or something. So I checked, and my hash was correct.

I informed the TAs of the error (which happened to lots of students). They then gave me the points back for the SHA portion.

But I didn't get any points for the encryption part. So my question is, if I encrypted the message and then hashed the ciphertext, and the SHA hash was correct, then doesn't that mean that the ciphertext must have also been done correctly?
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
November 22 2019 09:48 GMT
#20239
--- Nuked ---
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
November 22 2019 16:21 GMT
#20240
On November 22 2019 18:48 Nesserev wrote:
Show nested quote +
On November 22 2019 07:06 travis wrote:
But I didn't get any points for the encryption part. So my question is, if I encrypted the message and then hashed the ciphertext, and the SHA hash was correct, then doesn't that mean that the ciphertext must have also been done correctly?

Yes.


ok thanks thought so
this post was more a sanity check than anything
Prev 1 1010 1011 1012 1013 1014 1032 Next
Please log in or register to reply.
Live Events Refresh
BSL 21
20:00
Non-Korean Championship - D4
Bonyth vs Sziky
Mihu vs QiaoGege
Sziky vs XuanXuan
eOnzErG vs QiaoGege
Mihu vs DuGu
Dewalt vs Bonyth
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
JuggernautJason166
SpeCial 128
Nathanias 90
StarCraft: Brood War
Artosis 752
Shuttle 422
Dewaltoss 106
Dota 2
syndereN656
Pyrionflax173
LuMiX1
Other Games
tarik_tv16547
summit1g8047
gofns6172
FrodaN5410
Liquid`RaSZi2189
fl0m912
XaKoH 169
ArmadaUGS114
KnowMe109
Maynarde91
Organizations
Other Games
gamesdonequick2150
EGCTV975
BasetradeTV24
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• Hupsaiya 76
• RyuSc2 45
• musti20045 36
• Sammyuel 14
• LaughNgamezSOOP
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• IndyKCrew
• Laughngamez YouTube
• Migwel
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21724
Other Games
• imaqtpie2911
• Scarra1695
Upcoming Events
Replay Cast
8h 38m
Wardi Open
11h 38m
Monday Night Weeklies
16h 38m
OSC
1d 10h
The PondCast
2 days
OSC
2 days
Big Brain Bouts
4 days
Serral vs TBD
BSL 21
5 days
BSL 21
6 days
Liquipedia Results

Completed

IPSL Winter 2025-26
SC2 All-Star Inv. 2025
NA Kuram Kup

Ongoing

C-Race Season 1
BSL 21 Non-Korean Championship
CSL 2025 WINTER (S19)
KCM Race Survival 2026 Season 1
OSC Championship Season 13
Underdog Cup #3
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025

Upcoming

Escore Tournament S1: W5
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Rongyi Cup S3
Nations Cup 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 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.