Posts

Showing posts from February, 2015

Problems with jQuery Cycle + Caroufredsel -

i have created jquery cycle/maximage2 gallery, while using caroufredsel carousel thumbnail navigation, caroufredsel isn't firing until resize browser window reason. have tried wrapping cycle in $(window).load(function() { and wrapping caroufredsel in $(document).ready(function() { to see if still no change. js fiddle below: (resize internal browser see fire). http://jsfiddle.net/azgja/2/

ios - How does Navigation Controller work with Split View Controller under the hood? -

i have difficulty understanding behavior on iphone(portrait). several cases: no navigation controller both master , detail, shows master in beginning. if master embedded in navigation controller, shows detail first, yet can go master through navigation bar. question: master 1 embedded in navigation controller, isn't supposed controller on navigation stack? how detail navigation bar , pop-off effect on stack well? if go other way around, put navigation controller in detail instead of master. not surprisingly, shows master first time. yet master not same treatment, not navigation bar, , there no way can go detail. question: causes different "treatment"?

angularjs - angular-ui-grid nested in angular-ui-layout with 100% height -

i trying show angular-ui-grid in 1 of containers/panes of angular-ui-layout. container should contain toolbar @ top , remaining space should filled either chart or corresponding data table tried solve flexgrid , ng-include. problem don't ui-grid initialize correctly when first shown , not fill remaining space. not reliably resize when resize browser window, not grow accordingly, not shrink it's scrollbars misaligned. i tried using handlewindowresize , ui-grid-auto-resize no avail. the ui-layout this: <div ui-layout="{flow : 'column'}" > <div ui-layout-container size="20%"> <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> </div> <div ui-layout-container> <div style="height:100%;display:flex;flex-flow:column;padding:10px"> <form role="form" style="padding-bottom:

java - Is there No Point to use instanceof with primitive types array? -

this somehow same asking: is there subclass / superclass primitive types? (because ((object) (new string[6])) instanceof object[] true, string extends object .) for instance, of int[] , only ((object) (new int[3])) instanceof int[] true, among in java? if so, ((object) (new int[3])) instanceof int[] is identical to ((object) (new int[3])).getclass() == int[].class and prefer latter one, should faster, doesn't have check every type/class inheritances. it difficult understand asking, think asking whether using getclass() better using instanceof array types. from perspective of readability, instanceof better: object obj = new int[3]; if (obj instanceof int[]) { int[] array = (int[]) obj; } if (foo.getclass() == int[].class) { int[] array = (int[]) obj; } clearly, first form more readable. from performance perspective, cannot see why 2 versions could not identical. in instanceof case, int[] type has no subtypes

html - Change image when hovering over li and keep that image permanent using CSS -

for life of me can't figure out. there image place holder loads on page visit. when hover on option 1, 2 or 3 new image takes place , becomes permanent until hover option. possible? <div> [image - loads on visit] [image 2- hidden until hover on li] [image 3- hidden until hover on li] </div> <div> <ul> <li>option 1</li> <li>option 2</li> <li>option 3</li> </ul> </div> here way jquery. have load in own images see work. here working fiddle! https://jsfiddle.net/ur7tns7l/ i took away $(#element).on("mouseleave",function(){ }); this makes image permanent until hovered over.

python - Why cant I access a property of an instance from another class? -

i've have trouble issue while now, , following example of problem: class player(object): def __init__(self): self.weapon = "rifle" self.rifle_test = rifle(self) self.dictionary = {} self.dictionary["rifle"] = self.rifle_test def check(self): print(self.weapon) print(self.dictionary[self.weapon].ammo) class rifle(object): def __init__(self, player): self.ammo = 10 self.player = player self.player.check() player_test = player() i have player ("player_test") , rifle ("rifle_test"). when call check() inside rifle(), nothing printed in console. i've tried moving things around, separating 2 classes , not having rifle_test in player_test, etc. main problem this: when execute function of specific instance instance, function executed not treated if executed instance carries it . in other words, if execute check() rifle(), different if execute player_test

php - XAMPP - Alias 127.0.0.1 -

