Posts

Showing posts from July, 2010

react native - Fix children container width truble -

Image
my children views may different width, not bigger parent view. how can fix it? this screenshot of how looks now: you can give parent view width device window width this: var {height, width} = dimensions.get('window'); implement height , width required in parent view: <view style={{height:height, width:width}}></view> after constructing parent view, can give child view width , height own interest : style={{height:40, width:250}} also should have knowledge on react-native flex construct others layout can view here

amazon web services - issue while running uiautomator 2.0 tests on AWS device farm -

i new automated testing, , started using uiautomator 2.0 android studio, have 3 apk files, app-debug, app-debug-androidtest-unaligned , app-debug-unaligned. in aws device farm first uploading app-debug, choose instrumentation type, uploading app-debug-andriodtest-unaligned. and when tried run 2 tests (setup suite , tear down suite) running. please me identify issue.

javascript - onChange event---> only alert working?!! other functions not working -

<div class="col-md-2"><select id="ddluser" onchange="loadcheckboxesforuser()" class="form-control" style="width:100%;" > function loadcheckboxesforuser() { alert("hi"); $("#checkbox1").attr("checked", "checked"); } only alert working, not make checkbox checked, otherwise when use function on $(document).ready , works fine you can use .prop method check checkbox $("#checkbox1").prop("checked", "checked");

node.js - neo4j.ClientError: [Neo.ClientError.Security.Unauthorized] -

i'm new neo4j tried insert data neo4j database via node4js error has occurred resolve problem. var express=require("express"); var app=express(); var neo4j=require('neo4j'); var neo4jdb = new neo4j.graphdatabase('http://localhost:7474/browser'); var crypto=require('crypto'); var bodyparser = require('body-parser'); app.use(bodyparser.urlencoded({ extended: true })) var appsecret=process.env.app_secret; app.get('/',function (req,res){ res.send("hello world"); }) app.get('/index',function(req,res){ res.sendfile('test.html',{'root': __dirname }); }) app.post('/insert',function (req,res){ var email = req.body['email']; var password = req.body['password']; var query = [ 'create (user:user {newuser})', 'return user' ].join('\n'); var params = { newuser: {

AngularJS two way binding variables to array items -

