Daily Archives

Articles indexed Tuesday October 16 2012

Page 6/15 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Error using SoapClient() in PHP [migrated]

    - by Dhaval
    I'm trying to access WSDL(Web Service Definition Language) file using SoapClient() of PHP. I found that WSDL file is authenticated. I tried with passing credentials on an array by another parameter and active SSL on my server, still I'm getting an error. Here is the code I'm using: $client = new SoapClient("https://webservices.chargepointportal.net:8081/coulomb_api_1.1.wsdl",array("trace" = "1","Username" = "username","Password" = "password")); Here is the error I'm getting: Warning: SoapClient::SoapClient(https://webservices.chargepointportal.net:8081/coulomb_api_1.1.wsdl) [soapclient.soapclient]: failed to open stream: Connection timed out in PATH_TO_FILE on line 80 Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "https://webservices.chargepointportal.net:8081/coulomb_api_1.1.wsdl" in PATH_TO_FILE on line 80 Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://webservices.chargepointportal.net:8081/coulomb_api_1.1.wsdl' : failed to load external entity "https://webservices.chargepointportal.net:8081/coulomb_api_1.1.wsdl" in PATH_TO_FILE:80 Stack trace: #0 /home2/wingstec/public_html/widget/API/index.php(80): SoapClient-SoapClient('https://webserv...', Array) #1 {main} thrown in PATH_TO_FILE on line 80 It seems that error says file not exist at the path we given but when we run that path directly on browser then we're getting that file Can anyone help me to figure out what the exactly problem is?

    Read the article

  • Oracle EZConnect in Mediawiki

    - by raindog308
    Mediawiki supports Oracle and I'm trying to configure it in the installer. The installers says you can use EZConnect...something like: user/pass@//server.example.com/dbname or since the installer has fields elsewhere for user/pass server.example.com/dbname The installer includes a link to the EZConnect docs: http://docs.oracle.com/cd/E11882_01/network.112/e10836/naming.htm. All the examples in that doc include a forward slash. But every combination I've tried results in an error like this: Invalid database TNS "sever.example.com/service_name". Use only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_) and dots (.). I can't find any examples of EZConnect that don't include a forward slash. That error is from Mediawiki, not Oracle. I'm tailing the listener log and there is no connection made - Medaiwiki is returning an error without trying to connect. I'm using php OCI8 with the Oracle instant client. I don't have a tnsnames.ora setup for this client - which is kind of the point of EZConnect. I did write a test php script that connects via oci_connect just fine. Has anyone configured Mediawiki to use Oracle with EZConnect? If so, what did you use in the installer?

    Read the article

  • How does Minecraft renders its sunset and sky?

    - by Nick
    In Minecraft, the sunset looks really beautiful and I've always wanted to know how they do it. Do they use several skyboxes rendered over eachother? That is, one for the sky (which can turn dark and light depending on the time of the day), one for the sun and moon, and one for the orange horizon effect? I was hoping someone could enlighten me... I wish I could enter wireframe or something like that but as far as I know that is not possible.

    Read the article

  • AndEngine player, background and camera

    - by valdemar593
    I'm developing a 2D shooter using AndEngine. At the moment I'm trying to make the camera follow the player. As I've understood the common approach is to use the SmoothCamera zooming it and setting the chased entity. The problem is that the camera follows the player WITH background moving also (RepeatingSpriteBackground), so it looks like the player doesn't move at all though the actual position changes. So I don't really get how to make the camera follow the player and have the background not moving. Thanks in advance.

    Read the article

  • Advices fo starting a video game design career

    - by Allen Gabriel Baker
    I'm 24 and have a passion for video games and game-design. I've decided I want to design video games as my career. I have no experience with designing video games or coding but I'm interested and willing to learn. I want a job at any level but what would I need to land a job? I have no college experience and I have no money. What is a cheap school, or do I really need to go to school for this, or can I learn on my own? Is it possible to do this with no money? I'm literally broke but I want this so bad I feel like its the only career I'll enjoy. I want to call up company's and ask them what they are looking for in someone they want to hire, is that a good idea? Also I don't know the history of video game design and I don't want to sound like a dummy when someone says something about this field or talks about a famous designer and I have no idea who they're talking about. So what is key info when it comes to this field and where should I find it? Hopefully some of you guys and girls can help me out: I know in the future I will create something everyone will enjoy and you guys will remember when you gave me advice and I will always remember you guys for helping me. I'm gifted I know I am and I want to share my gift with the rest of the world by making games that change the Industry. Help me out please.

    Read the article

  • String on a model

    - by alecnash
    I am trying to put a sting on a Model and I want it to be dynamic. Did some research and came up with drawing the text on the texture and then set it on the model. I use something like this: public static Texture2D SpriteFontTextToTexture(SpriteFont font, string text, Color backgroundColor, Color textColor) { Size = font.MeasureString(text); RenderTarget2D renderTarget = new RenderTarget2D(GraphicsDevice, (int)Size.X, (int)Size.Y); GraphicsDevice.SetRenderTarget(renderTarget); GraphicsDevice.Clear(Color.Transparent); Spritbatch.Begin(); //have to redo the ColorTexture Spritbatch.Draw(ColorTexture.Create(GraphicsDevice, 1024, 1024, backgroundColor), Vector2.Zero, Color.White); Spritbatch.DrawString(font, text, Vector2.Zero, textColor); Spritbatch.End(); GraphicsDevice.SetRenderTarget(null); return renderTarget; } When I was working with primitives and not models everything worked fine because I set the texture exactly where I wanted but with the model (RoundedRect 3d button) it looks like that: Is there a way to have the text centered only on one side?

    Read the article

  • COCOS2D-html5 MoveBy doesn't work

    - by ufo
    I'd like to run an action on a sprite using the MoveBy action. After lots of attempts, I can't achieve the goal... I have issues with the MoveBy in 2 different projects, so maybe I'm missing something in the setup... But I can't figure what! The instruction is like this: this.platform1Sprite.runAction(cc.MoveBy.create(1, cc.p(200, 0))); I don't get any error, simply it doesn't work. Thank you in advance.

    Read the article

  • Why doesn't Unity's OnCollisionEnter give me surface normals, and what's the most reliable way to get them?

    - by michael.bartnett
    Unity's on collision event gives you a Collision object that gives you some information about the collision that happened (including a list of ContactPoints with hit normals). But what you don't get is surface normals for the collider that you hit. Here's a screenshot to illustrate. The red line is from ContactPoint.normal and the blue line is from RaycastHit.normal. Is this an instance of Unity hiding information to provide a simplified API? Or do standard 3D realtime collision detection techniques just not collect this information? And for the second part of the question, what's a surefire and relatively efficient way to get a surface normal for a collision? I know that raycasting gives you surface normals, but it seems I need to do several raycasts to accomplish this for all scenarios (maybe a contact point/normal combination misses the collider on the first cast, or maybe you need to do some average of all the contact points' normals to get the best result). My current method: Back up the Collision.contacts[0].point along its hit normal Raycast down the negated hit normal for float.MaxValue, on Collision.collider If that fails, repeat steps 1 and 2 with the non-negated normal If that fails, try steps 1 to 3 with Collision.contacts[1] Repeat 4 until successful or until all contact points exhausted. Give up, return Vector3.zero. This seems to catch everything, but all those raycasts make me queasy, and I'm not sure how to test that this works for enough cases. Is there a better way?

    Read the article

  • Using memorystream and DotNetZip in MVC gives "Cannot access a closed Stream"

    - by Frode Lillerud
    I'm trying to create a zipfile in a MVC method using the DotNetZip components. Here is my code: public FileResult DownloadImagefilesAsZip() { using (var memoryStream = new MemoryStream()) { using (var zip = new ZipFile()) { zip.AddDirectory(Server.MapPath("/Images/")); zip.Save(memoryStream); return File(memoryStream, "gzip", "images.zip"); } } } When I run it I get a "Cannot access a closed Stream" error, and I'm not sure why.

    Read the article

  • phonegap crossplatform redirection to local file

    - by Marco Gagliardi
    Hi I'm developing a phonegap + JQueryMobile app, which should be correctly executed on Android, iOs and WindowsPhone as well. I need to exploit an external service wich requires one callback url to redirect the app to in case of success, and one in case of error (pretty common situation. In my case both will be local files, say www/success.html and www/error.html). Of course I could write different paths for each device (e.g. file:///android_asset/www/success.html on Android), but i'm wondering if the framework provide a more simple elegant solution. So the questions is, how can i get a unique absolute URL wich allows me to perform a cross-platform HTTP redirection from a remote web page to a local file within a phonegap application? Thanks

    Read the article

  • Scraping paginated items from a website using scrapy

    - by Mridang Agarwalla
    I'm using scrapy to scrape items from a site. I'm not being able to implement this scraping pattern. The site I'm trying to scrape is a forum and I scrape the site once a day. Each page has a table containing posts. New posts are added to the top of the table and as more and more posts are posted to the site, the older posts go further into the pages due to pagination. This is a very simple scenario and we will assume that the order of the posts never change. I would like to scrape this site and scrape all the "new" records until the last scraped post from yesterday is encountered. I have configured my spider to paginate endlessly and when it encounters yesterday's last scraped post, it should stop. How can implement this? (My Scrapy installation works with my Django installation using django-dynamic-scraper )

    Read the article

  • CSS H4 hover style

    - by user1750613
    I tried many css from other places and stackoverflow, but somehow I can not make it done. I'm very new to css, and using Joomla and a template. I'm using custom.css folder for certain customizations on style. Here is I want to do: I want to style h4 when it is a link. For example, I'm creating a custom html module, have a list in the content. And in the content I'm giving each, h5 style, and a link to it to a certain page in the site. What I want to achieve is to have this list with color blue. And when mouse over-hover to have underline and still the same color. And when clicked back to the original position with no underline and no color change. (the same color in every situation, just underline when you are over it.) I tried these h5, h5 a, h5 a: hover, h5 .contentheading a, and so on... In one instance, it was working with : h5 { font-family: arial, sans-serif; font-size: 1.3em; font-weight: bold; } h5 a { color: #0088CC; } h5 a: hover { color: #0088CC; text-decoration: underline; } As I read I should use 'a' when the heading is a link. But now something is overriding it, I'm completely lost now. I see a:hover style in the inspection. I want to use this h5 in several content (in custom modules) when I want to style a content as a list to links. And I thought it will be practical to have one heading with a certain style so that I can use it with flexibility. Thanks a lot, any help will be great : )

    Read the article

  • clear input textbox value on load

    - by user544079
    I have the following form which is getting pre populated with values on load. I want to have empty input boxes on load using Javascript. However I do not have access to the <body> tag so <body onload="" will not work here. Is there any other way to clear the form fields on load? <form method="POST" action=""> <input name="username" id="user" value="" /><br /> <input name="pwd" id="pass" value="" /> <input type="submit" value="Go" /> </form>

    Read the article

  • Codeigniter: Check where model is loaded from?

    - by qwerty
    I'm having the strangest thing ever right now. I "disabled" a model because i don't need to access it ever again. I did so by echoing out an error string in the __construct() and right after that die(). That way i would notice if i ever loaded the model, even by mistake, which should never happen. Alright? The problem is, the model is not loaded ANYWHERE in the entire project, but it still gets loaded for some reason. It's not auto loaded, that's for sure. Is it possible to track down where a model is loaded? Like which line it happens etc?

    Read the article

  • Exclude category from main RSS feed, but not all feeds

    - by jamEs
    I've got a blog that supplies content to multiple MailChimp newsletters via RSS. The first newsletter works fine, but the second I'm having issues with. The issue I have is that the second newsletter has "hidden" content. This content isn't meant for wide consumption, so it doesn't appear on the frontpage, but is accessible elsewhere on the site. The snafu with this is that not all of this content is hidden, just some of it, while other pieces of content for this newsletter could overlap with the first newsletter. This obviously makes excluding everything problematic, as they could be assigned multiple categories, some of which I wouldn't want hidden. The issue I'm running into is that I have a way to exclude this content from the frontpage, but not from the main RSS feed. I'm using WP Hide Post for this, which allows me to exclude from feed, which in turn removes it from all feeds, including the ones that feed the newsletter. I'm currently using /feed?cat=XXX to reference these feeds. Is there a way to make it so category feeds still work, just the main /feed RSS would exclude it?

    Read the article

  • Postgresql count+sort performance

    - by invictus
    I have built a small inventory system using postgresql and psycopg2. Everything works great, except, when I want to create aggregated summaries/reports of the content, I get really bad performance due to count()'ing and sorting. The DB schema is as follows: CREATE TABLE hosts ( id SERIAL PRIMARY KEY, name VARCHAR(255) ); CREATE TABLE items ( id SERIAL PRIMARY KEY, description TEXT ); CREATE TABLE host_item ( id SERIAL PRIMARY KEY, host INTEGER REFERENCES hosts(id) ON DELETE CASCADE ON UPDATE CASCADE, item INTEGER REFERENCES items(id) ON DELETE CASCADE ON UPDATE CASCADE ); There are some other fields as well, but those are not relevant. I want to extract 2 different reports: - List of all hosts with the number of items per, ordered from highest to lowest count - List of all items with the number of hosts per, ordered from highest to lowest count I have used 2 queries for the purpose: Items with host count: SELECT i.id, i.description, COUNT(hi.id) AS count FROM items AS i LEFT JOIN host_item AS hi ON (i.id=hi.item) GROUP BY i.id ORDER BY count DESC LIMIT 10; Hosts with item count: SELECT h.id, h.name, COUNT(hi.id) AS count FROM hosts AS h LEFT JOIN host_item AS hi ON (h.id=hi.host) GROUP BY h.id ORDER BY count DESC LIMIT 10; Problem is: the queries runs for 5-6 seconds before returning any data. As this is a web based application, 6 seconds are just not acceptable. The database is heavily populated with approximately 50k hosts, 1000 items and 400 000 host/items relations, and will likely increase significantly when (or perhaps if) the application will be used. After playing around, I found that by removing the "ORDER BY count DESC" part, both queries would execute instantly without any delay whatsoever (less than 20ms to finish the queries). Is there any way I can optimize these queries so that I can get the result sorted without the delay? I was trying different indexes, but seeing as the count is computed it is possible to utilize an index for this. I have read that count()'ing in postgresql is slow, but its the sorting that are causing me problems... My current workaround is to run the queries above as an hourly job, putting the result into a new table with an index on the count column for quick lookup. I use Postgresql 9.2.

    Read the article

  • Android, FragmentActivity and prevent Swipe

    - by FIG-GHD742
    I use android.support.v4.app.FragmentActivity for create a app with multi fragment/panels that can be access by drag/swipe between different part of the app. In one of my fragment I has a zoomable view and my problem is in case I is on the zoomable view I will prevent the use for drag/swipe to a other fragment. I has try to hack into android.support.v4.view.ViewPager for get the action from on Touch event but not work. I has try all of this case but not work: (All code is a a part of subclass to android.support.v4.view.ViewPager) Case 1: // Not working @Override protected void onPageScrolled(int position, float offset, int offsetPixels) { if (isPreventDrag()) { super.onPageScrolled(position, 1, 0); } else { super.onPageScrolled(position, offset, offsetPixels); } } Case 2: // Work but stop all event include the event to the target image view. @Override public boolean onInterceptTouchEvent(MotionEvent ev) { switch (ev.getAction()) { case MotionEvent.ACTION_DOWN: lastX = ev.getX(); // float lockScroll = false; return super.onInterceptTouchEvent(ev); case MotionEvent.ACTION_MOVE: this.lockScroll = this.isPreventDrag(); break; } if (lockScroll) { ev.setLocation(lastX, ev.getY()); return super.onInterceptTouchEvent(ev); } else { return super.onInterceptTouchEvent(ev); } } Case 3: // Work good, but by some unknown error I can drag the screen // some pixels before this stop the event. @Override public boolean onTouchEvent(MotionEvent ev) { if (this.isPreventDrag()) { return true; } else { return super.onTouchEvent(ev); } } I want a easy way to deactivate stop or deactivate if the use is allow to switch to a other Fragment. Here is a working code for me, I don't know what error I do before. // This work for me, @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (this.isPreventDrag()) { return false; } else { return super.onInterceptTouchEvent(ev); } }

    Read the article

  • Namespace Traversal

    - by RikSaunderson
    I am trying to parse the following sample piece of XML: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soapenv:Body> <d2LogicalModel modelBaseVersion="1.0" xmlns="http://datex2.eu/schema/1_0/1_0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datex2.eu/schema/1_0/1_0 http://datex2.eu/schema/1_0/1_0/DATEXIISchema_1_0_1_0.xsd"> <payloadPublication xsi:type="PredefinedLocationsPublication" lang="en"> <predefinedLocationSet id="GUID-NTCC-VariableMessageSignLocations"> <predefinedLocation id="VMS30082775"> <predefinedLocationName> <value lang="en">VMS M60/9084B</value> </predefinedLocationName> </predefinedLocation> </predefinedLocationSet> </payloadPublication> </d2LogicalModel> </soapenv:Body> </soapenv:Envelope> I specifically need to get at the contents of the top-level predefinedLocation tag. By my calculations, the correct XPath should be /soapenv:Envelope/soapenv:Body/d2LogicalModel/payloadPublication/predefinedLocationSet/predefinedLocation I am using the following C# code to parse the XML: string filename = "content-sample.xml"; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(filename); XmlNamespaceManager nsmanager = new XmlNamespaceManager(xmlDoc.NameTable); nsmanager.AddNamespace("soapenv", "http://schemas.xmlsoap.org/soap/Envelope"); string xpath ="/soapenv:Envelope/soapenv:Body/d2LogicalModel/payloadPublication/predefinedLocationSet/predefinedLocation"; XmlNodeList itemNodes = xmlDoc.SelectNodes(xpath, nsmanager); However, this keeps coming up with no results. Can anyone shed any light on this, because I feel like I'm banging my head on a brick wall.

    Read the article

  • Compiling scalafx for Java 7u7 (that contains JavaFX 2.2) on OS X

    - by akauppi
    The compilation instructions of scalafx says to do: export JAVAFX_HOME=/Path/To/javafx-sdk2.1.0-beta sbt clean compile package make-pom package-src However, with the new packaging of JavaFX as part of the Java JDK itself (i.e. 7u7 for OS X) there no longer seems to be such a 'javafx-sdkx.x.x' folder. The Oracle docs say that JavaFX JDK is placed alongside the main Java JDK (in same folders). So I do: $ export JAVAFX_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk $ sbt clean [warn] Using project/plugins/ (/Users/asko/Sources/scalafx/project/plugins) for plugin configuration is deprecated. [warn] Put .sbt plugin definitions directly in project/, [warn] .scala plugin definitions in project/project/, [warn] and remove the project/plugins/ directory. [info] Loading project definition from /Users/asko/Sources/scalafx/project/plugins/project [info] Loading project definition from /Users/asko/Sources/scalafx/project/plugins [error] java.lang.NullPointerException [error] Use 'last' for the full log. Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? Am I doing something wrong or is scalafx not yet compatible with the latest Java release (7u7, JavaFX 2.2). What can I do? http://code.google.com/p/scalafx/ Addendum ..and finally (following Igor's solution below) sbt run launches the colorful circles demo easily (well, if one has a supported GPU that is). Oracle claims that "JavaFX supports graphic hardware acceleration on any Mac OS X system that is Lion or later" but I am inclined to think the NVidia powered Mac Mini I'm using does software rendering. A recent MacBook Air (core i7) is a complete different beast! :)

    Read the article

  • error when trying to install nokogiri

    - by sam
    im trying to install nokogiri to use in a ruby on rails application to read xml files, ive been following the instructions on their page for home brew 0.9, when i try and install the libivcon from source as bellow wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz tar xvfz libiconv-1.13.1.tar.gz cd libiconv-1.13.1 ./configure --prefix=/usr/local/Cellar/libiconv/1.13.1 make sudo make install i get the following error `make: *** No rule to make target `install'. Stop.` any idea why that might be ? sorry if the answers a real simple one im pretty new to ror / terminal and ive been going round in loops with this for almost a day, any helps much appreciated !

    Read the article

  • Update tile notifcation with XML returned by web service

    - by tempid
    I have a Metro app in C# & XAML. The tile is updated periodically and I've used WebAPI to serve the tile notification XML. So far so good. I was then told that I cannot use WebAPI as the server that I was planning to host it on does not have .NET 4.5. No plans to install it anytime soon either. I had to change the WebAPI to a plain old Web service (.NET 3.5) which does the same thing - return tile notification XML. I've enabled HTTP-GET (I know, security concern) and was able to invoke the webservice like this - http://server/TileNotifications.asmx/[email protected] But ever since I made the switch, the tiles are not being updated. I've checked Fiddler and made sure the app is hitting the webservice and the XML is being returned correctly. But the tiles are not updated. If I replace it with the WebAPI, the tiles are updated. Do I need to do anything special with the web services? like decorating the web method with a custom attribute? Here's my web service code - [WebMethod] public XmlDocument GetTileData(string user) { // snip var xml = new XmlDocument(); xml.LoadXml(string.Format(@"<tile> <visual> <binding template='TileWideSmallImageAndText02'> <image id='1' src='http://server/images/{0}_wide.png'/> <text id='1'>Custom Field : {1}/text> <text id='2'>Custom Field : {2}</text> <text id='3'>Custom Field : {3}</text> </binding> <binding template='TileSquarePeekImageAndText01'> <image id='1' src='http://server/images/{0}_square.png'/> <text id='1'>Custom Field</text> <text id='2'>{1}</text> </binding> </visual> </tile>", value1, value2, value3, value4)); return xml; }

    Read the article

  • Aligning inputs on bootstrap using the Fluid Grid System

    - by sguha
    I am creating a form that requires the user to input their name and email address. The first line of the form has two inputs side by side for each part of the name and the 2nd line has one input for the email address that should be the same width as the first line combined. I'm trying to use the fluid grid system but can't line up the 2nd row with the first. <form action="/subscriptions" method="post"> <fieldset> <div class="control-group"> <label class="control-label" for="name">Name</label> <div class="controls row-fluid"> <input class="span2" id="first_name" name="first_name" placeholder="First" required="required" type="text"> <input class="span2" id="last_name" name="last_name" placeholder="Last" required="required" type="text"> </div> </div> <div class="control-group"> <label class="control-label" for="email">Email</label> <div class="controls row-fluid"> <input class="span4" id="email" name="email" type="email"> </div> </div> </fieldset> </form>? http://jsfiddle.net/sguha095/v4amX/

    Read the article

  • Windows 2008 and wrong BPL loading [SOLVED]

    - by Beto Neto
    I have an application builded with Run-time Packages. When the executable starts it auto loads the required packages (.bpl). Recently we has installed an Windows 2008 R2 server to use as Terminal Services. We maintain some old compiled versions of our application in different paths, like this: c:\app\version_1\common.bpl c:\app\version_1\app.exe c:\app\version_2\common.bpl c:\app\version_2\app.exe Common.bpl is the a run-time package what app.exe depends on. THE PROBLEM: I start "c:\app\version_2\app.exe" and it loads "c:\app\version_2\common.bpl". When I start the "c:\app\version_1\app.exe" it loads the WRONG bpl (from version_2). The path "c:\app\version_2\" isn't at the system search path. At Windows2003 server this problem doesn't occurs. What can I do to solve this? Thanks! I have downloaded the Process Explorer (microsoft sysinternals), and checked the loaded modules of each executable, all they are correct! But I noticed another problem. After start the second version, an entry-not-found-error occurs, telling me what a initialization entry point, of an unit what only exists in one of the versions, could not be found. Something is very strange. The ProcessExplorer is telling me that the process is loading the correct modoles, but when they are running this seems not be happening. Seems the applications are sharing the loaded modules. SOLVED There was a MouseHook using FindVCLWindow, this was generating the AV. Sorry about inconvenience guys, and thanks!

    Read the article

  • Multi Player game using Nodejs and Socket IO

    - by Kishorevarma
    I am trying out multi player racing game using Node and Socket IO ,express . So I have tried simple example to see the latency between node server and the clients. I have a draggable image in client . when I move the image ienter code heren one client ,it has to move in all clients. so basically when I am moving the image I am sending the image position to the node server in a json format , then from there I am broadcasting to all clients. there is a ~approx 300ms latency from the time. following are the results. Client 1 sending data to server at : 286136 (timestamp) Server received at : 286271 Client2 received data at : 286470 Client3 received data at : 286479 Client4 received data at : 286487 Client5 received data at : 286520 the latency between move from client1 to client5 is 384ms. its too hight for a racing game .. here is my server code. var app = require('express').createServer(); var io = require('socket.io'); var http = require('http'); var http_server = http.createServer(); var server = http.createServer(app); server.listen(3000); var socket = io.listen(server,{ log: false }); socket.sockets.on('connection', function (client) { client.on('message', function (data){ console.log("data arrived to server",new Date().getTime()); // Below both statements are giving same latency between the client 1 and client 5 client.broadcast.emit('message',data); //socket.sockets.emit('message',data); }); }); 1) Is there any way to optimize the server code to reduce the latency? 2) is this expected latency using node and websockets ? 3) is socket io can't broadcast the data asynchronously (I mean at a same time) ? Thanks Kishorevarma

    Read the article

  • I cannot get mlocManager.removeUpdates(mlocListener); to work

    - by Colin
    I have an app that uses the LocationManage functions which works well until the app is stopped or paused. The location listener function is still carrying on in the background. Relevant bits of code follow. When I click home or back the onstop() function is being triggered correctly. package uk.cr.anchor; import android.app.Activity; import android.content.Context; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.media.MediaPlayer; import android.media.RingtoneManager; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.TableRow; import android.widget.Toast; import android.widget.ToggleButton; import android.content.SharedPreferences; import android.graphics.Color; public class main extends Activity { /** Called when the activity is first created. */ private LocationManager mlocManager; private LocationListener mlocListener; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); LocationListener mlocListener = new MyLocationListener(); mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener); } @Override protected void onStop(){ stoplistening(); super.onStop(); } /* Class My Location Listener */ public class MyLocationListener implements LocationListener { @Override public void onLocationChanged(Location loc) { loc.getLatitude(); loc.getLongitude(); etc etc etc } private void stoplistening() { if (mlocManager != null) { Toast.makeText( getApplicationContext(), "kill", Toast.LENGTH_SHORT ).show(); mlocManager.removeUpdates(mlocListener); } else { Toast.makeText( getApplicationContext(), " not kill", Toast.LENGTH_SHORT ).show(); } } } I always get the "not kill" message. Can anyone help me!

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >