Search Results

Search found 19441 results on 778 pages for 'static libraries'.

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

  • Static Vs Non-Static Method Performance C#

    - by dotnetguts
    Hello All, I have few global methods declared in public class in my asp.net web application. I have habbit of declaring all global methods in public class in following format public static string MethodName(parameters) { } I want to know how it would impact on performance point of view? 1) Which one is Better? Static Method or Non-Static Method? 2) Reason why it is better? Following link shows Non-Static methods are good because, static methods are using locks to be Thread-safe. The always do internally a Monitor.Enter() and Monitor.exit() to ensure Thread-safety. http://bytes.com/topic/c-sharp/answers/231701-static-vs-non-static-function-performance And Following link shows Static Methods are good static methods are normally faster to invoke on the call stack than instance methods. There are several reasons for this in the C# programming language. Instance methods actually use the 'this' instance pointer as the first parameter, so an instance method will always have that overhead. Instance methods are also implemented with the callvirt instruction in the intermediate language, which imposes a slight overhead. Please note that changing your methods to static methods is unlikely to help much on ambitious performance goals, but it can help a tiny bit and possibly lead to further reductions. http://dotnetperls.com/static-method I am little confuse which one to use? Thanks

    Read the article

  • Persistent static route stops working after VPN drops and reconnects

    - by user76157
    I've got a VPN between two networks, one home and one office (A and B). Their subnets are: (A) 192.168.1.0 and (B) 192.168.0.0 The two networks have identical ADSL routers. Unfortunately these can only do dial-out VPN. So I've got a Windows 2008 server on Network B acting as a VPN server (ServerB). Network A's router (RouterA) passes through Network B's router and connects via PPTP to ServerB. RouterA is assigned the static IP 192.168.0.40 on Network B. There's a persistent static route on ServerB telling it to use 0.40 for all requests to Network A's subnet, 192.168.1.0. (route -p add 192.168.1.0 mask 255.255.255.0 192.168.0.40). This enables ServerB to ping all machines on A (and those machines to ping ServerB). The VPN connection occasionally drops (I'm not sure why - it's set to remain always on and seems to drop randomly). This wouldn't be too much of a problem, as it reconnects automatically and quickly, except that when it does reconnect, the static route on ServerB no longer works. Route print (on ServerB) shows that the persistent static route still exists. However a tracert to a machine on Network A doesn't use the static route; it tries instead to use ServerB's default gateway (which is RouterB), and fails to find the machine. Deleting and re-adding the static route fixes the problem - a tracert uses the static route. At the moment, a batch file to delete and re-add the static route is scheduled to run every day. But this is clearly far from an ideal solution! I hope that's not too confusing. Any help would be very much appreciated.

    Read the article

  • Static noise in headphones

    - by John Murdoch
    I have a Asus P6T based system. I was using the on-board sound (plugging in Logitech X-230 2.1 analog speakers in the green "front speakers" 3.5mm analog output, then plugging in my headphones in that). I was quite happy with the sound quality (didn't hear any static noise if volume was turned down to my normal listening level). Then about a week ago I started having terrible static noise from the left channel, and no normal audio on that left channel. Right channel had more static noise than usual but did have a bit of sound. I tried using the AC'97 in front of my case but that seemed to have no signal. I decided my on-board sound card has gone bad and bought an internal sound card to replace it (Startech 7.1Ch PCI). This fixed the "no sound from left channel problem", but I had much more audible static noise. I decided the card was low quality and/or it had interference from all the other things happening inside the computer case, and bought a Sweex SC016 external USB sound card. But even with that I have static noise in headphones. Positioning the USB sound card differently doesn't seem to help. Trying the other analog outputs (e.g., surround) doesn't help. The static noise in all cases is proportional to the volume. I have tried different headphones, but the situation is situation though perhaps the flavour of the static noise changes slightly. So what are my options? a) Get another, more expensive, external USB sound card hoping the quality will improve? b) Get another, more expensive, internal sound card (PCIe 1x perhaps) hoping the quality will improve? c) Get a dedicated DAC box? d) Get some Hi-Fi earphones? Suggestions? tl;dr - Two different sound cards both still have static noise in headphones.

    Read the article

  • Is static universally "evil" for unit testing and if so why does resharper recommend it?

    - by Vaccano
    I have found that there are only 3 ways to unit test (mock/stub) dependencies that are static in C#.NET: Moles TypeMock JustMock Given that two of these are not free and one has not hit release 1.0, mocking static stuff is not too easy. Does that make static methods and such "evil" (in the unit testing sense)? And if so, why does resharper want me to make anything that can be static, static? (Assuming resharper is not also "evil".) Clarification: I am talking about the scenario when you want to unit test a method and that method calls a static method in a different unit/class. By most definitions of unit testing, if you just let the method under test call the static method in the other unit/class then you are not unit testing, you are integration testing. (Useful, but not a unit test.)

    Read the article

  • Windows 7 libraries and folder redirection nightmare

    - by Lobuno
    Hello! In our active directory we deploy a policy to our clients where the personal directory (My documents) is redirected to a file server of ours \server\share\username\Documents In older systems everything worked fine. in Windows 7 some users are experimenting the following symptoms: The Documents library is EMPTY Where the documents library should be shown in Explorer an empty white icon is displayed. No caption. Right clicking in the Documents library to edit the folders that are part of the libraries brings the dialog up. However, that dialog is unusable. No folder is present there and clicking Add folder does nothing. Deleting the library and auto-creating it doesn't solve the problem The shared directory can be accessed via UNC paths and it can be mounted as a shared drive as well. The library is still broken. The shared drives are on a W2008 indexed server... Using the Windows Library tool utility doesn't solve the problem. What can the cause of this problem be and how can this be solved?

    Read the article

  • Windows 7 libraries and folder redirection nightmare

    - by Lobuno
    Hello! In our active directory we deploy a policy to our clients where the personal directory (My documents) is redirected to a file server of ours \server\share\username\Documents In older systems everything worked fine. in Windows 7 some users are experimenting the following symptoms: The Documents library is EMPTY Where the documents library should be shown in Explorer an empty white icon is displayed. No caption. Right clicking in the Documents library to edit the folders that are part of the libraries brings the dialog up. However, that dialog is unusable. No folder is present there and clicking Add folder does nothing. Deleting the library and auto-creating it doesn't solve the problem The shared directory can be accessed via UNC paths and it can be mounted as a shared drive as well. The library is still broken. The shared drives are on a W2008 indexed server... Using the Windows Library tool utility doesn't solve the problem. What can the cause of this problem be and how can this be solved?

    Read the article

  • Does python import all the listed libraries? - Python

    - by RadiantHex
    Hi folks, I'm just wondering, I often have really long python files and imports tend to stack quite quickly. PEP8 says that the imports should always be written at the beginning of the file. Do all the imported libraries get imported when calling a function coded in the file? Or do only the necessary libraries get called? Does it make sense to worry about this? Is there no reason to import libraries within the functions or classes that need them?

    Read the article

  • Write to static field - is FindBugs wrong in this case?

    - by htorque
    I have a Java class like this: public class Foo { public static int counter = 0; public void bar(int counter) { Foo.counter = counter; } } FindBugs warns me about writing to the static field counter via the instance method bar. However, if I change the code to: public class Foo { public static int counter = 0; public static void setCounter(int counter) { Foo.counter = counter; } public void bar(int counter) { setCounter(counter); } } Then FindBugs won't complain. Isn't that wrong? I'm still writing to a static field from an instance method, just via a static method - no?

    Read the article

  • Static IP settings on Windows 2003 server not getting saved

    - by Prashant Mandhare
    We have a Dell PowerEgde 1950 server with Broadcom NetXtreme gigabit ethernet card, and we are facing a strange problem with static IP assignment. When we assign a static IP to this broadcom NIC, settings are not getting saved. Following are the steps to reproduce problem open TCP/IP properties window for broadcom NIC manually enter static IP address and other details like gateway, DNS, etc. apply and close properties dialog. re-open TCP/IP properties windows, you will see your static IP settings lost and changed to "obtain IP address manually" but when checked using ipconfig command, you will still see your same static IP settings but, when checked using ipconfig command after rebooting server, these static ip settings are completely gone and automatically obtained IP is assigned Supplementary information: Recently we had formatted this server and installed windows 2003 from OEM windows setup CD (not from OS installation CD received from Dell). After windows installation was over, broadcom NIC drivers were installed.

    Read the article

  • How to transition to Comcast with static IP address

    - by steveha
    I have my own email server in my house, on a static IP address. I have had business DSL for over a decade, but I also now have Comcast business Internet. I want to transition from the DSL to the Comcast, and I have some questions. I have a domain name, my own mail server, and a firewall (a PC with two network interfaces, running Devil-Linux). I need to make sure I understand how to set up the Comcast cable box, and how to set up my firewall. First, do I need to change any settings in the cable box? Currently I have only used the cable box by plugging in a laptop, with the laptop doing DHCP. I think I can leave the box alone but I would like to make sure. Second, I'm not sure I understand the instructions Comcast gave me for setting up the firewall. My DSL provider gave me the following information: static IP address, net mask, gateway, and two DNS servers. Comcast gave me: static IP address, routable static IP address, net mask, and two DNS servers, and told me to put the "static IP address" as the "gateway" on the firewall. Is this just Comcast-speak here? Does "routable static IP address" mean the same thing as "static IP address" in my DSL setup, the end-point address that I should publish in the DNS MX records for my email server? Or should I publish the "static IP address", and Comcast will then route all its traffic over the cable box? My plan is: first, I'm going to configure another firewall, so I have one firewall for the DSL and one for the Comcast (rather than madly editing settings to switch back and forth). Then I will publish the new Comcast static IP address as a backup email server address in the DNS MX records, wait a while to let it propagate, and then switch my home over from the DSL to the Comcast. Then I'll change DNS to make that the primary mail address and the DSL the secondary, let that go a while and make sure it seems reliable. Then I'll remove the DSL from the DNS MX records completely, and finally shut down the DSL service. (I thought about keeping the DSL as a backup, but the reason I'm leaving DSL is that it has become unreliable; and I have heard that Comcast business Internet is reliable.) Final question, any advice for me? Anything you think might be useful, helpful, or educational. Thanks.

    Read the article

  • How to transition to Comcast with static IP address [migrated]

    - by steveha
    I have my own email server in my house, on a static IP address. I have had business DSL for over a decade, but I also now have Comcast business Internet. I want to transition from the DSL to the Comcast, and I have some questions. I have a domain name, my own mail server, and a firewall (a PC with two network interfaces, running Devil-Linux). I need to make sure I understand how to set up the Comcast cable box, and how to set up my firewall. First, do I need to change any settings in the cable box? Currently I have only used the cable box by plugging in a laptop, with the laptop doing DHCP. I think I can leave the box alone but I would like to make sure. Second, I'm not sure I understand the instructions Comcast gave me for setting up the firewall. My DSL provider gave me the following information: static IP address, net mask, gateway, and two DNS servers. Comcast gave me: static IP address, routable static IP address, net mask, and two DNS servers, and told me to put the "static IP address" as the "gateway" on the firewall. Is this just Comcast-speak here? Does "routable static IP address" mean the same thing as "static IP address" in my DSL setup, the end-point address that I should publish in the DNS MX records for my email server? Or should I publish the "static IP address", and Comcast will then route all its traffic over the cable box? My plan is: first, I'm going to configure another firewall, so I have one firewall for the DSL and one for the Comcast (rather than madly editing settings to switch back and forth). Then I will publish the new Comcast static IP address as a backup email server address in the DNS MX records, wait a while to let it propagate, and then switch my home over from the DSL to the Comcast. Then I'll change DNS to make that the primary mail address and the DSL the secondary, let that go a while and make sure it seems reliable. Then I'll remove the DSL from the DNS MX records completely, and finally shut down the DSL service. (I thought about keeping the DSL as a backup, but the reason I'm leaving DSL is that it has become unreliable; and I have heard that Comcast business Internet is reliable.) Final question, any advice for me? Anything you think might be useful, helpful, or educational. Thanks.

    Read the article

  • Draytek Vigor 2820 static IP's

    - by dannymcc
    I have a Draytek Vigor 2820 router which is connected to our ADSL provider (British Telecom, BT). We currently have one static IP address which is accessible from anywhere outside of our network and points at a simple web server on port 80. We have just been given 5 more static IP addresses which I would like to point at five servers that have static IP's. As an example: Current static IP - 80.123.123.123 New Static IP's - 100.100.100.100-105 Server IP's - 192.168.1.129-133 I have confused myself completely between NAT addresses, static routes and WAN IP aliases. If anyone can give me a clear idea of what I need to do it would be greatly appreciated.

    Read the article

  • Creating a seperate static content site for IIS7 and MVC

    - by JK01
    With reference to this serverfault blog post: A Few Speed Improvements where it talks about how static content for stackexchange is served from a separate cookieless domain... How would someone go about doing this on IIS7.5 for a ASP.NET MVC site? The plan so far: Register domain eg static.com, create a new website in IIS Manually copy the js / css / images folders from MVC as is so that they have the same paths on the new server Enable IIS gzip settings (js/css = high compression, images = none) Set caching with far future expiry dates <clientCache cacheControlCustom="public" /> in the web.config Never set any cookies on the static.com site Combine and minimize js / css Auto deploy changes in static content with WebDeploy Is this plan correct? And how can you use WebDeploy to deploy the whole web app to one server and then only the static items to another? I can see there is a similar question, but for apache: Creating a cookie-free domain to serve static content so it doesn't apply

    Read the article

  • How to proceed when a bug in open source libraries is suspected?

    - by Suma
    We are using some open source libraries in our projects. Sometimes there are some issues found in some of them (most likely library bugs, but it may also be a wrong usage from our side, especially when sometimes documentation is not exactly 100 % complete). As the libraries are often quite complex, debugging them to pinpoint the source of the problem is sometimes quite hard. Can you help me to summarize what other options are there and how to exactly proceed with them? I have just recently hit some strange problems when using TCMalloc (Google scalable memory allocator) on Windows, so I would most welcome answers which would apply to this particular library, but more general answers are good as well. 1) Ask the maintainer/owner of the project for assistance. How can this be done? 2) Hire someone to identify and fix the issue. How to do this? How can I find someone with enough expertise in some particular library? ... any other options?

    Read the article

  • Static classes and/or singletons -- How many does it take to become a code smell?

    - by Earlz
    In my projects I use quite a lot of static classes. These are usually classes that naturally seem to fit into a single-instance type of thing. Many times I use static classes and recently I've started using some singletons. How many of these does it take to become a code smell? For instance, in my recent project which has a lot of static classes is an Authentication library for ASP.Net. I use a static class for a helper class that fixes ASP.Net error codes so it can be used like CustomErrorsFixer.Fix(Context); Or my authentication class itself is a static class //in global.asax's begin_application Authentication.SomeState="blah"; Authentication.SomeOption=true; //etc //in global.asax's begin_request Authentication.Authenticate(); When are static or singleton classes bad to use? Am I doing it wrong, or am I just in a project that by definition has very little per-instance state associated with it? The only per-instance state I have is stored in HttpContext.Current.Items like so: /// <summary> /// The current user logged in for the HTTP request. If there is not a user logged in, this will be null. /// </summary> public static UserData CurrentUser{ get{ return HttpContext.Current.Items["fscauth_currentuser"] as UserData; //use HttpContext.Current as a little place to persist static data for this request } private set{ HttpContext.Current.Items["fscauth_currentuser"]=value; } }

    Read the article

  • "You are missing the following 32-bit libraries, and Steam may not run: libc.so.6" The common fixes don't work,

    - by M_Steam_User
    So I know this is a problem that has been asked around a lot, but I've tried a bunch of solutions with no success. I'm running Ubuntu 12.04 (64 bit), and I just installed it yesterday. This is my first time working with linux. The error is: You are missing the following 32-bit libraries, and Steam may not run: libc.so.6 Things I've tried. First, I had downloaded from the steam website. I uninstalled it, and tried again from the ubuntu software centre. sudo apt-get update sudo apt-get install ia32-libs sudo apt-get upgrade This installed a bunch of the 32 bit libraries, but did not fix the issue. This seems like the major fix for most people. The direct approach of sudo apt-get install libc.so.6 returns this: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package libc.so.6 E: Couldn't find any package by regex 'libc.so.6' I guess libc.so.6 isn't a package, just a single file or something? I also tried gksudo gedit /etc/ld.so.conf.d/steam.conf Added these two lines, those the second one was all ready in the file, but copied over: /usr/lib32 /usr/lib/i386-linux-gnu/mesa Then executed: sudo ldconfig But nothing seemed to happen, steam still doesn't work. So, I feel like it is more likely that I have the library and steam isn't looking in the right place. One thing I've seen is people usually reference /usr/local/lib/ for your library locations. However, I can't find where to cd into /usr/, it isn't in my home folder. If /usr/ is the home folder, there is only a /.local folder which only has /share, no lib anywhere. Sorry for my linux ignorance. I appreciate any help, I honestly have no idea how to confirm I have the library and point steam to it, or if that is even the right thing to do. Edit: Tried this, not entirely sure what it means ~$ ls -l /lib32/libc* -rwxr-xr-x 1 root root 1721832 Sep 30 11:06 /lib32/libc-2.15.so -rw-r--r-- 1 root root 185928 Sep 30 11:06 /lib32/libcidn-2.15.so lrwxrwxrwx 1 root root 15 Sep 30 11:06 /lib32/libcidn.so.1 -> libcidn-2.15.so -rw-r--r-- 1 root root 34316 Sep 30 11:06 /lib32/libcrypt-2.15.so lrwxrwxrwx 1 root root 16 Sep 30 11:06 /lib32/libcrypt.so.1 -> libcrypt-2.15.so lrwxrwxrwx 1 root root 12 Sep 30 11:06 /lib32/libc.so.6 -> libc-2.15.so

    Read the article

  • Injecting jQuery into a page fails when using Google AJAX Libraries API

    - by jakemcgraw
    I'd like to inject jQuery into a page using the Google AJAX Libraries API, I've come up with the following solution: http://my-domain.com/inject-jquery.js: ;((function(){ // Call this function once jQuery is available var func = function() { jQuery("body").prepend('<div>jQuery Rocks!</div>'); }; // Detect if page is already using jQuery if (!window.jQuery) { var done = false; var head = document.getElementsByTagName('head')[0]; var script = document.createElement("script"); script.src = "http://www.google.com/jsapi"; script.onload = script.onreadystatechange = function(){ // Once Google AJAX Libraries API is loaded ... if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { done = true; // ... load jQuery ... window.google.load("jquery", "1", {callback:function(){ jQuery.noConflict(); // ... jQuery available, fire function. func(); }}); // Prevent IE memory leaking script.onload = script.onreadystatechange = null; head.removeChild(script); } } // Load Google AJAX Libraries API head.appendChild(script); // Page already using jQuery, fire function } else { func(); } })()); The script would then be included in a page on a separate domain: http://some-other-domain.com/page.html: <html> <head> <title>This is my page</title> </head> <body> <h1>This is my page.</h1> <script src="http://my-domain.com/inject-jquery.js"></script> </body> </html> In Firefox 3 I get the following error: Module: 'jquery' must be loaded before DOM onLoad! jsapi (line 16) The error appears to be specific to the Google AJAX Libraries API, as I've seen others use a jQuery bookmarklet to inject jQuery into the current page. My question: Is there a method for injecting the Google AJAX Libraries API / jQuery into a page regardless of the onload/onready state?

    Read the article

  • Test a site with a static subdomain locally

    - by bcmcfc
    How can I test a site that uses one or more static domains for serving images locally? e.g. domain.tld with images servered from static.domain.tld Local working copy of the site on WAMP checked out from SVN: URLs will be pointing at static.domain.tld rather than static.domain.local

    Read the article

  • TeamSpeak3 libraries

    - by Scott
    I've downloaded the TeamSpeak 3 server from their official website (it's 64 bit, as my dedicated server is 64 bit too). This is what I get,when I'm trying to run the server: Starting the TeamSpeak 3 server TeamSpeak 3 server started, for details please view the log file /libexec/ld-elf.so.1: scott# /lib/libiconv.so.3: unsupported file layout Whats wrong? /libexec/ld-elf.so.1 exists, same as the second one, is there any solution for that?

    Read the article

  • TeamSpeak3 libraries

    - by Scott
    I've downloaded the TeamSpeak 3 server from their official website (it's 64 bit, as my dedicated server is 64 bit too). This is what I get,when I'm trying to run the server: Starting the TeamSpeak 3 server TeamSpeak 3 server started, for details please view the log file /libexec/ld-elf.so.1: scott# /lib/libiconv.so.3: unsupported file layout Whats wrong? /libexec/ld-elf.so.1 exists, same as the second one, is there any solution for that?

    Read the article

  • Separate log files for each web application and shared libraries with log4j

    - by oo_olo_oo
    I have few web applications run on the Tomcat server. Each application contains its own log4j library copy inside its own war. This allows for separate, flexible logging configuration per application. I also have few shared libraries (kept in Tomcat's shared libraries directory). I would like to have shared library loggers output among with the application (which uses them) loggers output (for example: if application A logs to file a.log, and uses library b.jar, I would like b.jar to log also to the a.log file). The problem is, that the shared libraries are loaded by the shared classloader, which causes that they can't access loggers defined by the applications. Is there any solution for this issue?

    Read the article

  • MS Environment: How to force link a static library to another using .vsprops, if possible?

    - by msbuildnewbie
    Environment: VS 2008 in Windows. Problem: A static library, say first.lib is not linked to, say second.lib, if first.lib is specified in .vsprops file and none of its functions is referenced in the second.lib. If, however, first.lib is removed from the .vsprops file and placed instead in the appropriate project options dialog(1), it is linked, even if its functions remain unreferenced. (1) Project - Properties - Configuration Properties - Linker - Input. Our solution uses .vsprops exclusively and to somehow be able to specify first.lib in such a file with additional tweaking of some settings would be considered a more elegant solution. Using a dummy function to pull in unused functions of first.lib is not an option. Thanks in advance.

    Read the article

  • How to add libraries in C++?

    - by m00st
    Yea this is a dumb question... However in both of my C++ classes we did not do this at all (except for native libraries: iostream, iomanip, etc.)... My question is can anyone provide a link that gives the general explanation of adding libraries to C++? I do realize what what #include means; it's just I have no clue on the linker/directories in a C++ IDE. So long question short; could I get a general explanation of terms used to link libraries in C++? I'm using c::b w/ MinGW.

    Read the article

  • Importing libraries in eclipse programmatically

    - by Krt_Malta
    Hi, Is there a way I could put a library (Jar file) into an Eclipse project programatically? Up to now I've managed to do an external reference to it programatically using IPath path = new Path("C:\\Hello\\jtwitter.jar"); libraries.add(JavaCore.newLibraryEntry(path, null, null)); //add libs to project class path try { javaProject.setRawClasspath(libraries.toArray(new IClasspathEntry[libraries.size()]), null); } catch (JavaModelException e1) { e1.printStackTrace(); } } however I'd like to copy the jtwitter file to the project folder programatically so I could reference it as jtwitter.jar only. Can this be done please? Thanks a lot and regards, Krt_Malta

    Read the article

  • Implementing Static Libraries In iPhone

    - by socialCircus
    Hi All, I have created a static library following this link. But I am facing Problems in using the library. For reference on how to use static libraries in an iPhone project I followed this link . But I am stil struggling with the "How to implement static libraries in any other iPhone project?" question. Thank you all.

    Read the article

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