Posts

Showing posts from August, 2010

eclipse - Getting an error "error while loading shared libraries: libmpi.so.1: cannot open shared object file: No such file or directory" -

Image
getting error "error while loading shared libraries: libmpi.so.1: cannot open shared object file: no such file or directory" while running veins simulation in omnet++ edit: i reinstalled omnet++ , getting error: jvm terminated. exit code=13 /home/jayabalan/usr/omnetpp-4.6/ide/jre/bin/java -dosgi.requiredjavaversion=1.7 -xms256m -xmx1024m -xx:maxpermsize=320m -dosgi.instance.area.default=/home/jayabalan/usr/omnetpp-4.6/bin/../ide/../samples -jar /home/jayabalan/usr/omnetpp-4.6/ide//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar -os linux -ws gtk -arch x86_64 -showsplash -launcher /home/jayabalan/usr/omnetpp-4.6/ide/omnetpp -name omnet++ ide --launcher.library /home/jayabalan/usr/omnetpp-4.6/ide//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326/eclipse_1605.so -startup /home/jayabalan/usr/omnetpp-4.6/ide//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar --launcher.appendvmargs -exitdata 340021 -vm /home/jayaba

angularjs - AOT compiled code throws error - No provider for t -

i getting following error when run angular application. front end in angular , back-end uses spring. build.js:1 **exception: uncaught (in promise): error: no provider t! error: no provider t!** @ e [as constructor] (http://localhost:8080/xo-as/ng/build.js:1:59315) @ e [as constructor] (http://localhost:8080/xo-as/ng/build.js:1:60416) @ new e (http://localhost:8080/xo-as/ng/build.js:1:60744) @ t._throwornull (http://localhost:8080/xo-as/ng/build.js:1:71064) @ t._getbykeydefault (http://localhost:8080/xo-as/ng/build.js:1:71402) @ t._getbykey (http://localhost:8080/xo-as/ng/build.js:1:70782) @ t.get (http://localhost:8080/xo-as/ng/build.js:1:69150) @ e.get (http://localhost:8080/xo-as/ng/build.js:1:126499) @ e.t.injectorget (http://localhost:8080/xo-as/ng/build.js:1:152798) @ e.get ( when researched online solutions came across few posts mentioned because of cookieoptions. in following link, have suggested solutions well. https://github.com/salemdar/angular2-cookie/issues/37

algolia integration formulaire symfony -

i looking integrate algolia search bar. able index elements without problem. this form: public function searchaction(request $request) { $article = new article(); $form = $this->createformbuilder($article) ->add('title') ->getform() ; if ($form->handlerequest($request)->isvalid()) { $this->get('algolia.indexer')->search( $this->getentitymanager(article::class), 'adminbundle:article', 'test'); return $this- >render('mainbundle:search:searchresults.html.twig', array( 'article' => $article )); } return $this->render('@main/search/search.html.twig', array( 'form' => $form->createview(), )); }

sonar github plugin for scala [sonarqube] [github] -

using sonar github plugin, did several java base based projects jenkins -> sonar scan -> github pull request i need same thing scala based project (regular scala sonar run well). however, plugin (sonar-github) seems dropping scala scan results. luck it? or impossible do? or need plugin? thanks chris l there's no official code analyzer scala. that's reason why no issues detected on scala code. note not relate github plugin, aims decorate pull requests issues raised code analyzers.

Locust. Read --host value from python code -

locust --no-web --client=1 --hatch-rate=1 --num-request=2 --host= http://localhost i want read --host value provided in cmd line in httplocust class. aware can use host attribute direct assignment not want it. want read value cmd line in httplocust class. building custom logs , want pass value logs. tried httplocust.host returns none. also want read --web-port python code. you can access via sys.argv or parse options via argparse import argparse parser = argparse.argumentparser() parser.add_argument('-h', '--host') args, unknown = parser.parse_known_args() print str(args.host)

r - Finding difference in dates by grouped variable -

i working on master's thesis , need r coding. analyzing movements of wild turkeys during different stages of reproduction. need find difference in last date , first date individual within area. x<- data.frame( areaid = c(1,1,1,1,2,2,2,2), timestamp=as.posixct(c("06/01/2014 05:01", "6/01/2014 13:00","06/01/2014 23:00", "06/02/2014 10:00","06/20/2015 09:00", "06/20/2015 10:00", "06/20/2015 11:00", "06/20/2015 12:00"), format='%m/%d/%y %h:%m')) i need new dataframe areaid , time spent in area. thanks help. the dplyr solution @gregor should work. however, if dplyr not functioning properly. can try approach using data.table . library(data.table) setdt(x) x[, .(duration = max(timestamp) - min(timestamp)), = areaid] areaid duration 1: 1 1.207639 days 2: 2 3.000000 days or use aggregate function base r. aggregate(timestamp ~ areaid, data = x, fun = funct

java - add user using spring mvc framework -

hello want save user database using spring mvc framework got error. java.lang.illegalstateexception: neither bindingresult nor plain target object bean name 'command' available request attribute @ org.springframework.web.servlet.support.bindstatus.<init> (bindstatus.java:144) atorg.springframework.web.servlet.tags.form.abstractdataboundformelementtag. getbindstatus(abstractdataboundformelementtag.java:168)at org.springframework.web.servlet.tags.form.abstractdataboundformelementtag. getpropertypath(abstractdataboundformelementtag.java:188) @ org.springframework.web.servlet.tags.form.abstractdataboundformelementtag .getname(abstractdataboundformelementtag.java:154) @ org.springframework.web.servlet.tags.form.abstractdataboundformelementtag .autogenerateid(abstractdataboundformelementtag.java:141) atorg.springframework.web.servlet.tags.form.abstractdataboundformelementtag. resolveid(abstractdataboundformelementtag.java:132) atorg.springframework.web.servlet.tag

android - How to change the name of a Kotlin property to match the field to on Firebase database -

i want change name of field kotlin property pointing on firebase database. for instance: i have property count in kotlin var count: int but name on firebase items_count . i've tried using: when try using @propertyname("items_count") var count: int but doesn't work. i achieved using: @set:propertyname("items_count") @get:propertyname("items_count") var count: int

ASP.NET MVC - Working with Editor Templates on Mobile Display mode -

i'm adapting asp.net mvc 5 web application better fit on mobile devices. followed example of basic implementation of display mode feature. this working fine when returning view controller, i.e., view called myview.cshtml serve myview.mobile.cshtml file. inside view call editor template this: @html.editorfor(model => model.someproperty) i expected behavior same when using editor , display templates, so, added file /editortemplates/someproperty.mobile.cshtml , appears not working. it works fine on desktop, on mobile version blank template should displayed. could missing here or maybe not supported? as workaround, implemented snippet http://detectmobilebrowsers.com/ check if mobile , ended doing this: @{ var ismobile = (bool)viewbag.ismobile; } @foreach (var m in model.someproperty) { @html.partial(string.format("~/views/editortemplates/someproperty{0}.cshtml", ismobile ? ".mobile" : ""), m) }

c - free() crashing on char array, but only if the array holds exactly 7 elements -

i have simple c program supposed read message sent program, unix named pipe , show user. the way program following : reads incomming message size pipe allocates enough memory incoming message, plus byte null terminator reads incoming data allocated memory appends null terminator , returns the code following : void* receivefrompipe(char* pipe, int* stuffsize){ printf("opening pipe\n"); int fd = open(pipe,o_rdonly); printf("pipe opened write side\n"); read(fd,stuffsize,sizeof(stuffsize)); printf("incoming message size : %d\n",*stuffsize); void* stuffpointer = calloc((*stuffsize) + 1,1);//allocate stuffsize bytes printf("allocated memory stuff\n"); read(fd,stuffpointer,*stuffsize); printf("read stuff pipe\n"); close(fd); printf("closed pipe\n"); ((int*)stuffpointer)[*stuffsize] = 0x00; return stuffpointer; } and code in main function simple read-free loop, :

python - Pandas dataframe cannot convert columns datatype from object to string for further operation -

Image
this working code, downloading excel file website. takes 40 seconds. once run code, notice key1, key2 , key3 columns object dtypes. cleaned dataframe such key1 , key2 have alphanumeric values. still pandas keeping object dtype. need concatenate (as in ms excel) key1 , key2 create separate column called deviceid. realize cannot join 2 columns since object dtypes. how convert string can create new column? import pandas pd import urllib.request import time start=time.time() url="https://www.misoenergy.org/library/repository/market%20reports/20170816_da_bcsf.xls" cnstsfxls = urllib.request.urlopen(url) xlsf = pd.excelfile(cnstsfxls) dfsf = xlsf.parse("sheet1",skiprows=3) dfsf.drop(dfsf.index[len(dfsf)-1],inplace=true) dfsf.drop(dfsf[dfsf['device type'] == 'un'].index, inplace=true) dfsf.drop(dfsf[dfsf['device type'] == 'unknown'].index, inplace=true) dfsf.drop(['constraint name','contingency name', 'constraint

Firebase angulafire search not linking with database -

Image
i looking list of customers whom invite has been enabled through email. following ts alert: invitecustomer(): void { let prompt = this.alertctrl.create({ title: 'invite customer', message: "customer invited join app.", inputs: [ { name: 'name', placeholder: "your customer's name", type: 'text' }, { name: 'mobile', placeholder: "your customer's mobile number", type: 'mobile' }, { name: 'email', placeholder: "your customer's email", type: 'email' }, ], buttons: [ { text: 'cancel', handler: data => { console.log('cancel clicked'); } }, { text: 'save', handler: data => { this.customerprovider.invitecustomer(data.name, data.mobile, data.email,this.retailerprofile.retailerid, this.retailerprofile

angularjs - Javacript not working in materialize sidenav using angular ngInclude? -

i implementing angularjs's ng-include header in materialize framework.i'm using xampp apache local server. ng-include working correctly in mobile view sidenav() not working.in chrome browser's console i'm getting message i guess i'm doing silly mistake can't figure out.please help. check link: filename = index.html, ext = .html the project present in below structure demo -css --site.css -js --site.js --app.js -vendor --css ---materialize.min.css --js ---angular.min.js ---materialize.min.js index.html header.html index.html <!doctype html> <html> <head> <meta charset="utf-8" /> <link href="http://fonts.googleapis.com/icon?family=material+icons" rel="stylesheet"> <link type="text/css" rel="stylesheet" href="vendor/css/materialize.min.css" media="screen,projection" /&g

javascript - Using template literal for dynamic property in ReactJS -

my failed attempt: temp.map((obj,i) => ({ obj[`person${++i}`] = obj.person.name }) i want produce this [{id:324, person1:'mike'},{id:23, person2:'jane'}] but i'm stuck on making property dynamic concatenation using template literal string. issue code is, directly returning data using () => ({....}) and there using obj[...] not valid key. map return new array store result in new variable, if want modify same array better use foreach . check snippet: let arr = [{id: 10, name: 'a'}, {id: 20, name: 'b'}]; let newarr = arr.map((el,i) => ({ id: el.id, [`name${i+1}`]: el.name })); console.log('new array', newarr); modifying same data using foreach : let arr = [{id: 10, name: 'a'}, {id: 20, name: 'b'}]; arr.foreach((el,i) => { el[`person${i+1}`] = el.name; }) console.log('modified array', arr);

animation - If browser fails to generate frames on time for displays, On which side dropping of a browser frame happens? -

i have been trying understand critical render path of browser quite future seminar. understand process, there 1 thing that's bugging me. hearing frame dropping quite lot. i understand device refreshes screen 60 times in second (60hz). browser has generate 60 frames in second smooth animations. browser gets 16.7 ms(mostly 10-12ms) generate frame. so, if browser fails generate frame under 16.7ms, frame go? still displayed on screen? if still gets displayed, frame drop mean missing 1 of device refresh slot right?? so, example if browser generates 15 frames in second , feed display of device, device displays 15 frames since frame rate low , missing 45 screen refresh slots, user of device can recognize jank. is above explanation correct?

javascript - operation is not supported - readAsArrayBuffer -

i trying convert blob data arraybuffer. so, using filereader,but getting error "operation not supported". var audioctx = new(window.audiocontext || window.webkitaudiocontext)(); navigator.mediadevices.getusermedia({audio: true}).then(function onsuccess(stream) { debugger; rec = new mediarecorder(stream); rec.ondataavailable = function(e) { audiochunks.push(e.data); }; rec.onstart = function(e) { audiochunks = []; } rec.onstop = function(e) { var blobdata = new blob(audiochunks, { type: 'audio/x-l16' }); debugger; var reader = new filereader(); reader.onload = function() { audioctx.decodeaudiodata(reader.result, function(buffer) { resample(buffer, 16000, function(newbuffer) { debugger; var arraybuffer = convertfloat32toint16(newbuffer.getchannel

Conversion of arrays in java -

assume have array of integers, int[] x={0,1,2,3}; can convert x array of type string? can upcast x array of doubles? above conversions, mean converting entries of array collectively, not individually. how conversions work arrays in java? have convert each entry of original array , assign corresponding entry of target array? in java8 can do: int[] x = {0,1,2,3}; // int double double[] doublesarray = arrays.stream(x).asdoublestream().toarray(); //int string string[] stringarray = arrays.stream(x).maptoobj(string::valueof).toarray(string[]::new); // string double double[] doublesarrayfromstring = arrays.stream(stringarray).maptodouble(double::valueof).toarray(); arrays.stream(doublesarray).foreach(system.out::println); arrays.stream(stringarray).foreach(system.out::println); arrays.stream(doublesarrayfromstring).foreach(system.out::println); here 's running code.

PCRE regex to Re2 Regex without negative lookahead -

i trying use regex filter emails addresses in office g suite account email routing. in order so, have created following regex in order following: accept email address domain "domain.com" reject 2 of addresses domain. in order so, created following regex complete said function: ^(?!test|tes2)[a-z0-9._%+-]+@domain.com$ this 1 reject both test@domain.com , tes2@domain.com , accept other combinations said domain. however, g suite not accept pcre regex, cannot achieve this. temporarily, created following re2 regex accept email addresses said domain: (\w|^)[\w.+\-]{0,25}@(domain)\.com(\w|$) how can expand allow functionality intended since lookarounds not allowed in re2 regex? because negative lookahead fixed size, it's relatively straightforward expand so. explode in complexity though; i've added comments , spacing readability. ^ ( # not /^t/ [a-su-z0-9._%+-][a-z0-9._%+-]* | # /^t/ not /^te/ t ([a-df-z0-9._%+-][a-z0-9._%+-]*)? |

spring - Docker container accessing external MySQL host -

i have setup spring-boot docker container in ec2 instance(ec2_ip) , have mysql hosted in different vm. verified that mysql host(mysql_ip) accessible ec2 instance hosting docker container. i passing spring.datasource.url parameters using docker environment variables during docker run. the spring boot app fails complaining error message access denied user db_user@ec2_ip . part unable understand , fix. don't understand why trying connect ec2_ip instead of db_user@mysql_ip . i did docker inspect , verified environment variable spring.datasoure.url passed correctly , db_user@mysql_ip:3306. i have spent hours trying fix problem, no luck. appreciated. to clarify based on comments, have datasource configured correctly. inside docker inspect, value of args: -dspring.datasource.url=jdbc:mysql://mysql_ip:3306/test also, checked if pass invalid ip (eg) random text, throws error saying host invalid (this confirms, taking host pass in). however, if configure external ip, see

python 3.x - Why does my binary search use so many comparisons? -

here code: def binary_search(sortedlist,target,comparisons): start = 0 end = len(sortedlist) - 1 while(end - start >= 0): mid = (start + end)//2 comparisons += 2 if(target < sortedlist[mid]): comparisons -= 1 end = mid - 1 elif(target > sortedlist[mid]): start = mid + 1 else: return target, comparisons return false, comparisons it same every other post on here binary searching reason uses way many comparisons. here code after fixed myself from classes import genelist ## uncomment following line able make own testing genes # classes import gene, genome def binary_search(sortedlist, target, comparisons): reducedlist = sortedlist while len(reducedlist) > 1: mid = len(reducedlist) // 2 comparisons += 1 if target < reducedlist[mid]: reducedlist = reducedlist[:mid] else: reducedlist = reducedlist[mid:] comparisons += 1 if reducedlist[0] =

android - Retrofit continuous query not working properly in mobile network -

i using retrofit parsing json api. when using mobile network (not wifi) continuously making query retrieve response api getting time out error. code : userlogin("username"). enqueue(new retrofitcallback<patientmodel>() { @override public void onsuccess(patientmodel result) { if (null != result) { loginresponse(result); } } @override public void onfailure(int code, string msg) { } @override public void onthrowable(throwable t) { } @override public void onfinish() { hideprogress(); } }); maybe must increase time out. try : gson gson = new gsonbuilder() .setdateformat(&qu

wordpress - Widget not saving in admin side when inline css is called -

my widget content , <div style="padding-right: 20%;"> <div class="foot_address">lorem ipsum dummy</div> <div style="width: 100%; height: 1px; background: #b2b2b2;"></div> [divider height="15"] +91 123456678 <div style="width: 100%; height: 1px; background: #b2b2b2;"></div> [divider height="15"] info@example.com <div style="width: 100%; height: 1px; background: #b2b2b2;"></div> [divider height="15"] <div> when i'm removing div classes , styles widget saving , not present data . it working in localhost , issue raised when moved live server. this issue seems have started wordpress 4.8. maybe localhost, got older version , reason works there. one solution use classic text widget plugin adds widget allows html code. aware plugin uses php namespaces supported in php version 5.3.0 , higher.

Handsontable edit data on row change -

i using nghandontable datagrid. facing 1 problem not finding row change event. need because if save data on afterchange event in database table, server hit on every cell change can cause performance problem. so want hit server on row change event hit after changes done row. please me suggestion or work around of problem.

r - How can I view the source code for a function? -

i want @ source code function see how works. know can print function typing name @ prompt: > t function (x) usemethod("t") <bytecode: 0x2332948> <environment: namespace:base> in case, usemethod("t") mean? how find source code that's being used by, example: t(1:10) ? in other cases, can see r functions being called, can't find source code functions. > ts.union function (..., dframe = false) .cbind.ts(list(...), .makenamests(...), dframe = dframe, union = true) <bytecode: 0x36fbf88> <environment: namespace:stats> > .cbindts error: object '.cbindts' not found > .makenamests error: object '.makenamests' not found how find functions .cbindts , .makenamests ? in still other cases, there's bit of r code, of work seems done somewhere else. > matrix function (data = na, nrow = 1, ncol = 1, byrow = false, dimnames = null) { if (is.object(data) || !is.atomic(data)) data <

python - NotADirectoryError: [WinError 267] The directory name is invalid: 'Directory' -

so i'm working on python project simulate systems deletes information after typing wrong passwords. import os password = str(input("set password: ")) treisleft = 3 path = "c:\users\person\desktop\python projects\password.py" while (treisleft > 0): x = str(input("what's password? ")) if (x == password): print("access granted, welcome :d") file = open ("c:\\users\\\person\\downloads\\documents\\spanish course.txt", "r") print (file.read()) break else: print("access denied, try again") treisleft -= 1 if (treisleft == 0): print ("nice try hacker!!") os.removedirs (path) the problem error: [winerror 267] directory name invalid: c:\users\person\desktop\python projects\password.py (the directory basically)

php - How can I add zones into MySQL database using leaflet? -

i created admin interface user can add markers(hospitals, school) , want extend app drawing polygons(parks, zones). thing connected map , can draw polygons, can't coordinates , add them database. how can this? thanks! you can try : https://bl.ocks.org/danswick/d30c44b081be31aea483 the interesting part : var featuregroup = l.featuregroup().addto(map); var drawcontrol = new l.control.draw({ edit: { featuregroup: featuregroup } }).addto(map); map.on('draw:created', function(e) { // each time feature created, it's added feature group featuregroup.addlayer(e.layer); }); // when click on button export document.getelementbyid('export').onclick = function(e) { // extract geojson featuregroup var data = featuregroup.togeojson(); // stringify geojson var converteddata = 'text/json;charset=utf-8,' + encodeuricomponent(json.stringify(data)); // create export document.getelementbyid('export

I can't quote swift viewController class into Objective-c projects -

i have objective-c project @ present.i need add swift programming language in objective-c project.i imported prjectname-swift.h,but created swift file in objective-c project,i can't quote swift file in objective-c project.below set example, use pictures present.i use xcode version 8.3.3 enter image description here enter image description here

c# - WCF service data caching technique -

currently wcf service provides method in api performs health check of specific device in same local network. simplified version of method: public status devicehealthcheck() { return device.isalive() ? status::alive : status.not_responding; } the problem device.isalive() establishes network connection device , when lot of clients call devicehealthcheck() network traffic turns out huge bottleneck. i create 1 thread work time in background , call device.isalive() every few second , update variable working cache. @ stage devicehealthcheck() might this: public status devicehealthcheck() { return cachedhealthstatus; } i don't know how create such background thread in wcf service. or maybe there solution problem?

docker - dynamically adding nginx container ip into phpfpm /etc/hosts file -

looking automatically add nginx container ip address inside phpfpm container /etc/hosts file. inside yml file, have service called phpfpm, , know can use extra_hosts attribute assign values /etc/hosts file, don't know how dynamically call place nginx container ip. nginx: build: ./nginx ports: - "80:80" - "443:443" volumes: - ../public/:/var/www/html/public/ container_name: nginx networks: - backend phpfpm: build: ./php-fpm volumes: - ../public/:/var/www/html/public/ container_name: phpfpm extra_hosts: - "test.local:nginx" <insert nginx ip test.local> networks: - backend any thoughts on how this? containers within compose file run on same network , can names. phpfpm , nginx in case. if need more names same service need use aliases nginx: build: ./nginx ports: - "80:80" - "443:443" volumes:

Does Delphi TClientDataSet.IndexFieldNames really remove records from the dataset (make them invisible)? -

i execute following code in delphi: myclientdataset.indexfieldnames:='field1;field2;field3' and can see myclientdataset.recordcount shows reduced number of records while temporary index active. if make while loop: while not myclientdataset.eof begin //... code myclientdataset.next; end; then part of records visited in loop while temporary index active. records lost without specific order: of lost records can have nil values in indexed fields , of lost records have fields values. is such behavior design or have discovered clientdataset bug (maybe dependent upon specific version of midas.dll library) or need configure tclientdataset in specific way (i can not imagine - how)? i working delphi 6 guess problem can in later delphi versions well.

python - A ImportError when I install pycaffe without MKL -

i'm doing project, using intelcaffe. when run python code : import sys caffe_root = '/path/to/caffe/' sys.path.insert(0, caffe_root + 'python') import caffe caffe.set_mode_cpu() i following error: file "caffemodel.py", line 6, in <module> import caffe file "../../caffe/python/caffe/__init__.py", line 37, in <module> .pycaffe import net, sgdsolver, nesterovsolver, adagradsolver, rmspropsolver, adadeltasolver, adamsolver file "../../caffe/python/caffe/pycaffe.py", line 49, in <module> ._caffe import net, sgdsolver, nesterovsolver, adagradsolver, \ importerror: libmkldnn.so: cannot open shared object file: no such file or directory i want know how solve . hope me . thank you!

How to enable mobile hotspot programmatically in marshmallow and above android version? -

i've tried create wifi tethering hotspot in android marshmallow using following code. public class wifiaccessmanager { private static final string ssid = "mhotspot"; public static boolean setwifiapstate(context context, boolean enabled) { //config = preconditions.checknotnull(config); try { wifimanager mwifimanager = (wifimanager) context.getsystemservice(context.wifi_service); if (enabled) { mwifimanager.setwifienabled(false); } wificonfiguration conf = getwifiapconfiguration(); mwifimanager.addnetwork(conf); return (boolean) mwifimanager.getclass().getmethod("setwifiapenabled", wificonfiguration.class, boolean.class).invoke(mwifimanager, conf, enabled); } catch (exception e) { e.printstacktrace(); return false; } } public static wificonfiguration getwifiapconfiguration() { wificonfiguration conf = new wificonfiguration(); conf.ssid = ssid; conf.all

How to split a string in Java -

i have string, "004-034556" , want split 2 strings: string1=004 string2=034556 that means first string contain characters before '-' , , second string contain characters after '-' . want check if string has '-' in it. if not, throw exception. how can this? just use appropriate method: string#split() . string string = "004-034556"; string[] parts = string.split("-"); string part1 = parts[0]; // 004 string part2 = parts[1]; // 034556 note takes regular expression , remember escape special characters if necessary. there 12 characters special meanings: backslash \ , caret ^ , dollar sign $ , period or dot . , vertical bar or pipe symbol | , question mark ? , asterisk or star * , plus sign + , opening parenthesis ( , closing parenthesis ) , , opening square bracket [ , opening curly brace { , these special characters called "metacharacters". so, if want split on e.g. period/dot . means " an

c++ - What is the difference between following two snippets? -

char *t=new char(); and char *t=new char[102]; as code accepted using latter one? //bishops spoj char *t=new char(); allocates memory single character, , calls default constructor. char *t=new char[102]; creates array of 102 char s , calls default constructor. as default constructor pod types nothing, difference amount of memory allocated (single char vs array of char)

Microstrategy - creating a simple percentage column -

i have metric shows sum(widgets). want find out number of widgets faulty, created metric that. want find % faulty total, , have created widget % calculation, not show other 0.00% whether there values or not. definition in metric editor: ([number of faulty widgets] / [number of widgets]) i've been on microstrategy community , have tried possible solutions/formatting etc. no avail. i've looked @ % column settings in other % metrics in our projects , can't see difference in settings or way formulated. can helps me try figure out why getting 0%? thanks andrew

angularjs - How to validate parent form from inner form -

i have form following : <form name="mypage.myform"> ... <ng-include src="'panel1.html'"></ng-include> ... <md-button ng-disabled="mypage.myform.$invalid || mypage.myform.$pristine" ng-click="mypage.save()" type=submit> enregistrer </md-button> <md-button ng-disabled="mypage.myform.$invalid || mypage.myform.$pristine" ng-click="" > annuler </md-button> </form> and code of included html : <div layout=row layout-sm=column > <my-link link-entity=mypage.dto.organisme constraints=mypage.constraints on-select-item-handler standalone=true search-min-length=0 flex></my-link> </div> mylink component: .component('mylink', { bindings: { linkentity: '=', constraints: '=?', fieldname: '@', standalone: 

python - SQLAlchemy Primary Key from Unique and Primary Foreign Keys -

i have 2 tables, reports , bids, 1 many relationship report can have multiple bids. simplified report looks this: class report(base): __tablename__ = 'reports' dr_nbr = column(char(14), primary_key=true) header_trade = column(varchar(255), unique=true) bids = relationship("biddetail", lazy="dynamic") the bids table looks this: class biddetail(base): __tablename__ = 'bids' report_id = column(char(14), primary_key=true) report_header_trade = column(varchar(255), primary_key=true) __table_args__ = (foreignkeyconstraint( [report_id, report_header_trade], [report.dr_nbr, report.header_trade]), {}) i have tried few ways import 2 keys reports , use primary keys. know when use primary foreign keys table need define foreignkeyconstraint , when 1 foreign key primary , unique doesn't work. thing i've tried (by researching similar qu

node.js - iTunes Rank API(Sales and Trends) return empty value -

sales , trends reporting api returning empty array object after 03-aug-2017. have response in api call till 03-aug-2017. https://reportingitc2.apple.com/api/data/ranked var itc = require("itunesconnect"); var report = itc.report; var itunes = new itc.connect('xxxxxx', 'yyyyy'); var query = report('ranked', { start:'yyyy-mm-dd', end:'yyyy-mm-dd', }); itunes.request(query, function(error, result) { console.log(result); }); data available in site .

phpmyadmin status monitor cannot be start -

under localhost>status>monitor [start monitor] [settings] [instructions/setup] not response clicking. else works fine. please help. thank you. server version: 5.5.52-mariadb - mariadb server web server: apache/2.4.6 (centos) openssl/1.0.1e-fips php/5.6.31 mod_perl/2.0.10 perl/v5.16.3 phpmyadmin version: 4.4.15.10 os: centos 7.3

java - Change compiledSdkVersion in Aide (Android) -

i learning how build android app using java. since don't have pc right now, using android phone mean time. using aide app. i following project https://github.com/sagar-viradiya/android-design-support-lib-demo/blob/master/app/build.gradle have no luck in building , running app. dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.android.support:recyclerview-v7:22.2.0' compile 'com.android.support:cardview-v7:22.2.0' compile 'com.android.support:design:22.2.0' compile 'com.android.support:support-v4:22.2.0' } since dependencies of project on version 22.2.0, , built-in compiledsdkversion in aide 19 got error like: 'aapt: error retrieving parent item: no resource found matches given name textappearance.appcompat.caption' i searched why have error online , found out because compiledsdkversion , dependency versions i'm using doesn&

Why is autoprefixer not working (GULP) -

so works. @ file produced , gulp-autoprefixer has worked , can see -webkit on transitions , transforms. gulp.task("admin-scss", () => { $.fancylog("-> compiling admin .scss"); return gulp.src(pkg.paths.src.admin + pkg.vars.scssname) .pipe($.plumber({ errorhandler: onerror })) .pipe($.sourcemaps.init({ loadmaps: true })) .pipe($.sass({ includepaths: pkg.paths.scss }) .on("error", $.sass.logerror)) .pipe($.cached("sass_compile")) .pipe($.autoprefixer()) .pipe($.rename(pkg.vars.adminname)) .pipe($.cssnano({ discardcomments: { removeall: true }, discardduplicates: true, discardempty: true, minifyfontvalues: true, minifyselectors: true })) .pipe($.header(banner, { pkg: pkg }))

angularjs - Cross-origin Ajax request to API returns 500 (Internal Server Error) response -

i getting error response '500 (internal server error)' when get call api. here’s error message: xmlhttprequest cannot load http://10.10.14.188:4800/api/v1/healthmonitor/devicestatus . response preflight request doesn't pass access control check: no 'access-control-allow-origin' header present on requested resource. origin ' http://192.168.4.217 ' therefore not allowed access. response had http status code 500. …though response when try postman or using curl command. in call, have pass id in header. here code: this.getstate = function () { return $http({ method: 'get', url: 'http://10.10.14.188:4800/api/v1/healthmonitor/devicestatus', headers: {'jab_device_id': '80f1374192a6d6eb9ebf48e2eba18366','content-type': 'application/json'} }); }; also, tried ajax got same error. here code: $.ajax({ url: '

c - Get the Apple llvm clang compiler with MP and MPI support -

i have compile program (gromacs 4.6) on mac mpi , mp support , cuda. cuda 8.0 (required) not allow use of gcc on mac, "apple llvm 8.0.0". i tried hard set clang compiler support openmp , openmpi not working. what managed getting llvm 4.0.0 installed openmp , openmpi support, compiling nvcc complaining: nvcc fatal : version ('40000') of host compiler ('clang') not supported is there way got apple llvm openmp support? edit: $ clang-4.0 -fopenmp hello_openmp.c # works fine $ gcc -fopenmp hello_openmp.c clang: error: unsupported option '-fopenmp' $ gcc --version configured with: --prefix=/library/developer/commandlinetools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 apple llvm version 8.0.0 (clang-800.0.42.1) target: x86_64-apple-darwin16.7.0 thread model: posix installeddir: /library/developer/commandlinetools/usr/bin $ clang-4.0 --version clang version 4.0.1 (tags/release_401/final) target: x86_64-apple-darwin16.7.0

email - How to filter my follow up task in shared mailbox -

i have added shared account in outlook caused tasks mixed shared account. can filter of task mails sent not me follow - cannot filter. instance, need filter email follow from:guy1@la.com to: guy2@la.com, email in shared folder. despite fact there option filter "only items which" flagged me - not work in case. there example selects follow emails sent me or me: ("http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-c000-000000000046}/811c000b" = 0 , "http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-c000-000000000046}/81050040" <= 'yesterday' , "urn:schemas:httpmail:displayto" '%my surname%' , "http://schemas.microsoft.com/mapi/received_by_name" '%my surname%')

How can I execute my Thomas Algorithm function using Matlab? -

i have created function execute thomas algorithm. i'm trying use function solve system following arrays: b = -4ε + 2αh^2 a = 2ε - h(1+α(n+1)h) c = 2ε + h(1+αnh) g = 4kπh^2sin(kπnh) where α=1.2, k=2, ε=0.02, r=4 i've inserted function (below), i'm not sure how enter in these parameters in command window i'm pretty new matlab. appreciated. function y = thomasalgorithm(a,b,c,f) % obtain values m = length(f); f(1) = f(1)/b(1); % forward substitution j = 1:m-1 c(j) = c(j)/b(j); b(j+1) = b(j+1) - a(j)*c(j); f(j+1) = (f(j+1) - a(j)*f(j))/b(j+1); end; % backwards substitution k = m-1:-1:1 f(k) = f(k) - c(k)*f(k+1); end; % output y = f; end i tried put command window (below) got error: error in thomasalgorithm (line 11) b(j+1) = b(j+1) - a(j)*c(j); i'm not sure i'm going wrong @ moment or how solve , i've kind of hit wall. >> m=10; x0=0, xm=

dom - How do I get the value of text input field using JavaScript? -

i working on search javascript. use form, messes else on page. have input text field: <input name="searchtxt" type="text" maxlength="512" id="searchtxt" class="searchfield"/> and javascript code: <script type="text/javascript"> function searchurl(){ window.location = "http://www.myurl.com/search/" + (input text value); } </script> how value text field javascript? there various methods input textbox value directly (without wrapping input element inside form element): method 1: document.getelementbyid('textbox_id').value value of desired box for example, document.getelementbyid("searchtxt").value;   note: method 2,3,4 , 6 returns collection of elements, use [whole_number] desired occurrence. first element, use [0], second 1 use 1 , , on... method 2: use document.getelementsbyclassname('class_name')[whole_numbe