Posts

Showing posts from February, 2010

html - If all elements don't have a particular class, then apply styles -

i have list of elements class name of .box . sometimes, element have class, not know element has it. is there way check if elements of .box don't have .extraclass , apply styles .box , if elements of .box has class .extraclass , don't apply css style? i want using css only. jsfiddle var toggleclass = document.getelementbyid('toggleclass'), box = document.getelementsbyclassname('box'), randomnumber = -1; toggleclass.addeventlistener('click', function() { if (randomnumber !== -1) box[randomnumber].classlist.remove('extraclass'); randomnumber = math.floor(math.random() * 9); box[randomnumber].classlist.toggle('extraclass'); }); removeclass.addeventlistener('click', function() { if (randomnumber !== -1) box[randomnumber].classlist.remove('extraclass'); }); #wrapper { padding: 0; margin: 0; display: flex; justify-content: center; flex-wrap: wrap; } .box { backgroun

appcompat - Divider lines are not correct on Android 5 and Android 4 phones -

in android application, migrating app "com.android.support:preference-v14:23.4.0" settings screen. using theme.appcompat theme. works fine on android 6 phones. but on android 5 , android 4 phones, noticed divider lines "black" in color. used dark theme, should white (with alpha). case android 6 phones, not android 5 , android 4. i tried lot change divider color unable so. loooked solutions on internet nothin seem work. can me this you can use setdivider method provided preferencefragmentcompat class. change style of divider. use method need sure view created otherwise nullpointer error. best place change style in onviewcreated. example: @override public void onviewcreated(view view, @nullable bundle savedinstancestate) { super.onviewcreated(view, savedinstancestate); setdividerstyle(); } private void setdividerstyle() { colordrawable test = new colordrawable(getactivity().getresources().getcolor(r.color.your color)); setdivide

ios - iPad app should not install/usable in iPhone -

i want restrict way iphones not use app intended ipad only. are there ways not allowing user install ipad apps on iphones? second case if installed should usable in iphones. let me know how achieve this in navigator (the left bar), select "show projet navigator"(int top bar, it's icon left) . in deployment info you're able chose devices. https://gyazo.com/47d1bb85b9e72a274ecba072ea676c4e

java - Jackson Databinding -

we using api communicate between our services. bind data use following dependencies: <dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>jackson-core</artifactid> <version>2.6.5</version> </dependency> <dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>jackson-databind</artifactid> <version>2.6.0</version> </dependency> <dependency> <groupid>com.fasterxml</groupid> <artifactid>jackson-xml-databind</artifactid> <version>0.6.2</version> </dependency> the old way api offered list me : country: [ "nl", "be", "es", "gb", ], normally bind pojos followed: e.g. @jsonproperty("country") private list<string> countries; which

java - Css class is not loaded for imageView javafx -

i have css file: .-fx-attribute-label { -fx-min-width: 50; -fx-font-weight: bold; } ... .img-view { -fx-stroke-width: 2.0; } .img-view:hover { -fx-stroke: #70c0e7; } .img-view:selected { -fx-stroke: #26a0da; } and try add img-view class imageview: pairstream.foreach(id -> { final imageview imgview = new imageview(id.getvalue()); imgview.getstyleclass().add("img-view"); facesview.getchildren().add(imgview); //facesview hbox contains imageviews children ... }); i need highlight on hover , when selected doesn't work. know css file loaded because other class -fx-attribute-label works. why it's not working img-view class? imageview not subclass of shape hence not have eg stroke attribute - refer http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html see attributes can set on imageview. your use case has solved wrapping image stackpane , handling hover there.

c++ - Holding reference types in value typed list? -

in discussion what , stack , heap? learned value types kept @ stack , pointers @ heap.in application have qlist<t*> , qmap<qstring,qlist<qstring>> holding pointers of objects. now know, reference types holding @ heap (application). lists, holding references, value types , @ stack. available in thread in created. how know, when thread dead, or if function/method, call in thread? need lists in whole application. bit stupid question fill lists , mere chance if objects available. edit: @coyotte508 the things in stack member pointers pointing memory. , is, if created in stack, if they're local variables of function or of class declared on stack. in main class have list: qlist<fachbereich *> lfbs; in constructor of main class create list: lfbs=qlist<fachbereich *> (); ..- call method readconfig(); one of subroutines : void appconfig::readfachbereiche(qxmlstreamreader &reader) { fachbereich* fb(0); while(!r

android - How to update SQL database from within an onClick event of button inside a ListView -

how handle onclick events of button within listview item. fetching data of content provider in app. implemented custom simplecursoradapter not update database within onclick event. find below customsimplecursoradapter code. i warming android. might missing simple. appreciated public class customsimplecursoradapter extends simplecursoradapter { private context mcontext; private context appcontext; private int layout; private cursor cr; private final layoutinflater inflater; public customsimplecursoradapter(context context, int layout, cursor c, string[] from, int[] to,int flag) { super(context, layout, c, from, to,flag); this.layout = layout; this.mcontext = context; this.inflater = layoutinflater.from(context); this.cr = c; } @override public view newview(context context, cursor cursor, viewgroup parent) { return inflater.inflate

Add column into Javascript function in .js file -

i have add line of code existing js function. cannot add right into, because can interfere future updates of .js file. have add .js file. part of code want add line is: (function($) { if (typeof _wpcf7 == 'undefined' || _wpcf7 === null) { _wpcf7 = {}; } _wpcf7 = $.extend({ cached: 0 }, _wpcf7); $.fn.wpcf7initform = function() { this.ajaxform({ beforesubmit: function(arr, $form, options) { $form.wpcf7clearresponseoutput(); $form.find('[aria-invalid]').attr('aria-invalid', 'false'); $form.find('img.ajax-loader').css({ visibility: 'visible' }); }, and line want add is: $form.find('input.wpcf7-submit').val('sending'); the part want add should right under: $form.find('img.ajax-loader').css({ visibility: 'visible' }); how can achive it? sorry poor language, , in advance answers :)

ruby - How would i add the ability to upload a picture to be a posts background on the show page in rails? -

so in rails have post crudability made far, have markdown on posts. when create posts want have ability upload picture displayed background of post on show page when user clicks this. know question bit broad , possibly refined wouldn't know how word it.

javascript - AngularJS prevent Flash of unstyled content (FOUC) with angular-css -

i'm using angular-css inject css dynamically in head tag when click on link, see flash of unstyled content. if put css in login.html file, don't have problem. tried add ng-cloak on entire login.html file it's not working (but ng-cloak works correctly first load). is there way dynamically load css without fouc using angularjs , angular-css ? is bad practice put css above html in style tag ? can resolve problem , reduce number of requests made browser. thank you! you should able fix using ng-cloak , adding following index.html file [ng:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; }

javascript - Google Maps custom info window -

http://plnkr.co/edit/vcsnt1roifc0n64mgzrp }); var node=document.createelement('div'); node.innerhtml= '';//set chart url self.infowindow.setoptions({content:node,map:self.map}); }; } line 126: trying draw custominfo window (in have html) polygon layer. can't manage work once stage above; causing map not load. appreciated. === line 108 // polygon outlines self.polygon2 = new google.maps.fusiontableslayer({ suppressinfowindows: true, query: { from: self.outlineftid, select: self.outlinecolumn }, styleid: 2, templateid: 2 }); // generate new polygon window self.infowindow = new google.maps.infowindow(); google.maps.event.addlistener(self.polygon1, 'click', function(e) {}); //call drawvisualization when infowindow ready google.maps.event.addlisteneronce(self.infowindow, 'domready', function() { }); it works far here... when add following breaks: //create content infowindow var node=document.createelement('

Matching Multiple Groups in a Java-Regex -

is possible find groups in regular expression match specific part of string? pattern pattern = pattern.compile("(green trousers)|(green\\s+t)"); matcher matcher = pattern.matcher("my beautiful green trousers red!"); while (matcher.find()) { (int = 1; <= matcher.groupcount(); i++) { if (matcher.group(i) != null) { system.out.println("group " + + " matched"); } } } this example returns first group matching, interested in fact second group matches too. there's no direct way this, regular expression consume string left right until finds match. using | means first check first alternative, if doesn't match backtracks , tries second alternative. in case (green trousers) matches, searching stops , match returned.

magento - use phtml code instead of xml code to display reviews -

i added below code in catalog.xml file , reviews section displaying in product view page. want display under particular tab. <block type="review/product_view_list" name="product.info.product_additional_data" as="product_review" template="review/product/view/list.phtml"> <block type="review/form" name="product.review.form" as="review_form"/></block> is there way can use phtml code display review section. so planning use phtml code under tab you can call in particular tab content getchildhtml function call particular block content. below: echo $this->getchildhtml('product_review'); echo $this->getchildhtml('review_form');

ionic ng cordova TypeError: "Cannot read property 'printer' of undefined" -

.controller('myctrl', function($scope,$cordovaprinter, ) { $scope.print = function() { console.log('print method here'); var page = document.getelementbyid('print_id'); if($cordovaprinter.isavailable()) { $cordovaprinter.print(page, 'document.html', function () { alert('printing finished or canceled') }); } } give me suggestion regarding error. thanks

xml - android:gravity not changing the position of the text in a TextView -

i writing code activity has table contains 2 rows(see screenshot). text in 2 rows in center(not textview). however, setting android:gravity = "center" or android:gravity = "center_horizontal" not affect text @ all. missing? screenshot activity_game.xml: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white" android:orientation="horizontal" android:padding="16dp" tools:context=".mainactivity"> <tablelayout android:id="@+id/tl1" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1"> <tablerow android:id="@+id/tr_header_p1" android:layout_width="matc

php - Can't get quotes right -

and saw on title. can't quotes right php. want export variables file, can't quoted right, can me? this code: if($sliderconfig = fopen("./slidersettings.class.php", "w")) { $error[] = 'er een probleem met het veranderen van de slider_config, contacteer site-admin.'; } $configuration = '<?php $slider_text = '.$slider_text.'; $text_link = '.$text_link.'; $slider_speed = '.$slider_speed.'; $text_size = '.$text_size.'; ?>'; fwrite($sliderconfig, $configuration); fclose($sliderconfig); $message[] = 'de configuratie succesvol bijgwerkt!'; this ouput: <?php $slider_text = test; $text_link = test; $slider_speed = test; $text_size = test; ?> and should ouput: <?php $slider_text = 'test'; $text_link = 'test'; $slider_speed = 'test'; $text_size = 'test'; ?>

Java Apache JEXL boolean expressions issue -

i'm developing in java system check occurrence of combination of keywords in text. example, have following expression check: ( yellow || red ) && sofa . divided job 2 steps. first 1 detect individual words in text. second 1 use result checking boolean expression. after short web search choose apache jexl. // web app contains set of preconfigured keywords inserted administrator: list<string> system_occurence =new arraylist<string>() {{ add("yellow"); add("brown"); add("red"); add("kitchen"); add("sofa"); }}; // method below check if of system keywords in text list<string> occurence = getoccurencekeywordsinthetext(); ( string word :occurrence){ jexlcontext.set(word,true); } // set false system keywords not in text system_occurence.removeall(occurence); ( string word :system_occurence){ jexlcontext.set(word,false); } // value boolean expression string jexl

java - When writing to context in the Reducer.reduce method, why is the toString method invoked and not the write method? -

i'm writing map-reduce batch job, consists of 3-4 chained jobs. in second job i'm using custom class output value class when writing context via context.write() . when studying behavior of code, noticed tostring method of custom class invoked, rather write method. why happen, if class implements writable interface, , implemented write method? the custom class's code: import org.apache.hadoop.io.writable; import java.io.datainput; import java.io.dataoutput; import java.io.ioexception; public class writablelongpair implements writable { private long l1; private long l2; public writablelongpair() { l1 = 0; l2 = 0; } public writablelongpair(long l1, long l2) { this.l1 = l1; this.l2 = l2; } @override public void write(dataoutput dataoutput) throws ioexception { dataoutput.writelong(l1); dataoutput.writelong(l2); } @override public void readfields(datainput datainput) throws ioexception { l1 = datainput.readlong(); l2 = datainput

sql - Alert when stored procedure fails -

is possible have sql server (2008) send email alert if stored procedure fails any reason? i can quite sql job can't see options within programmability area or properties of stored procedure itself. stored procedure triggered via application on demand. have looked @ doing other application adds many layers of complication-i hoping sql server had me covered on this!? i have searched not found same question. thanks. high level overview of how can this.. 1.modify stored procs return 1 in case of failure , log table.this has weakness because some failures wont caught 2.once information logged table,then sending email easy using sp_send_dbmail . exec msdb.dbo.sp_send_dbmail @profile_name = 'adventure works administrator', @recipients = 'yourfriend@adventure-works.com', @query = 'select count(*) adventureworks2012.production.workorder duedate > ''2004-04-30'' ,

Marklogic rest resource extension deployment -

is there way modify xquery module & deploy multiple rest extensions on http server? rest resource name should unique each developer can test xquery module changes on dev machine. the problem using curl resource name should match namespace in xquery module. curl --anyauth --user : -x put -h "content-type: application/xquery" -d@"./dev-search.xqy" " http://host:port/v1/config/resources/dev-search-v4?title=retrieval interface&version=1.0&provider=marklogic&description=this module returns marklogic document&method=get" it sounds have multiple developers using same http application server on same marklogic instance test code writing it. think that's problem should solve. first, having each developer use local copy of marklogic. if that's not option, i'd set each developer separate application server , content database (with small subset of data). each developer can deploy whatever , whenever or wants.

naudio - C# Audio File is played in a loop although it is stopped -

i have older implementation using naudio 1.6 play ring tone signalling incoming call in application. user acceptes call, stop playback. basically follwing done: 1. event call must signalled, timer started 2. inside timer play() on player 3. when timer starts again, check performed if file played checking currenttime property against totaltime propery of wavestream 4. when user accepts call, stop() called on player , stop timer the point is, run in cases playback still repeated although timer stopped , stop() called on player. in following link read classes bufferedwaveprovider , wavechannel32 used in code padding buffer zero. http://mark-dot-net.blogspot.com/2011/05/naudio-and-playbackstopped-problem.html is possible non-stopping playback due usage of classes bufferedwaveprovider , wavechannel32 ? in naudio 1.7 audiofilereader class there. class padding zeros? did not find property padwithzeroes in class. make use

android - Black edges around the taken screenshot -

i'm following example : package com.mtsahakis.mediaprojectiondemo; import android.app.activity; import android.content.context; import android.content.intent; import android.graphics.bitmap; import android.graphics.bitmap.compressformat; import android.graphics.pixelformat; import android.graphics.point; import android.hardware.display.displaymanager; import android.hardware.display.virtualdisplay; import android.media.image; import android.media.imagereader; import android.media.projection.mediaprojection; import android.media.projection.mediaprojectionmanager; import android.os.bundle; import android.os.handler; import android.os.looper; import android.util.displaymetrics; import android.util.log; import android.view.display; import android.view.orientationeventlistener; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import java.io.file; import java.io.fileoutputstream; import java.io.ioexception; import java.nio.bytebuff

osx - Exception on reloading remote spring boot application with Intellij IDEA -

Image
i'm trying setup remote spring-boot environment using spring devtools , docker , intellij. started article . unfortunately randomly fails exception. below configuration: dockerfile from java:8 expose 8888 workdir /app add build.gradle /app/build.gradle add gradlew /app/gradlew add gradle /app/gradle add src /app/src run ["chmod", "+x", "/app/gradlew"] docker-compose.yml backend: build: . env_file: environment ports: - "8888:8888" volumes: - ./.gradle-docker:/root/.gradle command: "/app/gradlew clean bootrun" links: - db db: image: postgres:9.5.3 env_file: environment ports: - "5454:5432" the whole application started command line with: docker-compose build , docker-compose up commands. in intellij i've prepared following java application configuration: where docker:8888 i

java - Comparing two ArrayList using Gson? -

i trying compare 2 arraylist< map< string, object>> objects problem need compare them in different app sessions. saving first arraylist in sharedpreferences after converting string using gson. query string in next session compare it. tried converting arraylist comparing list generated during new session. tried converting new list json , comparing both texts. result same. below relevant code: declaration: arraylist<map<string, object>> tweetmaparray = new arraylist<>(); then in method : list<twitter4j.status> statuses = twitter.getusertimeline(params[0], new paging(1, 200)); tweetmaparray.clear(); // reusing (twitter4j.status status : statuses) { map<string, object> valuestoputinmarker = new hashmap<>(); valuestoputinmarker.put("id", status.getid()); valuestoputinmarker.put("status", status.gettext());

html - CSS Selectors outside parent div -

so have bit of html have navigation bar hidden off-screen until checkbox @ top :checked clicking label (hamburger png) @ point comes on screen until such time hamburger icon clicked again , navigation menu hidden off screen once more. now if stick nav section inside header use selectors (+ , ~) target it...but can't think of way when it's new div that's not next checkbox , in it's own div outside of parent. parent have in common #wrapper, no? can't figure out how target inside div. is there way target in pure css make nav menu pop out when checkbox :checked , when un-checked? have javascript it, wanted in css in case, well, know...the user has javascript disabled. html <div id="wrapper"> <header> <a href="#" id="logo">titlebar</a> <label for="hamburger" id="nav_open_icon"><img src="http://i.imgur.com/vv4rdc9.png" alt="open-menu"></label&

php - Export MySQL to CSV -

i have below script export mysql data csv file.this script export inside while loop want put constant value in 2nd column or want keep 2nd column empty , put mysql data in column 1 , column 3. // output column headings fputcsv($output, array('column 1', 'column 2', 'column 3')); // fetch data $rows = mysql_query('select field1,field2 table'); // loop on rows, outputting them while ($row = mysql_fetch_assoc($rows)) fputcsv($output, $row); you have field1 (i.e-column1) , field2(i.e-column3) add null @ 2nd position below $insert = array( '' ); array_splice( $row, 1, 0, $insert ); then use fputcsv($output, $row);

ios - QuartzCore - CA::Render::Shmem::new_shmen() memory leak -

i find out quartzcore - ca::render::shmem::new_shmen()craete somthing , never release , cause memory leak. this repeats many times , memory allocation increase gradually. how can fix problem? the reason because of object (mainly viewcontroller) not realeased. if have problem, check weather stuff released or not.

sql server - How to show blank instead of column value for all duplicated columns of a SQL query? -

there similar question answer known number of columns , single selection column. problem here have no knowledge of columns (count, type) of specified sql query , want blank columns not single column. for example lets have following query. select * view1 result : column(1) column(2) column(..) column(n) 1 sales 1500 2 c sales 2500 3 c sales 2500 4 development 2500 expected result : column(1) column(2) column(..) column(n) 1 sales 1500 2 c 2500 3 4 development pseudo sql query : exec proc_blank_query_result 'select * view1' if you're in sql server 2012 or

c# - how to consuming web service using jquery ajax in asp.net web application -

i unable consuming web service using jquery ajax possible using c# language. jquery ajax code` <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="jquery-3.0.0.js"></script> <script> $(document).ready(function(){ var url = "http://192.xxxx.xx.xx:10000/service1.asmx/getjsondata"; $.ajax({ type: "get", url: url, contenttype: "application/json; charset=utf-8", datatype: "json", success: function (data) { alert("hii"); alert(data.d) }, error: function (xmlhttprequest, textstatus, errorthrown) { alert("error"); } }); }) </script> </head>

php - How to send message with telegram inline bots -

i have set webhook , gives me updates, don't know how send inlinequeryresult php i want send text this: aaaaaaaaaaabbbbbbbbbcccccc how can send php curl? currentry trying: $token = 'bot###'; $chat_id = '###'; $keyboardl = ['inline_keyboard' => [[['text' => "one", 'callback_data' => "1"],['text' => "two", 'callback_data' => "2"]]]]; $data = array("chat_id" => $chat_id,"results" => "??????","reply_markup" => $keyboardl); $data_string = json_encode($data); $ch = curl_init('https://api.telegram.org/'.$token.'/answerinlinequery'); curl_setopt($ch, curlopt_customrequest, "post"); curl_setopt($ch, curlopt_postfields, $data_string);

C++ specializing variadic template inside of a variadic template -

how specialize classes variadic template parameters inside of classes variadic template parameters? i.e.: template < typename ... > struct test_class { template < typename ... > struct s { }; }; template < > template < typename ... ts > struct test_class< ts ... >::s< int > { }; // doesn't work is possible? template <typename...> struct outsides { // ... }; template </* ... */> struct outsides</* ... */> { // ... }; template <typename... types> struct testclass { template <typename... othertypes> using s = outsides<othertypes...>; }; specializing in nested way not possible, can specialize nested template somewhere else.

java - Where does the triggers reside in MVC? -

i in confusion identify role of triggers in mvc pattern, 1 saying triggers operates database , comes under model part , 1 saying triggers controlls data inserted or updated database , comes controller part of mvc. please tell me role of triggers in mvc pattern. thanks. when event happens crud operation example, event dispatcher , event handler called action after crud operation. role of triggers if dealing database , triggers crud operation, triggers belong model layer, controller acts connection between view , model

apache - .htaccess doesn't ask me for password -

i'm trying protect directory adding .htaccess , .htpasswd instead asking me password, goes home page of site directly. my .htaccess being read (put garbage in , got 500 error). here's .htaccess : authname "page d'administration protégée" authtype basic authuserfile "/applications/mamp/htdocs/backoffice_mollanger/app/.htpasswd" require valid-user and .htpasswd admin:gl0iioiri2n6m first of all, remove speech marks have around .htpasswd location, should not there. if not try using this, can specify directory want protect stating file name in replace of example: <files /example> authname "page d'administration protégée" authtype basic authuserfile /applications/mamp/htdocs/backoffice_mollanger/app/.htpasswd require valid-user </files>

associations - belongsTo - hasMany - getting instance from belongsTo - sequelize -

provided have following models: module.exports = function (sequelize, datatypes) { var workingcalendar = sequelize.define('workingcalendar', { date: datatypes.dateonly, isworking: datatypes.boolean, }, { indexes: [{ unique: true, fields: ['periodid', 'date'] }] }, { classmethods: { associate: function (models) { workingcalendar.belongsto(models.period); } } }); return workingcalendar; }; module.exports = function(sequelize, datatypes) { var period = sequelize.define('period', { name: datatypes.string, numberofperiods: datatypes.integer }, { classmethods: { associate: function(models) { period.hasmany(models.workingcalendar); } } }); return period; }; and trying period through workingcalendar follows: return models.workingcalendar .findall({ attributes: [ 'periodid', 'date'

javascript - Access the attributes of the caller element in the options section of the jQuery plugin -

i have links according show when clicked have different width , height data (this links generated in server side) like: <a class="inline" href="#inline-content-1" data-width="80%" data-height="80%">content 1</a> <a class="inline" href="#inline-content-2" data-width="50%" data-height="80%">content 2</a> now want use like: $('.inline').colorbox({inline:true, width:$(this).data('width'), height:$(this).data('height')}); but $(this).data('width') not seem valid in options section colorbox can passed function evaluated in place of static value of properties. $('.inline').colorbox({ inline: true, width: function(){ return $(this).data('width'); }, height: function(){ return $(this).data('height'); } });

mysql - What happens when I create an index on a column? -

i asked multiple question indexes already. this: would following queries benefit index? mytable(col1, col2, col3) . . . col1 = ? , col3 = ? . . . col2 = ? . . . col1 in (?, ?) . . . col3 = ? , col1 not in (?, ?) . . . col1 = ? or col2 = ? . . . col2 = ? , col1 = ? . . . col1 = ? , col2 > ? . . . col1 = ? , col3 > ? -- each question containing 1 of these queries ;-) every time got answer specific query mentioned in question, , still cannot judge such index useful such query or not. (or how making more optimal) so decided ask question , want know backstage. happens when create index on column? index made of what? multiple column index containing rows (because order important) ? how works causes query faster? actually need information indexes make me able how can determine proper index (multiple columns or single column) query. note: have experiences work explain . , yes know using explain useful in these cases. need further information. an index puts va

How can I add a text under a FAB in android -

Image
i'm working on app android , need put text under fab (floating action button) so: but every time i'm trying use linearlayout or relativelayout it, fab sets random location , it's not need be. i can't post of code layout because has details can't share (i'm under contract , not public project). if need specific let me know , i'll find way share without revealing anything. edit: need fab because after click on on layout should this: fab after click and if click on picture, goes different page are using coordinatorlayout set position of fab? here's example how can that. <android.support.design.widget.coordinatorlayout android:id="@+id/main_content" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- content --> <linearlay

c# - How to use TableLayout to create the design i want? -

Image
help using tablelayout & tablerow, in picture below trying marge no.4 , no.6 no.1 had no idea how it. no.1 able cause using layout-weight divide screen 3row,3col . <tablelayout android:layout_width="match_parent" android:layout_height="match_parent" android:stretchcolumns="*"> <tablerow android:layout_weight="2" android:id="@+id/tablerow1"> <textview android:text="1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:background="@android:color/holo_blue_dark" /> <tablelayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_span="2" android:stretchcolumns="*" android:id="@+id/tablelayout1"> <tablerow

ubuntu - libavcodec.so.56 not found when running software compiled with opencv -

i upgraded computer ubuntu 16.04. every time try run software compiled opencv, following error: libavcodec.so.56: cannot open shared object file: no such file or directory looking around /usr/lib/x86_64-linux-gnu/ , can find libavcodec.so , not libavcodec.so.56 . when trying run sudo apt-get install libavcodec56 , get: package 'libavcodec56' has no installation candidate i've scoured internet in search of answer, not find @ point. solving annoying problem appreciated. just install ffmpeg typing: sudo apt-get install -y ffmpeg and files: /usr/lib/x86_64-linux-gnu/libavcodec-ffmpeg.so /usr/lib/x86_64-linux-gnu/libavcodec-ffmpeg.so.56 copy /usr/lib/x86_64-linux-gnu/libavcodec-ffmpeg.so.56 /usr/lib/x86_64-linux-gnu/libavcodec-ffmpeg.so.56

java - How did JVM implement array's class? -

can override methods of array? example tostring() or other methods. import java.lang.reflect.method; public class arraysclasstest { static int[] array = { 1, 2, 3, 1 }; public static void main(string[] args) { class<? extends int[]> class1 = array.getclass(); try { method method = class1.getmethod("tostring"); } catch (nosuchmethodexception | securityexception e) { // todo auto-generated catch block e.printstacktrace(); } } } you can't change features of arrays. jls §10.7 array members specifies every member of array: the members of array type of following: the public final field length , contains number of components of array. length may positive or zero. the public method clone , overrides method of same name in class object , throws no checked exceptions. return type of clone method of array type t[] t[] . a clone of multidimensional array shallow, creates single new arr