Search Results

Search found 790 results on 32 pages for '401 internals'.

Page 18/32 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Casting problems with Google Maps API

    - by Thiago
    Hi there, I'm trying to run the following line: Directions.loadFromWaypoints((Waypoint[])waypoints.toArray(), opts); But I'm getting: 23:41:44.595 [ERROR] [carathome] Uncaught exception escaped java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lcom.google.gwt.maps.client.geocode.Waypoint; at com.presasystems.gwt.carathome.client.widgets.MostrarLinhasPanel$1$1.onSuccess(MostrarLinhasPanel.java:72) at com.presasystems.gwt.carathome.client.widgets.MostrarLinhasPanel$1$1.onSuccess(MostrarLinhasPanel.java:1) at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:216) at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287) at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:393) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.apply(Impl.java) at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188) at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222) at java.lang.Thread.run(Unknown Source) Why? Shouldn't this cast work? How can I do this in an elegant fashion? Thanks in advance

    Read the article

  • What is the best way to send structs containing enum values via sockets in C.

    - by Axel
    I've lots of different structs containing enum members that I have to transmit via TCP/IP. While the communication endpoints are on different operating systems (Windows XP and Linux) meaning different compilers (gcc 4.x.x and MSVC 2008) both program parts share the same header files with type declarations. For performance reasons, the structures should be transmitted directly (see code sample below) without expensively serializing or streaming the members inside. So the question is how to ensure that both compilers use the same internal memory representation for the enumeration members (i.e. both use 32-bit unsigned integers). Or if there is a better way to solve this problem... //type and enum declaration typedef enum { A = 1, B = 2, C = 3 } eParameter; typedef enum { READY = 400, RUNNING = 401, BLOCKED = 402 FINISHED = 403 } eState; #pragma pack(push,1) typedef struct { eParameter mParameter; eState mState; int32_t miSomeValue; uint8_t miAnotherValue; ... } tStateMessage; #pragma pack(pop) //... send via socket tStateMessage msg; send(iSocketFD,(void*)(&msg),sizeof(tStateMessage)); //... receive message on the other side tStateMessage msg_received; recv(iSocketFD,(void*)(&msg_received),sizeof(tStateMessage)); Additionally... Since both endpoints are little endian maschines, endianess is not a problem here. And the pack #pragma solves alignment issues satisfactorily. Thx for your answers, Axel

    Read the article

  • Silverlight, WCF service, integrated security AND ssl/https not possible?

    - by Flores
    I have this setup that works perfectly when using http. A silverlight 3 client .net 4 WCF service hosted in IIS with basicHttpBinding and using integrated security on the site When setting https to required on the website the setup stops working. Using the wcftestclient on the uri I get the message: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'. The remote server returned an error: (401) Unauthorized. Maybe this makes sense because the wcftestclient does not pass credentials? in the web.config the security mode for the service binding is set is set to 'Transport'. The silverlight client is created like this: BasicHttpBinding basicHttpBinding = new BasicHttpBinding(); basicHttpBinding.Security.Mode = BasicHttpSecurityMode.Transport; var serviceClient = new ImportServiceClient(basicHttpBinding, serviceAddress); The service address is ofcourse starting with https:// And the silverlight client reports this error: The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via Remember, swithing it back to http (and setting security mode to 'TransportCredentialOnly' makes everything working again. Is the setup I want even supported? If so, how should it be configured?

    Read the article

  • Mercurial Editor: "abort: The system cannot find the file specified"

    - by Killroy
    I have a problem getting Mercurial to recognise my editor. I have a file, c:\windows\notepad.exe and typing "notepad" at the command prompt works. I can commit by using the "-m" argument to supply the commit title. But a simple "hg commit" brings up the error. A call to "hg --traceback commit" brings up: Traceback (most recent call last): File "mercurial\dispatch.pyc", line 47, in _runcatch File "mercurial\dispatch.pyc", line 466, in _dispatch File "mercurial\dispatch.pyc", line 336, in runcommand File "mercurial\dispatch.pyc", line 517, in _runcommand File "mercurial\dispatch.pyc", line 471, in checkargs File "mercurial\dispatch.pyc", line 465, in <lambda> File "mercurial\util.pyc", line 401, in check File "mercurial\commands.pyc", line 708, in commit File "mercurial\cmdutil.pyc", line 1150, in commit File "mercurial\commands.pyc", line 706, in commitfunc File "mercurial\localrepo.pyc", line 836, in commit File "mercurial\cmdutil.pyc", line 1155, in commiteditor File "mercurial\cmdutil.pyc", line 1184, in commitforceeditor File "mercurial\ui.pyc", line 361, in edit File "mercurial\util.pyc", line 383, in system File "subprocess.pyc", line 470, in call File "subprocess.pyc", line 621, in __init__ File "subprocess.pyc", line 830, in _execute_child WindowsError: [Error 2] The system cannot find the file specified abort: The system cannot find the file specified I've tried setting the HGEDITOR environment variable, setting "visual =" and "editor =" in the Mercurial.ini file. I tried full path as well as command only. I also tried copying the notepad.exe file into both the current folder as well as the mercurial folder. Ideally I would like to use the editor at this location "C:\PortableApps\Notepad++Portable\Notepad++Portable.exe", but at this stage I would be happy with any editor!

    Read the article

  • NoSuchMethodError: com/sun/istack/logging/Logger.getLogger

    - by pandi-sus
    I developed a webservice and deployed it to websphere 7.0 and developed a dynamic dispatch client using JAX-WS APIs which also runs on same application server. I get error at the following line: Dispatch dispatch = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE); Error: Caused by: java.lang.NoSuchMethodError: com/sun/istack/logging/Logger.getLogger(Ljava/lang/Class;)Lcom/sun/istack/logging/Logger; at com.sun.xml.ws.api.config.management.policy.ManagementAssertion.(ManagementAssertion.java:87) at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize(J9VMInternals.java:200) at java.lang.J9VMInternals.initialize(J9VMInternals.java:167) at com.sun.xml.ws.server.MonitorBase.createManagedObjectManager(MonitorBase.java:177) at com.sun.xml.ws.client.Stub.(Stub.java:196) at com.sun.xml.ws.client.Stub.(Stub.java:174) at com.sun.xml.ws.client.dispatch.DispatchImpl.(DispatchImpl.java:129) at com.sun.xml.ws.client.dispatch.SOAPMessageDispatch.(SOAPMessageDispatch.java:77) at com.sun.xml.ws.api.pipe.Stubs.createSAAJDispatch(Stubs.java:143) at com.sun.xml.ws.api.pipe.Stubs.createDispatch(Stubs.java:264) at com.sun.xml.ws.client.WSServiceDelegate.createDispatch(WSServiceDelegate.java:390) at com.sun.xml.ws.client.WSServiceDelegate.createDispatch(WSServiceDelegate.java:401) at com.sun.xml.ws.client.WSServiceDelegate.createDispatch(WSServiceDelegate.java:383) at javax.xml.ws.Service.createDispatch(Service.java:336) I included the following dependency. javax.xml.ws jaxws-api 2.1 I also tried adding policy dependency (versions - 2.2 and 2.2.1) com.sun.xml.ws policy 2.2.1 Any ideas on what more dependencies I need to add?

    Read the article

  • Python - Code snippet not working on Python 2.5.6, using IDLE

    - by Francisco P.
    Hello, everyone I am using a piece of self-modifying code for a college project. Here it is: import datetime import inspect import re import sys def main(): # print the time it is last run lastrun = 'Mon Jun 8 16:31:27 2009' print "This program was last run at ", print lastrun # read in the source code of itself srcfile = inspect.getsourcefile(sys.modules[__name__]) f = open(srcfile, 'r') src = f.read() f.close() # modify the embedded timestamp timestamp = datetime.datetime.ctime(datetime.datetime.now()) match = re.search("lastrun = '(.*)'", src) if match: src = src[:match.start(1)] + timestamp + src[match.end(1):] # write the source code back f = open(srcfile, 'w') f.write(src) f.close() if __name__=='__main__': main() Unfortunately, it doesn't work. Error returned: # This is the script's output This program is last run at Mon Jun 8 16:31:27 2009 # This is the error message Traceback (most recent call last): File "C:\Users\Rui Gomes\Desktop\teste.py", line 30, in <module> main() File "C:\Users\Rui Gomes\Desktop\teste.py", line 13, in main srcfile = inspect.getsourcefile(sys.modules[__name__]) File "C:\Python31\lib\inspect.py", line 439, in getsourcefile filename = getfile(object) File "C:\Python31\lib\inspect.py", line 401, in getfile raise TypeError('{!r} is a built-in module'.format(object)) TypeError: <module '__main__' (built-in)> is a built-in module I'd be thankful for any solutions.

    Read the article

  • Bitbucket API authentication with Python's HTTPBasicAuthHandler

    - by jbochi
    I'm trying to get the list of issues on a private repository using bitbucket's API. I have confirmed that HTTP Basic authentication works with hurl, but I am unable to authenticate in Python. Adapting the code from this tutorial, I have written the following script. import cookielib import urllib2 class API(): api_url = 'http://api.bitbucket.org/1.0/' def __init__(self, username, password): self._opener = self._create_opener(username, password) def _create_opener(self, username, password): cj = cookielib.LWPCookieJar() cookie_handler = urllib2.HTTPCookieProcessor(cj) password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() password_manager.add_password(None, self.api_url, username, password) auth_handler = urllib2.HTTPBasicAuthHandler(password_manager) opener = urllib2.build_opener(cookie_handler, auth_handler) return opener def get_issues(self, username, repository): query_url = self.api_url + 'repositories/%s/%s/issues/' % (username, repository) try: handler = self._opener.open(query_url) except urllib2.HTTPError, e: print e.headers raise e return handler.read() api = API(username='my_username', password='XXXXXXXX') api.get_issues('my_username', 'my_repository') results in: >>> Server: nginx/0.7.62 Date: Mon, 19 Apr 2010 16:15:06 GMT Content-Type: text/plain Connection: close Vary: Authorization,Cookie Content-Length: 9 Traceback (most recent call last): File "C:/USERS/personal/bitbucket-burndown/bitbucket-api.py", line 29, in <module> print api.get_issues('my_username', 'my_repository') File "C:/USERS/personal/bitbucket-burndown/bitbucket-api.py", line 25, in get_issues raise e HTTPError: HTTP Error 401: UNAUTHORIZED api.get_issues('jespern', 'bitbucket') works like a charm. What's wrong with my code?

    Read the article

  • Devise not allowing active resource to access the services

    - by Saurabh Pandit
    In my application there are two folders one for a rails application and another for a ruby application. In the ruby folder I have created a ruby file in which I have written code to access some model which is present in the rails application using active resource. Sample code is shown below : active_resource_example.rb require 'rubygems' require 'active_resource' class Website < ActiveResource::Base self.site = "http://localhost:3000/admin/" self.user = "user" self.password = "password" end websites = Website.find(:all) puts websites.inspect In my rails application I have used ActiveAdmin gem which uses devise for authentication. On rails Server I get the following result : Started GET "/admin/websites.json" for 192.168.1.37 at 2011-11-12 14:41:06 +0530 Processing by Admin::WebsitesController#index as JSON Completed in 43ms And on my terminal where I executed active_resource_example.rb, I got following error : user@user:~/Desktop$ ruby active_resource_example.rb /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:132:in `handle_response': Failed. Response code = 401. Response message = Unauthorized . (ActiveResource::UnauthorizedAccess) from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:115:in `request' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:80:in `block in get' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:218:in `with_auth' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:80:in `get' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/base.rb:894:in `find_every' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/base.rb:806:in `find' from active_resource_example.rb:12:in `<main>' user@user:~/Desktop$ I tried this with another application in which Devise authentication is not used with the same configuration I used in active_resource_example.rb, there I got the result. Desperately need some solution to this issue.

    Read the article

  • Using Windows Integrated Auth & Anonymous during redirect on IIS7

    - by James Black
    I have an application we bought that I need to integrate, and it uses jakarta connection to get to the application from IIS. So, the basic operation is: user goes to the url Gets redirected to the application SSO is enabled, so redirected back to IIS for fetching of domain credentials Back to application If username is blank show login page, else let user in. This is a simplification of all the steps, but the basic idea is here. My difficulty is that I need both Windows Integrated Auth and anonymous on, as some users won't have credentials, and need to be prompted for a username/password. I have looked at: http://stackoverflow.com/questions/2068546/iis-windows-authentication-before-anonymous already, but the user doesn't get to click on a link to decide. The application goes back to IIS looking for login.aspx and from there I want to either get their domain credentials or pass back to the application empty strings to signify that there are no credentials. It seems this isn't going to be possible though as if anonymous is on it doesn't make the 401 request so the credentials aren't passed. If I can't get this to work with just using an ASP page, could it be done using an ISAPI filter, or a module?

    Read the article

  • Scribe-LinkedIn Search API

    - by Rupeshit
    Hi folks, I want to fetch data from the LinkedIn API for that I am using the Scribe library.All requests are giving me data as expected but when I tried two facet in the url then scribe is not able to get data from LinkedIn API. If I gave this URL : http://api.linkedin.com/v1/people-search?facets=location,network&facet=location,in:0 then it gives me proper result but if I entered this URL: http://api.linkedin.com/v1/people-search?facets=location,network&facet=location,in:0&facet=network,F i.e. URL containing multiple facets then it gives me this output: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <status>401</status> <timestamp>1292487039516</timestamp> <error-code>0</error-code> <message> [unauthorized].OAU:CiEgwWDkA5BFpNrc0RfGyVuSlOh4tig5kOTZ9q97qcXNrFl7zqk- Ts7DqRGaKDCV|94f13544-9844-41eb-9d53-8fe36535bbc3|*01|*01:1292487039:VseHXaJXM2gerxJyn6kHhIka7zw=</message> </error> Any kind of help to solve this will be appreciated.Thanks.

    Read the article

  • Sharepoint isn't accepting new Credentials initially when switching users.

    - by Tiziani
    Hi all, I have a standard website (one webapplication and one site collection) with some custom pages and webparts. The issue I'm having is that when I try to switch users, using the "Sign In As a Different User" and entering new credentials (even for another site collection admin account), IE tries the account three times, and then it presents a 401 Access Denied screen. After that, if I erase all the stuff of access denied page from the browser's url, I'm logged as the new account I just had entered and was not accepted. After researching for a while on google, I found a KB ( http://support.microsoft.com/kb/970814 ) that might relate, but just tested here and it didn't work at all. The modified method suggested by the KB is the following: function LoginAsAnother(url, bUseSource) { document.cookie="loginAsDifferentAttemptCount=0"; if (bUseSource=="1") { GoToPage(url); } else { //var ch=url.indexOf("?") =0 ? "&" : "?"; //url+=ch+"Source="+escapeProperly(window.location.href); //STSNavigate(url); document.execCommand("ClearAuthenticationCache"); } } But after making this change, it no longer asks for a new credential. Any ideas?

    Read the article

  • Ruby-on-rails: routing problem: controller action looks for show when it should look for finalize

    - by cbrulak
    background: trying to use the twitter gem for ruby-on-rails. in routes: map.resources :twitter_sessions map.finalize_twitter_sessions 'twitter_sessions/finalize', :controller => 'twitter_sessions', :action => 'finalize' (twitter_sessions is the controller for the twitter sessions in my app). The view has one file new.html.erb and is very simple: <% form_tag(twitter_sessions_path) do |f| %> <p><%= submit_tag "twitter!" %></p> <% end %> and the twitter_sessions_controller.rb: def new end def create oauth.set_callback_url(finalize_twitter_sessions_url) session['rtoken'] = oauth.request_token.token session['rsecret'] = oauth.request_token.secret redirect_to oauth.request_token.authorize_url end def destroy reset_session redirect_to new_session_path end def finalize oauth.authorize_from_request(session['rtoken'], session['rsecret'], params[:oauth_verifier]) profile = Twitter::Base.new(oauth).verify_credentials session['rtoken'] = session['rsecret'] = nil session[:atoken] = oauth.access_token.token session[:asecret] = oauth.access_token.secret sign_in(profile) redirect_back_or root_path end However, after I click the "twitter" button, I get this error: 401 Unauthorized .../gems/oauth-0.3.6/lib/oauth/consumer.rb:200:in `token_request' .../gems/oauth-0.3.6/lib/oauth/consumer.rb:128:in `get_request_token' .../gems/twitter-0.9.2/lib/twitter/oauth.rb:32:in `request_token' .../gems/twitter-0.9.2/lib/twitter/oauth.rb:25:in `set_callback_url' app/controllers/twitter_sessions_controller.rb:7:in `create' If I go to the finalize url, http://localhost:3000/twitter_sessions/finalize, directly, I get this error: Unknown action No action responded to show. Actions: create, destroy, finalize, isLoggedInToBeta, login_required, and new Any ideas? Thanks

    Read the article

  • REST API error return good practices

    - by Remus Rusanu
    I'm looking for guidance on good practices when it comes to return errors from a REST API. I'm working on a new API so I can take it any direction right now. My content type is XML at the moment, but I plan to support JSON in future. I am now adding some error cases, like for instance a client attempts to add a new resource but has exceeded his storage quota. I am already handling certain error cases with HTTP status codes (401 for authentication, 403 for authorization and 404 for plain bad request URIs). I looked over the blessed HTTP error codes but none of the 400-417 range seems right to report application specific errors. So at first I was tempted to return my application error with 200 OK and a specific XML payload (ie. Pay us more and you'll get the storage you need!) but I stopped to think about it and it seems to soapy (/shrug in horror). Besides it feels like I'm splitting the error responses into distinct cases, as some are http status code driven and other are content driven. So what is the SO crowd recommendation? Good practices (please explain why!) and also, from a client pov, what kind of error handling in the REST API makes life easier for the client code?

    Read the article

  • JPA/Hibernate query with class name?

    - by Petteri Hietavirta
    In this example com.test.Cat extends com.test.Animal and there is no field DB in CAT table of com.test.Cat explicitly defining its type (it wasn't me). When I query my animals from DB I get a collection of Animals. It is possible to sort them by class name: order by r.class but is there a way to use class name as a criteria? For example I would like to get all animals expect dogs. But no luck - even this does not work: where r.class = ? (String "ccc.test.Cat") as I get an exception: Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer at org.hibernate.type.IntegerType.set(IntegerType.java:64) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:154) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:136) at org.hibernate.param.PositionalParameterSpecification.bind(PositionalParameterSpecification.java:62) at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:514) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1589) at org.hibernate.loader.Loader.doQuery(Loader.java:696) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.doList(Loader.java:2228) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125) at org.hibernate.loader.Loader.list(Loader.java:2120) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)

    Read the article

  • HttpURLConnection: What's the deal with having to read the whole response?

    - by stormin986
    My current problem is very similar to this one. I have a downloadFile(URL) function that creates a new HttpURLConnection, opens it, reads it, returns the results. When I call this function on the same URL multiple times, the second time around it almost always returns a response code of -1 (But throws no exception!!!). The top answer in that question is very helpful, but there are a few things I'm trying to understand. So, if setting http.keepAlive to false solves the problem, it indicates what exactly? That the server is responding in a way that violates the http protocol? Or more likely, my code is violating the protocol in some way? What will the trace tell me? What should I look for? And what's the deal with this: You need to read everything from error stream. Otherwise, it's going to confuse next connection and that's the cause of -1. Does this mean if the response is some type of error (which would be what response code(s)?), the stream HAS to be fully read? Also, every time I am attempting an http request I am basically creating a new connection, and then disconnect()ing it at the end. However, in my case I'm not getting a 401 or whatever. It's always a 200. But my second connection almost always fails. Does this mean there's some other data I should be reading that I'm not (in a similar manner that the error stream must be fully read)? Please help shed some light on this? I feel like there's some fundamental http protocol understanding I'm missing.

    Read the article

  • [Zend YouTubeAPP] failed to upgrade a token

    - by kwokwai
    Hi all, I was testing Zend Gdata 1.10.1 in my localhost. I downloaded Zend Gdate from this link: http://framework.zend.com/download/webservices Inside the Zend Gdata zip file, there was a folder called demos. I extracted it and used the YouTudeVideoApp to upload a sample video to Youtube. But every time after I logged into Youtube, before it redirected me to my localhost, I received a warning message like this warning message: localhost: This website is registered with Google to make authorization requests, but has not been configured to send requests securely. We recommend that you continue the process only if you trust the following destination: localhost:8080/youtube/operations.php So I googled on how to resolve the problem of getting this warning message when I saw some people suggesed changing the value of $secure to True in operation.php. Here is the script mentioned: function generateAuthSubRequestLink($nextUrl = null) { $scope = 'http://gdata.youtube.com'; $secure = true; $session = true; if (!$nextUrl) { generateUrlInformation(); $nextUrl = $_SESSION['operationsUrl']; } $url = Zend_Gdata_AuthSub::getAuthSubTokenUri($nextUrl, $scope, $secure, $session); echo '<a href="' . $url . '"><strong>Click here to authenticate with YouTube</strong></a>'; } After I altered the value of $secure to True, I found that the warning message changed to this: localhost: Registered, secure. This website is registered with Google to make authorization requests The new warning message is somehow shorter and looks better than the previous warning message. But once I pressed the Allow Access button, it turned out to be this: ERROR - Token upgrade for CI3M6_Q3EOGkxoL-___wEYjffToQQ failed : Token upgrade failed. Reason: Invalid AuthSub header. Error 401 ERROR - Unknown search type - '' I don't know why this happened. Could you help me solve the problem please?

    Read the article

  • GET Trello JSON to put in a string var

    - by Verber
    I'm trying to get the JSON that a TRELLO API Url returns and put it into a string. On my own private board I am getting "401 Unauthorized". But the Trello Api doesn't seem to give any way to authorize a user through the URL. If I try a public board I get "XMLHttpRequest cannot load https://api.trello.com/1/board/4d5ea62fd76aa1136000000c?key=68d02bf40d2ad57dd9eb418eb15f9564. Request header field X-Requested-With is not allowed by Access-Control-Allow-Headers." This is my code: <body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"> </script> <script> var list = $.getJSON(" https://api.trello.com/1/board/4d5ea62fd76aa1136000000c? key=68d02bf40d2ad57dd9eb418eb15f9564"); document.getElementById('print').innerHTML = list; </script> <div id="print"> </div> </body>

    Read the article

  • How to store an inventory using hashtables?

    - by Harm De Weirdt
    Hello everyone. For an assignment in collego we have to make a script in Perl that allows us to manage an inventory for an e-store. (The example given was Amazon) Users can make orders in a fully text-based environment and the inventory must be updated when an order is completed. Every item in the inventory has 3 to 4 attributes: a product code, a title, a price and for some an amount (MP3's for example do not have this attribute) Since this is my first encounter with Perl, i don't really know how to start. My main problem is how i should "implement" the inventory in the program. One of the functions of the program is searching trough the titles. Another is to make an order, where the user should give a product code. My first idea was a hashtable with the productcode as key. But if i wanted to search in the titles that could be a problem because of this: the hashkey would be something like DVD-123, the information belonging to that key could be "The Green Mask 12" (without the ") where the 12 indicates how many of this DVD are currently in stock. So i'd have to find a way to ignore the 12 in the end. Another solution was to use the title as Hashkey, but that would prove cumbersome too I think. Is there a way to make a hashtable with 2 key's, and when I give only one it returns an array with the other values? (Including the other key and the other information) That way I could use another key depending on what info I need from my inventory. We have to read the default inventory from a txt file looking like this: MP3-72|Lady Gaga - Kiss and Run (Fear of Commitment Monster)|0.99 CD-400|Kings of Leon - Only By The Night|14.50|2 MP3-401|Kings of Leon - Closer|0.85 DVD-144|Live Free or Die Hard|14.99|2 SOFT-864|Windows Vista|49.95 Any help would be appreciated very much :) PS: I am sorry for my bad grammar, English isn't my native language.

    Read the article

  • Better way to summarize data about stop times?

    - by Vimvq1987
    This question is close to this: http://stackoverflow.com/questions/2947963/find-the-period-of-over-speed Here's my table: Longtitude Latitude Velocity Time 102 401 40 2010-06-01 10:22:34.000 103 403 50 2010-06-01 10:40:00.000 104 405 0 2010-06-01 11:00:03.000 104 405 0 2010-06-01 11:10:05.000 105 406 35 2010-06-01 11:15:30.000 106 403 60 2010-06-01 11:20:00.000 108 404 70 2010-06-01 11:30:05.000 109 405 0 2010-06-01 11:35:00.000 109 405 0 2010-06-01 11:40:00.000 105 407 40 2010-06-01 11:50:00.000 104 406 30 2010-06-01 12:00:00.000 101 409 50 2010-06-01 12:05:30.000 104 405 0 2010-06-01 11:05:30.000 I want to summarize times when vehicle had stopped (velocity = 0), include: it had stopped since "when" to "when" in how much minutes, how many times it stopped and how much time it stopped. I wrote this query to do it: select longtitude, latitude, MIN(time), MAX(time), DATEDIFF(minute, MIN(Time), MAX(time)) as Timespan from table_1 where velocity = 0 group by longtitude,latitude select DATEDIFF(minute, MIN(Time), MAX(time)) as minute into #temp3 from table_1 where velocity = 0 group by longtitude,latitude select COUNT(*) as [number]from #temp select SUM(minute) as [totaltime] from #temp3 drop table #temp This query return: longtitude latitude (No column name) (No column name) Timespan 104 405 2010-06-01 11:00:03.000 2010-06-01 11:10:05.000 10 109 405 2010-06-01 11:35:00.000 2010-06-01 11:40:00.000 5 number 2 totaltime 15 You can see, it works fine, but I really don't like the #temp table. Is there anyway to query this without use a temp table? Thank you.

    Read the article

  • Black outline around map polygons (IE)

    - by user146780
    This only happens in some IE's. Here: http://animactions.ca/Animactions/volet_entreprise.php You may notice that when you click and drag on one of the circles, you will get something similar to this: http://img534.imageshack.us/img534/7578/errorra.png I cannot figure it out. Here is my image map: <p class="style2"> <map id="FPMap0" name="FPMap0"> <area coords="405, 8, 375, 10, 353, 13, 322, 30, 317, 48, 327, 69, 344, 75, 370, 84, 401, 86, 428, 81, 454, 69, 466, 56, 468, 37, 452, 19, 419, 9" href="le_developpement_des_equipes_de_travail.php" shape="poly" style="outline:0" target="_blank" /> <area coords="95, 164, 65, 166, 43, 174, 21, 186, 16, 206, 27, 225, 48, 237, 76, 241, 99, 241, 129, 236, 151, 228, 165, 214, 167, 194, 154, 177, 130, 168, 105, 165" href="le_developpement_operationnel.php" shape="poly" style="outline:0" target="_blank" /> <area coords="138, 17, 115, 7, 95, 8, 63, 8, 41, 20, 21, 35, 23, 60, 42, 74, 77, 83, 117, 86, 144, 76, 164, 62, 173, 40, 156, 21, 137, 12" href="coaching_strategique_de_cadre.php" shape="poly" style="border-width:0" target="_blank" /> </map> <img alt="services entreprise" height="258" src="Images/service_ent.PNG" width="490" usemap="#FPMap0" /></p> I really hope someone can figure this out because I'v tried everything... Thanks

    Read the article

  • C lang. -- Error: Segmentation fault

    - by user233542
    I don't understand why this would give me a seg fault. Any ideas? This is the function that returns the signal to stop the program (plus the other function that is called within this): double bisect(double A0,double A1,double Sol[N],double tol,double c) { double Amid,shot; while (A1-A0 > tol) { Amid = 0.5*(A0+A1); shot = shoot(Sol, Amid, c); if (shot==2.*Pi) { return Amid; } if (shot > 2.*Pi){ A1 = Amid; } else if (shot < 2.*Pi){ A0 = Amid; } } return 0.5*(A1+A0); } double shoot(double Sol[N],double A,double c) { int i,j; /*Initial Conditions*/ for (i=0;i<buff;i++) { Sol[i] = 0.; } for (i=buff+l;i<N;i++) { Sol[i] = 2.*Pi; } Sol[buff]= 0; Sol[buff+1]= A*exp(sqrt(1+3*c)*dx); for (i=buff+2;i<buff+l;i++) { Sol[i] = (dx*dx)*( sin(Sol[i-1]) + c*sin(3.*(Sol[i-1])) ) - Sol[i-2] + 2.*Sol[i-1]; } return Sol[i-1]; } The values buff, l, N are defined using a #define statement. l = 401, buff = 50, N = 2000

    Read the article

  • fix a columns width when a list is bound to a datagridview

    - by Andy
    I have a list that I have bound to a datagridview. I want the first column to be a fixed size. The data is bound to the dataGridView and I can't seem to find a way to access an individual colums properties. if I try myDatagridview.colums[0] I get an index out of bounds, since it says the columns count is 0. private DataGridView setUpDataGrid(List<NVRlineVal> _NVRData) { //setup dataGridView DataGridView NVRDataGridView = new System.Windows.Forms.DataGridView(); NVRDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; NVRDataGridView.Dock = System.Windows.Forms.DockStyle.Fill; NVRDataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; NVRDataGridView.Location = new System.Drawing.Point(3, 3); NVRDataGridView.Name = "NVRDataGridView" + nvrIndex; NVRDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders; NVRDataGridView.Size = new System.Drawing.Size(380, 401); NVRDataGridView.TabIndex = 0; NVRDataGridView.DataSource = _NVRData; var test = NVRDataGridView.Columns; NVRDataGridView.DataMember = "devState"; DataGridViewAutoSizeColumnMode.None; } Any ideas on how to have a fixed column width for only one of these columns, the rest will autosize?

    Read the article

  • Is it possible to disable/bypass the login popup caused by mod_auth_ntlm_winbind (Single Sign On) an

    - by cvack
    I have an intranet on a remote Web server. This will be integrated with Active Directory on our local server. The web server is running Apache / Linux and the AD server is running Windows 2003. This is all done with VPN. Login to the intranet is conducted in two ways: 1. Users who are logged in to AD to be logged in automatically with SSO. 2. Users who are NOT logged in to AD to be logged in using a common login form. In order to auto login (SSO) I use mod_auth_ntlm_winbind. The problem here is that the users not logged in to AD will get a popup box where they must enter their DOMAIN/username + AD password. If I disable this popup, there is no way to get $_SERVER['REMOTE_USER'] Then my question: Is it possible to turn off this popup box and still get the REMOTE_USER? Or: If possible, can I use AJAX to check if http://my-intranet/auth returns 401 error (non-AD users). If so, do not go to the /auth folder.

    Read the article

  • how to put header authentication into a form using php?

    - by SkyWookie
    Hey guys, for the page I am doing needs a login authentication using Twitter (using tweetphp API). For test purposes I used this code below to do a successful login: if (!isset($_SERVER['PHP_AUTH_USER'])){ header('WWW-Authenticate: Basic realm="Enter your Twitter username and password:"'); header('HTTP/1.0 401 Unauthorized'); echo 'Please enter your Twitter username and password to view your followers.'; exit(); } $username = $_SERVER['PHP_AUTH_USER']; $password = $_SERVER['PHP_AUTH_PW']; The problem now is, I want to integrate it into a form, so far I have the following: <form action="logincheck.php" method="post" class="niceform" > <fieldset> <legend>Twitter Login:</legend> <dl> <dt><label for="email">Twitter Username:</label></dt> <dd><input type="text" name="username" id="username" size="32" maxlength="128" /></dd> </dl> <dl> <dt><label for="password">Password:</label></dt> <dd><input type="password" name="password" id="password" size="32" maxlength="32" /></dd> </dl> </fieldset> <fieldset class="action"> <input type="submit" name="submit" id="submit" value="Submit" /> I am sending it to logincheck.php, this is where I think I get stuck. I am not sure how to compare the form data with Twitter's login data. I was trying a similar if statement as I used in the first code (box that pops up before page loads), but I couldn't wrap my head around it. Thanks again guys!

    Read the article

  • Multithreading A Function in VB.Net

    - by Ben
    I am trying to multi thread my application so as it is visible while it is executing the process, this is what I have so far: Private Sub SendPOST(ByVal URL As String) Try Dim DataBytes As Byte() = Encoding.ASCII.GetBytes("") Dim Request As HttpWebRequest = TryCast(WebRequest.Create(URL.Trim & "/webdav/"), HttpWebRequest) Request.Method = "POST" Request.ContentType = "application/x-www-form-urlencoded" Request.ContentLength = DataBytes.Length Request.Timeout = 1000 Request.ReadWriteTimeout = 1000 Dim PostData As Stream = Request.GetRequestStream() PostData.Write(DataBytes, 0, DataBytes.Length) Dim Response As WebResponse = Request.GetResponse() Dim ResponseStream As Stream = Response.GetResponseStream() Dim StreamReader As New IO.StreamReader(ResponseStream) Dim Text As String = StreamReader.ReadToEnd() PostData.Close() Catch ex As Exception If ex.ToString.Contains("401") Then TextBox2.Text = TextBox2.Text & URL & "/webdav/" & vbNewLine End If End Try End Sub Public Sub G0() Dim siteSplit() As String = TextBox1.Text.Split(vbNewLine) For i = 0 To siteSplit.Count - 1 Try If siteSplit(i).Contains("http://") Then SendPOST(siteSplit(i).Trim) Else SendPOST("http://" & siteSplit(i).Trim) End If Catch ex As Exception End Try Next End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim t As Thread t = New Thread(AddressOf Me.G0) t.Start() End Sub However, the 'G0' sub code is not being executed at all, and I need to multi thread the 'SendPOST' as that is what slows the application.

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >