• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 16:48
CEST 22:48
KST 05:48
  • 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
Code S Season 1 - RO8 Preview3[ASL21] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10
Community News
Maestros of The Game 2 announcement and schedule !4Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event12Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25
StarCraft 2
General
Code S Season 1 - RO8 Preview Behind the Blue - Team Liquid History Book Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results
Tourneys
Maestros of The Game 2 announcement and schedule ! GSL Code S Season 1 (2026) Sea Duckling Open (Global, Bronze-Diamond) RSL Revival: Season 5 - Qualifiers and Main Event Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
Do we have a pimpest plays list? BGH Auto Balance -> http://bghmmr.eu/ (Spoiler) Asl ro8 D winner interview BW General Discussion AI Question
Tourneys
Small VOD Thread 2.0 [ASL21] Ro8 Day 4 [BSL22] RO16 Group Stage - 02 - 10 May [ASL21] Ro8 Day 3
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates 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 OutLive 25 (RTS Game) Daigo vs Menard Best of 10
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
US Politics Mega-thread European Politico-economics QA Mega-thread The Letting Off Steam Thread Russo-Ukrainian War Thread 3D technology/software discussion
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
How EEG Data Can Predict Gam…
TrAiDoS
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2187 users

The Big Programming Thread - Page 481

Forum Index > General Forum
Post a Reply
Prev 1 479 480 481 482 483 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.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
May 16 2014 00:56 GMT
#9601
--- Nuked ---
3FFA
Profile Blog Joined February 2010
United States3931 Posts
Last Edited: 2014-05-19 11:53:59
May 16 2014 19:18 GMT
#9602
Thank you so much Ben and Nesserev! Especially for explaining it to me so that now I understand the why behind all of this.

Fixed Code as requested below.
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
May 16 2014 21:08 GMT
#9603
--- Nuked ---
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
May 17 2014 10:23 GMT
#9604
[image loading]

Hahahaha
Time is precious. Waste it wisely.
BungaBunga
Profile Joined May 2014
Italy23 Posts
May 17 2014 15:10 GMT
#9605
Are there any iOS developers around here?
jtype
Profile Blog Joined April 2009
England2167 Posts
May 18 2014 09:16 GMT
#9606
On May 18 2014 00:10 BungaBunga wrote:
Are there any iOS developers around here?


Do you have a question for them?
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
May 18 2014 09:34 GMT
#9607
It's a lot easier if you ask the question instead of asking if you should ask the question :p
There is no one like you in the universe.
BungaBunga
Profile Joined May 2014
Italy23 Posts
May 18 2014 10:03 GMT
#9608
Here is my question:
I've put a lot of effort into making an Android app. The app is doing ok and I can currently live off it.
Now the question is if it makes sense to repeat the same thing for iOS.

I cannot afford hiring another developer or designer.
So I would basically have to do it all by myself.
It would probably take me about 2 years to get the iOS app done.

Here are the things that concern me:
- I would need to buy all the Apple stuff (laptop, iPhone, tablet)
- I'm not a designer myself. Even though the app looks ok for Android, I know that the bar for iOS is a lot higher.
- On Android it is relatively easy to get steady downloads with good SEO. On iOS I've heard that you need to spend loads of money on marketing just to be visible. I'm wondering if anyone has some experience with that.

Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
Last Edited: 2014-05-18 13:43:00
May 18 2014 10:48 GMT
#9609
On May 18 2014 19:03 BungaBunga wrote:
Here is my question:
I've put a lot of effort into making an Android app. The app is doing ok and I can currently live off it.
Now the question is if it makes sense to repeat the same thing for iOS.

I cannot afford hiring another developer or designer.
So I would basically have to do it all by myself.
It would probably take me about 2 years to get the iOS app done.

Here are the things that concern me:
- I would need to buy all the Apple stuff (laptop, iPhone, tablet)
- I'm not a designer myself. Even though the app looks ok for Android, I know that the bar for iOS is a lot higher.
- On Android it is relatively easy to get steady downloads with good SEO. On iOS I've heard that you need to spend loads of money on marketing just to be visible. I'm wondering if anyone has some experience with that.


http://www.xda-developers.com/android/google-tool-helps-developers-port-android-apps-to-ios/

Maybe this can help...

On another note, do you guys have an idea how can one access the private function of a parent class from one of its child classes?
Time is precious. Waste it wisely.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
May 18 2014 13:58 GMT
#9610
On May 18 2014 19:48 Manit0u wrote:

On another note, do you guys have an idea how can one access the private function of a parent class from one of its child classes?


You don't.

Private: Only visible to the current class.
Protected: Visible to the current class and any classes inheriting this class.
Public: Visible to everyone.

What you want is a protected method, not a private one.
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
Last Edited: 2014-05-18 14:05:22
May 18 2014 14:04 GMT
#9611
On May 18 2014 22:58 Morfildur wrote:
Show nested quote +
On May 18 2014 19:48 Manit0u wrote:

On another note, do you guys have an idea how can one access the private function of a parent class from one of its child classes?


You don't.

Private: Only visible to the current class.
Protected: Visible to the current class and any classes inheriting this class.
Public: Visible to everyone.

