Help to understand issue
Hello all I am facing an issue where the explosion program wont explode in alternate units of measure, I am not sure what exactly the requirement is, we have 2 programs one is the special pack explosion and the second is post special pack from COPA to PCA
I executed the program called Special Pack Explosion to COPA and see the fields below
I dont see any amount or anything below, I dont see any unit of measure so I am not sure
What the requirement is
Reference doc Material/Component Condition record COPA Document Number
98811123 15022234 0000044543 23441
2nd program is called Post Special Pack From COPA to PCA
I see fields
Sales Org Ccode Created Date G/l Material PC Reference Doc Amount Activ Createdate
1000 10000 1/13/2007 400213 150004 21531 9811123 300 sb00 1/29/07
Can some one help me with what this report is used for and where do I see the unit of measure or how do I change it.
Thanks,
Zaid
i understand what the program is doing
Similar Messages
-
Need help in understanding FA acquisition via Internal Order
Hi Gurus
I need your help in understanding the FA acquisition via Internal Order. The process we are following is that we create AUC using the AUC asset class and enter that AUC number in the settlement rule while creating IO. Once IO budget is approved, we release the IO. Once GR is completed, we do the Invoice receipt for the PO, followed by settlement of IO against the AUC. Afterwards, we create fixed asset in AS01 and enter this asset number in the settlement rule for the AUC in AIAB and settle the AUC to Fixed asset for the costs.
My question is that during all this process, I don't see the PO information in the AUC record. When I display AUC, under the Enviornment tab, I see the Purchase order link but when I click it, there is nothing in there. The reason could be that we are creating AUC seperatly and not from within the IO where it says create AUC. I am not sure what is the best way for the whole process.
I would be thankful if you can guide me.
Thanks,
ShaluHi
Can someone please help me with this issue?
Thanks,
Shalu -
I try to sync my nano and get: the ipod cant be synced because there is not enough free space to hold all of the items in the items library (need 100MB) - I have a new computer?? can you help me understand this message: what to do?
Hello pryan1012,
What this message means is that you have more music in your itunes library than there is free space in your ipod.
I had this same issue at one time. This is what helped me put my music on the ipod. I used manually manage.
Learn how to sync muisc here.
Hope this helps.
~Julian -
# Question
Can you please help to understand how the firefox decides on the Expires date for a cached javascript file ( my server did not set any Expire header, but firebox set it down). I tried to understand but different javascript file gets different Expires date value when it is being cached. Please help me as I tried lot and could not get proper answer for this. Thanks in Advance.Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. <br />
http://forums.mozillazine.org/viewforum.php?f=25 <br />
You'll need to register and login to be able to post in that forum. -
Help required understanding steps of Transfer Workflow:WS01000014
Hi All,
Please help me understand the steps of this workflow..i have already gone thru some explaination about this workflow from this [link|http://www.sapfans.com/forums/viewtopic.php?f=11&t=292192&start=0&st=0&sk=t&sd=a] but getting confused with few steps.
Correct me if i am wrong ..the workflow is triggered when a new position is created?(to which employee is going to be transffered?)
In step1:check target postion..of who? and then what happens?
step on user and role is confusing too
there are two specify postion in two departments..what are the two postions for ? 1 fro employee and one for his new manager/hr admin?
pls advice
thanks in advanceHello,
The workflow is triggered when an instance of object ORGCHEARM
issues the event CREATED - ie there has been an organizational change.
Step 1 is condition "Check Target Position" :
( Designation.Root <> 'P' and
Designation.Object Type <> '' and
Designation.Object ID <> 00000000
) or
( Designation.Root = 'P' and
Designation.Object Type = 'S' and
Designation.Object ID <> 00000000
If true then continue, if false: Specify Agent.
Specify Agent branches according to type of
Agent Specification. The condition is:
Designation.User Name <> ''
In both cases task TS01000118 (Specify Position in New Department)
is called. If the condition was true then it's called with as agent
the contents of ORGCHEARM.ACROSSBORDERUSER; if not true then
the role AC0000168 is used to determine the superior(s) of the
"object type affected" and they are used as the agents (ie they receive the workitem).
Hope this helps.
regards,
Rick Bakker
Hanabi Technology -
Help in understanding how the policy "SI-PerDiskAvgServiceTime-AT" work
Hello Sir, I am trying to deploy policy "SI-PerDiskAvgServiceTime-AT" on servers in my environment. And after deployment this policy is triggering so many alerts. I read some online forums and learnt that this is an auto-thresholding policy relying on historical data. Can you please help me understand how this policy works. Thank You
I have decided to ditch Visual Communicator as an option.
Apart from the poor support, I have tested the Trial version and it would not make sense to use the application in its cirrent form.
In a ten minute period using 2 cameras as a test, the application froze and crashed four times. Not acceptable as reliability is crucial.
The test was done on a Windows 7 64 bit machine with 4 physical Xeon Quad core 3GHZ processors and 32 GB RAM with a 2GB Graphics card, so performance was not the issue.
the application is just not stable.
I am getting better support and results from both Wirecast 4 and Cutfour. -
No Sound from Logic 8- can anyone help with this issue?...
Hi,
I am relatively new to Logic and have an issue as I work my way through the getting started book.
I have no sound when I play any type of track...
I have gone through the Apple website's Logic common issues page and have no issues with laptop and program compatibility and I have correctly installed my audio interface which is also fully compatible with the laptop I have.
The setup I have is:
- Macbook Pro 1, 2 with Mac OS X version 10. 6. 7 running Logic 8.
- a Focusrite Saffire audio interface.
Can anyone help shed any light onto this why I have no sound returning at me when I click pay track?
Thanks for the thoughts you share!Somewhere in the Everything wrote:
This has solved the issue and helped my understanding of the program. I didn't realise selecting core audio interface was responsible for output audio also. Though it seems obvious now, I think I overlooked this on that point of the journey I was on... thank you Pancenter
You're welcome.
I don't know your setup and this may not work for you, see what you think.
I tend to keep the internal built-in audio as the core audio device for all of the Mac sounds including DVD playback... iTunes....etc.
I reserve the pro/semi-pro audio interface for use only with the professional audio application. There's a couple of reasons for this... the Mac built-in audio actually works better for some things like DVD playback, also.. core audio volume will now affect the Focusrite's volume.. I'd rather not have the volume of the pro interface or the sample rate messed with. I need to load my projects and have them play exactly as I saved them.
Also, keep reading the manuals... there's much to learn there. The manuals will help train your mind for further understanding as you progress.
Any type of knowledge a person gains by working things out on their own (as you did) will stick with you. Even though you didn't find the solution you put in effort.
The answers are never the important part of learning, the work put in is the actual answer.
When I teach audio related classes.... for example, learning how a compressor works. I have a student pick one compressor and learn it inside and out. Use it for voice, guitar, drums, bass, synths. Using one plug-in, in depth gives one perspective and the basic knowledge of how to use other compressors one will need in the future.
pancenter- -
Can someone help me understand why my i tunes stop working after my library comes up?
Can someone please help me understand why my i tunes stop working after my library comes up?
Hello generousdragon,
It sounds like you are unable to use iTunes shortly after launching it. Use the following article to help troubleshoot the issue, named:
iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
http://support.apple.com/kb/ts1717
Start with this step to isolate 3rd party plugins that may be causing an issue, an use the rest of the troubleshooting if needed.
Start iTunes in Safe Mode
Open iTunes in Safe Mode to isolate any interference from plug-ins or scripts not manufactured by Apple.
Hold down Shift–Control while opening iTunes. You should see a dialog that says "iTunes is running in safe mode" before iTunes finishes starting up.
Click Continue.
See if the issue you're experiencing persists in Safe Mode.
If you have the same issue while iTunes is in Safe Mode, proceed to the "Create a new user account" section. If you don't experience the same issue, follow these steps to remove third-party plug-ins.
Thank you for using Apple Support Communities.
All the very best,
Sterling -
Error Posting IDOC: need help in understanding the following error
Hi ALL
Can you please, help me understand the following error encountered while the message was trying to post a IDOC.
where SAP_050 is the RFC destination created to post IDOCs
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Call Adapter
-->
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>XIAdapter</SAP:Category>
<SAP:Code area="IDOC_ADAPTER">ATTRIBUTE_IDOC_RUNTIME</SAP:Code>
<SAP:P1>FM NLS_GET_LANGU_CP_TAB: Could not determine code page with SAP_050 Operation successfully executed FM NLS_GET_LANGU_CP_TAB</SAP:P1>
<SAP:P2 />
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>Error: FM NLS_GET_LANGU_CP_TAB: Could not determine code page with SAP_050 Operation successfully executed FM NLS_GET_LANGU_CP_TAB</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
Your help is greatly appreciated.............Thank you!Hi Patrick,
Check the authorizations assigned to the user which you used in the RFC destinations, If there is no enough authorizations then it is not possible to post the idocs.
Also Refer this Note 747322
Regards,
Prakash -
I've installed CS6 and web Premium on a Mac running 10.9.5, and Dreamweaver,Flash and Illustrator wont launch. All other components work normally. In Activity monitor it says Adobe switchboard failed to respond. Can anyone help solve this issue?
Release: 4/25/2012
http://support.amd.com/us/gpudownload/windows/Pages/radeonmob_win7-64.aspx -
E-Rows = NULL and A-Rows=42M? Need help in understanding why.
Hi,
Oracle Standard Edition 11.2.0.3.0 CPU Oct 2012 running on Windows 2008 R2 x64. I am using Oracle 10g syntax for WITH clause as the query will also run on Oracle 10gR2. I do not have a Oracle 10gR2 environment at hand to comment if this behaves the same.
Following query is beyond me. It takes around 2 minutes to return the "computed" result set of 66 rows.
SQL> WITH dat AS
2 (SELECT 723677 vid,
3 243668 fid,
4 TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
5 TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt
6 FROM DUAL
7 UNION ALL
8 SELECT 721850,
9 243668,
10 TO_DATE ('06.02.2013', 'dd.mm.yyyy'),
11 TO_DATE (' 22.03.2013', 'dd.mm.yyyy')
12 FROM DUAL
13 UNION ALL
14 SELECT 723738,
15 243668,
16 TO_DATE ('16.03.2013', 'dd.mm.yyyy'),
17 TO_DATE (' 04.04.2013', 'dd.mm.yyyy')
18 FROM DUAL)
19 SELECT /*+ GATHER_PLAN_STATISTICS */ DISTINCT vid, fid, mindt - 1 + LEVEL dtshow
20 FROM dat
21 CONNECT BY LEVEL <= maxdt - mindt + 1
22 order by fid, vid, dtshow;
66 rows selected.
SQL>
SQL> SELECT * FROM TABLE (DBMS_XPLAN.display_cursor (NULL, NULL, 'ALLSTATS LAST'));
PLAN_TABLE_OUTPUT
SQL_ID 9c4vma4mds6zk, child number 0
WITH dat AS (SELECT 723677 vid, 243668 fid,
TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt FROM DUAL
UNION ALL SELECT 721850, 243668,
TO_DATE ('06.02.2013', 'dd.mm.yyyy'), TO_DATE ('
22.03.2013', 'dd.mm.yyyy') FROM DUAL UNION ALL
SELECT 723738, 243668, TO_DATE
('16.03.2013', 'dd.mm.yyyy'), TO_DATE (' 04.04.2013',
'dd.mm.yyyy') FROM DUAL) SELECT /*+
GATHER_PLAN_STATISTICS */ DISTINCT vid, fid, mindt - 1 + LEVEL dtshow
FROM dat CONNECT BY LEVEL <= maxdt - mindt + 1 order by fid, vid,
dtshow
Plan hash value: 1865145249
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | OMem | 1Mem | Used-Mem |
| 0 | SELECT STATEMENT | | 1 | | 66 |00:01:54.64 | | | |
| 1 | SORT UNIQUE | | 1 | 3 | 66 |00:01:54.64 | 6144 | 6144 | 6144 (0)|
| 2 | CONNECT BY WITHOUT FILTERING (UNIQUE)| | 1 | | 42M|00:01:04.00 | | | |
| 3 | VIEW | | 1 | 3 | 3 |00:00:00.01 | | | |
| 4 | UNION-ALL | | 1 | | 3 |00:00:00.01 | | | |
| 5 | FAST DUAL | | 1 | 1 | 1 |00:00:00.01 | | | |
| 6 | FAST DUAL | | 1 | 1 | 1 |00:00:00.01 | | | |
| 7 | FAST DUAL | | 1 | 1 | 1 |00:00:00.01 | | | |
--------------------------------------------------------------------------------------------------------------------------If I take out one of the UNION queries, the query returns in under 1 second.
SQL> WITH dat AS
2 (SELECT 723677 vid,
3 243668 fid,
4 TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
5 TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt
6 FROM DUAL
7 UNION ALL
8 SELECT 721850,
9 243668,
10 TO_DATE ('06.02.2013', 'dd.mm.yyyy'),
11 TO_DATE (' 22.03.2013', 'dd.mm.yyyy')
12 FROM DUAL)
13 SELECT /*+ GATHER_PLAN_STATISTICS */ DISTINCT vid, fid, mindt - 1 + LEVEL dtshow
14 FROM dat
15 CONNECT BY LEVEL <= maxdt - mindt + 1
16 order by fid, vid, dtshow;
46 rows selected.
SQL>
SQL> SELECT * FROM TABLE (DBMS_XPLAN.display_cursor (NULL, NULL, 'ALLSTATS LAST'));
PLAN_TABLE_OUTPUT
SQL_ID 1d2f62uy0521p, child number 0
WITH dat AS (SELECT 723677 vid, 243668 fid,
TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt FROM DUAL
UNION ALL SELECT 721850, 243668,
TO_DATE ('06.02.2013', 'dd.mm.yyyy'), TO_DATE ('
22.03.2013', 'dd.mm.yyyy') FROM DUAL) SELECT /*+
GATHER_PLAN_STATISTICS */ DISTINCT vid, fid, mindt - 1 + LEVEL dtshow
FROM dat CONNECT BY LEVEL <= maxdt - mindt + 1 order by fid, vid,
dtshow
Plan hash value: 2232696677
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | OMem | 1Mem | Used-Mem |
| 0 | SELECT STATEMENT | | 1 | | 46 |00:00:00.01 | | | |
| 1 | SORT UNIQUE | | 1 | 2 | 46 |00:00:00.01 | 4096 | 4096 | 4096 (0)|
| 2 | CONNECT BY WITHOUT FILTERING (UNIQUE)| | 1 | | 90 |00:00:00.01 | | | |
| 3 | VIEW | | 1 | 2 | 2 |00:00:00.01 | | | |
| 4 | UNION-ALL | | 1 | | 2 |00:00:00.01 | | | |
| 5 | FAST DUAL | | 1 | 1 | 1 |00:00:00.01 | | | |
| 6 | FAST DUAL | | 1 | 1 | 1 |00:00:00.01 | | | |
26 rows selected.What I cannot understand is why the E-Rows is NULL for "CONNECT BY WITHOUT FILTERING (UNIQUE)" step and A-Rows shoots up to 42M for first case. The behaviour is the same for any number of UNION queries above two.
Can anyone please help me understand this and aid in tuning this accordingly? Also, I would be happy to know if there are better ways to generate the missing date range.
Regards,
SatishMay be, this?
WITH dat AS
(SELECT 723677 vid,
243668 fid,
TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt
FROM DUAL
UNION ALL
SELECT 721850,
243668,
TO_DATE ('06.02.2013', 'dd.mm.yyyy'),
TO_DATE (' 22.03.2013', 'dd.mm.yyyy')
FROM DUAL
UNION ALL
SELECT 723738,
243668,
TO_DATE ('16.03.2013', 'dd.mm.yyyy'),
TO_DATE (' 04.04.2013', 'dd.mm.yyyy')
FROM DUAL)
SELECT vid, fid, mindt - 1 + LEVEL dtshow
FROM dat
CONNECT BY LEVEL <= maxdt - mindt + 1
and prior vid = vid
and prior fid = fid
and prior sys_guid() is not null
order by fid, vid, dtshow;
66 rows selected.
Elapsed: 00:00:00.03 -
Can you help me understand the use of the word POSITION in TR and CFM?
Hi,
I am trying to have a view of typical BI reports in TR and TM/CFM so through my research I came to the following link:.
http://help.sap.com/saphelp_nw2004s/helpdata/en/62/08193c38f98e1ce10000000a11405a/frameset.htm
My problem on this link and other postings on this site seem to be the same. Can you help me understand the use of the word POSITIONS in these context:
1. Our client has asked for financial transaction reports in BW, such as position of Borrowings, Investments and Hedge Operations (TM data).
2. I have a requirement on, some reports related to Money Market (Fixed Term Deposits, Deposits at Notice) something on FSCM-Treasury and Risk Manager. These reports will be similar to that of Loans, i.e. Position statement, flow statement, etc.
3. The set of position values for a single position or a limited amount of positions can be reported by transactions TPM12 and TPM13 in R3.
4. 0CFM_C10 (Financial Positions Cube)
Do you have some simple report outputs to help clarify how the word POSITION is used in such environments?
Thanks
Edited by: AmandaBaah on Feb 15, 2010 4:39 PMIf I future buy 10 shares in company at £1 per share - at the end of the day my potential value is £10
The next day the shares drop tp £0.9 per share - I have a negative position - my shares are only worth £9
I haven;t bought them yet - but I have a negative position - ie if things stayed as they are - I am going to realise (ie end up with) a loss
Now you can use this for loans and foreign exchange banks as well... -
Need your help on performance issue please
Hello everyone!
I need your help to understand an effect I notice with a Thread class I built. I currently work on enhancement of my application Playlist Editor (see http://www.lightdev.com/page74.htm) and a new release will be available soon.
Among other extensions the new release will have a title filter function which is based on audio data that is recursively read from ID3 tags of files found in a given root directory. The data collection is done by a CollectionThread class which reads into a data model class AudioDataModel and the entire process works fine, no problem with that.
However, when my application is started for the first time the CollectionThread runs approximately 3 minutes to collect data from approximately 4300 audio files on an Intel Pentium M 1,4 GHz, 512 MB RAM, Windows XP SP2. When the application is shut down and started again, it takes only a few seconds to do the same task for all subsequent launches.
I already tried to start the application with java option -Xms40m to increase initial heap size. This increases performance in general but the effect is still the same, i.e. first run lasts significantly longer than subsequent runs.
I also tried to build a pool mechanism which creates many empty objects in the data model and then releases them to contain the actual data at is being read in but this did not lead to better performance.
It must have to do with how Java (or Windows?) allocates and caches memory. I wonder whether there is a way to pre-allocate memory or if there are any other ideas to improve performance so that the process always only takes seconds instead of minutes?
I attach the key classes to this message. Any help or ideas is much appreciated!
Thanks a lot a best regards
Ulrich
PS: You can use the news subscription service at
http://www.lightdev.com/dynTemplate.php4?id=80&dynPage=subscribe.php4 to be informed when the new release of Playlist Editor is available.
All classes posted here do not need debugging, they already have proven to run error free. The classes are only posted for information for the interested reader - no need to go through all the stuff in detail - only if it interests you.
My application calls class CollectionThread wich is a subclass of InfoThread. CollectionThread recursively goes through a directory and file structure and stores found ID3 tag information in instances of class ID3v11Tag which in turn gets stored in one instance of class AudioDataModel. All classes are shown below.
This is the mentioned CollectionThread
* Light Development Playlist Editor
* Copyright (C) 2004 Ulrich Hilger
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package com.lightdev.app.playlisteditor.data;
import com.lightdev.lib.util.InfoThread;
import java.io.File;
* A class to collect audio data from a given storage location.
* <p>
* <code>CollectionThread</code> uses ID3 tag information to gain data.
* </p>
* <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
* ID3 tags.</p>
* @author Ulrich Hilger
* @author Light Development
* @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
* @author <a href="mailto:[email protected]">[email protected]</a>
* @author published under the terms and conditions of the
* GNU General Public License,
* for details see file gpl.txt in the distribution
* package of this software as well as any licensing notes
* inside this documentation
* @version 1, October 13, 2004
public class CollectionThread extends InfoThread {
* constructor
* @param model AudioDataModel the data model to collect data to
public CollectionThread(AudioDataModel model) {
this.model = model;
* constructor, creates a new empty AudioDataModel
public CollectionThread() {
this(new AudioDataModel());
* set the data model to collect data to
* @param model AudioDataModel the model to collect data to
public void setModel(AudioDataModel model) {
this.model = model;
* get the data model associated to this thread
* @return AudioDataModel the data model
public AudioDataModel getModel() {
return model;
* set the directory to collect data from
* @param rootDir File the directory to collect data from
public void setRootDirectory(File rootDir) {
this.rootDir = rootDir;
* do te actual work of this thread, i.e. iterate through a given directory
* structure and collect audio data
* @return boolean true, if work is left
protected boolean work() {
boolean workIsLeft = true;
maxValue = -1;
filesProcessed = 0;
if(getStatus() < STATUS_HALT_PENDING) {
countElements(rootDir.listFiles());
if(getStatus() < STATUS_HALT_PENDING) {
workIsLeft = collect(rootDir.listFiles());
return workIsLeft;
* count the elements in a given file array including its subdirectories
* @param files File[]
private void countElements(File[] files) {
int i = 0;
while (i < files.length && getStatus() < STATUS_HALT_PENDING) {
File file = files;
if (file.isDirectory()) {
countElements(file.listFiles());
i++;
maxValue++;
* recursively read data into model
* @param files File[] the file array representing the content of a given directory
private boolean collect(File[] files) {
int i = 0;
while(i < files.length && getStatus() < STATUS_HALT_PENDING) {
File file = files[i];
if(file.isDirectory()) {
collect(file.listFiles());
else if(file.getName().toLowerCase().endsWith("mp3")) {
try {
model.addTrack(file);
catch(Exception e) {
fireThreadException(e);
i++;
filesProcessed++;
fireThreadProgress(filesProcessed);
return (i<files.length);
/** the directory to collect data from */
private File rootDir;
/** the data model to collect data to */
private AudioDataModel model;
/** the number of files this thread processed so far while it is running */
private long filesProcessed = 0;
This is class InfoThread
* Light Development Java Library
* Copyright (C) 2003, 2004 Ulrich Hilger
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package com.lightdev.lib.util;
import java.util.Vector;
import java.util.Enumeration;
* Abstract class <code>InfoThread</class> implements a status and listener concept.
* An <code>InfoThread</code> object actively informs all objects registered as listeners about
* status changes, progress and possible exceptions. This way the status of a running
* thread does not require a polling mechanism to be monitored.
* <p>
* <code>InfoThread</code> implements the following working scheme
* </p>
* @author Ulrich Hilger
* @author Light Development
* @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
* @author <a href="mailto:[email protected]">[email protected]</a>
* @author published under the terms and conditions of the
* GNU General Public License,
* for details see file gpl.txt in the distribution
* package of this software
* @version Version 1, October 13, 2004
public abstract class InfoThread extends Thread {
* construct an <code>InfoThread</code> object
* <p>This class is meant to be used when a <code>Thread</code> object is needed that actively
* informs other objects about its status</code>. It is a good idea therefore to register
* one or more listeners with instances of this class before doing anything
* else.</p>
* @see addInfoThreadListener
public InfoThread() {
* set the amount of time this thread shall idle after it is through with one
* work cycle and before a next work cycle is started. This influences the time
* other threads have for their work.
* @param millis long the number of milliseconds to idle after one work cycle
public void setIdleMillis(long millis) {
idleMillis = millis;
* Causes this thread to begin execution; the Java Virtual Machine calls the <code>run</code>
* method of this thread. Calls method <code>prepareThread</code> before calling
* <code>run</code>.
* @see run
* @see prepareThread
public synchronized void start() {
setStatus(STATUS_INITIALIZING);
prepareThread();
setStatus(STATUS_READY);
super.start();
* call method <code>start</code> instead of this method.
* calling this method directly will lead to an exception
* @see start
public void run() {
//System.out.println("InfoThread.run");
if (status == STATUS_READY) {
boolean workIsLeft = true;
setStatus(STATUS_RUNNING);
while (status < STATUS_STOP_PENDING && workIsLeft) {
if (status < STATUS_HALT_PENDING) {
workIsLeft = work();
if(!workIsLeft) {
setStatus(STATUS_WORK_COMPLETE);
if (status == STATUS_HALT_PENDING) {
setStatus(STATUS_HALTED);
else if (status == STATUS_STOP_PENDING) {
setStatus(STATUS_STOPPED);
else {
try {
sleep(idleMillis);
catch (InterruptedException e) {
fireThreadException(e);
else {
// error: Thread is not ready to run
setStatus(STATUS_THREAD_FINISHED);
* stop this thread. This will terminate the thread irrevokably. Use method
* <code>haltThread</code> to pause a thread with the possiblity to resume work later.
* @see haltThread
public void stopThread() {
switch (status) {
case STATUS_RUNNING:
setStatus(STATUS_STOP_PENDING);
break;
case STATUS_HALT_PENDING:
// exception: the thread already is about to halt
break;
case STATUS_STOP_PENDING:
// exception: the thread already is about to stop
break;
default:
// exception: a thread can not be stopped, when it is not running
break;
* halt this thread, i.e. pause working allowing to resume later
* @see resumeThread
public void haltThread() {
switch (status) {
case STATUS_RUNNING:
setStatus(STATUS_STOP_PENDING);
break;
case STATUS_HALT_PENDING:
// exception: the thread already is about to halt
break;
case STATUS_STOP_PENDING:
// exception: the thread already is about to stop
break;
default:
// exception: a thread can not be halted, when it is not running
break;
* resume this thread, i.e. resume previously halted work
* @see haltThread
public void resumeThread() {
if(status == STATUS_HALTED || status == STATUS_HALT_PENDING) {
setStatus(STATUS_RUNNING);
else {
// exception: only halted threads or threads that are about to halt can be resumed
* this is the method to prepare a thread to run. It is not implemented in this abstract
* class. Subclasses of <code>InfoThread</code> can implement this method to do anything
* that might be required to put their thread into STATUS_READY. This method is called
* automatically by method <code>start</code>. When implementing this method, it should
* call method <code>fireThreadException</code> accordingly.
* @see start
* @see fireThreadException
protected void prepareThread() {
// does nothing in this abstract class but might be needed in subclasses
* this is the main activity method of this object. It is not implemented in this abstract
* class. Subclasses of <code>InfoThread</code> must implement this method to do something
* meaningful. When implementing this method, it should call methods
* <code>fireThreadProgress</code> and <code>fireThreadException</code> accordingly.
* @return boolean true, if work is left, false if not
* @see fireThreadProgress
* @see fireTreadException
protected abstract boolean work();
* add an <code>InfoTreadListener</code> to this instance of <code>InfoThread</code>
* @param l InfoThreadListener the listener to add
* @see removeInfoThreadListener
public void addInfoThreadListener(InfoThreadListener l) {
listeners.add(l);
* remove an <code>InfoTreadListener</code> from this instance of <code>InfoThread</code>
* @param l InfoThreadListener the listener to remove
public void removeInfoThreadListener(InfoThreadListener l) {
listeners.remove(l);
* notify all <code>InfoThreadListener</code>s of a status change
* @param fromStatus int the status tis thread had before the change
* @param toStatus int the status this thread has now
protected void fireThreadStatusChanged(int fromStatus, int toStatus) {
Enumeration e = listeners.elements();
while(e.hasMoreElements()) {
Object l = e.nextElement();
if(l instanceof InfoThreadListener) {
((InfoThreadListener) l).threadStatusChanged(this, fromStatus, toStatus);
* notify all <code>InfoThreadListener</code>s of an exception in this thread
* @param ex Exception the exception that occurred
protected void fireThreadException(Exception ex) {
Enumeration e = listeners.elements();
while(e.hasMoreElements()) {
Object l = e.nextElement();
if(l instanceof InfoThreadListener) {
((InfoThreadListener) l).threadException(this, ex);
* notify all <code>InfoThreadListener</code>s of the progress of this thread
* @param progressValue long a value indicating the current thread progress
protected void fireThreadProgress(long progressValue) {
Enumeration e = listeners.elements();
while(e.hasMoreElements()) {
Object l = e.nextElement();
if(l instanceof InfoThreadListener) {
((InfoThreadListener) l).threadProgress(this, progressValue, maxValue);
* set the status of this thread and notify all listeners
* @param newStatus int the status this thread is to be changed to
private void setStatus(int newStatus) {
//System.out.println("InfoThread.setStatus oldStatus=" + status + ", newStatus=" + newStatus);
int fromStatus = status;
status = newStatus;
fireThreadStatusChanged(fromStatus, newStatus);
* get the current status of this thread
* @return int the status
public int getStatus() {
return status;
* cleanup before actual destruction.
public void destroy() {
//System.out.println("InfoThread.destroy");
cleanup();
super.destroy();
* cleanup all references this thread maintains
private void cleanup() {
//System.out.println("InfoThread.cleanup");
listeners.removeAllElements();
listeners = null;
/* ----------------------- class fields start ------------------------ */
/** storage for the objects this thread notifies about status changes and progress */
private Vector listeners = new Vector();
/** indicator for the status of this thread */
private int status = STATUS_NONE;
/** maximum value for threadProgress */
protected long maxValue = -1;
/** the idle time inside one work cycle in milliseconds */
protected long idleMillis = 1;
/* ----------------------- class fields end -------------------------- */
/* ----------------------- constants start --------------------------- */
/** constant value indicating that no status has been set so far */
public static final int STATUS_NONE = 0;
/** constant value indicating that the thread is currently initializing */
public static final int STATUS_INITIALIZING = 1;
/** constant value indicating that the thread is ready to run */
public static final int STATUS_READY = 2;
/** constant value indicating that the thread is running */
public static final int STATUS_RUNNING = 3;
/** constant value indicating that the thread is about to halt */
public static final int STATUS_HALT_PENDING = 4;
/** constant value indicating that the thread is halted */
public static final int STATUS_HALTED = 5;
/** constant value indicating that the work of this thread is complete */
public static final int STATUS_WORK_COMPLETE = 6;
/** constant value indicating that the thread is about to stop */
public static final int STATUS_STOP_PENDING = 7;
/** constant value indicating that the thread is stopped */
public static final int STATUS_STOPPED = 8;
/** constant value indicating that the thread is finished */
public static final int STATUS_THREAD_FINISHED = 9;
/* ----------------------- constants end --------------------------- */
}this is the InfoThreadListener interface
* Light Development Java Library
* Copyright (C) 2003, 2004 Ulrich Hilger
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package com.lightdev.lib.util;
* An interface classes interested to receive events from objects
* of class <code>InfoThread</code> need to implement.
* @author Ulrich Hilger
* @author Light Development
* @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
* @author <a href="mailto:[email protected]">[email protected]</a>
* @author published under the terms and conditions of the
* GNU General Public License,
* for details see file gpl.txt in the distribution
* package of this software
* @version Version 1, October 13, 2004
public interface InfoThreadListener {
* method to receive a status change notification from a thread
* @param thread InfoThread the thread which status changed
* @param fromStatus int the status which the thread had before the change
* @param toStatus int the status which the thread has now
public void threadStatusChanged(InfoThread thread, int fromStatus, int toStatus);
* method to receive a notification about the progress of a thread
* @param thread InfoThread the thread which notified about its progress
* @param progressValue long the value (e.g. 10 if 100 percent completed, 20 of 1 million files processed, etc.)
public void threadProgress(InfoThread thread, long progressValue, long maxValue);
* method to receive a notifiaction about the fact that an exception occurred in a thread
* @param thread InfoThread the thread for which an exception occurred
* @param e Exception the exception that occurred
public void threadException(InfoThread thread, Exception e);
}This is class AudioFileDescriptor
* Light Development Java Library
* Copyright (C) 2004 Ulrich Hilger
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package com.lightdev.lib.audio;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.io.Serializable;
import java.text.DecimalFormat;
* This class models characteristics of an audio file such as the absolute path
* of the file, its tag contents (if any) and the play duration, etc.
* <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
* ID3 tags.</p>
* @author Ulrich Hilger
* @author Light Development
* @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
* @author <a href="mailto:[email protected]">[email protected]</a>
* @author published under the terms and conditions of the
* GNU General Public License,
* for details see file gpl.txt in the distribution
* package of this software
* @version Version 1, October 13, 2004
public class AudioFileDescriptor implements Serializable, Comparable {
public AudioFileDescriptor(String absolutePath) throws FileNotFoundException, IOException {
load(absolutePath);
public boolean equals(Object o) {
if(o != null && o instanceof AudioFileDescriptor) {
return ((AudioFileDescriptor) o).getAbsolutePath().equalsIgnoreCase(this.getAbsolutePath());
else {
return false;
public void load(String absolutePath) throws FileNotFoundException, IOException {
this.absolutePath = absolutePath;
RandomAccessFile rf = new RandomAccessFile(absolutePath, "r");
if(id3v11Tag == null) {
id3v11Tag = new ID3v11Tag(rf, false);
else {
id3v11Tag.readTag(rf, rf.length() - 128);
rf.close();
public String getAbsolutePath() {
return absolutePath;
public ID3v11Tag getID3v11Tag() {
return id3v11Tag;
public void setID3v11Tag(ID3v11Tag tag) {
this.id3v11Tag = tag;
public String toString() {
DecimalFormat df = new DecimalFormat("00");
return id3v11Tag.getArtist() + ", " + id3v11Tag.getAlbum() + " - " +
df.format(id3v11Tag.getTrackNumber()) + " " + id3v11Tag.getTitle();
* Compares this object with the specified object for order.
* @param o the Object to be compared.
* @return a negative integer, zero, or a positive integer as this object is less than, equal to,
* or greater than the specified object.
* @todo Implement this java.lang.Comparable method
public int compareTo(Object o) {
return toString().compareTo(o.toString());
private String absolutePath;
private ID3v11Tag id3v11Tag;
private transient long duration = -1;
private transient int type = TYPE_UNKNOWN;
public static final transient int TYPE_UNKNOWN = 0;
public static final transient int TYPE_MP3 = 1;
}This is class ID3V11Tag into which the data is actually stored
* Light Development Java Library
* Copyright (C) 2004 Ulrich Hilger
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package com.lightdev.lib.audio;
import java.io.File;
import java.io.RandomAccessFile;
import java.io.IOException;
import java.io.Serializable;
import java.text.DecimalFormat;
* This class is a very simple implementation of an ID3v11Tag. It models an ID3 tag
* pretty much the same way as it is physically stored inside an audio file.
* <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
* ID3 tags.</p>
* @author Ulrich Hilger
* @author Light Development
* @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
* @author <a href="mailto:[email protected]">[email protected]</a>
* @author published under the terms and conditions of the
* GNU General Public License,
* for details see file gpl.txt in the distribution
* package of this software
* @version Version 1, October 13, 2004
public class ID3v11Tag implements Serializable, Comparable {
* construct an ID3v11Tag and read tag content from a given file
* <p>This constructor can be used for cases where a RandomAccessFile has already
* been opened and will be closed elsewhere</p>
* @param rf RandomAccessFile the open file to read from
* @param isAtTagStartPos boolean true, if the file pointer is at the
* position where the ID3 tag starts; when false, the pointer is positioned accordingly here
* @throws IOException
public ID3v11Tag(RandomAccessFile rf, boolean isAtTagStartPos) throws IOException {
if(isAtTagStartPos) {
readTag(rf);
else {
readTag(rf, rf.length() - 128);
* construct an ID3v11Tag and read tag content from a file at a given location
* <p>This constructor opens and closes the audio file for reading</p>
* @param absolutePath String the absolute path to the audio file to open
* @throws IOException
public ID3v11Tag(String absolutePath) throws IOException {
RandomAccessFile rf = new RandomAccessFile(absolutePath, "r");
readTag(rf, rf.length() - 128);
rf.close();
* construct an ID3v11Tag and read tag content from a given file
* <p>This constructor opens and closes the audio file for reading</p>
* @param audioFile File the audio file to read from
* @throws IOException
public ID3v11Tag(File audioFile) throws IOException {
this(audioFile.getAbsolutePath());
* get a string representation of this object
* @return String
public String toString() {
DecimalFormat df = new DecimalFormat("00");
return getArtist() + ", " + getAlbum() + " - " + df.format(getTrackNumber()) + " " + getTitle();
* position to file pointer and read the tag
* @param rf RandomAccessFile the file to read from
* @param jumpPos long the position to jump to (the tag start position)
* @throws IOException
public void readTag(RandomAccessFile rf, long jumpPos) throws IOException {
rf.seek(jumpPos);
readTag(rf);
* read the tag from a given file, assuming the file pointer to be at the tag start position
* @param rf RandomAccessFile the file to read from
* @throws IOException
public void readTag(RandomAccessFile rf) throws IOException {
rf.read(tagBuf);
if(tag.equalsIgnoreCase(new String(tagBuf))) {
rf.read(title);
rf.read(artist);
rf.read(album);
rf.read(year);
rf.read(comment);
rf.read(trackNo);
rf.read(genre);
public String getTitle() {
return new String(title).trim();
public String getArtist() {
return new String(artist).trim();
public String getAlbum() {
return new String(album).trim();
public String getYear() {
return new String(year).trim();
public String getComment() {
return new String(comment).trim();
public int getGenreId() {
try {
int id = new Byte(genre[0]).intValue();
if(id < GENRE_ID_MIN || id > GENRE_ID_MAX) {
return GENRE_ID_OTHER;
else {
return id;
catch(Exception ex) {
return GENRE_ID_OTHER;
public String getGenreName() {
return genreNames[getGenreId()];
public int getTrackNumber() {
try {
return (int) trackNo[0];
catch(Exception e) {
return 0;
* Compares this object with the specified object for order.
* @param o the Object to be compared.
* @return a negative integer, zero, or a positive integer as this object is less than, equal to,
*Hi Franck,
thank you, mate. I did what you suggested (changed class attached) but that did not change the mentioned behaviour.
The first run is approximately 75 seconds with Java option -Xms40m and approx. double without, the second run and all subsequent runs are only 2-3 seconds each (!!!) even when terminating and re-starting the application between thread runs.
I'm pretty clueless about that, any more help on this anyone?
Thanks a lot and best regards
Ulrich
PS: BTW, I forgot to post the class that is filled with data by class CollectionThread, so here it is
* Light Development Playlist Editor
* Copyright (C) 2004 Ulrich Hilger
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package com.lightdev.app.playlisteditor.data;
import java.io.File;
import com.lightdev.lib.audio.ID3v11Tag;
import javax.sound.sampled.UnsupportedAudioFileException;
import java.io.IOException;
import java.io.Serializable;
import com.lightdev.lib.audio.AudioFileDescriptor;
import com.lightdev.lib.ui.SortListModel;
import java.util.Iterator;
* Storage model for audio data.
* <p>
* <code>AudioDataModel</code> can be used to store ID3 tag data collected from
* a directory with audio files to perform queries and reports on the found data.
* </p>
* <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
* ID3 tags.</p>
* @author Ulrich Hilger
* @author Light Development
* @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
* @author <a href="mailto:[email protected]">[email protected]</a>
* @author published under the terms and conditions of the
* GNU General Public License,
* for details see file gpl.txt in the distribution
* package of this software as well as any licensing notes
* inside this documentation
* @version 1, October 15, 2004
public class AudioDataModel extends SortListModel implements Serializable {
* constructor
public AudioDataModel() {
* add an audio track from a given audio file
* <p>This will attempt to read ID3 tag data from the file.</p>
* @param audioFile File the file to add audio data for
* @throws IOException
public void addTrack(File audioFile) throws IOException {
AudioFileDescriptor afd = new AudioFileDescriptor(audioFile.getAbsolutePath());
if (!data.contains(afd)) {
data.add(afd);
* get all tracks for agiven combination of genre name, artist name and album name. Any of
* the parameters may be null or AudioDataModel.FILTER_ALL
* <p>Ugly code, I know, but it simply hard codes all combinations of the the mentioned
* parameters. Any more elegant implementations welcome.</p>
* @param genreName String a genre name to get tracks for
* @param artistName String an artist name to get tracks for
* @param albumName String an album name to get tracks for
* @return SortListModel the found tracks in a list model
public SortListModel getTracks(String genreName, String artistName, String albumName) {
SortListModel foundTracks = new SortListModel();
Iterator e = data.iterator();
while(e.hasNext()) {
AudioFileDescriptor afd = (AudioFileDescriptor) e.next();
ID3v11Tag tag = afd.getID3v11Tag();
if(genreName == null || genreName.equalsIgnoreCase(FILTER_ALL)) {
if(artistName == null || artistName.equalsIgnoreCase(FILTER_ALL)) {
if (tag.getAlbum().equalsIgnoreCase(albumName))
foundTracks.add(afd);
else {
if(albumName == null || albumName.equalsIgnoreCase(FILTER_ALL)) {
if (tag.getArtist().equalsIgnoreCase(artistName))
foundTracks.add(afd);
else {
if (tag.getArtist().equalsIgnoreCase(artistName) &&
tag.getAlbum().equalsIgnoreCase(albumName))
foundTracks.add(afd);
else {
if(artistName == null || artistName.equalsIgnoreCase(FILTER_ALL)) {
if(albumName == null || albumName.equalsIgnoreCase(FILTER_ALL)) {
if (tag.getGenreName().equalsIgnoreCase(genreName))
foundTracks.add(afd);
else {
if (tag.getGenreName().equalsIgnoreCase(genreName) &&
tag.getAlbum().equalsIgnoreCase(albumName))
foundTracks.add(afd);
else {
if(albumName == null || albumName.equalsIgnoreCase(FILTER_ALL)) {
if (tag.getGenreName().equalsIgnoreCase(genreName) &&
tag.getArtist().equalsIgnoreCase(artistName))
foundTracks.add(afd);
else {
if (tag.getGenreName().equalsIgnoreCase(genreName) &&
tag.getArtist().equalsIgnoreCase(artistName) &&
tag.getAlbum().equalsIgnoreCase(albumName))
foundTracks.add(afd);
foundTracks.sort();
return foundTracks;
* list all artists in this model
* @return SortListModel
public SortListModel listArtists() {
SortListModel artists = new SortListModel();
artists.add(FILTER_ALL);
Iterator e = data.iterator();
while (e.hasNext()) {
ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
String artistName = tag.getArtist();
if (artists.indexOf(artistName) < 0) {
artists.add(artistName);
artists.sort();
return artists;
* list all artists in this model having titles belonging to a given genre
* @param genreName String name of the genre artists are searched for
* @return SortListModel
public SortListModel listArtists(String genreName) {
SortListModel artists = new SortListModel();
artists.add(FILTER_ALL);
Iterator e = data.iterator();
while (e.hasNext()) {
ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
String artistName = tag.getArtist();
String genre = tag.getGenreName();
if (artists.indexOf(artistName) < 0 && genre.equalsIgnoreCase(genreName)) {
artists.add(artistName);
artists.sort();
return artists;
* list all genres in this model
* @return SortListModel
public SortListModel listGenres() {
SortListModel genres = new SortListModel();
genres.add(FILTER_ALL);
Iterator e = data.iterator();
while (e.hasNext()) {
ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
String genreName = tag.getGenreName();
if (genres.indexOf(genreName) < 0) {
genres.add(genreName);
genres.sort();
return genres;
* list all albums in this model
* @return SortListModel
public SortListModel listAlbums() {
SortListModel albums = new SortListModel();
albums.add(FILTER_ALL);
Iterator e = data.iterator();
while (e.hasNext()) {
ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
String albumName = tag.getAlbum();
if (albums.indexOf(albumName) < 0) {
albums.add(albumName);
albums.sort();
return albums;
* list all albums in this model having titles belonging to a given genre
* @param genreName String name of the genre albums are searched for
* @return SortListModel
public SortListModel listAlbums(String genreName) {
SortListModel albums = new SortListModel();
albums.add(FILTER_ALL);
Iterator e = data.iterator();
while (e.hasNext()) {
ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
String albumName = tag.getAlbum();
String genre = tag.getGenreName();
if (albums.indexOf(albumName) < 0 && genre.equalsIgnoreCase(genreName)) {
albums.add(albumName);
albums.sort();
return albums;
* list all albums in this model having titles belonging to a given genre and artist
* @param genreName String name of the genre albums are searched for
* @param artistName String name of the artist albums are searched for
* @return SortListModel
public SortListModel listAlbums(String genreName, String artistName) {
SortListModel albums = new SortListModel();
albums.add(FILTER_ALL);
Iterator e = data.iterator();
while (e.hasNext()) {
ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
String albumName = tag.getAlbum();
String genre = tag.getGenreName();
String artist = tag.getArtist();
if(genreName == null || genreName.equalsIgnoreCase(FILTER_ALL)) {
if (albums.indexOf(albumName) < 0 &&
artist.equalsIgnoreCase(artistName))
albums.add(albumName);
else {
if (albums.indexOf(albumName) < 0 &&
genre.equalsIgnoreCase(genreName) &&
artist.equalsIgnoreCase(artistName))
albums.add(albumName);
albums.sort();
return albums;
* get the number of audio tracks stored in this data model
* @return int the number of tracks
public int getTrackCount() {
return data.size();
/** constant to select all items of a given part */
public static final String FILTER_ALL = " all";
}...and here the changed CollectionThread now caching found File objects in a vector
* Light Development Playlist Editor
* Copyright (C) 2004 Ulrich Hilger
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package com.lightdev.app.playlisteditor.data;
import com.lightdev.lib.util.InfoThread;
import java.io.File;
import java.util.Vector;
import java.util.Enumeration;
* A class to collect audio data from a given storage location.
* <p>
* <code>CollectionThread</code> uses ID3 tag information to gain data.
* </p>
* <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
* ID3 tags.</p>
* @author Ulrich Hilger
* @author Light Development
* @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
* @author <a href="mailto:[email protected]">[email protected]</a>
* @author published under the terms and conditions of the
* GNU General Public License,
* for details see file gpl.txt in the distribution
* package of this software as well as any licensing notes
* inside this documentation
* @version 1, October 13, 2004
public class CollectionThread extends InfoThread {
* constructor
* @param model AudioDataModel the data model to collect data to
public CollectionThread(AudioDataModel model) {
this.model = model;
* constructor, creates a new empty AudioDataModel
public CollectionThread() {
this(new AudioDataModel());
* set the data model to collect data to
* @param model AudioDataModel the model to collect data to
public void setModel(AudioDataModel model) {
this.model = model;
* get the data model associated to this thread
* @return AudioDataModel the data model
public AudioDataModel getModel() {
return model;
* set the directory to collect data from
* @param rootDir File the directory to collect data from
public void setRootDirectory(File rootDir) {
this.rootDir = rootDir;
* this is the method to prepare a thread to run.
protected void prepareThread() {
maxValue = -1;
filesProcessed = 0;
innerCount = 0;
fileList = new Vector();
* do the actual work of this thread, i.e. iterate through a given directory
* structure and collect audio data
* @return boolean true, if work is left
protected boolean work() {
boolean workIsLeft = true;
if(getStatus() < STATUS_HALT_PENDING) {
countElements(rootDir.listFiles());
if(getStatus() < STATUS_HALT_PENDING) {
workIsLeft = collect(); //collect(rootDir.listFiles());
fileList.clear();
fileList = null;
return workIsLeft;
* count the elements in a given file array including its subdirectories
* @param files File[]
private void countElements(File[] files) {
int i = 0;
while (i < files.length && getStatus() < STATUS_HALT_PENDING) {
File file = files;
if (file.isDirectory()) {
countElements(file.listFiles());
else {
fileList.add(file);
i++;
maxValue++;
* read data into model
* @param files File[] the file array representing the content of a given directory
* @return boolean true, if work is left
private boolean collect(/*File[] files*/) {
Enumeration files = fileList.elements();
while(files.hasMoreElements() && getStatus() < STATUS_HALT_PENDING) {
File file = (File) files.nextElement();
try {
model.addTrack(file);
catch(Exception e) {
fireThreadException(e);
filesProcessed++;
if(++innerCount > 99) {
innerCount = 0;
fireThreadProgress(filesProcessed);
return false;
int i = 0;
while(i < files.length && getStatus() < STATUS_HALT_PENDING) {
File file = files[i];
if(file.isDirectory()) {
collect(file.listFiles());
else if(file.getName().toLowerCase().endsWith("mp3")) {
try {
model.addTrack(file);
catch(Exception e) {
fireThreadException(e);
i++;
filesProcessed++;
fireThreadProgress(filesProcessed);
return (i<files.length);
/** the directory to collect data from */
private File rootDir;
/** the data model to collect data to */
private AudioDataModel model;
/** the number of files this thread processed so far while it is running */
private long filesProcessed = 0;
/** a list to temporary store found files */
private Vector fileList;
/** counter to determine when to fire progress messages */
private int innerCount = 0; -
Need help in understanding why so many gets and I/O
Hi there,
I have a sql file somewhat similar in structure to below:
delete from table emp;-- changed to Truncate table emp;
delete from table dept;--changed to Truncate table dept;
insert into emp values() select a,b,c from temp_emp,temp_dept where temp_emp.id=temp_dept.emp_id
update emp set emp_name=(select emp_name from dept where emp.id=dept.emp_id);
commit --only at the end
the above file takes about 9-10 hrs to complete its operation. and
the values from v$sql for the statement
update emp set emp_name=(select emp_name from dept where emp.id=dept.emp_id);
are as below:
SHARABLE_MEM PERSISTENT_MEM RUNTIME_MEM SORTS LOADED_VERSIONS OPEN_VERSIONS USERS_OPENING FETCHES EXECUTIONS PX_SERVERS_EXECUTIONS END_OF_FETCH_COUNT USERS_EXECUTING LOADS FIRST_LOAD_TIME INVALIDATIONS PARSE_CALLS DISK_READS DIRECT_WRITES BUFFER_GETS APPLICATION_WAIT_TIME CONCURRENCY_WAIT_TIME CLUSTER_WAIT_TIME USER_IO_WAIT_TIME PLSQL_EXEC_TIME JAVA_EXEC_TIME ROWS_PROCESSED COMMAND_TYPE OPTIMIZER_MODE OPTIMIZER_COST OPTIMIZER_ENV OPTIMIZER_ENV_HASH_VALUE PARSING_USER_ID PARSING_SCHEMA_ID PARSING_SCHEMA_NAME KEPT_VERSIONS ADDRESS TYPE_CHK_HEAP HASH_VALUE OLD_HASH_VALUE PLAN_HASH_VALUE CHILD_NUMBER SERVICE SERVICE_HASH MODULE MODULE_HASH ACTION ACTION_HASH SERIALIZABLE_ABORTS OUTLINE_CATEGORY CPU_TIME ELAPSED_TIME OUTLINE_SID CHILD_ADDRESS SQLTYPE REMOTE OBJECT_STATUS LITERAL_HASH_VALUE LAST_LOAD_TIME IS_OBSOLETE CHILD_LATCH SQL_PROFILE PROGRAM_ID PROGRAM_LINE# EXACT_MATCHING_SIGNATURE FORCE_MATCHING_SIGNATURE LAST_ACTIVE_TIME BIND_DATA TYPECHECK_MEM
18965 8760 7880 0 1 0 0 0 2 0 2 0 2 2011-05-10/21:16:44 1 2 163270378 0 164295929 0 509739 0 3215857850 0 0 20142 6 ALL_ROWS 656 E289FB89A4E49800CE001000AEF9E3E2CFFA331056414155519421105555551545555558591555449665851D5511058555155511152552455580588055A1454A8E0950402000002000000000010000100050000002002080007D000000000002C06566001010000080830F400000E032330000000001404A8E09504646262040262320030020003020A000A5A000 4279923421 50 50 APPS 0 00000003CBE5EF50 00 1866523305 816672812 1937724149 0 SYS$USERS 0 01@</my.sql -2038272289 -265190056 0 9468268067 10420092918 00000003E8593000 6 N VALID 0 2011-05-11/10:23:45 N 5 0 0 1.57848E+19 1.57848E+19 5/12/2011 4:39 0
1) how do i re-write this legacy script? and what should be done to improve performance?
2) Should i use PL/sql to re-write it?
3) Also help in understanding why a simple update statement is doing so many buffer gets and reading , Is this Read consistency Trap as i'm not committing anywhere in between or it is actually doing so much of work.
(assume dept table has cols emp_name and emp_id also)update emp set emp_name=(select emp_name from dept where emp.id=dept.emp_id);I guess that these are masked table names ? Nobody would have emp_name in a dept table.
Can you re-format the output, using "code" tags ( [ or { }
Hemant K Chitale
Edited by: Hemant K Chitale on May 12, 2011 12:44 PM -
Duplicate partitions, need help to understand and fix.
So I was looking for a USB that I plugged in and went into /media/usbhd-sdb4/miles and realized all its contents was from my home directory.
So I created a random file in my home directory to see if it would also update /media/usbhd-sdb4/miles , and it did.
Can someone help me understand what is happening?
Also if I can fuse sdb4 and sdb2 as one, and partition it as my home directory without losing its contents?
Below is some information that I think would be helpful.
Thank you.
[miles]> cd /media/usbhd-sdb4/
[usbhd-sdb4]> ls -l
total 20
drwx------ 2 root root 16384 May 28 14:16 lost+found
drwx------ 76 miles users 4096 Oct 15 00:42 miles
[usbhd-sdb4]> cd miles
[miles]> pwd
/media/usbhd-sdb4/miles
[miles]>
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 19.5G 0 part
└─sda2 8:2 0 446.2G 0 part
sdb 8:16 0 465.8G 0 disk
├─sdb1 8:17 0 102M 0 part /media/usbhd-sdb1
├─sdb2 8:18 0 258.9M 0 part [SWAP]
├─sdb3 8:19 0 14.7G 0 part /
└─sdb4 8:20 0 450.8G 0 part /media/usbhd-sdb4
sr0 11:0 1 1024M 0 romCheck your udev rules...
Maybe you are looking for
-
Unable to clear customer due to error: u201CPlease enter valid trading partner:
Hi team i am getting this error in clearing in customer invoice i checked out in customer master trading partner no is there :***** and that customer is also a Vendor but in vendor master record that trading partner no is not there but customer numbe
-
Using exec() to set Environment Vars in OSX
Hi everybody I have some problems using the exec() command. Want I want to do is to start the tomcat Server out of my programm. Due to this reason I need to set two environment Variables and execute a shell script. Standardshell in OS X is Tcsh. So I
-
What package is sgen in?
Hi folks, I'm trying to find out what package the generic scsi driver (sgen) is in for Solaris 8 on Intel. Any help or pointers would be greatly appreicated. Regards, Rajesh
-
How to avoid printing zero in amount field in adobe forms
Hi All, If the amount is empty in the amount field then it is printing 0,00. I have written some peice of code to avoid printing that value. I wanted to print space. Below is the logic which i have tried in javascript. if ( this.WRSHB.rawValue ==
-
Does anybody know if it is possible to transport a web template for example from a test system into a production system? Or do I have to do it manually? With "export to file"? Thanks in advance