Posts

python - Activating/deactivating a virtualenv -

i started working on first python api hello world example on friday on vps running ubuntu 14.04. used python3, created folder, virtualenv, activated , electricity went out , connection broke. i've left there, , tried continue stopped. now, can't find way "get active" mode (to command-line view saying (myprojectenv)user@host:~/myproject$ i've searched "deactivate" somewhere in order re-activate again, can't find such. any understanding proper way of handling virtualenv's appreciated. you have activate virtualenv again. in bash have source activate file: source myprojectenv/bin/activate

javascript - How can I have different type of events in Fullcalendar? -

i'm trying have 2 sort of events in full calendar. one of them clickable , open popup when click on them. the others 1 don't take care if click on them. i'm using fullcalendar symfony : https://github.com/adesigns/calendar-bundle anybody know how that? edit: in calendar-settings.js: $('#calendar-holder').fullcalendar({ select: function (start, end, jsevent, view) { alert("test"); }), eventsources: [ { url: routing.generate('fullcalendar_loader'), type: 'post', data: {}, error: function () {}, }, ] then in calendareventlistener have: class calendareventlistener { private $entitymanager; public function __construct(entitymanager $entitymanager) { $this->entitymanager = $entitymanager; } public function loadevents(calendarevent $calendarevent) { $evententity = new evententity('firstevent', new datetime(), new...

html - Set equal height for group of divs -

within section, have 4 divs. first div, floated left has both width , height in pixels. want height dynamically generated based on other div's height. quite stuck. here jsfiddle : https://jsfiddle.net/ksaluja/62o7ydan/ thanks! <section> <div class="attempt"> </div> <div> <ul id="menu"> <li><a style="background:#3f4e64" href="/html/default.asp">button1</a></li> <li><a style="background:#788291">button2</a></li> </ul> </div> <div> <h2>title</h2> <p> badkada </p> <p> fusce luctus ipsum in dui accumsan, posuere scelerisque lacus ultrices. quisque quis ultricies nunc. nam augue magna, eleifend id mi vel, pretium </p> <p> fusce luctus ipsum in dui accumsan, posuere scelerisque lacus ultrices. quisque quis ultricies nunc. n...

How to read Unicode file as Unicode string in Python -

i have file encoded in unicode or utf-8 (i don't know which). when read file in python 3.4, resulting string interpreted ascii string. how convert unicode string u"text" ? the term "unicode" refers standard, not particular encoding. since files in computers binary, there exist different ways of encoding unicode data in binary files. 1 of them "utf-8". you can consult https://docs.python.org/3/howto/unicode.html an example taken document (in section "reading , writing unicode data") with open('unicode.txt', encoding='utf-8') f: line in f: print(repr(line)) in python 3, unlike python2, unicode string constants not written "u".

Cannot pass asterisk character to external command via powershell -

Image
i cannot pass asterisk character external command using powershell i use following line like & .\args.bat @("-arg1", "-arg2", "*.test.com") where args.bat dumps passed arguments @echo off echo %~nx0 script args are... %%i in (%*) echo %%i and instead of passing "*.test.com" lookups current directory files matching pattern "*.test.com" , sends list of them args.bat that can seen if use "*" instead of "*.test.com" i've tried tick character escape asterisk, didn't help in case using asterisk required i'm passing makecert.exe create wildcard domain certificate please help i'm not seeing that. test created args.bat so: 'pause' > args.bat then executed it: & .\args.bat @("-arg1", "-arg2", "*.ps1") when in task manager @ command line cmd.exe, see: it must batch file doing because powershell doing nothing * . btw use...

java - I want message or notification show when start or boot android mobile. -

i want message or notification show when start or boot android mobile. notification show when destroyed application not showing message or notification. please me. public class beaconservice extends service { handler mhandler = new handler(); @override public ibinder onbind(intent arg0) { return null; } @override public int onstartcommand(intent intent, int flags, int startid) { new thread(new runnable() { @override public void run() { while (true) { try { thread.sleep(10000); mhandler.post(new runnable() { @override public void run() { shownotification(); } }); }catch (exception e){ } } } }).start(); return star...

c - TCP Server Crash -

i wondering why crashes when client connects?? supposed simple tcp server when client connects , sends string, server responds number of a's in string. server crashes client types letter in. #include<io.h> #include<stdio.h> #include<winsock2.h> #pragma comment(lib,"ws2_32.lib") //winsock library int main(int argc , char *argv[]) { wsadata wsa; socket s , new_socket, master; struct sockaddr_in server , address; int c, valread; char *message = "welcome marshall's tcp server!!"; int maxrecv = 1024; char *buffer; char ammta = 'a'; char ammtb = 'a'; int count = 0, x; fd_set readfds; buffer = (char*) malloc((maxrecv + 1) * sizeof(char)); printf("\ninitialising winsock..."); if (wsastartup(makeword(2,2),&wsa) != 0) { printf("failed. error code : %d",wsagetlasterror()); return 1; } printf("initialised.\n"); //create socket if((s = socket(af_inet , sock_stream , 0 )) == invalid_so...