您的当前位置:首页正文

ORA-38760: This database instance failed to turn on flashback database

2023-11-10 来源:帮我找美食网

第二种:ALTER SYSTEM DISCONNECT SESSION ‘sid,serial#‘ IMMEDIATE

第三种:用以下命令查到系统级别的进程号,然后杀掉。

SET LINESIZE 100
COLUMN spid FORMAT A10
COLUMN username FORMAT A10
COLUMN program FORMAT A45
 
SELECT s.inst_id,
       s.sid,
       s.serial#,
       p.spid,
       s.username,
       s.program
FROM   gv$session s
       JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
WHERE  s.type != ‘BACKGROUND‘;

结果今天起来起动数据库就有如下提示了:

SQL> startupORACLE instance started.Total System Global Area 1536602112 bytesFixed Size            2213616 bytesVariable Size          956303632 bytesDatabase Buffers      570425344 bytesRedo Buffers            7659520 bytesDatabase mounted.ORA-38760: This database instance failed to turn on flashback database

不知跟昨天的事有没有关系,先记录下来。晚些做实现进一步验证。先记录处理此故障的步骤。

SQL> shutdown immediate;ORA-01109: database not openDatabase dismounted.ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area 1536602112 bytesFixed Size            2213616 bytesVariable Size          956303632 bytesDatabase Buffers      570425344 bytesRedo Buffers            7659520 bytesDatabase mounted.ORA-38760: This database instance failed to turn on flashback databaseSQL> alter database flashback on;alter database flashback on*ERROR at line 1:ORA-38706: Cannot turn on FLASHBACK DATABASE logging.ORA-38713: Flashback Database logging is already turned on.SQL> alter database flashback off;Database altered.SQL> alter database flashback on;alter database flashback on*ERROR at line 1:ORA-38706: Cannot turn on FLASHBACK DATABASE logging.ORA-38714: Instance recovery required.SQL> alter database flashback off;Database altered.SQL> shutdown immediate;ORA-01109: database not openDatabase dismounted.ORACLE instance shut down.SQL> startup mount;ORACLE instance started.Total System Global Area 1536602112 bytesFixed Size            2213616 bytesVariable Size          956303632 bytesDatabase Buffers      570425344 bytesRedo Buffers            7659520 bytesDatabase mounted.SQL> alter database flashback on;alter database flashback on*ERROR at line 1:ORA-38706: Cannot turn on FLASHBACK DATABASE logging.ORA-38714: Instance recovery required.

SQL>  select FLASHBACK_ON from v$database;FLASHBACK_ON------------------RESTORE POINT ONLYSQL> alter database force logging;Database altered.SQL> alter database flashback off;Database altered.SQL> alter database open;alter database open*ERROR at line 1:ORA-38760: This database instance failed to turn on flashback databaseSQL> shutdown immediate;ORA-01109: database not openDatabase dismounted.ORACLE instance shut down.SQL> startup mount;ORACLE instance started.Total System Global Area 1536602112 bytesFixed Size            2213616 bytesVariable Size          956303632 bytesDatabase Buffers      570425344 bytesRedo Buffers            7659520 bytesDatabase mounted.SQL> alter database open;alter database open*ERROR at line 1:ORA-38760: This database instance failed to turn on flashback databaseSQL> alter database flashback on;alter database flashback on*ERROR at line 1:ORA-38706: Cannot turn on FLASHBACK DATABASE logging.ORA-38714: Instance recovery required.SQL> recover database;ORA-00283: recovery session canceled due to errorsORA-38760: This database instance failed to turn on flashback database

