Does it make sense to always wrap an InputStream as BufferedInputStream, when I know whether the given InputStream is something other than buffered? For e.g:
InputStream is = API.getFromSomewhere()
if(!(is instanceof BufferedInputStream))
return new BufferedInputStream(is);
return is;
Hi -
I'm getting JSON-encoded output from another organization's API.
In many cases, the output can be either an array of objects (if there are many) or an object (if there's just one). Right now I'm writing tortured code like this:
if ( is_array($json['candidateList']['candidate'][0]) ) {
foreach ($json['candidateList']['candidate'] as $candidate) {
// do something to each object
}
}
else {
// do something to the single object
}
How can I handle it so the "do something" part of my code only appears once and uses a standard syntax?
Basically, we want to run static programs compiled on one platform on another.
If it's not possible, what are the most significant changes in the kernel API between version 2.6.9 and 2.6.18?
hello all i am able to connect to facebook through api key from my native iphone application i can also send my post to the facebook through my application but i want to retrive that same post into my application please guide me how could i do that
thanks in advance
If I do --strip-debug or --strip-unneeded, I have the .ko that lists all function names with nm, if I do just strip foo.ko I have a kernel module that refuses to load.
Does anyone know a quick shortcut how to remove all symbols that are not needed for module loading so that people cannot reverse engineer the API:s as easily?
PS: For all you open source bigots; this is something that general public will never be using in any case so no need to turn the question into a GPL flame war.
In Android, how can I apply a style to an API action?
I am using the RingtoneManager.RINGTON_PICKER action to let the user select an alarm, and would like to apply the standard theme that the other child-activities use.
Does anyone know how I can apply a theme? The code I'm using to open the RINGTONE_PICKER is
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
((Activity)mContext).startActivityForResult(intent, BackendConstant.RINGTONE_CODE);
Hi. I'm using the jQuery UI Button control but don't seem to be able to adjust the size (width and height). Here's the API documentation. I tried setting a STYLE attribute on it, but then the LABEL wasn't centered correctly. Thanks.
Is there any way in .NET for a thread to determine its 'parent', i.e. the thread that created it?
I'm diagnosing a timing issue with a black box third party API and would like to find out what custom code of mine it is executing on which thread.
I correctly inserted a javascript file into the wordPress admin with :
wp_enqueue_script()
I know that the script is loading. I tested it with an alert().
I then found that I am unable to access the DOM. When I tried :
document.getElementsByTagName('body')[0].addEventListener('load', function() {});
This error was:
Uncaught TypeError: Cannot call method 'addEventListener' of undefined
This is the first time I have used 'settings api' or inserted scripts into the WordPress admin.
And, does it cache it locally?
I ask because I am wondering if it's possible to change the sound of a push notification via SSH, replacing an app sound.
My question is specifically about how the API for push notifications works. Does it send a .caf (aiff) binary file for the phone to play each time?
Is there a quick way to check whether a path I have is on a local disk or somewhere on the network? I can't just check to see if it's a drive letter vs. UNC, because that would incorrectly identify mapped drives as local. I assumed it would be a boolean in the DirectoryInfo object, but it appears that it's not.
I've found classic VB code to do this check (through an API), but nothing for .NET so far.
I'm using the Google Maps API to build a map full of markers, but I want one marker to stand out from the others. The simplest thing to do, I think, would be to change the color of the marker to blue, instead of red. Is this a simple thing to do or do I have to create a whole new icon somehow? If I do have to create a new icon, what's the easiest way to do that?
Hi,
I'm thinking about using Rx (Reactive Framework) in order to asynchronously query Twitter search API on a given keyword. The sample app I'd like to build should be able to display new tweets in the console.
Do you think it is possible to do that ? Would it be simpler than using standard programming techniques ?
How would you do that ?
Thank !
Jeremy
as topic, I am strange that why does the SDK not provide API to show the UIFont picker ? like the date Picker......
or maybe some open source code is available now ?
Thanks for your help !
Regards
I am trying to store my Google Maps API Key in my application.ini file, and I would like to be able to read it from my controller whenever its needed. How can I go about reading values from the application.ini from my controller?
Thanks!
Hi there.
I need to pass the user name and password in the URL for a REST web services call.
I know that if I pass it this way in Firefox, it works:
https://{UserName}:{Password}@api.opsourcecloud.net/oec/0.9/myaccount
Is there a proper way to pass user name and password aside from the above example?
It's a Spring Security Context?
I'm currently looking into developing Facebook applications and was planning on using Flash as the basis of my application, I have test built some simple PHP Facebook applications and I know enough about action-script 3 to start me on my way, but the API for Facebook development in AS looks far more tedious than the PHP one.
my question is would I be able to create interactive graphics (games) like we see across the web in the HTML5 canvas class? and which would be simpler?
In my Blackberry application, I have a email address I want the user to be able to send an email to. I would like to have the built in Email Application run the compose screen with the "to" field filled in with the email address I supply, similar to how desktop mail clients respond to a "mailto" link. Does the API have a function for this?
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext import db
from google.appengine.api import urlfetch
class TrakHtml(db.Model):
hawb = db.StringProperty(required=False)
htmlData = db.TextProperty()
class MainHandler(webapp.RequestHandler):
def get(self):
Traks = list()
Traks.append('93332134')
#Traks.append('91779831')
#Traks.append('92782244')
#Traks.append('38476214')
for st in Traks :
trak = TrakHtml()
trak.hawb = st
url = 'http://etracking.cevalogistics.com/eTrackResultsMulti.aspx?sv='+st
result = urlfetch.fetch(url)
self.response.out.write(result.read())
trak.htmlData = result.read()
trak.put()
result.read() is not giving whole file , it giving some portion. trak.htmlData is a textproparty() so it have to store whole file and i want that only
Hello,
How can I get java classes from an xml file?
In this situation, I don't have an XML schemma and this way I cant't use JAXB, Castor or other xml binding API as far as I know.
i have to create a program to login on facebook using example http://code.google.com/p/facebook-java-api/wiki/Examples but
when i run project then i get my doFilter method does not call after complete init method please give me solution
I have a site that is mainly showing a paged list of content (articles, data element's, etc.), and I'm wondering about returning HTTP 404 when user navigates outside of the available list range.
Some sites just display "No results/Page number out of range" and some return additionally return HTTP 404 status.
What's your take on that, and why?
UPDATE
It's not and api response. This question is in regard to user viewed pages that among other things show a list/table in the main area.
Hi
I would like to know whether there are any third-party epub reader APIs available on the internet which I can integrate with my iPhone/iPad app? Did a search through Google but couldn't come up with an API/reader which can be integrated within my app.
Would appreciate any help.
Thanks.