Posts

Showing posts from July, 2014

c# - StackTrace, line info of fluent call -

given following fluent api calls: foo() .bar1(() => { ... }) .bar2(() => { ... }) .bar3(); i want determine code file , line number of bar1, bar2 , bar3 lines later down (eh... up) call stack... case 1: ...inside bar1/bar2/bar3 extension methods. my current solution: create stack trace inside methods , find information. open problems: line information belongs foo() line, not bar#(...) -line :( case 2: ...later on, somewhere else in code, in case given delegate throws exception when executed. my current solution: examine stack trace of exception , find correct line : ) special case 3: bar3 defines delegate inside method, still want .bar3() line when such delegate throws exception. my current solution: don't know yet, delegate created somewhere else , can't use same method in case 2. chance information case1, however, information not correct (wrong line number). q: know how determine correct code file , line number in 3 cases?

objective c - EXC_BAD_ACCESS (code = 2, adress = 0x0) while changing value of boolean -

what i'm trying do in app, got sql-lite database wrote methodes. callback of method boolean. true = write data, false = not write data. code dosn't show error's in x-code should right. question in method define boolean , set null. afterwards have if-clause, check's if data written db, , change defined boolean true or false. throws me error: exc_bad_access (code = 2, address = 0x0) the point is, don't understand why error coming along. guys please tell me, i'm doing wrong , how can solve it. you'll find code down here: code - (bool *) createlogin:(nsinteger *)user_id usr: (nsstring *)username pwd: (nsstring *)password date: (nsdate *)last_login{ bool *returnvalue = null; self.ivo_db = [[ivo_database alloc] init]; if((sqlite3_open_v2([[ivo_db getwritabledatabase] utf8string], &sqldb, sqlite_open_readwrite, null) != sqlite_ok)){ nslog(@" %s couldn'

Issue in installation of mxnet package in R -

mxnet package not installing in r (on windows 10) when follow steps given in documentation. install.packages("drat", repos="https://cran.rstudio.com") drat:::addrepo("dmlc") install.packages("mxnet") it gives following result installing package ‘c:/users/ashish/documents/r/win-library/3.3’ (as ‘lib’ unspecified) warning in install.packages : cannot open url ' http://dmlc.github.io/drat/bin/windows/contrib/3.3/packages.gz ': http status '404 not found' warning in install.packages : cannot open url ' http://dmlc.github.io/drat/bin/windows/contrib/3.3/packages ': http status '404 not found' warning in install.packages : unable access index repository http://dmlc.github.io/drat/bin/windows/contrib/3.3 : cannot open url ' http://dmlc.github.io/drat/bin/windows/contrib/3.3/packages ' package available in source form, , may need compilation of c/c++/fortran: ‘mxnet’ wa

wordpress - Redirecting whole website by htaccess -

i using wordpress , trying redirect whole website new domain. want website structure remain same in way: "www.domain.com" redirected to "www.domain.ca" "www.domain.com/post1" redirected "www.domain.ca/post1" as site of wordpress htaccess has commands. haven't changed commands added more site home page starts redirects not whole site.according research "rewriterule ^(.*)$ ..." lets whole website redirect unfortunately not. of htaccess code given below. have replaced domain names in code. old domain: www.domain.com new domain: www.domain.ca # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress rewritecond %{http_host} ^domain\.com$ [or] rewritecond %{http_host} ^www\.domain\.com$ rewriterule ^(.*)$ "http\:\/\/www\.domain\.ca/$1

Realm objective c - array of array -

i have features in product json. list of strings. but, have localized. so, becomes array of array. i not able array of array in realm. can suggest me how can achieve in realm objective-c ? { "name" : "product 1", "features" : [ [ { "locale" : "en", value : "feature1"}, { "locale" : "cn", value : "feature1 in cn"} ], [ { "locale" : "en", value : "feature2"}, { "locale" : "cn", value : "feature2 in cn"} ] ] } thanks by modifying json slightly, either @ source or part of mapping step in code, can pass directly realm's kvc initialization mechanism: { "name": "product 1", "features": [ [[ { "locale": "en", "value": "feature1" }, { "locale": "cn", "value": "feature1 in cn" }

c++ - Conversion in template from Classes inherit a base class to base -

