亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? owens.txt

?? 用C++編的小程序。
?? TXT
字號:
The SQLite Database Engine
by Michael Owens

Listing 1: VDBE Program for a Simple Query

SQLite version 2.8.0
Enter ".help" for instructions

sqlite> explain select projectname_short from project
   ...> order by rating desc limit 10;
0          ColumnName   0          0        projectname_short
1          Integer      -10        0
2          MemStore     0          1
3          Integer      0          0
4          OpenRead     0          3        project
5          VerifyCook   0          1476
6          Rewind       0          13
7          Column       0          3
8          SortMakeRe   1          0
9          Column       0          11
10         SortMakeKe   1          0 
11         SortPut      0          0
12         Next         0          7
13         Close        0          0
14         Sort         0          0
15         SortNext     0          19
16         MemIncr      0          19
17         SortCallba   1          0
18         Goto         0          15
19         SortReset    0          0
20         Halt         0          0


Listing 2: C API example

#include <stdlib.h>
#include <stdio.h>
#include <sqlite.h>
typedef struct sqlite_vm sqlite_vm;
int main()
{
   const char* db_name = "db";
   sqlite *db; /* The database handle */
   char *sql = "select projectname_full as name, rating, license "
               "from project order by rating desc limit 10";
   const char *tail; /* Points to next SQL statement to process, if any. */
   char *err_msg; /* Last error message, if any. */

   sqlite_vm *pvm; /* Virtual machine for executing query. */
   db = sqlite_open(db_name, 0, &err_msg);
   if(db==0)
   {
      fprintf(stderr, "Can't open database: %s\n", err_msg);
      exit(1);
   }
   /* Compile SQL, allocate a virtual machine for processing. */
   int ret = sqlite_compile(db,sql,&tail,&pvm,&err_msg);
   if(ret != SQLITE_OK)
   {
      fprintf(stderr, "Compile failed: %s\n", err_msg);
      sqlite_freemem(err_msg);
      exit(1);
   }
   int i, ncols;
   const char** fields;
   const char** col_defs;
   ret = sqlite_step(pvm, &ncols, &fields, &col_defs);
   /* Print Column Names */
   printf("%35s %5s %40s\n\n", col_defs[0], col_defs[1], col_defs[2]);
   /* Print Column Datatypes */
   printf("%35s %5s %40s\n\n", col_defs[3], col_defs[4], col_defs[5]);
   /* Print Result Set */
   while(ret == SQLITE_ROW)
   {
      printf("%35s %5s %40s\n", fields[0], fields[1], fields[2]);
      ret = sqlite_step(pvm, &ncols, &fields, &col_defs);
   }
   ret = sqlite_finalize(pvm, &err_msg);
   if(ret != SQLITE_OK)
   {
      fprintf(stderr, "Finalize failed: %s\n", err_msg);
      sqlite_freemem(err_msg);
      exit(1);
   }
   sqlite_close(db);
}

Listing 3: Creating A Custom Function

