本文整理汇总了C++中Utilities类的典型用法代码示例。如果您正苦于以下问题:C++ Utilities类的具体用法?C++ Utilities怎么用?C++ Utilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Utilities类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: findDuplicatesWrapper
void findDuplicatesWrapper() {
Utilities uobj;
uint64_t *random;
random = uobj.generate_random_array();
int count = uobj.count_duplicates(random);
free(random);
cout << "Duplicates:" << count << endl;
}
开发者ID:saprasath,项目名称:CCPP_PROGRAMS,代码行数:8,代码来源:main.cpp
示例2: UtilitiesWrapper
void UtilitiesWrapper() {
Utilities utils;
char inp[256];
char *lowerInp;
strcpy(inp, "LIRIL");
lowerInp = utils.toLowerCase(inp);
cout << "TOLOWER:" << lowerInp << endl;
free(lowerInp);
}
开发者ID:saprasath,项目名称:CCPP_PROGRAMS,代码行数:9,代码来源:main.cpp
示例3: execute
/**
*
* Virtual function execute that will be overridden by other objects and will return which ever instantiated object to UI or Kernel (which ever needs it)
*
*/
void Utilities::execute(){
Utilities* util;
while(util != NULL){
util = displayMenu();
if(util != NULL){
util->execute();
}
}
//This will be replaced with reference to the Kernel and the pointer "util" passed for scheduling and execution
/*if(util != NULL){
util->execute();
}*/
//TODO need access to the memory management system in order to pass the pointer to the created utility object
}
开发者ID:yiyingZ,项目名称:CSCI-3132---OS32-Project-Summer-2015,代码行数:24,代码来源:Utilities.cpp
示例4: TestReceivedHeaderParse_
void
UtilitiesTester::Test()
{
TestReceivedHeaderParse_();
TestComputerName_();
Utilities utilities;
if (utilities.IsValidIPAddress("127.0.0.A"))
throw;
if (!utilities.IsValidIPAddress("127.0.0"))
throw;
if (Configuration::Instance()->IsIPv6Available())
{
if (!utilities.IsValidIPAddress("2001:0db8:0000:0000:0000:0000:1428:07ab"))
throw;
if (!utilities.IsValidIPAddress("001:0db8:0000:0000:0000::1428:07ab"))
throw;
if (!utilities.IsValidIPAddress("2001:db8::1428:7ab"))
throw;
}
}
开发者ID:M0ns1gn0r,项目名称:hmailserver,代码行数:26,代码来源:Utilities.cpp
示例5: _TestReceivedHeaderParse
void
UtilitiesTester::Test()
{
_TestReceivedHeaderParse();
_TestComputerName();
Utilities utilities;
if (utilities.IsValidIPAddress("127.0.0.A"))
throw;
if (!utilities.IsValidIPAddress("127.0.0"))
throw;
if (TCPServer::HasIPV6())
{
if (!utilities.IsValidIPAddress("2001:0db8:0000:0000:0000:0000:1428:07ab"))
throw;
if (!utilities.IsValidIPAddress("001:0db8:0000:0000:0000::1428:07ab"))
throw;
if (!utilities.IsValidIPAddress("2001:db8::1428:7ab"))
throw;
}
}
开发者ID:bogri5520,项目名称:hmailserver-1,代码行数:26,代码来源:Utilities.cpp
示例6: GetAPIRuntime
int GetAPIRuntime() {
return _Utilities.API_GetAPIRuntime();
}
开发者ID:ryan-kingstone,项目名称:GTA-API,代码行数:3,代码来源:API.cpp
示例7: GetTimestamp
int GetTimestamp() {
return _Utilities.API_GetTimestamp();
}
开发者ID:ryan-kingstone,项目名称:GTA-API,代码行数:3,代码来源:API.cpp
示例8: GetAPIVersion
int GetAPIVersion(char *&version) {
return _Utilities.API_GetAPIVersion(version);
}
开发者ID:ryan-kingstone,项目名称:GTA-API,代码行数:3,代码来源:API.cpp
示例9: IsAPIUpdateAvailable
// Utilities
int IsAPIUpdateAvailable() {
return _Utilities.API_IsAPIUpdateAvailable();
}
开发者ID:GaryWashington,项目名称:GTA-API,代码行数:4,代码来源:API.cpp
示例10: main
//-------------------------------------------------------------------------------------
// Name: main()
// Desc: The application's entry point
//-------------------------------------------------------------------------------------
void __cdecl main()
{
CSimpleIniA ini(true, true, true);
std::map<std::string, bool> Settings;
Utilities u;
// Try mounting the game directory; at console startup it's not mounted
u.MountGameDirectory();
if (ini.LoadFile("g:\\settings.ini") < 0)
{
ini.Reset();
std::string IniText(
" LaunchCode was created by CLK.\n\n" \
" What can this app do?\n" \
" - Remove console signature checks\n" \
" - Remove RSA signature checks\n" \
" - Set RoL LEDs\n" \
" - Remove profile breakpoints (freezing when viewing some profiles)\n"\
" - Remove XampHeapAllocExplicit breakpoints (some bullshit)\n" \
" - Enable hidden partitions for Xbox 360 Neighborhood\n" \
" - Add additional, customizable partitions to Neighborhood\n" \
" - Set the default account password for PartnerNet accounts\n" \
" - Set the display gamertag\n" \
" - Make the console think you have a gold membership\n" \
" -> Instructions/Limitations:\n" \
" - Account password length must not exceed 11 characters.\n"\
" - Each Neighborhood partition should match the following" \
"criteria, otherwise it will not be mounted:\n" \
" ~ NeighborhoodName must not exceed 35 characters\n" \
" ~ DevicePath must not exceed 61 characters\n" \
" ~ DevicePath must be formatted as so:\n" \
" - \"\\Device\\Harddisk0\\Partition1\\Devikit\"\n" \
" - The following are all valid basic paths:\n" \
" - \\Device\n" \
" - \\Device\\Harddisk0\\SystemPartition\n" \
" - \\Device\\Harddisk0\\Partition1\n" \
" - \\Device\\Flash\n" \
" - \\Device\\Mu0System\n" \
" - \\Device\\Mu1System\n" \
" - \\Device\\Mass0\n" \
" - \\Device\\Mass1\n" \
" - \\Device\\Mass2\n" \
" - \\Device\\BuiltInMuSfcSystem\n" \
" - \\Device\\Harddisk\\SystemExtPartition\n" \
" - \\Device\\Harddisk\\SystemAuxPartition\n" \
" - \\Device\\BuiltInMuUsb\\Storage\n" \
" - \\Device\\BuiltInMuUsb\\StorageSystem\n" \
" - \\Device\\BuiltInMuUsb\\SystemExtPartition\n" \
" - \\Device\\BuiltInMuUsb\\SystemAuxPartition\n" \
" - \\Device\\BuiltInMuMmc\\Storage\n" \
" - \\Device\\BuiltInMuMmc\\StorageSystem\n" \
" - \\Device\\BuiltInMuMmc\\SystemExtPartition\n" \
" - \\Device\\BuiltInMuMmc\\SystemAuxPartition\n" \
" - \\Device\\HdDvdRom\n" \
" - \\Device\\HdDvdStorage\n" \
" - \\Device\\HdDvdPlayer\n" \
" - \\Device\\TransferCable\n" \
" - \\Device\\Mass0PartitionFile\\Storage\n" \
" - \\Device\\Mass1PartitionFile\\Storage\n" \
" - \\Device\\Mass0PartitionFile\\StorageSystem\n" \
" - \\Device\\Mass1PartitionFile\\StorageSystem\n" \
" - \\Device\\Harddisk0\\Cache0\n" \
" - \\Device\\Harddisk0\\Cache1\n" \
" - \\Device\\NetworkStorageCache\n" \
" - \\Device\\UpdateStorage\n" \
" - \\Device\\Harddisk0\\TitleURLCachePartition\n" \
" - \\Device\\DeviceAuth\n" \
" - \\Device\\BuiltInMuUsb\\ReservationPartition\n" \
" - \\Device\\LauncherData\n" \
"\n\n\n\nGreets to the following people:\n" \
"gabe_k, Xenon.7 (Xenomega), paul (British dude), rickshaw, skitzo, kiwi, dual\n" \
"yolo."
);
std::fstream readme("g:\\readme.txt", std::ios::trunc | std::ios::in | std::ios::out);
readme << IniText;
readme.close();
ini.SetBoolValue("settings", "SetLeds", true);
ini.SetBoolValue("settings", "PatchRsaPubCrypt", true);
ini.SetBoolValue("settings", "RemoveConsoleSignatureChecks", true);
ini.SetBoolValue("settings", "RemovePackageRsaChecks", true);
ini.SetBoolValue("settings", "RemoveProfileBreakpoints", true);
ini.SetBoolValue("settings", "RemoveXampHeapAllocExplicitBreakpoints", true);
ini.SetBoolValue("settings", "SetAsStartupApplication", true);
ini.SetBoolValue("settings", "EnableHiddenPartitions", true);
ini.SetBoolValue("settings", "EnableExtraNeighborhoodDrives", true);
ini.SetBoolValue("settings", "SetGamertag", true);
ini.SetBoolValue("settings", "SetGoldMembership", true);
ini.SetBoolValue("settings", "EnableXamWatsonOutput", true);
ini.SetValue("Network", "AccountCreatePassword", "meth=friend");
ini.SetValue("Network", "OnlineGamertag", "[test]DRUG DEALER"); // MODIFY THIS LINE TO YOUR DEFAULT GAMERTAG
//ini.SetBoolValue("xshell", "WriteCustomBackground", false);
//.........这里部分代码省略.........
开发者ID:landaire,项目名称:LaunchCode,代码行数:101,代码来源:LaunchCode.cpp
示例11: main
int main(int argc, char* argv[])
{
int numOfParticles , numOfSamples;
double landmarkThreshold;
const char *filepath = NULL;
const char *database = NULL;
config_t cfg, *cf;
cf = &cfg;
config_init(cf);
if (!config_read_file(cf, "config.cfg"))
return(EXIT_FAILURE);
config_lookup_int(cf, "particles" , &numOfParticles);
config_lookup_int(cf, "samples" , &numOfSamples);
config_lookup_float(cf, "landmarkThreshold" , &landmarkThreshold);
config_lookup_string(cf, "filepath" , &filepath);
config_lookup_string(cf, "database" , &database);
DBWrapper dbwr(database);
SMC smc;
Utilities ut;
dataBuffer dataPoints = ut.readFile("-----", filepath);
int timeStates = dataPoints.size();
Params baseparams;
vector < StateProgression > particles(numOfParticles, timeStates);
smc.infer( &particles, & dataPoints, baseparams, numOfParticles , numOfSamples);
Landmarks observations;
for(unsigned int i = 0; i< particles[0].stateProg[0].size(); i++){
Landmark land(smc.numOfLandmarks , particles[0].stateProg[0][i],i);
observations.addLandMark(land);
}
Landmarks landmarks = dbwr.getCurrentLandmarks();
vector<double> current_observations;
std::map<int, int > landmark_associations;
for(unsigned int i=0; i<observations.size(); i++)
{
if(landmarks.size()==0)
{
dbwr.insertLandmark(& observations.landmarks[i].distribution);
landmarks = dbwr.getCurrentLandmarks();
current_observations.push_back(0);
continue;
}
vector< vector< double > > distanceFeatures = landmarks.extractDistances(& observations.landmarks[i], & ut);
bool found = false;
for(unsigned int ijk = 0 ; ijk<distanceFeatures.size(); ijk++){
if( distanceFeatures[ijk][0]<.3 && distanceFeatures[ijk][1]<20 && found ==false){
landmark_associations.insert(std::make_pair(i, landmarks.landmarks[ijk].getId()));
current_observations.push_back(ijk);
found =true;
break;
}
}
if(found==false){
dbwr.insertLandmark(& observations.landmarks[i].distribution);
current_observations.push_back(observations.size());
landmarks = dbwr.getCurrentLandmarks();
landmark_associations.insert(std::make_pair(current_observations.back(), landmarks.landmarks.back().getId()));
}
}
ofstream myfile;
myfile.open ("/home/panos/Desktop/aggregated.txt",std::ofstream::out | std::ofstream::app);
myfile << "[";
for(unsigned int i =0 ; i< dataPoints[0].size() ; i++)
myfile << dataPoints[0][i][0] << " " << dataPoints[0][i][1] << " " << dataPoints[0][i][2] << " " << landmark_associations[particles[0].assignments[i]]<< endl;
myfile<< "]";
myfile.close();
return 0;
}
开发者ID:hadjichristslave,项目名称:SMC,代码行数:73,代码来源:main.cpp
示例12: main
int main()
{
int m = pow(2, 2);
int n = pow(2, 8);
cout << m << endl;
cout << n << endl;
double s1 = sin(5.0, 3.0);
double s2 = sin(3.4, 2.7);
cout << s1 << endl;
cout << s2 << endl;
return 0;
}
开发者ID:CptDemocracy,项目名称:The-CPlusPlus-Flamenco,代码行数:14,代码来源:functions.cpp
示例13: setConfigPath
void PhoenixGlobals::setConfigPath( const QString &path ) {
m_config_path = path;
utilities.createFolder( path );
}
开发者ID:kelvinhammond,项目名称:Phoenix,代码行数:4,代码来源:phoenixglobals.cpp
示例14: setSavePath
void PhoenixGlobals::setSavePath( const QString &path ) {
m_save_path = path;
utilities.createFolder( path );
}
开发者ID:kelvinhammond,项目名称:Phoenix,代码行数:4,代码来源:phoenixglobals.cpp
示例15: setArtworkPath
void PhoenixGlobals::setArtworkPath( const QString &path ) {
m_artwork_path = path;
utilities.createFolder( path );
}
开发者ID:kelvinhammond,项目名称:Phoenix,代码行数:4,代码来源:phoenixglobals.cpp
示例16: setBiosPath
void PhoenixGlobals::setBiosPath( const QString &path ) {
m_bios_path = path;
utilities.createFolder( path );
}
开发者ID:kelvinhammond,项目名称:Phoenix,代码行数:4,代码来源:phoenixglobals.cpp
注:本文中的Utilities类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论