int main(int argc,char* argv[]){ /*int s = atoi(argv[1]); int e = atoi(argv[2]); int size = atoi(argv[3]);*/ sms(); }
QList<QString> handle_input(QString sms_packet) { QList<QString> return_info; // parse the information SMS sms(sms_packet); if (sms.type == SMS::EMPTY) return return_info; // bad sms, do nothing QString should_notify; if (sms.type == SMS::RECEIVED) should_notify = "1"; else should_notify = "0"; // get the list of people and use it to create the sms file // for now this only works for conversations with only one other person // use spaces and string.split(" ") for multiple numbers QString filename = sms.numbers + ".sms"; if (!sms_exists(filename)) // file doesnt already exist, create it sms_makefile(filename, sms.names, sms.numbers); // then append the file sms_append(filename, sms.toString()); return_info.append(sms.numbers); // number return_info.append(sms.names); return_info.append(should_notify); // type return_info.append(sms.message); // message return return_info; }
void PeopleApplication::smsNumberToActiveService(const QString& number){ // hard-coded details of the MeeGo SMS application QDBusInterface sms("com.meego.sms", "/", "com.meego.sms"); if (!sms.isValid()) { qWarning() << "Composing SMS to" << number << "- could not find SMS app"; return; } QDBusReply<void> reply = sms.call(QDBus::BlockWithGui, "showdialogpage", number); if (!reply.isValid()) qWarning() << "Composing SMS to" << number << "failed:" << reply.error().message(); }
QServer::QServer(QWidget *parent) : QMainWindow(parent) , m_server(this) { ui.setupUi(this); //To display messages on GUI connect(this,SIGNAL(sms(QString)),this,SLOT(readSMS(QString))); //Try to start the server, example name "test" if(m_server.listen("test")) { ui.statusBar->showMessage("Server Ready!"); //Catch all new connections connect(&m_server, SIGNAL(newConnection()), this, SLOT(newConnection())); } }
void QServer::readSocket() { //Pointer to the signal sender QLocalSocket * socket = (QLocalSocket*)sender(); //Read all data on the socket & store it on a QByteArray QByteArray block = socket->readAll(); //Data stream to easy read all data QDataStream in(&block, QIODevice::ReadOnly); in.setVersion(QDataStream::Qt_5_4); while (!in.atEnd()) //loop needed cause some messages can come on a single packet { QString receiveString; in >> receiveString; receiveString.prepend(QString("%1 :: ").arg(socket->socketDescriptor())); emit sms(receiveString); } }
int main(int argc, char **argv) { // setup ros ros::init(argc, argv, "rosplan_simple_map_server"); ros::NodeHandle nh("~"); // params std::string filename("waypoints.txt"); std::string fixed_frame("map"); nh.param("/waypoint_file", filename, filename); nh.param("fixed_frame", fixed_frame, fixed_frame); // init KCL_rosplan::RPSimpleMapServer sms(nh, fixed_frame); ros::ServiceServer createPRMService = nh.advertiseService("/kcl_rosplan/roadmap_server/create_prm", &KCL_rosplan::RPSimpleMapServer::generateRoadmap, &sms); sms.setupRoadmap(filename); ROS_INFO("KCL: (RPSimpleMapServer) Ready to receive."); ros::spin(); return 0; }
DialogResetPassword::DialogResetPassword(QWidget *parent) : QDialog(parent), ui(new Ui::DialogResetPassword) { ui->setupUi(this); ui->frame->setStyleSheet("background-color: white;border-style:outset;border-width:1px"); QFont font; font.setPointSize(20); ui->labelTitle->setFont(font); ui->lineEditPassword->setEchoMode(QLineEdit::Password); ui->lineEditPassword_2->setEchoMode(QLineEdit::Password); ui->labelLogo->setPixmap(QPixmap(":/res/images/obs.png")); ui->labelLogo->setScaledContents(true); ui->labelLogo->setStyleSheet("background-color: transparent;border-style:none;"); ui->lineEditUser->setFocus(); connect(ui->toolButtonCode, SIGNAL(clicked()), SLOT(sms())); }
void CSmsDialer::onSendSmsRequest(boost::shared_ptr<yApi::IYPluginApi> api, const std::string& sendSmsRequest) const { try { m_messageKeyword->setCommand(sendSmsRequest); boost::shared_ptr<ISms> sms(new CSms(getRecipientPhone(api, m_messageKeyword->to()), m_messageKeyword->body())); m_phone->send(sms); notifyAck(true); } catch (shared::exception::CInvalidParameter& e) { std::cerr << "Invalid SMS sending request \"" << sendSmsRequest << "\" : " << e.what() << std::endl; notifyAck(false); return; } catch (CPhoneException& e) { std::cerr << "Error sending SMS : " << e.what() << std::endl; notifyAck(false); } }
bool TestCppBase::TestVariantArrayRef() { String sms("hhvm.stats.max_slot"); String hfc("hhvm.hot_func_count"); String mla("hhvm.multi_level_array"); String k1("key1"); String k2("key2"); String k3("key3"); Variant v1(11); Variant v2(77); Variant v3(99); Variant v4(true); Variant ml_arr(Array::Create()); ml_arr.toArrRef().set(k1, Array::Create()); ml_arr.toArrRef().lvalAt(k1).toArrRef().set(k2, Array::Create()); ml_arr.toArrRef().lvalAt(k1).toArrRef().lvalAt(k2).toArrRef().set(k3, v4); Variant arr(Array::Create()); arr.toArrRef().set(sms, v1); arrayRefHelper(arr); arr.toArrRef().set(sms, v2); VERIFY(arr.toArray().rvalAt(hfc).toInt64() == 77); // bidirectional references arr.toArrRef().set(hfc, v3); VERIFY(arr.toArray().rvalAt(sms).toInt64() == 99); VERIFY(ml_arr.toArray().size() == 1); VERIFY(ml_arr.toArray().rvalAt(k1).isArray() == true); VERIFY(ml_arr.toArray(). rvalAt(k1).toArray(). rvalAt(k2).toArray(). rvalAt(k3).toBoolean() == true); return Count(true); }
static void arrayRefHelper(Variant& arr) { String sms("hhvm.stats.max_slot"); String hfc("hhvm.hot_func_count"); Variant r(Variant::StrongBind{}, arr.toArrRef().lvalAt(sms)); arr.toArrRef().setRef(hfc, r); }