Posts

Showing posts from January, 2011

JavaScript - Bing Maps - WellKnownText -

i have follow code: var area = new microsoft.maps.wellknowntext.read(x, { strokecolor: stroke, strokethickness: 10 }); $scope.map.setview({ center: new microsoft.maps.location(lat, lng), zoom: 17 }); $scope.map.entities.push(area); which should map known text (wkt) string. works fine if have point() other wkt string, shows nothing. i've looked @ msdn example, demonstrates point(), , no matter try, can't other shapes show up. has been able map shapes through wkt handler? thanks docmur

java - variable not null then turns null? -

this question has answer here: what nullpointerexception, , how fix it? 12 answers so have file manager class handles data being loaded , saved. reason when declare file manager used in class turns null when test file manager via debug messages, shows as, not null. reason when use declaration shows null. [16:21:22 error]: error occurred while enabling creditcard v1.0 (is date?) java.lang.nullpointerexception @ com.dogboy602k.creditcard.main.util.manager.<init>(manager.java:47) ~[?:?] @ com.dogboy602k.creditcard.main.main.main.onenable(main.java:42) ~[?:?] @ org.bukkit.plugin.java.javaplugin.setenabled(javaplugin.java:292) ~[spigot.jar:git-spigot-e50d38c-02f4218] @ org.bukkit.plugin.java.javapluginloader.enableplugin(javapluginloader.java:340) [spigot.jar:git-spigot-e50d38c-02f4218] @ org.bukkit.plugin.simplepluginmanager.enableplugin(simp

types - Implementing non-positional keyword arguments in Haskell -

i trying implement keyword arguments in haskell, similar ones found in ocaml. goal have arguments can passed in order, , can partially applied in function call (yielding new function takes remaining keyword arguments). i've tried implement using datakinds , type-class represents "a value can converted function a -> b ." idea function taking 2 keyword arguments, foo , bar , can converted either function looks foo -> bar -> x or function looks bar -> foo -> x . should unambiguous long foo , bar have different types (and x isn't function takes foo or bar ), i've tried achieve kwarg gadt. the functional dependency in fun class meant make relationship between f , a , , b more explicit, i'm not sure whether helped. compiler error , without it. i have enabled following language extensions: {-# language datakinds #-} {-# language kindsignatures #-} {-# language gadts #-} {-# language multiparamtypeclasses #-} {-# language flexiblein

wkhtmltopdf - laravel-snappy pdf generation fails with no error -

i have installed laravel-snappy following instructions on https://github.com/barryvdh/laravel-snappy following installation tested wkhtmltopdf , works: vagrant@homestead:/usr/local/bin$ /usr/local/bin/wkhtmltopdf google.com /tmp/google.pdf loading pages (1/6) counting pages (2/6) resolving links (4/6) loading headers , footers (5/6) printing pages (6/6) done i can confirm pdf exists: vagrant@homestead:/tmp$ ls google.pdf this contents of snappy.php file: return array( 'pdf' => array( 'enabled' => true, 'binary' => '/usr/local/bin/wkhtmltopdf', 'timeout' => false, 'options' => array(), 'env' => array(), ), 'image' => array( 'enabled' => true, 'binary' => '/usr/local/bin/wkhtmltoimage', 'timeout' => false, 'options' => array(), 'env&

c++ - Why is the double pound needed in one place but not the others in this macro? -

in particular bit of code, author clever using macro create incrementor functions members of class counter. class counter { public: uint64 _call; uint64 _call_indirect; uint64 _return; uint64 _syscall; uint64 _branch; uint64 _branch_indirect; counter() : _call(0),_call_indirect(0), _return(0), _branch(0), _branch_indirect(0) {} uint64 total() { return _call + _call_indirect + _return + _syscall + _branch + _branch_indirect; } }; counter countseen; counter counttaken; #define inc(what) void inc ## (int32 taken) { countseen. ++; if( taken) counttaken. ++;} inc(_call) inc(_call_indirect) inc(_branch) inc(_branch_indirect) inc(_syscall) inc(_return) i'm little confused macro, though. why author use double pound in function definition part of macro , not when being used class variable being incremented? edit: double pound concatenation, confusion comes why double pound not nec

game maker - Gamemaker teleport issue -

i trying make "teleport" feature in gamemaker. when hit spacebar, teleport state occurs. teleport object teleports player (because speeds game if not teleporting when player doesnt need it), gets direction player facing, teleports teleport object few pixels away few pixels @ time(this makes can make sure player wont hit walls when teleporting). teleports player teleport object. if teleport object hits wall, stop (thats earlier bit about) code simple, when hit space, teleport object doesnt move in slightest. ///teleport state // teleport player objteleport.x = objplr.x; objteleport.y = objplr.y; // --> right here error says "unecessary expression state used statement", appears no matter type on 4th line objteleport.x += (hspd*10); objteleport.y += (vspd*10); objplr.x = x; objplr.y = y; state = scrmovestate;

windows - Where to set /TSAWARE in Visual Basic 6.0 project in Visual Studio 98 -

i need set /tsaware flag legacy vb 6.0 activex exe. can binedit /tsaware app.exe after building app, i'm thinking there should way select in vb6 project in visual studio. i've looked @ project properties don't see anywhere set linker options. project activex component. this question mentions doing in visual studio 6.0 c++ in linker haven't seen way in vb doesn't seem have explicit link settings. actually "vb6 linker" (vs 6.0 link.exe) indeed support flag. of course may have sure have installed vs 6.0 service packs through @ least sp6. to invoke can edit project's .vbp file, adding section: [vbcompiler] linkswitches=/tsaware using later "microsoft (r) coff/pe dumper version 8.00.50727.42" dump compiled exe confirmation, shows 8000 dll characteristics terminal server aware . as far know has worked very long time, perhaps since service pack 3.

android - Text alignment in Html.java and custom tagHandlers -

i'm stumped, confused , frustrated! although can see in html.java api style , text-align should usable tags <p> , <div> etc. failing work <p align="center"> or <p style="text-align: center"> , many other variants. what correct form use html.java through taghandler in fromhtml() method? the received knowledge text alignment not possible preset taghandlers in html.java, but, if so, why there code therein looks capable of handling along other css style parameters? why doesn't custom taghandler using text alignment work? read on more details of test app... not being able central alignment of text, , other styles font size, multiple font faces ttf files, background colour, have made own htmltextview based on textview custom taghandler class. given 1 or 2 minor irritations, of tags fine custom alignment tags, left , centre , right work in special conditions (that don't understand), otherwise. don't work or crash ap

Java directive "page" in all JSP's -

in project have many .jspf (jsp fragments) inserted in jsp's. jsp fragments contain: <%@ page language="java" contenttype="text/html; charset=utf-8" pageencoding="utf-8"%> for jsp's, jsp directive(described above) included. have put directive in jsp fragments? necessary? better, if have jsp fragment head.jspf inserted in jsp's , containing directive(described above), isn't sufficient? thank answer

.htaccess - how to include ALL subdirectories in htaccess file -

our server set horribly each domain has own subdirectory , under those, there anywhere 2 200 more subdirectories (they created new subdirectory every campaign did). question is: how create 1 (1) htaccess file go under domains main subdirectory include other subdirectories under 1 directory , redirect (all index files every other directory) specific url?? i need automate process somehow - going directory subdirectory , uploading htaccess file per domain. there has got better way of doing this... not know names of subdirectories under each domain subdirectory , called different. there has wildcard can include please help!!

java - Going through every object in program using reflection -

i want write cost analysis method number of different classes count number of times objects have been created. easy way increment variable in constructors each of them, wondering if it's possible go through every object in use using reflection? here's 2 ways this: install java agent jvm, can stuff monitor object creation create own classloader can delegate actual object creation work default classloader, count objects they're created. neither solution particularly easy implement. i'd go java agent , because doesn't require changes application code - instead injected jvm @ runtime. edit: alternatively, learn use java profiler, visualvm .

javascript - Adding an active state to list item using angular -

i have following html markup:- <ul class="dropdown-menu"> <li ng-repeat="track in songtracks track $index" ng-class="{active: $index===selectedindex}"> <a ng-click="setsongtrack(track)"> {{track.name}} </a> </li> </ul> in angular, use this:- $scope.setsongtrack = setsongtrack; $scope.selectedindex = 0; $scope.index= function(i) { $scope.selectedindex=i; }; which passes dashjs so:- function setsongtrack(track) { musicplayer.setsongtrack(track); $scope.selectedindex = track; } musicplayer being instance of dashjs, parses audio tracks. wo

lua - Basic Kong Plugin - 403 Forbidden when trying to set URI -

i'm trying write basic plugin kong. now, want change destination based on logic. code same base plugin code, except added in foohandler:access function in handler.lua file. ngx.req.set_uri("http://localhost:8080/openid-connect-server-webapp/token") however, sending curl request localhost:8000 return 403 forbidden error. i tried numerous other uris, http, https. tried google, yahoo, , few other localhost ports. far, uri have found works, https://requestb.in/ , site displays http requests made it. i can tell kong 1 blocking requests 403, since requests aren't reaching desired upstream url. is there sort of limitation on using ngx.req.set_uri()?

javascript - How to substitute all values of a certain key in an array of JSON objects -

i have array of json object, example, people data, example: [ { name : 'john', age : '7' }, { name : 'mary', age : '70' }, { name : 'joe', age : '40' }, { name : 'jenny', age : '4' } ] i want substitute string values in age corresponding integer in order sort age . or add key, example agei integer value. i loop through array, but, there better way that, example 1 command in jquery? you can use foreach modify array in place: var array = [ { name : 'john', age : '7' }, { name : 'mary', age : '70' }, { name : 'joe', age : '40' }, { name : 'jenny', age : '4' } ] array.foreach(obj => { obj.age = number(obj.age) }); console.log(array); or use map make new array: var array = [ { name :

Firebase and Facebook API Calls -

i in need of help. building application , have run bump. i'm trying make api calls graph api facebook not under new account. using linkwithredirect link facebook account email , password account on firebase. after complete everytime try , make call graph api says account linked. ` facebook.addeventlistener('click', e => { // first, perform signinwithredirect. // creates provider object. var provider = new firebase.auth.facebookauthprovider(); provider.addscope('public_profile'); provider.addscope('email'); provider.addscope('user_photos'); provider.addscope('manage_pages'); provider.addscope('publish_pages'); provider.addscope('business_management'); provider.addscope('read_insights'); // provider.addscope('public_actions'); // can add additional scopes provider:x auth.currentuser.linkwithredirect(provider).then(function(){ firebase.a

python - Output of testing if string is Palindrome -

output of testing if string palindrome def ispalindrome1(s): """assume s str returns true if s palindrome;false otherwise. punctuation marks, blanks, , capitalization ignored.""" def tochars(s): s = s.lower()# means:s = 'abcd',if s referenced s.lower,then s='abcd'. ans = '' c in s: if c in'abcdefghijklmnopqrstuvwxyz': ans =ans+c return ans def ispal(s): print ' ispal called with',s if len(s)<=1: print ' return true base case' return true else: ans = s[0] == s[-1] , ispal(s[1:-1]) print ' return',ans,'for',s return ans return ispal(tochars(s)) def testispalindrome1(): print 'try doggod' print ispalindrome1('doggod') print 'try dogood' print ispalindrome1('

c# - ArcObjects: Setting symbol levels doesn't seem to apply unless switched to advanced view -

using information provided on http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/00010000035w000000.htm i've been able set map levels on isymbol objects, unsure if it's working how expect. if i'm not in 'advanced view' (layer properties -> symbology -> advanced -> symbol levels -> , clicked 'switch advanced view') don't know sure if values set since if switch default advanced values reset 0-n. there seems flag gets set when toggle default advanced, , need set users able know values set and/or not accidentally reset values. have idea on toggles default/advanced view through arcobjects? documentation states default view's join , merge '... implemented behind scenes using symbol level objects , interfaces', there must way?

html - Put as many elements as possible in each page print -

i trying print categories, each category contains unknown number of elements. every page needs: header , footer. to include categories as possible i try "position:fixed" header , footer, , "page-break-inside: avoid" category container. first page fine, in others categories start top of page, , behind header. the question : there way in media print? if not, there way render page looks wont, , print it? this example: <style> @media print { .category { page-break-inside: avoid; padding: 10px; } .page { padding-top: 20px; } } </style> <body> <h1 style="position:fixed">this text hide category in second page </h1> <div class="page"> <div class="category"> category 1<br/>item<br/>item<br/>item<br/> </div> <div class="category"> category 2<br/>item<br/>item<br/>item&

kivy - buildozer - using a different python version (not default 2.7.2) -

i'm trying compile andriod apk file more recent version buildozer uses default (2.7.2). reason being, have library needs 2.7.7 or greater, , i'm not confident in creating full python build myself specific lib. app runs on linux pc runs 2.7.12. using python 3.5 crystax gives me more problems again. (i try again if solution above not possible.) is impossible, or complex 'python intermediate'? appreciated. edit: ok, looks need compile python android repository github. annnnd..... the fun begins! the code used compile python2 in recipe here . targeting different python version require updating patches , potentially making other changes depending on necessary compatibility. there pr @ https://github.com/kivy/python-for-android/pull/775 , may useful reference. don't know if work easily. going python3 route crystax easier.

android - Is it safe to use more than 1500 tabs in a TabLayout? -

i using adapter 1000+ items in it. cause lag? seems might - imagination. if how can around it? want have tab each month in many years code: mviewpager.setadapter(mdemocollectionpageradapter); mviewpager.setcurrentitem(564); tablayout.setupwithviewpager(mviewpager);

git - how to fix repo upload failed with urlopen error [Errno -2] Name or service not known? -

i have created own git server repo. git works fine. , repo sync code server. when used "repo upload ." failed. log :~/retest/build/ap$ repo upload . upload project ap/ remote branch master: branch mifi ( 1 commit, thu jul 27 21:20:21 2017 +0800): 3da5c7d8 build:first build null (y/n)? y ---------------------------------------------------------------------- failed ap/ mifi (null: <urlopen error [errno -2] name or service not known>) the .git/config :~/retest/build/ap$ cat .git/config core repositoryformatversion = 0 filemode = true filter "lfs" smudge = git-lfs smudge --skip -- %f remote "lqce" url = http://url/for/git review = null projectname = mifi/ap fetch = +refs/heads/*:refs/remotes/lqce/* branch "mifi" remote = lqce merge = refs/heads/master :~/retest/build/ap$ repo upload . branch mifi ( 1 commit, thu jul 27 21:20:21 2017 +0800): 3da5c7d8 bu

PHP MYSQL valid query gives no error or result unless LIMIT added to query -

this php i'm using should yield result of 10300 rows 2 values per row. running script instantly completed , results in white page no error feedback on screen or in various apache , mysql logs. $output = array(); $sql = "select id, name objects order id desc"; $result = $conn->query($sql) or die(mysqli_error()); $count = 0; while($row = $result->fetch_assoc()) { $output['records']['objects'][$count]['id'] = $row['id']; $output['records']['objects'][$count]['name'] = $row['name']; $count++; } echo json_encode($output); however if change query such $sql = "select id, name objects order id desc limit 500"; i receive results expected , output (after json encode) seems 31kb (31418 characters) am exceeding limit here , have error levels set wrong?

frontend - How to differentiate between reflow and repaint in chrome developer tools? -

how differentiate between repaint a repaint occurs when changes made elements affect visibility not layout. example, opacity, background-color, visibility, , outline. repaints expensive because browser must check visibility of other nodes in dom — 1 or more may have become visible beneath changed element. and reflow reflows have bigger impact. refers re-calculation of positions , dimensions of elements, leads re-rendering part or of document. changing single element can affect children, ancestors, , siblings. using chrome developer tools(or other similar tools)? in chrome performance tab see repaint. repaint

android - RecyclerView onDrawOver view disappear after scroll -

Image
i want display view (example textview ) on recyclerview after scroll position (example: 3) use public class headeritemdecoration extends recyclerview.itemdecoration { @override public void ondrawover(canvas c, recyclerview parent, recyclerview.state state) { super.ondrawover(c, parent, state); int topchildposition = parent.getchildadapterposition(parent.getchildat(0)); if(topchildposition == 3) { log.i("tag", "draw header"); textview textview = new textview(parent.getcontext()); textview.settext("bbdasdasd"); textview.setbackgroundcolor(color.red); textview.layout(0, 0, 100, 100); drawtext(c, textview); } } private void drawtext(canvas c, view header) { c.save(); c.translate(0, 0); header.draw(c); c.restore(); } } and mrecyclerview.additemdecoration(new headeritemdecoration()); i work pr

php - Add Tip input by customer to woocommerce checkout page -

i developing food ordering woocommerce store. trying add input field or grouped button let customer add delivery tips checkout total. backend part: wrote action add tip checkout based on percentage given (let's 10% of total order) add_action( 'woocommerce_cart_calculate_fees', 'calculatetipspercentage', 10, 1 ); function calculatetipspercentage( $cart ) { if ( is_admin() && ! defined( 'doing_ajax' ) ) return; $total_tax = 0; $carttotal= 0; // unformated taxes array $taxes = $cart->get_taxes(); //get tax amount taxes array foreach($taxes $tax) $total_tax += $tax; global $woocommerce; $percentage = 0.10;//percentage of tips (must entered customer) $carttotalamount = ( $woocommerce->cart->cart_contents_total + $woocommerce->cart->shipping_total ); //cart total without tax $totalorderwithtax = ( $carttotalamount + $total_tax); //cart total tax $extrafee= round( $totalo

ruby on rails - No route matches {:action=>"change_name", :controller=>"users", :id=>nil} missing required keys: [:id] -

i've added gem "devise" , got error. can't understand what's wrong code. in advance! error: def user_form common_options = { validate: true, html: { class: 'user-form' } } form_options = current_user ? [ current_user, { url: change_user_name_path(current_user.id), method: :post, validate: true }.merge(common_options) ] : [ user.new, { validate: true }.merge(common_options) ] form_for *form_options |f| yield f end end routes rails.application.routes.draw devise_for :users devise_for :usernames root 'surveys#index' resources 'surveys' resources 'attempts' resources 'users', only: [:create] delete 'attempts/:survey_id/:user_id' => 'attempts#delete_user_attempts', as: :delete_user_attempts post 'user/:id/change_name' => 'users#change_name', as: :change_user_name controller: class userscontroller < applicationcontroller def creat

c++ - Visual Studio - why does stdafx.h gets embedded -

i unix guy project need code in vs 2015. need write gmock test cases c++ classes. i first tried start sample project selected file->new->project->win32->win32 console application. project did got created default name consoleapplication2.cpp having embedded statement - #include "stdafx.h" i found if delete line code fails compile - in unix create .h , .cpp files , create make file - aim start project - create .h files first , create .cpp / gmock test cases , build build all please let me know if there option in vs same or way so? for use of stdafx.h please see link here if want add header file , respective cpp file need go project in solution explorer @ right side of ide. right click , go add. there option header file , class both. can add there , start writing code test cases.

javascript - Word boundary not working for amount in dollars (REgex) -

this question has answer here: how reduce complexity in regex? 3 answers i have regex match amount in $. (\-?\$\-?[0-9]+\.?[0-9]*|usd\-?[0-9]+\.?[0-9]*|[0-9]+\.?[0-9]*\-?usd|[0-9]*\.?[0-9]*\$) currently matching $250 , usd250 etc, should not match $250 in $250abchhh . so, tried word boundary, didn't fix issue well, how can fix issue? matching cases $456 $45.6 $.5 $-45 -$45 usd-456 usd46 usd4.6 usd.46 1$ 1.5$ .5$ -.5$ 5usd 456usd it should not match 455$abc abc$123 abcuds1 jhb$5665usdjnjnb $usd1555 usd$768 $566usd $5788usdbjhj you should write correct regex decimal. , use ^$ start , end of line. ^\s*(?:(?:(?:-?(?:usd|\$)|(?:usd|\$)-)(?:(?:0|[1-9]\d*)?(?:\.\d+)?(?<=\d)))|(?:-?(?:(?:0|[1-9]\d*)?(?:\.\d+)?(?<=\d))(?:usd|\$)))\s*$ look here @ test results.

invoke command - Powershell seems to treat sub pipeline code as part of execution body of first pipeline script block -

i creating retry command in powershell invoke script block retry logic: function invoke-commandwithretry { [cmdletbinding()] param ( [parameter(mandatory = $true, valuefrompipeline = $true)] [scriptblock]$command, [parameter(mandatory = $false)] [validaterange(0, [uint32]::maxvalue)] [uint32]$retry = 3, [parameter(mandatory = $false, position = 3)] [validaterange(0, [uint32]::maxvalue)] [uint32]$delayinms = 1000 ) process { $retrycount = 0 while( $true ) { try { return (invoke-command -scriptblock $command) } catch { if( $retrycount -ge $retry ) { throw } else { write-warning $_.exception start-sleep -milliseconds $delayinms $retrycount+

javascript - React onSubmit event not working -

when hit enter on form, not trigger onsubmit event. there no errors. other event, onblur, dispatch. logform function console.log json string of form's fields, have not yet gotten far. trying trigger onsubmit event on form. or explanation appreciated. here's code: import react 'react' export default function signupform() { return ( <form onsubmit={logform}> <div classname="form-group"> <label> name: <input onblur={logupdate} classname="form-control" type="text" placeholder="username"/> </label> </div> <div classname="form-group"> <label> email: <input onblur={logupdate} classname="form-control" type="text" placeholder="johndoe@example.com"/> </label> </div> <div classname="form-group&q

itext - saving modified data in pdf itextsharp -

i have created pdf using itextsharp contains editable fields, when service called pdf created. problem facing is, if changing in pdf , downloading changes not saved. want open pdf in new tab through server side. code using is: public static string[] languages_gc = { "english", "math", "science" }; [httpget] [odataroute("getpdf")] public void downloadpdf() { httpcontext.current.response.contenttype = "application/pdf"; httpcontext.current.response.addheader("content-disposition", "inline;filename=example.pdf"); httpcontext.current.response.cache.setcacheability(httpcacheability.nocache); document doc = new document(itextsharp.text.pagesize.a4, 10f, 10f, 100f, 0f); string pdffilepath = httpcontext.current.server.mappath(".") + "/pdffiles"; pdfwriter wri = pdfwriter.getinstance(doc, httpcontext.current.response.outputstream);

javascript - Not able to iterate HTMLCollection in jQuery extension -

i working on form filler. below code working fine in chrome console, when put code in extension (form filler) not work. jquery code: var addresselement=$($('[data-name="selected-address"]')[0].children).filter(function(idx) { return this.innerhtml.indexof('52') == 0; }); addresselement[0].click(); also tried javascript code document.queryselectorall('[ng-bind="address.formattedaddress"]'); html: <div class="select-replacement form-control" data-name="selected-address"> <a href="javascript:;" ng-click="selectaddress(address);" ng-repeat="address in address.addresslist" ng-bind="address.formattedaddress" class="ng-binding ng-scope">30, test data</a> <a href="javascript:;" ng-click="selectaddress(address);" ng-repeat="address in address.addresslist" ng-bind="address.formattedaddress" class

c# - Authentication using Owin in MVC -

i'm messing around owin authentication wanted learn more mvc in general decided write little test app have login form , authenticate users against credentials stored in database. login form validation written gods sake...i cannot figure out how create valid session once user has entered correct credentials. assume need set cookie or similar formsauthentication? so have owin startup file contains following public void configuration(iappbuilder app) { // more information on how configure application, visit https://go.microsoft.com/fwlink/?linkid=316888 } public void configureauth(iappbuilder app) { // enable application use cookie store information signed in user app.usecookieauthentication(new cookieauthenticationoptions { authenticationtype = defaultauthenticationtypes.applicationcookie, authenticationmode = authenticationmode.passive, loginpath = new pathstring("/account/logon"), cookiesecure = cookiesecureoptio

html - Margin around set height and width -

as title says i'm looking add gap, know can setting different width want using margin. doesn't work, pushes div down (in jsfiddle doesn't add margin because of height:100%). here's fiddle, https://jsfiddle.net/s31r2af4/ how can solve this? (no overflow:auto ) try this: .chat-holder{ margin:10px; height:calc(100% - 20px); box-sizing:border-box; } .sidebar{ width:50%; height:500px; background:purple; overflow:overlay; }

Python: How to approach writing a program -

i'm new programming , unsure how go approaching problem. i'm not asking code, point me in right direction keywords can google how code problem. problem: (to put simply) own business requires amount of skilled workers. 2 - foreman (can job of below) 4 - equipment operators (can job below except foreman) 10 - laborers each day need @ least 1 foreman, 2 equipment operators , 6 laborers on job site. have of these workers on contract , leave @ predetermined amount of time. i create program forecasts/projects workforce shortages based on dates workers leaving. ie: june show 10% below normal staffing , show short foreman , 3 laborers. i hope i've explained enough , know there other variables, need point in right direction on how approach , programming methods implement it. thank valued input.

How one object of same class assign to the other object of the same class in c++? -

i know can directly assign same class objects in c++,but happen behind scene? there's called "default copy-constructor " , "default assignment-operator ". unless overload these methods in class, default behavior non-static members of class copied one-by-one source target class. a little more: includes pointers, btw. why should overload these operators , follow rule of three if have pointers members.

android - How to display Fragment in a tab Activity -

i'm facing quite frustrating bug in app, let me explain: have mainactivity appbar containing 3 tabs , each tab displays fragment. problem comes when try lunch fragment , make replace screen. new fragment displayed on replaced 1 , 2 visible. here code: the mainactivity: public class mainactivity extends appcompatactivity { public static model model; public static controller controller; private sectionspageradapter msectionspageradapter; private viewpager mviewpager; private static final int permission_galerie = 10; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main_layout); this.model = new model(); this.controller = new controller(model,this); final toolbar toolbar = (toolbar)findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); msectionspageradapter = new sectionspageradapter(getsupportfragmentmanager()); mviewpager = (viewpager)findviewbyid(r.id.containe

java - how to show tab of view pager on click of navigation drawer item without overlaping? -

Image
there 3 fragments in app.i showed them in tabs successfully.now want show fragment of tab1 on click of navigationdrawer item1 , same rest.but there problem of overlapping.can guide me rid of problem? mainactivity.java protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); viewpager viewpager = (viewpager) findviewbyid(r.id.pager); // set viewpageradapter viewpager viewpager.setadapter(new viewpageradapter(getsupportfragmentmanager())); drawerlayout drawer = (drawerlayout) findviewbyid(r.id.drawer_layout); actionbardrawertoggle toggle = new actionbardrawertoggle( this, drawer, toolbar, r.string.navigation_drawer_open, r.string.navigation_drawer_close); drawer.setdrawerlistener(toggle); toggle.syncstate(); navigationview navigationview = (navigationview) fin

java - Sending text message using android application -

i trying build sms application following this tutorial , seems fine except when hit send button ,the message not received other user number have entered in edittext . in application have 2 edittext , 1 button .one edittext message , other specifying phone number of receiver. code given below : mainactivity.java public class mainactivity extends appcompatactivity { private static final int my_permissions_request_send_sms =0 ; button send; edittext message; edittext phoneno; string number; string txt; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); send=(button)findviewbyid(r.id.sendbutton); message=(edittext)findviewbyid(r.id.textmessage); phoneno=(edittext)findviewbyid(r.id.phone); send.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) {