Posts

Showing posts from February, 2011

c# - Comparing a DateTimeOffSet From DataBase to Current Value -

what want simple. if datetimeoffset of created event older 24 hours want removed database. having huge amount trouble working converting system.linq.iqueryable system.datetime . any appreciated. index of events public actionresult index() { iqueryable<datetimeoffset> b = db.events.select(x => x.eventtime); datetimeoffset currentdate = datetimeoffset.now; if (currentdate > b) { db.events.remove(@event); db.savechanges(); return view(db.events.tolist()); } return view(db.events.tolist()); } my other question how structure requires 24 hour difference in order remove row database. the data table has eventtime datetimeoffset data type. i have been trying use datetimeoffset.compare(currentdate, b); but visual studio isn't liking line well. please if know how compare time database current time. there nothing in regards on site. have spent day on site , have yet find along this. thanks it might ea

android - How do I expose a USB device to the Java API through HAL? -

background: i'm trying integrate new sensor android platform. development purposes, using nvidia jetson-tk1 dev board , spark core. spark core communicates sensor , outputs data serially through usb. at high level, needs are: to able read/write serial data spark core on usb to handle data android service written api accomplish @ high speeds in future when become more experienced @ working hal, may eliminate spark core , use gpio pins on jetson control sensor ic. onto details: i can read data through command cat /dev/ttyacm0 , i'm looking more low-level approach. want use hal communicate device. specifically, want spark core show when cat /proc/bus/input/devices . want able read data using getevent /dev/input/eventxx . the main question: here approach: find or develop usb device driver in native c code use jni compile driver within android source code create hal module (.so binary) hal definition compile android source code kernel

javascript - Can't get json from php -

i beginner in php , wordpress. try make simple plugin can show 3 latest post , show them in page. @ first want array has been encoded in json, , work with js. somewhere in code have mistake or maybe don't understand important. there code return nothing. if delete datatype in ajax, return whole code. advises appreciated. js , php in 1 file. <button onclick='myajax()'>button</button> <script type="text/javascript"> function myajax(){ $.ajax({ type: "get", url: "plug_in.php", data: {action: "call_this"}, datatype: 'json', success:function(data){ alert(data); } }) }; </script> <? //plugin name: plagin //description: plugin getting posts , posts function show_post(){ $args = array( 'numberposts' => 3 ); $post = get_posts($args); $all_post = arra

python - Pygame: Accessing colliding sprite's properties using spritecollide() -

i building top down shooter in style of raiden 2. need know how access enemy object when detect collision using 'spritecollide'. the reason need enemy object can lower energy level every bullet hits them. this dictionary have work with: enemycollisions = pygame.sprite.groupcollide(shipbulletgroup, enemygroup, true, false) here's bullet class: class bullet(entity): def __init__(self, ship, angle): entity.__init__(self) self.speed = 8 self.level = 0 self.image = pygame.surface((bullet_dimensions, bullet_dimensions)).convert() self.rect = self.image.get_rect() self.rect.x = ship.rect.centerx self.rect.y = ship.rect.top self.angle = angle def update(self, enemygroup): if self.rect.bottom < 0: self.kill() else: self.rect.y -= self.speed here's unfinished enemy class: class enemy_1(entity): def __init__(self): entity.__init__(self)

hive - Change tungsten install directory in continuent-tools-hadoop -

hi im using load data in hive hadoop. https://github.com/continuent/continuent-tools-hadoop this gives following error: ls: cannot access /opt/continuent/tungsten/tungsten-replicator/: no such file or directory it obvious installed in tungsten in different folder not default one. where can change url of tungsten directory ? execute ./bin/load-reduce-check -r /mnt1/continuent

“unknown table status: TABLE_TYPE” and related messy stuff over mysql phpmyadmin 4.4.14 (X.A.M.P.P. 5.6.14-0-VC11, Windows 7 x64) -

already existent related question topics useless, since it's different (or older -3.40-) version. .patches don't fit in files described in other posts around web. in addition unknown table status these notices appear every time click on non empty table: notice in .\libraries\tbl_info.inc.php#78 undefined index: rows backtrace .\libraries\menu.class.php#221: include(.\libraries\tbl_info.inc.php) .\libraries\menu.class.php#85: pma_menu->_getbreadcrumbs() .\libraries\response.class.php#308: pma_menu->gethash() .\libraries\response.class.php#388: pma_response->_ajaxresponse() pma_response::response() notice in .\libraries\tbl_info.inc.php#80 undefined index: name backtrace .\libraries\menu.class.php#221: include(.\libraries\tbl_info.inc.php) .\libraries\menu.class.php#85: pma_menu->_getbreadcrumbs() .\libraries\response.class.php#308: pma_menu->gethash() .\libraries\response.class.php#388: pma_response->_ajaxresponse() pma_response::response()

