易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 :

用CMarkUp类解析XML文件

解析:
 CMarkup xml;
 CString strChanText, strChanType;
 xml.Load("MyXml.xml");
 xml.ResetMainPos();
 if (!Chan.FindElem("TreeOrg"))
 {
      return;
 }
 if (xml.IntoElem())
 {
      xml.FindElem("Qchannels");
      if (xml.IntoElem())
      {
           while (xml.FindElem("Chan"))
           {
                  strChanText = xml.GetAttrib("iChanId");
                  strChanType = xml.GetAttrib("iChanType");
           }
      }
 }
XML文件名称:MyXml.xml
内容:
<?xml vers ......

XML Schema nillable=”true” vs minOccurs=”0″

出处:http://www.dimuthu.org/blog/2008/08/18/xml-schema-nillabletrue-vs-minoccurs0/
【前言】一个月前研究过nillable="true"和 vs minOccurs="0"的区分,没有想到啊,今天就记不得了,看来真是好记性不如烂笔头啊,况且我还么的好记性。。。。
【总结】英文一眼看不出结论,说点汉语直接些,别说我土哈~
nillable="true":该元素的值可以为空,但是该元素不能省略,也就是说,只能:
<minzero xsi:nil="true"><minzero>
而不能直接将minzero这个元素去掉
(注意:xsi:nil="true"或者xsi:nil="1"应该就是表示这个元素为空)
minOccurs="0":该元素可以直接被省略掉,但是不能让该元素的值为空,也就是说,不能:
<minzero xsi:nil="true"><minzero>
In a WSDL, XML Schema is the section where it define the message format for each operations, which eventually become the real API that users are interested. And it is the most tricky part of the WSDL. Nowadays there are many tools that you can design and use WSDLs without any needs in knowing the meaning of a single line of the WSDL. But there are situations ......

python的C、c++扩展

