Posts

Showing posts from August, 2013

android - React native debugger transtions are very slow on windows 10, but very fast on linux ubuntu -

i have real device samsung galaxy core, 1.5 gb of ram. make test debugging same app on windows 10, debugger on , transitions , animations slow. on linux ubuntu 64 bit transitions , animations fast. debugging adb reverse. react native debugger slow if use wi-fi in both os. not able understand problem on windows because work fine , fast debugger adb reverse.

processing - Capture RGB image using Kinect V2 with size 512* 424 -

i using kinect v2 acquisition data save rgb, ir, depth, raw , registered images in each capture. problem images have size (512*424) except rgb image has (1920*1080). have (512*424) not want save (1920*1080) resize (512*424) because think there problems coordinates using processing library work kinect idea how can save required size? here code using save the information each capture ... hope might explain problem import org.openkinect.freenect.*; import org.openkinect.freenect2.*; import org.openkinect.processing.*; kinect2 kinect2; printwriter output; void setup() { size(1024, 848, p2d); kinect2 = new kinect2(this); kinect2.initvideo(); kinect2.initdepth(); kinect2.initir(); kinect2.initregistered(); // start data kinect2.initdevice(); output = createwriter("raw_data.txt"); } void draw() { background(0); image(kinect2.getvideoimage(), 0, 0, kinect2.colorwidth*0.267, kinect2.colorheight*0.267); image(kinec

Error with Admin Backup/Transfer DirectAdmin -

i have scheduled mysql backups admin backup/transfer. everytime there message errors databases on server (not all): <17:00:02> error while backing database k001d08_tm error while backing database k001d08_tm: sql file 0 bytes in size: /home/admin/database_backups/k001d08/backup/k001d08_tm.sql mysqldump error output: mysqldump: got error: 2002: "can't connect local mysql server through socket '/var/run/mysqld/mysqld.sock' (2)" when trying connect but when go backup, backup made well. error messages wrong in opinion. how can fix messages? because wrong messages can not monitor way want. thanks in advance.

node.js - TypeError('app.use() requires middleware functions') in session in express js -

while using session in express js, getting following error. app.use(cookieparser()); app.use(session({secret:'xyz'})); typeerror: app.use() requires middleware functions @ eventemitter.use (d:\lms-node\node_modules\express\lib\application.js:210:11)

java - What is a good IF statement to use in my Appium code -

new site , still trying hang of asking questions. update ok after making changes code have if statement in code, problem if if statement true proceeds page won't click on button. code correct or missing parts? driver.findelement(by.id(redbutton)).click(); driver.findelement(by.id(good)).click(); driver.findelement(by.id(locator)).click(); //if statement variable named "viewdets" //if "view details & pay" button pops click if (!driver.findelements(by.id(viewdets)).isempty()) { driver.findelement(by.id(viewdets)).click(); //app closes , doesn't click pay button driver.findelement(by.id(pay)).click(); driver.findelement(by.id(conpay)).click(); //if not continue stall , check in } else { thread.sleep(7000); driver.findelement(by.id(stall)).click(); driver.findelement(by.id(two)).click(); driver.findelement(by.id(three)).click(); driver.findelem

php - Need to compare two rows from the DB in Laravel -

i have table users in laravel. a user has, among other things, id , owner_id . i want perform query owners. means, id equal owner_id . users::where('id','owner_id')->get(); something this. didn't work obviously. any suggestions? use wherecolumn instead. users::wherecolumn('id','owner_id')->get(); with where , you're looking literal string 'owner_id'.

javascript - Dynamically generated form submits only the last row ID of the mysql table -

i have dynamically generated form.it has 1 text input value id dynamically fetched database table (table_one). aim submit id table(table_two). on page can see these ids fetched table_one say: 1, 2, 3, 4 ,5, when submit of these ids '2', last id '5' submitted table_two. how can amend code when submit row 2, id '2' submitted not '5'? below code. html <form> <input type="text" id="name" name="name" value="<?php echo $name_id;?>" > <button type="submit" onclick="return chk()">edit</button> </form> javascript function chk(){ var name = document.getelementbyid('name').value; var datastring = 'name='+ name; $.ajax({ type:"post", url:"test.php", data:datastring, cache:false, success: function(html){ $('#msg').html(html); }

sql - I need to retrieve the department, which has the max(avg(salary)) for each region from table hr (oracle) -

i need retrieve highest average salary group regions table hr (oracle) output should be: region, department_name, max(avg(salary)) can't output region , department_name together select t1.region_name, max(t1.avg)from ( select region_name, department_name, round(avg(salary) ) avg regions reg inner join countries coun on reg.region_id = coun.region_id inner join locations loc on coun.country_id = loc.country_id inner join departments dep on loc.location_id = dep.location_id inner join employees emp on emp.department_id = dep.department_id group region_name, department_name order 3 ) t1group t1.region_name i suppose looking department(s) per region have highest avarage salary in region. you'd rank joined rows avarage salary , keep highest ranked rows: select region_name, department_name, avg_salary ( select reg.region_name, dep.department_name, a

How do I plot the x axis line using Highcharts when pegged at 0? -

how plot x axis line bar chart pegged @ 0, when have positive , negative values (i.e. bars on both side of x axis)? it not different plotting normal column chart. use negative values , highcharts scale chart automatically. highcharts.chart('container', { chart: { type: 'column' }, title: { text: 'column chart negative values' }, xaxis: { categories: ['apples', 'oranges', 'pears', 'grapes', 'bananas'] }, credits: { enabled: false }, series: [{ name: 'john', data: [5, 3, 4, 7, 2] }, { name: 'jane', data: [2, -2, -3, 2, 1] }, { name: 'joe', data: [3, 4, 4, -2, 5] }] }); jsfiddle: link

excel vba - Populating combobox with dynamic horizontal range -

Image
i’m needing vba code value column ‘a’ , list adjacent horizontal non blank cells right in userform combox1. sample data: +-----+----+----+----+---+ | | b | c | d | e | +-----+----+----+----+---+ | a1 | 63 | | 55 | 5 | +-----+----+----+----+---+ sudo code: sub test() myval = “a1” findme = myval set match = sheets(“sheets1”).range(a:a).find(findme) myrange = foundrange userform1.combobox.value = myrange exit sub in example code above, foundrange row value found, plus columns ‘b’ through ‘e’, minus blanks. combobox values: 63 55 56 thank you! create userform named userform1 , combobox named combobox , button named commandbutton1 . on image below: then use code on commandbutton populate combobox: private sub commandbutton1_click() dim ws1 worksheet dim long, c long dim rng range, rng2 range dim cellfound range dim lastrow long, lastcolumn long set ws1 = thisworkbook.sheets(1) findme = "a1" lastrow = ws1.cells(w

Android Beacon Library - didRangeBeaconsInRegion Method -

i have theory question. when using method didrangebeaconsinregion of android beacon library, method returns beacons found nearby, eventhough diferent regions (uuid), or returns beacons of same region (uuid) defined? thanks, if set 2 different region objects, region1 , region2, , start ranging on them, 2 callbacks each second. the first callback give list of beacons matching region1 , second give list of beacons matching region2. this behavior not specific uuid, region. if define wildcard region not specify uuid, single callback return beacons seen. if define region uuid specified, callback region contain list including beacons matching uuid.

uitableview - Swift 3 - Custom TableViewCell dynamic height - programatically -

i trying setup dynamic height custom table view cell...programatically. there many tutorials doing inside storyboard, pure programmatic solution: class customtableviewcell: uitableviewcell { var container: uiview = { let view = uiview() view.translatesautoresizingmaskintoconstraints = false return view }() override func awakefromnib() { super.awakefromnib() self.setupview() self.addconstraints() } func setupview() { self.contentview.addsubview(self.container) self.container.backgroundcolor = uicolor.cyan } func addconstraints() { self.container.leadinganchor.constraint(equalto: self.contentview.leadinganchor, constant: 0).isactive = true self.container.trailinganchor.constraint(equalto: self.contentview.trailinganchor, constant: 0).isactive = true self.container.topanchor.constraint(equalto: self.contentview.topanchor, constant: 0).isactive = true se

operating system - Issue writing and reading from shared memory space c -

the goal of code create shared memory space , write n's value in child print numbers generated in parent process. presently prints out memory addresses 16481443b4 change every time run program. not sure if writing shared memory incorrectly or reading shared memory incorrectly. possibly both. #include <sys/types.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <wait.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/shm.h> #include <sys/mman.h> int main(int argc, char** argv){ //shared memory file descriptor int shm_fd; //pointer shared memory obj void *ptr; //name of shared obj space const char* name = "collatz"; //size of space const int size = 4096; //create shared memory obj shm_fd = shm_open(name, o_creat | o_rdwr, 0666); //config size ftruncate(shm_fd, size); //memory map shared memory obj ptr = mmap(0, size, prot_wri

python - Django form field required based on field from another form -

i have form in set form fields 'required' based on value form in same view example class forma(forms.form): field_a = forms.charfield() field_b = forms.charfield() class formb(forms.form): field_x = forms.choicefield(choices = [('a', 'a'), ('b', 'b')]) i set fields in forma required during validation of form, based on value of fields_x in formb. there clean way in django ?

c# - Implement interface using concrete implementations of abstract interface members -

is there specific reason why following not possible? class classofints : ihaveints { public myint intholder { get; } // solves use case i'm unsure why necessary // iint ihaveints.intholder { => intholder; } } interface ihaveints { iint intholder { get; } } class myint : iint { public int theint { get; } } interface iint { int theint { get; } } i think above code implements ihaveints since myint implements iint. is there specific reason why following not possible? well, short answer is: "because c# specification doesn't allow it". longer answers typically involve amount of speculation in thought process of c# language designers. makes such questions opinion based. however, did make deliberate choice interface members have implemented precisely declared, , choice why can't that. reason behind choice have special-case read-only properties, because allowing property implemented way writeable property unsafe. all

ssms - How to create a SQL Server query to do validation against preexisting look up (base) table? -

i have customer customer records in 1 of fields country. say below records , column customer number, column customer name , column c country cnumber cname ccountry ----------------------------- 0001 customera usa 0002 customerb japan 0003 customerc france 0004 customerd hoss in sql server database, there tabled name country has countries there listed there. query compare customers have valid country name in column c. can see customer 0004 has country hoss not country. need query tell me invalid country 0004 customer. thanks help. if want list records invalid country select * customer ccountry not in (select ccountry country)

java - JNI application hanging -

please how approach debugging jni application. used jps pid of process that's running jvm: $ jps 8248 <- pid of process span c++ application run jni stuff ... 8335 jps now can attach gdb stack. $ gdb -p 8248 gnu gdb (gdb) red hat enterprise linux 7.6.1-94.el7 .... /cut/ (gdb) (gdb) bt #0 0x00007fddd9f141bd in __lll_lock_wait () /lib64/libpthread.so.0 #1 0x00007fddd9f0fd02 in _l_lock_791 () /lib64/libpthread.so.0 #2 0x00007fddd9f0fc08 in pthread_mutex_lock () /lib64/libpthread.so.0 #3 0x00007fddda9f3e26 in mutexlock () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.0.0.0 #4 0x00007fddda9ed6f1 in settlsexceptionstrings () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.0.0.0 #5 0x00007fddda9ec38c in printexceptionandfreev () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.0.0.0 #6 0x00007fddda9ec52d in printexceptionandfree () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.0.0.0 #7 0x00007fddda9ed46b in getjnienv () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.

javascript - Mozilla CORS issue work around -

i have following code in script on page: function getjson(url, passedfunction) { console.log("getjson start: "+url); var xhr = new xmlhttprequest(); globalforxhr = xhr; xhr.open("get", url, true); xhr.overridemimetype("application/json"); //stop mozilla bug xhr.withcredentials = true; xhr.onreadystatechange = function() { console.log("getjson ready state change: "+xhr.readystate+" , xhr: "+xhr.status); if (xhr.readystate == 4 && xhr.status == 200) { try { passedfunction(json.parse(xhr.responsetext)); } catch (e) { alert("got exception ("+e+") whille trying handle: "+url); } } } xhr.send(); } i have 2 situations: page served remote server s1, , code calling remote server s2. standard cors headers in place , works fine in both mozilla , chrome. but, running tom

Method Interception using Reflection in C# -

i wrote abstract class uses reflection find fields marked attribute in constructor, this: [attributeusage(attributetargets.field)] public class trackedfield : attribute {} public class atrackedobject { public atrackedobject() { type objtype = this.gettype(); foreach(fieldinfo f in objtype.getfields()) { if(f.isdefined(typeof(trackedfield)), false)) { //add field list keep tabs on periodically } } } } what do, is: create attribute, trackedmethod in constructor, in same fashion trackedfields, find methods tagged trackedmethod change method when gets called, method inside atrackedobject gets called first or instead, either replacing method entirely or injecting code it, without breaking ability @ least see original method call was, including parameters no third-party libaries , , should .net 3.5 compatible i have seen number of se threads discussing how this, , of answers relied on being able use thi

c - Wrong output when printing a tent shape with stars -

i'm trying print out hollow, open tent shape using asterisk stars "*". code uses 2 loops, first rows, , other columns. following code: void printtent(int n) { int j = 1; int = 1; if (n == 1) { printf("*"); } else { for(i = 0; < n; i++) { for(j = 0; j < n; j++) { printf(" "); } if(j == n) { printf("*"); for(j = 1; j <= n; j++) { printf(" "); } } } } } int main() { printtent(4); } output obtained: * * * * desired output: * * * * * * * i don't think need if (n == 1) { printf("*"); } we can take care of in you've written in else part. for n=4 , number of spaces printed @ start of each line 3, 2, 1 & 0. you seem trying accomplish first inner loo

java - JSoup: Problems getting text from elements -

import java.io.ioexception; import org.jsoup.jsoup; import org.jsoup.nodes.document; import org.jsoup.nodes.element; public class main { public static void main(string[] args) throws exception { document d=jsoup.connect("https://osu.ppy.sh/u/charless").get(); for(element line : d.select("div.profilestatline")) { system.out.println(d.select("b").text()); } } } i'm having problems getting text "2027pp (#97,094)" in div.profilestatline b. should output, doesn't. url: https://osu.ppy.sh/u/charless parts of page loaded javascript, why can't see divs you're looking for. you can use browser load page , interpret javascript before parsing. library webdrivermanager help. public static void main(string[] args) throws exception { chromedrivermanager.getinstance().setup(); chromedriver chromedriver = new chromedriver(); chromedriver.get("https://osu.ppy.sh

angular - How can I do dynamic layouts templates with Bootstrap grid? -

i working boostrap , angular 4. create register component , want reuse html in other place. html code <div class="col-md-4 col-sm-6 col-md-offset-4 col-sm-offset-3"> <div class="card"> <div class="card-header text-center" data-background-color="purple"> <br> <h4 class="title">registrate</h4> <br> </div> <p class="category text-center">unete nosotros</p> <div class="card-content"> <div class="input-group"> <span class="input-group-addon"> <i class="material-icons">face</i> </span> <div class="form-group label-floating"> <label class="control-label">nombre</label> <input type="text" class="form-control">

c# - Add a second command that calls another method? -

i'm remaking text-based adventure game. during character creation, i'd user, @ time, type 'skillset' , list traits specific race has. i've tried couple hours , can't seem figure out. this character creation class. public string usercommand_seachskill; skillset searchskill = new skillset(); public void create_character() { // choose gender // { validate = 0; console.clear(); console.write("are male or female? (f/m): "); sex = console.readline().toupper(); if (sex == "m" || sex == "f") { validate = 1; } else if (sex != "m" || sex != "f") { console.writeline("you must enter 'm' or 'f'"); } } while (validate == 0); and skill set class. in if/else statements methods print traits of

Angular - kendo-grid-column - Bind html data -

can directly bind pre formatted value kendo grid column? data contains html tags , want column render data formatting , not treat tags text. use ng-template achieve desire output need parse whole data, store different keys , use them format in .html file. there anyway make kendo render html inside column? you can render html using wrapper element within cell template , , bind innerhtml property data item field, containing html render, e.g.: <kendo-grid-column field="htmlfield"> <ng-template kendogridcelltemplate let-dataitem> <div [innerhtml]="dataitem.htmlfield"></div> </ng-template> </kendo-grid-column> model: { "productid": 1, "productname": "chai", "supplierid": 1, "categoryid": 1, "quantityperunit": "10 boxes x 20 bags", "unitpri

development environment - Android app losing backstack after going to sleep -

the problem: i intent new activity called missionactivity within mainactivity. i press home button. i return app after long period of time, application has start again. the app returns missionactivity using previously. if press arrow within toolbar, or press button closes app backstack lost (i think). ideally, launch mainactivity after application gets killed. have read through android documentation , other questions on site. however, no matter change in android manifest, behavior doesn't seem affected. here relevant portion of manifest. mainactivity intents missionactivity. guessing maybe have add launch modes? however, whatever try adding 1 doesn't seem change anything. <application android:name=".nextspaceflight" android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsrtl="true" android:theme="@style/apptheme">

javascript - Jquery On change array ID -

i have multiple selector on loop in php code var new_acc = $("div[id^=new_acc]").hide(); (var = 1; <= id; i++) { $('#reason_change\\['+id+'\\]').change(function(e) { $( "#reason_change\\["+id+"\\] ").show(); }); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <select name="reason_change[1]" id="reason_change[1]" > <option value="0">--0000--</option> <option value="1">--0001--</option> <option value="2">--0002--</option> </select> <div class="field" id="new_acc[1]"> <label>account</label> <input type="text" name="account_cus[1]" id="account_cus[1]" value=""> </div> <select name="reason_change[2]" id="reas

mysql - Search function in PHP works with numeric values but doesn't work with letters/words -

people can order links @ platform , these stored in 2 different tables, eg wp_project , wp_articles. reason when people place order 1 link 1 project row gets created , 1 article row gets created. however if client orders 10 links there 1 project entry , ten article entries. isn't relevant problem explain how system works. there 2 common identifiers projects , articles, both id , project title stored in both inpu_project , inpu_articles. now if want echo links 1 project built search function can select project id, click search , whether client ordered 1 link or 20 links amount of links show. the problem starts when want search based on project title instead of id, non-numeric words (with spaces in between sometimes). this prevent error undefined index in error logs $where_clouse=''; this search function based on project title: if(isset($_get['todo']) && $_get['todo']=='search') { if($_get['proid'

Grails Serialization for dependency classes -

i have project has 3 modules module module b module c module has author class , being referenced in other modules b , c. when build project 3 modules has class class file size different in module b , c a. this causing serializaiton id issue. in 3 classes has different serialization id. we getting invalidclassexception in clustered environment. 1 come across issue? please me find root cause.

erlang - How to access a variable from a method which was set in another method of the same module in elixir? -

i want access argument x of m1 method m2 method. defmodule mymodule def m1(x) # code end def m2() # accesss 'x' here io.puts x end end how access x method m2? you can't this. forbidden operation in beam in erlang , elixir , other beam based languages. intended behavior have provide transparently required input data each function call. can emulate using other components of erlang run-time system ( erts ) . example, use ets (erlang term storage) or use process working server providing such storage. constraint fundamental building block making highly reliable systems primal purpose of erlang. more information read making reliable distributed systems in presence of software errors thesis. described best there @ beginning of work.

jquery - Include millisecond data in JavaScript Date -

i have requirement send current system date microservices on search. time should include milliseconds information well. sending new date() same , looked like: thu aug 31 2017 15:06:37 gmt+0530 (india standard time) however need milliseconds information time should like: thu aug 31 2017 15:06:37.228 gmt+0530 (india standard time) here 228 millisecond @ moment can extract using getmilliseconds() method of date . question how can add in date works locations wherever application accessed? if don't mind having result string, show output looking for: // es5 var fmtdatemses5 = function(date) { var splitdate = date.tostring().split(' '); splitdate[4] = splitdate[4] + '.' + date.getmilliseconds(); return splitdate.join(' '); } // log output (es5) console.log('es5 output\n', fmtdatemses5(new date())); // es6 const fmtdatemses6 = date => { const splitdate = date.tostring().split(' '); splitdate[

synapse - Cannot contact endpoint through http proxy -

my synapse server behind http proxy , have configured in axis2.xml file below. <transportsender name="http" class="org.apache.synapse.transport.passthru.passthroughhttpsender"> <parameter name="http.proxyhost" locked="false">cachex.pdn.ac.lk</parameter> <parameter name="http.proxyport" locked="false">3128</parameter> <parameter name="http.nonproxyhosts" locked="false">localhost|moon|sun</parameter> </transportsender> but getting sockettimeout exepction while calling endpoint. 2017-09-12 10:03:33,198 [-] [wrappersimpleappmain] warn proxyservice unable load wsdl : stockquote java.net.sockettimeoutexception: connect timed out this issue not there when use sysnpase server without http proxy how fix issue?

ios - Different AVAudioSessionCategory for headphone use and no headphone use -

is possible setup different avaudiosessioncategory:s headphone use , non headphone use? i haven't found direct way it, , no options. it looks if can see route active etc , listen route changes, feasible go long way of trying accomplish way ourselves? let's want avaudiosessioncategoryplayback when headphones plugged in, , when not want other category or category/option setup etc.

html - google map not displaying in webpage -

html : <ui-gmap-google-map center='map.center' zoom='map.zoom' control="map.control"> <ui-gmap-marker ng-repeat="marker in markers" coords="marker.coords" options="marker.options" events="marker.events" idkey="marker.id"> <ui-gmap-window show="true"> <div class="popup"> {{marker.content}} </div> </ui-gmap-window> </ui-gmap-marker> </ui-gmap-google-map> js: controller part : // google maps $scope.map = { center: { latitude: 0, longitude: 0 }, zoom: 1, maptypeid: google.maps.maptypeid.roadmap, control: {} }; // place marker $scope.markers = []; function setmarker(lat, long, title, content) { var marker = { id: $scope.markers.length+1, coords: { latitude: lat, longitude: long },

github - Maven release issue in Jenkins -

i trying taking maven build & update release using jenkins. not able update project version , getting error. how fix ? jenkins version : 2.7.1 war maven : 3 windows 7 <scm> <connection>scm:git:git@github.com:username/test-app.git</connection> <url>scm:git:git@github.com:username/test-app.git</url> <developerconnection>scm:git:git@github.com:username/test-app.git</developerconnection> </scm> maven goal -x release:clean release:prepare release:perform <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-release-plugin</artifactid> <version>2.5.3</version> </plugin> error [error] failed execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project test-app: unable commit files [error] provider message: [error] git-push command failed. [error

set lookup field & managed meta data field using jsom in sharepoint -

setting lookup field & managed meta data field value using jsom. through jsom need set value list . setting lookup , managed metadata columns through code try , modify below sample code: var clientcontext = new sp.clientcontext(_sppagecontextinfo.webabsoluteurl); var list = clientcontext.get_web().get_lists().getbytitle('testlist'); var itemcreateinfo = new sp.listitemcreationinformation(); var listitem = list.additem(itemcreateinfo); var singlelookupcolumn = new sp.fieldlookupvalue(); singlelookupcolumn.set_lookupid(2); listitem.set_item('customlookup', singlelookupcolumn); var field = list.get_fields().getbyinternalnameortitle("testtaxonomy"); var taxfield = clientcontext.castto(field, sp.taxonomy.taxonomyfield); var taxonomycol = new sp.taxonomy.taxonomyfieldvalue(); taxonomycol.set_label("test"); taxonomycol.set_termguid("23d03b66-5be6-512b-9fe3-ff13b9b4757c"); taxonomycol.set_wssid(-1); tax

java - Program crashes when given high values -

my coding, im trying make program wont crash whatever input user, program divide , print out answer. have searched not find help! coding works fine numbers smaller 100000000 or 199999999 point. scanner in = new scanner(system.in); double n1 = in.nextint(); double n2 = in.nextint(); double n3 = n1/n2; system.out.println(n3); you using in.nextint() read integer value less 2^31 -1 (of course gets converted double ). when give values more (2^31) - 1 12589691475 , nextint() can not read them big numbers. use in.nextdouble() instead.

python - Django ImportError from django.core.management -

i have tried make work #!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("django_settings_module", "leke.settings") try: django.core.management import execute_from_command_line except importerror: # above import may fail other reason. ensure # issue django missing avoid masking other # exceptions on python 2. try: import django except importerror: raise importerror( "couldn't import django. sure it's installed , " "available on pythonpath environment variable? did " "forget activate virtual environment?" ) raise execute_from_command_line(sys.argv) please that's error have been getting manager.py . thanks django might not able install package. i'm not sure solution did trick me. sudo pip install dj

datetime - Error in converting date-time to number in MATLAB -

i have .csv file contains 2 columns of time data. want convert date number, following error: ??? error using ==> datenum @ 174 datenum failed. error in ==> interpolasi_suhu_dan_waktu_16_02_17 @ 21 t = datenum(m{1}); caused by: error using ==> dtstr2dtvecmx input cell array must either column or row. here .csv file (waktu_16_02_17.csv): 0:03:13 0:02:58 0:13:13 0:12:58 0:23:13 0:22:58 0:33:13 0:32:56 0:43:13 0:42:58 0:48:11 0:57:59 0:58:13 1:07:59 1:08:13 1:17:59 1:18:13 1:27:59 1:28:14 1:37:57 1:38:14 1:52:59 1:44:31 2:02:57 and code used is: fid = fopen('waktu_16_02_17.csv', 'r'); m = textscan(fid, '%s %s', 'delimiter', ',', 'collectoutput', 1); fclose(fid); format short g g = m{1}; can me figure out what's going wrong? still can't see correct formatting of csv file (is \n after each string? 2 strings or 1 long?). code works me. i copied data , create new .csv file. contains 1 string

Firebase deploy firebase.json only -

can deploy hosting configuration file, firebase.json instead of deploying assets ie. html files, images etc? if so, how? i'm doing firebase deploy --only hosting deploy assets. i'm asking because want test out rewrite rules etc , don't want re-upload assets again time consuming. thanks. there no way deploy firebase.json file.

centos - Tomcat address already in use -

i have problem tomcat. on centos server have 3 websites. two working, 1 have problem severe: failed initialize end point associated protocolhandler ["http-bio-8081"] java.net.bindexception: address in use :8081 how can do? thank you!

c# - I am trying to export an excel and make it password protected. My code is given below.But i am getting error -

i trying export excel , make password protected. my code given below. but getting error: excel completed file level validation , repair. some parts of workbook may have been repaired or discarded. i don't know doing wrong . in-case without save line package error doesn't appear. in controller: [httpget] public filestreamresult exporttoexcel() { _objservice = new servicebal(); list<reconcilationentity> objmodel = new list<reconcilationentity>(); objmodel = _objservice.getcreditsudharleads(); string url = string.empty; if (!directory.exists(server.mappath("~/tempexcel"))) { system.io.directory.createdirectory(server.mappath("~/tempexcel")); } string filepath = server.mappath("~/tempexcel"); string date = datetime.now.toshortdatestring().replace("/", "_") + "_" + datetime.now.toshorttimestrin

php - WordPress Feed: add "data-has-syndication-rights" attribute -

i want add data-has-syndication-rights attribute images in wordpress atom feed. idea how that? maybe there solution hook. example: http://feedexamples.ingestion.microsoft.com/

android - Animation effect to buttons in linear layout -

i have floating action button , linear layout containing 5 buttons.on clicking of floating action button, making linear layout visible or invisible.i want add animations buttons on click of floating action button.the animation should on clicking of fab,first button should visible of linear layout , second button should visible,then third,then fourth , on.i have tried adding following animation doesn't quite work me <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha xmlns:android="http://schemas.android.com/apk/res/android" android:fromalpha="1.0" android:toalpha="0.4" android:duration="1000" android:repeatcount="infinite" android:repeatmode="reverse" /> </set> please help

php session on refresh page or on button submit -

my site url this: http://localhost/record/index.php when add,update,delete record table url this: http://localhost/record/index.php?delmsg=users%20has%20been%20deleted how can remove php variable on refresh page or button submit using session you right trying remove message handling variables, using sessions lot better , let control logic not safe users pointed. use session_start(); in beginning of every php file want handle session values. to set value want read later: if (isset($_get['del'])) { $del_id = intval($_get['del']); // intval improve security if (mysqli_query($sql,"delete user id = ".$del_id.";")) { $_session["delmsg"] = "user id = " . $del_id . " has been deleted"; header('location: index.php'); } } to read value in further request , show contents accordingly: if (isset($_session["delmsg"])) { echo "<div class='message

reactjs - How to know heights of elements before they get rendered in react? -

i have long list of elements in ui leads performance issue. facing issues after integrating 'react-virtualization'. screen blinking while scrolling up/down. can suggest, how make work elements of different heights? thanks in advance

swift - Getting elements from array of dictionary and save the keys as string, and values as string -

i have array of dictionaries of type <int,string> this: [14: "2", 17: "5", 6: "5", 12: "ali", 11: "0", 2: "4", 5: "it it", 15: "5", 18: "2", 16: "5", 8: "2", 13: "4", 19: "4", 1: "2", 4: "12-09-2017 - 9:52"] i need keys alone , save them in string, , values alone , save them in string. the results should that: string key = "12,17,6,12,11,2,5,15,18,16,8,13,19,1,4" string values = "2,5,5,ali,0,4,it ti,5,2,5,2,4,4,2,12-09-2017 - 9:52" a dictionary has keys , values property return keys/values (lazy) collection. values have join them: let dict = [14: "2", 17: "5", 6: "5", 12: "ali", 11: "0", 2: "4", 5: "it it", 15: "5", 18: "2", 16: "5", 8: "2", 13: "4", 19: "4",

elk stack - Metricbeat filesystem type ignore seems not work -

i'm trying setup disk usage visualization in kibana using metricbeat system module. seems ignore filesystem.ignore_types setting , feed data of mounted filesystems, including virtual kernel-related binfmt_misc, cgroup, debugfs, sysfs, proc, devpts, securityfs etc. configfile looks following: metricbeat.modules: - module: system metricsets: - cpu - load - filesystem - memory filesystem.ignore_types: [binfmt_misc, cgroup, tmpfs, debugfs, sysfs, binfmt_misc, proc, devpts, securityfs, autofs,mqueue,hugetlbfs, fusectl, pstore] enabled: true period: 60s but still metricbeat sends data of filesystems of these types elasticsearch. 2017-09-11t22:56:04+02:00 dbg publish: { "@timestamp": "2017-09-11t20:56:04.816z", "beat": { "hostname": "osboxes", "name": "osboxes", "version": "5.5.2" }, "metricset": { "module": "system

powershell - A positional parameter cannot be found that accepts argument 'System.Management.Automation.PSCredential' -

i'm try running dsc configuration in azure automations, get's suspended following exception: "the running command stopped because preference variable "erroractionpreference" or common parameter set stop: positional parameter cannot found accepts argument 'system.management.automation.pscredential'. the code i'm running : configuration domainjoin{ $cred = get-automationpscredential -name "azurelogin" login-azurermaccount $cred import-dscresource -modulename 'psdesiredstateconfiguration' import-dscresource -modulename 'xdscdomainjoin' $dscdomainadmin = get-azurermautomationcredential -name "gsy admin" -resourcegroupname "rg-dc-rocs" -automationaccountname "rocsautomation" $dscdomainname = get-azurermautomationvariable -name "dscdomainname" -resourcegroupname "rg-dc-rocs" -automationaccountname "rocsautomation" #psdscallowdomainuser = $true node l

ViewPager in Android - When is the destroyItem(ViewGroup container , int position) method called? -

in viewpager set adapter follows myviewpageradapter = new myviewpageradapter(); viewpager.setadapter(myviewpageradapter); this myviewpageradapter class public class myviewpageradapter extends pageradapter { private layoutinflater layoutinflater; public myviewpageradapter() {} @override public object instantiateitem(viewgroup container, int position) { } @override public int getcount() { } @override public boolean isviewfromobject(view view, object obj) { } @override public void destroyitem(viewgroup container, int position, object object) { } } what happens when call empty contructor in myviewpageradapter? methods called? no methods called. a constructor used create new object of class myviewpageradapter , because in case it's default constructor (empty body) , can skip writing it. ref: https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.8.9

gnuplot - How to use dgrid3d with X and Y points to plot an intensity map -

i have file x y data points (> 10^4) 12.399999999999999 3.7333333333333334 22.13333333333334 34.93333333333333 13.600000000000001 10.133333333333333 94.26666666666667 26. 25.333333333333336 8.666666666666666 52. 38. 25.33333333333333 51.733333333333334 24.799999999999997 37.333333333333336 77.33333333333333 5.466666666666667 13.2 7.733333333333333 33.46666666666667 4.666666666666667 33.86666666666666 46. 52.8 3.466666666666667 24.400000000000002 20.933333333333334 54.53333333333334 27.6 121.73333333333335 30.133333333333333 103.73333333333333 13.466666666666667 47.599999999999994 5.333333333333333 ........... (positive , non-gridded), plot gnuplot. i have been looking different posts , examples, , provide function intensity or directly z values corresponding intensity, or use array of values indicating pixels or squared zones of image. i ask if there way plot intensity map plot providing x , y points. also, know if possible indicate range plot

c++ - profiler : enable/disable depend on value of a (global?) variable -

i want profile @ time-steps. game. my game loop (heavily simplified):- for(int t=0;t<1000000;t++){ dogameloop(); // logic -> physic -> graphic -> sleep -> clear allocator ... }; in visual studio, how profile dogameloop() e.g. when 43<=t<=45 ? want profile while -o2 turn on (release mode). now, can profile whole program via (top bar) > debug > performance profiler > cpu usage . show graphical tree https://blogs.msdn.microsoft.com/devops/2015/10/29/profile-your-cpu-in-the-debugger-in-visual-studio-2015/ . i don't mind solution make t global variable, or insert microsoft-specific piece of code near dogameloop() . prefer not change other parts of code. (i have searched solution few months.) i heard queryperformancecounter may help, have no idea it.

android - Hidden WIFI live glasses (get audio) -

i bought these hidden glasses ( https://www.alibaba.com/product-detail/2017-new-style-live-12m-resolution_60544870892.html ). when want view video streaming in browser, write ip of device , access app web. through dev tools browser video streaming ip. when activate audio option, don't watch audio ip or similar. question if has worked glasses , tell me experience. in advance!