dasd.doc

Upload: tiago-almeida

Post on 14-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 dasd.doc

    1/8

    ading documentation, being familiar with the API, or Google.permalink[]linux_gamer 11 points 2 hours agoDiligent study, just like you're doing.permalink[]negative_epsilon 11 points 2 hours agoYou don't figure it out from scratch, you Google such a specific question and click the first link.How did he figure it out? He might have also Googled it somewhere and found it elsewhere. Originally, the first person to discover this probably knew from experience (And googling/looking at the docs) that ConfigurationInfo getDeviceConfigurationInfo() is the place to get all sorts of configuration information (Go figure!), and he went to the documentation of ConfigurationInfo to find this field:public int reqGlEsVersionAdded in API level 4The GLES version used by an application. The upper order 16 bits represent the major version and the lower order 16 bits the minor version.Or, you could probably use this function, as per that same page:public String getGlEsVersion ()Added in API level 4This method extracts the major and minor version of reqGLEsVersion attribute andreturns it as a string. Say reqGlEsVersion value of 0x00010002 is returned as 1.2Returns

    String representation of the reqGlEsVersion attributepermalink[]undetected_error 4 points 2 hours agoFamiliarity. You can't just walk into an API and automatically know exactly whatit contains and/or how to use it. It takes time to get familiar with an API (orany code for that matter.)permalink[]LFReason 4 points 2 hours agohttp://developer.android.com/guide/components/index.htmlthese guides?permalink[]amazing_rando 3 points 2 hours ago*Either you look it up online where someone eading documentation, being familiar

    with the API, or Google.permalink[]linux_gamer 11 points 2 hours agoDiligent study, just like you're doing.permalink[]negative_epsilon 11 points 2 hours agoYou don't figure it out from scratch, you Google such a specific question and click the first link.How did he figure it out? He might have also Googled it somewhere and found it elsewhere. Originally, the first person to discover this probably knew from experience (And googling/looking at the docs) that ConfigurationInfo getDeviceConfigurationInfo() is the place to get all sorts of configuration information (Go figure!), and he went to the documentation of ConfigurationInfo to find this field:

    public int reqGlEsVersionAdded in API level 4The GLES version used by an application. The upper order 16 bits represent the major version and the lower order 16 bits the minor version.Or, you could probably use this function, as per that same page:public String getGlEsVersion ()Added in API level 4This method extracts the major and minor version of reqGLEsVersion attribute andreturns it as a string. Say reqGlEsVersion value of 0x00010002 is returned as 1.2

  • 7/29/2019 dasd.doc

    2/8

    ReturnsString representation of the reqGlEsVersion attributepermalink[]undetected_error 4 points 2 hours agoFamiliarity. You can't just walk into an API and automatically know exactly whatit contains and/or how to use it. It takes time to get familiar with an API (orany code for that matter.)permalink[]LFReason 4 points 2 hours agohttp://developer.android.com/guide/components/index.htmlthese guides?permalink[]amazing_rando 3 points 2 hours ago*Either you look it up online where someone else has already done it, or you readthe API documentation, which will tell you:how to get supported OpenGL ES versions, and how that data is formatted (it's from ConfigurationInfo)how to get your device's configuration info (it comes from ActivityManager)how to get your system's activity manager (you call getSystemService with a string that says what to return)where to find that string (it's in Context)Basically, working backwards from what you want to find out how to get it. Theneventually you become more familiar with the API and you don't need to look things up, and as you become familiar with more APIs you get a feel for how people t

    end to organize things, so looking things up isn't as time consuming. But unlessyou're doing a whole lot of programming with that particular API you're probably never going to get it all memorized, and it probably doesn't make sense to try.But, with almost any common task in programming, you can search for it and findmultiple solutions, arguments over which solution is the most correct, and arguments over whether it's something you should even be doing in the first place.permalink[]get_username 3 points 2 hours agoLets break this down and look at it some.final ActivityManager activityManager = (ActivityManager) ...Often in Java when people cast like that, they are casting up and down a hierarchy tree. Meaning that ActivityManager is most likely a subclass of whatever getS

    ystemService(Context.ACTIVITY_SERVICE) returns.Once you get more familiar with Java you'll start to realize that interfaces areused everywhere. As such whenever you perform an action like getSystemService(Context.ACTIVITY_SERVICE) you'll be returned some highly generic version that will only do the basic function.So instead people cast to get the specific class they want.Furthermore this implies that we knew somewhere down the road that Context contained a ACTIVITY_SERVICE constant that we wanted to use.How do we know to use it? Well we have previous experience with the API, that isall.final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();How did they know to do that? Well they understood the API of activityManager, a

    nd knew they could get a configurationInfo that was stored in there by accessingthe getDeviceConfigurationInfo method.In short. I am going to keep giving the same answer. It is all about the API you're using and what you know is inside of it.You only know to do these things when you get more familiar with the API and canplay with it. Until then you'll just have to play with the API and see what things do.permalink[]xihonyx[S] 2 points 2 hours agoGotcha. I almost feel like there should be a reverse lookup table somewhere.

  • 7/29/2019 dasd.doc

    3/8

    Say I found the ConfigurationInfo class which I can use to pull configuration information from the device and determine if OpenGL ES 2.0 equals 0x20000.Is there a way to search through every method within the API that takes an instance of the ConfigurationInfo class and use the keyword: "configuration"?permalinkparent[]get_username 1 point 2 hours agoMost frameworks and languages have some kind of API that you can look up.Even better when you're in Eclipse IDE using Java you will often type a namemyvar.someMethod()and the local API will open and tell you what it is. Then you can click on thatand go inspect the class yourself.permalinkparent[]BarelyComical 2 points 1 hour agoI understand how the code works...Well there's your problem. You're spending too much understanding stuff. Shit like this should be Googled and forgotten immediately.permalink[]casualblair 1 point 2 hours agoThis is called problem solving. I'm not being condescending, this is a skill many people lack.You can do this in three ways. The first (googling) tends to fail because you don't know what the correct question to ask is. You may be missing a key term or word that describes the issue. You may simply be too unfamiliar with the work that your searches are either too specific or too vague.

    You at this point have two options: find out the question and ask for the answeror find out the answer and ask the question.I do this frequently in my work. I customize 3rd party software and it's my jobto take obscure non-documented applications and tweak them to suit the needs ofthe people I work for. Maybe it's having two databases talk to each other when certain data is updated. Maybe it's bypassing a constraint in the default system.Maybe it's imposing a constraint on the default system that isn't available.Start with what you want to do and start browsing and tracing and interacting with the system until you find something that appears to work. Then ask the question. Or test the living shit out of it until you are confident it is correct andask if it is the answer.Sometimes there is no one to talk to.permalink

    []corecollapse 1 point 46 minutes agoStackoverflow, api docs, Blogs, books, coworkers, open source code.permalink[]CedricCicada 1 point 2 hours agoBy reading something. Maybe there's documentation provided with the library. Maybe it was in a book. Maybe he asked a question on the Internet.permalink[]Milumet 0 points 2 hours agoBy reading the documentation.It is truly baffling that you have to tell people things like this.permalink[]xiipaoc 0 points 2 hours agoHonestly... the way you did it just now. Read someone else's code and see what t

    hey did. They probably synthesized it from things they picked up reading other people's code, possibly even in another language, and they probably synthesized it similarly, etc. Most of how I deal with unfamiliar actions at my job is seeinghow other people did it. Of course, this tends to perpetuate old and bad code,but you can break out of that if you recognize the code as bad and try to figureout ways to make it better.permalink[]adventuretimeXD 0 points 31 minutes agoUsually I just query my unique in-ear transponder...If your's is acting up our you never had one installed, I would contract my OEM.

  • 7/29/2019 dasd.doc

    4/8

    ..ading documentation, being familiar with the API, or Google.permalink[]linux_gamer 11 points 2 hours agoDiligent study, just like you're doing.permalink[]negative_epsilon 11 points 2 hours agoYou don't figure it out from scratch, you Google such a specific question and click the first link.How did he figure it out? He might have also Googled it somewhere and found it elsewhere. Originally, the first person to discover this probably knew from experience (And googling/looking at the docs) that ConfigurationInfo getDeviceConfigurationInfo() is the place to get all sorts of configuration information (Go figure!), and he went to the documentation of ConfigurationInfo to find this field:public int reqGlEsVersionAdded in API level 4The GLES version used by an application. The upper order 16 bits represent the major version and the lower order 16 bits the minor version.Or, you could probably use this function, as per that same page:public String getGlEsVersion ()Added in API level 4This method extracts the major and minor version of reqGLEsVersion attribute andreturns it as a string. Say reqGlEsVersion value of 0x00010002 is returned as 1.2Returns

    String representation of the reqGlEsVersion attributepermalink[]undetected_error 4 points 2 hours agoFamiliarity. You can't just walk into an API and automatically know exactly whatit contains and/or how to use it. It takes time to get familiar with an API (orany code for that matter.)permalink[]LFReason 4 points 2 hours agohttp://developer.android.com/guide/components/index.htmlthese guides?permalink[]amazing_rando 3 points 2 hours ago*Either you look it up online where someone else has already done it, or you read

    the API documentation, which will tell you:how to get supported OpenGL ES versions, and how that data is formatted (it's from ConfigurationInfo)how to get your device's configuration info (it comes from ActivityManager)how to get your system's activity manager (you call getSystemService with a string that says what to return)where to find that string (it's in Context)Basically, working backwards from what you want to find out how to get it. Theneventually you become more familiar with the API and you don't need to look things up, and as you become familiar with more APIs you get a feel for how people tend to organize things, so looking things up isn't as time consuming. But unlessyou're doing a whole lot of programming with that particular API you're probably never going to get it all memorized, and it probably doesn't make sense to try

    .But, with almost any common task in programming, you can search for it and findmultiple solutions, arguments over which solution is the most correct, and arguments over whether it's something you should even be doing in the first place.permalink[]get_username 3 points 2 hours agoLets break this down and look at it some.final ActivityManager activityManager = (ActivityManager) ...Often in Java when people cast like that, they are casting up and down a hierarchy tree. Meaning that ActivityManager is most likely a subclass of whatever getS

  • 7/29/2019 dasd.doc

    5/8

    ystemService(Context.ACTIVITY_SERVICE) returns.Once you get more familiar with Java you'll start to realize that interfaces areused everywhere. As such whenever you perform an action like getSystemService(Context.ACTIVITY_SERVICE) you'll be returned some highly generic version that will only do the basic function.So instead people cast to get the specific class they want.Furthermore this implies that we knew somewhere down the road that Context contained a ACTIVITY_SERVICE constant that we wanted to use.How do we know to use it? Well we have previous experience with the API, that isall.final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();How did they know to do that? Well they understood the API of activityManager, and knew they could get a configurationInfo that was stored in there by accessingthe getDeviceConfigurationInfo method.In short. I am going to keep giving the same answer. It is all about the API you're using and what you know is inside of it.You only know to do these things when you get more familiar with the API and canplay with it. Until then you'll just have to play with the API and see what things do.permalink[]xihonyx[S] 2 points 2 hours agoGotcha. I almost feel like there should be a reverse lookup table somewhere.Say I found the ConfigurationInfo class which I can use to pull configuration in

    formation from the device and determine if OpenGL ES 2.0 equals 0x20000.Is there a way to search through every method within the API that takes an instance of the ConfigurationInfo class and use the keyword: "configuration"?permalinkparent[]get_username 1 point 2 hours agoMost frameworks and languages have some kind of API that you can look up.Even better when you're in Eclipse IDE using Java you will often type a namemyvar.someMethod()and the local API will open and tell you what it is. Then you can click on thatand go inspect the class yourself.permalinkparent[]BarelyComical 2 points 1 hour agoI understand how the code works...

    Well there's your problem. You're spending too much understanding stuff. Shit like this should be Googled and forgotten immediately.permalink[]casualblair 1 point 2 hours agoThis is called problem solving. I'm not being condescending, this is a skill many people lack.You can do this in three ways. The first (googling) tends to fail because you don't know what the correct question to ask is. You may be missing a key term or word that describes the issue. You may simply be too unfamiliar with the work that your searches are either too specific or too vague.You at this point have two options: find out the question and ask for the answeror find out the answer and ask the question.I do this frequently in my work. I customize 3rd party software and it's my job

    to take obscure non-documented applications and tweak them to suit the needs ofthe people I work for. Maybe it's having two databases talk to each other when certain data is updated. Maybe it's bypassing a constraint in the default system.Maybe it's imposing a constraint on the default system that isn't available.Start with what you want to do and start browsing and tracing and interacting with the system until you find something that appears to work. Then ask the question. Or test the living shit out of it until you are confident it is correct andask if it is the answer.Sometimes there is no one to talk to.permalink

  • 7/29/2019 dasd.doc

    6/8

    []corecollapse 1 point 46 minutes agoStackoverflow, api docs, Blogs, books, coworkers, open source code.permalink[]CedricCicada 1 point 2 hours agoBy reading something. Maybe there's documentation provided with the library. Maybe it was in a book. Maybe he asked a question on the Internet.permalink[]Milumet 0 points 2 hours agoBy reading the documentation.It is truly baffling that you have to tell people things like this.permalink[]xiipaoc 0 points 2 hours agoHonestly... the way you did it just now. Read someone else's code and see what they did. They probably synthesized it from things they picked up reading other people's code, possibly even in another language, and they probably synthesized it similarly, etc. Most of how I deal with unfamiliar actions at my job is seeinghow other people did it. Of course, this tends to perpetuate old and bad code,but you can break out of that if you recognize the code as bad and try to figureout ways to make it better.permalink[]adventuretimeXD 0 points 31 minutes agoUsually I just query my unique in-ear transponder...If your's is acting up our you never had one installed, I would contract my OEM... how that data is formatted (it's from ConfigurationInfo)

    how to get your device's configuration info (it comes from ActivityManager)how to get your system's activity manager (you call getSystemService with a string that says what to return)where to find that string (it's in Context)Basically, working backwards from what you want to find out how to get it. Theneventually you become more familiar with the API and you don't need to look things up, and as you become familiar with more APIs you get a feel for how people tend to organize things, so looking things up isn't as time consuming. But unlessyou're doing a whole lot of programming with that particular API you're probably never going to get it all memorized, and it probably doesn't make sense to try.But, with almost any common task in programming, you can search for it and findmultiple solutions, arguments over which solution is the most correct, and argum

    ents over whether it's something you should even be doing in the first place.permalink[]get_username 3 points 2 hours agoLets break this down and look at it some.final ActivityManager activityManager = (ActivityManager) ...Often in Java when people cast like that, they are casting up and down a hierarchy tree. Meaning that ActivityManager is most likely a subclass of whatever getSystemService(Context.ACTIVITY_SERVICE) returns.Once you get more familiar with Java you'll start to realize that interfaces areused everywhere. As such whenever you perform an action like getSystemService(Context.ACTIVITY_SERVICE) you'll be returned some highly generic version that will only do the basic function.So instead people cast to get the specific class they want.

    Furthermore this implies that we knew somewhere down the road that Context contained a ACTIVITY_SERVICE constant that we wanted to use.How do we know to use it? Well we have previous experience with the API, that isall.final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();How did they know to do that? Well they understood the API of activityManager, and knew they could get a configurationInfo that was stored in there by accessingthe getDeviceConfigurationInfo method.In short. I am going to keep giving the same answer. It is all about the API you

  • 7/29/2019 dasd.doc

    7/8

    're using and what you know is inside of it.You only know to do these things when you get more familiar with the API and canplay with it. Until then you'll just have to play with the API and see what things do.permalink[]xihonyx[S] 2 points 2 hours agoGotcha. I almost feel like there should be a reverse lookup table somewhere.Say I found the ConfigurationInfo class which I can use to pull configuration information from the device and determine if OpenGL ES 2.0 equals 0x20000.Is there a way to search through every method within the API that takes an instance of the ConfigurationInfo class and use the keyword: "configuration"?permalinkparent[]get_username 1 point 2 hours agoMost frameworks and languages have some kind of API that you can look up.Even better when you're in Eclipse IDE using Java you will often type a namemyvar.someMethod()and the local API will open and tell you what it is. Then you can click on thatand go inspect the class yourself.permalinkparent[]BarelyComical 2 points 1 hour agoI understand how the code works...Well there's your problem. You're spending too much understanding stuff. Shit like this should be Googled and forgotten immediately.permalink

    []casualblair 1 point 2 hours agoThis is called problem solving. I'm not being condescending, this is a skill many people lack.You can do this in three ways. The first (googling) tends to fail because you don't know what the correct question to ask is. You may be missing a key term or word that describes the issue. You may simply be too unfamiliar with the work that your searches are either too specific or too vague.You at this point have two options: find out the question and ask for the answeror find out the answer and ask the question.I do this frequently in my work. I customize 3rd party software and it's my jobto take obscure non-documented applications and tweak them to suit the needs ofthe people I work for. Maybe it's having two databases talk to each other when certain data is updated. Maybe it's bypassing a constraint in the default system.

    Maybe it's imposing a constraint on the default system that isn't available.Start with what you want to do and start browsing and tracing and interacting with the system until you find something that appears to work. Then ask the question. Or test the living shit out of it until you are confident it is correct andask if it is the answer.Sometimes there is no one to talk to.permalink[]corecollapse 1 point 46 minutes agoStackoverflow, api docs, Blogs, books, coworkers, open source code.permalink[]CedricCicada 1 point 2 hours agoBy reading something. Maybe there's documentation provided with the library. Maybe it was in a book. Maybe he asked a question on the Internet.

    permalink[]Milumet 0 points 2 hours agoBy reading the documentation.It is truly baffling that you have to tell people things like this.permalink[]xiipaoc 0 points 2 hours agoHonestly... the way you did it just now. Read someone else's code and see what they did. They probably synthesized it from things they picked up reading other people's code, possibly even in another language, and they probably synthesized it similarly, etc. Most of how I deal with unfamiliar actions at my job is seeing

  • 7/29/2019 dasd.doc

    8/8

    how other people did it. Of course, this tends to perpetuate old and bad code,but you can break out of that if you recognize the code as bad and try to figureout ways to make it better.permalink[]adventuretimeXD 0 points 31 minutes agoUsually I just query my unique in-ear transponder...If your's is acting up our you never had one installed, I would contract my OEM...