/*! * \brief Constructeur du menu initial de gestion des UVs. */ Debut::Debut() { this->setWindowTitle(QString("Operation choisie sur les UVs ?")); liste=new QComboBox; update(); ajouter=new QPushButton("Ajouter une UV", this); consulter=new QPushButton("Consulter les informations sur cette UV", this); modifier=new QPushButton("Modifier des informations sur cette UV", this); sup=new QPushButton("Supprimer cette UV", this); terminer=new QPushButton("Opérations sur les UVs terminées", this); coucheH1=new QHBoxLayout; coucheH1->addWidget(liste); coucheH2=new QHBoxLayout; coucheH2->addWidget(consulter); coucheH2->addWidget(sup); coucheH2->addWidget(ajouter); coucheH2->addWidget(modifier); coucheH2->addWidget(terminer); coucheV=new QVBoxLayout; coucheV->addLayout(coucheH1); coucheV->addLayout(coucheH2); setLayout(coucheV); QObject::connect(ajouter, SIGNAL(clicked()), this, SLOT(ajout())); QObject::connect(sup, SIGNAL(clicked()), this, SLOT(suppression())); QObject::connect(modifier, SIGNAL(clicked()), this, SLOT(modif())); QObject::connect(consulter, SIGNAL(clicked()), this, SLOT(afficher())); QObject::connect(terminer, SIGNAL(clicked()), this, SLOT(fin())); }
int main() { Liste *maListe = initialisation(); insertion(maListe, 4); insertion(maListe, 8); insertion(maListe, 15); suppression(maListe); afficherListe(maListe); return 0; }
int main() { int n = 8; int k = 3; Liste *maListe = initialisation(n, k); while (maListe->premier != maListe->dernier) { int i; for(i=0;i<k-1;i++) { maListe->courant = maListe->courant->suivant; } printf("%d", suppression(maListe)); printf("\n\n"); } printf("%d", suppression(maListe)); printf("\n\n"); return 0; }
Debut::Debut() { this->setWindowTitle(QString("Choix de début")); ajouter=new QPushButton("Ajouter", this); modifier=new QPushButton("Modifier", this); sup=new QPushButton("Supprimer", this); coucheH=new QHBoxLayout; coucheH->addWidget(sup); coucheH->addWidget(ajouter); coucheH->addWidget(modifier); coucheV=new QVBoxLayout; coucheV->addLayout(coucheH); setLayout(coucheV); QObject::connect(ajouter, SIGNAL(clicked()), this, SLOT(ajout())); QObject::connect(sup, SIGNAL(clicked()), this, SLOT(suppression())); QObject::connect(modifier, SIGNAL(clicked()), this, SLOT(modif())); }
void ImageViewer::classify(QImage &img) { struct feature_node* x = Malloc(struct feature_node, NUM_FEATURES+1); x[NUM_FEATURES].index = -1; // -1 marks the end of list std::vector<double> vPredictValues; double prob_estimates[1]; for (size_t i = 0; i < reader.getInstancesNumber(); i++) { for (int j = 0; j < NUM_FEATURES; j++) { x[j].index = 1+j; // 1-based feature number x[j].value = reader.instancesFeatures[i][j]; } int predict_label = predict(modelPedestrian, x); if (predict_label == 1) { predict_values(modelPedestrian, x, prob_estimates); } else { prob_estimates[0] = 0; } vPredictValues.push_back(prob_estimates[0]); } suppression(img, vPredictValues); reader.instancesFeatures.clear(); free(x); }
int main(int argc, char *argv[]) { DWORD dw; exit_th =0; if(argc > 1) { if(strcmp(argv[1],"-i")==0 ) Install(); else if(strcmp(argv[1],"-d")==0) Suppression(); else { printf("Mauvaise option\n"); printf("-i : installe le driver qui sera charge au demarrage\n"); printf("-d : desinstalle le driver \n"); } return 1; } //debut du programme printf("Appuyez sur une touche pour initialiser la connexion\n"); system("pause 1 >Nul"); Initialize(); if(connection()) { printf("connexion echouee, appuyez sur une touche pour sortir du programme\n"); system("pause 1>null"); return 1; } SetDebugPrivilege(); printf("Connexion etablie"); pipehandle = CreateNamedPipe("\\\\.\\\\pipe\\framework", PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE,2, 2024, 2024, 0, 0); if(pipehandle == INVALID_HANDLE_VALUE) { printf("Error pipehandle\n"); closeconnection(); system("pause"); return 1; } pipehandle_net = CreateNamedPipe("\\\\.\\\\pipe\\frameworkNet", PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE,2, 2024, 2024, 0, 0); if(pipehandle == INVALID_HANDLE_VALUE) { printf("Error pipehandle\n"); closeconnection(); system("pause"); return 1; } //Envoie IOCTL pour que le driver place les hooks ainsi que les callback driverhandle = CreateFile("\\\\.\\dkf",GENERIC_READ|GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_SYSTEM,0); if(driverhandle == INVALID_HANDLE_VALUE) { suppression(); printf("Error CreateFile failed \n"); system("pause"); return 2; } else { DeviceIoControl(driverhandle,IOCTL_DKF_START,NULL,0,NULL,0,&dw,0); } printf("Hook et callback ok\n"); // lancement du Threaad th_handle = CreateThread(0,0,(LPTHREAD_START_ROUTINE) ListenDriver,0,0,&dw); th_handle_net = CreateThread(0,0,(LPTHREAD_START_ROUTINE) ListenDriverNet,0,0,&dw); printf("Pressez une touche pour arrêter le programme\n"); system("pause 1>Nul"); exit_th = 1; TerminateThread(th_handle_net,0); TerminateThread(th_handle,0); if(pipehandle) CloseHandle(pipehandle); printf("de-hook \n"); DeviceIoControl(driverhandle,IOCTL_DKF_STOP,NULL,0,NULL,0,&dw,0); printf("Fermeture de la connexion \n"); system("pause 1>Nul"); closeconnection(); return 0; }
void Suppression() { schSCManager = OpenSCManager(0,0,SC_MANAGER_ALL_ACCESS); suppression(); }