参考大牛的文章,说是跟还原点有关系。SQL> col name for a30SQL> /NAME                   TO_CHAR(TIME,‘YYYY/ GUA------------------------------ ------------------- ---B1                   2016/06/06 23:03:58 YESSQL> alter database flashback off;Database altered.SQL> select flashback_on from v$database;FLASHBACK_ON------------------RESTORE POINT ONLYSQL> drop restore point b1;Restore point dropped.SQL> select flashback_on from v$database;FLASHBACK_ON------------------NOSQL> select open_mode from v$database;OPEN_MODE--------------------MOUNTEDSQL> alter database flashback on;alter database flashback on*ERROR at line 1:ORA-38706: Cannot turn on FLASHBACK DATABASE logging.ORA-38714: Instance recovery required.SQL> recover database;Media recovery complete.SQL> alter database flashback on;alter database flashback on*ERROR at line 1:ORA-38706: Cannot turn on FLASHBACK DATABASE logging.ORA-38714: Instance recovery required.SQL> recover database;ORA-00283: recovery session canceled due to errorsORA-00264: no recovery requiredSQL> shutdown immediate;ORA-01109: database not openDatabase dismounted.ORACLE instance shut down.SQL> startup mount;ORACLE instance started.Total System Global Area 1536602112 bytesFixed Size            2213616 bytesVariable Size          956303632 bytesDatabase Buffers      570425344 bytesRedo Buffers            7659520 bytesDatabase mounted.SQL> alter database flashback on;alter database flashback on*ERROR at line 1:ORA-38706: Cannot turn on FLASHBACK DATABASE logging.ORA-38714: Instance recovery required.SQL> recover database;ORA-00283: recovery session canceled due to errorsORA-00264: no recovery requiredSQL> alter database open resetlogs;alter database open resetlogs*ERROR at line 1:ORA-01139: RESETLOGS option only valid after an incomplete database recoverySQL> alter database open;Database altered.SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area 1536602112 bytesFixed Size            2213616 bytesVariable Size          956303632 bytesDatabase Buffers      570425344 bytesRedo Buffers            7659520 bytesDatabase mounted.Database opened.SQL> select flashback_on,log_mode from v$database;FLASHBACK_ON       LOG_MODE------------------ ------------NO           ARCHIVELOGSQL> alter database flashback on;Database altered.SQL> select flashback_on,log_mode from v$database;FLASHBACK_ON       LOG_MODE------------------ ------------YES           ARCHIVELOG结论:

应该是由于数据库非一致性关闭导致的38760错误,如果重启flashback都报错38714,就删除还原点后,再重启数据库,可以正常启动了。以后还是正常关机保险。

参考:http://blog.csdn.net/aaron8219/article/details/10129503

http://blog.chinaunix.net/uid-22948773-id-2821820.html

ORA-38760: This database instance failed to turn on flashback database

标签:38714 38760 38706

小编还为您整理了以下内容,可能对您也有帮助:

[20分] mybatis怎样配置支持并发

参考配置方法如下:

1、修改SqlSessionFactoryBean,或者继承该类, 增加configLocations, 移除 configLocation

private Resource[] configLocations;

/*修改该方法*/

public void setConfigLocation(Resource configLocation){

this.configLocations = configLocation != null ? new Resource[] { configLocation } : null;

}

/*增加该方法*/

public void setConfigLocations(Resource[] configLocations) {

this.configLocations = configLocations;

}

/**

* 合并mybatis配置文件

*/

public Document SQLConfigMap()

{

Document doc = DocumentHelper.createDocument();

doc.setXMLEncoding("UTF-8");

DocumentFactory documentFactory = new DocumentFactory();

DocumentType docType = documentFactory.createDocType("configuration",

"-//mybatis.org//DTD Config 3.0//EN", "http://mybatis.org/dtd/mybatis-3-config.dtd");

doc.setDocType(docType);

Element rootElement = doc.addElement("configuration");

rootElement.addElement("typeAliases");

rootElement.addElement("mappers");

return doc;

}

public void readXML(Resource configXML, final Element elementTypeAlias,

final Element elementMapper)

{

// Document document = null;

SAXReader saxReader = new SAXReader();

// Element root = doc.getRootElement();

/*typeAliases合并*/

saxReader.addHandler("/configuration/typeAliases/typeAlias", new ElementHandler()

{

@Override

public void onEnd(ElementPath path)

{

Element row = path.getCurrent();

Element els = elementTypeAlias.addElement("typeAlias");

els.addAttribute("alias", row.attributeValue("alias")).addAttribute("type",

row.attributeValue("type"));

row.detach();

}

@Override

public void onStart(ElementPath arg0)

{

// TODO Auto-generated method stub

}

});

/*mapper合并*/

saxReader.addHandler("/configuration/mappers/mapper", new ElementHandler()

{

@Override

public void onEnd(ElementPath path)

{

Element row = path.getCurrent();

Element els = elementMapper.addElement("mapper");

String mapper = row.attributeValue("mapper");

String resource = row.attributeValue("resource");

els.addAttribute("mapper", mapper);

els.addAttribute("resource", resource);

row.detach();

}

@Override

public void onStart(ElementPath arg0)

{

// TODO Auto-generated method stub

}

});

try

{

saxReader.read(configXML.getInputStream());

}

catch (Exception e)

{

// TODO Auto-generated catch block

e.printStackTrace();

}

//return doc;

}

/**

* Build a {@code SqlSessionFactory} instance.

*

* The default implementation uses the standard MyBatis {@code XMLConfigBuilder}

* API to build a

* {@code SqlSessionFactory} instance based on an Reader.

*

* @return SqlSessionFactory

* @throws IOException if loading the config file failed

*/

protected SqlSessionFactory buildSqlSessionFactory() throws IOException

{

Configuration configuration = null;

XMLConfigBuilder xmlConfigBuilder = null;

Document document = this.SQLConfigMap();

Element root = document.getRootElement();

Element elementMapper = root.element("mappers");

Element elementTypeAlias = root.element("typeAliases");

for (Resource configLocation : configLocations)

{

readXML(configLocation, elementTypeAlias, elementMapper);

}

// Reader reader = null; InputStream inputStream = null;

if (this.configLocations != null)

{

logger.debug(document.asXML());

InputStream inputSteam = new ByteArrayInputStream(document.asXML().getBytes());

xmlConfigBuilder = new XMLConfigBuilder(inputSteam, null, this.configurationProperties);

configuration = xmlConfigBuilder.getConfiguration();

if (inputSteam != null)

{

inputSteam.close();

inputSteam = null;

}

document = null;

}

else

{

if (this.logger.isDebugEnabled())

{

this.logger.debug("Property 'configLocation' not specified,

using default MyBatis Configuration");

}

configuration = new Configuration();

configuration.setVariables(this.configurationProperties);

}

if (hasLength(this.typeAliasesPackage))

{

String[] typeAliasPackageArray = tokenizeToStringArray(this.typeAliasesPackage,

ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS);

for (String packageToScan : typeAliasPackageArray)

{

configuration.getTypeAliasRegistry().registerAliases(packageToScan);

if (this.logger.isDebugEnabled())

{

this.logger.debug("Scanned package: '" + packageToScan + "' for aliases");

}

}

}

if (!isEmpty(this.typeAliases))

{

for (Class<?> typeAlias : this.typeAliases)

{

configuration.getTypeAliasRegistry().registerAlias(typeAlias);

if (this.logger.isDebugEnabled())

{

this.logger.debug("Registered type alias: '" + typeAlias + "'");

}

}

}

if (!isEmpty(this.plugins))

{

for (Interceptor plugin : this.plugins)

{

configuration.addInterceptor(plugin);

if (this.logger.isDebugEnabled())

{

this.logger.debug("Registered plugin: '" + plugin + "'");

}

}

}

if (hasLength(this.typeHandlersPackage))

{

String[] typeHandlersPackageArray = tokenizeToStringArray(this.typeHandlersPackage,

ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS);

for (String packageToScan : typeHandlersPackageArray)

{

configuration.getTypeHandlerRegistry().register(packageToScan);

if (this.logger.isDebugEnabled())

{

this.logger.debug("Scanned package: '" + packageToScan + "' for type handlers");

}

}

}

if (!isEmpty(this.typeHandlers))

{

for (TypeHandler<?> typeHandler : this.typeHandlers)

{

configuration.getTypeHandlerRegistry().register(typeHandler);

if (this.logger.isDebugEnabled())

{

this.logger.debug("Registered type handler: '" + typeHandler + "'");

}

}

}

if (xmlConfigBuilder != null)

{

try

{

xmlConfigBuilder.parse();

if (this.logger.isDebugEnabled())

{

this.logger.debug("Parsed configuration file: '" + this.configLocations + "'");

}

}

catch (Exception ex)

{

throw new NestedIOException("Failed to parse config resource: " +

this.configLocations, ex);

}

finally

{

ErrorContext.instance().reset();

}

}

if (this.transactionFactory == null)

{

this.transactionFactory = new SpringManagedTransactionFactory();

}

Environment environment = new Environment(this.environment, this.transactionFactory,

this.dataSource);

configuration.setEnvironment(environment);

if (this.databaseIdProvider != null)

{

try

{

configuration.setDatabaseId(this.databaseIdProvider.getDatabaseId(this.dataSource));

}

catch (SQLException e)

{

throw new NestedIOException("Failed getting a databaseId", e);

}

}

if (!isEmpty(this.mapperLocations))

{

for (Resource mapperLocation : this.mapperLocations)

{

if (mapperLocation == null)

{

continue;

}

try

{

XMLMapperBuilder xmlMapperBuilder = new XMLMapperBuilder(mapperLocation.getInputStream(),

configuration, mapperLocation.toString(), configuration.getSqlFragments());

xmlMapperBuilder.parse();

}

catch (Exception e)

{

throw new NestedIOException("Failed to parse mapping resource: '" +

mapperLocation + "'", e);

}

finally

{

ErrorContext.instance().reset();

}

if (this.logger.isDebugEnabled())

{

this.logger.debug("Parsed mapper file: '" + mapperLocation + "'");

}

}

}

else

{

if (this.logger.isDebugEnabled())

{

this.logger.debug("Property 'mapperLocations' was not specified or

no matching resources found");

}

}

return this.sqlSessionFactoryBuilder.build(configuration);

}

Android开发问题:Failed to install Hello.apk on device 'emulator-5554!

    R.java消失或解析异常

    自定义title栏

    SQLite isFirst和isBeforeFirst方法的区别

    eclipse删除空行

    getX()和getRawX()的区别

    imagView居中显示问题

    synchronized引发了 java.util.ConcurrentModificationException

    获取随机颜色

    去掉Activity的标题栏,全屏显示

    如何修改应用名称及应用图标

    关于调试方法

    Couldn't read row 0, col -1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.

    android.content.res.Resources.loadXmlResourceParser

    android.content.res.Resources$NotFoundException

    交互性的button定义的方法

    在超级终端中执行程序报错-Permission deny

    从svn导入工程项目有惊叹号

    从svn导入工程项目有惊叹号

    首次进入带有EditText的Activity不自动弹出软键盘,再次点击才弹

    Gallery中OnItemClickListener与OnItemSelectedListener的区别

    Eclipse中签名导出apk崩溃,手动签名

    android.view.InflateException: Binary XML file line #异常的解决

    将assets文件夹中的压缩包拷贝到sdcard中(不限大小)

    判断是否有root权限

    最简单的Root 模拟器的方法

    新版ADT开启eclipse提示 "Running Android Lint" has encountered a problem

    新版ADT开启eclipse提示 cannot open libstdc++.so.6..

    无法升级ADT

1.R.java消失或解析异常

查看res中资源文件,图片,xml等。比如图片文件名不能有大写不能有空格。

搞定错误之后Project->clean就可以了。

2.自定义title栏

首先要z在values->styles中定义一个style,然后在mainfest文件中设置android:theme.

最后在Activity中按照这个顺序写:

super.onCreate(savedInstanceState);

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); 

setContentView(R.layout.activity_main);

getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_layout);

3.SQLite isFirst和isBeforeFirst方法的区别:

看下面一段代码

Cursor c = queryTheCursor(type);

if(c.moveToLast())

while (!c.isBeforeFirst()) {

String tmpContent = new String();

tmpContent = c.getString(c.getColumnIndex("content"));

contents.add(tmpContent);

c.moveToPrevious();

}

c.close();  

代码的作用是逆序输出表中的内容,第三行如果用的是isFirst()的话就无法输出第一行,正确做发是用isBeforeFirst()。

4.eclipse删除空行 

在eclipse中删除某一行就用ctrl+D快捷键。如果你想删除一个文件中的所有空行呢。

可以用下面方法:

1)打开源码编辑器 

