• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 15:44
CET 21:44
KST 05:44
  • 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 Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
RSL Season 3: RO16 results & RO8 bracket13Weekly Cups (Nov 10-16): Reynor, Solar lead Zerg surge1[TLMC] Fall/Winter 2025 Ladder Map Rotation14Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA12
StarCraft 2
General
RSL Season 3: RO16 results & RO8 bracket SC: Evo Complete - Ranked Ladder OPEN ALPHA RSL Season 3 - Playoffs Preview Mech is the composition that needs teleportation t GM / Master map hacker and general hacking and cheating thread
Tourneys
RSL Revival: Season 3 $5,000+ WardiTV 2025 Championship StarCraft Evolution League (SC Evo Biweekly) Constellation Cup - Main Event - Stellar Fest 2025 RSL Offline Finals Dates + Ticket Sales!
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 500 Fright night Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened
Brood War
General
soO on: FanTaSy's Potential Return to StarCraft BGH Auto Balance -> http://bghmmr.eu/ A cwal.gg Extension - Easily keep track of anyone Data analysis on 70 million replays [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[BSL21] RO16 Tie Breaker - Group A - Sat 21:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] GosuLeague T1 Ro16 - Tue & Thu 22:00 CET
Strategy
Game Theory for Starcraft Current Meta How to stay on top of macro? PvZ map balance
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Clair Obscur - Expedition 33 EVE Corporation [Game] Osu!
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
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread The Games Industry And ATVI Things Aren’t Peaceful in Palestine About SC2SEA.COM
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread Korean Music Discussion
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
The Health Impact of Joining…
TrAiDoS
Dyadica Evangelium — Chapt…
Hildegard
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2295 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
Hyrule19159 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
Hyrule19159 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
Poland4733 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
Poland17450 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
Poland17450 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
Norway8193 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
Poland17450 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
Norway8193 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
Canada17028 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
Poland17450 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
Poland17450 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
RO16 TieBreaker - Group A
TerrOr vs Aeternum
HBO vs Kyrie
ZZZero.O183
LiquipediaDiscussion
OSC
17:00
Masters Cup #150: Group C
davetesta193
Liquipedia
IPSL
17:00
Ro16 Group B
Julia vs Artosis
JDConan vs DragOn
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
White-Ra 355
IndyStarCraft 190
Nathanias 90
Vindicta 31
StarCraft: Brood War
Britney 26987
ZZZero.O 183
Dewaltoss 100
Rock 57
Noble 20
NaDa 16
League of Legends
rGuardiaN103
Counter-Strike
fl0m1331
adren_tv94
Heroes of the Storm
Liquid`Hasu407
Khaldor279
Other Games
Grubby4862
qojqva1747
FrodaN1437
B2W.Neo719
Beastyqt687
Mlord609
crisheroes448
Hui .114
KnowMe113
Trikslyr74
Organizations
Other Games
gamesdonequick1312
EGCTV1134
BasetradeTV34
StarCraft: Brood War
lovetv 10
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 21 non-featured ]
StarCraft 2
• printf 99
• Kozan
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• IndyKCrew
StarCraft: Brood War
• Airneanach124
• 80smullet 11
• Pr0nogo 4
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 7192
• WagamamaTV202
• Ler63
• lizZardDota239
• Noizen29
Other Games
• imaqtpie1264
• Shiphtur278
Upcoming Events
RSL Revival
10h 46m
Classic vs SHIN
Maru vs TBD
herO vs TBD
Wardi Open
17h 16m
IPSL
23h 16m
StRyKeR vs OldBoy
Sziky vs Tarson
BSL 21
23h 16m
StRyKeR vs Artosis
OyAji vs KameZerg
OSC
1d 2h
OSC
1d 12h
Monday Night Weeklies
1d 20h
OSC
2 days
Wardi Open
2 days
Replay Cast
3 days
[ Show More ]
Wardi Open
3 days
Tenacious Turtle Tussle
4 days
The PondCast
4 days
Replay Cast
5 days
LAN Event
5 days
Replay Cast
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2025-11-16
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
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.