• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 02:19
CET 07:19
KST 15:19
  • 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
ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
2026 KongFu Cup Announcement3BGE Stara Zagora 2026 cancelled11Blizzard Classic Cup - Tastosis announced as captains15Weekly Cups (March 2-8): ByuN overcomes PvT block4GSL CK - New online series18
StarCraft 2
General
Blizzard Classic Cup - Tastosis announced as captains BGE Stara Zagora 2026 cancelled BGE Stara Zagora 2026 announced ByuL: The Forgotten Master of ZvT Terran AddOns placement
Tourneys
RSL Season 4 announced for March-April Sparkling Tuna Cup - Weekly Open Tournament 2026 KongFu Cup Announcement [GSL CK] Team Maru vs. Team herO StarCraft Evolution League (SC Evo Biweekly)
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026] Map Editor closed ?
External Content
The PondCast: SC2 News & Results Mutation # 516 Specter of Death Mutation # 515 Together Forever Mutation # 514 Ulnar New Year
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ BSL 22 Map Contest — Submissions OPEN to March 10 ASL21 General Discussion Are you ready for ASL 21? Hype VIDEO Gypsy to Korea
Tourneys
[Megathread] Daily Proleagues [BSL22] Open Qualifiers & Ladder Tours IPSL Spring 2026 is here! ASL Season 21 Qualifiers March 7-8
Strategy
Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2 Fighting Spirit mining rates Zealot bombing is no longer popular?
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread PC Games Sales Thread No Man's Sky (PS4 and PC)
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
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
Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia TL Mafia Community Thread
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine Mexico's Drug War NASA and the Private Sector
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread Formula 1 Discussion General nutrition recommendations Cricket [SPORT] TL MMA Pick'em Pool 2013
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1537 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
Hyrule19194 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
Hyrule19194 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
Poland4742 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
Poland17693 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
Poland17693 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
Norway8242 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
Poland17693 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
Norway8242 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
Netherlands10342 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
Canada17329 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
Poland17693 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
Poland17693 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
Next event in 3h 41m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
NeuroSwarm 239
StarCraft: Brood War
Sea 28825
ToSsGirL 78
Noble 73
HiyA 63
League of Legends
JimRising 759
Counter-Strike
Stewie2K1137
Super Smash Bros
Mew2King200
Heroes of the Storm
Khaldor168
Other Games
summit1g10666
WinterStarcraft492
Moletrap2
Organizations
Other Games
gamesdonequick521
ComeBackTV 159
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• davetesta38
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1611
• HappyZerGling105
Upcoming Events
Sparkling Tuna Cup
3h 41m
RSL Revival
3h 41m
ByuN vs SHIN
Maru vs Krystianer
WardiTV Team League
5h 41m
Patches Events
10h 41m
BSL
13h 41m
GSL
1d 1h
Wardi Open
1d 5h
Monday Night Weeklies
1d 10h
OSC
1d 17h
WardiTV Team League
2 days
[ Show More ]
PiGosaur Cup
2 days
Kung Fu Cup
3 days
The PondCast
4 days
KCM Race Survival
4 days
WardiTV Team League
4 days
Replay Cast
4 days
KCM Race Survival
5 days
WardiTV Team League
5 days
Korean StarCraft League
5 days
uThermal 2v2 Circuit
6 days
BSL
6 days
Liquipedia Results

Completed

Proleague 2026-03-13
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Jeongseon Sooper Cup
BSL Season 22
RSL Revival: Season 4
Nations Cup 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual

Upcoming

CSL Elite League 2026
ASL Season 21
Acropolis #4 - TS6
2026 Changsha Offline CUP
Acropolis #4
IPSL Spring 2026
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
NationLESS Cup
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 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.