2)使用快捷键Ctrl+f 

3)在Find输入框中输入:^s*n 

4)Replace With输入框的值为空 

5)在【Options】选中的"Regular expressions" 

6)点击【Replace All】按钮。 

7)OK!

5.getX()和getRawX()的区别

getX()是表示Widget相对于自身左上角的x坐标

而getRawX()是表示相对于屏幕左上角的x坐标值(注意:这个屏幕左上角是手机屏幕左上角,不管activity是否有titleBar或是否全屏幕),getY(),getRawY()一样的道理 

6.imagView居中显示问题

xml设置如下:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_gravity="center"

android:orientation="vertical" >

<ImageView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/myImageView"

android:layout_gravity="center"

android:scaleType="matrix"

android:src="@drawable/pic" >

</ImageView>

</LinearLayout>

7.synchronized引发了 java.util.ConcurrentModificationException

如果多个线程同时访问一个 ArrayList 实例,而其中至少一个线程从结构上修改了列表,那么它必须 保持外部同步。

解决方法:初始化的时候 将ArrayList改为CopyOnWriteArrayList;

原理:

JAVA中将引用从一个对象移到另外一个对象不需要消耗CPU时间,可以看做是一个原子操作。

JAVA中如果一个对象仍旧存在引用,则不会被CG回收。      

CopyOnWriteArrayList就是根据以上两个特点,在列表有更新时直接将原有的列表复制一份,并再新的列表上进行更新操作,完成后再将引用移到新的列表上。旧列表如果仍在使用中(比如遍历)则继续有效。如此一来就不会出现修改了正在使用的对象的情况(读和写分别发生在两个对象上),同时读操作也不必等待写操作的完成,免去了锁的使用加快了读取速度。

8.获取随机颜色

并不用每次都生成三个随机数,下面两条语句就可以了:

Random myRandom=new Random();

int ranColor = 0xff000000 | mRandom.nextInt(0x00ffffff);

9.去掉Activity的标题栏,全屏显示

在manifest文件中修改对应的Avtivity属性。

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

10.如何修改应用名称及应用图标

修改程序的图标,修改drawable文件夹的i→→c_launcher.png图标,把新的图标改名覆盖就可以了。

如果你要自己的名称,可以修改AndroidManifest.xml的这个节点,application android:icon="@drawable/ic_launcher",不需要加文件扩展名。

即使这么做了,真机调试的时候可能还是会有一些问题,比如图标没办法改变,这个时候就需要在Eclipse中新建一个不同名的项目,然后转移代码(有点小麻烦~_~!)。

11.关于调试方法

调试的时候程序如果出错,一般是查看logcat,看error发生的地方,会提示在程序的第几行,然后去找就可以了。

但有些错误没办法定位,那就把日志输出成txt,然后去google,吧。

12.Couldn't read row 0, col -1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.

错误1:请求的字段在数据库的表中不存在,一般是大小写没写对;

错误2:编程的中途改变表的字段,实际字段并没有改变,解决方法是卸载当前版本,再安装调试。

13.android.content.res.Resources.loadXmlResourceParser

在传递string类做参数的地方传了int形变量。

14.android.content.res.Resources$NotFoundException

出现此类异常时,可以根据 Resource ID到资源类R中找相关的资源。比如0x7f030000,对应的是city_item布局文件,就可以将问题缩小到更小的范围。对于这类运行时找不到资源,但资源又确实存在的问题,可能的编译打包时出现问题,没有将该资源加入。可修改一下该资源,让编译器重新编译。 

还有试一下Project ->Clean一下这个项目 也可以的。

15.交互性的button定义的方法:

首先是准备好按钮不同状态的图片

然后 在res/drawable中定义selector的xml文件

<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android">

<!-- 定义按钮点击时的图片 -->

<item android:drawable="@drawable/addbtn_focus" android:state_pressed="true"/>

<!-- 定义按钮默认的图片 -->

<item android:drawable="@drawable/addbtn_lost"/>

</selector>

最后Button的background属性中设置

<Button

android:id="@+id/btnAdd"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:background="@drawable/addbtn_selector"/>

16.在超级终端中执行程序报错-Permission deny

参照http://android.stackexchange.com/questions/16814/terminal-permission-denied-need-more-info-on-error-message

主要原因是不能在sdcard中执行,直接进入data/目录下面创建文件,然后执行就可以了。

17.从svn导入工程项目有惊叹号

错误提示Archive for required library: 'libs/armeabi/libvudroid.so' in project 'DocumentViewer' cannot be read or is not a valid ZIP file

主要是路径出了问题

解决方法:在project的build-path将外部包(库)的引用删掉就可以了。

18.首次进入带有EditText的Activity不自动弹出软键盘,再次点击才弹出。

只有设置manifest的方法有用,在activity的设置中添加:

[html] view plain copy

android:windowSoftInputMode="adjustPan|stateHidden"

19.Gallery中OnItemClickListener与OnItemSelectedListener的区别

OnItemClickListener:只有单击Gallery中的View才会触发事件,准确的说是当点击之后抬起手的时候触发,滑动不会触发。

OnItemSelectedListener:当Gallery中的View被选中的时候就会触发,Galler初次显示就会触发一次,选中第一个iew,滑动和单击都会触发。

20.从16进制中提取颜色的rgb分量。

主要就是通过位运算来实现。

[java] view plain copy

public class Main {  

public static void main(String[] args) {  

// TODO Auto-generated method stub  

int INK_COLOR = 0xFF11ef23;  

float r = getColorR(INK_COLOR );  

float g = getColorG(INK_COLOR );  

float b = getColorB(INK_COLOR );  

System.out.print(r+" "+g+" "+b);  

}  

public static float getColorR(int c)  

{  

int R = (c & 0x00FF0000 )>>16;  

return (float) (R/255.0);  

}  

public static float getColorG(int c)  

{  

int G =(c & 0x0000FF00 )>>8;  

return (float) (G/255.0);  

}  

public static float getColorB(int c)  

{  

int B = c & 0x000000FF;  

return (float) (B/255.0);  

}  

}  

21. Eclipse中签名导出apk崩溃,手动签名。

工程没问题,调试也没问题,但打包的时候eclipse会崩溃,解决方法是手动打包。

首先去工程目录下的bin文件夹下找到apk文件,解压后删除META-INF文件夹,重新打包成压缩包,改后缀名为.apk

首先是签名(假设你已经在根目录下生产了密钥keystore):

进入java安装目录/bin文件夹下:

[plain] view plain copy

./jarsigner  -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore android.keystore ~/Output.apk android  

然后是优化,进入sdk的tools文件夹下,运行。

[plain] view plain copy

./zipalign -v 4 ~/Output.apk Output_realase.apk  

当前目录下Output_realase.apk就是打包签名好的apk了。

22.android.view.InflateException: Binary XML file line #异常的解决

创建自定义view的时候,碰到 android.view.InflateException: Binary XML file line #异常,反复研究

后发现是缺少一个构造器造成。

[java] view plain copy

public MyView(Context context,AttributeSet paramAttributeSet)  

{  

super(context,paramAttributeSet);  

}  

补齐这个构造器,异常就消失了.

23.将assets文件夹中的压缩包拷贝到sdcard中(不限大小)

[java] view plain copy

public static void copyAssetToSdcard(Context c, String assetFile, String destination) throws IOException {    

InputStream in = c.getAssets().open(assetFile);    

File outFile = new File(destination);  

OutputStream out;    

Log.v("Try", "Try coping.");  

try {  

if (!(new File(destination)).exists()) {  

Log.v("Try", "Not exists..");  

out = new FileOutputStream(outFile);  

copyFile(in, out);  

in.close();  

in = null;  

out.flush();  

out.close();  

out = null;  

}  

} catch (Exception e) {  

Log.v("Error", "Error in if。");  

}  

}    

public static void copyFile(InputStream in, OutputStream out) throws IOException {  

Log.v("Coping", "copyFiling.");  

byte[] buffer = new byte[1024];  

int read;  

while ((read = in.read(buffer)) != -1) {  

Log.v("read:", "" + read);  

out.write(buffer, 0, read);  

}  

}  

24.判断是否有root权限

[java] view plain copy

public static synchronized boolean getRootAhth()  

{  

Process process = null;  

DataOutputStream os = null;  

try  

{  

process = Runtime.getRuntime().exec("su");  

os = new DataOutputStream(process.getOutputStream());  

os.writeBytes("exitn");  

os.flush();  

int exitValue = process.waitFor();  

if (exitValue == 0)  

{  

return true;  

} else  

{  

return false;  

}  

} catch (Exception e)  

{  

Log.d("*** DEBUG ***", "Unexpected error - Here is what I know: "  

+ e.getMessage());  

return false;  

} finally  

{  

try  

{  

if (os != null)  

{  

os.close();  

}  

process.destroy();  

} catch (Exception e)  

{  

e.printStackTrace();  

}  

}  

}  

25.最简单的Root 模拟器的方法

启动一个模拟器,开始-运行-输入cmd,打开dos,依次输入

adb shell

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

cd /system/bin

cat sh > su

chmod 4755 su

su

即可获得root权限

26.新版ADT开启eclipse提示 "Running Android Lint" has encountered a problem

进Eclipse,Window > Preferences > Android > Lint Error Checking, u去掉 "When saving files check for errors"的勾。

27. 新版ADT开启eclipse提示 cannot open libstdc++.so.6..

要安装32位的库。

sudo apt-get install lib32stdc++6

sudo apt-get install lib32z1

28.无法升级ADT

