Posts

Showing posts from April, 2014

How to add button in a row of JTable in Swing java -

i have made 1 swing gui have jtable rows , columns.how should add button row in jtable ? you don't add row - add cell. this tutorial describes need.

javascript - ES6 / lodash - check nested Object values with startsWith -

is there function or fast way check if value in our object startswith e.g asd example: let obj = { 'child' : { 'child_key': 'asdfghhj' }, 'free': 'notasd', 'with': 'asdhaheg' } // check here if our obj has value startswith('asd') regards you can recursively iterate object properties , check if property starts prefix using find function: function haspropertystartingwith(obj, prefix) { return !!object.keys(obj).find(key => { if (typeof obj[key] === 'object') { return haspropertystartingwith(obj[key], prefix) } if (typeof obj[key] === 'string') { return obj[key].startswith(prefix) } return false }) } console.log(haspropertystartingwith(obj, 'asd'))

unable to successfully interpolate strings in Ruby -

i'm noob rails trying create partial passed collection. there variable counter defined inside partial implicit collection passed in called _counter referencing update row names benefit of css selectors. code looks this: <div class=<%= "column1--row" + product_counter.to_s + " column1--row" %> > <img src=<%= "http://fillmurray.com/" + (size + product_counter).to_s + "/" + (size + product_counter).to_s %> alt="product1" class="product-image"> <div class="description"> <span class="title"><%= product.title %></span><br> <span class="details"><%= product.description %></span> <span class="rank"> <i class="fa fa-caret-up" aria-hidden="true">936</i> </span> <span class="comments"><i class="fa fa-comment" aria-hid

reactjs - Webpack, React & Mocha test: Missing class properties transform -

i have been having issue on week now. code runs fine in browser , no errors, when run mocha test , error of missing class properties transform . installed via npm , deleted packages , re-installed them still nothing. have read numerous posts on here (i.e. error: missing class properties transform ) , still come error. missing here? help. webpack.config.js: ... module: { loaders: [ { test: /\.(js|jsx)$/, include: [ path.resolve(__dirname, "public/app") ], exclude: /node_modules/, loaders: [ 'react-hot', 'babel?presets[]=react,presets[]=es2015,presets[]=stage-0' ], loader: 'babel', query: { "plugins": ['transform-decorators-legacy'] } }, { test: /\.json?$/, loader: 'json' },

How to make Statusbar not transparent(Android 5) -

i'm using coordinatorlayout , this( app:layout_scrollflags="scroll|enteralways" ) line of code in order hide toolbar whenever recyclerview scrolled. , works pretty well, toolbar not hidden behind statusbar because transparent. my layout looks this <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:context="com.yannisbecker.backup.mainactivity"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" andro

One to Many Form in Access -

i have form manager fills out each employee once week audit. form in excel. data tracked on time review trends. asking 1 many relationship. each answer on form should create new record in table rather 1 record per audit form. there 34 audit questions can result in either yes, no or n/a. of experience in sql , oracle databases not familiar access. looking form in access can input audit response , can create trends , forth in tableau. example rep: ms. smith date of audit: 09/10/2016 each of 34 questions year or no response. cannot seem manage form working without having enter reps name 34 times. recommendations access newbie? correct me if misunderstood question, here do. you can create 2 tables, 1 called representative , other audit . in table representative , create field rep_name , let access create autonumber primary key. in table audit , create field date/time date of audit, create number field rep_id , 34 yes/no fields audit questions , let access create autonu

Excel return true or false if the value is found in another sheet -

i want return true or false depending on if value found in sheet. problem encountering if value found on other sheet pops mutiple times. making vlookup return #n/a when set exact match. a repeated value not produce #n/a error produce first match encounters. means not finding match. if can see values might mean in different format (ie text rather value or vice versa). check how values stored each piece , make sure data types same. trick check how views each value use evaluate formula feature step through each calculation.

Check which rows a formula refers to in Excel (error checking with VBA) -

is there way use vba list rows formula refers to? i have built spreadsheet should refer cells in same row, , formulas referring different row in error. cannot work out how in vba. example, third formula in error. =(d3+f3)/(e3+d3) =d4/e4 =d5^e5+f12 =d6+f6^g6 ok, can understand reason want check if formula refer single row only... here's wrote. please, read comments in code. option explicit sub checkformulas() dim c range dim wsh worksheet dim sformula string 'context set wsh = thisworkbook.worksheets(1) 'loop through set of cells in usedrange each c in wsh.usedrange 'formula starts "=" if c.formula "=*" sformula = c.formula 'check if formula refer single row 'if not, change background color form cell if doesformularefertosinglerow(sformula) c.interior.color = vbred end if end if next end sub 'needs reference ms vbscript regular expression 5.5 '

adobe connect - getting attendants of a recorded meeting in adobeconnect -

i'm trying attendants of 1 recording of meeting i'm able records sco-contents , attendants of meeting report-meeting-attendance but report-meeting-attendance returns of attendants in recordings of meeting , cant filter recording scoid (it returns empty) how can attendants of single recording of meeting? you should use report-event-participants-complete-information meeting sco-id parameter. find more information here .

c# - Display string as html in asp.net mvc view -

i have controller generate string containing html markups.now when displaying on views, displayed simple string containing tags. tried use html helper encode/decode display properly, not working. string str= "<a href="/home/profile/seeker">seeker</a> has applied <a href="/jobs/details/9">job</a> floated you.</br>"; on views, @html.encode(str) you close want use @html.raw(str) @html.encode takes strings , ensures special characters handled properly. these include characters spaces.

Conditional formatting based on formula Excel -

i trying create rule conditional formatting highlights column yellow if header of table contains same value contained in cell a1, says formula has error. have ideas? here formula: =cell("col", indirect(address(row(), column()))) = (match($a$1,table1[#headers],0)+2) edit: formula works when put cell, not when put 'new rule' section of conditional formatting. create conditional rule applying relevant column (say g header in $g$1 ) following rule: =and(g1<>"",$a$1=$g$1) i don't think can reference header table structured reference used why hardcoded range. regards,

android - Multiple APK for different ARM CPUs -

i developing app, heavily uses native code , require performance. gcc compiler can optimize code different types of processors: cortex-a9, cortex-a7, cortex-a15, et cetera. armv7 processors don't have neon instructions or implement partially. anyway, gcc knows it. i want maximum performance on every device. when build application idiv support, application instantly crashes, example, on tegra 2. compiling cortex-a15 gives great perfomance boost, compiled code can't run on cortex-a9. so there way publish multiple apks not cpu abi, cpu model? unfortunately can't finer granularity cpu abi. what can checking cpu features @ runtime using cpufeatures ndk, , load right library or codepath.

How to use the "Resource Files" logical folder in Netbeans IDe for C/C++? -

Image
as can seen in below screenshot, netbeans c/c++ project allows addition of resource files. when google things along lines of "netbeans c/c++ 'resource files," nothing useful comes up. such, ask here: , how can use them? logical folder application can use @ runtime regular fstream s, or allow embedding of files in final executable similar java's getclass().getresourceasstream() mechanism? note: using g++ 5.4.0 on ubuntu 16.04 lts x64 if these platform independent in way (in case know how use them on windows , other versions of linux well).

machine learning - Combine training data and validation data, how to select hyper-parameters? -

suppose split data training set , validation set. perform 5-fold cross-validation on training set obtain optimal hyper-parameters model, use optimal hyper-parameters train model , apply resulting model on validation set. question is, reasonable combine training , validation set, , use hyper-parameters obtained training set build final model? it resonable if training data relatively small , adding validation set makes model stronger. however, @ same time, adding new data makes selected hyperparameters possibly suboptimal (it hard show kind of transformation of hyperparameters should apply when add new data training set). balance 2 things - gain in model quality more data , possible loss due hard predict change in hyperparameters meaning. extent can simulate process make sure makes sense, if have n points in training data , m in validation, can try split training further chunks same proportion (thus 1 n * (n/(n+m) , other n * (m/(n+m))), train on first 1 , check whether opt

excel - doing logic operations in vba -

Image
hi i'm trying logic operations or,not, , vba i'm having trouble code not incrementing values know probably(hopefully) easy fix error appreciated. sub logicop () dim myrange range dim rowi range dim cell range set myrange = range("a8:f20") 'go each row of column each rowi in myerange.rows andfunc = 1 'and operaton notfunc = 0 'not function result1 = 0 result2 = 0 result3 = 0 each cell in rowi.cells 'go each cell of rows in rowi if cell.value = notfunc resuslt1 = result1 + 1 end if if cell.value = andfunc resuslt2 = result2 + 1 end if if cell.value <> andfunc , cell.value <> notfun result3 = result3 + 1 end if next cell next result1 = cells(3,3 ) result2 = cells(3, 4) result3 = cells(3,5) end sub as pointed out in comments there numerous spelling mistakes prevent code form working. can avoid using option e

php - How do I make a class variable automatically available to its children classes? -

i have application class , have number of separate classes extend it. if set $variable in parent application class, how make automatically available in children? class application { public $variable; public function __construct() { $this->variable = "something"; } } class child extends application { public function dosomthing() { $mything = $variable." cool"; return $mything; } } i know can put global $variable; in dosomthing() method, super tedious on , on in every method write. there way available child class methods? thanks. you set property named variable in application class in __construct method. if property visibility permits (e.g. public or protected), can access property potato in children classes method $this->potato : class application { public $variable; public function __construct() { $this->variable = "something"; } } class child extends applicatio

PHP built-in server hosting web fonts -

i'm using php's built-in web server local development of project, so: $ php -s localhost:8000 -t web/ inside web directory fontawesome (an icon webfont) , web page correct includes , classes. font doesn't display correctly when served locally. the 'network' developer tab in browser shows font correctly loading server: 200 http://localhost:8000/fonts/fontawesome-webfont.woff2?v=4.6.3 however response headers include content-type: application/octet-stream when (i believe) should returning content-type: application/font-woff etc. is there way serve web fonts php's built-in web server? adding custom mime types perhaps? from the docs : if php file given on command line when web server started treated "router" script. script run @ start of each http request. if script returns false, requested resource returned as-is. otherwise script's output returned browser. $ php -s localhost:8000 router.php sample router.php adding

PJAX: force entire page to reload on manual refresh, how? -

i'm new pjax , ajax, scripting in general. have simple pjax implementation works except when manually performing hard reload of page. upon manually reloading page keyboard command or mouse click pjax div reloaded browser window instead of entire page (container frame , pjax div) meaning 80% of page goes away including header, footer, navigation, styles, etc. i'm looking way force frame reload along current pjax content instead of naked pjax content no frame. thanks. here's simple reduction of code: <a data-pjax='#pjax-container' href="https://10.0.1.8:8890/location/3114">seattle</a> <script type="text/javascript"> $( document ).ready(function() { $(document).pjax('[data-pjax] a, a[data-pjax]', '#pjax-container'); }); </script> <div id="pjax-container"> ...pjax loaded content... </div> try : $.pjax.reload('#pjax-container') the documentatio

mysql - php?cmd=SELECT 1+1 not found and SELECT 1-1 it works -

please , need , simple , can not find reason , sending query php return json , simple sum of value field or other value not realize , subtractions if , what's up? ...//www.mipagina.com.mx/consultas.php?cmd=select 1+1 select 1 1\nyou have error in sql syntax; check manual corresponds mysql server version right syntax use near '1' @ line 1 ...//www.mipagina.com.mx/consultas.php?cmd=select 1-1 [{"1-1":"0"}] ...//www.mipagina.com.mx/consultas.php?cmd=select cantidad + 1 timbres id = 2 select cantidad 1 timbres id = 2\nyou have error in sql syntax; check manual corresponds mysql server version right syntax use near '1 timbres id = 2' @ line 1 ...//www.mipagina.com.mx/consultas.php?cmd=select cantidad - 1 timbres id = 2 [{"cantidad - 1":"24"}] you need url encode sql query - + sign interpreted space in url. if you're manually encoding it, you'd need replace + sign %2b

R: How to pass two filepaths as parameters to a function? -

i'm trying pass 2 file paths parameters function. it's not accepting inputs. here's i'm doing: partition<-function(d1,p2){ d1<-read.table(file = d1, fill = true) p2<-read.table(file = p2, fill = true) } and while calling function: partition("samcopy.txt","partcopy.txt") the .txt not being read variables inside function. how make variables read table? aidangawronski's approach works, programming standpoint should avoided! here more traditional answer problem. partition<-function(d1,p2){ <- read.table(file = d1, fill = true) b <- read.table(file = p2, fill = true) res <- list(a,b) names(res) <- c(d1,p2) res } to understand why above approach "better", important understand environments , more r scoping rules. environments workspace. example, when first open r , begin assigning objects, these objects stored within global environment. example of envir

fopen - Read txt file line by line into char array C -

i know question has been asked few times, never in way helps me figure out problem. essentially, reading 4 text files, single words separated new line, , wanting store these in char array. first count number of lines in file , create new char array, life of me, cannot figure out how read correctly. last 2 lines test if has read entire file correctly , come null , question mark symbol. i want each line @ next index in char array. any awesome! thank ahead of time. #include <omp.h> #include <stdio.h> #include <stdlib.h> void countanagrams(char* filename); void main () { char *filenames[] = {"anagrama.txt","anagramb.txt","anagramc.txt","anagramd.txt"}; countanagrams(filenames[0]); countanagrams(filenames[1]); countanagrams(filenames[2]); countanagrams(filenames[3]); } void countanagrams(char* filename) { int anagramcount = 0; int ch, lines = 0; //count number of lines in file file

node.js - Trying to deploy React Webpack app to Heroku, keep getting 'Uncaught Error: Cannot find module "./src/index.js"' error -

i'm trying deploy heroku, , build successful; however, blank screen , console has error: 'uncaught error: cannot find module "./src/index.js"' also, while deploying, have following error: error in loader /tmp/build_ad82f59a947c9639c358909b17671d27/node_modules/babel/index.js?{"presets":["react","es2015","stage-1"]} didn't return function in local environment, have .env file private access tokens , use dotenv retrieve secret keys when make api call. have set config variables on heroku. when in heroku logs, error: 2016-09-12t22:16:15.191754+00:00 app[web.1]: > node server.js 2016-09-12t22:16:15.191755+00:00 app[web.1]: 2016-09-12t22:16:15.686543+00:00 app[web.1]: { [error: enoent: no such file or directory, open '.env'] errno: -2, code: 'enoent', syscall: 'open', path: '.env' } here's webpack.config.js: module.exports = { entry: [ './src/index.js' ], output

javascript - preventing immediate submission after modal popoup -

validation form done on server-side fires when user submits form. wish display modal popup summarizing data user entered , give them option continue or cancel. of right now, modal displays second , goes on save without waiting user confirmation. how can keep form submitting until user decides so? form: <div id="display" class="fieldset"> @using (html.beginform("addaccount", "rxcard", formmethod.post, new { id = "add", enctype = "multipart/form-data" })) { <fieldset> <div class="form"> <label id="lblaccountname">account name</label> @html.validationmessagefor(model => model.pharmacy.accountname, null, new { @class = "validationmessage" }) @html.textboxfor(model => model.pharmacy.accountname )

isabelle - Simplify meta-universally quantified assumptions with equality -

sorry not being able come shorter example. i have proof state of 1. ⋀e1 t1 l e2 t2 g1. typing (g1 @ (x, u) # g2) e1 t1 ⟹ typing (g1 @ g2) e1 t1 ⟹ (⋀xa. xa |∉| l ⟹ typing ((xa, t1) # g1 @ (x, u) # g2) (open e2 (exp_fvar xa)) t2) ⟹ (⋀xa g1a. xa |∉| l ⟹ (xa, t1) # g1 = g1a ⟹ x |∉| fv (open e2 (exp_fvar xa)) ⟹ typing (g1a @ g2) (open e2 (exp_fvar xa)) t2) ⟹ x |∉| fv e1 ⟹ x |∉| fv e2 ⟹ typing (g1 @ g2) (exp_let e1 e2) t2 note fourth premise (the large one): universally meta-quantifies on g1a , g1a determined equation there. substitute (and simplify conclusion of premise) , auto able solve goal. can make simplifier solve this? i guess small example is lemma foo: "(⋀ g. x#xs = g ⟹ p x ⟹ f g) ⟹ f (x#xs)" apply simp there related question equalities under existentials . this problem can solved reliably using simproc. induct proof method in ~~/sr

reactjs - In Redux, what is the relationship between store.dispatch(), connect() and bindActionCreators() -

what difference between dispatch() , connect() , bindactioncreators() ? and in circumstances should use each of them? thanks dispatch - dispatches action trigger change in redux's store . logic perform change in reducer. connect - react's state of particular component has nothing redux's store until apply higher order component connect() particular component. in order make redux store , react's state work together, need connect . after component has been connected redux's store, can listen changes in store. if action has been dispatched, redux store changes , because component connected store , listens changes, needs rerender. however, there small gotcha - need specify on store changes component rerender (mapstatetoprops) , state changes component allowed trigger (mapdispatchtoprops) bindactioncreators - wraps action creators (a function creates action) into dispatch() call can use this: fancyactioncreator() instead of having wrap in dispat

Build fails for Android Studio -

this error getting: error:execution failed task ':app:transformclasseswithprejackpackagedlibrariesfordebug'. > failed delete temporary file c:\users\jesse\appdata\local\temp\jill-1473722184552-0.jack gradle syncs, no projects can built. similar error in every project. i'm not sure should here. reinstalled android studio, didn't resolve anything. might simple solution. did try file/invalidate caches / restart... ?

How can I prevent unauthorized connections to my python socket server? -

i have simple server written in python opens , listens on tcp socket: import socket server_socket = socket.socket(socket.af_inet, socket.sock_stream) server_socket.bind(("", 4242)) server_socket.listen(5) print("tcpserver waiting client on port 4242") while 1: client_socket, address = server_socket.accept() print("i got connection ", address) while 1: data = client_socket.recv(512) if data: print(data) if not data: print("closed connection") break and works great! i left wondering... rouge client can connect server if know ip , port. given ip , port aren't crazy secure... how can make sure device can connect tcp socket own device? can make sort of key? ssl about, having trouble understanding that. seems ssl protects data being intercepted, can still connect , write listener? thanks! you don't need ssl here. tsl , ssl protocols provide encr

ios - Swift - StoreKit verify customers offline -

i'm using storekit , list products registered in itunes connect , simulate purchase in sandbox. i wonder if there way determine whether individual purchased subscription application, though offline. i'm not using backend. do know way check it?

opencv - Visual Studio opaque compilation error indication -

i trying compile opencv cuda support using microsoft visual studio 2013 , following compilation error message: 22> cmake error @ cuda_compile_generated_pyrlk.cu.obj.cmake:264 (message): 22> error generating file 22> f:/nir/dev/opencv/build/visualstudioa/modules/cudaoptflow/cmakefiles/cuda_compile.dir/src/cuda/debug/cuda_compile_generated_pyrlk.cu.obj 22> 22> 22>c:\program files\msbuild\microsoft.cpp\v4.0\v120\microsoft.cppcommon.targets(170,5): error msb6006: "cmd.exe" exited code 1. is there way more information error? increasing log verbosity, or getting nvcc command failed useful cuda compile verbosity can enabled @ cmakecache.txt file: //print out commands run while compiling cuda source file. // makefile generator defaults verbose variable // specified on command line, can forced on // option. cuda_verbose_build:bool=on

iOS and Android: Is There a Way to Install an App From a Kiosk? -

i vaguely remember hearing technology awhile ago (maybe nfc?) somehow made possible user install app on phone bringing close (or maybe tapping it?) sales kiosk appropriate hardware. however, i'm having trouble finding reference technology, , i'm starting wonder if dreamt up. regardless, question this: know install apps through ios/android app store, either ecosystem there alternative way (with user's permission of course) install app nearby device such phone, blue tooth transmitter, etc.? as douglas junior suggested in comments, there no way install iphone apps outside of app store. in android ecosystem there way, using android beam: https://developer.android.com/guide/topics/connectivity/nfc/nfc.html#p2p however, dead-end people, there's no point in setting kiosk half customers can use.

jquery - Can't click links or highlight text -

i have been struggling couple days , have conceded ask help. i've tried answers similar questions, haven't fixed problem. i can't highlight text or click links on lilliannordica.com/lily-of-the-north or other pages on site except home page. know must in front, after staring @ hours , hours, still don't see it. there several things on website did first time, i'm guessing messed 1 of them up. don't know css include in this, here's of it. body{ background: #352144; font-family: gotham, "helvetica neue", helvetica, arial, sans-serif; } p { font-size: 18px; } li { font-size: 18px; } a:link { color:#fd027a; } a:hover { color:#dcd111; } a:visited { color:#53b111; } .brand-image { background: #352144; padding-left: 25px; } #lillian-sig { padding: 10px 0px 10px; } .navbar-default { background-color: #c0a5b4; border-color: #b899aa; padding-left: 30px; text-transform: uppercase; letter-sp

How to get payments connected with a certain transfer on Stripe through API? -

i have transfers related payments. can see through dashboard seems not available using api. this charge on dashboard, can see has 2 connected objects customer , transfer transfer connected many payments once have fetched transfer can use transfer id balance transaction method. it's parameter need pass , return transactions related transfer. if using nodejs example be: stripe.balance.listtransactions({ transfer: 'tr_8ahwq8qw34n' })

XCGLogger version 4.0.0 and CocoaPods error -

i trying use cocoapods acquire xcglogger swift 3. have tried specifying version 4.0.0 , 4.0.0-beta.3 in pod file. when run pod update or pod install following error: analyzing dependencies [!] unable satisfy following requirements: xcglogger (~> 4.0.0-beta.3) required podfile you can add podfile : pod 'xcglogger', :git => 'git@github.com:davewoodcom/xcglogger.git', :branch => 'swift_3.0' specifying branch mean you'll updates push them, beta 4 etc.

javascript - .play() not firing within directive using $watch -

i using buzz sound , familiar it's functionality. however, myself , mentor cannot figure out why sound file not firing within directive. my directive: (function() { function clocktimer($interval, $window, stop_watch) { return { templateurl: '/templates/directives/clock_timer.html', replace: true, restrict: 'e', scope: {}, link: function(scope, element, attributes) { scope.stop_watch = stop_watch; //see constants in app.js scope.startbutton = 'start work'; scope.breakbutton = 'take break'; scope.onbreak = false; //boolean alternating displaying of work-time or break var mysound = new buzz.sound("/sounds/blue.mp3", { formats: ['mp3'], preload: true }); // @desc initiates holder of completed work sessions.

ionic framework - Detecting centers of circles from camera images -

Image
so i'm developing ionic app uses phone camera detect circles on fabric, picture below: where max size 3x3 grid , there 4 different colors (lightblue, darkblue, lightgreen , darkgreen). basically, i've broken problem down 3 steps: get center of each circle. get color @ center of each circle using positions of each circle's center, create representation of pattern 2d array my problem figuring out best way achieve step 1. i've looked hough transform , can't find resources javascript. if there easier or better way using hough transform grateful know. you can use image segmentation watershed algorithm described in here

php - how to return the result of mongoDB query and gridFS data in a one go? -

i using mongodb , codeigniter php framework in project. dealing e-commerce website. using mongodb store product features , images of products. product details stored in collection , images stored in gridfs bucket product code. want return product details , images passing product code db. wrote 2 queries, 1 retrieving product details collection 1 images of product gridfs. the 2 query results allocated 2 arrays.so iam not able combine result , make single araay pass view page. i bugged this. please help.. i dont have experience in php, imho, question mixes apples bananas. gridfs storage using bit different serialisation can cover documents on 16mb limit (the chunk size 255kb) , reflected in driver interface. mongo single document can 16mb, far images after serialisation fitting in bson limit, using standard collection act solution.

ios - UICollectionView is showing but the cells are not showing in swift -

i created collectionview programmatically (without storyboard). set background color red, , showing properly. cells not showing. know why cells not showing? private let cellid = "cellid" class infoviewshow: nsobject, uicollectionviewdatasource, uicollectionviewdelegate, uicollectionviewdelegateflowlayout { private let cellheight:cgfloat = 80 var collectionview: uicollectionview? let layout = uicollectionviewflowlayout() override init() { super.init() setupcollectionview() collectionview?.registerclass(infocell.self, forcellwithreuseidentifier: cellid) } private func setupcollectionview() { if let view = uiapplication.sharedapplication().keywindow { //let y = (view.frame.width * 10 / 16) + 34 + 26 collectionview = uicollectionview(frame: .zero , collectionviewlayout: layout) collectionview?.backgroundcolor = uicolor.redcolor() collectionview?.delegate = self collectionview?.datasource = self collectionv

java - Fix font and font size in android application -

is there anyway fix font , font size android application? wanted prevent people change application font if have installed app bytafont. have no idea fix results have search how change font not fixing font. thank all. giving different perspective here: why want that? if of users unhappy fonts app using business of installing other apps in order manipulate that; prevent them doing that? in other words: if technical possible: consider not doing this. app developer, goal attract users; not annoy them! edit: worried changing fonts affect responsiveness/usability of app - don't assume. make experiments see happens! maybe not such problem @ all! and if is: users have override things there. in other words, coming business perspective: worth spending time on this? maybe 0.1% of users manipulate fonts; , and afterwards 50% of people unhappy app. worth spending efforts small group @ all? versus: working on other, great features attract more customers? development ti

python - Kafka Consumer didn't receiving any messages from its Producer -

the following python coding kafka producer, i'm not sure messages able published kafka broker or not. because consumer side didn't receiving messages. consumer python program working fine while testing using producer console command. from __future__ import print_function import sys pyspark import sparkcontext kafka import kafkaclient, simpleproducer if __name__ == "__main__": if len(sys.argv) != 2: print("usage:spark-submit producer1.py <input file>", file=sys.stderr) exit(-1) sc = sparkcontext(appname="pythonregression") def sendkafka(messages): ## set broker port kafka = kafkaclient("localhost:9092") producer = simpleproducer(kafka, async=true, batch_send_every_n=5, batch_send_every_t=10) send_counts = 0 message in messages: try: print(message) ## set topic name , push messages kafka broker yield producer.send_messages('test', message.enco

Docker compose and ansible: site.yml does not appear to be a file -

im building docker-compose service probes db service start before starting test on app. docker-compose files worked great , created new host docker machine , error when running: docker-compose agent this docker-compose.yml test: build: ../../ dockerfile: docker/dev/dockerfile volumes_from: - cache links: - db environment: django_settings_module: todobackend.settings.test mysql_host: db mysql_user: root mysql_password: password test_output_dir: /reports builder: build: ../../ dockerfile: docker/dev/dockerfile volumes: - ../../target:/wheelhouse volumes_from: - cache entrypoint: "entrypoint.sh" command: ["pip", "wheel", "--no-index", "-f /build", "."] agent: image: pjestrada/ansible volumes: - ../../ansible/probe.yml:/ansible/site.yml links: - db environment: probe_host: "db" probe_port: "3306" db: image: mysql:5

c# - Angular 1.5 routing(ngRoute) refresh/reload issue in MVC 5 -

i've been going through lot of posts routing mvc/angular how use still not able make work. have problem page refresh/reload when being on angular view/route, it's wont work. here got far: anguar route provider - routes components: $routeprovider .when('/angular/test1', { template: '<sample-component1></sample-component1>' }) .when('/angular/test2', { template: '<sample-component2></sample-component2>' }); $locationprovider.html5mode(true); mvc web config: <rewrite> <rules> <rule name="angularjs" stopprocessing="true"> <match url=".*" /> <conditions logicalgrouping="matchall"> <add input="{request_filename}" matchtype="isfile" negate="true" /> <add input="{request_uri}" matchtype=

c# - JsonConvert.SerializeObject to class with non-nullable DateTime properties? -

background i have json deserialized class has datetime properties. sometimes corresponding elements of json null . when try deserialize json class error thrown because plain old datetime can't accept null . easy removes functionality so easiest resolution make accepting properties of class nullable datetime ( datetime? ) if there's lot of datetime methods can no longer use on properties. works ... weird ? so in looking alternatives have considered following : public class foorelaxed { [required(errormessage = "please enter id.")] public int? id { get; set; } [required(errormessage = "please enter start date.")] public datetime? startdate { get; set; } [required(errormessage = "please enter end date.")] public datetime? enddate { get; set; } public foorelaxed() { } public foorelaxed( int? id, datetime? startdate, datetime? enddate)