What you want is a protected method, not a private one.


That much I knew, thought that maybe there's some hacks you could use that I didn't know of. The thing is, I have a big private function in one class in the big framework. I need to alter this function ever so slightly without having to rewrite a ton of stuff (the class containing the private function has lots of children). Simply changing it to protected won't work since I don't know if any of its children won't override it then. It's a poor design by the creator of this thing...

Anyway, another question, this time about JS (of which I don't know much so I'll write it more in pseudo-code than anything):


func(args)
{
print(args.length);
print(args[1]);
}


Input/Output:

> func blahblah
undefined
blahblah


Any idea why it doesn't return the .length property? I know that it would be true in the past for array-like objects but I hear it isn't the case now... I'm confused.
Time is precious. Waste it wisely.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
May 18 2014 14:25 GMT
#9612
Technically with Reflection (at least in some languages) you can circumvent any protection levels you want. You really don't want that though.

If you have access to the source code of the problematic class, you probably can introduce a level of indirection to safely lower the protection level to protected:

First write a protected method that simply forwards to the private method you want to override. Then change all references to the private method to use the new method instead. If you made sure that the name of the new protected method won't clash with any method names of any potential subclasses, you now have a protected hook that nobody uses yet.
If you have a good reason to disagree with the above, please tell me. Thank you.
berated-
Profile Blog Joined February 2007
United States1134 Posts
May 18 2014 14:39 GMT
#9613
On May 18 2014 23:04 Manit0u wrote:
Show nested quote +
On May 18 2014 22:58 Morfildur wrote:
On May 18 2014 19:48 Manit0u wrote:

On another note, do you guys have an idea how can one access the private function of a parent class from one of its child classes?


You don't.

Private: Only visible to the current class.
Protected: Visible to the current class and any classes inheriting this class.
Public: Visible to everyone.

What you want is a protected method, not a private one.


That much I knew, thought that maybe there's some hacks you could use that I didn't know of. The thing is, I have a big private function in one class in the big framework. I need to alter this function ever so slightly without having to rewrite a ton of stuff (the class containing the private function has lots of children). Simply changing it to protected won't work since I don't know if any of its children won't override it then. It's a poor design by the creator of this thing...

Anyway, another question, this time about JS (of which I don't know much so I'll write it more in pseudo-code than anything):


func(args)
{
print(args.length);
print(args[1]);
}


Input/Output:

> func blahblah
undefined
blahblah


Any idea why it doesn't return the .length property? I know that it would be true in the past for array-like objects but I hear it isn't the case now... I'm confused.


what type would you say blahblah is?

Your example isn't 100% clear to me, but hopefully some of this helps? If you are actually passing in an argument like args, then its possible in your example that args could be an object, not an array.


var obj = {};
obj[1] = 'test';


Above would be an example where you obj[1] would return a value but length would not be known.

If you are actually trying to access the arguments of a function, then, the keyword is arguments and it isn't passed into the function, its just kind of there.

Example of arguments
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
May 18 2014 15:10 GMT
#9614
On May 18 2014 23:39 berated- wrote:
Show nested quote +
On May 18 2014 23:04 Manit0u wrote:
On May 18 2014 22:58 Morfildur wrote:
On May 18 2014 19:48 Manit0u wrote:

On another note, do you guys have an idea how can one access the private function of a parent class from one of its child classes?


You don't.

Private: Only visible to the current class.
Protected: Visible to the current class and any classes inheriting this class.
Public: Visible to everyone.

What you want is a protected method, not a private one.


That much I knew, thought that maybe there's some hacks you could use that I didn't know of. The thing is, I have a big private function in one class in the big framework. I need to alter this function ever so slightly without having to rewrite a ton of stuff (the class containing the private function has lots of children). Simply changing it to protected won't work since I don't know if any of its children won't override it then. It's a poor design by the creator of this thing...

Anyway, another question, this time about JS (of which I don't know much so I'll write it more in pseudo-code than anything):


func(args)
{
print(args.length);
print(args[1]);
}


Input/Output:

> func blahblah
undefined
blahblah


Any idea why it doesn't return the .length property? I know that it would be true in the past for array-like objects but I hear it isn't the case now... I'm confused.


what type would you say blahblah is?

Your example isn't 100% clear to me, but hopefully some of this helps? If you are actually passing in an argument like args, then its possible in your example that args could be an object, not an array.


var obj = {};
obj[1] = 'test';


Above would be an example where you obj[1] would return a value but length would not be known.

If you are actually trying to access the arguments of a function, then, the keyword is arguments and it isn't passed into the function, its just kind of there.

Example of arguments


Trying to help some poor soul using stuff I didn't create with my (very) limited knowledge of JS. Can't get more specific since that's all I got from said person.
Time is precious. Waste it wisely.
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2014-05-18 19:24:35
May 18 2014 19:24 GMT
#9615
On the comments on reflection above:

Manit0u - the direct answer to your question is yes, you can do it. Spine is in the right direction with reflection, here is an example in Java: http://stackoverflow.com/questions/14398157/how-to-invoke-parent-private-method-from-child