I want to install ADT plugin in Eclipse with Zip file but when i click on next button in first page of install, the progress late long time. I wait around 3hours that i wait for install but now half ADT install :(

In install window, above of progress bar, writes: cannot perform operation.Computing alternate solutions, may take a while: 7/15 .

Why to install ADT needs a long time? Is this no problem or install has a problem?

sorry for my poor english and Thanks for help

由于官方对android开发的ide主推Android Studio,对eclipse也就少了很多,ADT-bundle也停止了更新,所以出现了上面的问题。

解决方法是从Eclipse官网下载最新版本的Eclipse,最新版的ADT插件。

现在高三,在5个月就高考,有关英语提升。

这是高三英语复习的六项任务和四个阶段!

高三一年英语学习的六项具体任务

1. 阅读1000篇文章,约40万单词量。

2. 大小作文写够100篇,约每周两篇。

3. 练听力,总量约合听力试题的120套。

4. 掌握语法和词汇的基础知识。词汇范围按考试说明办。

5. 背诵20篇短文(如新概念第二册)和100个写作句型。

6. 练够综合试题50套。

高三英语复习四个阶段

第一阶段(高二结束后的暑假):7月10日—8月31日

1. 阅读短文(篇幅约400词左右)200篇,其中100篇精读,100篇泛读。

2. 练习听力每天10-20分钟,可听新概念英语第二册,也可听《走遍美国》或China Radio International。

3. 背高考考试大纲上的“词汇表”。背诵《新概念英语》小短文5篇。

4. 练习写小作文10篇,尽量用小词小句子,以记事为主。

5. 此阶段一般不做练习题。

第二阶段(第一学期及寒假):9月1日—2009年2月16日

1. 把高三课本作为练习听说读写的重要材料。课前要预习课文,争取自己看懂每一句。课上要听课文录音,认真回答教师及书后练习上关于课文理解的问题。同时,适当总结语言知识,书后练习有选择地做。

2. 坚持每周阅读10-15篇文章,练习听力1-2小时,小作文2-3篇。

3. 复习语法和初高中课本上的语言点,以记住基本条条为主。

4. 此阶段可做些专项练习。如单选、听力测试、完形填空、阅读理解及书面表达等。如果学生答案正确率接近三分之二,难度就算合适。但不练短文改错,也不宜多做综合试题。

第三阶段(第二学期):2009年2月16日—4月1日

1. 继续坚持听读写练习,直到高考前一天。

2. 重点抓考试大纲所列词汇的复习与总结。

3. 增加改错方面的训练,先单句后短文。

4. 结合自己的弱项,如完形,写作等,多在这方面下一点功夫。

第四阶段:2009年4月1日—6月1日

1. 做综合测试题20套(每周2-3套)。

2. 边做题边总结答题规律和自己出错之处,并努力记住。

3. 综合试题应包括近三年高考试题,对各地自编的模拟试题要有所取舍。越临近高考越不做偏题怪题。

4. 把以前做过的易错的基础题重新汇编,让学生再做一次,以确保中低档题的正确率。

英语是我初高中时候最有把握的一门课,在高手如林的重点高中,英语卷面成绩第一总能帮我拉一拉总分,所以我们先给你讲讲高中英语的学习吧。只要你真的花时间了,肯定可以较快提高。

A.阅读:

坚持每天做阅读理解,做上一两个月,每天都做,每天测时,提高速度和正确率。

那么,我想在这个月内提高英语阅读理解的速度,那么我每天晚上(或者每隔一天晚上,双休日休不休息自己看着办,但是一旦规定下来,坚决执行)做两篇阅读理解,以我现在的水平,应该两篇花个12分钟没有问题,那么我晚上就只给自己20分钟(包括对答案的时间),坚持一两个礼拜,也许发现自己的速度已经稳定在10分钟,然后你找下一个目标,12分钟内做三篇,再坚持一两个礼拜,完成这个目标,再坚持一两个礼拜,可能15-18分钟就可以做五篇了。那么这个时候,即便不练了,基本上你也可以保持这个速度了。

以上讲的是关于阅读速度的问题,那么现在我们来讲提高准确率,针对你说的练习时有很多读不明白的问题,我的猜测是你选用的习题太难了,或者你们现在的作业比较难,暂时不适合你来做。最好是去买一本阶梯式训练(题目一套一套由易到难)的参考书(或者图书馆借就可以了),先用一个礼拜做初级习题,做完以后好好看答案和解释,觉得基本都懂了,这个层次的习题没问题了,那么可以了,再花两个礼拜做中级试题……训练过程中有时候要对题型进行思考,1.据我的经验,英语阅读的很多题目在原文都可以找到答案,然而为什么经常找不到呢?原因在于很多时候选项中会运用同义词、句型转换、叙述人称变换等手段来伪饰,明白了这一点也许你会比较清楚怎么去找这类问题的答案了。2.像“inference”“indicate”这类的题目经常出现在一篇文章的最后一题,多总结几篇,看看他们的正确选项规律如何。3.有一些文章类型比如新闻报道、表格形式、菜单形式的,或许可以直接看题目,但是要注意边角。

(PS:完形填空的训练方法可以参照阅读理解,但是完形填空有所不同的是必定会考一部分关于语法、词性、词语搭配的问题,所以有时候要分析分析不同类型题目的应对策略)

B.听力:

练听力,一个月内,每隔一天听一次,最好是阶梯式训练(题目一套一套由易到难)的那种,先用一个礼拜听初级,听完好好看听力原文,对答案思考,觉得基本上90%到95%都听得懂了,那么可以了,再花两个礼拜听中级试题……

这样的训练方法简单而卓有成效,而且你每天都有事干的。(关键问题在于每天安排20分钟就是20分钟,不要超额支付时间成本,不然你其余的安排乱套了)

C.语法:

语法题不太一样,这个就要靠你们一个一个语法点去攻克了,建议买一本语法书,要知识点简明而全面,不要啰啰嗦嗦讲很多例子的,但是练习题要多一些的。(记得高考前我们一律用一本书《英语语法实践指南》(郭凤高主编),那本书的习题高考前一共做了3遍,后面两遍基本上飞快,整本书就花了六七个小时。结果做单选题训练,20道题目往往两分钟就搞定了,很多题目都是重复的。)

D.作文

初高中的英语作文重在展现你自己的水平:1.语法,尽可能不出现语法错误。2.书写,书写尽量工整,这个一方面能够让老师看得舒服,另一方面也表明了你写作的思路流畅。3.从句、长句、优美的句子、高级词汇的灵活运用。我高二的时候买了一本书《王长喜十句作文法》讲的是关于四六级考试的,应用优美的模板来写作的技巧(说实在的这个有点儿投机取巧,但是应对考试绰绰有余)。我分析了一下平时的考卷,发现作文的题材有六七成都和里面所介绍的五种相关,我就把他里面提供的相同题材的几个不同模板做了一下整理,每种题材整理出一个我自认为最完美的模板(模板中不乏显摆自己高超语法技巧的闪光点)然后每一次考试尽量套上一个适合的模板,结果是十有我的作文会成为范文之一。

【万金油句子举例】

1.___has been brought into focus,and ____ always aroused the greatest concern

2.Among the various reasons contributing to this phonomenon, ____ plays an important part.

3.There is no complete agreement among people as to ____ .Some people take it for granted that _____________ while others hold the opinion that ___________ .

E.背单词

背诵英语单词,我见过很多人很没有效率地背,wonderful,w- o- n- d- e- r- f- u- l,精彩的,(干嘛要一个字母一个字母读出声来呢,字母是最最没有意义的,还要重复好几遍)。我的意见是,只背两遍,第一遍,看这个单词后面的读音,读出声来,然后看一下单词拼写(按照音节一个一个音节记下来)won- der- ful,然后看一遍词性和中文注释。第二遍,这个时候眼睛要离开书本啦,一定要离开,然后想起来那个读音,读一遍,在心里按照音节拼写出来这个单词。如果记住了,赶快继续下一个单词,如果没记住,再看一眼课本的拼写(记住,只给自己一次补充的机会),最多两三遍就能记住一个单词,我的经验是,一个单元有50个单词的话,要花个15分钟来背单词。

另外,要记得复习,关于记忆的问题,复习最重要。可以养成这样一个习惯,比如,我每一周的周六下午(我不知道你们补课不,如果周六补课,周六下午应该是你们过得最轻松的一个时间段)放学后都要好好复习一下这一周的英语单词。

[ 同理,你在复习其他科目时。背诵其他的材料也是如此、、历史、地理,先读一遍或者看一遍,读懂了吗?然后用笔稍微标记一下这段话总共有几个要点1.2.3.4总共四点,OK,离开书本/材料,试着背背看,你背出了1.3,好的,那么再看一遍,背出了1、2、4,怎么这么粗心,3给忘了?最后一次机会!这样子,对自己要求高一点,“只有一次机会!”你会提高不少效率。 ]

高考英语单项填空解题技巧

从历届高考英语试题可以看出,单项填空题的考查内容基本分为五类:基础语法知识;惯用法及搭配;各类词语辨析;交际英语运用;逻辑推理判断。近年来考查较多的有动词(时态、语态、情态动词、动词词组、词语辨析万助动词)、疑问代词、状语从句和情景对话等。

近年来,单项填空的命题日益重视语境创设,突出考查运用能力,由以往的语法知识型向潜隐型和灵活型过渡(设计较为真实的语言情景,综合考查考生在具体语境中灵活运用语言知识的能力),这类试题的增加是高考命题的趋势。运用能力可分为五类:交际英语;语法+语境;语法+上卞丈;语法+比较辨析;纯语法题。前四类所占比例逐渐增加,符合大纲对中学英语教学林淡化语法,重视能力”的要求。

高考英语单项填空的解题技巧主要包括:

一、语义推断法

根据题干所给的信息词或语段的意思推断题干的意思,然后依照句意对未知信息进行逻辑推理。如:Mary wrote an

article on___the team had failed the game.

A. why B. what C. who D. that

由题干所给信息可推知题干的意思是“玛丽写了一篇关干小组为什么没能赢得比赛的文".其中用why引导宾语从句。运用语义推断法解题的关键在于,把题干中的主要信息和选项中所给的词联系起来。

二、注意分离现像

由于句型转换成其仙原因.某个短语或固定搭配中的一寸成分离开原来的位置,导致原结构不易辨认,称为分离现象。如:

In my opinion, it’s the best use that could be made_this

money.

A. with B. for C. of D. from

把先行词use放回空白处之前,再试着把选项中的介词分别放到空白处,很容易发现made use

of这一短语,所以最佳答案为C。

三、克服思维定势

Her sister has become a lawyer,_she wanted to be.

A. who B. that C. what D. which

此题易误选C,考生的思维定势是what she-wanted to

be。实际上,空格处为非性定语从句引导词的选用,which代替上文的a lawyer,正确答案应选D。

四、添加法

在题干或所提供的选项中加人适当成分,重现隐藏的语境,可以使题干内容变得明朗。如:

I arrived late. I_the road to be so icy.

A. wouldn’t expect B.haven’t expected

C. hadn’t expected D. wasn’t expecting

此题考查时态,暗含的语境为“来之前未料到路况那么滑”。解题时不妨加上隐藏语境"before I

arrived",则主句的谓语动词expect应发生在从句(before I

ar-rived)的谓语动词expect应发生在从句(before I

ar-rived)的谓语动词之前,故选C。使用添加法的关键在于找准句的省略信息井补充完整。

