Array Cast Question Puzzling me

The question below puzzles me. The answer states that the result is a class cast exception because o1 is an int [] [] not a int []
But I thought the point of line 7 is to say "I know it is a 2D array but I want to cast it to a 1D array - I know I am losing precision here".
Given:
1. class Dims {
2. public static void main(String[] args) {
3. int[][] a = {{1,2,}, {3,4}};
4. int[] b = (int[]) a[1];
5. Object o1 = a;
6. int[][] a2 = (int[][]) o1;
7. int[] b2 = (int[]) o1;
8. System.out.println(b[1]);
9. } }
What is the result?
A. 2
B. 4
C. An exception is thrown at runtime
D. Compilation fails due to an error on line 4.
E. Compilation fails due to an error on line 5.
F. Compilation fails due to an error on line 6.
G. Compilation fails due to an error on line 7.
Answer:
3 C is correct. A ClassCastException is thrown at line 7 because o1 refers to an int[][]
not an int[]. If line 7 was removed, the output would be 4.
˚ A, B, D, E, F, and G are incorrect based on the above. (Objective 1.3)

While you could approximate casting a 2D array to a 1D array in C/C++ by just grabbing a pointer to your first array and then overrunning array bounds (relying on how C/C++ allocates 2D arrays and the lack of bounds checking), Java's strong typing and bounds checking makes this impossible.
If you want to do something similar in Java, you will need to create a new 1D array of the proper size and copy the elements stored in your 2D array into this new array. That being said, a database is almost guaranteed to be a better solution.