python的C、c++扩展
http://blog.chinaunix.net/u3/110228/showart_2148725.html
python的强大不仅表现在其功能上,而且还表现在其扩展能力上。
使用C/C++很容易编写python的模块,扩展python的功能。
同时将性能要求比较高的代码使用C/C++编写,能更好的弥补
脚本语言执行速度慢的缺陷。
1. python的C语言扩展
1.1 TestCLib.c: 提供python的模块接口
#include "Python.h"
#include <stdlib.h>
#include <stdio.h>
long fac(long);
// ------------------------------------------------------
// Make C code usable in Python
// ------------------------------------------------------
PyObject*   TestCLib_fac(PyObject * self, PyObject *args)
{
    long num;
    if ( ! PyArg_ParseTuple(args,"l",&num)){
        return NULL;
    }
    return (PyObject*)Py_BuildValue("l",fac(num));
}
static PyMethodDef  TestCLibMethods[] = {
    {"fac",TestCLib_fac,METH_VARARGS},
  ......

python的C、c++扩展

python的C、c++扩展
http://blog.chinaunix.net/u3/110228/showart_2148725.html
python的强大不仅表现在其功能上,而且还表现在其扩展能力上。
使用C/C++很容易编写python的模块,扩展python的功能。
同时将性能要求比较高的代码使用C/C++编写,能更好的弥补
脚本语言执行速度慢的缺陷。
1. python的C语言扩展
1.1 TestCLib.c: 提供python的模块接口
#include "Python.h"
#include <stdlib.h>
#include <stdio.h>
long fac(long);
// ------------------------------------------------------
// Make C code usable in Python
// ------------------------------------------------------
PyObject*   TestCLib_fac(PyObject * self, PyObject *args)
{
    long num;
    if ( ! PyArg_ParseTuple(args,"l",&num)){
        return NULL;
    }
    return (PyObject*)Py_BuildValue("l",fac(num));
}
static PyMethodDef  TestCLibMethods[] = {
    {"fac",TestCLib_fac,METH_VARARGS},
  ......

python的C、c++扩展

python的C、c++扩展
http://blog.chinaunix.net/u3/110228/showart_2148725.html
python的强大不仅表现在其功能上,而且还表现在其扩展能力上。
使用C/C++很容易编写python的模块,扩展python的功能。
同时将性能要求比较高的代码使用C/C++编写,能更好的弥补
脚本语言执行速度慢的缺陷。
1. python的C语言扩展
1.1 TestCLib.c: 提供python的模块接口
#include "Python.h"
#include <stdlib.h>
#include <stdio.h>
long fac(long);
// ------------------------------------------------------
// Make C code usable in Python
// ------------------------------------------------------
PyObject*   TestCLib_fac(PyObject * self, PyObject *args)
{
    long num;
    if ( ! PyArg_ParseTuple(args,"l",&num)){
        return NULL;
    }
    return (PyObject*)Py_BuildValue("l",fac(num));
}
static PyMethodDef  TestCLibMethods[] = {
    {"fac",TestCLib_fac,METH_VARARGS},
  ......

VC中编译有C源文件的程序

最近在做程序时需要使用一个已经编好的C程序源文件(有头文件),将头文件加入要调用的源文件中,调用相应C函数,编译时出现如下错误:
sss.c(3129) : fatal error C1010: unexpected end of file while looking for precompiled header directive
在网上查了相关资料,说不能在C源文件中包含"stdafx.h"文件,
知道需要以这样的方式加入头文件和声明要调用的函数:
extern "C"
{
#include "sss.h"
}
extern "C"
{
extern BOOL S1();
} ......

Tricky C questions



以下是几个棘手的
C 问题, 很难做, 看看自己会做几个?
How do you write a program which produces its own source code as its output?
How can I find the day of the week given the date?
Why doesn’t C have nested functions?
What is the most efficient way to count the number of bits which are set in a value?
How can I convert integers to binary or hexadecimal?
How can I call a function, given its name as a string?
How do I access command-line arguments?
How can I return multiple values from a function?
How can I invoke another program from within a C program?
How can I access memory located at a certain address?
How can I allocate arrays or structures bigger than 64K?
How can I find out how much memory is available?
How can I read a directory in a C program?
How can I increase the allowable number of simultaneously open files?
What’s wrong with the call fopen(”c:\newdir\file.dat”, “r”)
?
without using third variable ......

C/C++不定参数的用法

C++不定参数的用法 (C类似)
2009-11-19 15:41
/*
va_list vl; //定义一个指向参数列表的变量(一个...指针)
va_start(vl,first_param); //把指向参数列表的变量初始化
va_arg(vl,mode); //获取下一个参数,参数类型由第二个参数指定,第二个参数用于在va_arg内部进行尺寸计算,以便找到下一个参数
va_end(vl); //结束
*/
#include <iostream>
#include <cstdarg> //头文件包含:C++ <cstdarg>; C <stdarg.h>
using namespace std;
void variable(int i,...)
{
      int j=0;
      va_list arg_ptr; //定义一个指向参数列表的变量
      va_start(arg_ptr,i); //把指向参数列表的变量初始化
      while(j!=-1) //自定义的一个参数结束标志
      {
             j=va_arg(arg_ptr,int); //获取下一个参数
             printf("%d ",j);
      }
&nb ......

C/C++不定参数的用法

C++不定参数的用法 (C类似)
2009-11-19 15:41
/*
va_list vl; //定义一个指向参数列表的变量(一个...指针)
va_start(vl,first_param); //把指向参数列表的变量初始化
va_arg(vl,mode); //获取下一个参数,参数类型由第二个参数指定,第二个参数用于在va_arg内部进行尺寸计算,以便找到下一个参数
va_end(vl); //结束
*/
#include <iostream>
#include <cstdarg> //头文件包含:C++ <cstdarg>; C <stdarg.h>
using namespace std;
void variable(int i,...)
{
      int j=0;
      va_list arg_ptr; //定义一个指向参数列表的变量
      va_start(arg_ptr,i); //把指向参数列表的变量初始化
      while(j!=-1) //自定义的一个参数结束标志
      {
             j=va_arg(arg_ptr,int); //获取下一个参数
             printf("%d ",j);
      }
&nb ......
总记录数:40319; 总页数:6720; 每页6 条; 首页 上一页 [2273] [2274] [2275] [2276] 2277 [2278] [2279] [2280] [2281] [2282]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号