----赖格英-----

记忆不好了,记录工作中的点点滴滴....

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

01 2014 档案

摘要:第一章 初始化OpenGL 无论是什么东西,要使用它,就必须对它进行初始化。如果你之前使用过GDI,你应该也多多少少了解到GDI在绘制图形之前要为之创建渲染环境。OpenGL也一样。本章给出的代码,大家可以不必理解其中的具体意义,反正以后每次初始化是使用这个代码即可。 首先,在一个新的应用程序中,我们需要添加对OpenGL库的引用。Delphi已经为我们写好了OpenGL的头文件,因此我们只须直接在单元的uses中添加OpenGL即可: ... uses Windows, Graphics, OpenGL, ... ... 在创建窗口时,应添加如下代码:procedure Form1.Crea 阅读全文
posted @ 2014-01-28 23:04 向北方 阅读(10903) 评论(0) 推荐(0) 编辑

摘要:前言 在开发了许多2D图形程序之后,许多人开始对3D图形编程产生了兴趣。学习一套3D API,是进行3D图形编程的基础。在有趣的3D图形编程中,3D API只不过充当着一种低级的工具而已。因此,在这里我要提醒想学习3D API的朋友,无论你将要使用DirectX,或者跟我一样使用OpenGL,都不要把它们看得过于神圣。事实上它们只是一套API,学习它,你只须一定的Windows编程基础即可。它们不需要你有多么高深的数学功底,也不需要什么灵活的头脑——如果你只是想用OpenGL渲染3D图形的话,就不需要什么特别的知识。因为无论是DirectX还是OpenGL,都只是在帮你画画而已。 我的这套教程 阅读全文
posted @ 2014-01-28 23:02 向北方 阅读(3164) 评论(0) 推荐(1) 编辑

摘要:unit Unit1;interfaceuses OpenGL,Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls;type TForm1 = class(TForm) Timer1: TTimer; procedure FormCreate(Sender: TObject); procedure FormPaint(Sender: TObject); procedure Timer1Timer(Sender: TObject); ... 阅读全文
posted @ 2014-01-28 22:59 向北方 阅读(2247) 评论(0) 推荐(0) 编辑

摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;type TMyR... 阅读全文
posted @ 2014-01-23 23:00 向北方 阅读(2926) 评论(0) 推荐(0) 编辑

摘要:unit Form_MainU;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,MapWinGIS_TLB, DB, Grids, DBGrids, DBTables, OleCtrls, ComCtrls, StdCtrls ;type TForm1 = class(TForm) Button1: TButton; PageControl1: TPageControl; TabSheet1: TTabSheet; T... 阅读全文
posted @ 2014-01-20 22:52 向北方 阅读(891) 评论(0) 推荐(0) 编辑