to view code follow link i've created directive handles array of items (it 2 because it's "from" , "to" date pair). i want make array items accessible separate values later use refer array items vm.data = ['data a', 'data b']; vm.separatedata = vm.data[0]; vm.otherdata = vm.data[1]; when implement 2 way bind directive, vm.data[0] , vm.data[1] references updated vm.separatedata , vm.otherdata aren't. is there way of making work or should restructure rest of app (where needed) accomodate array items? in fiddle link (same above) try changing text input values , you'll see mean. vm.data[0] string , primitive datatype in javascript immutable. bind immutable string 'data a' vm.separatedata, not reference data[0]. if want copy reference array vm.separatedata try wrap strings in other javascript objects, e.g. vm.data = [{"value":"data a"}, {"value":"data b"

Tail stdout from multiple Docker containers -

i have script starts 10 containers in background mode (fig -d option). want aggregate stdout or log in /var/log of them. how can this? the containers started using different docker-compose files can not docker-compose target1 target2 target3 docker logs accepts 1 container parameter. i considering creating volume /var/log on containers, mapping them directory outside of docker, making sure logs not have colliding name , using bash tail -f * . appreciate more elegant solution this bash script want: docker-logs #!/bin/bash while [ $# -ne 0 ] (docker logs -f -t --tail=10 $1|sed -e "s/^/$1: /")& shift done wait usage: $ docker-logs containerid1 containerid2 ... containeridn the output of script has each line tracked logs prepended container id. the script works in --follow mode , must interrupted ctrl-c . note options of docker logs hardcoded in script. if need able control options of docker logs command line need parse command lin

PHP shell_exec command not working in Windows -

i have following code doesn't seem work, works when open command prompt , run command: <!doctype html> <html> <head> </head> <body> <form action="ping.php" method="post"> <label for="pc_number">provide target pc names (separate ":"): </label> <input type="text" name="pc_number" id="pc_number"> <input type="submit"> </form> <?php if(empty($_post["pc_number"])==false) { $number = explode(":", $_post["pc_number"]); foreach($number $pc) { $restart = shell_exec("shutdown /r /m {$pc} /t 0"); echo "restarting {$pc}... <br>\n"; echo $restart; } } ?> </body> how come works in command prompt not when execute via php? trying restart windows pc remotely.

Jquery $("body").append(data); not apending completely -

i using following function append page data current page. $.get("/some.jsp", function(data) { $("body").append(data); }); this code appends data when calling page in desktop browser. when loading webpage in mobiles, doesn't append full data. appends half of data. i thought has limitation on chars, make variable jsp page's contents string, passed string append body follows, data = "jsp contents"; $("body").append(data); but there no use. i checked data length follows, console.log("data"); console.log(data.length); it shows 6760 chars, in both desktop , mobile. why data not appends in mobile? check css first. think css mobile device hiding details.

java - Google Maps: Create marker from different class -

in android studio project, have 2 activites: 1 mapsactivity , other basic. when click on map, other activity launches consists of set of edittexts (textfields) allowing user define custom properties marker. however, when try create marker class, android studio gives me error. here code, mapsactivity.java: package com.geekybrackets.virtualtourguide; import android.content.intent; import android.support.v4.app.fragmentactivity; import android.os.bundle; import com.google.android.gms.maps.cameraupdatefactory; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.onmapreadycallback; import com.google.android.gms.maps.supportmapfragment; import com.google.android.gms.maps.model.latlng; import com.google.android.gms.maps.model.marker; import com.google.android.gms.maps.model.markeroptions; public class mapsactivity extends fragmentactivity implements onmapreadycallback { public googlemap mmap; double lat = 0; double lon = 0; @overrid

Sinatra can't see styles.css -

in directory have: shop.rb (app < sinatra::base) lib directory - ruby models inside views directory - erb files inside gemfile where should place style.css ? tried every place possible, created public folder , tried every possible place, styles doesn't work. in layout have: <link rel="stylesheet" href="/style.css"/> i tried with: <link rel="stylesheet" href="style.css"/> it might because app not configured find public directory/ first make sure public directory exists relative main entry file of application (assuming shop.rb) , use following configuration: class shop < sinatra::base configure set :public_folder, file.expand_path('../public', __file__) set :views , file.expand_path('../views', __file__) set :root , file.dirname(__file__) end '/' erb :index end end once set up, sinatra should know find public directory , ca

c# - Realm JSON parsing issue list/array -

i'm running in issue realm , inability use basic lists in object scheme someobject : realmobject. i'm parsing json objects web directly in realm objects. it's not mapping should array parts, in json data particularly "entrycharts" data. here json web. take @ entrycharts array. { "id": 20, "tradetype": "buy", "title": "enter: @ market (1,144p)", "keypoints": "<ul><li><strong>enter:</strong> @ market (1,144p)</li><li><strong>stop:</strong> 1107p</li></ul>", "productid": 2, "showasfeatured": false, "entrysummary": "<p>lorem ipsum dolor sit amet, consectetur adipiscing elit. semper in malesuada id, varius sit amet lectus.&nbsp;</p>\n", "entrycharts": [ { "data": "https://www.somesite.co.uk/somepic.png"

sql - ERROR ORA-00905: missing keyword (microsoft ole db provider for oracle) -

can see keyword missing pl/sql query below? i getting error ora-00905: missing keyword (microsoft ole db provider oracle) not sure keyword missing - odbc query oracle database select "stat"."ord"."sampleid", max(case when "stat"."ordanael"."mc"='qaers' n"stat"."ordanael"."res_txt" else '' end) ersid, "stat"."ordmcstp_v"."seqnb", "stat"."ord"."ordpatname", "stat"."ord"."ordpatbirthdt", "stat"."ord"."corordnb", "stat"."ord"."projnb", max(case when "stat"."ordanael"."mc"='ammol' 'ammol' when "stat"."ordanael"."mc"='ammolr' 'ammolr' else '' end) test, max(case when "stat"."ordanael"."m

c# - SQL function returns entries multiple times -

i using sql function return entries, in 2 tables. table contains information userid , fileid , created datetime. table b contains information userid , fileid , transmission state . the function should return entries of userid , fileid , created , state the function looks this: with findnewestversion ( select created cdate, fileid fid, userid uid, row_number() on (partition fileid, userid order created desc)rn tablea created <= @duedate ) select * tableb b, tablea inner join (select cdate, userid, fileid findnewestversion rn = 1) x on a.created = cdate , a.userid = uid , a.fileid = fid a.userid = isnull(@userid, a.userid) , a.fileid = isnull(@fileid, q.fileid) , b.tasktype = 'transmission' and call of function using in c# looks this: select a.userid, a.fileid, a.created, a.versionid, case when b.variablecolumn1 null null else b.variable1 end transstate dbo.lsfn_getmatrixatduedate([parameters]) left join table

c# - Get line number where exception occurred in ASP.NET Core -

i've implemented custom exception filter based on blog post https://blog.kloud.com.au/2016/03/23/aspnet-core-tips-and-tricks-global-exception-handling/ . i noticed cannot file name or line number exception occurred stackframe; value method getfilelinenumber 0. a quick example of tried: stacktrace trace = new stacktrace(exception, true); stackframe[] stackframes = trace.getframes(); if (stackframes != null) { foreach (stackframe traceframe in stackframes) { sourcefile = traceframe.getfilename(); sourcelinenumber = traceframe.getfilelinenumber(); } } just mention: getfilename returns null, can namespace , class name various locations, it's not problem. noticed somewhere should have pdb file on folder work , checked have it. , if worked, should work in production environment well. tried using caller information ( https://msdn.microsoft.com/en-us/library/mt653988.aspx ) there's bit different problem. exception filter has implement iexceptionfilter inte

Twitter ping inside proxy failed but when open from browser it open -

i have problem: when open twitter.com, opens, when use tweetinvi doesn’t work. therefore, made code: var result = ping.send("twitter.com"); if (result.status != system.net.networkinformation.ipstatus.success) { insertlogwithfilename("test ping : 000x" ); } i setup proxy configuration, ping not work. tweetinviconfig.currentthreadsettings.httprequesttimeout = 5000000; tweetinviconfig.currentthreadsettings.uploadtimeout = 9000000; if (noproxy == "0") { tweetinviconfig.currentthreadsettings.proxyurl = "http://" + proxyip + ":" + proxyport; } try { auth.setusercredentials(cuskey, secret, accesstoken, useraccessse); } catch (exception exp) { insertlogwithfilename("error in authentication :" + exp.message); } try { var authenticateduser = user.getauthenticateduser(

scala - HList as parameter of method with simplified type signature -

suppose have container-marker case class typedstring[t](value: string) where value represents id particular type t . i have 2 classes case class user(id: string) case class event(id: string) and have function stuff: def func[l <: hlist](l: l)(...) {...} so can use func[typedstring[user] :: typedstring[event] :: hnil]( typedstring[user]("user id") :: typedstring[event]("event id") :: hnil ) (it's important me keep type signature explicitly) the question is: how change or extends func have shorter type signature (keeping marker types) like: func[user :: event :: hnil]( typedstring[user]("user id") :: typedstring[event]("event id") :: hnil ) the shapeless.ops.hlist.mapped type class gives relation of 1 hlist l , hlist elements of l wrapped in type constructor. because have 2 types, type l want specify , type (the elements of l wrapped in typedstring ), need use same trick used in your previou

r - documenting a list of data frames with roxygen2 -

i trying document data append in package. i have list 3 elements (data.frames) , each of data frames has columns. wonder how document hierarchical structure (list -> data.frame -> column) within roxygen2 . examples show 1 layer, data.frame , column names. here minimal example 2 data frames in list. list( names=data.frame(id=1:10, a=letters[1:10]), values=data.frame(id=rep(1:10, each=10), values=runif(100)) ) in list, 3 data.frames connected id column, kind of related, don't want put them 1 data frame, because of saving memory. any suggestions welcome. edit i tried add segments documentation, not seem work #' list group information test data set #' #' dataset list 2 data.tables (proteins, timepoint). #' has common id column in data.tables. #' #' \strong{proteins} #' @format data frame 5458 rows , 3 columns #' \describe{ #' \item{id}{unique group id} #' \item{names}{individual names} #' \item{other names}

xml - Add namespace to root node when root node may have multiple types -

i using xlst 1.0 , want transform xml add 'nil' attributes empty elements . finding namespace being added each matching element e.g output looks like: <age xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nil="true" /> i know valid i'd rather added top-node. came across answer: how can add namespaces root element of xml using xslt? however have multiple possible root nodes, thought this: <xsl:template match="animals | people | things"> <xsl:element name="{name()}"> <xsl:attribute name="xmlns:xsi">http://www.w3.org/2001/xmlschema-instance</xsl:attribute> <xsl:apply-templates/> </xsl:element> </xsl:template> however error visual studio "prexix xmlns not defined" , i'm not sure this. here total xlst file (it won't paste reason) tries few things: transform different types of animal single type add namespace root

Writing a protocol that has client and server side software -

i developing protocol encompass client , server module. several protocols close 1 have in mind exist, want make simpler less overhead , have more control on. the protocol doing can , run in scenario, local, web, lan, internet, etc. can run on single box. my question is, how can start developing server side of protocol? ideas, insights, key words, starting points appreciated. regards do want develop protocol , use it? or looking protocol use? if second, have worked "websocket" protocol enables clients communicate each other via server. protocol , there libraries in .net ( >= 4.5), java, javascript, ... supported in many browsers.

vector - Spearman's footrule distance with base R -

given 2 permutations: v1 [1] 4 3 1 5 2 v2 [1] 2 3 4 5 1 how compute spearman's footrule distance (total displacement of elements) base r? (flexible 2 permutations of size n ) for example, these 2 vectors, it's follows: 1 moved 2 places v1 v2 2 moved 4 places v1 v2 3 moved 0 places v1 v2 4 moved 2 places v1 v2 5 moved 0 places v1 v2 so total distance be: 2+4+0+2+0 = 8 here method using sapply , which , , sum : sum(sapply(seq_along(v1), function(i) abs(i - (which(v2 == v1[i]))))) here, move along indices of v1 , calculate distance of index of element in current index position in v2. these summed together. i suspect along lines of @alexis_laz's solution in comments may have greater computational efficiency.

android - Firebase does not sync database anymore, when app is killed -

currently have service, adds change listeners realtime database (onchildadded, onchildchanged etc.), started on boot. when start app , exit , remove recent apps screen, android kills , don't receive database changes anymore. can't fire notifications anymore, notify user, there new data in database. is there way without creating permanent notification, prevents android killing service?

validation - UWP - AutoSuggestBox customization -

i need support validation on standard autosuggestbox control. idea customize autosuggestbox control changing it's textbox validatingtextbox (my implementation of validatingtextbox james croft). possible? if yes - how, , if not - alternative? so idea customize autosuggestbox control changing it's textbox validatingtextbox it not recommended replacing textbox of autosuggestbox . default functionalities might fail because of that. instead, can add function it. , winrtxamltoolkit offers great validation extension textbox control. you can apply extension autosuggestbox following steps: reference winrtxamltoolkit in project. add reference of winrtxamltoolkit.controls.extensions in xaml page below: <page ... xmlns:extensions="using:winrtxamltoolkit.controls.extensions" ...> create copy of autosuggestbox control's style template visual studio. or can copy template here , , apply autosuggestbox control. find textbox control in templa

android - how to create a pdf document with bitmap use pdfium? -

i have tried pdfium produce pdf in android4.3. have not idea how add bitmap fpdf_page. test source code: int main(){ fpdf_initlibrary(); fpdf_document ppdfdoc = fpdf_createnewdocument(); //insert fpdf_page pdf_page = fpdfpage_new(ppdfdoc,0,500,600); fpdf_pageobject object = fpdfpageobj_newimgeobj(ppdfdoc); //add bitmap object. //what should here???? fpdfpage_generatecontent(pdf_page); fpdfpage_insertobject(pdf_page, object); int fd = open("/sdcard/temp.pdf",o_rdwr|o_creat); if (fd < 1) { printf("cannot write file descriptor. %d : error:%d", fd,errno); } writepdf(ppdfdoc,fd); fpdf_destroylibrary(); return 0; } thank you!! there fpdfimageobj_setbitmap can used set fpdf_bitmap image object.

css - Color Stop Parameter in Linear Gradient -

i have repeating linear gradient css design. #div1{ background: repeating-linear-gradient(red, yellow 10%, green 20%); } i know meant color parameters percentage right after color seems vague. meant ? identifies position color must start? or what? i read documentation , couldn't understand it. can explain me in simpler words ? thank you. ok, i'll give shot...but first documentation actual @ w3.org ...not w3schools! this code (assuming div height of 100px): #div1 { background: repeating-linear-gradient(red, yellow 10%, green 20%); height: 100px; } <div id="div1"></div> so final % figure 20%, means, in case of repeating gradient, gradient end @ 20% of height of element , repeat. so 100% / 20% = 5 gradient repeats 5 times. see happens when last number changed #div1 { background: repeating-linear-gradient(red, yellow 10%, green 33.33%); height: 100px; } <div id="div1"></di

node.js - Updating multiple sub-documents via Mongoose? -

say example, we're using following schema define comments tree; { "_id" : objectid("id_here"), "parentcomment" : "this opinion", "ishidden" : false, "comments" : [ { "comment" : "i disagree opinion", "ishidden" : false }, { "comment" : "test post", "ishidden" : false }, .... } so, if update parent comment set ishidden flag true banned phrases, we'd this; var usercomments = require('mongoose').model("usercomments"); (let = 0; < bannedphrases.length; i++) { var conditions = { parentcomment: bannedphrases[i] } , update = { ishidden: true} , options = { multi: true }; usercomments.update(conditions, update, options, callback); } now, consider subd

xamarin.forms - Font size in Picker control in xamarin forms -

i surprised see picker control not have font size property set font size. had need set font size picker control. kindly suggest how set font size? the underlaying scrollable xamarin.form picker list handled native controls such ios uipickerview , android's datepicker | timepicker , ... , access these controls internal pickerrender class. you can create custom renderers each of targeted platforms , create custom views each of them. example: on ios need create custom uipickerview class , override viewfor method , return uilabel each row has custom font attributes assigned. on android, create standard picker, datepicker , , findviewbyid access various edittext s make picker , assign textsize property each custom font size.

loopbackjs - read data from file using loopback -

i have raw data file 100 records. name - start position 0. address - start position 50. i want read data[name , address] , validation , store information in db. please suggest how can achieved loopback. one way approach add remote method 1 of models actual import , use packages ' csv ' , ' xml ' npm read files. so, basic steps are: add remote method existing model add packages npm read actual files read through files , update database. something this: // mymodel.js import fs = require('fs'); import xml = require('xml') import csv = require('csv') export function import(info, callback) { // current database connection. var ds = this.datasource.connector; // *********************************************** // ** read files , write database here ** // *********************************************** // ---> // *********************************************** // return results and/or erro

Python Tkinter Run Checkbuttons -

i want write python script, have checkbuttons , button running active checkbuttons. if checkbutton active , click on "run" def run_app should check checkbuttons active. if run code, terminal says, global name "is_checked" not defined. from tkinter import * import os import sys import os.path import subprocess exe = (path of exe) call = exe class app: def __init__(self, master): self.is_checked = intvar() frame = frame(master) frame.pack() self.test = checkbutton(frame, text="verzeichnisse", ) self.test.pack(side=left) self.slogan = checkbutton(frame, text="visual studio", onvalue=1, offvalue=0, variable=self.is_checked ) self.slogan.pack(side=left) self.button = button(frame, text="run", fg="red",

fortran - Calculating mflop/s of a HPC application using memory bandwidth info -

Image
i want calculate mflops (million of operations per second per processor) of hpc application(nas benchmark) without running application. have measured memory bandwidth of each core of system (a supercomputer) using stream benchmark. i'm wondering how can mflops per processor of application having memory bandwidth info of cores. node has 64gib memory (includes 16 cores-2 sockets) , 58 gib/s aggregated bandwidth using physical cores. memory bandwidth of cores varied 2728.1204 mb/s 10948.8962 mb/s triad function it's must because of numa architecture. any appreciate. you can't estimate of mflops/gflops of benchmark memory bandwidth results stream. need know 2 more parameters: peak mflops/gflops of cpu core (better max flop operations per clock cycle variants of vector instructions , cpu frequency limits: min, mean, max) , gflops/gbytes (flops bytes ratio, arithmetic intensity) of every program need estimate (every nas benchmark). the stream benchmark has low a

c# - Posting with parameter and returning as a json response -

Image
how post data web api , return result? i'm trying pass in data web api, , returning result set in form of json. <div class="panel1" ng-show="tab===2"> <table st-table="rowcollection" class="table table-striped" ng-controller="getsamplesbystatus"> <thead> <tr> <th>sampleid</th> <th>barcode</th> <th>createdat</th> <th>createdby</th> <th>statusid</th> </thead> <tbody> <tr ng-repeat="row in dataset | limitto:10"> <td>{{row.sample.sampleid}}</td> <td>{{row.sample.barcode}}</td> <td>{{row.sample.createdat | date:'mm/dd/yyyy'}}</td> <td>{{row.sample.createdby}}</td>

javascript - Transform not working in firefox with jQuery scroll effect -

i having problems getting scroll effect work in firefox, have working fine in chrome, safari , opera code, can't see wrong '-moz-transform' line of code. i have checked in firefox browser , shows following element { transform: rotate(0deg); } the rotate value remains @ zero, new jquery , not sure how debug here. please see code below: $(window).scroll(function(){ var $cog = $('#my-div'), $body = $(document.body), bodyheight = $body.height(); $cog.css({ 'transform': 'rotate(' + ($body.scrolltop() / bodyheight * -360) + 'deg)', '-moz-transform': 'rotate(' + ($body.scrolltop() / bodyheight * -360) + 'deg)', '-webkit-transform': 'rotate(' + ($body.scrolltop() / bodyheight * -360) + 'deg)', '-o-transform': 'rotate(' + ($body.scrolltop() / bodyheight * -360) + 'deg)' }); }); please use , le

sublimetext3 - Sublime Text 3 - Syntax highlighting breaks when using PHP in JS context -

Image
i using sublime text 3, build 3114. should latest version available today. before installing update, javascript code highlighted correctly when using php in context. losing syntax highlight functions javascript unless close , re-open tag <script> in flow. here screen shot of issue i'm having (i wrote few random lines give idea): the last call of removeclass method in function myfunctwo has lost syntax highlighter because used <?php echo $id; ?> in line above. lines of js code below php, outside js function, not highlighted. if closed </script> tag , re-opened it, syntax highlighter start working again. has faced issue? there can php highlighter? haven't modified theme files , using default theme twilight. also, syntax highlighting set php because file contains php code, js , html. if set 'javascript', syntax highlighter ignore php code giving green color of "test" there in line. thanks lot sharing thoughts! close java

android - Can't open APK file on mobile device after installing from PC -

i've made android application using eclipse. has no errors, go, wanted test on own phone first. copied apk file samsung galaxy s6 using usb cable. unplugged it, made sure file version not higher or later android version on phone. used apk installer app, , it's installed. it's @ files, , can update how many times want. after updating, or installing gives 2 buttons in button. "ready" , "open". "ready" 1 clickable, , leaves page. can't open apk-file. i've followed every tutorial can't open it. this manifest code: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.rodekruis" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="21" /> <application

aggregation framework - Using $match after a $lookup in MongoDB -

i have 2 collections , want fields both, i'm using $lookup in aggregation pipeline. this works fine , returns documents field, array 0 or 1 elements (an object). if 0 elements, means join (in sql world) didn't return anything. if 1 element, means there match , element in object fields of second collection. now have results, i'd use $match in order filter of results. in order use $match first want use $unwind on new field in order extract array. problem once insert $unwind stage, result of query single document. why happening? how can $unwind , $match documents got $lookup stage? assume have documents after lookup : {doc:{_id:1, lookuparray:[{doc:1},{doc:2}]}} and {doc:{_id:2, lookuparray:[/* empty */]}} when $unwind without options get: {doc:{_id:1, lookuparray:{doc:1}}} {doc:{_id:1, lookuparray:{doc:2}}} null and when specify { $unwind: { path: "$array", preservenullandemptyarrays: true } } then get: {doc:{_id

ListFragment does not show title bar in Android Studio -

Image
why title bar not show in listfragment ? i did not set fullscreen or other.please me <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsrtl="true" android:theme="@style/apptheme"> <activity android:name=".crimelistactivity"> <intent-filter> <action android:name="android.intent.action.main"/> <category android:name="android.intent.category.launcher"/> </intent-filter> </activity> <activity android:name=".crimepageractivity" android:label="@string/app_name"> </activity> </application> crimelistfragment.java public class crimelistfragment extends listfragment { private arraylist<crime> mcrimes; private static final string tag = "crimelistfragme

How do I build my own Android project into an artifact? -

i'm starting in android dev. have dozen of non-sharing independent modules/folders i'd using in main app folder. gradle compile project takes upto more 3-5 minutes. with web, learnt if means can precompile independent modules/folder artifacts add them dependancies (like adding precompiled glide or butterknife dependancies) in build.gradle , circumvent recompiling again. now, how build artifacts of own android projects able use in build.gradle dependancies list?

DatePeriod for Facebook Ads Insights API -

i able facebook campaign insights using marketing api, can said period of time. code below gives data last 30 days. how can dropdown data user input period (eg. 60days or 1 day or 1 week etc). please let me know code. per developers site, available presets: date_preset enum{today, yesterday, last_3_days, this_week, last_week, last_7_days, last_14_days, last_28_days, last_30_days, last_90_days, this_month, last_month, this_quarter, last_3_months, lifetime} $params = array ( 'date_preset'=>'last_30_days', 'data_columns'=>"['adgroup_id','actions','reach']", ); ?> you need use time range field. example time_range={"since":"2016‌​-03-15","until":"2016-03-15"} per this question

ios - Is any UIKit element declared in .h file public or protected in objective c? -

i newbie in ios development , have doubt if declare uikit element such uilabel *label in some.h file not in .m file, protected or public other classes if import class class , access using class instance? #import <uikit/uikit.h> @interface latestnews_viewcontroller : uiviewcontroller @property (strong, nonatomic) iboutlet uiimageview *latestnewsbackimg; @property (strong, nonatomic) iboutlet uiimageview *latestnewsdateimg; @property (strong, nonatomic) iboutlet uilabel *latestnewsdate; is latestnewsdate public or protected?? 1). properties in code can accessed class importing "latestnews_viewcontroller". i.e. public classes. 2). can make private property in class example: @interface latestnews_viewcontroller : uiviewcontroller { nsstring *latestnewsbackimg; //private nsstring *latestnewsdateimg; //private } nsarray *array; //public @end

How to deal with files outside IntelliJ project with Git? -

i have intellij project inside folder under git control. i.e. there plenty of files outside of project, can pushed , on. is possible track them intellij too, i.e. push, pull etc? you can go settings | version control , specify root directory, or multiple directories, managed intellij vcs integration. you'll see modified , unversioned files in directories in changes view, , you'll able perform vcs operations them.

c# - How to use openssl-net wrapper? -

client encrypting files using openssl: c:\openssl\bin"\openssl.exe smime -encrypt -des3 -in "%1.xml" -out "%1.xml.cip" "certificate.pem" >> d:\log\log_encrypt.txt if errorlevel 0 (del "%1.csv") now want this: erp system -> generate payroll -> encrypt using openssl smime so first thought run above bat command erp system. problem client doesn't want have unencrypted payroll file on disk moment (although doing other files: save unencrypted -> encrypt -> delete unencrypted). have write app data directly erp (that's not problem), encrypt using openssl, , save encrypted file. i found c# wrapper openssl-net: https://github.com/openssl-net/openssl-net to honest don't know how achieve above openssl smime des3 encryption using client certificate , wrapper. please? documentation or something?

java - How do I embed artifact information in maven shaded jar -

i document in shaded jar maven artifacts end in shaded jar. all packages merged , makes difficult workout artifacts went looking @ jar. i suppose ideal place information manifest file in text file. ideally want see groupid, artifactid , version. is @ possible maven shade plugin? thanks in advance, phil. you can maven, below steps follow: 1- create under src/main/resources file wich contain information, information.txt example following content: version=${project.version} artifactid=${project.artifactid} groupid=${project.groupid} 2- activate maven filtring <project> ... <build> ... <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> <includes> <include>**/information.txt</include> </includes> </resource> ...

ios - Using property accessors on viewDidLoad - Objective C -

as far know should use accessors access or modify property, except in 2 scenarios: init dealloc don’t use accessor methods in initializer methods , dealloc places shouldn’t use accessor methods set instance variable in initializer methods , dealloc. initialize counter object number object representing zero, might implement init. this exceptions because calling accessors when view not initialised might raise issues when overriding setters/getters ( https://developer.apple.com/library/mac/documentation/cocoa/conceptual/memorymgmt/articles/mmpractical.html ) so, according use of accessors on viewdidload should fine, , recommended, in of codes available on internet developers use _ivars on viewdidload , wonder why. there reason using property _ivars instead of accessors in viewdidload ? one of valuable post using accessors in init/dealloc method https://www.mikeash.com/pyblog/friday-qa-2009-11-27-using-accessors-in-init-and-dealloc.html

javascript - When should wkWebView be used? -

i using cordova build hybrid application. in app, links not work in ios (no issues on android). after extensive searches, found error " resetting plugins due page load ". found solution here . in order resolve this, however, need use wkwebview , installed ( wkwebview plugin ). some sites show details of wkwebview, unsure of how or when should using wkwebview . webview web kit (wk) - in other words browser engine (responsible rendering view, html5 functionalities database etc). webview should used if have ios app. default, ios uses uiview, has lot of bugs , issues cordova. webview should fix them, , improve performance. however, webview installation might tricky one. example, has no support websql or indexeddb (and therefore, sqlite should used ios). also, if accessing files via file:// protocol, need install additional plugins runs local server ( https://git-wip-us.apache.org/repos/asf/cordova-plugins.git#master:local-webserver ). in addition, don't need

python - Pytesseract No such file or directory error -

first of did mentioned here pytesseract-no such file or directory error still doesn't work. i'm using pycharm ide following code: from pil import image import pytesseract import subprocess im = image.open('test.png') im.show() subprocess.call(['tesseract','test.png','out']) print pytesseract.image_to_string(image.open('test.png')) im.show() opens image successfully. subprocess.call() tesseract test.png out extracts text image.. but pytesseract.image_to_string() fails. i don't it. why able use tesseract in shell not in python. , in python can open same image when used tesseract image can't found. below can see error output. file "/home/hamza-c/schreibtisch/android/jioshare/orc.py", line 7, in <module> print pytesseract.image_to_string(image.open('/home/hamza-c/schreibtisch/android/jioshare/test.png')) file "/usr/local/lib/python2.7/dist-packages/pytesseract/pytesseract.py&qu