( ! ) Deprecated: Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /var/www/html/wp-includes/functions.php on line 6131
Call Stack
#TimeMemoryFunctionLocation
10.0000484224{main}( ).../index.php:0
20.0006484576require( '/var/www/html/wp-blog-header.php ).../index.php:17
30.28314391520require_once( '/var/www/html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.28954420840include( '/var/www/html/wp-content/themes/twentyfifteen/archive.php ).../template-loader.php:125
50.28954420840get_header( $name = ???, $args = ??? ).../archive.php:19
60.28954421056locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
70.28954421152load_template( $_template_file = '/var/www/html/wp-content/themes/twentyfifteen/header.php', $load_once = TRUE, $args = [] ).../template.php:749
80.28974421696require_once( '/var/www/html/wp-content/themes/twentyfifteen/header.php ).../template.php:814
90.28994429104wp_head( ).../header.php:18
100.28994429104do_action( $hook_name = 'wp_head' ).../general-template.php:3197
110.28994429320WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
120.28994429320WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
130.29014432304wp_enqueue_scripts( '' ).../class-wp-hook.php:341
140.29014432304do_action( $hook_name = 'wp_enqueue_scripts' ).../script-loader.php:2311
150.29014432520WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
160.29014432520WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
170.29024434408twentyfifteen_scripts( '' ).../class-wp-hook.php:341
180.29034435928wp_style_add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../functions.php:440
190.29034435928WP_Styles->add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../functions.wp-styles.php:245
200.29034435928WP_Dependencies->add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../class-wp-styles.php:385
210.29034554712_deprecated_argument( $function_name = 'WP_Dependencies->add_data()', $version = '6.9.0', $message = 'IE conditional comments are ignored by all supported browsers.' ).../class-wp-dependencies.php:317
220.29034560664wp_trigger_error( $function_name = '', $message = 'Function WP_Dependencies->add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:5925
230.29044561416trigger_error( $message = 'Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:6131

( ! ) Deprecated: Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /var/www/html/wp-includes/functions.php on line 6131
Call Stack
#TimeMemoryFunctionLocation
10.0000484224{main}( ).../index.php:0
20.0006484576require( '/var/www/html/wp-blog-header.php ).../index.php:17
30.28314391520require_once( '/var/www/html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.28954420840include( '/var/www/html/wp-content/themes/twentyfifteen/archive.php ).../template-loader.php:125
50.28954420840get_header( $name = ???, $args = ??? ).../archive.php:19
60.28954421056locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
70.28954421152load_template( $_template_file = '/var/www/html/wp-content/themes/twentyfifteen/header.php', $load_once = TRUE, $args = [] ).../template.php:749
80.28974421696require_once( '/var/www/html/wp-content/themes/twentyfifteen/header.php ).../template.php:814
90.28994429104wp_head( ).../header.php:18
100.28994429104do_action( $hook_name = 'wp_head' ).../general-template.php:3197
110.28994429320WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
120.28994429320WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
130.29014432304wp_enqueue_scripts( '' ).../class-wp-hook.php:341
140.29014432304do_action( $hook_name = 'wp_enqueue_scripts' ).../script-loader.php:2311
150.29014432520WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
160.29014432520WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
170.29024434408twentyfifteen_scripts( '' ).../class-wp-hook.php:341
180.32264562520wp_style_add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../functions.php:444
190.32264562520WP_Styles->add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../functions.wp-styles.php:245
200.32264562520WP_Dependencies->add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../class-wp-styles.php:385
210.32264562520_deprecated_argument( $function_name = 'WP_Dependencies->add_data()', $version = '6.9.0', $message = 'IE conditional comments are ignored by all supported browsers.' ).../class-wp-dependencies.php:317
220.32264562840wp_trigger_error( $function_name = '', $message = 'Function WP_Dependencies->add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:5925
230.32274563064trigger_error( $message = 'Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:6131

ImRe - 圖形轉換小精靈

ImRe - 圖形轉換小精靈

軟體:ImRe(版本:2.1)
類別:影像轉檔
性質:Freeware(461 K)

【編輯/王國淵】

數位相機越來越普及且體積也更加小巧,幾乎有電腦的人就有一部數位相機,所以一旦有機會出門踏青,數位相機的快門總是會被按個不停。拼命地按快門時著實有一種快感,但是當回家後看著上千張的戰利品,想到要整理時,可是讓人的興致完全冷到最低點阿。此時,你其實可以透過 ImRe 的協助來減輕你的工作量。

ImRe 是一款集合了圖片轉換、縮放功能的免費圖片編修工具,使用者可以利用它所提供的批次修改功能,來對圖片進行一次性的調整,加速你對圖片的處理。你只需要指定所要進行轉換的圖片目錄,ImRe 自然就會依照你的設定加目錄裡面所有的圖片都做好縮放以及轉檔的工作囉。

ImRe 目前支援 Jpeg 、Bmp 、Gif 、Tiff 、Png 、Emf 與 Wmf 等七種圖形檔案格式,使用者可以在這些格式間任意轉換圖檔,節省你許多處理照片時所需要的時間喔。

下載:

MySQL Stored Procedure Programming

<<MySQL Stored Procedure Programming>>



Book description


MySQL Stored Procedure Programming covers a lot of ground. The book starts with a thorough introduction to stored procedures programming and functions, covering the fundamentals of data types, operators, and using SQL in stored procedures. You’ll learn how to build and maintain stored programs — covering transactions, stored functions, and triggers — and how to call and use MySQL-based stored procedures in a variety of languages, including PHP, Perl, Python, .NET, and Java. This book, destined to be the bible of stored procedure development, is a resource that no real MySQL programmer can afford to do without.


 


MySQL Stored Procedure Programming CHM下载


书中配套代码的下载


书中样例数据库的下载

SQL Hacks (CHM)


<<SQL Hacks >>



Book description


Whether you’re running Access, MySQL, SQL Server, Oracle, or PostgreSQL, this book will help you push the limits of traditional SQL to squeeze data effectively from your database. SQL Hacks offers 100 hacks — unique tips and tools — that bring you the knowledge of experts who apply what they know in the real world to help you take full advantage of the expressive power of SQL. You’ll find practical techniques to address complex data manipulation problems.


Download CHM

J2ME : Sort Record Example

import javax.microedition.rms.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.io.*;

public class SortExample extends MIDlet implements CommandListener
{
  private Display display;
  private Alert alert;
  private Form form
  private Command exit; 
  private Command start;
  private RecordStore recordstore = null;
  private RecordEnumeration recordEnumeration = null;
  private Comparator comparator = null;
  public SortExample ()
  {
    display = Display.getDisplay(this);
    exit = new Command(“Exit”, Command.SCREEN, 1);
    start = new Command(“Start”, Command.SCREEN, 1);
    form new Form(“Mixed RecordEnumeration”null);
    form.addCommand(exit);
    form.addCommand(start);
    form.setCommandListener(this);
  }
  public void startApp()
  {
    display.setCurrent(form);
  }
  public void pauseApp()
  {
  }
  public void destroyAppboolean unconditional )
  {
  }
  public void commandAction(Command command, Displayable displayable)
  {
    if (command == exit)
    {
      destroyApp(true);
      notifyDestroyed();
    }
    else if (command == start)
    {
      try
      {
        recordstore = RecordStore.openRecordStore(
                      “myRecordStore”true );
      }
      catch (Exception error)
      {
        alert = new Alert(“Error Creating”
             error.toString(), null, AlertType.WARNING)
        alert.setTimeout(Alert.FOREVER)
        display.setCurrent(alert);
      }
      try
      {
        String outputData[] {“Mary”“Bob”“Adam”};
        for (int x = 0; x < 3; x++)
        {
          byte[] byteOutputData = outputData[x].getBytes();
          recordstore.addRecord(byteOutputData, 0
                   byteOutputData.length);
        }
      }
      catch Exception error)
      {
       alert = new Alert(“Error Writing”
                error.toString(), null, AlertType.WARNING)
       alert.setTimeout(Alert.FOREVER)
       display.setCurrent(alert);
      }
      try
      {
        StringBuffer buffer = new StringBuffer();
        Comparator comparator = new Comparator();
        recordEnumeration = recordstore.enumerateRecords(
                          null, comparator, false);
        while (recordEnumeration.hasNextElement())
        {
          buffer.append(new String(recordEnumeration.nextRecord()));
          buffer.append(“\n”);
        }
        alert = new Alert(“Reading”, buffer.toString() 
                 null, AlertType.WARNING)
        alert.setTimeout(Alert.FOREVER)
        display.setCurrent(alert);
      }
      catch (Exception error)
      {
        alert = new Alert(“Error Reading”
                  error.toString(), null, AlertType.WARNING)
        alert.setTimeout(Alert.FOREVER)
        display.setCurrent(alert);
      }
      try
      {
       recordstore.closeRecordStore();
      }
      catch (Exception error)
      {
        alert = new Alert(“Error Closing”
                    error.toString(), null, AlertType.WARNING)
        alert.setTimeout(Alert.FOREVER)
        display.setCurrent(alert);
      }
      if (RecordStore.listRecordStores() != null)
      {
        try
        {
          RecordStore.deleteRecordStore(“myRecordStore”);
          recordEnumeration.destroy();
        }
        catch (Exception error)
        {
         alert = new Alert(“Error Removing”
                error.toString(), null, AlertType.WARNING)
         alert.setTimeout(Alert.FOREVER)
         display.setCurrent(alert);
        }
      }      
    }
  }     
}
class Comparator implements RecordComparator
{
  public int compare(byte[] record1, byte[] record2)
  {
    String string1 = new String(record1)
               string2= new String(record2);
    int comparison = string1.compareTo(string2);
    if (comparison == 0)
      return RecordComparator.EQUIVALENT;
    else if (comparison < 0)
      return RecordComparator.PRECEDES;
    else
      return RecordComparator.FOLLOWS;
  }
}

J2ME : Store Database

import java.io.*;
import javax.microedition.midlet.*;
import javax.microedition.rms.*;

public class TestStore extends MIDlet {

    static final String DBNAME = “mydata”;

    public TestStore() {

        RecordStore rs = null;

        // Data is persistent across MIDlet invocations.
        // So, first clear out the old record store…

        try {
            RecordStore.deleteRecordStoreDBNAME );
        }
        catchException e ){
            // ignore any errors…
        }

        // Now create a new one and dump
        // each element out….

        try {
            rs = RecordStore.openRecordStoreDBNAME,
                                              true );

            byte[] data1 = “Here is the first record”.getBytes();
            byte[] data2 = “And here is the second”.getBytes();
            byte[] data3 = “And then the third”.getBytes();

            data3[00;
            data3[data3.length-1(byte1;

            rs.addRecorddata1, 0, data1.length );
            rs.addRecorddata2, 0, data2.length );
            rs.addRecorddata3, 0, data3.length );

            dumpRecordStorers, System.out );


            rs.closeRecordStore();
        }
        catchRecordStoreException e ){
            System.out.println);
        }

        notifyDestroyed();
    }

    public void dumpRecordStoreRecordStore rs,
                                 PrintStream out )
    {
        ifrs == null return;

        StringBuffer hexLine = new StringBuffer();
        StringBuffer charLine = new StringBuffer();

        try {
            int    lastID = rs.getNextRecordID();
            byte[] data = new byte[100];
            int    size;

            forint i = 1; i < lastID; ++i ){
                try {
                    size = rs.getRecordSize);
                    ifsize > data.length ){
                        data = new bytesize * ];
                    }

                    out.println“Record ” + i +
                              ” of size ” + size );

                    rs.getRecordi, data, );
                    dumpRecorddata, size, out,
                           hexLine, charLine, 16 );

                    out.println“” );
                }
                catchInvalidRecordIDException e ){
                    continue;
                }
            }
        }

        catchRecordStoreException e ){
            out.println“Exception reading record store: ” + e );
        }
    }

    private void dumpRecordbyte[] data, int size,
                             PrintStream out,
                             StringBuffer hexLine,
                             StringBuffer charLine,
                             int maxLen )
    {
        ifsize == return;

        hexLine.setLength);
        charLine.setLength);

        int count = 0;

        forint i = 0; i < size; ++i ){
            char b = (char) ( data[i0xFF );

            ifb < 0x10 ){
                hexLine.append‘0’ );
            }

            hexLine.appendInteger.toHexString) );
            hexLine.append‘ ‘ );

            if( ( b >= 32 && b <= 127 ||
                Character.isDigit||
                Character.isLowerCase||
                Character.isUpperCase) ){
                charLine.append( (char);
            else {
                charLine.append‘.’ );
            }

            if++count >= maxLen || i == size-){
                whilecount++ < maxLen ){
                hexLine.append”   ” );
                }

                hexLine.append‘ ‘ );
                hexLine.appendcharLine.toString() );

                out.printlnhexLine.toString() );
 
                hexLine.setLength);
                charLine.setLength);
                count = 0;
            }
        }
    }

    public void destroyAppboolean unconditional ) {
    }

    public void startApp() {
    }

    public void pauseApp() {
    }
}


