• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 16:13
CEST 22:13
KST 05:13
  • 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
[ASL21] Ro8 Preview Pt2: Progenitors2Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10Team Liquid Map Contest #22 - The Finalists22
Community News
RSL Revival: Season 5 - Qualifiers and Main Event10Code S Season 1 (2026) - RO12 Results02026 GSL Season 1 Qualifiers25Maestros of the Game 2 announced92026 GSL Tour plans announced15
StarCraft 2
General
Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun Code S Season 1 (2026) - RO12 Results Team Liquid Map Contest #22 - The Finalists Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool MaNa leaves Team Liquid
Tourneys
RSL Revival: Season 5 - Qualifiers and Main Event GSL Code S Season 1 (2026) SC2 INu's Battles#15 <BO.9 2Matches> WardiTV Spring Cup SEL Masters #6 - Solar vs Classic (SC: Evo)
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
[ASL21] Ro8 Preview Pt2: Progenitors Why there arent any 256x256 pro maps? BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ ASL21 General Discussion
Tourneys
[ASL21] Ro8 Day 2 [Megathread] Daily Proleagues Escore Tournament StarCraft Season 2 [BSL22] RO16 Group Stage - 02 - 10 May
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Stormgate/Frost Giant Megathread Dawn of War IV Nintendo Switch Thread Daigo vs Menard Best of 10 Diablo IV
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
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 TL Mafia Community Thread Five o'clock TL Mafia
Community
General
European Politico-economics QA Mega-thread US Politics Mega-thread Russo-Ukrainian War Thread 3D technology/software discussion Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion McBoner: A hockey love story
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Movie Stars In Video Games: …
TrAiDoS
ramps on octagon
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1312 users

The Big Programming Thread - Page 1020

Forum Index > General Forum
Post a Reply
Prev 1 1018 1019 1020 1021 1022 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.
Acrofales
Profile Joined August 2010
Spain18285 Posts
July 19 2020 14:05 GMT
#20381
I agree with Furikawari. Having a class Secretario and setting his "job" to Secretario is double. This looks like a situation for polymorphism. If the exercise is specifically asking to use enums for jobs, you would probably want to go the other way round and have a single class "Employee" where you can set Employee.job dependent on the actual job he or she has. Something like this:

+ Show Spoiler +

public Empleado(String despacho, String fax, String nombre, String apellidos, String DNI,
String direccion, int anyos_antiguedad, String telefono, double salario, String supervisor, Jobs job) {
super(nombre, apellidos, DNI, direccion, anyos_antiguedad, telefono, salario, supervisor);
this.office = despacho;
this.fax = fax;
this.job = job;
}

Although you'll probably have to change some things with your super() call.
Godwrath
Profile Joined August 2012
Spain10142 Posts
Last Edited: 2020-07-19 14:21:35
July 19 2020 14:11 GMT
#20382
Thanks for the answers guys, yeah that's what i did (employee and 3 child classes). It's more out of curiosity if i could do an enum, and assign the value in a constructor, or if that's incorrect (not because it doesn't work, but more about if it can bring problems later on). I ended up just adding the job in the toString() method rather than a field.

While i am at it, are there any books that you recommend for java (not sure how updated the old OP is in that regard)?
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
Last Edited: 2020-07-19 14:30:51
July 19 2020 14:26 GMT
#20383
On July 19 2020 23:11 Godwrath wrote:
Thanks for the answers guys, yeah that's what i did (employee and 3 child classes). It's more out of curiosity if i could do an enum, and assign the value in a constructor, or if that's incorrect (not because it doesn't work, but more about if it can bring problems later on). I ended up just adding the job in the toString() method rather than a field.

While i am at it, are there any books that you recommend for java (not sure how updated the old OP is in that regard)?


The point of polymorphism is to make the code easier and more modular. If you store the subclass as an enum instead of using polymorphism then your code must check for that enum every time you want to do something different based on the subclass. Polymorphism allows the code to know what it is so each subclass can have its own method and you don't have to do those extra checks yourself.
I'll always be your shadow and veil your eyes from states of ain soph aur.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
July 19 2020 22:52 GMT
#20384
As an addition to the above, you can also have shared methods return different things. For example, you may have a shared function in your Employee class called "getJobName". In response to this function call your Secretario subclass of Employee can return "Secretario", Boss can return "Jefe", etc.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
July 21 2020 00:39 GMT
#20385
First of all, please try to write all variable names in English. This makes your code more readable internationally and you can always translate the fields you needs when displaying them to the user.

