Search Results

Search found 5718 results on 229 pages for 'resource'.

Page 15/229 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • how to atomically claim a row or resource using UPDATE in mysql

    - by Igor
    i have a table of resources (lets say cars) which i want to claim atomically. if there's a limit of one resource per one user, i can do the following trick: UPDATE cars SET user = 'bob' WHERE user IS NULL LIMIT 1 SELECT * FROM cars WHERE user IS bob that way, i claim the resource atomically and then i can see which row i just claimed. this doesn't work when 'bob' can claim multiple cars. i realize i can get a list of cars already claimed by bob, claim another one, and then SELECT again to see what's changed, but that feels hackish. What I'm wondering is, is there some way to see which rows i just updated with my last UPDATE? failing that, is there some other trick to atomically claiming a row? i really want to avoid using SERIALIZABLE isolation level. If I do something like this: 1 SELECT id FROM cars WHERE user IS NULL 2 <here, my PHP or whatever picks a car id> 3 UPDATE cars SET user = 'bob' WHERE id = <the one i picked> would REPEATABLE READ be sufficient here? in other words, could i be guaranteed that some other transactions won't claim the row my software has picked during step 2?

    Read the article

  • Strange resource not found issue?

    - by xBroak
    i seem to be having a very strange problem, when the app is run on my test phone it works perfectly, and plays a sound from the raw folder via soundpool on button press, however when i submit my app to testing after building it it crashes on 120+ devices for 'Resource not found' codes below: Please also note, the file is in fact there, in both the R file, in the compiled APK file and i have also cleaned numerous times. http://www.appthwack.com/public/FUVGFZn42q '01-03 21:09:36.828 26762 26762 W System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{appinventor.ai_Broak.PaintballWiz/com.muo.paintballwiz.PaintballWiz}: android.content.res.Resources$NotFoundException: File res/raw/pballshot.ogg from drawable resource ID #0x7f050000 - 1 occurrence' soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 100); //soundPoolMap = new SparseIntArray(); soundPoolMap = new HashMap<Integer, Integer>(); // soundPoolMap.put(soundID, soundPool.load(this, R.raw.midi_sound, 1)); int myAudioFile = getResId("pballshot", R.raw.class); soundPoolMap.put(soundID, soundPool.load(PaintballWiz.this, myAudioFile, 1)); audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); curVolume = audioManager .getStreamVolume(AudioManager.STREAM_MUSIC); maxVolume = audioManager .getStreamMaxVolume(AudioManager.STREAM_MUSIC); leftVolume = curVolume / maxVolume; rightVolume = curVolume / maxVolume; soundPool.play(soundID, leftVolume, rightVolume, priority, no_loop, normal_playback_rate); soundPool.play(soundID, 0, 0, 1, -1, 1f);

    Read the article

  • REST design: what verb and resource name to use for a filtering service

    - by kabaros
    I am developing a cleanup/filtering service that has a method that receives a list of objects serialized in xml, and apply some filtering rules to return a subset of those objects. In a REST-ful service, what verb shall I use for such a method? I thought that GET is a natural choice, but I have to put the serialized XML in the body of the request which works but feels incorrect. The other verbs don't seem to fit semantically. What is a good way to define that Service interface? Naming the resource /Cleanup or /Filter seems weird mainly because in the examples I see online, it is always a name rather than a verb being used for resource name. Am I right to feel that REST services are better suited for CRUD operations and you start bending the rules in situations like this service? If yes, am I then making a wrong architectural choice. I've pushed to develop this service in REST-ful style (as opposed to SOAP) for simplicity, but such awkward cases happen a lot and make me feel like I am missing something. Either choosing REST where it shouldn't be used or may be over-thinking some stuff that doesn't really matter? In that case, what really matters?

    Read the article

  • No resource found that matches given name in main.xml

    - by AndroidBeginner
    This is really starting to drive me crazy. <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@id+/textview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/hello"/> Produces the following error message: "Error: no resource found that matches the given name (at 'id' with value '@id+/textview'). This is copy and pasted from the Android hello world example.

    Read the article

  • Temporary table resource limit

    - by Jk
    Hi, i have two applications (server and client), that uses TQuery connected with TClientDataSet through TDCOMConnection, and in some cases clientdataset opens about 300000 records and than application throws exception "Temporary table resource limit". Is there any workaround how to fix this? (except "do not open such huge dataset"?) update: oops i'm sorry there is 300K records, not 3 millions..

    Read the article

  • Change resource file on the file

    - by Imran
    I woulld like to localize my WPF application with resource files. It good technics. But I have requirement to give ability to end user to change some localization information (for example some word traslation). It means change information in the resourse files on the fly (in run time). Is it possible ?

    Read the article

  • MySQL & PHP Parameter 1 as Resource

    - by Nik
    Alright, PHP is throwing this error at me (in the log) when I run the code mentioned below: Error mysql_num_rows() expects parameter 1 to be resource, string given in (place) on line 10 Line 9-11 $queryFP = ("SELECT * FROM db"); $countFP = mysql_num_rows($queryFP); $aID = rand(1, $countFP); I think it has something to do with the $queryFP's syntax, but I'm not completely sure how to fix it since $queryFP's syntax is the simplest query I've ever seen.

    Read the article

  • Change resource file on the fly

    - by Imran
    I woulld like to localize my WPF application with resource files. It good technics. But I have requirement to give ability to end user to change some localization information (for example some word traslation). It means change information in the resourse files on the fly (in run time). Is it possible ?

    Read the article

  • Cannot parse persistence unit from class path resource

    - by Grzegorz S
    so I have this problem in running my Spring WS app which implements JPA ( or should implement..) I have a problem with running a WS, it looks like my Spring context can't find file persistence.xml Which i am able to believe because i did not have generated META-INF folder in my template (which is Maven project template with archetype org.springframework.ws) I have created META-INF manually. Here is the HTTP 500: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'caChainDao' defined in file [E:\STS\vfabric-tc-server-developer-2.7.2.RELEASE\zz\wtpwebapps\FCAWSv4\WEB-INF\classes\pl\famoc\test\ws\db\dao\caChainDao.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Cannot parse persistence unit from class path resource [persistence.xml] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133) javax.servlet.GenericServlet.init(GenericServlet.java:160) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) java.lang.Thread.run(Thread.java:722) Here it is my persistence.xml <?xml version="1.0" encoding="UTF-8" ?> <persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL" /> </persistence> here it is where i am looking for it <property name="persistenceXmlLocation" value="classpath:persistence.xml" /> and here it is path to this xml in my classpath: src/main/webapp/META-INF/persistence.xml Could anyone give me a hint what am i missing?

    Read the article

  • Packaging Android resource files within a distributable Jar file

    - by Jeff Gilfelt
    I am working on some reusable Android code that I would like to distribute to other developers for use within their own applications. The code has some resource dependencies (layouts, xml & png drawables) that I would like to be able to include and reference within a single package (Jar file). Is this possible, and if so what is the best method to do this?

    Read the article

  • Reading Resource Files from my own APK in Android Native Environment

    - by Kyle
    I'm porting to Android. My existing project has a ton of resource files that I'm porting into my Android project. I have them all in /res/raw/, and I would like to access those resources in my native library with functions such as fopen() and such. Can this be done, or do I have to go through JNI for this as well? I would really prefer not to, for ease of porting and possible speed and memory reasons.

    Read the article

  • Why bind hibernate SessionFactory to a JNDI resource?

    - by jschoen
    In my current adventure of learning hibernate and setting it up to use an appserver's connection pool, most examples and resources out there point you in the direction of binding the SessionFactory to a JNDI resource in your appserver in the process. I wondering what the benefit of this is? Since the you can access a the connection pool with out doing this.

    Read the article

  • How to use java ee 6 @Resource annotation

    - by javamonkey79
    The java ee 6 api has an annotation @Resource with an attribute 'lookup', however, so does the java se 6 api (here). However, since java ee 6 is dependent on java se 6, it seems you can not get at the ee version of the annotation and the 'lookup' attribute. Is this a bug or is there some other way to use this annotation that I am missing. TIA

    Read the article

  • How catch "Resource not found" warnings in WPF / Visual studio

    - by Sdry
    I am working on a project, in which I am changing themes, by doing this there are some warnings being issued, and I am wondering how to prevent them from beeing issued, or reaching the debug output. `System.Windows.ResourceDictionary Warning: 9 : Resource not found`; It happens when I do Application.Current.Resources.MergedDictionaries.Clear(); Application.Current.Resources.MergedDictionaries.Add(theme.ResourceDictionary); I perfectly understand why there is a warning, I would just like to stop it being outputted (while debugging)

    Read the article

  • GWT CSS Resource to find all classes

    - by Zoja
    What i want to do is: I have css file read from a file into a String. I would like to build some kind of css resource (CssResource ?) out of that string or file, and I'd like to be able to extract from it all classes and id selectors in some kind of collection which i could search. Does anybody know how to do that ?

    Read the article

  • Rails method as a nested resource

    - by Blastula
    Hello, I'm wondering about the clever way to do this... I have methods that return a value when passed an an object as parameter, such as: <%= average_rainfall(@location) % I'd like to use the exact same methods as a nested resource to call via jQuery/Ajax, like so: .load('/location/8/average_rainfall') I understand how to define the route, but how do I tell my method to 'find' /location/8 and use that as it's parameter instead of @location as expected? Thanks!

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >