Posts

Showing posts from May, 2013

c# - Access to StandardInput from NRECO.VideoConverter? -

i'm using answer this question pipe string of bitmaps ffmpeg. requires redirecting standardinput stream , writing it. is similar available nreco.videoconverter? there way either access running process, or access standardinput base stream? if want provide input data stdin or read output data stdout (or both) may use convertlivemedia method; has overloads different usage scenarios: var videoconv = new ffmpegconverter(); var ffmpegtask = videoconv.convertlivemedia( "rawvideo", h264stream, "h264", new convertsettings() { custominputargs = string.format(" -pix_fmt bgr24 -video_size 640x480 -framerate 5 ", framebmp.width, framebmp.height) }); ffmpegtask.start(); ffmpegtask.write( bmpbytes ); // call n times each input frame. image size should 640x480 ffmpegtask.stop(); you can adopt code snippet "image2pipe" if needed.

will IF SIGNAL SQLSTATE in mariadb exit stored procedure? -

i don't quite understand how mariadb signals work. i have stored procedure takes string input. testing string valid characters. if invalid characters found want send signal error invalid. stored procedure exit if signal sqlstate '......' set mesage_text='......' raised? or complete procedure before issuing signal? when using if...then statements not seem work. create procedure `testp`() begin if teststringsecurity('he;llo world') != 0 select 'invalid characters'; end if; select 'good go'; end; always returns good go . seems must wrap in if ... ... else valid case. though setting signal different. create procedure `testp`() begin if teststringsecurity('he;llo') != 0 select 'invalid characters'; else select 'good go'; end if; end using signal seem interrupt execution immediately. create procedure `testp`() begin declare exit handler sqlexception begin diagnostics condition 1 @sq

sqlite - Android Room Persistence Library: Upsert -

android's room persistence library graciously includes @insert , @update annotations work objects or collections. have use case (push notifications containing model) require upsert data may or may not exist in database. sqlite doesn't have upsert natively, , workarounds described in so question . given solutions there, how 1 apply them room? to more specific, how can implement insert or update in room not break foreign key constraints? using insert onconflict=replace cause ondelete foreign key row called. in case ondelete causes cascade, , reinserting row cause rows in other tables foreign key deleted. not intended behavior. use @insert(onconflict = onconflictstrategy.replace) implement insert or replace , shown in the accepted answer on linked-to question.

forwarding a lua code to another -

i have lua code called lua file , wants assign value , print out value getting "nil", please me. here code: function main_setup() package.path = package.path ..";c:/users/kude/desktop/mqtt1/?.lua" require "ds18b20" end local = main_setup() print(a) output: nil function main_setup() package.path = package.path ..";c:/users/kude/desktop/mqtt1/?.lua" require "ds18b20" end this function not return anything. so local = main_setup() is equivalent to local = nil hence nil is expected output of print(a)

ruby on rails - How to check if nonce has been used? -

in rails 3.1.5 application, using ims-lti gem perform third-party authentication. perform authentication, 3 things must done: check request signature correct check if timestamp old check nonce has not been used the first 2 done, having trouble nonce check. questions have found deal generating nonces in rails, not checking them. there several related questions use oauth-plugin gem check nonce: rails oauth-plugin: multiple strategies causes duplicate nonce error oauth signature verification fails return false unless oauthnonce.remember(nonce, timestamp) unfortunately, oauth-plugin gem hasn't been updated since 2013, , not compatible version of oauth gem required lms-lti gem. it not appear oauth gem supports validating nonces. is there canned way check nonce, whether in native rails or through gem, or relegated to: creating nonce table checking nonce not in table storing nonce , timestamp in table cycling table drop entries expired timestamp

c# - disable dbclick event in Handson Grid -

i using handson table in project. getting issue related double-click function. step 1 . add grey color on button click handson table. step 2 . after when double-click on cell add/edit value, grey color of cell automatically disabled. how set grey color cell? example of problem: $(document).ready(function () { var data = [ ["2008", 10, 11, 12, 1], ["2009", 20, 11, 14, 0], ["2010", 30, 15, 12, 1] ]; var rowcount; var d = $("#example1grid").handsontable({ data: data, colheaders: ["", "kia", "nissan", "toyota", "honda"], cells: function (row, col, prop) { var cellproperties = {}; var hot = this.instance; rowcount = hot.countrows() - hot.countemptyrows(); return cellproperties; }, }); var buttons = { file: document.getelementbyid('btnbgcolor') }; but

How to get the latest NuGet Packages during TFS2013 build -

Image
i've got local build getting correct nuget packages before build tfs (2013) build still fails. how latest packages before tfs build kicks off? i've read several articles talk deleting nuget.targets file solution, don't understand how solution can possibly know in our local nuget store packages if that??? based on this article i've added "$(solutiondir)\nuget restore" pre-build event of first project in solution built, doesn't seem working. @bikerdude - update 8/14/17 nope - nothing on process tab:

html - Resizing window issues -

Image
i stuck 1 of school project having trouble solving it. whenever resize window menus collapsed. sharing screenshot , script. this during maximize window view: this happen when minimize menu options goes down when resize window: i sharing script of page, happening on pages. please check script below: #topnav { height:50px; width:100%; position: relative; display:inline-block; font-size: 14pt; background-color:black; font-family:'times new roman', times, serif; overflow: hidden; } #menu1 { margin-left: 120px; margin-top: 10px; display: block; float: left; color:highlight; overflow: hidden; } #menu1 { color: highlight; text-decoration: none; } #menu2 { margin-top: 10px; margin-right: 120px; display: block; float:right; color: white; position:relative; } #menu2 { color: white; text-decoration:

Separate form submissions by campaign in analytics -

Image
i have campaigns running in google analytics at same time , and, in website, have contact form. is there way can see of campaigns came message send me? for example, john has clicked in campaign-one , send me message, , mario has clicked in campaign-two , send me message. want know john came campaign-one , mario campaign-two. i have been mapping events in site, can't figure out how separate if form came campaign-one or campaign-two. thanks lot! :-) if you've set campaign-one , campaign-two values utm_campaign parameter in campaign tagging, show in campaign dimension in google analytics. i'm assuming "i have been mapping events", mean have implemented event tracking on site these form submissions. you can either build custom report in google analytics includes campaign dimension and event dimensions (event category, event action, event label), or can add campaign secondary dimension events report. example, in behavior > events

css - Changing a specific select2 Background color -

Image
i using select 2 select boxes ( https://github.com/select2/select2/releases/tag/4.0.3 ) , working great. however, change background-color of 1 specific select box on form, how go doing so? i give select same background color text input, adding class not that. class on text field has class of "alert-danger", background enough purposes. help.

Powershell SQL remove last row -

i have multiple text files need imported in sql server management studio. have written code in powershell import files. have file ends row contains '---------------------------------------' for example test|test2|test3 a|b|c q|w|e '-----------' is there way ignore or skip row. tried select-object -skiplast 1 function autoimportcommaflatfiles($location, $file, $extension, $server, $database) { $full = $location + $file + $extension ## $columns = get-content $full | select-object -skip 1 | set-content $full $all = get-content $full | select-object -skip 3 $columns = $all[0] $columns = $columns.replace(" ","") $columns = $columns.replace("||","column emtpy|column empty 2|") $columns = $columns.replace("","column emtpy3") $columns = $columns.trimend('|') $columns = $columns.replace("|","] varchar(100), [") $table = "cre

sql - Visual Studio 2015 Database project -

i need exclude tables publishing in database project, main idea publish subset of tables depending on build configuration, if it's debug want publish tables if configuration release want publish subset of tables. try code: [conditional("release")] public static void insertconditionally(yourdbcontext context) { context.database.migrate(); if( !context.products.any()) { context.products.addrange( new product("name 1 release", "param 1"), new product("name 2 release", "param 1"), new product("name 3 release", "param 1") ); context.savechanges(); } } [conditional("debug")] public static void insertconditionally(yourdbcontext context) { context.database.migrate(); if (!context.products.any()) { context.products.addrange( new product("name 1 debug", "param 1"

c# - Removing member variable from Entity Framework Core generated class -

i using entity framework core generate classes sql database , trying remove navigation member variables of classes. example, here 1 of class generated: public class serialnumbers { public serialnumbers() { features = new hashset<features>(); } /// <summary> /// serial number id /// </summary> public guid id { get; set; } /// <summary> /// contracts id /// </summary> public guid contractid { get; set; } /// <summary> /// user's id /// </summary> public guid userid { get; set; } public virtual icollection<features> features { get; set; } public virtual contracts contract { get; set; } public virtual users user { get; set; } how go removing navigation variables contract , user aren't needed i'm doing? if remove them, sql exception when calling linq methods. thanks

Multiple errors from C assert macro -

i have assert macro that's defined as: #define likely(cond) (__builtin_expect((cond), 1)) #define unlikely(cond) (__builtin_expect(!!(cond), 0)) static void assert_fail(const char *__assertion, const char *__file, unsigned int __line, const char *__function) { fprintf(stderr, "\nassert failed %s:%d %s()\n%s\n", __file, __line, __function, __assertion); void *array[50]; size_t size = backtrace(array, 50); // fill out array of pointers stack entries backtrace_symbols_fd(&array[1], size, stderr_fileno); exit(1); } #define assert(expr) ( likely(expr) ? (void) (0) : \ assert_fail(#expr, __file__, __line__, __func__ )) which works fine, except when make simple error inside assert condition, eg wrong variable name: assert(size > 0); it prints sensible error, 5 notes (including repeats) makes harder read. there sane way address make easier read? core issue seems use of macros, can'

Array answer[i] to if Java -

int count=0,answer[2,4,3,2,1]; the problem : " ']' expected . how solve want first answer answer[0] second answer[1] , all. you cannot use regular int declaration array unless include brackets in variable name answer[] , also, array values defined curly braces: int count = 0; int[] answer = {2,4,3,2,1}; or int count = 0, answer[] = {2,4,3,2,1};

javascript - Nodejs wait for the multiple reuqest to give response -

i looked on internet looking answer didn't find. i studied bit event loop https://www.youtube.com/watch?v=8aghzqkofbq amazing video. still problem not solved. tried promises , callback problem on that. because call function inside there asynchronous function if put callback, wait end of function not asynchrounous function within it. so ask help. beg xd getting know more , more javascript thats question: i have nodejs express angular app. have form in front end. make post request form node server grab data process , start make 6 request server. @ end of 6 request need send data front end tell dont get app.post('/api/todos', function(req, res) { var = (new date(req.body.from)).gettime(); var = (new date(req.body.to)).gettime(); var partner = req.body.partner; var pos = req.body.pos; request.request(from,to,partner,pos); res.send("data") } this handling of form can see problem when call "request.request" if put call

javascript - How do I return the response from an asynchronous call? -

i have function foo makes ajax request. how can return response foo ? i tried return value success callback assigning response local variable inside function , return one, none of ways return response. function foo() { var result; $.ajax({ url: '...', success: function(response) { result = response; // return response; // <- tried 1 } }); return result; } var result = foo(); // ends being `undefined`. -> more general explanation of async behavior different examples, please see why variable unaltered after modify inside of function? - asynchronous code reference -> if understand problem, skip possible solutions below. the problem the a in ajax stands asynchronous . means sending request (or rather receiving response) taken out of normal execution flow. in example, $.ajax returns , next statement, return result; , executed before function passed success callback ca

Where are OAuth 2.0 with Gmail for Server-Side Authorization examples for Java? -

i need implement oauth2 web application written in java access gmail. unfortunately google's documentation has python example regarding topic: https://developers.google.com/gmail/api/auth/web-server i've googled hours , not find example explains topic - i'm new oauth2 , therefore step-by-step example in java useful. thanks in advance :)

WS02 Identity Server Active Directory Permissions -

i'm working company partner working on implementation of ws02 our site. mentioned ad user account created them (which @ point in time standard, non-admin user account) needs have write permissions, user account can reset passwords. the question have is, which permissions in ad account need granted? when scanned through ws02 administration guide, found vague references account needing "read/write permission." ideally, i'd either use 'delegate control' wizard, or advanced security window grant: reset password: to...you know...reset user object's password read lockout time: read if account locked out write lockout time: set lockout time 0, unlocking account read useraccountcontrol: [optional] see if account disabled write useraccountcontrol: [optional] disable/enable account call me paranoid, i'd rather assign selective/granular permissions so, rather give account domain admin level permissions. help?

python - The system cannot find the path specified - FirefoxDriver.exe -

i doing sample selenium code python 3.5 opening link https://www.python.org/ when executing py showed followingf error.. firefoxdriver.exe exists in given path.. , i've added path in environmental variables too.. still error exists.. can me out of this.. my py sample.py : from selenium import webdriver selenium.webdriver.common.keys import keys browser = webdriver.firefox('c:\\pythonselenium\\firefoxdriver.exe') browser.get(parameters['https://www.python.org/']) ==================== restart: c:/pythonselenium/sample.py ==================== traceback (most recent call last): file "c:/pythonselenium/sample.py", line 4, in <module> driver = webdriver.firefox('c:\\pythonselenium\\firefoxdriver.exe') file "c:\python36\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 134, in __init__ firefox_profile = firefoxprofile(firefox_profile) file "c:\python36\lib\site-packages\selenium\webdriver\fire

ios - Store array of tasks in CoreData or UserDefaults in Swift -

i creating app add task pressing button, cell has custom cell populates tableview information user type in textviews, problem having hard time save array using userdefaults(the method know), app crashes when press addbutton, guys point me right direction please ? thanks. i have customcell here: import uikit class celulacustomizada: uitableviewcell //custom cell { @iboutlet weak var imagemdefesa: uiimageview! @iboutlet weak var nomelabeldefesa: uilabel! @iboutlet weak var levellabeldefesa: uilabel! } import uikit var taskmgr: taskmanager = taskmanager() struct task { var name = "un-named" var desc = "un-described" var image : uiimage } i call function append array when press button getting error in userdefaults. class taskmanager: nsobject { var tasks = [task]() func addtask(name: string, desc: string, image: uiimage) { tasks.append(task(name: name, desc: desc, image: image))

ios - Used type 'va_list' (aka '__builtin_va_list') where arithmetic or pointer type is required -

i using sqlite database function insert row given . - (nsnumber *) insertrow:(nsdictionary *) record { // nslog(@"%s", __function__); int dictsize = [record count]; // used use c-arrays. // nsmutable data used make arc-compatible // dkeys unused, necessary because nsdictionary:getobjects:andkeys // way ordered list of values dictionary nsmutabledata * dkeys = [nsmutabledata datawithlength: sizeof(id) * dictsize]; // dvalues used create argument list bindsql nsmutabledata * dvalues = [nsmutabledata datawithlength: sizeof(id) * dictsize]; [record getobjects:(__unsafe_unretained id *)dvalues.mutablebytes andkeys:(__unsafe_unretained id *)dkeys.mutablebytes]; // construct query nsmutablearray * placeholdersarray = [nsmutablearray arraywithcapacity:dictsize]; (int = 0; < dictsize; i++) // array of ? markers placeholders in query [placeholdersarray add

vba - Speed up Excel Macro as Opening -

Image
so whole scope of excel file is copy , paste other 27 external files current excel file 1 one. show mean, following code examples , stimulated capture picture. macros(line # including space line): 1. importing sub in file, have 27 subs this. it's longer example. real macro has 179 lines total. in example, has 51 lines. the thing changed row numbers word row in vba code in line 6. sub import_nj() dim row integer, pathfileopen string, namefileopen string, typefileopen string, fullfilename string, tabcopy string, modelfilename string let row = worksheets("control_table").cells("2", "d").value let pathfileopen = worksheets("control_table").cells(row, "a").text let namefileopen = worksheets("control_table").cells(row, "b").text let typefileopen = worksheets("control_table").cells(row, "c").text let fullfilename = pathfileopen & "\" &am

vagrant - Updating Laravel Homestead error: 401 Unauthorized -

i'm trying update laravel homestead vagrant box update command. used work me in past, gives me error: ~/homestead: vagrant box update ==> homestead-7: checking updates 'laravel/homestead' homestead-7: latest installed version: 2.1.0 homestead-7: version constraints: >= 1.0.0 homestead-7: provider: virtualbox there error while downloading metadata box. error message shown below: requested url returned error: 401 unauthorized why error produced? should authorized to?

javascript - React: onClick on button not working -

for past hour, have been trying work. onclick on of buttons not working @ all… doing wrong? const react = require('react'); class questionnaire extends react.component { constructor (props) { super(props); this.state = { selectedsection: 0 }; } selectsection (e) { console.log(e); } render () { return ( <div> <div classname='btn-group mr-2' role='group'> <button classname='btn btn-primary' onclick={this.selectsection}>a</button> <button classname='btn btn-secondary' onclick={this.selectsection}>b</button> <button classname='btn btn-secondary' onclick={this.selectsection}>c</button> <button classname='btn btn-secondary' onclick={this.selectsection}>d</button> </div> </div> ); } } module.exports = questionnaire; i should mention u

matlab - matlab2tikz error plotting image with alphadata -

i plotting matrix ("i1") has nan values through imagesc command. can see in code have set such nan values should plotted in white i = magic(10); i1 = nan(10); i1(4:6,4:6) = i(4:6,4:6); f1 = figure(); h = imagesc(i1); colormap jet; set(h,'alphadata',~isnan(i1)) axis tight; axis equal; axis on; matlab2tikz('file.tex') i need convert such image in matlab2tikz (see indeed last line of script) obtain following error: error using writepng>parseinputs (line 349) value of 'alpha' invalid. expected input 1 of these types:double, uint8, uint16 instead type logical. can overcome problem? in advance all have convert transparencies double . right now, array of type logical , transparency data can 1 of double, uint8 or uint16 . given nature of array, want non nan visible while values nan transparent, want 0/1 data, not true/false . simply convert double after fact: set(h,'alphadata',double(~isnan(i1)));

string - How do I print my Java object without getting "SomeType@2f92e0f4"? -

i have class defined follows: public class person { private string name; // constructor , getter/setter omitted } i tried print instance of class: system.out.println(myperson); but got following output: com.foo.person@2f92e0f4 . similar thing happened when tried print array of person objects: person[] people = //... system.out.println(people); i got output: [lcom.foo.person;@28a418fc what output mean? how change output contains name of person? , how print collections of objects? note : intended canonical q&a subject. background all java objects have tostring() method, invoked when try , print object. system.out.println(myobject); // invokes myobject.tostring() this method defined in object class (the superclass of java objects). object.tostring() method returns ugly looking string, composed of name of class, @ symbol , hashcode of object in hexadecimal. code looks like: // code of object.tostring() public string tostring() { re

entity framework - How to convert EntityFramework generated SQL query to simple SQL Query -

i new in linq , in existing project linq has been used need write stored procedure 1 of linq query. have generated entityframework generated sql query below want write proper sql query in stored procedure. select [unionall1].[id] [c1], [unionall1].[id1] [c2], [unionall1].[name] [c3], [unionall1].[ydstopin] [c4], [unionall1].[windspeed] [c5], [unionall1].[elevation] [c6], [unionall1].[winddirection] [c7], [unionall1].[startcoordinate] [c8], [unionall1].[pincoordinate] [c9], [unionall1].[targetcoordinate] [c10], [unionall1].[linetype] [c11], [unionall1].[published] [c12], [unionall1].[unpublished] [c13], [unionall1].[deleted] [c14], [unionall1].[book_id] [c15], [unionall1].[imagefile_id] [c16], [unionall1].[situationcategory_id] [c17], [unionall1].[c1] [c18], [unionall1].[id2] [c19], [unionall1].[situationid] [c20], [unionall1].[handicapid] [c21], [unionall1].[c2] [c22],

sql - oracle compare date to null -

i have query comparing date 1 table max date table. problem having when date null being compared against. take following query: select col1 table1 date > (select max(date) table b); the query works fine except when subquery returns 0 rows. in case of 0 rows want return rows. in other words want date compare datetime min value. in case of 0 rows want compare: date > '01-01-1900' i have tried using case statements no luck feel missing simple. any appreciated you want use nvl function assist. (nvl(p_datefield, to_date('01/01/1901','mm/dd/yyyy')) so you: select col1 table1 date > (select max(nvl(date, to_date('01/01/1901','mm/dd/yyyy')) table b); the idea 01/01/1901 represents null . if don't it, change date can come grips on represent null on behalf. update #1..a comment below suggests coalesce work better. could...so here's example: select col1 table1 date > (select coalesce(date, to_date(&

javascript - Angular2: how to "reload" page with router (recheck canActivate)? -

i have routers canactivate: [ authguard ] , validation inside authguard how force check canactivate in same router url ? for example: current route /admin , have got event session expired . have session check in authguard check activates when execute .navigate(...) . how force run canactivate in same location? i've tried: this.router.navigate([ this.router.url ]); angular checks same location , nothing. p.s. can locate "login page" or other pages when got session expired event , have redirects inside authguard , not want repeat same redirects in other events, need location.reload() in angular2 routes. main question sounds like : how force rerun canactivate guards in current location? my temporary solution: auth.service.ts import { injectable, injector } '@angular/core'; import { activatedroute, router, routerstatesnapshot } '@angular/router'; @injectable() export class authservice { constructor(private route: activat

Oracle procedure within package with alter table throws ORA-01031:insufficient privileges -

i insufficient privileges error when executing procedure inside package, though appropriate access has been granted. create or replace package developer.ddl_packs procedure disbcons begin execute immediate 'alter table tester.address disable constraint pk4'; end; end; grant alter on tester.address developer; exec developer.ddl.disbcons edit: tried adding authid definer in package header. still ora-01031:insufficient privileges error when executed developer . user execution works if add authid current_user , execute same developer user. not understand why oracle not consider relevant access when executed authid definer @vivek can add authid definer/current_user within package specification only, think work after that, below package specification should be: create or replace package developer.ddl_packs authid current_user procedure disbcons; end;

performance - unnecessary CVT instructions in PTX binary generated from OpenCL -

i have written simple opencl code, , tried execute on tesla k40m gpu , measure gflops. here code i've written: __kernel void test(__global float *gin, __global float *gout, int m, int n, int p) { int x = get_global_id(0); // private variable float temp = 1.0; // start of new level of loop int baseindex1 = (x) * 512; temp += gin[baseindex1 + 0] * var; temp += gin[baseindex1 + 1] * var; temp += gin[baseindex1 + 2] * var; temp += gin[baseindex1 + 3] * var; temp += gin[baseindex1 + 4] * var; temp += gin[baseindex1 + 5] * var; temp += gin[baseindex1 + 6] * var; temp += gin[baseindex1 + 7] * var; temp += gin[baseindex1 + 8] * var; temp += gin[baseindex1 + 9] * var; temp += gin[baseindex1 + 10] * var; ... temp += gin[baseindex1 + 510] * var; temp += gin[baseindex1 + 511] * var; gout[baseindex1] = temp; } i have deployed kernel on gpu global_work_size of [1048576] , local_work_size of [128]. total num

Google Search Appliance - clarification for Query Suggestions saving for "90 Days" -

the gsa documentation on query suggestions says "the search appliance automatically refreshes query suggestions every 24 hours , keeps them 90 days." know 90 days means? if suggestions refreshed every 24 hours, 90 day timer reset every time? is 90 day referring time search run user resulted in creation of query suggestion? , if user later on "used" query suggestion - reset expiration date? can adjust length of expiration? any appreciated! basically, query suggestions composed of queries have been executed in last 90 days. therefore, if search on day 1 , day 89, term present longer 90 days. i know of no way extend 90 days. however, has positive benefit - things people no longer search no longer appear suggestions.

Angular 4 ngIf inside ngFor not functioning as expected -

the issue having not getting expected functionality out of *ngif statement inside *ngfor. using iterate through custom validation messages , each ngif has unique statement. following component.html file working with: <div class="form-group"> <label for="{{title}}">first name:</label> <input type="text" class="form-control" id="{{title}}" name="{{title}}" [(ngmodel)]="vm.title" [ngmodeloptions]="{standalone: true}" #title="ngmodel" minlength="{{minlength}}" maxlength="{{maxlength}}" required /> <div *ngif="title.errors && (title.dirty || title.touched)" class="alert alert-danger"> <div *ngfor="let validation of validations"> <div *ngif="validation.method">{{validation.message}}</div> </div> </div> and here component.ts file: import { component,

xslt - ZPL: How to horizontally centered a line of text on a label regardless of text length -

Image
i need center text horizontally on label if length of text changes still remain centered. i using xslt process format this: <!-- position home (3.75",4.00")--> <xsl:text><![cdata[^ft494,812]]></xsl:text> <xsl:text><![cdata[^a0b,62,62]]></xsl:text> <!-- using fb command center text --> <xsl:text><![cdata[^fb500,1,0,c]]></xsl:text> <!-- field block --> <xsl:text><![cdata[^fd]]></xsl:text> <xsl:value-of select="/lb:label/lb:mydatafield" /> <xsl:text><![cdata[^fs]]></xsl:text> so output looks this: example a: 123 street 1234567890 1234567890 1234567890 or example: b 123 street 1234567890 so far text not centering , result looks this: 123 street 1234567890 1234567890 1234567890 i think problem stemming use of b "bottoms up&

java - Set On Click Listener for custom view Crashes App -

this question has answer here: what nullpointerexception, , how fix it? 12 answers i attempting create custom container extending linear layout containing few buttons, edit texts, etc., can added app programmatically. far can add custom layout programmatically using layoutinflater, when tried set on click listener button contained inside layout, app crashes every time on startup here simplified code: exercise_entry_layout.xml, layout view: <com.mdmil.app.exerciseentry xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="60dp" android:orientation="horizontal"> <textview android:id="@+id/textview" android:layout_width="0dp" android:layout_height="wrap_content" android:layou