示例#1
0
    void Config::makeDefault()
    {
        setUrl();
        version = 0;
        setOs();
        setBits();

        makeFile();
    }
示例#2
0
int main(int argc, char *argv[])
{
    QFileInfo exeFI(argv[0]);
    /*
    QString curDir;
    if(argc >= 2){
        curDir = argv[1];
    }
    */

    exeFI.absoluteDir().mkdir("OUTPUT\\2012_05_02");

    makeFile(exeFI.absolutePath() + "\\OUTPUT\\2012_05_02\\050320_44342.txt");
    makeFile(exeFI.absolutePath() + "\\mdg_check_yyyyyy.log");
    makeFile(exeFI.absolutePath() + "\\OUTPUT\\2012_05_02\\ErrorPoint090402_32323.txt");
    makeFile(exeFI.absolutePath() + "\\OUTPUT\\2012_05_02\\" + QString::fromUtf8("重なりエラー統計.csv"));

    return 1;
}
示例#3
0
void makeValidate(DOMString in, EppXmlValidator& validator)
{
	makeFile(in);
    if (!validator.parseFile(TMPFILENAME))
	{
		cout<<endl<<"PASSED: XSD Validation";
	}
	else
	{	
		cout<<endl<<"FAILED: XSD Validation";
	}
}
示例#4
0
    QDomElement LoadContent()
    {
        makeFile();
        QDomElement n;
        if(file.open(QIODevice::ReadOnly | QIODevice::Text))
        {
            doc.setContent(&file);
            n = doc.elementsByTagName("Root").at(0).toElement();
            file.close();
        }

        return n;
    }
示例#5
0
    void Config::createOrLoad()
    {
       QFile f(filename.c_str());

       if(not QDir("download").exists())
           QDir().mkdir("download");

       if(not QDir("logs").exists())
           QDir().mkdir("logs");

        if(!f.exists())
        {
            makeDefault();
            makeFile();
        }
        else
        {
            loadFile(f);
        }
    }
示例#6
0
void Decoder::decode(std::string inFileName,std::string outFileName,bool mode)
{
    //open input file
    std::string inName(inFileName);
    if (inName.rfind(".ebast",inName.size()-6) == std::string::npos) {
        std::cerr << "This isn't a ebast File" << std::endl;
        exit(1);
    }
    inFile.open(inFileName, std::ios::in | std::ios::binary);
    if (!inFile.is_open()) {
        std::cerr << "Unable to read File" << std::endl;
        exit(1);
    }
    
    //open output file
    std::string outName(outFileName);
    outName += ".txt";
    if(std::ifstream(outName.c_str()))
    {
        std::cerr<<outName<<" already exists!"<<std::endl;
        exit(1);
    }
    
    outFile.open(outName.c_str(),std::ios::out | std::ios::binary);
    if (!outFile.is_open()) {
        std::cerr << "Unable to create File" << std::endl;
        exit(1);
    }
    
    //reading frequency table from file
    huffmanTree->setRoot(readHeader());
    if (mode) {
        print(huffmanTree->getRoot());
    }
    //make file
    makeFile();
    
}
示例#7
0
/*-----------------------------------------------------------------------------*/
int main(int argc, char *argv[]) {

        Input input = validateInput(argc, argv);
	printf("awget:\n\tRequest: %s\n\t", input.URL);

	char ** fileLines = readFile(input.filename);	

	printf("chainlist is\n\t");
        for(int j = 1; fileLines[j] != NULL; j++) {
	    printf("%s\n\t", fileLines[j]);
	}

	Packet * aPacket = buildPacket(fileLines, input.URL);

	int randStepNum = getRandStepNum(aPacket->chainFile[0]); //Get random stepping stone number
	
	char * steppingStone = fileLines[randStepNum]; //Get random stepping stone

	printf("next SS is %s\n\t", steppingStone);

	//Connect to stepping stone
        int socketfd = setupSocket(getIP(steppingStone), atoi(getPort(steppingStone)));

	//Remove stepping stone from file
	removeSS(randStepNum, aPacket); 

	//Write to stepping stone
	socketfd = writeSocket(socketfd, aPacket);

	printf("waiting for file...\n..\n");	

	//Read the data
	char *filename = getFilename(input.URL);
	makeFile(socketfd, filename);
	printf("\tReceived file <%s>\n\tGoodbye!\n", filename);
	close(socketfd);
        free (aPacket);
}
示例#8
0
文件: copy8.c 项目: avinashbhat/trees
void main()
{
	int i,e; 
	node cur;
	while(fscanf(stdin,"%d",&e)==1)
	{
		if(e==EOF)
			break;
		// For creating root node
		if(root==NULL)
		{
			root=makeNode();
			root->r=1;
			root=insertion(root,e);
		}
		else
		{
			cur=find(e);
			cur=insertion(cur,e);
		}
	}
	makeFile(root);
}
示例#9
0
// Square の左右だけ変換
inline Square inverseFile(const Square sq) {
	return makeSquare(inverse(makeFile(sq)), makeRank(sq));
}
示例#10
0
inline std::string squareToStringCSA(const Square sq) {
	const Rank r = makeRank(sq);
	const File f = makeFile(sq);
	const char ch[] = {fileToCharCSA(f), rankToCharCSA(r), '\0'};
	return std::string(ch);
}
示例#11
0
 QString acquirerelease_js() { return makeFile(":/systemsemaphore_acquirerelease.js"); }
