Search Results

Search found 9816 results on 393 pages for 'world engineer'.

Page 23/393 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Asynchronous Silverlight 4 call to the World of Warcraft armoury streaming XML in C#

    - by user348446
    Hello - I have been stuck on this all weekend and failed miserably! Please help me to claw back my sanity!! Your challenge For my first Silverlight application I thought it would be fun to use the World of Warcraft armoury to list the characters in my guild. This involves making an asyncronous from Silverlight (duh!) to the WoW armoury which is XML based. SIMPLE EH? Take a look at this link and open the source. You'll see what I mean: http://eu.wowarmory.com/guild-info.xml?r=Eonar&n=Gifted and Talented Below is code for getting the XML (the call to ShowGuildies will cope with the returned XML - I have tested this locally and I know it works). I have not managed to get the expected returned XML at all. Notes: If the browser is capable of transforming the XML it will do so, otherwise HTML will be provided. I think it examines the UserAgent I am a seasoned asp.net web developer C# so go easy if you start talking about native to Windows Forms / WPF I can't seem to set the UserAgent setting in .net 4.0 - doesn't seem to be a property off the HttpWebRequest object for some reason - i think it used to be available. Silverlight 4.0 (created as 3.0 originally before I updated my installation of Silverlight to 4.0) Created using C# 4.0 Please explain as if you talking to a web developer and not a proper programming lol! Below is the code - it should return the XML from the wow armoury. private void button7_Click(object sender, RoutedEventArgs e) { // URL for armoury lookup string url = @"http://eu.wowarmory.com/guild-info.xml?r=Eonar&n=Gifted and Talented"; // Create the web request HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url); // Set the user agent so we are returned XML and not HTML //httpWebRequest.Headers["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)"; // Not sure about this dispatcher thing - it's late so i have started to guess. Dispatcher.BeginInvoke(delegate() { // Call asyncronously IAsyncResult asyncResult = httpWebRequest.BeginGetResponse(ReqCallback, httpWebRequest); // End the response and use the result using (HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.EndGetResponse(asyncResult)) { // Load an XML document from a stream XDocument x = XDocument.Load(httpWebResponse.GetResponseStream()); // Basic function that will use LINQ to XML to get the list of characters. ShowGuildies(x); } }); } private void ReqCallback(IAsyncResult asynchronousResult) { // Not sure what to do here - maybe update the interface? } Really hope someone out there can help me! Thanks mucho! Dan. PS Yes, I have noticed the irony in the name of the guild :)

    Read the article

  • How do you unit test the real world?

    - by Kim Sun-wu
    I'm primarily a C++ coder, and thus far, have managed without really writing tests for all of my code. I've decided this is a Bad Idea(tm), after adding new features that subtly broke old features, or, depending on how you wish to look at it, introduced some new "features" of their own. But, unit testing seems to be an extremely brittle mechanism. You can test for something in "perfect" conditions, but you don't get to see how your code performs when stuff breaks. A for instance is a crawler, let's say it crawls a few specific sites, for data X. Do you simply save sample pages, test against those, and hope that the sites never change? This would work fine as regression tests, but, what sort of tests would you write to constantly check those sites live and let you know when the application isn't doing it's job because the site changed something, that now causes your application to crash? Wouldn't you want your test suite to monitor the intent of the code? The above example is a bit contrived, and something I haven't run into (in case you haven't guessed). Let me pick something I have, though. How do you test an application will do its job in the face of a degraded network stack? That is, say you have a moderate amount of packet loss, for one reason or the other, and you have a function DoSomethingOverTheNetwork() which is supposed to degrade gracefully when the stack isn't performing as it's supposed to; but does it? The developer tests it personally by purposely setting up a gateway that drops packets to simulate a bad network when he first writes it. A few months later, someone checks in some code that modifies something subtly, so the degradation isn't detected in time, or, the application doesn't even recognize the degradation, this is never caught, because you can't run real world tests like this using unit tests, can you? Further, how about file corruption? Let's say you're storing a list of servers in a file, and the checksum looks okay, but the data isn't really. You want the code to handle that, you write some code that you think does that. How do you test that it does exactly that for the life of the application? Can you? Hence, brittleness. Unit tests seem to test the code only in perfect conditions(and this is promoted, with mock objects and such), not what they'll face in the wild. Don't get me wrong, I think unit tests are great, but a test suite composed only of them seems to be a smart way to introduce subtle bugs in your code while feeling overconfident about it's reliability. How do I address the above situations? If unit tests aren't the answer, what is? Thanks!

    Read the article

  • mouse to Three.js world coordinates during TrackballControls

    - by PanChan
    I know there are a lot of answers how to translate the mouse coordinates to the Three.js world coordinates (I prefere this one). But I have troubles on calculating when using TrackballControls. First what I expect to do: I want to add a zoom function to my scene. Not by the mouse wheel, the user should be able to draw a rectangular and by lifting the mouse button, the camera is zooming on this rectangular. I've implemented all and it works, but only when the user didn't rotate/zoom/pan with TrackballControls! If the camera was manipulated, I get wrong coordinates for my drawn rectangular. I really can't figure out why... I only know that it's an issue with TrackballControls, because without them, it works. Does anyone see my mistake? I'm sitting here for two days now and can't find it.... :( var onZoomPlaneMouseDown = function(event){ event.preventDefault(); var plane = document.getElementById("zoomPlane"); var innerPlane = document.getElementById("innerZoomPlane"); var mouseButton = event.keyCode || event.which; mouse.x = ( event.clientX / WIDTH ) * 2 - 1; mouse.y = - ( event.clientY / HEIGHT ) * 2 + 1; if(mouseButton === 1){ var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 ); projector.unprojectVector( vector, camera ); var dir = vector.sub( camera.position ).normalize(); var distance = - camera.position.z / dir.z; zoomPlaneUpperCorner = camera.position.clone().add( dir.multiplyScalar( distance ) ); innerPlane.style.display = "block"; innerPlane.style.top = event.clientY + "px"; innerPlane.style.left = event.clientX + "px"; } if(mouseButton === 3){ plane.style.display = "none"; innerPlane.style.display = "none"; } }; var onZoomPlaneMouseUp = function(event){ event.preventDefault(); var plane = document.getElementById("zoomPlane"); var innerPlane = document.getElementById("innerZoomPlane"); var mouseButton = event.keyCode || event.which; mouse.x = ( event.clientX / WIDTH ) * 2 - 1; mouse.y = - ( event.clientY / HEIGHT ) * 2 + 1; var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 ); projector.unprojectVector( vector, camera ); var dir = vector.sub( camera.position ).normalize(); var distance = - camera.position.z / dir.z; zoomPlaneLowerCorner = camera.position.clone().add( dir.multiplyScalar( distance ) ); if(mouseButton === 1){ plane.style.display = "none"; innerPlane.style.display = "none"; var center = new THREE.Vector3(); center.subVectors(zoomPlaneLowerCorner, zoomPlaneUpperCorner); center.multiplyScalar( 0.5 ); center.add(zoomPlaneUpperCorner); var rayDir = new THREE.Vector3(); rayDir.subVectors(center, camera.position ).normalize(); controls.target = center; var height = zoomPlaneUpperCorner.y - zoomPlaneLowerCorner.y; var distanceToCenter = camera.position.distanceTo(center); var minDist = (height / 2) / (Math.tan((camera.fov/2)*Math.PI/180)); camera.translateOnAxis(rayDir, (distanceToCenter - minDist)); } };

    Read the article

  • Errors with the Basic OpenCV Hello World

    - by GuyNoir
    I'm simply trying to run the basic openCV hello world tutorial code, but I'm getting errors. I have everything properly linked and built, but it's not working. This seems like it should be extremely easy, but it's not working. OpenCV is properly installed, and I even attempted to place opencv_core220d and opencv_highgui220d in the Debug folder of my project, but no luck. I'm running Visual Studio 2010 under Windows 7 64bit. Here's the errors: 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Users\John\Documents\Visual Studio 2010\Projects\Webcam test\Debug\opencv_core220d.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded. 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded. 'Webcam test.exe': Loaded 'C:\Users\John\Documents\Visual Studio 2010\Projects\Webcam test\Debug\opencv_highgui220d.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7600.16661_none_ebfb56996c72aefc\comctl32.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\avifil32.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\msacm32.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\msvfw32.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\avicap32.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file 'Webcam test.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file The program '[5512] Webcam test.exe: Native' has exited with code 1 (0x1). Here's my code: // OpenCV_Helloworld.cpp : Defines the entry point for the console application. // Created for build/install tutorial, Microsoft Visual Studio and OpenCV 2.2.0 #include "stdafx.h" #include <cv.h> #include <cxcore.h> #include <highgui.h> int _tmain(int argc, _TCHAR* argv[]) { // Open the file. IplImage *img = cvLoadImage("photo.jpg"); if (!img) { printf("Error: Couldn't open the image file.\n"); return 1; } // Display the image. cvNamedWindow("Image:", CV_WINDOW_AUTOSIZE); cvShowImage("Image:", img); // Wait for the user to press a key in the GUI window. cvWaitKey(0); // Free the resources. cvDestroyWindow("Image:"); cvReleaseImage(&img); for(int i = 0; i < 10000; i++){ printf("Error: Could"); } return 0; }

    Read the article

  • openDatabase Hello World - 2

    - by cf_PhillipSenn
    This is a continuation from a previous stackoverflow question. I've renamed some variables so that I can tell what are keywords and what are names that I can control. Q: Why is the deleteRow function not working? <html> <head> <title>html5 openDatabase Hello World</title> <script src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("jquery", "1"); google.setOnLoadCallback(OnLoadCallback); function OnLoadCallback() { var dbo; dbo = openDatabase('HelloWorld'); dbo.transaction( function(T1) { T1.executeSql( 'CREATE TABLE IF NOT EXISTS myTable ' + ' (myTableID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, ' + ' Field1 TEXT NOT NULL );' ); } ); dbo.transaction(function(T2) { T2.executeSql('SELECT * FROM myTable',[], function (T6, result) { for (var i=0; i < result.rows.length; i++) { var row = result.rows.item(i); $('#savedData').append('<li id="'+row.myTableID+'">' + row.Field1 + '</li>'); } }, errorHandler); }); $('form').submit(function() { var xxx = $('#xxx').val(); dbo.transaction( function(T3) { T3.executeSql( 'INSERT INTO myTable (Field1) VALUES (?);', [xxx], function(){ $('#savedData').append('<li id="ThisisWhereIneedHELP">' + xxx + '</li>'); $('#xxx').val(''); }, errorHandler ); } ); return false; }); $('#savedData > li').live('click', function (){ deleteRow(this.id); $(this).remove(); }); } function deleteRow(myTableID) { alert('trying to delete'); dbo.transaction(function(T4) { T4.executeSql('DELETE FROM myTable WHERE myTableID = ?', [myTableID], function(){ alert('Deleted!'); }, errorHandler); }); } function errorHandler(T5, error) { alert('Oops. Error was '+error.message+' (Code '+error.code+')'); // T5.executeSql('INSERT INTO errors (code, message) VALUES (?, ?);', // [error.code, error.message]); return false; } </script> </head> <body> <form method="post"> <input name="xxx" id="xxx" /> <p> <input type="submit" name="OK" /> </p> <ul id="savedData"> </ul> </form> </body> </html>

    Read the article

  • How can I solve for the game's world coordinates?

    - by HyperGroups
    I've used 3DReaperDX to get a obj file, the header information are shown as follows: #AR=2.00606, FOV=45.09583(height), Xscale:0.83290, Yscale:0.41519, Zscale:1.0 #************************************************** #ALPHABLENDENABLE: No #ZENABLE: Yes #ZWRITEENABLE: Yes #TWOSIDED: No #INVALID: No #THIN: No #RENDERTARGET_IS_BACKBUFFER: Yes #WIDTH_DO_MATCH: Yes #RGBWRITEDISABLED: No # object DrawCall_0 to come ... g v 2143.35547 6654.99023 25835.37109 v 2243.17773 6296.61523 25957.53906 v 2343.00000 5856.84473 26093.97656 How can I get the game's world coordinates. For example: I can map the scaleTransform to the VertexData scaleTransform={X1scale,Y1scale,Z1scale} {0.8329,0.41519,1.} Is the obj file enough to get the game's world coordinates? I want to put a object in this ground, and the coordinates is the same to that in the Game Engine, And I can place something(with some fixed coordinates) in the Game and then to use 3DReaper to get the obj file. If the file is not enough itself to get the game world coordinates.

    Read the article

  • Oracle HCM World: Evite Now Available! February 4-6, Las Vegas

    - by Roxana Babiciu
    Add that personal touch by inviting your human capital management partners to HCM World with our new evite! Oracle HCM World is where HR, talent management and technology intersect. This is the event for HCM professionals, whether they are involved in recruiting and staffing, learning and development, compensation and benefits, or any other aspect of HR. Nine tracks and more than 90 sessions will unveil invaluable strategy and best practices to more than 1,500 attendees. Mark Hurd and David Rock, industry luminary and CRO of NeuroLeadership Group are both confirmed as keynote speakers. The call for papers deadline has been extended to November 15 and early bird registration ends November 22. Visit the HCM World website and Field Flash for more information.

    Read the article

  • Why do bind1st and bind2nd require constant function objects?

    - by rlbond
    So, I was writing a C++ program which would allow me to take control of the entire world. I was all done writing the final translation unit, but I got an error: error C3848: expression having type 'const `anonymous-namespace'::ElementAccumulator<T,BinaryFunction>' would lose some const-volatile qualifiers in order to call 'void `anonymous-namespace'::ElementAccumulator<T,BinaryFunction>::operator ()(const point::Point &,const int &)' with [ T=SideCounter, BinaryFunction=std::plus<int> ] c:\program files (x86)\microsoft visual studio 9.0\vc\include\functional(324) : while compiling class template member function 'void std::binder2nd<_Fn2>::operator ()(point::Point &) const' with [ _Fn2=`anonymous-namespace'::ElementAccumulator<SideCounter,std::plus<int>> ] c:\users\****\documents\visual studio 2008\projects\TAKE_OVER_THE_WORLD\grid_divider.cpp(361) : see reference to class template instantiation 'std::binder2nd<_Fn2>' being compiled with [ _Fn2=`anonymous-namespace'::ElementAccumulator<SideCounter,std::plus<int>> ] I looked in the specifications of binder2nd and there it was: it took a const AdaptibleBinaryFunction. So, not a big deal, I thought. I just used boost::bind instead, right? Wrong! Now my take-over-the-world program takes too long to compile (bind is used inside a template which is instantiated quite a lot)! At this rate, my nemesis is going to take over the world first! I can't let that happen -- he uses Java! So can someone tell me why this design decision was made? It seems like an odd decision. I guess I'll have to make some of the elements of my class mutable for now...

    Read the article

  • How can I create an Assembly program WITHOUT using libraries?

    - by Newbie
    Hello. I've literally only just started looking to learn Assembly language. I'm using the NASM assembler on Windows Vista. Usually, when I begin to learn a new language, I'll copy someone else's Hello World code and try to understand it line-by-line. However, I'm finding it suprisingy difficult to find a Hello World program that doesn't reference other libraries! You see, there's no point trying to understand each line of the code if it is closely linked with a whole library of additional code! One of the reasons I want to learn Assembly is so that I can have near complete control over the programs I write. I don't want to be depending on any libraries. And so my question is this: Can anyone give me NASM-compatible Assembly code to a completely stand-alone Hello World program that can output to the Windows Vista console? Alternatively, I appreciate that a library may be required to tell the pogram WHERE to print the output (ie. the Windows console). Other than that, I can't see why any libraries should be required. Am I overlooking anything?

    Read the article

  • Dependently typed language best suited to “real world” programming?

    - by Kim
    Which dependently typed programming languages could be used for real world application development? I will mostly be writing toy applications at first, after that maybe web development or a simple DBMS. These are some points, that I think are important: documentation example programs a good/big standard library an easy to use foreign function interface a community of people using the language for real world tasks tool support

    Read the article

  • Create Hello World with RESTful web service and Jersey

    - by Harry Pham
    I follow tutorial here on how to create web service using RESTful web service and Jersey and I get kind of stuck. The code is from HelloWorld3 in the tutorial I linked above. Here is the code. I use Netbean6.8 + glassfish v3 RESTGreeting.java create using JAXB. This class represents the HTML message in Java package com.sun.rest; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlElement; @XmlRootElement(name = "restgreeting") public class RESTGreeting { private String message; private String name; /** * Creates new instance of Greeting */ public RESTGreeting() { } /* Create new instance of Greeting * with parameters message and name */ public RESTGreeting( String message, String name) { this.message = message; this.name = name; } /** Getter for message * return value for message * */ @XmlElement public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } /* Getter for name * return name */ @XmlElement public String getName() { return name; } public void setName(String name) { this.name = name; } } HelloGreetingService.java creates a RESTful web service that returns an HTML message package com.sun.rest; import javax.ws.rs.core.Context; import javax.ws.rs.core.UriInfo; import javax.ws.rs.Consumes; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.GET; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; @Path("helloGreeting") public class HelloGreetingService { @Context private UriInfo context; /** Creates a new instance of HelloGreetingService */ public HelloGreetingService() { } /** * Retrieves representation of an instance of com.sun.rest.HelloGreetingService * @return an instance of java.lang.String */ @GET @Produces("text/html") public RESTGreeting getHtml(@QueryParam("name") String name) { return new RESTGreeting( getGreeting(), name); } private String getGreeting() { return "Hello "; } /** * PUT method for updating or creating an instance of HelloGreetingService * @param content representation for the resource * @return an HTTP response with content of the updated or created resource. */ @PUT @Consumes("text/html") public void putHtml(String content) { } } However when i deploy it on Glassfish, and run it. It generate an exception. I try to debug using netbean 6.8, and figure out that this line return new RESTGreeting(getGreeting(), name); in HelloGreetingService.java cause the exception. But not sure why. Here is the stacktrace javax.ws.rs.WebApplicationException at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:268) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1029) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:941) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:932) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:384) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:451) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:632) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97) at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) at java.lang.Thread.run(Thread.java:637)

    Read the article

  • Play Framework: Real-world production experiences?

    - by Rob
    Has anyone used the Play framework for a reasonably complex or large, deployed production app yet? If so, I would like to hear what the pros and cons of that experience were and what you might do differently if you could start over. In particular, I'm interested in how well it worked for projects that are big enough that it requires a small team and/or apps that had requirements that go beyond what demo/test projects can (e.g. scalability requirements). The other question on this topic does not cover use in production, and as we all know, the true wins (and gotchas) of platforms often don't show up until used in battle.

    Read the article

  • Static compilation in the .NET world

    - by AngryHacker
    I'll be writing a small desktop app for a client that has WinXP machines and they won't be installing the .NET framework (at least not for me). So my choices are limited to either C++ or VB6, neither of which sound great. I remember reading back in the day that Mono came up with a static compiler, but recently the only thing I could find is Miguel de Icaza's entry on static compilation for a game engine for the purposes of running the app on the iPhone - not what I had in mind. Are there any products out there, free or commercial that will allow me to statically compile my .net 3.5 winform app? Thanks

    Read the article

  • More issues with IntelliJ 9.0.1 "Hello World" in Scala - Predef version 5.0 vs 4.1

    - by Alex R
    Any ideas what could cause this? Scala signature Predef has wrong version Expected 5.0 found: 4.1 in .... scala-library.jar I tried both versions 2.7.6 and 2.8 RC1 of scala-*.jar, the result was the same. JDK is 1.6.u20. UPDATE Today uninstalled IntelliJ 9.0.1, and installed 9.0.2 Early Availability, with the 4/14 stable version of the Scala plug-in. Then I setup a project from scratch through the wizards: new project from scratch JDK is 1.6.u20 accept the default (project) instead of global / module accept the download of Scala 2.8.0beta1 into project's lib folder Created a new class: object hello { def main(args: Array[String]) { println("hello: " + args); } } For my efforts, I now have a brand-new error :) Here it is: Scalac internal error: class java.lang.ClassNotFoundException [java.net.URLClassLoader$1.run(URLClassLoader.java:202), java.security.AccessController.doPrivileged(Native Method), java.net.URLClassLoader.findClass(URLClassLoader.java:190), java.lang.ClassLoader.loadClass(ClassLoader.java:307), sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301), java.lang.ClassLoader.loadClass(ClassLoader.java:248), java.lang.Class.forName0(Native Method), java.lang.Class.forName(Class.java:169), org.jetbrains.plugins.scala.compiler.rt.ScalacRunner.main(ScalacRunner.java:72)] Thanks

    Read the article

  • Hello-World-grade landscape Android app fails to start (complete code included)

    - by WingedCat
    I'm trying to develop a simple Android app, fixed in landscape mode. I am using Eclipse 1.3, compiling for Android SDK version 7 (OS version 2.1). When I try to run it in the emulator, it crashes on boot. (It gets as far as the unlock slider, but shortly after that when trying to launch the application itself, I get "The application Failtest (process com.wcs.failtest) has stopped unexpectedly. Please try again.".) Here is main.xml (with the tags escaped so this displays properly): <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="480px" android:layout_height="320px" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="96px" android:layout_height="320px" android:id="@+id/action_menu" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="96px" android:layout_height="48px" > <Button android:layout_width="48px" android:layout_height="48px" android:background="#f00" android:id="@+id/action_button_11" /> </LinearLayout> </LinearLayout> </LinearLayout> Here is AndroidManifest.xml (again with the tags escaped so this displays properly): <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.wcs.failtest" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> <activity android:name=".FailtestActivity" android:screenOrientation="landscape" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="7" /> </manifest> And here is FailtestActivity.java: package com.wcs.failtest; import android.app.Activity; import android.os.Bundle; import android.widget.Button; import android.view.View.OnClickListener; import android.view.View; public class FailtestActivity extends Activity { private OnClickListener action11Listener = new OnClickListener() { public void onClick(View v) { } }; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Button button; button = (Button)findViewById(R.id.action_button_11); button.setOnClickListener(action11Listener); setContentView(R.layout.main); } } I suspect it is something simple I'm overlooking. What is it?

    Read the article

  • Singleton pattern and broken double checked locking in real world java application

    - by saugata
    I was reading the article Double-checked locking and the Singleton pattern, on how double checked locking is broken, and some related questions here on stackoverflow. I have used this pattern/idiom several times without any issues. Since I have been using Java 5, my first thought was that this has been rectified in Java 5 memory model. However the article says This article refers to the Java Memory Model before it was revised for Java 5.0; statements about memory ordering may no longer be correct. However, the double-checked locking idiom is still broken under the new memory model. I'm wondering if anyone has actually run into this problem in any application and under what conditions.

    Read the article

  • $.ajax ColdFusion cfc JSON Hello World

    - by cf_PhillipSenn
    I've simplified this example as much as I can. I have a remote function: <cfcomponent output="false"> <cffunction name="Read" access="remote" output="false"> <cfset var local = {}> <cfquery name="local.qry" datasource="myDatasource"> SELECT PersonID,FirstName,LastName FROM Person </cfquery> <cfreturn local.qry> </cffunction> </cfcomponent> And using the jQuery $.ajax method, I would like to make an unordered list of everyone. <!DOCTYPE HTML> <html> <head> <script src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("jquery", "1"); </script> <script type="text/javascript"> jQuery(function($){ $.ajax({ url: "Remote/Person.cfc?method=Read&ReturnFormat=json", success: function(data){ var str = '<ul>'; // This is where I need help: for (var I=0; I<data.length; I++) { str += '<li>' + I + data[I][1]+ '</li>' } str += '</ul>'; $('body').html(str); }, error: function(ErrorMsg){ console.log("Error"); } }); }); </script> </head> <body> </body> </html> The part where I'm lost is where I'm looping over the data. I prefer to the use jQuery $.ajax method because I understand that $.get and $.post don't have error trapping. I don't know how to handle JSON returned from the cfc.

    Read the article

  • Unit Testing in the real world

    - by Malfist
    I manage a rather large application (50k+ lines of code) by myself, and it manages some rather critical business actions. To describe the program simple, I would say it's a fancy UI with the ability to display and change data from the database, and it's managing around 1,000 rental units, and about 3k tenants and all the finances. When I make changes, because it's so large of a code base, I sometimes break something somewhere else. I typically test it by going though the stuff I changed at the functional level (i.e. I run the program and work through the UI), but I can't test for every situation. That is why I want to get started with unit testing. However, this isn't a true, three tier program with a database tier, a business tier, and a UI tier. A lot of the business logic is performed in the UI classes, and many things are done on events. To complicate things, everything is database driven, and I've not seen (so far) good suggestions on how to unit test database interactions. How would be a good way to get started with unit testing for this application. Keep in mind. I've never done unit testing or TDD before. Should I rewrite it to remove the business logic from the UI classes (a lot of work)? Or is there a better way?

    Read the article

  • A simple Python deployment problem - a whole world of pain

    - by Evgeny
    We have several Python 2.6 applications running on Linux. Some of them are Pylons web applications, others are simply long-running processes that we run from the command line using nohup. We're also using virtualenv, both in development and in production. What is the best way to deploy these applications to a production server? In development we simply get the source tree into any directory, set up a virtualenv and run - easy enough. We could do the same in production and perhaps that really is the most practical solution, but it just feels a bit wrong to run svn update in production. We've also tried fab, but it just never works first time. For every application something else goes wrong. It strikes me that the whole process is just too hard, given that what we're trying to achieve is fundamentally very simple. Here's what we want from a deployment process. We should be able to run one simple command to deploy an updated version of an application. (If the initial deployment involves a bit of extra complexity that's fine.) When we run this command it should copy certain files, either out of a Subversion repository or out of a local working copy, to a specified "environment" on the server, which probably means a different virtualenv. We have both staging and production version of the applications on the same server, so they need to somehow be kept separate. If it installs into site-packages, that's fine too, as long as it works. We have some configuration files on the server that should be preserved (ie. not overwritten or deleted by the deployment process). Some of these applications import modules from other applications, so they need to be able to reference each other as packages somehow. This is the part we've had the most trouble with! I don't care whether it works via relative imports, site-packages or whatever, as long as it works reliably in both development and production. Ideally the deployment process should automatically install external packages that our applications depend on (eg. psycopg2). That's really it! How hard can it be?

    Read the article

  • Optimizing a 3D World Javascript Animation

    - by johnny
    Hi! I've recently come up with the idea to create a tag cloud like animation shaped like the earth. I've extracted the coastline coordinates from ngdc.noaa.gov and wrote a little script that displayed it in my browser. Now as you can imagine, the whole coastline consists of about 48919 points, which my script would individually render (each coordinate being represented by one span). Obviously no browser is capable of rendering this fluently - but it would be nice if I could render as much as let's say 200 spans (twice as much as now) on my old p4 2.8 Ghz (as a representative benchmark). Are there any javascript optimizations I could use in order to speed up the display of those spans? One 'coordinate': <div id="world_pixels"> <span id="wp_0" style="position:fixed; top:0px; left:0px; z-index:1; font-size:20px; cursor:pointer;cursor:hand;" onmouseover="magnify_world_pixel('wp_0');" onmouseout="shrink_world_pixel('wp_0');" onClick="set_askcue_bar('', 'new york')">new york</span> </div> The script: $(document).ready(function(){ world_pixels = $("#world_pixels span"); world_pixels.spin(); setInterval("world_pixels.spin()",1500); }); z = new Array(); $.fn.spin = function () { for(i=0; i<this.length; i++) { /*actual screen coordinates: x/y/z --> left/font-size/top 300/13/0 300/6/300 | / |/ 0/13/300 ----|---- 600/13/300 /| / | 300/20/300 300/13/600 */ /*scale font size*/ var resize_x = 1; /*scale width*/ var resize_y = 2.5; /*scale height*/ var resize_z = 2.5; var from_left = 300; var from_top = 20; /*actual math coordinates: 1 -1 | / |/ 1 ----|---- -1 /| / | 1 -1 */ //var get_element = document.getElementById(); //var font_size = parseInt(this.style.fontSize); var font_size = parseInt($(this[i]).css("font-size")); var left = parseInt($(this[i]).css("left")); if (coast_line_array[i][1]) { } else { var top = parseInt($(this[i]).css("top")); z[i] = from_top + (top - (300 * resize_z)) / (300 * resize_z); //global beacause it's used in other functions later on var top_new = from_top + Math.round(Math.cos(coast_line_array[i][2]/90*Math.PI) * (300 * resize_z) + (300 * resize_z)); $(this[i]).css("top", top_new); coast_line_array[i][3] = 1; } var x = resize_x * (font_size - 13) / 7; var y = from_left + (left- (300 * resize_y)) / (300 * resize_y); if (y >= 0) { this[i].phi = Math.acos(x/(Math.sqrt(x^2 + y^2))); } else { this[i].phi = 2*Math.PI - Math.acos(x/(Math.sqrt(x^2 + y^2))); i } this[i].theta = Math.acos(z[i]/Math.sqrt(x^2 + y^2 + z[i]^2)); var font_size_new = resize_x * Math.round(Math.sin(coast_line_array[i][4]/90*Math.PI) * Math.cos(coast_line_array[i][0]/180*Math.PI) * 7 + 13); var left_new = from_left + Math.round(Math.sin(coast_line_array[i][5]/90*Math.PI) * Math.sin(coast_line_array[i][0]/180*Math.PI) * (300 * resize_y) + (300 * resize_y)); //coast_line_array[i][6] = coast_line_array[i][7]+1; if ((coast_line_array[i][0] + 1) > 180) { coast_line_array[i][0] = -180; } else { coast_line_array[i][0] = coast_line_array[i][0] + 0.25; } $(this[i]).css("font-size", font_size_new); $(this[i]).css("left", left_new); } } resize_x = 1; function magnify_world_pixel(element) { $("#"+element).animate({ fontSize: resize_x*30+"px" }, { duration: 1000 }); } function shrink_world_pixel(element) { $("#"+element).animate({ fontSize: resize_x*6+"px" }, { duration: 1000 }); } I'd appreciate any suggestions to optimize my script, maybe there is even a totally different approach on how to go about this. The whole .js file which stores the array for all the coordinates is available on my page, the file is about 2.9 mb, so you might consider pulling the .zip for local testing: metaroulette.com/files/31218.zip metaroulette.com/files/31218.js P.S. the php I use to create the spans: <?php //$arbitrary_characters = array('a','b','c','ddsfsdfsdf','e','f','g','h','isdfsdffd','j','k','l','mfdgcvbcvbs','n','o','p','q','r','s','t','uasdfsdf','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9',); $arbitrary_characters = array('cat','table','cool','deloitte','askcue','what','more','less','adjective','nice','clinton','mars','jupiter','testversion','beta','hilarious','lolcatz','funny','obama','president','nice','what','misplaced','category','people','religion','global','skyscraper','new york','dubai','helsinki','volcano','iceland','peter','telephone','internet', 'dialer', 'cord', 'movie', 'party', 'chris', 'guitar', 'bentley', 'ford', 'ferrari', 'etc', 'de facto'); for ($i=0; $i<96; $i++) { $arb_digits = rand (0,45); $arbitrary_character = $arbitrary_characters[$arb_digits]; //$arbitrary_character = "."; echo "<span id=\"wp_$i\" style=\"position:fixed; top:0px; left:0px; z-index:1; font-size:20px; cursor:pointer;cursor:hand;\" onmouseover=\"magnify_world_pixel('wp_$i');\" onmouseout=\"shrink_world_pixel('wp_$i');\" onClick=\"set_askcue_bar('', '$arbitrary_character')\">$arbitrary_character</span>\n"; } ?>

    Read the article

  • Stuck at "Hello World" with IntelliJ IDEA 9.0.1 for Scala

    - by Alex R
    I've been using Eclipse since 2.x and and IDEs in general for over 20 years (since Turbo Pascal and Turbo C in the late '80s!). (that preamble is supposed to imply, "I'm not an idiot" ... LOL :-] ) I'm trying to use the debugger in IntelliJ 9.0.1. I've resigned myself to an old standby: class hello { def main(a: Array[String]) = println("got args: " + a) } Alas, I'm unable to get even this simple Scala example to run. I'd like to eventually put a breakpoint in it, but for now just running it would be great. I have Java 1.6u20 and the Scala plug-in 0.3.473 (January 2010). The error below summarizes my experience: What possibly could I be doing wrong? Thanks

    Read the article

  • Need help debugging a very basic PHP SOAP Hello world app

    - by WarDoGG
    I have been breaking my head at this, reading almost every article and tutorial there is on the web, but nothing doing.. i still cannot get my first web service application to work. I would really appreciate it if anyone could debug this code for me and provide me with a good explanation as to what is wrong and why. This will help indeed ! Thanks ! I have pasted below the entire codes that i am using making it easier to debug. I'm using the PHP5 SOAP extension. Here is my WSDL: <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions name="testWebservice" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s1="http://microsoft.com/wsdl/types/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"> <s:import namespace="http://microsoft.com/wsdl/types/" /> <s:element name="getUser"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="getUserResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="getUserResult" type="tns:userInfo" /> </s:sequence> </s:complexType> </s:element> <s:complexType name="userInfo"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="ID" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="authkey" type="s:int" /> </s:sequence> </s:complexType> </s:schema> </wsdl:types> <wsdl:message name="getUserSoapIn"> <wsdl:part name="parameters" element="tns:getUser" /> </wsdl:message> <wsdl:message name="getUserSoapOut"> <wsdl:part name="parameters" element="tns:getUserResponse" /> </wsdl:message> <wsdl:portType name="testWebservice"> <wsdl:operation name="getUser"> <wsdl:input message="tns:getUserSoapIn" /> <wsdl:output message="tns:getUserSoapOut" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="testWebserviceBinding" type="tns:testWebservice"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="getUser"> <soap:operation soapAction="http://tempuri.org/getUser" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="testWebserviceService"> <wsdl:port name="testWebservicePort" binding="tns:testWebserviceBinding"> <soap:address location="http://127.0.0.1/nusoap/storytruck/index.php" /> </wsdl:port> </wsdl:service> </wsdl:definitions> and here is the PHP Code i use to setup the server: <?php function getUser($user,$pass) { return array('ID'=>1); } ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache $server = new SoapServer("http://127.0.0.1/mywsdl.wsdl"); $server->addFunction('getUser'); $server->handle(); ?> and the code for the client: <?php $client = new SoapClient("http://127.0.0.1/index.php?wsdl", array('exceptions' => 0)); try { $result = $client->getUser("username","pass"); print_r($result); } catch (SoapFault $result) { print_r($result); } ?> Here is the ERROR output i am getting on the browser : SoapFault Object ( [message:protected] => Error cannot find parameter [string:Exception:private] => [code:protected] => 0 [file:protected] => C:\xampp\htdocs\client.php [line:protected] => 6 [trace:Exception:private] => Array ( [0] => Array ( [function] => __call [class] => SoapClient [type] => -> [args] => Array ( [0] => getUser [1] => Array ( [0] => username [1] => pass ) ) ) [1] => Array ( [file] => C:\xampp\htdocs\client.php [line] => 6 [function] => getUser [class] => SoapClient [type] => -> [args] => Array ( [0] => username [1] => pass ) ) ) [previous:Exception:private] => [faultstring] => Error cannot find parameter [faultcode] => SOAP-ENV:Client )

    Read the article

  • What is a real world example of bad code or programming practice

    - by Luke101
    I just want to know some bad programming practice or code I should avoid to make sure it does not exist in my code. I use c# asp.net but the example you give can be in any language since the idea is still the same. I have follow many suggestions on SO that really cleaned my code up. Now I looking to launch my application and want to make sure its ready for prime time.

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >