Help on using hashtables with sub structures inside

Hi everyone,
I'm currently working on a script that scans Active Directory for computers, and lists current users logged, and logs to an hashtable the username as key, and a count as a value.
After that it sends an email with the list. This part is all developed and working. Now I want to go further, and in the hash table, I would like to have as the key the username, and as the value the counter and a list of the computer names where the user
is logged on.
I have this code for working with the hashtable:
ForEach ($c in $computer) {
#Get explorer.exe processes
$proc = gwmi win32_process -computer $c -Filter "Name = 'explorer.exe'"
#Go through collection of processes
ForEach ($p in $proc) {
$temp = "" | Select Computer, Domain, User
$temp.computer = $c
$temp.user = ($p.GetOwner()).User
$temp.domain = ($p.GetOwner()).Domain
$report += $temp
If($UsersList.ContainsKey($temp.user) -eq 1){
$UsersList[$temp.user] = $UsersList[$temp.user] + 1
#$UsersList
Else {
$UsersList.add($temp.user,1)
Can I have it the way I'd like, or have to change my approach?
Thanks in advance
Nuno Silva

Thanks for the help. One more question regarding printing the arraylist.
I use the code below to print everything. I can print successfully the key and value but get an error on the computerlist.
($UsersList.GetEnumerator() |
Sort-Object Value -descending |
% { "{0}, {1} - {3}" -f $_.key, $_.value.Count, $_.value.ComputerList })
Error formatting a string: Index (zero based) must be greater than or equal to zero and less than the size of the argument list..
+     % { "{0}, {1} - {3}" -f $_.key, $_.value.Count, $_.value.ComputerList[0] })
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ({0}, {1} - {3}:String) [], RuntimeException
    + FullyQualifiedErrorId : FormatError
Error formatting a string: Index (zero based) must be greater than or equal to zero and less than the size of the argument list..
How can I print it out?
Thanks in advance,
Nuno Silva

Similar Messages

  • APD using Query with multiple structures as a data source

    All,
    I want to set up an automatic process which executes a query and exports it to a shared drive as a csv file. I have tried various options , when I try to use APD to set up the extract, I get an error and this is because the query that I am trying to use has Strucutres in both rows and columns. Hence, I am unable to use this option. I tried RSCRM_BAPI, It works well, but there is an issue with scheduling this in Process chain. I created an event and scheduled this as a job to trigger after "event" as per SAP instructions, but the job does not exist and it is not possible to trigger it through the Process chain unless the variables are hard coded in the query which I do not want to do.
    Can any one tell me if there is a way to deal with APD using Query with multiple structures?
    Would really appreciate if some one can give me the right solution...
    Thanks

    Hi Tanu ,
    APD is an option but its not very good with large amount of data or hiearachies or if you have attributes in you query structure .
    One more option for this requirement is use of report program using function module RRW3_GET_QUERY_VIEW_DATA .
    This will work fine with multiple structure etc .
    There are some overheads with this FM  ex: if amount of data is too much then program will give dump .Solution for that is we call the FM in LOOP by diving amount of data need to be fetched .ex:  we can read data quarter wise.
    For using this function module what you can do is write an ABAP program (At SE38 ) .which will call this FM and then write the output into a flat file which you can save at application server (AL11) .From there other system can read it .
    To automate this whole process you can further add all the report programs into a process chain (RSPC) which can be schedule as per requirement .
    To pass input parameters you can use variants that will pass the values to the report .
    Check thi link for sample code :
    [http://www.tricktresor.de/content/index.php?navID=696&aID=496]
    Hope this will be helpful .
    Regards,
    Jaya Tiwari

  • Help on using NewObject with constructors!

    Hi,All:
    I want to create an object in a native method. The object is an instance of an inner class. The inner class has two constructors: one default and one with two arguments. There is no problem if I use NewObject with the default construtor. But if I use NewObject with the constructor taking two int arguments. The JVM crashes.
    Can anybody give me some idea what the problem is?
    Thanks!
    Tao
    Here is the native method, the inner class and error message:
    JNIEXPORT jobject JNICALL Java_Prompt_createtp(JNIEnv *env, jobject obj)
         jobject test_ttt= 0;
         jclass cls2;
         jmethodID cid;     
         jint a,b;
         jfieldID fid;
         a = 10; b = 20;
         cls2 = (*env)->FindClass(env,"LPrompt$tp;");          
         cid = (*env)->GetMethodID(env,cls2,"<init>","(LPrompt;II)V");     
    test_ttt = (*env)->NewObject(env,cls2,cid,a,b);
    // However, the following codes using default constructor works well
    //cid = (*env)->GetMethodID(env,cls2,"<init>","(LPrompt;)V");     
    //test_ttt = (*env)->NewObject(env,cls2,cid);
    (*env)->DeleteLocalRef(env,cls2);
         return test_ttt;
    // here is the inner class     
    class tp{
    int a;
    int b;
    tp(){
    a = 100;
    b = 0;
    tp(int x,int y){
    a = x; b = y;
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # Internal Error (53484152454432554E54494D450E43505001A3), pid=276, tid=640
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode)
    # An error report file with more information is saved as hs_err_pid276.log
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    #

    You are getting the constructor id on a signature that looks like:
    Prompt(Prompt p, int n1, int n2)I guess that your constructor signature is:
    Prompt(int n1, int n2)So it should ne:
    cid = (*env)->GetMethodID(env,cls2,"<init>","(II)V");Next time please paste your code between code tags exactly like this:
    &#91;code&#93;
    your code
    &#91;/code&#93;
    You may read the [url http://forum.java.sun.com/help.jspa?sec=formatting]Formatting tips for more information.
    Regards

  • Problem in Sender File Adapter using FCC with Variable structure

    Hi Experts,
    Hi Experts,
    I have facing an issues while using FCC in Sender File adapter. Below are the configs for the same:-
    Recordset structure required is ==HEADER,1,DATA,*,TRAILER,1
    Recordset per message == *
    Key Field Name == Key
    (Sorry i dont know how to insert screen shot here..pls tell me how can i insert screen shots here on sdn)
    HEADER.fieldSeparator           ,
    HEADER.endSeparator           u2018nlu2019
    HEADER.fieldNames               Key,x,y,zu2026
    HEADER.keyFieldValue          1
    HEADER.keyFieldInStructure      ignore
    HEADER.fieldContentFormatting     trim
    HEADER.additionalLastFields     ignore
    HEADER.missingLastFields     ignore
    DATA.fieldSeparator
    DATA.endSeparator
    DATA.fieldNames
    DATA.keyFieldValue
    DATA.keyFieldInStructure
    DATA.fieldContentFormatting
    DATA.additionalLastFields
    DATA.missingLastFields
    Using same variables for Trailer record as well.
    Source CSV file which i am picking:-
    ADSE ,RASD,replan  Contact ,2  0080509 0 8:43:25   ,        
    EMPL ,0011111,  S Top Up ,20080401  ,20080430  ,sdf  ,                          00000000431250  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:07:35,
    EMPL ,0222222,  r Cash Award ,20070701  ,20070703  ,ded  ,                          00000000023509  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:09:31,
    EMPL ,0233333,   Cash Award ,20070801  ,20070831  ,df  ,                          00000000044057  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:10:56,
    EMPL ,0244444,   Cash Award ,20080101  ,20080111  ,sf  ,                          00000000026717  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:08:29,
    BTRL ,   5140, 
    When i tested the scenario and monitored it using MDT in CC monitoring tool its giving me below mentioned error.
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    XML document must have a top level element. Error processing resource 'http://myurlname/mdt/me...
    However if i change the occurence of DATA as some specific value for eg 4 instead of * it works fine.
    Kindly help me in solving this problem.
    Thanks,
    Aditya Verma

    Hi Madan,
    Thanks a lot for giving me the way to this. But when i tested this with the below file its giving me the same error. Please let me know if i need to do any changes to the parameters mentioned above:-
    ADSE ,ASDA,Sha  replan Fr ont Feed Contact ,2  0080509 0 8:43:25   ,        
    EMPL ,0011111,   Cash Top Up ,20080401  ,20080430  ,TPV  ,                          00000000431250  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:07:35,
    EMPL ,0222222,   r Cash Award ,20070701  ,20070703  ,TPV  ,                          00000000023509  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:09:31,
    EMPL ,0233333,  r Cash Award ,20070801  ,20070831  ,TPV  ,                          00000000044057  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:10:56,
    EMPL ,0244444,   Cash Award ,20080101  ,20080111  ,TPV  ,                          00000000026717  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:08:29,
    EMPL ,0255555,   Cash Award ,20080301  ,20080320  ,TPV  ,                          00000000027870  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:08:25,
    EMPL ,0266666,   Cash Award ,20071001  ,20071020  ,TPV  ,                          00000000020681  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:09:31,
    EMPL ,0877777,   Cash Top Up ,20080401  ,20080430  ,TPV  ,                          00000000036000  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:07:05,
    EMPL ,0888888,   Leaver Cash Award ,20071201  ,20071231  ,TPV  ,                          00000000157200  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:11:29,
    EMPL ,0899999,  S Leaver Cash Award ,20080301  ,20080331  ,TPV  ,                          00000000153530  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:07:42,
    EMPL ,0800000,  S Leaver Cash Award ,20070701  ,20070731  ,TPV  ,                          00000000012234  ,2007                                    ,  ,  ,  ,  ,  ,20080414  18:08:34,
    BTRL ,   5140,
    This the original csv file which i'll get in live. Kindly suggest as ur solution worked with other file but not working with this scv file.
    Thanks a lot,
    Aditya.

  • Using datasource with streaming api inside a web service

    I am using the 9.1 server and accessing a datasource
    created with aldsp3.0. When I run the code below as a
    standalone java app, everything works fine. When I run it
    on the server, I get a class cast exception when trying to cast an object returned from the stream to MyData type.
    When running the java app in the debugger, the objects
    dataServiceDoc, dog , and dObj all have
    the correct type. When running the web service in the debugger, the objects are all of type
    DataObjectGeneral, thus causing the cast error.
    <p><p>
    Any help will be greatly appreciated!
    <p>
    Thanks.
    <p><p>
    package services;
    <p>
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import weblogic.jndi.Environment;
    import com.bea.dsp.RequestConfig;
    import com.bea.dsp.das.DASResult;
    import com.bea.dsp.das.DataAccessServiceFactory;
    import com.bea.dsp.das.PreparedExpression;
    import com.bea.sdo.impl.data.DataObjectGeneral;
    import commonj.sdo.DataObject;
    <p>
    @WebService
    <p>
    public class MyService
    <p>
    private final static String DS_URL = "t3://localhost:7001";
    <p>
    @WebMethod
    <p>
    public String testMethod2()
    <p>
    StringBuilder result = new StringBuilder();
    <p>
    try
    <p>
    // Get the initial context to the WebLogic Server passing in user credentials
    <p>
    Context ctx = getInitialContext(DS_URL,"weblogic", "weblogic");
    <p>
    RequestConfig reqConfig = new RequestConfig();
    <p>
    reqConfig.enableFeature(RequestConfig.RETURN_DATA_SERVICE_AUDIT);
    <p>
    reqConfig.enableFeature(RequestConfig.RETURN_AUDIT_PROPERTIES);
    <p>
    reqConfig.setStringArrayAttribute(RequestConfig.RETURN_AUDIT_PROPERTIES,
    new String[] { "common", "query" });;
    <p>
    String dspDataSpace = "MY_DS";
    <p>
    String adhoc = createQuery();
    <p>
    PreparedExpression pe = DataAccessServiceFactory.prepareExpression(ctx, dspDataSpace, adhoc);
    <p>
    DASResult<Object> dasResult = pe.executeQuery(reqConfig);
    <p>
    int i = 0;
    <p>
    int N = 100;
    <p>
    Long[] ids = new Long[N];
    <p>
    while (dasResult.hasNext() && i<N)
    <p>
    Object dataServiceDoc = dasResult.next();
    <p>
    // Convert Object to a Data Object
    <p>
    DataObjectGeneral dog = (DataObjectGeneral) dataServiceDoc;
    <p>
    DataObject dObj = dog.getRootObject();
    <p>
    // Cast the Data Object to the SDO Type (MyDataType)
    <p>
    MyDataType p = (MyDataType) dObj;
    <p>
    i++;
    <p>
    <p>
    catch (Exception e)
    <p>
    result.append(e);
    <p>
    <p>
    return result.toString();
    <p>
    <p>
    private static InitialContext getInitialContext(String url, String username, String password) throws NamingException
    <p>
    Environment env = new Environment();
    <p>
    env.setProviderUrl(url);
    <p>
    env.setInitialContextFactory("weblogic.jndi.WLInitialContextFactory");
    <p>
    env.setSecurityPrincipal(username);
    <p>
    env.setSecurityCredentials(password);
    <p>
    return new InitialContext(env.getInitialContext().getEnvironment());
    <p>
    <p>
    public static void main(String [] args)
    <p>
    MyService ms = new MyService();
    <p>
    System.out.println(ms.testMethod2());
    <p>
    <p>
    <p>

    test

  • Use @TODATE with Subs Variable?

    I'm have a series of calculations which depend on the elapsed time between now (stored in a substitution variable as &Todaysdate), and a date which is in an Attribute.While I can get the formulae to work using typed-in dates, when I swap the date for the variable, it gives an error:VAR TheDateDummymember( TheDate = @TODATE("dd-mm-yyyy", "23-08-2002"); )works fine, butVAR TheDateDummymember( TheDate = @TODATE("dd-mm-yyyy", &Todaysdate); )with &Todaysdate defined as either 23--8-2002 or "23-08-2002" gives a syntax error (error in TODATE command).If I split it in two:Temp = &Todaysdate;TheDate = @TODATE("dd-mm-yyyy", Temp); then I get no errorAm I missing something?

    It could be that the @TODATE function wants a member reference - I know that it should work, but the workaround that you posted suggests to me that the function is not resolving the sub variable properly.Try using the @MEMBER function around the sub variable - I haven't tested it myself but it might work...Regards,Jade-------------------------------Jade ColeSenior Business Intelligence ConsultantClarity [email protected]

  • Need help on using Tuxedo with Oracle 8

    Hi friends,
    I wrote a simple tuxedo server with embedded sql that has only the task to insert
    a string passed by the client into a table in oracle DB.
    The Server is logged on to the database correctly during tmboot. When I start the
    client the service function will be invoked and it returns TPSUCCESS. But somehow
    my sql statements are ignored. No record is added to the table and I got no sql errors.
    Here is my service function (AUTOTRAN=Y):
    void INSERT(TPSVCINFO *msg){
    EXEC SQL insert into ABC values ('some data');
    EXEC SQL COMMIT WORK;
    if (SQLCODE != SQL_OK){
    tpreturn(TPFAIL, 0, msg->data, 0L, 0);
    tpreturn(TPSUCCESS, 0, msg->data, 0L, 0);
    Thanks in advance.
    Kevin

    Thanks for your help.
    Kevin
    "Manoj SASIDHARAN" <[email protected]> wrote:
    >
    Hi Kevin,
    Oracle Docs has the following to say abt SQL Error -36:
    ORA-00036 maximum number of recursive SQL levels (string)
    exceeded
    Cause: An attempt was made to go more than the specified
    number
    of recursive SQL levels.
    Action: Remove the recursive SQL, possibly a recursive
    trigger.
    Pl check if u have some triggers on the table... and also
    determine
    the level of their nesting... That shld probably solve
    ur probs.
    Good Luck
    MS
    "Kevin" <[email protected]> wrote:
    Hi, thanks for your answer.
    But I am not sure of the error message...is the error
    code what
    I got an ORA error code or something else (e.g. why -36
    and not
    36)?
    Please have a look to my source code.
    Hope you can give me more information.
    Thanks in advance
    Kevin
    #include <stdio.h> /*operation system*/
    #include <Uunix.h> /*Tuxedo*/
    #include <errno.h> /*operation system*/
    #include <atmi.h> /*TPSVCINFO, TPFAIL, TPSUCCESS,
    etc.*/
    #include <sqlcode.h> /*SQL related*/
    #include <sqlca.h>
    void
    #if defined(__STDC__) || defined(__cplusplus)
    MSK2MANTA(TPSVCINFO *msg)
    #else
    MSK2MANTA(msg)
    TPSVCINFO *msg;
    #endif
    printf("MSK2MANTA Service started\n");
    if(msg->data == NULL){
    printf("received message is NULL!\n");
    tpreturn(TPFAIL, 0, msg->data, 0L, 0);
    printf("Transaction-Status = %d\n", tpgetlev());
    EXEC SQL insert into BUF values ('sysdate', 'msk2manta
    data');
    if ((sqlca.sqlcode != 0) || (SQLCODE != SQL_OK)){
    printf("Failed to insert! SQLCODE1 = %d\n", SQLCODE);
    printf("Failed to insert! sqlca.sqlcode = %d\n",sqlca.sqlcode);
    printf("Failed to insert! sqlca.sqlerrm.sqlerrmc=
    %s\n", sqlca.sqlerrm.sqlerrmc);
    tpreturn(TPFAIL, 0, msg->data, 0L, 0);
    EXEC SQL COMMIT WORK;
    if (SQLCODE != SQL_OK){
    printf("Failed to commit! SQLCODE2 = %d\n", SQLCODE);
    tpreturn(TPFAIL, 0, msg->data, 0L, 0);
    tpreturn(TPSUCCESS, 0, msg->data, 0L, 0);
    Output: tpgetlev()=1, SQLCODE=-36, sqlca.sqlcode=0, sqlerrmc=""
    Scott Holland <[email protected]> wrote:
    Also... print out the remainder of the sqlca structure.
    You will have
    error text in that structure describing what the actual
    error is.
    sdh
    Kevin wrote:
    Hi Manoj,
    thanks for your answer.
    I added an extra SQLCODE check after the insert andget following
    error:
    "SQLCODE = -36"
    Do you know how to find out what the error is stangfor?
    Thanks
    Kevin
    "Manoj SASIDHARAN" <[email protected]>
    wrote:
    Hi Kevin,
    Could u pl put an extra SQLCODE (or sqlca.sqlcode)check
    after the INSERT statement
    as shown in the modified code and try...
    Currently the check verifies the sqlcode of the COMMIT
    statement and not the INSERT
    statement executed just before.
    HTH
    Regards
    /MS
    "Kevin" <[email protected]> wrote:
    Hi friends,
    I wrote a simple tuxedo server with embedded sql
    that
    has only the task
    to insert
    a string passed by the client into a table in oracleDB.
    The Server is logged on to the database correctly
    during
    tmboot. When I
    start the
    client the service function will be invoked and
    it
    returns
    TPSUCCESS. But
    somehow
    my sql statements are ignored. No record is added
    to
    the table and I got
    no sql errors.
    Here is my service function (AUTOTRAN=Y):
    void INSERT(TPSVCINFO *msg){
    EXEC SQL insert into ABC values ('some data');
    //// MS CHANGES - START
    printf("SQLCODE = %ld", sqlca.sqlcode);
    if (sqlca.sqlcode != 0) {
    ////// Handle the case
    //// MS CHANGES - STOP
    EXEC SQL COMMIT WORK;
    if (SQLCODE != SQL_OK){
    tpreturn(TPFAIL, 0, msg->data, 0L, 0);
    tpreturn(TPSUCCESS, 0, msg->data, 0L, 0);
    Thanks in advance.
    Kevin

  • Need help in using hashtable as a property of a form bean

    Hi,
    Is it possible to use a hashtable as a property of the bean.
    Well this is the problem i have
    I am using a hashtable as property and i want it to store from(/retrive into} form as ints/strings
    I have a
    JSP Page
    SampleAction --Action
    SampleForm --ActionForm
    Sample(bean)
    =============
    JSP Page
    (within the html:form tag)
    <html:text property="sample.number" />
    ====================
    struts-config links to
    SampleAction
    SampleForm
    ==============
    SampleForm
    Sample sample = new Sample();
    reset(){ ...impl...}
    validate(){.... impl.....}
    =================
    Sample.java
    private Hashtable prop = new Hashtable();
    public int getNumber()
       return ((Integer)prop.get("number")).intValue();
    public void setNumber(int number)
       prop.put("number",new Integer(number));
    ====================================
    this setup understandbly gives me a error like this
    no getter method for property sample.number
    PLEASE DO remember that i have a large number of mixed types in my form that needs to be populated into the bean and i detest using that many variables(in the bean)
    I NEED TO A KNOW A SOLN. PLEASE
    Thanx in advance
    cheers
    Ash

    Hi,
    I think the solution for your problem is
    put a form tag in your jsp page.
    name it as your form name defined in the struts-config.xml.
    in your case
    it is 'sample'.
    And make changes in the html:text tag like,
    <html:text name="sample" property="number" />
    Hope it will work.. have fun !!!

  • Looking for examples/help on using Ethernet with Keithley 2701 DMM

    All of the example code utilizing their IVI driver is based on GPIB or RS232. I specifically bought the 2701 to utilize the Ethernet port, but cannot find CVI examples on how to do this. Can anyone point me to an ethernet example using their driver and the Ethernet port? Or perhaps post a non-Keithley ehternet driver and examples on its use?

    Hi Paul,
    What you have been told is exactly what you need to do.
    Here is a document in NI web that explains about it:
    How Can I Communicate With a Keithley 2701 DMM?
    There is also an Instrument driver that NI built for these DMM:
    LabVIEW Certified Plug and Play Instrument Driver
    To find this documents you need to go to NI.com and at the top on the search box enter 2701. That will give you all the documents related to this.
    Thank you
    Ricar
    do S.
    National Instruments.

  • Help Please ... with calling functions inside listener events

    I need the window to update itself before another method inside my listener is called. When I make the call to updateUI() it preforms it's function once my listener event is compelete while I would like to to happend.
    paw.updateHasMoved();
    temp.updateUI();// -->Want the update to occure before the next line is called
    piece.CB.board = ComputersMove(piece.CB.board);

    okidoi Mr Helpy!
    let me try with this
    just one more question, the button should be created at
    runtime or inside my
    movieclip?
    Regards
    Rick
    "Mr Helpy mcHelpson" <[email protected]>
    escribió en el mensaje
    news:f46tjk$lg1$[email protected]..
    > flooring.onLoad = function(success) {
    > if (flooring.firstChild.hasChildNodes()) {
    >
    > you can just do
    >
    > flooring.onLoad = function(success) {
    > if (success) {
    >
    > you'll need to create a button on top of your image.
    This for me is most
    > easily done with a predefined custom class, and on the
    instantiation of
    > your
    > image(movieclip) you can define the button actions
    contained in the movie
    > clip.
    >
    > make sense?
    >
    > HmcH
    >

  • Can you help me use PSE9 with CS5 as an external editor?

    Hello,
    I much prefer the Elements Organizer to Bridge, and have a large catalog with tags that I don't want to give up.  95% of the time, I am perfectly happy with the PSE9 editor.  However, for the other 5% of the time, CS5 is the ticket (even if only for the better Camera RAW processing).  However, I can't seem to save the resulting edited photo in a version set with the original, and for that matter, it seems to get lost somewhere in the ether but PSE9 continues to believe that the file is being edited.
    Any help would be appreciated.
    Thanks in advance,
    Claude

    In the Organizer go to Edit >>Preferences >>Editing
    Under supplementary editing browse to the CS5 editing application and select it, then click OK.
    To edit an image select it in Organizer and click Edit >>With CS5.
    A new image will be launched automatically and when saved in CS5 will be found next to the original in a version set in the Organizer.
     

  • HELP, HELP, HELP, Problems using GridBagLayout with BorderLayout

    I have a BorderLayout for my application. I created a JPanel that has the following items added to it:
    1)Button
    2)VisualComponent
    3)ControllerComponent
    The JPanel is then added to the WEST Pane of the BorderLayout. My problem is that I can not get my components in the JPanel to display correctly. The items should be added from top to buttom in my JPanel, but they overlap and display side by side, and some don't appear at all until my entire window application is Maximized. It seems as if all my components are trying to display in one row even though I explicitly add them to different rows as follows:
    1)addUsingGBL(openFile,0,1,2,1);
    2)addUsingGBL(visualComponent,1,1,1,3);
    3)addUsingGBL(controlsComponent,4,1,2,1);
    where addUsingGBL is as follows:
    void addUsingGBL(Component component,int row, int column, int width, int height)
    gbc. gridx = row;
    gbc.gridy = column;
    gbc.gridwidth = width;
    gbc.gridheight = height;
    gbLayout.setConstraints(component, gbc);
    mediaPanel.add(component);
    mediaPanel.doLayout();
    If anyone has any suggestions, I would greatly appreciate it. Entire code is available if needed. Thanks!

    void addUsingGBL(Component component,int row, int column, int width, int height)
    gbc. gridx = row;
    gbc.gridy = column;
    gbc.gridwidth = width;
    gbc.gridheight = height;
    gbLayout.setConstraints(component, gbc);
    mediaPanel.add(component);
    mediaPanel.doLayout();
    }I see that the problem is that you are using the same gridbagconstraints reference to add all your components. In effect, all your components refer to the same gridbagconstraints , you are getting all the components on a single row. The solution to this is simple - Try this out and tell me whether that works...
    void addUsingGBL(Component component,int row, int column, int width, int height)
    //Add this line in the beginning...
    gbc = new GridBagConstraints();
    gbc. gridx = row;
    gbc.gridy = column;
    gbc.gridwidth = width;
    gbc.gridheight = height;
    gbLayout.setConstraints(component, gbc);
    mediaPanel.add(component);
    mediaPanel.doLayout();

  • HELP, HELP, HELP, Problems using GridBagLayout with a BorderLayout

    I have a BorderLayout for my application. I created a JPanel that has the following items added to it:
    1)Button
    2)VisualComponent
    3)ControllerComponent
    The JPanel is then added to the WEST Pane of the BorderLayout. My problem is that I can not get my components in the JPanel to display correctly. The items should be added from top to buttom in my JPanel, but they overlap and display side by side, and some don't appear at all until my entire window application is Maximized. It seems as if all my components are trying to display in one row even though I explicitly add them to different rows as follows:
    1)addUsingGBL(openFile,0,1,2,1);
    2)addUsingGBL(visualComponent,1,1,1,3);
    3)addUsingGBL(controlsComponent,4,1,2,1);
    where addUsingGBL is as follows:
    void addUsingGBL(Component component,int row, int column, int width, int height)
    gbc. gridx = row;
         gbc.gridy = column;
         gbc.gridwidth = width;
         gbc.gridheight = height;
         gbLayout.setConstraints(component, gbc);
         mediaPanel.add(component);
         mediaPanel.doLayout();
    If anyone has any suggestions, I would greatly appreciate it. Entire code is available if needed. Thanks!

    Here is the code, sorry, didn't see that part before.
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.media.*;
    public class MediaPlayerDemo extends JFrame /*implements ControllerListener*/{
    private Player player;
    private File file;
    public static JPanel mediaPanel;
    public static JScrollPane scrollableMediaPanel;
    //public static JFrame navigation = new JFrame("Lessons");
    public static Component visualComponent;
    public static Component controlsComponent;
    private static ImageIcon background = new ImageIcon("c:/Tony.jpg");
    public static GridBagConstraints gbc;
    public static GridBagLayout gbLayout;
    //public static panel column;
    //public static Container c;
    // inner class to handler events from media player
    private class EventHandler implements ControllerListener
         public void controllerUpdate( ControllerEvent e )
              if ( e instanceof EndOfMediaEvent)
              //if ( player == null )
              //return;
              player.close();
              //if ( visualComponent != null )
              mediaPanel.remove( visualComponent );
              //if ( controlsComponent != null )
              mediaPanel.remove( controlsComponent );
              mediaPanel.doLayout();
              // doLayout();
              if ( e instanceof RealizeCompleteEvent )
                   //c = getContentPane();
                   // load Visual and Control components if they exist
                   visualComponent =
                   player.getVisualComponent();
                   //visualComponent.setSize(5,5);
                   mediaPanel.doLayout();
                   //**Sets the layout for mediaPanel as GridLayout**
                   //**GridLayouts set the rows and col, **
                   //**& adds contentslt to rt **
                   //scrollableMediaPanel= new JScrollPane(mediaPanel);
                   //scrollableMediaPanel= new JScrollPane(mediaPanel);
                   gbc.weightx = 0;
                   gbc.weighty = 0;
                   gbc.fill = GridBagConstraints.NONE;
                   if ( visualComponent != null )
                   //add comp #2
                   addUsingGBL(visualComponent,1,1,1,3);
                   controlsComponent =
                   player.getControlPanelComponent();
                   if ( controlsComponent != null )
                   //add comp #3
                   //mediaPanel.add(controlsComponent);
                   addUsingGBL(controlsComponent,1,1,1,3);
                   controlsComponent =
                   player.getControlPanelComponent();
                   /*if ( controlsComponent != null )
                   //add comp #3
                   addUsingGBL(controlsComponent,4,1,2,1);
              doLayout();//after all components are added, you must redo your layout
              //**The following is for adding the a container only **
              //**getContentPane().add(mediaPanel,BorderLayout.WEST);**
              //**getContenPane().doLayout(); **
              //**setSize(200,700);//(width, Height) **
              //**show(); **
              }//if
         }//controllerUpdate
    }//eventHandler
    public MediaPlayerDemo()
         //**Title for a container **
         //**super( "Demonstrating the Java Media Player" );**
         mediaPanel = new panelBack(background);//instantiate JPanel Object
         gbLayout = new GridBagLayout();
         mediaPanel.setAlignmentY(TOP_ALIGNMENT);
         mediaPanel.setLayout(gbLayout);
                   gbc = new GridBagConstraints();
                   gbc.fill = GridBagConstraints.NONE;
                   //gbc.anchor = GridBagConstraints.NONE;
         //instatiate JButton object
         JButton openFile = new JButton( "Open file to play" );
         //openFile.setBounds(0, 0, 25, 25);
         //openFile.setVisible(true);
         //JBUTTON ActionListener
         openFile.addActionListener
              new ActionListener()
                   public void actionPerformed( ActionEvent e )
                   openFile();
                   createPlayer();
         );//addActionListener
         //add comp #1
         addUsingGBL(openFile,0,1,2,1);
         //set scrollPane
         scrollableMediaPanel = new JScrollPane(mediaPanel,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                   JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS );
         //Set Border
         scrollableMediaPanel.setViewportBorder(new BevelBorder(BevelBorder.RAISED));
    }//Constructor
    private void createPlayer()
         if ( file == null )
              return;
         removePreviousPlayer();
         try
              // create a new player and add listener
              player = Manager.createPlayer( file.toURL() );
              player.addControllerListener( new EventHandler() );
              player.start(); // start player
         catch ( Exception e )
              JOptionPane.showMessageDialog( this,
                   "Invalid file or location", "Error loading file",
                   JOptionPane.ERROR_MESSAGE );
    //Main only useful if creating a container to hold menuPanel
    public static void main(String args[])
         MediaPlayerDemo app = new MediaPlayerDemo();
         app.getContentPane().setLayout(new BorderLayout(0,0));
              app.getContentPane().setBackground(Color.white);
              app.getContentPane().add(scrollableMediaPanel, BorderLayout.WEST);
         app.getContentPane().validate();//re-layout a container for which the layout has changed
         app.setSize(1000,700);//(width, height)
         app.show();
         app.addWindowListener
              new WindowAdapter()
                   public void windowClosing( WindowEvent e )
                   System.exit(0);
    private void openFile()
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(
              JFileChooser.FILES_ONLY );
         int result = fileChooser.showOpenDialog( this );
         // user clicked Cancel button on dialog
         if ( result == JFileChooser.CANCEL_OPTION )
              file = null;
         else
              file = fileChooser.getSelectedFile();
    private void removePreviousPlayer()
         if ( player == null )
              return;
         player.close();
         if ( visualComponent != null )
              mediaPanel.remove( visualComponent );
         if ( controlsComponent != null )
              mediaPanel.remove( controlsComponent );
         //set background for the JPanel
         public class panelBack extends JPanel
              ImageIcon image;
              panelBack(ImageIcon image)
                   super();
                   this.image=image;
              public void paintComponent(Graphics g)
                   image.paintIcon(this,g,0, 0);
         }//panelback
    void addUsingGBL(Component component,int row, int column, int width, int height)
    gbc = new GridBagConstraints();
         gbc. gridx = row;
         gbc.gridy = column;
         gbc.gridwidth = width;
         gbc.gridheight = height;
         gbLayout.setConstraints(component, gbc);
         mediaPanel.add(component);
         mediaPanel.doLayout();
    }//MediaPlayerDemo

  • Help needed - using AG241 with WRT54GS

    Hey,recently i had successfully been using this set up.The wireless worked perfectly without any problems.However,setting it up to work was not so easy.
    And now my wireless routers setting were restored to default and I am unable to get the two working together.Can you guys give me some advice please?
    ie Should the WRT54GS be operating in router mode or gateway mode and should both have DHCP turned on?
    thanks for your time.
    -Ian

    and I forgot to mention I'd like to be able to send and recieve audio and midi between the 3 daws like using one to sequence another and say be able to export midi/audio to ableton and start it playing.
    I also dj so I would ultimately prefer to be creating and compiling drum and synth loops and easily pass them to ableton whether in the studio or at a gig.

  • Help using -replace with wildcard characters, specifically braces

    Hello all,
    Needing help in using -replace with literal wildcard characters, specifically the braces characters. From reading old posts online this seems to have been a notorious shortcoming of PowerShell, but not sure if it's been resolved or not. My simple
    code tries to remove the braces as follows (would like to keep the foreach loop and everything as is if possible):
    $string = "test[]"
    $braces = @("``[","``]")
    Foreach($brace in $braces){
    If($string -like "*$brace*"){
    $string = $string -replace ($brace,"")
    write-host $string
    This code gives an error at the -replace line, saying "The regular expression pattern `] is not valid." I'm not sure how to pass the literal brace characters to the -replace parameter? Can this be done?

    -like is a wildcard operator (it recognized wildcard patterns like * ,? and [a-z].
    For a regular expression you use the -match operator.  
    Wildcard patterns and regular expressions are not interchangeable.
    See:
    get-help about_wildcards
    get-help about_regular_expressions
    for an explanation and examples of each one, and 
    get-help about_comparison_operators
    for examples of using -like and -match.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

Maybe you are looking for

  • Family Sharing when having different accounts for purchasing and iCloud

    I have two Apple ID accounts. One that I use for making iTunes purchases (which I had way before @me.com or @icloud.com existed) and the new @icloud.com account that I use for everything iCloud related (Messages, backups, etc). Now that Family Sharin

  • Fact vs. Dimension table mappings

    What is the difference between how Dimensions and Facts behave in the Mapping Editor? I have no problems loading my data into a Dimension, but with the fact table the mapping gets really complex (I have about 5 dimensions and the fact table only cont

  • Foreign Keys for a Logical Table

    Hi All, I want to know in which scenarios we create the Foreign Keys for a Logical Table. Once we create the foreign key for the logical table, does it mean that it will automatically override if any joins are there. Physical Table A, B ( no physical

  • Disk Location of Presets in Lightroom 3

    Where are the preset files (Metadata, Develop, etc.) files located on the hard disk under Windows?  I would like to sinc my main compuer settings with my laptop. Thank you. Steve

  • Automatic payments

    Where can I go to stop my auto pay. I have begun paying with a different methos but need to be sure I shut the other one off. I don't see it anywhere. Thanks.