Trouble understanding static

Like the topic says, I do use it (actually I have to for the GUIs or they don't compile), but I really don't understand too much about them (what they allow, what they limit) and the definition on java.sun is not very clear to me. Could someone please give me a brief explanation on this subject and maybe an example?

public class Test {
    private String myName = "My name is . . .!";  //private variable of class Test
  public static void main(String[] argv)   //is static because the runtime environment needs to call this first, before making any objects, so it's not essential for your class, just gives you a way of running your code from within your class itself
    String theNameMainGets = "";  //main will receive the name in this
    Test testThis = new Test();  //make an instance without a name
    Test testThisWithAName = new Test("nogoodatcoding"); //pass a cool name to the constructor :D
    //theNameMainGets = whatIsMyName(); //will not work since main is static, so even though it is part of the same class, it cannot call a non-static member, whatIsMyName, because a copy of that is with every instance, and when main calls it, the instance may not exist
    theNameMainGets = testThis.whatIsMyName(); //correct way to access the non-static member, by creating an instance and then using that to access it
    System.out.println(theNameMainGets);
    theNameMainGets = testThisWithAName.whatIsMyName();
    System.out.println(theNameMainGets);
    //note, you can't say, testThis.myName; since myName is private to testThis.
Test()
      myName = "No one named me";
Test( String newName )
      myName = newName;
    public String whatIsMyName()
      return myName;
}Hope this helps

Similar Messages

  • Trouble understanding static objects

    Hello,
    I have trouble understanding static objects.
    1)
    class TestA
    public static HashMap h = new HashMap();
    So if I add to TestA.h from within a Servlet, this is not a good idea, right?
    But if I just read from it, that is ok, right?
    2)
    class TestB
    public static SimpleDateFormat df = new SimpleDateFormat();
    What about TestB.df from within a Servlet? Is this ok?
    example: TestB.df.format(new Date(1980, 1, 20));

    There is exactly one instance of a static member for every instance of a class. It is okay to use static members in a servlet if they are final, or will not change. If they may change, it is a bad idea. Every call to a servlet launches a new thread. When there are multiple calls, there are multiple threads. If each of these threads are trying to make changes to the static memeber, or use the static memeber while changes are being made, the servelt could give incorrect results.
    I hope that helped..
    Thanks
    Cardwell

  • Have Trouble understanding the runnable interface

    Hi
    I am new to java programming. I have trouble understanding threading concepts.When I run the below code,Thread3 runs first. I need a small clarification here- I created two thread objects
    Thread thread1=new Thread(new RunnableThread(),"thread1");
    Thread thread2=new Thread(new RunnableThread(),"thread2");
    As soon as I create these objects -Will the constructor with the string argument in the "RunnableThread" class gets invoked. If so why doesn't System.out.println(runner.getName()); get invoked for the above objects. what is the sequence of execution for the below program.
    /*************CODE****************************/
    class RunnableThread implements Runnable
         Thread runner;
         public RunnableThread()
         public RunnableThread(String threadName)
              runner=new Thread(this,threadName);          //Create a new Thread.
              System.out.println(runner.getName());
              runner.start();          //Start Thread
         public void run()
              //Display info about this particular Thread
              System.out.println(Thread.currentThread());
    public class RunnableExample
         public static void main(String argv[])
              Thread thread1=new Thread(new RunnableThread(),"thread1");
              Thread thread2=new Thread(new RunnableThread(),"thread2");
              RunnableThread thread3=new RunnableThread("thread3");
              //start the threads
              thread1.start();
              thread2.start();
              try
                   //delay for one second
                   Thread.currentThread().sleep(1000);
              catch (InterruptedException e)
              //Display info about the main thread
              System.out.println(Thread.currentThread());
    }

    srinivasaditya wrote:
    Hi
    I am new to java programming. I have trouble understanding threading concepts.I'd consider it to be an advanced area.
    When I run the below code,Thread3 runs first. I need a small clarification here- I created two thread objects
    Thread thread1=new Thread(new RunnableThread(),"thread1");
    Thread thread2=new Thread(new RunnableThread(),"thread2");No, this is wrong. You don't need your RunnableThread. Runnable and Thread are enough. Your wrapper offers nothing of value.
    >
    As soon as I create these objects -Will the constructor with the string argument in the "RunnableThread" class gets invoked. If so why doesn't System.out.println(runner.getName()); get invoked for the above objects. what is the sequence of execution for the below program.did you run it and see? Whatever happens, that's the truth.
    %

  • Trouble Understanding Logic of Primes Program

    I am reading a book called Beginning Java 7, by Ivor Horton. In his book he has a primes calculation program. The code is below. I am having trouble understanding the logic of the program. I've stared at it for the past several hours with no luck. What I can't understand is how both i and j are both initialized to 2 but the if statement:
    if(i%j == 0) {
              continue OuterLoop;                                         
            }then passes a 2 to the println() function. I am totally lost on this problem. The program below outputs all of the prime numbers from 2 to 50 without any errors. Please help!
    Thank you.
    public class Primes2 {
      public static void main(String[] args) {
        int nValues = 50;                                                  // The maximum value to be checked
        // Check all values from 2 to nValues
        OuterLoop:
        for(int i = 2 ; i <= nValues ; ++i) {
          // Try dividing by all integers from 2 to i-1
          for(int j = 2 ;  j < i ; ++j) {
            if(i%j == 0) {                                                 // This is true if j divides exactly
              continue OuterLoop;                                          // so exit the loop
          // We only get here if we have a prime
          System.out.println(i);                                           // so output the value
    }Edited by: EJP on 27/03/2013 19:54: fixed all the bizarre formatting, spelling, and removed the even more bizarre comment marketers around the text. Please use standard English and its existing conventions here.

    Hi. I did notice that. What I don't understand is how 2 is outputted as a prime number when the Net Beans debugger shows that i's value is 3 in the if statement. Where does the value 2 come from? Thanks.
    Edited by: 996440 on Mar 27, 2013 3:07 PM

  • HT4623 I upgraded my iphone4S yesterday and Siri response with "having trouble understanding".  Is there an upgrade for Siri?

    I upgraded my iPhone4S to iOs6 and now Siri does not understand me.  Siri responses "having trouble understanding you, try again".  Is there an updgrade for Siri?  I have been searching all afternoon for a glimmer of a solution.  Any suggestions?

    Sure...
    See this Apple article for a Hard reset of a Factory reset.
    http://support.apple.com/kb/HT3728

  • Having trouble understanding Abstract class. Help!!!!!!

    Having trouble understanding Abstract class. when is Abstract class used and for what.

    Having trouble understanding Abstract class. when is
    Abstract class used and for what.An abstract class is used to force the developer to provide a subclass, to implement the abstract methods, while still keeping the methods that were provided.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Trouble understanding KMP algorithm

    If anyone is familiar with the KMP skip search algorithm and cares to shed some light on the subject. I am having trouble understanding how the table is derived, as many examples i come across seem to be using different variations. The table used to control the search.
    Thanks a million in advance, Mel

    JosAH wrote:
    The failure function can be a bit of a burden to fully understand but realize that it gives you the next index of the string to search for if the current match for a prefix of the pattern failed. thats kind of what i wanted to hear lol, thanks both of you
    and i took ur advice, i did the whole example on pen and paper. i would be lieing if i said i fully understand it, but i do have a better understanding now.
    Mel

  • Major trouble understanding structure

    Hello,
    This is my first time creating a Photoshop Plugin, and I am having a lot of trouble understanding how to do it. I am using Microsoft MFC to create it. Does anybody know of good references or sample code to look at? I simply don't get how to create this!!!
    I am trying to do a filter plugin that will let the user select a particular color, and turn all other colour in the image to black and white.
    Thanks.

    There is one MFC sample in the SDK. It doesn't sound like you are having trouble with MFC per say but more about getting pixels in and out of Photohsop. Where exactly are you having troubles? Maybe the Dissolve sample will help you out but it uses OS (Win32) API's and not MFC.

  • Trying to understand Static methods

    Hi all,
    I am trying to learn a little bit about static methods and hope that someone here can help me understand it better. My understanding of static methods is that they exist only once (More like global methods). This tells me that usage of static methods should be used with care as they are likely to cause problems in cases where multiple users try to access a static object at the same time.
    I am looking at a piece of code that had me thinking for a bit. I cant post the code itself but here is an example of how the code is structured
    The first class declares a couple of non static arrays and makes them available via the getters and setters. It also has one method that calls a static method in another class.
    package com.tests.statictest;
    import java.util.ArrayList;
    public class ClassA{
         ArrayList arrayList1 = new ArrayList();
         ArrayList arrayList2 = new ArrayList();
         public ClassA(){
              arrayList1.add("TEST1");
              arrayList1.add("TEST2");
              arrayList2.add("Test3");
              arrayList2.add("Test4");
         ArrayList getArrayList1(){
              return arrayList1;
         ArrayList getArrayList2(){
              return arrayList2;
         ArrayList getJoinedArrayList(){
              return ClassB.joinArrays(arrayList1,arrayList2);
    }The second class contains the static method that is called by the above class to join the two arrays. This class is used by many other classes
    package com.tests.statictest;
    import java.util.ArrayList;
    public class ClassB{
         public static ArrayList joinArrays(ArrayList list1, ArrayList list2){
              ArrayList list3 = new ArrayList();
              list1.addAll(list2);
              return list1;
    }And here is my test class
    package com.tests.statictest;
    public class ClassC{
          public static void main(String args[]){
               ClassA classA = new ClassA();
              System.out.println(classA.getArrayList1());
              System.out.println(classA.getArrayList2());
              System.out.println(classA.getJoinedArrayList());
         }The output to the above program is shown below
    [TEST1, TEST2]
    [Test3, Test4]
    [TEST1, TEST2, Test3, Test4]My question for the above is that i am wondering if the above is safe. Can you think of situations where the above is not recommended. What exactly would happen if ten instances of ClassA threads are executed at the same time? Woulnt the static method in ClassB corrupt the data?

    ziggy wrote:
    Hi all,
    I am trying to learn a little bit about static methods and hope that someone here can help me understand it better. My understanding of static methods is that they exist only once (More like global methods). This tells me that usage of static methods should be used with care as they are likely to cause problems in cases where multiple users try to access a static object at the same time. There is no such thing as a "static object" in Java. The word "static" simply means "belonging to a class as a whole, rather than an individual instance."
    My question for the above is that i am wondering if the above is safe. Can you think of situations where the above is not recommended. What exactly would happen if ten instances of ClassA threads are executed at the same time?ClassA isn't a thread, so it can't be "executed", per se.
    Woulnt the static method in ClassB corrupt the data?"Staticness" doesn't have anything to do with it; the issue at hand is operations on a shared data structure, which is a concern whether you're dealing with static or non-static members. There is nothing inherent in ClassB that will "corrupt" anything, however.
    ~

  • Trouble understanding "BreakWithLabelDemo" (Sun Java Tutorial)

    Hi.
    I've been slowly working my way through all of the Sun Java tutorials, now I've come across one I just can't wrap my head around.
    It's the "BreakWithLabelDemo" tutorial located at [http://java.sun.com/docs/books/tutorial/java/nutsandbolts/branch.html] that is confusing me.
    class BreakWithLabelDemo {
        public static void main(String[] args) {
            int[][] arrayOfInts = { { 32, 87, 3, 589 },
                                    { 12, 1076, 2000, 8 },
                                    { 622, 127, 77, 955 }
            int searchfor = 12;
            int i;
            int j = 0;
            boolean foundIt = false;
        search:
            for (i = 0; i < arrayOfInts.length; i++) {
                for (j = 0; j < arrayOfInts.length; j++) {
    if (arrayOfInts[i][j] == searchfor) {
    foundIt = true;
    break search;
    if (foundIt) {
    System.out.println("Found " + searchfor +
    " at " + i + ", " + j);
    } else {
    System.out.println(searchfor
    + " not in the array");
    Now it's not understanding what the +break+ statement does that's the problem, it's the nested +for+ loops they've used to demonstrate it that is, and in particularly the code.arrayOfInts[i].length;Now, could someone please enlighten me as to what this statement returns to be evaluated against the variable +j+.
    For instance does it simply return the length of the array +arrayOfInts+ and if so why is it referencing a specific element within the array denoted by the variable +i+ ? Also the array is multidimensional when it's declared and initialized and yet it's treated as a regular array in the code above? Why doesn't that throw an error?
    Any help walking me through this piece of code would be fantastic. Thank you.
    -nexus                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    int[][] arrayOfInts = ...In effect arrayOfInts is a multidimensional array. But it's important to remember that Java has no notion of array dimension. It's just an array - an array consisting of three things in order: {32, 87, 3, 589}, {12, 1076, 2000, 8}, and {622, 127, 77, 955}. It just so happens that these elements are also arrays.
    Because it's just an array arrayOfInts also has a length. The length is three because there's three elements. It doesn't matter that each of the elements has a length 4, arrayOfInts has length 3.
    In this particular array the elements are also arrays, so it makes sense to ask what their length is. For instance, the last one, {622, 127, 77, 955}, is just arrayOfInts[2] and it has length 4. We can refer to its length as arrayOfInts[2].length and write code like:
    if(arrayOfInts[2].length == 4) {
        // this will be executed for the array in the example
    }Where arrays are multidimensional - in the sense that their elements are also arrays - they can be "ragged". For instance
    int[][] arrayOfInts = {
        {32, 87, 3, 589},
        {12},
        {622, 127, 77, 955, -1, 42, 5}
    };The array elements all have different lengths and that is why the inner for loop uses the expression j<arrayOfInts.length so that it loops through the correct number of elements of the i-th element of [i]arrayOfInts.

  • Understanding static ip route command

    Hi all,
    this is not a technical problem, I am just trying to understand how the static ip routes in the form:
    ip route vrf my_vrf 10.10.10.0 255.255.255.0 Te1/8/16
    will work.
    According to the CISCO documentation, the network 10.10.10.0/24 will be considered as a directly
    connected network, right? This sounds to me thet the router || layer 3 switch would send ARP "who-has"
    every time a packet should be delivered to some destination within 10.10.10.0/24 network.
    But if the interface Te1/8/16 has just a point-to-point connection to his peer and both even belong to some
    different network, say 192.168.1.0/30, who is going to answer the ARP request? Do we need to have
    an ARP proxy or.. is it going to work at all? (I have seen such configurations only in books not in real world)
    Unfortunately I do not have a test environment where i could just try this configuration,
    so your explanations || pointing to the right documentation will be highly appreciated!
    Thanks & regards,
    Yury Pakhomenko

    Hello Mahesh,
    You can use IP address as long as Tunnel IP addresses on both sides are in the same subnet. So in your case you can use
    ip route 101.101.101.101 255.255.255 13.13.13.3
    Or you can use the tunnel interface
    ip route 101.101.101.101 255.255.255 Tunnel0
    Although I have seen issues in some cases when the interface name is used instead of tunnel IP.
    Please rate this post if helpful.
    THanks
    Shaml

  • Network trouble assigning static IP, dhcpcd works but not static.

    I've tried static IP in rc.conf and assigning it manually.  When I assign it manually, and my gateway route, it shows up with static but doesn't talk on network.  Then I do a dhcpcd to the same NIC and viola, it gets assigned an IP on subnet I was specifying manually, only now it's talking once dhcpcd has been run.  However, it still doesn't see  (cannot ping) other IPs on my local network, only the internet!. 
    My local office network is DSL hooked up to a SonicWall gateway then a MS SBS 2011 server acting as local DNS and DC.  After trying every configuration and command I can find here in these forums, I can only get on the network using dhcpcd.  Also, on only a couple occasions I was able to ping the server by IP, but still can't get resolution from the local DNS.  I don't think it's because of my local network config, I have a solaris box that joins my local net and can ping any and everything on it as well as use the local DNS.
    Questions:
    1. Why does static IP assignment not work.  I've tried in rc.conf as well as "ip addr" and "ip route" commands, and made sure resolv.conf is good..  Only dhcpcd gets me connected.
    2. Why do I not get service from my local private network's DNS once dhcpcd gets me on the network? 
    3. And why can I not ping other IP's on my local network once dhcpcd get's me connected.
    (after a fresh boot)
    # ip addr
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
    2:
    eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
        link/ether 00:1b:21:d9:72:bc brd ff:ff:ff:ff:ff:ff
        inet 10.0.1.200/24 brd 10.0.1.255 scope global eth0
    3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
        link/ether 00:1b:21:d9:72:bd brd ff:ff:ff:ff:ff:ff
    4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
        link/ether 00:25:90:62:9a:ea brd ff:ff:ff:ff:ff:ff
    5: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
        link/ether 00:25:90:62:9a:eb brd ff:ff:ff:ff:ff:ff
    (after a manual ip addr add <IP> dev eth3, still no network connectivity)
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
    2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
        link/ether 00:1b:21:d9:72:bc brd ff:ff:ff:ff:ff:ff
        inet 10.0.1.200/24 brd 10.0.1.255 scope global eth0
    3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
        link/ether 00:1b:21:d9:72:bd brd ff:ff:ff:ff:ff:ff
    4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
        link/ether 00:25:90:62:9a:ea brd ff:ff:ff:ff:ff:ff
    5: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
        link/ether 00:25:90:62:9a:eb brd ff:ff:ff:ff:ff:ff
        inet 192.168.168.36/24 scope global eth3
    (so I do an ifconfig eth3 up, looks better, but still not talking on network)
    eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
            inet 10.0.1.200  netmask 255.255.255.0  broadcast 10.0.1.255
            ether 00:1b:21:d9:72:bc  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
            device memory 0xfa3e0000-fa400000 
    eth1: flags=4098<BROADCAST,MULTICAST>  mtu 1500  metric 1
            ether 00:1b:21:d9:72:bd  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
            device memory 0xf97e0000-f9800000 
    eth2: flags=4098<BROADCAST,MULTICAST>  mtu 1500  metric 1
            ether 00:25:90:62:9a:ea  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
            device interrupt 16  memory 0xfbce0000-fbd00000 
    eth3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
            inet 192.168.168.37  netmask 255.255.255.0  broadcast 192.168.168.255
            ether 00:25:90:62:9a:eb  txqueuelen 1000  (Ethernet)
            RX packets 1567  bytes 131544 (128.4 KiB)
            RX errors 0  dropped 1  overruns 0  frame 0
            TX packets 13  bytes 1454 (1.4 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
            device interrupt 17  memory 0xfbde0000-fbe00000 
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436  metric 1
            inet 127.0.0.1  netmask 255.0.0.0
            loop  txqueuelen 0  (Local Loopback)
            RX packets 290  bytes 22392 (21.8 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 290  bytes 22392 (21.8 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    (here's my resolv.conf - these IP's are good, I backed it up and make sure it's these values before I do the manual ip addr  they work once dhcpcd is run)
    # Generated by dhcpcd from eth3
    # /etc/resolv.conf.head can replace this line
    nameserver 192.168.168.199
    nameserver 192.168.168.150
    nameserver 68.94.157.1
    # /etc/resolv.conf.tail can replace this line
    (here's what I had in my rc.conf, it doesn't assign anything on a fresh boot)
    # /etc/rc.conf - Main Configuration for Arch Linux
    # LOCALIZATION
    # LOCALE: available languages can be listed with the 'locale -a' command
    # HARDWARECLOCK: set to "UTC" or "localtime", any other value will result
    #   in the hardware clock being left untouched (useful for virtualization)
    # TIMEZONE: timezones are found in /usr/share/zoneinfo
    # KEYMAP: keymaps are found in /usr/share/kbd/keymaps
    # CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
    # CONSOLEMAP: found in /usr/share/kbd/consoletrans
    # USECOLOR: use ANSI color sequences in startup messages
    LOCALE="en_US.UTF-8"
    HARDWARECLOCK="UTC"
    TIMEZONE="UTC"
    KEYMAP="us"
    CONSOLEFONT=
    CONSOLEMAP=
    USECOLOR="yes"
    # HARDWARE
    # MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
    # MOD_BLACKLIST: Prevent udev from loading these modules
    # MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
    # NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
    MOD_AUTOLOAD="yes"
    #MOD_BLACKLIST=() #deprecated
    MODULES=(8021q autofs4)
    # Scan for LVM volume groups at startup, required if you use LVM
    USELVM="no"
    # NETWORKING
    # HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
    HOSTNAME="mg"
    INTERFACE="eth3"
    ADDRESS="192.168.168.38"
    GATEWAY="192.168.168.168"
    BROADCAST="192.168.168.255"
    # Enable these network profiles at boot-up.  These are only useful
    # if you happen to need multiple network configurations (ie, laptop users)
    #   - set to 'menu' to present a menu during boot-up (dialog package required)
    #   - prefix an entry with a ! to disable it
    # Network profiles are found in /etc/network.d
    # This now requires the netcfg package
    #NETWORKS=(main)
    # DAEMONS
    # Daemons to start at boot-up (in this order)
    #   - prefix a daemon with a ! to disable it
    #   - prefix a daemon with a @ to start it up in the background
    #DAEMONS=(syslog-ng dbus acpid autofs  firewall setup-bonding network crond aide cupsd)
    DAEMONS=(syslog-ng dbus acpid autofs  firewall network crond aide cupsd)
    Last edited by Mogombus (2012-04-09 02:35:55)

    Okay, somewhere in there, you plugged a cable into eth0 and it acquired a private network address in the 10.xx.xx.xx space.
    Can you verify you are assigning a static address to eth0 of 192.168.168.37 ?  That is an unusual address. Are you sure you are on the correct subnet?
    What was the output of ip route when you thought you should have been able to hit the net?
    What is the gateway address for eth0 ?
    Can you describe the network attached to eth0?  (It seems to be a 10.xx.xx.xx private address)
    Can you describe the network attached to eth3?  (Is it a local router ? )
    Last edited by ewaller (2012-04-09 14:50:10)

  • Trouble Understanding variables

    I am committed to learning A3, but HOLY CRAP!! I have never
    been a programmer, just a lowly designer. Apparently a pretty dumb
    designer! :)
    I can breeze through this in AS2 with no problem, but AS3 is
    killin' me! I am trying to create a music player that will embed in
    a web page, it will be XML driven and the XML will be populated via
    a database and generated by PHP. I am using a listbox component to
    display the playlist (from the XMLfile). I have figured out how to
    start playing the first mp3 on the list.
    Now when the user click a different button, I can get that
    song to play also, but I ended up created a second sound object, so
    the two play at the same time. Not good. I have tried and tried to
    access the object that is playing the first sound so I can stop it
    and load a new sound into it - I am about to pull my hair out!
    I seem to missing a basic understanding of how to access this
    object and change the variable value so I can play a new song. Any
    help would be GREATLY appreciated!!

    Vern,
    > If I understand correctly: any variable I am going to
    use outside
    > of the function that assigns its value needs to be
    declared OUTSIDE
    > of that function first?
    Yes.
    > Once declared it can be used anywhere, but if it isn't
    declared
    > outside, then the value is stuck inside that function.
    Is that correct?
    Close. In fact, if you're coding in the main timeline,
    you're so close,
    you could arguably define it in those terms and be fine.
    Variables (and
    functions) are available to the scope in which they're
    declared. If you
    declare a variable in the main timeline, then that variable
    is available in
    that frame and any subsequent frame of that timeline.
    Depending on the
    circumstances of your FLA, the main timeline may indeed feel
    like
    "everywhere," to the point where the variable could be said
    to be used
    "anywhere" -- but it's really not much different from the
    restriction a
    variable feels when declared inside a function; it's just
    that the whole
    movie takes place inside that "function"/FLA/SWF.
    > If I got that right, then for my scrubber, I need to set
    up some
    > variables that hold SoundChannel.position, Sound.length,
    > MovieClip.position
    > THEN create a function which assigns values and
    calculate the
    > MovieClip.position
    Yes. That way, any number of functions can use those
    variables. But
    keep in mind, all you really need are variables that point to
    your instances
    of Sound, SoundChannel, and MovieClip. Then use those
    variables to
    reference the necessary properties of those classes. (In
    other words, no
    need to make a mySound variable *and* a mySoundLength
    variable: the mySound
    variable suffices, because it leads to the Sound.length
    property as simply
    as mySound.length.)
    > I never liked how clunky onEnterFrame could is. I assume
    the Timer
    > class is a bit more streamlined?
    It's just another tool in the toolbox. :) Timer is the
    recommended new
    version of setInterval() and setTimeout() combined.
    > I am so used to _root.movieClip.variable=foo; (I mean
    the easy
    > access to any variable from anywhere) but change is
    good, I like
    > change. Change is good.
    I like change in my pocket! ;) The thing about an expression
    like
    _root.movieClip.variable is that you could often just
    reference the variable
    anyway, without the need for the "_root" reference. AS3 has
    root (no
    underscore), which behaves in many ways like _root, but dig
    into that a bit
    ... you'll find some important differences.
    > So it sounds as if, to include the loadbar within all of
    this, then I need
    > to move the playHead along the width of the loadbar, not
    a set length
    > in pixels.
    You could do a set length, but it's much more flexible if
    you use the
    width of some other object, like a track or some other movie
    clip. If you
    go with the width of some object, you can *change* the width
    of that object
    and the code still works.
    > The drag part should be easy enough, but adjusting the
    actual audio
    > from that may give some fits!
    To derive volume, you'll take the position of the draggable
    knob along
    its track and divide that by the width of the track. Assume
    you have a
    ridiculously long volume track, 500px. The volume knob has
    been dragged
    halfway across, to 250px. 250 / 500 is 0.5, which is the AS3
    way of
    specifying 50% volume. Now imagine the track is 50px wide.
    The knob has
    been dragged all the way across (to 50px). 50 / 50 is 1,
    which is 100%
    volume. And so on.
    > But here is my real question about that, will it be OK
    to try and add
    > that functionality in once the actual playHead is
    working, or is
    > that a mistake to not include it from the beginning?
    Ehh, for something like this -- especially if you're
    teaching yourself
    and involved in a learning experience -- I'd say it doesn't
    matter one way
    or the other. Take small steps and master each step. Sooner
    or later, what
    you're doing will "click" for you, and after that, you'll
    find that you can
    add or remove features as you please.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Trouble Understanding CSS Layout and Padding

    Hi,
    I'm having some serious problems understanding CSS layout techniques and the impact of padding and was hoping I could get some help.
    Here are a couple of pages that show examples of what I don't "get". The first has padding that causes the layout to look right. The second doesn't have padding but doesn't lay out as I would expect. Also, the amount of text affects the "bottom" div as well. I'm an old hand at HTML and could do this layout in my sleep using tables. Css is a different, frustrating story.
    http://www.libertywebmarketing.com/test/1.html
    http://www.libertywebmarketing.com/test/2.html
    Thanks.
    Fitz21

    Thank you for the help.There's a lot of valuable info in these answers that I'm going to have to study. I never thought of applying classes to Div tags, but I guess I have to start learning somewhere. I'm not sure how to use the technique, but I'll definately look into it. If I could wake up tomorrow and know what you all know simply by wishing it, I would.
    I see that there are many things I have to learn about using CSS and I'd really like to see some real world examples that don't look like typical cheesy CSS designs with columns. If I were going to design this page using HTML, I would probably do something like this: http://www.libertywebmarketing.com/test/3.html
    (The last two tables show the table structure and use of a spacer. I know this a seriously antiquated way of doing it, but it's to illustrate what I'm trying to accomplish: Namely, staggered, left/right alternating boxes that will expand properly depending on the amount of copy or the vertical height of the photo in them.) 
    Dreamweaver 101,
    I have "Dreamweaver 8 The Missing Manual" by David Sawyer McFarland, but I find it really concentrates on "typical CSS designs" that look like Content mangement templates. While I agree it's a valuable book, there's nothing in there I have found that addresses anything like what I'm trying to do. Is the Dummies book better for atypical layouts?
    Again, thank you all.
    Fitz21

  • Trouble understanding RH customization when linking FM files

    Is there a video that will help with this, particularly creating and customizing a single CSS for use with my work? I also would like to have an idea of the best workflow.
    Here is what I am doing and some issues:
    Open RH.
    Click File > New > Project.
    What I really want is a bunch of HTML files with known filenames. I know FM 12 can do this without RH, but I want to work this out now so I can take this in a better direction. Anyway, I click Application Help in Project Type.
    Click the Import tab in the New Project dialog box.
    Select FrameMaker Documents as the Import Type, and click OK.
    Select my FrameMaker .book file, and click Open.
    Enter a title for the project, file name for the project (left default), and location for the project.
    Click Finish.
    At this point, my multi-FM-file .book project hangs and never finishes. If I am using a single-FM-file .book project, though, the following happens:
    The Import dialog box opens.
    In the FrameMaker Document area, click Edit. Some scanning happens, and the Conversion Settings dialog box opens.
    Edit paragraph settings.
    Find those paragraphs I don't want output for and select the Exclude from output check box, such as Footer.
    Set each of my four Bulletn styles to Multilevel list. Bullet1, Bullet2, Bullet3, and Bullet4 styles represent decreasing levels of subbulleted lists.
    Set my eight Stepsn styles to Multilevel list. Steps1, Steps2, Steps3, and Steps4 styles represent decreasing levels of subnumbered lists (1, a, I, i). Each of these styles has a corresponding First style that sets the numbering to 1, such as Steps1First.
    Set up cross reference settings to remove page numbers.
    Set the default format for Image to .png.
    Leave Character, and Other settings alone.
    Click OK and Next.
    Leave the Table of Contents, Index, and Glossary Settings turned off.
    Click Finish. Some scanning happens and a result is created.
    Some issues.
    While Mutilevel Numbering creates 4 appropriate levels of bullets based on my styles, it only creates 3 of 4 levels of numbered lists. Levels 3 and 4 are presented identically by RH. How did this happen and how do I fix it.
    Indented body tags are not correct. I can fix this in the CSS. But, then, how do I create and make sure my project uses a new CSS?
    How do I create a delivery package for this? I see what I have in project manager, and want to create a folder that contains my output, that is, HTML, PNG, and CSS files that support my project so I can move these to the target CD or delivery mechanism?
    I have HTML and CSS buried within individual folders with the respective FM source. How do I get these HTML files and images out, and mate them to one and only one CSS for delivery?
    Thoughts?
    Sean

    Thanks. I will choose Blank Project  instead if Application from now on, though I understand that is erased by choosing FM files. I really just want compliant HTML 5 output with a single CSS file that I can deploy with linked files, which will be PNGs.
    So, can you  help with my customization questions?
    Also, another issue I have run into is spacing in the HTML around run-in headings. This is caused by RH adding an extra blank paragraph with a non-breaking space, as show in the following code. I don't need this empty paragraph added, and it was not in the FM source. Thoughts?
    <p class="FM_GlossaryTerm">Term Name Here as a runin in FrameMaker.</p>
    <p class="FM_GlossaryTerm">&#160;</p>  //<-- This line added in RH conversion, and I don't want it.
    <p class="FM_GlossaryDefinition">Term definition paragraph here.</p>
    Cheers,
    Sean

Maybe you are looking for

  • My Mac can no longer find my Time Capsule or my home network.

    Hello, having had no problems for the first few months I can no longer get online. My Mac cannot find my network (but can find all of the other networks on my street) and cannot find the Time Capsule. The Time Capsule itself has a green light so I as

  • CS4 changing aspect ratio, resizing video

    Hello, I've been working on a project at school for some time and am just now getting to the editing factor. My issue is about half way through editing it seems that its changed the aspect ratio from wide screen to a more standard ratio. I have it se

  • BAPI_PO_CHANGE is not updating Quantity and Delivary Date

    HI All, I am trying to update quantity and delivery date of PO by using BAPI_PO_CHANGE, by Passing below parameters. As per the documentation: Parameter: PURCHASEORDER 4500003477 Parameter: POHEADER PMNTTRMS = 0002 PUR_GROUP = 002 Parameter: POHEADER

  • How do i get an outline stroke without initial stroke in CC?

    Hi, I need an outline on a stroke that i drew but when i apply object>path>outline stroke i keep getting my initial stroke applied as well. I only need the outline, not the initial stroke. I use Illustrator CC. Thanks

  • "connection refused" in Safari

    Recently uninstalled Safari "Ad-block" extension. Now I am getting "connection refused" errors when trying to access some web pages. Can someone help!