Second thing that comes to mind is your awfully long constructor, just pass those variables as a hash or some other form of data if you really have to. It's worth keeping in mind that you should avoid creating methods that take on more than 4 arguments (that includes constructors).

I think that for this particular case you could use either inheritance (as others already suggested) or some form of composition (which you should prefer over inheritance) like the abstract document pattern.
Time is precious. Waste it wisely.
Godwrath
Profile Joined August 2012
Spain10142 Posts
July 21 2020 13:55 GMT
#20386
Noted, thanks everyone!
JimmyJRaynor
Profile Blog Joined April 2010
Canada17486 Posts
Last Edited: 2020-07-21 15:00:15
July 21 2020 14:38 GMT
#20387
On June 23 2020 00:28 necrosexy wrote:
any recommended .NET guides?

i really like this guy's insights into MS development technologies including .NET

https://weblog.west-wind.com/

if you are building sophisticated database applications and speed is an important factor... Rick Strahl is a great guy to follow.

Damn, I wish I could maintain and grow my customer base from Maui Hawaii.
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
Poland17743 Posts
July 21 2020 20:07 GMT
#20388
On July 21 2020 22:55 Godwrath wrote:
Noted, thanks everyone!


I also forgot to mention that you should use proper data types on the db if possible. For example, if you have a "job" or "role" on your user and it's always going to be one of specific list you should make it an enum (postgres example) instead of a string/varchar. This way your column will always take up only 4 bytes of data but still be human readable. Just like you should use "money" for storing currency, "inet" for ip addresses, so on and so forth. It makes your data more robust and helps with integrity.

On June 23 2020 00:28 necrosexy wrote:
any recommended .NET guides?


Not strictly .NET but Code Complete 2nd ed. is a mandatory read in my opinion.
Time is precious. Waste it wisely.
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
Last Edited: 2020-08-05 10:19:43
August 05 2020 10:18 GMT
#20389
I have a question regarding desktop apps. I want to create an app for my wife's business and I intend to do it in Java. There's one thing I have trouble finding info about on the web: storing encrypted data.

Since the app will deal with medical patients it's vital that all their data will be secure. I'm not really sure how to do it though. Should I use sqlite file and encrypt it with third party software? (I guess it would be decrypted while in use by the app, exposing a potential security hole)

Have any of you dealt with stuff like that? Any ideas or pointers are welcome. I will be doing some more research on this by myself and will post any updates if I find something interesting.

