• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 08:57
CET 14:57
KST 22:57
  • 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
TL.net Map Contest #21: Winners10Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting12[ASL20] Ro4 Preview: Descent11
Community News
StarCraft, SC2, HotS, WC3, Returning to Blizzcon!33$5,000+ WardiTV 2025 Championship6[BSL21] RO32 Group Stage4Weekly Cups (Oct 26-Nov 2): Liquid, Clem, Solar win; LAN in Philly2Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win10
StarCraft 2
General
Mech is the composition that needs teleportation t TL.net Map Contest #21: Winners Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win RotterdaM "Serral is the GOAT, and it's not close" 5.0.15 Patch Balance Hotfix (2025-10-8)
Tourneys
Constellation Cup - Main Event - Stellar Fest $5,000+ WardiTV 2025 Championship Sparkling Tuna Cup - Weekly Open Tournament Merivale 8 Open - LAN - Stellar Fest Sea Duckling Open (Global, Bronze-Diamond)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection Mutation # 495 Rest In Peace
Brood War
General
[ASL20] Ask the mapmakers — Drop your questions BW General Discussion [BSL21] RO32 Group Stage BGH Auto Balance -> http://bghmmr.eu/ SnOw's ASL S20 Finals Review
Tourneys
[Megathread] Daily Proleagues [ASL20] Grand Finals [BSL21] RO32 Group B - Sunday 21:00 CET [BSL21] RO32 Group A - Saturday 21:00 CET
Strategy
Current Meta PvZ map balance How to stay on top of macro? Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile Should offensive tower rushing be viable in RTS games? Dawn of War IV
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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine YouTube Thread Dating: How's your luck?
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread Movie Discussion! Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Why we need SC3
Hildegard
Reality "theory" prov…
perfectspheres
Our Last Hope in th…
KrillinFromwales
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1422 users

The Big Programming Thread - Page 912

Forum Index > General Forum
Post a Reply
Prev 1 910 911 912 913 914 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.
Hanh
Profile Joined June 2016
146 Posts
October 25 2017 09:48 GMT
#18221
On October 25 2017 16:30 Silvanel wrote:
Show nested quote +
On October 25 2017 04:16 Acrofales wrote:
Don't use PyQT, but seems this is relevant: https://stackoverflow.com/questions/33736819/pyqt-no-error-msg-traceback-on-exit

Have you tried just putting your entire script between try catch and printing the exception and callback? Reading this seems like PyQT treats this as a last resource if the exception isn't being handled, and exits with an information-less error code.


Yeah i found this also. I think i will try to run line by line and if that doesnt help try override sys.execpthook. Still there is number provided in that exit process message (its 0 for example if application finish without errors), so i wondered if anyone knows what 3 stands for in my example, thats probably some group of errors. Knowning that could probably help me a lot.


If I remember correctly, 3 is the return code from abort() on Windows. On Linux, you would get another value. In any case, that's just the program unwinding the exception and not finding any handler.
Silvanel
Profile Blog Joined March 2003
Poland4733 Posts
October 25 2017 10:07 GMT
#18222
Thank You i looked in https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx and it says 0x03 is actualy ERROR_PATH_NOT_FOUND which makes sense in regards to my application. Will look into it.
Pathetic Greta hater.
R1CH
Profile Blog Joined May 2007
Netherlands10341 Posts
October 25 2017 10:28 GMT
#18223
Exit codes are process dependent so you can't infer much from an exit status of 3. Error codes are different, eg if you CreateFile an invalid path you'll get error 3 (PATH_NOT_FOUND) in Win32, but this is a Win32 API specific thing.
AdministratorTwitter: @R1CH_TL
TL+ Member
LG)Sabbath
Profile Blog Joined July 2005
Argentina3024 Posts
October 25 2017 11:12 GMT
#18224
On October 25 2017 13:59 Manit0u wrote:
Show nested quote +
On October 24 2017 08:52 LG)Sabbath wrote:
On October 16 2017 18:14 Manit0u wrote:
https://api-platform.com/

Fucken amazing!

https://github.com/docker/dockercraft

This is too much...

After reading the intro, still not sure what that framework is like. The intro is basically a docker-compose + doctrine tutorial.


It's pretty much Symfony in API-only mode