currently, have xampp setup typing 127.0.0.1 in browser redirects me home page found within htdocs. i able type "devtest" , have alias 127.0.0.1. what have tried far modifying: c:\xampp\apache\conf\extra\httpd.vhosts.conf added entry looks like: <virtualhost *:80> serveradmin webmaster@dummy-host2.example.com documentroot c:\xampp\htdocs\workspace\myproject servername devtest errorlog c:\xampp\htdocs\workspace\myproject\myproject-error_log customlog c:\xampp\htdocs\workspace\myproject\myproject-access_log common </virtualhost> is there step i'm missing? open hosts file in notepad: c:\windows\system32\drivers\etc\hosts add line: 127.0.0.1 devtest navigate to: http://devtest

Android-Gradle - java.util.zip.ZipException: duplicate entry: android/support/v7/widget/PositionMap.class -

i have problem duplicate class in dependencies. apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.1" defaultconfig { applicationid 'br.com.etm.checkseries' minsdkversion 15 targetsdkversion 23 versioncode 1 versionname "1.0" multidexenabled true } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } productflavors { } } dependencies { compile filetree(include: ['*.jar'], dir: 'libs') testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.0' compile ('com.android.support:recyclerview-v7:23.1.0'){ exclude module : 'support-v4' exclude module : 'appcompat-v7' } compile('com.mikepenz:materialdrawer:4.3.8@aar'

scala - Generic map method for spark RDD doesnt compile -

i can't figure out why doesn't compile: implicit class debughelper[t](ar: rdd[t]) { def debug_restrainer(implicit sc: sparkcontext): rdd[t] = { if (debug_size.isdefined) sc.parallelize(ar.take(debug_size.get)) else ar } } it gives error: no classtag available t does know it's complaining about? if compiler asks classtag need. sparkcontext can retrieved existing rdd. import scala.reflect.classtag implicit class debughelper[t](ar: rdd[t])(implicit val t: classtag[t]) { def debug_restrainer: rdd[t] = { if (debug_size.isdefined) ar.sparkcontext.parallelize(ar.take(debug_size.get)) else ar } }

Using vectorization to compute moving average in Matlab -

i wrote script compute simple moving average of vector using for-loop: x=rand(1000,1); y=nan(size(a)); i=100:length(a); y(i)=mean(x(i-99:i)); end could use vectorization method avoid loop? thanks. you can avoid loop using either convolution ( conv ) or smooth if have curve fitting toolbox. filtersize = 5; y = conv(x, ones(1, filtersize) / filtersize, 'same'); % or curve-fitting toolbox y = smooth(x, filtersize);

asp.net mvc - How to open an exe on local pc from a link on a web page hosted on a server in C#? -

Image
i got web site link called 'open trim' should open application on local pc called trim.exe. when run website on local pc works fine. click link 'open trim' , trim.exe application opens. but, when upload same code windows 2003 server link doesn't anything. i have seen in github.com website open github desktop application clicking link 'clone in desktop'. trying achieve similar feature website , trim.exe. i using following code. var p = new process { startinfo = { useshellexecute = false, redirectstandardoutput = true, filename = path + opentrimbatchfilename } }; p.start(); p.standardoutput.readtoend(); p.startinfo.createnowindow = true; p.waitforexit(); reference: how run exe file in c# the code mentioned make exe run on server machine. that's why working on loca

What is best practice/alternative to use $broadcast/$on in triggering events in angularjs? -