void normal_curve_area(sqlite_func* context, int argc, const char **argv)
{
   char** endptr;
   char result[65];
   double x1, x2, mu, sigma;
   if(argc != 4)
   {
      return;
   }
   x1 = strtod((char*)argv[0], endptr);
   if((x1==0) && (argv[0]==*endptr))
      return;
   x2 = strtod((char*)argv[1], endptr);
   if((x2==0) && (argv[1]==*endptr))

      return;
   mu = strtod((char*)argv[2], endptr);
   if((x1==0) && (argv[2]==*endptr))
      return;
   sigma = strtod((char*)argv[3], endptr);
   if((x1==0) && (argv[3]==*endptr))
      return;
   sprintf(result, "%f", GetNormalCurveArea(x1,x2,mu,sigma));
   sqlite_set_result_string(context, result, -1);
}
double GetNormalCurveArea(double x1, double x2, double mu, double sigma)
{
   /* Maclaurin Series Expansion for exp(-x2/2)
   Michael Owens
   Description: This function takes two random variables, a lower 
   limit (x1) and an upper limit (x2), on a Gaussian distribution and 
   computes the total area between them.
   User Input Parameters: 
   x2: upper limit
   x1: lower limit
   mu: population mean
   sigma: variance
   Nomenclature:
   sz: dummy variable for series expansion
   z = (x-mu)/sig
   cum: the cumulative value of z, or integral
   cum1 is the area from -r1 to 0 while
   cum2 is the area from 0 to r2.
   Limitations:
   The Limiting Values of z: A value greater than z=5 will give exactly 50% of
   the normal curve to four decimal places, and larger values will only
   encumber series convergence, therefore any values greater than 4 will be
   reset to 4.
   */
   double j = 10; // Initialized for priming the while() block.
   double bound = 4.2;
   double z1 = (x1 - mu) / sigma;
   double z2 = (x2 - mu) / sigma;
   if (z1 < -bound)
      z1 = (double)-bound;
   if (z1 > bound)
      z1 = (double)bound;
   if (z2 < -bound)
      z2 = (double)-bound;
   if (z2 > bound)
      z2 = (double)bound;
   double cum1 = fabs(z1);
   double cum2 = fabs(z2);
   // Use absolute values for computing terms
   x1 = fabs(z1);
   x2 = fabs(z2);
   // Computations
   // Maclaurin Series: term by term addition
   // Area of lower limit
   if(cum1)

      SeriesExpansion(x1,cum1);
   else
      cum1 = 0;
   // Area of upper limit
   if(cum2)
      SeriesExpansion(x2,cum2);
   else
      cum2 = 0;
   // Determine the total area:
   double Area;
   if ((z2 + z2) < (fabs(z2 + z2))) // if z2 is negative
      Area = cum1 - cum2; // then z1 must be negative too.
   else
      if ((z1 + z1) < (fabs(z1 + z1))) // z2 is positve and if z1 negative
         Area = cum1 + cum2;
      else
         Area = fabs(cum2 - cum1); // if z1 is positive
   // Limiting area from origin to +infinity
   double CA;
   CA = pow(2*3.1415926535, 0.5);
   // Normalized area
   Area = Area/CA; // Area from origin to lower limit.
   return Area;
}
short SeriesExpansion(double &x, double &cum)
{
   double SeriesTerm;
   double j = 10;
   for (int i = 1; j > 0.0001; i++)
   {
      int f = i;
      double factorial = f;
      if(f-1)
      {
      while(f-1)
         factorial *= --f;
      }
      if(!factorial)
      return 0;
      SeriesTerm = (pow(-1,i));
      SeriesTerm *= (double)1/((2*i)+1);
      SeriesTerm *= (double)pow(x,(2*i+1));
      SeriesTerm *= (double)1/((pow(2,i)*factorial));
      cum += SeriesTerm;
      j = fabs(SeriesTerm);
   }
   return 1;
}


Listing 4: Using A Custom Function

int main(int argc, char **argv)
{
   sqlite *db;

   const char *tail;
   sqlite_vm *pvm;
   char *err_msg;
   int ncols;
   const char** fields;
   const char** col_defs;
   db = sqlite_open("db", 0, &err_msg);
   sqlite_create_function(db, "normal_curve_area", 4, normal_curve_area, NULL);
   const char* sql = "select normal_curve_area(-2.35, 2.35, 0, 1)";
   sqlite_compile(db, sql, &tail, &pvm, &err_msg);
   sqlite_step(pvm, &ncols, &fields, &col_defs);
   printf("Area=%s\n", fields[0]);
   sqlite_finalize(pvm, &err_msg);
   sqlite_close(db);
   return 0;
}


Listing 5: Controlling Conflict Resolution

SQLite version 2.8.2
Enter ".help" for instructions
sqlite> -- Create table;
sqlite> create table emp(name text UNIQUE ON CONFLICT ROLLBACK);
sqlite> -- Populate;
sqlite> insert into emp values('Larry');
sqlite> insert into emp values('Moe');
sqlite> insert into emp values('Curly');
sqlite> -- generate a UNIQUE constraint violation;
sqlite> insert into emp values('Curly');
SQL error: uniqueness constraint failed
sqlite> -- try to commit, won't work as previous resolution rolled back transaction.
sqlite> commit;
SQL error: cannot commit - no transaction is active
sqlite> -- Set REPLACE at transaction scope.
sqlite> begin on conflict replace;
sqlite> -- try again: this time it will work
sqlite> insert into emp values('Curly');
sqlite> commit;
sqlite> -- Play around with statement level resolution;
sqlite> begin on conflict replace;
sqlite> -- ABORT will stop us, but leave transaction running.
sqlite> insert or ABORT into emp values('Curly');
SQL error: uniqueness constraint failed
sqlite> -- FAIL will stop us, but leave transaction running.
sqlite> insert or FAIL into emp values('Curly');
SQL error: uniqueness constraint failed
sqlite> -- IGNORE will silently fail, but leave transaction running.
sqlite> insert or IGNORE into emp values('Curly');
sqlite> -- default transaction scope is REPLACE, will push it through.
sqlite> insert into emp values('Curly');
sqlite> commit;
sqlite>



