• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 14:35
CET 20:35
KST 04:35
  • 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
[ASL22] Finals Preview: Sweet Victory!12[ASL22] Ro4 Preview: Mirror Mirror6[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5
Community News
Weekly Cups (October 19-25): Clem triples first in 5.0.175Evil Geniuses - shutting down21ISSL (IntoTheTV x SOOP SC2 League): Premier7Weekly Cups (October 12-18): 5.0.17 era begins1[$1250] International ShieldBattery League99
StarCraft 2
General
How do you feel about the mass reverts in the 5.0.17 PTR? No more SC2 streamers on team liquid? Behind the Blue - Team Liquid History Book 5.0.17 Patch Notes - October 7, 2026 Evil Geniuses - shutting down
Tourneys
ISSL (IntoTheTV x SOOP SC2 League): Premier Stellar Fest TWO the Moon (Dec 16-20) Sparkling Tuna Cup - Weekly Open Tournament RSL goes to London! 2026 Offline Finals Nov 21-22 RSL 2026 Offline Finals LCQ Sign-Ups
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[D] the control group Simple Questions/Answers [G] How to playtest arcade maps [A] Nemrods 1/4 players
External Content
Mutation # 550 Graveyard Shift The PondCast: SC2 News & Results Mutation # 549 Endless Sparkles Mutation # 548 Shining Bright
Brood War
General
Rollback Netcode in Brood War Top Players of October 2026 (EBPD Rankings) BW General Discussion Sagi.gg Launcher Released Mathematicians needed to calc "Low Econ Epicness"
Tourneys
[Megathread] Daily Proleagues 2v2v2v2 Tournament Stage 1: Community Poll [IPSL] IPSL Winter 26-27 Ro24 is HERE! [$1250] International ShieldBattery League
Strategy
50,000-Word Terran Builds Memo 2026-10-22 Cliff Jump Revisited (1 in a 1000 strategy) Simple Questions, Simple Answers
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Deus Ex 3!? Mobile Legends: Bang Bang Armies of Exigo - YesYes?
Dota 2
Dota 2 Champions League Season 3 Begins April 25!
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread The Chess Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
Fan Club Resource Thread Reynor Fan Club The Flash Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts
Blogs
Why I built Repalyzer (1.1.…
BlueStar
Innovate or Game Over?
TrAiDoS
ShieldBattery on Mac
Kraekkling
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
Can Bots Beat Pros?? Starcr…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 13009 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
Poland17868 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
Poland17868 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
Poland17868 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
Poland17868 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
Poland17868 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
Monday Night Weeklies
02:00
#68
RotterdaM844
TaKeTV 341
TKL 299
SteadfastSC188
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 844
ByuN 620
TKL 299
SteadfastSC 188
BRAT_OK 60
StarCraft: Brood War
Bisu 948
Shuttle 714
Dewaltoss 131
firebathero 97
ProTech51
HiyA 42
Shinee 33
ToSsGirL 23
Aegong 20
scan(afreeca) 16
[ Show more ]
Sacsri 7
Dota 2
qojqva3194
420jenkins1428
monkeys_forever284
PGG 204
capcasts33
Counter-Strike
gobbtv271
Heroes of the Storm
Liquid`Hasu1404
MindelVK9
Other Games
tarik_tv6080
Grubby3350
Liquid`RaSZi2438
ceh91415
Beastyqt861
mouzStarbuck340
Mlord303
C9.Mang0177
Livibee177
XaKoH 93
Mew2King77
Organizations
Counter-Strike
PGL686
StarCraft: Brood War
lovetv 6
[ Show 16 non-featured ]
StarCraft 2
• Reevou 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Laughngamez YouTube
• Migwel
StarCraft: Brood War
• HerbMon 49
• Eskiya23 18
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV615
League of Legends
• Nemesis3671
Other Games
• imaqtpie585
• Shiphtur527
Upcoming Events
Replay Cast
3h 25m
Rogue vs Classic
Patches Events
17h 25m
PiGosaur Cup
1d 5h
Kung Fu Cup
1d 15h
Replay Cast
2 days
The PondCast
2 days
KCM Race Survival
2 days
IntoTheTV X SOOP
4 days
Reynor vs Solar
ByuN vs SHIN
Clem vs MaxPax
herO vs Rogue
WardiTV Invitational
4 days
IPSL
4 days
WorsT vs nOmaD
Dewalt vs andersOn
[ Show More ]
IntoTheTV X SOOP
5 days
WardiTV Invitational
5 days
IPSL
5 days
Azhi_Dahaki vs ggnore13
Double vs WIZARD
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-11-01
Blizzard Classic Cup 2026
HCC Season 3

Ongoing

Acropolis #5
KCM Race Survival 2026 Season 4
International ShieldBattery League
BSL Season 23
IPSL Winter 2026-27
Proleague 2026-11-02
Calamity Cup Div. A Season 8
IEM Beijing 2026
PGL Masters Bucharest 2026
Stake Ranked Episode 5
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026

Upcoming

1xBet Invitational
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
BLAST Bounty Winter 2027
eXTREMESLAND 2026
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 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.