Posts

c# - Translate camera to rotate left ('Q') and right ('E') -

i'm trying translate camera when press q , e want example when press 'q' camera translate left , let me give movement camera rotation, that tried this: public class cameramove : monobehaviour { public gameobject player; //public variable store reference player game object private float movespeed; private vector3 offset; //private variable store offset distance between player , camera // use initialization void start () { //calculate , store offset value getting distance between player's position , camera's position. offset = transform.position - player.transform.position; } void update(){ if (input.getkey (keycode.q)) transform.position += vector3.up * movespeed * time.deltatime; else if (input.getkey (keycode.e)) transform.position += -vector3.up * movespeed * time.deltatime; } // lateupdate called after update each frame void lateupdate () { // set position of camera's transform same player...

c# - UWP Crash on ContinuousRecognitionSession_Completed without error -

i using microsoft's speech recognition library in uwp app. speech recognition works fine on desktop. however, when runs on windows phone application crashes when enters continuousrecognitionsession_completed. private void continuousrecognitionsession_completed(speechcontinuousrecognitionsession sender, speechcontinuousrecognitioncompletedeventargs args) { //code stuff } then application on phone crashes without error. visual studio continue run time before giving exit code. when exit code receive either 'access violation', believe code '0xc0000005', or breakpoint exception. i @ wits end , if has tip on how fix appreciated!

php - How to Set A Custom Load order For My User display Table based on Ranks -

so building new cms community , have run minor issue. want able list ranks highest in chain of command lowest, cannot work out how using string based ranks. <?php include "dbh.php"; include "header.php"; $sql = "select * users_leo"; $result = $conn->query($sql); $row = $result->fetch_assoc(); $rank = $row["rank"]; $department = $row["department"]; ?> <div class="login-page"> </div> <div class='form'> <?php $sql = "select * users_leo"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo "<table> <tr> <th>in-game name</th> <th>rank</th> <th>department</th> <th>profile</th> </tr>"; while($row = $result->fetch_assoc()) { echo "<tr>"; ...

mysql - Merge two queries to get the combined value in SQL -

i have merge 2 sql queries values in 1 place. want show year date , week date show amounts , units in 1 table same cat sql query select `empsid`, `cat`, `chk_date`, sum(amount) currentamount, sum(units) currentunits `pays` `empsid` = 'semlad01' , `cat` in ('salary pay', 'truck allowance', 'expense reimbursement', 'bonus (accrued)', 'phone reimbursement') , date(`chk_date`) = '2016-11-12' group `cat` second query: select `empsid`, `cat`, `chk_date`, sum(amount) ytdamount, sum(units) ytdunits `pays` `empsid` = 'semlad01' , `cat` in ('salary pay', 'truck allowance', 'expense reimbursement', 'bonus (accrued)', 'phone reimbursement') , date(`chk_date`) <= '2016-11-12' group `cat` table structure empsid cat ytdamount ytdunits currentamount currentuni...

node.js - Accesing Ghost AWS Ubuntu Server in production -

Image
i'm trying access ghost blog on aws ubuntu server via http://x.x.x.x:2368 , site can't reached. here steps made: - git cloned myblog - cd myblog , npm install --production - npm start or npm start --production console says site running ok config file var path = require('path'), config; config = { production: { url: 'http://127.0.0.1:2368', mail: {}, database: { client: 'sqlite3', connection: { filename: path.join(__dirname, '/content/data/ghost.db') }, debug: false }, server: { host: '127.0.0.1', port: '2368' } }, development: { url: 'http://127.0.0.1:2368', database: { client: 'sqlite3', connection: { filename: path.join(__dirname, '/content/data/ghost-dev.db') }, ...

java - Hibernate HQL issue after migration from Jboss4.2 to Jboss7.2 -

recently have migrated jboss4.2 jboss 7.2. exact same hql query running fine jboss4.2. in jboss7.2 hql query not running in jboss7.2, it's giving error have mentioned below: no persistent classes found query class: select distinct pf.projectformid com.gsk.rd.craw.model.projectform pf left join pf.contacts c pf.createdby=:mudid or pf.modifiedby=:mudid or c.mudid=:mudid java.lang.illegalargumentexception: org.hibernate.queryparameterexception: not locate named parameter 18:33:04,338 trace [org.hibernate.engine.query.spi.queryplancache] (http-/127.0.0.1:8080-1) unable locate hql query plan in cache; generating (select distinct pf.projectformid com.gsk.rd.craw.model.projectform pf left join pf.contacts c pf.createdby=:mudid or pf.modifiedby=:mudid or c.mudid=:mudid ) 18:33:04,338 trace [org.jboss.modules] (http-/127.0.0.1:8080-1) finding class com.gsk.rd.craw.model.projectform module "deployment.craw.ear:main" service module loader 18:33:04,338 trace [org.jboss...

c++ - How do I pass a truly immutable 2D array to a function? -

i have function: void foo(const double *const *matrix, unsigned num_rows, unsigned num_columns){ //matrix[0][0] = 5; // error: expression must modifiable lvalue (unsigned = 0; < num_rows; i++) delete matrix[i]; delete matrix; } ...wherein function cannot change values @ given index in matrix, yet still able delete matrix or of rows . there way pass in 2d matrix , guarantee not altered in way? edit: doesn't there's way this, i'll switch using vectors. no. delete can called on pointer if it's passed const & or declared const because pointer not going changed. there no way prevent doing unsigned char *p = (unsigned char *)your_precious_data_pointer; *p = 42; get on it. const correctness designed detect accidental mistakes, not preventing intentional actions programmers. it's not security. it can debated if it's tool preventing accidental mistakes.