Search Results

Search found 24293 results on 972 pages for 'static ip'.

Page 28/972 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • Java: startingPath as "public static final" exception

    - by HH
    [Updated] Thanks to polygenelubricants's reply, the real problem is the exception from the method getCanonicalPath() because I cannot include try-catch-loop there. $ cat StartingPath.java import java.util.*; import java.io.*; public class StartingPath { public static final String startingPath = (new File(".")).getCanonicalPath(); public static void main(String[] args){ System.out.println(startingPath); } } $ javac StartingPath.java StartingPath.java:5: unreported exception java.io.IOException; must be caught or declared to be thrown public static final String startingPath = (new File(".")).getCanonicalPath(); ^ 1 error

    Read the article

  • Returning in a static initializer

    - by Martijn Courteaux
    Hello, This isn't valid code: public class MyClass { private static boolean yesNo = false; static { if (yesNo) { System.out.println("Yes"); return; // The return statement is the problem } System.exit(0); } } This is a stupid example, but in a static class constructor we can't return;. Why? Are there good reasons for this? Does someone know something more about this? So the reason why I should do return is to end constructing there. Thanks

    Read the article

  • Finding C++ static initialization order problems

    - by Fred Larson
    We've run into some problems with the static initialization order fiasco, and I'm looking for ways to comb through a whole lot of code to find possible occurrences. Any suggestions on how to do this efficiently? Edit: I'm getting some good answers on how to SOLVE the static initialization order problem, but that's not really my question. I'd like to know how to FIND objects that are subject to this problem. Evan's answer seems to be the best so far in this regard; I don't think we can use valgrind, but we may have memory analysis tools that could perform a similar function. That would catch problems only where the initialization order is wrong for a given build, and the order can change with each build. Perhaps there's a static analysis tool that would catch this. Our platform is IBM XLC/C++ compiler running on AIX.

    Read the article

  • Returning in a static class constructor

    - by Martijn Courteaux
    Hello, This isn't valid code: public class MyClass { private static boolean yesNo = false; static { if (yesNo) { System.out.println("Yes"); return; // The return statement is the problem } System.exit(0); } } This is a stupid example, but in a static class constructor we can't return;. Why? Are there good reasons for this? Does someone know something more about this? So the reason why I should do return is to end constructing there. Thanks

    Read the article

  • Why is this static routing not working ?

    - by geeko
    Greeting gurus, I'm trying to develop a DHCP enforcement extension like Microsoft NAP. My trick to block dynamic-IP requesting machines (that don't meet certain policy) is to strip the default gateway (no default gateway) stated in the IP lease and set the lease subnet mask to 255.255.255.255. Now I need the blocked machines to be able to reach some specific locations (IPs) on the network. To allow for this, I'm including some static routes in the lease. For example, I'm including 10.10.10.11 via router 10.10.10.254 (the one to which the blocked machine that needs to access 10.10.10.11 is connected). Unfortunately, as soon as I set the default gateway to nothing, blocked machines cannot reach any of the added static routes. I also tried classless static routes. Any ideas ? any one knows how MS NAP actually do it ? Geeko

    Read the article

  • Exposing headers on iPhone static library

    - by leolobato
    Hello guys, I've followed this tutorial for setting up a static library with common classes from 3 projects we are working on. It's pretty simple, create a new static library project on xcode, add the code there, a change some headers role from project to public. The tutorial says I should add my library folder to the header search paths recursively. Is this the right way to go? I mean, on my library project, I have files separated in folders like Global/, InfoScreen/, Additions/. I was trying to setup one LOKit.h file on the root folder, and inside that file #import everything I need to expose. So on my host project I don't need to add the folder recursively to the header search path, and would just #import "LOKit.h". But I couldn't get this to work, the host project won't build complaining about all the classes I didn't add to LOKit.h, even though the library project builds. So, my question is, what is the right way of exposing header files when I setup a Cocoa Touch Static Library project on xCode?

    Read the article

  • Static struct in C++

    - by pingvinus
    Hi, I want to define an structure, where some math constants would be stored. Here what I've got now: struct consts { //salt density kg/m3 static const double gamma; }; const double consts::gamma = 2350; It works fine, but there would be more than 10 floating point constants, so I doesn't want to wrote 'static const' before each of them. And define something like that: static const struct consts { //salt density kg/m3 double gamma; }; const double consts::gamma = 2350; It look fine, but I got these errors: 1. member function redeclaration not allowed 2. a nonstatic data member may not be defined outside its class I wondering if there any C++ way to do it?

    Read the article

  • c++ defining a static member of a template class with type inner class pointer

    - by Jack
    I have a template class like here (in a header) with a inner class and a static member of type pointer to inner class template <class t> class outer { class inner { int a; }; static inner *m; }; template <class t> outer <t>::inner *outer <t>::m; when i want to define that static member i says "error: expected constructor, destructor, or type conversion before '*' token" on the last line (mingw32-g++ 3.4.5)

    Read the article

  • C++ Class Static variable problem - C programmer new to C++

    - by Microkernel
    Hi guys, I am a C programmer, but had learnt C++ @school longtime back. Now I am trying to write code in C++ but getting compiler error. Please check and tell me whats wrong with my code. typedef class _filter_session { private: static int session_count; /* Number of sessions count -- Static */ public: _filter_session(); /* Constructor */ ~_filter_session(); /* Destructor */ }FILTER_SESSION; _filter_session::_filter_session(void) { (this->session_count)++; return; } _filter_session::~_filter_session(void) { (this->session_count)--; return; } The error that I am getting is "error LNK2001: unresolved external symbol "private: static int _filter_session::session_count" (?session_count@_filter_session@@0HA)" I am using Visual Studio 2005 by the way. Plz plz help me. Regards, Microkernel

    Read the article

  • static setter method injection in Spring

    - by vishnu
    Hi, I have following requirement I wanted to pass http:\\localhost:9080\testws.cls value as setter injection through spring configuration file. How can i do this static variable setter injection for WSDL_LOCATION public class Code1 extends javax.xml.ws.Service { private final static URL CODE1_WSDL_LOCATION; static { URL url = null; try { url = new URL("http:\\localhost:9080\testws.cls"); } catch (MalformedURLException e) { e.printStackTrace(); } CODE1_WSDL_LOCATION = url; } public Code1(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } public Code1() { super(CODE1_WSDL_LOCATION, new QName("http://tempuri.org", "Code1")); } /** * * @return * returns Code1Soap */ @WebEndpoint(name = "Code1Soap") public Code1Soap getCode1Soap() { return (Code1Soap)super.getPort(new QName("http://tempuri.org", "Code1Soap"), Code1Soap.class); } } Please help me out.

    Read the article

  • Difference between static const char* and const char*.

    - by Will MacDonagh
    Could someone please explain the difference in how the 2 snippets of code are handled below? They definitely compile to different assembly code, but I'm trying to understand how the code might act differently. I understand that string literals are thrown into read only memory and are effectively static, but how does that differ from the explicit static below? struct Obj1 { void Foo() { const char* str( "hello" ); } }; and struct Obj2 { void Bar() { static const char* str( "hello" ); } };

    Read the article

  • default value for a static property

    - by Blitzz
    I like c#, but why can I do : public static bool Initialized { private set; get; } or this : public static bool Initialized = false; but not a mix of both in one line ? I just need to set access level to my variable (private set), and I need it set at false on startup. I wouldn't like to make that boring private _Initialized variable, which would be returned by the getter of the public Initialized var. I like my code to be beautiful. (NB: my variable is static, it can't be initialized in the constructor). Thanks

    Read the article

  • template static classes across dynamic linked libraries

    - by user322274
    Hello, I have a templated class with a static value, like this: template <class TYPE> class A{ static TYPE value; }; in the code of a dll I assign the static value: code of DLL_1 A<float>::value = 2.0; I wish the value to be shared by all the dlls I'm using, i.e. I want that: code of DLL_2 printf("value on DLL_2 %f",A<float>::value); print out "2.0" any clues? thx

    Read the article

  • Static variable for optimization

    - by keithjgrant
    I'm wondering if I can use a static variable for optimization: public function Bar() { static $i = moderatelyExpensiveFunctionCall(); if ($i) { return something(); } else { return somethingElse(); } } I know that once $i is initialized, it won't be changed by by that line of code on successive calls to Bar(). I assume this means that moderatelyExpensiveFunctionCall() won't be evaluated every time I call, but I'd like to know for certain. Once PHP sees a static variable that has been initialized, does it skip over that line of code? In other words, is this going to optimize my execution time if I make a lot of calls to Bar(), or am I wasting my time?

    Read the article

  • Use nested static class as ActionListener for the Outer class

    - by Digvijay Yadav
    I want to use an nested static class as an actionListener for the enclosing class's GUI elements. I did something like this: public class OuterClass { public static void myImplementation() { OuterClass.StartupHandler startupHandler = new OuterClass.StartupHandler(); exitMenuItem.addActionListener(startupHandler); // error Line } public static class StartupHandler implements ActionListener { @Override public void actionPerformed(ActionEvent e) { //throw new UnsupportedOperationException("Not supported yet."); if (e.getSource() == exitMenuItem) { System.exit(1); } else if (e.getSource() == helpMenuItem) { // show help menu } } } } But when I invoke this code I get the NullPointerException at the //error Line. Is this the right method to do do this or there is something I did am missing?

    Read the article

  • Are static members inherited? (C++)

    - by Keand64
    When static members are inherited, are they static for the entire heirarchy, or just that class, ie: class SomeClass { public: SomeClass(){total++;} static int total; }; class SomeDerivedClass: public SomeClass { public: SomeDerivedClass(){total++;} }; int main() { SomeClass A; SomeClass B; SomeDerivedClass C; return 0; } would total be 3 in all three instances, or would it be 2 for SomeClass and 1 for SomeDerivedClass?

    Read the article

  • Java synchronizing static list ?

    - by JavaUser
    Hi, In a Java class , i am having a static list so this list is shared across all the objects of this class.The business logic in this class will run periodically which is invoked by some method with out passing instance parameters.Now I want to invoke this run method based on the list(I will add some vales into this list based on JMS) ,this list may empty sometimes and after finishing the run , i am emptying this list.Now my question is , whether I need to synchronize this list or not? Also let me know is there any other way to pass value in one object instance(Thread1) to other object instance (Thread2) other than having Static variable(static list)? Thx

    Read the article

  • Asp.net static object behaviour

    - by Circadian
    I have the following class as part of an asp.net application. public sealed class SomeClass { private static string appId = Guid.NewGuid().ToString(); public static ReadSomethingFromDb(){} public static WriteSomethingToDb(){} } There are more than one application instances in the same application pool, and they all access the same database. I want the operations performed by the above class to be uniquely tied to the instance that performed it, hence the use of the appId. So adding a record to the database would for example contain a name, address and appId. This has been simplified for discussion purposes. Assuming that I have two instances running at mysite.a and mysite.b the above class would generate two different guids. My problem is that mysite.a sometimes produces more than one guid, which is unexpected. Thank you in advance

    Read the article

  • Trigger IP ban based on request of given file?

    - by Mike Atlas
    I run a website where "x.php" was known to have vulnerabilities. The vulnerability has been fixed and I don't have "x.php" on my site anymore. As such with major public vulnerabilities, it seems script kiddies around are running tools that hitting my site looking for "x.php" in the entire structure of the site - constantly, 24/7. This is wasted bandwidth, traffic and load that I don't really need. Is there a way to trigger a time-based (or permanent) ban to an IP address that tries to access "x.php" anywhere on my site? Perhaps I need a custom 404 PHP page that captures the fact that the request was for "x.php" and then that triggers the ban? How can I do that? Thanks! EDIT: I should add that part of hardening my site, I've started using ZBBlock: This php security script is designed to detect certain behaviors detrimental to websites, or known bad addresses attempting to access your site. It then will send the bad robot (usually) or hacker an authentic 403 FORBIDDEN page with a description of what the problem was. If the attacker persists, then they will be served up a permanently reccurring 503 OVERLOAD message with a 24 hour timeout. But ZBBlock doesn't do quite exactly what I want to do, it does help with other spam/script/hack blocking.

    Read the article

  • Where should I host my static websites, preferably with pay as you go pricing? [duplicate]

    - by Peter
    This question already has an answer here: How to find web hosting that meets my requirements? 4 answers I have many static websites that I want to host, they only have html, css, js files and images. I'm looking for a simple hosting solution preferably with pay as you pricing, my sites don't have any traffic yet, but I'm expecting high traffic on some of them. So what hosting solution should I be looking for ?

    Read the article

  • How can I move a library inside a project's source tree and compiling static binaries?

    - by AbrahamVanHelpsing
    How can I move a library inside a project's source tree and compiling static binaries? I want to use a particular tool that utilizes ANCIENT binaries without upgrading it's API usage. This way I can use the old libraries inside the single binary without wrecking the local host environment. I am on nix with netbeans/eclipse/code::blocks. I don't have a problem reading, just looking for a starting point. Any thoughts?

    Read the article

  • How to jump through an IP ad in firefox?

    - by chris
    I use firefox with a lot of anti-ad extension, like adblock, NoScript, Ghosty etc. I found this IP 220.191.158.69 always in the list of NoScript, I want to ban this IP. I have checked it, searched it. It is from China telecom damn Ad. I guess NoScript can ban this IP already, but When I do not allow that IP, sometimes a webpage can not be loaded at first time, I need to refresh two or more times. I hate it... So I hope there are some way or browser extensions or script can jump through this damn IP.

    Read the article

  • nginx not serving admin static files?

    - by toto_tico
    First, I want to clarify that this error is just for the admin static files. This means my problem is specific just to the static files that corresponds to the Django admin. The rest of the static files are working perfect. Basically my problem is that for some reason I cannot access those admin static files with the ngix server. It works perfect with the micro server of Django and the collect static is doing its job. This means it is putting the files on the expected place in the static folder. The urls are correct but I cannot even access the admin static files directly, but the others I can. So, for example, I am able to access this url (copying it in the browser): myserver.com:8080/static/css/base/base.css but i am not able to access this other url (copying it in the browser): myserver.com:8080/static/admin/css/admin.css I also tried to copy the admin/ directory structure into other_admin_directory_name/. Then I can access myserver.com:8080/static/other_admin_directory_name/css/admin.css Then, it works. So, I checked permissions and everything is fine. I tried to change ADMIN_MEDIA_PREFIX = '/static/admin/' to ADMIN_MEDIA_PREFIX = '/static/other_admin_directory_name/', it doesn't work. This a mistery in itself that I am exploring but still no luck. Finally, and it seems to be an important clue: I tried to copy the admin/ directory structure into admin_and_then_any_suffix/. Then I cannot access myserver.com:8080/static/admin_and_then_any_suffix//css/admin.css So, if the name of the directory starts with admin (for example administration or admin2) it doesn't work. * added thanks to sarnold observation ** the problem seems to be in the nginx configuration file /etc/nginx/sites-available/mysite location /static/admin { alias /home/vl3/.virtualenvs/vl3/lib/python2.7/site-packages/django/contrib/admin/media/; }

    Read the article

  • How to find ip address of my Asus RT-AC86U in Access Point mode?

    - by WilliamKF
    I'm using an Asus wireless router model RT-AC68U and can connect fine to the internet using it wirelessly. I configured the router to be an Access Point, but having done so, I can no longer locate the GUI to adjust the router as I have no idea what its IP Address is anymore. The router is plugged into a cable modem and router which is a model SMCD3G is a business class gateway labeled Comcast Business IP Gateway. This gateway is assigning ip addresses in the range 10.1.10.XX and I went to the web interface at 10.1.10.1 and listed the connected devices and see my laptop which is connected to the Asus access point along with a few other devices, but none of the devices listed are the Asus router (I tried all the six ip addresses listed). How can I determine the IP Address of my Asus router in access point mode so I can see the GUI interface again to control the router other than by doing a factory reset?

    Read the article

  • Is there any IP which refers to the internet?

    - by victorferreira
    Hello, guys, good morning. 127.0.0.1 is the local IP, isnt it? Is there a IP that I can use in order to refer to the any user in the internet? The thing is: i want to block a specific file to be accessed by the internet using IIS6. but i doesnt show me a clear way to do this. But i can define some security rules, for example: give IP restrictions for some file. So, i can deny for everybody (using that IP i am asking about) and allow for the internal IP. any suggestions?

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >