• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 11:55
CEST 17:55
KST 00:55
  • 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] Ro16 Preview: Holy Diver1[ASL22] Ro16 Preview: Rough Waters10[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915
Community News
StarCraft open world shooter announced at BlizzCon72Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism10Official StarCraft website teases new content ahead of BlizzCon?172Stellar Fest TWO the Moon (Dec 16-20)9Weekly Cups (August 24-30): Patches' balance mod takes over3
StarCraft 2
General
StarCraft open world shooter announced at BlizzCon How do you feel about the StarCraft shooter announcement at BlizzCon 2026? Balance hotfix patch 5.0.16b (July 16) Team Liquid Map Contest #22: Results and Winners Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament RSL goes to London! 2026 Offline Finals Nov 21-22 KSL Week #92 IntoTheTV X SOOP SC2 League : Weekly & Monthly 2026 GSTL Announcement
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
The PondCast: SC2 News & Results Mutation # 542 The Ascended Mutation # 541 Binary Choice Mutation # 540 Dodge This
Brood War
General
[ASL22] Ro16 Preview: Holy Diver Official StarCraft website teases new content ahead of BlizzCon? ASL22 General Discussion BGH Auto Balance -> http://bghmmr.eu/ Broodwar Prediction Market
Tourneys
[ASL22] Ro16 Group C [ASL22] Ro16 Group B [ASL22] Ro16 Group A Escore Tournament - Season 3
Strategy
Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation Game Theory for Starcraft
Other Games
General Games
Diablo IV Nintendo Switch Thread EVE Corporation [Maplestory Hardcore] Let's Play~!! General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish 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
Community
General
UK Politics Mega-thread US Politics Mega-thread Things Aren’t Peaceful in Palestine Trading/Investing Thread Russo-Ukrainian War Thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Diablo Animated Series on Netflix
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
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Virtual Romance, Real-Life C…
TrAiDoS
Regacy Esports:Our Goa…
regacyesports
Dreaming of BW patches (mod…
c3rberUs
LOCKPICKING NOOB
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 6536 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
Poland17843 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
Poland17843 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
Poland17843 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
Poland17843 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
Poland17843 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 5m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 587
Tasteless 173
Rex 104
SHIN 62
RotterdaM 19
Railgan 16
StarCraft: Brood War
Britney 42888
Calm 5624
Jaedong 924
PianO 681
firebathero 337
Shuttle 249
ggaemo 220
Artosis 186
910 91
Bonyth 72
[ Show more ]
Mini 66
Sea.KH 63
Mong 60
Hyun 57
Liquid`Ret 45
sSak 38
Sharp 26
Trap 23
Rock 20
HiyA 15
Hm[arnc] 14
SilentControl 11
Shine 8
Dota 2
qojqva3882
syndereN873
Fuzer 272
LuMiX1
Super Smash Bros
Mew2King103
Heroes of the Storm
MindelVK6
Liquid`Hasu1
Other Games
Grubby3241
Liquid`RaSZi1318
singsing1301
Hui .187
QueenE139
Organizations
Other Games
EGCTV1308
StarCraft 2
StarCraft495
Heroes of the Storm
Heroes of the Storm377
Other Games
gamesdonequick280
StarCraft 2
ComeBackTV 90
StarCraft: Brood War
Afreeca ASL 53
Kim Chul Min (afreeca) 15
[ Show 15 non-featured ]
StarCraft 2
• StrangeGG 85
• Adnapsc2 36
• mYiSmile136
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• Michael_bg 11
• FirePhoenix8
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis3806
Other Games
• Shiphtur158
Upcoming Events
RSL Revival
5m
Serral vs Rogue
BlizzCon
2h 35m
IdrA vs MC
Afreeca Starleague
18h 5m
Light vs JyJ
Soulkey vs hero
WardiTV Weekly
19h 5m
Monday Night Weeklies
1d
Afreeca Starleague
1d 18h
Snow vs Shinee
Shine vs EffOrt
GSL
1d 19h
PiGosaur Cup
2 days
The PondCast
2 days
Kung Fu Cup
2 days
[ Show More ]
Replay Cast
3 days
KCM Race Survival
3 days
IntoTheTV X SOOP
3 days
Replay Cast
4 days
IntoTheTV X SOOP
4 days
Replay Cast
5 days
GSL
5 days
Replay Cast
6 days
GSL
6 days
Shopify Rebellion Sundays
6 days
Spirit vs Mixu
Liquipedia Results

Completed

Acropolis #5 - TRS
PiG Sty Festival 8.0
Big Dog Cup 2026 Div 1

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Acropolis #5
Blizzard Classic Cup 2026
Blizzard Classic Cup 2026
RSL Revival: Season 6
Calamity Invitational
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026

Upcoming

Acropolis #5 - GSA
Acropolis #5 - GSB
Acropolis #5 - GSC
SC4ALL II: Brood War
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
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
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.