ImRe - 圖形轉換小精靈
軟體:ImRe(版本:2.1)
類別:影像轉檔
性質:Freeware(461 K)
【編輯/王國淵】
數位相機越來越普及且體積也更加小巧,幾乎有電腦的人就有一部數位相機,所以一旦有機會出門踏青,數位相機的快門總是會被按個不停。拼命地按快門時著實有一種快感,但是當回家後看著上千張的戰利品,想到要整理時,可是讓人的興致完全冷到最低點阿。此時,你其實可以透過 ImRe 的協助來減輕你的工作量。
ImRe 是一款集合了圖片轉換、縮放功能的免費圖片編修工具,使用者可以利用它所提供的批次修改功能,來對圖片進行一次性的調整,加速你對圖片的處理。你只需要指定所要進行轉換的圖片目錄,ImRe 自然就會依照你的設定加目錄裡面所有的圖片都做好縮放以及轉檔的工作囉。
ImRe 目前支援 Jpeg 、Bmp 、Gif 、Tiff 、Png 、Emf 與 Wmf 等七種圖形檔案格式,使用者可以在這些格式間任意轉換圖檔,節省你許多處理照片時所需要的時間喔。
下載:
Author: strong
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.
J2ME : Sort Record Example
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 destroyApp( boolean 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.deleteRecordStore( DBNAME );
}
catch( Exception e ){
// ignore any errors…
}
// Now create a new one and dump
// each element out….
try {
rs = RecordStore.openRecordStore( DBNAME,
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[0] = 0;
data3[data3.length-1] = (byte) –1;
rs.addRecord( data1, 0, data1.length );
rs.addRecord( data2, 0, data2.length );
rs.addRecord( data3, 0, data3.length );
dumpRecordStore( rs, System.out );
rs.closeRecordStore();
}
catch( RecordStoreException e ){
System.out.println( e );
}
notifyDestroyed();
}
public void dumpRecordStore( RecordStore rs,
PrintStream out )
{
if( rs == null ) return;
StringBuffer hexLine = new StringBuffer();
StringBuffer charLine = new StringBuffer();
try {
int lastID = rs.getNextRecordID();
byte[] data = new byte[100];
int size;
for( int i = 1; i < lastID; ++i ){
try {
size = rs.getRecordSize( i );
if( size > data.length ){
data = new byte[ size * 2 ];
}
out.println( “Record ” + i +
” of size ” + size );
rs.getRecord( i, data, 0 );
dumpRecord( data, size, out,
hexLine, charLine, 16 );
out.println( “” );
}
catch( InvalidRecordIDException e ){
continue;
}
}
}
catch( RecordStoreException e ){
out.println( “Exception reading record store: ” + e );
}
}
private void dumpRecord( byte[] data, int size,
PrintStream out,
StringBuffer hexLine,
StringBuffer charLine,
int maxLen )
{
if( size == 0 ) return;
hexLine.setLength( 0 );
charLine.setLength( 0 );
int count = 0;
for( int i = 0; i < size; ++i ){
char b = (char) ( data[i] & 0xFF );
if( b < 0x10 ){
hexLine.append( ‘0’ );
}
hexLine.append( Integer.toHexString( b ) );
hexLine.append( ‘ ‘ );
if( ( b >= 32 && b <= 127 ) ||
Character.isDigit( b ) ||
Character.isLowerCase( b ) ||
Character.isUpperCase( b ) ){
charLine.append( (char) b );
} else {
charLine.append( ‘.’ );
}
if( ++count >= maxLen || i == size-1 ){
while( count++ < maxLen ){
hexLine.append( ” ” );
}
hexLine.append( ‘ ‘ );
hexLine.append( charLine.toString() );
out.println( hexLine.toString() );
hexLine.setLength( 0 );
charLine.setLength( 0 );
count = 0;
}
}
}
public void destroyApp( boolean 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 destroyApp( boolean 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 destroyApp( boolean 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.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 destroyApp( boolean 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
{
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((char) chr);
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 StringBuffer( 50 );
props = new Form( “System Properties” );
props.append( “Free Memory = ” + free + “\n” );
props.append( “Total Memory = ” + total + “\n” );
props.append( showProp( “microedition.configuration” ) );
props.append( showProp( “microedition.platform” ) );
props.append( showProp( “microedition.locale” ) );
props.append( showProp( “microedition.encoding” ) );
props.append( showProp( “microedition.encodingClass” ) );
props.append( showProp( “microedition.http_proxy” ) );
props.addCommand( exitCommand );
props.setCommandListener( this );
display.setCurrent( props );
}
/**
* Eventhandling code goes into commandAction
*/
public void commandAction( Command c, Displayable s )
{
if ( c == exitCommand )
{
destroyApp( false );
notifyDestroyed();
}
}
/**
* Show a property.
*/
String showProp( String prop )
{
String value = System.getProperty( prop );
propbuf.setLength( 0 );
propbuf.append( prop );
propbuf.append( ” = ” );
if (value == null)
{
propbuf.append( “<undefined>” );
}
else
{
propbuf.append( “\”” );
propbuf.append( value );
propbuf.append( “\”” );
}
propbuf.append( “\n” );
return propbuf.toString();
}
/**
* Time to pause, free any space we don’t need right now.
*/
public void pauseApp()
{
display.setCurrent( null );
propbuf = null;
props = null;
}
/**
* No op
*/
public void destroyApp( boolean unconditional )
{
System.out.println( “In destroyApp” );
}
}