Ah, I was hoping for something new. Every PHP framework seems to be based on Symfony lately. :/
https://www.twitch.tv/argsabbath/
Hanh
Profile Joined June 2016
146 Posts
October 25 2017 11:14 GMT
#18225
On October 25 2017 19:07 Silvanel wrote:
Thank You i looked in https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx and it says 0x03 is actualy ERROR_PATH_NOT_FOUND which makes sense in regards to my application. Will look into it.


Check out https://msdn.microsoft.com/en-us/library/aa272002(v=vs.60).aspx


abort does not return control to the calling process. By default, it terminates the current process and returns an exit code of 3.

Manit0u
Profile Blog Joined August 2004
Poland17421 Posts
October 25 2017 15:17 GMT
#18226
On October 25 2017 20:12 LG)Sabbath wrote:
Show nested quote +
On October 25 2017 13:59 Manit0u wrote:
On October 24 2017 08:52 LG)Sabbath wrote:
On October 16 2017 18:14 Manit0u wrote:
https://api-platform.com/

Fucken amazing!

https://github.com/docker/dockercraft

This is too much...

After reading the intro, still not sure what that framework is like. The intro is basically a docker-compose + doctrine tutorial.


It's pretty much Symfony in API-only mode

Ah, I was hoping for something new. Every PHP framework seems to be based on Symfony lately. :/


That's because Symfony is pretty much the standard library for PHP nowadays. Everything is using it (even Zend).
Time is precious. Waste it wisely.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
October 26 2017 23:00 GMT
#18227
In Java, particularly Android, is it a good idea to log on entering an exiting a method for current and future traceability?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Manit0u
Profile Blog Joined August 2004
Poland17421 Posts
October 26 2017 23:29 GMT
#18228
On October 27 2017 08:00 WarSame wrote:
In Java, particularly Android, is it a good idea to log on entering an exiting a method for current and future traceability?


In every situation it depends on how much logs it will generate. Especially on mobile devices, where storage space is at a premium.
Time is precious. Waste it wisely.
Hanh
Profile Joined June 2016
146 Posts
October 27 2017 01:06 GMT
#18229
On October 27 2017 08:00 WarSame wrote:
In Java, particularly Android, is it a good idea to log on entering an exiting a method for current and future traceability?


In Java, it is better to leave it for later by using aspects.
Silvanel
Profile Blog Joined March 2003
Poland4733 Posts
Last Edited: 2017-10-27 08:36:44
October 27 2017 08:36 GMT
#18230
If someone is still intrested in my problem it turned out that if run my app directly from windows console the python traceback is there. Only if i use some kind of IDE (tried PyCharm and IDLE but from what i heared it is also the case for Eclipse and others) the traceback is gone.
So right now i am developing in PyCharm and testing in console.
Pathetic Greta hater.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
October 27 2017 09:37 GMT
#18231
On October 27 2017 08:00 WarSame wrote:
In Java, particularly Android, is it a good idea to log on entering an exiting a method for current and future traceability?


No. Just write well-structured code with good tests. Assert your preconditions when it's not explicit, and throw instead of swallowing errors.
There is no one like you in the universe.
Manit0u
Profile Blog Joined August 2004
Poland17421 Posts
October 27 2017 12:48 GMT
#18232
On October 27 2017 17:36 Silvanel wrote:
If someone is still intrested in my problem it turned out that if run my app directly from windows console the python traceback is there. Only if i use some kind of IDE (tried PyCharm and IDLE but from what i heared it is also the case for Eclipse and others) the traceback is gone.
So right now i am developing in PyCharm and testing in console.


You know of course that you can launch console inside PyCharm?

I've always got my console open in jetbrains IDEs.
Time is precious. Waste it wisely.
Manit0u
Profile Blog Joined August 2004
Poland17421 Posts
Last Edited: 2017-10-27 14:28:02
October 27 2017 12:54 GMT
#18233
Do you guys think there's a more elegant way to write this stuff?


class PropertyValidator < ActiveModel::Validator
def validate(record)
attributes = record.property_attributes_info

attributes.each do |properties_attribute, definitions_attribute|
@properties = {}
@errors = []

next if skip_validation?(record[properties_attribute], record[definitions_attribute])

@properties = record[properties_attribute]

validate_properties(record[definitions_attribute])

next if @errors.empty?

record.errors.add(properties_attribute, @errors)
end
end

private

def skip_validation?(properties, definitions)
properties.blank? || definitions.blank?
end

