w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Error "Task can be only monitored with a single monitor" when setting my monitor to a task in dll
OnMessage function creates implicit monitor which receives the task message and calls your anonymous function. Same goes for OnTerminated. If you wish to use MonitorWith, you should implement message processing and termination handling as a monitor events, not with OnMessage/OnTerminated functions.

Categories : Delphi

Using Performance Monitor to monitor pooled connections
You can run this from a SQL query windows to get a count and the details of current connections and session running on your SQL server. select * FROM sys.dm_exec_sessions AS es INNER JOIN sys.dm_exec_connections AS ec ON es.session_id = ec.session_id I've had trouble with pooled connections. They're hard to control. Explicitly closing them never seemed to work since they're under the control of .NET. The biggest reason we've run out of connections is uncommitted transactions. If a transaction is left uncommitted or rolled back for some reason, the connection, instead of being re-used, get's stuck in limbo, forcing .NET to open yet another connection to continue processing.

Categories : Sql Server

Monitor.Enter vs Monitor.Wait
According to MSDN: Monitor.Wait Method(Object) SynchronizationLockException: The calling thread does not own the lock for the specified object. In other words: You can only call Monitor.Wait(Object), when you already own the lock, whereas you call Monitor.Enter(Object) in order to acquire the lock. As for why Monitor.Wait is needed: If your thread realizes, that it is lacking information to continue execution (e.g. it's waiting for a signal), you might want to let other threads enter the critical section, because not all threads have the same prerequisites. For the waiting thread to continue execution, you will need to call Monitor.Pulse(Object) or Monitor.PulseAll(Object) before releasing the lock (otherwise, you're going to get the same kind of exception as with Monitor.Wait(Ob

Categories : C#

Notification when display gets connected or disconnected
There are several ways to achieve that: You could implement applicationDidChangeScreenParameters: in your app delegate (the method is part of the NSApplicationDelegateProtocol). Another way is to listen for the NSApplicationDidChangeScreenParametersNotification sent by the default notification center [NSNotificationCenter defaultCenter]. Whenever your delegate method is called or you receive the notification, you can iterate over [NSScreen screens] and see if a display got connected or removed (you have to maintain a display list you can check against at program launch). A non-Cocoa approach would be via Core Graphics Display services: You have to implement a reconfiguration function and register it with CGDisplayRegisterReconfigurationCallback(CGDisplayReconfigurationCallBack cb, void

Categories : Objective C

Website monitor display issue
Try wrapping a "Relative" #container around all your "absolute" divs. I've adjusted your code below: <body> <div id="container"> <div id="Links"> <a href="About.html"><img src="Slideshow/About.png" width="140em" /></a> <br /><br /> <a href="Contact.html"><img src="Slideshow/Contact.fw.png" width="140em" /></a> <br /><br /> <a href="Services.html"><img src="Slideshow/Services.fw.png" width="140em" /></a> </div> <div id="mainText"> <h1>Contact</h1> <p>If you want to contact me please call at <b>1.800.SUCCESS</b> or use the form below to sned me an email!</p> </div> <form name="contactform" method="post" action="send_form_email.php">

Categories : HTML

Win 8.1 DPI - WPF - How to find independent monitor/display's DPI
I suggest you read Developing a Per-Monitor DPI-Aware WPF Application on MSDN. This article covers pretty most of what you'll need to support High-DPI WPF Windows 8.1 apps. Note, though, that the examples given in the article above are mostly written in C++, but that's less of an issue for WinRT apps since C++ and C# can now interop more easily than before.

Categories : C#

Swing application won't display in unity when second monitor is on the left
Okay it's a simple as private static void createAndShowGUI() { //Create and set up the window. JFrame frame = new JFrame("HelloWorldSwing"); frame.setLocation (50, 50); ... setLocation copes just fine with the multiple monitors. It's just that the default location (if setLocation is not called) appears to be off screen when monitor 2 is left. 0,0 is at the top left on the left monitor as expected. However if you use setLocation(0,0) the window's close / minimize / maximize buttons are obscured by the unity top bar. I guess some platform-specific stuff is required to integrate with the unity top bar / side bar.

Categories : Java

How to detect whether headphone is connected to Mac or disconnected
The headphone port is represented as its own audio device. You can detect if it is the current default audio device. The CAPlayThrough example project provides a Cocoa based sample application for obtaining all possible input and output devices on the system, setting the default device for input and/or output, and playing through audio from the input device to the output.

Categories : Objective C

Emiting an event once a client has connected or disconnected to server
Actually that is fairly simple in sockets only import socket s = socket.socket() host = socket.gethostname() port = 7654 s.bind((host,port)) #bind the host/port to the server s.listen(1024) #put the server into listening mode client, address = s.accept() print "a client has connected "+str(address) onConnect(client) #this function is fired when a client connects (and uses the client object as arg while 1: data=client.recv(1024) #receives the data if data == None: break #breaks when empty data is being received (the client may have disconnected) print data #debug reasons print "The client has disconnected "+str(address) onDisconnect(client) #this function is fired when a client disconnects You still have to create the onConnect and onDisconnect functions

Categories : Python

Monitor changes to an array
If they add to the array by calling push(), you can simply create a custom push() method on the array that runs your handling code and calls Array.prototype.push(). This is how Google Analytics' _gaq array works.

Categories : Javascript

Get Monitor Count
This is not currently not possible with Javascript, you could perhaps attempt to take a guess by calculating the screen height and width. For example if the screen width is wider than the height * 1.78 then it means that it is more than a 16:9 aspect ratio then they are probably using a dual screen. Well then would window.innerWidth be better than screen.width? Other than that, this is not possible.

Categories : Javascript

how to monitor a file for changes?
I believe what are looking for is file change notifications such as FindFirstChangeNotification, FindNextChangeNotification, and ReadDirectoryChangesW you monitor a file or directory for changes, rename, write, and so on.

Categories : C++

How to monitor changes in a website?
You have set timer interval to 5000 milliseconds which makes it 5 seconds only. So your code will run every 5 seconds. If you want to run your timer every minute, you should set it to 1000x60=60000 ms. I hope this helps.

Categories : C#

Using git to just monitor changes on a webserver
Yes, using Git on a server should not interfere with the normal operation of the server (as mentioned in the comments, doing this on a production server is dodgy but I'll leave that to one side.) Note that using Git normally will create a .git directory at the root of whatever you're tracking. If that is your web server root directory, you might want to consider whether this is a risk as far as external access to the contents of the .git directory (depending on your server setup, this may or may not be a concern). If you want to create the .git directory somewhere else outside your working tree, see the GIT_DIR environment variable.

Categories : Linux

Trapping mouse on one monitor
Here's some simple Windows Forms code you can try. It uses the SetWindowsHookEx function to set a global mouse hook. In the hook method it checks to see whether the mouse coordinates are within the bounds of the primary screen and it adjusts the coordinates, if necessary. When you run this code, the mouse cursor will still be able to leave the primary screen area as long as you are just moving the mouse, but it will jump back as soon as a click event happens. You might want to combine my code with your ClipCursor technique to prevent this from happening. public partial class Form1 : Form { private const int WH_MOUSE_LL = 14; private delegate int HookProc(int code, IntPtr wParam, IntPtr lParam); [DllImport("user32.dll", EntryPoint = "SetWindowsHookEx", SetLastError = true)]

Categories : Dotnet

Substituting a dll, to monitor dll usage
yes, entirely possible you can already figure out what the function signatures are and re-implement them (heh, Google already did this with Java JRE :) ) The problem you have is loading a different dll with the same name, though its entirely possible you can do this explicitly with a fixed directory. you can load the dll and then hook up all its functions. At least that's what I think will happen - having 2 dlls of the same name in the same process might be troublesome (but I think, different path, all's ok). Security generally isn't done when loading dlls, however MS does this with some .NET assemblies, but the cost is that it takes a long time to load them as there's a significant delay caused by the decryption required to secure the dll. this is why a lot of .NET applications (espec

Categories : Windows

Can one monitor STM's contention level?
You can observe the history count of a ref which will indicate that there is contention on it: user=> (def my-ref (ref 0 :min-history 1)) #'user/my-ref user=> (ref-history-count my-ref) 0 user=> (dosync (alter my-ref inc)) 1 user=> (ref-history-count my-ref) 1 The history count does not directly represent contention. Instead it represents the number of past values that have been maintained in order to service concurrent reads. The size of the history is limited by min and max values. By default those are 0 and 10, respectively, but you can change them when creating the ref (see above). Since min-history is 0 by default, you won't usually see ref-history-count return non-zero values, unless there is contention on the ref. See more discussion on history count here: https://g

Categories : Clojure

Why do we need objects monitor if there is only thread
Object.wait isn't "wait this long". It's "wait for some other thread to do something". The forms that take arguments are "wait for some other thread to do something, but get bored and stop after this long". You need to hold the object's lock to ensure proper synchronization with the thread that will notify you that the thing you're waiting for got done. It doesn't make sense to use the method in a single-threaded context. If you just want to wait for a certain length of time, Thread.sleep is the method you want.

Categories : Java

campaign monitor api get summary
See stdClass object and foreach loops - campaign monitor api I think you might need: $campaigns = $result->response->Results; then: foreach($campaigns as $s) { echo $s->Recipients . " " . $s->TotalOpened . " "; // etc. } Most Campaign Monitor methods return objects have a response->Results structure to get at the individual items in a set (campaigns, lists, subscribers etc.). As you probably saw, the documentation doesn't explain this last step - it just var_dumps the objects, although you can work out what to do by examining them. Make sure you check whether there are any wrappers before you examine the object directly, but I've found you mostly end up using response->Results to get at the arrays of data. Pete

Categories : PHP

SynchronizationLockException on Monitor.Exit()?
The code as posted is fundamentally wrong. The Monitor::Enter() call must appear outside of the try{} block. The failure mode is nasty and undiagnosable. If the Enter() call throw an exception for any reason then the Exit() call in the finally{} block will crash with the documented exception since the monitor was never entered. It is undiagnosable because that exception replaces the one thrown by the Enter() method, you cannot see it nor catch the original exception. So you have no idea why this code failed and cannot fix the problem. Move the Enter call above the try block. That still doesn't fix the problem that your code crashes but at least you'll now have some decent info about what is really going wrong. Btw, do note the added Monitor::Enter() overload available in .NET 4.0

Categories : Visual Studio

How do I monitor redistogo logs?
Do you mean that ? redis-cli -h host.redistogo.com -p portnumber -a yourpassword monitor If you are looking for a monitoring tool take a look at RedisLive it requires some configuration and is self hosted but does the job. On the contrary if you are looking for a full featued Redis GUI (real-time editor/client list/slowlog/data-viz, online monitoring, configuration, advanced terminal and so on...) you will want to give a try to Redsmin. Disclaimer: I'm the founder of Redsmin.

Categories : Ruby On Rails

gdbus-monitor - interface ``
Looking into dbus-monitor's source code shows that it occures as soon as DBUS_EXPORT const char * dbus_message_get_interface ( DBusMessage * message ) returns NULL (which is valid!, but not according to the spec which requires minimum one . and two name chunks!! EDIT: A noteable exception are method calls which do not require the interface field of a message to be set http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-types). g_dbus_message_new_method_call (...) allows interface_ to be null. But that still only solves half the problems (sender). The receiver method seems to not exist for interface_s being NULL. Turns out it is a bug, I did a source code investigation and filed a bug (including fix) https://bugzilla.gnome.org/show_bug.cgi?id=706675

Categories : Misc

how can monitor many regions in xcode?
Check the available number of regions by: [CLLocationManager regionMonitoringAvailable] In the Location Awareness Programming Guide, You should always be judicious when specifying the set of regions to monitor. Regions are a shared system resource and the total number of regions available systemwide is limited. For this reason, Core Location limits the number of regions that may be simultaneously monitored by a single application. Therefore, the maximum number of regions are limited & not fixed. It is shared system-wide. Referring to your question, you should re-define your regions. Remember to implement locationManager:monitoringDidFailForRegion:withError: in case of any failure when adding region to be monitored.

Categories : Xcode

How to monitor change in input
You have to add it as an event on your view: var MyView = Backbone.View.extend({ events: { 'keyup input': 'updateParagraph' }, updateParagraph: function(ev) { this.$('p').html(ev.target.value); } }); This assumes that your HTML for the view is just like what you have in your question. If you want to use multiple events, you will need to add each one to the hash. Like: events: { 'keyup input': 'updateParagraph', 'propertychange input': 'updateParagraph', // etc. } And if your view is tied to a model and the input should update the model, I would write it this way instead: var MyView = Backbone.View.extend({ initialize: function() { this.listenTo(this.model, 'change:text', this.updateParagraph); }, events: { 'keyu

Categories : Javascript

BASH better way to monitor files
instead of using multiple tail -n 1 file try the following construct: tail -f file | while read line;do echo "read: $line" done it will be much more reliable...and won't read the same line twice ;) note: by using new processes of grep/awk/etc you are burning away processes...it's not that it is critical, but usually process creation is expensive...but if new lines occur rarely it's perfectly fine where i want'ed to get is: if you are intrested, take a look at bash builting string manipulator function replace $(x/aa} ${x//aa} and friends..or try to use extended regexpes with grep

Categories : Bash

How do I monitor clicks on ads from my site?
To reliably count a click, you would send the user to your own server and then redirect him to the final ad destination. The you can count all the requests on your server. All advertising platforms offer a similar kind of tracking, since they usually charge by click (called CPC).

Categories : Web Services

Monitor changes to a database in Spring
You can use audit tables and enable access only to admin users or implement role based access in your application. Auditing Role-Based Access Control (RBAC)

Categories : Sql Server

Monitor UI latency of web app from javascript
Well in simple terms, you measure the aggregate time of your UI functions, then divide by the number of calls :-) reliable UI timing: But, in all seriousness, this doesn't always work nicely. The reason is that certain operations are synchronous from the POV of JavaScript, but don't in fact update the DOM synchronously in practice. I've found that the best way to measure real-ish UI update time is to start measuring -- (new Date()).getTime() -- at the start of my UI update function, then at the end of it make a call to window.requestAnimationFrame(function(){ /* get elapsed time here! */ }); window.requestAnimationFrame is fairly new, so older browsers don't really support it. There's also some intrinsic time that elapses even if your update code does nothing, but you can measure th

Categories : Javascript

How to monitor just t-sql commands in SQL Profiler?
Pick a trace template (such as Tuning) and use a filter. Either filter by a particular login (such as your own login or a service's login), a particular database. For instance, to filter by database: Under Trace properties -> Events tab -> Select show all columns. Set a Like filter on database name. I find setting a filter on the number of Logical Reads of say > 10 reads, filters out most of the noise. How to: Filter Events in a Trace Using SQL Server Profiler

Categories : Sql Server

Monitor WordPress Downloads?
Google Analytics maybe? You do have to edit your theme files to get this working though. Otherwise the plugins you listed are the best known I guess. At least the ones I've seen in the last years. Also I thought Yoast tracks outbound and downloads as well, might wanna check that.

Categories : Wordpress

How can I monitor another application's database for changes?
You can't access it from Java. One way is poll: to run ls -l /data/data/com.target.app/databases/data.db and get time-stamp periodically. Or perhaps use watch or tail commands. May be a background service can run this and issue a local broadcast. Other way is to ship SQLite3 binary with your app, start process as root, and supply commands to it. I think many apps like titanium etc, do this. Update: Here's an SQLite3 project: http://code.google.com/p/sqlite3-android/

Categories : Java

how to monitor operation on mac platform
Your best bet is going to be the KAuth system. You install your kauth handler (as a kernel extension) and get various callback codes when someone tries to create, open or close a file. This involves getting your callback in the critical path of opening files, so whatever you do has to be quick! To quote: KAUTH_SCOPE_FILEOP defines the following actions. KAUTH_FILEOP_OPEN KAUTH_FILEOP_CLOSE KAUTH_FILEOP_CLOSE_MODIFIED KAUTH_FILEOP_RENAME KAUTH_FILEOP_EXCHANGE KAUTH_FILEOP_LINK KAUTH_FILEOP_EXEC https://developer.apple.com/library/mac/technotes/tn2127/_index.html If you're writing a kext you then have the question of how to get that info back into userland. FWIW I used Kqueue but you may have success with another method (let me know in the comments if you

Categories : Osx

Monitor, lock or volatile?
You don't need any locks for this, you should just reschedule next timer execution from within the timer delegate. That should ensure 100% no overlaps. At the end of timer's event handler call timer.Change(nextRunInMilliseconds, Timeout.Infinite), that way the timer will fire only once, after nextRunInMilliseconds. Example: //Object that holds timer state, and possible additional data private class TimerState { public Timer Timer { get; set; } public bool Stop { get; set; } } public void Run() { var timerState = new TimerState(); //Create the timer but don't start it timerState.Timer = new Timer(OnTimer, timerState, Timeout.Infinite, Timeout.Infinite); //Start the timer timerState.Timer.Change(1000, Timeout.Infinite); } public void OnTimer(object state) {

Categories : C#

Monitor Registry Changes during Installation
regshot is capable of creating a registry snapshot before and after installation and compare them, showing only differences. Of course, identifying the related changes is kind of work... http://sourceforge.net/projects/regshot/

Categories : Windows

How to monitor a function for changes in Angular / breeze?
The Breeze EntityManager has a "hasChangesChanged" event that you can subscribe to. Something like: myEntityManager.hasChangesChanged.subscribe(function(args) { var hasChanges = args.hasChanges; var entityManager = args.entityManager; ... do something interesting... }); The EntityManager also has an EntityChanged event that might be useful. Also see: EntityManager api docs

Categories : Angularjs

Event for exiting the screen monitor (with WPF)
You could handle the Window's MouseMove event and check the mouse's position. private void Window_MouseMove(object sender, MouseEventArgs e) { //PrimaryScreenWidth - 1 to account for the cursor itself if (e.GetPosition(this).X >= SystemParameters.PrimaryScreenWidth - 1 || e.GetPosition(this).X <= 1) MessageBox.Show("Edge hit"); } If you're running multiple monitors, you could also handle the MouseLeave event to handle the case where the mouse has moved to the second monitor. private void Window_MouseLeave(object sender, MouseEventArgs e) { MessageBox.Show("Edge hit"); }

Categories : C#

How to configure FunkLoad monitor in two servers?
The Nuxeo responded to me: You need : a monitor.conf file for each server that you want to monitor, to bind host and port to something that is reachable from the bencher to run the fl-monitor-ctl command on each hosts to setup the bencher configuration to point to a list of monitored hosts: [monitor] hosts=178.216.200.48 178 178.216.200.170 [178.216.200.48] port=8008 description=My first server [178.216.200.170] port=8008 description=My second server Then run the bench

Categories : Python

QT getting the screen resolution without the extended monitor
You pretty much had it, just give the screen ID of your main monitor to the geometry() call. QDesktopWidget widget; QRect mainScreenSize = widget.availableGeometry(widget.primaryScreen()); // or screenGeometry(), depending on your needs

Categories : Qt

Monitor Java application with VisualVM
You normally attach VisualVM to the PID of the process you want to profile. If that's Jetty or Tomcat or some other Java EE app server, that means the PID of the app server. If not, it's the PID of the JVM that's running your app. If you've already got a JVM installed on your EC2 instance, I'd recommend looking in the JVM /bin folder to see if jvisualvm.exe is already there. If it is, fire it up in a separate command shell and attach it the PID of your application.

Categories : Java

how to monitor the close event of a JDialog?
Change setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); to setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING); This will require you to manually dispose of the dialog. Depending on your needs, you would simply need to change System.exit(0); to dispose(); I would, personally, advise against extending directly from a top level container like JDialog, but that's just me. I prefer to use, something like, a JPanel that has a helper method that can display an dialog. This method would create the dialog and add the panel to it, for example

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.