Search Results

Search found 24391 results on 976 pages for 'static methods'.

Page 10/976 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • multiple domains, one static IP address and latency

    - by shirish
    how is latency affected when multiple domains are using one single static IP address ? The scenario is in shared web-hosting By latency meaning the DNS lookup the client has to do. As far as I understand it, the browser would hit the root servers to try to figure out the IP Address and it belongs where and then when it comes to the correct server, it probably looks up some sort of table to determine which site names much and show that site as such via browser to the user. Is my understanding correct or backwards or what ?

    Read the article

  • how to set static IP address in opensolaris

    - by pm100
    in closed solaris i knew how to do this. Edit /etc/inet/ipnodes, change /etc/defaultrouter, reboot in opensolaris there is not defaultrouter file. first thing I tried was System-admin-network switch to manual enter static address and netmask and gateway. press 'activate' "this interface cannot be activated". No error messages given. Close widget, open again. Now hangs for a minute and then closes try edit /etc/inet/ipnodes, reboot eth card not up. Network widget hangs then closes Works perfectly on DHCP

    Read the article

  • Setting a Static IP Running FreeBSD8 in VirtualBox hosted on Windows 7

    - by gvkv
    I'm using VirtualBox on Windows 7 (host) to run a FreeBSD (guest) based web server. I`ve assigned a static ip of 192.168.80. 1 to the (virtualized) NIC which is run in bridged mode. The problem is that when I ping an external server (such as google.com) I get a No route to host error: dimetro# ping google.com PING google.com (66.249.90.104): 56 data bytes ping: sendto: No route to host ... I can ping the BSD server from both another virtualized machine and my host machine and from the server, I can ping everything on the network. The router ip is 192.168.1.1/16. ADDENDUM: I have the following lines in /etc/rc.conf on the BSD VM to configure networking: defaultrouter="192.168.1.1" ifconfig_em0="inet 192.168.80.1 netmask 255.255.0.0"

    Read the article

  • Fastest web server for serving static content

    - by Swader
    Hello, I'm optimizing our system for some faster static content delivery, and was wondering if anyone has any proper experience with the fastest web servers out there for such a purpose. From the three main candidates I've considered, Nginx, Cherokee and Lighttpd, each seems to have its own problems - but the reports I've read online are somewhat biased and lean towards whichever server the user is currently using. Any ideas on where to see a proper benchmark for this specific purpose, or at least a non-biased list of pros and cons? Any personal experiences and pitfalls I should be vary of? Thanks Edit: Serverfault.com gave the answer as nginx. I'd still like to hear some developer thoughts from this end of the universe.

    Read the article

  • Help on using mod_rewrite to serve I18N static site

    - by Guandalino
    My static site www.example.com is translated in different languages and files are organized in this hierarchy: / /de index.html seite-1.html /en index.html page-1.html /it index.html pagina-1.html The root contains no files, just one subdirectory for each language the site is translated in, while subdirectories contain pages translated (both content and file name are) in the language corresponding to subdirectory name, de, en, it, etc. The question is: how to configure mod_rewrite so that when a client visits www.example.com it is taken to the correct version of the site, falling back to english version if the required locale is not supported (i.e. Accept-Language header doesn't exist or specifies a language for which the site is not available, e.g. fr)? Thanks for any pointer, I'm here to provide further details or feedback! Best regards

    Read the article

  • Action -methods vs public methods in PHP frameworks

    - by Tower
    There are plenty of PHP frameworks out there as many of you know, and I am interested in your thoughts on this: Zend Framework has so-called action controllers that must contain at least one action method, a method whose name ends in "Action". For example: public function indexAction() {} The word "Action" is important, without it you can't access the method directly via the URI. However, in some other frameworks like Kohana you have public and private methods, where public methods are accessible and private are not. So my question is which do you think is a better approach? From a secure point of view I would vote Zend's approach, but I am interested in knowing what others think.

    Read the article

  • Parsing C#, finding methods and putting try/catch to all methods

    - by erdogany
    I know it sounds weird but I am required to put a wrapping try catch block to every method to catch all exceptions. We have thousands of methods and I need to do it in an automated way. What do you suggest? I am planning to parse all cs files and detect methods and insert a try catch block with an application. Can you suggest me any parser that I can easily use? or anything that will help me... every method has its unique number like 5006 public static LogEntry Authenticate(....) { LogEntry logEntry = null; try { .... return logEntry; } catch (CompanyException) { throw; } catch (Exception ex) { logEntry = new LogEntry( "5006", RC.GetString("5006"), EventLogEntryType.Error, LogEntryCategory.Foo); throw new CompanyException(logEntry, ex); } } I created this for this; http://thinkoutofthenet.com/index.php/2009/01/12/batch-code-method-manipulation/

    Read the article

  • Refering to javascript instance methods with a pound/hash sign

    - by Josh
    This question is similar to http://stackoverflow.com/questions/736120/why-are-methods-in-ruby-documentation-preceded-by-a-pound-sign I understand why in Ruby instance methods are proceeded with a pound sign, helping to differentiate talking about SomeClass#someMethod from SomeObject.someMethod and allowing rdoc to work. And I understand that the authors of PrototypeJS admire Ruby (with good reason) and so they use the hash mark convention in their documentation. My question is: is this a standard practice amongst JavaScript developers or is it just Prototype developers who do this? Asked another way, is it proepr for me to refer to instance methods in comments/documentation as SomeClass#someMethod? Or should my documentation refer to `SomeClass.someMethod?

    Read the article

  • Code optimization - Unused methods

    - by Yochai Timmer
    How can I tell if a method will never be used ? I know that for dll files and libraries you can't really know if someone else (another project) will ever use the code. In general I assume that anything public might be used somewhere else. But what about private methods ? Is it safe to assume that if I don't see an explicit call to that method, it won't be used ? I assume that for private methods it's easier to decide. But is it safe to decide it ONLY for private methods ?

    Read the article

  • C++, create an instance from a static method

    - by Manux
    Hello, let's say I want my users to use only one class, say SpecialData. Now, this data class would have many methods, and depending on the type of data, the methods do different things, internally, but return externally similar results. Therefore my wanting to have one "public" class and other "private", child classes that would change the behavior of methods, etc... It would be amazingly more simple for some types of data that need to be built to do something like this: SpecialData& sm = SpecialData::new_supermatrix(); and new_supermatrix() would return a SuperMatrix instance, which inherits from most behaviors of SpecialData. my header: static SpecialData& new_supermatrix(); my cpp: SpecialData& SpecialData::new_supermatrix()(){ return SuperMatrix(MATRIX_DEFAULT_MAGNITUDE,1000,1239,FLOAT32,etc...); } The problem is, I get this error, which is probably logical due to the circumstances: invalid initialization of non-const reference of type ‘SpecialData&’ from a temporary of type ‘SpecialData’ So, any ideas?

    Read the article

  • static initialization confusion

    - by Happy Mittal
    I am getting very confused in some concepts in c++. For ex: I have following two files //file1.cpp class test { static int s; public: test(){s++;} }; static test t; int test::s=5; //file2.cpp #include<iostream> using namespace std; class test { static int s; public: test(){s++;} static int get() { return s; } }; static test t; int main() { cout<<test::get()<<endl; } Now My question is : 1. How two files link successfully even if they have different class definitions? 2. Are the static member s of two classes related because I get output as 7. Please explain this concept of statics.

    Read the article

  • Can you make an Extension Method Static/Shared?

    - by Matt Thrower
    OK, I've probably misunderstood something here but, as far as I can see ... An extension method has to be contained in a module, not a class You can't make methods in modules Static/Shared Therefore you can't use an extension method on a class without instantiating it. In other words you can't make an extension method on String called "MyExtensionMethod" and use: String.MyExtensionMethod("String") But instead .. Dim test As String test.MyExtensionMethod("string") Is this correct? Or is there a way I can get extension methods to work as static methods?

    Read the article

  • Static method not called

    - by Smile
    I'm trying to call a static method (printABC()) in this class but it's not working. If I uncomment both of the lines marked T_T (1 and 2), it works! Why does it fail with only one of the lines? import java.util.Scanner; class pro0009 { static Scanner in = new Scanner(System.in); static int A,B,C; static void printABC(){ String ABC = in.nextLine(); ABC=ABC.replace("A"," "+A+" "); ABC=ABC.replace("B"," "+B+" "); ABC=ABC.replace("C"," "+C+" "); //System.out.print(ABC.substring(1)); System.out.print(ABC); } public static void main(String[] args){ int x = in.nextInt(); //1 int y = in.nextInt(); //2 int z = in.nextInt(); //3 if(x<y){//1<2 if(x<z){ //1<3 if(y<z){//x<y<z 2<3 //1<2<3 A=x; B=y; C=z; printABC();//T_T 1 System.out.println("Here"); //pro0009.printABC();//T_T 2 //System.out.println("Here2"); }else{ //x<z<y A=x; B=z; C=y; } }else{//z<x<y A=z; B=x; C=y; } }else{//y<x if(y<z){ if(x<z){//y<x<z A=y; B=x; C=z; }else{//y<z<x A=y; B=z; C=x; } }else{//z<y<x A=z; B=y; C=x; } } } }

    Read the article

  • Implementing a "state-machine" logic for methods required by an object in C++

    - by user827992
    What I have: 1 hypothetical object/class + other classes and related methods that gives me functionality. What I want: linking this object to 0 to N methods in realtime on request when an event is triggered Each event is related to a single method or a class, so a single event does not necessarily mean "connect this 1 method only" but can also mean "connect all the methods from that class or a group of methods" Avoiding linked lists because I have to browse the entire list to know what methods are linked, because this does not ensure me that the linked methods are kept in a particular order (let's say an alphabetic order by their names or classes), and also because this involve a massive amount of pointers usage. Example: I have an object Employee Jon, Jon acquires knowledge and forgets things pretty easily, so his skills may vary during a period of time, I'm responsible for what Jon can add or remove from his CV, how can I implement this logic?

    Read the article

  • Make methods that do not depend on instance fields, static?

    - by m3th0dman
    Recently I started programming in Groovy for a integration testing framework, for a Java project. I use Intellij IDEA with Groovy plug-in and I am surprised to see as a warning for all the methods that are non-static and do not depend on any instance fields. In Java, however, this is not an issue (at least from IDE's point of view). Should all methods that do not depend onto any instance fields be transformed into static functions? If true, is this specific to Groovy or it is available for OOP in general? And why?

    Read the article

  • What is the difference between all-static-methods and applying a singleton pattern?

    - by shahensha
    I am making a database to store information about the users of my website (I am using stuts2 and hence Java EE technology). For the database I'll be making a DBManager. Should I apply singleton pattern here or rather make all it's methods static? I will be using this DBManager for basic things like adding, deleting and updating User profiles. Along with it, I'll use for all other querying purposes, for instance to find out whether a username already exists and to get all users for administrative purposes and stuff like that. My questions What is the benefit of singleton pattern? Which thing is most apt here? All static methods or a singleton pattern? Please compare both of them. regards shahensha P.S. The database is bigger than this. Here I am talking only about the tables which I'll be using for storing User Information.

    Read the article

  • What is the difference between all-static-methods and applying a singleton pattern?

    - by shahensha
    I am making a database to store information about the users of my website (I am using stuts2 and hence Java EE technology). For the database I'll be making a DBManager. Should I apply singleton pattern here or rather make all it's methods static? I will be using this DBManager for basic things like adding, deleting and updating User profiles. Along with it, I'll use for all other querying purposes, for instance to find out whether a username already exists and to get all users for administrative purposes and stuff like that. My questions What is the benefit of singleton pattern? Which thing is most apt here? All static methods or a singleton pattern? Please compare both of them. P.S. The database is bigger than this. Here I am talking only about the tables which I'll be using for storing User Information.

    Read the article

  • Significant amount of the time, I can't think of a reason to have an object instead of a static class. Do objects have more benefits than I think?

    - by Prog
    I understand the concept of an object, and as a Java programmer I feel the OO paradigm comes rather naturally to me in practice. However recently I found myself thinking: Wait a second, what are actually the practical benefits of using an object over using a static class (with proper encapsulation and OO practices)? I could think of two benefits of using an object (both significant and powerful): Polymorphism: allows you to swap functionality dynamically and flexibly during runtime. Also allows to add new functionality 'parts' and alternatives to the system easily. For example if there's a Car class designed to work with Engine objects, and you want to add a new Engine to the system that the Car can use, you can create a new Engine subclass and simply pass an object of this class into the Car object, without having to change anything about Car. And you can decide to do so during runtime. Being able to 'pass functionality around': you can pass an object around the system dynamically. But are there any more advantages to objects over static classes? Often when I add new 'parts' to a system, I do so by creating a new class and instantiating objects from it. But recently when I stopped and thought about it, I realized that a static class would do just the same as an object, in a lot of the places where I normally use an object. For example, I'm working on adding a save/load-file mechanism to my app. With an object, the calling line of code will look like this: Thing thing = fileLoader.load(file); With a static class, it would look like this: Thing thing = FileLoader.load(file); What's the difference? Fairly often I just can't think of a reason to instantiate an object when a plain-old static-class would act just the same. But in OO systems, static classes are fairly rare. So I must be missing something. Are there any more advantages to objects other from the two that I listed? Please explain.

    Read the article

  • Lambdas within Extension methods: Possible memory leak?

    - by Oliver
    I just gave an answer to a quite simple question by using an extension method. But after writing it down i remembered that you can't unsubscribe a lambda from an event handler. So far no big problem. But how does all this behave within an extension method?? Below is my code snipped again. So can anyone enlighten me, if this will lead to myriads of timers hanging around in memory if you call this extension method multiple times? I would say no, cause the scope of the timer is limited within this function. So after leaving it no one else has a reference to this object. I'm just a little unsure, cause we're here within a static function in a static class. public static class LabelExtensions { public static Label BlinkText(this Label label, int duration) { Timer timer = new Timer(); timer.Interval = duration; timer.Tick += (sender, e) => { timer.Stop(); label.Font = new Font(label.Font, label.Font.Style ^ FontStyle.Bold); }; label.Font = new Font(label.Font, label.Font.Style | FontStyle.Bold); timer.Start(); return label; } }

    Read the article

  • uitableview delegate methods are not called

    - by Sean
    hi all i got the problem that the tableview methods are not called the first time the tableview is shown. if switch back to the previous view and then click the button to show the tableview again, the methods are called this time. i've to say that i show an actionsheet while the tableview is loading. the actionsheet i call in the ViewWillAppear method. thanks in advance sean

    Read the article

  • Having trouble with extension methods for byte arrays

    - by Dave
    I'm working with a device that sends back an image, and when I request an image, there is some undocumented information that comes before the image data. I was only able to realize this by looking through the binary data and identifying the image header information inside. I've been able to make everything work fine by writing a method that takes a byte[] and returns another byte[] with all of this preamble "stuff" removed. However, what I really want is an extension method so I can write image_buffer.RemoveUpToByteArray(new byte[] { 0x42, 0x4D }); instead of byte[] new_buffer = RemoveUpToByteArray( image_buffer, new byte[] { 0x42, 0x4D }); I first tried to write it like everywhere else I've seen online: public static class MyExtensionMethods { public static void RemoveUpToByteArray(this byte[] buffer, byte[] header) { ... } } but then I get an error complaining that there isn't an extension method where the first parameter is a System.Array. Weird, everyone else seems to do it this way, but okay: public static class MyExtensionMethods { public static void RemoveUpToByteArray(this Array buffer, byte[] header) { ... } } Great, that takes now, but still doesn't compile. It doesn't compile because Array is an abstract class and my existing code that gets called after calling RemoveUpToByteArray used to work on byte arrays. I could rewrite my subsequent code to work with Array, but I am curious -- what am I doing wrong that prevents me from just using byte[] as the first parameter in my extension method?

    Read the article

  • Static route works on one computer, not the other

    - by Dan
    I have been struggling with this for a couple days now, maybe I just need some people with a fresh perspective to figure out what the issue is. Basically I have a bunch of computers that are being routed through a specific gateway in order to access a web page that is hosted internally on a separate subnet. I set up static routes on all of the computers, and they all work... except one. Here's what a route print -4 looks like for a working computer (Windows 7): =========================================================================== Interface List 14...xx xx xx xx xx xx ......Broadcom 802.11n Network Adapter 11...xx xx xx xx xx xx ......Realtek PCIe GBE Family Controller 1...........................Software Loopback Interface 1 12...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter 13...00 00 00 00 00 00 00 e0 Microsoft 6to4 Adapter 17...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface =========================================================================== IPv4 Route Table =========================================================================== Active Routes: Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 10.xxx.xxx.230 10.xxx.xxx.94 20 10.zzz.zzz.0 255.255.255.0 10.xxx.xxx.147 10.xxx.xxx.94 21 10.xxx.xxx.0 255.255.255.0 On-link 10.xxx.xxx.94 276 10.xxx.xxx.94 255.255.255.255 On-link 10.xxx.xxx.94 276 10.xxx.xxx.255 255.255.255.255 On-link 10.xxx.xxx.94 276 127.0.0.0 255.0.0.0 On-link 127.0.0.1 306 127.0.0.1 255.255.255.255 On-link 127.0.0.1 306 127.255.255.255 255.255.255.255 On-link 127.0.0.1 306 224.0.0.0 240.0.0.0 On-link 127.0.0.1 306 224.0.0.0 240.0.0.0 On-link 10.xxx.xxx.94 276 255.255.255.255 255.255.255.255 On-link 127.0.0.1 306 255.255.255.255 255.255.255.255 On-link 10.xxx.xxx.94 276 =========================================================================== Persistent Routes: Network Address Netmask Gateway Address Metric 10.zzz.zzz.0 255.255.255.0 10.xxx.xxx.147 1 =========================================================================== And here's a route print -4 from the station that doesn't work (also Windows 7): =========================================================================== Interface List 10...xx xx xx xx xx xx ......Realtek PCIe GBE Family Controller 1...........................Software Loopback Interface 1 12...00 00 00 00 00 00 00 e0 Microsoft 6to4 Adapter 14...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2 16...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface =========================================================================== IPv4 Route Table =========================================================================== Active Routes: Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 10.xxx.xxx.230 10.xxx.xxx.132 276 10.zzz.zzz.0 255.255.255.0 10.xxx.xxx.147 10.xxx.xxx.132 21 10.xxx.xxx.0 255.255.255.0 On-link 10.xxx.xxx.132 276 10.xxx.xxx.132 255.255.255.255 On-link 10.xxx.xxx.132 276 10.xxx.xxx.255 255.255.255.255 On-link 10.xxx.xxx.132 276 127.0.0.0 255.0.0.0 On-link 127.0.0.1 306 127.0.0.1 255.255.255.255 On-link 127.0.0.1 306 127.255.255.255 255.255.255.255 On-link 127.0.0.1 306 224.0.0.0 240.0.0.0 On-link 127.0.0.1 306 224.0.0.0 240.0.0.0 On-link 10.xxx.xxx.132 276 255.255.255.255 255.255.255.255 On-link 127.0.0.1 306 255.255.255.255 255.255.255.255 On-link 10.xxx.xxx.132 276 =========================================================================== Persistent Routes: Network Address Netmask Gateway Address Metric 10.zzz.zzz.0 255.255.255.0 10.xxx.xxx.147 1 =========================================================================== Both of these stations are running Windows 7. So essentially what I am trying to do here is route all traffic to the 10.zzz.zzz.0 subnet through the 10.xxx.xxx.147 gateway. Everything else should go through the 10.xxx.xxx.230 gateway. This is the intended behavior, and again it is working everywhere but that one station. I noticed that the Active Route metric costs differ between the two stations, but I am new to the routing table and I am not sure how that is impacting the behavior. I hope I have been able to explain the situation clearly. Any help would be much appreciated. I can provide any additional information if needed!

    Read the article

  • code style for private methods in c#

    - by illdev
    I just found out, that it seems a common pattern to user UpperFirstLetterPascalCase() for private methods. I for myself, find this completely inconsistent with naming rules of private instance fields and variables and I find it difficult to read/debug, too. I would want to ask, why using a first upper letter for methods could be a better choice than a first lower (doThis())? Just out of curiosity...

    Read the article

  • non-static method setPrzechowaj(java.lang.String) cannot be referenced froma a static context

    - by bigbluedragon
    hey i have problem with JDialogForm. I have created it using netbeans 6.8. That JDialogForm have textfield and button below it. and here is some code... private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { String sciezka = jTextField1.getText(); if (sciezka.length() > 0) { Zmienne_pomocnicze.setPrzechowaj(sciezka); } } Now i want to copy that string "sciezka" to my main window but if I do it like this public class Zmienne_pomocnicze { public String n; public void setPrzechowaj (String neew) { n = neew; } public String getPrzechowaj () { return n; } } i get error in jButton1: non-static method setPrzechowaj(java.lang.String) cannot be referenced froma a static context any ideas?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >