Posts

Showing posts from January, 2010

Mathematica: Unusual piecewise plot issue -

Image
hello , in advance, i came upon issue trying plot piecewise function in mathematica. when entered directly plot function, piecewise did not plot. however, when defined piecewise variable, did plot. why issue occurring , can still join plot? (i join setting exclusions none) the following code: (i define maxwell strain function , trying model plastic deformation of polymer on multiple stress cycles) z = 2*10^10; h = 10^12; maxwellstrain[s_, t_] := s/z + (s*t)/h; stress = {0, 10^7, -10^7, 5*10^6, 10^7, -5*10^6}; time = {0, 100, 200, 300, 400, 500}; strainlist = join[{0}, table[maxwellstrain[stress[[i + 1]], t - time[[i]]], {i, 1, 5}]]; plot[ piecewise[ table[{ total[strainlist[[1 ;; + 1]]], time[[i]] < t < time[[i + 1]]}, {i, 1, 5} ], exclusions -> none] , {t, 0, 500} ] x = piecewise[ table[{ total[strainlist[[1 ;; + 1]]], time[[i]] < t < time[[i + 1]]}, {i, 1, 5} ], exclusions -> none] plot[x, {t, 0, 500}] the fol

ios - Does the size of a placeholder image affect performance? -

at moment downloading images remotely using uiimageview category. while image downloading use placeholder image stored in xcassets folder. is worth having multiple placeholder images different sizes: small, medium, , large? or worth having 1 placeholder image , using throughout application? does size of placeholder image affect performance? well, should have @2x , @3x version of images, mean less work cpu scale / down image on different devices. also, there technically work done cpu scale image or down. however, apple's graphics processor pretty efficient @ scaling images. so technical answer "yes, affect performance", in reality not big enough difference notice. now, if have built poorly written app displays hundreds of these placeholders in uiscrollview instead of form of uicollectionview (which displays on screen, or on screen), notice slight performance difference images adds large performance difference.

c# - Setting the username in the model instead of javascript code -