i have scenario want communicate between sibling controllers in different apps. created sample demo uses publisher-subscriber service broadcast , listen event. code subscribing event in controller. want understand whether best practice? alternative way achieve same, give example? indicated following scenario – controllera broadcast event , controllerb , controllerc listen ( 1-many ) var app = angular.module('app', []); app.controller('controllera', ['$scope', 'pubsubservice', controllera]); function controllera($scope, pubsubservice) { $scope.teamname = ''; $scope.changeteam = function() { pubsubservice.publish("changenameevent", { filterteam: $scope.teamname }); }; } app.controller('controllerb', ['$scope', 'pubsubservice', controllerb]); function controllerb($scope, pubsubservice) { var callbacknamechanged = function(message) { $scope.team = message.filterteam }; pubs

java - Constructing a 3D KD Tree -

so trying construct 3d kd tree list of randomly generated points. trying accomplish task recursively well. in recursion facing error when i'm trying partition list of points. code follows: public class scratch { /** * @param args command line arguments */ public static void main(string[] args) { arraylist<point> points = new arraylist<point>(); random rand = new random(system.currenttimemillis()); (int = 0; < 100; i++) { double x = rand.nextint(100); double y = rand.nextint(100); double z = rand.nextint(100); point point = new point(x, y, z); points.add(point); } node root = kdtree(points, 0); system.out.println("done"); } static class node { node leftchild; node rightchild; point location; node() { } node(node leftchild, node rightchild, point location) {

bash - split command output into array of lines -

here's bash function command's output parameter , return array of output lines. function get_lines { while read -r line; echo $line done <<< $1 } sessions=`loginctl list-sessions` get_lines "$sessions" actual output of loginctl list-sessions is: session uid user seat c2 1000 asif seat0 c7 1002 sadia seat0 but while loop runs once printing output in single line. how can array of lines , return it? you use readarray , avoid get_lines function: readarray sessions < <(loginctl --no-legend list-sessions) this create array sessions each line of output of command mapped element of array.

java - NameValuePair and httpParams is deprecated, how to solve it? -

this question has answer here: namevaluepair, httpparams, httpconnection params deprecated on server request class login app 1 answer i tried search answer there not complete answer. code going select image gallery , upload server database. now code has 2 error. 1. namevaluepair 2. httpparams this code @override protected void doinbackground(void...params){ bytearrayoutputstream bytearrayoutputstream=new bytearrayoutputstream(); image.compress(bitmap.compressformat.jpeg,100,bytearrayoutputstream); string encodedimage= base64.encodetostring(bytearrayoutputstream.tobytearray(),base64.default); arraylist <namevaluepair> datatosend=new arraylist<>(); datatosend.add(new basicnamevaluepair("image",encodedimage)); datatosend.add(new basicnamevaluepair("name&quo

plot - R: abline does not add line to my graph -

i try draw line graph using r. lines have been plotted, abline line doesn't show up. m <- c(1.0,1.5,2.0,2.5,3) y <- c(0.0466,0.0522,0.0608,0.0629,0.0660) plot(m, y, type="l", col="red", xlab="sdr", ylab="simulated type error rate") abline(h=c(0.025,0.075),col=4,lty=2) this simple coding graph. ways make line pop out? try instead: m <- c(1.0,1.5,2.0,2.5,3) y <- c(0.0466,0.0522,0.0608,0.0629,0.0660) plot(m, y, type="l",col="red",xlab="sdr", ylim = c(0.025, 0.075), ylab="simulated type error rate") abline(h=c(0.025,0.075),col=4,lty=2) by using ylim . i refer read answer post: curve() not add curve plot when “add = true” more setting ylim when plotting several objects on graph.

windows - How are command prompt random numbers generated? -

in command prompt environment, there variable %random% uses algorithm generate pseudo-random numbers. does know algorithm generates these numbers? the %random% dynamic variable generates random number 0 32,767 inclusive. algorithm of these numbers generated this: srand((unsigned)time(null)); it turns out windows command processor uses standard naïve algorithm seeding random number generator (quote here ) it spits out new number every second because of time seed. as dbenham pointed out, 2 command prompts opened in same second output same exact numbers because of pseudorandomness , taking in of time seed.

ios - Set theme effect for application in AppStore view -

Image
hi nowadays of application in app store have theme effect like https://itunes.apple.com/us/app/quik-video-editor-by-gopro/id694164275?mt=8 could please 1 me set theme in app as far know,it not possible set theme yourself . if app popular , apple think app worth having custom page design,they contact you. you can refer link of forums.developer.apple.com

livecycle - Does Adobe live cycle provide support to convert pdf to docx? -

i checked adobe pdf library datalogics not provide api convert pdf docx . can tell if adobe live-cycle does? the documentation pdf generation service part of adobe livecycle es4 lists docx supported format (on windows only) can convert pdf to. livecycle still depends on acrobat xi pro being installed well.

ios - Objective-c : Designing UIView/UILabel Programmatically -

Image
i want design uiview / uilabel image programmatically in objective c . specially edge in middle . can ? currently have : uilabel *mylabel = [[uilabel alloc] initwithframe:cgrectmake(self.tabposition.x,self.tabposition.y,120,20)]; //or whatever size need mylabel.center = self.tabposition; [mylabel setfont:[uifont systemfontofsize:12]]; mylabel.backgroundcolor = [[uicolor blackcolor] colorwithalphacomponent:0.6f]; mylabel.textcolor = [uicolor whitecolor]; mylabel.textalignment = nstextalignmentcenter; mylabel.text = [nsstring stringwithformat:@"%@ %@",data.user.firstname,data.user.lastname] ; mylabel.tag = indexpath.row; mylabel.userinteractionenabled = yes; uipangesturerecognizer *gesture = [[uipangesturerecognizer alloc] initwithtarget:self action:@selector(labeldr

Which test management Jira Add-On can be used which has cucumber integration? -

i evaluating test management tool (a jira add-on) can used store requirements, manual test cases cucumber feature file automation. i have evaluated xray , looks promising want play more such tools before show presentation client. zephyr, testrail , hiptest others in list evaluated. can suggest tool can dig into. thanks. i explore cucumber pro, addition cucumber. more information available @ https://cucumber.io/pro

asp.net web api - Absolute and idle session timeout owin WebAPI -

i creating webapi using oauth bearer authentication follow: var oauthserveroptions = new oauthauthorizationserveroptions { tokenendpointpath = new pathstring("/token"), accesstokenexpiretimespan = timespan.fromminutes(100), provider = new authorizationserverprovider(), refreshtokenprovider = new refreshtokenprovider(), }; the application generate tokens authenticated users, expire in 100 minutes. users must use refresh token continue access application. now, want change policy follow: if user idle 100 minutes, user must login again (the application must return 401) - idle timeout event if user not idle, user must login again after 8 hours - absolute timeout i have searched several days, can't find suitable solution is there solution or sample worked problem here? currently, removed refresh token ability, user must login again after 100 minutes. thank much. i don't see wa

iis - ASP.NET Web Api2: Should we enable JSON data compression or not? -

i read json not default compressed through iis while other files html, cshtml, aspx compressed. why iis doesn't compress json default using gzip compression? if manually, involve risk? you right, default compression not enabled json. need change iis configuration enable it. i don’t find issue if have cpu support it. in reducing pay load big number. give better user experience on lower bandwidth user.

jquery - Can't over-ride certain css objects theme in the .dialog() widget -

i'm having trouble overriding css theme .dialog() box. followed instructions here http://api.jqueryui.com/dialog/#theming , not able resolve issue. using dialogclass option .dialog() widget should append styles apply them, this: javascript initialization: $("#modal").dialog({ dialogclass: "css" }); html: <div id="modal"></div> css: .css .ui-dialog-content { border:1px solid #ddd; background-color:#333; padding:50px !important; } ok documentation says can style .ui-dialog-content class , objects, , works, somewhat. border , background-color works, padding doesn't work because it's styled in element.style , using !important doesn't over-ride it, it's not letting me change pre-existing settings modal classes, when using !important , wondering if knows how work, starting getting padding work on .ui-dialog-content class. you can see fiddle here: http://jsfiddle.net/tsy52/

remove outer label of checkbox in ruby -

i'm using ruby on project . need custom style check boxes. please find below code <%= f.input :category_ids, :as => :check_boxes %> <%= f.collection_check_boxes :category_ids, category.order(:name), :id, :name |b| b.label { b.check_box + b.text } end %> <% end %> using above code im getting out <label for="property_space_amenities_space_amenities_2"> <input type="checkbox" value="2" name="property[space_amenities][space_amenities][]" id="property_space_amenities_space_amenities_2">internet connectivity </label> form im not able give custom style this i want output below <label class="control-label" for="user_login">login</label> <input class="form-control" id="user_login" name="user[login]" type="text" /> please me in this according rails doc , can have separated label , checkbox

c# - TPL - task is not awaited -

been using tpl quite while, , still have mysteries solve :) when run in console, expect work done before logs "jobs done": await startattachedasync(() => { var result = parallel.for(0, 4, async => { callcontext.logicalsetdata("contextid", i); await task.run(async () => { await task.delay(2000); await task.run(async () => { await task.delay(2000); write("step c done " + i); }); write("step b done " + i); }); write("step done " + i); }); console.writeline("for done: completed = " + result.iscompleted); }); console.writeline("jobs done"); private static async task startattachedasync(action action) { await task.factory.startnew(action, cancellationtoken.none, taskcreationoptions.attachedtoparent, taskscheduler.default); } gives me: for loop done: completed = true jobs done step c done 0 step c do

objective c - Strange dismissViewControllerAnimated Crash - iOS 8 -

my app crashing, in ios 8.4, when try dismissviewcontrolleranimated:no , after alert uitextfield . changing animated yes it's working well, guess that's not fix. code: ( uimodalpresentationcurrentcontext modal) - (ibaction)openalertwithtextfield:(id)sender { uialertview * alert = [[uialertview alloc] initwithtitle:@"" message:@"type number:" delegate:self cancelbuttontitle:@"cancel" otherbuttontitles:@"confirm", nil]; [alert setalertviewstyle:uialertviewstyleplaintextinput]; uitextfield * alerttextfield = [alert textfieldatindex:0]; [alerttextfield setkeyboardtype:uikeyboardtypenumberpad]; [alerttextfield setdelegate:self]; [alert show]; } #pragma mark - uialertviewdelegate - (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex { if (buttonindex == 1) { // crash [self dismissviewcontrolleranimated:no completion:nil]; // no crash [se

Render Html + Javascript in a .Net headless browser -

there need render html page simple javascript using headless browser in .net c# (server side) application. need rendered html source code. i think can use .free/opensource libraries rendering such as: awesomium geckofx cefsharp berkelium requirement example: html code before render: <!doctype html> <html> <head> <title>test</title> <meta charset="utf-8" /> <script type="text/javascript"> function formatcurrency(value) { document.write(value.tolocalestring('en-us', { style: 'decimal', minimumfractiondigits: 2, maximumfractiondigits: 2 })); } </script> </head> <body> <h1>example</h1> <table> <tr> <td>price:</td> <td><script>formatcurrency(275)</script></td> </tr> </table> </body> </html> html co

html5 - dynamically change css class name -

below code: <asp:listview id="lviewmenu" runat="server"> <itemtemplate> <li class="context-menu-group"><span class="color-bar color-13"></span> <asp:linkbutton id="lbtnmenu" runat="server" text='<%# eval("menuname")%>' onclick="lbtnmenu_click"></asp:linkbutton> </li> </itemtemplate> </asp:listview> and need change class name of <li> context-menu-group active when linkbutton clicked on onclick() how?

javascript - No 'Access-Control-Allow-Origin' header is present on the requested resource -

i had error xmlhttprequest cannot load http://domain.com/canvas/include/rs-plugin/js/extensions/revolution.extension.video.min.js . request header field x-requested-with not allowed access-control-allow-headers in preflight response. i have these 2 lines @ top of php page load js file. header("access-control-allow-origin: *"); but issues persist, should do. i trying access domain.com js file subdomain.domain.com this header response access-control-allow-origin:* connection:keep-alive content-encoding:gzip content-length:4799 content-type:text/html date:wed, 25 may 2016 06:28:04 gmt keep-alive:timeout=5, max=100 server:apache/2.4.7 (ubuntu) vary:host,accept-encoding x-powered-by:php/5.5.9-1ubuntu4.14 try add access controll on htaccess origin domain. <ifmodule mod_headers.c> header set access-control-allow-origin "*" </ifmodule> is not secure allow access controll sites. replace &q

Virtual Keyboard recommendations (JavaScript) -

im looking recommendations javascript virtual keyboards (that aren't built jquery). far have been able find ones made jquery don't want add jquery project when else written native js. anyone know of native framework agnostic virtual keyboard solution? i never use such thing device keyboard should preferred in opinion in project can use that, our devices 48" android keyboard 48" wide - unusable, , project not native android based can use native keyboard replacement. if has tip let me know. cheers hi can use keyboard link here .this way generate key board . hope helps , can add comment if want further .

android - Null pointer exception when compressing image -

when on samsung galaxy s3 select image gallery, ocasionaly recieve null pointer exception on compressing stage. problem line bm.compress(compressformat.jpeg, 85, bos); method public string savefile(bitmap bm, int id) { string file_path = environment.getexternalstoragedirectory() .getabsolutepath() + "/mk"; file dir = new file(file_path); if (!dir.exists()) { dir.mkdirs(); } file file = new file(dir, "smaller" + id + ".jpeg"); fileoutputstream fout; try { fout = new fileoutputstream(file); // bm.compress(bitmap.compressformat.png, 85, fout); bufferedoutputstream bos = new bufferedoutputstream(fout); bm.compress(compressformat.jpeg, 85, bos); if (bos != null) { bos.flush(); bos.close(); } if (fout != null) { fout.flush();

Microsoft Speech Platform - sampling rate and bit depth -

recognition results best if sampling rate , bit depth of audio match training data of system. so, know exact sampling rate and/or bit depth (and/or stereo/mono) used in microsoft speech platform (newest, if that's important)? , if so, remember got information? please note using ms speech platform, not sapi. unless both using same training data, that's not same afaik. precise - use this: http://msdn.microsoft.com/en-us/library/microsoft.speech.recognition.speechrecognitionengine.setinputtowavefile%28v=office.14%29.aspx my first try based upon c++ code example given on page. the microsoft.speech sr engine doesn't need training ( unlike system.speech sr engine ), , relatively insensitive sampling rate (will work > 8 khz sampling rate). 16 bit audio preferred, believe work 8 bit audio.

android - textView.getSelectionEnd() returning start index value on Samsung Marshmallow 6.0 devices -

this issue observed on samsung devices android 6.0 only. working fine on other devices, including non - samsung devices android 6.0 , samsung devices android 5.1 , below. currently don`t have samsung device android 6.0 readily check things on it, arranging soon. the feature using : the user long presses on word sentence in textview , user can edit selected word. we accomplish : making textview selectable , adding longclicklistener. adding custom selection action mode callback , overriding oncreateactionmode() return false, since don`t need default cut-copy-paste action mode. handling onlongclicklistener exact selected word , provide ui correct , replace word. the issue facing : textview.getselectionstart() returns correct start index textview.getselectionend() returns value of start index instead of end index. have guard condition whenever start , end index same selection space , hence ignore it, word selections on samsung devices android 6.0 , ignored re

In iOS , What functions are running before the launch screen shows -

sometimes , when click app icon on desktop , keeps highlighted period of time , 1~2 seconds , app opens , shows launch screen. i've no idea how decrease waiting time. so want know in period of time , did app ? functions running before launch screen shows ? it sounds me doing lot in viewdidload function of initial viewcontroller of main storyboard. cause launch screen stay on screen until functionality has finished. you can fix putting functionality background thread if it's not essential has finished before viewcontroller presented.

android send http post request - correct way -

good morning together, i found helpful tutorial making http post request android. code works fine, know, if code best way this, or if yo have ideas, how can optimize it. private class postclass extends asynctask<string, string, string> { context context; public postclass(context c){ this.context = c; } @override protected string doinbackground(string... params) { try { url url = new url("xxxx"); httpurlconnection connection = (httpurlconnection)url.openconnection(); string urlparameters = "xxx"; connection.setrequestmethod("post"); connection.setdooutput(true); dataoutputstream dstream = new dataoutputstream(connection.getoutputstream()); dstream.writebytes(urlparameters); dstream.flush(); dstream.close(); buffere

xpath find element's grandparent -

i'm bit stuck getting grandparent element xpath. unfortunately tries not successful :( html <span class="fsm fwn fcg"> <a href="bla bla"> <abbr> <span class="timestampcontent" id="js_19">21 mins</span> </abbr> </a> </span> i need <a href="bla bla"> element grandparent <span class="timestampcontent" id="js_19">21 mins</span> i tried smth like: //span[@class='timestampcontent' , contains(text(), 21 mins)]../.. or ../..//span[@class='timestampcontent' , contains(text(), 21 mins)] and other options, didn't worked out :( your first try close, / before .. missing (and missing quotes around '21 mins', believe typo) : //span[@class='timestampcontent' , contains(text(), '21 mins')]/../.. alternatively, can other way around i.e selecting element has grand child span

javascript - how to write single and double quotes while appending data? -

$(".overlayp ul").append('<li id="group_'+msg1[i][0].id+'" class="list_items"><div class="row"><div class="col-xs-2 col-md-1"><div class="itemavatar"><img src="'+url+'/service/getuserimage/'+msg1[i][0].id+'/32" alt="avatar"></div></div><div class="col-xs-10 col-md-11"><div class="item"><div class="item-title">'+msg1[i][0].name+'<span class="pull-right members"><a onclick="if(confirm("are sure?")) removegroupuser('+groupid+','+msg1[i][0].id+');">remove user</a></span></div></div></div></div></li>'); i getting unexpected token error because while appending li have started single quote while writing confirm dialog box facing problem how mention quote inside "are sur

java - Integration sonar with jacoco. I see exluded packages in sonar coverage report -

Image
i want migrate cobertura jacoco codecoverage tool. i'm using maven build tool , added jococo-maven-plugin in pom.xml file. configuration looks this: <plugin> <groupid>org.jacoco</groupid> <artifactid>jacoco-maven-plugin</artifactid> <version>0.7.2.201409121644</version> <configuration> <append>true</append> <outputencoding>utf-8</outputencoding> <destfile>${sonar.jacoco.reportpath}</destfile> <datafile>${sonar.jacoco.reportpath}</datafile> <outputdirectory>${jacoco.output.path}</outputdirectory> <excludes> <exclude>com/acmecorp/acmeproject/mbean/**/*.class</exclude> <exclude>com/acmecorp/acmeproject/model/**/*.class</exclude> </excludes> </configuration> <executions> <execution> <id>agent&

Why does this 1-D array in python get altered / re-defined while being autocorrelated? -

in python, have 1 1-d array coef defined follows: coef = np.ones(frame_num-1) in range(1,frame_num): coef[i-1] = np.corrcoef(data[:,i],data[:,i-1])[0,1] np.savetxt('serial_corr_results/coef_rest.txt', coef) now want autocorrelation on it, , use code posted deltap in post: timeseries = (coef) #mean = np.mean(timeseries) timeseries -= np.mean(timeseries) autocorr_f = np.correlate(timeseries, timeseries, mode='full') temp = autocorr_f[autocorr_f.size/2:]/autocorr_f[autocorr_f.size/2] the autocorrelation works fine, however, when want plot or work original coef, values have changed of timeseries -= np.mean(timeseries). why original array coef changed here , how can prevent being altered? need further down in script other operations. also, operation -= doing? have tried google that, haven't found it. thanks! numpy arrays mutable, e.g. timeseries = coef # timeseries , coef point same data timeseries[:] = 0 will set both timese

highcharts style modification in R -

i hope change attributes in highcharts, part of rcharts r package . also, hope using r, not web related or other language. in highcharts example, can see default attributes under style tag follow: <style> .rchart { display: block; margin-left: auto; margin-right: auto; width: 800px; height: 400px; } </style> i hope modify to: <style> .rchart { display: block; margin-left: auto; margin-right: auto; width: 100%; height: 100%; position: absolute } </style> i tried find how in reference ( https://media.readthedocs.org/pdf/rcharts/latest/rcharts.pdf ), not find it. i'd appreciate if let me know this. i think best way generate highcharts-specific code , insert in html file containing custom css. otherwise, if want adjust style direclty r, can access width , height attributes of chart through chart$params$width , chart$para

java - String.Split() for a array of string and saving into a new array -

so, i'm receiving array of string , split each element , save new array , have faced lot of problems , came bad solution: string[] timeslots = { "13:00:00 - 14:00:00", "15:00:00 - 16:00:00","17:00:00 - 18:00:00" }; string[] t = new string[6]; string temp[] = new string[6]; int j = 1; (int = 0; < 3; i++) { temp = timeslots[i].split("\\-"); if(j == 1){ t[0] = temp[0]; t[1] = temp[1].trim(); } else if(j == 2){ t[2] = temp[0]; t[3] = temp[1].trim(); } else{ t[4] = temp[0]; t[5] = temp[1].trim(); } j++; } as can see have create if-statement save 2 elements, know it's bad approach that's able come :( you can calculate index in result array index in input array: string[] t = new string[2*timeslots.length]; (int = 0; < timeslots.length; i++) { string[] temp = timeslots[i].split("\\-"); t[2*i] = temp[0].trim(); t[2*i+

javascript - select tag does not support multiple -

in code use ng-options bind data select tag,also set multiple property true. <select ng-if="exp.metadata.elementtype =='in'" multiple="" ng-multiple="true" class="form-control" ng-model="exp.value" ng-options="value.id value.title value in exp.datasource"> <option value=""> select ...</option> </select> but in run time in browser, select tag not support multiple,also not see multiple="" or ng-multiple="true" when inspect select element. (f12->elements) below minimal setup example multiple select in angular. not sure why need please select option in multiple select, though. angular.module('test', []).controller('test', test); function test() { var vm = this; vm.options = [ {name: 'aaa', value: '1'}, {name: 'bbb', value: '2'}, {name: 'ccc', value: &#

node.js - Install a gem to node project on Heroku -

i install gem node project, hosted on heroku. more use sass compass, , compass available gem. there projects wrap gem node, of them require gem. is there way this? there's topic ( installing gems on node heroku projects ), hasn't received replies. i got reply heroku. " you need use heroku multi buildpack in order have both ruby buildpack , node buildpack: https://github.com/ddollar/heroku-buildpack-multi "

javascript - Fullcalendar: How to create Bootstrap Modal box on click of a custom button? -

in fullcalendar, want create bootstrap modal on click of custom button.i not know how it. have tried , kept prompt box, not requirement. me how pop modal on click of button click. following code:- <script> $(document).ready(function() { $.ajax({ url: "calendar/show_holidays", type: 'post', // send post data data: 'type=fetch', async: true, success: function(s){ holidays =s; // holidays = '['+s+']'; //alert(holidays); $('#calendar').fullcalendar('addeventsource', json.parse(holidays)); } }); $('#calendar').fullcalendar({ custombuttons: { eventbutton: { text:'add event', click:function(event, jsevent, view){ console.log(event.id); var title = prompt('event title:', event.title, { buttons: { ok: true, cancel: false} });

php - Generate one single migration from all migration files symfony doctrine? -

my website hosted on shared server cant run migration command since dont have access ssh. there way can generate 1 single migration/sql file migration files generated during development, can import/execute manually? i using symfony 2 framework doctrine2 output sql , execute manually you output sql of migrations run on local machine , execute web-console (e.g. phpmyadmin). php app/console doctrine:migrations:migrate --write-sql -e prod where " prod " environment point towards database structure in sync 1 on server. once ran compiled sql on server, re-run same command update "local" version of database (without --write-sql option) php app/console doctrine:migrations:migrate -e prod this update remote database without need ssh, direct connection (my)sql server. upon next database change; repeat... just point towards production database if possible, point towards production/remote database " prod " environment. database_hos

node.js - Wrong hour difference between 2 timestamps (hh:mm:ss) -

using moment.js, want time difference between 2 timestamps. doing following, var prevtime = moment('23:01:53', "hh:mm:ss"); var nexttime = moment('23:01:56', "hh:mm:ss"); var duration = moment(nexttime.diff(prevtime)).format("hh:mm:ss"); i result : 01:00:03 why have 1 hour difference? seconds , minutes seem work well. after doing that, tried following : function time_diff(t1, t2) { var parts = t1.split(':'); var d1 = new date(0, 0, 0, parts[0], parts[1], parts[2]); parts = t2.split(':'); var d2 = new date(new date(0, 0, 0, parts[0], parts[1], parts[2]) - d1); return (d2.gethours() + ':' + d2.getminutes() + ':' + d2.getseconds()); } var diff = time_diff('23:01:53','23:01:56'); output : 1:0:3 the problem having here when putting nexttime.diff() in moment constructor, feeding milliseconds moment() , tries interpret timestamp, why don't expe

java - How to display only selected data from database in Android Studio -

my program designed search database specific name entered, program display row of specific name. however, code unable display specific data. have tried many kind of ways unable solve problem. php code below: <?php $con = mysql_connect('mysql17.000webhost.com', 'a2634311_minzhe', 'mzrules0118'); if (!$con) { die('could not connect: ' . mysql_error()); } mysql_select_db("a2634311_gdp", $con); $result = mysql_query("select * groupdesign"); while($row = mysql_fetch_assoc($result)) { $output[]=$row; } print(json_encode($output)); mysql_close($con); ?> my activity code below: import android.app.activity; import android.content.context; import android.content.intent; import android.content.sharedpreferences; import android.os.asynctask; import android.os.strictmode; import android.support.v7.app.actionbaractivity; imp