Posts

Showing posts from April, 2015

BIRT report becomes blank when I deleted a column from the page -

as new birt stuff,i trying edit birt report. found out when delete row table, birt report become blank when run..its not data db...even no labels in not showing...only master page data showing...as not 1 created report, didn't know setting done on it.and confused why labels not showing?

How do I Upload A MP3 File To A Local HTTP Web Server (C#) -

i wondering how upload mp3 file localhost http web server. tried caused error listener httplistenercontext context = _httplistener.getcontext(); byte[] _responsearray = file.readallbytes(@"c:/users/user1/desktop/test.mp3"); context.response.outputstream.write(_responsearray, 0, _responsearray.length); context.response.keepalive = false; context.response.close(); console.writeline("respone given request.");

sql server - How do you implement if/then logic in SQL -

i'm new sql , databases, bear me here. i know query isn't correct, think other developers here can understand i'm trying do. ideas on how fix query work? select [labtest], count(*) [usersdb].[dbo].[vwuserlabtest] if (labtest='ptt') set rangemax=35 if (labtest='ck') set rangemax=150 if (labtest='ca') set rangemax=10.1 resultvalue>rangemax group labtest i think want: select [labtest], count(*) [usersdb].[dbo].[vwuserlabtest] (labtest = 'ptt' , resultvalue > 35) or (labtest = 'ck' , resultvalue > 150) or (labtest = 'ca' , resultvalue > 10.1) group labtest; there other ways of expressing logic. neither if nor case needed -- simple filtering conditions.

javascript - Display nested objects using w3-repeat of w3.js library -

Image
i'm trying display array of objects nested array of objects using tag w3-repeat of library w3.js. know it's not main used library, i'm new stuff , liked w3.css style css styling (simple , easy-to-learn) , i'm trying w3.js javascript side. i'm trying make table starting object this: var myobject = { "deliveries" : [ { "state" : "inside", "arrive" : "15/09/17 - 15:00", "courier" : "courier 1", "cli-cust" : [ { "type" : "client", "name" : "cli. name", "goods" : [ {"material" : "pasta", "qt" : "200"}, {"material" : "bread", "qt" : "300"}, {"material" : "oil", ...

php - How can I get mysql to print rows from a database table -

i trying learn php w3schools includes mysql section.so far have completed every other part of tutorial on w3school except part prints content database table. weird reason , nothing displays when run code. please how can working , problem come fact using mariadb xampp instead of mysql although said practically same syntax. here code <?php $servername = "localhost"; $username = "uhexos"; $password = "strongpassword"; $database = "fruitdb"; // create connection $conn = new mysqli($servername, $username, $password); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } // create database $sql = "create database fruitdb"; if ($conn->query($sql) === true) { echo "database created successfully"; } else { echo "error creating database: " . $conn->error; } $conn->close(); // create connection $conn = mysqli_connect($servername, $u...

Express route param breaks on params containing "@" -

have simple express route router.get('/compare/:packages', function(req, res, next) { const packages = req.params.packages.split(','); res.render('index', { title: "title" }); }); when accessing contains @ sign, doesn't match , returns 404, help? /compare/elm,@cycle/run edit: worked router.get('/compare/:packages*', function(req, res, next) { const packages = req.params.packages.split(','); res.render('index', { title: "title" }); }); the issue isn't @ , it's / before /run , because default, parameters delimited slashes. you can use this: router.get('/compare/*', function(req, res, next) { const packages = req.params[0].split(','); res.render('index', { title: "title" }); });

subtract - $ sign and calculation in python -

i'm trying calculate value in $ sign, , subtract it. not sure how...sorry if basic question, thank much. import urllib.request bs4 import beautifulsoup import time urleth = "https://coinmarketcap.com/currencies/ethereum/" page = urllib.request.urlopen(urleth) content = page.read().decode('utf-8') soup = beautifulsoup(content, 'html.parser') valeth = soup.find("span", {"id": "quote_price"}).decode_contents(formatter="html") print("ethereum price ", valeth) print(valeth) above good below, not sure. valeth shows $ sign, , sure how subtract $100 has dollar sign. value = (valeth - $100.00) print(value) you have make $100.00 100.00 then, can everything. suppose, var = '$100.00' var = float(var[1:]) value = (valeth - var) print(value)

windows - git project folder disapears in the middle of editing inside VM -

i'm using ubuntu 16.04 virtual machine, vmware 12.5.6, on windows pc. have python project work on using git on virtual machine. however, after running , testing code in terminal, in project folder including .git/ disappears. has run bug?

rust - How can I get the length of a tuple? -

this behaviour tried: struct matrix(f32, f32, f32, f32); let matrix = matrix(1.1, 1.2, 2.1, 2.2); matrix.len(); // expected `4` which produces error: error[e0599]: no method named `len` found type `&tuples::matrix` in current scope --> src/tuples.rs:19:44 | 19 | println!("matrix length: {}", self.len()); | ^^^ | = help: items traits can used if trait implemented , in scope = note: following traits define item `len`, perhaps need implement 1 of them: candidate #1: `std::iter::exactsizeiterator` candidate #2: `core::slice::sliceext` candidate #3: `core::str::strext` std::iter::exactsizeiterator looks candidate, still don't know how implement it context whilst trying reverse matrix , realized instead of dryly listing reverse indexes of matrix so: fn reverse(matrix: matrix) -> matrix { return matrix(matrix.3, matrix.2, matrix.1, matrix.0) }...

tensorflow optimizing sparse_tensor_dense_matmul operation on GPU -

is optimizing sparse_tensor_dense_matmul operation possible in tensorflow on gpu? use tensoflow 1.2.1 cuda 8. error example: import tensorflow tf tf.device('/gpu:0'): st = tf.sparsetensor( tf.constant([[0, 0], [1, 1]], dtype=tf.int64), tf.constant([1.2, 3.4], dtype=tf.float32), tf.constant([2, 2], dtype=tf.int64) ) v = tf.variable([[1.0, 0.0], [0.0, 1.0]], dtype=tf.float32) st = tf.sparse_tensor_dense_matmul(st, v) st = tf.reduce_min(st) optimizer = tf.train.adamoptimizer() trainer = optimizer.minimize(st) tf.session() sess: print(sess.run(trainer)) results in following error: traceback (most recent call last): file "test_tf3.py", line 18, in <module> print(sess.run(trainer)) file "/media/awork/home/astepochkin/drecs/repo/env/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 895, in run run_metadata_ptr) file "/media/awork/home/astepochkin...

ios - Placement of 3D object not working the SECOND time my button is pressed -

i programmatically added button arscnview , added function that's called whenever it's tapped. function creates , place 3d object. button works first time it's pressed, second time onwards not place object. here's code: private var button = uibutton() override func viewdidload() { super.viewdidload() // set view's delegate sceneview.delegate = self button.settitle("body", for: button.state) button.frame = cgrect(x: 100, y: 25, width: 100, height: 25) button.addtarget(self, action: #selector(buttonaction), for: .touchupinside) view.addsubview(button) } @objc func buttonaction(sender: uibutton!) { self.createplanenode() } func createplanenode() { //create new scene our 3d object in print("hi") //this prints everytime button pressed, checked. let object = scnscene(named: "art.scnassets/manbody.obj") let node = scnnode() let nodearray = object!.rootnode.childnodes ...

php - how to get name of dynamically generated method in codeigniter -

i have achieved url follows myapp.com/profile/username1 myapp.com/profile/username2 myapp.com/profile/username3 my routes.php file contains following line of code $route['profile/(:any)'] = 'profile/user_profile/$profile_method'; my profile controller contains code public function user_profile($profile_method) { echo $profile_method; } all problem want return username process further, method returns parameter name instead of username. please tell me doing wrong ? just tip have no / after username myapp.com/profile/username/1 try $route['profile/(:any)'] = 'profile/user_profile/$1'; $route['profile/(:any)/(:num)'] = 'profile/user_profile/$1/$2'; instead of $route['profile/(:any)'] = 'profile/user_profile/$profile_method'; http://www.codeigniter.com/user_guide/general/routing.html#examples then public function user_profile($profile_method = '...

php - foreign key not define in migration file in Laravel 5.2 -

i have 2 migration files in laravel app projects , task. project id column foreign key task table project_id. need save project id project_id in task table. did not configure foreign key ralationship in task migration file task migration file public function up() { schema::create('tasks', function(blueprint $table) { $table->increments('id')->unsigned(); $table->longtext('task_name'); $table->text('body'); $table->string('assign'); $table->string('priority'); $table->date('duedate'); $table->integer('project_id')->unsigned(); $table->timestamps(); }); } this taskcontroller public function postnewtask(request $request, project $project) { $task = new task; $task->task_name = $request->input('name'); $task->body = $request->input(...

c++ - Adding a tile to the Windows 10 Action Center -

i new c++ , windows framework, sorry if asking blatantly obvious question. wondering if there way add own custom tile windows 10 action center, this: https://i.stack.imgur.com/larop.png any or advice appreciated. in advanced! edit: found similar post @ windows 10 action center buttons , has no answers. right there no way add "quick action" button. can try adding request (or upvote existing item) on windows dev uservoice site .

android - Alternatives for all google play games deprecated API's? -

i want add multiplayer game, using google play game services api. following post: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html there lots of deprecated api: games.players.getplayersearchintent() games.players.loadconnectedplayers() games.players.loadinvitableplayers() value leaderboardvariant.collection_social invitations.loadinvitations() realtimemultiplayer.getselectopponentsintent() turnbasedmultiplayer.getselectopponentsintent() methods in requests package. i didn't find helpful discussion regarding alternatives deprecated api. i don't want integrate deprecated api in game. may shed light regarding this? thanks in advance!

c++ - Initialise static data members using lambda function -

i new concept of using lambda functions in c++. aim initialise static data member array of objects using lambda function. below code - #include <iostream> class b { public: b() {std::cout << "b called" <<std::endl;} b(int y){std::cout << "b int called" <<std::endl;} }; class { public: a(){std::cout << "called" << std::endl;} static b bobj[256]; }; b bobj[256] = [] () {for (int = 0 ; < 256; i++) { bobj[i] = new b(2)}}; int main() { a; } but getting compilation error 'ambiguous overload ‘operator=’ (operand types ‘b’ , ‘b*’)' , others. how can code lambda function initialise array of objects? i think see @ least one of problems. definition of bobj array of b objects: b bobj[256] yet trying assign pointer-to-b (by using new ): bobj[i] = new b(2) i believe that's cause of error you've shown, ambiguous overload 'operator=' (operand ...

Use a function that doesn't return value insider wordpress shortcode -

i trying use jetpack sharing icons inside shortcode display grid post.. have not been able because sharing_display( '', true ) outputs sharing icon , thought not displaying after using sharing_display( '', false ) still not able display icons this code using.. if($loop->have_posts()): $html.='<div id="oj-blog" class="section blog-wrap"> <div class="container"> '.(($title?'<div class="title"> <h2>'.$title.'</h2> </div>':'')).' <div class="row">'; while($loop->have_posts()):$loop->the_post(); $html.=' <div class="blog-single"> <h3>'.get_the_title().'</h3> <p>'.get_the_excerpt().'</p>'; if ( function_exists( 'sharing_display' ) ) { $ht...

javascript - AngularJs - resort array via a field -

i have array : [object,object,object]; each object has property name "rate". want sorting object rate property. i have variable ( $scope.restaurants.data ) in js. , structure of variable: array[3] 0:object id:3 name:"bestrest" profile:"rest.png" rate:1 restaurantcityslug:"ny" slug:"foo" __proto__:object 1:object id:7 name:"bestres3t" profile:"rest7.png" rate:0 restaurantcityslug:"ny" slug:"fo4o" __proto__:object 2:object id:7 name:"bestr242es3t" profile:"re3st7.png" rate:2 restaurantcityslug:"ny" slug:"fo244o" __proto__:object and exeption : array[3] 0:object id:7 name:"bestres3t" profile:"rest7.png" rate:0 restaurantcityslug:"ny" slug:"fo4o" __proto__:object 1:object id:3 name:"bestrest" profile:"rest.png" rate:1 rest...

How to run Neo4j 3.0.6 multiple instances in a single machine using INEO -

how run neo4j 3.0.6 multiple instances in single machine using ineo? how change port number of neo4j 3.0.6 version , instance using ineo? ineo third party solution, , based on github repo not maintained recently. btw, have checked create instance specific port section of readme.md ? ineo create -p8486 my_db_test currently neo4j offers similar solution instance handling, called neo4j desktop, , can downloaded here: https://neo4j.com/download/other-releases/ if use native neo4j database, should change following properties in neo4j.conf able have more instance locally: dbms.connector.bolt.listen_address dbms.connector.http.listen_address dbms.connector.https.listen_address

php - Laravel collectivehtml secure route or url -

in view page have route: {!! form::open(['url' => 'forumcomment/' . $forum->slug, 'files'=>false, 'id' => 'qw-commentform' ,'class' => 'qt-clearfix']) !!} <hr class="qt-spacer-s"><div class="input-field"> {!! form::textarea('comment', null, ['class'=>'materialize-textarea', 'id'=>'my-editor', 'required'=>'required','aria-required'=>true]) !!} <label for="comment" class="">comment*</label></div> <hr class="qt-spacer-s"> {!! form::submit('post comment', array( 'class'=>'qt-btn qt-btn-primary qt-btn-xl' )) !!} {!! form::close() !!} getting mixed content error how can secure route? add boot method of appserviceprovider . loads content on http on local development , https...

php - I want to show names of people on the listview in android through json -

i using asynctask through want json array of names , want show in listview . here php code: $con=mysqli_connect("localhost","root","","raheel"); $id=intval($_post['id']); $mysqli_qry="select* name name_id='$id'; "; $result=mysqli_query($con,$mysqli_qry)or die("error occur in connection" . mysqli_error($con)); $rowcount=mysqli_num_rows($result); $arr=array(); if($rowcount>0) { while($row=mysqli_fetch_assoc($result)) { $arr=$row; } } header('content-type: application/json'); echo json_encode($arr); mysqli_close($con ?> the problem facing how json array in asynctask mode , assign data(names) listview home.java code: package com.example.raheel.bank; public class home extends appcompatactivity implements homecallback { listview listview; private listadapter madapter; p public arraylist<string > info; @override protec...

c# - How to use Tuple.Create() method to create an tuple like this -

if write code this: var = tuple.create(1,2,3); var b = tuple.create(1,2,3,4,5,6,7,a); it creates tuple type is: tuple<int,int,int,int,int,int,int,tuple<tuple<int,int,int>>> how use tuple.create() method create tuple like: tuple<int,int,int,int,int,int,int,tuple<int,int,int>> as documentation says, return value of tuple.create<t1, t2, t3, t4, t5, t6, t7, t8> method system.tuple<t1, t2, t3, t4, t5, t6, t7, tuple<t8>> 8-th argument wrapped new tuple. if passing tuple last argument, tuple wrapped tuple , you'll tuple<tuple<>> have now. implementation of creation method pretty straight-forward: static tuple<t1, t2, t3, t4, t5, t6, t7, tuple<t8>> create<t1, t2, t3, t4, t5, t6, t7, t8>( t1 item1, t2 item2, t3 item3, t4 item4, t5 item5, t6 item6, t7 item7, t8 item8) { return new tuple<t1, t2, t3, t4, t5, t6, t7, tuple<t8>>( item1, item2, item3, item4, ite...

branch - Git - find a bug in specified commit -

Image
there bug appeared in commit 63aeeab . there many changes between b947052 , 63aeeab . want somehow checkout 63aeeab , discard changes 1 one find bug. , go current commit. proper way? one option checkout 63aeeab , reset previous commit. in way return in b947052 before creating next commit , changes introduced 63aeeab in working copy. git checkout 63aeeab git reset head^ note these commands have no effects on git tree shape, no branches moved, no commits changed. in state should able discard changes 1 one (it helpful --patch option of git checkout ) let me say, sorry have this, make small commits, add unit tests.

javascript - Express.js POST method doesn't work -

i'm trying make discussion-based node.js/express-app , i'm working on page create discussion. testing if discussion controller file linked, everytime click button post form, doesn't anything. my pug (view), called 'createdisc.pug' extends layout block content h1 create new discussion form(action='', method='post') div label(for='title') title input#title div label(for='desc') description input#desc div input(type='submit', value='create') my router, called 'createdisc.js' var express = require('express'); var router = express.router(); var disc = require('../controllers/disc'); router.get('/discussion/create', function (req, res, next) { res.render('createdisc'); }); router.post('/discussion/create', disc.createdisc); module.exports = router; my controller called 'disc.js' i'm try...

python - Pyspark: help filtering out any rows which have unwanted characters -

writing parquet file gives me error states " ,;{}()\n\t=" characters not allowed. i'd eliminate rows have of these characters anywhere. would use "like", "rlike" or else? i have tried this: df = df.filter(df.account_number.rlike('*\n*', '*\ *','*,*','*;*','*{*','*}*','*)*','*(*','*\t*') == false) obviously not work. i'm unsure right regex syntax is, or if need regex in particular case. you use rlike since it's regular expressions: df.filter(~df.account_number.rlike("[ ,;{}()\n\t=]")) when put characters between [] means of following characters. i don't see why these characters wouldn't allowed in dataframe rows, there might invalid character in column names instead. can use .withcolumnrenamed() rename it.

angular - Angular2 Using Typescript : How to bind clickable item of div in 1 component to expand a collapsible div in another component -

i have 2 shared components. in component1 have following 3 values inside legend data variable. when click on value, want expand div in component2 expand. trying bind them past several hours efforts have gone in vain far. kindly provide answer typescript only. my component1.html <div class='row'> <div class='col-sm-4 asset-classes'> <div class='row1'> <div class='col-sm-6 asset'> <h5><b>total data</b></h5> <div id='legenddiv' style='border: 0px; margin: 2px 0 0px 0;position: relative;width: 166px; '></div> </div> <div class='col-sm-6'> <div id='chart1div' [style.width.%]='100' [style.height.px]='200'> </div> </div> </div> </div> <div class='col-sm-4'> <div class='row1'> ...

android - Making list view strech entire screen height -

Image
i have list view design recipes app. each item consists of image, title, description , number of calories. problem doesnt fill entire screen, instead gives scrollbar on right. how can make fill screen? also, there better way of showing list items without using tables? list.xml: <framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <scrollview android:layout_width="match_parent" android:layout_height="match_parent" android:fadingedgelength="0dp" android:fillviewport="true" android:overscrollmode="never" android:scrollbars="none"> <relativelayout android:layout_width="mat...

javascript - How deep to nest promises and callbacks in NodeJS? -

only in context of promises , callbacks, following make sense? static getdefaultadminheader(_this) { return new promise((resolve, reject) => { [nodejs fs module].readfile([name of file], (err, fd) => { resolve(fd); }); }); } in other words: promise above more add callback? or there programmatic plus structure? from question, promise can nested many layers want, code dirty. usually, should not nested promise, or mixed promise , callback. from code, there many solution remove callback. use fs promise module instead, e.g., https://www.npmjs.com/package/fs-extra use standard fs promisifyall function bluebird library

testflight - react native map triggers NFCReaderUsageDescription? -

i have made simple react native app using map view. have simple functionality. uploaded ios testflight setup our team testings. got rejected becuase of using nfc?? missing info.plist key - app attempts access privacy-sensitive data without usage description. app's info.plist must contain nfcreaderusagedescription key string value explaining user how app uses data.

facebook - fb graph api group feed on specific type only -

https://graph.facebook.com/v2.10/fb_group_id/feed?fields=attachments{title,media,subattachments,type,url},type,created_time,description,message,message_tags&limit=10&access_token=my_access_token this reruns me types ( status , photo , video , link ) of feeds can make request have specified type photo feeds or video feeds attachments , sub-attachments have type fields, interested check attachments , sub-attachments , return if type equal provided type i want have 3 arrays textual feeds images videos

java - Hibernate @AttributeOverride with @ColumnTransformer -

i'm studying hibernate/jpa , doing practice to. task map entity: @entity public class item { @id @generatedvalue(strategy = generationtype.identity) private long id; @embedded @attributeoverride(name = "priceinusd", column = @column(name = "start_price_in_uah")) private price startprice; @embedded @attributeoverride(name = "priceinusd", column = @column(name = "end_price_in_uah")) private price endprice; } and here embeddable class: @embeddable public class price { @column(name = "price_in_uah") @org.hibernate.annotations.columntransformer( read = "{dont_know_what_to_put_here} * 0.039", write = "? / 0.039") private int priceinusd; } in db store price in uah , in java code have in usd . understand bit stupid example, still... the problem when use hibernate's @columntransformer have specify column name in read property (l...

javascript - How to force a 16:9 ratio with getUserMedia on all devices? -

i need use getusermedia while video set record in 16:9 resolution . my code works on desktops , on android 7 , above: navigator.getusermedia( { audio: true, video: { mandatory: { minwidth: 380, minheight: 214, maxwidth: 380, maxheight: 214 } } }) but on android 6 , below, , on desktops (can't figure out which), getusermedia breaks, , no image available camera. this works on all devices , desktop, default resolution ratio of 4:3, while need 16:9: navigator.getusermedia( { audio: true, video: true }) i tried omitting mandatory , no luck. to add confusion, ios devices (11 beta) , android require passing facingmode argument: video: { facingmode: 'user' } so, seems passing width , height arguments breaks getusermedia on desktops , devices android 5 , 6. is there way force 16:9 ratio on devices? correct , conventional method of capturing video specific dimensions? you're...

html - remove opening and closing animation -

i have css of pacman eating animation in css. how can remove opening , closing animation , make mouth remain open .loader{position:absolute;top:50%;left:50%;height:60px;width:160px;margin:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)} .circles{position:absolute;left:-5px;top:0;height:60px;width:180px} .circles span{position:absolute;top:25px;height:12px;width:12px;border-radius:12px;background-color:grey} .circles span.one{right:80px} .circles span.two{right:40px} .circles span.three{right:0px} .circles{-webkit-animation:animcircles 0.5s infinite linear;animation:animcircles 0.5s infinite linear} @-webkit-keyframes animcircles{0%{-webkit-transform:translate(0px,0px);transform:translate(0px,0px)}100%{-webkit-transform:translate(-40px,0px);transform:translate(-40px,0px)}} @keyframes animcircles{0%{-webkit-transform:translate(0px,0px);transform:translate(0px,0px)}100%{-webkit-transform:translate(-40px,0px);transform:translate(-40px,0px)}} .pacm...

php - Loop using session -

count value changes on every refresh. how store count value in variable , use in "for loop" on here $x <= 10; <?php echo "<div class='p_list_heading'> product name </div>"; echo "<div class='p_list_heading'> product price </div>"; echo "<div class='p_list_heading'> product quantity </div>"; echo count($_session['product_name']); ($x = 0; $x <= 10; $x++) { if($_session['product_name'][$x]!==""){ echo "<div class=\"c_hold\">"; echo "<div>".@$_session['product_name'][$x]."</div>"; echo "<div>".@$_session['product_price'][$x]."rs". "</div>"; echo "</div>"; } } ?> store in variable $y $y = count($_session[...

ecmascript 6 - ES6 AngularJS 1 $inject Inheritence -

i have 3 child controllers extending single parent controller so: class parentcontroller { constructor( $scope, $state ){ this.$scope = $scope; this.$state = $state; } } parentcontroller.$inject = [ '$scope', '$state' ]; // child class childacontroller extends parentcontroller { constructor( $scope, $state, aservice ){ super( $scope, $state ); this.aservice = aservice; } // ... common functions } childacontroller.$inject.push( 'aservice' ); // child b class childbcontroller extends parentcontroller { constructor( $scope, $state, bservice ){ super( $scope, $state ); this.bservice = bservice; } } childbcontroller.$inject.push( 'bservice' ); my issue there reference kept $inject array. meaning childb's 3rd dependency aservice instead of bservice . so children have same following inject array $inject => [ '$scope', '$state', 'aservice...

c# - Get ContactPoint2D/contact normal from the OnTriggerXXX function -

i trying force unity not change speed , direction of objects after collision. need oncollisionenter2d event, don't need unity automatically change speed , direction; want manually. i tried use code dont work (automatically collision still works): private void oncollisionenter2d(collision2d collision) { fallvector = getrigidbody.velocity.normalized; fallnormalvector = collision.contacts[0].normal; var reflectedvelocity = vector3.reflect(fallvector, fallnormalvector).normalized; getrigidbody.velocity = reflectedvelocity * 3; } i told mark gameobject istrigger , use ontriggerenter2d other question uses collider2d instead of collision2d , can't contact normal that. how can contactpoint2d or contact normal collider2d in ontriggerenter2d function? edit: after reading answer below, wrote code below, getcontacts() returns (0.0, 0.0) in elements , did wrong? both objects of collision istrigger = true. (unity version 5.6.0f3) contactp...

pandas - Faster method for changing row entries? -

i have pandas dataframe follows: in [55]: df.head() out[55]: country energy supply energy supply per capita % renewable 0 afghanistan 3.210000e+08 10.0 78.669280 1 albania 1.020000e+08 35.0 100.000000 2 algeria1 1.959000e+09 51.0 0.551010 3 american samoa nan nan 0.641026 4 andorra 9.000000e+06 121.0 88.695650 and suppose want remove every numeric character each entries in df['country'] wrote following code: in [15]: c in energy['country']: ....: c = ''.join([i in c if not i.isdigit()]) ....: and when call df.head() , output same i.e no changes @ all. far know method assigns new value variable c doesn't make changes in dataframe(am right?) so tried new code: in [51]: k = 0 in [52]: c in df['country']: ....: df.loc[k, "country...

Postgresql 9.6 writing data from remote oracle db is slow -

Image
im using oracle_fdw extension in postgresql database. i'm trying copy data of many tables in oracle database postgresql tables. i'm doing running insert local_postgresql_temp select * remote_oracle_table . performance of operation slow , tried check reason , mybe choose different alternative. 1)first method - insert local_postgresql_table select * remote_oracle_table generated total disk write of 7 m/s , actual disk write of 4 m/s(iotop). 32g table took me 2 hours , 30 minutes. 2)second method - copy (select * oracle_remote_table) /tmp/dump generates total disk write of 4 m/s , actuval disk write of 100 k/s. copy utility suppose fast seems slow. -when run copy local dump, reading fast 300 m/s. -i created 32g file on oracle server , used scp copy , took me few minutes. -the wals directory located on different file system. parameters assigned : min_parallel_relation_size = 200mb max_parallel_workers_per_gather = 5 max_worker_processes = 8 effective_cache_size ...

javascript - Property 'includes' is missing in type 'Subscription' -angular2 -

i have been trying array of objects node service oninit , assign component. able view data in service when try assign variable in component, below error. have included code well. please favour on this.all need take array service , assign finallist in component. error in c:/users/girija/documents/animapp/src/app/components/list.component.ts (28,5): type 'subscription' not assignable type 'any[]'. property 'includes' missing in type 'subscription'. my code below: app.service.ts: public finallist=[] getlist(){ return this.http.get('/api/list').subscribe(data=>{ this.finallist=json.parse(data['_body']); return this.finallist; }) } app.component.ts: totallist=[]; ngoninit() { this.totallist=this.someservice.getlist(); } subscribe returns subscription object, not have looking for. try this: app.service.ts getlist(): ob...

python - How to use WebApp2 after installing PyreBase? -

is possible make webapp2 code run after installing pyrebase library? when webapp2 library imported in entirely different python code files error each time, says webapp2 module not found (in import code line) i know there problem webapp2 library after installing pyrebase, last time had remove python in order use webapp2 again , i'm looking solution. thank you!

javascript - Firebase script is blocked by AdBlock -

i've added firebase script website <script src="https://www.gstatic.com/firebasejs/4.2.0/firebase.js"></script> , unfortunately it's blocked extensions adblock, how can fix that? i can think of 2 ways: change adblock rules allow gstatic.com or @ least firebase sdk. host firebase sdk in different place adblock doesn't block.

javascript - How to send very big amount of data to server using ajax -

i practicing ajax , want send big amount of data server (for instance want make tags post can 20 tags). concatenate each tag specific symbol between them , in server filter , convert many tags again don't think that's natural way. best way send say, 30 - 40 entries server ajax optimally. update (as of people suggested showing js code example): $(document).ready(function(){ var tagstosend = "tag1%tag2%tag3%tag4%tag5%tag6%tag7%tag8%tag9%tag10%tag11%tag12%tag13"; $.ajax({ url: "test.php", method: "post", data: { tags: tagstosend }, success: function(result){ alert(result) } }); }) so in server i'll iterate on given tags string , filter each tag. , want more natural way. i think better way sending tags as json array , not get parameter . this: var postdata = {}; postdata['tagstosend'] = ["tag1", "tag2", ...]; and...

angularjs - How to url rewrite with Google app engine -- HTML5 mode not working -

i using angularjs, java application. using tomcat run application. when run project open url http://localhost:8080/projectname so configured base tag , html5 mode as $locationprovider.html5mode(true); $locationprovider.hashprefix(''); <base href="/projectname/"> with welcome file configured main.html in web.xml , added code <welcome-file-list> <welcome-file>main.html</welcome-file> </welcome-file-list> <error-page> <error-code>404</error-code> <location>/</location> </error-page> to make ui-router work html5 mode(mentioned in ui-router issue page). then change project google app engine standard java project , when run project open url http://localhost:8080 so changed base tag <base href="/"> with there no problem in main.html routing not working. when use $state.go working. on refreshing or manually entering url i'm getting 404 error. conso...

azure - Freeze Cloud Services for no billing -

we have few cloud services both vms , web worker roles in it. there way "freeze" or stop them not billed if want start them again? i saw answers of them outdated. thank in advance! is there way "freeze" or stop them not billed if want start them again? unfortunately no. must delete cloud service deployment stop billing. stopped cloud service continue incur charges.

c# - WPF Convert Checkbox.IsChecked to int or string 1 or 0 -

so winforms easy this: streamwriter.writeline(this.checkbox1.checked ? "1" : "0"); but how can in wpf ? have use ".ischecked" , message, can't convert bool? bool. i tried: streamwriter.writeline(this.checkbox1.ischecked ? "1" : "0"); which doesn't work. in wpf checkbox.ischecked of nullable type. have modify code to: streamwriter.writeline((this.checkbox1.ischecked == true) ? "1" : "0"); note: if see ? after datatype like: bool? abc , means abc can have null value, when default bool variable not accept null value. examples: for int datatype: int variable = 0; //correct int variable = null; //incorrect int? variable = null; //correct int? variable = 1; //correct for bool datatype: bool mybool = false; //correct bool mybool = null; //incorrect bool? mybool = null; //correct bool? mybool = true; //correct also in bool? mybool = true; , int? variable = 1; , if fur...

vba - Paste Excel worksheet to a PowerPoint presentation -

Image
i'm attempting paste excel finished powerpoint presentation. i've taken bits of code peltier tech , spreadsheet guru. macro intended work within excel template produces excel worksheet paste powerpoint. i've tested code in output worksheet , works. however, when macro executed real in excel template fails. do need define output worksheet object variable? , how reference variable in excel powerpoint paste loop , myrangearray section? please note, objppt defined in macro upstream of grandfinale(). sub grandfinale() dim pppres powerpoint.presentation dim ppslide powerpoint.slide dim shp object dim myslidearray variant dim myrangearray variant dim x long set objppt = getobject(, "powerpoint.application") set pppres = objppt.activepresentation set ppslide = pppres.slides(objppt.activewindow.selection.sliderange.slideindex) 'declare pp slides myslidearray = array(13, 14, 15, 16, 17, 18, 19, 20, 21, 22) 'declare excel ranges myrangearray =...

Efficient implementation of File Explorer - Android -

i'm creating simple file explorer on android studio, , wonder 1 of following implementations best: my solution : have activity called mainactivity displays list of files, , each time user clicks on directory, creates new mainactivity (and oncreate method gets new list of files, ...). correction : in correction tutorial, found when user clicks on directory, instead of starting new activity, code keeps current 1 , changes (clear list , fill new files, change title...). is there solution better other ? more efficient keep same activity ? thanks help. keep single activity no question ! when user clicks item build data-source based on newly selected path. make sure distinct between files , directories. call notifydatasetchanged , thats ! to query file system there 2 ways: the easy - use java file.listfiles() the hard - run shell command runtime.getruntime().exec( "ls -la" ) , parse response. there many open source projects on github subject. ex...

http - URL request from Python -

i have server running , listening value field can make requests web browser url, eg: http://192.168.1.101/value=1 how can make request python, tried above code doesnt seem work. from urllib.parse import urlencode urllib.request import request, urlopen url = 'http://192.168.1.101/value=1' request = request(url) my server listening in above formate.(get) get /value=1 http/1.1 cheers! use requests module import requests req url = 'http://192.168.1.101/value=1' resp = req.get(url) print(resp.text) # printing response

jsf 2 - JSF returns blank/unparsed page with plain/raw XHTML/XML/EL source instead of rendered HTML output -

i have facelets files below. webcontent |-- index.xhtml |-- register.xhtml |-- templates | |--userform.xhtml | `--banner.xhtml : both pages using templates /templates directory. /index.xhtml opens fine in browser. generated html output. have link in /index.xhtml file /register.xhtml file. however, /register.xhtml not getting parsed , returns plain xhtml / raw xml instead of generated html output. when rightclick page in browser , view page source , still see xhtml source code instead of generated html output. looks template not getting applied. however, when open /register.xhtml /faces/register.xhtml in browser's address bar, displays correctly. how caused , how can solve it? there 3 main causes. facesservlet not invoked. xml namespace uris missing or wrong. multiple jsf implemenations have been loaded. 1. make sure url matches facesservlet mapping the url of link (the url see in browser's address bar) has match <url-patte...