i have node template link list. want create in restaurant project list of item use node linked list reference counter, special inherit beverage , edible. bevrage , edible inherit item. have menu have dishes include 3 class , need change or add dish manager. problem because can't convert class base node<item>* . i want use function addnewtitem() ; #ifndef menue_h #define menue_h #include "node.h" class menue { public: menue(); node<item>* _head; void deleteitem(node<item>* item); node<item>* getitem(int i); void addnewtitem(node<item>& nextnode) {if(_head) _head->addnode(nextnode); else _head=nextnode;} void printmenue(); void deleteitem(int i); ~menue(); protected: private: }; #endif // menue_h call class #ifndef meneger_h #define meneger_h #include "node.h" #include "waiter.h" #include "menue.h" class m

FIWARE Orion and pep proxy solutions? -

from orion documentations has been mentionned 2 available pep proxy wilma , steelskin. want list available options there other open source solutions securing fiware orion? thanks in advance help. orion http service, can use protect http services fine. best solution depends on deployment scheme. within fiware have 2 mentioned: wilma , simple, works keystone; steelskin , more advanced, works keystone or openstack keyrock. other options may include: nginx , typically used performant proxy , has authentication modules well; squid , widespread proxy , supports authentication; apache , has widespread proxy , authentication modules, although bottleneck of system.

c - Set or Reset a given bit without branching -

in 1 interview, asked me, how set or reset bit? simple question , answered that. after asked me, without branching . dont know branching. search , came here http://graphics.stanford.edu/~seander/bithacks.html but still not getting concept of branching , non-branching. please explain branching . branching means instructions cpu executes contain conditional jump. either-or choice. mean if , for -loop, while -loop, switch , ?: or makes decision based on boolean. one class of branches people forget short-circuiting boolean operators , possibly (but not on cpus) things evaluate truth values, int foo; ...; foo = !foo; branch on cpus, not (not on x86). so set bit: i |= (1 << bit); reset bit: i &= ~(1 << bit); toggle bit: i ^= (1 << bit); no branches. don't see how make complicated have use branch. the reason why might want worry branches branch prediction. see question , answer excellent explanation of why matters.

swift - How to show UITableViewController as a UIPopover ViewController -