Running arbitrary vim commands from bash command line to script vim -

i want script vim edit files command line. example want along lines of: vim -<some_option> 'iworld<esc>bihello <esc>:wq helloworld.txt<cr>' or: echo 'iworld<esc>bihello <esc>:wq helloworld.txt<cr>' | vim and have save file helloworld.txt body of hello world is possible? i've tried few different approaches none seem it. realize can things vim +plugininstall run ex commands command line, i'd love able string arbitrary motions this can achieved + flag , :normal command: $ vim +"norm iworld" +"norm ihello " +"wq helloworld.txt"

javascript - use $http.get in a service/factory to return a collection -

i try use http.get promise in angularjs service, manipulation on obtained collection , return controller... my question how use $http.get() in service in order obtain , manipulate result before returning controller, in code bellow : the pen code var app = angular.module('myapp', []); app.controller('customersctrl', ['$scope','customer',function($scope, customer) { $scope.odds = customer.odds; }]); app.factory('customer', ['$http', function($http) { var = [{'id':88, 'name':"a"}, {'id':89, 'name':"shoutnotbehere"}]; var odds = []; $http.get("http://www.w3schools.com/angular/customers.php") .then(function(response) { = response.records; }); angular.foreach(all, function(c, i) { if (i % 2 == 1) { odds.push(c); } }); return {odds: odds}; }]); <script src="https://ajax.googleapis.com/ajax/li

citrus framework - Extract and unmarshal JSON payload from response -

