User Profile

Collapse

Profile Sidebar

Collapse
huiling25
huiling25
Last Activity: Aug 3 '10, 12:44 AM
Joined: Dec 11 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Code to print documents with 2 printers

    I managed to come out with the code. But when the folder "PrintAll" has 4 documents, the computer will hang and spool error will occur. If "PrintAll" folder has only 1 document, this code run smoothly.


    Code:
    Set WshNetwork = WScript.CreateObject("WScript.NetWork") 
    
    
    set shApp = createobject("shell.application")
    ...
    See more | Go to post

    Leave a comment:


  • I have found another way to print files from a folder. However, it can't print .prn or .doc files.

    Here is the code of "printall.v bs"

    Code:
    set shApp = createobject("shell.application") 
    set shFolder = shApp.namespace("C:\Documents and Settings\Administrator\Desktop\Form 
    Generator\PrintAll") 
    set shItems = shFolder.Items() 
    for each shItem in shItems
    ...
    See more | Go to post

    Leave a comment:


  • How to execute batch file with a pathname using Javascript? (Windows XP and IE)

    I tried for several days, but none can work. IE keep showing yellow exclamation mark at the status bar after clicking "Submit" and batch file cannot be executed. The HTML file and batch file is in the same folder.

    Here is the code for printpage.html
    Code:
    <html>
    <head>
    <script language="javascript" type="text/javascript">
    function printFile()
    {
       var
    ...
    See more | Go to post

  • I have changed my code a little.. I managed to do a little dfs.. but i am unable to get the value of the top item on the stack...

    Graph.java
    Code:
    public class Graph {
    	int		arraySize, graphSize;
            int row=0,col=0;
    	ListNode	node[];
            int[][] matrix;
            
                boolean[] visited;
    
    	public Graph() {	// constructor
    		arraySize = 10;
    		graphSize
    ...
    See more | Go to post

    Leave a comment:


  • huiling25
    started a topic Need HELP in Depth-First-Iterative Graph Traversal
    in Java

    Need HELP in Depth-First-Iterative Graph Traversal

    I was given the pseudo code.. but i still cannot figure out how to do it... how can i find if the vertices are adjacent to the vertex on stack top? I know i have to have an array of true/false (to dictate if the vertex is being visited)...
    Code:
    dfs(v)
    {    create a stack s to store visited notes
        s.push(v)
        while(!s.isEmpty())
        {
            if(no unvisited vertices are adjacent to the vertex on stack top)
    ...
    See more | Go to post

  • huiling25
    replied to Unable to insert into LinkedList
    in Java
    Thanx for ur help~ I solved the problem already~
    See more | Go to post

    Leave a comment:


  • huiling25
    started a topic Unable to insert into LinkedList
    in Java

    Unable to insert into LinkedList

    I don't know why the customer records cannot be inserted into the linked list and the head of the linked list keep pointing to null...
    Code:
    //ListNode.java
    public class ListNode{
        private Object item;
        private ListNode next,head;
        public ListNode(Object newItem)
        {    item = newItem;    next = null;     }
        public ListNode(Object newItem, ListNode newNext)
        {    item = newItem;
    ...
    See more | Go to post

  • huiling25
    started a topic Linking 2 Linked Lists together
    in Java

    Linking 2 Linked Lists together

    I have a Customer.java and a Transaction.jav a Transaction is when the user wants to deposit money. Customer.java includes the particulars of the user such as Name, AccountID, Balance etc. I have a LinkedList for Customer and a LinkedList for Transaction. How can i link the 2 together?

    Code:
    #
    //ListNode.java
    public class ListNode{
        private Object item;
        private ListNode next,head;
        public ListNode(Object
    ...
    See more | Go to post

  • huiling25
    replied to Help on Linked Lists
    in Java
    I see, thanx for all your help~...
    See more | Go to post

    Leave a comment:


  • huiling25
    replied to Help on Linked Lists
    in Java
    Hmm, so, i don't need to use the LinkedList() or ListNode() to help me print out the data?
    See more | Go to post

    Leave a comment:


  • huiling25
    started a topic Help on Linked Lists
    in Java

    Help on Linked Lists

    I have a file containing all the customer records. I had a program to read from the file and store using LinkedLists. Each Node is each customer record. Each customer record have AccID, Add, PhoneNum, etc.. All the accID, add are stored in an array. My question is how can I get all the names, ids all printed out?

    Code:
    //ListNode.java
    public class ListNode{
        private Object item;
        private ListNode next,head;
    ...
    See more | Go to post

  • huiling25
    replied to HELP!! About 2D and 1D arrays
    in Java
    Here is the solution:

    Code:
    queryIDArray(length of 3) and srnIDArray(length of 2)
    int[] xArray = new int[queryIDArray.length*scrnIDArray.length];
    int[] yArray = new int[queryIDArray.length*scrnIDArray.length];
    float[] valueArray = new float[queryIDArray.length*scrnIDArray.length];
    
    int k=0;
    
    for(int i=0;i<queryIDArray.length;i++)
    {
    	for(int j=0;j<scrnIDArray.length;j++)
    ...
    See more | Go to post

    Leave a comment:


  • huiling25
    replied to HELP!! About 2D and 1D arrays
    in Java
    There is an error in my typing, it should be
    Code:
    In score 2D array:
    [ i ] [ j ]    [ value ]
      0    0          1.0
      0    1          0.24 //should be 0.24 instead of 0.04
      1    0          0.24 
      1    1          1.0
      2    0          0.15
      2    1          0.14
    Instead of removing duplicates, how can i check when matching 1D (i.e. newArray) against 2D (i.e. score), check that when it matches...
    See more | Go to post

    Leave a comment:


  • huiling25
    started a topic HELP!! About 2D and 1D arrays
    in Java

    HELP!! About 2D and 1D arrays

    I'm matching the value of each of the 2D array against 1D Array. 1D array is actually the conversion of 2D to 1D array, so that i can use Arrays.sort() to sort the array to ascending order. However when i'm printing out, it give me extra values. I should have 6 values printed out only.
    Code:
    In score 2D array:
    [ i ] [ j ]    [ value ]
      0    0          1.0
      0    1          0.04
      1    0          0.24 
      1    1
    ...
    See more | Go to post

  • Thanks for the solution, it works now....
    See more | Go to post

    Leave a comment:


  • huiling25
    started a topic HELP!! My program cannot work for float array
    in Java

    HELP!! My program cannot work for float array

    My program works alright for integer array, but not float array. How can I change the program so that I can get the original position of each element in the float array after sorting? Let's say my float array is {5.0f,10.0f,1.0 f,15.0f}.
    Here's my code:
    Code:
    import java.util.*;
    
    public class SortArrays
    {
    	public static void main(String args[])
    	{
    		Integer[] score = {5, 10, 0, 1, 15};
    ...
    See more | Go to post

  • huiling25
    replied to HELP!!Retrieve product number from SDF file
    in Java
    Thanx for the suggestion, the suggestion works....
    See more | Go to post

    Leave a comment:


  • huiling25
    replied to HELP!!Retrieve product number from SDF file
    in Java
    Oh yah, I had paste the wrong one here. Here is my correct code:
    Code:
    Scanner inFile = new Scanner(new FileReader("merlin3.sdf"));
    while(inFile.hasNext("-ISIS-"))
    {
    	String line = inFile.nextLine();
    	String pdt = line.replaceAll("-ISIS-","");
    	String pdtNo = pdt.trim();
    	System.out.println(pdtNo);
    }
    Is there any way I can loop the whole file and retrieve...
    See more | Go to post

    Leave a comment:


  • huiling25
    started a topic HELP!!Retrieve product number from SDF file
    in Java

    HELP!!Retrieve product number from SDF file

    I have a sdf file, i wan to retrieve product numbers from the file. However, when i print out, it only printed out the first product number(02230416 222D). There are supposed to be 2 products numbers, does anyone knows why my program only loop 1 time?
    This is how the sdf file looks like:
    Code:
      -ISIS-  02230416222D
    
     17 18  0  0  0  0  0  0  0  0999 V2000
    
    ......
    $$$$//this is end of the first product
    ...
    See more | Go to post

  • huiling25
    replied to HELP!!BitSet set() returns null..
    in Java
    Thanks, it work out already. =)...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...