Listing 6: Trigger Examples

-- Log deleted projects
CREATE TRIGGER on_delete_proj BEFORE DELETE ON project
FOR EACH ROW
BEGIN
   insert into removed values(old.project_id,old.projectname_full);
END
-- Track version changes. Set conflict to overwrite matching records.
CREATE TRIGGER on_update_proj BEFORE UPDATE OF latest_version ON project
FOR EACH ROW
BEGIN
   insert OR REPLACE into versions
   values( new.project_id, old.latest_version, new.latest_version )
END


Listing 7: Views with Triggers

CREATE VIEW above_average AS SELECT projectname_full, rating
FROM project
WHERE rating > (SELECT AVG(rating) FROM project)
ORDER BY rating DESC;
-- Make the view updatable according to following trigger
CREATE TRIGGER on_update_above_average
INSTEAD OF UPDATE ON above_average
FOR EACH ROW
BEGIN
   UPDATE project SET rating=new.rating
   WHERE projectname_full=new.projectname_full;
END
-- Now the following update to the view will work:
UPDATE above_average SET rating=10 WHERE projectname_full='Gentoo Linux';


Listing 8: SQLite from Perl

use DBI;
my $dbh = DBI->connect("dbi:SQLite:dbname=db","","");
my $cursor;
my @rec;
my $SQL = "select projectname_full as name, rating "
           . "from project order by rating desc";
$cursor = $dbh->prepare($SQL);
$cursor->execute();
while(@rec = $cursor->fetchrow_array)
{
   print "$rec[0], $rec[1]\n";
}
$cursor->finish;
$dbh->disconnect;


Listing 9: SQLite from Python
import sqlite

conn = sqlite.connect(db="db", mode=077)
cursor = conn.cursor()
SQL = """select projectname_full as name,
         rating from project
         order by rating desc"""
cursor.execute(SQL)
row = cursor.fetchone()
while row != None:
   print "%14s, %15s" % (row['name'], row['rating'])
   row = cursor.fetchone()
conn.close()





4


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品一区国产麻豆| 国产老肥熟一区二区三区| 在线免费亚洲电影| 亚洲男人的天堂在线aⅴ视频| 97超碰欧美中文字幕| 亚洲天堂av一区| 欧美午夜电影网| 丝袜美腿亚洲一区二区图片| 欧美一级国产精品| 国产麻豆精品95视频| 国产精品亲子乱子伦xxxx裸| 一本大道久久a久久精二百| 亚洲午夜激情av| 日韩欧美在线1卡| 高清在线不卡av| 一区二区三区电影在线播| 欧美精品在欧美一区二区少妇| 日韩电影在线免费观看| 久久一区二区视频| 91一区二区在线观看| 天天综合网 天天综合色| 精品国产乱码久久久久久蜜臀| 国产电影一区在线| 亚洲国产cao| 久久久久久久一区| 欧美在线免费视屏| 激情久久五月天| 日韩毛片一二三区| 91精品国产一区二区| 国产风韵犹存在线视精品| 一区二区三区高清不卡| 亚洲精品一区二区三区蜜桃下载| 懂色av一区二区在线播放| 亚洲成a人v欧美综合天堂| 久久久久亚洲蜜桃| 欧美丝袜自拍制服另类| 国产一区二区h| 亚洲一区二区在线免费看| 久久久精品2019中文字幕之3| 日本韩国一区二区三区| 国产一区二区不卡在线| 亚瑟在线精品视频| 国产精品美女久久久久aⅴ| 6080午夜不卡| 色综合久久综合网欧美综合网| 日韩成人午夜精品| 亚洲视频1区2区| 久久精品在线观看| 日韩写真欧美这视频| 欧美性生交片4| 99国产欧美另类久久久精品| 精品一区二区三区免费播放| 亚洲国产日韩精品| 亚洲天堂网中文字| 国产日本一区二区| 日韩三级.com| 欧美色综合影院| 91丨九色丨尤物| 风间由美一区二区av101| 精品一区二区三区免费观看| 婷婷开心久久网| 一个色妞综合视频在线观看| 国产精品久久久久久久浪潮网站| 欧美videofree性高清杂交| 精品视频一区 二区 三区| 色综合婷婷久久| 丁香桃色午夜亚洲一区二区三区| 久久99国产精品尤物| 免费xxxx性欧美18vr| 肉色丝袜一区二区| 亚洲亚洲人成综合网络| 亚洲精选视频在线| 亚洲精品久久久久久国产精华液 | 色综合婷婷久久| 成人免费视频一区| 成人a级免费电影| 国产99久久久国产精品潘金网站| 国内一区二区在线| 精品在线播放午夜| 麻豆精品视频在线观看免费| 蜜桃在线一区二区三区| 日本亚洲欧美天堂免费| 欧美a一区二区| 久久国产乱子精品免费女| 乱中年女人伦av一区二区| 久久av资源网| 国产91丝袜在线播放九色| 国产精品一级在线| 成人成人成人在线视频| kk眼镜猥琐国模调教系列一区二区| 国产成人夜色高潮福利影视| 国产精华液一区二区三区| 成人av网址在线观看| 91免费观看在线| 欧美久久久久久久久久| 欧美xxxxxxxx| 欧美国产乱子伦| 一区二区三区在线影院| 午夜精品福利一区二区三区av| 毛片不卡一区二区| 国产剧情一区在线| 成人免费观看视频| 91久久精品一区二区| 91精品免费在线| 国产亚洲欧美在线| 亚洲专区一二三| 美女精品一区二区| 丁香激情综合国产| 在线免费亚洲电影| 精品国产乱码久久久久久蜜臀 | 亚洲高清三级视频| 九九热在线视频观看这里只有精品| 国产精品系列在线播放| 日本精品一级二级| 欧美精品一区二区三区在线播放| 亚洲欧洲一区二区在线播放| 首页国产欧美久久| 丁香激情综合国产| 欧美蜜桃一区二区三区| 国产人妖乱国产精品人妖| 一区二区三区精品在线观看| 极品美女销魂一区二区三区 | 日日欢夜夜爽一区| 国产成人亚洲精品青草天美| 欧美三级资源在线| 欧美激情一区在线观看| 天堂va蜜桃一区二区三区漫画版| 丁香啪啪综合成人亚洲小说 | 日韩一级完整毛片| 亚洲另类在线视频| 国产一区不卡在线| 欧美日韩国产一区二区三区地区| 欧美精彩视频一区二区三区| 午夜电影网一区| 99re在线精品| 久久精品在线观看| 日韩精品国产欧美| 色婷婷亚洲一区二区三区| 国产亚洲人成网站| 理论片日本一区| 欧洲一区在线电影| 中文字幕亚洲一区二区av在线| 蜜臀久久99精品久久久久久9| 91成人免费在线视频| 国产精品网友自拍| 捆绑变态av一区二区三区| 欧美性大战久久久久久久| 成人免费在线视频| 国产激情一区二区三区| 欧美成人video| 日韩国产在线一| 一本久久精品一区二区| 国产精品免费视频一区| 国产麻豆精品在线| 精品国产亚洲一区二区三区在线观看| 亚洲一二三级电影| 欧美亚洲综合色| 一区二区三区.www| 91麻豆swag| 亚洲精品综合在线| 一本色道**综合亚洲精品蜜桃冫| 久久精品人人爽人人爽| 国产综合久久久久影院| 日韩一二三区不卡| 乱一区二区av| 精品精品欲导航| 狠狠色丁香婷婷综合| 精品国产一区二区三区不卡| 精品一区二区三区免费播放| 日韩精品一区二区三区视频| 奇米色777欧美一区二区| 91麻豆精品国产无毒不卡在线观看| 亚洲大片在线观看| 欧美精品少妇一区二区三区| 亚洲一本大道在线| 欧美精品第1页| 奇米影视一区二区三区| 欧美精品一区二区高清在线观看| 九九九精品视频| 欧美国产精品中文字幕| eeuss国产一区二区三区| 日韩一区日韩二区| 精品视频1区2区3区| 亚洲第一在线综合网站| 56国语精品自产拍在线观看| 日韩av午夜在线观看| 26uuu精品一区二区在线观看| 国产一区免费电影| 国产精品久久影院| 色婷婷精品久久二区二区蜜臀av| 亚洲成a人v欧美综合天堂下载| 欧美一区二区在线视频| 久久国内精品视频| 中文字幕在线不卡一区二区三区| 97久久精品人人澡人人爽| 亚洲午夜免费福利视频| 精品国产乱码久久久久久老虎| 丁香一区二区三区| 亚洲成人在线免费| 久久美女高清视频|