Daily Archives

Articles indexed Sunday February 20 2011

Page 3/10 | < Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • Handling cameras in a large scale game engine

    - by Hannesh
    What is the correct, or most elegant, way to manage cameras in large game engines? Or should I ask, how does everybody else do it? The methods I can think of are: Binding cameras straight to the engine; if someone needs to render something, they bind their own camera to the graphics engine which is in use until another camera is bound. A camera stack; a small task can push its own camera onto the stack, and pop it off at the end to return to the "main" camera. Attaching a camera to a shader; Every shader has exactly one camera bound to it, and when the shader is used, that camera is set by the engine when the shader is in use. This allows me to implement a bunch of optimizations on the engine side. Are there other ways to do it?

    Read the article

  • How was your experience working as a game tester?

    - by MrDatabase
    I'm currently an independent game developer. I'm open to the idea of working on a team in the game industry. I'm under the impression that being a "game tester" is a relatively easy way to get a job... however that job may be somewhat undesirable. So how was your experience working as a tester in the game industry? Some interesting experiences could include: Did the game tester position lead to other more desirable positions? How were the relationships between testers and developers? Did you write any code? (test "frameworks", unit tests etc) If bugs made it into production was any (potentially unfair) blame put on the testers?

    Read the article

  • Error Message-The source attachment does not contain the source for the file ListView.class

    - by user603695
    Hello, new to Android. I get the following message in the debugger perspective: The source attachment does not contain the source for the file ListView.class You can change the source attachment by clicking the change attached Source Below Needless to say the app errors. I've tried to change the source attachment to the location path: C:/Program Files/Android/android-sdk-windows/platforms/android-8/android.jar However, this did not work. Any thoughts would be much appreciated. Code is: import android.app.ListActivity; import android.os.Bundle; import android.view.*; import android.widget.*; public class HelloListView extends ListActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter<String>(this, R.layout.main, COUNTRIES)); ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // When clicked, show a toast with the TextView text Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_SHORT).show(); } }); } static final String[] COUNTRIES = new String[] { "Afghanistan", "Albania", "Algeria", "American Samoa... Thanks!

    Read the article

  • Read XML from an XDocument with silverlight

    - by user625310
    Hi I have managed to load an XDocument with xml data from this link http://go.yr.no/go/e/main/http://www.yr.no/place/Norway/Telemark/Sauherad/Gvarv/forecast.xml. I am using C# and .Net in Blend and producing a web app (ie some of the normal .Net functions is not included in the silverlight plugin). I have researched this a lot but can not figure out: how to put the "text" in the link node in a string variable and how to all put the "-11" from ? in a array and link it to the "time from"? I think i have to use LINQ, but the stuff on MSDN and other tutorials is confusing and to general. huge thank in advance Regards Arnt I am sorry to ask such novice questions, but i have searched a lot. Also please excuse the typos, English is not my first language. Huge thank in advance Arnt

    Read the article

  • Get type of the parameter from list of objects, templates, C++

    - by CrocodileDundee
    This question follows to my previous question Get type of the parameter, templates, C++ There is the following data structure: Object1.h template <class T> class Object1 { private: T a1; T a2; public: T getA1() {return a1;} typedef T type; }; Object2.h template <class T> class Object2: public Object1 <T> { private: T b1; T b2; public: T getB1() {return b1;} } List.h template <typename Item> struct TList { typedef std::vector <Item> Type; }; template <typename Item> class List { private: typename TList <Item>::Type items; }; Is there any way how to get type T of an object from the list of objects (i.e. Object is not a direct parameter of the function but a template parameter)? template <class Object> void process (List <Object> *objects) { typename Object::type a1 = objects[0].getA1(); // g++ error: 'Object1<double>*' is not a class, struct, or union type } But his construction works (i.e. Object represents a parameter of the function) template <class Object> void process (Object *o1) { typename Object::type a1 = o1.getA1(); // OK }

    Read the article

  • How to display an external content in my website using javascript

    - by Chris
    Hello! This is my first post! I have a question about javascript...here is my code: <html> <head> <title>Geolocation Demo</title> </head> <body> <h1>Geolocation Demo</h1> <p>Latitude: <span id="lat">0.00</span> Longitude: <span id="lon">0.00</span> City: <span id="city">Loading...</span></p> <p><a id="city_link" href="http://tinygeocoder.com/" target="_blank">View City</a></p> <p><a id="gmaps_link" href="http://maps.google.co.uk/" target="_blank">View on Google Maps</a></p> <script language="javascript"> // show the position on the page and make a google maps link function showPosition(position) { var lat = position.coords.latitude; var lon = position.coords.longitude; document.getElementById("lat").innerHTML = lat; document.getElementById("lon").innerHTML = lon; var gmaps_url = "http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q=" + lat + "+" + lon; var city_url = "http://tinygeocoder.com/create-api.php?g=" + lat + "," + lon; document.getElementById("gmaps_link").href = gmaps_url; document.getElementById("city_link").href = city_url; } </script> </body> </html> As you can see, this script target my geolocation. Specifically, Lat and Lon are working perfectly. In addinition, i want to display and region info (like city). So, i found a website which i provide the coordinates and it returns me a region name. My question is if i can display the name of region without clicking the link "View city" but in the field "city"...is it possible to pass the webpage content (http://tinygeocoder.com/create-api.php?g=" + lat + "," + lon;) into my webpage? The content of this page is only the name as i said...no html tags! Thank you!

    Read the article

  • CodeIgniter - Calling a function from inside a view

    - by Chris
    Hey, Is it possible to call a function which is located in a controller from a view. This is what i have in my controller, as an example function checkKeyExists($userid, $key){ } Then inside my view i have the following if(checkKeyExists($row->id, $role->key)){ } But when i run it, it says that checkKeyExists is not defined. If anyone can let me know how i could do this, that would be great. Cheers

    Read the article

  • help merging perl code routines together for file processing

    - by jdamae
    I need some perl help in putting these (2) processes/code to work together. I was able to get them working individually to test, but I need help bringing them together especially with using the loop constructs. I'm not sure if I should go with foreach..anyways the code is below. Also, any best practices would be great too as I'm learning this language. Thanks for your help. Here's the process flow I am looking for: -read a directory -look for a particular file -use the file name to strip out some key information to create a newly processed file -process the input file -create the newly processed file for each input file read (if i read in 10, I create 10 new files) Sample Recs: col1,col2,col3,col4,col5 [email protected],[email protected],8,2009-09-24 21:00:46,1 [email protected],[email protected],16,2007-08-18 22:53:12,33 [email protected],[email protected],16,2007-08-18 23:41:23,33 Here's my test code: Target Filetype: `/backups/test/foo101.name.aue-foo_p002.20110124.csv` Part 1: my $target_dir = "/backups/test/"; opendir my $dh, $target_dir or die "can't opendir $target_dir: $!"; while (defined(my $file = readdir($dh))) { next if ($file =~ /^\.+$/); #Get filename attributes if ($file =~ /^foo(\d{3})\.name\.(\w{3})-foo_p(\d{1,4})\.\d+.csv$/) { print "$1\n"; print "$2\n"; print "$3\n"; } print "$file\n"; } Part 2: use strict; use Digest::MD5 qw(md5_hex); #Create new file open (NEWFILE, ">/backups/processed/foo$1.name.$2-foo_p$3.out") || die "cannot create file"; my $data = ''; my $line1 = <>; chomp $line1; my @heading = split /,/, $line1; my ($sep1, $sep2, $eorec) = ( "^A", "^E", "^D"); while (<>) { my $digest = md5_hex($data); chomp; my (@values) = split /,/; my $extra = "__mykey__$sep1$digest$sep2" ; $extra .= "$heading[$_]$sep1$values[$_]$sep2" for (0..scalar(@values)); $data .= "$extra$eorec"; print NEWFILE "$data"; } #print $data; close (NEWFILE);

    Read the article

  • UCA + Natural Sorting

    - by Alix Axel
    I recently learnt that PHP already supports the Unicode Collation Algorithm via the intl extension: $array = array ( 'al', 'be', 'Alpha', 'Beta', 'Álpha', 'Àlpha', 'Älpha', '????', 'img10.png', 'img12.png', 'img1.png', 'img2.png', ); if (extension_loaded('intl') === true) { collator_asort(collator_create('root'), $array); } Array ( [0] => al [2] => Alpha [4] => Álpha [5] => Àlpha [6] => Älpha [1] => be [3] => Beta [11] => img1.png [9] => img10.png [8] => img12.png [10] => img2.png [7] => ???? ) As you can see this seems to work perfectly, even with mixed case strings! The only drawback I've encountered so far is that there is no support for natural sorting and I'm wondering what would be the best way to work around that, so that I can merge the best of the two worlds. I've tried to specify the Collator::SORT_NUMERIC sort flag but the result is way messier: collator_asort(collator_create('root'), $array, Collator::SORT_NUMERIC); Array ( [8] => img12.png [7] => ???? [9] => img10.png [10] => img2.png [11] => img1.png [6] => Älpha [5] => Àlpha [1] => be [2] => Alpha [3] => Beta [4] => Álpha [0] => al ) However, if I run the same test with only the img*.png values I get the ideal output: Array ( [3] => img1.png [2] => img2.png [1] => img10.png [0] => img12.png ) Can anyone think of a way to preserve the Unicode sorting while adding natural sorting capabilities?

    Read the article

  • Getting the instance when Constructor#newInstance throws?

    - by Shtééf
    I'm working on a simple plugin system, where third party plugins implement a Plugin interface. A directory of JARs is scanned, and the implementing classes are instantiated with Constructor#newInstance. The thing is, these plugins call back into register* methods of the plugin host. These registrations use the Plugin instance as a handle. My problem is how to clean up these registrations if the constructor decides to fail and throw halfway through. InvocationTargetException doesn't seem to have anything on it to get the instance. Is there a way to get at the instance of an exception throwing constructor? P.S.: It's typically strongly advised to users that the constructor not do anything, but in practice people are doing it any ways.

    Read the article

  • open layers LineString not working

    - by AlexS
    Sorry to bother you guys, but I'm stuck with his problem for half a day. I want to draw poly line in OpenLayers using LineString object, so I've copied the example from documentation. It runs ok but i can't see the line on the screen Code looks like this <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> var map; var lineLayer ; var points; var style; var polygonFeature function test() { lineLayer = new OpenLayers.Layer.Vector("Line Layer"); style = { strokeColor: '#0000ff', strokeOpacity: 1, strokeWidth: 10 }; map.addLayer(lineLayer); points = new Array(); points[0] =new OpenLayers.LonLat(-2.460181,27.333984 ).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());; points[1] = new OpenLayers.LonLat(-3.864255,-22.5 ).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());; var linear_ring = new OpenLayers.Geometry.LinearRing(points); polygonFeature = new OpenLayers.Feature.Vector( new OpenLayers.Geometry.Polygon([linear_ring]), null, style); lineLayer.addFeatures([polygonFeature]); alert("1"); } function initialize() { map = new OpenLayers.Map ("map_canvas", { controls:[ new OpenLayers.Control.Navigation(), new OpenLayers.Control.PanZoomBar(), new OpenLayers.Control.LayerSwitcher(), new OpenLayers.Control.Attribution()], maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), maxResolution: 156543.0399, numZoomLevels: 19, units: 'm', projection: new OpenLayers.Projection("EPSG:900913"), displayProjection: new OpenLayers.Projection("EPSG:4326") }); // Define the map layer // Here we use a predefined layer that will be kept up to date with URL changes layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik"); map.addLayer(layerMapnik); var lonLat = new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()); map.zoomTo(3); map.setCenter(lonLat, 19); test(); } </head> <body onload="initialize()" > <div id="map_canvas" style="width: 828px; height: 698px"></div> I'm sure I'm missing some parameter in creation of map or something but I really can't figure which one.

    Read the article

  • uiSlider thumb graphic 'flashes' when dragging uiScrollview on 1st gen 3.1.3

    - by Mark Tompson
    I have added my own thumb to a uiSlider and added a 1px x 1px transparent .png to the tracks (I don't want to see the tracks) (I have also tried setting tracks to nil). My uiSlider is also rotated to vertical. The uiSlider sits over a uiScrollView but is not 'attached' to that view. There are numerous uiLabels 'attached' to this uiScrollView, so they all slide about 'beneath' the uiSlider. It all works fine on 3g and iphone 4, but on my 1g itouch (3.1.3) I get a strange flash from the thumb graphic sometimes when scrolling the uiScrollview!? It does seem to happen when the edge of a uiLabel (on the uiScrollView) passes 'under' the thumb graphic? I have tried everything I can think of...

    Read the article

  • Modulation of adding new Strings -> Method calls.

    - by guesswork
    If I have a program that does the following: if(input=='abc'){do x} if(input=='def'){do y} In the future, I may want to add another piece of code like so: if(input=='ghy'){do x} As you can see, I am adding a new 'if' statement for a different conditional BUT using the SAME function X. The code in future has potential to have lots of different IF statements (or switches) all of which are comparing a string vs a string and then performing a function. Considering the future expansion, I was wondering if there is a possible 'neater', 'modular' way of achieving the same results. It's a shame I can't combine the String with a Method call in a hashtable (String, method) in Java. That way I could just store any new procedures inside a hashtable and grab the relevant method for that String. Any ideas? Thank you

    Read the article

  • Console-App to get all open files for processes

    - by t.kehl
    Hi I am searching for a console-app (where I can pipe the output to a txt-file) which gives me a list of all current processes and the files which each process has open. The tool should also work when the user doesn't has administrativ-privilegues and it should also give file-path which are located on the network (UNC and absolute/mappings). Is there something like this which I can call from another tool and get the information? I am on a windows system. I have a open filename and need now to get the whole path for the file

    Read the article

  • Appropriate uses of Monad `fail` vs. MonadPlus `mzero`

    - by jberryman
    This is a question that has come up several times for me in the design code, especially libraries. There seems to be some interest in it so I thought it might make a good community wiki. The fail method in Monad is considered by some to be a wart; a somewhat arbitrary addition to the class that does not come from the original category theory. But of course in the current state of things, many Monad types have logical and useful fail instances. The MonadPlus class is a sub-class of Monad that provides an mzero method which logically encapsulates the idea of failure in a monad. So a library designer who wants to write some monadic code that does some sort of failure handling can choose to make his code use the fail method in Monad or restrict his code to the MonadPlus class, just so that he can feel good about using mzero, even though he doesn't care about the monoidal combining mplus operation at all. Some discussions on this subject are in this wiki page about proposals to reform the MonadPlus class. So I guess I have one specific question: What monad instances, if any, have a natural fail method, but cannot be instances of MonadPlus because they have no logical implementation for mplus? But I'm mostly interested in a discussion about this subject. Thanks! EDIT: One final thought occured to me. I recently learned (even though it's right there in the docs for fail) that monadic "do" notation is desugared in such a way that pattern match failures, as in (x:xs) <- return [] call the monad's fail. It seems like the language designers must have been strongly influenced by the prospect of some automatic failure handling built in to haskell's syntax in their inclusion of fail in Monad.

    Read the article

  • How do I authenticate regarding EJB3 Container ?

    - by FMR
    I have my business classes protected by EJB3 security annotations, now I would like to call these methods from a Spring controller, how do I do it? edit I will add some information about my setup, I'm using Tomcat for the webcontainer and OpenEJB for embedding EJB into tomcat. I did not settle on any version of spring so it's more or less open to suggestions. edit current setup works this way : I have a login form + controller that puts a User pojo inside SessionContext. Each time someone access a secured part of the site, the application checks for the User pojo, if it's there check roles and then show the page, if it's not show a appropriate message or redirect to login page. Now the bussiness calls are made thanks to a call method inside User which bypass a probable security context which is a remix of this code found in openejb security examples : Caller managerBean = (Caller) context.lookup("ManagerBeanLocal"); managerBean.call(new Callable() { public Object call() throws Exception { Movies movies = (Movies) context.lookup("MoviesLocal"); movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992)); movies.addMovie(new Movie("Joel Coen", "Fargo", 1996)); movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998)); List<Movie> list = movies.getMovies(); assertEquals("List.size()", 3, list.size()); for (Movie movie : list) { movies.deleteMovie(movie); } assertEquals("Movies.getMovies()", 0, movies.getMovies().size()); return null; } });

    Read the article

  • A way of allocating multidimensional arrays dynamically

    - by C77431
    salute.. I am learning dynamic allocations for multidimensional arrays in a book and I found some ways for that, And now haven't problem in it. But the author of the book shows us a way, but it doesn't work correctly. It is this: pbeans = new double [3][4]; // Allocate memory for a 3x4 array And this is the error: error C2440: '=' : cannot convert from 'int (*)[4]' to 'int *' how should i define pbeans ( if this type of coding is legal)? and what is the problem exactly? Regards.

    Read the article

  • django shopping cart as a beginner

    - by Jacques Knie
    Hi, i'm quite new to django and trying to add a shopping cart to a simple webshop. What I need is a simple cart that can be filled and presents its content, which is then sent to the vendor via email. So Satchmo might be too big for this task. Therefore i chose django-cart (http://code.google.com/p/django-cart/) which causes some problems now. 1. Is django-cart the right thing? Or are there any better approaches to this task? 2. As I am a beginner even django-cart makes me struggle. I used the view and the template of the django-cart-website, but writing a form that can be used to add products to the cart took me hours. I probably need help in understanding the general layout of a shopping cart and its integration into a website. 3. Two more specific questions: Is it possible to dynamically populate a formfield in a template (e.g. with {{ object.id }})? Is django-cart able to change (update) the contents of a cart? I hope it's not too many questions at once. Thanks in advance Jacques

    Read the article

  • I have problem loading all items from XML with for each

    - by vaha
    Hi all, I'm low level as3 programmer and I need help whit this code: I have gallery XML file: 1 0 Lokacije 1 1.jpg 2 2 Coaching 1 2.jpg 3 0 0 3.jpg And: var loader: URLLoader = new URLLoader(); loader.load(new URLRequest("gallery.xml"); var xml = new XML(evt.target.data); for each(var item in xml..item) { centralniText.htmlText = item.slika; } only shows last item from XML file: 3.jpg I want all. Please help.

    Read the article

  • spring web application context is not loaded from jar file in WEB-INF/lib when running tomcat in eclipse

    - by Remy J
    I am experimenting with spring, maven, and eclipse but stumbling on a weird issue. I am running Eclipse Helios SR1 with the STS (Spring tools suite) plugin which includes the Maven plugin also. What i want to achieve is a spring mvc webapp which uses an application context loaded from a local application context xml file, but also from other application contexts in jar files dependencies included in WEB-INF/lib. What i'd ultimately like to do is have my persistence layer separated in its own jar file but containing its own spring context files with persistence specific configuration (e.g a jpa entityManagerFactory for example). So to experiment with loading resources from jar dependencies, i created a simple maven project from eclipse, which defines an applicationContext.xml file in src/main/resources Inside, i define a bean <bean id="mybean" class="org.test.MyClass" /> and create the class in the org.test package I run mvn-install from eclipse, which generates me a jar file containing my class and the applicationContext.xml file: testproj.jar |_META-INF |_org |_test |_MyClass.class |_applicationContext.xml I then create a spring mvc project from the Spring template projects provided by STS. I have configured an instance of Tomcat 7.0.8 , and also an instance of springSource tc Server within eclipse. Deploying the newly created project on both servers works without problem. I then add my previous project as a maven dependency of the mvc project. the jar file is correctly added in the Maven Dependencies of the project. In the web.xml that is generated, i now want to load the applicationContext.xml from the jar file as well as the existing one generated for the project. My web.xml now looks like this: org.springframework.web.context.ContextLoaderListener <!-- Processes application requests --> <servlet> <servlet-name>appServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value> classpath*:applicationContext.xml, /WEB-INF/spring/appServlet/servlet-context.xml </param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>appServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> Also, in my servlet-context.xml, i have the following: <context:component-scan base-package="org.test" /> <context:component-scan base-package="org.remy.mvc" /> to load classes from the jar spring context (org.test) and to load controllers from the mvc app context. I also change one of my controllers in org.remy.mvc to autowire MyClass to verify that loading the context has worked as intended. public class MyController { @Autowired private MyClass myClass; public void setMyClass(MyClass myClass) { this.myClass = myClass; } public MyClass getMyClass() { return myClass; } [...] } Now this is the weird bit: If i deploy the spring mvc web on my tomcat instance inside eclipse (run on server...) I get the following error : org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/test/MyClass at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) at javax.servlet.GenericServlet.init(GenericServlet.java:160) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1133) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1087) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:996) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4834) at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5155) at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5150) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NoClassDefFoundError: org/test/MyClass at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) at java.lang.Class.getDeclaredMethods(Class.java:1791) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:446) at org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.determineUrlsForHandlerMethods(DefaultAnnotationHandlerMapping.java:172) at org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.determineUrlsForHandler(DefaultAnnotationHandlerMapping.java:118) at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.detectHandlers(AbstractDetectingUrlHandlerMapping.java:79) at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.initApplicationContext(AbstractDetectingUrlHandlerMapping.java:58) at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119) at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72) at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73) at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106) at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) ... 25 more 20-Feb-2011 10:54:53 org.apache.catalina.core.ApplicationContext log SEVERE: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/test/MyClass If i build the war file (using maven "install" goal), and then deploy that war file in the webapps directory of a standalone tomcat server (7.0.8 as well) it WORKS :-( What am i missing ? Thanks for the help.

    Read the article

  • Rotate a linked list

    - by user408041
    I want to rotate a linked list that contains a number. 123 should be rotated to 231. The function created 23 but the last character stays empty, why? typedef struct node node; struct node{ char digit; node* p; }; void rotate(node** head){ node* walk= (*head); node* prev= (*head); char temp= walk->digit; while(walk->p!=NULL){ walk->digit=walk->p->digit; walk= walk->p; } walk->digit=temp; } How I create the list: node* convert_to_list(int num){ node * curr, * head; int i=0,length=0; char *arr=NULL; head = NULL; length =(int) log10(((double) num))+1; arr =(char*) malloc((length)*sizeof(char)); //allocate memory sprintf (arr, "%d" ,num); //(num, buf, 10); for(i=length;i>=0;i--) { curr = (node *)malloc(sizeof(node)); (curr)->digit = arr[i]; (curr)->p = head; head = curr; } curr = head; return curr; }

    Read the article

  • structure inside structure - c++ Error

    - by gamadeus
    First of all the error I am getting is of the type: Request for member 's' of struct1.struct1::struct2, which is of non class type '__u32' where: struct struct1 { struct x struct2; struct x struct3; struct x struct4; }; The usage is of the form: struct struct1 st1; st1.struct2.s = Value; Now my struct1 is: struct ip_mreq_source { struct in_addr imr_multiaddr; struct in_addr imr_sourceaddr; struct in_addr imr_interface; }; struct 'x' is in_addr Where: typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; }; element 's' is the element s_addr in in_addr. My detailed error coming out of g++ (GCC 4.4.3) from the Android based compiler: arm-linux-androideabi-g++ -MMD -MP -MF groupsock/GroupsockHelper.o.d.org -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline- limit=64 -Igroupsock/include -Igroupsock/../UsageEnvironment/include -Iandroid- ndk-r5b/sources/cxx-stl/system/include -Igroupsock -DANDROID -Wa,--noexecstack -DANDROID_NDK -Wall -fexceptions -O2 -DNDEBUG -g -Iandroid-8/arch-arm/usr/include -c groupsock/GroupsockHelper.cpp -o groupsock/GroupsockHelper.o && rm -f groupsock/GroupsockHelper.o.d && mv groupsock/GroupsockHelper.o.d.org groupsock/GroupsockHelper.o.d groupsock/GroupsockHelper.cpp: In function 'Boolean socketJoinGroupSSM(UsageEnvironment&, int, netAddressBits, netAddressBits)': groupsock/GroupsockHelper.cpp:427: error: request for member 's_addr' in 'imr.ip_mreq_source::imr_multiaddr', which is of non-class type '__u32' groupsock/GroupsockHelper.cpp:428: error: request for member 's_addr' in 'imr.ip_mreq_source::imr_sourceaddr', which is of non-class type '__u32' groupsock/GroupsockHelper.cpp:429: error: request for member 's_addr' in 'imr.ip_mreq_source::imr_interface', which is of non-class type '__u32' I am not sure what is causing the error. Any pointers would be great - no pun intended. Thanks

    Read the article

  • Would it be useful to change java to support both static and dynamic types?

    - by James A. N. Stauffer
    What if a Java allow both static and dynamic types. That might allow the best of both worlds. i.e.: String str = "Hello"; var temp = str; temp = 10; temp = temp * 5; Would that be possible? Would that be beneficial? Do any languages currently support both and how well does it work out? Here is a better example (generics can't be used but the program does know the type): var username = HttpServletRequest.getSession().getAttribute("username");//Returns a String if(username.length() == 0) { //Error }

    Read the article

  • Default Arguments in Matlab

    - by Scott
    Hello. Is it possible to have default arguments in Matlab? For instance, here: function wave(a,b,n,k,T,f,flag,fTrue=inline('0')) I would like to have the true solution be an optional argument to the wave function. If it is possible, can anyone demonstrate the proper way to do this? Currently, I am trying what I posted above and I get: ??? Error: File: wave.m Line: 1 Column: 37 The expression to the left of the equals sign is not a valid target for an assignment. Thanks!

    Read the article

  • An Intro to IIS URL Rewrite–plus redirecting URLs to www-Web Pro Week 8 of 52

    - by OWScott
    Today’s video post is an intro to URL Rewrite and the start of a few lessons on this powerful tool.  Additionally I cover how to rewrite URLs to add the www to the domain name for the sake of search engine optimization (SEO). This is week 8 of a 52 week series on various web administration related tasks.  Past and future videos can be found here. I have already written a blog post on this, so for those that prefer to read rather than watch, you can find it here. IIS URL Rewrite–redirecting non-www to www

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >