Posts

sql - Oracle - how to calculate sum of highest salary for each dept -

as far get, getting max sal of each dept: select ename, sal, deptno emp out sal = ( select max(sal) emp inside out.deptno=inside.deptno ); this returns 4 results, want sum of 4 results, how do that? seems not work: select ename, sum(sal), deptno emp out group deptno, sal, ename having sum(sal) = ( select max(sal) emp inside out.deptno=inside.deptno ); it returning same result first query. select sum(max_sal) total_sum ( select deptno, max(sal) max_sal emp group deptno ) x to highest salary every department can group department , use max() highest. use subquery sum these up.

vba - ms access form closing ask save yesnocancel -

i have put vba in unload form event in ms access 2010 private sub form_unload(cancel integer) dim strmsg string dim iresponse integer ' specify message display. strmsg = "do wish save changes?" & chr(10) strmsg = strmsg & "click yes save or no discard changes." ' display message box. iresponse = msgbox(strmsg, vbquestion + vbyesnocancel, "save record?") ' check user's response. if iresponse = vbyes ' undo change. docmd.runcommand accmdsave end if if iresponse = vbno ' undo change. docmd.runcommand accmdundo end if if iresponse = vbcancel ' undo change cancel = true end if end sub if data changed above code working fine, yes save & close, no undo & close , cancel cancel event , remain on form when data unchanged yes button working fine, no button not close form where m mistaking ? your question vague bec...

android - App above all anothers -

Image
with functionality of android possible make app callable everywhere facebook messenger chat: you cannot have "full app" above others. however, can achieve convincing simulacrum trick. applications android.permission.system_alert_window (displayed "draw on other apps" in play store) can create windows service , show them on other content. there open source library called standout provides behavior in easy use manner. might want take @ it.

sublimetext2 - How to use multiple cursors efficiently in this case? -

Image
the stage set: i'm add 3 li s ul , think application of multiple cursors in st2. i'm not sure how this. at step 1. i'd able is: "open 2 new lines 2 new cursors". don't think possible instead tried opening 2 new lines manually (step 2) , applying multiple cursors using ctrl+shift+up except cursors end in not-so-ideal spot (step 3). even if hold cmd , click cursors end in same not-so-ideal spot (step 3). question how can efficiently apply multiple cursors situation? trying harpreet's technique doesn't seem work me: i think open-ended question. in first attempt, if replace 2 of enters ctrl+shift+d (duplicate_line), find when multi cursor (select_lines), give positioning wanted. the cause of problem original 3 empty lines aren't same (due whatever indentation mechanism). , best way of using multi-cursor using them on structurally identical lines. of course in practice, depends on cursor is. example if near other < li...

node.js - WebSocket Streaming dual videos -

wanted clear few questions websocket. is possible stream videos server client , client server @ same time...something video calling? can server stream 2 videos single client @ time? regarding first question, yes can. there wrappers simplify task such binaryjs . as per second question, require little configuration. once bidirectional link between client , server established, client treat every incoming message part of same stream. separating or multiplexing 2 videos in same stream have carry mark client separate it. it better idea open new connection (with same server) stream second video.

php - How do I set whether a form redirects to a new page or not? -

so i'm trying create simple log in page php , html . it's pretty simple. first, user inputs username , password, clicks submit button. if username/password combo invalid, "invalid log in." printed, , user redirected log in page. if username/password combo valid, "logging in..." printed, , user redirected page. all post data must kept when redirecting . i can't figure out how change form's action. code snippet below. please past potential sql injections. deal them later. <form action="<?php echo htmlspecialchars($_server['php_self']); ?>" method="post" id="form"> user name:<input type="text" name="username" id="username"> password:<input type="password" name="password" id="password"> <input type="submit" name="submit" id="submit" value="submit"> <input type="reset...

playframework - find a single document with play+reactivemongo -

function receives author object in request def login = action.async (parse.json) { request => request.body.validate[author].map { author => val query = json.obj("username" -> "222") val obj = collection.find(query).one[author] obj.map { author => ok("welcome").withsession ( "username" -> "ok") } }.getorelse(future.successful(badrequest("invalid json"))) } always results in bad request, hard coded username. what's wrong here? changed login post. seems working now. post /author/login @controllers.authors.login