w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Request Window Feature from another class
I think you cant do it.you should call anad.requestWindowFeature(Window.FEATURE_NO_TITLE); before setContentView().please See this Android Developer site

Categories : Android

Running `cucumber feature/test.feature` in ruby shows weird behaviour
The first line instructs the shell to run myapp.rb, which is, AFAIU, this script itself. Namely, each execution of the script recursively runs itself again. Try the following: #!/usr/bin/ruby `cucumber feature/test.feature` Or, even better, directly from the CLI: cucumber feature/test.feature To run all the tests simply issue the cucumber command without args: cucumber

Categories : Ruby

Would turning off feature in kernel cause kernel module(using feature) to misbehave?
CONFIG_HUGETLBFS can disable the user-space API, and CONFIG_TRANSPARENT_HUGEPAGE can disable automatic creation of huge pages for generic memory. However, huge pages are an integral part of the x86 memory management code and are used for things like direct mappings or large MMIO regions. You cannot simply switch off huge pages. When you are working with the MM code, you cannot avoid worrying about huge pages.

Categories : Linux

GWT request factory - Fire request inside of success method of another request
Try to create an event in the first onSuccess method. When your event is handled, you could send another request to the server. Check out How to use the GWT EventBus to use the eventbus. Thomas Broyer statement is also right. You should only use one RequestFactory and one ClientFactory!

Categories : Java

django - request.META - when sending request, what to do so that data appears in request.META
With the exception of CONTENT_LENGTH and CONTENT_TYPE, as given above, any HTTP headers in the request are converted to META keys by converting all characters to uppercase, replacing any hyphens with underscores and adding an HTTP_ prefix to the name. So, for example, a header called X-Bender would be mapped to the META key HTTP_X_BENDER. See https://docs.djangoproject.com/en/dev/ref/request-response/ So, in your case, I think you need to simply send {"TOKEN": "abc"}.

Categories : Python

AngularJs chaining an undefined ajax request and output progress (also if one request fail)
You can use $q.all to get all response and then process the response at the same time $q.all(promises).then(function (values) { //process all result together }); And you can also plugin a callback function to each promises to indicate the progress $q.all(promises[0].then(callback), promises[1].then(callback), ...).then(function (values) { //process all result together });

Categories : Angularjs

Zend Validation - Specify multiple ways to validate a request - depending on whats in the request
You can create a strategy class that can select input filter that can fit current request based on posted parameters. In other words your request flow should be something like this: Request -> Route -> Controller -> Input Filter Strategy -> InputFilter -> Other Stuff

Categories : Validation

Spring-MVC :: How to pass request parameters (or) query string values to another subsequent request?
You could call the underlying method directly So if you have as controller2 : @RequestMapping(value = "/MyURL", method = RequestMethod.POST) public String myMethod(final BaseDTO baseDTO, Model model) {} Inject controller2 into controller1 and call "normally": controller2.myMethod(baseDTO, model);

Categories : Java

PayPal Adaptive Payments - Preapproval request results in "Invalid request" error
OK fixed. How? Fix #1 The arguments requestEnvelope.errorLanguage and clientDetails.applicationId need to be "JSONified" into objects on their own, such as: "requestEnvelope": { "errorLanguage": "en_US" }, and "clientDetails": { "applicationId": "APP-XXXXXXXXXXXXX" }, respectively. Fix #2 Date formats; date format should be of the form 2014-03-15T20:14:38.007+00:00 and not 2014-03-14T20:14:38+0000 as I was passing. Note the milliseconds, and the timezone with the colon in the utc offset. Next time an Invalid request comes up the parameters I'm passing will be the first thing to look at.

Categories : Python

IIS handles request much longer when request originates from another computer and returns HTTP 200 and text
So a request from localhost is quicker than a request from a remote computer. That makes perfect sense - the localhost doesn't have to do a network request out to the network, find a remote host, send the request over the network and then wait for a response. Having said that - if your application is taking 15ms locally and 260ms on even a relatively close network, then it's slow :).

Categories : Dotnet

JQuery Ajax POST - Request Body not showing up in Raw HTTP Request
Look at the responseText success: function (response, status, xhr) { console.log(xhr.responseText); alert('Success Auth Token:' + response); } You will probably see the correct text there, but the responseXml will be null since the document is not valid. Why? Because you are missing the line <?xml version="1.0" encoding="ISO-8859-1"?> which will make it a valid XML doc

Categories : Javascript

Why can't I make a GET request to flickr api but I the request works when all the parameters are embedded in the string?
I've never used requestmaker until now, but I just tried and it works for me. I'm guessing your input is incorrect - try one of these two methods: are you using requestmaker GET or POST method (it's the top-right dropdown)? if GET, then Request URL: http://www.flickr.com/services/rest/? method=flickr.photos.search&api_key=KEYHERE&text=lol Request Header: Leave as is Request Data: N/A (you're using GET so nothing to post) if POST, then Request URL: http://www.flickr.com/services/rest/ Request Header: N/A (remove the headers) Request Data: method=flickr.photos.search&api_key=KEYHERE&text=lol

Categories : Api

Spring3 doesn't work @valid when json request I got 400 Bad Request error
Data binding (mapping request to objects) is an independent process from data validation. In Spring, data binding can contribute with its own binding errors to overall validation errors. Binding errors are supported by Spring's standard WebDataBinder, which kicks in when the method parameter is annotated with @ModelAttribute With @RequestBody annotation a completely different mechanism is used - HttpMessageConverters (in you case probably the MappingJackson2HttpMessageConverter). When the JSON unmarshalling fails a HttpMessageNotReadableException exception is thrown. You can handle exceptions within your global HandlerExceptionResolver or a special @ExceptionHandler annotated handler method within the handler itself or a global @ControllerAdvice.

Categories : Json

SSRS error message: The request failed with HTTP status 400: Bad Request
You probably have access to a folder with the correct permissions (or the report item itself) and not to the directory. Check the permissions to the directory by going to the SSRS Server directly generally: http: (servername)/Reports Click 'Folder Settings' and then security should come up. You should add relevant users here if you want the root of the connection to not pop up errors. Generally speaking SSRS can be item config set, directory of child items (which may also be more directories), or root directory set. The main landing page generally when connecting in code to SSRS is the point shown above unless you specify in code behind or a config some other starting point.

Categories : Reporting Services

How to call request using google timezone api for multiple locations in single request
How to we search using google timezone api for multiple locations(latitude and longitude pair) in single request Looking at the Google Documentation there is no example, so multiple location request is most likely not supported.

Categories : Google Maps

Flask: request.json works but request.get_json() causes error code 500
In Flask/wrappers.py the method get_json() is defined as method to the class Request. However, the same file still contains the old, deprecated method json(). If you have an old version of flask, then a) update or b) use request.json() instead.

