Posts

Showing posts from September, 2015

javascript - IE9 error '$'is not defined -

Image
<!--[if lte ie 9]><html class="lte9"><![endif]--><!--[if gt ie 9]><html><![endif]--> <!--[if !ie]><!--> <html> <!--<![endif]--> blah blah <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <script src="{{ asset('js/mypage.js') }}" type="text/javascript"></script> </body> </html> when load page, ie9 brings error '$' not defined . how can solve error? +++ mypage.js $(function(){ //when load page, //ie9 tag not moving. $(window).load(function() { $('div.mask').hide(); }); // when click , willshow show. //for not ie 9 if (!$('html').hasclass('lte9')) { var = $('ul.about > li > span.activebtn');

git - Does reset could work against remote branch? -

i saw command git reset --hard origin/master is working via remote tracking branch. is possible reset against remote branch , not remote tracking branch? warning: these commands have power change history. use them if understand , accept risk. the command git reset --hard origin/master wouldn't have effect on remote branch if applicable; effectively, you're telling local branch move head same commit reflected in origin/master repository knows it. not touch remote branch. if git fetch wasn't run prior, do run risk of overwriting local repository older variant of remote repository, entirely fixable git fetch && git reset --hard origin/master . if wanted reset commits against remote repository, have first apply them local repository, force-push them via git push -f . note these kinds of changes respect git done local repository first; if want publish them remote repository, have invoke different commands.

how to split a dataframe to specific number of rows in if loop in R -

i writing function send emails clients in r. using mailr package so,but service provider allows me send 100 emails hour. want is, if suppose email list contains 270 email addresses,i want spilt chunk1=100 , chunk2 = 100 & chunk3 = 70 should send out emails first chunk wait hour , chunk2 , on. function looks like. email <- function(dataframe,city,date){ dataframe$registrant_email <- tolower(dataframe$registrant_email) dataframe_city <- dataframe[dataframe$registrant_city == city & dataframe$create_date == date, ] # removing na's , blank email ids dataframe_city <- dataframe_city[!(is.na(dataframe_city$registrant_email)|dataframe_city$registrant_email==""), ] # removing duplicate email ids dataframe_city <-dataframe_city[!duplicated(dataframe_city$registrant_email),] emails <- as.vector(dataframe_city$registrant_email) if(length(emails) > 100){ # divide vector chunks of 100 } else{send_email(emails} re

java - Accesing spring boot REST service in glasfish -

did following tutorial https://spring.io/guides/gs/uploading-files/ want able deploy glassfish 4.1. problem cannot exposed rest service my application class: package de.awinta.kti.cms; import org.springframework.boot.springapplication; import org.springframework.boot.autoconfigure.springbootapplication; import org.springframework.boot.builder.springapplicationbuilder; import org.springframework.boot.web.support.springbootservletinitializer; @springbootapplication public class application extends springbootservletinitializer { public static void main(string[] args) { springapplication.run(application.class, args); } @override protected springapplicationbuilder configure(springapplicationbuilder application) { return application.sources(application.class); } } my restcontroller: @restcontroller @requestmapping("/files") public class fileuploadcontroller { //private final storageservice storageservice; @autowired

javascript - Sequential requests to mongodb -

i writing node.js , mongodb app. cut long story short, small social network users registering , on. problem before adding user should check whether user same name exists. how can using promises? below current version of user adding code. ... function adduser(login, password){ return mongo.connectasync()return mongoclient.connectasync(url) .then(db => { // here should test login existance // , after need pointer db // register new user }) .catch(err => { console.log('error--db_provider--addlog'); throw err; }); } ...

wpf - Moq with c# System.Windows.MessageBoxButton.YesNoCancel -

i'm writing unit tests around wpf module of program. i've come point showmessage returns yes or no value within statement. dservice.showmessage(view, args); the args takes lambda (shortened) new messageargs(arg1, arg2, arg3, (la) => { if (la.result == messresult.yes) { // } } i'm trying mock result given lambda having difficulty , have been unable find similar problem. i've tried setting default result within lambda in unit test: new messageargs(arg1, arg2, arg3, (la) => { if (la.result == messresult.yes) { la.result = messresult.yes; } } which proved unsuccessful along trying set arg result below statement as: args.result = messresult.yes; i have tried use setup as: dservicemock.setup(x => x.showmessage) but there no return property showmessage void function. none have shown change in action unit test. has else had similar "problem" , found solution or know of documentation around this? i&

How to Override "ir.sequence" field in csv import in Odoo? -

i'm trying import new customer data odoo using csv import. there 1 field customer_id_no auto generated when record created(using "ir.sequence"). now each customer record in csv has unique customer_id_no when try import it, existing customer_id_no overridden standard sequence. how can insert data csv in odoo? also unable find answer import many2one fields. on greatful. @czoellner right. have change method. : @api.model def create(self, vals): vals['customer_id_no'] = mechanics_to_generate_sequence() return super(classname, self).create(vals) it needs address case customer_id_no provided. this @api.model def create(self, vals): if not vals.get('customer_id_no'): vals['customer_id_no'] = mechanics_to_generate_sequence() return super(classname, self).create(vals) note afterward need make sequence next iteration value next highest in customer_id_no .

postgresql - SQL Multiple update record from SELECT WHERE -

i need help. i want totally quantity of material same id in bill. like this bill no. 001 jellopy x1ea jellopy x1ea jellopy x1ea zargon x1ea result should be bill no. 001 jellopy x3ea zargon x1ea so,i want this 1.select+sum 2.update 3.delete duplicate here old (dbill) table dbill id mat qty 01 a1 1 01 a1 1 01 a1 1 01 a2 1 id mat qty [01 a1 1] < same mat&id = sum [01 a1 1] < same mat&id = sum [01 a1 1] < same mat&id = sum 01 a2 1 and sqlfiddle test http://sqlfiddle.com/#!15/b30a3c 1 sum quantity same material select mat,id,sum(qty) result dbill group id,mat [2] got result this id mat qty 01 a1 3 01 a2 1 [3] so... update this update dbill set qty = result dbill t inner join (select mat,id,sum(qty) result dbill group id,mat) s on s.id = t.id , s.mat = t.mat the problem when [3] update here result id mat qty 01 a1 3 01 a1 3 01 a1 3 01 a2 3 because correct result should b

javascript - How to prevent location change of all components after update of nodeDataArray of diagram? -

i have diagram: var $ = go.graphobject.make; var diagram = $(go.diagram, element[0], { initialcontentalignment: go.spot.topcenter, initialscale: 1, layout: $(go.layereddigraphlayout, { direction: 0 }), isreadonly: false, allowlink: true, allowclipboard: false, animationmanager.duration: 200, undomanager.isenabled: false }); i create several simple elements , add them using addnodedatacollection method diagram model. change position of elements , add 1 more nodedataarray . expect after adding of new element position of old items won't changed not true. locations of items changed , elements aligned center. correct behaviour? didn't find how prevent recalculation of locations after adding new item in nodedataarray . normally when add or remove node or link, layout performed again. in case diagram.layout happen again, moving manually adjusted node positions layout thinks should be. please read http://gojs.net/latest/intro/l

php - Use composer on a small linux webservice -

i'm developing application using php. need use library: mgp25/instagram-api it uses composer auto load libraries can't install composer on server because company got web-service doesn't support ssh access , found in : use composer without ssh access server the best way make " vendor/autoload.php " on server/computer , upload on server, since don't have linux server , don't know how use it, want ask there can make file " vendor/autoload.php " me? possible @ all?

javascript - Need to display percentage of the individual bar in highcharts -

Image
hi need in displaying total percentage value each individual bar @ end particular bar. i'm not sure how done , start it. please give me suggestion/solution helps output. please take @ below image: $(function () { highcharts.chart('container', { chart: { type: 'bar' }, title: { text: '' }, xaxis: { categories: ['dec', 'nov', 'oct', 'sep', 'aug', 'jul', 'jun', 'may', 'apr', 'mar', 'feb', 'jan'] }, yaxis: { min: 0, //labels:{enabled: false}, title: { text: '' } }, legend: { reversed: true }, exporting: { enabled: false }, plotoptions: { series: { stacking: 'normal' } },

android - Not receiving broadcast for "wifi is connected" -

i have registered broadcastreceiver in manifest. registered <action android:name="android.net.conn.connectivity_change" /> <action android:name="android.net.wifi.wifi_state_changed" /> i have registered following permissions: <uses-permission android:name="android.permission.access_wifi_state" /> <uses-permission android:name="android.permission.access_network_state"/> it fires when disable/enable wifi , when wifi disconnected after losing signal (when go away hotspot). there no broadcast when came hotspot (when wifi connected again). have testet samsung galaxy s5 (android 6.0.1). there peculiarity don't know? the code broadcastreceiver public class statusreceiver extends broadcastreceiver { @override public void onreceive(final context context, intent intent) { if(intent.getaction() != null) log.d("action", intent.getaction()); } } <receiver android:name=&

hadoop - how to use bincode operator in group function in pig -

i need group below data on fname , lastname. (fname,lname,id) abc,xyz,i abc,xyz,n ppp,xxx,i ppp,xxx,i in id field expecting 2 values i.e n or if both n , same fname,lname combination should use id n else need use value id field given in group. i expecting below results: abc,xyz,n ppp,xxx,i i have tried below code , working fine in =load '/testing/name.txt' using pigstorage(',') (fname:chararray,lname:chararray,id:chararray); grp = group in (fname,lname); z = foreach grp generate flatten(group) (fname,lname),(count(in.id) >1 ? ('n') :bagtotuple(in.id))as id; however need check values of id field instead of counts: z = foreach grp generate flatten(group) (fname,lname),((in.id == 'n' or in.id == 'i') ? ('n') :bagtotuple(in.id))as id; however giving below error: (name: equal type: null uid: null)incompatible types in equal operator left hand side:bag :tuple(id:chararray) right hand side:chararray however givi

java - why file is not deleted inspite of using delete function? -

(int = 0; < listoftempfiles.length; i++) { (int j = 0; j < listoffaqfiles.length; j++) { if (listoftempfiles[i].isfile() && listoftempfiles[i].length() > 0) { if (listoftempfiles[i].getname().tolowercase().contains(".pdf")) { if (listoftempfiles[i].getname().substring(listoftempfiles[i].getname().lastindexof("#") + 1).equals(listoffaqfiles[j].getname())) { try { list<inputstream> list = new arraylist<inputstream>(); list.add(new fileinputstream(listoftempfiles[i])); list.add(new fileinputstream(listoffaqfiles[j])); system.out.println(listoftempfiles[i].getname() + "with faq: " + listoffaqfiles[j].getname()); int iend = list

My android marquee java won't run -

below java function marquee: public textview setmarqueetext(string content){ textstyle = new htmlparser().parse(content); txtview = new textview(this.playercontext); txtview.setlayoutparams(new framelayout.layoutparams(layoutparams.match_parent,layoutparams.match_parent)); if (!textstyle.getfontsize().isempty()){ txtview.settextsize(typedvalue.complex_unit_px, (float)(double.parsedouble(textstyle.getfontsize()) * screenratio)); } string color = textstyle.getfontcolor(); if (!color.endswith("")){ txtview.settextcolor(color.parsecolor(color)); } txtview.setsingleline(true); txtview.setellipsize(truncateat.marquee); txtview.setmarqueerepeatlimit(-1); txtview.setgravity(gravity.bottom); txtview.setfocusable(true); txtview.sethorizontallyscrolling(true); txtview.settext(html.fromhtml(content)); txtview.setselected(true); return txtview; } i call functio

c# - Async - Which of these is correct -

from below 2 scenario(s), 1 of them correct way of doing asynchronous programming in c#? scenario-1 public async task<t1> addsomethingasync(param) { return await someotherfunctionfromthirdpartylibraryforioasync(param); } then list<task> tasks=new list<task>(); foreach(var task in fromalltasks()) { tasks.add(addsomethingasync(task)); } await task.whenall(tasks.asparallel()); scenario-2 public async task<t1> addsomethingasync(param) { return someotherfunctionfromthirdpartylibraryforioasync(param); } then list<task> tasks=new list<task>(); foreach(var task in fromalltasks()) { tasks.add(someotherfunctionfromthirdpartylibraryforioasync(task)); } await task.whenall(tasks.asparallel()); the difference between 2 is, later not having await keyword inside addsomethingasync function. so here update - want know achieve is, tasks should executed in parallel , asynchronously. (my thinking in scenario-1, call awaited insid

How to set an inputAccessoryView with Cordova on iOS -

i need add toolbar (for markdown tags) keyboard of cordova ios app. know it's possible swift, inputaccessoryview , i've found hiding keyboardaccessorybar in keyboard plugin cordova. is there way cordova? or maybe html/css manipulation?

single sign on - Siteminder SSO default login -

i'm new siteminder , struggling set idp server. installed policy server, admin ui , web agent (incl. option pack). web agent installed on redhat embedded apache server. after configure policy server. still don't know how can authenticated siteminder. there kind of login page? if so, what's url it?

excel - translate code from batch to vba -

i have batch file process name msmdsrv.exe , pid number using tasklist port number using netstat connection type established. at end export result file pbd_port.csv for /f "tokens=2 delims=," %%f in ('tasklist /nh /fi "imagename eq msmdsrv.exe" /fo csv') ( set var=%%f ) /f "tokens=2 delims= " %%h in ('netstat -ano ^| findstr established ^| findstr %var%') ( set var1=%%h ) echo %var1% > pbd_port.csv i use code port number of powerbi desktop , change every time when launch power bi desktop . is possible have macro in excel same thing ? instead of using batch file user has click on it, want macro give same result , write result not in csv in worksheet. edit : built code batch, wanted general advice how translate vba, comment edit : actually, on complicating things, port number stored in temporary text file generated new ssas instance, see different solution here http://community.powerbi.com/t5/desktop/connect-to

extjs6 classic - How to do Data binding in extjs 6 -

i have json this. firstname: 'xyz', comments : [{ emailaddress : "abc@gmail.com", body : "pqr", emailaddress : "xyz@gmail.com", body : "xyz", }] i want show firstname in textfield editable. , want show comments in grid. not able understand how it. please me that. my view following: ext.define("sampleview", { extend: "ext.panel.panel", alias: 'widget.sample', id : 'samplevid', requires: ['studentviewmodel'], viewmodel: { type: 'studentviewmodel' }, layout: { type: 'vbox', align: 'stretch' }, initcomponent: function() { ext.apply(this, { items: [this.form(), this.grid()], }); this.callparent(arguments); }, grid: function(){ return { xtype: 'grid', reference: 'samplegri

What does means * in array allocation before size declaration in C++? -

this question has answer here: how create array of pointers? 3 answers table = new myobject*[table_size]; i know * declaring pointers variable , obtain value of variable pointer, mean? it means know means :-) the type myobject * pointer myobject object declaring array of said pointers, table_size of them exact.

excel vba - Getting sheet by index causes error in vba macro -

i'm trying create macro in excel, following code causes error. can't why public sub createsimplemodel() dim reportsheet worksheet msgbox thisworkbook.sheets.count reportsheet = thisworkbook.sheets(1) <-- here error end sub the message box appears shows there sheets in workbook. error object variable or block not set appreciated. you need use "set" if want reference workbook public sub createsimplemodel() dim reportsheet worksheet msgbox thisworkbook.sheets.count set reportsheet = thisworkbook.sheets(1) end sub

Python randint not equal to 0 -

this question has answer here: how create random range, exclude specific number? 5 answers i trying use random.randint randomly generate single int between range, e.g. randint(-2,2) , however, possibly generate 0 , not expected, wondering there way make not equal 0 . or use loop until randint(-2,2) not generate 0 , , output. cheers don't use randint() then; picks integer continuous range of values, not discrete set. use random.choice() function instead, passing in list of just integers want pick from: random.choice([-2, -1, 1, 2]) this'll return random value list.

react native - ReactNative : NavigatorExperimental : NavigationCardStack seems to have default grey background. How to to remove it? -

my app fullscreen background image wraps navigationcardstack. <image source={bkg} style={styles.backgroundimage}> <navigationcardstack navigationstate={this.state.navstate} onnavigate={this._handleaction.bind(this)} renderscene={this._renderscene.bind(this)} style={styles.navigator} /> </image> i tried add style background: 'transparent' navigationcardstack it's not working. any idea?

mysql - Is there a way to count occurrence of values of multiple column in SQL? -

let have table storing survey result, , syntax looks this: id | q1 | ..... | q30 | created_at created_at timestamp column , others integers fields. now want have result of survey according month. 1 question, have: select year(created_at) year, month(created_at) month, q1, count(*) occurrence survey_table group year(created_at), month(created_at), q1 the return like: year | month| q1 | occurence 2016 | 11 | 1 | 10 2016 | 11 | 2 | 15 2016 | 11 | 3 | 2 2016 | 10 | 1 | 12 2016 | 10 | 2 | 2 2016 | 10 | 3 | 50 the data passed php script further calculation , data-display. to calculation on 30 columns, 1 way perform query 30 times different question. wondering if there way in single query output this: year | month| q1_1 | q1_2 | q1_3 | q2_1 | q2_2 | q2_3 | ... | q30_1 | q30_2 | q30_3 2016 | 11 | 10 | 15 | 2 | 2 | 20 | 5 | ... | 5 | 15 | 7 2016 | 10 | 12 | 2 | 50 | 25 | 27 | 12 | ... | 20 | 24 | 20 i

Handling a unique key Constraint Violation with powershell and SQL -

i'm writing script insert guid sql table. in order stop duplicates, have made table guid column unique. so need catch violation , ignore if duplicate , continue script. write new guids ignore duplicates. what best way catch , deal violation? i've seen few options on site, none work me, fail catch block missing statement block. or other errors. example of catch block i've been trying catch(sqlexception ex) { sqlexception = ex.innerexception system.data.sqlclient.sqlexception; if (sqlexception.number == 2601 || sqlexception.number == 2627) { errormessage = "cannot insert duplicate values."; } else { errormessage = "error while saving data."; } } and errors: at d:\software approval requests\getapprovalrequestsnew2.ps1:15 char:6 + catch (updateexception ex) + ~ catch block missing statement block. @ d:\software approval requests\getapprovalrequestsnew2.ps1:18 char:32 + if (innerexcept

Is there any possibility to execute jar file having selenium tests described in testng xml file through command Prompt -

when write script in bat file following code project location actual testng file placed: set projectlocation=c:\users\automation-master cd %projectlocation% set classpath=%projectlocation%\bin;%projectlocation%\seleniumlibrary\* java org.testng.testng %projectlocation%\testng.xml with above code browser invoked. but in same way need execute jar(of above project) file comprising of class files, libs , testng xml actual tests in through command line. my query how specify classpath of libs , classes in jar file , point testng xml file in jar execute script? assuming have built jar contains test classes, can specify in testng via below options -testjar - specifies jar file contains test classes. if testng.xml file found @ root of jar file, used, otherwise, test classes found in jar file considered test classes. -xmlpathinjar - attribute should contain path valid xml file inside test jar (e.g. resources/testng.xml ). default testng.xml , means file called testn

android - refresh fragment that gone to activity after back pressed in that activity -

i have fragment in tabbed activity.it redirects onclicklistener activity.after changes made in activity.user press button.so in fragment need listener fired after come activity.or maybe after user made changes give user button go fragment , reload fragment meanwhile.i don't know either way. tried onresume() onstart() on every thing didn't work because nothing happened fragment in transaction. tried addonbackstackchangedlistener() should placed in activity not fragment. don't know do? time public static class placeholderfragment extends fragment { /** * fragment argument representing section number * fragment. */ private static final string arg_section_number = "section_number"; /** * returns new instance of fragment given section * number. */ public static placeholderfragment newinstance(int sectionnumber) { placeholderfragment fragment = new placeholderfragment(); bundle args = new bundle();

nginx - How to access Django App from NodeJS deployment in EC2 container -

i have django app machine learning server. used serve real-time predictions nodejs app. running application in amazon ec2 container , web-server in nginx. don't want expose django application outside world node.js server. have nodejs application running in ec2 container , accesses django application like request.post('http://localhost:8000/polls/distance', { form: { _id : json.stringify(req.user._id), "arr": json.stringify(arr) } }, (err, body, response) => { if (err) throw err; else { console.log(response); res.status(200).send(response); } }); my django app running locally @ address http://127.0.0.1:8000 . works fine on local system when try run on ec2 instance doesn't work. have tried command 'python manage.py runserver 0:8000' , tried accessing via ipaddress:port notation , loads saying bad request. close port on ec2 instance onc

android - Synchronized scrolling of multiple custom views -

i've got custom view, draws scale , handles touch event (horizontall scroll of scale). drawing part: @override public void ondraw(canvas canvas){ startingpoint = mainpoint; counter = 0; int = 0; while (startingpoint <= scalewidth) { if(i % 4 == 0) { size = scaleheight / 4; if (counter < 24) { counter = counter + 1; } else { counter = 1; } string c = integer.tostring(counter); canvas.drawtext(c, startingpoint, endpoint - (size + 20), textpaint); } else { if(i % 2 == 0) { size = scaleheight / 8; } else { size = scaleheight / 16; } } if(startingpoint >= closest) { //метки шкалы canvas.drawline(startingpoint, endpoint - size, startingpoint, endpoint, rulerpaint); } startingpoint = startingpoint + pxmm;

arcgis - ESRI javascript api 3.18 -

after adding more 5 mapimage in esri map ,zooming in chrome , mozilla takes lots of cpu. in chrome page specially hangs. if zoom level highest page stops working in chrome. in chrome,during image load page becomes unresponsive. var map = new esri.map('map', { //center: [6.6032, 53.1917], sliderstyle: "large", basemap:'topo', zoom:9, maxzoom:14, force3dtransforms: true, navigationmode: "classic" }); esridbimagelayer= new esri.layers.mapimagelayer({ 'id': 'usgs_basemap_image_overlay' }); esridbimagelayer.setopacity(0.7); map.addlayer(esribasedbimagelayer); //dbimagelist retrieved webservice necessary data. var tempimagelist = dbimagelist; for(var i=0;i<tempimagelist.length;i+

How does JavaFX handle cyclic property bindings? -

assume have following code snippet: private final booleanproperty = new simplebooleanproperty(false); private final booleanproperty b = new simplebooleanproperty(false); private final booleanproperty c = new simplebooleanproperty(false); private final booleanproperty d = new simplebooleanproperty(false); a.bind(c); c.bind(d.or(a)); how javafx handle that? because dependent c, c dependent on d or a). there formula recognize such 'exceptions'? my first thought property_a cant bound property_b bound property_a or depends on properties too, have properties bound property_a. right? javafx not prevent kind of dependency. there no cycle in dependencies , in case allowed. analyzing dependencies not possible, since bind takes observablevalue parameter, regardless of implementation , internals of implementation hidden "behind interface", it's impossible dependencies observablevalue . it's therefore

My Regex for File Filter Attribute in NiFi GetFile Processor is Failing -

i have list of files copy hdfs. the file names like: sample-11072016 sample-11082016 sample-11062016 sample-11062016 denodo-09082016 denodo-09122016 denodo-11082016 denodo-11072016 now trying write regex pick today's sample file. digits following file dates in sample-11082016 file of date 11/08/2016 the regex tried [sample]-(0-9){8} regex return sample files of dates checking 8 digits. please suggest on how find file today's date. problem here file name sample stays constant date keeps changing. have write regex pick file of today's date only. i pretty new regex, possible write regex check if date today's date. any suggestions help. nifi regex rules same java regex rules. regex expression should used against file filter attribute of getfile processor regards, sai_pb. you're there on regex. putting "sample" in between square brackets ('[' , ']'), you're saying "the first character sho

javascript - How can I reduce repetitiveness in Vue.js mixin with `computed` properties? -

here's code struggle make more dry: # src/mixins/stateclassmixin.js export default { computed: { statelabelclass: function () { return { 'label-primary': this.ticket && this.ticket.attributes.state === 'new', 'label-info': this.ticket && this.ticket.attributes.state === 'pending', 'label-warning': this.ticket && this.ticket.attributes.state === 'on_hold', 'label-success': this.ticket && this.ticket.attributes.state === 'closed' } }, statepanelclass: function () { return { 'panel-primary': this.ticket && this.ticket.attributes.state === 'new', 'panel-info': this.ticket && this.ticket.attributes.state === 'pending', 'panel-warning': this.ticket && this.ticket.attributes.state === 'on_hold', 'panel-success': t

ios - Enable zombie objects in Xamarin Studio -

i have ios app in xamarin crashes due exc_bad_access. wonder if possible enable zombie objects xcode. any appreciated. you can check enable zombie objects checkbox in tab called diagnostics of current build's run item . to run zombies instrument, go profile in project menu , choose memory group of instruments, , select zombies instrument. so when object unallocated, system not free marks zombie .

angularjs - secondary level routing in node js changes root directory -

in web project using angular js , node js both @ same time. for routing url in angular js have used below code app.config(function($routeprovider,$locationprovider) { $routeprovider .when("/expert/:expertname*", { templateurl : "public/views/individual_expert.html", controller:"usercontroller" }) .otherwise({ redirectto:"/home" }) $locationprovider.html5mode(true); }); in above case url generated follows , page displayed properly. http://localhost:3002/expert/58200b0f3574801df4ef767c this same thing executed when refresh page same url browser node js code executed. code snippet below app.get('/expert/:expertname',function(req,res){ if(req.session.usersession!=null){ if(req.session.usersession.type=="member") res.sendfile('index/member_index.html'); else if(req.session.usersession.type=="expert") res.sendfile('index/exp

Php search for specific links and append the url after them -

i have string following patterns $mystring="bla <a href="website.com"></a>"; with few more links , other html tags. i want use php function to: search href tags contain specific word. in case, word website.com . append text link same url every occurrence. example: <a href="website.com?bla"></a> should become to: <a href="website.com?bla"></a><br><a href="website.com?bla">new link here</a> and same goes rest links. how go doing this? first of all, should iterate around occurrences, using strpos method, using lastpos offset. insert string/new link, after finding closing $needle = "website.com?"; // word find $endlink = "</a>" $lastpos = 0; $str_to_insert = "<br><a href=\"website.com?bla\">new link here</a>" // text append while (($lastpos = strpos($mystring, $needle, $lastpos))!== f

javascript - jQuery Function to bring in "offcanvas" slide-in menu is not working -

i have tried , searched internet dry without solution problem. have created list in modified located off main screen slide-in menu using transform: translate (-100%). when main navbar collapses mobile button, intend assign jquery function button in order slide-in offcanvas menu. however, button not respond no matter , need aid. appreciated! /..the main navbar../ <nav class="main-navigation" role="navigation"> <ul> <li class="products1"><a href="#2">products</a></li> <li class="store1"><a href="#3">store</a></li> <li class="about1"><a href="#4">about us</a></li> <li class="discover1"><a href="#5">discover</a></li> <li class="support1"><a href="#6">support</a></

php - Eclipse not connecting to xdebug -

i unable connect xdebug eclipse. following xdebug config in php.ini [xdebug] zend_extension="/usr/local/opt/php56-xdebug/xdebug.so" xdebug.remote_port=10000 xdebug.remote_enable=1 xdebug.remote_connect_back = on xdebug.remote_host=127.0.0.1 xdebug.remote_log="/tmp/xdebug.log" and getting following log in xdebug.log log opened @ 2016-11-08 11:55:46 i: checking remote connect address. i: checking header 'http_x_forwarded_for'. i: checking header 'remote_addr'. i: remote address found, connecting 127.0.0.1:10000. i: connected client. :-) -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///library/webserver/documents/akeneo/pim-community-standard/web/app.php" language="php" xdebug:language_version="5.6.24" protocol_version="1.0" appid="6191" idekey="eclipse_dbgp"><engine version="2.4.1"><

vb.net - File Access Rights - how to replace Windows Msgbox? -

Image
i'm denying folder access throuh app, temporary thing on 1 of forms. know how replace windows msgbox own: this msgbox produced windows when user wants write data in folder, while app sets can't write @ moment. well, can't replace message box itself, make sure doesn't show up, , show own in place. i'm guessing you're trying write/change file? if that's case, check ahead of time if have rights so, , if not, show own messagebox instead of leaving windows so.

react native - Affix element on scroll -

Image
i play behavior . a tab component within scrollview should remain affix under navbar when scroll, problem applying absolute position tab relates scrollview. structure: <scrollview style={styles.scrollview} onscroll={this.onscroll} scrolleventthrottle={16}> <image source={....} /> <tab>...</tab> <view style={[styles.content, props.scrollableviewstyle]}> // lorem ipsum.. </view> </scrollview> image: how can play in react native?

My ionic app is not working on ios 10? -

i have added below meta tag in index.html still app not working on ios 10? when build on native device showing splashscreen.. <meta http-equiv="content-security-policy" content="default-src gap://ready file://* *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; style-src 'self' 'unsafe-inline' *"> try add content security policy follows: <meta http-equiv="content-security-policy" content="img-src * android-webview-video-poster: 'self' data:; default-src * 'self' gap: wss: ws: ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval';"> does resolve issue?

oop - What is a "runtime class" in Java? -

i try understand object.getclass() method does. the documentation says "returns runtime class of object." explanation doesn't me understanding term. has simple description of "runtime class" , getclass() does? just understand "an object has metadata of object's type". in object, can find methods declared in class, fields, type hierarchy, etc. information typically used code uses reflection either inspect objects/types or run method without need have class defined , compiled when they, being coded. "runtime" may emphasized because class definition may change on time, or object may declared supertype while instance of subtype of 1 declared. when class loaded, it's information, loaded during instance, returned getclass() method. in short, when code runs, vm have definition of class in different way "source" form type in .java file. information, of course after being compiled, loaded , metadata (as said

git - How to fix a commit accidentally marked as merge on SourceTree? -

sourcetree/bitbucket/git question: trying merge master branch feature branch in sourcetree, conflict detected. sourcetree downloaded , staged changes master branch , left me conflicted file fix. however, when resolving conflict, realized need make more changes file - so, unstaged files master branch , discarded changes in them, made modification in 1 remaining file , staged few lines , made commit. but, sourcetree still classified merge commit, it's marked such on bitbucket, despite fact commit merely changed few lines in 1 file , none of changes master branch included. the real problem when i'm trying merge master feature now, sourcetree says branch 'already up-to-date', despite fact not, , can see on diff tab on bitbucket. apparently, bitbucket thinks merged previous commit, although wasn't. how can fix situation? it seems mix when resolving conflict. want merge master branch feature branch? if yes, should select feature branch current branch, , cli

php - Data source error while trying to add user in custom audience -

i trying add user custom audience using following code $audience = new customaudience($custom_audience_id); $audience->addusers(array(trim($mailaddress)), customaudiencetypes::email); and $users = array( array('fname', 'lname', 'someone@example.com'), array('fnamenew', 'lnamenew', 'someone_new@example.com'), ); $schema = array( customaudiencemultikeyschemafields::first_name, customaudiencemultikeyschemafields::last_name, customaudiencemultikeyschemafields::email, ); $audience = new customaudiencemultikey(<custom_audience_id>); $audience->addusers($users, $schema); but getting error in both codes (#2650) failed update custom audience: audience created data source event_based.web_pixel_hits, not support data source file_imported.hashes_or_user_ids any suggestion how can solve or there way can add user while updating custom audience? you can create custom audience either website traffic(pixel),

.net - how can I read appsettings.json from angular? -

i trying read appsettings.json on angular , set url depending on settings on appsettings.json. on appsettings.json have defined url test , dev environments. i want on angular set urls depending on file. is possible? thanks you can use $http.get('path/to/appsettings.json') data json file.

shell - how to pass string to bash command as a parameter -

i have string variable contains loop. loopvariable="for in 1 2 3 4 5 echo $i done" i want pass variable bash command inside shell script. getting error bash $loopvariable i've tried bin/bash $loopvariable but doesn't work. bash treats string giving me error. theoretically execute it. not sure doing wrong bash: in 1 2 3 4 5 echo $i done: no such file or directory i have tried use approach using while loop. getting same error i=0 loopvalue="while [ $i -lt 5 ]; make -j15 clean && make -j15 done" bash -c @loopvalue when use bash -c "@loopvalue" following error bash: -c: line 0: syntax error near unexpected token `done' and when use use bash -c @loopvalue [: -c: line 1: syntax error: unexpected end of file you can add -c option read command argument. following should work: $ loopvariable='for in 1 2 3 4 5; echo $i; done' $ bash -c "$loopvariable" 1 2 3 4 5 from man bash: -c

Custom compressioncodec on Spark -

has developed java-based custom compressioncodec apache spark (i.e. org.apache.spark.io.compressioncodec)? unlike older versions, requires implementation of 2 methods in class: compressedinputstream , compressedoutputstream i'm working on this, , works smaller data sizes, shows "executor lost" errors larger sizes. i'm seeing end() method of compressor class never called. wonder if might bug in spark lower level library (i'm using spark 1.5.1). has been down path? thanks.

javascript - Creating a calendar in HTML -

i'm creating calendar in html part of school project. so far i've created basics of page. i'd calendar, you're able create appointments, show (like basic calendar). here i've made far (it's danish, don't think should problem. let me know if you'd translated though): html: <html> <head> <title>december</title> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script src="javascript.js"></script> </head> <body> <div class="navigation"> <div id="forrige"> <a href="november.html">forrige måned</a> </div> <div id="naeste"> <a href="januar.html">næste måned</a> </div> </div> <br><br>

c# - IIS App pool stop -

today face weird issue on server iis app pool stop have restart manually start website. i have rapid fail protection : true (5 min - 5 times) i have try generate scenario in local iis manually trigger division 0 error iis not crashing. i have tried check event log long lot of entries there. how check why particular app pool crash due reason/exception?

node.js - Timeout Error (errno: 2) while reading data from usb -

i getting libusb_transfer_timed_out error ( errcode: 2 ) when trying read data usb. using this module. function onusbattached(device) { console.log('you gotta usb.\n'); device.open(); // open device. // console.log(device.interfaces); var syncinterface = device.interfaces[0]; // sync interface var asyncinterface = device.interfaces[1]; // async interface // console.log('incomingendpoint', incomingendpoint); if(syncinterface.iskerneldriveractive()){ console.log('kernel driver active. detaching kernel driver.'); syncinterface.detachkerneldriver(); } console.log('claiming interface'); syncinterface.claim(); var inendpoint = syncinterface.endpoints[0]; var outendpoint = syncinterface.endpoints[1]; // .controltransfer(bmrequesttype, brequest, wvalue, windex, data_or_length, callback(error, data)) device.controltransfer(0xc0, 0x32, 0, 0, 1, function (err, data) { if(

JMX issue with DataStax OpsCenter Agent -

we're running 8 node dse cluster (just cassandra) divided among 2 datacenters. working fine apart agent on 1 node stubbornly refuses cooperate. here version info: cassandra 3.0.9.1346 dse 5.0.3 opscenter 6.03 all nodes have upgraded sstables , have been repaired. here log: info [async-dispatch-47] 2016-11-08 14:33:13,811 starting system. info [async-dispatch-47] 2016-11-08 14:33:13,832 starting dynamicenvironmentcomponent warn [async-dispatch-47] 2016-11-08 14:33:13,845 exception while processing jmx data: java.lang.nullpointerexception error [async-dispatch-47] 2016-11-08 14:33:13,845 error starting dynamicenvironmentcomponent. java.lang.nullpointerexception @ clojure.java.io$as_relative_path.invoke(io.clj:404) @ clojure.java.io$file.invoke(io.clj:416) @ opsagent.environment.collection$cassandra_yaml_location__gt_install_location.invoke(collection.clj:118) @ opsagent.environment.dynamic$dynamic_env_state.invoke(dynamic.clj:61) @