Search Results

Search found 11331 results on 454 pages for 'resource monitor'.

Page 14/454 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • debugging a resource leak in a printer driver

    - by MK
    I'm trying to debug a memory leak in a printer driver. I'm pretty sure it's a resource leak, not just a plain memory leak because analyzing heap with !heap -s in windbg doesn't show any increase. How do I monitor other kinds of objects with windbg? Number of GDI objects and open handles is not growing either, so what could it be?

    Read the article

  • Embed resource in .NET Assembly without assembly prefix?

    - by Robert Fraser
    Hi all, When you embed a reosurce into a .NET assembly using Visual Studio, it is prefixed with the assembly name. However, assemblies can have embedded resources that are not assembly-name-prefixed. The only way I can see to do this is to disassemble the assembly using ildasm, then re-assemble it, adding the new resource -- which works, but... do I really need to finish that sentence? (Desktop .NET Framework 3.5, VS 2008 SP1, C#, Win7 Enterprise x64) Thanks, All the best, Robert

    Read the article

  • Do Resource Adapters make RPC calls

    - by Subramanian
    The J2EE Conn Architecture deals with resource adapters to communicate with data stores - databases or EIS. From the adapter/driver perspective would it be right to say that they make a RPC call to the datastore? Or does RPC necessarily have to be a "discover and invoke" (lookup and call) type of call?

    Read the article

  • Add newlines to a text resource in Android?

    - by shmuelp
    I have a custom Dialog that contains only a TextView to display some text in my application. The documentation lists that only the b, i, u, tt, big, small, sup, sub, and strike tags are supported. I really need to add some newlines for readability. Do I need to change to a more complicated layout, or is there some way to encode newlines in the resource? I tried adding br tags, but that did not help.

    Read the article

  • @Resource annotation is null at run-time.

    - by Andrew
    I'm using GlassFish v3. The following field is declared in a class: @Resource private javax.sql.DataSource _data_source; The following is declare in web.xml: <data-source <namejava:app/env/data</name <class-namecom.mysql.jdbc.Driver</class-name <server-namelocalhost</server-name <port-number3306</port-number <usermyUser</user <passwordmyPass</password </data-source At run-time _data_source is empty. What am I doing wrong?

    Read the article

  • J2EE Applications, SPARC T4, Solaris Containers, and Resource Pools

    - by user12620111
    I've obtained a substantial performance improvement on a SPARC T4-2 Server running a J2EE Application Server Cluster by deploying the cluster members into Oracle Solaris Containers and binding those containers to cores of the SPARC T4 Processor. This is not a surprising result, in fact, it is consistent with other results that are available on the Internet. See the "references", below, for some examples. Nonetheless, here is a summary of my configuration and results. (1.0) Before deploying a J2EE Application Server Cluster into a virtualized environment, many decisions need to be made. I'm not claiming that all of the decisions that I have a made will work well for every environment. In fact, I'm not even claiming that all of the decisions are the best possible for my environment. I'm only claiming that of the small sample of configurations that I've tested, this is the one that is working best for me. Here are some of the decisions that needed to be made: (1.1) Which virtualization option? There are several virtualization options and isolation levels that are available. Options include: Hard partitions:  Dynamic Domains on Sun SPARC Enterprise M-Series Servers Hypervisor based virtualization such as Oracle VM Server for SPARC (LDOMs) on SPARC T-Series Servers OS Virtualization using Oracle Solaris Containers Resource management tools in the Oracle Solaris OS to control the amount of resources an application receives, such as CPU cycles, physical memory, and network bandwidth. Oracle Solaris Containers provide the right level of isolation and flexibility for my environment. To borrow some words from my friends in marketing, "The SPARC T4 processor leverages the unique, no-cost virtualization capabilities of Oracle Solaris Zones"  (1.2) How to associate Oracle Solaris Containers with resources? There are several options available to associate containers with resources, including (a) resource pool association (b) dedicated-cpu resources and (c) capped-cpu resources. I chose to create resource pools and associate them with the containers because I wanted explicit control over the cores and virtual processors.  (1.3) Cluster Topology? Is it best to deploy (a) multiple application servers on one node, (b) one application server on multiple nodes, or (c) multiple application servers on multiple nodes? After a few quick tests, it appears that one application server per Oracle Solaris Container is a good solution. (1.4) Number of cluster members to deploy? I chose to deploy four big 64-bit application servers. I would like go back a test many 32-bit application servers, but that is left for another day. (2.0) Configuration tested. (2.1) I was using a SPARC T4-2 Server which has 2 CPU and 128 virtual processors. To understand the physical layout of the hardware on Solaris 10, I used the OpenSolaris psrinfo perl script available at http://hub.opensolaris.org/bin/download/Community+Group+performance/files/psrinfo.pl: test# ./psrinfo.pl -pv The physical processor has 8 cores and 64 virtual processors (0-63) The core has 8 virtual processors (0-7)   The core has 8 virtual processors (8-15)   The core has 8 virtual processors (16-23)   The core has 8 virtual processors (24-31)   The core has 8 virtual processors (32-39)   The core has 8 virtual processors (40-47)   The core has 8 virtual processors (48-55)   The core has 8 virtual processors (56-63)     SPARC-T4 (chipid 0, clock 2848 MHz) The physical processor has 8 cores and 64 virtual processors (64-127)   The core has 8 virtual processors (64-71)   The core has 8 virtual processors (72-79)   The core has 8 virtual processors (80-87)   The core has 8 virtual processors (88-95)   The core has 8 virtual processors (96-103)   The core has 8 virtual processors (104-111)   The core has 8 virtual processors (112-119)   The core has 8 virtual processors (120-127)     SPARC-T4 (chipid 1, clock 2848 MHz) (2.2) The "before" test: without processor binding. I started with a 4-member cluster deployed into 4 Oracle Solaris Containers. Each container used a unique gigabit Ethernet port for HTTP traffic. The containers shared a 10 gigabit Ethernet port for JDBC traffic. (2.3) The "after" test: with processor binding. I ran one application server in the Global Zone and another application server in each of the three non-global zones (NGZ):  (3.0) Configuration steps. The following steps need to be repeated for all three Oracle Solaris Containers. (3.1) Stop AppServers from the BUI. (3.2) Stop the NGZ. test# ssh test-z2 init 5 (3.3) Enable resource pools: test# svcadm enable pools (3.4) Create the resource pool: test# poolcfg -dc 'create pool pool-test-z2' (3.5) Create the processor set: test# poolcfg -dc 'create pset pset-test-z2' (3.6) Specify the maximum number of CPU's that may be addd to the processor set: test# poolcfg -dc 'modify pset pset-test-z2 (uint pset.max=32)' (3.7) bash syntax to add Virtual CPUs to the processor set: test# (( i = 64 )); while (( i < 96 )); do poolcfg -dc "transfer to pset pset-test-z2 (cpu $i)"; (( i = i + 1 )) ; done (3.8) Associate the resource pool with the processor set: test# poolcfg -dc 'associate pool pool-test-z2 (pset pset-test-z2)' (3.9) Tell the zone to use the resource pool that has been created: test# zonecfg -z test-z1 set pool=pool-test-z2 (3.10) Boot the Oracle Solaris Container test# zoneadm -z test-z2 boot (3.11) Save the configuration to /etc/pooladm.conf test# pooladm -s (4.0) Results. Using the resource pools improves both throughput and response time: (5.0) References: System Administration Guide: Oracle Solaris Containers-Resource Management and Oracle Solaris Zones Capitalizing on large numbers of processors with WebSphere Portal on Solaris WebSphere Application Server and T5440 (Dileep Kumar's Weblog)  http://www.brendangregg.com/zones.html Reuters Market Data System, RMDS 6 Multiple Instances (Consolidated), Performance Test Results in Solaris, Containers/Zones Environment on Sun Blade X6270 by Amjad Khan, 2009.

    Read the article

  • how do I get dual monitors to work properly in Ubuntu 11.10 on a Dell Latitude D630?

    - by wes cook
    I have spent a lot of time trying to get dual monitors to work on Ubuntu 11.10 on my Dell Latitude D630 (nVidia NVS 135m video card). - For starters, the System Displays settings app always only showed one unknown monitor, even though I had the external Acer monitor connected. - So I downloaded and installed the nVidia drivers. According to what I read I would need to only use the nVidia driver app (nVidia X Server Settings), so that's what I've done. (System Displays settings continued to only show a single monitor anyway). - nVidia settings app only showed on monitor until I changed the BIOS setting to use the onboard video for external monitor (not the dock video, which it was set to, even though I don't have a docking station). - The nVidia setting app now recognized both monitors. So, I setup the X Server display config as Separate X screen for both monitors. My laptop screen shows up as AUO 1440x900 and my external monitor as Acer E211H 1920x1080. - Everything seemed like it would work, but the external monitor was just a complete white screen. The external monitor was non-functional, even though sometimes it would show the background image - still nothing would show up over there. - So, I checked the Enable Xinerama box. - Now, after logging out and back in, the wallpaper extends to both screens but I get no taskbar at the bottom or top, no system menus, and I have to press the power button to restart or log off. - After experimenting with all the shells, the only one that shows the menus and taskbars when I log in is Gnome Classic. - This is pretty much the same symptoms as found here: How do I fix 11.10 GUI?. - So, I resign myself to the older shell. - Everything works fine until ... I unplug the external monitor ... this is a laptop after all. - Anyway, after doing some work on the road, I plug back in and I still see both screens and it's functional except, ... - Now, the laptop screen (with the taskbar and menu bar) has 4 black bars at the top that windows cannot cover. The top bar is the menu bar (with Applications, Places, the date and time and the system menu on the right). But the next 3 bars (the same height as the top menu bar) are empty and are just reducing the max size of windows on that screen. - See screenshot here: http://i39.tinypic.com/35d2kh1.png - So ... 1. How do I get rid of those extra 3 black bars? They're taking valuable screen space. 2. (less critical) How do I successfully use both screens in the Ubuntu or Ubuntu 2D shell?

    Read the article

  • Good way to extract strings to resource

    - by Bart Friederichs
    I am using Visual Studio 2010 and we just decided to get started on localization of our code. We want to use the per-form resource file in combination with a separate resource file for static strings, called strings.resx. I was wondering if there is a good way to extra static strings (we already have quite some code we need to translate) to the strings.resx file? I have tried this plugin: Resource Refactoring 2010, but it doesn't work completely. It creates the correct new resource, but the strings aren't refactored in the code. Also, the tool seems to be abandoned by its developer. Is there a good plugin that can do this?

    Read the article

  • Why is text on my TV monitor all grainy?

    - by searchfgold6789
    I have successfully installed the Catalyst drivers and hooked up my 1080p TV to the Radeon HD 5750's HDMI port and now it is working. There only seems to be one issue - most images appear OK, at least to my eyes, but text is grainy and difficult to read (not sure how well it can be seen in the picture): It works fine with a smaller screen, and hopefully you can see it with the new pictures which are only slightly better, but images are rendered a little funny too. Changing antialiasing does nothing and changing the refresh rate only makes a slight change if any. The small monitor I have works fine. Smaller resolutions such as 1024x768 look OK but are the wrong aspect ratio. I have tried renaming the input mode on the TV to "PC", and that helped... a little bit. Also, I tried a different PC with the same result. Messing around extensively with the ATI Catalyst Control Center also did not help. I am wondering if there is anything else I can try to increase the quality so it is more usable.

    Read the article

  • Problem Installing Application on iPhone: Resource has been modified

    - by Steve
    Hi, I am working on a simple iPhone application and when I run my app on my machine it installs on the device, but when I try it on a Windows machine using an ad-hoc distribution profile, it shows an error: "Application couldn't be installed because a resource has been modified." I have 2 iPhones and have tested the same app; on iPhone 2G it works fine, but on the 3G it shows the error I have written above. I tried to change the certificate and provisioning profiles, but no luck. Please let me know where I am mistaken. Thanks. Steve

    Read the article

  • Java resource as file

    - by Martin Riedel
    Is there a way in Java to construct a File instance on a resource retrieved from a jar through the classloader? My application uses some files from the jar (default) or from a filesystem directory specified at runtime (user input). I'm looking for a consistent way of a) loading these files as a stream b) listing the files in the user-defined directory or the directory in the jar respectively Edit: Apparently, the ideal approach would be to stay away from java.io.File altogether. Is there a way to load a directory from the classpath and list its contents (files/entities contained in it)?

    Read the article

  • Tracing or Logging Resource Governor classification function behavior in Sql Server 2008

    - by nganju
    I'm trying to use the Resource Governor in SQL Server 2008 but I find it hard to debug the classification function and figure out what the input variables will have, i.e. does SUSER_NAME() contain the domain name? What does the APP_NAME() string look like? It's also hard to verify that it's working correctly. What group did the function return? The only way I can see this is to fire up the performance monitor and watch unblinkingly for little blips in the right CPU counter. Is there some way I can either run it in Debug mode, where I can set a breakpoint and step through and look at variable values, or can I at least do the old-school method of writing trace statements to a file so I can see what's going on? Thanks...

    Read the article

  • resource embedding in asp.net

    - by Mike
    I have a project which needs to generate PDF documents. I am using iTextSharp. I have a pdf which needs to be read and then appended to. To read the pdf document, I'm using PdfReader(), which accepts many forms, but I can't figure out how to reference a pdf in my webapplication to PdfReader. My host does not allow Binary Serialization (apparently that's bad), so I don't think I can load from an embedded resource. I've tried just using PdfReader("report.pdf"), but it keeps throwing an exception telling me that the file isn't found. I've tried putting the file in the bin directory, root directory, in the same directory as the class, but this still doesn't work. It works if I use a fully qualified path to the pdf document, but I can't use that when I upload it to my hosting provider. Does anyone have any suggestions on how I should do this? Thanks

    Read the article

  • gnome-shell failed to launch when dual monitor detected, nvidia card

    - by Terry Hu
    I installed a clean precise. I like gnome-shell so I installed it. It worked well with single monitor. But It does not work well when I go to office, plug my external monitor onto my laptop. I am using nvidia driver. Another colleague is using the same laptop, he can work well with dual monitors. His laptop is ATI graphic card. When I plug my extended monitor cable, I choose GNOME, but actually it goes to gnome 2 classic desktop environment, not GNOME 3. When I disconnect the extended monitor, restart X, I can login with GNOME3. Do I have to choose between GNOME3 and extended monitor? It's a hard choose.

    Read the article

  • How do I rotate my monitor using xorg?

    - by user1106405
    I have just installed KUbuntu 12.10, and I am attempting to rotate my monitor 90 deg to the left. When I add the option to rotate, the monitor seems to ignore the directive. I'm currently using dual 02:00.0 VGA compatible controller: NVIDIA Corporation GF104 [GeForce GTX 460] (rev a1) 03:00.0 VGA compatible controller: NVIDIA Corporation GF104 [GeForce GTX 460] (rev a1) and NVidia driver version 310 My xorg.conf is as follows: # nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings: version 304.51 (buildd@komainu) Fri Oct 12 12:53:49 UTC 2012 # nvidia-xconfig: X configuration file generated by nvidia-xconfig # nvidia-xconfig: version 310.14 ([email protected]) Tue Oct 9 13:04:01 PDT 2012 Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 1280 0 Screen 1 "Screen1" RightOf "Screen0" Screen 2 "Screen2" 0 0 InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" Option "Xinerama" "1" EndSection Section "Files" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection Section "Monitor" Identifier "Monitor0" VendorName "Unknown" ModelName "Samsung SyncMaster" HorizSync 30.0 - 81.0 VertRefresh 56.0 - 60.0 Option "DPMS" EndSection Section "Monitor" Identifier "Monitor1" VendorName "Unknown" ModelName "DELL 1908WFP" HorizSync 30.0 - 83.0 VertRefresh 56.0 - 75.0 EndSection Section "Monitor" Identifier "Monitor2" VendorName "Unknown" ModelName "DELL 1907FP" HorizSync 30.0 - 81.0 VertRefresh 56.0 - 76.0 EndSection Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 460" BusID "PCI:2:0:0" Screen 0 EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 460" BusID "PCI:2:0:0" Screen 1 EndSection Section "Device" Identifier "Device2" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 460" BusID "PCI:3:0:0" EndSection Section "Screen" # Removed Option "metamodes" "DFP-0: nvidia-auto-select +0+0; DFP-0: nvidia-auto-select +0+0; DFP-0: 1920x1200 +0+0; DFP-0: 1920x1200_60 +0+0; DFP-0: 1600x1200 +0+0; DFP-0: 1600x1200_60 +0+0; DFP-0: 1280x1024 +0+0; DFP-0: 1280x1024_60 +0+0; DFP-0: 1280x960 +0+0; DFP-0: 1280x960_60 +0+0; DFP-0: 1024x768 +0+0; DFP-0: 1024x768_60 +0+0; DFP-0: 800x600 +0+0; DFP-0: 800x600_60 +0+0; DFP-0: 800x600_56 +0+0; DFP-0: 640x480 +0+0; DFP-0: 640x480_60 +0+0; DFP-0: nvidia-auto-select @1920x1080 +0+0; DFP-0: nvidia-auto-select @1920x720 +0+0" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "Stereo" "0" Option "metamodes" "DFP-0: nvidia-auto-select +0+0; DFP-0: nvidia-auto-select +0+0; DFP-0: 1920x1200 +0+0; DFP-0: 1920x1200_60 +0+0; DFP-0: 1600x1200 +0+0; DFP-0: 1600x1200_60 +0+0; DFP-0: 1280x1024 +0+0; DFP-0: 1280x1024_60 +0+0; DFP-0: 1280x960 +0+0; DFP-0: 1280x960_60 +0+0; DFP-0: 1024x768 +0+0; DFP-0: 1024x768_60 +0+0; DFP-0: 800x600 +0+0; DFP-0: 800x600_60 +0+0; DFP-0: 800x600_56 +0+0; DFP-0: 640x480 +0+0; DFP-0: 640x480_60 +0+0; DFP-0: nvidia-auto-select +0+0; DFP-0: nvidia-auto-select +0+0" SubSection "Display" Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen1" Device "Device1" Monitor "Monitor1" DefaultDepth 24 Option "Stereo" "0" Option "metamodes" "DFP-2: nvidia-auto-select +0+0" Option "Rotate" "left" SubSection "Display" Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen2" Device "Device2" Monitor "Monitor2" DefaultDepth 24 Option "Stereo" "0" Option "metamodes" "nvidia-auto-select +0+0" SubSection "Display" Depth 24 EndSubSection EndSection Section "Extensions" Option "Composite" "Enable" EndSection Edit: If I delete the xorg.conf and reboot, I am able to rotate my monitor, however, my third monitor is not recognized: Screen 0: minimum 8 x 8, current 3360 x 1200, maximum 16384 x 16384 DVI-I-0 disconnected (normal left inverted right x axis y axis) DVI-I-1 disconnected (normal left inverted right x axis y axis) DVI-I-2 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm 1920x1200 60.0*+ 1600x1200 60.0 1280x1024 60.0 1280x960 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 HDMI-0 disconnected (normal left inverted right x axis y axis) DVI-I-3 connected 1440x900+1920+0 (normal left inverted right x axis y axis) 408mm x 255mm 1440x900 59.9*+ 75.0 1280x1024 75.0 60.0 1280x800 59.8 1152x864 75.0 1024x768 75.0 70.1 60.0 800x600 75.0 72.2 60.3 56.2 640x480 75.0 72.8 59.9

    Read the article

  • monitor http request from non-browser

    - by Ananth
    hi, I want to monitor http request generated out of a exe. Is there any tool that can help me? Actually, an exe would call my asp.net web page to register a user. The exe constructs the POST data request and calls my page. when the request reaches my web page, I don't see any data. I want to monitor the Request object and the traffic to find the reality. Any help is appreciated. Thanks. ~/Ananth

    Read the article

  • Instantiate an .aspx that is an embedded resource of an assembly

    - by asbjornu
    I have an ASP.NET (MVC) application in which I would like to load WebForms .aspx files that are embedded as resources in 3rd party assemblies. The reason I want to do this is to make a sort of "plug-in" system where a .dll file can be dropped in a folder and then picked up at runtime to provide additional functionality to the base application. I've gotten the plugin system to work (I'm using MEF) with plugins written in ASP.NET MVC (Views and Controllers), but for plain old ASP.NET (Pages), I've got myself into a bit of a problem. For the execution of the embedded .aspx file (which, in the usual WebForm way Inherits="My.BasePage") I've created a custom VirtualPathProvider, ResourceFile ControllerFactory and PageController. Within the PageController I've overridden the Execute(RequestContext) method and within it I'm trying to compile the .aspx with BuildManager.CreateInstanceFromVirtualPath(virtualPath, type). When doing this, I get the error message "Could not load type 'My.BasePage'", even though I'm giving the BuildManager the System.Type of My.BasePage in the call to CreateInstanceFromVirtualPath. I seem to be stuck at this point. I've tried to Server.Transfer() to the custom VirtualPathProvider handled URL to the same .aspx file, but that fails with the same error message. How can I help BuildManager find out where My.BasePage is defined and how come the Type requiredBaseType parameter of CreateInstanceFromVirtualPath seems to be ignored? I've tried to call BuildManager.AddReferencedAssembly(), but that only fails with "This method can only be called during the application's pre-start initialization stage". MSDN says: "The method must be called during the Application_PreStartInit stage of the application", but I have no such event in my HttpApplication object and find absolutely zero information about it on the internet. Either way, I don't want to be calling BuildManager.AddReferencedAssembly() in or before the Application_Start event, since that makes me have to recycle the whole application to be able to add new plugins to the system. Does anyone have any clues? Any other ideas on how I can "execute" an .aspx file that is embedded as a resource within an assembly through reflection? Can I for instance pre-compile the .aspx file within the same assembly as the base Page class it inherits?

    Read the article

  • Thread resource sharing

    - by David
    I'm struggling with multi-threaded programming... I have an application that talks to an external device via a CAN to USB module. I've got the application talking on the CAN bus just fine, but there is a requirement for the application to transmit a "heartbeat" message every second. This sounds like a perfect time to use threads, so I created a thread that wakes up every second and sends the heartbeat. The problem I'm having is sharing the CAN bus interface. The heartbeat must only be sent when the bus is idle. How do I share the resource? Here is pseudo code showing what I have so far: TMainThread { Init: CanBusApi =new TCanBusApi; MutexMain =CreateMutex( "CanBusApiMutexName" ); HeartbeatThread =new THeartbeatThread( CanBusApi ); Execution: WaitForSingleObject( MutexMain ); CanBusApi->DoSomething(); ReleaseMutex( MutexMain ); } THeartbeatThread( CanBusApi ) { Init: MutexHeart =CreateMutex( "CanBusApiMutexName" ); Execution: Sleep( 1000 ); WaitForSingleObject( MutexHeart ); CanBusApi->DoHeartBeat(); ReleaseMutex( MutexHeart ); } The problem I'm seeing is that when DoHeartBeat is called, it causes the main thread to block while waiting for MutexMain as expected, but DoHeartBeat also stops. DoHeartBeat doesn't complete until after WaitForSingleObject(MutexMain) times out in failure. Does DoHeartBeat execute in the context of the MainThread or HeartBeatThread? It seems to be executing in MainThread. What am I doing wrong? Is there a better way? Thanks, David

    Read the article

  • Jersey / ServletContext and resource loading on startup.

    - by Raphael Jolivet
    Hello, I'm kind of new in web development with Java. I am developing a web service and I've chosen REST / Jersey for it. I want to init some stuff on startup of the service and to keep them all along the life of the service. First question : Is the constructor of the Jersey Servlet a good place to do that ? Basically, what I want to do is to load a config.ini file located in my WEB-INF directory. Following this help, I understand I need a ServletContext to load my file as a resource. However, it is not clear to me how to get this ServletContext in a Jersey Servlet, as it is not really an instance of a servlet, but rather a POJO with some annotations. I wanted to try this tip, but the attribute "context" is null in the constructor. I think that Jersey might populate it after the constructor. Right ? So how is the right way to do this ? Here is my code so far : /** Main REST servlet */ @Path("/") public class Servlet { // ---------------------------------------------------- // Constants // ---------------------------------------------------- static private final String CONFIG_PATH = "/WEB-INF/config.ini"; // ---------------------------------------------------- // Attributes // ---------------------------------------------------- /** Context */ @Context ServletContext context; // ---------------------------------------------------- // Constructor // ---------------------------------------------------- /** Init the servlet */ public Servlet() { // Load config.ini from WEB-INF Config.config = new Config( this.context.getResourceAsStream(CONFIG_PATH)); // FAIL! this.context is null ... } // ---------------------------------------------------- // URI Handlers // ---------------------------------------------------- /** Welcome page */ @GET @Path("/") @Produces(MediaType.TEXT_HTML) public String welcome() { return "<h1>Hi there.</h1>"; } } Any help would be much appreciated. Thanks in advance, Raphael

    Read the article

  • Use a resource dictionary as theme in Silverlight

    - by SaphuA
    Hello, I have developed an application which allows the user to switch between themes. I'm doing this by including the xaml file as a resource in my project and using the following code: MainTheme.ThemeUri = new Uri("SilverlightApplication1;component/Themes/[ThemeName]/Theme.xaml", UriKind.Relative); This worked well, untill I found these themes: http://timheuer.com/blog/archive/2010/05/17/silverlight-4-tools-released-and-new-application-templates.aspx The difference is that these themes consist of multiple files. So I made a Theme.xaml file that only includes MergedDictionaries so I could still use the code above. This is the Theme.xaml file for the Cosmopolitan theme. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="CoreStyles.xaml"/> <ResourceDictionary Source="SDKStyles.xaml"/> <ResourceDictionary Source="Styles.xaml"/> <ResourceDictionary Source="ToolkitStyles.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> However, when I run the c# code above I get the following exception: System.Windows.Markup.XamlParseException: Failed to assign to property 'System.Windows.ResourceDictionary.Source'. Just to be clear, using the MergedDictionaries method does work when I set it in my App.xaml: <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Themes/Cosmopolitan/Theme.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> What am I doing wrong? Thanks!

    Read the article

  • Scheduling of tasks to a single resource using Prolog

    - by Reed Debaets
    I searched through here as best I could and though I found some relevant questions, I don't think they covered the question at hand: Assume a single resource and a known list of requests to schedule a task. Each request includes a start_after, start_by, expected_duration, and action. The goal is to schedule the tasks for execution as soon as possible while keeping each task scheduled between start_after and start_by. I coded up a simple prolog example that I "thought" should work but I've been unfortunately getting errors during run time: "=/2: Arguments are not sufficiently instantiated". Any help or advice would be greatly appreciated startAfter(1,0). startAfter(2,0). startAfter(3,0). startBy(1,100). startBy(2,500). startBy(3,300). duration(1,199). duration(2,199). duration(3,199). action(1,'noop1'). action(2,'noop2'). action(3,'noop3'). can_run(R,T) :- startAfter(R,TA),startBy(R,TB),T>=TA,T=<TB. conflicts(T,R1,T1) :- duration(R1,D1),T=<D1+T1,T>T1. schedule(R1,T1,R2,T2,R3,T3) :- can_run(R1,T1),\+conflicts(T1,R2,T2),\+conflicts(T1,R3,T3), can_run(R2,T2),\+conflicts(T2,R1,T1),\+conflicts(T2,R3,T3), can_run(R3,T3),\+conflicts(T3,R1,T1),\+conflicts(T3,R2,T2). % when traced I *should* see T1=0, T2=400, T3=200 Edit: conflicts goal wasn't quite right: needed extra TT1 clause. Edit: Apparently my schedule goal works if I supply valid Request,Time pairs ... but I'm stucking trying to force prolog to find valid values for T1..3 when given R1..3?

    Read the article

  • Can't Move Windows to 2nd Monitor without Left Mouse and Cntl Key

    - by John C
    I have 2 very frustrating problems that maybe someone can help me with: I have 2 monitors (different sizes and resolutions) setup with the "Extended" monitor Win7 setup. My problem is this = I can not "move" a window from my Primary Monitor (larger and higher resolution on right side in front of me) to my Secondary 2nd monitor (smaller and lower resolution) with just selecting the title bar with the left mouse button and dragging it to the left. Windows 7 "snaps" it back to the left Primary Monitor when the window is physically in the 2nd window area as I'm holding the left mouse button. I can prevent this problem - by holding down the Cntl Key with the Left Mouse button, but this is extremely annoying to me. Also I typically "lose" focus if I try typing input on the 2nd monitor. Typing is erratic with regard to keystroke accuracy from my keyboard translated into input on the 2nd screen. No problem with typing input on the primary left monitor. I find this extremely annoying in Windows 7 and turning off the "snap" feature via the Control panel does NOT work for me. Win7 stubbornly refuses to move my selected window to my 2nd monitor without me "forcing" Win7 to do this with the Cntrl Key. Please tell me this is not a Win7 feature. Also on my system - Windows Key + Shift, Left arrow Key (pressed together) or the same combo with The Right arrow Key - don't do anything whatsoever. Widows Key with "+" however does maximize current window across both monitors, and I can "restore" it with Windows Key and "-" back to original monitor and size. I have tried various solutions including changing the resolutions of one or both of my monitors and sometimes "temporarily helps" but reverts back to the problem. Also if I swap the logical (not physical) layout so that I tell Win7 the monitors are setup in a reserved situation (Large monitor on the left, and small on the right) - this also sometimes helps for awhile - and is very strange and awkward to work with "backwards". But all of these solutions stop working. The only solution that consistently works for "moving" the screens is to hold the Cntrl Key down as I'm moving window with the left mouse selected on the title bar. Even that however, doesn't prevent the loss of typing focus for me on the 2nd monitor - while at the same time the typing on the 1st monitor is fine. Any help on moving my window screens from one monitor on my 2nd monitor without having to press the Cntrl key while holding down my left mouse button with be appreciated. Also any help on gaining typing "focus" into my 2nd screen with be helpful too. Thanks - John

    Read the article

  • Torque and maui node status

    - by Lafada
    I am new for torque and maui. I was checking for node state to looking for which nodes are free and which nodes are in use. For torque one command is pbsnodes. Which gives status and other info related to node. When I was checking for maui then I found command diagnose -n which also shows status of the node. I was wondering between these 2 status. Both are giving different status for the same situation. When I do man pbsnodes I got the possible states for node "free", "offline", "down", "reserve", "job-exclusive", "job-sharing", "busy", "time-shared", or "state-unknown" But this type of different state I cant find for diagnose -n. How pbsnodes and diagnose -n get the status for node. Is there any database like xCAT use for torque or maui? Thx in advance for your valuable time.

    Read the article

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