五、删除法

在解题过程中,把选项涉及的,只起干扰作用的短语或句子暂时删除,只保留句子主干,对所问部分一目了然,便于做出正确

The day he has been looking forward to_____。

A. coming B. came

C. come . D. comes

此题易误选A。实际上,原句中的he has been looking forward to是定语从句修饰先行词the

day,解题时暂时隐藏,则原句主干简化为"The

day_____”,句子缺少的成分显然是谓语动词,故选D。运用删除法的关键在于迅速找出句子中的冗余信息,如插人语或附加成分。

六、还原法

把可能变换语序或结构的句子再还原回去,就可以清楚地辨明选项内容。女口:Is this factory_you visited

yesterday?

A. one B. the one

C. which D. where

此句还原成陈述句为This factoryis_you visited

yesterday.可以看出,句子的表语是含定语从句的短语,缺少先行词,故选B。谏用这一方法的关键在于正确还原句子结构。

七、分类筛选法

如果四个选项孤立地看都成立,则可用分类筛选法,即利用某一语法规则或句型要求,排除部分错项。如:

——We haven’t heard from Jane for a longtime.

——What do you suppose___to her?

A . was happening B. to happen

C. has’t happened D. having happened

此题首先应找准切入点,从句子结构人手。在"What do you suppose_____to

her?"这一疑问句中,可省略插人语do you

suppose来观察,省略后发现句子缺少谓语,便可排除非谓语形式的B、D两项;根据前一句提供的时态,正确选项只能是C。

八、情景法

对于一些情景交际题,可直接凭语感选出正确答案。如:

——I think you should phone Jenny and-say sorry to her.

——______.It was her fault.

A. No way B. Not possible

C. No chance D. Not at all

此题答语"It was her fault."决定了选A。

九、逻辑推理法

对于非谓语动词的选项,应考虑逻辑主语是该动作的执行者还是承受者,从而决定选用主动形式还是被动形式。如:

The Olympic. Games,______in 766 B.C:,

did not include women players until 1912.

A. first played B. to be first played

C. first playing D. to be first playing:

play的逻辑主语是the Olympic

Games,是动作的承受者而不是执行者,所以首先应考虑用过去分词,然后根据时间状语来确定动词的时态,故选A

十、标点符号法

根据句子中所用标点符号来确定选项。如:

I don’t like him;_,I will say he is honest.

A. but B. so

C: however D: and

解题时首先判断出句子之间为转折点,可排除B、D,根据所用标点,只能用however,故选C。

高考英语阅读理解的解题特点及解题技巧

1. 理解与速度

考生要处理好理解与速度的关系。答题时要力求情绪平稳,不要一味追求速度而影响理解的准确性;不要拘泥于一词一句的理解;不要遇到不懂的地方就反复读,影响阅读速度。比较好的阅读方法是边看边想边理解。遇到生词或看不懂的地方先做个记号,继续看下去,因为一些疑难点往往会在下文中得到解决。

关于阅读速度,难度中等的文章应为每分钟60个单词左右;难度较低、生词不超过总词汇量20%的材料,阅读速度应为每分钟70个单词左右。一般来说,"超纲"而又影响阅读理解的词汇都会用中文标出词义。只有保证了阅读的速度才有可能在规定时间内完成阅读、复读及答题的任务。

2. 阅读训练方式

在训练方式方面要力求多样化。常见的阅读训练方式有:掠读、寻读、精读和泛读等。在掠读、寻读时要掌握查阅的技巧。查阅时考生应迅速找到某一特定信息在短文中的位置,并以这个位置为中心,扩展到上文和下文,寻求正确答案。考生要学会用扫视的方法寻找信息。扫视时,眼睛要纵向而不是横向移动。运用扫视来扩大视觉范围能帮生又快又准确地捕捉到想要查找的信息。

考生应根据阅读目的选择阅读方式,调整阅读速度,合理分配阅读时间。

3. 生词处理

考生在阅读时一定会碰上生词或记不清楚的词汇。遇到这种情况时,考生可以通过上下文猜测词义。具体方法如下:

(1) 根据生词前后词汇的意思或整个句子的意思来猜测生词。例如:

The old man put on his spectacles and began to read.

根据句子后部分began to read可以猜出spectacle的意思为'"眼镜"。

(2)根据语法知识和标点符号来猜测生词。例如:

They will be on the night shift---from midnight to 6 a. m. ---next week.

此句两个破折号之间的部分表明night shift是"夜班"的意思。

(3) 根据说明词义的定语从句来猜测生词。例如:

The type of meter is called multi-meter, which is used to measure electricity.

从上句中的定语从句可以推断出multi-meter是"万能表"的意思。

(4) 根据已知事实细节来猜测生词。例如:

The family had just moved and the young woman was feeling a little melancholy on that Sunday in May. After all, it was Mother's day and 800 miles separated her from her parents in another state far away.

根据上下文的陈述,"刚刚搬家,远离父母,正好是星期天,又是母亲节,而两代人却天各一方"等事实,可以推断出年轻妻子当时忧郁、伤感的心情,并由此猜测出生词melancholy的意思。

(5) 学会只猜测生词的大概意思,而不必追求其准确含义。例如:

The Asian gibbon, like other apes, is especially adapted for life in trees.

在这句话中,考生只要猜出自gibbon是apes (类人猿) 的一种就行了,毋须知道其准确意思。

(6) 运用构词法判断生词的词义,也是提高阅读速度的一种技巧。考生可以通过已知的

词缀(包括前缀和后缀)和词根就能猜测生词的含义。例如,单词telescope由前缀tele (意思是far)和scope (意思是instrument for seeing or observing)构成,整个单词的意思是"望远镜"。为了熟练使用构词法知识猜测生词,考生在平时应多积累词缀以及词根方面的知识。

4. 利用信号词进行预测和推测

在阅读过程中,为了既迅速又准确地理解文章的含义,利用信号词预测非常重要。信号词可以揭示句子内在关系或文章各部分之间的关系(见下表)。特别是在快速阅读时,它能帮生预测文章信息,提高阅读速度。

部分信号词及其所预示的信息

信号词 预示的信息

however, on the contrary, although等 信号词引出的内容是与上文相反的论述,或作者不同的观点

similarly, equally, also, besides, furthermore, in other words等 下文与前面所讲内容相同或相似

for example, for instance等 具体例证,说明上文中的论点

for one thing, on the other hand等 下文还有另外一方面

in a word, in short等 后面的句子是对上文的总结

actually, in fact, the point is …, a study survey found/ showed/proved that …等 后面的句子往往是作者想要表达和强调的内容或观点

此外,在利用信号词进行预测时,考生还需注意以下三点:

(1) 遇到预示前后内容相同或相近,或者补充说明的信号词时,可以适当加快阅读速度,或借此推测生词的词义。

(2) 文中出现的频率较高的实词可以帮生确定文章的主旨大意。

(3) 出现代词I, we, my, our, 转折词but, however, yet,情态动词must, should, ought to, 连词although, though。其后所述内容与刚提到的内容相反,或暗示作者的观点和态度等信号词时,要放慢阅读速度,因为其附近的信息往往是命题和答题的主要线索或依据。

高考英语答题技巧

一、多听老师的,少自作主张;

对于如何备战高考,学校的老师都是非常有经验的,整个的教学进程也经过了精心的安排。因此,跟着老师走,不要留任何疑问是非常必要的。

二、多用碎时间,少搞大突击;

英语学科不同于其他的学科的是,可以随时随地进行复习。因此同学们可以见缝插针地学英语,更可以作为两个学科复习中间的调剂。

三、多接触英语,少钻研语法;

从近年的高考题,我们可以得出结论,英语越来越倾向于能力的考察。因此抽点时间看杂志、小说,听听英语广播,摘抄一些好句子都是提高英语的好办法。

四、多做高考题,少扣模拟题;

高考考察要点比较全面且难度适中。同学们可以把近五年的高考题从头到尾做一下,熟悉高考的思路。由于模拟题有的偏难,同学们可咨询老师,该放弃的就放弃。

五、多攻词汇表,少记课外词;

把主要精力放在高考词汇表中要求会的单词。包括拼写,适当形式变化,词语搭配,词组,一词多义等。学会使用单词是非常重要。不要为盲目地背课外词。

六、多做一般题,少钻研难题;

高考难度适中且注重基础。因此,语法、词法的扎实掌握都是非常必要的。若做到“不求第一次作对,但求第二次不错”就一定能攻克考点。

七、 多阅读完形,少做单选题;

高考非常强调语篇意识,即使是单项选择题,读不懂题干也不可能作对题目。“得阅读者得天下”一句话概括了高考英语取得高分的秘密。

八、多背好用法,少问为什么。

平时在各种阅读中,多多发掘好的用法,摘抄下来。在写作时,若能用上一两个好的词语、好句子,无疑会增色不少。

总而言之,构建知识网络,夯实基础;熟悉各类题型,掌握技巧是高考必胜的法宝。

我能帮你的就是这些了,最主要的还是要看你自己,一定要好好努力,我会很支持你的,加油哦!

把范达因的“推理小说二十条守则” 翻译成英文

