WMI powershell - Get-Counter vs Specific Performance Classes

Hi,
As i see there are more than one way to get the Performance information in windows using Powershell.
I could use the Get-Counter cmdlet to fetch information about Processor,Disk or Memory.
While there are also specific WMI classes for Performance like Win32_Perf,Win32_PerfRawData,Win32_PerfFormattedData.
How does one decide which is the right way or which provides a more accurate value.
Thanks for helping me understand.

It all depends on wwhat youo are tring to do.
Get-Counter and WMI do the samme thing.  Raw couters are not often useful.
Start here:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa373083(v=vs.85).aspx
¯\_(ツ)_/¯

Similar Messages

  • Get-Counter : The \\ServerNameHere\\SQLSERVER:Locks(_Total)\Lock Waits/sec performance counter path is not valid.

    I have the following code:
    Import-Module "sqlps" -DisableNameChecking
    #####http://www.travisgan.com/2013/03/powershell-and-performance-monitor.html
    function ExtractPerfmonData 
        param(
            [string]$server,
            [string]$instance
        [Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet]$collections
        $monitorServer = "MonitoringServerNameHere"
        $monitorDB = "MonitoringDatabaseNameHere"
        $counters = @(
            "\$($instance):Memory Manager\Memory Grants Pending",
            "\$($instance):Memory Manager\Target Server Memory (KB)",
            "\$($instance):Memory Manager\Total Server Memory (KB)",
            "\$($instance):Buffer Manager\Buffer Cache Hit Ratio",
            "\$($instance):Buffer Manager\Checkpoint pages/sec",
            "\$($instance):Buffer Manager\Page Life Expectancy",
            "\$($instance):General Statistics\User Connections",
            "\$($instance):General Statistics\Processes Blocked",
            "\$($instance):Access Methods\Page Splits/sec",
            "\$($instance):SQL Statistics\Batch Requests/sec",
            "\$($instance):SQL Statistics\SQL Compilations/sec",
            "\$($instance):SQL Statistics\SQL Re-Compilations/sec",
            "\$($instance):Locks(_Total)\Lock Waits/sec"
        $collections = Get-Counter -ComputerName $server -Counter $counters -SampleInterval 1 -MaxSamples 1
        $sampling = $collections.CounterSamples | Select-Object -Property TimeStamp, Path, Cookedvalue
        $xmlString = $sampling | ConvertTo-Xml -As String
        $query = "dbo.usp_InsertPerfmonCounters_SQLServer '$xmlString';"
        Invoke-Sqlcmd -ServerInstance $monitorServer -Database $monitorDB -Query $query
    #####ExtractPerfmonData -server "YourRemoteServerName" -instance "MSSQL`$SQLTest"
    ExtractPerfmonData -server "ServerName1Here" -instance "SQLSERVER" 
    ExtractPerfmonData -server "ServerName2Here" -instance "SQLSERVER"
    ExtractPerfmonData -server "ServerName3Here" -instance "MSSQL`$InstanceNameHere"  
    ExtractPerfmonData -server "ServerName4Here" -instance "SQLSERVER" 
    (I have 93 instances listed; here I just gave a sample of 4.)
    For only one instance I get the following error message:
    Get-Counter : The
    \\ServerNameHere2\\SQLSERVER:Locks(_Total)\Lock Waits/sec performance counter path  is not valid.
    All of the instances should have been set up the same, so I am confused as to why this error only occurs on this one instance.  I do not know where to look.  Has anyone ever seen this type of error before?
    lcerni

    Here is the output of the first script:
    CounterSetName                                                                                                                     
    ...       (eliminating non sql server counters here)              
    SQLAgent:Alerts                                                        
    SQLAgent:Jobs                                                          
    SQLAgent:JobSteps                                                        
    SQLAgent:Statistics                                      
    SQLServer:Access Methods                                                                                          
    SQLServer:Availability Replica  SQLServer:Backup Device                                                                                                            
    SQLServer:Batch Resp Statistics                                                                                                    
    SQLServer:Broker Activation                                                                                                        
    SQLServer:Broker Statistics                                                                                                        
    SQLServer:Broker TO Statistics                                                                                                     
    SQLServer:Broker/DBM Transport                                                                                                     
    SQLServer:Buffer Manager                                                                                                           
    SQLServer:Buffer Node                                                                                                              
    SQLServer:Catalog Metadata                                                                                                         
    SQLServer:CLR                                                                                                                      
    SQLServer:Cursor Manager by Type                                                                                                   
    SQLServer:Cursor Manager Total                                                                                                     
    SQLServer:Database Mirroring                                                                                                       
    SQLServer:Database Replica                                                                                                         
    SQLServer:Databases                                                                                                                
    SQLServer:Deprecated Features                                                                                                      
    SQLServer:Exec Statistics                                                                                                          
    SQLServer:FileTable                                                                                                                
    SQLServer:General Statistics                                                                                                       
    SQLServer:Latches                                                                                                                  
    SQLServer:Locks                                                                                                                    
    SQLServer:Memory Broker Clerks                                                                                                     
    SQLServer:Memory Manager                                                                                                           
    SQLServer:Memory Node                                                                                                              
    SQLServer:Plan Cache                                                                                                               
    SQLServer:Query Execution                                                                                                          
    SQLServer:Replication Agents                                                                                                       
    SQLServer:Replication Dist.                                                                                                        
    SQLServer:Replication Logreader                                                                                                    
    SQLServer:Replication Merge                                                                                                        
    SQLServer:Replication Snapshot                                                                                                     
    SQLServer:Resource Pool Stats                                                                                                      
    SQLServer:SQL Errors                                                                                                               
    SQLServer:SQL Statistics                                                                                                           
    SQLServer:Transactions                                                                                                             
    SQLServer:User Settable                                                                                                            
    SQLServer:Wait Statistics                                                                                                          
    SQLServer:Workload Group Stats                                                                                                     
    ...       (eliminating non sql server counters here)
    lcerni

  • Is it possible to get a count of all the class files in a Flash Builder project?

    Is it possible to get a count of all the class files in a Flash Builder project?
    Thanks!

    Resultsets are one per connection unless you have copied them. Do you have lots of connections are you properly reusing them or at least closing and discarding all references?
    See tutorial and Javadoc of API too

  • How to get comparable Oracle JDBC performance using Java 1.4 vs 1.1.7?

    Our application makes extensive use of JDBC to access an Oracle database. We wrote it a number of years ago using java 1.1.7 and we have been unable to move to new versions of java because of the performance degradation.
    I traced the problem to JDBC calls. I can reproduce the problem using a simple program that simply connects to the database, executes a simple query and then reads the data. The same program running under java 1.4 is about 60% slower than under java 1.1.7. The query is about 80% slower and getting the data is about 150% slower!
    The program is attached below. Note, I run the steps twice as the first time the times are much larger which I attribute to java doing some initializations. So the second set of values I think are more representative of the actual performance in our application where there are numerous accesses to the database. Specifically, I focus on step 4 which is the execute query command and step 5 which is the data retrieval step. The table being read has 4 columns with 170 tuples in it.
    Here are the timings I get when I run this on a Sparc Ultra 5 running
    SunOs 5.8 using an Oracle database running 8.1.7:
                     java 1.1.7  java 1.4
            overall:    2.1s         3.5s
            step 1:     30           200
            step 2:    886          2009
            step 3:      2             2
            step 4:      9            17
            step 5:    122           187
            step 6:      1             1
            step 1:      0             0
            step 2:    203           161
            step 3:      0             1
            step 4:      8            15   <-   87% slower
            step 5:     48           117   <-  143% slower
            step 6:      1             2I find the same poor performance from java versions 1.2 and 1.3.
    I tried using DataDirect's type 4 JDBC driver which gives a little better performance but overall it is still much slower than using java 1.1.7.
    Why do the newer versions of java have such poor performance when using JDBC?
    What can be done so that we can have performance similar to java 1.1.7
    using java 1.4?
    ========================================================================
    import java.util.*;
    import java.io.*;
    import java.sql.*;
    public class test12 {
        public static void main(String args[]) {
            try {
                    long time1 = System.currentTimeMillis();
    /* step 1 */  DriverManager.registerDriver(
                        new oracle.jdbc.driver.OracleDriver());
                    long time2 = System.currentTimeMillis();
    /* step 2 */  Connection conn = DriverManager.getConnection (
                  "jdbc:oracle:thin:@dbserver1:1521:db1","user1","passwd1");
                    long time3 = System.currentTimeMillis();
    /* step 3 */  Statement stmt = conn.createStatement();
                    long time4 = System.currentTimeMillis();
    /* step 4 */  ResultSet rs = stmt.executeQuery("select * from table1");
                    long time5 = System.currentTimeMillis();
    /* step 5 */  while( rs.next() ) {
                      int message_num = rs.getInt(1);
                      String message = rs.getString(2);
                    long time6 = System.currentTimeMillis();
    /* step 6 */  rs.close(); stmt.close();
                    long time7 = System.currentTimeMillis();
                System.out.println("step 1: " + (time2 - time1) );
                System.out.println("step 2: " + (time3 - time2) );
                System.out.println("step 3: " + (time4 - time3) );
                System.out.println("step 4: " + (time5 - time4) );
                System.out.println("step 5: " + (time6 - time5) );
                System.out.println("step 6: " + (time7 - time6) );
                System.out.flush();
            } catch ( Exception e ) {
                System.out.println( "got exception: " + e.getMessage() );
            ... repeat the same 6 steps again...
    }

    If I run my sample program with the -server option, it
    takes a lot longer (6.8s vs 3.5s).Which has to be expected, as the -server option optimizes for long running programs - so it shoudl go with my second suggestion, more below...
    I am not certain what you mean by "just let the jvm
    running". Our users issue a command (in Unix) which
    invokes one of our java programs to access or update
    data in a database. I think what you are suggesting
    would require that I rewrite our application to have a
    java program always running on the users workstation
    and to also rewrite our
    commands (over a hundred) to some how pass data and
    receive data with this new server java program. That
    does not seem a very reasonable just to move to a new
    version of java. Or are you suggesting something
    else?No I was just suggestion what you descript. But if this is not an option, then maybe you should merge your java-programs to C or another native language. Or you could try the IBM-JDK with the -faststart (or similar) option. If thew Unix you mention is AIX, then there would be the option of a resetable-vm. But I cannot say if this VM would solve your problem. Java is definitly not good for applications which only issue some unqiue commands because the hotspot-compiler can not be efficiently used there. You can only try to get 1.1.7 performance by experimenting with vm-parameters (execute java -X).

  • Get the values from Exception class

    Hi all ..
    In class i have raised one exception
    when i catch this exception in my program i m able to get the
    error message but i need to get all the parameters that i pass
    when i raise the exception ...
    i have raised like this
          RAISE EXCEPTION TYPE cx_bapi_error
            EXPORTING
              textid = cx_bapi_error=>cx_bo_error
              class_name = 'ZHS_'
              log_no = wa_bapi_return-log_no
              log_msg_no = wa_bapi_return-log_msg_no
              t100_msgid = wa_bapi_return-id
              t100_msgno = wa_bapi_return-number
              t100_msgv1 = wa_bapi_return-message_v1
              t100_msgv2 = wa_bapi_return-message_v2
              t100_msgv3 = wa_bapi_return-message_v3
              t100_msgv4 = wa_bapi_return-message_v4
              STATUS = lt_status
    and caught the exception like this in my program
        CATCH cx_bapi_error INTO go_error.
          gd_text = go_error->get_text( ).
          EXIT.
      ENDTRY.
    in this i m just getting the class name which i have passed in exception
    i need all other parameters that i have passed ..
    if u have any idea pls let me know ..
    Thanks in advance ...

    Hello Jayakumar
    Usually the attributes of standard exception classes are defines as <b>public</b> and <b>read-only</b>. Thus, you should be able to use the following coding:
    DATA:
      go_error   TYPE REF TO cx_bapi_error.  " specific exception class !!!
    TRY.
    RAISE EXCEPTION TYPE cx_bapi_error
    EXPORTING
    textid = cx_bapi_error=>cx_bo_error
    class_name = 'ZHS_'
    log_no = wa_bapi_return-log_no
    log_msg_no = wa_bapi_return-log_msg_no
    t100_msgid = wa_bapi_return-id
    t100_msgno = wa_bapi_return-number
    t100_msgv1 = wa_bapi_return-message_v1
    t100_msgv2 = wa_bapi_return-message_v2
    t100_msgv3 = wa_bapi_return-message_v3
    t100_msgv4 = wa_bapi_return-message_v4
    STATUS = lt_status.
    CATCH cx_bapi_error INTO go_error.
    gd_text = go_error->get_text( ).
    WRITE: go_error->t100_msgid,  " perhaps the attributes have different name
                go_error->t100_msgno, " check attribute names in SE24
    EXIT.
    ENDTRY.
    Regards
      Uwe

  • I have been getting java.lang.ClassNotFoundException: ZeroApplet.class and java.lang.ClassNotFoundException: JavaToJS.class crashes with JRE version 1.6.0_26-b03-384-10M3425 VM executing a Java Applet. Is Apple aware of this problem? No longer supported?

    My web page uses a Java Applet to allow my visitors to replay chess games; the Chess Viewer Deluxe applet was written by Nikolai Pilafov some time ago and has been working properly for some time (until recently). I don't monitor this part of my site regularly so I am not sure when it began to fail. On his web site [http://chesstuff.blogspot.com/2008/11/chess-viewer-deluxe.html] he has a link to check LiveConnect object functionality (which fails for OBJECT tags). His recommendation is to "seek platform specific support which might be available from the JRE developers for your platform".
    I have been getting java.lang.ClassNotFoundException: ZeroApplet.class and java.lang.ClassNotFoundException: JavaToJS.class crashes with JRE version 1.6.0_26-b03-384-10M3425 VM executing a Java Applet. Until I checked the LiveConnect object functionality, I was unable to identify the source of the console error messages. This does seem to be the smoking gun.
    Is Apple aware of this problem? Are these classes no longer supported? Has anyone else had this problem? You can attempt to recreate the problem locally by going to my web page: http://donsmallidge.com/DonSmallidgeChess.html
    Thanks in advance for any help you can provide!
    Abbreviated Java Console output:
    Java Plug-in 1.6.0_26
    Using JRE version 1.6.0_26-b03-384-10M3425 Java HotSpot(TM) 64-Bit Server VM
    load: class ZeroApplet.class not found.
    java.lang.ClassNotFoundException: ZeroApplet.class
        at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:662)
        at sun.applet.AppletPanel.createApplet(AppletPanel.java:807)
        at sun.plugin.AppletViewer.createApplet(AppletViewer.java:2389)
        at sun.applet.AppletPanel.runLoader(AppletPanel.java:714)
        at sun.applet.AppletPanel.run(AppletPanel.java:368)
        at java.lang.Thread.run(Thread.java:680)
    load: class JavaToJS.class not found.
    java.lang.ClassNotFoundException: JavaToJS.class
        at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:662)
        at sun.applet.AppletPanel.createApplet(AppletPanel.java:807)
        at sun.plugin.AppletViewer.createApplet(AppletViewer.java:2389)
        at sun.applet.AppletPanel.runLoader(AppletPanel.java:714)
        at sun.applet.AppletPanel.run(AppletPanel.java:368)
        at java.lang.Thread.run(Thread.java:680)

    I just went up to check the LiveConnect object functionality page AND IT WORKED THIS TIME! I must confess, this is very mysterious. I will do some more checking and reply here if I can determine why it is working now (and more importantly, why it didn't work before).

  • Using Get Data From Aggregation event class in SQL Profiler - SSAS 2012

    Hi,
    I'd like to understand better the use of the Get data from aggregation event class in SQL Profiler to monitor a MDX query and which info provide. Fe, does it return the MDX query? Is it possible to use this event class in order to monitor MDX query vs a
    Tabular model?
    In the TechNet documentation, this event class is handled briefly.
    Thanks

    Hi pscorca,
    This event is raised when the storage engine reads data from an aggregation, it may have a negative impact on performance when turned on. If you need to monitor SSAS instance status, we can also use dynamic management view:
    Use Dynamic Management Views (DMVs) to Monitor Analysis Services:
    http://msdn.microsoft.com/en-us/library/hh230820.aspx
    Regards,
    Elvis Long
    TechNet Community Support

  • Incrementing Counter on Stage through Class

    Hello everyone, I have a thread similar to this one about saving and loading a counter. However, I can't get the counter to increment when colliding with an object. When colliding with the object, it makes it not visible so you can't see it anymore.
    My counter that saves and loads looks like this:
    var so:SharedObject = SharedObject.getLocal("myStuff","/");
    var JumpCounter: int = 0;
    if(so.data.JumpCounter)
              JumpCounter = so.data.JumpCounter;
    And when you jump:
      JumpCounter++;
              so.data.JumpCounter = JumpCounter;
              so.flush();
    It ouputs here to a text box:
    JumpBox.text = JumpCounter.toString();
    This all works fine, I just can't get it to increment when colliding with my MovieClip.
    I have a class that looks like this attached to my MovieClip that I want to increment that looks like this:
    package {
              import flash.display.*;
              import flash.events.*;
              public class AddJumps extends MovieClip{
                        //construct function
                        public function AddJumps():void
                                  addEventListener(Event.ENTER_FRAME, collision);
                        private function collision(e:Event):void{
                                  if(this.hitTestObject(MovieClip(root).Player)){
                                  MovieClip(root).JumpIcon.visible = false;
    I'm unsure as how to access or increment my counter from within a class. I can't seem to remember how to access the stage.
    Thanks in advance!

    on your main timeline you should use:
    var so:SharedObject = SharedObject.getLocal("myStuff","/");
    var JumpCounter: int = 0;
    if(so.data.JumpCounter)
              JumpCounter = so.data.JumpCounter;
    function incrementJumpCounterF():void{
      JumpCounter++;
              so.data.JumpCounter = JumpCounter;
              so.flush();
    //And when you jump (or otherwise want to increment JumpCounter from the main timeline or a class like AddJumps):
    MovieClip(root).incrementJumpCounterF();

  • Getting multiple counters with get-counter ?

    Just trying to get a handful of counters for sql server monitoring.  but is there any way i can export-counters all  into 1  .blg file or am i not getting this ?  do they have to be in the same set i guess is the question.
    Counters like :
    Get-Counter "\\$computer\processor(_total)\% processor time"
    Physical Disk: Average Disk/sec Reads
    Physical Disk: Average Disk/sec Write
    SQL Server: Memory Manager >> Free List Stalls/sec
          SQL Server: Memory Manager >> Memory Grants Pending
    thanks,
    Chris

    Mike, once again, thanks.
    I guess i need to find out how to read the cmdlet powershell syntax.  from the documentation that you've sent, and which i've read before, i can't find where you can comma separate counters.  clearly, i need to decipher the syntax which is not
    too clear.
    That is why it is important to take a course or read a book or use the training materials on this site. The raining answers these obvious questions. It is like buying a new car - first you read the owners manual.
    In the first couple of lessons the syntax of the CmdLets are explained.
    You can also use help to discover how they work.
    The CmdLets shows you how to call a CmdLet with an array of strings.  A comma separated list of any kind is an array.
    (1,2,3,43,5).GetType()
    ¯\_(ツ)_/¯

  • Azure Powershell Get Public IP of Staging Cloud Service

    I also posted my question here..
    http://stackoverflow.com/questions/20690307/azure-powershell-get-public-ip-of-staging-cloud-service
    I am using this answer to look up our cloud service's public ip via azure powershell.
    Azure
    Powershell: Get public virtual IP of service
    This only returns the endpoints for the production cloud services. We also need to easily look up our staging cloud service endpoints.
    Does anyone know how to look these up with Azure Powershell?
    Thanks!

    hi TWilly,
    Thanks for psoting!
    You could use "Slot" in your powershell.
    Please see the description about "Slot":
    -Slot<String>
    Specifies the Windows Azure deployment environment. Choices are "Production" or "Staging".
    You could use it to specify the emviroment.Like this sample :
    C:\PS>Get-AzureRole –ServiceName "MySvc1" –Slot Staging –RoleName "MyTestVM3"
    You could refer to this document:
    http://msdn.microsoft.com/en-us/library/jj152869.aspx
    Please try it.
    Regards,
     Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Invoke-Command Get-Counter

    Hi
    I'm trying to run some code on remote computers that use get-counter. But the problem is when the data is returned the CounterSamples is not as expected and the data is just:
    Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSample
    What am i doing wrong?

    True :)
    When i run this:
    $data = get-counter "\Memory\Available kbytes"
    $data.CounterSamples
    I get this:
    Path                                    InstanceName                                
                           CookedValue
    \\hyp20\memory\available kbytes                                                                  
                 52592044
    When i run this:
    $data1 = invoke-command -computername hyp20 -scriptblock {get-counter "\Memory\Available kbytes"}
    $data1.CounterSamples
    I get this:
    Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSample
    Do you need to use the results for some further use? If not, what happens when change the Invoke-Command line to:
    Invoke-Command -ComputerName hyp20 -scriptblock {
    $data = Get-Counter "\Memory\Availabile kbytes"
    $data.CounterSamples
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Get-Counter failing with error : A counter with a negative denominator value was detected

    Hi Folks,
    I have a weird situation where I am sampling the CPU usage for small duration and taking an average of the usage using the 'Get-Counter' command. This command seems to work well when tried directly in the powershell prompt. However, when we use the same
    command in script, the following error throws up, 
    Starting process to consume CPU cycles
    Get-Counter : A counter with a negative denominator value was detected.
    At C:\Monitor.ps1:100 char:29
    + $sys_cpu_obj = Get-Counter <<<< '\Processor(_Total)\% Processor Time'
    + CategoryInfo : InvalidResult: (:) [Get-Counter], Exception
    + FullyQualifiedErrorId : CounterApiError,Microsoft.PowerShell.Commands.GetCounterCommand
    PS C:\> Get-Counter '\Processor(_Total)\% Processor Time'
    Timestamp CounterSamples
    2/29/2012 9:56:47 AM \\vms1\processor(_total)\% processor time :
    26.2817087701422
    PS C:\>
    Here is the routine that is being executed, 
    function sample-CPUUsage([int] $iterations=3,[int] $sampling_interval=2){
    [long] $sum=0
    # Collect an average of physical memory usage
    for($i=0; $i -lt $iterations; $i++){
    $sys_cpu_obj = Get-Counter '\Processor(_Total)\% Processor Time'
    [long] $cpu_usage=$($sys_cpu_obj.CounterSamples).CookedValue
    $sum+=$cpu_usage
    Start-Sleep -Seconds $sampling_interval
    [long] $sum=[long] ($sum/$iterations)
    return $sum
    Why am I getting this error when running the same command from the script ?
    -Pranav

    Hi,
    I cannot reproduce your issue either. It seems like that this issue a issue related with your environment.
    Based on the error message "A counter with a negative denominator value was detected", it seems like that
    $iterations sometimes is treated as a negative number. How about change
    [long] $sum=[long]
    ($sum/$iterations)
     as
    [long] $sum=[system.math]::abs([long]
    ($sum/$iterations))
    Best Regards,
    Yan Li 
    Yan Li
    TechNet Community Support

  • How to programmatically get the source for a class provided the class name?

    Hello,
    As a quick background, I am providing some tools to potential users of an in-house framework. One is the ability to generate quick prototypes from our existing demo applications. Assume a user downloads our jars and uses them in their project (we are using Eclipse, but that detail should not greatly affect my question). Included in the jars is a demos package that contains ready-to-run classes that serve to exhibit certain functionality. Since many users may just need quick extensions of these demos, I am trying to provide a way for them to be able to create a new project that starts with a copy of the demo class.
    So, the user is provided a list of the existing demos (each one uses a single class). When the user makes their selection, with the knowledge of our framework, I can translate that into what demo class they need (returned as a string of format package.subpack1.subpackn.DemoClassName). What I now want to do is to use that complete class name to get the source (look up the file) for the corresponding class, and copy it into to a new file in their project (the copying into the project can be done easily in Eclipse, so what I need help with is the bolded part). Is there a simple way to get the source given a class path for a class as described above? You may assume the source files are included in the jars for the framework.
    Thanks in advance.

    If there's a file named "package.subpack1.subpackn.DemoClassName.java" in a "demos" directory in the jar, then yes. You'd just use
    InputStream code = getResourceAsStream("/demos.package.subpack1.subpackn.DemoClassName.java");Or if those dots in the name actually separate directory names, i.e. you have a "package" directory under "demos" and a "subpack1" director under that and so on, then:
    InputStream code = getResourceAsStream("/demos/package/subpack1/subpackn/DemoClassName.java");

  • How do I setup multiple users to use one source but manage playlists separately?  For example, play counts are specific to each user.

    How do I setup multiple users to use one source but manage playlists separately?  For example, play counts are specific to each user.

    Hi,
    Thank you for posting in Windows Server Forum.
    Here adding to the words of “Tim”, a forwarder is a DNS server on a network used to forward DNS queries for external DNS names to DNS servers outside of that network. You can also forward queries according to specific domain names using conditional forwarders.
    A DNS server on a network is designated as a forwarder by having the other DNS servers in the network forward the queries they cannot resolve locally to that DNS server. You can refer information regarding forwarders and how to configure from beneath link.
    Understanding forwarders
    http://technet.microsoft.com/en-us/library/cc782142(v=ws.10).aspx
    Configure a DNS Server to Use Forwarders
    http://technet.microsoft.com/en-us/library/cc754941.aspx
    Hope it helps!
    Regards.

  • How can I get a dynamic list of Classes Loaded

    I assume this may need to use some sort of reflection. Does
    anyone have code or ideas where I can:
    a) I can get a list of all Classes loaded and their
    properties. This would probably be all instances of Class
    b) A list of all
    global instance variables. (This may not even be possible. I
    know it can be done in other languages)
    I assume this may need to use some sort of reflection.
    Thank you

    Adobe Newsbot hopes that the following resources helps you.
    NewsBot is experimental and any feedback (reply to this post) on
    its utility will be appreciated:
    mx.controls.List (Flex 3):
    If the data is incorrect, you can call the preventDefault()
    method to stop Flex from passing the new data back to the list
    control and from closing the
    Link:
    http://livedocs.adobe.com/flex/3/langref/mx/controls/List.html
    Displaying icons in a Flex List control at Flex Examples:
    http://blog.flexexamples.com/2007/08/17/displaying-icons-in-a-flex-list-control/
    --> <mx:Application xmlns:mx=&quot;
    http://www.adobe.com/2006/mxml&quot;
    Link:
    http://blog.flexexamples.com/2007/08/17/displaying-icons-in-a-flex-list-control/
    Populate the list -- Flex 2.01:
    You populate a list-based form control with the
    <mx:dataProvider> child tag. The <mx:dataProvider> tag
    lets you specify list items in several ways.
    Link:
    http://livedocs.adobe.com/flex/201/html/tutorial_controls_019_4.html
    Smooth Scroll for Horizontal List - Flex India Community |
    Google:
    I have created image gallery with Horizontal List[Flex 2.0].
    Just as below ref site. My Problem is i need a smooth scroll for
    Horizontal List. where images
    Link:
    http://groups.google.com/group/flex_india/browse_thread/thread/a12441143b98d32c?hide_quote s=no
    Creating a List control -- Flex 2.01:
    The following example code adds a handler for a change event
    to the List control. Flex broadcasts a mx.ListEvent.CHANGE event
    when the value of the control
    Link:
    http://livedocs.adobe.com/flex/201/html/dpcontrols_062_03.html
    Disclaimer: This response is generated automatically by the
    Adobe NewsBot based on Adobe
    Community
    Engine.

Maybe you are looking for

  • Problem with Custom container - cl_gui_custom_container/cl_gui_alv_grid

    Hi, I want to reuse the same custom container screen for a different data. First screen there will be button 1 and button 2 if I click button 1 then calculate and display data  in custom container, if button 2 is clicked then calculate and display da

  • Can I use apple tv to be my router?, Can I use apple tv to be my router?

    I'm looking for a wifi router, can I use apple tv to be my router? please help thanks...

  • Powershell Array Export Issues

    Hey everyone! So I might just be going about this the wrong way but here's my issue. The script functions as I need it to however, when I export the values to my .csv, the columns are in the wrong order than the way I think they should be. Here's wha

  • CRM_ORD_TE Authorization Object

    Hi Experts, Does the auth object CRM_ORD_TE only work for Claims related transactions ? Will this auth object also work for other transaction categories like Sales, Activities etc ? We need to control Opportunities and Activity authorization in based

  • Flash website not loading in various browsers

    Hi, I just uploaded my new website, and have gotten complaints from people using browsers other than IE. They are unable to load my flash website, and I have no idea why. It is: shojin.com Does anyone know what is going on?