Posts

Showing posts from April, 2012

DocuSign Webhooks -

i using docusign rest api on application.i have configured connect service on docusign account completed documents application. connect service cost beyond budget production account. after that, have added event notification while creating envelope application through rest api, it's working fine , getting completed documents application. if of envelope sent through docusign account, event notification not appended sent envelope , thereby unable of completed document application. please suggest me can completed documents application, no matter these documents being sent. note:- can't use connect service on entire docusign account beyond budget.thank you. also, have tried done through polling well. excessive polling leads exceeding number of api requests made.

Photo Gallery for website -

Image
i want create photo gallery html website. should contain album wise photo management. embedding picasa web album website. have stopped support that. can suggest me idea. whether can integrate flicker or other other photo platform support ? i want album this. http://ahamlett.com/jquery-picasa-gallery/ please try nanogallery, http://nanogallery.brisbois.fr/

ggplot2 - Plot rollapply with ggplot in R -

Image
i need help. want plot barplot package ggplot represents rollapply(vector, 2, fun= "mean"). want plot looks this: but bars have represent "rollmeans". code have used plot is: ggplot(bp12.0.5op, aes(fecha,part.0.5))+ geom_point(na.rm=true, color="firebrick")+ geom_line(color="firebrick", size=1)+ stat_summary_bin(fun.y="mean", geom="bar")+ geom_smooth(method = "loess", se = false, linetype = 1, color = "black", size = 1 )+ geom_hline(yintercept = 15000000)+ annotate("text", min(bp12.0.5op$fecha), 15500000, label = "límite")+ ggtitle("partÍculas de 0,5micras en sala llenado bp12 operational") geom_line(rollapply(bp12.0.5op, width = 10, fun = mean), col = 'red') thanks!

sql - How do I link different values in a column according to one value of another field? -

sorry misspecification of question , problem not easy explained in few words, given not expert in sql. i have dataset containing 3 field: id sector grade 1 aaa junior 2 aaa senior 3 aaa director1 4 bbb junior 5 bbb senior 6 bbb director2 id refers different persons, , grade, grade within organisation. i trying have following output adding column describing director each id. i.e sector 'aaa' have 'director1' , sector 'bbb' have 'director2'. therefore have: id sector grade director 1 aaa junior director1 2 aaa senior director1 3 aaa director1 director1 4 bbb junior director2 5 bbb senior director2 6 bbb director2 director2 i think cursor sure there simple way so. the structure is: select r.id, d.sector, d.grade resource left join d.dimension on d.i

wordpress - Get number of approved comments of post -

in wordpress theme use <?php $commentscount = get_comments_number(); echo $commentscount; ?> to show number of comments of specific post. the problem is: returns total comment count (including deleted comments etc.) want show number of approved comments. ideas? use wp_count_comments($postid); <?php $comments_count = wp_count_comments($postid); echo "comments approved: " . $comments_count->approved ; ?> this returns object containing needed data comments. so can use like, echo "comments in moderation: " . $comments_count->moderated; echo "comments approved: " . $comments_count->approved; echo "comments in spam: " . $comments_count->spam; echo "comments in trash: " . $comments_count->trash; echo "total comments: " . $comments_count->total_comments;

python - Create access point and monitor connected clients (Raspberry) -

i have been trying logger of connects, disconnects , times connected access point via raspberry pi. have came creating access point on raspberry pi 3 dnsmasq , hostapd , getting list of connected users (with ip/mac) via arp commands running command python read list. struggling creating listener(monitor) in python listen changes on network -> connect or disconnect , run arp command list , log change e.g. text file or console(irrelevant @ point). i avoid looping every x ms in order arp status since not give me exact information unless runs time , delay in time of response arp command , writing console/file or whatever there in loop. i'm wondering if knows listener implement , interrupt main program, work , go main program e.g. or other solution regarding this? perhaps use python's subprocess.popen read /var/log/daemon.log (or wherever log file is) , grep network,connect pattern. configure hostapd log need /etc/hostapd.conf . or if you're willing cod

Pinterest API stop working -

