Exemple #1
0
int main(int argc, char **argv) {
	std::vector<Common::UString> args;
	Common::Platform::getParameters(argc, argv, args);

	int returnValue = 1;
	Command command = kCommandNone;
	Common::UString file;

	try {
		if (!parseCommandLine(args, returnValue, command, file))
			return returnValue;

		Aurora::NDSFile nds(new Common::ReadFile(file));

		if      (command == kCommandInfo)
			displayInfo(nds);
		else if (command == kCommandList)
			listFiles(nds);
		else if (command == kCommandExtract)
			extractFiles(nds);

	} catch (...) {
		Common::exceptionDispatcherError();
	}

	return 0;
}
int main(int argc, char * argv[])
{
    // Seed randomizer with current time
    srand(time(NULL));

    // Simulate a normal distribution of 1000000 trials, with 50 occurrences
    // per trial.
    NormalDistributionSimulation nds(50, 1000000);

    // Print the result of the distribution (divided by 2000 as a scale factor)
    nds.print(2000.0);

    return 0;
}
Exemple #3
0
vector<const pddl_type *> TypeHierarchy::accumulateAll(const pddl_type * t)
{
	vector<const pddl_type *> nds(1,t);
	PTypeRef tt(t);
	GI gi = downGraph.find(&tt);
	if(gi == downGraph.end()) return nds;
	Nodes ns;
	PTypeRef pt(0);
	closure(downGraph,gi,ns,gi,&pt);
	for(Nodes::const_iterator i = ns.begin();i != ns.end();++i)
	{
		nds.push_back(***i);
	};
	return nds;
};
Exemple #4
0
int main()
{
  int nt = 4;

  std::vector<double> nds(nt);
  std::vector<double> wts(nt);

  cdgqf ( nt, 1, 1., 1., &nds[0], &wts[0] );

  for( int k = 0; k < nt; k++ )
  {
    std::cout << "nd = " << std::setprecision(16) << nds[k] << "\t"
              << "wt = " << std::setprecision(16) << wts[k] << std::endl;
  }

  return 0;
}
Exemple #5
0
bool SonicEngine::detectLanguages(Aurora::GameID UNUSED(game), const Common::UString &target,
                                  Aurora::Platform UNUSED(platform),
                                  std::vector<Aurora::Language> &languages) const {
	try {
		Aurora::NDSFile nds(target);

		for (size_t i = 0; i < Aurora::kLanguageMAX; i++) {
			Common::UString herf = getLanguageHERF((Aurora::Language) i);
			Common::UString tlk  = getLanguageTLK ((Aurora::Language) i);
			if (herf.empty() || tlk.empty())
				continue;

			if (!nds.hasResource(herf + ".herf") || !nds.hasResource(tlk + ".tlk"))
				continue;

			languages.push_back((Aurora::Language) i);
		}

	} catch (...) {
	}

	return true;
}