I don't really need super specifics since I'm only on the planning process (and I don't know Java that well yet) so just high level concepts will suffice for me right now.

Edit: Currently I'm looking for pure desktop solutions that don't require internet access. I know I can always make an API that will store the data on a secure server in the db there.
Time is precious. Waste it wisely.
tofucake
Profile Blog Joined October 2009
Hyrule19210 Posts
August 05 2020 12:52 GMT
#20390
sqlite has a native encryption at rest extension: https://www.sqlite.org/see/doc/release/www/readme.wiki
Liquipediaasante sana squash banana
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
Last Edited: 2020-08-05 21:23:35
August 05 2020 21:18 GMT
#20391
On August 05 2020 21:52 tofucake wrote:
sqlite has a native encryption at rest extension: https://www.sqlite.org/see/doc/release/www/readme.wiki


Nice. I think it's also possible to use native HSQL encrypted db with Java which could be potentially a better solution - no need to compile sqlite differently on different platforms and you can use Hibernate out of the box.


DriverManager.getConnection("jdbc:hsqldb:file:_some_encrypted_db;crypt_key="+key+";crypt_type=AES", "SA", "")


I'll keep looking into that.

Edit: It seems that H2 might be even better for that since it comes with more features like fulltext search and odbc driver.
Time is precious. Waste it wisely.
JimmyJRaynor
Profile Blog Joined April 2010
Canada17486 Posts
August 06 2020 18:33 GMT
#20392
On August 05 2020 19:18 Manit0u wrote:
I have a question regarding desktop apps. I want to create an app for my wife's business and I intend to do it in Java. There's one thing I have trouble finding info about on the web: storing encrypted data.

Since the app will deal with medical patients it's vital that all their data will be secure. I'm not really sure how to do it though. Should I use sqlite file and encrypt it with third party software? (I guess it would be decrypted while in use by the app, exposing a potential security hole)

Have any of you dealt with stuff like that? Any ideas or pointers are welcome. I will be doing some more research on this by myself and will post any updates if I find something interesting.

I don't really need super specifics since I'm only on the planning process (and I don't know Java that well yet) so just high level concepts will suffice for me right now.

Edit: Currently I'm looking for pure desktop solutions that don't require internet access. I know I can always make an API that will store the data on a secure server in the db there.

For the desktop medical apps I develop ... I use visual foxpro and Cryptor for encryption.
I maintain some Foxpro for DOS applications that also use Cryptor for encryption.

When I want to make the data available to internet or mobile users I use West Wind Web Connection.
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
Poland17743 Posts
August 07 2020 10:22 GMT
#20393
Thanks for the suggestion Jimmy. I'll look into it.

Also, I've got a piece of advice for you guys. If you ever get a job offer to work with Magento, turn it down. I've just got one temporarily before I negotiate something better and boy is it a pain. No real coding, you just copy-paste stuff and change some values. Still, even that takes longer than just writing the same thing from scratch in normal framework with tests and everything. Fucking horrible.

If you want to start your e-commerce business and want to set up your shop just go for a custom solution. Magento might be fine just for starters but only as long as you don't need any custom features for it and can use it out of the box. In my opinion doing anything in it is a waste of client's money and programmer's time...
Time is precious. Waste it wisely.
zatic
Profile Blog Joined September 2007
Zurich15365 Posts
August 07 2020 10:42 GMT
#20394
Our partners are working with Magento and it's a nightmare to negotiate any interfaces with them. I have no idea what you need to do on the Magento side to call an external service but the amount of documentation they want is nuts. Of course, it could also be the company's fault, less the product's.

For e-commerce Shopify or bust.
ModeratorI know Teamliquid is known as a massive building
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
August 07 2020 12:58 GMT
#20395
On August 07 2020 19:42 zatic wrote:
Our partners are working with Magento and it's a nightmare to negotiate any interfaces with them. I have no idea what you need to do on the Magento side to call an external service but the amount of documentation they want is nuts. Of course, it could also be the company's fault, less the product's.

For e-commerce Shopify or bust.


Well, it's a pain to do anything in it. I've just wasted an entire day to simply add another attribute to one model (doing only backend). In general, something that should be done in like 20-30min including tests in normal framework takes ages in Magento. The way it handles db migrations and such is also atrocious.

For me the worst thing is that you're writing very little actual code. Most of the stuff is just playing with .xml files and copy-pasting vendor classes to override specific methods. It's super slow too because all those .xml files you're toying with are used to then invoke magic stuff to generate code for new classes on the fly during runtime.

Now I have a task to create a process that'll update product descriptions based on a template by filling out placeholders with data from the product. Simple stuff but I envision it'll take me like a week or two to do in Magento...
Time is precious. Waste it wisely.
JimmyJRaynor
Profile Blog Joined April 2010
Canada17486 Posts
August 07 2020 12:59 GMT
#20396
On August 07 2020 19:22 Manit0u wrote:
Thanks for the suggestion Jimmy. I'll look into it.

Also, I've got a piece of advice for you guys. If you ever get a job offer to work with Magento, turn it down. I've just got one temporarily before I negotiate something better and boy is it a pain. No real coding, you just copy-paste stuff and change some values. Still, even that takes longer than just writing the same thing from scratch in normal framework with tests and everything. Fucking horrible.

If you want to start your e-commerce business and want to set up your shop just go for a custom solution. Magento might be fine just for starters but only as long as you don't need any custom features for it and can use it out of the box. In my opinion doing anything in it is a waste of client's money and programmer's time...

Working in medical is awesome.. the money is great. Its almost all women at the top who leave you alone and don't try to micromanage you thinking they "know software development". I'd say the medical establishment in Canada and the northeastern USA has the proper balance of fear and respect for technology that makes working for them pretty easy.

In my experience the best CIOs, project managers, and business analysts in the medical industry were front line medical workers earlier in their careers. The MBA wielding "Business Only" ones... try too much Jedi Master mind trick bullshit that they think is "advanced business management techniques".

The former front liners respect science and respect the sometimes arduous and lengthy software testing process. They are also more down to earth and more realistic. Avoid those MBA jerks.
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
Poland17743 Posts
August 07 2020 13:14 GMT
#20397
The app I'm creating right now is for my wife's small medical business. But most apps for medical in Poland suck monkey balls (it can be said the same about edu, tax and various office software too) since they're made by huge companies that don't give a fuck and hire students to churn them out. When you see completely plain and unstyled, generic Java stuff with copyright from 2005 you know it can't be good. It annoys everyone who uses them but there are no alternatives here.

If I manage to create this app for my wife and it'll be any good I'll think of licensing it out to other medical facilities. Then I can probably even start building a shared medical db and you can live off of that (I'm seriously tired from working for other people who don't give a shit).
Time is precious. Waste it wisely.
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
August 10 2020 09:47 GMT
#20398
Discovery of the day: company I'm working for now has a shower in the server room. Literally server rack is standing next to a shower stall.

My mind was blown.
Time is precious. Waste it wisely.
Silvanel
Profile Blog Joined March 2003
Poland4751 Posts
August 10 2020 09:59 GMT
#20399
Uhhh. Why? Is it foam shower? Is it part of fire extinguishing system? I need to know more
Pathetic Greta hater.
Kipsate
Profile Blog Joined July 2010
Netherlands45349 Posts
Last Edited: 2020-08-10 11:12:23
August 10 2020 11:11 GMT
#20400
Haha ,we work for a lot of E-Commerce Clients and they all build their stuff in Magento or Magento 2

We get a lot of busines from it as they inevitably need to build stuff that integrates with Magento but I haven't heard anyone who is really satisfied with it.

I also worked with a client who had Shopify which was just way better.
WriterXiao8~~
Prev 1 1018 1019 1020 1021 1022 1032 Next
Please log in or register to reply.
Live Events Refresh
IPSL
19:00
Ro24 Group F
eOnzErG vs TBD
G5 vs Nesh
Airneanach47
Liquipedia
BSL
19:00
RO16 Group B
Bonyth vs Sterling
KwarK vs JDConan
ZZZero.O273
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
JuggernautJason107
EmSc Tv 25
StarCraft: Brood War
Britney 21239
Shuttle 474
Mini 326
ZZZero.O 273
Dewaltoss 129
firebathero 118
ToSsGirL 34
Sacsri 8
NaDa 5
Dota 2
Gorgc6238
monkeys_forever385
febbydoto4
League of Legends
Doublelift1415
Counter-Strike
fl0m8314
olofmeister3353
Heroes of the Storm
Liquid`Hasu427
Khaldor250
MindelVK13
Other Games
Grubby5514
Liquid`RaSZi1421
FrodaN1244
B2W.Neo676
mouzStarbuck283
KnowMe218
RotterdaM214
Organizations
Other Games
gamesdonequick1351
BasetradeTV563
Dota 2
PGL Dota 2 - Main Stream69
StarCraft 2
EmSc Tv 25
EmSc2Tv 25
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 19 non-featured ]
StarCraft 2
• StrangeGG 53
• Adnapsc2 23
• maralekos17
• Response 11
• Reevou 1
• IndyKCrew
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• WagamamaTV744
• lizZardDota269
Other Games
• imaqtpie1384
• Shiphtur241
Upcoming Events
Patches Events
3h 47m
Replay Cast
12h 47m
Wardi Open
13h 47m
Afreeca Starleague
13h 47m
Jaedong vs Light
Monday Night Weeklies
19h 47m
Replay Cast
1d 3h
Sparkling Tuna Cup
1d 13h
Afreeca Starleague
1d 13h
Snow vs Flash
WardiTV Invitational
1d 14h
SHIN vs Nicoract
Solar vs Nice
GSL
2 days
Classic vs Cure
Maru vs Rogue
[ Show More ]
GSL
3 days
SHIN vs Zoun
ByuN vs herO
OSC
3 days
OSC
3 days
Replay Cast
4 days
Escore
4 days
The PondCast
4 days
WardiTV Invitational
4 days
Zoun vs Ryung
Lambo vs ShoWTimE
Replay Cast
5 days
CranKy Ducklings
5 days
RSL Revival
5 days
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
5 days
Krystianer vs TriGGeR
Cure vs Rogue
BSL
5 days
Replay Cast
6 days
Sparkling Tuna Cup
6 days
RSL Revival
6 days
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
6 days
BSL
6 days
Liquipedia Results

Completed

Proleague 2026-05-02
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
KK 2v2 League Season 1
Acropolis #4
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026

Upcoming

Escore Tournament S2: W6
BSL 22 Non-Korean Championship
Escore Tournament S2: W7
Escore Tournament S2: W8
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 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...

Disclosure: This page contains affiliate marketing links that support TLnet.

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.