Posts

linq - Logic of applying Group by in Sql Queries -

i asking beginner level of question confused whenever want use aggregate function group by. getting right results not pretty sure how group working here. requirement count of sent items based on messagegroup columns. messageid senderid messagegroup message _____________________________________________________________________________ 1 2 67217969-e03d-41ec-863e-659ca26e660f hi 2 2 67217969-e03d-41ec-863e-659ca26e660f hello 3 2 67217969-e03d-41ec-863e-659ca26e660f bye 4 1 c45dc414-9320-40a5-8f8f-9c960d6deffe tc 5 1 8486d16b-294b-45a5-8674-e7024e55f39b shutup actually want count sent messages.here senderid=2 has sent 3 messages want show single count have used messagegroup , doing groupby , getting count. i have used linq query:: return db.tblmessage.where(m => m.senderid == 2 ).groupby(m => m.message...

php - PHPExcel Save a xls file to a specific folder -

i want save xls file specific folder on server using php excel using following code : $objwriter = phpexcel_iofactory::createwriter($this->excel, 'excel5'); //force user download excel file without writing server's hd $objwriter->save('‪c:/xampp/htdocs/timesheet/files/test.xls'); but keep on getting following error : a php error encountered severity: warning message: fopen(â€Âªc:/xampp/htdocs/timesheet/files/test.xls): failed open stream: invalid argument filename: pps/root.php line number: 90 fatal error: uncaught exception 'phpexcel_writer_exception' message 'can't open â€Âªc:/xampp/htdocs/timesheet/files/test.xls. may in use or protected.' in c:\xampp\htdocs\timesheet\application\third_party\phpexcel\shared\ole\pps\root.php:93 stack trace: #0 c:\xampp\htdocs\timesheet\application\third_party\phpexcel\writer\excel5.php(226): phpexcel_shared_ole_pps_root->save('???c:/xampp/htd...') #1 c:\xampp\htdoc...

clojure - Overlapping partition in core.async -

in clojure can overlapping partitions of collection tuning step argument partition : (partition 3 1 (range 20)) ;; ((0 1 2) (1 2 3) (2 3 4) (3 4 5) ...) core.async have partition function since doesn't accept step argument, can't overlapping partitions: (let [c (chan)] (go (doseq [n (range 20)] (>! c n))) (go-loop [p (async/partition 3 c)] (when-let [v (<! p)] (prn v) (recur p)))) ;;[0 1 2] ;;[3 4 5] ;;[6 7 8] i realise having mean being able read same value channel more once. i'm aware create own function reads many values channel want , build own partitions. however wondering if there way achieve core api provided core.async. ps. sliding-buffer doesn't trick can't peek @ whole buffer @ once. one way of doing create function reads channel, buffers values , puts new channel. i'm not sure how idiomatic though. for example, function below put! vector output channel whenever required n items have b...

convert byte array to structure in c -

i developing client-server application in c. i want send structure client character array , convert character array structure @ server side. i have following structures typedef struct mail{ char cc[30]; char bcc[30]; char body[30]; } typedef struct msg_s{ int msgid; mail mail_l; } i want send msg1 client. unsigned char data[100]; struct msg_s msg1 ; msg1.msgid=20; // suppose data in mail structure filled. data = (unsigned char*)malloc(sizeof(msg1)); memcpy(data, &msg1, sizeof(msg1)); write(socketfd , data , sizeof(data)); when data @ server side, how convert structure? i want same in both c , java language. if possible, please suggest me article read this, , name of concept if missing. i see many errors, first, character array declaration inside struct mail doesn't following c convention it should like, typedef struct mail{ char cc[30]; char bcc[30]; char body[30]; } ...

http - How to solve with statuses/update Code 403 => Error 220 ,Your credentials do not allow access to this resource -

my code working functionality of post tweet, follower. last 2 days posting tweet got following error: i treid alot of ways , still t same problem. public function old_old_posttweet($text){ $this -> init(); $return = $this-> twitter -> sendtweet($text); return $return; } first function worked before without problems. public function curl_posttweet($text){ $cmd = "curl --request 'post' 'https://api.twitter.com/1.1/statuses/update.json' --data 'status=maybe+he%27ll+finally+find+his+keys.+%23peterfalk' --header 'authorization: oauth oauth_consumer_key=\"ntnu3bxxxxxxxxbkp2rua\", oauth_nonce=\"8aff955397bxxxxxxxx940cc6ded24\", oauth_signature=\"x8%2b%2foxxx5wm%2bgxxxxxkgxlu6o%3d\", oauth_signature_method=\"hmac-sha1\", oauth_timestamp=\"1395641319\", oauth_token=\"2336351089-5zsk2elxxxxxxxxxxxxxxxxxxxxxcirz0v12ba33\", oauth_version=\...

javascript - How can I send "push notifications" to a specific users webpage? -

i'm not sure begin. i'd able update users current page when user either updates database or sends specific get/post request (i write either way). i thinking server sent events made quick test using php server , realized couple things. first need event loop based server because using php i'd have create loop keep checking database specific change. second realized server intensive should method. so explicitly ask questions... is possible update users current page when else sends request php file on server? how? if need event loop based server best option? node.js? is possible sockets if not sse? sse makes more sense because i'm not looking user feedback. thanks websockets , signalr asp.net you. check out options here

vb.net - AT Command for Searching Signal Quality (Not Strength) -

i trying make application can measure signal, operator sim, apn, , other modem via serialport. want signal quality (not strength) such umts, hspa, hsdpa, or other. knows? if possible, tell me @ command can used on kind of application? at+creg has parameter gives indication of current access technology. documented in section 7.2 of standard @ command reference, ts 27.007. +creg: ,< stat>[,[< lac>],[< ci>],[< act>][,< cause_type>,< reject_cause>]] the parameter "act" has following values: 0 gsm 1 gsm compact 2 utran (= umts) 3 gsm w/egprs 4 utran w/hsdpa 5 utran w/hsupa 6 utran w/hsdpa , hsupa 7 e-utran (= lte)