i'm trying write citrus tests restful endpoint producing , consuming application/json content, , i'm not sure how responses unmarshalled java pojo (using jackson or whatever (un)marshaller citrus supports). e.g. in rest-assured, can write uploadresponse response = when().post("/file").as(uploadresponse.class); is there equivalent in citrus? i can find examples using validate() or extractfrompayload() , don't cover use case, since don't want operate on scalar members embed entire response object in request object subsequent test step. you can this: http().server(testserver) .post("/file") .validationcallback(new jsonmappingvalidationcallback<uploadresponse>(uploadresponse.class) { @override public void validate(uploadresponse payload, map<string, object> headers, testcontext context) { // payload object } }); the jsonmappingvalidationcallback a

css - Extended font-face in I.E. 5 -

i have css using external font called ocr.a.extended . have make font supported in i.e. 5 not supporting whereas in higher versions of i.e., displaying fine. using following css.. @font-face { font-family: ocr; src: url(../ocr.a.extended.woff); src: url(../ocr.a.extended.woff) format("opentype"); } do need go other file format except .woff .eot or .svg highly appreciated..

rest - Determining URLs for URI specified in XACML 3.0 specification -

currently i'm working on project exposes xacml pdp rest api. allow clients send rest requests containing various xacml request related properties , retrieve decisions on them. i have implemented services, need align rest endpoints correctly defined in rest specification xacml 3.0 ( http://docs.oasis-open.org/xacml/xacml-rest/v1.0/csprd03/xacml-rest-v1.0-csprd03.html ) in document, defines various uris each resource ex: rest entry point uri (as in section 2.2.1) urn:oasis:names:tc:xacml:3.0:profile:rest:home what need know corresponding url uri assuming service hosted in https://example.com/xacml is https://example.com/xacml/home ? thank you according rest profile of xacml (you can tweet author ), there several endpoints need support: entry point (identified urn:oasis:names:tc:xacml:3.0:profile:rest:home): root of web service. in case, https://example.com/xacml or perhaps https://example.com/xacml/api (if wanted have ui of kind @ top-level) the pd

javascript - NodeJS AngularJS Express small demo error -

im doing small tutorial online , i'm @ point wants me display data using http controller while sample data in server file.i able pull data controller.js file when try using .get work , doesn't show data on local hose. think issue in controller.js file been few hours debugging.. not seeing issue.. i'm sure stupid. controller.js file var myapp = angular.module('myapp', []); myapp.controller('appctrl', ['$scope', '$http', function($scope, $http) { console.log("hello world controller"); $http.get('/savinglist').success(function(response){ console.log("got data"); $scope.savinglist = response; }); }]); server.js file var express = require('express'); var app = express(); app.use(express.static(__dirname + "/public")); app.get('/savinglist', function (res, req){ console.log("i recieved request") person1= { name: 'tim', price: '

java - How to close child jFrames automatically when i close the parent? -

i have parent jframe , 2 'child' jframes in package jframe. imagine open parent jframe , it's child jframes - 3 forms open. close parent jframe. what should close child frames automatically after close parent jframe? here code: class parent: public class parent extends jframe { public parent() { jbutton child1 = new jbutton("child1"); child1.addactionlistener(new actionlistener() { @override public void actionperformed(actionevent e) { new child1().setvisible(true);; } }); jbutton child2 = new jbutton("child2"); child2.addactionlistener(new actionlistener() { @override public void actionperformed(actionevent e) { new child2().setvisible(true); } }); jbutton closealljframe = new jbutton("closealljframe"); closealljframe.addactionlistener(new actionlistener() { @override public void actionperformed(actionevent e)

windows - How to use Saxon/C to execute an XQuery from PHP? -

the saxon/c documentation begins saying; saxon/c on beta release: offering saxon-he product c/c++ programming platform. apis offered run xslt 2.0 , xquery 1.0 c/c++ or php applications. which implies saxon/c can used execute xquery php, can it? there saxon/c documentation xslt, not xquery. can saxon/c used run xquery php , if so, there documentation? edit : i'm running windows version of saxon/c. the php api documentation on saxon/c has need: http://www.saxonica.com/saxon-c/php_api.xml also check out examples in samples directory in download zip file. see file xqueryexamples.php

java - ActiveMQ fails to create local registry when started from Maven in console -

i having trouble initializing activemq (activemq-core:5.7.0) when running unit test maven console. working fine when run intellij. result intellij runner: 2016-07-04 14:21:22 debug jndihelper:90 - {java.naming.provider.url=vm://localhost, java.naming.factory.initial=org.apache.activemq.jndi.activemqinitialcontextfactory, java.naming.security.authentication=true} 2016-07-04 14:21:22 debug managementcontext:492 - creating rmiregistry on port 1099 2016-07-04 14:21:22 debug managementcontext:507 - not using jre 1.4: mx4j.tools.naming.namingservice 2016-07-04 14:21:22 debug managementcontext:522 - created jmxconnectorserver javax.management.remote.rmi.rmiconnectorserver@52ac6ca7 2016-07-04 14:21:22 debug managementcontext:120 - starting jmxconnectorserver... result mvn test: 2016-07-04 14:00:26 debug jndihelper:90 - {java.naming.provider.url=vm://localhost, java.naming.factory.initial=org.apache.activemq.jndi.activemqinitialcontextfactory, java.naming.security.authentication=tru

java - Vaadin combobox with different properties to display and bind -

i have 2 domain classes public class { private string nick; private string bid; // getters & setters } public class b { private string id; private string name; // lot of other fields // getter , setters } the idea a not save complete b , id. now create form in vaadin (7.6.7) create new a . there limited number of b objects available, have combobox, user can select b . as id of b non-user-friendly field, have combobox, bound property bid in a object , presents property name of b . i cannot figure out how code shall like. formlayout layout = new formlayout(); beanfieldgroup<a> databinder = new beanfieldgroup(a.class); field<?> nickfield = databinder.buildandbind("nick"); layout.addcomponent(nickfield); combobox bbox = new combobox("b"); list<b> allbs = ... // bs; allbs.stream().foreach(bbox::additem); databinder.bind(bbox, "bid"); // not work i know problem have bound combobox type b field of

mysql - cursor throwing nullpointer when called from content provider -

im trying query data 2 different tables using loadermanager in listfragment . tables definetely have data, checked, reason query/cursor returning null. suspect syntax issue im not entirely sure. ran same query in mysql workbench, , worked. iv tried running query this: cursor = db.query("customer, appointment", new string[]{"fullname", "physicaladdress", "date","time"}, "customer.id in(?)", new string[]{"select customerid appointment"},null,null,null); and this: cursor = db.rawquery("select fullname, physicaladdress, date, time customer, appointment customer.id in(select customerid appointment);", null); but everytime line of code runs: cursor.setnotificationuri(getcontext().getcontentresolver(), uri); i nullpointer. in case means anything, im not using framelayout , dynamically adding listfragment. iv defined in activities xml file. appreciated. please let me know if iv left out. databas

html - how to align the content of a box -

i have 2 paragraphs in html code shows: <div class="mainhead"> <p class="paragraph">this paragraph</p> <div class="info"> <p><span class="infomail">info@zazzoo.co.za</span> <span class="infonumber">082 888 7385 </span></p> </div> </div><!-- end of mainhead --> and following css: .mainhead { background-color: #d9edf7; width: 100%; display: flex; } .info{ text-align: right; } .mainhead .parapgraph{ text-align: center; } how can align div info far right , keep paragraph in center? here goes jsfiddle : https://jsfiddle.net/wosley_alarico/60a8qw5l/ to make p centered , not affected width of .info can use position: absolute , add float: right on .info . can use overflow: hidden clear float , fix height. .mainhead { background-color: #d9edf7; width: 100%; position: relative; ove

opengl - Create a cube with a 3d mesh, using a 2d array -

Image
i need create cube using mesh using these properties: "a two-dimensional array containing mesh vertices. each entry of array specifies vertices of 1 row of mesh. arrays rows must have same length. there must @ least 2 rows, , each row must have @ least 2 vertices" if think representation of cube made of paper: you can see 2 meshes, 3 orizontal square , 3 vertical. in case have use 2 meshes, while need one. i'd not have overlap, , not able find solution. best option i've found consists in filling array 9 rows. each rows contains 2 entry, , in way creating surface of cube. i'm attaching few images explain creates first rows, till when reach overlapping point: i guess problem has no solution, in case of have idea open proposal. (i'm sorry order may not accurate) var row0 = []; x, y, l x+t, y, l var row1=[] x, y, l+400 x+t, y, l+400 var row2=[] x, y+t, l+400 x+t, y+t, l+400 var row3=[] x, y+t, l x+t, y+t, l var row4

webserver - Network structure for online programming game with webSockets -

problem i'm making game provide piece of code represent agent program of intelligent agent (think robocode , like), browser-based. being ai/ml guy part, knowledge of web development was/is pretty lacking, i'm having bit of trouble implementing whole architecture. basically, after upload of text (code), naturally part of client-side, backend responsible running core logics , returning json data parsed , used client drawing part. there isn't need multiplayer support right now. if model after robocode's execution loop, need separate process each battle assigns different agents (user-made or not) different threads , gives them execution time each loop, generating new information given agents data drawing whole scene. i've tried think of way structure multiple clients, servers/web servers/processes [...], , came multiple possible solutions. favored solution (as of right now) clients communicate node.js server works kinda interface (think websocketd) unique pr

Using variables in Concordion markdown -

Image
when writing test specification in concordion, want include output of call in script. example, want test rest service posting new object , verifying returned object includes own uri string. in these circumstances, think it's right format of uri string included in test script rather buried within fixture. assuming object named newproduct has been created somehow, write this: when [post new product](- "#response=post(#newproduct)")<br/> [product record](- "#product=getcontent(#response)") returned<br/> , [id](- "c:set=#productid=getid(#product)") [ ](- "c:echo=#productid)")<br/> , hal reference matches [products/#productid](- "?=gethalref(#product)") unfortunately variable productid in last line not resolved. approach recommend? i'd recommend stating static format of uri string in specification rather actual values (which dynamic , lead different spec each time). the fixture can compare ex

qt - QUdpSocket::writeDatagram, wait for buffer free -

i'm using method qudpsocket::writedatagram , sending lot of data. when socket full, method return -1. possible somethind select() qudpsocket? while(!counterlist.empty()) { countervalueptr value = counterlist.dequeue(); if (mudpsocket->bytestowrite() <= 1<<13) { const qbytearray datagram = todatagram(*value); qint64 sentbytes = 0; try { sentbytes = mudpsocket->writedatagram(datagram, qhostaddress(msettings->getconnectionip()), msettings->getconnectionport()); } catch(...) { emit datalost(); qwarning() << "exception"; throw; } qdebug() << datagram; if(sentbytes == -1) { qstring errormsg = geterrormsg(wsagetlasterror()); qwarning() << "socketerror (" << mudpsocket->error() << ") : " << mudpsocket->errorstring() <&

ruby on rails - Google maps autocomplete js is working on localhost but not on heroku -

i'm junior ruby on rails developer. developed web app uses google maps javascript api , use autocomplete function on form input. the autocomplete works fine on localhost not work anymore after deploying on heroku. here html.erb below. perfect information, form in page footer. form partially hidden , visible part corresponds button used upload video file. once button has been clicked , video file has been chosen, display modal containing rest of form. that's 'text_field_tag' (with id = "user_input_autocomplete_address") displayed , autocomplete should work. <% if user_signed_in? %> <div class="footer-check hidden-md hidden-lg"> <div class="container text-right"> <div class="row"> <div class="flexbox"> <div class="footer-home active"> <%= link_to root_path %> <i class="fa fa-home" aria-hidden=&

ember.js - Ember 2.1.0 render partial if index page else another partial -

in templates/application.hbs able set condition check if index page render navigation it, else render set of navigation in-app pages. same footer. best way check this? also, whether user login or not doesn't matter. my research has lead outdated code or convention. i'm new ember appreciated. here emblem attempt, not working: if eq currentroutename="index" = partial 'partialname' else = partial 'partialname2' second attempt works: first run: ember install ember-truth-helpers add application template: if (eq currentroutename "index") = partial 'partialname' else = partial 'partialname2' the application controller has property currentroutename . can choose navigation render based on value. in application.hbs {{#if (eq currentroutename "index")}} render navigation index page {{else}} render navigation other pages {{/if}} the eq helper comes ember-truth-helpers

python - Iterating through array -

i have array of bools , want swap entries numbers. false => 0 true => 1 i have written 2 different pieces of code , know, 1 better , why. not solving problem, learning. arr = [[true,false],[false,true],[true,true]] i,row in enumerate(arr): j,entry in enumerate(row): if entry: arr[i][j] = 1 else: arr[i][j] = 0 print(arr) and second approach: arr = [[true,false],[false,true],[true,true]] in range(len(arr)): j in range(len(arr[i])): if arr[i][j]: arr[i][j] = 1 else: arr[i][j] = 0 print(arr) i read there ways importing itertools or similar. not fan of importing things if can done “on-board tools”, should rather using them problem? let's define array: >>> arr = [[true,false],[false,true],[true,true]] now, let's convert booleans integer: >>> [[int(i) in row] row in arr] [[1, 0], [0, 1], [1, 1]] alternatively, if want more flexible get

Java: How to use Command Line Arguments to add integers in a text file? -

i need use clas control adding of integers in file. first argument number of integers add. second arg other line skip when adding them( 3 2 should output 72 because adds 3 integers whilst skipping every 2nd line. text file 7 16 55 4 10 i need on how implement int m in code skips specified line. int n = integer.parseint(args[0]); int m = integer.parseint(args[1]); (int = 0; < n; i++) { x = in.next(); sum = sum + integer.parseint(x); } system.out.println(sum); what store numbers until n*m in array. easier way since can iterate , sum of numbers incrementing n something this: int count = 0, sum = 0; (int = 0; < num.length && count < m; += n) { sum = sum + integer.parseint(num[i]); count++; } with 2 2 -> sum = 62 , 3 2 -> sum = 72 demo . tried simulate trying without reading file using online ide.

for loop adding values with similar sign in a numeric vector in R -

create numeric vector x: x <- c(1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1) class(x) assign variable first value of x: a <- x[1] iterate through x , add elements similar in sign a: for(i in 2:length(x)) { if (sign(x[i]) == sign(x[i-1])) {a <- + x[i]}} somehow, a becomes 4 instead of 3! of why happening appreciated. use rle function x <- c(1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1) <- x[1] out <- rle(x) with(out, lengths[values == a]) # [1] 3 1 2 1 1 2 2 2 first change in sign: a <- with(out, lengths[values == a])[1] # [1] 3 if reverse signs: x <- -x # [1] -1 -1 -1 1 -1 1 1 -1 -1 1 -1 1 1 -1 1 1 -1 -1 1 -1 -1 1 -1 -1 1 <- x[1] out <- rle(x) <- with(out, lengths[values == a])[1] # [1] 3

c++ - Can only see a single white point CUDA/OpenGL interop -

i'm trying convert c++ code cuda code program read data external file , draw 3d matrix. i'm converting pieces of code @ time , fail trying draw small 3d matrix made of red points. can see single white point , that's code: #define buffer_offset(i) ((char *)null + (i)) gluint bufferobj; cudagraphicsresource *resource; int size=5*5*7; int window_dim=600; __global__ void kernel(float4 *ptr, int sizei) { const unsigned long int blockid = blockidx.x //1d + blockidx.y * griddim.x //2d + griddim.x * griddim.y * blockidx.z; //3d const unsigned long int threadid = (blockid * blockdim.x + threadidx.x); if(threadid<sizei ) { ptr[threadid].x=threadidx.x+0.5f; ptr[threadid+sizei].x=1.0f; ptr[threadid].y=blockidx.y+0.5f; ptr[threadid+sizei].y=0.0f; ptr[threadid].z=blockidx.z+0.5f; ptr[threadid+sizei].z=0.0f; ptr[threadid].w=1.0f; ptr[threadid+sizei].w=1.0f; } } static void key_func( unsigned char key, int x, int y ) { swi

html - Unable to use a directive inside another directive in Angular2 -

i have html page i'm loading directive <kms-dir1></kms-dir1> in component 'kmsdir1.html' loaded i.e templateurl, have defined , working fine, have requirement use 1 more directive (let's kmsdir2) in kmsdir1.html in kmsdir1 component have specified directives , tried it's not loading so have defined directive in parent page , using input , output params , making visibility hidden , show. is there alternative???? i.e load directive inside 1 more directive fyi: didn't see error in console. page not getting loaded (blank) i see 2 potential issues: you don't define directives directives property of component want use them the selectors specify don't match element in component.

binary - What is wrong with my IEEE 754 floating point representation? -

Image
i being asked in homework represent decimal 0.1 in ieee 754 representation. here steps made: however online converters, , answer on stack exchange suggests otherwise. put solution: s eeeeeeee mmmmmmmmmmmmmmmmmmmmmmm 0 01111011 10011001100110011001101 the difference number 1 @ right. why isn't 1100, why 1101? as njuffa said in comment, rounding explanation difference see. converters produce nearest floating-point value decimal number put in. ieee 754 standard recommends rounding mode taken account conversions 1 base (such decimal binary), , default rounding mode “to nearest”. the 2 closest single-precision floating-point values 1/10 1.10011001100110011001100×2 -4 , 1.10011001100110011001101×2 -4 (below , above 1/10). digits cut off “11001100…”, indicating real 1/10 closer upper bound lower bound(if remaining digits had been “100000000…”, real number have been in-between two). reason, upper value 1.10011001100110011001101×2 -4 chosen conversion of 1/10 bin

javascript - Can't get grunt-browser-sync in Cloud9-IDE to work -

Image
i have php-project in cloud9-ide want run grunt , browser-sync according to: http://fettblog.eu/php-browsersync-grunt-gulp/ my gruntfile.js looks this: module.exports = function(grunt) { grunt.loadnpmtasks('grunt-browser-sync'); grunt.loadnpmtasks('grunt-php'); grunt.loadnpmtasks('grunt-contrib-sass'); grunt.loadnpmtasks('grunt-contrib-watch'); pkg: grunt.file.readjson('package.json'), grunt.initconfig({ sass: { dist: { files: { 'assets/css/main.css' : 'assets/css/main.scss', } } }, watch: { sass: { files: 'assets/css/layout/*.sass', tasks: ['sass:dist'], } }, php: { dist: { options: { hostname: '0.0.0.0', port: 8080, base: '/home/ubuntu/workspace/lifeaqua', open: true, keepalive: true } } }, browser

java - Openshift jobssas 7 cloud was building the war but not deploying it -

Image
openshift building war not deploying it if 1 wants deploy generated war, must copied command cp app-root/runtime/repo/target/gamestore-0.0.1-snapshot.war app-root/dependencies/jbossas/deployments/root.war how copy generated war automatically ? firstly, openshift jbossas7 cloud require presence of pom.xml build code after push throw git push command. secondly, auto deploy generated war after building write in pom.xml <profiles> <profile> <!-- when built in openshift 'openshift' profile used when invoking mvn. --> <!-- use profile openshift specific customization app need. --> <!-- default put resulting archive 'deployments' folder. --> <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html --> <id>openshift</id> <build> <finalname>gamestore</finalnam

mysql - How to get last record for group? -

i have table called tbl_chat , tbl_post. tbl_chat given follows. |--------------------------------------------------------------------------------| | chat_id | message | from_user | to_user | post_id |send_date | |--------------------------------------------------------------------------------| | 1 | hi | 23 | | 35 | 2016-04-01 17:35| | 2 | test | 24 | | 35 | 2016-04-02 01:35| | 3 | thut | | 23 | 35 | 2016-04-02 03:35| | 4 | test | | 24 | 35 | 2016-04-02 12:35| | 5 | hi | 23 | | 35 | 2016-04-03 17:35| |--------------------------------------------------------------------------------| now, in chat table can see 3 users interacting each other. admin (a), user id = 23 , user = 24. so there 2 chat thread. one between , 23 another between , 24. i want query show 2 ch