i managed signalr chat going, , ran problem. <script type="text/javascript"> $(function () { // declare proxy reference hub. var chat = $.connection.chathub; // create function hub can call broadcast messages. chat.client.broadcastmessage = function (name, message) { $('#chat-body').append('<li><strong>' + name + ' :</strong> ' + message); }; // start connection. $.connection.hub.start().done(function () { $('#send-chat-msg-btn').click(function () { // call send method on hub. chat.server.send('username', $('#message-input-field').val()); // clear text box , reset focus next comment. $('#message-input-field').val('').focus(); }); }); }); </script> the username set in javascript code, when sending serv

Date format changed when printing report in c# -

Image
i developed application uses reports, , have problem when attemp print report date format changed format on client pc, although print date in correct format on pc, here 2 pictures first pc , other client pc my pc client pc here code used display report string datestring = datetimepicker1.value.tostring("yyyy/mm/dd"); datetime dt = datetime.parseexact(datestring, "yyyy/mm/dd", null); string datestring2 = datetimepicker2.value.tostring("yyyy/mm/dd"); datetime dt2 = datetime.parseexact(datestring2, "yyyy/mm/dd", null); dailyworktableadapter.fill(this.workingmgmtdataset1.dailywork,label2.text,dt,dt2); datatable1tableadapter.fill(this.finalds.datatable1,dt,dt2,label2.text); this.reportviewer1.refreshreport(); the date field expresion in report : =fields!date.value the client pc seems setup different culture. can force format of datetime value this: datetime dt = datetime.no

asp.net - How to use client side script on button click to modify text box -

Image
i'm developing interface using asp.net ajax webforms. shows update panel upon initialization of page , after various actions requested validate user pin number. interface used on tablets, created keypad buttons collect user's pin number looks this: when buttons clicked run: protected void btn0_click(object sender, eventargs e) { addnumbertopin("0"); } the procedure call labeled number argument strdigit defined as: protected void addnumbertopin(string strdigit) { txtpin.text += strdigit; if (txtpin.text.length == 5) { ... ...check database validate pin ... } } this works, slow because every button click creates round trip web server. seems should simple store collected pin in local variable on client , post server once 5 digits have been collected. i'm new web programming, i'm not sure how go doing this. i've read this , this , still can't figure out how buttons stop posting server.

asp.net mvc - Html.raw("test string") not displaying string with double quotes around it -

i have string 'test string" being displayed on html page but html.raw("test string") hides string when there double quotes around string, don't see in page text field does know how can fix this? you must escape special characters, such quotes, using \ character. in example be html.raw("\"test string\"")

Where can I compile my ruby code? -

i started programming on ruby @ codecademy can compile codes on doing website? when making lessons on c used codeblocks run codes. know text editor can run html code. ruby? thank you. i'll take stab @ answering question think you're asking, i'm not 100% sure here. ruby interpreted language (what mean? not whole lot nowadays. if you'd more in depth discussion on distinction or lack thereof between interpreting vs compiling, read jorg's comments below). execute ruby code, you'll need install ruby. fortunately you, freely available on major platform. if you're on unix-y (eg, linux or mac), i'd recommend installing ruby via rvm or rbenv. if you're on windows, can either go cygwin route , pretend it's unix-y environment, or there prebuilt installers out there. googling 'install ruby' should have sites can @ or near top of search results.

php - Symfony Form: OneToMany and CollectionType Field -

i got stucked building form symfony 3. i defined entity 'news' containing attribute 'newsarticle', has onetomany relation entity 'newsarticle', holding translations of attributes 'headline', 'subheader , 'bodytext'. goal provide form holds on 1 hand fields attributes of 'news' , on other hand fields create 'newsarticle' entry default language. entity news (excerpt): /** * @orm\entity * @orm\table(name="news") */ class news { /** * @orm\column(type="integer") * @orm\id * @orm\generatedvalue(strategy="auto") */ private $id; /** * @orm\onetomany(targetentity="newsarticle", mappedby="news", cascade={"persist", "remove"}) */ private $newsarticle; /** * constructor */ public function __construct() { $this->newsarticle = new \doctrine\common\collections\arraycollection();

Linux: re-loading kernel modules -

i'm doing development on gpu kernel module. gets compiled on 'make modules' , not on 'make', can dynamically loaded module loads on linux boot. rapidly recompile , reinstall module without installing whole new kernel. ok 'make modules' , replace existing .ko file in /lib/modules/... , reboot? if not (perhaps in use) can boot different kernel, replacement, , reboot in? possible insmod it? it gets compiled on 'make modules' , not on 'make', can dynamically loaded module loads on linux boot. you should check module placed. can stored in /lib/modules/...kernel-version../, or in /lib/modules , inside initramfs (initrd). in second case need regenerate initramfs image after updating ko in /lib/modules. i rapidly recompile , reinstall module without installing whole new kernel. ok 'make modules' , replace existing .ko file in /lib/modules/... , reboot? yes, allowed change .ko file, when module loaded. (loading of

python - Fastest way from logic matrix to list of sets -

i need convert sparse logic matrix list of sets, each list[i] contains set of rows nonzero values column[i]. following code works, i'm wondering if there's faster way this. actual data i'm using approx 6000x6000 , more sparse example. import numpy np = np.array([[1, 0, 0, 0, 0, 1], [0, 1, 1, 1, 1, 0], [1, 0, 1, 0, 1, 1], [1, 1, 0, 1, 0, 1], [1, 1, 0, 1, 0, 0], [1, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0], [0, 0, 1, 0, 1, 0]]) rows,cols = a.shape c = np.nonzero(a) d = [set() j in range(cols)] in range(len(c[0])): d[c[1][i]].add(c[0][i]) print d if represent sparse array csc_matrix , can use indices , indptr attributes create sets. for example, in [93]: out[93]: array([[1, 0, 0, 0, 0, 1], [0, 1, 1, 1, 1, 0], [1, 0, 1, 0, 1, 1], [1, 1, 0, 1, 0, 1], [1, 1, 0, 1, 0, 0], [1, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0],

gulp - How properly to bundle an aurelia plugin that html files, js files, and dependencies? -

situation we using fork of benib/aurelia-leaflet in our app. jspm install github:shaunluttin/aurelia-leaflet the plugin includes original in installation dependency , results in following installation. jspm_packages github leaflet <----- original leaflet@0.7.7 dist images leaftlet.css leaflet.js leaflet-src.js <----- dependency leaflet@0.7.7.js shaunluttin aurelia-leftlet@0.1.2 <----- aurelia plugin helpers aurelia-leaflet-exceptions.js index.js <----- dependency leaflet.html leaflet.js leaflet-defaults.js aurelia-leaflet@0.1.2.js these module definitions pointing dependencies. leaflet@0.7.7.js define(["github:leaflet/leaflet@0.7.7/dist/leaflet-src"], function(main) { return main; }); aurelia-leaflet@0.1.2.js define(["github:shaunluttin/aurelia-leaflet@0.1.2

c# - Where clause causing cannot compare elements error -

i have 2 tables, doctors , doctorshifts, relation between 2 table one(doctor) many(doctorshifts). in doctorshifts saved days of week each doctor work on. what need display list of doctors work today, tried following expression not work : iqueryable<doctor> todaydoctorsquery = _context.doctors.where(s => s.doctorshifts.where(s2 => s2.dayoftheweek == _todaynumber) != null); the error : cannot compare elements of type 'system.collections.generic.ienumerable`1[[medcare_software.edm.doctorshift, medcare-software, version=1.0.0.0, culture=neutral, publickeytoken=null]]'. primitive types, enumeration types , entity types supported."} how can list of doctor works today? the inner clause returns ienumerable<doctorshift> can't compared null. anyway, you're better off using any in: var todaydoctorsquery = _context.doctors.where( s=> s.doctorshifts.any(s2 => s2.dayoftheweek == _todaynumber)); and make sure dayoft

How to implement a nested master detail flow on Android? -

Image
i have list, within list, within list, , on. there's 5 tiers. it's easy enough create 5 activities each list on phones, if want support tablets well? i'd need work master detail flow. however, can't seem find tutorials or information in relations nested master detail flow. anyway, here illustration of i'm describing: in tablet layout, want screen shift 2 tiers @ time. user can advanced next tier selecting list item right tier. go previous tier, user can tap button. any idea how can achieve this? after full day scouring internet, found solution. "nested master details flow" effect use viewpager fragmentpageadapter. master detail flow this: to change 2 panel mode when user switches landscape, in extended fragmentpageradapter class, override following method: @override public float getpagewidth(int position) { displaymetrics metrics = getresources().getdisplaymetrics(); // if width greater 900dp halve width of page i

windows - UTF-8 text to clipboard C -

i have been looking around on how bring string, const char* output = "ヽ(⌐■_■)ノ♪♬"; to clipboard. setclipboarddata(cf_unicodetext, hmem); i have tried multibytetowidechar, have gotten noise , conflicting claims cannot save utf-16le clipboard (wchar_t). confused. direction or code sample great. windows uses utf-16le. string should created l prefix. use utf8 can declare string u8 prefix. example: const char* text = u8"ヽ(⌐■_■)ノ♪♬e"; then have use multibytetowidechar convert utf8 utf16 , use in winapi. note use u8 need newer compilers vs2015. it's easier use utf16 in first place. example: const wchar_t* text = l"ヽ(⌐■_■)ノ♪♬e"; int len = wcslen(text); hglobal hmem = globalalloc(gmem_moveable, (len + 1) * sizeof(wchar_t)); wchar_t* buffer = (wchar_t*)globallock(hmem); wcscpy_s(buffer, len + 1, text); globalunlock(hmem); openclipboard(null); emptyclipboard(); setclipboarddata(cf_unicodetext, hmem); closeclipboard();

error handling - Can I mix C and C++ IO? -

intro sync_with_stdio , enabled default states internally c , c++ use same buffer streams. there no interoperability beyond that. can't example construct basic_rdbuf file , need use basic_rdbuf::open . what i'm trying do i'd use exceptions io there's problem. it's true can use strerror error message, that's way down stack. c++ io has 1 exception ( failure ) , has 1 error code ( io_errc::stream ). there no granularity, catching exception far away error occurred not helpful. here's problem. can configure throw exceptions on failbit . not failbit errors exceptions. example: try { filestr.open(":^("); if (!(file >> input)) { // error } } catch (ios_base::failure& e) { cout << strerror(errno); } this groups "bad user input" "file not exist", think bad design. ideally i'd have separation of concerns. like: try { auto file = std::fopen(...); if ( /* bad conditiona

javascript - KnockoutJS: What Does Calling applyBindings Without Arguments do? -

i'm working through -- interesting -- code didn't write, , came across requirejs module seems initialize knockoutjs instance application. define([ 'ko', './template/engine', 'knockoutjs/knockout-repeat', 'knockoutjs/knockout-fast-foreach', 'knockoutjs/knockout-es5', './bind/scope', './bind/staticchecked', './bind/datepicker', './bind/outer_click', './bind/keyboard', './bind/optgroup', './bind/fadevisible', './bind/mage-init', './bind/after-render', './bind/i18n', './bind/collapsible', './bind/autoselect', './extender/observable_array', './extender/bound-nodes' ], function (ko, templateengine) { 'use strict'; ko.settemplateengine(templateengine); ko.applybindings(); }); this code calls ko.applybindings() without view model.

Sorting on C# arrays using OrderBy -

i using orderby create new sorted array suggested in post sort array of items using orderby<> . var sorted = sharepointlist.orderby(item => item.gettaborder()).toarray(); where, sharepointlist array of objects contains attributes including int taborder , gettaborder getter 'taborder' attribute but throws below exception. please help nullreferenceexception object reference not set instance of object. thanks in advance, sagarika the problem have null value in sharepointlist . if do; var sorted = sharepointlist.where(x => x != null).orderby(item => item.gettaborder()).toarray(); it prevent exception, null values excluded result. your entire list null in case need; if (sharepointlist != null) //order in here else //handle error

php - Finder Method returning only count when calling all() -

so. want find "correct" way of doing this. retrieve a list of entries in database, format "created" , "modified" fields in nice, human readable way. in cakephp2.x, have used afterfind method. seeing there none of in cakephp3, turned blog post , found had use formatresults function. naturally, tried (and many other iterations of same thing): public function findallforview(query $query, array $options) { $test = $query->formatresults(function ($results) { $r = $results->map(function ($row) { $row['created'] = new time($row['created']); $row['created'] = $row['created']->nice(); $row['modified'] = new time($row['modified']); $row['modified'] = $row['modified']->nice(); return $row; }); return $r; }); debug($test); foreach ($test $t) { debug($t); } debug($test->all()); return $test; } the variable $test returns:

fabricjs - Fabric.js how to set opacity of lines -

using fabric.js library, can set line width , color follows: canvas.freedrawingbrush.width = 5; canvas.freedrawingbrush.color = "#f00"; is there way set opacity too? couldn't find in documentation, neither on net anywhere. instead of using hexadecimal color code, can set color use rgba , below: canvas.freedrawingbrush.color = 'rgba(255, 0, 0, 0.1)'; demo jsfiddle

swift - found nil while unwrapping an Optional value when try to hidden navigation bar -

Image
i have problem. want make if cell tapped on 1st table view, display 2nd view controller , navigation bar hidden. go 1st view controller using button code: @ibaction func backbuttontapped(sender: anyobject) { let storyboard: uistoryboard = uistoryboard(name: "main", bundle: nil) let vc: uiviewcontroller = storyboard.instantiateviewcontrollerwithidentifier("restaurant") self.presentviewcontroller(vc, animated: true, completion: nil) } but print out fatal error: unexpectedly found nil while unwrapping optional value in 2nd view controller, hidden navigation bar using this: func hiddennavbar(){ self.navigationcontroller!.navigationbar.hidden = true } and show navigation bar again on 1st view controller using : override func viewwillappear(animated: bool) { createnavbar() } func createnavbar(){ self.navigationcontroller!.navigationbar.hidden = false } my main storyboard looks this: you using wrong way go previou

asp.net mvc - Exception in executing publishing : Method not found ProjectUsesAzureAD -

Image
in vs 2015 community, while publishing mvc project error: exception in executing publishing : method not found: 'boolean microsoft.visualstudio.web.azuread.contracts.ivsazureadservice.projectusesazuread(system.string, system.string byref, boolean byref, boolean byref, boolean byref, boolean byref, )'. i reinstalled 2 times visual studio, not solved yet. any help? it seems linked windows 10 updates problem also. since did not find solution anywhere above error, decided reset os windows 10 pro. installed vs 2015 update 3. , works now.

java - How to write mouse moved event for JButton -

this question has answer here: mouse on events jbutton 2 answers i tried following program test mouse moved method of java mouse adapter class, didn't work. want increase progress bar's value 2 when move mouse on mouse on button. how can fix this? import javax.swing.*; import java.awt.*; import java.awt.event.*; class progressdemo extends jframe{ private jprogressbar progress; private jbutton mousebutton; static int x = 2; progressdemo(){ progress = new jprogressbar(jprogressbar.horizontal,0,100); progress.setbounds(50,100,500,15); progress.setstringpainted(true); mousebutton = new jbutton("mouse over"); mousebutton.addmouselistener(new mouseadapter(){ public void mousemoved(mouseevent evt){ progress.setvalue(x+=2); } }); jpanel mouse

entity framework - Getting multiple errors during Database-Migration with EF6 and .NET 4.6.1 -

getting following errors: "validation failed 1 or more entities. see 'entityvalidationerrors' property more details." @ line 89 of configuration.cs line 89 context.savechanges(); , @ end of class file: namespace model.migrations { using system; using system.data.entity; using system.data.entity.migrations; using system.linq; internal sealed class configuration : dbmigrationsconfiguration<model.applicationdbcontext> { public configuration() { automaticmigrationsenabled = false; } protected override void seed(applicationdbcontext context) { seeddata.additionalseed _additionalseed = new seeddata.additionalseed(); _additionalseed.seed_stateorprovince(context); _additionalseed.seed_countryorregion(context); _additionalseed.seed_contacttypes(context); _additionalseed.seed_currencycodes(context); _additionalse

Linux - Gradle can't delete temporary files and build fails -

when execute $ gradle :android:clean or $ gradle :android:assembledebug get failure: build failed exception. * went wrong: execution failed task ':android:mergedebugresources'. > error: not delete path '/media/naxa/<ntfs partition>/<project path>/android/build/intermediates/incremental/mergedebugresources/merged.dir/values-sk'. i'd mention project on ntfs partition. i found workaround, i'm using --continue option ignore build failures. want know why file can't removed. blocked anything? it's known issue has been fixed in studio 2.2 preview 3. can find more info in thread . if on windows , see issue, follow comment #64: there tool can use stacktrace of code opened file still hold process. tool used generate stack trace partially fixed. http://file-leak-detector.kohsuke.org/ you need run studio java agent. if on linux , using ntfs, uncomment following property in bin/idea.properties : #--------------

Showing Category And Subcategory In Laravel -

Image
i using laravel 5.2 . have 2 eloquent models this- category.php - <?php namespace app; use illuminate\database\eloquent\model; class category extends model { protected $table = 'categories'; //table name public $timestamps = false; public $incrementing = false; //for non integer primary key protected $primarykey = 'name'; protected $fillable = [ 'name' ]; public function subcategory() { return $this->hasmany('app\subcategory', 'category_id', 'id'); } } and subcategory.php - <?php namespace app; use illuminate\database\eloquent\model; class subcategory extends model { protected $table = 'sub_categories'; //table name public $timestamps = false; protected $fillable = [

java - Read a list of nonnegative integers and to display the largest integer, the smallest integer and the average of all the integers -

i have encountered problems calculating of largest , smallest number... if first number entered larger number 2nd number input, not record 1st number largest... take @ output, elaborate better.. calculation error.. & 1st input problem.. codes below! public static void main(string[] args) { int smallest = integer.max_value; int largest = 0; int number; double totalavg = 0; double totalsum = 0; int count = 0; scanner kb = new scanner(system.in); system.out.println("enter few integers (enter negative numbers end input) :"); while (true) { //loop till user enter "-1" number = kb.nextint(); //condition loop break if (number <= -1) { system.out.println("end of input"); break; } else { count = count + 1; } if (number < smallest) { //problem 1 : if 1st input num bigger 2nd input num, smallest = number; // la

html - Showing reference link in whole page -

i'm learning step step website. in navigation section, i'm linking home, us, contact us, rates, services pages using code, when link on , rates pages, whole content text page linked directing contact page. don't know what's wrong code unlink body content of page keeping regular nav link. here's code page of rates page uses same code format. post both pages' codes if necessary. thanks. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>about us: home cleaning services in sf bay area</title> <!-- custom styles template --> <link href="css/style.css" rel="stylesheet"> </head> <body> <header> <nav> <ul> <li><a href="index.html">home</li>

html - How to avoid background image stretched horizontally with CSS? -

Image
i creating login form image background. here screenshot : it looks on normal screen. when try open on 27" imac monitor, form looks terrible. here screenshot imac monitor : here css far : body.woocommerce-account #main-content { background-image: url('path/to/login-background-min.png'); background-repeat: no-repeat; background-size: 100% 100%; padding-top: 20px; min-height: 800px; } how avoid image stretched? or maybe way make respect resolution? thanks. if remove background-size: 100% 100%; not stretch anymore. to ensure entire surface area covered should use this. background-size: cover; this maybe result in piece of picture not displayed. if want entire picture , don't mind white space on left , right of picture should use this: background-size: contain; if want can use stay centered. background-position: center;

sql - MakePoint return empty result -

i have spatialite database longitutade , latitude colums text: select latitude, longitude mytable1 limit 3; 54.475|9.0422222222222 52.398055555556|13.733888888889 49.940277777778|11.576388888889 when try create geometry them them makepoint results in emtpy values: spatialite> select makepoint(longitude, latitude, 4326) mytable1 limit 3; spatialite> on table lat/lon columns text it's working. idea why? solution : cast lon/lat text columns real like update mytable2 set geom = makepoint(cast(longitude real), cast(latitude real), 4326)

java - Error message I do not understand R renjin -

i asked solution before, apparently not helped renjin rather experimental still...but maybe please translate error message plain english? maybe can determine if can reasonable hope solve problem in reasonable time or if should rather abandon renjin. here message: exception in thread "awt-eventqueue-0" org.renjin.eval.evalexception: object 'c_hclust' not found here code: private void cluster() { try { this.engine.eval("dis<-dist(mymatrix, \"binary\")"); } catch (scriptexception ex) {system.out.println(1); logger.getlogger(rworker.class.getname()).log(level.severe, null, ex); } try { this.engine.eval("clus<-hclust(dis)"); } catch (scriptexception ex) {system.out.println(3); logger.getlogger(rworker.class.getname()).log(level.severe, null, ex); } try { this.engine.eval("plot(clus)"); } catch (scriptexception ex) {system.out.println(4);

node.js - I am trying to echo the changed name on the console.. but the program quits as in when I enter the new name -

i using textbot echo name user enters , added option change name of user using set name command, program takes new name , won't print it. wondering what's wrong? here's code var builder = require('botbuilder'); var hellobot = new builder.textbot(); hellobot.add('/', new builder.commanddialog() .matches('^set name', builder.dialogaction.begindialog('/profile')) .matches('^quit', builder.dialogaction.enddialog()) .ondefault([ function (session, args, next) { if (!session.userdata.name) { session.begindialog('/profile'); } else { console.log('in else part..'); next(); } }, function (session, results) { session.send('hello %s!', session.userdata.name); } ])); hellobot.add('/profile', [

objective c - WooCommerce iOS OAuth Invalid Signature -

many people have been tearing hair out looking solution invalid signature issue when sending requests woocommerce api ios app. i have put solution here. i providing solution invalid signature issue when sending requests woocommerce api ios app. to use woocommerce in ios app, requests must authenticate using oauth 1.0. in ios, regardless of whether app being written in objective-c or swift, afnetworking makes life easier when writing requests. follow procedure setup requests: get url, oauth 1.0 consumer key , consumer secret ready. add afnetworking project using cocoapods. podfile this: source 'https://github.com/cocoapods/specs.git' platform :ios, '9.0' target 'oauthsample3' use_frameworks! # pods oauthsample3 pod 'afnetworking', '1.3.4' end save in project directory , run pod install in terminal. next step, must install afnetworking 1.3.4. that's why says 1.3.4 in podfile. next, dow

App not doing any type payment with paypal android sdk. -

* hi , have created android app in have used android paypal gateway payment . its working on test account ,but when using live client-id giving following error: 1.when using pay paypal button : "there problem setting payment .account needs valid funding source ,such bank or payment card . please visit..." when using pay credit card: "the merchant not accept payments of type" if belongs india , implement's paypal android sdk on app..please give step go live . * i not sure many apis provide debug key hash , release one. if works testing purpose, maybe have find release key... is there bank account attached paypal 1 ? or have restriction on paypal account ?

mysql - How can I get the id, min and max in the same My SQL query? -

i have 2 tables: stops , bus_route_details. stop_id stop_name 1 ‘c’ cross road junction 2 10th road 3 16th road 4 4th road (golibar) 5 600tenamentgate 6 a.d.modi institute 7 ahansari chowk 8 a.h.school 9 a.p.m.complex 10 a.t.i. 11 aai tuljabhavani chowk/lokhandwala complex 12 aakash ganga society (dharavi) the table stops stores id , name of each stop. bus_route_details table stores bus_number, stop_id of stop stops table , order in stop appears on route. first stop has order 1 whereas last stop can number 44 if route has 44 stops in total. bus_number stop_id stop_order 8 2139 30 8 351 31 8 1791 32 8 19 33 8 2 34 8 497 35 8 2024 36 8 20 37 8 404 38 8 1787 39 8 621 40 8

java - replace regular expression capture with its upper variant -

i using string.replaceall(string, string) replace regular expression. that: "test test test word".replaceall("(?i)(\\w+)", "$1") i need replace capture upper variant, there way or need use java.util.regex.matcher ? check out string method: touppercase what suggest (not tested) like: "test test test word".replaceall("[magic regex]", "$1".touppercase()) @david knipe correct (comment). other thing think of along lines of first char upper case in context messy fast. if find way, better, going leave here in case there no other alternative.

service does not stop in android -

i have developed android app enables location service , sends data server. want put control on app starting , stopping location service. i implemented alarmmanager re-start service after time. when uncheck togglebutton stop service, not work. service not stop. it's running , sending data server continuously after stopping service. i added ondestroy() method of service , on/off checking codes below. @override public void ondestroy() { // handler.removecallbacks(sendupdatestoui); super.ondestroy(); log.v("stop_service", "done"); toast.maketext(getapplicationcontext(), "service stopped", toast.length_short).show(); if (activitycompat.checkselfpermission(this, manifest.permission.access_fine_location) != packagemanager.permission_granted && activitycompat.checkselfpermission(this, manifest.permission.access_coarse_location) != packagemanager.permission_granted) { // todo: conside

responsive design - Can't hide navigation when screen gets smaller -

i wan't hide nav , made img smaller when screen gets smaller 750px . example code this doesn't work: @media (max-width: 750px) header#site-header a.logo img margin: 15px height: 25px nav display: none and does: @media (max-width: 750px) header#site-header .container a.logo img margin: 15px height: 25px nav display: none the stylesheet before media queries overwriting styles. specifying direct path element gets higher priority , work. or can place !important give higher priority.

c++ - Return void or reference to self? -

given following class: struct object { int x, y; void addtoall( int value ){ x += value; y += value; }; object& addtoall( int value ){ x += value; y += value; return *this; }; }; what difference between 2 member functions? i understand returning reference self required operator overloads (e.g: operator+= ), excluding operator overloading, necessary? if not, when want or need return reference self opposed returning void? i apologize if found via google-fu, or basic question, wasn't sure search (and not lack of trying). what difference between 2 member functions? the function returning reference instance can chained when called like object o; o.addtoall(5).addtoall(6).addtoall(7); if useful depends on actual use case, it's used develop called domain specific language syntax.

angularjs - add active class to menu item clicked add remove from others -

i want add isactive class item menu when user click on item, , remove isactive class others items. trying compare id, angularjs code: $rootscope.isactive = function(idval, event){ return idval === event.target.id; } this part menu html code: <ul class="sidebar-nav"> <li> <a ui-sref="" id='101' ng-class="{active: isactive($event, 101)}"> <span class='glyphicon glyphicon-ban-circle glyph-sidebar'></span> rules </a> <ul class='dropdown sidebar-nav-dropdown' > <li> <a href="">transaction mapping</a> </li> <li> <a href="">file setup</a> </li> <li> <a href="">code setu

java - Different One-time screens -

i wondering one-time screens. i'll need use few one-time screens on app. first of all: one-time screen, saves user selection 3 options (i use image buttons) , let him go further, next time user comes activity, opens activity of option user selected earlier. i know need use code sharedprefences , saving sd-card/app memory. yeah, should consider simple state machine design. say created enum , eruntimestate , has 2 components; enum eruntimestate { initialize, been_initialized; } you can view useful example of saving data using sharedpreferences here , if need reminder. when using sharedpreferences , you're able query existing storage flag application, , if variable hasn't been set before, can set it's default value. so, when application first runs, can use sharedpreferences check saved instance of eruntimestate , using initialize default picked if there's no existing save data. once done, can use eruntimestate you've fetched configure

javascript - ng-repeat fails to execute correctly angularjs -

so i'm new angular , i'm trying take json collection obtained restful call , loop through each 1 display value while associating designated id in href. below find have tried: <div class="span2"> <!--sidebar content--> search: <input ng-model="query"> sort by: <select ng-model="orderprop"> <option value="name">alphabetical</option> <!--option value="age">newest</option> <option value="-age">oldest</option--> </select> </div> <div class="span10"> <!--body content--> <ul class="documents"> <li ng-repeat="document in documents | orderby:orderprop" class="thumbnail"> <a href="#/rest/{{document.document_id}}">{{document.title}}</a>