Posts

Showing posts from February, 2010

android - Why text is not bold when passing the style through custom view attributes? -

suppose have .xml style: <style name="materialpreviewdetailstextsmall"> <item name="android:layout_marginleft">@dimen/material_margin</item> <item name="android:textcolor">@color/material_preview_backgroud</item> <item name="android:textsize">@dimen/material_normal_smal_text</item> <item name="android:textstyle">bold</item> </style> i pass custom view through attributes: <pl.valueadd.ledoc.view.viewpreviewrow ... app:view_title="@string/equipment_overview_id_label" app:view_title_style="@style/materialpreviewdetailstextsmall"/> inside custom view obtain styled attributes , apply textview : public class viewpreviewrow extends relativelayout { textview tvtitle; public viewpreviewrow(context context, attributeset attrs) { super(context, attrs); init...

For Node.js applications, when to use port 3000 vs 8080? -

i have been reading on tutorials, , although of them use port 3000 node applications... of them use port 8080 instead. wondering recommended practice, , under circumstances should use other. guidelines? there isn't official node.js end, in, there aren't official remarks pertaining this. you'd find many people who'd confused using port 80 , 443 http , https respectively standard. standard standard pc , these details revealed in document released in 1994 support of t.b. lee. for general network usage try not use ports bellow 1024 otherwise you'd have have root access on network server run process. other guy said, use unused port , you'll fine above 1024 or else you'd need root access. i'd suggest use reverse proxy engine make things more easier , suitable. preferably nginx, they'd have multiple instances of server which'll utilize server properly. although isn't necessary make use of reverse proxy because things work without ...

javascript - Angular Js ui.bootstrap tabs customization -

i using angular js ui.bootstrap in project , want add tabs using ui bootstrap. using ui.bootstrap directive tabs. there no ul li content inside angular ui bootstrap tag. <uib-tabset active="active"> <uib-tab index="0" heading="static title 1">static content 1</uib-tab> <uib-tab index="0" heading="static title 2">static content 2</uib-tab> <uib-tab index="0" heading="static title 3">static content 3</uib-tab> </uib-tabset> i want add span tag inside tag in tabs. output want. <li ng-class="{active: active, disabled: disabled}" index="0" heading="static title 1" class="ng-isolate-scope active"> <a href="" ng-click="select()" uib-tab-heading-transclude="" class="ng-binding"> <span class="badge">5</span>static title 1 </a>...

c++ - CUDA Compute Capability Backwards Compatibility -

i working cuda code compiled compute capability 5.2. machine happens have compute capability 5.2 gpu (geforce gtx 970). however, question is: code compiled compute capability 5.2 still run on machine compute capability low 3? (assuming code never violates limitations of lower compute capability shared memory differences, etc.) the 1 word answer no. as general rule, can run code compiled lower compute capabilities on higher compute capability hardware, not other way around. if compile compute 5.2, should run on future hardware, not on older hardware.

javascript - Where should i store my JSON Web Token for a 'non-singlepage' frontend application -

i've built simple rest api hapijs using jwt auth method. want build pure es6 frontend, not have spa (there more 1 .html file). my question: best way store jwt after login. local storage, cookie ? if store in cookie, you'll vulnerable csrf attack, because browser automatically send token each request. see more information on these type of attacks: https://en.wikipedia.org/wiki/cross-site_request_forgery i recommend storing in localstorage , sending token via head of requests. note : browser doesn't automatically you! example: x-access-token: bearer -jwt goes here-

php - How to check auth user in laravel subdomain? -

i have project it's backend built in laravel 5.2 , frontend built in php. please check folder structure below it's in localhost. backend : http://crm.test.dev root folder, laravel5.2 -> public ->index.php frontend: http://test.dev url point laravel5.2 -> public -> frontend -> index.php my purpose is, if user(admin) logged in backend( http://crm.test.dev ) , not signed out. same user accessing frontend( http://test.dev ") @ time need show alert logged in backend( http://crm.test.dev ). frontend->index.php require __dir__.'/../../bootstrap/autoload.php'; $app = require_once __dir__.'/../../bootstrap/app.php'; $kernel = $app->make(illuminate\contracts\http\kernel::class); $response = $kernel->handle( $request = illuminate\http\request::capture() ); $isauthorized = auth::check(); $user = auth::user(); echo $user; actually issue config -> session.php {'domain' => null,} . update...

android - Apply matrix from one bitmap to another bitmap with different dimension but with same preview result -

Image
i creating simple preview application display different bitmap dimension. i want copy first bitmap matrix , use second bitmap larger dimension. i want preview of second image of first one. how apply matrix second image when applied on second image higher resolution, preview same first image. searching week didn't find luck put here. hope can you.

android - SetLayoutParams In View Cannot be Applied to int -

Image
i'm trying set layout params view component, android studio shows me error setlayoutparams in view cannot applied int . first time i'm experiencing without problem in earlier versions of android studio. why , solution? you have initialize new object 2 parameters . use .... tt.setlayoutparams(new viewgroup.layoutparams( viewgroup.layoutparams.wrap_content, viewgroup.layoutparams.wrap_content)); instead of this.... tv.setlayoutparams(viewgroup.layoutparams.wrap_content); these constructor viewgroup note:-you applying int instead of view. viewgroup.layoutparams.wrap_content int value value -2.

git - How can i compile kobotoolbox/odk collect in Android Studio? -

i have basic understanding of git , have been using github , bitbucket trying source github ! not understand given instructions in read me.i have done research , have found no solutions. things have tried include importing project android studio copy pasting source code new project i have figured out process, here steps if 1 requires them launch git console make new directory mkdir [directory name] change directory cd [directory name] clone repos git clone https://github.com/opendatakit/google-play-services.git git clone https://github.com/opendatakit/collect.git git clone https://github.com/opendatakit/gradle-config.git these automatically set these projects tip of master. change gradle-config @ version required collect/settings.gradle (e.g., 40) cd gradle-config git checkout 40 (4) open android studio ...new /import project... collect/build.gradle

Dynamic Google Analytics Account in GTM -

i new gtm , in learning phase. wanted implement gtm on 1 of websites , requirement based on url, analytics shall sent different ga accounts. below example url gaaccount ------------------------------------ http://domain.com/abc ua-xxxxxabc http://domains.com/def ua-xxxxxdef http://domain.com/xyx ua-xxxxxxyz http://domains.com/qwe ua-xxxxxqwe i tried make lookuptable in gtm same mentioned above , operate on basis of url problem here actual url contains long encrypted string below http://domain.com/abc/!ut/b/dasdasd654654weewexx879987xxxsswwo_adasdw_wewqewqe so lookuptable can not match url , error in gtm console undefined account i know page url variables provided gtm not sure how combine page hostname , page path 1 variable , strip unwanted string page path , match exact url. lookup table did not work becuase matches entire url given input check http://domain.com/abc equals http://domain.com/abc/!ut/b/dasdasd654...

swift - Why are objects in the same SKNode layer not interacting with each other? -

Image
i have less 1 year using spritekit didn't use sknodes layers before until recently. i have sknode layer holds of fish , user's position, example: var layermaingame = sknode() layermaingame.zposition = 50 layermaingame.addchild(userposition) layermaingame.addchild(pipfish) addchild(layermaingame) the interaction whether user touched fish or not handled function, checking if frames crossed: if cgrectintersectsrect(cgrectinset(node.frame, delta.dx, delta.dy), self.userposition.frame) { print("you got hit \(name).") gameover() } it works. interaction between userposition , pipfish works. doesn't work fish added game progresses. have function spawning different types of fish in intervals this: func spawnnew(fish: skspritenode) { layermaingame.addchild(fish) } the interaction between user , fish added same layer later in game not work. can pass right through them , no game on happens. when remove entire layermaingame variable , add them sce...

javascript - fetch should not be in the action || reducer? -

i'm doing right if put fetch in componentdidmount () ? folly put fetch action or reducer? why {this.props.data.name} not work without setting of standard parameters data in reducer? without (state = {data: { }}, action) ?! reducer const reducer = (state = { data: { } }, action) => { switch (action.type) { case 'experiment': return { ...state, data: action.data } break default: return state } } export default reducer component import react, { component } 'react' import { connect } 'react-redux' class persistent extends component { componentdidmount () { fetch('https://api.github.com/users/reactjs').then((response) => { response.json().then((json) => { this.props.dispatch({ type: 'experiment', data: json }) }) }) } render () { return ( <div> <ol> <li>{th...

javascript - applying jQuery UI dialog to classes -

having trouble getting example work classes. have classes each bring separate dialog box different information in them when clicked... https://jqueryui.com/dialog/#animated here fiddle , code. html... <div class="foo">click me <div class="bar">blahblahblah</div> </div> <div class="foo">or me <div class="bar">blahblahblah</div> </div> jquery... $( function() { $( ".bar" ).dialog({ autoopen: false, show: { effect: "blind", duration: 1000 }, hide: { effect: "explode", duration: 1000 } }); $( ".foo" ).click(function() { $(this).find(".bar").dialog( "open" ); }); }); you may not able use jquery ui dialog using class open dialog way in code because $(this).find(".bar") return empty , not exist. try using id inner div elem...

c# - Observing incoming websocket messages with Reactive Extensions? -

i want use linq process events received via websocket connection. have far: private static void main() { string wsendpoint = "wss://push.planetside2.com/streaming?environment=ps2&service-id=s:quicktesting"; using (websocket ws = new websocket(wsendpoint)) { ws.onmessage += ws_onmessage; ws.connect(); console.readkey(); ws.close(); } } private static void ws_onmessage(object sender, messageeventargs e) { console.writeline(e.data); } the first think stumps me how turn ws.onmessage sort of event stream. cannot find examples online observing external event source reactive extensions. intend parse messages json objects, filter , aggregate them. could provide example of creating observable websocket messages, , subscribing it? edit: final working code the difference chosen answer initialized websocket before passing observable.using //-----------...

scala - Link promise to another -

i'm reading scala.concurrent.impl.promise , confused concept "link defaultpromise another". understand 'prevent memory leak' part, don't know how write example current state of defaultpromise defaultpromise . when defaultpromise first created, state nil , list grows keep appending flatmap it. under circumstances branch case dp: defaultpromise[_] => dp.asinstanceof[defaultpromise[s]].linkrootof(p) in future.flatmap called? test("default promise linking") { //f1.getstate === nil val f1 = future {thread.sleep(200000); 2} //f1.getstate === list(callbackrunner1) f1.flatmap(x => future {thread.sleep(200000); 4}) //f1.getstate === list(callbackrunner2, callbackrunner1) f1.flatmap(y => future {thread.sleep(200000); 3}) thread.sleep(30000000) } take example: val f1 = future {thread.sleep(200000); 2} val f2 = f1.flatmap(x => { val f3 = future {thread.sleep(200000); 4} f3 }) f1...

mongodb - Does mongo-scala-driver support GridFs? -

i @ documentation here http://mongodb.github.io/mongo-scala-driver/1.1/ , not find mentioned. unfortunately mongo-scala-driver written scratch (it's not java driver wrapper) , does not support gridfs . you can take @ reactivemongo - it offers api gridfs . otherwise, can use java driver instead.

java ee - CDI beans inside .jar are not found by the container (Unsatisfied dependencies) -

Image
i have created java project serve lib other projects, reducing code duplication between projects. lib project exported jar included in web projects (war, not ear). in web projects (where these classes being removed) worked usual while classes kept on them ─ injection of simple , complex objects (those producers , settings) working normally. after removing these classes of web projects , add jar these same classes web projects (setting lib in pom.xml in maven projects) compiled normally, before too. on start server, classes (cdi beans) present in jar not found container during startup of cdi, generating (famous) error: weld-001408: unsatisfied dependencies type session qualifiers (...) already added beans.xml in meta-inf folder both in src/main/resources (indicated in weld , cdi documentation) root folder of project. below examples of beans (session, sessionfactory , examplelogger) presents in jar needs injected other projects (and have worked while class in web proj...

android - ionic build transformClassesWithDexForDebug failed -

i'm trying run ionic build android , following error :transformclasseswithdexfordebug i've seen issue dotted around stackoverflow, each output different, or requires different solution. i have latest versions of build tools , platform tools installed , sdk api version 23 , 24 (android 6 , 7). i'm absolutely awful @ troubleshooting messages these , wouldn't know begin. have solution this? here output build command. ... :compiledebugndk up-to-date :compiledebugsources :prepackagemarkerfordebug :transformclasseswithdexfordebug run dex in process, gradle daemon needs larger heap. has approximately 910 mb. faster builds, increase maximum heap size gradle daemon more 2048 mb. set org.gradle.jvmargs=-xmx2048m in project gradle.properties. more information see https://docs.gradle.org/current/userguide/build_environment.html exception in thread "main" java.lang.unsupportedclassversionerror: com/android/dx/command/main : unsupported major.minor ve...

javascript - How to test a function with different inputs -

function addtwo (a, b) { return + b; } //leave function call addtwo(50, 100); i'm learning react , i'm trying create codecademy type site 'learning project', have run js problem. say have function above, how test more 1 case? far i'm testing with: eval(code pulled in here) === 150 ? alert('correct!') : alert('wrong!'); which going alert correct, ok case. other questions (and one) i'm going want more 1 test case , that's i'm stuck. so, how can test multiple test cases, or there whole other way of doing i'm trying achieve? any help/tips appreciated, for know react here's code see bit of have : const codeeditor = react.createclass({ getinitialstate () { var initialvalue = [ "function addtwo () {", " ", "}", "//leave function call", "addtwo(50, 100);" ].join("\n"); return { katavalue: initialvalue }...

decompiling - How do Java decompilers discern a for-loop from a while-loop? -

consider these 2 methods: public static void forloop(int start, int limit) { (int = start; < limit; i++) { } } public static void whileloop(int start, int limit) { int = start; while (i < limit) { i++; } } when compiled, produce bytecode (this verbose output of javap ): public static void forloop(int, int); descriptor: (ii)v flags: acc_public, acc_static code: stack=2, locals=3, args_size=2 0: iload_0 1: istore_2 2: iload_2 3: iload_1 4: if_icmpge 13 7: iinc 2, 1 10: goto 2 13: return linenumbertable: line 6: 0 line 9: 13 localvariabletable: start length slot name signature 2 11 2 0 14 0 start 0 14 1 limit public static void whileloop(int, int); descriptor: (ii)v flags: acc_public, acc_static code: ...

sockets - Java DatagramChannel Multicast Defaults to IPv6 -

i'm trying write abstract class inherited 3 classes: udpserver multicastserver tcpserver multicastserver 1 having issues. of now, udp only. when connection received, hand socket predefined consumer<*sockettype*> stored in member m_handler . i'm using selector this. the main issue i'm running @ time seems default ipv6. i'm getting message: java.lang.illegalargumentexception: ipv6 socket cannot join ipv4 multicast group // m_chan member instance of channel type. datagramchannel multicast. if(tcpmode) // true if generic socket type passed serversocket ((serversocketchannel)m_chan).socket().bind(sa); else{ if(multicast) // true if generic socket type passed multicastsocket ((datagramchannel)m_chan).join(inet4address.getbyname(m_host), getipaddr()); else ((datagramchannel)m_chan).socket().bind(sa); } and here code getipaddr() : static networkinterface getipaddr() throws socketexception, unknownhostexception{ ...

ios - How to you save a string to a table View? -

this code: import uikit var reminder = [string]() class viewcontroller: uiviewcontroller, uitableviewdelegate, uitableviewdatasource { @iboutlet weak var textfield: uitextfield! @ibaction func checkmarktapped(sender: anyobject) { reminder.append(textfield.text!) textfield.text = "" } @ibaction func addreminder(sender: anyobject) { } func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { return reminder.count } func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { var cell:coustemcell = tableview.dequeuereusablecellwithidentifier("cell") as! coustemcell cell.tableviewlabel.text = reminder[indexpath.row] return cell } } so when ever press on checkmarktapped add whatever being put in textfield table view. code put in checkmarktapped suppose work keeps crashing. so doing wrong? ...

node.js - Pagination for search indexes on cloudant -

i have cloudant db contains documents access logs of users. example: { "name": "john doe", "url": "somepage.html", "dateaccessed": "2016-08-23t21:20:25.502z" } i created search index function: function (doc) { if(doc.dateaccessed) { var d = new date(doc.dateaccessed); index("dateaccessed", d.gettime(), {store: true}); } } now setup working expected normal query. example { q: 'dateaccessed:[1420041600000 1471987625266]', include_docs: true, sort: '-dateaccessed<number>', } however, wish limit results - let's 5 @ time (which can done "limit: 5" argument), , want somehow make pagination - able move next 5 results or previous 5 results. i checked cloudant documentation , there's argument there called "bookmark" ( https://cloudant.com/for-developers/search/ ) i'm not sure how use it. may request insights on this? t...

Azure Virtual Machine cannot be reached from internet -

Image
i have deployed spring boot application on virtual machine, it's working locally , cannot reached internet. http://x.x.x.x:8080 added inbound rule network interface in azure portal , added inbound rule firewall. i assume arm: you'd need public ip adress (static). can add control panel. associate network interface.

php - Display a message if column doesn't exist? -

i'm building app, , creates urls based on id. for example edit item link opens kind of url website.com/update_item.php?uid=1 if change id in url item id not created me , don't have access edit it, display following message: "you don't have access edit item!" the question is, how can display same message id's not exist in database? how can check either id or not registered in database? currently if type in id not exist displays blank page. here code $list_id = $_get["uid"]; $l_title = "select * list_items `id`='$list_id'" ; $query = $pdo->prepare($l_title); $query->execute(); $list = $query ->fetchall(); the if code if ($_session['fbid'] == $item['user_id']) { .... where $_session['fbid' ] logged in facebook user , $item['user_id'] id of user created list. check query results, if result empty, display message $list_id = $_get["uid"]; $l_title = ...

Python Pandas Groupby Resetting Values Based on Index -

Image
so have dataframe contains wrong information want fix: import pandas pd tuples_index = [(1,1990), (2,1999), (2,2002), (3,1992), (3,1994), (3,1996)] index = pd.multiindex.from_tuples(tuples_index, names=['id', 'firstyear']) df = pd.dataframe([2007, 2006, 2006, 2000, 2000, 2000], index=index, columns=['lastyear'] ) df out[4]: lastyear id firstyear 1 1990 2007 2 1999 2006 2002 2006 3 1992 2000 1994 2000 1996 2000 id refers business, , dataframe small example slice of larger 1 shows how business moves. each record unique location, , want capture first , last year there. current 'lastyear' accurate businesses 1 record, , accurate latest record of businesses more 1 record. df should @ end this: lastyear id firstyear 1 1990 2007 2 1999 2002 2002 2006 3 1992 1994 1994 19...

java - Apache DigestUtils seem to calculate MD5 partially wrong -

tonight working on easy solution on-the-fly-md5 calculation while stream passed. main framework working straight away. data got streamed , md5-hash computed. started monitoring md5-hash @ 3 different stages. before streaming, while streaming , after streaming. , suprised result. the important md5-digest wrongly computed. encoding used same method of apache's digestutils. instead of generating 3 times same output, got 2 of 3. to verify, there no general error in construct additionally used apache's (...).binary.hex class encode digest. , time result matched other ones. md5 before streaming: 9065793b048f4efee5ccddb34798ee19 md5 after streaming: 9065793b048f4efee5ccddb34798ee19 md5 while streaming encoded digestutils: 95d845ff55b5918edc8d1222045dd1cb md5 while streaming encoded binary.hex: 9065793b048f4efee5ccddb34798ee19 and here simple code. the first class started via main method. calls instance of class streamforwarder , passes test string inputstream. tha...

Windows CMD Start and wait for the default application in a batch file -

i trying start default application file, wait complete, , continue batch file. problem start, when used below creates command prompt window example.doc in title bar. can use call instead of start, call not wait program finish before going next line. appears start needs have executable name , not work default application system in windows. any ideas how can make happen without having hardcode windows application in batch file well? set filename=example.doc start /wait %filename% copy %filename% %filename%.bak how start default application file, wait completion, continue? it appears start needs have executable name , not work default application system in windows. start , when used below creates command prompt window example.doc in title bar start /wait %filename% the above command won't work because %filename% used window title instead of command run. always include title can simple string "my script" or pair of empty quotes "...

Does swift allow code blocks without conditions/loops to reduce local variable scope? -

this question has answer here: how create local scopes in swift? 5 answers in languages block level scope, create arbitrary blocks can encapsulate local variables , not have them pollute parents' scope: func myfunc() { // if statements block level scope if self.somecondition { var thisvarshouldntexistelsewhere = true self.dosomethingelse(thisvarshouldntexistelsewhere) } // many languages allow blocks without conditions/loops/etc { var thisvarshouldntexistelsewhere = false self.dosomething(thisvarshouldntexistelsewhere) } } when in swift, thinks i'm creating closure , doesn't execute code. create closure , execute, seems come execution overhead (not worth code cleanliness). func myfunc() { // if statements block level scope if self.somecondition { var thisvarshouldntexistelsewhere = true self.dosomethingelse(t...

spring boot - Upgrading LogStash Log4j configuration to Log4j2 -

i trying migrate spring boot app log4j log4j 2. understand log4j 2 changed syntax of .properties configurations original log4j. here snippet of original log4j configuration: log4j.appender.logstash=org.apache.log4j.net.socketappender log4j.appender.logstash.layout=org.apache.log4j.patternlayout log4j.appender.logstash.layout.conversionpattern=%d{hh:mm:ss.sss} %-5p %c {2} %x - %m%n log4j.appender.logstash.port=4560 log4j.appender.logstash.remotehost=logs.example.com log4j.appender.logstash.reconnectiondelay=10000 and here updated to, log4j 2: appender.logstash.type=socketappender # or 'socket' appender.logstash.name=logstash appender.logstash.layout.type=patternlayout appender.logstash.layout.pattern=%d{hh:mm:ss.sss} %-5p %c {2} %x - %m%n appender.logstash.host=logs.example.com appender.logstash.port=4560 appender.logstash.reconnectiondelaymillis=10000 however, when this, console , file appenders work fine, logstash appender throws broken pipe error. i've...

excel vba - Adding sum formula between every space ranges by vba -

Image
i trying automation , stuck here, need add sum formula dynamically in between space ranges. i'm lost here adding formula using vba can me out. thank in advance :) i'm assuming want if there blank in cell, want of other elements summed , result placed in blank. there number of ways code this, here attempt sub formulatesubtotals() finalrow = cells(worksheets("sheet1").rows.count, 1).end(xlup).row finalcol = cells(1, worksheets("sheet1").columns.count).end(xltoleft).column j = 1 finalcol = finalrow + 1 1 step -1 if isempty(cells(i, j)) if isempty(cells(i - 2, j)) firstrow = - 1 lastrow = firstrow else lastrow = - 1 firstrow = cells(i - 1, j).end(xlup).row end if cells(i, j) = application.worksheetfunction.sum(range(cells(firstrow, j), cells(lastrow, j))) end if next next j end sub this assumes sheet in ques...

Oracle SQL Update with rowover partition -

why error b1.employee_id invalid identifier sql below: update table_1 a1 set a1.addl_seq = ( select seq (select row_number() on (partition employee_id order employee_id, erncd) seq table_1) b1 b1.employee_id=a1.employee_id ); you can write update statement this: update (select employee_id, addl_seq, row_number() on (partition employee_id order employee_id, erncd) seq table_1) set addl_seq = seq;

error handling - In Go, can JSON marshaling of a well-defined type ever fail? -

given following code: package main import ( "encoding/json" "fmt" "log" ) type employee struct { id int "json:id" } func main() { b, err := json.marshal(&employee{id: 2}) if err != nil { log.fatal("couldn't marshal employee") } fmt.println(string(b)) } can checking error reliably ignored using _ placeholder since employee struct defined. theoretically should never fail, begs question practice ignore type of error , save little on type of boilerplate error checking? ignoring so: package main import ( "encoding/json" "fmt" ) type employee struct { id int "json:id" } func main() { b, _ := json.marshal(&employee{id: 2}) fmt.println(string(b)) } error handling , go : proper error handling essential requirement of software. normally code won't fail. if user adds marshaljson method reciver type, fa...

github - Atom git-plus difficulties -

i'm trying set atoms git-plus package , have gone through think appropriate setup steps , can't push files github account. using git config, i've configured user.email , user.name , made sure reflect account , email address in github i error message: to https://github.com/etc. ![rejected] head -> master (fetch first) error: failed push refs https://github.com etc. updates rejected because remote contains work not have locally. caused repository pushing same ref. may want o first integrate remote changes e.g. git pull before pushing again. the new repo test 1 created now. have tried git pull followed attempt push through git-plus. i've tried delete local copy , create again cloning. can push file using terminal. don't know enough version control know next. thoughts? for out there confused re: happening. i fixed specifying git pull message name , branch. merged whatever file causing issue , push git-plus worked fine. as understand (and ple...

Listen Android back button in cocos2d-x -

i want track android button in android activity. i have ready work on button in onkeyreleased() in c++ , when check button in activity methods onbackpressed() , onkeyup() , onkeydown() e.t.c nothing. please me same. well have create new event listener keyboard in init of class. because don't know have @ moment, how implement button listener android: bool yourscene::init() { if(!layer::init()) return false; auto listener = eventlistenerkeyboard::create(); listener->onkeyreleased = cc_callback_2(yourscene::onkeyreleased, this); director::getinstance()->geteventdispatcher()->addeventlistenerwithscenegraphpriority(listener, this); ........... } void yourscene::onkeyreleased(eventkeyboard::keycode keycode, event* event) { if(keycode == eventkeyboard::keycode::key_back) { // implement button login here } }

javascript - How to animate one element on top of another element in Angular 2? -

in angular 2, how animate 1 element it's size , position match of target element? target element's size , position not fixed, can vary @ runtime. attached complete example using jquery. bonus, i'm wondering if animation can done without using elementref ? codepen see pen animate element on top of another matthew banz ( @battmanz ) on codepen . html <section> <button id="animateblue">animate blue</button> <button id="randomizeorange">randomize orange</button> </section> <section> <div class="ball" id="ball1"></div> <div class="ball" id="ball2"></div> </section> css body { margin: 0; padding: 0; } section:first-of-type { padding: 10px; text-align: center; background-color: #ccc; } .ball { border-radius: 50%; position: absolute; } #ball1 { background-color: blue; z-index: 5; } #ball2 { background...

sql server 2008 - SQL - Nested Select in From claus with Count -

when use following code (it oracle guy , says there no reason not work...) notified there incorrect syntax located @ last ')'. idea how can change "sql appropriate"? thoughts not liking last select statement. select * cpininvest [case id||] not in ( select [case id||] ( select [case id||], count(*) cpincomm140 [role cd||]='pri||' group [case id||] having count(*)=1 ) ) it can shortened. select * cpininvest [case id||] not in ( select [case id||] cpincomm140 [role cd||]='pri||' group [case id||] having count(*)=1 ); but seriously, pipes in fieldnames? yuk! the reason why original query fail is: 1) count(*) needs alias. example [total] 2) tsql has odd requirement subqueries require alias

Inserting unicode escape sequence data to SQL server db (pyodbc) -

i'm trying insert data scraped web sql server db, , relevant columns of db table set nvarchar(max) type. testing in python shell: dbargs={'database': '<mydbname>', 'driver': '{freetds}', 'port': '1433', 'pwd': '<mypass>', 'server': '<server>', 'uid': '<myusername>'} import pyodbc cnxn = pyodbc.connect(**dbargs) cursor = cnxn.cursor() insert_cmd="insert c_master (run_id, product_name) values (?,?)" then cursor.execute(insert_cmd, (274, u'test naméâôóòöë')) works fine, however cursor.execute(insert_cmd, (274, u'test \u2019d')) causes error programmingerror: ('42000', "[42000] [freetds][sql server]incorrect syntax near ','. (102) (sqlexecdirectw)") i find scraping data of latter type , generating errors when try insert above db in writer pipeline. what correct way handle such data? ...

javascript - how to use crossfilter and dc.js to draw a cumulative distribution function lineChart -

suppose have records this: // origin: http://blog.rusty.io/2012/09/17/crossfilter-tutorial/ var livingthings = crossfilter([ // fact data. { name: “rusty”, type: “human”, legs: 2 }, { name: “alex”, type: “human”, legs: 2 }, { name: “lassie”, type: “dog”, legs: 4 }, { name: “spot”, type: “dog”, legs: 4 }, { name: “polly”, type: “bird”, legs: 2 }, { name: “fiona”, type: “plant”, legs: 0 } ]); let's want draw simple cdf based on legs variable using crossfilter , dc.js's linechart. the expected chart points be: x:0 --> y:0.16667 x:2 --> y:0.66667 x:4 --> y:1 but don't know how can implement this. please this? thanks!

javascript - Is it possible to rename a key in the Firebase Realtime Database? -

Image
i wondering, there way update key value? let´s use following data: i using set() write data. now, want user edit booktitle , needs change on both places. tried using update() can´t seem make work. can edit booktitle in bookinfo not on books . moving not option because erase bookdata . tried writing using push() then, can´t search because don´t have pushid (i need search because users can't have 2 books same name) so, there way update key value? or, there better approach this? accept suggestions. thank you! update: i´m using update book title inside bookinfo var bookname = document.getelementbyid('bookname').value; firebase.database().ref('books/' + bookname + '/bookinfo').update({ booktitle : bookname }); i think see you're trying do. firebase doesn't have concept of "renaming" part of path via update. instead have remove existing node , recreate it. can so: var booksref = firebase.database().ref('...

Spring JMS + JTA DMLC and Message Groups -

my application requires messages particular group id processed same thread. tried set using dmlc, seeing messages being processed, being handled separate threads within dmlc when concurrency set > 1. hope have multiple consumers reading queue each different message groups, not seeing desired behavior setup. there way using dmlc or smlc (with jta) support multiple listeners on queue messages particular group id handled same thread, without setting concurrency 1? i'm nearing point believe smlc , dmlc not meet need , need use different implementation handle case. there examples or advice on doing this? can post code exhibits behavior? ran test while answering this question , works fine me messages same group going same thread.

javascript - jQuery.get only send parameter ajaxRequest=true -

there weird problem stumbled upon today. sending data jquery.get this: $.get( "ajax_articles.inc.php", 'site=article&operation=newarticle', function() { /* ... */ }, 'html' ); results in ajax-requestlike this: http://localhost/website/ajax_articles.inc.php?ajaxrequest=true&_=1471969804080 however, if same request looks this: $.get( "ajax_articles.inc.php", {site : 'article', operation: 'newarticle' }, function() { /* ... */}, 'html' ); i desired request: http://localhost/website/ajax_articles.inc.php?site=article&operation=newarticle&ajaxrequest=true&_=1471970652894 the first request type worked months. it's in our code dozens of times. today stopped working , have problem if type lines console. has experienced similar problem? edit: wo have $.ajaxsetup() in our code looks this: $.ajaxsetup({ cache : false, datatype : 'html...

Create link using font-awesome in a span- and i-tag in html -

i trying create link font-awesome icons within span- , i-tag, however, not work. using following code: <a href="mailto:?subject=test&amp;body=test"> <span class="fa-stack fa-4x"> <i class="fa fa-circle fa-stack-2x text-primary"></i> <i class="fa fa-envelope fa-stack-1x fa-inverse"></i> </span> </a> try change version of stylesheet, misbehave <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.css"> <a href="mailto:?subject=test&amp;body=test"> <span class="fa fa-stack fa-4x"> <i class="fa fa-circle fa-stack-2x text-primary"></i> <i class="fa fa-envelope fa-stack-1x fa-inverse"></i> </span> </...

office365 - The operation was cancelled.. ErrorCode: 3072 -

we working on ios application using msoutlook-sdk-ios version 2.0.1 enable users send , receive work (outlook) emails ios app. registered ios app within microsoft azure activedirectory , specified microsoft graph (5 delegated permissions) , office 365 exchange online (4 delegated permissions) permissions. here app manifest in azure ad: { "appid": "3b008367-4e7d-43e5-9a76-46a908e8fa65", "approles": [], "availabletoothertenants": true, "displayname": "chatbaka", "errorurl": null, "groupmembershipclaims": null, "homepage": null, "identifieruris": [], "keycredentials": [], "knownclientapplications": [], "logouturl": null, "oauth2allowimplicitflow": false, "oauth2allowurlpathmatching": false, "oauth2permissions": [], "oauth2require...

powershell - How to get the Application Group, SID & UserName in NetSqlAZMAN -

$appname = "myappname" #open store $azstore = new-object -comobject azroles.azauthorizationstore #access app $myapp = $azstore.openapplication($appname) can please me in completing this. you might find example useful: # internal function download latest netsqlazman.dll nuget (if necessary) # , import current runspace. # can manually download installation package netsqlazman.codeplex.com , # add-type directly instead of function function _downloadandimportlatestnetsqlazmandll { $downloadurl = 'https://api.nuget.org/packages/netsqlazman-x86.3.6.0.15.nupkg' $localdir = join-path $env:temp 'netsqlazmanx86' $localnupkg = join-path $localdir 'netsqlazman-x86.3.6.0.15.nupkg' $dllpath = join-path $localdir 'lib\net40\netsqlazman.dll' if (-not (test-path $localdir)) { new-item -path $localdir -itemtype directory -force | out-null } if (-not (test-path $localnupkg)) { invoke-webrequ...