we offering pinterest pin scheduling features our customer last 1.5 years. started getting error response "something went wrong on our end. sorry that." today. i have tried pinterest api explorer , getting same error message. strange part is, though getting error message, pin created broken image. i.e. https://in.pinterest.com/pin/573434965041286865/ , when try open image url directly in browser i.e. https://s-media-cache-ak0.pinimg.com/originals/d0/ad/c8/d0adc8520559848912b22f392eb339c1.jpg , shows access denied error. is there api changes or other issue? passing image image_url parameters. have tried sending picture multipart/form image parameter too, getting same error. here sample of our request. url: https://api.pinterest.com/v1/pins/?access_token= &fields=id%2clink%2cnote%2curl form data: image_url: http://d1ttb7iswciaye.cloudfront.net/wp-content/uploads/2015/06/slide1_img.png note:take 1 step forward, , 1 more. it's possible if keep taking small

sitecore8.2 - Multiple attachment field in sitecore -

i using sitecore 8.2. i need add 2 fields of attachment type in 1 template. when attach file in 1 field, same value getting copied in field of attachment type. how can fix this? the attachment field must named "blob" , if still holds true, can can have 1 attachment field per template. if have multiple need named "blob" , therefore hydrated same value. i found name restriction in article field in siteocre 6.6 http://blogs.perficient.com/digitaltransformation/2012/12/05/working-with-the-sitecore-attachment-field-type/

java - A child container failed during start - loader constraint violation? -

i'm give up. using intellij idea. after starting using google contacts api i'm unable use gradle tomcat anymore. external. when using internal tomcat (tomcatrun) error. think have googled , tried every suggestion there is. 13:11:58: executing external task 'tomcatrun' note: input files use unchecked or unsafe operations. note: recompile -xlint:unchecked details. :compilejava :processresources up-to-date :classes child container failed during start java.util.concurrent.executionexception: org.apache.catalina.lifecycleexception: failed start component [standardengine[tomcat].standardhost[localhost].standardcontext[/myproject]] @ java.util.concurrent.futuretask.report(futuretask.java:122) @ java.util.concurrent.futuretask.get(futuretask.java:192) @ org.apache.catalina.core.containerbase.startinternal(containerbase.java:1123) @ org.apache.catalina.core.standardhost.startinternal(standardhost.java:816) @ org.apache.catalina.util.lifecyclebase.s

php - Custom pagination in laravel 5.2 -

hello working on laravel project. i used pagination facades in project like paginate(16); , in blade file $data->render() which create url " http://example.com?page=2 " but want url " http://example.com/2 " please let me know how this. thanks in advance.

Yii2 REST: How to customize Error response? -

for first use solution - http://www.yiiframework.com/doc-2.0/guide-rest-error-handling.html but, want customize 2 types error. when model validation wrong. when wrong (exceptiin) if model validation wrong response, that: { "success": false, "data": [ { "field": "country_id", "message": "country id cannot blank." }, { "field": "currency_id", "message": "currency id cannot blank." }, { "field": "originator_id", "message": "originator id cannot blank." } ] } but want that: { "success": false, "data": [ "errors": [ { "field": "country_id", "message": "country id cannot blank." }, {

swift - NSBackgroundColorAttributeName doesn't seem to work on iOS 10.3 -

we display label in our apps contains attributed text , highlighting color. achieve this, use following code used work: let paddedlineattributed = nsmutableattributedstring(string: paddedline, attributes: [nsfontattributename : newfont, nsparagraphstyleattributename : paragraphstyle, nsbackgroundcolorattributename : color]) but after upgrading 1 of our test devices ios 10.3, specified background color label not taking effect anymore. instead, using transparent background color making label invisible using white text color same color parent view. i suspect nsbackgroundcolorattributename culprit official api reference remains unchanged - https://developer.apple.com/reference/appkit/nsbackgroundcolorattributename any ideas? copied @schystz comment: adding nsbaselineoffsetattributename: 0 resolves issue. let paddedlineattributed = nsmutableattributedstring(string: paddedline, attributes: [nsfontattributename : newfont, nsparagraphstyleattributename : paragraphsty

