Search Results

Search found 12426 results on 498 pages for 'selectors api'.

Page 10/498 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Access static enum fields using JNI invocation API

    - by Xinus
    How can we access static enum fields using JNI invocation API I am trying to access glassfish org.glassfish.api.embedded.ContainerBuilder.Type enumeration from Glassfish api using following code jclass Type= env->FindClass( "org/glassfish/api/embedded/ContainerBuilder$Type"); jfieldID Type_web=env->GetStaticFieldID( Type,"web","org/glassfish/api/embedded/ContainerBuilder$Type"); But it always gives me error as Exception in thread "main" java.lang.NoSuchFieldError: web, How can I access that field ?

    Read the article

  • How do I manage the technical debate over WCF vs. Web API?

    - by Saeed Neamati
    I'm managing a team of like 15 developers now, and we are stuck at a point on choosing the technology, where the team is broken into two completely opposite teams, debating over usage of WCF vs. Web API. Team A which supports usage of Web API, brings forward these reasons: Web API is just the modern way of writing services (Wikipedia) WCF is an overhead for HTTP. It's a solution for TCP, and Net Pipes, and other protocols WCF models are not POCO, because of [DataContract] & [DataMember] and those attributes SOAP is not as readable and handy as JSON SOAP is an overhead for network compared to JSON (transport over HTTP) No method overloading Team B which supports the usage of WCF, says: WCF supports multiple protocols (via configuration) WCF supports distributed transactions Many good examples and success stories exist for WCF (while Web API is still young) Duplex is excellent for two-way communication This debate is continuing, and I don't know what to do now. Personally, I think that we should use a tool only for its right place of usage. In other words, we'd better use Web API, if we want to expose a service over HTTP, but use WCF when it comes to TCP and Duplex. By searching the Internet, we can't get to a solid result. Many posts exist for supporting WCF, but on the contrary we also find people complaint about it. I know that the nature of this question might sound arguable, but we need some good hints to decide. We're stuck at a point where choosing a technology by chance might make us regret it later. We want to choose with open eyes. Our usage would be mostly for web, and we would expose our services over HTTP. In some cases (say 5 to 10 percent) we might need distributed transactions though. What should I do now? How do I manage this debate in a constructive way?

    Read the article

  • What is the correct term for - server/client database sync via API?

    - by Daniel
    Forgive the vague question title. I've been programming mobile apps for 3 years now, and I've got a little too far from the web services and server side code then I probably should have. Anyway, I'm doing a personal project now and I want to create an web API for it. One of my requirements is to check for updates from my app, so I would send a timestamp to the API. I've used many APIs that my clients prepared for me and only now am I appreciating their work ! What is the term or technique used to create an API backed by a database which tracks changes via dates/timestamps, basically an effective way for me to query changes occurring since a timestamp. Simply put, I want that my app can call my API in order to sync new data and changed data from the server, to the app. The app would only have a timestamp of the last time it synced with the server. Would I have a log table for each data table in my database which adds a record for each change? Then I could query all changes with a timestamp superior to the one passed to the API. Can anyone point me in the right direction on this?

    Read the article

  • Ubuntu One API Java - how to use REST and AccessToken?

    - by Michael
    I am writing a java app in eclipse that backups data to several consumer-cloud-services encrypted and redundant. So far, I successfully implemented the authentication process, as it is described in the documentation. At this point, I do not know how to proceed. The next step would be implementing the auth with the stored AccessToken and afterwars implementing upload/download/listing functionality through the REST API. I think I have to store the String oauth.getSerialized(). How do I authenticate with this String afterwards? This does not work e.g.: AuthenticateResponse oauth = api.authenticate(serialized); api.setAuthorizer(new OAuthAuthorizer(oauth)); Can someone tell me please, how I can use the REST API with java? There is no explanation or link in the developers area as far as I saw. And btw, I wasted at least one hour trying to fix errors, because some needed libraries are listet after the example code. :/

    Read the article

  • Will GMails Greasemoney API help me: composing and sending messages, adding a button to the compose view, listing and sending drafts [migrated]

    - by Kent
    I want to create a Greasemonkey script for GMail and I've browsed through the GMail Greasemonkey 1.0 API documentation. I haven't fully understood what the API actually provides, which leads me to ask a few concrete questions. How will the API help if I want to: Add a button to the Compose view which executes some of my code. Compose and send a new message from scratch. List the current drafts. Pick a draft and send it. From what I can see it'll help me with 1 above, but I don't see any real interaction API parts which can help me with 2-4.

    Read the article

  • Should static parameters in an API be part of each method?

    - by jschoen
    I am currently creating a library that is a wrapper for an online API. The obvious end goal is to make it as easy for others to use as possible. As such I am trying to determine the best approach when it comes to common parameters for the API. In my current situation there are 3 (consumer key, consumer secret, and and authorization token). They are essentially needed in every API call. My question is should I make these 3 parameters required for each method or is there a better way. I see my current options as being: Place the parameters in each method call public ApiObject callMethod(String consumerKey, String consumerSecret, String token, ...) This one seems reasonable, but seems awfully repetitive to me. Create a singleton class that the user must initialize before calling any api methods. This seems wrong, and would essentially limit them to accessing one account at a time via the API (which may be reasonable, I dunno). Make them place them in a properties file in their project. That way I can load the properties that way and store them. This seems similar to the singleton to me, but they would not have to explicitly call something to initialize these values. Is there another option I am not seeing, or a more common practice in this situation that I should be following?

    Read the article

  • REST API Best practice: How to accept as input a list of parameter values

    - by whatupwilly
    Hi All, We are launching a new REST API and I wanted some community input on best practices around how we should have input parameters formatted: Right now, our API is very JSON-centric (only returns JSON). The debate of whether we want/need to return XML is a separate issue. As our API output is JSON centric, we have been going down a path where our inputs are a bit JSON centric and I've been thinking that may be convenient for some but weird in general. For example, to get a few product details where multiple products can be pulled at once we currently have: http://our.api.com/Product?id=["101404","7267261"] Should we simplify this as: http://our.api.com/Product?id=101404,7267261 Or is having JSON input handy? More of a pain? We may want to accept both styles but does that flexibility actually cause more confusion and head aches (maintainability, documentation, etc.)? A more complex case is when we want to offer more complex inputs. For example, if we want to allow multiple filters on search: http://our.api.com/Search?term=pumas&filters={"productType":["Clothing","Bags"],"color":["Black","Red"]} We don't necessarily want to put the filter types (e.g. productType and color) as request names like this: http://our.api.com/Search?term=pumas&productType=["Clothing","Bags"]&color=["Black","Red"] Because we wanted to group all filter input together. In the end, does this really matter? It may be likely that there are so many JSON utils out there that the input type just doesn't matter that much. I know our javascript clients making AJAX calls to the API may appreciate the JSON inputs to make their life easier. Thanks, Will

    Read the article

  • retrieve events where uid is the creator and application id is the admin - Facebook API

    - by Anup Parekh
    I would like to know if there is a Facebook API call to retrieve the events (eids) for all the events a user has created using my facebook connect application. The events are created using the following REST api call: https://api.facebook.com/method/events.create?event_info=' . $e_i . '&access_token=' . $cookie['access_token'] $e_i is the event info array where the 'host' value is set to 'Me' as follows $event_info['host'] = 'Me'; On Facebook events under the "Created by:" section it lists "My user name,Application Name", I presume this is because I am the creator and the application is the admin as stated in the REST api documentation http://developers.facebook.com/docs/reference/rest/events.create/ Unfortunately I cannot seem to find out how (neither REST nor GPRAPH API) to return a list of events where I am the creator and the application is the admin as in the above scenario. If this is possible I would really appreciate some assistance with how it is done. So far I have tried: REST API events.get using uid=application_id. This only returns events created by the application not those including the user who created them GRAPH API https://graph.facebook.com/me/events?fields=owner&access_token=... this returns all the events for 'me' but not where the application is also the admin. It seems strange that there's no reference to the linkage between the event creator and the event admin through the API but in Facebook it is able to pull both and display them on the event details.

    Read the article

  • Routing trouble for RESTful API - Rails

    - by aressidi
    I'm building out an API for web app that I've been working on for some time. I've started with the User model. The user portion of the API will allow remote clients to a) retrieve user data, b) update user information and c) create new users. I've gotten all of this to work, but it doesn't seem like its setup correctly. Here are my questions: Should the API endpoint be users or user? What's the best practice? I have to add the action to the end, which I would expect to be picked up instead by the request type so I don't have to specify it explicitly. How do I get my routes setup properly as not to have to include the method for protected actions? Let me give some examples: Get request for show - want it to work without the "show" curl -u rmbruno:blah http://app.local/api/users/show Put request for update - want it to work without the "update" curl -X put -F 'user[forum_notifications]=true' -u rmbruno:blah http://app.local/api/users/update Create - works with or without 'create' which is what I want for all these actions curl -X post -F 'user[login]=mamafatta' -F 'user[email][email protected]' -F 'user[password]=12345678' http://twye.local/api/users/ How do I structure routes to not require the action name? Isn't that the common way to to RESTful APIs? Here is my route for the API now: map.namespace :api do |route| route.resources :users route.resources :weight end I'm using restful authentication which is handling the http auth in curl. Any guidance on the routes issues and best practice on singular versus plural would be really helpful. Thanks! -A

    Read the article

  • Parsing back to 'messy' API strcuture

    - by Eric Fail
    I'm fetching data from an online database (REDcap) via API and the data gets delivered in as comma separated string like this, RAW.API <- structure("id,event_arm,name,dob,pushed_text,pushed_calc,complete\n\"01\",\"event_1_arm_1\",\"John\",\"1979-05-01\",\"\",\"\",2\n\"01\",\"event_2_arm_1\",\"John\",\"2012-09-02\",\"abc\",\"123\",1\n\"01\",\"event_3_arm_1\",\"John\",\"2012-09-10\",\"\",\"\",2\n\"02\",\"event_1_arm_1\",\"Mary\",\"1951-09-10\",\"def\",\"456\",2\n\"02\",\"event_2_arm_1\",\"Mary\",\"1978-09-12\",\"\",\"\",2\n", "`Content-Type`" = structure(c("text/html", "utf-8"), .Names = c("", "charset"))) I have this script that nicely parses it into a data frame, (df <- read.table(file = textConnection(RAW.API), header = TRUE, sep = ",", na.strings = "", stringsAsFactors = FALSE)) id event_arm name dob pushed_text pushed_calc complete 1 1 event_1_arm_1 John 1979-05-01 <NA> NA 2 2 1 event_2_arm_1 John 2012-09-02 abc 123 1 3 1 event_3_arm_1 John 2012-09-10 <NA> NA 2 4 2 event_1_arm_1 Mary 1951-09-10 def 456 2 5 2 event_2_arm_1 Mary 1978-09-12 <NA> NA 2 I then do some calculations and write them to pushed_text and pushed_calc whereafter I need to format the data back to the messy comma separated structure it came in. I imagine something like this, API.back <- `some magic command`(df, ...) identical(RAW.API, API.back) [1] TRUE Some command that can format my data from the data frame I made, df, back to the structure that the raw API-object came in, RAW.API. Any help would be very appreciated.

    Read the article

  • How to select text, but not images, in CSS

    - by thinkswan
    Simple question: I have the following markup... <a href='#'> <img src='icon.png'> This is the link </a> I want to have the text become underlined on mouseover. What is the CSS selector for selecting only the text in that <a> element and nothing else? I'd rather not wrap it in anything if I don't have to. a:hover { text-decoration: none; } a:hover <select_text_here> { text-decoration: underline; }

    Read the article

  • Selector and Iterating Through a Table Within a Div

    - by GregH
    I have been working on this and cannot get this iterator to work. I have the following HTML and am trying to iterate through all rows (except the first row) and extract the values in cells (td) 2 and 3 : <div id="statsId"> <table width="220" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td width="65"/> <td width="90"/> <td width="65"/> </tr> <tr style="font-weight: bold;"> <td align="left">$1.00</td> <td> <a href="#">UserID1</a> </td> <td>Single</td> </tr> <tr> <td align="left">$6.99</td> <td> <a href="#">UserID2</a> </td> <td>Multiple</td> </tr> <tr>... .....(snip) I tried the following iterator to iterate through all except the first row of the table that is a child of "div#statsID" and get the values of the 2nd and 3rd cells (in the example, the first extracted cells would have values of "UserID1" and "Single"), but it doesn't work. $('div#statsId > table tr:not(:nth-child(1))').each(function(i, ele) { var secondCol = $('td:nth-child(2)', ele).innerHTML var thirdCol= $('td:nth-child(3)', ele).text() ..... }); Any suggestions on how to specify and iterate through the rows (except the first) of a table that is a child of a div would be appreciated.

    Read the article

  • Add a wall post to a page or application wall as page or application with facebook graph API

    - by blauesocke
    Hi, I wan't to create a new wall post on a appliaction page or a "normal" page with the facebook graph API. Is there a way to "post as page"? With the old REST-API it worked like this: $facebook->api_client->stream_publish($message, NULL, $links, $targetPageId, $asPageId); So, if I passed equal IDs for $targetPageId and $asPageId I was able to post a "real" wall post not caused by my own facebook account. Thanks!

    Read the article

  • Is Google Maps API V3 good enough to use now?

    - by Haroldo
    Firstly, only reply if you have experience using API V3 (i can speculate myself!) I had a little go with V3 and it looked great but would love to hear from someone who's given it a bit of use before I start working with it and deploy it on a live site. I'm only looking to do very basic things: put markers on a map custom markers info bubbles It all looks very easy with v3: http://www.svennerberg.com/2009/06/google-maps-api-3-the-basics/ is it stable enough?

    Read the article

  • jQuery :contains selector to search for multiple strings

    - by Stefan
    Assuming i have: <li id="1">Mary</li> <li id="2">John, Mary, Dave</li> <li id="3">John, Dave, Mary</li> <li id="4">John</li> If i need to find all <li> Elements which contain "John" and "Mary", how would i construct the jQuery? A search for a single string seems easy: $('li:contains("John")').text() I am looking for something like the following pseudo code: $('li:contains("John")' && 'li:contains("Mary")').text() Thanks!

    Read the article

  • How to create a css rule for all elements except one class?!

    - by Nick
    Hi, I have created a CSS stylesheet for my project. Is there any way I can create a css rule that applies to all table elements EXCEPT table elements belonging to the class "dojoxGrid"? Something like: .not(dojoxGrid) table{ width:100%; border-top:1px solid #dddddd; border-left:1px solid #dddddd; border-right:1px solid #dddddd; margin:1em auto; border-collapse:collapse; } Thanks in advance!

    Read the article

  • $().mouseMove <-- Empty selector in jQuery 1.4

    - by Matrym
    The following bit of code breaks in the upgrade to jquery 1.4: $().mousemove( function (e) { defaults.mouseX = e.pageX; defaults.mouseY = e.pageY; }); }; What appeared to be a reasonable fix was adding "html" as the selector, ex: $("html"). The fix works fine - except now when the user mouses off the page, it doesn't register the mouse position beyond the boundaries. When attempting to use the mouse position for a drag, for example, the amount of movement beyond the screen is really important. Anyone got any ideas? Thanks in advance.

    Read the article

  • JQuery: Selector that contains some text, but doesn't contain others

    - by BPotocki
    Sorry if this question is mind numbingly easy to answer, but I'm a bit new to JQuery and I have a tight deadline. I am looking for a selector for textbox elements that have this format: id = "FixedName_#" "FixedName" will always be "FixedName", but I only want to find elements where the # is positive. So I would want to find "FixedName_1", and "FixedName_2" for example, but skip over "FixedName_-1" and "FixedName_-2". Thanks!

    Read the article

  • jquery select one class from many

    - by simnom
    Hi, I'm trying to achieve the following functionality. Within a form I have multiple fields with the class name .inputField if one of these fields is selected then the div associated with that element should be shown on focus and hidden on blur. However, when I implement the code below on selecting the second element the class is applied to both. Not sure where I'm going wrong?!?!? html markup: <form class="friendlyForm" name="friendlyForm" id="friendlyForm"> <ul> <li> <label for="testField">Test field</label> <input name="testField" value="here" class="inputField" id="testField" /> <div class="helper" style="display: none;">helper text here</div> </li> <li> <label for="testField">Test field2</label> <input name="testField2" value="here" class="inputField" id="testField2" /> <div class="helper" style="display: none;">helper text here</div> </li> </ul> </form> jQuery markup: $('.friendlyForm').find('.inputField').each(function(i) { $(this).blur(); $(this).focus(function() { //Add the focus class and fadeIn the helper div $(this).parent().addClass('focus'); $(this).parent().parent().find('.helper').fadeIn(); }); $(this).blur(function () { //Remove the focus class and fadeOut helper div $(this).parent().removeClass('focus'); $(this).parent().parent().find('.helper').fadeOut(); }); }); Any pointers here would be greatly appreciated. Thanks

    Read the article

  • How to get jQuery to find the first list-item, rather than all list-items?

    - by ricebowl
    I'm trying to implement a basic jQuery infinite carousel. As much for the learning process as for anything else (as a rule I'm not a fan of re-inventing wheels, but...I have to learn somehow, might as well start with the basics). I've managed to get the list to animate left happily enough, but I'm stuck when it comes to selecting the first element of the list. I've tried to use: $('ul#services > li:first'); $('ul#services > li:first-child'); $('ul#services > li').eq([0]); (xhtml below), In each case a console.log(first) (the var name used) returns all of the list-items. Am I doing something blatantly, and obviously, wrong? The eventual plan is to clone the first li, append it to the parent ul, remove the li from the list and allow the list to scroll infinitely. It's just a list of services rather than links so I'm not -at the moment- planning to have scroll or left/right functionality. Current xhtml: <div class="wrapper"> <ul id="services"> <!-- closing the `</li>` tags on the following line is to remove whitespace in the horizontal list, doesn't seem to make a difference to the jQuery from my own testing. --> <li>one</li ><li>two</li ><li>three</li ><li>four</li ><li>five</li ><li>six</li ><li>seven</li ><li>eight</li ><li>nine</li ><li>ten</li> </ul> </div>

    Read the article

  • Is there a selector or a work around to select any element with no children.

    - by rnaud
    Looking at the CSS3 specs, I can't find any way to select any element that has no children. Let me explain. <body> <h1>Main Page</h1> <div id="main"> <div class="post"> <h2>Article 1</h1> <p>some text</p> </div> <div class="post"> <h2>Article 2</h1> <p>some text</p> </div> </div> </body> I'm looking for a CSS syntax to select the h1, the two h2 and the two p. A way to select in any page, all elements with no children. Any suggestion ? Sorry, I forgot to add the "empty" part, I am actually already using the *:empty selector, but it's not working for any tag that has a nodeText as a child. So it's working for any input, image, object, but not for h2, h1, or any p.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >