Splitting list
Which is the best way for splitting a list of objects in a set of lists?
I have solved my problem with following code:
private List<Object> splitInsertOperations(List<Object> toSplit)
int range = 24; //max length for every trunked list
List<List<Object>> splittedList = new ArrayList<Object>();
ListIterator<Object> iterator = toSplit.listIterator();
int stop = 0;
while(true){
List<PBCPOperation> trunkList = new ArrayList<PBCPOperation>(range);
while( (stop = iterator.nextIndex()) != toSplit.size() ){
trunkList.add(iterator.next());
if( stop != 0 && (stop%(range-1)) == 0){
break;
System.out.println(start + " - " + stop);
start = stop + 1;
splittedList.add(trunkList);
if(stop == toStore.size()){
break;
return splittedList;
}
Similar Messages
-
Anyone know if there is any plugin (or app) for Finder that split list view in 2 independent columns, so I could drag and drop files (and folders) between folders more easily?
Path Finder have this feature, but I wish to keep in finder (its free and follows the "less is more" idea).It's what I've been doing... I just thought that an plugin like these wouldn't be so hard to find! But that's alright!
Thank's everybody!
Message was edited by: Cesar Lucci
Message was edited by: Cesar Lucci -
Hi all,
We are using oracle database (10.2.0.4 64bit) and OS AIX (6.1).
We have list partition table. On column sale two values (1 or 0) are stored.
Table has two partition DAILY_ISSUANCE_SALE_FACT_1 for value (1) and DAILY_ISSUANCE_SALE_FACT_0 for value (0).
Due to huge size of table, we want to split partition DAILY_ISSUANCE_SALE_FACT_1 and DAILY_ISSUANCE_SALE_FACT_0.
How I can splite these two partitions with values 1 and 0?We are using oracle database (10.2.0.4 64bit) and OS AIX (6.1).
We have list partition table. On column sale two values (1 or 0) are stored.
Table has two partition DAILY_ISSUANCE_SALE_FACT_1 for value (1) and DAILY_ISSUANCE_SALE_FACT_0 for value (0).
Due to huge size of table, we want to split partition DAILY_ISSUANCE_SALE_FACT_1 and DAILY_ISSUANCE_SALE_FACT_0.
How I can splite these two partitions with values 1 and 0?
You can't - a list partition whose definition only specifies one value cannot be split. If you have specified a DEFAULT partition for the table you can split that default partition but that won't affect the two partitions that you mentioned.
You could also add a new partition but that won't affect those two partitions either.
See the 'Maintaining Partitions' section of the VLDB and Partitioning Guide
http://docs.oracle.com/cd/E18283_01/server.112/e16541/part_admin002.htm#i1007318
That section has details and examples of how to add/split partitions.
Due to huge size of table, we want to split partition
Why? What are you trying to accomplish? What difference does it make if the table is 'huge'? Can you tell us precisely when the table became huge? Does that mean that the day before it was not huge but that now it is?
Large tables are generally partitioned to either improve performance of queries or to improve the performance of maintenance operations (e. g. delete/remove older data, add new daily data).
What PROBLEM are you trying to solve? Post info (query, execution plan, etc - see the FAQ for how to post a tuning request) that demonstrates the problem you think you have and we can help you solve it. -
How to split list of columns into 2 tables in SSIS 2012?
Hi,
I have 200 columns in Source. Now i want to split these columns, few into Destination A and few more columns into
Destination B. Multi cast i tried to use, but it coping all the columns . Any help would be appreciated. Thanks in Advance.
Lets assume i have columns A,B,C,D,E..
i want to move Columns A,B,D into destination A and
columns A,C,D,E INTO Destination B. please help me to implement this logic?Hi vasu_479,
Based on your description, you want to split columns in source table into two destination tables.
After testing the scenario in my environment, we can use Multicast to achieve your requirement. Just as you said, the Multicast would return all columns. But we can use the method below to achieve the goal:
If the destination tables are existing tables, we can just map column A, B and D as Input Columns to the corresponding Destination Columns in the Mapping tab for destination A. Then map column A, C, D and E in destination B.
If the destination tables are created in the Destination component, we can modify the create table query to directly create A, B and D for destination table A, create A, C, D and E for destination table B. Then there columns would be automatically mapped
in the Mappings pane.
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Splitting a Linked List at a Given Node, into Two Sublists??
My code just will not work!! Any help would be appreciated! My problem is in the last method SplitAt. These are the conditions set and my code:
Splitting a Linked List at a Given Node, into Two Sublists
a. Add the following as an abstract method to the class
LinkedListClass:
public void splitAt (LinkedListClass<T> secondList, T item);
//This method splits the list at the node with the info item into two sublists.
//Precondition: The list must exist.
//Postcondition: first and last point to the first and last nodes of the first sublist,
// respectively. secondList.first and secondList.last point to the first
// and last nodes of the second sublist.
Consider the following statements:
UnorderedLinkedList<Integer> myList;
UnorderedLinkedList<Integer> otherList;
Suppose myList points to the list with the elements 34, 65, 18, 39, 27, 89, and 12 (in this order). The statement
myList.splitAt(otherList, 18);
splits myList into two sublists: myList points to the list with elements 34 and 65, and otherList points to the sublist with elements 18, 39, 27, 89, and 12.
b. Provide the definition of the method splitAt in the class UnorderedLinkedList. Also write a program to test your method.
public class UnorderedLinkedList<T> extends LinkedListClass<T>
//Default constructor
public UnorderedLinkedList()
super();
//Method to determine whether searchItem is in
//the list.
//Postcondition: Returns true if searchItem is found
// in the list; false otherwise.
public boolean search(T searchItem)
LinkedListNode<T> current; //variable to traverse
//the list
boolean found;
current = first; //set current to point to the first
//node in the list
found = false; //set found to false
while (current != null && !found) //search the list
if (current.info.equals(searchItem)) //item is found
found = true;
else
current = current.link; //make current point to
//the next node
return found;
//Method to insert newItem in the list.
//Postcondition: first points to the new list
// and newItem is inserted at the
// beginning of the list. Also,
// last points to the last node and
// count is incremented by 1.
public void insertFirst(T newItem)
LinkedListNode<T> newNode; //variable to create the
//new node
newNode =
new LinkedListNode<T>(newItem, first); //create and
//insert newNode before
//first
first = newNode; //make first point to the
//actual first node
if (last == null) //if the list was empty, newNode is
//also the last node in the list
last = newNode;
count++; //increment count
//Method to insert newItem at the end of the list.
//Postcondition: first points to the new list and
// newItem is inserted at the end
// of the list. Also, last points to
// the last node and
// count is incremented by 1.
public void insertLast(T newItem)
LinkedListNode newNode; //variable to create the
//new node
newNode =
new LinkedListNode(newItem, null); //create newNode
if (first == null) //if the list is empty, newNode is
//both the first and last node
first = newNode;
last = newNode;
else //if the list is not empty, insert
//newNode after last
last.link = newNode; //insert newNode after last
last = newNode; //set last to point to the
//actual last node
count++;
}//end insertLast
//Method to delete deleteItem from the list.
//Postcondition: If found, the node containing
// deleteItem is deleted from the
// list. Also, first points to the first
// node, last points to the last
// node of the updated list, and count
// is decremented by 1.
public void deleteNode(T deleteItem)
LinkedListNode<T> current; //variable to traverse
//the list
LinkedListNode<T> trailCurrent; //variable just
//before current
boolean found;
if ( first == null) //Case 1; the list is empty
System.err.println("Cannot delete from an empty "
+ "list.");
else
if (first.info.equals(deleteItem)) //Case 2
first = first.link;
if (first == null) //the list had only one node
last = null;
count--;
else //search the list for the given info
found = false;
trailCurrent = first; //set trailCurrent to
//point to the first node
current = first.link; //set current to point to
//the second node
while (current != null && !found)
if (current.info.equals(deleteItem))
found = true;
else
trailCurrent = current;
current = current.link;
}//end while
if (found) //Case 3; if found, delete the node
count--;
trailCurrent.link = current.link;
if (last == current) //node to be deleted
//was the last node
last = trailCurrent; //update the value
//of last
else
System.out.println("Item to be deleted is "
+ "not in the list.");
}//end else
}//end else
}//end deleteNode
public void splitAt(LinkedListClass<T> secondList, T item)
LinkedListNode<T> current;
LinkedListNode<T> trailCurrent;
int i;
boolean found;
if (first==null)
System.out.println("Empty.");
first=null;
last=null;
count--;
else
current=first;
found=false;
i=1;
while(current !=null &&!found)
if(current.info.equals(secondList))
found= true;
else
trailCurrent=current;
i++;
if(found)
if(first==current)
first=first;
last=last;
count=count;
count=0;
else
first=current;
last=last;
last=null;
count = count- i+1;
count = i-1;
else
System.out.println("Item to be split at is "
+ "not in the list.");
first=null;
last=null;
count=0;
}I dont have a test program at all. The program is supposed to prompt for user input of numbers. (it does) Take the input and end at input of -999 (it does). Then it asks user where it wants to split list (it does). When I enter a number it does nothing after that. I am going to post updated code and see if that helps along with all the classes. Thanks!
This is the class to prompt:
import java.util.*;
public class Ch16_ProgEx6
static Scanner console = new Scanner(System.in);
public static void main(String[] args)
UnorderedLinkedList<Integer> list
= new UnorderedLinkedList<Integer>();
UnorderedLinkedList<Integer> subList =
new UnorderedLinkedList<Integer>();
Integer num;
System.out.println("Enter integers ending with -999.");
num = console.nextInt();
while (num != -999)
list.insertLast(num);
num = console.nextInt();
System.out.println();
System.out.println("list: ");
list.print();
System.out.println();
System.out.println("Length of list: " + list.length());
System.out.print("Enter the number at which to split list: ");
num = console.nextInt();
list.splitAt(subList, num);
System.out.println("Lists after splitting list");
System.out.print("list: ");
list.print();
System.out.println();
System.out.println("Length of list: " + list.length());
System.out.print("sublist: ");
subList.print();
System.out.println();
System.out.println("Length of sublist: " + subList.length());
}This is the ADT:
public interface LinkedListADT<T> extends Cloneable
public Object clone();
//Returns a copy of objects data in store.
//This method clones only the references stored in
//each node of the list. The objects that the
//list nodes point to are not cloned.
public boolean isEmptyList();
//Method to determine whether the list is empty.
//Postcondition: Returns true if the list is empty;
// false otherwise.
public void initializeList();
//Method to initialize the list to an empty state.
//Postcondition: The list is initialized to an empty
// state.
public void print();
//Method to output the data contained in each node.
public int length();
//Method to return the number of nodes in the list.
//Postcondition: The number of nodes in the list is
// returned.
public T front();
//Method to return a reference of the object containing
//the data of the first node of the list.
//Precondition: The list must exist and must not be empty.
//Postcondition: The reference of the object that
// contains the info of the first node
// is returned.
public T back();
//Method to return a reference of object containing
//the data of the last node of the list.
//Precondition: The list must exist and must not be empty.
//Postcondition: The reference of the object that
// contains the info of the last node
// is returned.
public boolean search(T searchItem);
//Method to determine whether searchItem is in the list.
//Postcondition: Returns true if searchItem is found
// in the list; false otherwise.
public void insertFirst(T newItem);
//Method to insert newItem in the list.
//Postcondition: newItem is inserted at the
// beginning of the list.
public void insertLast(T newItem);
//Method to insert newItem at the end of the list.
//Postcondition: newItem is inserted at the end
// of the list.
public void deleteNode(T deleteItem);
//Method to delete deleteItem from the list.
//Postcondition: If found, the node containing
// deleteItem is deleted from the
// list.
public void splitAt(LinkedListClass<T> secondList, T item);
}This is the linked list class:
import java.util.NoSuchElementException;
public abstract class LinkedListClass<T> implements LinkedListADT<T>
protected class LinkedListNode<T> implements Cloneable
public T info;
public LinkedListNode<T> link;
//Default constructor
//Postcondition: info = null; link = null;
public LinkedListNode()
info = null;
link = null;
//Constructor with parameters
//This method sets info pointing to the object to
//which elem points to and link is set to point to
//the object to which ptr points to.
//Postcondition: info = elem; link = ptr;
public LinkedListNode(T elem, LinkedListNode<T> ptr)
info = elem;
link = ptr;
//Returns a copy of objects data in store.
//This method clones only the references stored in
//the node. The objects that the nodes point to
//are not cloned.
public Object clone()
LinkedListNode<T> copy = null;
try
copy = (LinkedListNode<T>) super.clone();
catch (CloneNotSupportedException e)
return null;
return copy;
//Method to return the info as a string.
//Postcondition: info as a String object is
// returned.
public String toString()
return info.toString();
} //end class LinkedListNode
public class LinkedListIterator<T>
protected LinkedListNode<T> current; //variable to
//point to the
//current node in
//list
protected LinkedListNode<T> previous; //variable to
//point to the
//node before the
//current node
//Default constructor
//Sets current to point to the first node in the
//list and sets previous to null.
//Postcondition: current = first; previous = null;
public LinkedListIterator()
current = (LinkedListNode<T>) first;
previous = null;
//Method to reset the iterator to the first node
//in the list.
//Postcondition: current = first; previous = null;
public void reset()
current = (LinkedListNode<T>) first;
previous = null;
//Method to return a reference of the info of the
//current node in the list and to advance iterator
//to the next node.
//Postcondition: previous = current;
// current = current.link;
// A refrence of the current node
// is returned.
public T next()
if (!hasNext())
throw new NoSuchElementException();
LinkedListNode<T> temp = current;
previous = current;
current = current.link;
return temp.info;
//Method to determine whether there is a next
//element in the list.
//Postcondition: Returns true if there is a next
// node in the list; otherwise
// returns false.
public boolean hasNext()
return (current != null);
//Method to remove the node currently pointed to
//by the iterator.
//Postcondition: If iterator is not null, then the
// node that the iterator points to
// is removed. Otherwise the method
// throws NoSuchElementException.
public void remove()
if (current == null)
throw new NoSuchElementException();
if (current == first)
first = first.link;
current = (LinkedListNode<T>) first;
previous = null;
if (first == null)
last = null;
else
previous.link = current.link;
if (current == last)
last = first;
while (last.link != null)
last = last.link;
current = current.link;
count--;
//Method to return the info as a string.
//Postcondition: info as a String object is returned.
public String toString()
return current.info.toString();
} //end class LinkedListIterator
//Instance variables of the class LinkedListClass
protected LinkedListNode<T> first; //variable to store the
//address of the first
//node of the list
protected LinkedListNode<T> last; //variable to store the
//address of the last
//node of the list
protected int count; //variable to store the number of
//nodes in the list
//Default constructor
//Initializes the list to an empty state.
//Postcondition: first = null, last = null,
// count = 0
public LinkedListClass()
first = null;
last = null;
count = 0;
//Method to determine whether the list is empty.
//Postcondition: Returns true if the list is empty;
// false otherwise.
public boolean isEmptyList()
return (first == null);
//Method to initialize the list to an empty state.
//Postcondition: first = null, last = null,
// count = 0
public void initializeList()
first = null;
last = null;
count = 0;
//Method to output the data contained in each node.
public void print()
LinkedListNode<T> current; //variable to traverse
//the list
current = first; //set current so that it points to
//the first node
while (current != null) //while more data to print
System.out.print(current.info + " ");
current = current.link;
}//end print
//Method to return the number of nodes in the list.
//Postcondition: The value of count is returned.
public int length()
return count;
//Method to return a reference of the object containing
//the data of the first node of the list.
//Precondition: The list must exist and must not be empty.
//Postcondition: The reference of the object that
// contains the info of the first node
// is returned.
public T front()
return first.info;
//Method to return a reference of object containing
//the data of the last node of the list.
//Precondition: The list must exist and must not be empty.
//Postcondition: The reference of the object that
// contains the info of the last node
// is returned.
public T back()
return last.info;
//Returns a copy of objects data in store.
//This method clones only the references stored in
//each node of the list. The objects that the
//list nodes point to are not cloned.
public Object clone()
LinkedListClass<T> copy = null;
try
copy = (LinkedListClass<T>) super.clone();
catch (CloneNotSupportedException e)
return null;
//If the list is not empty clone each node of
//the list.
if (first != null)
//Clone the first node
copy.first = (LinkedListNode<T>) first.clone();
copy.last = copy.first;
LinkedListNode<T> current;
if (first != null)
current = first.link;
else
current = null;
//Clone the remaining nodes of the list
while (current != null)
copy.last.link =
(LinkedListNode<T>) current.clone();
copy.last = copy.last.link;
current = current.link;
return copy;
//Method to return an iterator of the list.
//Postcondition: An iterator is instantiated and
// returned.
public LinkedListIterator<T> iterator()
return new LinkedListIterator<T>();
//Method to determine whether searchItem is in
//the list.
//Postcondition: Returns true if searchItem is found
// in the list; false otherwise.
public abstract boolean search(T searchItem);
//Method to insert newItem in the list.
//Postcondition: first points to the new list
// and newItem is inserted at the
// beginning of the list. Also,
// last points to the last node and
// count is incremented by 1.
public abstract void insertFirst(T newItem);
//Method to insert newItem at the end of the list.
//Postcondition: first points to the new list and
// newItem is inserted at the end
// of the list. Also, last points to
// the last node and
// count is incremented by 1.
public abstract void insertLast(T newItem);
//Method to delete deleteItem from the list.
//Postcondition: If found, the node containing
// deleteItem is deleted from the
// list. Also, first points to the first
// node, last points to the last
// node of the updated list, and count
// is decremented by 1.
public abstract void deleteNode(T deleteItem);
public abstract void splitAt(LinkedListClass<T> secondList, T item);
}And this is the UnorderedLinked Class with the very last method the one being Im stuck on. The SplitAt Method.
public class UnorderedLinkedList<T> extends LinkedListClass<T>
//Default constructor
public UnorderedLinkedList()
super();
//Method to determine whether searchItem is in
//the list.
//Postcondition: Returns true if searchItem is found
// in the list; false otherwise.
public boolean search(T searchItem)
LinkedListNode<T> current; //variable to traverse
//the list
boolean found;
current = first; //set current to point to the first
//node in the list
found = false; //set found to false
while (current != null && !found) //search the list
if (current.info.equals(searchItem)) //item is found
found = true;
else
current = current.link; //make current point to
//the next node
return found;
//Method to insert newItem in the list.
//Postcondition: first points to the new list
// and newItem is inserted at the
// beginning of the list. Also,
// last points to the last node and
// count is incremented by 1.
public void insertFirst(T newItem)
LinkedListNode<T> newNode; //variable to create the
//new node
newNode =
new LinkedListNode<T>(newItem, first); //create and
//insert newNode before
//first
first = newNode; //make first point to the
//actual first node
if (last == null) //if the list was empty, newNode is
//also the last node in the list
last = newNode;
count++; //increment count
//Method to insert newItem at the end of the list.
//Postcondition: first points to the new list and
// newItem is inserted at the end
// of the list. Also, last points to
// the last node and
// count is incremented by 1.
public void insertLast(T newItem)
LinkedListNode newNode; //variable to create the
//new node
newNode =
new LinkedListNode(newItem, null); //create newNode
if (first == null) //if the list is empty, newNode is
//both the first and last node
first = newNode;
last = newNode;
else //if the list is not empty, insert
//newNode after last
last.link = newNode; //insert newNode after last
last = newNode; //set last to point to the
//actual last node
count++;
}//end insertLast
//Method to delete deleteItem from the list.
//Postcondition: If found, the node containing
// deleteItem is deleted from the
// list. Also, first points to the first
// node, last points to the last
// node of the updated list, and count
// is decremented by 1.
public void deleteNode(T deleteItem)
LinkedListNode<T> current; //variable to traverse
//the list
LinkedListNode<T> trailCurrent; //variable just
//before current
boolean found;
if ( first == null) //Case 1; the list is empty
System.err.println("Cannot delete from an empty "
+ "list.");
else
if (first.info.equals(deleteItem)) //Case 2
first = first.link;
if (first == null) //the list had only one node
last = null;
count--;
else //search the list for the given info
found = false;
trailCurrent = first; //set trailCurrent to
//point to the first node
current = first.link; //set current to point to
//the second node
while (current != null && !found)
if (current.info.equals(deleteItem))
found = true;
else
trailCurrent = current;
current = current.link;
}//end while
if (found) //Case 3; if found, delete the node
count--;
trailCurrent.link = current.link;
if (last == current) //node to be deleted
//was the last node
last = trailCurrent; //update the value
//of last
else
System.out.println("Item to be deleted is "
+ "not in the list.");
}//end else
}//end else
}//end deleteNode
public void splitAt(LinkedListClass<T> secondList, T item)
LinkedListNode<T> current;
LinkedListNode<T> trailCurrent;
int i;
boolean found;
if (first==null)
System.out.println("Empty.");
first=null;
last=null;
count--;
count=0;
else
current=first;
found=false;
i=1;
while(current !=null &&!found)
if(current.info.equals(item))
found= true;
else
trailCurrent=first;
current=first;
i++;
if(found)
if(first==current)
first.link=first;
last.link=last;
count--;
count=0;
else
first.link=current;
last.link=last;
last=null;
count = count- i+1;
count = i-1;
} else {
System.out.println("Item to be split at is "
+ "not in the list.");
first=null;
last=null;
count=0;
Any help or just advice would be fine. Im not the best at Java, better at VB. Am completely stumped! Thanks so much! -
Can someone help with splitting a Linked List.??
Any help would be awesome!!!
My code just will not work!! Any help would be appreciated! My problem is in the last method SplitAt. These are the conditions set and my code:
Splitting a Linked List at a Given Node, into Two Sublists
a. Add the following as an abstract method to the class
LinkedListClass:
public void splitAt (LinkedListClass<T> secondList, T item);
//This method splits the list at the node with the info item into two sublists.
//Precondition: The list must exist.
//Postcondition: first and last point to the first and last nodes of the first sublist,
// respectively. secondList.first and secondList.last point to the first
// and last nodes of the second sublist.
Consider the following statements:
UnorderedLinkedList<Integer> myList;
UnorderedLinkedList<Integer> otherList;
Suppose myList points to the list with the elements 34, 65, 18, 39, 27, 89, and 12 (in this order). The statement
myList.splitAt(otherList, 18);
splits myList into two sublists: myList points to the list with elements 34 and 65, and otherList points to the sublist with elements 18, 39, 27, 89, and 12.
b. Provide the definition of the method splitAt in the class UnorderedLinkedList. Also write a program to test your method.
public class UnorderedLinkedList<T> extends LinkedListClass<T>
//Default constructor
public UnorderedLinkedList()
super();
//Method to determine whether searchItem is in
//the list.
//Postcondition: Returns true if searchItem is found
// in the list; false otherwise.
public boolean search(T searchItem)
LinkedListNode<T> current; //variable to traverse
//the list
boolean found;
current = first; //set current to point to the first
//node in the list
found = false; //set found to false
while (current != null && !found) //search the list
if (current.info.equals(searchItem)) //item is found
found = true;
else
current = current.link; //make current point to
//the next node
return found;
//Method to insert newItem in the list.
//Postcondition: first points to the new list
// and newItem is inserted at the
// beginning of the list. Also,
// last points to the last node and
// count is incremented by 1.
public void insertFirst(T newItem)
LinkedListNode<T> newNode; //variable to create the
//new node
newNode =
new LinkedListNode<T>(newItem, first); //create and
//insert newNode before
//first
first = newNode; //make first point to the
//actual first node
if (last == null) //if the list was empty, newNode is
//also the last node in the list
last = newNode;
count++; //increment count
//Method to insert newItem at the end of the list.
//Postcondition: first points to the new list and
// newItem is inserted at the end
// of the list. Also, last points to
// the last node and
// count is incremented by 1.
public void insertLast(T newItem)
LinkedListNode newNode; //variable to create the
//new node
newNode =
new LinkedListNode(newItem, null); //create newNode
if (first == null) //if the list is empty, newNode is
//both the first and last node
first = newNode;
last = newNode;
else //if the list is not empty, insert
//newNode after last
last.link = newNode; //insert newNode after last
last = newNode; //set last to point to the
//actual last node
count++;
}//end insertLast
//Method to delete deleteItem from the list.
//Postcondition: If found, the node containing
// deleteItem is deleted from the
// list. Also, first points to the first
// node, last points to the last
// node of the updated list, and count
// is decremented by 1.
public void deleteNode(T deleteItem)
LinkedListNode<T> current; //variable to traverse
//the list
LinkedListNode<T> trailCurrent; //variable just
//before current
boolean found;
if ( first == null) //Case 1; the list is empty
System.err.println("Cannot delete from an empty "
+ "list.");
else
if (first.info.equals(deleteItem)) //Case 2
first = first.link;
if (first == null) //the list had only one node
last = null;
count--;
else //search the list for the given info
found = false;
trailCurrent = first; //set trailCurrent to
//point to the first node
current = first.link; //set current to point to
//the second node
while (current != null && !found)
if (current.info.equals(deleteItem))
found = true;
else
trailCurrent = current;
current = current.link;
}//end while
if (found) //Case 3; if found, delete the node
count--;
trailCurrent.link = current.link;
if (last == current) //node to be deleted
//was the last node
last = trailCurrent; //update the value
//of last
else
System.out.println("Item to be deleted is "
+ "not in the list.");
}//end else
}//end else
}//end deleteNode
public void splitAt(LinkedListClass<T> secondList, T item)
LinkedListNode<T> current;
LinkedListNode<T> trailCurrent;
int i;
boolean found;
if (first==null)
System.out.println("Empty.");
first=null;
last=null;
count--;
else
current=first;
found=false;
i=1;
while(current !=null &&!found)
if(current.info.equals(secondList))
found= true;
else
trailCurrent=current;
i++;
if(found)
if(first==current)
first=first;
last=last;
count=count;
count=0;
else
first=current;
last=last;
last=null;
count = count- i+1;
count = i-1;
else
System.out.println("Item to be split at is "
+ "not in the list.");
first=null;
last=null;
count=0;
}Edited by: romeAbides on Oct 10, 2008 1:24 PMI dont have a test program at all. The program is supposed to prompt for user input of numbers. (it does) Take the input and end at input of -999 (it does). Then it asks user where it wants to split list (it does). When I enter a number it does nothing after that. I am going to post updated code and see if that helps along with all the classes. Thanks!
This is the class to prompt:
import java.util.*;
public class Ch16_ProgEx6
static Scanner console = new Scanner(System.in);
public static void main(String[] args)
UnorderedLinkedList<Integer> list
= new UnorderedLinkedList<Integer>();
UnorderedLinkedList<Integer> subList =
new UnorderedLinkedList<Integer>();
Integer num;
System.out.println("Enter integers ending with -999.");
num = console.nextInt();
while (num != -999)
list.insertLast(num);
num = console.nextInt();
System.out.println();
System.out.println("list: ");
list.print();
System.out.println();
System.out.println("Length of list: " + list.length());
System.out.print("Enter the number at which to split list: ");
num = console.nextInt();
list.splitAt(subList, num);
System.out.println("Lists after splitting list");
System.out.print("list: ");
list.print();
System.out.println();
System.out.println("Length of list: " + list.length());
System.out.print("sublist: ");
subList.print();
System.out.println();
System.out.println("Length of sublist: " + subList.length());
}This is the ADT:
public interface LinkedListADT<T> extends Cloneable
public Object clone();
//Returns a copy of objects data in store.
//This method clones only the references stored in
//each node of the list. The objects that the
//list nodes point to are not cloned.
public boolean isEmptyList();
//Method to determine whether the list is empty.
//Postcondition: Returns true if the list is empty;
// false otherwise.
public void initializeList();
//Method to initialize the list to an empty state.
//Postcondition: The list is initialized to an empty
// state.
public void print();
//Method to output the data contained in each node.
public int length();
//Method to return the number of nodes in the list.
//Postcondition: The number of nodes in the list is
// returned.
public T front();
//Method to return a reference of the object containing
//the data of the first node of the list.
//Precondition: The list must exist and must not be empty.
//Postcondition: The reference of the object that
// contains the info of the first node
// is returned.
public T back();
//Method to return a reference of object containing
//the data of the last node of the list.
//Precondition: The list must exist and must not be empty.
//Postcondition: The reference of the object that
// contains the info of the last node
// is returned.
public boolean search(T searchItem);
//Method to determine whether searchItem is in the list.
//Postcondition: Returns true if searchItem is found
// in the list; false otherwise.
public void insertFirst(T newItem);
//Method to insert newItem in the list.
//Postcondition: newItem is inserted at the
// beginning of the list.
public void insertLast(T newItem);
//Method to insert newItem at the end of the list.
//Postcondition: newItem is inserted at the end
// of the list.
public void deleteNode(T deleteItem);
//Method to delete deleteItem from the list.
//Postcondition: If found, the node containing
// deleteItem is deleted from the
// list.
public void splitAt(LinkedListClass<T> secondList, T item);
}This is the linked list class:
import java.util.NoSuchElementException;
public abstract class LinkedListClass<T> implements LinkedListADT<T>
protected class LinkedListNode<T> implements Cloneable
public T info;
public LinkedListNode<T> link;
//Default constructor
//Postcondition: info = null; link = null;
public LinkedListNode()
info = null;
link = null;
//Constructor with parameters
//This method sets info pointing to the object to
//which elem points to and link is set to point to
//the object to which ptr points to.
//Postcondition: info = elem; link = ptr;
public LinkedListNode(T elem, LinkedListNode<T> ptr)
info = elem;
link = ptr;
//Returns a copy of objects data in store.
//This method clones only the references stored in
//the node. The objects that the nodes point to
//are not cloned.
public Object clone()
LinkedListNode<T> copy = null;
try
copy = (LinkedListNode<T>) super.clone();
catch (CloneNotSupportedException e)
return null;
return copy;
//Method to return the info as a string.
//Postcondition: info as a String object is
// returned.
public String toString()
return info.toString();
} //end class LinkedListNode
public class LinkedListIterator<T>
protected LinkedListNode<T> current; //variable to
//point to the
//current node in
//list
protected LinkedListNode<T> previous; //variable to
//point to the
//node before the
//current node
//Default constructor
//Sets current to point to the first node in the
//list and sets previous to null.
//Postcondition: current = first; previous = null;
public LinkedListIterator()
current = (LinkedListNode<T>) first;
previous = null;
//Method to reset the iterator to the first node
//in the list.
//Postcondition: current = first; previous = null;
public void reset()
current = (LinkedListNode<T>) first;
previous = null;
//Method to return a reference of the info of the
//current node in the list and to advance iterator
//to the next node.
//Postcondition: previous = current;
// current = current.link;
// A refrence of the current node
// is returned.
public T next()
if (!hasNext())
throw new NoSuchElementException();
LinkedListNode<T> temp = current;
previous = current;
current = current.link;
return temp.info;
//Method to determine whether there is a next
//element in the list.
//Postcondition: Returns true if there is a next
// node in the list; otherwise
// returns false.
public boolean hasNext()
return (current != null);
//Method to remove the node currently pointed to
//by the iterator.
//Postcondition: If iterator is not null, then the
// node that the iterator points to
// is removed. Otherwise the method
// throws NoSuchElementException.
public void remove()
if (current == null)
throw new NoSuchElementException();
if (current == first)
first = first.link;
current = (LinkedListNode<T>) first;
previous = null;
if (first == null)
last = null;
else
previous.link = current.link;
if (current == last)
last = first;
while (last.link != null)
last = last.link;
current = current.link;
count--;
//Method to return the info as a string.
//Postcondition: info as a String object is returned.
public String toString()
return current.info.toString();
} //end class LinkedListIterator
//Instance variables of the class LinkedListClass
protected LinkedListNode<T> first; //variable to store the
//address of the first
//node of the list
protected LinkedListNode<T> last; //variable to store the
//address of the last
//node of the list
protected int count; //variable to store the number of
//nodes in the list
//Default constructor
//Initializes the list to an empty state.
//Postcondition: first = null, last = null,
// count = 0
public LinkedListClass()
first = null;
last = null;
count = 0;
//Method to determine whether the list is empty.
//Postcondition: Returns true if the list is empty;
// false otherwise.
public boolean isEmptyList()
return (first == null);
//Method to initialize the list to an empty state.
//Postcondition: first = null, last = null,
// count = 0
public void initializeList()
first = null;
last = null;
count = 0;
//Method to output the data contained in each node.
public void print()
LinkedListNode<T> current; //variable to traverse
//the list
current = first; //set current so that it points to
//the first node
while (current != null) //while more data to print
System.out.print(current.info + " ");
current = current.link;
}//end print
//Method to return the number of nodes in the list.
//Postcondition: The value of count is returned.
public int length()
return count;
//Method to return a reference of the object containing
//the data of the first node of the list.
//Precondition: The list must exist and must not be empty.
//Postcondition: The reference of the object that
// contains the info of the first node
// is returned.
public T front()
return first.info;
//Method to return a reference of object containing
//the data of the last node of the list.
//Precondition: The list must exist and must not be empty.
//Postcondition: The reference of the object that
// contains the info of the last node
// is returned.
public T back()
return last.info;
//Returns a copy of objects data in store.
//This method clones only the references stored in
//each node of the list. The objects that the
//list nodes point to are not cloned.
public Object clone()
LinkedListClass<T> copy = null;
try
copy = (LinkedListClass<T>) super.clone();
catch (CloneNotSupportedException e)
return null;
//If the list is not empty clone each node of
//the list.
if (first != null)
//Clone the first node
copy.first = (LinkedListNode<T>) first.clone();
copy.last = copy.first;
LinkedListNode<T> current;
if (first != null)
current = first.link;
else
current = null;
//Clone the remaining nodes of the list
while (current != null)
copy.last.link =
(LinkedListNode<T>) current.clone();
copy.last = copy.last.link;
current = current.link;
return copy;
//Method to return an iterator of the list.
//Postcondition: An iterator is instantiated and
// returned.
public LinkedListIterator<T> iterator()
return new LinkedListIterator<T>();
//Method to determine whether searchItem is in
//the list.
//Postcondition: Returns true if searchItem is found
// in the list; false otherwise.
public abstract boolean search(T searchItem);
//Method to insert newItem in the list.
//Postcondition: first points to the new list
// and newItem is inserted at the
// beginning of the list. Also,
// last points to the last node and
// count is incremented by 1.
public abstract void insertFirst(T newItem);
//Method to insert newItem at the end of the list.
//Postcondition: first points to the new list and
// newItem is inserted at the end
// of the list. Also, last points to
// the last node and
// count is incremented by 1.
public abstract void insertLast(T newItem);
//Method to delete deleteItem from the list.
//Postcondition: If found, the node containing
// deleteItem is deleted from the
// list. Also, first points to the first
// node, last points to the last
// node of the updated list, and count
// is decremented by 1.
public abstract void deleteNode(T deleteItem);
public abstract void splitAt(LinkedListClass<T> secondList, T item);
}And this is the UnorderedLinked Class with the very last method the one being Im stuck on. The SplitAt Method.
public class UnorderedLinkedList<T> extends LinkedListClass<T>
//Default constructor
public UnorderedLinkedList()
super();
//Method to determine whether searchItem is in
//the list.
//Postcondition: Returns true if searchItem is found
// in the list; false otherwise.
public boolean search(T searchItem)
LinkedListNode<T> current; //variable to traverse
//the list
boolean found;
current = first; //set current to point to the first
//node in the list
found = false; //set found to false
while (current != null && !found) //search the list
if (current.info.equals(searchItem)) //item is found
found = true;
else
current = current.link; //make current point to
//the next node
return found;
//Method to insert newItem in the list.
//Postcondition: first points to the new list
// and newItem is inserted at the
// beginning of the list. Also,
// last points to the last node and
// count is incremented by 1.
public void insertFirst(T newItem)
LinkedListNode<T> newNode; //variable to create the
//new node
newNode =
new LinkedListNode<T>(newItem, first); //create and
//insert newNode before
//first
first = newNode; //make first point to the
//actual first node
if (last == null) //if the list was empty, newNode is
//also the last node in the list
last = newNode;
count++; //increment count
//Method to insert newItem at the end of the list.
//Postcondition: first points to the new list and
// newItem is inserted at the end
// of the list. Also, last points to
// the last node and
// count is incremented by 1.
public void insertLast(T newItem)
LinkedListNode newNode; //variable to create the
//new node
newNode =
new LinkedListNode(newItem, null); //create newNode
if (first == null) //if the list is empty, newNode is
//both the first and last node
first = newNode;
last = newNode;
else //if the list is not empty, insert
//newNode after last
last.link = newNode; //insert newNode after last
last = newNode; //set last to point to the
//actual last node
count++;
}//end insertLast
//Method to delete deleteItem from the list.
//Postcondition: If found, the node containing
// deleteItem is deleted from the
// list. Also, first points to the first
// node, last points to the last
// node of the updated list, and count
// is decremented by 1.
public void deleteNode(T deleteItem)
LinkedListNode<T> current; //variable to traverse
//the list
LinkedListNode<T> trailCurrent; //variable just
//before current
boolean found;
if ( first == null) //Case 1; the list is empty
System.err.println("Cannot delete from an empty "
+ "list.");
else
if (first.info.equals(deleteItem)) //Case 2
first = first.link;
if (first == null) //the list had only one node
last = null;
count--;
else //search the list for the given info
found = false;
trailCurrent = first; //set trailCurrent to
//point to the first node
current = first.link; //set current to point to
//the second node
while (current != null && !found)
if (current.info.equals(deleteItem))
found = true;
else
trailCurrent = current;
current = current.link;
}//end while
if (found) //Case 3; if found, delete the node
count--;
trailCurrent.link = current.link;
if (last == current) //node to be deleted
//was the last node
last = trailCurrent; //update the value
//of last
else
System.out.println("Item to be deleted is "
+ "not in the list.");
}//end else
}//end else
}//end deleteNode
public void splitAt(LinkedListClass<T> secondList, T item)
LinkedListNode<T> current;
LinkedListNode<T> trailCurrent;
int i;
boolean found;
if (first==null)
System.out.println("Empty.");
first=null;
last=null;
count--;
count=0;
else
current=first;
found=false;
i=1;
while(current !=null &&!found)
if(current.info.equals(item))
found= true;
else
trailCurrent=first;
current=first;
i++;
if(found)
if(first==current)
first.link=first;
last.link=last;
count--;
count=0;
else
first.link=current;
last.link=last;
last=null;
count = count- i+1;
count = i-1;
} else {
System.out.println("Item to be split at is "
+ "not in the list.");
first=null;
last=null;
count=0;
Any help or just advice would be fine. Im not the best at Java, better at VB. Am completely stumped! Thanks so much! -
Hi friends,
Developed a report where line size is upto 255. While taking print out the font size becomes very small.
Another way is to download list in notepad and then take printout. But this disturbs the column headings.
Is there any option to change the default A4 page size to A3. Or to split list in two portions vertically.
Pls help.
Thanks
anugo to transaction SPAD.
AND IN OUTPUT DEVISE CHANGE PAGE FORMAT -
ORA-14314: resulting List partition(s) must contain atleast 1 value
Hi,
Using: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production, Windows 7 Platform.
I'm trying to understand Exchange Partition and Split (List) partitioning. Below is the code I'm trying to work on:
CREATE TABLE big_table (
id NUMBER(10),
created_date DATE,
lookup_id NUMBER(10),
data VARCHAR2(50)
declare
l_lookup_id big_table.lookup_id%type;
l_create_date date;
begin
for i in 1 .. 1000000 loop
if mod(i,3) = 0 then
l_create_date := to_date('19-mar-2011','dd-mon-yyyy');
l_lookup_id := 2;
elsif mod(i,2) = 0 then
l_create_date := to_date('19-mar-2012','dd-mon-yyyy');
l_lookup_id := 1;
else
l_create_date := to_date('19-mar-2013','dd-mon-yyyy');
l_lookup_id := 3;
end if;
insert into big_table(id, created_date, lookup_id, data)
values (i, l_create_date, l_lookup_id, 'This is some data for '||i);
end loop;
commit;
end;
alter table big_table add (
constraint big_table_pk primary key (id));
exec dbms_stats.gather_table_stats(user, 'BIG_TABLE', cascade => true);
create table big_table2 (
id number(10),
created_date date,
lookup_id number(10),
data varchar2(50)
partition by list (created_date)
(partition p20991231 values (TO_DATE(' 2099-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')));
alter table big_table2 add (
constraint big_table_pk2 primary key(id));
alter table big_table2 exchange partition p20991231
with table big_table
without validation
update global indexes;
drop table big_table;
rename big_table2 to big_table;
alter table big_table rename constraint big_table_pk2 to big_table_pk;
alter index big_table_pk2 rename to big_table_pk;
exec dbms_stats.gather_table_stats(USER, 'BIG_TABLE', cascade => TRUE);
I'm trying to split the data by moving created_date=19-mar-2013 to new partition p20130319. I tried to run the below query but failed with error. Where am I doing it wrong?
Thanks.
alter table big_table
split partition p20991231 values (to_date('19-mar-2013','dd-mon-yyyy'))
into (partition p20130319
,partition p20991231
Error report:
SQL Error: ORA-14314: resulting List partition(s) must contain atleast 1 value
14314. 00000 - "resulting List partition(s) must contain atleast 1 value"
*Cause: After a SPLIT/DROP VALUE of a list partition, each resulting
partition(as applicable) must contain at least 1 value
*Action: Ensure that each of the resulting partitions contains atleast
1 valueI stand corrected.
Below are the steps I have gone through to understand:
1. How to partition a table with data in it.
2. Exchange partition.
3. Split partition (List).
4. Split data to more than 2 partitions.
Please correct me if I'm missing anything.
CREATE TABLE big_table
id NUMBER(10),
created_date DATE,
lookup_id NUMBER(10),
data VARCHAR2(50)
DECLARE
l_lookup_id big_table.lookup_id%type;
l_create_date DATE;
BEGIN
FOR i IN 1 .. 1000000
LOOP
IF mod(i,3)= 0 THEN
l_create_date := to_date('19-mar-2011','dd-mon-yyyy');
l_lookup_id := 2;
elsif mod(i,2) = 0 THEN
l_create_date := to_date('19-mar-2012','dd-mon-yyyy');
l_lookup_id := 1;
ELSE
l_create_date := to_date('19-mar-2013','dd-mon-yyyy');
l_lookup_id := 3;
END IF;
INSERT INTO big_table(id, created_date, lookup_id, data)
VALUES(i, l_create_date, l_lookup_id, 'This is some data for '||i);
END LOOP;
COMMIT;
END;
ALTER TABLE big_table ADD
(CONSTRAINT big_table_pk PRIMARY KEY (id));
EXEC dbms_stats.gather_table_stats(USER, 'BIG_TABLE', CASCADE => true);
CREATE TABLE big_table2
( id NUMBER(10),
created_date DATE,
lookup_id NUMBER(10),
data VARCHAR2(50)
partition BY list(created_date)
(partition p0319 VALUES
(TO_DATE(' 2013-03-19 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') ,TO_DATE(' 2012-03-19 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') ,TO_DATE(' 2011-03-19 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
ALTER TABLE big_table2 ADD
(CONSTRAINT big_table_pk2 PRIMARY KEY(id));
ALTER TABLE big_table2 exchange partition p0319
WITH TABLE big_table without validation
UPDATE global indexes;
DROP TABLE big_table;
RENAME big_table2 TO big_table;
ALTER TABLE big_table RENAME CONSTRAINT big_table_pk2 TO big_table_pk;
ALTER INDEX big_table_pk2 RENAME TO big_table_pk;
EXEC dbms_stats.gather_table_stats(USER, 'BIG_TABLE', CASCADE => TRUE);
SELECT p.partition_name, p.num_rows
FROM user_tab_partitions p
WHERE p.table_name = 'BIG_TABLE';
ALTER TABLE big_table split partition p0319 VALUES
(TO_DATE(' 2013-03-19 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
INTO (partition p20130319, partition p0319);
ALTER INDEX big_table_pk rebuild;
EXEC dbms_stats.gather_table_stats(USER, 'BIG_TABLE', CASCADE => TRUE);
SELECT p.partition_name, p.num_rows
FROM user_tab_partitions p
WHERE table_name = 'BIG_TABLE';
SELECT DISTINCT created_date FROM big_table partition(p20130319);
SELECT DISTINCT created_date FROM big_table partition(p0319);
ALTER TABLE big_table split partition p0319 VALUES
(TO_DATE(' 2012-03-19 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
INTO (partition p20120319, partition p20110319);
ALTER INDEX big_table_pk rebuild;
EXEC dbms_stats.gather_table_stats(USER, 'BIG_TABLE', CASCADE => TRUE);
SELECT p.partition_name, p.num_rows
FROM user_tab_partitions p
WHERE table_name = 'BIG_TABLE';
SELECT DISTINCT created_date FROM big_table partition(p20130319);
SELECT DISTINCT created_date FROM big_table partition(p20120319);
SELECT DISTINCT created_date FROM big_table partition(p20110319); -
Problems when updating amavisd-new to 2.5.0
Hi the list !
Thanks for the great tips and support we got here. I’m really newbie on mac os x server while it’s now a long time I’m on clients ones.
I wanted to follow topicdesk.com tutorials to update spamassassin and clamav as I saw here the initial conf by Apple isn’t working.
Then, I saw before updating SpamAssassin that I had to update amavisd-new first. So, I begin with this tutorial. Here’s what happened (sorry for the long-long post) :
First installed Xcode 2.4.1.
Everything was fine until the CPAN Perl Module updates, as I always had the “make had returned bad status, install seems impossible” error. Looking for some info on the net, I then understand that you have to install everything Apple suggests as if you don’t, you’ll have later problems whith “make” command (I know, I first wanted to install only gcc that seemed necessary to me, and when nothing works as expected, I had to go back and install everything ...) In fact, the missing BSD SDK was supsected to be the missing thing, but not only. Then, just install everything and this is fine.
Updated the whole asked Perl module without any problem, following the tutorial
Then Reboot the server when asked ; amavisd-new new version 2.5.0 seems OK. Then, the beginning of problems...
My smtp log which is set in debug mode shows lots of error entries such as
May 24 13:11:21 xserve postfix/smtpd[302]: connect from xxxx.adsl.hansenet.de[xxx.xxx.xxx.xxx]
May 24 13:11:22 xserve postfix/smtpd[302]: 0A64A71E1A: client=xxxx.adsl.hansenet.de[xxx.xxx.xxx.xxx]
May 24 13:11:22 xserve postfix/cleanup[349]: 0A64A71E1A: message-id=<890420070524111120@broilingwhelped>
May 24 13:11:22 xserve postfix/qmgr[74]: 0A64A71E1A: from=<[email protected]>, size=1188, nrcpt=1 (queue active)
May 24 13:11:22 xserve postfix/smtp[350]: connect to 127.0.0.1[127.0.0.1]: Connection refused (port 10024)
May 24 13:11:22 xserve postfix/smtp[350]: 0A64A71E1A: to=<[email protected]>, relay=none, delay=1, status=deferred (connect to 127.0.0.1[127.0.0.1]: Connection refused)
May 24 13:11:22 xserve postfix/smtpd[302]: disconnect from xxxx.adsl.hansenet.de[xxx.xxx.xxx.xxx]
Obviously, amavisd-new isn’t running. Then, trying sudo /usr/bin/amavisd and it say there are mistakes in the conf file. BTW, it’s not really obvious trying to migrate settings from the old conf file to the new one :
I don't understand how this old conf settings
@local_domains_acl = ( ".$mydomain" ); # $mydomain and its subdomains
@local_domains_maps = ( 1 );
# @local_domains_acl = qw(); # default is empty, no recipient treated as local
# @local_domains_acl = qw( .example.com );
# @local_domains_acl = qw( .example.com !host.sub.example.net .sub.example.net );
# @local_domains_acl = ( ".$mydomain", '.example.com', 'sub.example.net' );
has to bee changed in the new one way :
@local_domains_maps = ( [".$mydomain"] ); # $mydomain and its subdomains
# @local_domains_maps = (); # default is empty list, no recip. considered local
# @local_domains_maps = # using ACL lookup table
# ( [ ".$mydomain", 'sub.example.net', '.example.com' ] );
# @local_domains_maps = # similar, split list elements on whitespace
# ( [qw( .example.com !host.sub.example.net .sub.example.net )] );
# @local_domains_maps = ( new_RE( qr'[@.]example\.com$'i ) ); # using regexp
# @local_domains_maps = ( read_hash("$MYHOME/local_domains") ); # using hash
# perhaps combined with Postfix: mydestination = /var/amavis/local_domains
# for debugging purposes: dump_hash($local_domains_maps[0]);
Anyway, I doubt this is the (real?) reason to my problems
I correct some of these problems (in fact I forgot to look at amavis.log, but here is what it said) :
May 24 13:53:30 xserve amavis[1072]: INFO: SA version: 3.0.1, 3.000001, no optional modules: Mail::SpamAssassin::SQLBasedAddrList Net::DNS::RR::SOA Net::DNS::RR::NS Net::DNS::RR::MX Net::DNS::RR::A Net::DNS::RR::AAAA Net::DNS::RR::PTR Net::DNS::RR::CNAME Net::DNS::RR::TXT Net::CIDR::Lite Sys::Hostname::Long DBD::mysql IP::Country::Fast Mail::SPF Mail::SPF::Query Mail::SPF::Mech Mail::SPF::Mech::A Mail::SPF::Mech::All Mail::SPF::Mech::Exists Mail::SPF::Mech::IP4 Mail::SPF::Mech::IP6 Mail::SPF::Mech::Include Mail::SPF::Mech::MX Mail::SPF::Mech::PTR Mail::SPF::Mod Mail::SPF::Mod::Exp Mail::SPF::Mod::Redirect Mail::SPF::SenderIPAddrMech Mail::SPF::v1::Record Mail::SPF::v2::Record
May 24 13:53:30 xserve amavis[1072]: SpamControl: init_pre_chroot done
May 24 13:53:30 xserve amavis[1072]: Net::Server: 2007/05/24-13:53:30 Amavis (type Net::Server::PreForkSimple) starting! pid(1072)
May 24 13:53:30 xserve amavis[1072]: Net::Server: Binding to UNIX socket file /var/amavis/amavisd.sock using SOCK_STREAM
May 24 13:53:30 xserve amavis[1072]: Net::Server: Binding to TCP port 10024 on host 127.0.0.1
May 24 13:53:30 xserve amavis[1072]: Net::Server: Setting gid to "82 82"
May 24 13:53:30 xserve amavis[1072]: Net::Server: Setting uid to "82"
May 24 13:53:30 xserve amavis[1072]: Module Amavis::Conf 2.086
May 24 13:53:30 xserve amavis[1072]: Module Archive::Zip 1.18
May 24 13:53:30 xserve amavis[1072]: Module BerkeleyDB 0.26
May 24 13:53:30 xserve amavis[1072]: Module Compress::Zlib 2.004
May 24 13:53:30 xserve amavis[1072]: Module Convert::TNEF 0.17
May 24 13:53:30 xserve amavis[1072]: Module Convert::UUlib 1.08
May 24 13:53:30 xserve amavis[1072]: Module DB_File 1.810
May 24 13:53:30 xserve amavis[1072]: Module Digest::MD5 2.36
May 24 13:53:30 xserve amavis[1072]: Module MIME::Entity 5.420
May 24 13:53:30 xserve amavis[1072]: Module MIME::Parser 5.420
May 24 13:53:30 xserve amavis[1072]: Module MIME::Tools 5.420
May 24 13:53:30 xserve amavis[1072]: Module Mail::Header 1.77
May 24 13:53:30 xserve amavis[1072]: Module Mail::Internet 1.77
May 24 13:53:30 xserve amavis[1072]: Module Mail::SpamAssassin 3.000001
May 24 13:53:30 xserve amavis[1072]: Module Net::Server 0.96
May 24 13:53:30 xserve amavis[1072]: Module Net::Server::PreFork 0.96
May 24 13:53:30 xserve amavis[1072]: Module Net::Server::PreForkSimple 0.96
May 24 13:53:30 xserve amavis[1072]: Module Time::HiRes 1.9707
May 24 13:53:30 xserve amavis[1072]: Module URI 1.35
May 24 13:53:30 xserve amavis[1072]: Module Unix::Syslog 0.99
May 24 13:53:30 xserve amavis[1072]: Amavis::DB code loaded
May 24 13:53:30 xserve amavis[1072]: Amavis::Cache code loaded
May 24 13:53:30 xserve amavis[1072]: SQL base code NOT loaded
May 24 13:53:30 xserve amavis[1072]: SQL::Log code NOT loaded
May 24 13:53:30 xserve amavis[1072]: SQL::Quarantine NOT loaded
May 24 13:53:30 xserve amavis[1072]: Lookup::SQL code NOT loaded
May 24 13:53:30 xserve amavis[1072]: Lookup::LDAP code NOT loaded
May 24 13:53:30 xserve amavis[1072]: AM.PDP-in proto code loaded
May 24 13:53:30 xserve amavis[1072]: SMTP-in proto code loaded
May 24 13:53:30 xserve amavis[1072]: Courier proto code NOT loaded
May 24 13:53:30 xserve amavis[1072]: SMTP-out proto code loaded
May 24 13:53:30 xserve amavis[1072]: Pipe-out proto code NOT loaded
May 24 13:53:30 xserve amavis[1072]: BSMTP-out proto code NOT loaded
May 24 13:53:30 xserve amavis[1072]: Local-out proto code loaded
May 24 13:53:30 xserve amavis[1072]: OS_Fingerprint code NOT loaded
May 24 13:53:30 xserve amavis[1072]: ANTI-VIRUS code loaded
May 24 13:53:30 xserve amavis[1072]: ANTI-SPAM code loaded
May 24 13:53:30 xserve amavis[1072]: ANTI-SPAM-SA code loaded
May 24 13:53:30 xserve amavis[1072]: Unpackers code loaded
May 24 13:53:30 xserve amavis[1072]: Found $file at /usr/bin/file
May 24 13:53:30 xserve amavis[1072]: No $dspam, not using it
May 24 13:53:30 xserve amavis[1072]: No $altermime, not using it
May 24 13:53:30 xserve amavis[1072]: Internal decoder for .mail
May 24 13:53:30 xserve amavis[1072]: Internal decoder for .asc
May 24 13:53:30 xserve amavis[1072]: Internal decoder for .uue
May 24 13:53:30 xserve amavis[1072]: Internal decoder for .hqx
May 24 13:53:30 xserve amavis[1072]: Internal decoder for .ync
May 24 13:53:30 xserve amavis[1072]: No decoder for .F tried: unfreeze, freeze -d, melt, fcat
May 24 13:53:30 xserve amavis[1072]: Found decoder for .Z at /usr/bin/uncompress
May 24 13:53:30 xserve amavis[1072]: Found decoder for .gz at /usr/bin/gzip -d
May 24 13:53:30 xserve amavis[1072]: Internal decoder for .gz (backup, not used)
May 24 13:53:30 xserve amavis[1072]: Found decoder for .bz2 at /usr/bin/bzip2 -d
May 24 13:53:30 xserve amavis[1072]: No decoder for .lzo tried: lzop -d
May 24 13:53:30 xserve amavis[1072]: No decoder for .rpm tried: rpm2cpio.pl, rpm2cpio
May 24 13:53:30 xserve amavis[1072]: Found decoder for .cpio at /bin/pax
May 24 13:53:30 xserve amavis[1072]: Found decoder for .tar at /bin/pax
May 24 13:53:30 xserve amavis[1072]: Found decoder for .deb at /usr/bin/ar
May 24 13:53:30 xserve amavis[1072]: Internal decoder for .zip
May 24 13:53:30 xserve amavis[1072]: No decoder for .7z tried: 7zr, 7za, 7z
May 24 13:53:30 xserve amavis[1072]: No decoder for .rar tried: rar, unrar
May 24 13:53:30 xserve amavis[1072]: No decoder for .arj tried: arj, unarj
May 24 13:53:30 xserve amavis[1072]: No decoder for .arc tried: nomarch, arc
May 24 13:53:30 xserve amavis[1072]: No decoder for .zoo tried: zoo, unzoo
May 24 13:53:30 xserve amavis[1072]: No decoder for .lha tried: lha
May 24 13:53:30 xserve amavis[1072]: No decoder for .cab tried: cabextract
May 24 13:53:30 xserve amavis[1072]: No decoder for .tnef tried: tnef
May 24 13:53:30 xserve amavis[1072]: Internal decoder for .tnef
May 24 13:53:30 xserve amavis[1072]: No decoder for .exe tried: rar, unrar; lha; arj, unarj
May 24 13:53:30 xserve amavis[1072]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
May 24 13:53:30 xserve amavis[1072]: (!!)TROUBLE in pre_loop_hook: Please create an empty directory /var/amavis/db to hold a database (config variable $db_home)
I created the directory, then it says
May 24 13:58:12 xserve amavis[1133]: (!!)TROUBLE in pre_loop_hook: db_home directory is not writable: /var/amavis/db at /usr/bin/amavisd line 7783.
I changed CHMOD to 777 (just see later to be more restricitve)
And then it seems OK
May 24 14:11:49 localhost /usr/bin/amavisd[44]: starting. /usr/bin/amavisd at localhost amavisd-new-2.2.0 (20041102), Unicode aware
May 24 14:11:49 localhost /usr/bin/amavisd[44]: user=, EUID: 0 (0); group=, EGID: 0 0 (0 0)
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Perl version 5.008006
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Net::Server: 2007/05/24-14:11:49 Amavis (type Net::Server::PreForkSimple) starting! pid(44)
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Net::Server: Binding to UNIX socket file /var/amavis/amavisd.sock using SOCK_STREAM
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Net::Server: Binding to TCP port 10024 on host 127.0.0.1
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Net::Server: Setting gid to "82 82"
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Net::Server: Setting uid to "82"
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Amavis::Conf 2.033
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Archive::Tar 1.22
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Archive::Zip 1.18
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Compress::Zlib 2.004
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Convert::TNEF 0.17
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Convert::UUlib 1.08
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module DB_File 1.810
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module MIME::Entity 5.420
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module MIME::Parser 5.420
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module MIME::Tools 5.420
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Mail::Header 1.77
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Mail::Internet 1.77
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Mail::SpamAssassin 3.000001
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Net::Cmd 2.26
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Net::SMTP 2.29
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Net::Server 0.96
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Time::HiRes 1.9707
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Module Unix::Syslog 0.99
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Amavis::DB code NOT loaded
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Amavis::Cache code NOT loaded
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Lookup::SQL code NOT loaded
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Lookup::LDAP code NOT loaded
May 24 14:11:49 localhost /usr/bin/amavisd[44]: AMCL-in protocol code loaded
May 24 14:11:49 localhost /usr/bin/amavisd[44]: SMTP-in protocol code loaded
May 24 14:11:49 localhost /usr/bin/amavisd[44]: ANTI-VIRUS code loaded
May 24 14:11:49 localhost /usr/bin/amavisd[44]: ANTI-SPAM code loaded
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Unpackers code loaded
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Found $file at /usr/bin/file
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No $arc, not using it
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Found $gzip at /usr/bin/gzip
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Found $bzip2 at /usr/bin/bzip2
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No $lzop, not using it
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No $lha, not using it
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No $unarj, not using it
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Found $uncompress at /usr/bin/uncompress
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No $unfreeze, not using it
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No $unrar, not using it
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No $zoo, not using it
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Found $cpio at /usr/bin/cpio
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No $ar, not using it
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No $rpm2cpio, not using it
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No $cabextract, not using it
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No $dspam, not using it
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: KasperskyLab AntiViral Toolkit Pro (AVP)
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: KasperskyLab AVPDaemonClient
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: H+BEDV AntiVir or CentralCommand Vexira Antivirus
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: Command AntiVirus for Linux
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: Symantec CarrierScan via Symantec CommandLineScanner
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: DrWeb Antivirus for Linux/FreeBSD/Solaris
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: F-Secure Antivirus
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: CAI InoculateIT
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: MkS_Vir for Linux (beta)
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: MkS_Vir daemon
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: ESET Software NOD32
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: ESET Software NOD32 - Client/Server Version
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: Norman Virus Control v5 / Linux
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: Panda Antivirus for Linux
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: NAI McAfee AntiVirus (uvscan)
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: VirusBuster (Client + Daemon)
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: CyberSoft VFind
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: Ikarus AntiVirus for Linux
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No primary av scanner: BitDefender
May 24 14:11:49 localhost /usr/bin/amavisd[44]: Found secondary av scanner Clam Antivirus - clamscan at /usr/bin/clamscan
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No secondary av scanner: FRISK F-Prot Antivirus
May 24 14:11:49 localhost /usr/bin/amavisd[44]: No secondary av scanner: Trend Micro FileScanner
May 24 14:11:49 localhost /usr/bin/amavisd[44]: SpamControl: initializing Mail::SpamAssassin
May 24 14:11:52 localhost /usr/bin/amavisd[44]: SpamControl: done
But in fact there's still a problem :
May 24 14:12:22 localhost /usr/bin/amavisd[219]: (00219-01) ESMTP::10024 /var/amavis/amavis-20070524T141222-00219: <p.estxxxx@xxxxxxx> -> <pacvolley@ xxxxxxx > Received: SIZE=5929 from xserve.xxxxx ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00219-01 for <pacvolley@ xxxxxxx>; Thu, 24 May 2007 14:12:22 +0200 (CEST)
May 24 14:12:22 localhost /usr/bin/amavisd[219]: (00219-01) body hash: 05f429e5a692012d98323c55a540b730
May 24 14:12:22 localhost /usr/bin/amavisd[219]: (00219-01) Checking: [82.241.222.174] <p.estxxx@xxxxx> -> <pacvolley@xxxxx>
May 24 14:12:22 localhost /usr/bin/amavisd[219]: (00219-01) p003 1 Content-Type: multipart/alternative
May 24 14:12:22 localhost /usr/bin/amavisd[219]: (00219-01) p001 1/1 Content-Type: text/plain, size: 394 B, name:
May 24 14:12:22 localhost /usr/bin/amavisd[219]: (00219-01) p002 1/2 Content-Type: text/html, size: 3962 B, name:
May 24 14:12:22 localhost /usr/bin/amavisd[302]: (00219-01) run_command: child process [302]: Can't close main::stdin: Bad file descriptor at /usr/bin/amavisd line 1589.\n
May 24 14:12:22 localhost /usr/bin/amavisd[302]: (00219-01) SMTP shutdown: tempdir is being removed: /var/amavis/amavis-20070524T141222-00219
May 24 14:12:23 localhost /usr/bin/amavisd[219]: (00219-01) TROUBLE in check_mail: mime_decode-1 FAILED: parsing file(1) results - missing last 2 results at (eval 40) line 150.
May 24 14:12:23 localhost /usr/bin/amavisd[219]: (00219-01) PRESERVING EVIDENCE in /var/amavis/amavis-20070524T141222-00219
May 24 14:12:23 localhost /usr/bin/amavisd[219]: (00219-01) TIMING [total 284 ms] - SMTP EHLO: 21 (7%), SMTP pre-MAIL: 3 (1%), mkdir tempdir: 1 (0%), create email.txt: 2 (1%), SMTP pre-DATA-flush: 8 (3%), SMTP DATA: 5 (2%), body_hash: 2 (1%), mkdir parts: 3 (1%), mime_decode: 57 (20%), rundown: 181 (64%)
May 24 14:12:23 localhost /usr/bin/amavisd[219]: (00219-01) TROUBLE in process_request: Error writing a SMTP response to the socket: Broken pipe at (eval 36) line 760, <GEN3> line 208.
May 24 14:12:23 localhost /usr/bin/amavisd[219]: (00219-01) Requesting process rundown after fatal error
May 24 14:12:23 localhost /usr/bin/amavisd[219]: (00219-01) load: 100 %, total idle 0.001 s, busy 0.287 s
May 24 14:12:23 localhost /usr/bin/amavisd[219]: (00219-01) SMTP shutdown: Error writing a SMTP response to the socket: Bad file descriptor at (eval 36) line 760.\n
And in the mail log I get corresponding errors such as :
May 24 14:30:20 xserve postfix/smtpd[626]: connect from xxxxxx.club-internet.fr[xxx.xxx.xxx.xxx]
May 24 14:30:20 xserve postfix/smtpd[626]: 5580872531: client= xxxxxx.club-internet.fr[xxx.xxx.xxx.xxx]
May 24 14:30:20 xserve postfix/cleanup[452]: 5580872531: message-id=<00e301c79dff$49859120$0100a8c0@pcservice>
May 24 14:30:20 xserve postfix/smtpd[626]: disconnect from xxxxxx.club-internet.fr[xxx.xxx.xxx.xxx]
May 24 14:30:20 xserve postfix/qmgr[64]: 5580872531: from=<[email protected]>, size=95594, nrcpt=1 (queue active)
May 24 14:30:20 xserve postfix/smtp[464]: 5580872531: to=<sjoly@ xxxxxx.com>, relay=127.0.0.1[127.0.0.1], delay=0, status=deferred (host 127.0.0.1[127.0.0.1] said: 421 4.3.2 Service shutting down, closing channel (in reply to end of DATA command))
I first thought mails were lost, and obviously as it won’t be so easy to fix alone without any help (and time is running loosing mails), I decided to come back to the old amavisd-new version, restoring /usr/bin/amavis and amavis.conf, and rebooting computer.
Then, another problem with Perl modules that were updated so that old amavis seemed also not working. I decided to replace /Library/Perl and System/Library/Perl with new ones from a clean fresh install on my local server. Rebooted, and seems to be OK as before. Then looked for Postfix and understood than flushing will force deferred mails to be processed.
Anyway, all is to be done again. If anybody here as an idea of what's going wrong, I'll be glad to learn ...
Mac OS X (10.4.9)well, there you have it – a classical if then loop.
seems i'm still stuck somewhere in the middle of the amavisd.conf nightmare. had amavisd-new 2.4.5 / spamassassin 3.1.8 up and running after a real nightmare (which had to do with daemonize=1).
after i tried to get up-to-date with amavisd-new 2.5.1 and spamassassin 3.2.1 i saw the same problems (see below) again, while launchd tried to get amavisd started.
Jun 15 05:14:11 mail launchd: org.amavis.amavisd: exited with exit code: 2
Jun 15 05:14:11 mail launchd: org.amavis.amavisd: respawning too quickly! throttling
Jun 15 05:14:11 mail launchd: org.amavis.amavisd: 9 more failures without living at least 60 seconds will cause job removal
Jun 15 05:14:11 mail launchd: org.amavis.amavisd: will restart in 10 seconds
remembering the previous troubles, i double checked all things, which could be set wrong (daemonize, etc.) and all was well. tried a second install and all to no success.
later i had the idea, it might be the new amavisd.conf, which troubles (why ever) the startup. so i used the v2.4.5 one and lo and behold, it worked. but why? what is so strange/new/different in 2.5.1, that the startup of amavisd gets broken?
now i read, that they changed a bunch of stuff and i certainly would be using the newer versions conf file, but it seems i don't get it right configured. i'm on the latest updated 10.4.9 server with all fixes installed. every service is working, mail gets in/out and gets even tagged.
well, i didn't do the setup with the 2 users junkmail/nojunkmail yet. is it really necessary to set them up as local users? can't they be handled as every other user which has mail enabled via wgm?
anyone can help me here? thx.
Various Mac OS X (10.4.9) Mac OS X Server (10.4.9) -
Hi All
What are the things that are to be kept in mind for choosing the Seeburger adapters.
For a logistics based EDIs we are planning to go for Seeburger adapters in XI, i need to know the following things that will help me to contact the seeburger guys for pricing.
1. what are the seeburger components we need to develop the interfaces,(The softwares comes with what all adapters)
2. Does any trial version is available for download?
3. What are the things that will differ from a normal interface development when we use the Seeburger adapters(any1)
steps in IR and ID.
is there any Document from SAP which gives overall picutres the things to be taken care when taking seebuger in XI?
regards
Nisar KhanHi Nisar,
1. what are the seeburger components we need
to develop the interfaces,(The softwares comes
with what all adapters)
2. Does any trial version is available for
download?
No trial version available.
3. What are the things that will differ from a
normal interface development when we use the
Seeburger adapters(any1)
steps in IR and ID.
In IR:
You need to use the Standard XSD provided by Seeburger for different mesages like EDFACT ORDERS D96A etc in IR and other steps are similar which we do for the normal scenarios.
In ID:
This is the scenario for AS2
Seeburger has provided std mapping which need to be deployed on Xi server and will be used in XI adapter module tab for EDI-XML and XML-EDi conversion.
Example of mapping:
See_E2X_INVOIC_UN_D96A
See_E2X_INVOIC_UN_D99A
See_E2X_ORDERS_UN_D96A
See_E2X_OSTRPT_EAN_D96A.
1) After deploying mapping program.
We need to give the AS2ID in the party identifier tab,AS2ID that is entered here will be used for identifying the sender and receiver of the document.
1)The value of the Agency field must be Seeburger.
2)The value of the Schema field must be AS2ID.
Every partner is assigned the WAN no which is provided by the WAN service provider. That WAn no we need to configure in the party identifier tab
Configuration in adapter:
Under the party identifiere tab
Agency will be seeburger
Scheme=AS2ID
Name = WAN network no of the partner who is sending the file
Sender AS2 adapter configuration:
Few changes in the module parameter tab.
localejbs/CallBicXIRaBean bic
CallSapAdapter 0
Module configuration:
bic= destSourceMsg = MainDocument
bic= destTargetMsg = MainDocument
bic= mappingName= See_E2X_EDIFACT_ORDERS_UN_D93A which does the conversion of EDI-XML.
Receiver AS2 adapter configuration:
When the adapter is used in a receiver channel, it obtains a message from the Integration Engine and sends it to a business partner. In this case, the following steps are required:
1. Define the channel as a Receiver channel on the Parameters tab
2. The last step ensures the module sequence is complete:
Make sure the module ModuleProcessorExitBean does exist in the module sequence:
Module Name=localejbs/ModuleProcessorExitBean
Type=L
Module Key=Exit
with the following module parameter:
Module Key=Exit
Parameter Name=JNDIName
Parameter Value=deployedAdapters/SeeXIAS2/shareable/SeeXIAS2
4) from the followingt types of adapters:
1)BIC Adapter:
There is no BIC adapter it is the client based tool provided by seeburger which has the standard mapping program which does the conversion of EDI-XML and XML-EDI it supports many data types like INHOUSE,CSV, TRADACOM etc. So the std mappinf provided by seeburger has to be deploye first on XI and then used in adapter module tab for conversion.
Using BIC we can create our own data strucutre like we do in IR,we can create our own data type mapping program.
There are three mapping program which is provided by seeburger which is used for creating our own mapping program.
1) Create XML message
2) CreateMappingXML to EDI
3) CreateMappingEDI to XML.
You need to use this mapping program and create your own mapping program for your own structure once it is created import it in BIC.
2)Split997 adapter
The SEEBURGER message splitter module initiates new XI messages as children of a main (or parent) XI Message. A new child (or split) message will be created for each main messages attachment in the split list.
Example of when to use splitter:
1) mail adapter initiates a XI message which contains several attachments, you can use the message splitter to create a new XI Message for each attachment in the original email.
2) U have many UNH messages in one EDI file and u want to create different IDOC for every UNH message for that file that time splitter can be sued.
3)AS2 adapter.
I have provided u the details.
You can refer my thread reply:
Re: Pls.. Help Needed.. Seeburger Mapping Names..!!
Re: Seeburger AS2 adapter...
Re: AS2 Module tab.. Mapping Names for modified Standard Msg types ? ? BIC ??
AS2 adpater-- Configuration details for both SND and RCV.
AS2 Sender Adapter -- Need few details.
EDI-SEEberger-XI-IDOc-R/3
flow of the data from EDi to SAp r/3 using seeburger:
1) Data will be coming thorugh WAN or mailbox.
2) If its coming through WAN then every WAN provider will give the partner which is sending the data a partner number for indentification.
3) In your AS2 channel you need to configure the party and for that party you need to give the WAN number which is proivded for that partner. So it will run that configuration whenever that partner send the data.
4) In the adapter you have to give the mapping program name which does the conversion of EDI-XML and XML-EDI.
5) Once you XML is generated then it will be used in MM
6) At the receiver if its IDOC adapter then IDOC adapter will post the IDOC to R3 system.
I hope I have given u better picture.
Thnx
Chirag -
// Code Help need .. in Reading CSV file and display the Output.
Hi All,
I am a new Bee in code and started learning code, I have stared with Console application and need your advice and suggestion.
I want to write a code which read the input from the CSV file and display the output in console application combination of first name and lastname append with the name of the collage in village
The example of CSV file is
Firstname,LastName
Happy,Coding
Learn,C#
I want to display the output as
HappyCodingXYZCollage
LearnC#XYXCollage
The below is the code I have tried so far.
// .Reading a CSV
var reader = new StreamReader(File.OpenRead(@"D:\Users\RajaVill\Desktop\C#\input.csv"));
List<string> listA = new List<string>();
while (!reader.EndOfStream)
var line = reader.ReadLine();
string[] values = line.Split(',');
listA.Add(values[0]);
listA.Add(values[1]);
listA.Add(values[2]);
// listB.Add(values[1]);
foreach (string str in listA)
//StreamWriter writer = new StreamWriter(File.OpenWrite(@"D:\\suman.txt"));
Console.WriteLine("the value is {0}", str);
Console.ReadLine();
Kindly advice and let me know, How to read the column header of the CSV file. so I can apply my logic the display combination of firstname,lastname and name of the collage
Best Regards,
Raja Village Sync
Beginer CoderVery simple example:
var column1 = new List<string>();
var column2 = new List<string>();
using (var rd = new StreamReader("filename.csv"))
while (!rd.EndOfStream)
var splits = rd.ReadLine().Split(';');
column1.Add(splits[0]);
column2.Add(splits[1]);
// print column1
Console.WriteLine("Column 1:");
foreach (var element in column1)
Console.WriteLine(element);
// print column2
Console.WriteLine("Column 2:");
foreach (var element in column2)
Console.WriteLine(element);
Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP] -
What happened to Cover Flow in iTunes 11?
This upgrade is not as good than iTunes 10 was. I used cover Flow all the time an now it´s gone. How can I downgrade to iTunes 10 till Apple implements Cover Flow again in a new release of iTunes?
Totally agree! I downloaded latest i-tunes - and how I wish I could take back that moment.
I have thousands of music files and I used to be able to see them as a split List and Cover Flow which was perfect for flicking between Album/Artist/ Name etc whilst being able to scroll through the visual reference of Album Covers.
Something that all lovers of music have enjoyed for years. It echoed the experience of rifling through record collections.
i-Tunes used to be good for archiving all my music in a relatively user friendly format.
Why have they dumped this format!
Please bring back Cover Flow! -
Hi
We are in the process of implementing an XI-EDI solution using the Seeburger adapter. I've heard that Seeburger generates some report after a syntax check & you can send that as a 997.
How do we configure that? Is that an automatic process that is taken care of by the Seeburger adapter & just needs to be configured or does it involve mapping, where I may have to treat this as a synchronous XI message?
I'd really appreciate any help/suggestions on this.
Thanks
RachanaHI,
Purpose of Split 997:
The SEEBURGER message splitter module initiates new XI messages as children of a main (or parent) XI Message. A new child (or split) message will be created for each main messages attachment in the split list.
When to use split:
1)if the mail adapter initiates a XI message which contains several attachments, you can use the message splitter to create a new XI Message for each attachment in the original email.
2) Ususally split 997 is used when you have a multiple UNH segments under the UNB segments and you need to create a multiple IDOC for each UNH occurance that time the split 997 channel is used.
Process flow in configuration:
The Message Splitter module must be configured in the SAP XI Integration Directory. The Message Splitter module will executed as part of the module sequence of the communication channel.
Furthermore since the module must initiate new XI Messages it also takes the role of a sender adapter. Therefore the splitter adapter can be selected as adapter in sender channels.
operation mode of the splitter in 4 steps:
1. An XI Message has been initiated by an adapter (e.g. OFTP, mail )
2. The Splitter message will be executed as part of the module sequence processing of the sender channel.
3. The splitter reads the splitter partner data to known which sender channel should be used for initiating the child messages.
4. Child messages will be initiated. Note the sender channel used to initiate child messages uses a special adapter called Split997
Thnx
Chirag -
ARRAYLIST comarision failing.
Hi,
I am expecting wen arraylist is null any of the cases then then other arraylist sud come in noMatchList.
but now its is coming blank[].can u figure it out and solve..
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
public class Demo3 {
public static void main(String[] args) {
ArrayList<String> al = new ArrayList<String>();
al.add("1");al.add("2");al.add("3");al.add("4");al.add("6");
ArrayList<String> a2 = new ArrayList<String>();
// a2.add("1");a2.add("6");//a2.add("3");a2.add("4");a2.add("6");
ArrayList<String> a3 = new ArrayList<String>();
//a3.add("1");a3.add("2");a3.add("33");a3.add("44");a3.add("5");
ArrayList<String> a4 = new ArrayList<String>();
a4.add("1");a4.add("2");a4.add("33");a4.add("44");a4.add("5");
ArrayList<String> a5 = new ArrayList<String>();
a5.add("1");a5.add("2");a5.add("33");a5.add("44");a5.add("5");
ArrayList<String> a6 = new ArrayList<String>();
a6.add("1");a6.add("2");a6.add("3300");a6.add("44");a6.add("500");
ArrayList<String> a8 = new ArrayList<String>();
a8.add("1");a8.add("2");a8.add("33");a8.add("44");a8.add("51231111");
ArrayList<String> a9 = new ArrayList<String>();
a9.add("1");a9.add("2");a9.add("33");a9.add("44");a9.add("51231111");
LinkedHashMap<String,ArrayList<String>> lhm = new LinkedHashMap<String,ArrayList<String>>();
lhm.put("rule1", al);lhm.put("rule2", a2);lhm.put("rule3", a3);
// lhm.put("rule4", a4);
// lhm.put("rule5", a5);
// lhm.put("rule6", a6); // lhm.put("rule9", a9);
// lhm.put("rule8", a8);
System.out.println("lhm value " + lhm);
StringBuilder match = new StringBuilder();
String[] a= new String[0];
a = lhm.keySet().toArray(a);
for(int i=0;i<a.length;i++){
for(int j = 0;j<a.length -1;j++){
if(j!= i){
ArrayList<String> x1 = lhm.get(a);
ArrayList<String> x2 = lhm.get(a[j]);
if(x1.containsAll(x2) && x2.containsAll(x1) && !(x1.isEmpty() || x2.isEmpty())){
if(!match.toString().contains(a[i])){
match.append(a[i]+",");
if(!match.toString().contains(a[j])){
match.append(a[j]+",");
match.append(":");
StringBuilder noMatch = new StringBuilder();
for(int i=0;i<a.length;i++){
for(int j = 0;j!= i &&j<a.length -1;j++){
ArrayList<String> x1 = lhm.get(a[i]);
ArrayList<String> x2 = lhm.get(a[j]);
if(!(x1.containsAll(x2) && x2.containsAll(x1))){
if(!(x1.isEmpty() || x2.isEmpty())){
if(!match.toString().contains(a[i]) && !noMatch.toString().contains(a[i])){
noMatch.append(a[i]+",");
if(!match.toString().contains(a[j]) && !noMatch.toString().contains(a[j])){
noMatch.append(a[j]+",");
//For Matched (Grouping done here)
List<List<String>> matchList = spitTheString(match.toString());
List<List<String>> noMatchList = spitTheString(noMatch.toString());
private static List<List<String>> spitTheString(String match){
String[] strings = match.toString().split(":");
List<List<String>> finalList = new ArrayList<List<String>>();
StringBuilder builder = null;
for(String string:strings){
String[] strings2 = string.split(",");
builder = new StringBuilder();
List<String> list = new ArrayList<String>();
for(int i = 0;i < strings2.length;i++){
if(strings2[i].length() != 0){
builder.append(strings2[i]);
if(i < strings2.length -1)
builder.append(",");
if(builder.length() != 0){
list.add(builder.toString());
finalList.add(list);
return finalList;codingMonkey wrote:
Please use code tags when posting code. You can do this using the CODE button above the forum editor. Few people will bother to read unformatted code.This time I did bother to read the unformatted code, specifically to learn a new language. However I am not entirely sure what the language I learnt is called, so lets call it "non-english".
To the OP what exactly is the problem here? I have gone over your code and I notice a few things. Firstly you only add 3 ArrayList<String> into your map, one of which is non empty, the other two are empty. Secondly you have two sets of for loops, the first for loop appends matches, the second appends non matches. In both cases you will only add a match or a non match if in either situation both ArrayLists are non empty. Further more in the situation where 2/3 of your ArrayLists are empty, then no string will ever be built, because the conditional expression of empty in both cases is true > (!true) > false. This is why you have two empty StringBuilders if you even bothered to check.
Mel -
Help with dynamic playlist for mpd
Hi guys,
I use mpd with sonata for playing my music, and after trying exaile there is one thing id really like for mpd, and that is the dynamic playlist function.
When you're playing a song in exaile with dynamic playlist enabled, it queries audioscrobbler and automatically adds similar artists/songs to your playlist (if you have them on your pc).
I dont want to use exaile as it just feels too big and slow and bloated (not KISS ), i know a little bit of python so i thought i'll try and make my own little script/program as Sonata has audioscrobbler support, but i dont think there is anyway to query similar artists.
I think im going to try and make this as a daemon type program that will run in the background adding songs to the playlist.
Ive found the code from the exaile source (audioscrobbler.py) which queries lastfm e.g.
>>> lips = AudioScrobblerQuery(artist='The Flaming Lips')
>>> for artist in lips.similar():
... print artist.name, artist.mbid
This will print a list of similar artists to the flaming lips.
I've not done much with python so i thought this would be a good way to try and improve.
Does anyone have any suggestions as to what the best way to go about searching and comparing the results to my mpd database, would the best way just to be to search the mpd.db?
And if anyone else has any ideas/comments id like to hear them.
Edit:
I just found this too, so i may only need to change some things to integrate it with mpd rather than amarok
http://www.kde-apps.org/content/show.php?content=31920
Thanks
Last edited by Kane (2008-06-05 13:24:33)well i just modified the patch into a little script, it does what i need
its here if anyone wants it
import audioscrobbler
import mpd
import random
import time
lastsong = {}
def timer_control():
get_similar()
time.sleep(10)
timer_control()
def get_similar():
audioscrobbler
client = mpd.MPDClient()
client.connect("localhost", 6600)
mpdstatus = client.status()
prevsonginfo = client.currentsong()
global lastsong
if mpdstatus['state'] == "stop": return
if prevsonginfo == lastsong: return
lastsong = prevsonginfo
similarartists = ""
song = prevsonginfo
#if not song: break #No song, do nothing
prevartist = song['artist']
# Is the info already cached?
similar_cache = {}
if similar_cache.has_key(prevartist):
similarartists = similar_cache[prevartist]
else:
#Not cached so fetch from Audioscrobbler
try:
similarartists = [artist.name for artist in audioscrobbler.AudioScrobblerQuery(artist=prevartist).similar()]
# Cache search results and save some time next search
similar_cache[prevartist] = similarartists
except audioscrobbler.AudioScrobblerError:
similar_cache[prevartist] = None # Empty cache
return # Do nothing!
if not similarartists: return # Empty list
# Split list in half and sort upper half
# this means good matches will have priority
# but makes sure artist A does not always result in artist B
half_idx = len(similarartists)/2
upperhalf = similarartists[:half_idx]
lowerhalf = similarartists[half_idx:]
random.shuffle(upperhalf)
artistlist = upperhalf
artistlist.extend(lowerhalf)
# Try each artist in order
for artist in artistlist:
try:
print "Trying:",artist
songs = client.search("artist", artist)
if not songs: continue
selected_song = random.sample(songs, 1)[0]
client.add(selected_song['file'])
print "Added", selected_song['title'],"by",selected_song['artist']
# Delete old song from playlist?
break
except mpd.MPDError, e:
print "MPDError", e.message
continue
except ValueError, e:
print "ValueError:",e.message
continue
timer_control()
Last edited by Kane (2008-06-06 16:22:49)
Maybe you are looking for
-
Satellite P105-S9722: Need info about Toshiba Warranty Policy
Hi, I would have a question regarding the international warranty policy of Toshiba, I searched but didn't find the answer on the site. I have a P105-S9722 that I purchased February last year and the warranty expired in Feb 08. The entire screen was r
-
How can we get the table name...
Hi All, How can we get the actual table name for an argument if its datatype is %ROWTYPE. For Ex : function ACCOUNT_UPDATE (account_no number, person person%rowtype, amounts dbms_describe.number_table, trans_date date) return accounts.balance%type; I
-
Hi experts i have some while generate purchase,sales and inventry flows
hai, as usual i am using general purchase,sales flow for purchase,sell items to customer and vendor.but its not my issue.the main issue is when i purchase item from vendor i pay some amount to vendor.like this issue when i sell goods to custom
-
Windows 8 does not have a USB boot option
QuestionHow can I boot my Windows 8 laptop from a USB device? I created a recovery disk on a USB thumb drive. So far I have: Entered into the UEFI (BIOS) and set USB to boot first. Disabled secure boot. I tried to reboot using the general setup optio
-
Assignment in Cash discount GL is not populating Billing no & customer no
I have done settings for cash discount GL seeting in customising. Now when i use F-28 or F-32 , We charge balance amount to discount manually in standard. Suppose a debit in customer account 2000 INR. But we receive bank GL 1900 INr & entered 100 (