"Twenty rules for writing detective stories" (1928)
  (Originally published in the American Magazine (1928-sep),
  and included in the Philo Vance investigates omnibus (1936).

  by S.S. Van Dine
  (pseud. for Willard Huntington Wright)
  THE DETECTIVE story is a kind of intellectual game. It is more — it is a sporting event. And for the writing of detective stories there are very definite laws — unwritten, perhaps, but none the less binding; and every respectable and self-respecting concocter of literary mysteries lives up to them. Herewith, then, is a sort Credo, based partly on the practice of all the great writers of detective stories, and partly on the promptings of the honest author's inner conscience. To wit:

  1. The reader must have equal opportunity with the detective for solving the mystery. All clues must be plainly stated and described.

  2. No willful tricks or deceptions may be placed on the reader other than those played legitimately by the criminal on the detective himself.

  3. There must be no love interest. The business in hand is to bring a criminal to the bar of justice, not to bring a lovelorn couple to the hymeneal altar.

  4. The detective himself, or one of the official investigators, should never turn out to be the culprit. This is bald trickery, on a par with offering some one a bright penny for a five-dollar gold piece. It's false pretenses.

  5. The culprit must be determined by logical dections — not by accident or coincidence or unmotivated confession. To solve a criminal problem in this latter fashion is like sending the reader on a deliberate wild-goose chase, and then telling him, after he has failed, that you had the object of his search up your sleeve all the time. Such an author is no better than a practical joker.

  6. The detective novel must have a detective in it; and a detective is not a detective unless he detects. His function is to gather clues that will eventually lead to the person who did the dirty work in the first chapter; and if the detective does not reach his conclusions through an analysis of those clues, he has no more solved his problem than the schoolboy who gets his answer out of the back of the arithmetic.

  7. There simply must be a corpse in a detective novel, and the deader the corpse the better. No lesser crime than murder will suffice. Three hundred pages is far too much pother for a crime other than murder. After all, the reader's trouble and expenditure of energy must be rewarded.

  8. The problem of the crime must he solved by strictly naturalistic means. Such methods for learning the truth as slate-writing, ouija-boards, mind-reading, spiritualistic se'ances, crystal-gazing, and the like, are taboo. A reader has a chance when matching his wits with a rationalistic detective, but if he must compete with the world of spirits and go chasing about the fourth dimension of metaphysics, he is defeated ab initio.

  9. There must be but one detective — that is, but one protagonist of dection — one deus ex machina. To bring the minds of three or four, or sometimes a gang of detectives to bear on a problem, is not only to disperse the interest and break the direct thread of logic, but to take an unfair advantage of the reader. If there is more than one detective the reader doesn't know who his codector is. It's like making the reader run a race with a relay team.

  10. The culprit must turn out to be a person who has played a more or less prominent part in the story — that is, a person with whom the reader is familiar and in whom he takes an interest.

  11. A servant must not be chosen by the author as the culprit. This is begging a noble question. It is a too easy solution. The culprit must be a decidedly worth-while person — one that wouldn't ordinarily come under suspicion.

  12. There must be but one culprit, no matter how many murders are committed. The culprit may, of course, have a minor helper or co-plotter; but the entire onus must rest on one pair of shoulders: the entire indignation of the reader must be permitted to concentrate on a single black nature.

  13. Secret societies, camorras, mafias, et al., have no place in a detective story. A fascinating and truly beautiful murder is irremediably spoiled by any such wholesale culpability. To be sure, the murderer in a detective novel should be given a sporting chance; but it is going too far to grant him a secret society to fall back on. No high-class, self-respecting murderer would want such odds.

  14. The method of murder, and the means of detecting it, must be be rational and scientific. That is to say, pseudo-science and purely imaginative and speculative devices are not to be tolerated in the roman policier. Once an author soars into the realm of fantasy, in the Jules Verne manner, he is outside the bounds of detective fiction, cavorting in the uncharted reaches of adventure.

  15. The truth of the problem must at all times be apparent — provided the reader is shrewd enough to see it. By this I mean that if the reader, after learning the explanation for the crime, should reread the book, he would see that the solution had, in a sense, been staring him in the face-that all the clues really pointed to the culprit — and that, if he had been as clever as the detective, he could have solved the mystery himself without going on to the final chapter. That the clever reader does often thus solve the problem goes without saying.

  16. A detective novel should contain no long descriptive passages, no literary dallying with side-issues, no subtly worked-out character analyses, no "atmospheric" preoccupations. such matters have no vital place in a record of crime and dection. They hold up the action and introce issues irrelevant to the main purpose, which is to state a problem, analyze it, and bring it to a successful conclusion. To be sure, there must be a sufficient descriptiveness and character delineation to give the novel verisimilitude.

  17. A professional criminal must never be shouldered with the guilt of a crime in a detective story. Crimes by housebreakers and bandits are the province of the police departments — not of authors and brilliant amateur detectives. A really fascinating crime is one committed by a pillar of a church, or a spinster noted for her charities.

  18. A crime in a detective story must never turn out to be an accident or a suicide. To end an odyssey of sleuthing with such an anti-climax is to hoodwink the trusting and kind-hearted reader.

  19. The motives for all crimes in detective stories should be personal. International plottings and war politics belong in a different category of fiction — in secret-service tales, for instance. But a murder story must be kept gemütlich, so to speak. It must reflect the reader's everyday experiences, and give him a certain outlet for his own repressed desires and emotions.

  20. And (to give my Credo an even score of items) I herewith list a few of the devices which no self-respecting detective story writer will now avail himself of. They have been employed too often, and are familiar to all true lovers of literary crime. To use them is a confession of the author's ineptitude and lack of originality. (a) Determining the identity of the culprit by comparing the butt of a cigarette left at the scene of the crime with the brand smoked by a suspect. (b) The bogus spiritualistic se'ance to frighten the culprit into giving himself away. (c) Forged fingerprints. (d) The mmy-figure alibi. (e) The dog that does not bark and thereby reveals the fact that the intruder is familiar. (f)The final pinning of the crime on a twin, or a relative who looks exactly like the suspected, but innocent, person. (g) The hypodermic syringe and the knockout drops. (h) The commission of the murder in a locked room after the police have actually broken in. (i) The word association test for guilt. (j) The cipher, or code letter, which is eventually unraveled by the sleuth.

参考资料:http://blog.sina.com.cn/s/blog_49e0c0e6010084uw.html

把范达因的“推理小说二十条守则” 翻译成英文

"Twenty rules for writing detective stories" (1928)
  (Originally published in the American Magazine (1928-sep),
  and included in the Philo Vance investigates omnibus (1936).

  by S.S. Van Dine
  (pseud. for Willard Huntington Wright)
  THE DETECTIVE story is a kind of intellectual game. It is more — it is a sporting event. And for the writing of detective stories there are very definite laws — unwritten, perhaps, but none the less binding; and every respectable and self-respecting concocter of literary mysteries lives up to them. Herewith, then, is a sort Credo, based partly on the practice of all the great writers of detective stories, and partly on the promptings of the honest author's inner conscience. To wit:

  1. The reader must have equal opportunity with the detective for solving the mystery. All clues must be plainly stated and described.

  2. No willful tricks or deceptions may be placed on the reader other than those played legitimately by the criminal on the detective himself.

  3. There must be no love interest. The business in hand is to bring a criminal to the bar of justice, not to bring a lovelorn couple to the hymeneal altar.

  4. The detective himself, or one of the official investigators, should never turn out to be the culprit. This is bald trickery, on a par with offering some one a bright penny for a five-dollar gold piece. It's false pretenses.

  5. The culprit must be determined by logical dections — not by accident or coincidence or unmotivated confession. To solve a criminal problem in this latter fashion is like sending the reader on a deliberate wild-goose chase, and then telling him, after he has failed, that you had the object of his search up your sleeve all the time. Such an author is no better than a practical joker.

  6. The detective novel must have a detective in it; and a detective is not a detective unless he detects. His function is to gather clues that will eventually lead to the person who did the dirty work in the first chapter; and if the detective does not reach his conclusions through an analysis of those clues, he has no more solved his problem than the schoolboy who gets his answer out of the back of the arithmetic.

  7. There simply must be a corpse in a detective novel, and the deader the corpse the better. No lesser crime than murder will suffice. Three hundred pages is far too much pother for a crime other than murder. After all, the reader's trouble and expenditure of energy must be rewarded.

  8. The problem of the crime must he solved by strictly naturalistic means. Such methods for learning the truth as slate-writing, ouija-boards, mind-reading, spiritualistic se'ances, crystal-gazing, and the like, are taboo. A reader has a chance when matching his wits with a rationalistic detective, but if he must compete with the world of spirits and go chasing about the fourth dimension of metaphysics, he is defeated ab initio.

  9. There must be but one detective — that is, but one protagonist of dection — one deus ex machina. To bring the minds of three or four, or sometimes a gang of detectives to bear on a problem, is not only to disperse the interest and break the direct thread of logic, but to take an unfair advantage of the reader. If there is more than one detective the reader doesn't know who his codector is. It's like making the reader run a race with a relay team.

  10. The culprit must turn out to be a person who has played a more or less prominent part in the story — that is, a person with whom the reader is familiar and in whom he takes an interest.

  11. A servant must not be chosen by the author as the culprit. This is begging a noble question. It is a too easy solution. The culprit must be a decidedly worth-while person — one that wouldn't ordinarily come under suspicion.

  12. There must be but one culprit, no matter how many murders are committed. The culprit may, of course, have a minor helper or co-plotter; but the entire onus must rest on one pair of shoulders: the entire indignation of the reader must be permitted to concentrate on a single black nature.

  13. Secret societies, camorras, mafias, et al., have no place in a detective story. A fascinating and truly beautiful murder is irremediably spoiled by any such wholesale culpability. To be sure, the murderer in a detective novel should be given a sporting chance; but it is going too far to grant him a secret society to fall back on. No high-class, self-respecting murderer would want such odds.

  14. The method of murder, and the means of detecting it, must be be rational and scientific. That is to say, pseudo-science and purely imaginative and speculative devices are not to be tolerated in the roman policier. Once an author soars into the realm of fantasy, in the Jules Verne manner, he is outside the bounds of detective fiction, cavorting in the uncharted reaches of adventure.

  15. The truth of the problem must at all times be apparent — provided the reader is shrewd enough to see it. By this I mean that if the reader, after learning the explanation for the crime, should reread the book, he would see that the solution had, in a sense, been staring him in the face-that all the clues really pointed to the culprit — and that, if he had been as clever as the detective, he could have solved the mystery himself without going on to the final chapter. That the clever reader does often thus solve the problem goes without saying.

  16. A detective novel should contain no long descriptive passages, no literary dallying with side-issues, no subtly worked-out character analyses, no "atmospheric" preoccupations. such matters have no vital place in a record of crime and dection. They hold up the action and introce issues irrelevant to the main purpose, which is to state a problem, analyze it, and bring it to a successful conclusion. To be sure, there must be a sufficient descriptiveness and character delineation to give the novel verisimilitude.

  17. A professional criminal must never be shouldered with the guilt of a crime in a detective story. Crimes by housebreakers and bandits are the province of the police departments — not of authors and brilliant amateur detectives. A really fascinating crime is one committed by a pillar of a church, or a spinster noted for her charities.

  18. A crime in a detective story must never turn out to be an accident or a suicide. To end an odyssey of sleuthing with such an anti-climax is to hoodwink the trusting and kind-hearted reader.

  19. The motives for all crimes in detective stories should be personal. International plottings and war politics belong in a different category of fiction — in secret-service tales, for instance. But a murder story must be kept gemütlich, so to speak. It must reflect the reader's everyday experiences, and give him a certain outlet for his own repressed desires and emotions.

  20. And (to give my Credo an even score of items) I herewith list a few of the devices which no self-respecting detective story writer will now avail himself of. They have been employed too often, and are familiar to all true lovers of literary crime. To use them is a confession of the author's ineptitude and lack of originality. (a) Determining the identity of the culprit by comparing the butt of a cigarette left at the scene of the crime with the brand smoked by a suspect. (b) The bogus spiritualistic se'ance to frighten the culprit into giving himself away. (c) Forged fingerprints. (d) The mmy-figure alibi. (e) The dog that does not bark and thereby reveals the fact that the intruder is familiar. (f)The final pinning of the crime on a twin, or a relative who looks exactly like the suspected, but innocent, person. (g) The hypodermic syringe and the knockout drops. (h) The commission of the murder in a locked room after the police have actually broken in. (i) The word association test for guilt. (j) The cipher, or code letter, which is eventually unraveled by the sleuth.

参考资料:http://blog.sina.com.cn/s/blog_49e0c0e6010084uw.html

Top