Search Results

Search found 1003 results on 41 pages for 'notify osd'.

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

  • Threads syncronization with ThreadPoolExecutor

    - by justme1
    I'm trying to implement some logic when I create main(father) thread witch executes several other threads. Then it waits for some condition which child threads creates. After condition is meet the father executes some more child threads. The problem that when I use wait/notify I have java.lang.IllegalMonitorStateException exception. Here is the code: public class MyExecutor { final static ArrayBlockingQueue<Runnable> queue = new ArrayBlockingQueue<Runnable>(10); final static ExecutorService svc = Executors.newFixedThreadPool(1); static final ThreadPoolExecutor threadPool = new ThreadPoolExecutor(5, 8, 10, TimeUnit.SECONDS, queue); public static void main(String[] args) throws InterruptedException { final MyExecutor me = new MyExecutor(); svc.execute(new Runnable() { public void run() { try { System.out.println("Main Thread"); me.execute(threadPool, 1); System.out.println("Main Thread waiting"); wait(); System.out.println("Main Thread notified"); me.execute(threadPool, 2); Thread.sleep(100); threadPool.shutdown(); threadPool.awaitTermination(20000, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } } }); svc.shutdown(); svc.awaitTermination(10000, TimeUnit.SECONDS); System.out.println("Main Thread finished"); } public void execute(ThreadPoolExecutor tpe, final int id) { tpe.execute(new Runnable() { public void run() { try { System.out.println("Child Thread " + id); Thread.sleep(2000); System.out.println("Child Thread " + id + " finished"); notify(); } catch (InterruptedException e) { e.printStackTrace(); } } }); } } When I comment wait and notify line I have the following output: Main Thread Main Thread waiting Main Thread notified Child Thread 1 Child Thread 2 Child Thread 1 finished Child Thread 2 finished Main Thread finished

    Read the article

  • OSD desktop-clock that does not get in your way?

    - by YSN
    Hello, is there a clock application, that can be placed on your screen like a widget staying always on top but automatically fades away on mouseover enabling you to click through it on items below, (behaves pretty much like the Ubuntu notifications in that sense). I am aware, that there are screenlets and gdesklets widget apps, but those are buggy, look outdated, and do not comply with the criteria listed above. What I have in mind is a clock that is large, (digital), always visible (on top of all other windows), and does not disrupt your work (e.g. you can still click that scroll bar or button if it is just below the clock, since the clock fades away on hovering). A tool called "OSD-Lyrics" that show lyrics for songs and behaves exactly the way I described above. So it should be possible (and even easier) to do the same with a clock. Thanks in advance, YSN

    Read the article

  • Animated Notify Icon like the task manager graph

    - by Blind Trevor
    Hi guys, I'm trying to create a bandwidth monitor - I've done most of it, but I want to have a notifyicon that changes dependent on the bandwidth. The same as when you open task manager and then minimise it, there is a little animated bar graph by the clock showing CPU usage... How do I do that??? Any help would be appreciated.

    Read the article

  • Notify user on database change? JavaScript/AJAX

    - by Andreas Carlbom
    Yo. I'm really quite new to this whole JavaScript business, not to mention AJAX, so I was thinking if you guys could help me out with a conundrum. Basically, what I want is for the user to be notified upon a change in a value of a MySQL table. How should I go about that? Should I use jQuery, or can I slap something together myself? Thankful for any and all replies.

    Read the article

  • two UserControls, one page, need to notify each other of updates

    - by jeriley
    I've got a user control thats used twice on the same page, each have the ability to be updated (a dropdown list gets a new item) and I'm not sure what might be the best way to handle this. One concern - this is an older system (~4+ years, datasets, .net2) and it is amazingly brittle. I did manage to have it run on 3.5 with no problems, but I've had a few run-ins with the javascript validation (~300 lines per page) throwing up all over the place when I change/add/modify controls in the parent.

    Read the article

  • WPF, notify a child in the element tree about an event in a parent

    - by jester
    I am developing a WPF app and I want an event in a parent to be notified to several of its children in the element tree, so that each of them can take an action accordingly. I know that a custom RoutedEvent can be used to signal in the other direction from a child to one of its ancestors by bubbling the event upwards, so that any of the ancestor elements can handle the event. What I want is the children to be notified about an event in the parent and they handle them appropriately. What is the best strategy to achieve this? EDIT: Clarifying the comments : Say I have a parent UserControl. It has a TabControl and its contents are several nested child UserControls. Now consider a scenario where I want the TabControl.SelectionChanged() event to cause some changes in each of the child UserControl. How to achieve this? (The contents of each tab is a UserControl which themselves may contain another few levels of children UserControls. I want the UserControl in the bottom level to know about the SelectionChanged() event and respond accordingly).

    Read the article

  • performSelectorInBackground, notify other viewcontroller when done.

    - by Michiel
    Hi, I have a method used to save an image when the user clicks Save. I use performSelectorInBackground to save the image, the viewcontroller is popped and the previous viewcontroller is shown. I want the table (on the previousUIViewController) to reload its data when the imagesaving is done. How can I do this? The save method is called like this: [self performSelectorInBackground:@selector(saveImage) withObject:nil]; [self.navigationController popViewControllerAnimated:YES];

    Read the article

  • how do I notify child controls of a change in the parent

    - by fishhead
    what is the best way to keep a child control up to date for changes in the parent. I have a number of child controls hosted inside my parent object and I can think of two ways to send change information to them. 1) wire the child control to an event in the parent. and fire that event on a change in the parent 2) keep a list of the children in an array and intenerate through the array when the change has happened and invoke a method in the child to handle the new changes. I hope I describe it okay. both work but there is probably a right way to handle this and a wrong way.

    Read the article

  • How to run command in the background and notify me via email when done

    - by Abs
    Hello all, I have the following command which will take ages to run (couple of hours). I would like to make it a background process and for it to send me an email when its done. For the cherry on the top, any errors it encountered should write to a text file when an error has occurred? find . -type f -name "*.rm" -exec ./rm2mp3.sh \{} \; -exec rm \{} \; How can I do this with my above command?

    Read the article

  • Openerp - notify users by message when a product has been created

    - by vissu
    I am customizing OpenERP. I need to display a notification message to all "Purchase Managers" as soon as a product created by user. I saw a message is created under settings - Email - Messages by saying "Product Created". However it is not displaying for the managers under main menu Messaging - Inbox. I want put this message as notification for managers. However, not able to find any good documentation in Google. Correct me if I am missing any basic logic.

    Read the article

  • Notify by email when passenger error occurs

    - by foresth
    Hello, is it possible to send notification emails when passenger error occurs? Something similar to the email sending by exception notifier when there is an error in Rails app. I wonder because now we have no way to find out if someone hits an unexpected app spawner or other error (like memory limit etc.). Thank you!

    Read the article

  • how to show jquery notify bar on submit using php or zend?

    - by user1400
    hi guys in my application on zend framework i use of 'jQuery Notify Bar' plugin for display messages, i'd like to show message when my form submit ,the other page is opened and notify bar be open until the other page is completely load and even some second more but the problem is that notify bar show for short Moment and when the other page begin to load , notify bar is closed, and the delay property is not effect to that $('#myForm').submit(function(){ $.notifyBar({ html: "Thank you, your settings were updated!", **delay: 20000,** animationSpeed: "normal" }); how to show notify bar in the other page too? thanks

    Read the article

  • How to flash the JFrame on Windows taskbar when it needs attention?

    - by japflap7stackoverflow
    Hi, i'm a computer science student working on a Yahoo Messenger - like program implemented in Java. My problem is that whenever the JTextArea inside my frame contains new message updates, the user must be prompted even when his/her frame is minimized. Is there a workaround on how to make the JFrame on the taskbar blink when updates are received? In short, i badly need a way to notify the user that the frame has been updated even though it is minimized. Is that possible? Thanks for you help. ^_^

    Read the article

  • Can a thread call wait() on two locks at once in Java (6)

    - by Dr. Monkey
    I've just been messing around with threads in Java to get my head around them (it seems like the best way to do so) and now understand what's going on with synchronize, wait() and notify(). I'm curious about whether there's a way to wait() on two resources at once. I think the following won't quite do what I'm thinking of: synchronized(token1) { synchronized(token2) { token1.wait(); token2.wait(); //won't run until token1 is returned System.out.println("I got both tokens back"); } } In this (very contrived) case token2 will be held until token1 is returned, then token1 will be held until token2 is returned. The goal is to release both token1 and token2, then resume when both are available (note that moving the token1.wait() outside the inner synchronized loop is not what I'm getting at). A loop checking whether both are available might be more appropriate to achieve this behaviour (would this be getting near the idea of double-check locking?), but would use up extra resources - I'm not after a definitive solution since this is just to satisfy my curiosity.

    Read the article

  • Do I need to notify a user if I am using statistics software in an iPhone app?

    - by Chris
    Hello, I am currently creating a (very simple) Objective-C client to send basic statistical data to my server for an iPhone app - just things like the state of the app (first-launch or launch, error, etc), along with the make/model/version (i.e.: "iPod touch 4.2"). No personally identifiable information or location data is sent. Is there anything, in the Apple Developer agreement or otherwise, that states that I must notify the user if I am doing this? I'm not interested in selling the data or anything, I just want to use the data to make my apps better. I am not adverse to telling the user I am doing this if it is required, I just don't want to scare the users (the paranoid "oooh, they're tracking me, they know exactly where I am" crowd) if I don't have to. Thanks for any advice.

    Read the article

  • Is it time to deprecate synchronized, wait and notify?

    - by OldCurmudgeon
    Is there a single scenario (other than compatibility with ancient JVMs) where using synchronized is preferable to using a Lock? Can anyone justify using wait or notify over the newer systems? Is there any algorithm that must use one of them in its implementation? I see a previous questions that touched on this matter but I would like to take this a little further and actually deprecate them. There are far too many traps and pitfalls and caveats with them that have been ironed out with the new facilities. I just feel it may soon be time to mark them obsolete.

    Read the article

  • How to set Fn+F2 to show battery's status throug OSD and not power statistics?

    - by papukaija
    In natty pressing Fn+F2 on my Samsung NC10 opened a new notification with the remaining battery power. After upgrading to Oneiric, it opens the power statistics. Is the a way to revert this change? Checking the battery status with the notification is much faster than finding it from the power statistics. I know that the remaining battery time can be set to be shown on the panel but I'm used to Fn+F2.

    Read the article

  • ListView adapter data change without ListView being notified

    - by brockoli
    I've written a ListActivity that has a custom list adapter. The list is being updated from a ContentProvider when onCreate is run. I also have a service that gets started when I run the app and it first updates the ContentProvider, then sends a Broadcast that the content has been updated. My ListActivity recieves the broadcast and tries to update my ListView. My problem is, I'm getting intermittent errors about the ListView adapter data changing without the ListView being notified. I call the notifyDataSetChanged() method on my list adapter right after I update it. What it seems like is happening is the list is still in the process of being updated after first call in onCreate when it recieves the broadcast from the service to update, so it tries to update my ListView before it's finished updating from it's first run. Does this make sense? Here is some of my code. NOTE: The service is working properly, it gets new data and updates my ContentProvider, and I do get the broadcast in my activity when it is updated. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ctx = this; getPrefs(); setContentView(R.layout.main); // Setup preference listener preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences.registerOnSharedPreferenceChangeListener(listener); // Setup report list adapter ListView nzbLv = (ListView) findViewById(R.id.report_list); nzbla = new NZBReportListAdaptor(ctx); getReports(); nzbla.setListItems(report_list); nzbLv.setAdapter(nzbla); // Broadcast receiver to get notification from NZBService to update ReportList registerReceiver(receiver, new IntentFilter(NZBService.BROADCAST_ACTION)); startService(new Intent(ctx, NZBService.class)); } @Override public void onResume() { super.onResume(); timerHandler.resume(); new updateSabQueue().execute(); //updateList(); } @Override public void onPause() { super.onPause(); timerHandler.pause(); unregisterReceiver(receiver); } private BroadcastReceiver receiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { Toast.makeText(ctx, "NZBService broadcast recieved", Toast.LENGTH_SHORT).show(); updateReportList(); } }; private void updateReportList() { new updateReportList().execute(); } private class updateReportList extends AsyncTask<Void, Void, Boolean> { /* (non-Javadoc) * @see android.os.AsyncTask#onPreExecute() * Show progress dialog */ protected void onPreExecute() { } /* (non-Javadoc) * @see android.os.AsyncTask#doInBackground(Params[]) * Get new articles from the internet */ protected Boolean doInBackground(Void...unused) { getReports(); return true; } /** * On post execute. * Close the progress dialog */ @Override protected void onPostExecute(Boolean updated) { if (updated) { Log.d(TAG, "NZB report list adapter updated"); synchronized(this) { nzbla.setListItems(report_list); } Log.d(TAG, "NZB report list notified of change"); nzbla.notifyDataSetChanged(); } } } Now that this question is answered, I will post my updated code in an effort to help others who might come across it. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ctx = this; getPrefs(); setContentView(R.layout.main); // Setup preference listener preferences = PreferenceManager.getDefaultSharedPreferences(this); preferences.registerOnSharedPreferenceChangeListener(listener); // Setup report list adapter ListView nzbLv = (ListView) findViewById(R.id.report_list); nzbla = new NZBReportListAdaptor(ctx); report_list.addAll(getReports()); nzbla.setListItems(report_list); nzbLv.setAdapter(nzbla); // Broadcast receiver to get notification from NZBService to update ReportList registerReceiver(receiver, new IntentFilter(NZBService.BROADCAST_ACTION)); startService(new Intent(ctx, NZBService.class)); } private class updateReportList extends AsyncTask<Void, Void, ArrayList<Report>> { /* (non-Javadoc) * @see android.os.AsyncTask#onPreExecute() * Show progress dialog */ protected void onPreExecute() { } /* (non-Javadoc) * @see android.os.AsyncTask#doInBackground(Params[]) * Get new articles from the internet */ protected ArrayList<Report> doInBackground(Void...unused) { return getReports(); } /** * On post execute. * Close the progress dialog */ @Override protected void onPostExecute(ArrayList<Report> updated) { nzbla.setListItems(updated); nzbla.notifyDataSetChanged(); } } private ArrayList<Report> getReports() { ArrayList<Report> reports = new ArrayList<Report>(); ContentResolver r = getContentResolver(); Cursor c = r.query(NZBReportProvider.CONTENT_URI, null, null, null, NZBReportProvider.ARTICLE_KEY_ROWID + " DESC"); startManagingCursor(c); Log.d(TAG, "NZBReport cursor.getCount=" + c.getCount()); int title = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_TITLE); int desc = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_DESCRIPTION); int cat = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_CAT); int size = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_SIZE); int link = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_LINK); int catid = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_CATID); int date = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_DATE_ADDED); int group = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_GROUP); if (c.getCount() > 0) { c.moveToFirst(); do { URL url = null; try { url = new URL(c.getString(link)); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } reports.add(new Report(c.getString(title), url, c.getString(desc), c.getString(cat), c.getString(date), c.getString(size), c.getInt(catid), c.getString(group))); } while (c.moveToNext()); } return reports; }

    Read the article

  • How to detect if object was updated using Nhibernate?

    - by Karel Frajtak
    I need to find out how to perform some action (flush cache) when an object of type X is updated. So when I save object of type Y, nothing is done, when I save unchanged object of type X nothing should happed, but when this object is changed and UPDATE is made, I want to know it. I tried various NHibernate events (IPostUpdateEventListener, IFlushEntityEventListener, etc.) but did not succeed. Can anybody help please? Thanks

    Read the article

  • How to be notified when a script's background job completes?

    - by Keith Bentrup
    My question is very similar to this one except that my background process was started from a script. I could be doing something wrong but when I try this simple example: #!/bin/bash set -mb # enable job control and notification sleep 5 & I never receive notification when the sleep background command finishes. However, if I execute the same directly in the terminal, $ set -mb $ sleep 5 & [1]+ Done sleep 5 I see the output that I expect. I'm using bash on cygwin. I'm guessing that it might have something to do with where the output is directed, but trying various output redirection, I'm not getting any closer?

    Read the article

  • How Android BaseAdapter notifyDataSetChanged works?

    - by Yama moto
    In the document for the method notifyDataSetChanged of class BaseAdapter noted that "Notifies the attached observers that the underlying data has been changed and any View reflecting the data set should refresh itself. " Supposed I changed the 3rd element in my string array (array data for the listview), what "any View reflecting the data set should refresh itself" means ? Does the 3rd view item in my list view be notified ? Also, how is notifyDataSetChanged() and getView() concerned ? Thanks in advance

    Read the article

  • Get notified when some other application acquires wake lock

    - by Sebouh
    I am wondering if the following is possible in android. I want to have my application do a certain task whenever the phone get awoken. Whenever some other application acquires a wake lock to do it's task, I want my application to do something of its own. Can I get notified through an intent using a broadcast receiver about this event? If so, what will happen if that other application finishes before my task ends? The reason I'm asking is that I don't want to wake the phone up to do my task and affect the battery life. I want to take the opportunity of the wake lock to do my thing.

    Read the article

  • How to configure Thunderbird to notify new mails only in certain folders?

    - by Karthik
    I have Ubuntu 12.04 and recently started using Thunderbird. I have GMail account and have configured a lot of Labels in it, all of which appear as folders in Thunderbird. Most of these are just subscriptions to mailing lists and are not that important. I have a few labels which are very important, for whom I would like immediate notification when a mail arrives. The problem is that the Mail indicator in the Unity top Panel, lights up for any incoming mail. How do I configure it to indicate incoming mails only in certain folders?

    Read the article

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