def validate_properties(definitions)
@properties.each do |property_name, property_value|
validate_property(property_name, property_value, definitions[property_name])
end
end

def validate_property(property_name, property_value, definition)
return @errors << "#{property_name} has no definition" if definition.blank?

check_type(property_name, property_value, definition[:type_of_value])
check_allowed_values(property_name, property_value, definition[:options])
check_constraints(property_name, definition[:options])
end

def check_type(property_name, property_value, type)
return if type_valid?(property_value, type)

@errors << "#{property_name}: #{property_value} is not a #{type}"
end

def check_allowed_values(property_name, property_value, options)
return if options.blank? || options[:allowed_values].blank?
return if value_allowed?(property_value, options[:allowed_values])

@errors << "#{property_name}: #{property_value} is not allowed"
end

def check_constraints(property_name, options)
return if options.blank? || options[:constraints].blank?
return if constraints_met?(options[:constraints])

@errors << "#{property_name}: does not meet constraints"
end

def type_valid?(value, type)
case type
when 'string'
value.is_a?(String)
when 'integer'
value.is_a?(Integer)
when 'float'
value.is_a?(Float)
when 'boolean'
value.is_a?(Boolean)
else
raise "Unknown property type \"#{type}\""
end
end

def value_allowed?(value, allowed)
case allowed[:type]
when 'range'
(allowed[:min]..allowed[:max]).include?(value)
when 'array'
allowed[:values].include?(value)
else
raise "Unknown allowed values type \"#{allowed[:type]}\""
end
end

def constraints_met?(constraints)
case constraints[:kind]
when 'other_property_equals'
constraints[:property_values].include?(@properties[constraints[:property_name]])
when 'and'
all_constraints_pass?(constraints)
when 'or'
any_constraints_pass?(constraints)
else
@errors << "Unknown constraint kind \"#{constraints[:kind]}\""
end
end

def all_constraints_pass?(constraints)
constraints[:constraints].each do |constraint|
return false unless constraints_met?(constraint)
end

true
end

def any_constraints_pass?(constraints)
constraints[:constraints].each do |constraint|
return true if constraints_met?(constraint)
end

false
end
end


I know it doesn't have any docs for now, but it's basically a form of custom DSL that I'm figuring out as I go (will add comments in the code later on) but I'm so far gone in wrapping my head around it that I've lost all perspective.

Is this code understandable enough if you look at it from the outside?

Edit:

Context for this is that I need to parse JSON and then validate some fields in it based on preconditions. This way an external application can pass me constraints like (a && (b && (c || d))) and each one of them can have similar nested constraints so I have to parse them recursively.
Time is precious. Waste it wisely.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
October 27 2017 16:24 GMT
#18234
For my login system I hash user's passwords and check it against a DB. Is it a bad idea to have a field in my User class that is my password hash in a byte array? Is that vulnerable to anything?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Biolunar
Profile Joined February 2012
Germany224 Posts
October 27 2017 16:28 GMT
#18235
On October 28 2017 01:24 WarSame wrote:
For my login system I hash user's passwords and check it against a DB. Is it a bad idea to have a field in my User class that is my password hash in a byte array? Is that vulnerable to anything?

Yes. You need to add a salt to the data or the password can be found with a rainbow table. Also make sure you use a good hashing algorithm (NOT MD5 or SHA1 please).
What is best? To crush the Zerg, see them driven before you, and hear the lamentations of the Protoss.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
October 27 2017 17:05 GMT
#18236
My database is on the phone, so they can't use a rainbow table against it I think. I was thinking more of concerns surrounding passing the hashed value around.

Also, I'm using SHA-256, so I should be fine on that end.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
Last Edited: 2017-10-27 17:41:25
October 27 2017 17:40 GMT
#18237
On October 28 2017 02:05 WarSame wrote:
My database is on the phone, so they can't use a rainbow table against it I think. I was thinking more of concerns surrounding passing the hashed value around.

Also, I'm using SHA-256, so I should be fine on that end.


The database being on your phone doesn't protect you against a rainbow table. If you have a million users and you hash all the passwords then you're going to have a bunch of duplicate entries in your database as anyone with the same password will have an identical entry after the hash. You add the salt so that each of those will hash to a different value and if an adversary brute forces one password they don't have everyone else's password who was using that same value.