摘要:program main !sms网格转换成mike21网格 DIMENSION X(60000),Y(60000),H(60000),NDNN(110000,3),ncbd(10000) dimension NBS(50),NOBD(5000,50),NSED(5000,50),id0(80000),nbi(50) dimension x0(50000),y0(50000),h0(50000) character*2 a*2,b*2,gnn*3,demo*500 open(3,file='./2013.8.30(after).grd',status='o... 阅读全文
posted @ 2014-01-20 11:44 向北方 阅读(1096) 评论(0) 推荐(1) 编辑

摘要:subroutine basis_function_b_val ( tdata, tval, yval )!!*******************************************************************************!!! BASIS_FUNCTION_B_VAL evaluates the B spline basis function.!!! Discussion:!! The B spline basis function is a piecewise cubic which! has the properties tha... 阅读全文
posted @ 2014-01-20 11:34 向北方 阅读(1367) 评论(0) 推荐(0) 编辑

摘要:unit Unit3;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids, Vcl.DBGrids, Data.DB, Vcl.OleCtrls, MapWinGIS_TLB, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.OleServer, Bde.DBTables;type TForm3 = cla... 阅读全文
posted @ 2014-01-19 23:07 向北方 阅读(1922) 评论(0) 推荐(0) 编辑

摘要:虽然版本号升的不大,但这也是一个重要的版本。作者发现了一个长期存在的bug,就是建立一个线程,如果不指定线程的优先级则默认设置为idle。(正确的应是Normal)看一下具体的改动情况:新功能:Added SetPriority function to the IOmniTaskConfig.Added indexed writers ([number] and [name]) to both TOmniValue and TOmniValueContainer. Bug修正:如果不指定线程优先级默认设置为Normal.Corrected swapped content of 'Sch 阅读全文
posted @ 2014-01-18 16:53 向北方 阅读(678) 评论(0) 推荐(0) 编辑

摘要:interfaceuses Classes, SysUtils;type TParallelProc = reference to procedure(i: Integer; ThreadID: Integer); TParallel = class(TThread) private FProc: TParallelProc; FThreadID: Integer; //current thread ID protected procedure Execute; override; function GetNextValue: Integer; public... 阅读全文
posted @ 2014-01-18 15:52 向北方 阅读(1262) 评论(0) 推荐(0) 编辑

摘要:有如下循环体:hits:=0;for I:=0 to NumberOfIterations-1 dobegin {perform some calculations dependent on random number generation to determine a value x} if x>0 then hits:=hits+1;end;{For Loop}FailureProbability:=hits/NumberOfIterations;如果迭代次数非常大,如何用并行方法完成?答案如下:program loop;{$APPTYPE CONSOLE}const ... 阅读全文
posted @ 2014-01-17 22:19 向北方 阅读(1255) 评论(0) 推荐(0) 编辑

摘要:1) 删除文件: C:\documents and settings\\.borland\registry.slm,如果在win8或在win7下,即C:\Users\HiWin8\.borland2)运行 c:\program files\borland\delphi7\bin\D7Reg.exe3) 一路单击下一步即可...4)打开 Delphi7 阅读全文
posted @ 2014-01-17 12:08 向北方 阅读(5568) 评论(0) 推荐(1) 编辑

摘要:SetLength(glb_IndexConfig,0);FreeAndNil(glb_IndexConfig); 阅读全文
posted @ 2014-01-15 15:27 向北方 阅读(690) 评论(0) 推荐(0) 编辑

摘要:Delphi的table的RecNum属性,可以用来定位记录,如:self.Table1.RecNum:=23;即可以让数据库记录移动到23号记录上,但这种作用仅限于Paradox数据库,而不是dBASE数据库。如何解决这个问题,可以如下处理:unit DBTables;...procedure TBDEDataSet.SetRecNo(Value: Integer);begin CheckBrowseMode; if (FRecNoStatus = rnParadox) and (Value RecNo) then begin DoBeforeScroll; if Dbi... 阅读全文
posted @ 2014-01-14 19:58 向北方 阅读(1533) 评论(0) 推荐(0) 编辑

摘要:OpenFileDialog OFD = new OpenFileDialog(); OFD.Title = "打开第一个文本文件"; OFD.FileName = "*.txt"; OFD.InitialDirectory = WorkSpacePath; if (OFD.ShowDialog() == DialogResult.OK) { FileInfo fi = new FileInfo(OFD.FileName); ... 阅读全文
posted @ 2014-01-12 20:37 向北方 阅读(12410) 评论(0) 推荐(0) 编辑

摘要:采用文件流方式来处理,StreamReader,StreamWriter:StreamReader sr = new StreamReader("c:\\a.txt"); while(!sr.EndOfStream) //读到文件流结尾退出 { string temp = sr.ReadLine(); // 一行一行的读 } sr.Close(); StreamWriter sw = new StreamWriter("c:\\a... 阅读全文
posted @ 2014-01-12 20:31 向北方 阅读(453) 评论(0) 推荐(0) 编辑

摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication1{ public partial class Form1 : Form { public Form1() { InitializeComponent(); ... 阅读全文
posted @ 2014-01-12 20:26 向北方 阅读(432) 评论(0) 推荐(0) 编辑

摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure Button1Click... 阅读全文
posted @ 2014-01-12 10:23 向北方 阅读(789) 评论(0) 推荐(0) 编辑

摘要:哈希表是通过哈希值来访问的,通过一定的内存浪费获取检索速度,在检索项时是不需要逐一检索。在编程中有一定的好处。unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedur... 阅读全文
posted @ 2014-01-12 10:18 向北方 阅读(2931) 评论(0) 推荐(0) 编辑

摘要:delphi 创建DBASE和FOXPRO两类DBF数据文件的差异,主要有几点:1、创建方法不同DBASE的创建方法:Self.Table1.Close; Self.Table1.Active :=False; Self.Table1.DisableControls; Self.Table1.DatabaseName:=Path; Self.Table1.TableName:=Fname; Self.Table1.TableType :=ttDBase;//与FoxPro的不同 Self.Table1.FieldDefs.Clear;... 阅读全文
posted @ 2014-01-07 21:31 向北方 阅读(1841) 评论(1) 推荐(0) 编辑

摘要:unit Form_ToChangCSVforDBFU;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, ComCtrls, DB, DBTables, Grids, DBGrids, ExtCtrls, StdCtrls;type TForm_ChangCSVToDBFF = class(TForm) PopupMenu1: TPopupMenu; DataSource1: TDataSource; DBGr... 阅读全文
posted @ 2014-01-06 09:06 向北方 阅读(2003) 评论(0) 推荐(0) 编辑

摘要:Edit1.Text:=ChangeFileExt(ExtractFileName(Application.ExeName),'') ; //获取到应用程序名后,将后缀名清空就可以啦。 阅读全文
posted @ 2014-01-06 09:03 向北方 阅读(911) 评论(0) 推荐(0) 编辑

摘要:table2.Close; table2.Active:=false; table2.Exclusive:=true; table2.TableName:='h:\gzkd\sds'; table2.TableType:=ttFOXPRO; with table2.FieldDefs do begin clear; with addfielddef do begin name:='bh'; datatype:=FTSTRING; size:=6; end; with addfielddef do begin name:='xm'; ... 阅读全文
posted @ 2014-01-05 00:25 向北方 阅读(737) 评论(0) 推荐(0) 编辑

摘要:如下:Real time_begin , time_end1 , time_end2Integer i , jcall CPU_TIME(time_begin)write(*,*) time_begindo j = 1 , 30 Do i = 1 , 300000000End Do call CPU_TIME(time_end1) write(*,*) j , time_end1 , time_end1 - time_beginend docall CPU_TIME(time_end2)write(*,*) 't' , time_end2 , time_end2 - time_ 阅读全文
posted @ 2014-01-01 14:54 向北方 阅读(8941) 评论(0) 推荐(0) 编辑

摘要:OpenMP for Fortran OpenMP Directive Syntax of OpenMP compiler directive for Fortran: !$OMP DirectiveName Optional_CLAUSES... ... ... Program statements between the !$OMP lines ... are executed in parallel by all threads ... !$OMP END DirectiveName Program statements between the 2 re... 阅读全文
posted @ 2014-01-01 12:47 向北方 阅读(5621) 评论(0) 推荐(1) 编辑

摘要:Beginning OpenMPOpenMP provides a straight-forward interface to write software that can use multiple cores of a computer. Using OpenMP you can write code that uses all of the cores in a multicore computer, and that will run faster as more cores become available.OpenMP is a well-established, standard 阅读全文
posted @ 2014-01-01 12:38 向北方 阅读(2067) 评论(0) 推荐(0) 编辑

摘要:以下例子来自https://computing.llnl.gov/tutorials/openMP/exercise.html网站一、打印线程(Hello world)C******************************************************************************C FILE: omp_hello.fC DESCRIPTION:C OpenMP Example - Hello World - Fortran VersionC In this simple example, the master thread forks a ... 阅读全文
posted @ 2014-01-01 11:52 向北方 阅读(7960) 评论(0) 推荐(0) 编辑

摘要:什么是OpenMP?“OpenMP (Open Multi-Processing) is an application programming interface (API) that supports multi-platform shared memory multiprocessing programming in C, C++ and Fortran on many architectures, including Unix and Microsoft Windows platforms. It consists of a set of compiler directives, lib 阅读全文
posted @ 2014-01-01 10:24 向北方 阅读(3482) 评论(0) 推荐(0) 编辑

摘要:比如程序:program main implicit none write(*,*) "AAAAAAAAAAAAAAAAAAAAAAAA" stop end虽然可以看见DOS窗口显示AAAAAAAAAAAAAAAAAAAAAAAA,不过是一闪而过,请问怎样解决呢?解答:stop的上一行加pause。 比如程序:program main implicit none write(*,*) "AAAAAAAAAAAAAAAAAAAAAAAA" pausestop end 阅读全文
posted @ 2014-01-01 09:37 向北方 阅读(1420) 评论(0) 推荐(0) 编辑