Similar Messages

  • Lightroom color cast question of JPEG image

    Lightroom color cast question of JPEG image
    Camera Canon MKII Color Matrix Adobe RGB
    Photoshop CS Color Setting Adobe RGB (1998)
    Lightroom 1.2 as new lightroom user I did not think that I needed to choose a color setting or color profile until I am ready to print my photos. I have not done any preset camera calibration.
    Link to my website with example photo http://www.basecampphotos.com/color.jpg
    My question is why is Lightroom displaying the images with a yellow color cast ? The image is a print screen from Lightroom on the left and Photoshop on the right The color cast problem can be seen in the white walls of the stairway. Also when viewing the image with Windows Picture and Fax viewer the walls are white as expected.
    Any ideas or suggestions as to why Lightroom is displaying the images with the yellow color cast or what I need to do to correct the issue ?
    Thanks
    Jim

    Almost definitely a corrupt monitor profile. Time and again this turns out to be the cause of such differences between PS and LR. You need to recalibrate the monitor or if you do not have a hardware calibrator, delete the profile from windows' monitor properties pane to test and then get a hardware calibrator.
    P.S since you are using adobeRGB jpegs, Windows picture and Fax viewers cannot give you the correct colors even on a calibrated monitor. Those are not color managed programs (I believe picture viewer finally is in Vista but definitely not in XP which you appear to be using). Also, PS has to be correctly set up to always preserve embedded profiles and to ask when you have profile mismatches, otherwise even PS will give incorrect color. Make sure to set this up in Edit>Color settings.
    P.S.2: Make sure you are not applying defaults in Lightroom to your images either on import or elsewhere. Sometimes people by accident define develop defaults that in this case might contain a white balance shift. Go to LR preferences and open the Presets tab. Here click on "Reset all default Develop settings" and make sure that only the auto grayscale checkbox is ticked. For images that it might have already happened to, make sure to hit the reset button.

  • Array Casting in java

    Hi,
    I am new to java.Last day Can I cast an arrays in java?For example casting an Object array to a String array or an integer array to a long one.If yes, then what are the rules and restrictions for casting arrays.I tried to google it, but I could not find any useful material.Could any one give me some links where I can get some useful material,books,mock tests etc. regarding preparation for SCJP 1.6?.Please help.
    Thanks in advance

    This is the Berkeley DB, Java Edition forum, and you should post only post questions about that product here. I think you may be looking for basic Java language information, and there are many other websites that can give you that information.

  • Array casting: ClassCastException

    import java.util.Vector;
    public class X
    public static void main(String args[])
         //first part
    String [] array = {"1","2", "3"};
    Object [] objs = array;
    array = (String[])objs;
    for( int i =0 ; i < array.length; i++)
    System.out.println(array);
         //second part
    Vector v = new Vector();
    v.add("1");
    v.add("2");
    v.add("3");
    objs = v.toArray();
    array = (String[])objs;
    for( int i =0 ; i < array.length; i++)
    System.out.println(array[i]);
    Why does the first part work properly but the second cause ClassCastException? Even if an array was instantiated as Object[] in toArray method casting MUST be ok. I work with an instances in array but not with array. An array only contains an objects I work with. It's only technical structure! Why does it cause ClassCastException?

    >
    Yes. I know it. The point is WHY it was done in this
    way? What can I do with the type of array? NONE. The
    actual information is CONTAINED in array. So array
    is only technical structure. I can't derive it, it has
    no virtual mechanisms. The actual objects I need are
    stored in array. The type of them is important. It
    looks like miss of language structure.
    The basic question here is a fundamental part of polymorphism - you cannot cast an Object into one that it is not.
    Object a = new Object();
    String b = (String) a;That code will also compile, but it is just as incorrect as your code. The problem is that "a" will never be a String. There may be ways to convert it into a String, but the object a will always be of type "Object" and never extend String, so it cannot be cast.
    Similarly, an array of type Object[] will always be of type Object[]. It cannot be cast to String[], because it will never have String[] as a superclass, if you will. The rules for working with arrays are exactly the same as working with the object which is the base type of the array.
    In order to be able to do a cast from Object[] to String[], there would have to be a runtime check which would ensure that every element in the Object[] was, in fact, a String. But the cast check in the compiler is just looking up the extends and implements chains. If you want to implement a runtime cast, Java basically leaves that up to you.
    And as has been mentioned, they do let you provide the array to be used as well.

  • About array cast.

    dear all
    could someone tell me what's wrong with the following codes?
    Object objarr[]
    = {new Integer(1), new Integer(2)};
    Integer[] intarr = (Integer [])objarr;
    it throws out a java.lang.ClassCastException when i ran it. but doesn't the objarr actually represents a Integer array?
    regards
    Yang Liu

    In Java, all objects are by default of Object type. That means an Integer object is of Object type. Similarly a String object is of Object type.
    But if I give you an object of type Object, can u absolutely say whether it is an Integer or a String (ofcourse assuming u don't use relection etc) ? No you cannot..
    Simlarly when you have a Object array, you can put anything into that array, a String or an Integer etc. So u cannot be sure that an Object array always contains only Integer... That is y u get the class cast exception.....
    Ofcourse, this is just the inheritance concept... A BMW is a type of car.. but a car needn't be a type of BMW... it could be a Toyota instead or someting else...
    Integer[] intarr = {new Integer(1), new Integer(2)};
    Object[] objarr = (Object[]) intarr;
    the above code works well.. since all Integer (s) are of Object type in Java....
    Hope this helps

  • The arrays class question

    consider the code below
    int[] list = {2, 4, 7, 10};
    java.util.Arrays.fill(list, 7);
    java.util.Arrarys.fill(list, 1, 3, 8);
    System.out.print(java,util.Arrays.equals(list, list));i understand line 2, it gonna fill 7 into the array,so the output would be Line 2: list is {7, 7, 7, 7}
    my question is line 3, how come the output would be {7, 8, 8,7} what does 1 and 3 represent in a arrary?
    the line 4 output would be {7, 8,8,7} again why?
    Thank you guys whoever is gonna take to respond me questions

    zerogpm wrote:
    but which 2 lists were comparing ? since i have list list with the same name1) You're not comparing lists, you're comparing arrays.
    2) You're comparing a single array with itself.
    3) Objects, including arrays, do not have names. Classes, variables, and methods have names. Objects do not.

  • Describe non-generic array cast in JLS3 as being unchecked

    This method :
        static <T, U extends T> U[] cast(T[] a) { return (U[]) a; }will generate the warning: [unchecked] unchecked cast, found: T[], required: U[].
    And it should. Wouldn't it be appropriate if
        static Object[] cast(String[] a) { return (String[]) a; }would produce the same warning?
    If you do that, you could translate the declaration
      T[] at = new T[255]
      String[] as = new String[255]into
    Array<T> at = Array.<T>newInstance(255);
    Array<String> as = Array.<String>newInstance(String.class, 255);where java.lang.reflect.Array would be something like
    package java.lang.reflect.Array;
    public final class Array<T> implements Iterable<T> {
        public final int length;
        private Type memberType;
        private Array(Type memberType, int length) {
            this.memberType = memberType;
            this.length = length;
        public native T getMember(int i);
        public native void setMember(int i, T member);
        public native java.util.Iterator<T> iterator();
       public static <U> Array<U> newInstance(int length) {
           return new Array<U>(null, length);
       public static <U> Array<U> newInstance(Class<U> memberClass, int length) {
           return new Array<U>(memberClass, length);

    Sorry, I created a bad example. It should have been:
        static <T, U extends T> T[] cast(U[] a) { return (T[]) a; }and
        static Object[] cast(String[] a) { return (Object[]) a; }The point is that an array of String is different from an array of Object and casts between them is unsafe. Throwing an ArrayStoreException if the wrong type is assigned is just a workaround for lack generic types in pre-Tiger Java. Now that we will have generics, I think it would be appropriate if Java arrays would be treated as proper generic types. For those that are afraid of breaking backwards compatiblility, the erasure mechanism should be able to take care of that.

  • Copying arrays, performance questions

    Hello there
    The JDK offers several ways to copy arrays so I ran some experiments to try and find out which would be the fastest.
    I was measuring the time it takes to copy large arrays of integers. I wrote a program that allocates arrays of various sizes, and copy them several times using different methods. Then I measured the time each method took using the NetBeans profiler and calculated the frequencies.
    Here are the results I obtained (click for full size):  http://i.share.pho.to/dc40172a_l.png
    (what I call in-place copy is just iterating through the array with a for loop and copying the values one by one)
    I generated a graph from those values:  http://i.share.pho.to/049e0f73_l.png
    A zoom on the interesting part: http://i.share.pho.to/a9e9a6a4_l.png
    According to these results, clone() becomes faster at some point (not sure why). I've re-ran these experiments a few times and it seems to always happen somewhere between 725 and 750.
    Now here are my questions:
    - Is what I did a valid and reliable way to test performances, or are my results completely irrelevant? And if it's not, what would be a smarter way to do this?
    - Will clone be faster than arraycopy past 750 items on any PC or will these results be influences by other factors?
    - Is there a way to write a method that would copy the array with optimal performances using clone and arraycopy, such that the cost of using it would be insignificant compared to systematically using one method over the other?
    - Any idea why clone() can become faster for bigger arrays? I know arraycopy is a native method, I didn't try to look into what it does exactly but I can't imagine it's doing anything more complicating than copying elements from one location in the memory to another... How can another method be faster than that?
    (just reminding I'm copying primitives, not objects)
    Thanks!
    Message was edited by: xStardust! Added links, mr forum decided to take away my images

    yeh, everyone thinks that at some point. it relies,
    however, on you being perfect and knowing everything
    in advance, which you aren't, and don't (no offence,
    the same applies to all of us!). time and time again,
    people do this up-front and discover that what they
    thought would be a bottleneck, isn't. plus,
    the JVM is much smarter at optimizing code than you
    think: trust it. the best way to get good performance
    out of your code is to write simple, straightforward
    good OO code. JVMs are at a point now where they can
    optimize java to outperform equivalent C/C++ code
    (no, really) but since they're written by human
    beings, who have real deadlines and targets, the
    optimizations that make it into a release are the
    most common ones. just write your application, and
    then see how it performs. trust me on this
    have a read of
    [url=http://java.sun.com/developer/technicalArticles/I
    nterviews/goetz_qa.html]this for more info anda chance to see where I plagiarized that post from :-)
    Thanks for that link you gave me :)
    Was usefull to read.
    About time and money of programming, that is not really an issue for me atm since i'm doing this project for a company, but through school (it's like working but not for money).
    Of course it should not last entirely long but I got time to figure out alot of things.
    For my next project I will try to focus some more on building first, optimizing performance later (if it can be done with a good margin, since it seems the biggest bottlenecks are not the code but things outside the code).
    @promethuuzz
    The idea was to put collection objects (an object that handles the orm objects initialized) in the request and pass them along to the jsp (this is all done through a customized mvc model).
    So I wanted to see if this method was performance heavy so I won't end up writing the entire app and finding out halve of it is very performance heavy :)

  • Array Module Question

    Hi,
    I am currently working on designing phase for an Array Module. We are planning to track the Array information and store it's content to database. Currently I am finalizing the data model and I have following question.
    --We need to track the Geneology of the Sample through out the whole system (Especially the results of Transfers). Is it better to have all that relationship in one flat table with columns for location (like PlateWell, GelLane…..) and columns for Content (Column like . LocationType  LocationId   ContentType ContentId) or is it better to store all the content of location as a ArrayType? Or is there any other option available in the Market?
    In the first case database rows for that table will increate very very fast plus to find out the geneology of the location in Array , I have to use Connect By Prior which will take good amount of time(Is there any other option available?). I don’t have much idea about second option but I think retrieval individual content is going to be a problem.
    Any help is really appreciated.
    Thanks in Advance
    Raj

    Made a complete example:
    String searchKey = "Juice";
    TreeMap tm = new TreeMap();
    tm.put("soda", "coke");
    tm.put("Juice", "orange");
    tm.put("SODA", "7-up");
    Set set = tm.entrySet();
    Iterator iterator = set.iterator();
    while( iterator.hasNext() ) {
    Map.Entry entry = (Map.Entry)iterator.next();
    if(entry.getKey().equals(searchKey)){
    System.out.println("searchKey '"+searchKey+"' value is: "+entry.getValue());
    What do you think? Anything obvious that can be improved?

  • WHY IS array CASTING NOT WORKING ?

    data object:
    class myData extends BaseData
    class x
    BaseData[] lData = null;
    setData(BaseData[] aData)
         lData = aData;          
    getData(BaseData[] aData)
    return lData;     
    class y
    myData[] a = new myData[];
    x xx = new x();      
    xx.setData(a);
    xx = (myData[])xx.getData(); <---casting doesnt work !!               
    }

    well IData IS an array so that's not the problem
    The problem is that an array is an object with its own inheritance but it has no knowledge of the inheritance of the objects it contains. So String[] does not extends Object[] even though String extends Object. But all 4 extends Object :)
    run this little to see to what interfaces/classes you can cast your arrays:
    public class Test {
         public static void main(String[] args) {
              Class cl = args.getClass();
              Class[] interfaces = cl.getInterfaces();
              System.out.println( "classes and super-classes" );
              while (cl != null) {
                   System.out.println( "    "+cl );
                   cl = cl.getSuperclass();
              System.out.println( "interfaces" );
              for (int i = interfaces.length; i-->0; )
                   System.out.println( "    "+interfaces[i] );
    }

  • Math / array / matrix-question

    Hallo everybody,
    first of all: it's not a indesignscripting-  but general math-javascriptquestion. please be patient
    I've got a first (matrixlike-)array (won't change)
    var containers = [
    'container11', 'container12', 'container13', 'container14', 'container15',
    'container21', 'container22', 'container23', 'container24', 'container25',
    'container31', 'container32', 'container33', 'container34', 'container35',
    'container41', 'container42', 'container43', 'container44', 'container45',
    'container51', 'container52', 'container53', 'container54', 'container55'
    and I've got a second array:
    ["container14", "container25", "container34", "container44", "container54"] //this array may contain 3 up to 8 items
    My aim is to check if a part of 5 to 3 items of the second array is part of or equal to a row or column of the matrix-like-array.
    For example: "container34", "container44", "container54" or "container11", "container12", "container13", "container14" (as part of second array) would be a result I#m looking for. Note: I only want to find the 'biggest charge'!
    Hope it's getting clear and one of the math-cracks will have a idea.
    Addittional: there's no MUST to work with arrays. I can also store the data to a object or mixture ... and may fill it with numbers instead of strings ...
    To get it visible:
    https://dl.dropboxusercontent.com/spa/3ftsuc9opmid3j4/Exports/fourWins/fourWins.html
    Items can be dragged and dropped. After every dropp the arrays have to be compared ... and I#m searching for a nice and elegant solution
    May be someone's interested
    Hans

    Hi Hans,
    Just a quick note although your question is solved.
    Provided that your matrix is 5×5 you could easily map any element to a single character in the set { A, B..., Z } (for example).
    Then your problem can be reduced to some pattern matching algorithm, that is, finding the longest part of the input string within a 'flat string' that just concatenates the rows and the columns of the search matrix in the form ROW1|ROW2...|COL1|COL2...|COL5
    And you can create RegExp on the fly to compute the solution(s) with almost no effort:
    const MX_ORDER = 5;
    const MIN_MATCH = 3; // We need at least 3 contiguous items
    var bestMatrixMatch = function F(/*str[]*/ROWS, /*str*/ND)
    // NB: No check is made on ROWS, so make sure you supply
    //     MX_ORDER strings, each being MX_ORDER-sized
        // Put in cache some subroutines
        F.RES_TO_STR ||(F.RES_TO_STR = function()
                return localize("'%1' found in %2", this.result, this.location);
        F.ROWS_TO_HS ||(F.ROWS_TO_HS = function(R, C,i,j)
                for( i=0,C=[] ; i < MX_ORDER ; ++i )
                for( C[i]='',j=0 ; j < MX_ORDER ; C[i]+=R[j++][i] );
                return R.concat(C).join('|');
        // Vars
        var haystack = F.ROWS_TO_HS(ROWS),
            candidates = ND &&
                haystack.match( new RegExp('['+ND+']{'+MIN_MATCH+',}','g') ),
            t, p;
        if( !candidates ) return null;
        // Sort the candidates by increasing size
        candidates.sort( function(x,y){return x.length-y.length} );
        // Grab the matches and keep the best
        while( t=candidates.pop() )
            if( 0 > ND.indexOf(t) ) continue;
            p = 1+~~(haystack.indexOf(t)/(1+MX_ORDER));
            return {
                result:   t,
                location: (p<=MX_ORDER)?('Row #'+p):('Col #'+(p-MX_ORDER)),
                toString: F.RES_TO_STR,
        return null;
    // =================
    // Sample code
    // =================
    var rows = [
        "ABCDE",
        "FGHIJ",
        "KLMNO",
        "PQRST",
        "UVWXY"
    var needle = "EKLMINSX";
    // get the result
    var result = bestMatrixMatch(rows, needle);
    alert(
        "Searching the longest part of '" + needle + "' in:\r\r" +
        ' '+rows.join('\r').split('').join(' ') +
        '\r\r===============\r\r' +
        (result || "No result.")
    @+
    Marc

  • Some subclassing array creation question

    i)     Declare a class Customer which contains name, id , payment, and status. [5m]     
    ii)     Create a class called Shop that contains a one dimensional arrays� reference of type Customer Mall which      stores up to 45 Customer information.     [2m]
    Above are the question. I just want to know should the Shop class extends the Customer class or is it unecessary.

    I dont think you should use the extends keyword.
    Ask yourself which of these statements makes sense:
    A Customer is-a Shop.. (I dont think so)
    A Shop is-a Customer.. (That doesn't make sense either)
    A Shop has-a Customer... (now that sounds right)
    Given that I would have a instance variable of type Customer[] within the Shop class.
    Use composition instead of inheritance.
    I hope this helps..
    J

  • Adding arrays - confusing question

    I am in the process of writing a java program where I have to add arrays. The question asks:
    This program asks you to assume that your computer has the very limited capability of being able to read and write only single-digit integers and to add together two integers consisting of one decimal digit each. Write a program that can read in two integers of up to 40 digits each, add these digits together, and display the result. Test your program using pairs of numbers of varying lengths. You must use arrays in this problem.
    I think I understand up to there is says"Write a program that can read in two integers of up to 40 digits each" from there I am lost.
    Can anyone help explain what is needed?
    This is what i have so far:
    import java.util.*;
    public class add
        public static void main(String[] args)
          Scanner in = new Scanner(System.in);
          int x = in.nextInt();
          int y = in.nextInt();
            int[] a = {x};
            int[] b = {y};
            int[] ab = new int[a.length + b.length];
            System.arraycopy(a, 0, ab, 0, a.length);
            System.arraycopy(b, 0, ab, a.length, b.length);
            System.out.println(Arrays.toString(ab));
    }

    Yeh, sorry about that didn't have the time to go ahead and drag some of the code over when I first found this forum, first thing I tried a quick compile and run just to see what problems I'd get and I got this runtime error of: Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 7
         at java.lang.String.charAt(String.java:687)
         at Joseph_Ryan_P2.main(Joseph_Ryan_P2.java:36)
    I threw in some print statements to see how far it gets before the error occurs and it seems to be right before the for loop(see code below)
    In this program I'm reading in from a text file that will read two numbers from the same line that are seperated by a space and eventually add them, is the best way to do that by using a tokenizer or some sort of space delimiter? Or is there an easier way? If the tokenizer is best how would i go about that I haven't learned too much about them besides the fact that they exist so far.
    Thanks for any help you or suggestions you guys can give.
    //Joseph_Ryan_P2.java
    //Big Integer Program
    //Description:
    //     Design and implement a BigInteger class that can add and subtract integers with up to 25 digits. Your
    //     class should also include methods for input and output of the numbers.
    // Must Use Arrays
    import java.io.*;               //neccessary imported libraries
    import java.util.*;
    public class Joseph_Ryan_P2          
         public static void main(String[] args)          //the programs main method
              try
                   Scanner scan = new Scanner(new File("BigInts")); //Scanner to read in from plaintext file
              String numline = scan.next();
              int x=0;
              int [] big1 = new int [numline.length()];
              System.out.println(numline);
                   int [] big2 = new int [numline2.length()];
                   String numline2= scan.nextLine();
                   System.out.println(numline2);
              for(int i = numline.length() - 1; i >= 0; i++)
              char current = numline.charAt(i);
              int d = (int) current - (int) '0';
                   big1[i] = d;
              }//end for loop
              }//end try
              catch(FileNotFoundException exception)
    System.out.println("The file could not be found.");
    catch(IOException exception)
    System.out.println(exception);
    } //end catch statements
         }//end main
    }//end class

  • TMG Standalone Array simple question

    hi everyone i have what i think is a simple question but i don't know if i'm missing something in all the tutorials about standalone arrays i've read.
    i'm working with 2 tmg enterprise editions in 2008R2 in a test environment. both are on sp2 fully updated and a single 20 Mbit connection. i would like for this two tmg's to work for high availability using that connection only and i was able to join both in
    a standalone array. here's how they're configured:
    tmg01
    internal nic ip range: 192.168.1.1/24
    second internal nic: not connected at the moment, considering for intra-array network if needed later on (if anyone suggest is absolutely necessary)
    external nic ip: dhcp supplied by isp.
    tmg02
    internal nic ip range: 192.168.1.2/24
    second internal nic: not connected at the moment.
    external nic: not connected. (where do i connect this one if i only have one modem for that 20 Mbit connection??)
    i have read that the intra-array network is not absolutely necessary so i’m leaving those unplugged.
    now, here’s my question, since they’re both already on an array, if tmg01 fails to deliver (let’s assume it has a hardware malfunction), how is tmg02 going to take over and connect to the external network if by definition my modem only accepts one cable? will
    i have to be near the server and change the cable to the other nic in tmg02 for it to work or do i have to add something in between the modem and the two tmg’s?
    is there something i’m missing? will i be needing 2 connections? maybe it’s too obvious or stupid and it just went passed me. i’m open to criticism and opinions.
    thanks

    Hi
    Let follow the best practice.
    In Production Normal setup for Full redundant Architecture, we need three servers, one for Array and other two servers for TMG for HA.
    1 . TMG Array Server – Subnet Routable with Internal TMG Subnet ( You can also have this in any one TMG but best practice is to separate it )
    2. 
    TMG – 1 – Two NIC, Internal / External
    3. 
    TMG – 2 – Two NIC, Internal / External
    Second Internal NIC is not required in your setup. So you can go with two NIC. External and Internal on two TMG
    Join TMG 1 and TMG 2 to Single Array which is server 1. By this all the configuration you make on one TMG will sync with other TMG.
    How TMG will handle in case of Server failure
    You need to Create two NLB in TMG
    One for Internal and one for External
    Internal NLB
    You need to create an Internal NLB, Since you are using 192.168.1.0 / 24 Network for Internal, assign an internal NLB as 192.168.1.3
    If you want to use TMG as gateway for all internet connection, then you need to have default Route from internal network pointing to 192.168.1.3 which is TMG NLB internal IP
    address
    External NLB
    Since you have not mentioned  External Network, let’s assume you are using 10.10.10.0 / 24 and External Interface of TMG 1 is 10.10.10.1 and TMG 2 is 10.10.10.2, Then create
    an External NLB and assign an IP address 10.10.10.3
    You need to have a Switch in between your Router and TMG servers,
    Connect TMG -1 and TMG – 2 External Interface NIC to Switch
    On external NIC – Set gateway as Modem IP address of Both TMG
    Connect an internet cable from modem to the same switch
    Ensure that, you have a route to 10.10.10.0 /24
     from Modem to External NLB IP address Ie 10.10.10.3
    Now you don’t have to switch cables to Modem,
    Good Luck !!

  • Quick RAID array setup question

    I had to upgrade one of the RAID arrays of one of my clients the other day. I had not setup the RIAD previously, but when I looked at how it was setup before it had 6 disc's in the array and one not part of the array.
    Now I assume who ever set it up before assumed that the 7th disc would be the redundant disc. After looking at the way it worked and doing some calculations from what info RAID admin provided me with I came to the conclusion that the way it was set up would be 6 disc's used as the array with one being a parity drive so if a drive failed that one would take over. On top of that they had another disc that was basically useless as it was not incorporated into the raid at all.
    The way I have set it up is that all 7 discs are part of the array so they have 6 disc's working with one fail over that would be the 7th meaning no disc's are wasted.
    Which way is correct is my question.

    I assume your predesessor left one disk as a hot spare.
    Whenever a disk from a raid set fails, the raid set will be rebuild with the hot spare disk. The bad disk can be swapped and will be the hot spare from then.
    Configuarions like this will give you the highest availability, but will cost you the most. Netto you will have the amount of 5 out of 7 disks. (1 for parity and 1 for hot spare).
    Note that in a raid5 set the parity is spread over all raid disks. There is not such a thing as a 'paritydisk'. The term paritydisk is hust for mathmatics purposes.
    Regards
    Donald

Maybe you are looking for

  • Excise Duty in J1IJ

    Hi Experts, We are trying to do Depot sales configuration. we have configured stock transfer first . scenario i would explain below. we created Purchase order with the help of ME21N then we have done the delivery with the help of T code VL10B, VL02N

  • InterMedia Text with USER_DATASTORE and ORA-03113

    Hi, I have problems using Oracle's InterMedia Text-index with a USER_DATASTORE. I'm using Oracle 8.1.7 on Windows NT 4.0. What I try to do is to create a context-index on multiple columns of multiple tables. I created a table containing the original

  • JSP is executed twice

    hi,           I am running weblogic 6.1 with sp4. I have got two JSP which are using a           datasource to connect to my database (oracle 8).           When I got a java.sql.connection through the datasource, I am creating a           statement a

  • Copy info record

    Hi Gurus, Is there any way I can copy an info record? All the data in one info record is same as the other, except the Vendor no. Is there a way, I can create a duplicate version of the previous info record and just change the Vendor number? Thanks,

  • How to activate IDOC

    Hi, I have followed the following TC to create IDOC we31,30 we81,82 and we60 saved as html page.I have to activate the IDOC that I have created, How to do that?. If i go to TC we02,05  then execute using F8,I am getting the below message "No IDOC Sel