Salts protect the collective. They're useless if the adversary is brute forcing one password. The rainbow table is just a list of what common passwords hash to with various algorithms. By utilizing a salt the adversary has to generate a rainbow table for every salt instead of having a master copy.
I'll always be your shadow and veil your eyes from states of ain soph aur.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
October 27 2017 21:03 GMT
#18238
As far as I understand it the database is on each phone, so they would have to have access to millions of phones with this app, their hashed passwords, and password hints. I agree salting is a good idea, but I don't think it is necessary in this case. Anyway, this is beside the question I was asking, which is whether passing around an object with a password hash field is vulnerable to anything if all the data stays inside the app. Could someone get the value? If they get the value could they log in with it somehow?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
October 27 2017 21:07 GMT
#18239
If it's just passing around the password as a string parameter then it's fine.

If the password is persisted in any way then no.

"data stays inside the app" means lots of things. Just because data is saved to app storage doesn't mean malicious users can't easily access the data.
There is no one like you in the universe.
tofucake
Profile Blog Joined October 2009
Hyrule19151 Posts
October 27 2017 21:12 GMT
#18240
salting the hash costs next to nothing and is far more secure than not.

you not wanting to salt means you either don't care (bad), don't think it matters (bad), don't want to do it because you don't understand salt (bad, but not as bad as the others), or "need" every possible byte of storage you can get for some other reason (bad)

tl;dr just fucking salt the password
Liquipediaasante sana squash banana
Prev 1 910 911 912 913 914 1032 Next
Please log in or register to reply.
Live Events Refresh
CranKy Ducklings
10:00
Sea Duckling Open #140
CranKy Ducklings84
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 198
Railgan 42
Creator 14
StarCraft: Brood War
Sea 6776
Horang2 4135
GuemChi 1585
Jaedong 890
actioN 290
Mini 250
BeSt 249
Soma 228
Killer 218
EffOrt 205
[ Show more ]
Rush 172
Mind 105
Hyun 95
Bonyth 72
ToSsGirL 67
Backho 60
PianO 34
JYJ32
sas.Sziky 32
Aegong 28
zelot 23
Terrorterran 14
soO 11
sorry 10
HiyA 7
Sacsri 7
Dota 2
Gorgc5272
singsing2292
qojqva1976
Dendi596
XcaliburYe219
BananaSlamJamma107
Heroes of the Storm
Khaldor214
Other Games
B2W.Neo1235
Sick275
Lowko237
Fuzer 197
Hui .121
XaKoH 87
nookyyy 56
MindelVK20
Organizations
StarCraft 2
WardiTV622
Counter-Strike
PGL231
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 73
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2101
League of Legends
• Stunt689
• HappyZerGling108
Upcoming Events
IPSL
4h 4m
dxtr13 vs OldBoy
Napoleon vs Doodle
LAN Event
4h 4m
Lambo vs Clem
Scarlett vs TriGGeR
ByuN vs TBD
Zoun vs TBD
BSL 21
6h 4m
Gosudark vs Kyrie
Gypsy vs OyAji
UltrA vs Radley
Dandy vs Ptak
Replay Cast
9h 4m
Sparkling Tuna Cup
20h 4m
WardiTV Korean Royale
22h 4m
LAN Event
1d 1h
IPSL
1d 4h
JDConan vs WIZARD
WolFix vs Cross
BSL 21
1d 6h
spx vs rasowy
HBO vs KameZerg
Cross vs Razz
dxtr13 vs ZZZero
Replay Cast
1d 19h
[ Show More ]
Wardi Open
1d 22h
WardiTV Korean Royale
2 days
Replay Cast
3 days
Kung Fu Cup
3 days
Classic vs Solar
herO vs Cure
Reynor vs GuMiho
ByuN vs ShoWTimE
Tenacious Turtle Tussle
4 days
The PondCast
4 days
RSL Revival
4 days
Solar vs Zoun
MaxPax vs Bunny
Kung Fu Cup
4 days
WardiTV Korean Royale
4 days
RSL Revival
5 days
Classic vs Creator
Cure vs TriGGeR
Kung Fu Cup
5 days
CranKy Ducklings
6 days
RSL Revival
6 days
herO vs Gerald
ByuN vs SHIN
Kung Fu Cup
6 days
Liquipedia Results

Completed

BSL 21 Points
SC4ALL: StarCraft II
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
Stellar Fest: Constellation Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual

Upcoming

SLON Tour Season 2
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
META Madness #9
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 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.