hadoop - Sqoop - Error while exporting from hive to mysql -

i have problem using sqoop export hive bigint data mysql. the type of column in mysql , hive bigint. i following error: caused by: java.lang.numberformatexception: input string: "3465195470" ... @ java.lang.integer.parseint (integer.java:583) it seems error occurs when converting string stored in hdfs numeric type. both hive , mysql columns bigint types, how solve problem? add sqoop command export -connect "jdbc:mysql://{url}/{db}?{option}" --username {username} --password {password} --table {username} --columns "column1,column2,column3" --export-dir /apps/hive/warehouse/tmp.db/{table} --update-mode allowinsert --update-key column1 --input-fields-terminated-by "\001" --input-null-string "\\n" --input-null-non-string "\\n" --null-string "\\n" --null-non-string "\\n" it issue due missing column or wrong column position. also there no need of --null-string , -nul

sql server - SqlSave - dates not in order appending to database -

i using command sqlsave (part of rodbc package) add data existing ms sql database. original table in database ordered date when run simple "select top 2000" query (there 1500 rows in table data displayed query) when run sqlsave new data added table no longer in date order - rows added @ top , @ bottom. i using following code: sqlsave(channel, mydataframe, mytable, append=true, rownames = false, fast = false) the r dataframe has same number of columns (in same order , same names) table. this expected behavior. tables not have order, , unless specify order in query, results not guaranteed come out in particular, consistent order.

c++ - Rendering 2D image using OpenGL -