Morfildur is in the more correct direction though - even though it's possible, you really should not do this except under some very rare circumstances.

You might need it in a very specific unit test to ensure the exact behavior of some type of configuration - but even then you should exhaust all other possibilities of designing your code in a way that doesn't force you to use reflection on private methods.
Who after all is today speaking about the destruction of the Armenians?
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
May 18 2014 20:59 GMT
#9616
On May 19 2014 04:24 phar wrote:
On the comments on reflection above:

Manit0u - the direct answer to your question is yes, you can do it. Spine is in the right direction with reflection, here is an example in Java: http://stackoverflow.com/questions/14398157/how-to-invoke-parent-private-method-from-child

Morfildur is in the more correct direction though - even though it's possible, you really should not do this except under some very rare circumstances.

You might need it in a very specific unit test to ensure the exact behavior of some type of configuration - but even then you should exhaust all other possibilities of designing your code in a way that doesn't force you to use reflection on private methods.


Thanks, Reflection is what I needed. I can't change the design since I have to work with something designed by someone else that's already in production environment so I don't really have much leeway here. I'm not even sure I'm still going to use this (most likely not), just wanted to know if it was possible.
Time is precious. Waste it wisely.
phar
Profile Joined August 2011
United States1080 Posts
May 19 2014 03:30 GMT
#9617
Yea I strongly, strongly encourage you to not use it if at all possible. Even if it works relatively well now, it's a bitch to maintain that code.
Who after all is today speaking about the destruction of the Armenians?
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-05-19 05:27:30
May 19 2014 05:22 GMT
#9618
This reflection thing seems like a hack. No direct instance of the superclass is created, yet you call its private methods. Isn't this against OOP?

Edit: Or is this the superclass instance?

Method m = getClass().getSuperclass().getDeclaredMethod("a", new Class<?>[]{});

Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-05-19 06:07:34
May 19 2014 06:02 GMT
#9619
--- Nuked ---
teamamerica
Profile Blog Joined July 2010
United States958 Posts
May 19 2014 06:15 GMT
#9620
On May 18 2014 22:58 Morfildur wrote:
Show nested quote +
On May 18 2014 19:48 Manit0u wrote:

On another note, do you guys have an idea how can one access the private function of a parent class from one of its child classes?


You don't.

Private: Only visible to the current class.
Protected: Visible to the current class and any classes inheriting this class.
Public: Visible to everyone.

What you want is a protected method, not a private one.


Just as a useless tidbit, afaik protected is visible to any children classes as well as any classes in the same package. Apparently in Javaland, at some point they imagined the atomic units of code being packages?
RIP GOMTV. RIP PROLEAGUE.
Prev 1 479 480 481 482 483 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 3h 12m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 673
Hui .193
BRAT_OK 71
MindelVK 8
CosmosSc2 3
JuggernautJason2
StarCraft: Brood War
Calm 3329
ggaemo 153
Dewaltoss 97
NaDa 12
Dota 2
monkeys_forever362
League of Legends
Doublelift2482
Reynor61
Counter-Strike
fl0m1984
Super Smash Bros
PPMD1
Other Games
gofns11084
Gorgc3906
Grubby3351
Liquid`RaSZi1986
FrodaN1040
qojqva722
mouzStarbuck443
shahzam422
Liquid`Hasu401
C9.Mang0334
tarik_tv104
syndereN86
ArmadaUGS77
Mew2King57
UpATreeSC53
ViBE15
Organizations
Other Games
gamesdonequick2048
StarCraft 2
angryscii 34
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 18 non-featured ]
StarCraft 2
• musti20045 17
• Adnapsc2 15
• Reevou 1
• Kozan
• Migwel
• sooper7s
• AfreecaTV YouTube
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• blackmanpl 29
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• lizZardDota256
League of Legends
• imaqtpie2398
Other Games
• Scarra526
• Shiphtur368
Upcoming Events
Replay Cast
3h 12m
Escore
13h 12m
The PondCast
13h 12m
WardiTV Invitational
14h 12m
Zoun vs Ryung
Lambo vs ShoWTimE
Big Brain Bouts
19h 12m
Fjant vs Bly
Serral vs Shameless
OSC
1d 1h
Replay Cast
1d 3h
CranKy Ducklings
1d 13h
RSL Revival
1d 13h
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
1d 14h
Krystianer vs TriGGeR
Cure vs Rogue
[ Show More ]
uThermal 2v2 Circuit
1d 18h
BSL
1d 22h
Artosis vs TerrOr
spx vs StRyKeR
Replay Cast
2 days
Sparkling Tuna Cup
2 days
RSL Revival
2 days
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
2 days
BSL
2 days
Dewalt vs DragOn
Aether vs Jimin
GSL
3 days
Afreeca Starleague
3 days
Soma vs Leta
Wardi Open
3 days
Monday Night Weeklies
3 days
OSC
4 days
CranKy Ducklings
4 days
Afreeca Starleague
4 days
Light vs Flash
Replay Cast
5 days
Replay Cast
6 days
The PondCast
6 days
Liquipedia Results

Completed

Proleague 2026-05-05
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
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
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
YSL S3
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...

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.