Posts

javascript - Call link in mobile site not working -

in mobile site, used <a href="tel:+1800229933">call free!</a> making call specified number device.but not working in of devices.thanks in advance. you should use callto: example: <a href="callto:+1800229933">call free!</a>

python - how to create a popup while loading data through method? -

i have method needs few second load data. these few second want display popup. problem python freezes starting load-method. my first idea draw progressbar in qteditor , hide it. , then: def load_data(self): self.progressbar.sethidden(false) [...load data...] the progressbar show, after load data. thought if "outsource" "sethidden" work: self.start.connect(self.load_data) def pre_load_data(self): self.progressbar.sethidden(false) self.start.emit() #signal created myself def load_data(self): [...load data...] but again progressbar created after process finished. tried make popup in other *.py file, , import it: popup.py: class popup(qtgui.qdialog): def __init__(self): qtgui.qwidget.__init__(self) self.pp=ui_loading() self.pp.setupui(self) and show popup before calling load_data-method: def test(self): self.bla = popup.popup() self.bla.show() self.load_data() the popup show inmediatly, empty. after load_data fi...

regex - How to parse/substitute part of a string given a starting matching condition in python? -

assume have string text='bla1;\nbla2;\nbla3;\n#endif\nbla4;' i want define method removes '\n' except if '\n' preceded string starting '#' or '\n' follows '#', result of process should be: text2='bla1;bla2;bla3;\n#endif\nbla4;' is there simple way in python using regex? (note: clear me how avoid \n followed #, using negative lookbehind, i.e. r'\n+(?!#)' challenge how identify \n preceded string starting #) the challenge is: how deal positive lookbehind variable-length strings in python? find : (#[a-z]+\\n)|\\n(?!#) and replace : '\1' output : bla1;bla2;bla3;\n#endif\nbla4; demo here : http://regex101.com/r/uo8wh2 this keep \n newline chars have preceding word starting # or followed hash. hth

asterisk - Originating VoIP call using AsterNET in C# -

i try doing mconnection.sendaction(new originateaction() { channel = "sip/201test", exten = "401", context = "201", priority = "1", callerid = "201", timeout = 30000 }); where 201 , 401 extensions connected local network. trying call 201 401. doing wrong? edit: i have test application button "call" i have 2 extensions connected server - 201, 401 i want call 201 401 on "call" button click channel name selected randomly not sure if right. update: ``` mconnection.sendaction(new originateaction() { channel = "sip/401", exten = "401", context = "default", priority = "1", callerid = "201...

c++ - Using a map as "Phonebook" -

i have code similar this enum days { monday, tuesday, wednesday, thursday, friday, saturday, sunday }; typedef void (*dailyfunction)(int); namespace dailyfunctions { void monday(int somedata); void tuesday(int somedata); void wednesday(int somedata); void thursday(int somedata); void friday(int somedata); void saturday(int somedata); void sunday(int somedata); } and somewere else in code use switch statement assign 1 of dailyfunctions dailyfunction ptr. when typing (more or less) same switch statement third time, had idea, great have map std::map<days, dailyfunction> myphonebookmap which allow me this: dailyfunction function_ptr = myphonebookmap[weekday]; to me seems, optimal place define such map in namespace dailyfunctions under function-declarations but how can define const map there (since shouldnt change) , populate @ same time? you can use boost function boost::assign::map_list_of or use copy constructor initialize c...

c++ - GLSL - When and where is the vertex and fragment called? -

i want know when vertex , fragment shader called in opengl loop. @ end of glutdisplayfunc() or glutmainloop(), or @ every vertex draw call? , vertex , fragment consecutively called 1 after other(ie: vertex fragment), or different times? say have following snippet of code: glpushmatrix(); glrotatef(rot,0.0f,1.0f,0.0); gltranslatef(0.0f,0.0f,25); glcolor3f(0.0,0.0,1.0); drawsphere(4,20,20); // draw triangles glcolor3f(1.0,0.0,0.0); gltranslatef(0.0f,0.0f,5); drawsphere(4,20,20); // draw triangles glpopmatrix(); does vertex shader called after each vertex call, reads current matrix on top of stack, send pre-defined modelview matrix uniform vertex shader? when fragment shader run? is @ end of glutdisplayfunc() or glutmainloop(), neither, because glut is not part of opengl. it's library (for creating simple opengl applications). or @ every vertex draw call? from programmers point of view it's not specified when happens e...

Unable to record my call in Android 4.4 -

i not able record call in android 4.4 . checked few applications googleplay don't work either. in application use mediarecorder.audiosource.voice_call doesn't work. anyone knows solution? see link - audiosource-voice-call-not-working-in-android-4-0-but-working-in-android-2-3 after lot of search found manufactures have closed access such function because call recording not allowed in countries. if finds such question , solution other way post on here may helpful many because many people have same issue.