i trying render 2d image using opengl(for rendering) , devil(for loading image). nothing gets rendered. upon error checking have found opengl throws invalid operation on wglmakecurrent call. following initialization function void cimagemainview::initializeopengl() { m_pdc = new cclientdc(this); m_hdc = m_pdc->getsafehdc(); setuppixelformat(); m_hrc = ::wglcreatecontext(m_hdc); bool ret = ::wglmakecurrent(m_hdc, m_hrc); if(!ret){ printf("error making current context\n"); } printf("wglmakecurrent "); checkglerror(); getopenglextendedinformation(); ::wglmakecurrent(null, null); printf("wglmakecurrent null"); checkglerror(); return; } setuppixelformat function looks following void cimagemainview::setuppixelformat() { static pixelformatdescriptor pfd = { sizeof(pixelformatdescriptor), // size of pfd 1, // version number

Utilities.parseCsv() 'Could not parse text' (Google Apps Script) -

i'm confused because working earlier , don't know why broken now. i've got csv files i'm trying parse. i'm accessing them using following code: var file = driveapp.getfilebyid(fileid); var csv = file.getblob().getdataasstring(); var data = utilities.parsecsv(csv); it crashes on 3rd line. when debugging, see looks normal... file object, csv string , based on preview think format looks correct csv ( 'header1,header2,header3 data1,data2,data3 data4,data5,data6...' etc). then, however, data undefined. causing error? i'm not finding online , debugging didn't provide me insight. are there particular symbols in csv break function perhaps? there ' , " symbols in csv data... don't know why should matter. update: file in question has 16000 lines. i'm going through in segments trying narrow down problem. isn't quotes; ran test parser follows , worked expected: function myfunction() { var = 'test""123,456

The errors report by IntelliJ IDEA I can not find -

Image
in snapshot can see, there 20 errors in basedaoimpl, can not find in basedaoimpl.java . edit

javascript - Dropdown for a bootstrapmodal from a ajax POST -

Image
i have bootstrap modal view: <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="mymodallabel">add missed tara or harvest product</h4> </div> <div class="modal-body"> <div class="form-group"> <label class="font-noraml"> select event type </label> <div class="input-group"> <sel

ruby on rails - Rubygems: Rubyzip required version >= 1.9.2 update on CentOS 6.x -

when do: /usr/bin/gem -v 1.8.25 when do: gem -v 2.6.11 i have installed rubygems 2.4.0 via rvm . have installed rubygems-1.8.25-1.el6.r.noarch.rpm via yum. but when install tarantula gives me error: gem::installerror: rubyzip requires ruby version >= 1.9.2. error occurred while installing rubyzip (1.0.0), , bundler cannot continue. make sure gem install rubyzip -v '1.0.0' succeeds before bundling. then type: gem install rubyzip , latest version of ruby zip got installed manually.

c# - Enumerable.Any method is not supported -

i have code : var jobs3 = _provider.context.query<jobresults>() .where(m => m.groups.any(y => usergroups.contains(y.groupname))) .tolist(); this method gives me exception in title. how can fix this? there way run method without using any? thanks. i solved problem converting iqueryable list, process list , convert iqueryable.

mysql - 'System.Data.StrongTypingException' - Not on update -

i have project have create lost source code. using visual studio 2017 , dotconnect mysq i recreating dataset , when update record amended values using: me.validate() me.activeinstructorsbycoursebindingsource.endedit() me.courselistbindingsource.endedit() me.auditlogbindingsource.endedit() me.csedatebindingsource.endedit() me.instructorcoursesbindingsource.endedit() me.tableadaptermanager.updateall(me.trainingdataset) the data saves should. if call method no changes made receive: exception thrown: 'system.data.dbconcurrencyexception' in system.data.dll i can see under exception details: 'directcast(($exception).row, app.trainingdataset.courselistrow).path' threw exception of type 'system.data.strongtypingexception' mysql default null ,visual studio dataset designer allownull=true nullvalue=(throw exception) . this correctable every column null allowed, more difficult column int32 or datetime . is there way circumvent or set prefer

security - Hardening Flags for iOS Apps -

in regular c++ app, there hardening flags can set, have position independent executables, read-only relocations, stack protection etc. usually, i'd use cflags='-wl,-z,relro,-z,now -pie -fpie -fstack-protector-all -d_fortify_source=2 -o1' -fstack-protector-all -d_fortify_source=2 work in xcode (using llvm). there equivalent remaining flags? set them , got warning: clang: warning: argument unused during compilation: '-pie' [-wunused- command-line-argument] clang: warning: argument unused during compilation: '-pie' [-wunused-command-line-argument] warning: unknown warning option '-w1,-z,relro,-z,now' [-wunknown-warning-option] especially pie , relro nice have. in case there no equivalents - how come?

php - Call to a member function query() on null -

i have weird problem php file adding database. installed php7 on server (when php 5.6 installed works well) , getting error: php message: php fatal error: uncaught error: call member function query() on null in /srv/patch/newdb.php:26 newdb file. <?php session_start(); require_once 'connectdb.php'; $data = json_decode(file_get_contents("php://input")); $username = mysqli_real_escape_string($connect, $data->username); $task = mysqli_real_escape_string($connect, $data->task); $dept = mysqli_real_escape_string($connect, $data->dept); $state = mysqli_real_escape_string($connect, $data->state); $task_start = mysqli_real_escape_string($connect, $data->task_start); $task_end = mysqli_real_escape_string($connect, $data->task_end); $login = mysqli_real_escape_string($connect, $data->login); $deadline = mysqli_real_escape_string($connect, $data->deadline); $priority = mysqli_real_escape_string($connect, $data->priority); if($_se

RegEx: Grabbing values between not escaped quotation marks -

this question related regex: grabbing values between quotation marks the regex best answer (["'])(?:(?=(\\?))\2.)*?\1 tested the debuggex demo also matches strings start escaped double quote. tried extend definition work negativ lookbehind. (["'](?<!\\))(?:(?=(\\?))\2.)*?\1 debuggex demo but not change in matched pattern. suggestions on how exclude escaped singe / double quotes starting pattern? i want use highlighting pattern in nedit, supports regex-lookbehind. example desired matching: <p> <span style="color: #ff0000">"str1"</span> notstr <span style="color: #ff0000">"str2"</span> \"notstr <span style="color: #ff0000">"str4"</span> </p> using negative lookbehind backslash not preceded backslash, i.e. (?<!(?<!\\)\\)["'] solves problem: ((?<!(?<!\\)\\)["'])(?:(?=

c# - Find similar records in a table using LINQ -

i trying find people same name , surname in 1 table , far have written linq query. query gives me cross join result. can me remove similar set of results, please? want show matching records in grid , user can open details of each 1 of them see if duplicates or not , take action on it for eg consider person's id number current result (1,2) (1,3) (2,1) (2,3) (3,1) (3,2) want result (1,2) (1,3) (2,3) var query = ori in db.people dup in db.people select new duplicatedataset { activemember = ori, duplicatemember = dup }; if (!string.isnullorempty(memberfirstname)) query = query.where(w => w.activemember.givenname.trim() == memberfirstname && w.duplicatemember.givenname.trim() == memberfirstname ); if (!string.isnullorempty(membersurname)) query = query.where(w => w.activemember.surname.trim() == membersurname && w.duplicatemember.s

Laravel query not binding values correctly -

my query returning wrong results , think because final parameter (minutes) not being binded query. when querylog seems fine wrong results being returned. if putthe minutes parameter directly query returns right results expected value needs variable. to explain query counting records until total minutes hit set number, in example im using 500. this query works , returns results expected: db::select('select null session_total_charges, null call_date, null inbound_duration, null total dual @total := 0 union select session_total_charges, call_date, inbound_duration, @total := @total + inbound_duration total (select * records order call_date) c calling_user =:user , call_date :date , outbound_zone_id in ("ukx","ukm","uklr","uknr") , @total < 500', ["user"=>$user, "date"=>$date]); this query not work , returns 1 row db::select('select null session_total_charges, null call_date, null inbound

how to read jquery data with python? -

i have big jquery data following format. jquery({locations: [,…], markerscontent: [,…], sidebarcontent: [,…]}); is there way context of first part (locations) python? tried unsuccessfully different commands in pyquery . can suggest solution? thanks you can iterate through json object. or if have single json inside access your_variable['locations']. if have more 1 json object inside variable, can iterate like, for key, value in your_variable.items(): print(key,value) in way, can access keys , values. if have list inside value, can iterate through extract values.

arrays - Angularjs get <td> index value in popup textbox -

in table can array of key value below mention code. it's working fine get value <tbody ng-repeat="value in itr"> <tr ng-repeat="(key, val) in value"> <td>{{val.pan_number}}</td> <td>{{val.name}}</td> <td>{{val.tax_payable}}</td> <td>{{val.taxes_paid}}</td> <td>{{val.year}}</td> <td><button class="btn btn-primary" ng-click="open($index)">edit</button></td> </tr> </tbody> on edit want show value in popup textbox below mention code controller.js $scope.open = function(){ var modalinstance = $uibmodal.open({ templateurl: 'path.html', animation: true, controller: function($scope, $modalinstance) { $scope.cancel = function() { $modalinstance.dismiss(&#

setting <P> as newline tag in umbraco7 tinymce -

i've run issue rich text editor in umbraco enters <br> on every press of enter. in older version <p> tag. want change behaviour of tinymce editor in umbraco7. i've tried various options : 1) setting following in tinymceconfig.config <customconfig> <config key="force_br_newlines">false</config> <config key="force_p_newlines">true</config> </customconfig> 2) edited tinymce.min.js located @ /umbraco/lib/tinymce/tinymce.min.js but had no effect , still <br> on pressing enter in rich text editor. has 1 run similar issue before , found solution control in umbraco 7? assuming using tinymce 4 setting want called forced_root_block : https://www.tinymce.com/docs/configure/content-filtering/#forced_root_block the appropriate value setting not true or false string containing block element use. example: forced_root_block : 'p' you have ask familiarity um

bigdecimal - Array in scala produced by x to y by z resulting in long decimals -

i trying generate numeric range of double val arrayofdoubles = (0.0 1.0 0.1).toarray , resultant not expected be. result array(0.0, 0.1, 0.2, 0.30000000000000004, 0.4, 0.5, 0.6, 0.7, 0.7999999999999999, 0.8999999999999999, 0.9999999999999999) . why this. use code expect be: val roundedarray = (x <- arrayofdoubles) yield bigdecimal(x).setscale(1, bigdecimal.roundingmode.half_up).todouble which results in array[double] = array(0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0) but looks cumbersome , expensive bigdecimal converts double string , parse it. is there way numericrange rounded 1 decimal place? thanks. 0 10 map (_ / 10.0) should trick

Read text file python Numpy -

Image
i have txt file has xyz coordinates extracted kinect. xyz coordinates separated commas , there 12 columns. there around 1200 rows every movement make in front of kinect 30 frames added in 1 second. is doubt on should use load it? if so, load directly numpy can use numpy.loadtxt ( https://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html ). if want structure allow more flexible access , manipulation of data, should use pandas.read_table ( http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_table.html ). after manipulation can convert pandas structure numpy.

html5 - Django Tutorial Part 3 - Code Clarification -

django newbie here. doing django tutorial , although blindly follow code confused how works. {% code %} allows insert python code html, don't line: <li><a href="/polls/{{ question.id }}/">{{ question.question_text }} i'd have explanation of how 2 curly brackets variable translates string representation of variable. i'm asking because tried doing similar operation in interpreter on own , didn't same results. {% if latest_question_list %} <ul> {% question in latest_question_list %} <li><a href="/polls/{{ question.id }}/">{{ question.question_text }} </a></li> {% endfor %} </ul> {% else %} <p>no polls available.</p> {% endif %} the {{ variable }} syntax in django templates used placeholder variable. if want check how works on console, start django shell: $ django-admin shell >>> django.template import engines >>> >>

java - Javax.mail API giving FolderClosedException -

i have peculiar problem - when run code save email as '.eml' file in independent java program, not face issues. same code when executed part of web application gives folderclosedexception. difference being independent program, have jdk on java 6 javax.mail jar file explicitly provided in classpath, , webapp, jdk java 7 , jar file not provided i.e. uses default jdk implementation. or guidance appreciated. my code below: public static void readmailandstorebasic() { properties props = new properties(); list<file> attachments = new arraylist<file>(); props.setproperty("mail.store.protocol", "imaps"); try { session session = session.getinstance(props, null); store store = session.getstore(); store.connect("outlook.office365.com", "xxxxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxx"); folder inbox = store.getfolder("up"); inbox.open(folder.r

python - Django: Query which excludes all children if the parent is included in the query -

class person(timestampedmodel): name = models.charfield(max_length=32) parent = models.foreignkey('self', null=true, blank=true, related_name='children') is_child = models.booleanfield(default=false,) i trying form query excludes children if parent present. children, represent 30% of model's entries -for time being- in postgresql. my approach use nested query . however, not sure efficient solution. i appreciate help. update the python solution came following: a = person.objects.filter(...) ids = [i.id in a] result = [x x in if any((not x.is_child, x.parent_id not in ids))] try this: qs0 = person.objects.filter(...) qs = qs0.exclude(is_child=true, parent__in=qs0)

c# - Entity Framework - Add child object to parent -

i'm trying implement simple one-to-many relationship entity framework , code first. set parent class in simple way : public class parent { [key] public long parentid { get; set; } public icollection<child> child { get; set; } public parent() { child = new hashset<child>(); } } this simplified version of course. child class simple parent 1 : public class child { [key] public long childid { get; set; } public int parentid { get; set; } public virtual parent parent { get; set; } } my controllers ones generated ef. problem when create child parent id in post method, id set in database when i'm getting parent, children list empty. i've tried adding child in parent in controller : db.parent.find(child.parentid).child.add(child); which apparently had no effect. the parent in child object null , child list in parent empty. how can child in parent's collection ? thank ! as far know, dis

coreos - Kubernetes: how to enable API Server Bearer Token Auth? -

i've been trying enabled token auth http rest api server access remote client. i installed coreos/k8s cluster controller using script: https://github.com/coreos/coreos-kubernetes/blob/master/multi-node/generic/controller-install.sh my cluster works fine. tls installation need configure kubectl clients client certs access cluster. i tried enable token auth via running: echo `dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null` this gives me token. added token token file on controller containing token , default user: $> cat /etc/kubernetes/token 3xq8w6iaourkxolh2yfpbgfxftbh0vn,default,default i modified /etc/kubernetes/manifests/kube-apiserver.yaml add in: - --token-auth-file=/etc/kubernetes/token to startup param list i reboot (not sure best way restart api server itself??) at point, kubectl remote server quits working(won't connect). @ docker ps on controller , see api server.

sql - Switch Negative Sign from Back to Front of Value -

i have 5 fields in sql table varchar fields. data in these fields money amounts, negative values have sign @ end of number, rather front. example : 4.56- how can change these fields varchar money , switch negative sign front of values in process? i have tried cast([field_name] money) hasn't worked. have gotten following error attempt: cannot convert char value money. char value has incorrect syntax. detect minus sign; remove it; cast positive result money; , negate it. case when [field_name] '%-' -(cast(replace([field_name],'-','') money)) else cast([field_name] money) end

MySQL : Select number of unique days between two dates -

i have table shows events took place during several days in spatial grid , want select number of unique days each cell of grid in order obtain number of days event happend, here table structure : +-----+------------+------------+---------+---------+ | id | start_date | end_date | id_cell | event | +-----+------------+------------+---------+---------+ | 1 | 2017-03-01 | 2017-03-04 | 250 | envent1 | | 2 | 2017-03-01 | 2017-03-04 | 251 | envent1 | | 3 | 2017-03-01 | 2017-03-04 | 307 | envent1 | | 4 | 2017-03-01 | 2017-03-04 | 308 | envent1 | | 5 | 2017-03-01 | 2017-03-09 | 250 | event2 | | 9 | 2017-02-24 | 2017-03-03 | 250 | event3 | | 13 | 2017-02-24 | 2017-03-24 | 250 | event4 | | 17 | 2017-02-24 | 2017-03-02 | 250 | event5 | | 21 | 2017-01-04 | 2017-01-25 | 250 | event6 | | 25 | 2017-03-26 | 2017-03-28 | 250 | event2 | +-----+------------+------------+---------+---------+ for example, expected result cell 250 id

rxjs - Angular: Observable model property does not exist -

after upgrading angular 2 angular 4 these errors when trying compile using aot: property 'total' not exist on type 'observable<any>'. this how have used observables until now... first have assigned variable this: public mydata: observable<any>; then have call service subscribe this: this.mysubscription = this.apiservice.get('url-here') .subscribe( response => this.mydata = response, error => this.feedbackservice.displayerror(<any>error), () => this.feedbackservice.stoploading() ); this works in development mode (ng serve), , can use stuff *ngfor iterate on results. after getting these errors tried add model class this: export class mydata { total: number; count: number; data: array<any> = []; } ... rest of component here and use observable this: public mydata: o

javascript - Trying to filter out matching records from 2 array as 1 array have different structure -

below sample records : var array1 = [ { "testid": 15, "child": [ { "variantid": 100, "name": "a1", }, { "variantid": 200, "name": "a2", }, { "variantid": 300, "name": "a3", }, { "variantid": 400, "name": "a4", }, { "variantid": 500, "name": "a5", } ] } ] var array2= [ { "variantid": 100, "tests": [ { "testid": 15, "flag" : true } ] }, { "variantid": 200, "tests": [ { "testid": 15, "flag" : false } ] }, {

java - Mapping mouse event coordinates -

i've implemented jlayer<jpanel> component paint zoomed graphics of itself, descending components zoomed too. jlayer applied contentpane jframe component. the main problem zoom applies, indeed, graphic , actual size , position of components remain same. implies mouse events happen in wrong position respectively user see. i've king of tweaked defining glasspane jcomponent @ top of frame has it's own mouseinputadapter redispatch mouseevent s underlying components using swingutilities.getdeepestcomponentat() . accomplished creating new mouseevent mouse coordinates mapped depending on zoom value. (obtained modifying how use rootpanes tutorial) this method not satisfying because lot of events can't fired (for example mouse_entered events fired descending components). on other hand using layerui.paint() override implies have have remap mouse coordinates. is there way map mouse coordinates without breaking inner mouseevent processing? or is there