i need show pop on tableview controller. i using following code presenting pop on func showpopover() { let secondstoryboard = uistoryboard(name: "second", bundle: nil) viewobj = secondstoryboard.instantiateviewcontrollerwithidentifier("viewcontroller") as! viewcontroller viewobj.modalpresentationstyle = uimodalpresentationstyle.popover viewobj.preferredcontentsize = cgsizemake(400,500) let popoverpresentationcontroller = viewobj.popoverpresentationcontroller popoverpresentationcontroller?.delegate = self popoverpresentationcontroller?.sourceview = self.view //walletbutton popoverpresentationcontroller?.sourcerect = cgrectmake(0, button.frame.origin.y+100, 0, 0) presentviewcontroller(viewobj, animated: true, completion: nil) } //mark:- uipopoverpresentationcontrollerdelegate methods... starts func adaptivepresentationstyleforpresentationcontroller(controller: uipresentationcontroller) -> uimodalpresentationstyle{ return uimodalpresentatio

php - Change URL on Wordpress -

i have been working on wordpress site. www.example.com , main homepage of site( index.html ) says "we're under construction etc." , it's image. for development of website, have been using different directory - www.example.com/dev , have developed has been under /dev ( /dev/index.php etc.) the website ready , need point finsihed website ( www.example.com/dev ) actual public site(which under www.example.com ) have finished. how go this? this can done 2 ways, you can changing site_url in options table. once transfer data , change url site should running on new url. if have stored static urls in post or pages then, have change well. export sql file phpmyadmin. find , replace urls old new ones. note: keep current development site working as, it's possible contact form 7 or data gets missing. example, widgets in inactive mode sometime. once new website confirmed can remove old website.

Copy all tables and charts from all sheets of Excel to PowerPoint -

i need code snippet copy charts , tables excel file sheets powerpoint file using macro (vba) in excel. below code copies charts. want copy tables , charts , images. sub pushchartstoppt() 'set reference 'microsoft powerpoint 12.0 object library' 'in vbe via tools > references... ' dim ppt powerpoint.application dim pptpres powerpoint.presentation dim pptsld powerpoint.slide dim pptcl powerpoint.customlayout dim pptshp powerpoint.shape dim cht chart dim ws worksheet dim long 'get powerpoint application object: set ppt = createobject("powerpoint.application") ppt.visible = msotrue set pptpres = ppt.presentations.add 'get custom layout: each pptcl in pptpres.slidemaster.customlayouts if pptcl.name = "title , content" exit next pptcl 'copy charts in chart sheets: each cht in activeworkbook.charts set pptsld = pptpres.slides.addslide(pptpres.slides.count + 1, pptcl) pptsld.select each p

wget - Install packages via yum without internet in centOS7 -

i guess there 2 metods same method 1:centos dvd iso yum repository step 1:download/transfer centos dvd iso which not working me. i used command via wget http://mirror.lihnidos.org/centos/7/isos/x86_64/ centos-7-x86_64-dvd-1511.iso but downloading html file not iso file 2nd method custom yum repository maybe because there space in command ? use this wget http://mirror.lihnidos.org/centos/7/isos/x86_64/centos-7-x86_64-dvd-1511.iso oh, , can download package want in .rpm format, , use command : yum install mypackage.rpm make sure edit "mypackage" name of file :)

android - Set toolbar to FragmentActivity -

there similar lots of questions tried didn't help. followed splash screen app shows activity viewpager . called activity fragmentcontainer because contains viewpager. because fragmentcontainer extends fragmentacitity cannot use setsupportactionbar() set custom toolbar. fragment_container.xml this: <relativelayout> <com.astuetz.pagerslidingtabstrip android:background="?attr/colorprimary" android:id="@+id/tabs" android:layout_below="@id/toolbar_top_fc" android:layout_height="?attr/actionbarsize" android:layout_width="match_parent" android:textcolorprimary="@android:color/white" app:pstsindicatorcolor="@color/coloraccent" app:pstspaddingmiddle="true" app:pststabpaddingleftright="24dp" /> <android.support.v4.view.viewpager android:id="@+id/pager" android:layout_

entity framework - What is the difference between EntityTypeConfiguration and DbMigration for a new EF project -

should use entitytypeconfiguration build data model, or should directly enable migrations use dbmigration . that use : public class blogefcfconfiguration : entitytypeconfiguration<blog> { public blogefcfconfiguration() : base() { haskey(x => x.blogid); property(x => x.blogid).hasdatabasegeneratedoption(databasegeneratedoption.identity); property(x => x.name).hascolumntype("varchar").hasmaxlength(128); } } or public partial class initialcreate : dbmigration { public override void up() { createtable( "dbo.blogs", c => new { blogid = c.int(nullable: false, identity: true), name = c.string(maxlength: 128, unicode: false), }) .primarykey(t => t.blogid); } public override void down() { droptable("dbo.blogs"); } } indeed if want change model have us

git - Can't start my app using the Bluemix Live Sync "bl start" command -

Image
i want start coding git , have followed instructions here: https://new-console.ng.bluemix.net/docs/develop/bluemixlive.html using " bl sync " command created , synced bluemix project in windows local directory shown in screenshot below. name of project "speak out". " bl sync " command but when checked status " bl status ", message returned saying project had not been set on machine , needed run sync command. " bl status " command i have installed bluemix live sync v1.0.7, node.js v.5.8.0, , using windows 10. have tried restart computer update execution path, nothing changed. can me solve problem starting app bluemix live sync? i noticed there spaces in project name "speak out". attempted reproduce problem creating own project space character in name. ran bl sync , bl status on both windows 10 , mac os x. in both cases bl sync succeeded , bl status failed, although not in same way yours. suspect the

jquery - window.resize not working as reloading the resized window -

here piece of jquery loading href link window resized less 767, working fine, disappear want hide , show want see, click on reload button of browser puts webpage same should not on window width of below 767. not working refresh resized web page. $(window).bind('resize', function(e){ width = $(window).width(); if (width < 767){ $("a.collapselistbt").show(); // here if ($('.content-box-right').hasclass('show')){ $('.content-box-right').removeclass('show'); } } else{ $("a.collapselistbt").hide(); $('.content-box-right').addclass('show'); } }); please suggest how keep still , not let move setting fixed window width of 767 add javascript $(document).load(function(e){ width = $(window).width(); if (width < 767){ $("a.collapselistbt").show(); // here if ($('.content

java - How can we call onActivityResult on three classes? -

in code there 3 class called onactivityresult in "activity a" goes "activity b" "activity c" , in activity c call finish(); by calling finish doesn't go "activity " how can call this? just call final intent intent = new intent(activityb.this, activityc.class); startactivity(intent); finish(); when going activityb activityc on button click or other click of view in activityb

Android : filter many CAN IDs when monitoring CAN Data with ELM 327 throught Bluetooth -

i developping android app display can data using elm 327 in bluetooth. following elm 327 datasheet , can filter received data sending @ cra hhh (hhh = can id) before monitoring @ ma. objective display data specific can ids (for example 7a2, 250, 420...). try send many @ cra hhh commands last 1 used elm. question is: how can set many can id filters elm327? the elm accepts can filter , maks commands @ cf , @ cm, solution? cra hhh convenient way set mask , filter allowing receive messages single can id. for example, at cra 123 is equivalent to at cf 123 @ cm 7ff so, yes, right, receive list of specific can ids, have use @ cf , @ cm commands , forge specific (filter,mask) pair according needs.

python - What is the difference in *args, **kwargs vs calling with tuple and dict? -

this question has answer here: what ** (double star/asterisk) , * (star/asterisk) parameters? 12 answers this basic question. there difference in doing def foo(*args, **kwargs): """standard function accepts variable length.""" # foo(v1...vn, nv1=nv1...nvn=nvn) def foo(arg, kwargs): """convention, call tuple , dict.""" # mytuple = (v1, ..vn) mydict = {nv1=nv1, ...nvn=nvn} foo(mytuple, mydict) i same thing both, except later has weird convention of creating tuple , dictionary . there difference? can solve same computational problem of handling infinite things because dict , tuple can take care of me anyway? is more of idiomatic part of python i.e syntactic sugar things anyway? i.e function going handle you! ps: not sure of many downvotes though agree copy of why use packed *args

eclipse - Save WizardPage Settings with Java -

i created wizard wizardpage exporting files in folder. how can save last selected folder in wizard? if user opens wizard again, options selected last time should written in there. you try following: 1. retrieve dialogsettings object. 2. find section. if null, create it. 3. use store/load related information. idialogsettings settings = workbenchplugin.getdefault().getdialogsettings(); idialogsettings section = settings.getsection("your_section_name"); if (section == null) { section = settings.addnewsection("your_section_name"); } string lastselectedfolder = section.get("your_last_selected_folder_key");

android - MPAndroidChart RadarChart collapses itself -

Image
i have problems radarchart labels. specifically, if use long texts (e.g. 15-20 chars), , available space not big, chart gets collapsed , labels positioned inside collapsed chart (but there more space available). i tried use valueformatter label axis truncates labels if longer 5 chars, see, chart size calculaction based on full label text, chart got collapsed same way described before. xaxis xaxis = radarchart.getxaxis(); xaxis.setvalueformatter(new xaxisvalueformatter() { @override public string getxvalue(string original, int index, viewporthandler viewporthandler) { return original.length() > 5 ? original.substring(0, 5) + "…" : original; } }); here pictures clarify problem. charts displayed inside cardview s , can see, there plenty of space remaining on sides. first 2 pictures taken valueformatter set, last 2 without it. probably having mistakes, here solutions: 1) set radar data after set radarchart parameters call in

How can I get more exact data-points from a visual studio load test? -

when load-testing in visual studio results reported snapshots of data using resolution in time indicated sample rate parameter. find desirable way @ results. more useful have actual timestamp of when happens rather timestamps constant interval. example page response time more useful have timestamp of when response received. i obtain data exporting graphs csv. gives me data in form: "elapsed time","page1time","page2time" "00:00" , "", "" "00:05" , "", "" "00:10" , "0,36325", "" "00:15" , "", "0,2825" because of constant time-intervals used there large gaps in data no data points, general poor accuracy. rather prefer have timestamp each datapoint every page time contains both response time , timestamp: "timestamp1","page1time","

ios - I want cache images without show them in any imageView how do this i want do progress while I´m change to use the by url later -

sdwebimagedownloader *downloader = [sdwebimagedownloader shareddownloader]; [downloader downloadimagewithurl:[[nsurl alloc] initwithstring:url] options:0 progress:^(nsinteger receivedsize, nsinteger expectedsize) { // progression tracking code } completed:^(uiimage *image, nsdata *data, nserror *error, bool finished) { if (image && finished) { }}); try one: -(uiimage *)downloadimageasync:(nsstring *)imagekey { nslog(@"image key : %@",imagekey); __block uiimage *returnedimage; sdwebimagemanager *manager = [sdwebimagemanager sharedmanager]; [manager downloadwithurl:[nsurl urlwithstring:imagekey] options:0 progress:^(nsuinteger receivedsize, long long expectedsize){ ns

celery - Is there a way to trigger a task that will run on the same server? -

Image
i have many celery nodes running on different linux boxes. simplified cluster looks like: i have long-running taska downloads (huge) file remote file-server, , want trigger taskb once taska finishes job on same machine because taska downloaded file input taskb . know celery supposed distributed, in cases, 1 having true distributed solution expensive. notice in diagram taska on nodea triggers taskb on same node, while taska runs on nodeb triggers taskb on nodeb (same node runs "parent" task). apply() not work because want queue taskb() run when there spare worker process (on same node!) it. i started exploring possibility of having unique queue on each node (so nodea has queuea, nodeb has queueb, etc), not know how available queue names taska can queue task on queue on same node. (this solve problem.) i trying find solution in celery documentation, not find helps me. idea appreciated. you trigger taskb in withing taska directly using apply method

Docker Swarm - strategy doesn't seem to have any effect -

i have provisioned swarm master , swarm nodes docker machine (as described here ). working fine; machines created , running, have been discovered , accepts containers. the output 'docker-machine ls' is: $ docker-machine ls name active driver state url swarm docker errors default - virtualbox stopped unknown local - virtualbox stopped unknown my-swarm * (swarm) digitalocean running tcp://104.131.161.197:2376 my-swarm (master) v1.11.1 node0 - digitalocean running tcp://104.236.29.169:2376 my-swarm v1.11.1 node1 - digitalocean running tcp://104.236.216.164:2376 my-swarm v1.11.1 the problem i'm having distribution of containers. no matter strategy set swarm, seems di

how to represent "sub-sequences" in uml sequence diagrams? -

in activity diagrams, can have top level activity diagram contains sub-activity diagram. useful sub-activity contains lots of details don't want show in top level activity diagram. is similar concept available sequence diagrams? basically, have sequence diagram want hide of details in diagram moving details sequence diagram. this can achieved using <<ref>> fragment in sequence diagram, references sub sequence diagram. see example picture : http://www.ibm.com/developerworks/rational/library/content/rationaledge/feb04/3101_figure11.jpg balance lookup , debit account references other sequence diageams may in turn contain plenty of lifelines , calls.

c# - Get files in directory with multiple search patterns -

i have method gets files in specified directory extension txt . besides files, want files extensions ppt , docx etc. how achieve that? this current code: private void button2_click(object sender, eventargs e){ listview1.items.clear(); if (textbox1.text != ""){ list<string> files = new list<string>(); files = directory.getfiles(textbox1.text, "*.txt,*.ppt").tolist(); progressbar1.maximum = files.count; progressbar1.value = 0; listviewitem it; foreach (var file in files){ = new listviewitem(file.tostring()); it.subitems.add(system.io.path.getfilename(file.tostring())); it.subitems.add(system.io.path.getextension(file.tostring())); listview1.items.add(it); progressbar1.increment(1); } } else messagebox.show("select directory first"); } your question not clear understand want files different extension specified path. can't using directory.getfiles("c://et

c# 4.0 - not ab;e to restore database from .bak file -

i habe taken backup of sql server ce database not able resotore it. try { string filename = "tapedatabase.sdf"; string sourcepath = backuppath; openfiledialog ofd = new openfiledialog(); ofd.showdialog(); string fn = ofd.filename; string restorepath = path.getdirectoryname(system.windows.forms.application.startuppath); string sourcefile = system.io.path.combine(fn); string destfile = system.io.path.combine(restorepath, filename); try { system.io.file.copy(sourcefile, destfile, true); messagebox.show("database restored to: " + destfile, "info"); } catch(exception epp) { messagebox.show("database not restored"); }

java - Failed to import bean definitions from URL location [classpath:applicationContext-core.xml] -

i'm working on java project spring on eclipse using maven, , running on tomcat server v6.0. working fine since yesterday morning. here problem : i'm building project, got build success. start tomcat server , got error : org.springframework.beans.factory.parsing. beandefinitionparsingexception : configuration problem: failed import bean definitions url location [classpath:applicationcontext- core.xml] offending resource: servletcontext resource [/web-inf/applicationcontext.xml]; nested exception org.springframework.beans.factory. beandefinitionstoreexception : ioexception parsing xml document class path resource [applicationcontext-core.xml]; nested exception java.io. filenotfoundexception : class path resource [applicationcontext-core.xml] cannot opened because not exist i found out similar problem on website none of them give me solution worked me. it seems eclipse isn't able find applicationcontext-core.xml when i'm doing : <

android - green dao update column on play store update has taken place -

this generator class public class generator { public static void main(string[] args) throws exception { schema schema = new schema(1, "app.abc.db.dao"); createabcdb(schema); } private static void createabcdb(schema schema) throws ioexception, exception { entity abc = schema.addentity("abc"); abc.addidproperty(); abc.addshortproperty("name"); } } this code abc dao dao session. works fine. daomaster.devopenhelper devopenhelper = new daomaster.devopenhelper(surveyactivity.this, "abc.db", null); sqlitedatabase db = devopenhelper.getwritabledatabase(); daomaster daomaster = new daomaster(db); daosession daosession = daomaster.newsession(identityscopetype.none); abcdao = daosession.getabcdao(); i added 1 more column abc.addshortproperty("email"); to createabcdb in generator new version of app. once users updated getting sql exception sayi

html - Style bootsrap radio buttons via images -

i attempting style radio buttons using images, via background-color property. using bootstrap, code sequence looks this: <div id="something"> <div class="radio"> <label> <input id="some_id" value="yes" type="radio"> yes </label> </div> <div class="radio"> <label> <input id="some_id2" checked="" value="no" type="radio"> no </label> </div> </div> what want edit it's icons checked, unchecked, focused, checked-focused , disabled states. don't want text have background, icon in front of it. css: .radio label { line-height: 40px; min-height: 40px; } .radio label{ background-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/google_%22g%22_logo.svg/1024px-google_%22g%22_log

ios - Swift - Method chaining -

i'd implement method chaining in swift code, alamofire methods. example, if have use function below getlistforid(12).success { // success block }. failure { // failure block } how create function getlistforid ? to expand on great points @dasblinkenlight , @sulthan have made – here's small example of how achieve request function take success , failure closure, in convenient syntax want. first, you'll have define new class represent 'result handler'. success , failure functions pass around, allowing add multiple trailing closures make completion block logic. you'll want this: class resulthandler { typealias successclosure = requesthandler.output->void typealias failureclosure = void->void // success , failure callback arrays private var _successes = [successclosure]() private var _failures = [failureclosure]() /// invoke stored callbacks given callback result func invokecallbacks(result:requesth

php - How to store multiple parameters passed as POST in database -

i have passed json encoded parameters post have captured , decoded in php file. have used following code that. $entitybody = file_get_contents('php://input'); $entitybody = json_decode($entitybody, true); i have passed json encoded parameters follows: { "id": "5", "name": "abcd", "imei": "1234" } actually number of parameters passing post may 15 20 going insert in table i.e. each of them field in table in mysql database. new json , php. method know value of each parameter after checking whether set following: if(isset($entitybody['id'])) ... elseif(isset(...)) ... it clear there many if , else when there many parameters. there way can store parameters in table in more efficient way. if helps me in doing grateful. use json_decode function parse json array or object. $a = json_decode($entitybody); $a->id; refer http://php.net/manual/en/function.json-decode.php

javascript - Jquery mobile, creating a bar down side of page (photo's) -

Image
i trying create sort of thin bar running down edge of page mobile app, based on jquery mobile. it's purpose alert people presence of side panel can pull out. have attached images explain point better since jqm uses page content footer system, unclear me how this. have heard of creating sidebar content-secodary seems on kill , i've heard behaves differently on phone opposed tablets. intro i made few months ago, difference pull button don't have height set 100%. this solution tested on: desktop chrome desktop firefox mobile android chrome only thing need change button height. working example jsfiddle example can found here: http://jsfiddle.net/gajotres/qgdst/ code html <!doctype html> <html> <head> <title>jqm complex demo</title> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no; target-densitydpi

php - Symfony 3 : Change the locale for all pages -

i change locale pages on symfony. i tried : $req->setlocale('fr'); but when go other page locale set default again. i know possible link "domaine/fr/get" don't want have different links each languages... :/ i wondering if possible set default locale depending on ip's country. you can setting default locale. # app/config/config.yml framework: default_locale: fr to advanced control on how make locale sticky during user's session or set locale based on ip, can create localelistener , covered in cookbook entry.

c# - Crash when gerate click by a button in an empty gridview list -

when gerate click in gridview code : datagridview1_cellclick(datagridview1, new datagridviewcelleventargs(0, 0)); on empty gridview, error occurs: "an unhandled exception of type 'system.argumentoutofrangeexception' occurred in mscorlib.dll additional information: index out of range. must non-negative , less size of collection." on line of code: datagridviewrow row = this.datagridview1.rows[e.rowindex]; my question how avoid error? thank you! in datagridview1_cellclick , need check index greater 0 before attempt access element rows . private void datagridview1_cellclick(object sender, datagridviewcelleventargs e) { //don't want execute when column header/row clicked (oob) if (e.rowindex < 0 || e.columnindex < 0) return; datagridviewrow row = this.datagridview1.rows[e.rowindex]; }

java - How To Load Servlet Result Page in Div? -

i have following situation: there left side menu in web application, when user clicks link of menu specific page opened in specific div. specific div working content page. for example there password changing link, when click it, displayed on content div. every page done .jsp format , each page have error , success pages. example if have changepassword.jsp have changepassworderror.jsp , changepasswordsuccess.jsp, used display error , success messages. i'm using servlets information , handle , redirect on correct page. example if user want change his/her password , goes fine directed changepasswordsuccess.jsp servlet , if error directed changepassworderror.jsp. when opened own page it's silly have provide link user return main page. if error message, error page opened own page obvious. my question how can direct user servlet main page result page of servlet displayed in content div? meaning if user directed success page, success page displayed on main page's

c# - How to Shim ExecuteReader with MS Fake -

i trying test method below error in line using (var reader = command.executereader()) connection must opened , available. not able shim method , return fake reader. method test public emailtemplatefiltermodel[] getemailtemplatefilters() { var filterlist = new list<emailtemplatefiltermodel>(); using (var connection = new sqlconnection(_clientconnstring)) using (var command = connection.createcommand("cspgetinvoicetemplatefiltercollections")) { if (connection.state != connectionstate.open) connection.open(); using (var reader = command.executereader()) { while (reader.read()) { var filter = new emailtemplatefiltermodel { parmid = (int)reader["invoiceemailmapparmid"],

netezza - Sum of Rows - SQL query -

i need develop sql query following: column column b row1 2861682 sum(row1 row5) row2 2522226 sum(row2 row5) row3 2285983 sum(row3 row5) row4 2096046 sum(row4 row5) row5 1935355 sum(row5) this data have in table column. now need calculate sum(row1 row5) sum(row2 row5) sum(row3 row5) sum(row4 row5) sum(row5) thanks the standard sql form uses correlated subquery: select t.*, (select sum(b) t t2 t2.a >= t.a ) thesum t; some databases support window/analytic functions allow cumulative sums. edit: netezza 1 of databases support cumulative sums using window functions (thanks postgres heritage, imagine). can express as: select t.*, sum(b) on (order desc) thesum t edit ii: i don't have netezza database test on, have rowid column. might able use this, although cannot find documentation guarantees being monotonically increasing. in fact, i'm prett

php - Phinx init does not work -

i install phinx db migrations in project, documentation commands not work. @ first impossible run php vendor/bin/phinx init because phinx not php commant. ok went bin directory , run phinx.bat generated yaml config file bin folder not root dir says in documentation, bin directory. should correct installation? so problem on windows , need write windows separator command works: vendor\bin\phinx init

elasticsearch - Multiple Non-Nested Aggregations -

is there way multiple non nested aggregations on fields in elastic search? of aggregations child or parent, on same level. { "size": 0, "aggs": { "one": { "terms": { "field": "a" }, "aggs": { "two": { "terms": { "field": "b" }, "aggs": { "three": { "terms": { "field": "c" } } } } } } } } elasticsearch has broadly 3 types of aggregations. bucket - allows form "buckets" of different types. terms (on not_analyzed string fields), time intervals

java - How to block application launch in Android -

i want create application in android show devices list of applications , allow user select apps want restricted access period of time. i aware there android application named "appblock" don't know how works. you select app, period of time , doesn't allow open app. you cannot block start of application. way see possible: need save list of applications info in app need blocked time when need blocked. implement service runs "forever" , detects started applications. refer this answer how it. on each detection should check if application present in database , if time says need blocked. if - close application. refer this answer learning how it. global architecture think should follow.

cookies - How to maintain session in swagger editor -

i using swagger building api documentation. new it. doing logging in first , giving call list api. session, cookies not maintained, list call not getting executed. need first login application , give call list. how can in swagger editor http://editor.swagger.io/#/ thankyou i spent time struggling same question , far can tell swagger editor not make api calls xhr.withcredentials = true , means browser not send cookies if server's cors policy allows it. there's been discussion of updating swagger editor allow option (e.g., https://github.com/swagger-api/swagger-js/issues/251 ), doesn't appear has been done quite yet. your best option avoid entire cross-origin security issue hosting swagger editor on own domain. 1 of suggestions: https://github.com/swagger-api/swagger-editor/blob/master/docs/cors.md#host-swagger-editor-in-your-own-domain . run if 1 of own apps on dev site. another suggestion disable chrome web security: https://github.com/swagger-api/swagg

database - How to load data from azure to a xamarin form using data binding -

Image
i having problem loading data azure database xamarin forms listview. problem have gettaskasync statement, have modified controller , builds gives me system. tpyeinitializationexception error message when try data db. template, used todo list example way data both share same db without luck. advice appreciated. please if can point out went wrong or have examples can see better idea on problem appreciate it. in advance. public partial class continentcontroller { static continentcontroller defaultinstance = new continentcontroller(); mobileserviceclient client; imobileservicetable<continent> continenttable; private continentcontroller() { this.client = new mobileserviceclient( constants.applicationurl); this.continenttable = client.gettable<continent>(); } public static continentcontroller defaultmanager { { return defaultinstance; } private set {

javascript - Display custom user name and password modal dialog with Plaid Link -

i'm using plaid link custom integration , far able pull list of institutions. great because don't have hardcode list of institutions , can display custom modal dialog selection institutions. now next step let user enter credentials public_token , metadata through onsuccess callback. plaid link wants me call linkhandler.open type of selected institution passed in, display plaid modal dialog allows user enter credentials , confirm. onsuccess callback called. but if want let user enter user name , password through custom modal. there linkhandler.auth(username, password) cause onsuccess called in similar manner, without displaying modal dialog can't style? here's snippet, it's copy pasted docs, no surprises there: let plaidlink = plaid.create({ env: "tartan", clientname: "", key: "blahblahblah", // correct public key. product: "auth", onload: () => { console.debug("onload"); }, on

docker - amazon ecs Container for Configuration files -

at moment try figure out setup application in amazon ecs. my application needs config file. want have container hold config file when want change don't need redeploy application. i can't find best practice method this. found out ecs tasks make docker run , can't make docker create . does have idea how can manage config files applications? most using docker overkill. how complex data? if it's simple key-value pairs use dynamodb , rid of file completely. option using efs file, or attaching/detaching ebs volume.

maven - how to remove stackstrace from surefire report & include sys output? -

i'm exeuting test suite of junit tests using maven & i'm using surefire plug-in reporting , have customize reports ...so how remove stacks trace information surefire report & rather include / print sys output in generated report written in scripts ??

When coding a Java class in Eclipse, is it possible to insert a URL hyperlink to a webpage..? -

i coding java class in eclipse. in commented lines, insert clickable url hyperlinks point web pages on internet. note: not javadocs document, it's regular .java class file. is possible..? if so, how..? thanks. in eclipse, can paste link comment, hold down control , click it. if want able press without holding down, go window -> preferences -> general -> editors -> text editors -> hyperlinking, click on url , remove modifier key, click apply, click ok , you're done!

windows - Linphone configuration results in multiple undefined Autotools macros -

i have downloaded linphone opensource , build using mingw. have followed steps given readme.mingw. when use command "./autogen.sh", got following error. + aclocal -i m4 -i /usr/local/share/aclocal -i /share/aclocal aclocal:m4/po.m4:36: warning: macro `am_path_prog_with_test' not found in librar y aclocal:m4/po.m4:61: warning: macro `am_path_prog_with_test' not found in librar y aclocal:m4/po.m4:78: warning: macro `am_path_prog_with_test' not found in librar y aclocal:m4/gettext.m4:170: warning: macro `am_iconv_link' not found in library configure.ac:185: warning: am_nls m4_require'd not m4_defun'd m4/intltool.m4:27: it_prog_intltool expanded from... configure.ac:185: top level configure.ac:194: warning: am_nls m4_require'd not m4_defun'd m4/po.m4:23: am_po_subdirs expanded from... m4/gettext.m4:57: am_gnu_gettext expanded from... configure.ac:194: top level configure.ac:194: warning: ac_lib_prepare_prefix m4_require'd not m4_defu n