• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 16:18
CEST 22:18
KST 05:18
  • 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
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
IntoTheTV X SOOP SC2 League : Weekly & Monthly4Clem: "I don't have that much hope in Blizzard"2ZeroSpace Early Access is Now Live!25Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters2Balance hotfix patch 5.0.16b (July 16)90
StarCraft 2
General
What's the best tug of war? Reynor: GSL Loss Wasn't About Preparation Format Balance hotfix patch 5.0.16b (July 16) How would you feel about frequent/monthly balance patches for SC2? Clem: "I don't have that much hope in Blizzard"
Tourneys
IntoTheTV X SOOP SC2 League : Weekly & Monthly INu's Battles#18 - Cure, herO, Rogue & ByuN RSL Revival: Season 6 - Qualifiers and Main Event Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026
Strategy
[G] Having the right mentality to improve
Custom Maps
[M] (2) Industrial Park New Map Maker - Looking for Advice - Love or Hate
External Content
Mutation # 535 Assembly of Vengeance The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ ASL22 General Discussion BW General Discussion How Famous was FlaSh before his Debut? Animated Gateway
Tourneys
Escore Tournament - Season 3 Small VOD Thread 2.0 [Megathread] Daily Proleagues [IPSL] Spring 2026 Grand Finals - This Weekend!
Strategy
Simple Questions, Simple Answers PvT advise for noobs Fighting Spirit mining rates Creating a full chart of Zerg builds
Other Games
General Games
ZeroSpace Early Access is Now Live! Path of Exile General RTS Discussion Thread Nintendo Switch Thread Diablo IV
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance Vanilla Mini Mafia
Community
General
US Politics Mega-thread Artificial Intelligence Thread Russo-Ukrainian War Thread How to buy a book - shipping from Korea to Europe The Games Industry And ATVI
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Anime Discussion Thread Series you have seen recently... Movie Discussion! [Req][Books] Good Fantasy/SciFi books
Sports
TeamLiquid Health and Fitness Initiative For 2023 2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023 McBoner: A hockey love story
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Simple Questions Simple Answers FPS when play League Of Legend on laptop
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
How Games can Help with Majo…
TrAiDoS
Hello guys!
LIN1s
ASL S22 English Commentary…
namkraft
Poker (part 2)
Nebuchad
An Exploration of th…
waywardstrategy
Customize Sidebar...

Website Feedback

Closed Threads



Active: 4601 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
Poland17800 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
Poland17800 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
Poland17800 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
Poland17800 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
Poland17800 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 1h 42m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 364
ZombieGrub239
ProTech95
Counter-Strike
fl0m3758
Heroes of the Storm
Liquid`Hasu478
Other Games
tarik_tv4910
Grubby3814
singsing1550
shahzam1024
B2W.Neo236
C9.Mang0188
UpATreeSC161
ArmadaUGS128
hungrybox88
JuggernautJason85
QueenE77
Livibee60
Trikslyr54
SteadfastSC20
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 16 non-featured ]
StarCraft 2
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• blackmanpl 48
• FirePhoenix9
• iopq 1
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Other Games
• imaqtpie729
• Shiphtur610
• Scarra269
Upcoming Events
OSC
1h 42m
Replay Cast
4h 12m
Korean StarCraft League
6h 42m
Afreeca Starleague
7h 42m
RSL Revival
12h 42m
Serral vs SHIN
herO vs Solar
Online Event
18h 42m
RSL Revival
1d 12h
Clem vs ByuN
Rogue vs Lambo
OSC
1d 15h
WardiTV Weekly
2 days
Sparkling Tuna Cup
3 days
[ Show More ]
INu's Battles
3 days
Cure vs herO
ByuN vs Rogue
PiGosaur Cup
4 days
The PondCast
4 days
Kung Fu Cup
4 days
Patches Events
4 days
Replay Cast
5 days
CrankTV Team League
5 days
Replay Cast
6 days
CrankTV Team League
6 days
Liquipedia Results

Completed

Proleague 2026-07-22
HSC XXIX
Eternal Conflict S2 E3

Ongoing

CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
Escore Tournament S3: W4
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026

Upcoming

ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
ASL Season 22: Qualifier #1
ASL Season 22: Qualifier #2
CSLAN 4
ASL Season 22
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
ESL Pro League Season 24
Stake Ranked Episode 4
Logitech G Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 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.