tws::wcs::capabilities_t tws::wcs::wcs_manager::capabilities() { capabilities_t capabilities; capabilities.identification = identification(); capabilities.provider = provider(); capabilities.metadata = metadata(); return capabilities; }
void RICTLMB2B30Widget::rbHexadecimalClicked() { ui->leIdentification->setValidator(m_hexaValidator); int pos; QString identification(ui->leIdentification->text()); // Check if the code is valid for a hexadecimal value. if(m_hexaValidator->validate(identification,pos) == QRegExpValidator::Invalid) ui->leIdentification->clear(); // Call leIdentificationChanged to handle the code. leIdentificationChanged(QString()); }
//main int main(void) { char d; printf("Bonjour et bienvenue dans \"Question/Réponse \" \n Avez vous un profil ? (o/n) "); scanf("%s", &d);fflush(stdin); if(d == 'o'){ printf("Quel est votre Pseudo ?\n"); scanf("%s", pseudo); fflush(stdin); printf("pseudo menu %s\n", pseudo); identification(); lancerMenu(); } if(d == 'n') { create_profil(); lancerMenu(); } return 0; }
int main(int argc,char * argv[]) { int res; char chaine[10]; double a,b,delta; scanf("%s",chaine); res = identification(chaine); /*seulement si la fonction est reconnue*/ if(res!=-1) { printf("intervalle min\n"); scanf("%lf",&a); printf("intervalle max\n"); scanf("%lf",&b); printf("delta\n"); scanf("%lf",&delta); calcul(a,b,delta,res); } else printf("erreur lors de la saisie de la fonction \n"); return(EXIT_SUCCESS); }
void Client_Thread :: run(){ int tmp; cout << "Start Client" << endl; message mess; identification(); while (1){ if (mess.recv_message(Info.socket) == 1) break; switch (mess.get_type()){ case '0': break; case 'a': mess.set_type('u'); mess.set_name(Info.user_name); pthread_mutex_lock (&lock); for (it = Info_Clients.begin(); it != Info_Clients.end(); ++it){ if (Info.socket != (*it).second) mess.send_message((*it).second); } pthread_mutex_unlock (&lock); break; case 'u': pthread_mutex_lock (&lock); tmp = Info_Clients[mess.get_name()]; pthread_mutex_unlock (&lock); mess.set_name(Info.user_name); mess.send_message(tmp); break; } } close (Info.socket); cout << "Stop Client" << endl; exit_thread(); }
int main(int argc, char* argv[]) { int retour = 1; while(retour) { printf("### WELCOME TO OUR MUSIC VIDEO FINDER ###\n\n ## Here you will be able to find the original soundtrack of a video or discover in which videos of our database you can find a track. ##\n\n # If you want to discover the music in one of your videos, type : discover.\nIf you want to dicover the OST of a video type in our database: movie.\nIf you would like to discover in which video(s) you can find a certain track, type : track #\n\n"); char scan1[100] = ""; char scan2[100]; char cmd[256]; int i,j; int point; int slash = 0; retour = 0; fgets(scan1,10,stdin); if ((strlen(scan1)>0) && scan1[strlen(scan1)-1]=='\n') { scan1[strlen(scan1)-1] = '\0'; } if(strcmp(scan1, "discover")!=0&&strcmp(scan1, "movie")!=0&&strcmp(scan1,"track")!=0) { printf("Wrong parameter."); retour = 1; } if (strcmp(scan1,"discover") == 0) { printf("# Type the path to the video you would like us to analyse. #\n\n "); scanf("%s", &scan2); for (i=strlen(scan2);i>0;i--) { if (scan2[i] == '.') { point = i; } if (scan2[i] == '/') { slash = i; break; } } char* name = malloc((point-slash+1) * sizeof(char)); for (i=0; i<(point-slash); i++) { name[i] = scan2[i+slash]; } printf("%s",name); printf("\n%s\n", scan2); FILE* database2 = fopen("database.txt", "a+"); if (database2 == NULL) {perror("Erreur : ");} else { fprintf(database2, "\n_%s\n", name); fclose(database2); } //fgets(scan2, 10, stdin); //if ((strlen(scan2)>0) && scan2[strlen(scan2)-1]=='\n') //{ // scan2[strlen(scan2)-1] = '\0'; //} snprintf(cmd, 256, "/home/sayuko/ENSIIE/S4/BDM/GNSDK/samples/audio_recognizer/mp3split.sh %s", scan2); system(cmd); identification(); } else if (strcmp(scan1,"movie") == 0) { printf("# Type the name of the video you wish to find the OST. #\n\n"); fgets(scan2, 100, stdin); if ((strlen(scan2)>0) && scan2[strlen(scan2)-1]=='\n') { scan2[strlen(scan2)-1] = '\0'; } movieSearch(scan2); } else if (strcmp(scan1,"track") == 0) { printf("# Type the name of the track you would like to search for. #\n\n "); fgets(scan2, 100, stdin); if ((strlen(scan2)>0) && scan2[strlen(scan2)-1]=='\n') { scan2[strlen(scan2)-1] = '\0'; } trackSearch(scan2); } FILE* database = fopen("database.txt", "a+"); fprintf(database, "\n"); system("rm *.wav"); } return 0; }
QVariant EnabledLocalesModel::data( const QModelIndex& index, int role ) const { if ( index.row() < 0 || index.row() >= m_locales.count() ) return QVariant(); const QString& localeCode = m_locales[index.row()]; Locale locale( localeCode.toLatin1() ); // Get language and country in current system locale UnicodeString uDisplayLanguage; UnicodeString uDisplayCountry; locale.getDisplayLanguage( locale, uDisplayLanguage ); locale.getDisplayCountry( locale, uDisplayCountry ); // Capitalize language and country UErrorCode status; BreakIterator* titleIterator = BreakIterator::createTitleInstance( locale, status ); uDisplayLanguage = uDisplayLanguage.toTitle( titleIterator ); uDisplayCountry = uDisplayCountry.toTitle( titleIterator ); QString displayLanguage = unicodeStringToQString( uDisplayLanguage ); QString displayCountry = unicodeStringToQString( uDisplayCountry ); switch ( role ) { case Qt::DisplayRole: return QString( "%1 - %2 (%3)" ).arg( displayLanguage ).arg( displayCountry ).arg( localeCode ); case LocaleCodeRole: return localeCode; case CountryRole: return displayCountry; case LanguageRole: return displayLanguage; case AddressRole: return address(); case CollateRole: return collate(); case CtypeRole: return ctype(); case IdentificationRole: return identification(); case LangRole: return lang(); case LanguageLcRole: return language(); case MeasurementRole: return measurement(); case MonetaryRole: return monetary(); case MessagesRole: return messages(); case NameRole: return name(); case NumericRole: return numeric(); case PaperRole: return paper(); case TelephoneRole: return telephone(); case TimeRole: return time(); } return QVariant(); }