J2ME : Record Enumeration Example

import javax.microedition.rms.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.io.*;

public class RecordEnumerationExample 
             extends MIDlet implements CommandListener
{
  private Display display;
  private Alert alert;
  private Form form
  private Command exit; 
  private Command start;
  private RecordStore recordstore = null;
  private RecordEnumeration recordEnumeration = null;
  public RecordEnumerationExample ()
  {
    display = Display.getDisplay(this);
    exit = new Command(“Exit”, Command.SCREEN, 1);
    start = new Command(“Start”, Command.SCREEN, 1);
    form new Form(“RecordEnumeration”);
    form.addCommand(exit);
    form.addCommand(start);
    form.setCommandListener(this);
  }
  public void startApp()
  {
    display.setCurrent(form);
  }
  public void pauseApp()
  {
  }
  public void destroyAppboolean unconditional )
  {
  }
  public void commandAction(Command command, 
              Displayable displayable)
  {
    if (command == exit)
    {
      destroyApp(true);
      notifyDestroyed();
    }
    else if (command == start)
    {
      try
      {
        recordstore = RecordStore.openRecordStore(
                      “myRecordStore”true );
      }
      catch (Exception error)
      {
        alert = new Alert(“Error Creating”
                error.toString(), null, AlertType.WARNING)
        alert.setTimeout(Alert.FOREVER)
        display.setCurrent(alert);
      }
      try
      {
        String outputData[] {“First Record”
                 “Second Record”“Third Record”};
        for (int x = 0; x < 3; x++)
        {
          byte[] byteOutputData = outputData[x].getBytes();
          recordstore.addRecord(byteOutputData, 
                     0, byteOutputData.length);
        }
      }
      catch Exception error)
      {
        alert = new Alert(“Error Writing”
                error.toString(), null, AlertType.WARNING)
        alert.setTimeout(Alert.FOREVER)
        display.setCurrent(alert);
      }
      try
      {
         StringBuffer buffer = new StringBuffer();
         recordEnumeration = 
                recordstore.enumerateRecords(null, null, false);
         while (recordEnumeration.hasNextElement())
         {
           buffer.append(new String(recordEnumeration.nextRecord()));
           buffer.append(“\n”);
         }
           alert = new Alert(“Reading”
                buffer.toString(), null, AlertType.WARNING)
           alert.setTimeout(Alert.FOREVER)
           display.setCurrent(alert)
      }
      catch (Exception error)
      {
        alert = new Alert(“Error Reading”
                  error.toString(), null, AlertType.WARNING)
        alert.setTimeout(Alert.FOREVER)
        display.setCurrent(alert);
      }
      try
      {
        recordstore.closeRecordStore();
      }
      catch (Exception error)
      {
        alert = new Alert(“Error Closing”
               error.toString(), null, AlertType.WARNING)
        alert.setTimeout(Alert.FOREVER)
        display.setCurrent(alert);
      }
      if (RecordStore.listRecordStores() != null)
      {
        try
        {
          RecordStore.deleteRecordStore(“myRecordStore”);
          recordEnumeration.destroy();
        }
        catch (Exception error)
        {
         alert = new Alert(“Error Removing”
               error.toString(), null, AlertType.WARNING)
         alert.setTimeout(Alert.FOREVER)
         display.setCurrent(alert);
        }
      }      
    }
  }     
}

J2ME: Test the RMS listener methods

import java.io.*;
import javax.microedition.midlet.*;
import javax.microedition.rms.*;

public class RmsListener extends MIDlet
{
  private RecordStore rs = null;
  static final String REC_STORE = “db_8”;

  public RmsListener()
  {
    // Open record store and add listener
    openRecStore();
    rs.addRecordListener(new TestRecordListener());

    // Initiate actions that will wake up the listener    
    writeRecord(“J2ME and MIDP”);
    updateRecord(“MIDP and J2ME”);
    deleteRecord();
    
    closeRecStore();  // Close record store
    deleteRecStore()// Remove the record store
  }

  public void destroyAppboolean unconditional )
  {
  }

  public void startApp()
  {
    // There is no user interface, go ahead and shutdown
    destroyApp(false);
    notifyDestroyed();
  }

  public void pauseApp()
  {
  }

  public void openRecStore()
  {
    try
    {
      // The second parameter indicates that the record store
      // should be created if it does not exist
      rs = RecordStore.openRecordStore(REC_STORE, true);
    }
    catch (Exception e)
    {
      db(e.toString());
    }
  }    
  
  public void closeRecStore()
  {
    try
    {
      rs.closeRecordStore();
    }
    catch (Exception e)
    {
      db(e.toString());
    }
  }

  public void deleteRecStore()
  {
    if (RecordStore.listRecordStores() != null)
    {
      try
      {
        RecordStore.deleteRecordStore(REC_STORE);
      }
      catch (Exception e)
      {
        db(e.toString());
      }
    }      
  }

  public void writeRecord(String str)
  {
    byte[] rec = str.getBytes();

    try
    {
      rs.addRecord(rec, 0, rec.length);
    }
    catch (Exception e)
    {
      db(e.toString());
    }
  }

  public void updateRecord(String str)
  {
    try
    {
      rs.setRecord(1, str.getBytes()0, str.length());
    }
    catch (Exception e)
    {
      db(e.toString());
    }
  }

  public void deleteRecord()
  {
    try
    {
      rs.deleteRecord(1);
    }
    catch (Exception e)
    {
      db(e.toString());
    }
  }

  /*————————————————–
  * Simple message to console for debug/errors
  * When used with Exceptions we should handle the 
  * error in a more appropriate manner.
  *————————————————-*/
  public void db(String str)
  {
    System.err.println(“Msg: ” + str);
  }

}


/*————————————————–
* Listen for updates to the record store
*————————————————-*/
class TestRecordListener implements RecordListener
{
  public void recordAdded(RecordStore recordStore, int recordId
  
    try
    {
      System.out.println(“Record with ID#: ” + recordId + 
                         ” added to RecordStore: ” + recordStore.getName())
    }
    catch (Exception e)
    {
      System.err.println(e);
    
  

  public void recordDeleted(RecordStore recordStore, int recordId
  {
    try
    {
      System.out.println(“Record with ID#: ” + recordId + 
                         ” deleted from RecordStore: ” + recordStore.getName())
    
    catch (Exception e)
    {
      System.err.println(e);
    }
  }

  public void recordChanged(RecordStore recordStore, int recordId
  {
    try
    {
      System.out.println(“Record with ID#: ” + recordId + 
                         ” changed in RecordStore: ” + recordStore.getName())
    
    catch (Exception e)
    {
      System.err.println(e);
    }
  
}


J2ME : Search Example

import javax.microedition.rms.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.io.*;

public class SearchExample extends MIDlet implements CommandListener
{
  private Display display;
  private Alert alert;
  private Form form
  private Command exit; 
  private Command start;
  private RecordStore recordstore = null;
  private RecordEnumeration recordEnumeration = null;
  private Filter filter = null;
  public SearchExample ()
  {
    display = Display.getDisplay(this);
    exit = new Command(“Exit”, Command.SCREEN, 1);
    start = new Command(“Start”, Command.SCREEN, 1);
    form new Form(“Mixed RecordEnumeration”null);
    form.addCommand(exit);
    form.addCommand(start);
    form.setCommandListener(this);
  }
  public void startApp()
  {
    display.setCurrent(form);
  }
  public void pauseApp()
  {
  }
  public void destroyAppboolean unconditional )
  {
  }
  public void commandAction(Command command, Displayable displayable)
  {
    if (command == exit)
    {
      destroyApp(true);
      notifyDestroyed();
    }
    else if (command == start)
    {
      try
      {
        recordstore = RecordStore.openRecordStore(
                          “myRecordStore”true );
      }
      catch (Exception error)
      {
        alert = new Alert(“Error Creating”
                 error.toString(), null, AlertType.WARNING)
        alert.setTimeout(Alert.FOREVER)
        display.setCurrent(alert);
      }
      try
      {
        String outputData[] {“Mary”“Bob”“Adam”};
        for (int x = ; x < 3; x++)
        {
          byte[] byteOutputData = outputData[x].getBytes();
          recordstore.addRecord(byteOutputData, 0
                         byteOutputData.length);
        }
      }
      catch Exception error)
      {
        alert = new Alert(“Error Writing”
               error.toString(), null, AlertType.WARNING)
        alert.setTimeout(Alert.FOREVER)
        display.setCurrent(alert);
      }
      try
      {
        filter = new Filter(“Bob”);
        recordEnumeration = recordstore.enumerateRecords(
                     filter, null, false);
        if (recordEnumeration.numRecords() 0)
        {
          String string = new String(recordEnumeration.nextRecord());
          alert = new Alert(“Reading”, string, 
                     null, AlertType.WARNING);
          alert.setTimeout(Alert.FOREVER)
          display.setCurrent(alert)
        }
      }
      catch (Exception error)
      {
       alert = new Alert(“Error Reading”
                error.toString(), null, AlertType.WARNING)
       alert.setTimeout(Alert.FOREVER)
       display.setCurrent(alert);
      }
      try
      {
       recordstore.closeRecordStore();
      }
      catch (Exception error)
      {
        alert = new Alert(“Error Closing”
                error.toString(), null, AlertType.WARNING)
        alert.setTimeout(Alert.FOREVER)
        display.setCurrent(alert);
      }
      if (RecordStore.listRecordStores() != null)
      {
        try
        {
         RecordStore.deleteRecordStore(“myRecordStore”);
         recordEnumeration.destroy();
         filter.filterClose();
        }
        catch (Exception error)
        {
         alert = new Alert(“Error Removing”
                  error.toString(), null, AlertType.WARNING)
         alert.setTimeout(Alert.FOREVER)
         display.setCurrent(alert);
        }
      }
    }
  }     
}
class Filter implements RecordFilter
{
  private String search = null;
  private ByteArrayInputStream inputstream = null;
  private DataInputStream datainputstream = null;
  public Filter(String search)
  {
    this.search = search.toLowerCase();
  }
  public boolean matches(byte[] suspect)
  {
    String string = new String(suspect).toLowerCase();
    if (string!= null && string.indexOf(search!= –1)
      return true;
    else
      return false;
  }
  public void filterClose()
  {
    try
    {
      if (inputstream != null)
      {
        inputstream.close();
      }
      if (datainputstream != null)
      {
        datainputstream.close();
      }
    }
    catch Exception error)
    {
    }
  }
}

J2ME : Read Display File

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.io.*;

public class ReadDisplayFile extends MIDlet implements CommandListener
{
  private Display display;    // Reference to Display object
  private Form fmMain;       // Main form
  private Command cmHelp;    // Command to show a help file
  private Command cmExit;    // Command to exit the MIDlet
  private Alert alHelp;      // Alert to display help file text

  public ReadDisplayFile()
  {
    display = Display.getDisplay(this);
    
    cmHelp = new Command(“Help”, Command.SCREEN, 1);
    cmExit = new Command(“Exit”, Command.EXIT, 1);    
    
    fmMain = new Form(“Read File”);
    fmMain.addCommand(cmExit);
    fmMain.addCommand(cmHelp);
    fmMain.setCommandListener(this);
  }

  public void startApp()
  {
    display.setCurrent(fmMain);
  }

  public void pauseApp()
  { }

  public void destroyApp(boolean unconditional)
  { }

  public void commandAction(Command c, Displayable s)
  {
    if (c == cmHelp)
    {
      String str;
      // Access the resource and read its contents
      if ((str = readHelpText()) != null)
      {
        // Create an Alert to display the help text        
        alHelp = new Alert(“Help”, str, null, null);
        alHelp.setTimeout(Alert.FOREVER);
        display.setCurrent(alHelp, fmMain);
      }
    }
    else if (c == cmExit)
    {
      destroyApp(false);
      notifyDestroyed();
    
  }
  
  private String readHelpText()
  {
    InputStream is = getClass().getResourceAsStream(“help.txt”);
    try 
    {
      StringBuffer sb = new StringBuffer();
      int chr, i = 0;
      // Read until the end of the stream      
      while ((chr = is.read()) != –1)
          sb.append((charchr);

      return sb.toString();
    }
    catch (Exception e)
    {         
      System.out.println(“Unable to create stream”);
    }
    return null;
  }
}


J2ME : Shows the values of the system properties

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

/**
 * A MIDlet shows the values of the system properties.
 */
public class MIDletProps extends MIDlet implements CommandListener
{

    private Display display;    // The display for this MIDlet
    private Form props;
    private StringBuffer propbuf;
    private Command exitCommand = new Command(“Exit”, Command.SCREEN, 1);


    /**
    * Construct MIDletProps
    */
    public MIDletProps() {
        display = Display.getDisplay(this);
    }

    /**
     * Show the value of the properties
     */
    public void startApp() {
       Runtime runtime = Runtime.getRuntime();
       runtime.gc();
       long free = runtime.freeMemory();
       long total = runtime.totalMemory();
    
       propbuf = new StringBuffer50 );
       props = new Form“System Properties” );
    
       props.append“Free Memory = ” + free + “\n” );
       props.append“Total Memory = ” + total + “\n” );
    
       props.appendshowProp“microedition.configuration” ) );
       props.appendshowProp“microedition.platform” ) );
       props.appendshowProp“microedition.locale” ) );
       props.appendshowProp“microedition.encoding” ) );
       props.appendshowProp“microedition.encodingClass” ) );
       props.appendshowProp“microedition.http_proxy” ) );
    
       props.addCommandexitCommand );
       props.setCommandListenerthis );
       
       display.setCurrentprops );

    }

    /**
    * Eventhandling code goes into commandAction
    */
    public void commandActionCommand c, Displayable s 
    {
      if c == exitCommand 
      {
         destroyAppfalse );
         notifyDestroyed();
      }  
    }


    /**
     * Show a property.
     */
   String showPropString prop 
   {
      String value = System.getPropertyprop );
      propbuf.setLength);
      propbuf.appendprop );
      propbuf.append” = ” );
      if (value == null
      {
         propbuf.append“<undefined>” );
      
      else 
      {
          propbuf.append“\”” );
          propbuf.appendvalue );
          propbuf.append“\”” );
      }
      propbuf.append“\n” );
      return propbuf.toString();
    }


   /**
    * Time to pause, free any space we don’t need right now.
    */
    public void pauseApp() 
    {
       display.setCurrentnull );
       propbuf = null;
       props = null;
    }

    /**
     * No op
     */
    public void destroyAppboolean unconditional 
    {
       System.out.println“In destroyApp” );

    }

}