Search Results

Search found 748 results on 30 pages for 'periodically'.

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

  • Guice + Quartz + iBatis

    - by DroidIn.net
    I'm trying to wire together Guice (Java), Quartz scheduler and iBatis (iBaGuice) to do the following: Start command line utility-scanner using main() Periodically scan directory (provided as argument) for files containing formatted output (XML or YAML) When file is detected, parse and output result to the database The problems: I used this example to wire Guice and Quartz. However I'm missing some important details which I'm asking in the comments but the post is somewhat dated so I'm quoting it here also: It's not obvious how to set-up the scheduler. Where and how would I wire the Trigger (I can use Trigger#makeMinutelyTrigger)? I really have just one type of job I will be executing, I understand that details in the JobFactory#newJob are coming from the TriggerFiredBundle parameter but where/how do I wire that? And where/how do I create or wire concrete Job?

    Read the article

  • How can I fast-forward a single git commit, programmatically?

    - by Norman Ramsey
    I periodically get message from git that look like this: Your branch is behind the tracked remote branch 'local-master/master' by 3 commits, and can be fast-forwarded. I would like to be able to write commands in a shell script that can do the following: How can I tell if my current branch can be fast-forwarded from the remote branch it is tracking? How can I tell how many commits "behind" my branch is? How can I fast-forward by just one commit, so that for example, my local branch would go from "behind by 3 commits" to "behind by 2 commits"? (For those who are interested, I am trying to put together a quality git/darcs mirror.)

    Read the article

  • Using a filename with spaces with scp and chmod in bash.

    - by speciousfool
    Periodically, I like to put files in the /tmp directory of my webserver to share out. What is annoying is that I must set the permissions whenever I scp the files. Following the advice from another question I've written a script which copies the file over, sets the permissions and then prints the URL: #!/bin/bash scp "$1" SERVER:"/var/www/tmp/$1" ssh SERVER chmod 644 "/var/www/tmp/$1" echo "URL is: http://SERVER/tmp/$1" When I replace SERVER with my actual host, everything works as expected...until I execute the script with an argument including spaces. Although I suspect the solution might be to use $@ I've not yet figured out how to get a spaced filename to work.

    Read the article

  • How to establish a two-way communication between Activity and Service in different process?

    - by steff
    Hi everyone, I'm working on establishing a two-way communication between an Activity and a Service which runs in a different process. Querying the process from the Activity is no big deal. But I want the process to notify the Activity on events. The idea behind it is this: the service runs independently from the actual app. It queries a webserver periodically. If a new task is found on the webserver the process should notify the activity. I found this thread over at AndDev.org but it doesn't seem to work for me. I've been messing around with BroadcastReceiver. I've implemented an interface which should notify the Activity but the problem is that the listener is always null since the Broadcast from the process is done via Intent, hence the class that extends BroadcastReceiver will be newly instantiated. How can I establish a 2-way communication? This has to be possible. Thanks for any help, steff

    Read the article

  • Session ID Rotation - does it enhance security?

    - by dound
    (I think) I understand why session IDs should be rotated when the user logs in - this is one important step to prevent session fixation. However, is there any advantage to randomly/periodically rotating session IDs? This seems to only provide a false sense of security in my opinion. Assuming session IDs are not vulnerable to brute-force guessing and you only transmit the session ID in a cookie (not as part of URLs), then an attacker will have to access your cookie (most likely by snooping on your traffic) to get your session ID. Thus if the attacker gets one session ID, they'll probably be able to sniff the rotated session ID too - and thus randomly rotating has not enhanced security.

    Read the article

  • Garbage collecting at ColdFusion CFC

    - by Sergii
    Hello. I have a CFC as singletone object in Application scope. One of the methods is used for massive data processing and periodically causes the "Java heap space" errors. EDIT All variables inside the method are VAR-scoped, so they should not be kept in the object scope when invokation ended. It can be a bit dumb question for Java people, but I'd like to know how Java garbage collector cleans up the CFC methods memory: only when whole request ends, or maybe right after each method/function invokation? Second option is interesting because it can allow me to split my large method into the few, as one of the possible optimizations.

    Read the article

  • In Rails: How can I turn off caching for a particular activerecord database table?

    - by pmneve
    I have an associative table (scripts_runs) (has_many, through) that carries a status column ('started', 'ready to parse', 'completed' ). The started and ready to parse states are signaled by 'flag' files from distributed executions of the scripts pickedup periodically (20 seconds). The completed status is written directly to the associative table by the parser when it is done. With short scripts the complete status is written before the ready to parse flag file is picked up. Because the row from the table is cached, the complete status is not seen by the observer for the flag files and gets overwritten by the ready to parse status. This is not good. I need the status to be updated in the database in the correct sequence so an Ajax periodic query can inform the user of the status of each script and when the run ( consisting of one to many scripts ) is completed. Can I force the ScriptRun.find(:id) to always go to the database? If so how? If not, why not???

    Read the article

  • Redirect and parse in realtime stdout of an long running process in vb.net

    - by Richard
    Hello there, This code executes "handbrakecli" (a command line application) and places the output into a string: Dim p As Process = New Process p.StartInfo.FileName = "handbrakecli" p.StartInfo.Arguments = "-i [source] -o [destination]" p.StartInfo.UseShellExecute = False p.StartInfo.RedirectStandardOutput = True p.Start Dim output As String = p.StandardOutput.ReadToEnd p.WaitForExit The problem is that this can take up to 20 minutes to complete during which nothing will be reported back to the user. Once it's completed, they'll see all the output from the application which includes progress details. Not very useful. Therefore I'm trying to find a sample that shows the best way to: Start an external application (hidden) Monitor its output periodically as it displays information about it's progress (so I can extract this and present a nice percentage bar to the user) Determine when the external application has finished (so I can't continue with my own applications execution) Kill the external application if necessary and detect when this has happened (so that if the user hits "cancel", I get take the appropriate steps) Does anyone have any recommended code snippets?

    Read the article

  • Can you use the PackageMaker command to create an installer from a list of files?

    - by zekel
    I want to (periodically and automatically) create an installer from various files and folders that are in many places. But, I can't figure out how to supply the packagemaker command with all the paths of the items I want to install. This is for internal development purposes, not for customer distribution. I want the files included to be configureable; it's not really an option to use the GUI to add all the paths because they will change frequently. The best I could do was to use the --watch flag and touch all of the stuff I wanted included in the package. This is very messy and includes other files that happen to be accessed at the same time. There isn't a common scheme to what I want to include, so I can't just --filter the rest out. Is there a better way? Am I missing the point?

    Read the article

  • Programmatic resource monitoring per process in Linux

    - by tuxx
    Hi, I want to know if there is an efficient solution to monitor a process resource consumption (cpu, memory, network bandwidth) in Linux. I want to write a daemon in C++ that does this monitoring for some given PIDs. From what I know, the classic solution is to periodically read the information from /proc, but this doesn't seem the most efficient way (it involves many system calls). For example to monitor the memory usage every second for 50 processes, I have to open, read and close 50 files (that means 150 system calls) every second from /proc. Not to mention the parsing involved when reading these files. Another problem is the network bandwidth consumption: this cannot be easily computed for each process I want to monitor. The solution adopted by NetHogs involves a pretty high overhead in my opinion: it captures and analyzes every packet using libpcap, then for each packet the local port is determined and searched in /proc to find the corresponding process. Do you know if there are more efficient alternatives to these methods presented or any libraries that deal with this problems?

    Read the article

  • Server is on or off

    - by Daniel
    Curious. I'm starting to broadcast high school football games online, and it uses a program to broadcast the feeds off my computer. However, when I shut the program down or the computer down, the server goes offline and guests won't be able to access the feeds. Is there any kind of code out there that I can post onto my website that will indicate to my guests whether the server is on or off? I would figure it would be a simple code, a php script or something that periodically checks to see if a site is on line and then displays ON or OFF.

    Read the article

  • what is the right way to exit Windoes Service OnStart if configuration is wrong and nothing to do in

    - by matti
    Is something like this ok? protected override void OnStart(string[] args) { if (SomeApp.Initialize()) { SomeApp.StartMonitorAndWork(); base.OnStart(args); } } protected override void OnStop() { SomeApp.TearDown(); base.OnStop(); } Here Initialize reads a config file and if it's wrong there's nothing to do so service should STOP! If config is ok StartMonitorAndWork starts: Timer(new TimerCallback(DoWork), null, startTime, loopTime); and DoWork polls database periodically. The question is: "Is exiting OnStart without doing nothing enough if Initialize returns false? OR should there be something like this: private void ExitService() { this.OnStop(); System.Environment.Exit(1); } protected override void OnStart(string[] args) { if (ObjectFolderApp.Initialize()) { SomeApp.StartMonitorAndWork(); base.OnStart(args); } else { ExitService(); } } Thanks & BR - Matti

    Read the article

  • Ruby Multithreading: making one thread wait for a signal from another

    - by Peter
    In Ruby, I want to have two threads running at the same time, and want the background thread to periodically signal the foreground thread. How do I get the foreground thread to block until the background thread says 'go'? I can think of a few ways to do it, but am after the most appropriate, idiomatic Ruby method. In code: loop do # background, thread 1 sleep 3 receive_input # tell foreground input is ready # <-- how do I do this? end and loop do # foreground, thread 2 wait_for_signal_from_background # <-- how do I do this? do_something end

    Read the article

  • Limiting the size of the managed heap in a C# application

    - by Assaf Lavie
    Can I configure my C# application to limit its memory consumption to, say, 200MB? IOW, I don't want to wait for the automatic GC (which seems to allow the heap to grow much more than actually needed by this application). I know that in Java there's a command line switch you can pass to the JVM that achieves this.. is there an equivalent in C#? p.s. I know that I can invoke the GC from code, but that's something I would rather not have to do periodically. I'd rather set it once upon startup somehow and forget it.

    Read the article

  • What might cause SQL error Cannot find the object "dbo.InspectionEvents" because it does not exist o

    - by mrtrombone
    Hi My ASP.Net app is periodically getting the error 'Cannot find the object dbo."XXXX" because it does not exist or you do not have permissions' when it tries to execute a specific stored procedure that writes to the database. I have seen a few forum posts about this issue but the strange thing is that the method works fine almost all of the time, just every now and then I see it in my error logs. Can anyone tell me why this might works Ok most of the time but occassionally fire the error? Application is C# using Enterprise Library 4.1 Data Access. Database is SQL Server 2005 Cheers

    Read the article

  • python and paramiko: how to check if end of ssh tunnel is still alive and reestablish if not?

    - by Christian
    Hello all, I'm trying to achieve the following: I have two hosts A and B. A establishes a remote port forwarding tunnel on B, i.e. B is the one a port is forwarded on to some where else and A is the one that sets up the tunnel. I tried the script rforward.py that ships with paramiko and it works very well so far. (I'm running rforward.py on A, which connects to B and forwards a port of B to somewhere else) However, when B is shutting down, A doesn't seem to recognize it. I'd rather like A to recognize that B is down and to try to reestablish the connection periodically in case B comes up again. Is there a way to do this? Thanks.

    Read the article

  • Continuous Progress Bar in Javascript

    - by Goro
    Hello, I am trying to find the best option to create a simple progress bar that I need to be triggered periodically from within another JavaScript script. Every few minutes, a timer would cause the progress bar to start going from 0 to 100%. Once it reaches 100%, the bar would reset to 0. I am trying to implement a smooth animated version of the bar, like this one: http://www.webappers.com/progressBar/. (I tried adapting this particular one but I could not get it to work the way I described) I am looking into the jQuery UI ProgressBar: Is it possible to use it in the manner I have described? Thank you.

    Read the article

  • XmlDocument caching memory usage

    - by mdsharpe
    We are seeing very high memory usage in .NET web applications which use XmlDocument. A small (~5MB) XML document is loaded into an XmlDocument object and stored in HttpContext.Cache for easy querying and XSLT transformation on each page load. The XML is modified on disk periodically so a cache has a dependency on the file. Such an application appears to be using hundreds of megabytes of RAM. I have experimented with requesting garbage collection on each request start, and this keeps the RAM usage far lower but I cannot imagine this is good practise. Does anyone have any suggestions as to how we can achieve the same goal but with lower RAM usage?

    Read the article

  • Mercurial Messing Up csproj Files?

    - by alphadogg
    I am using Hg to manage and merge code with three other developers involved in a VS2008 project. We do have an .hgignore file that ignores a fair number of files not necessary to track, such as *.pdb, *.obj, etc. However, we do track .csproj files. Periodically, it would seem that files go missing after a merge. We would get build issues, and have to relocate files which were in the project folders, but not in the csproj file. Eventually, I noted during a merge conflict that sometimes Hg seems to merge incorrectly. Here's a screenshot below. The actual conflict that requires manual intervention is lower in the file. But in this section, hg incorrectly replaces DirectoryTasks.cs with a new, different file called ReportTasks.cs, when in fact, both should be added. How do people manage to avoid this?

    Read the article

  • Embedded Linux: Memory Fragmentation

    - by waffleman
    In many embedded systems, memory fragmentation is a concern. Particularly, for software that runs for long periods of time (months, years, etc...). For many projects, the solution is to simply not use dynamic memory allocation such as malloc/free and new/delete. Global memory is used whenever possible and memory pools for types that are frequently allocated and deallocated are good strategies to avoid dynamic memory management use. In Embedded Linux how is this addressed? I see many libraries use dynamic memory. Is there mechanism that the OS uses to prevent memory fragmentation? Does it clean up the heap periodically? Or should one avoid using these libraries in an embedded environment?

    Read the article

  • amazon design doubt

    - by praveen
    I was looking at the amazon website and was wondering how one of the feature would have been implemented. The feature : what customers buy after viewing a particular item. If i were to develop such a feature i would probably generate a session id for each user session and store the session id-page id combination in a log file. and if a book is bought set a separate flag for the session id-page id. A separate program can then be run on the log file periodically, to identify the groups that were bought together/viewed together and that information can be stored in a persistent file. This is ofcourse a simple solution without taking into consideration the distributed nature of the servers - but would this suffice or can you help me identify a better design.

    Read the article

  • ASP.Net: Scheduled tasks in a shared environment.

    - by UpTheCreek
    This is really an extension of this question, which asked the best way to schedule tasks which need to be performed periodically within ASP.NET in a normal environment. However, I would like to ask this specifically for a Shared Hosting Environment (most of the answers to the previous question would not work in a shared environment as far as I know). One obvious solution would be to have a page which is responsible to performing the tasks on the hosted machine, and call this page from another machine (that you have full control over) using e.g. a windows scheduled task. This is a bit nasty though - are there any better approaches?

    Read the article

  • Copying Some from a PostgreSQL Server to Another

    - by whollychao
    I am in need of an application that can periodically transmit select rows from a PostgreSQL database across a network to a second PostgreSQL server. Typically these will be the most recent row added, pulled and transmitted every 10-30 seconds. The primary servers run in a MS Windows environment with a high-latency, and occasionally intermittent, network connection. Therefore, any application would have to be tolerant of this and ideally automatically reconnect / resend data that could not be transmitted. Due to the environment and the requirements, a full-blown replication package would be unnecessary. I appreciate any help anyone has with this problem.

    Read the article

  • What's the best way to check if the view is visible on the window?

    - by bhups
    What's the best way to check if the view is visible on the window? I have a CustomView which is part of my SDK and anybody can add CustomView to their layouts. My CustomView is taking some actions when it is visible to the user periodically. So if view becomes invisible to the user then it needs to stop the timer and when it becomes visible again it should restart its course. But unfortunately there is no certain way of checking if my CustomView becomes visible or invisible to the user. There are few things that I can check and listen to: onVisibilityChange //it is for view's visibility change, and is introduced in new API 8 version so has backward compatibility issue onWindowVisibilityChange //but my CustomView can be part of a ViewFlipper's Views so it can pose issues onDetachedFromWindows //this not as useful onWindowFocusChanged //Again my CustomView can be part of ViewFlipper's views. So if anybody has faced this kind of issues please throw some light.

    Read the article

  • Strategy in storing ad-hoc numbers/constants?

    - by Jiho Han
    I have a need to store a number of ad-hoc figures and constants for calculation. These numbers change periodically but they are different type of values. One might be a balance, a money amount, another might be an interest rate, and yet another might be a ratio of some kind. These numbers are then used in a calculation that involve other more structured figures. I'm not certain what the best way to store these in a relational DB is - that's the choice of storage for the app. One way, I've done before, is to create a very generic table that stores the values as text. I might store the data type along with it but the consumer knows what type it is so, in situations I didn't even need to store the data type. This kind of works fine but I am not very fond of the solution. Should I break down each of the numbers into specific categories and create tables that way? For example, create Rates table, and Balances table, etc.?

    Read the article

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