Search Results

Search found 15218 results on 609 pages for 'private ips'.

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

  • Closest Ruby representation of a 'private static final' and 'public static final' class variable in

    - by Hosh
    Given the Java code below, what's the closest you could represent these two static final variables in a Ruby class? And, is it possible in Ruby to distinguish between private static and public static variables as there is in Java? public class DeviceController { ... private static final Device myPrivateDevice = Device.getDevice("mydevice"); public static final Device myPublicDevice = Device.getDevice("mydevice"); ... public static void main(String args[]) { ... } }

    Read the article

  • Error code while trying to use private variables in a function

    - by Cortopasta
    I get an error that says Parse error: syntax error, unexpected T_PRIVATE in E:\PortableApps\xampp\htdocs\SN\AC\ACclass.php on line 6 while trying to run my script. I'm new to classes in PHP and was wondering if someone could point out my error. Here's the code for that part. <?php class ac { public function authentication() { private $plain_username = $_POST['username']; private $md5_password = md5($_POST['password']); $ac = new ac();

    Read the article

  • functional test for rails controller private method

    - by mohit
    I have a private method in my controller. which is used for some database update. this method i am calling from another controller method. and it works fine. But when i am trying to write a test case for that method then It is tripping on accessing (session variable and params) in my functional all other methods are working fine the problem is only with private method? In my setup method in functional test, I am setting session also.?

    Read the article

  • final and private static

    - by xdevel2000
    I read that doing: public final void foo() {} is equals to: private static void foo() {} both meaning that the method is not overridable! But I don't see the equivalence if a method is private it's automatically not accessible...

    Read the article

  • Are private members inherited in C#?

    - by Petr
    Just seen one tutorial saying that: Class Dog { private string Name; } Class SuperDog:Dog { private string Mood; } Then there was an UML displaying that SuperDog will inherit Name as well. I have tried but to me it seems that only public members are inherited. At least I could not access Name unless it was declared as public.

    Read the article

  • C# - are private members inherited?

    - by Petr
    Hi, Just seen one tutorial saying that: Class Dog { private string Name; } Class SuperDog:Dog { private string Mood; } Then there was an UML displaying that SuperDog will inherit Name as well. I have tried but to me it seems that only public members are inherited. At least I could not access Name unless it was declared as public. Thanks

    Read the article

  • Best way to setup hosts, subdomains, and IPs [closed]

    - by LynnOwens
    I own a domain, let's call it mydomain.com. I need to host the following off it: forums.mydomain.com www.mydomain.com blog.mydomain.com objects.mydomain.com I believe I can get 5 static IPs. I plan on assigning one each to those four hosts. Then I need to adhoc create names, all below objects.mydomain.com. For instance: one.objects.mydomain.com two.objects.mydomain.com three.objects.mydomain.com I need to create these names programatically, and without human intervention. Preferably, they would not get their own IPs. They would use the IP of objects.mydomain.com. First question: Does this mean that I need to host my own DNS? Second question: I'm using Apache as a web server. What does the virtual host configuration look like? I was experimenting with the following to understand how routing on domain names works and I always ended up at www. <VirtualHost *:80> ServerAdmin [email protected] ServerName www.mydomain.com ServerAlias www.mydomain.com DocumentRoot "E:/Static/www" RewriteEngine On RewriteRule ^(/www/.*) /www$1 </Virtualhost> <VirtualHost *:80> ServerAdmin [email protected] ServerName forums.mydomain.com ServerAlias forums.mydomain.com DocumentRoot "E:/Static/forums" RewriteEngine On RewriteRule ^(/forums/.*) /forums$1 </Virtualhost>

    Read the article

  • Why do we need private variables?

    - by rak
    Why do we need private variables in classes in the context of programming? Every book on programming I've read says this is a private variable, this is how you define it but stops there. The wording of these explanations always seemed to me like we really have a crisis of trust in our profession. The explanations always sounded like other programmers are out to mess up our code. Yet, there are many programming languages that do not have private variables. What do private variables help prevent? How do you decide if a particular of properties should be private or not? If by default every field SHOULD be private then why are there public data members in a class? Under what circumstances should a variable be made public?

    Read the article

  • Tuple struct constructor complains about private fields

    - by Grubermensch
    I am working on a basic shell interpreter to familiarize myself with Rust. While working on the table for storing suspended jobs in the shell, I have gotten stuck at the following compiler error message: tsh.rs:8:18: 8:31 error: cannot invoke tuple struct constructor with private fields tsh.rs:8 let mut jobs = job::JobsList(vec![]); ^~~~~~~~~~~~~ It's unclear to me what is being seen as private here. As you can see below, both of the structs are tagged with pub in my module file. So, what's the secret sauce? tsh.rs use std::io; mod job; fn main() { // Initialize jobs list let mut jobs = job::JobsList(vec![]); loop { /*** Shell runtime loop ***/ } } job.rs use std::fmt; pub struct Job { jid: int, pid: int, cmd: String } impl fmt::Show for Job { /*** Formatter ***/ } pub struct JobsList(Vec<Job>); impl fmt::Show for JobsList { /*** Formatter ***/ }

    Read the article

  • J2ME private folder(only accessible to my midlet)

    - by Shankar
    I have two midlets, one will download some files form server everyday and the other uses these files. If i download the files to a normal folder the mobile user may delete the folder or files manually. So i need a private folder which is hidden and only accessible for my midlets. I heard about private folders which symbian platform provides for each application which are not accessible to users. I need such a folder for my j2me app. How to create such folder?? Shankar

    Read the article

  • How to Access a Private Variable?

    - by SoulBeaver
    This question isn't meant to sound as blatantly insulting as it probably is right now. This is a homework assignment, and the spec sheet is scarce and poorly designed to say the least. We have a function: double refuel( int liter, GasStation *gs ) { // TODO: Access private variable MaxFuel of gs and decrement. } Sound simple enough? It should be, but the class GasStation comes with no function that accesses the private variable MaxFuel. So how can I access it anyway using the function refuel? I'm not considering creating a function setFuel( int liter ) because the teacher always complains rather energetically if I change his specification. So... I guess I have to do some sort of hack around it, but I'm not sure how to go about this without explicitely changing the only function in GasStation and giving it a parameter so that I can call it here. Any hints perhaps?

    Read the article

  • A pragmatic view on private vs public

    - by Denis Gorbachev
    Hello everybody! I've always wondered on the topic of public, protected and private properties. My memory can easily recall times when I had to hack somebody's code, and having the hacked-upon class variables declared as private was always upsetting. Also, there were (more) times I've written a class myself, and had never recognized any potential gain of privatizing the property. I should note here that using public vars is not in my habit: I adhere to the principles of OOP by utilizing getters and setters. So, what's the whole point in these restrictions?

    Read the article

  • delegating into private parts

    - by FredOverflow
    Sometimes, C++'s notion of privacy just baffles me :-) class Foo { struct Bar; Bar* p; public: Bar* operator->() const { return p; } }; struct Foo::Bar { void baz() { std::cout << "inside baz\n"; } }; int main() { Foo::Bar b; // error: 'struct Foo::Bar' is private within this context Foo f; f->baz(); // fine } Since Foo::Bar is private, I cannot declare b in main. Yet I can call methods from Foo::Bar just fine. Why the hell is this allowed? Was that an accident or by design?

    Read the article

  • .NET Properties - Use Private Set or ReadOnly Property?

    - by tgxiii
    In what situation should I use a Private Set on a property versus making it a ReadOnly property? Take into consideration the two very simplistic examples below. First example: Public Class Person Private _name As String Public Property Name As String Get Return _name End Get Private Set(ByVal value As String) _name = value End Set End Property Public Sub WorkOnName() Dim txtInfo As TextInfo = _ Threading.Thread.CurrentThread.CurrentCulture.TextInfo Me.Name = txtInfo.ToTitleCase(Me.Name) End Sub End Class // ---------- public class Person { private string _name; public string Name { get { return _name; } private set { _name = value; } } public void WorkOnName() { TextInfo txtInfo = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo; this.Name = txtInfo.ToTitleCase(this.Name); } } Second example: Public Class AnotherPerson Private _name As String Public ReadOnly Property Name As String Get Return _name End Get End Property Public Sub WorkOnName() Dim txtInfo As TextInfo = _ Threading.Thread.CurrentThread.CurrentCulture.TextInfo _name = txtInfo.ToTitleCase(_name) End Sub End Class // --------------- public class AnotherPerson { private string _name; public string Name { get { return _name; } } public void WorkOnName() { TextInfo txtInfo = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo; _name = txtInfo.ToTitleCase(_name); } } They both yield the same results. Is this a situation where there's no right and wrong, and it's just a matter of preference?

    Read the article

  • web.config to redirect except some given IPs

    - by Alvin
    I'm looking for a web.config which is equivalent as the .htaccess file below. <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REMOTE_HOST} !^123\.123\.123\.123 RewriteCond %{REMOTE_HOST} !^321\.321\.321\.321 RewriteCond %{REQUEST_URI} !/coming-soon\.html$ RewriteRule (.*)$ /coming-soon.html [R=302,L] </IfModule> Which redirects everyone to a coming soon page except for the given IPs. Unfortunately I'm not familiar with IIS. Thank you

    Read the article

  • IPS Package Groups

    - by Alan_Solaris_RE
    IPS group packages consist solely of dependencies on other packages that make up a logical grouping of software. These are similar to, but not the equivalent of, Solaris 10 metaclusters. The main difference is that metaclusters are nested subsets ranging from a minimal install to nearly all packages on the media. Group packages have no such hierarchy. They can overlap other groups, or be completely disjoint sets. A group dependency is set this way in an IPS package manifest file: depend fmri=full/pkg/name type=group Current Solaris Groups Solaris currently has 4 system groups defined. These are used for different types of installation, and are included in the xml manifest files used by the various Solaris installers: Package Name Summary Description Default Installation For:  group/system/solaris-desktop Oracle Solaris Desktop Provides an Oracle Solaris desktop environment Live Media  group/system/solaris-large-server Oracle Solaris Large Server Provides an Oracle Solaris large server environment Text Installer  group/system/solaris-small-server Oracle Solaris Small Server Provides a useful command-line Oracle Solaris environment  Zones  group/system/solaris-auto-install  Oracle Solaris Automated Installer Client  Provides an Oracle Solaris Automated Installer client  Automated Installer There are also several "feature" groups such as AMP and GNU Developer Tools. These are provided for convenience, but are not used directly by any installers. Retrieving Group Package Information A listing of all current groups can be found with the command: pkg info -r group/* A listing of all the packages in a group can be obtained with: pkg contents -o fmri -H -rt depend -a type=group groupname An example: $ pkg contents -o fmri -H -rt depend -a type=group solaris-desktop archiver/gnu-tar audio/audio-utilities codec/flac codec/libtheora codec/ogg-vorbis codec/speex communication/im/pidgin etc. You can determine which package group is currently installed on your system: $ pkg list group/system/\* Output would look like: NAME (PUBLISHER) VERSION IFO group/system/solaris-desktop 0.5.11-0.175.0.0.0.0.0 i-- Note that there are not version numbers associated with a group package dependency. The package version that best fits the system will be used, based on other dependencies such as what is listed in incorporation files. Installing a Group To Install a group, simple use the group package name as you would any other package: $ pkg install solaris-small-server  If you want to exclude a package from installing, you can use the --reject flag: $ pkg install --reject audio/audio-utilities solaris-desktop Creating Your Own Group To create your own group package, you can follow the pkg(5) documentation on how to create a package, and use this action for each package that is part of your group:   depend fmri=full/pkg/name type=group

    Read the article

  • private class calling a method from its outer class

    - by oxinabox.ucc.asn.au
    Ok, so I have a class for a "Advanced Data Structure" (in this case a kinda tree) SO I implimented a Iterator as a private class with in it. So the iterator needs to implement a remove function to remove the last retuirned element. now my ADT already impliments a remove function, and in this case there is very little (thinking about it, i think nothing) to be gain by implimenting a different remove function for the iterator. so how do I go about calling the remove from my ADT sketch of my struture: public class ADT { ... private class ADT_Iterator impliments java.util.Itorator{ ... public void remove(){ //where I want to call the ADT's remove function from } ... public void remove( Object paramFoo ) { ... } ... } So just calling remove(FooInstance) won't work (will it?) and this.remove(FooInstance) is the same thing. what do i call? (and changign the name of the ADT's remove function is not an option, as that AD T has to meet an Interace wich I am note at liberty to change) I could make both of them call a removeHelper functon, I guess...

    Read the article

  • class modifier issues in C# with "private" classes

    - by devoured elysium
    I had a class that had lots of methods: public class MyClass { public bool checkConditions() { return checkCondition1() && checkCondition2() && checkCondition3(); } ...conditions methods public void DoProcess() { FirstPartOfProcess(); SecondPartOfProcess(); ThirdPartOfProcess(); } ...process methods } I identified two "vital" work areas, and decided to extract those methods to classes of its own: public class MyClass { private readonly MyClassConditions _conditions = new ...; private readonly MyClassProcessExecution = new ...; public bool checkConditions() { return _conditions.checkConditions(); } public void DoProcess() { _process.DoProcess(); } } In Java, I'd define MyClassConditions and MyClassProcessExecution as package protected, but I can't do that in C#. How would you go about doing this in C#? Setting both classes as inner classes of MyClass? I have 2 options: I either define them inside MyClass, having everything in the same file, which looks confusing and ugly, or I can define MyClass as a partial class, having one file for MyClass, other for MyClassConditions and other for MyClassProcessExecution. Defining them as internal? I don't really like that much of the internal modifier, as I don't find these classes add any value at all for the rest of my program/assembly, and I'd like to hide them if possible. It's not like they're gonna be useful/reusable in any other part of the program. Keep them as public? I can't see why, but I've let this option here. Any other? Name it! Thanks

    Read the article

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