Categories : Python

Google translate API (Paid Api) Request Error for few requests randomly while sending multiple request in Asp.net
Increase quota of Google Translator API by increasing characters/second/user Limit. https://code.google.com/apis/console/#project:149xxxxxxx84:quotas

Categories : C#

Getting HTTP status 400 - The request sent by the client was syntactically incorrect: using curl to post/put json request
I had a similar error when I posted to a normal http controller. My problem happened when the binding failed, the solution was that I needed to include BindingResult result. You could try adding that after your model for POST.

Categories : Json

The request failed with HTTP status 400: Bad Request ( The data is invalid. ): Code base Works on one machine but not another
It's an Internet Proxy issue. The suspect machine had be configured to manually use a proxy server. Turning this off: Control Panel -> Internet Options -> Connections Tab -> Lan Settings Button, and enabling "Automatically detect settings" has fixed the problem.

Categories : Asp Net

SSRS: Why do SKA-cookies build up until: HTTP 400 Bad Request - Request Too Long
Issue listed as fixed in SQL Server 2012 SP1 CU7. (see comments from Microsoft in the connect issue) But still present in SQL-Server 2014. The later section applies, if you can't install SQL Server 2012 SP1 CU7: OK, got the answer myself. The keep-alive cookie is issued every time one opens a report. Now, that becomes a problem when one opens (or refreshs, or changes to another page), say, more than 110 - 120 reports, without closing the browser. So we safeguard by deleting the excess cookies, and set a safe boundary at appx. 1/2 of the assumed maximum of 120 cookies. The cookies are HttpOnly, and expire when one closes the browser (session cookies). They are non-secure HttpOnly cookies, which is why I failed in my attempt to delete them via JavaScript. So it becomes necessary to de

Categories : Asp Net

Curl request - invalid xml request when posting user&password after xml
This is wrong: curl_setopt($ch, CURLOPT_POSTFIELDS, 'xml='.urlencode($xml).urlencode('&user=123456&password=123456')); urlencode only the variable names and the values (or only values if you know the variable names are ok): curl_setopt($ch, CURLOPT_POSTFIELDS, 'xml='.urlencode($xml).'&user=' . urlencode('123456').'&password=' . urlencode('123456'));

Categories : PHP

Facebook Request.callback() not firing when request is made from Service
The problem, as you have probably noticed, is that the executeAsync() method needs to be called from a UI thread for the callback to work. A service, on the other hand, runs in the background, thus with no access to the UI thread. Since I don't think you are planning to do any UI work in your onComplete(), one suggestion is to use a different API that does not require running on UI thread. One such API is executeAndWait(), which will return a response object you can use for checking against errors. For example: Response resp = uploadPhoto.executeAndWait(); if(resp.getError() == null){ //Success }

Categories : Android

paypal 400 bad request error getting at WebResponse response = request.GetResponse();
Please change Your CSHTML url as below:- <script type="text/javascript"> function GetGmailContacts() { window.location = "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize?client_id=clientid&response_type=code+id_token&scope=openid profile email&redirect_uri=localhost_url"; } </script> C# code:- public ActionResult Index(string code,string id_token) { if (code != null) { string postcontents = string.Format("client_id={0}&client_secret={1}&grant_type=authorization_code&redirect_uri={2}&code={3}" , System.Web.HttpUtility.UrlEncode("client_id") , System.Web.HttpUtility.UrlEncode("C

Categories : Asp Net Mvc

400 Bad Request when sending a http request with Common Lisp usocket
It looks like I needed to include the host. (defparameter *new-line* '(#Return #Newline)) (defun read-url (host port path) (let ((sock (usocket:socket-connect host port))) (format (usocket:socket-stream sock) "~A" (concatenate 'string "GET " path " HTTP/1.1" *new-line* "Host: " host *new-line* *new-line*)) (force-output (usocket:socket-stream sock)) (do ((line (read-line (usocket:socket-stream sock) nil) (read-line (usocket:socket-stream sock) nil)) (all "")) ((not line) all) (setf all (concatenate 'string all line " ")))))

Categories : Http

Identify image request in servlet by filename in URI instead of as request parameter
Map the servlet on a prefix URL pattern /images/* instead of an apparently exact URL pattern /images. Then, you can specify URLs exactly like that and obtain the filename as URI path information by HttpServletRequest#getPathInfo(). Kickoff example: @WebServlet("/images/*") public class ImageServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String filename = request.getPathInfo().substring(1); File file = new File(directory, filename); response.setHeader("Content-Type", getServletContext().getMimeType(file.getName())); response.setHeader("Content-Length", String.valueOf(file.length())); Files.copy(file.toPath(), response.getOutputStream()); }

Categories : Image

Using http.request to request data but got a heart-shaped icon?
You are receiving binary data. When you log the data out you are interpreting this as text, sending it through an encoding process. My best guess is that the heart symbol is the first byte, then you have a sequence that terminates the string. Use a simple loop to write out the data if you want to visualize it.

Categories : Node Js

Django QueryDict empty with request.POST but populated in request.GET
In my option,Have you open DEBUG(= True) in settings.py? And in the DEBUG mode, you can raise An Exception(raise Exception('')),And then you can see the Environment Varialbe like url, GET,POST.etc....in you page OR return HttpResponse(request.POST.dict()) to see the post variable. use crsf_exempt is a right way when post

Categories : Python

How to view the http request created by an jquery ajax request
Wireshark can help you track network usage so you ll be able to check all http data transfers (ajax or not) using filters. You may be able to log http request directly on the server (WS can listen on localhost)

Categories : Jquery

Is it Possible to trigger request when request received by MockService (Onrequest Script)
You can create REST request using HTTPBuilder in groovy script. Examples: get request, post request Or you can use RESTClient - it is an extension of HTTPBuilder

Categories : Rest

jQuery ajax request cancelled slows the current request
jQuery('#my_input').focusout(function(){ jQuery.xhrPool.abortAll(); }); blur event in that it supports detecting the loss of focus from parent elements blur vs focusout -- any real differences?

Categories : Jquery

Web API Multipart form-data: Can I save raw request as a file when new request comes in?
Yes, you can do it. Following is an example where I use a message handler to log incoming requests. This handler can be used to log any kind of request(not only the multipartform requests). //add this handler in your config config.MessageHandlers.Add(new LoggingMessageHandler()); // Logging message handler public class LoggingMessageHandler : DelegatingHandler { private StringBuilder messageBuilder = null; protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { messageBuilder = new StringBuilder(); messageBuilder.AppendFormat("{0} {1}", request.Method.Method, request.RequestUri); messageBuilder.AppendLine(); //get request headers information GetHeaders(r

Categories : Misc

How can I make an AJAX request and then remove the iframe the request was made from?
function cancelAndDelete() { $.ajax({url:"removeTempFiles.jsp", data: {id: fileId}, async: true}, complete: window.location.replace("http://URL HERE.com")); $("#iframe").remove(); } Is that what you're looking to do?

Categories : Jquery

Chrome Refuses to make Ajax Request to same url after request is aborted
It is because of cacheing, and because the URL is the same as it was before, hence why it ignores it. By appending a timestamp, makes the URL different, and each request goes through. Another option is setting cache to false (with .ajax()) which interestingly enough, simply appends a timestamp for you. .ajax() docs $.ajax({ /* ... */ cache: false });

Categories : Javascript

$.getJSON request is behaving in a way I am unclear about. Not sure how to format the request with callback=?
Look at your console: XMLHttpRequest cannot load https://api.twitch.tv/kraken/channels/athenelive/videos?limit=3&broadcasts=true. Origin http://fiddle.jshell.net is not allowed by Access-Control-Allow-Origin. Using $.getJSON with a callback argument actually sends a JSONP request, which jQuery implements by just creating a <script> tag and using a unique global callback. Without it, you attempt to send a regular AJAX request to that other website, which isn't allowed by your browser. Add a callback parameter and it'll work: $.getJSON("https://api.twitch.tv/kraken/channels/" + names[index] + "/videos?limit=3&broadcasts=true&callback=?", function (json) {

Categories : Javascript

How to get individual text elements from a XML request in jQuery Ajax request
giv a try to this $(returned).find('data').each(function(){ var $data = $(this); var first_name = $data.find("first_name").text(); alert("it worked: " + first_name); });

Categories : Jquery

Request Multi Picker - Can I make an operation before actually sending request?
When you look at the description of the Requests dialog, you’ll notice the parameter exclude_ids, by which you can specify user ids that will be excluded from the multi-friend selector. So if you look up in your database which of their friends your user has already send a request to, you can put those ids in there. Only cave-at: This parameter is not supported on mobile devices; so if you are targeting those, you might have to look for another solution (which would be most likely to create your own multi-friend selector) – but I’m not sure right now whether this restriction only applies to native mobile apps; maybe when using the JS SDK in a web-app it’ll work on those as well (the wording in the docs is not totally clear on that).

Categories : Facebook

Android: HttpClient, cannot retry request with a non-repeatable request entity
Try to set protocol param http.protocol.expect-continue to true in DefaultHttpClient: @Override protected HttpParams createHttpParams() { HttpParams params = super.createHttpParams(); HttpProtocolParams.setUseExpectContinue(params, true); return params; }

Categories : Android

Is there a way to specify -feature to the fsc Ant task?
Please try below, according to scala doc, fsc ant task should share same attributes with scalac <scalac srcdir="${scala.src.dir}" destdir="${build.dir}" classpathref="build.classpath" addparams="-feature"> <include name="**/*.scala" /> </scalac>

Categories : Scala

CCA for Feature Fusion
I found out how to perform the feature fusion using CCA. I wrote a Matlab code to do it and shared the code in MATLAB Central. Detailed descriptions can be found in this paper: M. Haghighat, M. Abdel-Mottaleb, W. Alhalabi, "Fully Automatic Face Normalization and Single Sample Face Recognition in Unconstrained Environments," Expert Systems With Applications, vol. 47, pp. 23-34, April 2016.

Categories : Matlab

How to animate all except one feature with CSS
This is actually pretty simple, just set the rule for all of them, then set it again for just the text-shadow: input[type=text]:focus { background: #fff; text-shadow: none; transition:all 0.5s; -webkit-transition:all 0.5s; -moz-transition:all 0.5s; transition:text-shadow 0s; -webkit-transition:text-shadow 0s; -moz-transition:text-shadow 0s; } With this code, if you change the text-shadow, it will instantly change, rather than animate. Like @Patrick commented, if you dont want the text-shadow to change at all, then make sure you don't edit that property.

Categories : CSS

© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.