Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
N

nt_virus

@nt_virus
About
Posts
39
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Delete common files between directories A and B from directory B - UNIX
    N nt_virus

    ----@---.-- [~/public_html/user/unixp]# find ./b -name `ls a` -exec rm {}\; find: warning: Unix filenames usually don't contain slashes (though pathnames do). That means that '-name ./' will probably evaluate to false all the time on this system. You might find the '-wholename' test more useful, or perhaps '-samefile'. Alternatively, if you are using GNU grep, you could use 'find ... -print0 | grep -FzZ ./'. find: paths must precede expression Usage: find [-H] [-L] [-P] [path...] [expression] why this happening :(

    System Admin

  • Delete common files between directories A and B from directory B - UNIX
    N nt_virus

    I rectified with backquote now.. ----@---.-- [~/public_html/user/unixp]# find ./b -name `ls -a` -exec rm {}\; find: warning: Unix filenames usually don't contain slashes (though pathnames do). That means that '-name ./' will probably evaluate to false all the time on this system. You might find the '-wholename' test more useful, or perhaps '-samefile'. Alternatively, if you are using GNU grep, you could use 'find ... -print0 | grep -FzZ ./'. find: paths must precede expression Usage: find [-H] [-L] [-P] [path...] [expression] now ? :(

    System Admin

  • Delete common files between directories A and B from directory B - UNIX
    N nt_virus

    yes. it is .. Single quote. 1-Key right of L.

    System Admin

  • Delete common files between directories A and B from directory B - UNIX
    N nt_virus

    --@--.--- [~/public_html/user/unixp]# ls ./ ../ 1 a/ b/ ls --@--.--- [~/public_html/user/unixp]# ls a ./ ../ a b --@--.--- [~/public_html/user/unixp]# ls b ./ ../ b c --@--.--- [~/public_html/user/unixp]# find ./b -name 'ls a' -exec rm {}\; find: missing argument to `-exec' Here i want to delete common files between directories A and B that is b from directory b.

    System Admin

  • Adding / Multiplying two matrices
    N nt_virus

    Java is very nice. I m on east. India. +5.30

    Java java wpf tools help tutorial

  • Adding / Multiplying two matrices
    N nt_virus

    fantastic.. It works.. you made my day (night here actually) .. Thanks a lot.

    Java java wpf tools help tutorial

  • Adding / Multiplying two matrices
    N nt_virus

    yes, no problem. do you use messenger ?

    Java java wpf tools help tutorial

  • Adding / Multiplying two matrices
    N nt_virus

    please do it in c# if you can, I will convert. I did my all possible things.

    Java java wpf tools help tutorial

  • Adding / Multiplying two matrices
    N nt_virus

    We both post posted at the same time. haha.

    Java java wpf tools help tutorial

  • Adding / Multiplying two matrices
    N nt_virus

    99% done..

    for (int i=0;i<first.length;i++)
    {
    for (int j = 0; j<second.length;j++)
    {
    sum[i][j] = first[i][j] + second[i][j];
    System.out.println(sum[i][j]);
    }

    But result are showing in vertical manner.. not like matrix way..

    Java java wpf tools help tutorial

  • Adding / Multiplying two matrices
    N nt_virus

    poor me... I modified as following ,, and I m done around 90%

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */

    package javaapplication6;
    import java.io.*;
    /**
    *
    * @author Sachin
    */
    public class Main {

    /\*\*
     \* @param args the command line arguments
     \*/
    public static void main(String\[\] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    

    try{
    System.out.println("Enter number of rows");
    int m = Integer.parseInt(br.readLine());
    System.out.println("Enter number of columns");
    int n = Integer.parseInt(br.readLine());
    int[][] first = new int[m][n];
    int[][] second = new int[m][n];
    int[][] sum = new int[m][n];
    System.out.println("Enter Value of first matrix");
    {
    for (int i=0;i<first.length;i++)
    {
    System.out.println("Row no. " + (i+1));
    for (int j=0; j<first[i].length;j++)
    {
    System.out.println("Enter value for column no. " + (j+1));
    first[i][j] = Integer.parseInt(br.readLine());

            }
        }
    }
    System.out.println("Enter value of second matrix");
    {
        for (int i=0;i<second.length;i++)
        {
            System.out.println("Row no. " + (i+1));
            for (int j=0;j<second\[i\].length;j++)
            {
                System.out.println("Enter value for column no. " + (j+1));
                second\[i\]\[j\] = Integer.parseInt(br.readLine());
            }
        }
        }
    System.out.println("Sum of two matrices are:");
    {
        for (int i=0;i<first.length;i++)
        {
            for (int j = 0; j<second.length;j++)
            {
                sum\[m\]\[n\] = first\[i\]\[j\] + second\[i\]\[j\];
            }
        }
        System.out.println(sum\[m\]\[n\]);
    }
    }
    catch (IOException e)
    {
       System.out.println(e);
    }
    }
    

    }

    same error is showing when i m adding two arrays.. :(

    Java java wpf tools help tutorial

  • Adding / Multiplying two matrices
    N nt_virus

    but that line add column values for 2nd row and so on till

    Java java wpf tools help tutorial

  • Adding / Multiplying two matrices
    N nt_virus

    Hello. I did this..

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */

    package javaapplication6;
    import java.io.*;
    /**
    *
    * @author Sachin
    */
    public class Main {

    /\*\*
     \* @param args the command line arguments
     \*/
    public static void main(String\[\] args) throws IOException 
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    

    try{
    System.out.println("Enter number of rows");
    int m = Integer.parseInt(br.readLine());
    System.out.println("Enter number of columns");
    int n = Integer.parseInt(br.readLine());
    int[][] first = new int[m][n];
    int[][] second = new int[m][n];
    int[][] sum = new int[m][n];
    System.out.println("Enter Value of first matrix");
    {
    for (int i=0;i<m;m++)
    {
    // System.out.println("Row no. " + (i+1));
    for (int j=0; j<n;j++)
    {
    // System.out.println("Enter value for column no. " + (j+1));
    first[m][n] = Integer.parseInt(br.readLine());

            }
        }
    }
    System.out.println("Enter value of second matrix");
    {
        for (int i=0;i<m;m++)
        {
            System.out.println("Row no. " + (i+1));
            for (int j=0;j<n;j++)
            {
                System.out.println("Enter value for column no. " + (j+1));
                second\[m\]\[n\] = Integer.parseInt(br.readLine());
            }
        }
        }
    System.out.println("Sum of two matrices are:");
    {
        for (int i=0;i<m;i++)
        {
            for (int j = 0; j<n;j++)
            {
                sum\[m\]\[n\] = first\[m\]\[n\] + second\[m\]\[n\];
            }
        }
        System.out.println(sum\[m\]\[n\]);
    }
    }
    catch (IOException e)
    {
       System.out.println(e);
    }
    }
    

    }

    Here in bold text.. first[m][n] = Integer.parseInt(br.readLine()); throws ArrayIndexOutOfBoundexception .... When I replace first[m][n] with first[i][j] .. it taking value .. how to rectify this error any suggestion..

    Java java wpf tools help tutorial

  • Sort Array in ascending and descding
    N nt_virus

    Thanks a lot a lot to both of you guys.. You made my day..

    Java java data-structures help tutorial

  • Sort Array in ascending and descding
    N nt_virus

    I tried that thing earlier but as I declared array as.. int[] value = {2,1,3,6,5} So this line Arrays.sort(value, Collections.reverseOrder()); giving error, red line under value, I don't understand why.. But now I declare array as .. Integer[] value = {2,1,3,6,5} It works....

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */

    package SortListOfNumbers;
    import java.util.Arrays;
    import java.util.Collections;

    public class Main{
    public static void main(String[] args)
    {
    Sorting srt = new Sorting();
    srt.ascending();
    srt.descending();
    }
    }
    class Sorting{
    public void ascending(){

            int\[\] value = {2,1,3,6,5};
            System.out.println("Sorting in ascending order");
            System.out.println("Unsorted value");       // Print unsorted array.
             for (int s : value)
               System.out.print(s + " ");
             System.out.println("\\n");
             Arrays.sort(value); // Sort in ascending
             System.out.println("sorted value ascending");       // Print unsorted array.
             for (int s : value)
                    System.out.print(s + " ");
             System.out.println("\\n");
     }
     public void descending(){
    
            Integer\[\] value = {2,1,3,6,5};
            System.out.println("Sorting in descending order");
            System.out.println("Unsorted value");       // Print unsorted array.
             for (int s : value)
               System.out.print(s + " ");
             System.out.println("\\n");
             Arrays.sort(value, Collections.reverseOrder());
             System.out.println("Sorted Descending");       // Print unsorted array.
             for (int s : value)
               System.out.print(s + " ");
             System.out.println("\\n");
     }}
    

    Please explain why is it happen so.. it bit strange for me. and thanks a lot.

    Java java data-structures help tutorial

  • Sort Array in ascending and descding
    N nt_virus

    I read the documentation now, I didn't find descending. There is a way by Comparator .. but its lengthy .. Any other way .. please tell.

    Java java data-structures help tutorial

  • Sort Array in ascending and descding
    N nt_virus

    thanks I did ascending..

    public class Main{
    public static void main(String[] args) {
    int[] value = {2,1,3,6,5};
    System.out.println("Unsorted value"); // Print unsorted array.
    for (int s : value)
    System.out.print(s + " ");
    System.out.println("\n");
    Arrays.sort(value); // Sort array

        System.out.println("sorted value ascending");       // Print unsorted array.
        for (int s : value)
            System.out.print(s + " ");
        System.out.println("\\n");      
    }}
    

    please tell how to do descending...

    Java java data-structures help tutorial

  • Sort Array in ascending and descding
    N nt_virus

    Hi. I m running this code.

    import java.util.*;
    public class Main{
    public static void main(String[] args) {
    int[] value = {2,1,3,6,5};
    System.out.println(value); // Print unsorted array.
    Arrays.sort(value); // Sort array
    System.out.println(value); //
    }}

    The output is showing.. run: [I@3e25a5 [I@3e25a5 why is it so.. I m confused.. Please help me. Also please tell me how to do in descending order by user input. Collections class will do with List

    Java java data-structures help tutorial

  • Remote DML/DDL from different Nodes to MS SQL Server 2005
    N nt_virus

    Thanks.. Sorry to say from my above post regarding this Suppose when I open SQL Server 2005 and Run the Insert Query on a table then that insert should ALSO reflect in SERVER. We don't care if that Data will store in Client side too This will provide inconsistency if 1 client is used to re-enter the data already entered by other client. So I think, continuous Synchronization should be there between databases as soon as any DDL/DML operation will done. How to achieve this ?

    Database database sql-server sysadmin help tutorial

  • Remote DML/DDL from different Nodes to MS SQL Server 2005
    N nt_virus

    Sorry I didn't get you mate. All PCs have Developer Edition [DE]. And application are made by me and my friends. Suppose when I open SQL Server 2005 and Run the Insert Query on a table then that insert should ALSO reflect in SERVER. We don't care if that Data will store in Client side too.

    Database database sql-server sysadmin help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups