handler

JavaScript onclick() text size increase with EventListener

﹥>﹥吖頭↗ 提交于 2019-12-11 09:49:36
问题 I am trying to implement the following to increase text size based on button click. I am trying to use one handler for this. The idea is to increase/decrease the fontsize for the text in "demo" area by +/-5 px. But I am not getting the desired result. <html> <body> <p>Change font size</p> <div id="main_area1"> <button id="button1" value="larger" type="button" onclick="changeFontSize(this)">Larger</button> </div> <div id="main_area2"> <button id="button2" vale="smaller" type="button" onclick=

Android getting Activity instance in Application from Handler

偶尔善良 提交于 2019-12-11 08:06:53
问题 I am using Handler for communicating between Current Activity and a subclass of Application. Subclass is having a thread which processes web service calls. Subclass may also have a ProgressDialog instance. I want to show ProgressDialog when http call is starting and dismiss dialog when call is finished. For this to happen, I need to access Activity from Handler. And then assign activity to Dialog using setOwnerActivity. Is this possible? I tried and cant not get activity from Handler. The max

AsyncTask refreshing google map api v2

隐身守侯 提交于 2019-12-11 07:12:34
问题 My android application retrieves some json data from remote API for each Marker (a Marker shows the position of a real device, there are less than 10 devices to watch) present on the map, and sets status of a device by changing a color of the marker according to some rule working on a given json data. I use AsyncTask to fetch json data and change a status of a device. I keep fetched data in ConcurrentHashMap<Device, Data> . So, I run a number of asynctasks, one for each device. I also use a

Handler post execute queue not in correct order

China☆狼群 提交于 2019-12-11 05:37:36
问题 i'm working on android application which have communication with Bluetooth BLE device (with custom protocol which was developed specific for our product). after i connect to the device i have callback public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) which get triggered each time the device want to send me data. In app architecture we have actions (for example getDeviceStatus() ), the protocol working in following way: phone connect to device

Reference handler object from main activity

谁说我不能喝 提交于 2019-12-11 04:35:48
问题 I have main an Activity class, a broadcast class ( subclass of broadcast receiver ) and few other classes. I use a Handler created in the broadcast class, for some things to do in future. But if some circumstances come ( user wants to exit app ), i want that Handler to cancel (prevent from being executed ). I read a lot of threads in SO on how to cancel Handlers and I know how to from same class ( Handler.removeCallback (Runnable ) , Handler.removeMessages(0) etc ). But I don't know how to

How to use boost::asio::io_service::run_one()

一世执手 提交于 2019-12-11 04:32:02
问题 I was reading up on boost::asio::io_service::run_one() and am confused by what it means by the function block. What has been blocked and where is the handler defined? 回答1: I was reading up on boost::asio::io_service::run_one() and am confused by what it means by the function block. What has been blocked Blocked means run_one() blocks until it completes one handler. and where is the handler defined? It isn't. Logically it's described in the documentation. A handler is whatever action is

Using a c# handler to serve up wav files cuts audio short (only a couple of seconds)

假如想象 提交于 2019-12-11 04:28:47
问题 I've got a c# handler that serves up audio files I've generated using text-to-speech. When the files are written to disk they sound fine, but when I try and play them in a browser (via the handler) using a quicktime plugin it cuts them short at about 2 seconds. Inside the handler I'm using the following code... context.Response.ClearContent(); context.Response.ClearHeaders(); context.Response.ContentType = "audio/x-wav"; context.Response.WriteFile(fileName); context.Response.Flush(); Anyone

Calling a Stored Procedure Within a Cursor Loop, Without Tripping the Continue Handler

人走茶凉 提交于 2019-12-11 04:04:22
问题 I am trying to call a Stored Procedure in MySQL within the loop of a Cursor. The cursor behaves properly when doing an INSERT in the loop; but if I try to call a Stored Procedure, the continue Handler 'sets done = 1' and will exit the loop prematurely, after the first record is processed. Any thoughts on how to work around this? Thanks. declare test_cursor cursor for select projectid, projectdesc from tblProjects order by projectdesc; DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1

How to apply a custom handlers to only specific folder

谁说胖子不能爱 提交于 2019-12-11 03:15:25
问题 I use Asp.Net 4 C# and IIS 7.5. In web.config I was able to apply my handler with success (code below) as you can see path="*.jpg" let the handler operate in any folder of my website. I need instead apply this handler to all .jpg request but ONLY in a specific folder , in my case /Cdn/Cms/Images/ So I update to path="/Cdn/Cms/Images/*.jpg" but the handler does not apply. I tried many times with different paths but now way. How can I apply a handler to only a specific folder? Thanks for your

I'm getting: exception has been thrown by the target of an invocation

﹥>﹥吖頭↗ 提交于 2019-12-11 03:15:03
问题 I´m getting the exception when I try to open my page: An unhandled exception occurred and the process was terminated. Application ID: /LM/W3SVC/6/ROOT/ROXY/es Process ID: 2972 Exception: System.InvalidOperationException Message: Handle is not initialized. StackTrace: at System.WeakReference.set_Target(Object value) at System.Data.ProviderBase.DbConnectionInternal.CloseConnection(DbConnection owningObject, DbConnectionFactory connectionFactory) at System.Data.Odbc.OdbcConnection.Close() at