Search Results

Search found 413 results on 17 pages for 'spawn'.

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

  • Cryptic Erlang Errors

    - by Jim
    Okay so I started learning erlang recently but am baffled by the errors it keeps returning. I made a bunch of changes but I keep getting errors. The syntax is correct as far as I can tell but clearly I'm doing something wrong. Have a look... -module(pidprint). -export([start/0]). dostuff([]) - receive begin - io:format("~p~n", [This is a Success]) end. sender([N]) - N ! begin, io:format("~p~n", [N]). start() - StuffPid = spawn(pidprint, dostuff, []), spawn(pidprint, sender, [StuffPid]). Basically I want to compile the script, call start, spawn the "dostuff" process, pass its process identifier to the "sender" process, which then prints it out. Finally I want to send a the atom "begin" to the "dostuff" process using the process identifier initially passed into sender when I spawned it. The errors I keep getting occur when I try to use c() to compile the script. Here they are.. ./pidprint.erl:6: syntax error before: '-' ./pidprint.erl:11: syntax error before: ',' What am I doing wrong?

    Read the article

  • passenger won't spawn more than 6 instances despite passenger_max_pool_size = 30

    - by mrD
    I have some problems with passenger + nginx and hope someone might be able help me and direct me in the right direction. I've set the passenger_max_pool_size to 30 but passenger never spawns more than 6 instances. I'm loading a webpage that uses ajax to load 30 sub pages from the server but because passenger only spawns 6 instances they are queued. What makes me confused is that Waiting on global queue is 0 but I can see in my browser that everything gets queued. When the first 6 ajax requests are done the next 6 starts loading. What am I missing? :) This is the output from passenger-status (I had about 24 requests in the browser waiting for response from the server when I checked this status) ----------- General information ----------- max = 30 count = 6 active = 6 inactive = 0 Waiting on global queue: 0 ----------- Domains ----------- /srv/rails/production/current: PID: 28428 Sessions: 1 Processed: 42 Uptime: 5m 43s PID: 28424 Sessions: 1 Processed: 23 Uptime: 5m 43s PID: 28422 Sessions: 1 Processed: 7 Uptime: 5m 43s PID: 28420 Sessions: 1 Processed: 22 Uptime: 6m 0s PID: 28426 Sessions: 1 Processed: 39 Uptime: 5m 43s PID: 28430 Sessions: 1 Processed: 7 Uptime: 5m 43s These are my passenger related settings in nginx.conf http { passenger_root /opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.11; passenger_ruby /opt/ruby/bin/ruby; passenger_max_pool_size 30;

    Read the article

  • How to run several fastcgi processes for nginx (spawn-fcgi)

    - by SPnova
    I want to run several fastcgi processes with different users and different php.ini . But unfortunately I found information about running one process only. http://www.howtoforge.com/installing-nginx-with-php5-and-mysql-support-on-ubuntu-9.04 There is mod suexec for Apache which allows to do it. Does anyone know something like that for fastcgi php nginx?

    Read the article

  • C# Spawn Multiple Threads for work then wait until all finished

    - by pharoc
    just want some advice on "best practice" regarding multi-threading tasks. as an example, we have a C# application that upon startup reads data from various "type" table in our database and stores the information in a collection which we pass around the application. this prevents us from hitting the database each time this information is required. at the moment the application is reading data from 10 tables synchronously. i would really like to have the application read from each table in a different thread all running in parallel. the application would wait for all the threads to complete before continuing with the startup of the application. i have looked into BackGroundWorker but just want some advice on accomplishing the above. Does the method sound logical in order to speed up the startup time of our application How can we best handle all the threads keeping in mind that each thread's work is independent of one another, we just need to wait for all the threads to complete before continuing. i look forward to some answers

    Read the article

  • Fork a process and send data to it inside Rails

    - by taro
    I'm making a Rails application. In the one action I need to spawn a long running process. This is not a problem. I can fork new process using spawn gem or some other. But some time after process has been spawned, user must be able to pass additional data to that process. Sure, I can fork process which will listen a UNIX socket, store socket address in the HTTP session and communicate with that process using drb protocol when user will require to pass new data to process. But I think it is not best solution and it will be a problem to deploy an application to the hosting. What is the easy way to do that?

    Read the article

  • PHP hits 100% CPU and eats RAM at the same time Monday to Friday

    - by Daniel Samuels
    We run a learning platform for primary schools here in the UK and it's all been running extremely well. However at around 4PM Monday to Friday we see the same issue arise -- 1-2 PHP threads will spike to 100% CPU and gradually start eating up RAM until the server(s) fall over. 98%+ of our requests are HTTPS, these come into our Layer 7 load balancer which then decrypts the SSL data, adds the X-HTTP-Forwarded-For header and forwards the data onto an application server (we have 2 of those at the moment) on port 80. Our application servers have Varnish on port 80 which takes in the request from the load balancer and passes the request through to Nginx on port 81. Nginx then works out which 'vhost' it needs to use and passes any PHP processing through to PHP-CGI which is listening on a socket (managed through spawn-fcgi). There's an instance of Memcached running too, MySQL runs on a separate server / slave setup. Throughout the day the load will typically go no higher than 0.8 on either of the application servers, however at around 4PM our problem arises. I've managed to run strace on a few of the actual threads when they cause the problem and I always see the same thing: stat("/usr/share/zoneinfo/Europe/London", {st_mode=S_IFREG|0644,st_size=3661, ...}) = 0 stat("/usr/share/zoneinfo/Europe/London", {st_mode=S_IFREG|0644,st_size=3661, ...}) = 0 This is repeated infinitely and never stops until you SEGKILL the process or oomkiller kills it. There are no cron jobs scheduled to run at that time and I don't have any way of seeing exactly what Nginx request is associated with the PHP process which is running. We are running PHP 5.3.14 which we upgraded to from 5.3.8 last week to rule out the older version being the problem. This issue has been going on a few months now and we have no idea what is causing it. We deploy our software very frequently, so it's difficult to track down a specific release which may have started the problem - especially as we do not know the date of the first occurrence of this issue. Varnish is version 3.0.1, Nginx is 1.0.6 (which I understand is about a year old now), our servers are running CentOS release 5.7 (Final) they have Intel i3 540s at 3.07Ghz and 8GB of RAM. There's a discussion on the Debian mailing list about something very similar, you can find that here. Has anyone seen anything like this in the past, does anyone have any ideas or suggestions? Are there a way of linking an Nginx request directly to a PHP thread? Is there a better way of seeing what the PHP process is doing? (I've seen GDB mentioned, though I'll have to recompile PHP) Thanks!

    Read the article

  • Spawning a interactive process

    - by notnoop
    How can a Java application spawn a new interactive application (e.g. an command line editor) from Java/Scala? When I use Runtime.getRuntime().exec("vim test"), I would only get a Process instance, while vim would be running in the background; rather then appear to the user.

    Read the article

  • How can I spawn a sprite based on a condition after the game starts?

    - by teddyweedy
    How do I spawn a sprite anytime later in the game when the game starts? I'm using FlashDevelop with Flixel. I did try it in override public function create(): void. It works only in the beginning. I try it using if (FlxG.score == 1) but it doesn't work. I also tried it in override public function update(): void. It works and it is moving but it leaves a sprite making it a multi-sprite. I also did try FlxGroup but to no avail.

    Read the article

  • Where i set touch effect when a spawn Srite are comming on the screen?

    - by shihab_returns
    I just create a scene where create a spawn spirit that comes from above screen height in Landscape mode. Now i want to remove spirits when i touch on it. I tried but seems the code not works and crashed also after a while. here is my code: /** TimerHandler for collision detection and cleaning up */ IUpdateHandler detect = new IUpdateHandler() { @Override public void reset() { } @Override public void onUpdate(float pSecondsElapsed) { Iterator<AnimatedSprite> targets = targetLL.iterator(); AnimatedSprite _target; while (targets.hasNext()) { _target = targets.next(); if (_target.getY() >= cameraHeight) { // removeSprite(_target, targets); tPool.recyclePoolItem(_target); targets.remove(); Log.d("ok", "---------Looop Inside-----"); // fail(); break; } } targetLL.addAll(TargetsToBeAdded); TargetsToBeAdded.clear(); } }; /** adds a target at a random location and let it move along the y-axis */ public void addTarget() { Random rand = new Random(); int minX = mTargetTextureRegion.getWidth(); int maxX = (int) (mCamera.getWidth() - mTargetTextureRegion.getWidth()); int rangeX = maxX - minX; Log.d("----point----", "minX:" + minX + "maxX:" + maxX + "rangeX:" + rangeX); int rX = rand.nextInt(rangeX) + minX; int rY = (int) mCamera.getHeight() + mTargetTextureRegion.getHeight(); Log.d("---Random x----", "Random x" + rX + "Random y" + rY); target = tPool.obtainPoolItem(); target.setPosition(rX, rY); target.animate(100); mMainScene.attachChild(target, 1); mMainScene.registerTouchArea(target); int minDuration = 2; int maxDuration = 32; int rangeDuration = maxDuration - minDuration; int actualDuration = rand.nextInt(rangeDuration) + minDuration; // MoveXModifier mod = new MoveXModifier(actualDuration, target.getX(), // -target.getWidth()); MoveYModifier mody = new MoveYModifier(actualDuration, -target.getHeight(), cameraHeight + 10); target.registerEntityModifier(mody.deepCopy()); TargetsToBeAdded.add(target); } @Override public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final ITouchArea pTouchArea, final float pTouchAreaLocalX, final float pTouchAreaLocalY) { if (pTouchArea == target) { Toast.makeText(getApplicationContext(), "Yoooooooo", Toast.LENGTH_LONG).show(); } return true; } ** My question is where i implements IOnAreaTouchListener in My code. ? ** Thanks in Advance.

    Read the article

  • Right way to create [self]respawning app in python

    - by grapescan
    I am using jabber bot written in python to log some MUC talks. Sometimes it drops on some network or XMPP problems. In this case I have to start it again by myself. The goal is to make it "self-respawning". I have some variants about how to do it. Bot is one process. Another process monitors its activity and starts it if bot died. Main process spawns bot subprocess and controls it. Also I think daemonizing bot process is useful here. Platform is Linux, as you could guess. What is the right way to solve this problem?

    Read the article

  • How to handle multi-processing of libraries which already spawn sub-processes?

    - by exhuma
    I am having some trouble coming up with a good solution to limit sub-processes in a script which uses a multi-processed library and the script itself is also multi-processed. Both, the library and script are modifiable by us. I believe the question is more about design than actual code, but for what it's worth, it's written in Python. The goal of the library is to hide implementation details of various internet routers. For that reason, the library has a "Proxy" factory method which takes the IP of a router as parameter. The factory then probes the device using a set of possible proxies. Usually, there is one proxy which immediately knows that is is able to send commands to this device. All others usually take some time to return (given a timeout). One thought was already to simply query the device for an identifier, and then select the proper proxy using that, but in order to do so, you would already need to know how to query the device. Abstracting this knowledge is one of the main purposes of the library, so that becomes a little bit of a "circular-requirement"/deadlock: To connect to a device, you need to know what proxy to use, and to know what proxy to create, you need to connect to a device. So probing the device is - as we can see - the best solution so far, apart from keeping a lookup-table somewhere. The library currently kills all remaining processes once a valid proxy has been found. And yes, there is always only one good proxy per device. Currently there are about 12 proxies. So if one create a proxy instance using the factory, 12 sub-processes are spawned. So far, this has been really useful and worked very well. But recently someone else wanted to use this library to "broadcast" a command to all devices. So he took the library, and wrote his own multi-processed script. This obviously spawned 12 * n processes where n is the number of IPs to which he broadcasted. This has given us two problems: The host on which the command was executed slowed down to a near halt. Aborting the script with CTRL+C ground the system to a total halt. Not even the hardware console responded anymore! This may be due to some Python strangeness which still needs to be investigated. Maybe related to http://bugs.python.org/issue8296 The big underlying question, is how to design a library which does multi-processing, so other applications which use this library and want to be multi-processed themselves do not run into system limitations. My first thought was to require a pool to be passed to the library, and execute all tasks in that pool. In that way, the person using the library has control over the usage of system resources. But my gut tells me that there must be a better solution. Disclaimer: My experience with multiprocessing is fairly limited. I have implemented a few straightforward which did not require access control to resources. So I have not yet any practical experience with semaphores or mutexes. p.s.: In the future, we may have enough information to do this without the probing. But the database which would contain the proper information is not yet operational. Also, the design about multiprocessing a multiprocessed library intrigues me :)

    Read the article

  • Using Java, can I have one JVM spawn another, and then have the original one exit?

    - by CarlG
    I have a need to have a running JVM start another JVM and then exit. I'm currently trying to do this via Runtime.getRuntime().exec(). The other JVM starts, but my original JVM won't exit until the "child" JVM process stops. It appears that using Runtime.getRuntime().exec() creates a parent-child relationship between the processes. Is there some way to de-couple the spawned process so that the parent can die, or some other mechanism to spawn a process without any relationship to the creating process? Note that this seems exactly like this question: http://stackoverflow.com/questions/2566502/using-java-to-spawn-a-process-and-keep-it-running-after-parent-quits but the accepted answer there doesn't actually work, at least not on my system (Windows 7, Java 5 and 6). It seems that maybe this is a platform-dependent behavior. I'm looking for a platform independent way to reliably invoke the other process and let my original process die.

    Read the article

  • Why would Windows Task Scheduler spawn multiple instances of the same task that run into each other?

    - by swagner88
    Overview: I use Windows Task Scheduler to run automated tasks. Occasionally I will see that randomly a task has failed to perform its duties. When I check Task Scheduler to see what has occurred in the history log, I see that for some reason, when the tasks are triggered at their schedules, they are spawning several instances of themselves simultaneously which turns into a train wreck for the task and it either kills the other instances and tries to run the "first" one, or it just does not run at all as it believes another instance of itself is already running. Sometimes this occurs in the same tasks and then occasionally it happens with others. The fix is just to end all instances and start the task manually. Question: Why would one single task with one single schedule decide to spawn multiple instance of itself simultaneously? Note: I've got a separate user account set to run the tasks instead of myself. That user is indeed an admin on the machine that runs the tasks and the tasks are set to tun whether or not the user is logged on. Also, the machine is windows server 08 R2.

    Read the article

  • LIBGDX "parsing error emitter" with 2 or more emitters [on hold]

    - by flow969
    I have a problem with the use of particle effect of LIBGDX with 2 or more emitters. After using ParticleEditor to create my .p file, I use it in my code BUT...when I use only 1 emitter it's fine but with more than 1, not fine ! :( Here is my error code in java console : Exception in thread "LWJGL Application" java.lang.RuntimeException: Error parsing emitter: - Delay - at com.badlogic.gdx.graphics.g2d.ParticleEmitter.load(ParticleEmitter.java:910) at com.badlogic.gdx.graphics.g2d.ParticleEmitter.<init>(ParticleEmitter.java:95) at com.badlogic.gdx.graphics.g2d.ParticleEffect.loadEmitters(ParticleEffect.java:154) at com.badlogic.gdx.graphics.g2d.ParticleEffect.load(ParticleEffect.java:138) at com.fasgame.fishtrip.android.screens.GameScreen.show(GameScreen.java:313) at com.badlogic.gdx.Game.setScreen(Game.java:61) at com.fasgame.fishtrip.android.screens.MainMenuScreen.render(MainMenuScreen.java:71) at com.badlogic.gdx.Game.render(Game.java:46) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:206) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114) Caused by: java.lang.NumberFormatException: For input string: "- Count -" at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source) at sun.misc.FloatingDecimal.parseFloat(Unknown Source) at java.lang.Float.parseFloat(Unknown Source) at com.badlogic.gdx.graphics.g2d.ParticleEmitter.readFloat(ParticleEmitter.java:929) at com.badlogic.gdx.graphics.g2d.ParticleEmitter$RangedNumericValue.load(ParticleEmitter.java:1062) at com.badlogic.gdx.graphics.g2d.ParticleEmitter.load(ParticleEmitter.java:866) ... 9 more And here is my particle effect .p file : Blanc - Delay - active: false - Duration - lowMin: 3000.0 lowMax: 3000.0 - Count - min: 0 max: 200 - Emission - lowMin: 0.0 lowMax: 0.0 highMin: 250.0 highMax: 250.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Life - lowMin: 500.0 lowMax: 500.0 highMin: 500.0 highMax: 500.0 relative: false scalingCount: 3 scaling0: 1.0 scaling1: 0.47058824 scaling2: 0.0 timelineCount: 3 timeline0: 0.0 timeline1: 0.51369864 timeline2: 1.0 - Life Offset - active: false - X Offset - active: false - Y Offset - active: false - Spawn Shape - shape: point - Spawn Width - lowMin: 0.0 lowMax: 0.0 highMin: 0.0 highMax: 0.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Spawn Height - lowMin: 0.0 lowMax: 0.0 highMin: 0.0 highMax: 0.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Scale - lowMin: 0.0 lowMax: 0.0 highMin: 70.0 highMax: 70.0 relative: true scalingCount: 2 scaling0: 1.0 scaling1: 0.0 timelineCount: 2 timeline0: 0.0 timeline1: 1.0 - Velocity - active: true lowMin: 0.0 lowMax: 0.0 highMin: 30.0 highMax: 300.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Angle - active: true lowMin: 220.0 lowMax: 320.0 highMin: 220.0 highMax: 320.0 relative: false scalingCount: 2 scaling0: 0.0 scaling1: 0.98039216 timelineCount: 2 timeline0: 0.0 timeline1: 1.0 - Rotation - active: false - Wind - active: false - Gravity - active: true lowMin: 0.0 lowMax: 0.0 highMin: 0.0 highMax: 0.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Tint - colorsCount: 3 colors0: 0.50980395 colors1: 0.7647059 colors2: 0.7921569 timelineCount: 1 timeline0: 0.0 - Transparency - lowMin: 0.0 lowMax: 0.0 highMin: 1.0 highMax: 1.0 relative: false scalingCount: 4 scaling0: 1.0 scaling1: 1.0 scaling2: 1.0 scaling3: 1.0 timelineCount: 4 timeline0: 0.0 timeline1: 0.36301368 timeline2: 0.6164383 timeline3: 1.0 - Options - attached: false continuous: true aligned: false additive: true behind: false premultipliedAlpha: false pre_particle.png Bleu - Delay - active: false - Duration - lowMin: 3000.0 lowMax: 3000.0 - Count - min: 0 max: 200 - Emission - lowMin: 0.0 lowMax: 0.0 highMin: 250.0 highMax: 250.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Life - lowMin: 500.0 lowMax: 500.0 highMin: 500.0 highMax: 500.0 relative: false scalingCount: 3 scaling0: 1.0 scaling1: 0.47058824 scaling2: 0.0 timelineCount: 3 timeline0: 0.0 timeline1: 0.51369864 timeline2: 1.0 - Life Offset - active: false - X Offset - active: false - Y Offset - active: false - Spawn Shape - shape: point - Spawn Width - lowMin: 0.0 lowMax: 0.0 highMin: 0.0 highMax: 0.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Spawn Height - lowMin: 0.0 lowMax: 0.0 highMin: 0.0 highMax: 0.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Scale - lowMin: 0.0 lowMax: 0.0 highMin: 70.0 highMax: 70.0 relative: true scalingCount: 2 scaling0: 1.0 scaling1: 0.0 timelineCount: 2 timeline0: 0.0 timeline1: 1.0 - Velocity - active: true lowMin: 0.0 lowMax: 0.0 highMin: 30.0 highMax: 300.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Angle - active: true lowMin: 220.0 lowMax: 320.0 highMin: 220.0 highMax: 320.0 relative: false scalingCount: 2 scaling0: 0.0 scaling1: 0.98039216 timelineCount: 2 timeline0: 0.0 timeline1: 1.0 - Rotation - active: false - Wind - active: false - Gravity - active: true lowMin: 0.0 lowMax: 0.0 highMin: 0.0 highMax: 0.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Tint - colorsCount: 3 colors0: 0.0 colors1: 0.7254902 colors2: 0.7921569 timelineCount: 1 timeline0: 0.0 - Transparency - lowMin: 0.0 lowMax: 0.0 highMin: 1.0 highMax: 1.0 relative: false scalingCount: 6 scaling0: 0.0 scaling1: 1.0 scaling2: 1.0 scaling3: 1.0 scaling4: 1.0 scaling5: 0.0 timelineCount: 6 timeline0: 0.0 timeline1: 0.047945205 timeline2: 0.34246576 timeline3: 0.6712329 timeline4: 0.94520545 timeline5: 1.0 - Options - attached: false continuous: true aligned: false additive: true behind: false premultipliedAlpha: false pre_particle.png BleuFonce - Delay - active: false - Duration - lowMin: 3000.0 lowMax: 3000.0 - Count - min: 0 max: 200 - Emission - lowMin: 0.0 lowMax: 0.0 highMin: 250.0 highMax: 250.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Life - lowMin: 500.0 lowMax: 500.0 highMin: 500.0 highMax: 500.0 relative: false scalingCount: 3 scaling0: 1.0 scaling1: 0.47058824 scaling2: 0.0 timelineCount: 3 timeline0: 0.0 timeline1: 0.51369864 timeline2: 1.0 - Life Offset - active: false - X Offset - active: false - Y Offset - active: false - Spawn Shape - shape: point - Spawn Width - lowMin: 0.0 lowMax: 0.0 highMin: 0.0 highMax: 0.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Spawn Height - lowMin: 0.0 lowMax: 0.0 highMin: 0.0 highMax: 0.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Scale - lowMin: 0.0 lowMax: 0.0 highMin: 70.0 highMax: 70.0 relative: true scalingCount: 2 scaling0: 1.0 scaling1: 0.0 timelineCount: 2 timeline0: 0.0 timeline1: 1.0 - Velocity - active: true lowMin: 0.0 lowMax: 0.0 highMin: 30.0 highMax: 300.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Angle - active: true lowMin: 220.0 lowMax: 320.0 highMin: 220.0 highMax: 320.0 relative: false scalingCount: 2 scaling0: 0.0 scaling1: 0.98039216 timelineCount: 2 timeline0: 0.0 timeline1: 1.0 - Rotation - active: false - Wind - active: false - Gravity - active: true lowMin: 0.0 lowMax: 0.0 highMin: 0.0 highMax: 0.0 relative: false scalingCount: 1 scaling0: 1.0 timelineCount: 1 timeline0: 0.0 - Tint - colorsCount: 3 colors0: 0.0 colors1: 0.7294118 colors2: 1.0 timelineCount: 1 timeline0: 0.0 - Transparency - lowMin: 0.0 lowMax: 0.0 highMin: 1.0 highMax: 1.0 relative: false scalingCount: 4 scaling0: 1.0 scaling1: 0.0 scaling2: 0.0 scaling3: 1.0 timelineCount: 4 timeline0: 0.0 timeline1: 0.001 timeline2: 0.5753425 timeline3: 0.79452056 - Options - attached: false continuous: true aligned: false additive: true behind: false premultipliedAlpha: false pre_particle.png For the "- Image Path -" missing it's normal if I let them in it doesn't work even with only 1 emitter PS : I've already updated my lib to the last release

    Read the article

  • How do you kill a PTY.spawn call in Ruby?

    - by viatropos
    If I run a command like this, using ruby's pty class, how do I kill it if I find a certain input string? cmd = "appcfg.py update cdn" PTY.spawn("#{cmd} 2>&1") do | input, output, pid | begin input.expect("Email:") do output.write("#{credentials[:username]}\n") end input.expect("Password:") do output.write("#{credentials[:password]}\n") end if input.gets == "SOMETHING" EXIT! end rescue Exception => e puts "GAE Error..." end end What is the right way to do that?

    Read the article

  • ruby on rails delajed_job failing with rvm

    - by mottalrd
    I have delayed_job installed and I start the daemon to run the jobs with this ruby script require 'rubygems' require 'daemon_spawn' $: << '.' RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) class DelayedJobWorker < DaemonSpawn::Base def start(args) ENV['RAILS_ENV'] ||= args.first || 'development' Dir.chdir RAILS_ROOT require File.join('config', 'environment') Delayed::Worker.new.start end def stop system("kill `cat #{RAILS_ROOT}/tmp/pids/delayed_job.pid`") end end DelayedJobWorker.spawn!(:log_file => File.join(RAILS_ROOT, "log", "delayed_job.log"), :pid_file => File.join(RAILS_ROOT, 'tmp', 'pids', 'delayed_job.pid'), :sync_log => true, :working_dir => RAILS_ROOT) If I run the command with rvmsudo it works perfectly If I simply use the ruby command without rvm it fails and this is the output, but I have no idea why this happens. Could you give me some clue? Thank you user@mysystem:~/redeal.it/application$ ruby script/delayed_job start production /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:16:in `kill': Operation not permitted (Errno::EPERM) from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:16:in `alive?' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:125:in `alive?' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:176:in `block in start' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:176:in `select' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:176:in `start' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:165:in `spawn!' from script/delayed_job:37:in `<main>'

    Read the article

  • Does Apache spawn piped logger on each HTTP request?

    - by Xepoch
    I am examining a high-volume Apache prefork site and noticing that many log entries such as: CustomLog '|/foo/bar/cronolog -foo -bar' RewriteLog '|/foo/bar/cronolog -bar -foo' When apache logs the request or the rewrite is cronolog spawned for EACH request or is the pipe opened and written-to for the lifetime duration of the preforked apache process? (This was asked on stackoverflow but I'll remove from there as more applicable here I think.)

    Read the article

  • Spawn a multi-threaded Java program from a Windows command line program, spawner won't end until spa

    - by Ross Patterson
    Short version: How can I prevent a spawned Java process in Windows from blocking the spawning process from ending? Long version: I'm trying to spawn a multi-threaded Java program (Selenium RC, not that it should matter) from a program launched from the Windows command line (NAnt's <exec> task, again, not that it should matter). I'm doing it using the Windows "start" command, and the spawned process is started and runs correctly. The spawning process receives control back and finishes (NAnt says "BUILD SUCCEEDED"), but doesn't actually exit to the command line. When the spawned process finally terminates (could be hours later), the command process returns and the command line prompt occurs. For example: <target name="start_rc"> <exec program="cmd" failonerror="false" workingdir="${ross.p5.dir}\Tools\selenium\selenium-server-1.0.1" verbose="true"> <arg value="/C"/> <arg value="start"/> <arg value="java"/> <arg value="-jar"/> <arg path="${ross.p5.dir}\Tools\selenium\selenium-server-1.0.1\selenium-server.jar"/> <arg value="-userExtensions"/> <arg path="${ross.p5.dir}\Tools\selenium\selenium-server-1.0.1\user-extensions.js"/> <arg value="-browserSideLog"/> <arg value="-log"/> <arg value="${ross.p5.dir}\artifacts\selenium.log"/> <arg value="-debug"/> </exec> </target> Produces: C :\Ross>nant start_rc NAnt 0.86 (Build 0.86.2898.0; beta1; 12/8/2007) Copyright (C) 2001-2007 Gerry Shaw http://nant.sourceforge.net Buildfile: file:///C:/Ross/ross.build Target framework: Microsoft .NET Framework 3.5 Target(s) specified: start_rc start_rc: [exec] Starting 'cmd (/C start java -jar C:\p5\Tools\selenium\selenium-server-1.0.1\selenium-server.jar -userExtensions C:\p5\Tools\selenium\selenium-server-1.0.1\user-extensions.js -browserSideLog -log C:\p5\artifacts\selenium.log -debug)' in 'C:\p5\Tools\selenium\selenium-server-1.0.1' BUILD SUCCEEDED Total time: 4.1 seconds. ... and then nothing until I close the window where Java is running, then ... C:\Ross> Obviously something is preventing the nant process from terminating, but shouldn't the Windows START command prevent that?

    Read the article

  • Method for spawning enemies according to player score and game time

    - by Sun
    I'm making a top-down shooter and want to scale the difficulty of the game according to what the score is and how much time has Passed. Along with this, I want to spawn enemies in different patterns and increase the intervals at which these enemies are shown. I'm going for a similar effect to Geometry wars. However, I can think of a to do this other than have multiple if-else statments, e.g. : if (score > 1000) { //spawn x amount if enemies } else if (score > 10000) { //spawn x amount of enemy type 1 & 2 } else if (score > 15000) { //spawn x amount of enemy type 1 & 2 & 3 } else if (score > 25000) { //spawn x amount of enemy type 1 & 2 & 3 //create patterns with enemies } ...etc What would be a better method of spawning enemies as I have described?

    Read the article

  • In a process using lots of memory, how can I spawn a shell without a memory-hungry fork()?

    - by kdt
    On an embedded platform (with no swap partition), I have an application whose main process occupies most of the available physical memory. The problem is that I want to launch an external shell script from my application, but using fork() requires that there be enough memory for 2x my original process before the child process (which will ultimately execl itself to something much smaller) can be created. So is there any way to invoke a shell script from a C program without incurring the memory overhead of a fork()? I've considered workarounds such as having a secondary smaller process which is responsible for creating shells, or having a "watcher" script which I signal by touching a file or somesuch, but I'd much rather have something simpler.

    Read the article

  • Is it ok to initialize an RB_ConstraintActor in PostBeginPlay?

    - by Almo
    I have a KActorSpawnable subclass that acts weird. In PostBeginPlay, I initialize an RB_ConstraintActor; the default is not to allow rotation. If I create one in the editor, it's fine, and won't rotate. If I spawn one, it rotates. Here's the class: class QuadForceKActor extends KActorSpawnable placeable; var(Behavior) bool bConstrainRotation; var(Behavior) bool bConstrainX; var(Behavior) bool bConstrainY; var(Behavior) bool bConstrainZ; var RB_ConstraintActor PhysicsConstraintActor; simulated event PostBeginPlay() { Super.PostBeginPlay(); PhysicsConstraintActor = Spawn(class'RB_ConstraintActorSpawnable', self, '', Location, rot(0, 0, 0)); if(bConstrainRotation) { PhysicsConstraintActor.ConstraintSetup.bSwingLimited = true; PhysicsConstraintActor.ConstraintSetup.bTwistLimited = true; } SetLinearConstraints(bConstrainX, bConstrainY, bConstrainZ); PhysicsConstraintActor.InitConstraint(self, None); } function SetLinearConstraints(bool InConstrainX, bool InConstrainY, bool InConstrainZ) { if(InConstrainX) { PhysicsConstraintActor.ConstraintSetup.LinearXSetup.bLimited = 1; } else { PhysicsConstraintActor.ConstraintSetup.LinearXSetup.bLimited = 0; } if(InConstrainY) { PhysicsConstraintActor.ConstraintSetup.LinearYSetup.bLimited = 1; } else { PhysicsConstraintActor.ConstraintSetup.LinearYSetup.bLimited = 0; } if(InConstrainZ) { PhysicsConstraintActor.ConstraintSetup.LinearZSetup.bLimited = 1; } else { PhysicsConstraintActor.ConstraintSetup.LinearZSetup.bLimited = 0; } } DefaultProperties { bConstrainRotation=true bConstrainX=false bConstrainY=false bConstrainZ=false bSafeBaseIfAsleep=false bNoEncroachCheck=false } Here's the code I use to spawn one. It's a subclass of the one above, but it doesn't reference the constraint at all. local QuadForceKCreateBlock BlockActor; BlockActor = spawn(class'QuadForceKCreateBlock', none, 'PowerCreate_Block', BlockLocation(), m_PreparedRotation, , false); BlockActor.SetDuration(m_BlockDuration); BlockActor.StaticMeshComponent.SetNotifyRigidBodyCollision(true); BlockActor.StaticMeshComponent.ScriptRigidBodyCollisionThreshold = 0.001; BlockActor.StaticMeshComponent.SetStaticMesh(m_ValidCreationBlock.StaticMesh); BlockActor.StaticMeshComponent.AddImpulse(m_InitialVelocity); I used to initialize an RB_ConstraintActor where I spawned it from the outside. This worked, which is why I'm pretty sure it has nothing to do with the other code in QuadForceKCreateBlock. I then added the internal constraint in QuadForceKActor for other purposes. When I realized I had two constraints on the CreateBlock doing the same thing, I removed the constraint code from the place where I spawn it. Then it started rotating. Is there a reason I should not be initializing an RB_ConstraintActor in PostBeginPlay? I feel like there's some basic thing about how the engine works that I'm missing.

    Read the article

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