示例#12
0
 QString release_js() { return makeFile(":/systemsemaphore_release.js"); }
示例#13
0
文件: evaluate.hpp 项目: risuon/apery
				ret[retIdx++] = std::make_pair(&pe[i][jcolor][jto] - &oneArrayKPP[0], MaxWeight() >> (distance+2));
				if (E1 < jto)
					jto = inverseFile(jto);
				ret[retIdx++] = std::make_pair(&ype[krank][i][jcolor][jto] - &oneArrayKPP[0], MaxWeight() >> (distance+2));
			}
		}
		else {
			// i, j 共に盤上
			const int ibegin = kppIndexBegin(i);
			const int jbegin = kppIndexBegin(j);
			const Piece ipiece = g_kppBoardIndexStartToPiece.value(ibegin);
			const Piece jpiece = g_kppBoardIndexStartToPiece.value(jbegin);
			const Square isq = static_cast<Square>(i - ibegin);
			const Square jsq = static_cast<Square>(j - jbegin);
			const Rank krank = makeRank(ksq);
			const File kfile = makeFile(ksq);
			const Rank irank = makeRank(isq);
			const File ifile = makeFile(isq);
			const Rank jrank = makeRank(jsq);
			const File jfile = makeFile(jsq);
			File diff_file_ki = kfile - ifile;
			bool kfile_ifile_is_inversed = false;
			if (0 < diff_file_ki) {
				diff_file_ki = -diff_file_ki;
				kfile_ifile_is_inversed = true;
			}
			const File diff_file_kj =
				static_cast<File>(diff_file_ki == static_cast<File>(0) ? -abs(kfile - jfile) :
								  kfile_ifile_is_inversed              ? jfile - kfile       : kfile - jfile);
			if (ipiece == jpiece) {
				if (diff_file_kj < diff_file_ki || (diff_file_kj == diff_file_ki && -jrank < -irank))
示例#14
0
int main(int argc, const char* argv[])
{
    //
    // Parse arguments
    //
    Arguments arguments;
    std::string makeFile("project.pmk");
    std::string fbxFile;
    bool fromFbx = false; // Create the entire wallpaper from FBX. 

    for (int i = 1; i < argc; ++i)
    {
        if (strncmp(argv[i], "-h", 2) == 0)
        {
            printUsage();
            return EXIT_SUCCESS;
        }
        else if (strncmp(argv[i], "-v", 2) == 0)
        {
            printVersion();
            return EXIT_SUCCESS;
        }
        else if (strncmp(argv[i], "-f", 2) == 0)
        {
            i++;
            if (i == argc)
            {
                logError("The project make file is missing!\n");
                printUsage();
                return EXIT_FAILURE;
            }
            makeFile = std::string(argv[i]);
        }
        else
        {
            if (i == argc - 1)
            {
                fbxFile = argv[i];
                fromFbx = true;
            }
            else
            {
                logError("Unknown command line arguments.");
			    printUsage();
			    return EXIT_FAILURE;
            }
        }

    }

    // Parse the configuration.
    if (!fromFbx)
    {
        if (!arguments.parse(makeFile.c_str()))
        {
            return EXIT_FAILURE;
        }
    }
    else
    {
        arguments.fromFbxFile(fbxFile);
    }

    //
    // Delete the old project if exists
    //
    char cmdline[1024];

#if defined WIN32
    sprintf_s(cmdline, 1024, "rd /s /q %s", arguments.shortProjectName.c_str());
    system(cmdline);
#endif
    
    //
    // Create the project
    //
    logInfo("Creating the project.");
    MakeProject makeProject(arguments);
    if (!makeProject.run(fromFbx))
    {
        return EXIT_FAILURE;
    }

    logInfo("Project %s has been created!", arguments.projectName.c_str());

    //
    // Run fbxtool and copy the resource to the application folder.
    //
#if defined WIN32
    sprintf_s(cmdline, 1024, "fbxtool.exe -meshformat pmh -meshattrib a %s", fbxFile.c_str());
    int exitCode = system(cmdline);
    
    sprintf_s(cmdline, 1024, "xcopy /E /i res %s\\application\\res", arguments.shortProjectName.c_str());
    system(cmdline);
    
    system("rd /s /q res");
#endif

    // If debugger is present, a pause is required to keep the console output
    // visible. Otherwise the pause is automatic. 
    if (IsDebuggerPresent())
    {
        system("pause");
    }

    return EXIT_SUCCESS;
}