Search Results

Search found 12222 results on 489 pages for 'initial context'.

Page 19/489 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • How to estimate the thread context switching overhead?

    - by Ignas Limanauskas
    I am trying to improve the performance of the threaded application with real-time deadlines. It is running on Windows Mobile and written in C / C++. I have a suspicion that high frequency of thread switching might be causing tangible overhead, but can neither prove it or disprove it. As everybody knows, lack of proof is not a proof of opposite :). Thus my question is twofold: If exists at all, where can I find any actual measurements of the cost of switching thread context? Without spending time writing a test application, what are the ways to estimate the thread switching overhead in the existing application? Does anyone know a way to find out the number of context switches (on / off) for a given thread?

    Read the article

  • Multiple Context menus in PyQt based on mouse location

    - by Nader
    I have a window with multiple tables using QTableWidget (PyQt). I created a popup menu using the right click mouse and it works fine. However, I need to create different popup menu based on which table the mouse is hovering over at the time the right mouse is clicked. How can I get the mouse to tell me which table it is hovering over? or, put in another way, how to implement a method so as to have a specific context menu based on mouse location? I am using Python and PyQt. My popup menu is developed similar to this code (PedroMorgan answer from Qt and context menu): class Foo( QtGui.QWidget ): def __init__(self): QtGui.QWidget.__init__(self, None) # Toolbar toolbar = QtGui.QToolBar() # Actions self.actionAdd = toolbar.addAction("New", self.on_action_add) self.actionEdit = toolbar.addAction("Edit", self.on_action_edit) self.actionDelete = toolbar.addAction("Delete", self.on_action_delete) # Tree self.tree = QtGui.QTreeView() self.tree.setContextMenuPolicy( Qt.CustomContextMenu ) self.connect(self.tree, QtCore.SIGNAL('customContextMenuRequested(const QPoint&)'), self.on_context_menu) # Popup Menu self.popMenu = QtGui.QMenu( self ) self.popMenu.addAction( self.actionEdit ) self.popMenu.addAction( self.actionDelete ) self.popMenu.addSeparator() self.popMenu.addAction( self.actionAdd ) def on_context_menu(self, point): self.popMenu.exec_( self.tree.mapToGlobal(point) )

    Read the article

  • Eclipse 3.5: Implementing my own context menu for a MultipageEditorPart --> no viewer involved

    - by Patrick
    Hello! :-) In my current RCP-project i use a MultipageEditorPart. It has various pages, with simple SWT composites on it. The composites contain some Text and Combo elements. When the user right clicks onto the editor page, I want a context menu to open. This menu holds a command for creating a new editor page, with a composite on it. The command is already working, but I'm quite clueless about how to implement the context menu for the editor. Can someone help with this?

    Read the article

  • Making sure unsigned int/long always execute in checked context in C#

    - by theburningmonk
    Has anyone found it strange that the default context for uint and ulong is unchecked rather than checked considering that they are meant to represent values that can never be negative? So if some code is trying to violate that constraint it seems to me the natural and preferred behaviour would be to throw an exception rather than returning the max value instead (which can easily leave important pieces of data in an invalid state and impossible to revert..). Is there an existing attribute which can be applied to either class/assembly so that it always performs arithmetic operations in a checked context? I was thinking of writing one myself (as an aspect using PostSharp) but would be great if there's one already. Many thanks,

    Read the article

  • System context menu Icon not transparent like WinRAR

    - by Samir
    I added a icon at the system context menu(the popped up menu when we right mouse click on any file/foler). But the icon is not transparent(in xp its not notice able, but in vista/win7 it is clearly visible) there is a white background beneath the icon. But WinRAR or TortoiseSVN icons don't have any white background, they are transparent. I tried the following C++ code: #define BITMAP_MAIN 201 //in resource.h BITMAP_MAIN BITMAP "main.bmp" // in .rc file // showing icon in menu... HBITMAP imgMain = LoadBitmap( aHinstance, MAKEINTRESOURCE(BITMAP_MAIN) ); SetMenuItemBitmaps ( hSubmenu, uMenuIndex, MF_BYPOSITION, imgMain, imgMain); [main.bmp is 16X16] Also the icon(.bmp) is not shown fully in non-english OS. So is there be any special technique to make the icon in the system context menu transparent like WinRAR?

    Read the article

  • When a template is rendered in template tag code, MEDIA_URL is not in context

    - by culebrón
    I want to use a template for 2 template tags. In the template, I used {{ MEDIA_URL }} and discovered that MEDIA_URL is not in context as expected. Had to use get_config and pass it manually. Why is the setting not in context, how else can I put it there, or maybe there's a better way that a template tag? (include, etc?) from django.template import Library from apps.annoying.functions import get_config from django.template.loader import render_to_string register = Library() @register.simple_tag def next_in_gallery(photo, gallery): next = photo.get_next_in_gallery(gallery) return make_arrow('right', next) @register.simple_tag def previous_in_gallery(photo, gallery): prev = photo.get_previous_in_gallery(gallery) return make_arrow('left', prev) def make_arrow(direction, object): return render_to_string('myapp/arrow.html', {'direction': direction, 'object': object, 'MEDIA_URL': get_config('MEDIA_URL', '')})

    Read the article

  • i can't see a context menu of WPF windows app through VNC

    - by tk
    I can open a context menu but cannot see the opened menu list through VNC. (I know that i can open the context menu by checking the vnc server machine directly) I tested on different vnc servers / clients machines (although all of them are windows Vista), and different wpf app, but still I cant see any menu list. Is this a reported problem? I found some information about wpf problem relating to windows desktop, but i dont know about vnc. ADDED : I dont have this problem on windows native apps or windows forms apps under my vnc environment.

    Read the article

  • How to determine the inner context node within an XSLT select

    - by Marcus Rickert
    Hi there! I'm trying to determine a subset of nodes stored in the variable objs by using a user defined function cube:is_active: <xsl:variable name="active_cubes" select="$objs[cube:is_active(XXX) = 'TRUE']"/ Since the function does not allow a local context I'm required to pass it as a parameter (denoted by XXX). However, the usual suspects "." or "current()" do not work since they refer to context node of the surrounding block and NOT to the current element of objs which is evaluated. The only solution so far which DOES work is: XXX=SOME_CHILD_TAG/.. But this is really ugly since it depends on the existence of the child tag for the parent node to work correctly. Is there any other way? Thanks!

    Read the article

  • How can I pass a Context object to a thread on call

    - by Pentium10
    I have this code fragment: public static class ExportDatabaseFileTask extends AsyncTask<String, Void, Boolean> { private final ProgressDialog dialog = new ProgressDialog(ctx); protected void onPreExecute(); protected Boolean doInBackground(final String... args); protected void onPostExecute(final Boolean success); } I execute this thread as new ExportDatabaseFileTask().execute(); As you see I use a ctx as Context variable in the new ProgressDialog call, how do I pass a context to the call method? to this one: new ExportDatabaseFileTask().execute();*

    Read the article

  • Specifying Locations relative to the context XML in Spring

    - by Daisuke Shimamoto
    Is there a way to reference a properties file relative to the Spring's context file itself? What I want to do is the below: <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <!-- I want the below to be relative to this context XML file. --> <value>app.properties</value> </list> </property> </bean> I was imagining something like ${contextpath} that I could prepend to the above "app.properties" but couldn't find anything helpful. Thanks.

    Read the article

  • Synchronization between user space process and interupt context code

    - by user1748950
    Recently I attended couple of interviews. Out of all kernel questions which were asked, thr is one specific question which I couldnt find convincing answer of. How will you use different synchronization techniques while sharing data between user space process and interrupt context function? My convincing answer was: In interrupt context code: 1. do *spin_lock_irqsave* 2. access data buffer which is shared between user space app and kernel 3. do *spin_lock_irqrestore* Then this was not convincing answer. Do I have to do irqsave and irqrestore in all the instances of data access? Regards, Yogi

    Read the article

  • Changing the context of a self-executing function

    - by TaylorMac
    This code is copied directly from: http://www.bennadel.com/blog/2264-Changing-The-Execution-Context-Of-Your-Self-Executing-Function-Blocks-In-JavaScript.htm // Set the singleton value to the return value of the self- // executing function block. var singleton = (function(){ // Declare a private variable. var message = "Stop playing with your context!"; this.getMessage = function(){ return( message ); }; // Return this object reference. return( this ); }).call( {} ); // alert the singleton message. alert( "Message:", singleton.getMessage()); ?My thought is that I can use this to better contain the variables and functions in my programs. However, when I try to run the code in a JSfiddle: http://jsfiddle.net/xSKHh/ It does not return the message. What am I missing?

    Read the article

  • Sysprep and Capture task sequence failing using MDT 2010

    - by Nic Young
    I have created a Windows Deployment Services server in Windows 2008 R2. When I originally set it up I was able to successfully use MDT 2010 to create my boot images as well as creating task sequences that would sysprep and capture, and deploy my custom .wim files. Everything was working perfectly. About a month later I boot up my Windows 7 x86 image and run Windows updates to keep my image up to date. I then go and run my sysprep and capture task sequence and I get the following errors: I searched online for the cause of this error message and it just seems to be a generic permission denied type of error message. I then decided to completely rebuild my VM image from scratch and try again. I am still getting the same error messages as before. The following is what I have tried troubleshooting this issue: Troubleshooting: I have ensured that that UAC and the firewall is turned completely off when trying to capture the image. I have tried recreating the task sequence and making sure that the deployment share is updated. I have ensured that the local Administrator account is enabled and has the same password as specified in the task sequence. I have tried joining the computer to the domain and running the task sequence and I get a different error: I have attempted to run the script from the command prompt with "Run as Administrator" and I still receive the same errors above. For testing purposes I have ensured that Everyone has read/write access to my deployment share. I have spent days on trying to resolve this to no avail. Any ideas? EDIT: Below is the log info from C:\Windows\Deploymentlogs\BDD.log as requested. <![LOG[LTI Windows PE applied successfully]LOG]!><time="11:48:34.000+000" date="07-25-2012" component="LTIApply" context="" type="1" thread="" file="LTIApply"> <![LOG[LTIApply processing completed successfully.]LOG]!><time="11:48:34.000+000" date="07-25-2012" component="LTIApply" context="" type="1" thread="" file="LTIApply"> <![LOG[Microsoft Deployment Toolkit version: 6.0.2223.0]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="ZTIDrivers" context="" type="1" thread="" file="ZTIDrivers"> <![LOG[The task sequencer log is located at C:\Users\nicy\AppData\Local\Temp\SMSTSLog\SMSTS.LOG. For task sequence failures, please consult this log.]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="ZTIDrivers" context="" type="1" thread="" file="ZTIDrivers"> <![LOG[Processing drivers for an X86 operating system.]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="ZTIDrivers" context="" type="1" thread="" file="ZTIDrivers"> <![LOG[TargetOS is the current SystemDrive]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="ZTIDrivers" context="" type="1" thread="" file="ZTIDrivers"> <![LOG[Property DriverCleanup is now = DONE]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="ZTIDrivers" context="" type="1" thread="" file="ZTIDrivers"> <![LOG[Compare Image processor Type with Original [X86] = [X86].]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="ZTIDrivers" context="" type="1" thread="" file="ZTIDrivers"> <![LOG[Prepare machine for Sysprep.]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="ZTIDrivers" context="" type="1" thread="" file="ZTIDrivers"> <![LOG[No driver actions can be taken for OS Images installed from *.wim files.]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="ZTIDrivers" context="" type="1" thread="" file="ZTIDrivers"> <![LOG[ZTIDrivers processing completed successfully.]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="ZTIDrivers" context="" type="1" thread="" file="ZTIDrivers"> <![LOG[Command completed, return code = -2147467259]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="LiteTouch" context="" type="1" thread="" file="LiteTouch"> <![LOG[Litetouch deployment failed, Return Code = -2147467259 0x80004005]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="LiteTouch" context="" type="3" thread="" file="LiteTouch"> <![LOG[For more information, consult the task sequencer log ...\SMSTS.LOG.]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="LiteTouch" context="" type="1" thread="" file="LiteTouch"> <![LOG[Property RetVal is now = -2147467259]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="LiteTouch" context="" type="1" thread="" file="LiteTouch"> <![LOG[Unable to copy log to the network as no SLShare value was specified.]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="LiteTouch" context="" type="1" thread="" file="LiteTouch"> <![LOG[CleanStartItems Complete]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="LiteTouch" context="" type="1" thread="" file="LiteTouch"> <![LOG[Unregistering TSCore.dll.]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="LiteTouch" context="" type="1" thread="" file="LiteTouch"> <![LOG[About to run command: wscript.exe "\\server\deploymentshare$\Scripts\LTICleanup.wsf"]LOG]!><time="11:48:35.000+000" date="07-25-2012" component="LiteTouch" context="" type="1" thread="" file="LiteTouch"> <![LOG[Microsoft Deployment Toolkit version: 6.0.2223.0]LOG]!><time="11:48:36.000+000" date="07-25-2012" component="LTICleanup" context="" type="1" thread="" file="LTICleanup"> <![LOG[Removing AutoAdminLogon registry entries]LOG]!><time="11:48:36.000+000" date="07-25-2012" component="LTICleanup" context="" type="1" thread="" file="LTICleanup"> <![LOG[VSSMaxSize not specified using 5% of volume.]LOG]!><time="11:48:36.000+000" date="07-25-2012" component="LTICleanup" context="" type="1" thread="" file="LTICleanup"> <![LOG[Logs contained 7 errors and 0 warnings.]LOG]!><time="11:48:36.000+000" date="07-25-2012" component="LTICleanup" context="" type="1" thread="" file="LTICleanup"> <![LOG[Stripping BDD commands from unattend.xml template.]LOG]!><time="11:48:36.000+000" date="07-25-2012" component="LTICleanup" context="" type="1" thread="" file="LTICleanup"> <![LOG[Modified unattend.xml saved to C:\windows\panther\unattend.xml]LOG]!><time="11:48:36.000+000" date="07-25-2012" component="LTICleanup" context="" type="1" thread="" file="LTICleanup"> <![LOG[Checking mapped network drive.]LOG]!><time="11:48:36.000+000" date="07-25-2012" component="LTICleanup" context="" type="1" thread="" file="LTICleanup"> <![LOG[testing drive Z: mapped to \\server\deploymentshare$]LOG]!><time="11:48:36.000+000" date="07-25-2012" component="LTICleanup" context="" type="1" thread="" file="LTICleanup"> <![LOG[Disconnecting drive Z: mapped to \\server\deploymentshare$]LOG]!><time="11:48:36.000+000" date="07-25-2012" component="LTICleanup" context="" type="1" thread="" file="LTICleanup"> <![LOG[Cleaning up C:\MININT directory.]LOG]!><time="11:48:36.000+000" date="07-25-2012" component="LTICleanup" context="" type="1" thread="" file="LTICleanup"> <![LOG[Cleaning up TOOLS, SCRIPTS, and PACKAGES directories.]LOG]!><time="11:48:36.000+000" date="07-25-2012" component="LTICleanup" context="" type="1" thread="" file="LTICleanup">

    Read the article

  • Implication of variable context switching time

    - by Rob
    Hi, I know that constant switching time of the Linux scheduler was a big achievement. I was just asking myself the question what would be the implication of a non-constant switching time. The only obvious reason I can think of is real-time systems where we have to meet deadlines. There it is obviously no ideal if the switching time is "random". Are there any other good reasons that favour constant switching times? Many thanks, Rob

    Read the article

  • How to resolve SSPI context error without changing Service Account from MSSQL

    - by kockiren
    There is a issue while connecting from new Windows 8.1 Clients to SQL Server 2008 running on Windows Server 2008 R2. The SQL Service running under account Domain\mssqlservice on a machine thats works fine I get this output from setspn -l domain\mssqlservice C:\>setspn -l domain\mssqlservice Registrierte Dienstprinzipalnamen (SPN) für CN=MSSQLService,CN=Users,DC=domain, DC=local,DC=tld: MSSQLSvc/mssql.domain.local.tld:1433 MSSQLSvc/mssql.domain.local.tld MSSQLSERVER/mssql.domain.local.tld:1433 On a windows 8.1 machine that don't work I get this output: C:\>setspn -l domain\msssqlservice FindDomainForAccount: Fehler beim Aufrufen von DsGetDcNameWithAccountW mit dem R ückgabewert 0x0000054B. Konto kockiren wurde nicht gefunden. On this Post I found a solution but, I can't change the Service Account who runs the SQL Service. Some application need this service delegation. But how I can realize that it works on my Windows 8.1 Clients?

    Read the article

  • Asterisk dialplan context and label clarifications

    - by liv2hak
    I have been learning Asterisk dial plan for the past week.I have written down a simple IVR system with two levels of menu and an exit option.I have used concepts from different tutorials on the web.Can someone confirm if the IVR below is correct? Correct in the sense that if the below is used will it work.I know the IVR does not do much yet.But I am just trying to clarify my understanding. [incoming] exten => 123,1,Answer() same => n(menuprompt),Background(main-menu) exten => 1,1,Playback(digits/1) same => n,Goto(incoming,menuprompt,123) exten => 2,1,Playback(digits/2) same => n,Goto(incoming,menuprompt,123) exten => 9,1,Hangup() [main-menu] exten => n(menuprompt),Background(main-menu) exten => 3,1,Playback(digits/3) same => n,Goto(main-menu,menuprompt,n) exten => 4,1,Playback(digits/4) same => n,Goto(main-menu,menuprompt,n) exten => 9,1,Hangup()

    Read the article

  • "Send to: Mail recipient" context menu not working

    - by Louis
    I have set the Mail app from Microsoft (WinRT) as the default application for mail in Default Programs. However, when I right-click on a file, and select Send to Mail recipient I get a message box saying:There is no email program associated to perform the requested action. Please install an email program or, if one is already installed, create an association in the Default Programs control panel. Is there a way to get this action working with Mail?

    Read the article

  • Context-specific remap

    - by dotancohen
    I have the following handy VIM map: inoremap ( ()<Left> However, sometimes I will enter Insert mode to add a function call around a variable, like so: Was: $sql = "SELECT * FROM " . $someTable; To: $sql = "SELECT * FROM " . mysql_real_escape_string($someTable); The mapping makes a redundant ) after mysql_real_escape_string(. Is there any way to refactor the mapping so that if there exists a character after the cursor, and the character after the cursor is not whitespace, then )<left> is not appended to (? Thanks.

    Read the article

  • How to add an item to my "Send To" context menu

    - by Binary Worrier
    On my old XP machine I would simply copy short-cuts into the %userprofile%\SendTo folder. On Windows-7 this folder is hidden, and I don't have access to it (which surprised me, it is MY SendTo folder after all). Is there an "approved" way of adding to my Send To menu that I'm unaware of? Or do I need extra permissions from our Sys Admin? Thanks BW

    Read the article

  • What is the reason of "Transaction context in use by another session"

    - by Shrike
    Hi, I'm looking for a description of the root of this error: "Transaction context in use by another session". I get it sometimes in one of my unittests so I can't provider repro code. But I wonder what is "by design" reason for the error. I've found this post: http://blogs.msdn.com/asiatech/archive/2009/08/10/system-transaction-may-fail-in-multiple-thread-environment.aspx and also that: http://msdn.microsoft.com/en-us/library/ff649002.aspx But I can't understand what "Multiple threads sharing the same transaction in a transaction scope will cause the following exception: 'Transaction context in use by another session.' " means. All words are understandable but not the point. I actually can share a system transaction between threads. And there is even special mechanism for this - DependentTransaction class and Transaction.DependentClone method. I'm trying to reproduce a usecase from the first post: 1. Main thread creates DTC transaction, receives DependentTransaction (created using Transaction.Current.DependentClone on the main thread 2. Child thread 1 enlists in this DTC transaction by creating a transaction scope based on the dependent transaction (passed via constructor) 3. Child thread 1 opens a connection 4. Child thread 2 enlists in DTC transaction by creating a transaction scope based on the dependent transaction (passed via constructor) 5. Child thread 2 opens a connection with such code: using System; using System.Threading; using System.Transactions; using System.Data; using System.Data.SqlClient; public class Program { private static string ConnectionString = "Initial Catalog=DB;Data Source=.;User ID=user;PWD=pwd;"; public static void Main() { int MAX = 100; for(int i =0; i< MAX;i++) { using(var ctx = new TransactionScope()) { var tx = Transaction.Current; // make the transaction distributed using (SqlConnection con1 = new SqlConnection(ConnectionString)) using (SqlConnection con2 = new SqlConnection(ConnectionString)) { con1.Open(); con2.Open(); } showSysTranStatus(); DependentTransaction dtx = Transaction.Current.DependentClone(DependentCloneOption.BlockCommitUntilComplete); Thread t1 = new Thread(o => workCallback(dtx)); Thread t2 = new Thread(o => workCallback(dtx)); t1.Start(); t2.Start(); t1.Join(); t2.Join(); ctx.Complete(); } trace("root transaction completes"); } } private static void workCallback(DependentTransaction dtx) { using(var txScope1 = new TransactionScope(dtx)) { using (SqlConnection con2 = new SqlConnection(ConnectionString)) { con2.Open(); trace("connection opened"); showDbTranStatus(con2); } txScope1.Complete(); } trace("dependant tran completes"); } private static void trace(string msg) { Console.WriteLine(Thread.CurrentThread.ManagedThreadId + " : " + msg); } private static void showSysTranStatus() { string msg; if (Transaction.Current != null) msg = Transaction.Current.TransactionInformation.DistributedIdentifier.ToString(); else msg = "no sys tran"; trace( msg ); } private static void showDbTranStatus(SqlConnection con) { var cmd = con.CreateCommand(); cmd.CommandText = "SELECT 1"; var c = cmd.ExecuteScalar(); trace("@@TRANCOUNT = " + c); } } It fails on Complete's call of root TransactionScope. But error is different: Unhandled Exception: System.Transactions.TransactionInDoubtException: The transaction is in doubt. --- pired. The timeout period elapsed prior to completion of the operation or the server is not responding. To sum up: I want to understand what "Transaction context in use by another session" means and how to reproduce it.

    Read the article

  • AsyncTask and Contexts

    - by Michael
    So I'm working out my first multi-threaded application using Android with the AsyncTask class. I'm trying to use it to fire off a Geocoder in a second thread, then update the UI with onPostExecute, but I keep running into an issue with the proper Context. I kind of hobbled my way through using Contexts on the main thread, but I'm not exactly sure what the Context is or how to use it on background threads, and I haven't found any good examples on it. Any help? Here is an excerpt of what I'm trying to do: public class GeoCode extends AsyncTask<GeoThread, Void, GeoThread> { @Override protected GeoThread doInBackground(GeoThread... i) { List<Address> addresses = null; Geocoder geoCode = null; geoCode = new Geocoder(null); //Expects at minimum Geocoder(Context context); addresses = geoCode.getFromLocation(GoldenHour.lat, GoldenHour.lng, 1); } } It keeps failing at the sixth line there, because of the improper Context.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >