Posts

What is the default typeface of the app bar text in Android? -

Image
the typeface of text default app bar isn't of typefaces available default -- compared of them visually app bar text , none of them matched. style i'm comparing theme.appcompat.light.darkactionbar . idea how text default text in app bar? here's i'm talking about: *text on left default app bar text , text on right default android text (sans-serif), bold -- of few typefaces available default, closest default app bar text *sans-serif not bold thin seems roboto medium 20sp according this info.

python - subprocess.Popen and relative directories -

i writing script open notepad.exe using subprocess.popen() import subprocess command = '%windir%\system32\\notepad.exe' process = subprocess.popen(command) output = process.communicate() print(output[0]) this throws filenotfounderror is possible change/add above code make work relative paths? did try run script c:\windows> after moving there, again failed. set shell=true, failed well. writing similar script using os.popen() works ok relative paths, regardless directory script run from, far understand popen not way forward.. early steps in world of programming/python. input appreciated. use os.path.expandvars expand %windir% : command = os.path.expandvars('%windir%\\system32\\notepad.exe') the result path can passed subprocess.popen . subprocess.popen not expand environment variables such %windir% . shell might should not depend on shell=true that.

java - order dependency (topological sort) with input of string -

https://leetcode.com/problems/course-schedule-ii/ question similar 1 instead, has input of string instead of numbers. following classes , sample test case , signatures. wondering how deal input of string import java.util.*; class order{ string order = ""; public order(string string){ this.order = string; } } class orderdependency{ order cur; order pre; public orderdependency(order o1, order o2){ cur = o1; pre = o2; } } public class order_dependency { public static list<order> getorderlist(list<orderdependency> orderdependencies){ ***code starts here*** } public static void main(string[] args) { order o1 = new order("a"); order o2 = new order("b"); order o3 = new order("c"); order o4 = new order("d"); orderdependency od1 = new orderdependency(o1, o2); orderdependency od2 = new orderdependency(o2, o3); ...

bash - Java Runtime exec() not working -

i try execute shell command via java this if (program.isplatformlinux()) { exec = "/bin/bash -c xdg-open \"" + file.getabsolutepath() + "\""; exec2 = "xdg-open \"" + file.getabsolutepath() + "\""; system.out.println(exec); } else { //other code } runtime.getruntime().exec(exec); runtime.getruntime().exec(exec2); but nothing happens @ all. when execute code prints /bin/bash -c xdg-open "/home/user/desktop/file.txt" in console, not open file. have tried call bash first , xdg-open -command, there not change. what's problem here , how can solve this? edit: output of calling looks this: xdg-open "/home/user/desktop/files/einf in a- und b/allg fil/ref.txt" xdg-open: unexpected argument 'in' but seeems strange me - why command seperatet before in entire path set in quotation marks? please note don't need xdg-open this. can use java platform-agnosti...

javascript - Error While minifying app stylesheet -

i problem when run meteor build project. i checked github issue may need comment out line behavior: url(#default#vml); but don't know file line in? while minifying app stylesheet: path.js:8:11: path must string. received null @ assertpath (path.js:8:11) @ object.posix.relative (path.js:496:3) @ pathrelative (packages/minifier-css.js:449:30) @ packages/minifier-css.js:408:31 @ array.foreach (native) @ function._.each._.foreach (packages/underscore.js:139:11) @ packages/minifier-css.js:365:7 @ array.foreach (native) @ function._.each._.foreach (packages/underscore.js:139:11) @ rewriterules (packages/minifier-css.js:342:5) @ object.csstools.rewritecssurls (packages/minifier-css.js:328:5) @ packages/minifier-css.js:298:16 @ array.foreach (native) @ function._.each._.foreach (packages/underscore.js:139:11) @ object.csstools.mergecssasts (packages/minifier-css.js:275:7) @ mergecss (packages/minifier-postcss/plugin/minify-css....

Change Attachment Icon on Data Entry Form in Access 2016 -

so have data entry form "new employees" on access 2016. want include attachment employees image. in property sheet - have 3 options display data field attachment. display as: 1. image/icon 2. icon or 3. paper clip. first 2 options display blank box (you can click on dialog box click attachment). image/icon , icon options yes both functionally work both seem, inefficient. other option, paper clip, literally paperclip image , (0) functionally works (even better 1. 2. directly goes attachment dialog box) attachment dialog box when open it, visually unappealing. i want button when click on it, attachment dialog box opens , saves field value in place indicate. open other ideas. please advise.

swift - how can I use constraints on a group of elements in storyboard in ios? -

Image
in uistoryboard have following situation: a uiviewcontroller 2 elements - button , label. text on each component fetched localized.strings, has different length each time user chooses different language. in code have: mybutton.settitle("textonbutton".localized(), for: .normal) mybutton.sizetofit() txtlabel.text = "txt".localized() how should attach constraints 2 elements - when grouped - in center? example: this not in middle: this in middle: if 1 element, attach constraint midx , that's all, situation when there 2 elements? can - somehow - attach constraints group of elements? you can achieve of called stack view . in storyboard select both labels , click following button: in hierarchy notice both labels got wrapped inside stack view . have add horizontally in container and vertically in container constraints stack view. can add spacing between 2 labels in attribute inspector when stack view selected. result:

java - Kafka connect confluent elasticsearch sink (no class found error) -

i new kafka connect. want push messages kafka topic elasticsearch. after following available documentation.. downloaded , compiled elastic search sink release tar.zip ( https://github.com/confluentinc/kafka-connect-elasticsearch/releases ) i added elastic search properties file , included above jar in classpath. when run kafka connect in standalone mode error ./usr/bin/connect-standalone etc/schema-registry/connect-avro-standalone.properties etc/kafka-connect-elasticsearch/quickstart-elasticsearch.properties [2016-11-13 00:05:38,768] error task elasticsearch-sink-0 threw uncaught , unrecoverable exception (org.apache.kafka.connect.runtime.workertask:142) java.lang.noclassdeffounderror:io/searchbox/client/jestclientfactory @ io.confluent.connect.elasticsearch.elasticsearchsinktask.start(elasticsearchsinktask.java:81) @ io.confluent.connect.elasticsearch.elasticsearchsinktask.start(elasticsearchsinktask.java:52) @ org.apache.kafka.connect.runtime.workersinktask.initializean...

javascript - Clickable image in a lightbox on page loading -

i'm new on web developing. i need sample code displays clickable image in lightbox on page loading close button. also, if there's way, need show on desktop browsers (avoiding mobile), , display 5x per day per user ip. can help? thanks. all together, 1 file. <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <style> div{position:relative;box-sizing:border-box;} #overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:black;opacity:0.7;z-index:1;} #lb{position:fixed;top:30px;left:20%;width:300px;height:300px;z-index:2;} #lb_hdr{height:30px;width:100%;overflow:hidden;background:#333;color:white;} #lb_hdr_title{float:left;height:100%;width:90%;padding:5px;} #lb_hdr_close{float:left;heig...

php - Converting query to parametrised query -

i have query on site , have been hacked because of it. i have spent 2 hours looking how convert query secure , have not got anywhere. if don't mind, please convert 1 me can see on rest? $camera_id = $_get['camera_id']; $cameras = mysqli_query($conn, "select * cameras id = $camera_id"); $camera = mysqli_fetch_array($cameras); try this. $camera_id = $_get['camera_id']; $cameras = mysqli_prepare($conn, "select * cameras id = ?"); mysqli_stmt_bind_param($cameras, $camera_id); $cameras->execute(); while making switch, switch straight away pdo. it's far better mysqli $db = new pdo('mysql:host=localhost;dbname=mydb', 'username', 'password'); $stmt = $db->prepare("select * cameras id = :camera_id"); $stmt->execute(array(":camera_id"=>$camera_id)); $result = $stmt->fetchall(); or instead of fetchall() while($row = $stmt->fetch(pdo::fetch_assoc)) { ...

angularjs - OrderBy in dirpaginate -

i have following code populate table:- <tr dir-paginate="user in newbillvalue|filter:search4|orderby:['bill_time','bill_id']|itemsperpage:10" pagination-id="newbills"> i want table ordered bill_time descending order , bill_id ascending order. how can done.

reactjs - React + react-router + typescript webpack production bundle issue -

i'm building app using react + react-router + redux + typescript + webpack, here's tsconfig.json: { "compileroptions": { "outdir": "./dist/", "sourcemap": true, "noimplicitany": true, "module": "commonjs", "target": "es6", "jsx": "react" }, "files": [ "./src/index.tsx" ] } and webpack.config.js looks like: var prod = json.parse(process.env.prod_env || '0'); ... module.exports = { ... plugins: prod ? [ new webpack.optimize.uglifyjsplugin({ compress: { warnings: false } }) ] : [], ... module: { loaders: [ // sass loader stylesheet. { test: /\.scss$/, loaders: ["style", "css", "sass"], exclude: /node_modules/ }, // files '.ts' or '...

python - How to use a CSV as input data for a Tensorflow neural network? -

i'm attempting write neural network changing mnist ml beginners code . have csv that's organized this: image_name |nevus? |dysplastic nevus?| melanoma? asdfgjkgdsl.png |1 |0 |0 an image name, , it's one-hot result. each image 1022 x 767, , i'd use color of each pixel input well. such, changed mnist code have 2,351,622 inputs (1022 pixels wide * 767 pixels high * 3 colors per pixel) , 3 outputs. # tensorflow.examples.tutorials.mnist import input_data # mnist = input_data.read_data_sets("mnist_data/", one_hot=true) def main(): x = tf.placeholder(tf.float32, [none, 2351622]) w = tf.variable(tf.zeroes([2351622, 3])) b = tf.variable(tf.zeroes([3])) y = tf.nn.softmax(tf.matmul(x, w) + b) y_ = tf.placeholder(tf.float32, [none, 3]) cross_entropy = tf.reduce_mean(-tf.reduce_sum(y_ * tf.log(y), reduction_indices=[1])) train_step = tf.train.gradientdescentoptimizer(0.5).minimize(cross_entropy) init ...

ios - Gamescene.sks and GameScene.swift don't seem to be linked in my project -

Image
i learning spritekit , started small project using level editor. however, gamescene.swift , gamescene.sks don't seem linked reason. below screenshots .sks file setup , small print statement in viewdidload of .swift file. please let me know doing wrong. or if missing something. the spritekit .sks file. my view controller's viewdidload function. class gameviewcontroller: uiviewcontroller { override func viewdidload() { super.viewdidload() let screensize = cgsize(width: uiscreen.main.bounds.width, height: uiscreen.main.bounds.height) gamecontroller.gamecontroller.setgamemanager(gameviewmanager: self); if let view = self.view as! skview? { // load skscene 'gamescene.sks' if let scene = skscene(filenamed: "gamescene") { // set scale mode scale fit window scene.scalemode = .aspectfill // present scene view.presentscen...

java - Getting null value when returned from actionListener -

i new java coding. please me in regard. in advance i wants display values derived mysql query combo box , select 1 of them through selecteditem , return selected value main function. // getserviceno method started here // java code populate jcombobox mysql database data // , returns selected value called program. import java.awt.flowlayout; import java.awt.event.*; import javax.swing.*; import java.sql.*; public class getserviceno extends jframe implements actionlistener { jframe frame = new jframe("select service"); private jcombobox jcb = new jcombobox(); jpanel panel = new jpanel(); jbutton jbtn = new jbutton("submit"); connection con; statement st; resultset rs; static string newserno; public getserviceno() { // getserviceno method started frame.setsize(350, 150); frame.setlayout(new flowlayout()); frame.setlocation(300,200); frame.setdefaultcloseoperation(jframe.exit_on_...

angularjs - Express serving index.html from Angular html5 mode not working -

i'm trying use html5 mode in angular js app sake of seo. however, faced problem express serving index.html request. deep linking didn't work , cannot refresh page. app.js app.use(servestatic(path.join(__dirname, 'public'))); app.use(servestatic(path.join(__dirname, 'node_modules'))); app.use(servestatic(path.join(__dirname, 'app_client'))); app.use('/api', routesapi); app.all('/*', function(req, res, next) { res.sendfile('./app_client/index.html', { root: __dirname }); console.log("send index"); }); i try many researches many sources, approach such app.get('/', function(req, res) { res.sendfile('index.html'); }); or router.get('/', function(req, res) { res.sendfile(path.join(__dirname, 'app_client', 'index.html')); }); or app.get('/*', function(req, res) { res.sendfile(__dirname + '/index.html') }); none seems work. know must wrong in ...

c# - SignalR not able to Authentication with Certificate -

i have read links refered non of them solve specific problem have. the issue not authentication in general, adding client certificate on client side , getting certificate on signalr server. far, not manage make work, there either server error or certificate on server null. if have working sample add client certificate on client side , getting on server, appreciate if send me that. **on client side have**: connection = new hubconnection(serveruri); var certificate = new x509certificate2(path); connection.addclientcertificate(certificate); hubproxy = connection.createhubproxy("myhub"); ***on server have config:*** <location path="signalr"> <system.webserver> <security> <access sslflags="sslnegotiatecert" /> </security> </system.webserver> </location> ***and certificate tried in hub*** public override bool authorizehubconnection(hubdescriptor hubdescriptor, irequest request) {...

python - Checking for arithmetic sequencing inside matrix without using numpy -

i'm wondering how can write function can determine if there's arithmetic sequence of length (this time four) in direction in matrix such that, if it's true, function returns list containing 4 coordinates (y,x) in matrix of occurrence of list. otherwise, returns nothing. see test below clarification. in mathematics, arithmetic progression (ap) or arithmetic sequence sequence of numbers such difference between consecutive terms constant. instance, sequence 5, 7, 9, 11, 13, 15 … arithmetic progression common difference of 2. p.s. location, components start vertical position first , horizontal 0 initial position both components in indexes. this how function tested. below function called as1. >>> as1([[1, 10, 18, 29, 2], [2, 7, 5, 6, 34], [21, 4, 3, 5, 2], [9, 1, 6, 10, 3], [16, -9, 9, 17, 4], [32, -6, 0, 26, 5]]) [[0, 1],[1, 1], [2, 1], [3, 1]] my attempt successful lists, not matrices: def as1(l):...

jwt - Call to undefined method Illuminate\Http\JsonResponse::validate() in Laravel 5.3 -

i implementing registration form using json post request , laravel 5.3 below controller settings <?php namespace app\http\controllers\auth; use app\user; use validator; use illuminate\http\request; use illuminate\http\response; use app\http\controllers\controller; use illuminate\foundation\auth\registersusers; class registercontroller extends controller { use registersusers; public function __construct() { $this->middleware('guest'); } protected function validator(array $data) { $data = $data['register']; $validator = validator::make($data, [ 'email' => 'required|email|max:255|unique:users', 'password' => 'required|min:6|confirmed', ]); if($validator->fails()) { $errors = $validator->errors()->all()[0]; //dd($errors); return response()->json(['errors'=>$errors]); } else { return $validator; } } protecte...

jquery - how manually set a vaule in a select2 which is fed from ajax call - laravel -

todo i trying set select2 value value fed ajax reqest. i have tried answers in these 2 threads: one two . my code: html: // blade {!! form::select('author_id', $author_array, @$auth_preset, array('class'=>'', 'id' => 'select_the_author', 'get-byajax' => 'author', 'ajax-target' => '#author_placeholder')) !!} // renders html (befere select2 initialization): (select author...) my js: $("select[get-byajax]").each(function(){ var baseurl = "{{url::to('get_by_ajax/')}}"; var itemkind = $(this).attr("get-byajax"); var readyurl = baseurl + '/' + itemkind; $(this).select2({ ajax: { url: readyurl, datatype: 'json', delay: 250, data: function (params) { ...