Posts

Showing posts from January, 2014

how to merge two sql queries with PHP -

is possible create 2 "mysql_query" , merge them before i'm using: mysql_fetch_array ? $mainquery_one = mysql_query("select...."); $mainquery_two = mysql_query("select...."); you can use multi_query function exact requirement. manual has relevant explanation sample snippet understanding. to summarize, concatenate 2 query string in single variable , call function variable parameter.

javascript - Inserting an image into angularjs table with php -

i have code below on website , want image shown in rows. have tried using tag in variable echoing it, , directly echoing image shows text. there way fix this? the below snippet shows i'm trying achieve html tag being echoed in shows text when run. note: below snippet breaks because of php can't run doesn't show issue. function myctrl($scope) { $scope.environment_service_packages = [ {name: 'click expand', info: {text: '<?php image = "random-image-15.jpg"; $embed = '"<img src=' . '"http://www.spyderonlines.com/image.php?pic=/images/wallpapers/random-image/' . $image . '"' . '>"'; echo "image:"; echo "$embed"; echo "above supposed image @ http://www.spyderonlines.com/image.php?pic=/images/wallpapers/random-image/random-image-15.jpg"; ?>', show: false}}, {name: 'obj2', info: {text: 'some info obj2...

sql - Rails: ActiveRecord query is forcing ORDER BY after DISTINCT -

i using query: post.where("created_at >= ? , created_at <= ?", 1.month.ago.beginning_of_month , 1.month.ago.end_of_month) .select('distinct user_id') which returns 40 elements. however, expect array query, , able iterate on array .each . issue when try use .each on result of query, this: activerecord::statementinvalid: pg::invalidcolumnreference: error: select distinct, order expressions must appear in select list line 1: ...ted_at <= '2016-06-30 21:59:59.999999') order created_at... ^ : select distinct user_id "posts" (created_at >= '2016-05-31 22:00:00.000000' , created_at <= '2016-06-30 21:59:59.999999') order created_at desc it seems query forces order by on created_at , , makes break since order_by isn't in query. to avoid issue, i'm using: post.where("created_at >= ? , created_at <= ?...

How to aggregate objects of different classes like Copula, lm in a single object while preserving their orginal classes and call them in a loop in R? -

i have few objects of class rvinematrix , copula families. need call every combination of 2 of these objects , compare them in function. of course can select combinations of 2 manually without using loop, easier through 2 "for" loops. aggregated objects in list , called them in 2 loops elements of list, realised in way classes changed "list". allcopula=list(rvm1,rvm2, rvm3,rvm4) (ic in 1:size(allcopula)[2]){ (ic2 in 1:size(allcopula)[2]){ testtable[ic,ic2]<- testcopula(desingdata,allcopula[ic],allcopula[ic2]) } } any appropriated. thanks. list should preserve original classes, can see in example code: > require(xts) > test <- xts(na, sys.date()) > vec1 <- seq(1:10) > typeof(test) [1] "logical" > typeof(vec1) [1] "integer" > l <- list(test, vec1) > typeof(l) [1] "list" > typeof(l[1]) [1] "list" > typeof(l[[1]]) [1] "logical" > typeof(l[[2]]) hence, have...

c# - Google news rss parameter num 100 returning only 30 results -

the link used fetch results form google news https://news.google.co.in/news?cf=all&hl=en&pz=1&ned=in&q=euro2016&csed=in&csep=false&num=100&sort=rated&output=rss it working fine there problem in number of results get. "num" parameter returning maximum 30 results irrespective of number when num parameter exceeds 30 has google changed number of results gives. if yes there documentation of it thanks in advance according source : num=num retrieves num results. default: 10. possible values: if q present [1,100], otherwise [1, 30] however, tried with no success retreives max limit results. i think due google news api deprecated , parameters no longer functional. check answer on stack overflow , comments more info google news api.

javascript - jquery removing items from the array doesn't work -

i able find answer changed bit , tried make work without success. i remove item when user press x button: part of js code: animals = temp; (var = 0; < animals.length; i++) { newoutput += '<p>' + animals[i] + '<input type="number" class="animals-input pull-right text-right" value="0" />' + '<a href="#" onclick="deleteitem(' + animals[i] + ')" class="pull-right delete-item">x</a></p>'; }; $('.animals-input').innerhtml = newoutput; full js fiddle code any ideas? thanks. you can this: (var = 0; < animals.length; i++) { newoutput.push('<p>' + animals[i] + '<input type="number" class="animals-input pull-right text-right" value="0" />' + '<a href="#" onclick="delet...

wpf controls - how use icon [Font-awesome] in WPF -

Image
i new in wpf. want use font-awesome icon in textbox , button. icon not bind textbox i install font-awesome resource application. let me know way how can use it thank you, i need please me.. example step 1 : download font-awesome tools -> library package manager -> package manager console install pm > install-package fontawesome.wpf step 2 : add resource <application> xmlns:fa="http://schemas.fontawesome.io/icons/" </application> step 3 : put app.xaml <application.resources> <style x:key="fontawesome"> <setter property="textelement.fontfamily" value="pack://application:,,,/fonts/#fontawesome" /> </style> </application.resources> step 4 : use in demo.xaml <textblock style="{staticresource fontawesome}" fontsize="75" text="&#xf133;" /> step 5 :- output first, download font awesome, extract zip f...

How to set foreground on part of multi binding when concatenating two properties in WPF XAML? -

i displaying 2 property values using multi-binding in wpf xaml. want set first/second value different color. <datagridtemplatecolumn header="concatcol" width="60"> <datagridtemplatecolumn.celltemplate> <datatemplate> <textblock textalignment="right"> <textblock.style> <style targettype="textblock"> <setter property="text"> <setter.value> <multibinding stringformat="{} {0:c1} / {1:c1}"> <binding path="firstprop" /> ...

java - media player still plays in all activities when device is rotated even though locked to portrait -

this first time dealing media player, have sound play when app starts problem having sound played again when device rotated though locked portrait, happening in fragments when rotated , want sound play when app starts , not again! have tried adding.. android:configchanges="orientation|keyboard|keyboardhidden|screensize" to manifest in mainactivity advised not working , seems odd me! here main activity java code media player set up. public class mainactivity extends appcompatactivity { toolbar toolbar; tablayout tablayout; viewpager viewpager; viewpageradapter viewpageradapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar = (toolbar)findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); tablayout = (tablayout)findviewbyid(r.id.tablayout); viewpager = (viewpager)findviewby...

c# - LinQ to SQL naming DataContext -

i have created dbml file has datacontext. dbml maps of database tables. far works since mapped german database naming looks quite weird. public system.data.linq.table<warengruppe> warengruppes { { return this.gettable<warengruppe>(); } } for non german speakers/writers, read waregroupens instead of waregroups . there way adjust naming of members in datacontext ? datacontext generated class , don't want adjust hand everytime, hoped set in designer , apply naming every time changed. my datacontext internal , wrapped either way looks little bit hasn't put enough energy source code or wouldn't care , in case me , don't feeling. you can turn off "plural"-naming behavior. navigate tools -> options -> database tools -> o/r designer , turn off pluralization of names setting false . i think not possible change plural caption behavior in way fit defined language. on/off possible. maybe depends on vs-ve...

javascript - check array inside an array length is empty then remove the parent array from the main array -

hi how check array inside array length empty remove parent array main array , think have array [ { "id": 71, "campaignassets": [ { "id": 128 } ] }, { "id": 99, "campaignassets": [] } ] from above array id:71 have campaignassets array length 1 on other 1 "id": 99 dont have campaignassets have remove parent array means { "id": 99, "campaignassets": [] } so final array should [ { "id": 71, "campaignassets": [ { "id": 128 } ] } ] this proposal features 2 solutions, generate new array , assign original array delete unwanted items without generating temporary. 1. new array you filter array#filter var data = [{ "id": 71, "campaignassets...

c# - Kendo error after upgrading to Dotnet Core 1.0 -

since upgrading core final 1.0 release, following error when running mvc site: on line 59 while running services.addkendo(). line 57: services.addmvc(); line 58: // register ui asp.net mvc helpers line 59: services.addkendo(); line 60: line 61: // addapplication services. system.reflection.targetinvocationexception: exception has been thrown target of invocation. ---> system.typeloadexception: not load type 'microsoft.extensions.dependencyinjection.servicecollectionextensions' assembly 'microsoft.extensions.dependencyinjection.abstractions, version=1.0.0.0, culture=neutral, publickeytoken=adb9793829ddae60'. @ microsoft.extensions.dependencyinjection.servicecollectionextensions.addkendo(iservicecollection services) @ zepdata.com.startup.configureservices(iservicecollection services) in path\startup.cs:line 59 --- end of inner exception stack trace --- @ system.runtimemethodhandle.invokemethod(object target, object[] a...

android - SSL Certificate Error in Fabric -

we're using fabric.io our crash analytics . while doing security scan of our android apk, got following error: custom trustmanager implemented in class io.fabric.sdk.android.services.network.mimplements naive certificate check. trustmanager breaks certificate validation!referenced in method io.fabric.sdk.android.services.network.k->a please clarify on issue , expected resolution eta. what can done this? i have similar problem. log shown: unable load maven meta-data https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml . caused by: javax.net.ssl.sslhandshakeexception: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target. maybe try: save ssl cert .cer file broswer, add cer file android studio/setting/tools/server certificates .

r - ggplot: Adding alpha value to a whole layer -

Image
i trying plot boxplots semi-transparent. when set alpha value, fill transparency adjusted, , not borders/strokes/colors. any idea how make whole geom layer transparent? library(ggplot2) ggplot(mtcars, aes(factor(cyl), mpg)) + geom_boxplot(aes(fill = factor(cyl), color = factor(cyl)), alpha = 0) this won't work out of box, since polygons ggplot2 applies alpha fill , not colour . in order fix that, we'll apply following ad-hoc patch taking low-level internals , adding alpha mapping needed. check out the following gist . won't post here, lengthy. ggplot(mtcars, aes(factor(cyl), mpg)) + geom_boxplot(aes(fill = factor(cyl), color = factor(cyl)), alpha = 0.4, size = 1.4) before: after:

c - RAW-Sockets should ignore MTU -

i have small problem raw-socket. have capture packets in network modify them. have add special data, timestamps. works fine, have problem witht mtu (linux). if of application of upper layers generates packets close mtu, can not add data. decide downsize mtu of systems. got smaller packets , possible ad data. when try sendout packets raw-socket, not working. i found (by google, in older stackoverflow threads , in linux manpages) option ip_mtu_discover help. when use setsockopt, nothing changes. if ((s = socket(af_packet, sock_raw, eth_p_all)) < 0) { printf("error: not open socket\n"); return -1; } char socket_mtu = ip_pmtudisc_dont; setsockopt(s,ipproto_ip,ip_mtu_discover,socket_mtu, 1); maybe important. downsizing of mtu done, because when add own data, resulting packet not greater 1500 + eth-header. problem is, make raw-sockets ignore local mtu of linux-system. is ip_mtu_discover right way ignore value set in mtu? is ip_mtu_discover realy usable...

how to make this syntax possible in node.js console (javascript) -

this question has answer here: variadic curried sum function 7 answers the same function summ : summ(7)(3)(5) must equal 15 and summ(7)(3)+5 must equal 15 and summ(7)(3) must equal 10 how make possible? you can use tostring / valueof method treat result value. function sum(a) { chain.valueof = function() {return a;} return chain; function chain(s) { += s; return chain; }; } sum(7)(3)(5) == 15 // true sum(7)(3) + 5 == 15 // true +sum(7)(3)(5) // 15

javascript - Tracking web page via osm(open street map) -

i need create web page track person via open street map in lat-long data sent via app installed on phone. app send lat , long in json file server in database web page take data , show path followed biker in dotted lines throughout journey. searched open layers simple examples... couldn't more info... if has done please tell me how approach in , how it. thank guys i have show path followed person , in map, values of lat , long present in database... have show dotted line followed person.... have integrated map passing current lat , long in static data format.... facing problem dynamic fetching ... how can show dotted line i.e path followed him... this code-- js code- <script> function init() { map = new openlayers.map("mapdiv"); var mapnik = new openlayers.layer.osm(); map.addlayer(mapnik); var lonlat1 = new openlayers.lonlat(77.64760799999999,12.9081357).transform( new openlayers.projection("epsg:4326"), // transform...

sqlite - Android huge JSONObject toString goes OutOfMemoryError -

i need read lot of data sqlite database , create formatted json. i'm achieving having object called requestpayload  which contains arraylist s in put data read sqlite. the requestpayload class has parsejson() method returns jsonobject on call tostring() method obtain json string got written on file. now, when i've got "small" quantities of data in sqlite goes fine. when i've got lot of data happens: 06-28 09:55:34.121 10857-6799/it.example.sampler e/androidruntime: fatal exception: thread-195240 process: it.example.sampler, pid: 10857 theme: themes:{com.cyanogenmod.trebuchet=overlay:system, com.android.settings=overlay:system, default=overlay:system, iconpack:system, fontpkg:system, com.android.systemui=overlay:system, com.android.systemui.navbar=overlay:system} java.lang.outofmemoryerror: failed allocate 52962812 byte allocation 16764752 free bytes , 41mb until oom @ java.lang.stringfactory.newstringfromchars(native method) ...

How to display total of a column in the last row of a datatable generated using jQuery? -

Image
i have created datatable using jquery. table has 5 columns ,among 1 column payment amount. have display sum of values in payment column @ bottom of payment amount column. how can that? below html code: <table id="statement-table" cellpadding="0" cellspacing="0" border="0" class="wide100"> <thead> <tr> <th class="black white-active-bg pad-bottom-0-5 cursor-auto"> <input type="checkbox" id="select-all-statement" value="" /> </th> <th id="stmt-column" class="black white-active-bg pad-bottom-0-5 cursor-auto">statement</th> <th id="duedate-column"class="black white-active-bg pad-bottom-0-5 cursor-auto">due date</th> ...

android - I am not able to find callback in first two fragments of viewpager in activity -

scenario: have 3 fragments in viewpager in activity. fragment one fragmenttwo fragmentthree i noticed switching fragment 1 3 onpause() method called when switched fragment 1 2 onpause not called problem: want show data in fragmentone's textview webservice on button click.i clicked button , data shown noticed when switch 1 2 , come fragment 1 data shown. want hide data when come one. there callback . ? you need understand viewpager first. viewpager creates fragment in advance before , keeps there smooth flow when switch, if on fragment 2. viewpager creates 1 , 3 , keeps. and when on fragment 3 retains fragment 1. anyways can increase limit of viewpager this viewpager.setoffscreenpagelimit(int num) you can understand lifecylce of fragment in viewpager putting logs in onpause , onresume in viewpager fragments. anyways coming prob. need have custom interface this . answer helped me too

c# - How can I parse an excel formula? -

i converting functionalities incorporated in complex excel sheet asp.net project. in have requirement parse/process excel formula using vb.net or c#. i have grid structure displays accounting figures , user allowed pre-configure formula in required cells. example :- in datagrid cell[2][1], should able configure formula = sum(cell[1][1] + cell[1][2]) . is there way can parse/process excel formula vb.net/c# ? you work around flee library evaluate c# expressions // create calculation engine calculationengine engine = new calculationengine(); expressioncontext context = new expressioncontext(); variablecollection variables = context.variables; // add variables variables.add("x", 100); variables.add("y", 200); // add expression calculation engine "a" engine.add("a", "x * 2", context); // add expression engine "b" engine.add("b", "y + 100", context); // add expression @ ...

html - how to set !important on a multi value css transform? -

i want undo older css transform applied element , set new rule. in css regularly use !important in such cases override higher priority rule, looks !important not taking effect on transform property: .mk-flipbox-front { -webkit-transform: translatex(100%); transform: translatex(100%); } i want override to: .mk-flipbox-front { -webkit-transform: translatex(100%) rotatey(0deg); transform: translatex(100%) rotatey(0deg); } but when use !important this: transform: translatex(100%) rotatey(0deg) !important; it breaks , not work. any chance can use !important on multiple value transform ? don't use !important instead more specific, , use parent selector (or sibling selector) override it something this: .mk-flipbox-front { -webkit-transform: translatex(100%); transform: translatex(100%); } .parent .mk-flipbox-front { -webkit-transform: translatex(100%) rotatey(0deg); transform: translatex(100%) rotatey(0deg); } <div cl...

php - Froala set text size in the beginning -

using froala text editor, how can set programatically initial size of text? it's blocked 28px , cannot modified simple option. $('#editorasunto').editable({ // idioma también cargando el es.js inlinemode: false, language: 'es', maxcharacters: 1000, placeholder: 'escribe el asunto del mensaje. hasta 1000 caracteres...', heightmin: 60, heightmax: 100, height: 60, buttons: ["bold", "italic", "underline", "strikethrough","sep" ,"fontfamily", "fontsize", "formatblock", "color","sep" ,"insertorderedlist", "insertunorderedlist", "outdent", "indent", "sep" ,"createlink", "inserthorizontalrule", "table","html"] }); the option fontsizedefaultselection: '14...

sql server - Function with XML path doesnt work -

i want write function concat field different row , group id. when execute code in tsql work fine, when execute function returns wrong data, why? create table yourtable ([id] int, [name] char(1), [value] int) insert yourtable ([id],[name],[value]) values (1,'a',4) insert yourtable ([id],[name],[value]) values (1,'b',8) insert yourtable ([id],[name],[value]) values (2,'c',9) insert yourtable ([id],[name],[value]) values (3,'d',9) insert yourtable ([id],[name],[value]) values (3,'u',9) select [id], stuff(( select ', ' + [name] yourtable (id = results.id) xml path(''),type).value('(./text())[1]','varchar(max)'),1,2,'') namevalues yourtable results group id; create function dbo.concat_string_group_by_id (@id int , @name varchar (100) ) returns table return cte as( select @id id ,@name name (values(0)) a(m)) select [id], stuff(( ...

createjs - TypeScript exporter from Animate CC -

Image
is there plane create typescript exporter animate cc ? or tool converting result js typescript ? regards is tool converting result js typescript your generated javascript typescript. more https://basarat.gitbooks.io/typescript/content/docs/why-typescript.html here image:

c - task_pid_nr(current) returns a pid that doesn't appear in the output of ps -

within linux kernel (4.5.5), have added printk() mm/filemap.c . the code have added inside of __generic_file_write_iter() : if(io_tracing_on) { ssize_t write_size = iov_length(from->iov, from->nr_segs); printk(kern_info "write size=%zu, pid=%d, inode=%lu\n", write_size, task_pid_nr(current), inode->i_ino); } when io_tracing_on evaluates true, continuous stream of output (discussed in different question ) follows: jun 27 15:00:41 malka kernel: [ 463.424155] write size=168, pid=715, inode=7864653 jun 27 15:00:41 malka kernel: [ 463.428064] write size=168, pid=715, inode=7864354 during continuous stream of output, have tried map pid (715) output of ps -ef , no avail -- pid not exist in process list. there way me determine process task_pid_nr(current) referring to? the pid in kernel have little bit different meaning , should use tgid match pid userspace perspective

css - Applying media query to an element -

trying apply media query 1 particular div, nothing happening. <style> @media screen , (min-device-width : 320px) , (max-device-width : 480px) { .rating { margin: auto; } </style> seems missed } after .rating <style> @media screen , (min-device-width : 320px) , (max-device-width : 480px) { .rating { margin: auto; } } /* <-- 1 missed */`enter code here` </style> also if not device can try change min-device-width min-width same max-width. also check device resolution accordingly , don't forgot add meta tag

javascript - Is it possible to transpile jQuery to Vanilla JS? -

i use traceur / babel transpile es6 es5 possible use gulp plugin transpile jquery plain javascript? answers :) you can open jquery.js , relevant functions want convert native javascript. copy new helper.js, include instead of jquery.js (or jquery.min.js) , use functions. voila, native js-functions.

css - sass :first-child selector not working -

i have element in ng-repeat <div class="panel panel-default" ng-repeat="candidateinfo in acandidatedetails"> <div class="panel-heading"> <div class="row"> <div class="col-xs-1"> <a style="cursor:pointer"> {{candidateinfo.name}}</a> </div> </div> <div stop-watch time="xyz" name="candidateinfo.name" time-of-interview="candidateinfo.doi" class="panel-height" ></div> </div> i need increase height of 1st panel div ;i gave class="panel-height" the sass code gave div .panel-height { &:first-child { height: 500px; } } but not working,no idea im going wrong any appreciated

node.js - Passport & SmartThings -

this going quite broad question stuck start. i'm trying authenticate smartthings using passport. looking @ smartthings documentation here: http://docs.smartthings.com/en/latest/smartapp-web-services-developers-guide/tutorial-part2.htm smartthings doesn't return user information, authentication token use make calls smartthings instance control environment. i'm trying use oauth2 strategy, expects user profile returned serialise user, in instance null. what trying achieve authorise smartthings , store token in session data can pulled. long term assign user account local application, now, i'd above working. does know how best going this. struggling this.. perhaps using oauth2 strategy isn't right way go it? have this: var passport = require('passport'); var oauth2strategy = require('passport-oauth2').strategy; var verifyhandler = function(req, token, refreshtoken, profile, done){ return done(token) } passport.serializeuser(function...

node.js - Nods js Deployment since all my servers are very old (any alternatives.) -

all servers have windows servers old. alternate deploy node js tool have developed. free servers on-line or local,is possible make available everyone. please help. when developing it's typical run node apps locally on own computer , use localhost connect them. make available wider public need server. cheapest options virtual private servers. free option have such server know digital ocean when register coupon link 10 usd coupon use on servers, 2 months cheapest server - quite nice: 512mb ram, 20gb ssd disk, , 1000gb monthly transfer. billing per hour if want server once in while tests, 10 usd credit can potentially last years. there no limits on domains host , can choose operating system from: ubuntu , debian , fedora , coreos , centos , freebsd . can choose location in new york, san francisco, toronto, london, frankfurt, singapore, bangalore , amsterdam - whatever place closest or users.

Java - Desktop.getDesktop().open() - Wait until file is open? -

i'm searching solution wait until file opened. application opens pdf files , displays user-input dialogs dialog overlapped pdf file. there way add listener or show dialog when pdf file open? i use delay or pause that's not want. i'm using desktop.getdesktop().open(new file("my.pdf"));

php - Telegram sends duplicate POST JSON requests to webhook -

i trying develop city bot telegram, meet problem. after sending message bot, telegram sends 2 duplicate requests webhook url. webhook script works twice , sends twice responses user. script - hellobot.php official telegram docs. server vps hosting self-signed ssl, uploaded cert key telegram. from server logs. 149.154.167.209 - - [28/jun/2016:13:48:00 +0300] "post /apps/gate.php http/1.0" 200 86 "-" "- 149.154.167.209 - - [28/jun/2016:13:48:00 +0300] "post /apps/gate.php http/1.1" 200 86 "-" "- 149.154.167.209 - - [28/jun/2016:13:48:00 +0300] "post /apps/gate.php http/1.0" 200 86 "-" "- 149.154.167.209 - - [28/jun/2016:13:48:00 +0300] "post /apps/gate.php http/1.1" 200 86 "-" "- how fix this? could post code; if asking getupdates , send response user upon each result ; may send duplication because did not set offset right offset (description): iden...

c# - Possible Bug in VS2015 Code snippets after Update 2 -

Image
i updated vs2015 update 2. since code snippets feature isn't working correctly. don't know if settings changed or it's actual bug. when try add region snippet surround code get: #pragma region myregion and #pragma endregion this bug appears in try snippet get: catch (const std::exception&) instead of regular catch(exception ex) anyone came accross issue? or missing something?

JQuery insertAfter parent div -

below html <div class="col-xs-12" id="docprop_00" class="docprop"> <div id="documentproperties" class="main_bg"></div> </div> jquery newelement.insertafter("div.main_bg:last"); here inserting element after main_bg div, need insert after parent div of main_bg div. how can that?? you can use .after() method that $(".main_bg").parent().after(newelament);

mean stack - Why MongoDB / MongoHub imports some float values as Number.POSITIVE_INFINITY? -

i did exports of collection (from localhost) mongodb client mongohub , imported mongohub remote server. today found 142 values (of 68k) float values number.positive_infinity in remote server. it happens in different property names, e.g; bygender.women localhost: "bygender": { "women": 10.232445707200000129, "men": 43.622531699299997854 }, remote server: "bygender": { "women": number.positive_infinity, "men": 43.622531699299997854 }, i checked export file , data it's correct issue should in import. i give example other values converted number.positive_infinity: 44.202104087999998683 19.085516518799998664 20.620553158300001684 18.124746482399999081 1.8338334224999999211 do know if there reason? server ubuntu 16.04, mongo v3.2.7 solved doing export , import command line. might mongohub bug. export: mongoexport --db databasename --collection collectionname --out filename.js...

java - JTextField with JComboBox is not working properly -

i want jtextfield appear when user select "extra" in jcombobox list , hidden otherwise. jtextfield not appearing when user selecting "extra" appearing if shrink window , enlarge again. after doing working properly, first time not appearing. why behaving that? solution this? here code: getcmbjtocsv_c_8().addactionlistener(new actionlistener() { public void actionperformed(actionevent e) { { input3 = (string)adaptor.getcmbjtocsv_c_8().getselecteditem(); adaptor.gettxtjtocsv_c_8().setvisible(false); if(input3.equals("extra")){ adaptor.gettxtjtocsv_c_8().setvisible(true); } } i have changed string comparison , i'm still getting same result. by default swing components have size of (0, 0). size/location of component determined layout manager when frame packed or made visible. so guess since start text field invisible size of parent panel not include text field. when resize frame text field ap...

typescript - Is it possible to use parent provider in child directives in angular 2 -

i'm trying use service provider general use in directive instead component. complains not getting service in child directive. expected use service in directive: // currenttimeservice.ts import { injectable } '@angular/core' @injectable() export class currenttimeservice { dt: number; constructor() { this.dt = new date().gettime(); } } app.ts //our root app component import {component} '@angular/core' import {currenttimeservice} "./currenttimeservice" import {simpledirective} "./simpledirective" @component({ selector: 'my-app', providers: [currenttimeservice], template: ` <div> <h2 mysimpledirective>hello {{name}}</h2> </div> `, directives: [simpledirective] }) export class app { constructor() { this.name = 'angular2 (release candidate!)' } } simpledirective.ts import {directive} '@angular/core'; import { currenttimeservice } "./currenttime...

open an object JSON in Java ( servlet ) -

i decree in separate folder of json file type. these files can not open them , eleborarli javascript through $ .getjson (). same thing can in java, or rather, can open .json in java , process function $ .getjson in javascript? my json : node1.json { "title": "risoluzioni problemi 1", "id": "node1", "radiolist": [{ "text": "possibile problema 1", "value": "node2" }, { "text": "possibile problema 2", "value": "node3" }, { "text": "possibile problema 3", "value": "node4" } ] } to work json, javascript / jquery used: $.getjson('node1.json', function (data){ createnextnodes(data); }); everything works. same thing ajax requests server, questi...

sql - SELECT only one pair if I have both (A, B) and (B, A) -

here simple question, when have (a,b) result of query, have (a,b), not (b,a). for exemple query returns : 161, 52 161, 53 53, 161 53, 161 here query : select s1.survey_id, s2.survey_id surveys s1, surveys s2 (s2.start_date between s1.start_date , s1.end_date or s2.end_date between s1.start_date , s1.end_date) , s1.survey_id != s2.survey_id order s1.survey_id, s2.survey_id here 1 method: with ss ( select s1.survey_id survey_id1, s2.survey_id survey_id2 surveys s1 join surveys s2 on (s2.start_date between s1.start_date , s1.end_date or s2.end_date between s1.start_date , s1.end_date ) , s1.survey_id <> s2.survey_id ) select ss.* ss survey_id1 < survey_id2 union select ss.* ss survey_id1 > survey_id2 , not exists (select 1 ss ss2 ss2.survey_id1 = ss.survey_id2 , ss2.survey_id2 = ss.survey_id1); however, if want overlapping surveys, appropriate query: ...

javascript - Push is not working -

after reading data of each loop. data populating successfully. trying push objects in array named test data fails. push not working. below code. $scope.testdata=[]; data.content.foreach(function(column) { var objects = { ip: "", user: "", date_created:"" }; objects.ip = column.ip; objects.user = column.username; var d = new date(column.created); var = d.toutcstring(); objects.date_created = a; testdata.push(objects); }); $scope.safeapply(); }, function(error){ console.log(error); }); you should assign $scope ,try this $scope.testdata.push()

sql server - MDX YTD and MTD function have different start date -

i'm new mdx. need change existing ssrs report on ssas cube showing values in mtd , ytd. my problem both functions have different start date january in case starting date of mtd function correct at moment mdx code looks this: with member [value] sum (ytd(), [measure].[value]) member [value] sum (mtd(), [measure].[value]) my problem mtd starts @ 2016-01-01 , ytd field start @ 2016-01-04 , want ytd field starts in 2016-01-01 in date dimension have calenderyear , periodyear. looks ytd function uses periodyear, report i'm building need calenderyear. can me mdx statement, same ytd function, starts @ first day of calenderyear?

c# - Bridge table that join multiple tables -

i've product table , feature table joined using bridge table, productfeature. below simplified version of these 3 tables. these works fine. no problem here. [table("products")] public partial class productentity { public int id { get; set; } public string code { get; set; } public icollection<productfeatureentity> productfeatures {get; set;} } [table("features")] public partial class featureentity { public int id { get; set; } public string code { get; set; } public icollection<productfeatureentity> productfeatures {get; set;} } [table("productfeatures")] public partial class productfeatureentity { [key, column(order = 1)] public int productid { get; set; } [key, column(order = 2)] public int featureid { get; set; } public int sequencenbr {get; set;} public productentity product {get; set;} public featureentity feature {get; set;} } but now, need make same bridge table able...

apache - Rspec failing with Untouched resources -

my recipe installs dynatrace module , enables it: include_recipe 'dynatrace::wsagent_package' apache2_module 'dtagent_module' module_name 'dtagent_module' filepath node['dynatrace']['apache_wsagent']['linux']['agent_path'] action [:enable] end my spec file contains following: 'creates /opt/dynatrace/agent/lib64/libdtagent.so file' expect(chef_run).to render_file('/opt/dynatrace/agent/lib64/libdtagent.so') end when run rspec fails following error: $ rspec -f d ./spec/unit/recipes/apache_spec.rb[1:4] run options: `include {:ids=>{"./spec/unit/recipes/apache_spec.rb"=>["1:4"]}}` dynatrace::apache creates /opt/dynatrace/agent/lib64/libdtagent.so file (failed - 1) failures: 1) dynatrace::apache creates /opt/dynatrace/agent/lib64/libdtagent.so file failure/error: expect(chef_run).to render_file('/opt/dynatrace/agent/lib64/libdtagent.so') e...

php - white background for cutFromCenter function -

Image
i following this code crop , resize images in php. however, when use cutfromcenter function, automatically filling image black colour, want fill white. public function cutfromcenter($width, $height) { if ($width < $this->getwidth() && $width > $height) { $this->resizetowidth($width); } if ($height < $this->getheight() && $width < $height) { $this->resizetoheight($height); } $x = ($this->getwidth() / 2) - ($width / 2); $y = ($this->getheight() / 2) - ($height / 2); return $this->cut($x, $y, $width, $height); } usage: $resizeimage->load('img/ori.jpg'); $resizeimage->cutfromcenter(320,250); $resizeimage->save('img/new.jpg'); any way make function fill small images white colour? this output: ok after 20 mins fiddling found problem , fixed have forked file can download version github link below. https://gist.github.com/barkermn01/a0ff9dd928ea7...

php - Regular expression that matches specific url format in textarea field -

basically want have html textarea field, user can write comment. if user writes url, want highlight url. example bellow: "hi! comment. link http://www.google.com , comment continues." i want regular expression match urls formatted follows: http://google.com http://www.google.com www.google.com i don't want match urls formatted follows google.com www.com so far regular expression looks this: /(http)?(s)?(:\/\/)?((w*\.)([a-za-z0-9])([-\w]+\.)+([^\s\.]+[^\s]*)+[^,.\s])/ but problem cannot match http://google.com (1) of list above. i know topic may marked duplicate , apology wasn't able find need anywhere. appreciated :)

c# - Blank form when running the application -

i trying run application read xml file , displaying in form. however, keeps giving me blank form without data. how display order data? using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.text; using system.windows.forms; using system.xml; namespace readorder { public partial class form1 : form { public form1() { initializecomponent(); } private void form1_load(object sender, eventargs e) { stringbuilder orderlist = new stringbuilder(); orderlist.append("order list:").append(environment.newline); int counter = 0; // location of xml file string xmlfilepath = @"..\..\orders.xml"; { // reference xmlreader object xmlreader reader = xmlreader.create(xmlfilepath); while (reader.readtofollowing("order"...

php 7 - laravel DB::connection()->getPdo()::PARAM_STR not working -

the function getpdo() param_str in laravel db::connection()->getpdo()::param_str is working fine php 7.0.0 not working php 5.6.16 or lesser versions. how can param_str pdo instance in laravel php 5.6.16 or less? i have tried db::connection()->getpdo()->param_str but not working me.. the solution worked me this.. static function db () { try { $db = db::connection()->getpdo(); } catch (pdoexception $e) { self::fatal( "an error occurred while connecting database. ". "the error reported server was: ".$e->getmessage() ); } return $db; } by calling.. $db=self::db(); $db::param_str i got solved. inside class & method

ios - Push notification message customization? -

i working on chat application. whenever send me message receive push notification text "a send message you".but receive push text "you have 4 new messages".(4 variable number). server team claims not sending type of message.just wanted know if apple customize message in case. no, apple doesn't that. it has server developers or third party library using send push notifications.

javascript - Working with accents in angularjs -

i have list of city names. if user picks 1 i'd set center of angular-google-map's city. console.log works fine correct city name if pass function it's replacing accents. $scope.selectcity = function (city) { console.log(city.name) //it works fine. log: abaújkér locationservice.getlatlngbycityname(city.name).then(function (result){ var citylatlng = result.data.results[0].geometry.location; console.log(citylatlng); }).catch(function (error) { console.log(error); }); }; locationservice.getlatlngbycityname returns bad request: get http://maps.googleapis.com/maps/api/geocode/json?address=aba%fajk%e9r&sensor=true 400 (bad request) the factory: factory.getlatlngbycityname = function (city) { console.log(city); // works fine. log: abaújkér var api_url = 'http://maps.googleapis.com/maps/api/geocode/json?address=' + city; return $http({ method: 'get', url: api_url, params: { sensor: true } }) .catch(...

jscript - Uncheck a group of radio buttons with Javascript -

i have 2 groups of radio buttons. when button in on group clicked button in other group should unchecked, , vice versa. the smartest way thought onclick. can't head around it. suggestions? [radio button 1 name="a"] [radio button 2 name="a"] [radio button 3 name="a"] [radio button 1 name="b"] [radio button 2 name="b"] [radio button 3 name="b"] thanks ray try this:- function disableradiobtnset(){ if ($('[name="a"]').is(':checked')){ $('input[name="b"]').attr("disabled",true); }else{ $('input[name="a"]').attr("disabled",true); } } $("input[name='a']").change(function(){ disableradiobtnset(); }); $("input[name='b']").change(function(){ disableradiobtnset(); }); demo jsfiddle

android - How to make toast (method not resloved) -

toast.maketext(this, "note deleted", toast.length_short).show(); why method cannot resloved ? following wrong format ? 1) sure have imported toast class 2) if it's inside activity, code work. 3) if it's inside fragment, need context show this: toast.maketext(getactivity(),"note deleted",toast.length_short).show();

postgresql - PostgresSQL export to a new row in an existing csv -

i'm new postgressql , i'm using postico @ moment query database. need run daily query extract information created previous day. have created query works, although i'm having trouble exporting table. i know can manually export new csv everyday, know if there's way (within postico or other client) export existing csv (and create new row/sheet). thanks!

css - javascript fires if both div have one same class -

suppose, have 2 div 'menu' & 'pipe' . when click menu pipe's width 100% here have 6 pair same affecting 1 affect all. "main code given bellow." here want js this, addclass ' addwidth ' in pipe div pipe div have 1 same class form object(here, menu div ) form click event happen, eg. menu 1 div clicked pipe 1 div have affected. .hasclass can in way dont know how. help me it's js,thanks in advance. .leftbox{ width:100px; height:400px; background-color:lightgreen; display: -webkit-flex; display: flex; -webkit-flex-direction: row; flex-direction: row; } .uprow{ width:100px; height:100%; background-color:pink; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; -webkit-justify-content: space-around; justify-content: space-around; } .menu{ width:50px; height:50px; background-color:yellow; } .selected{ background-color:g...

c# - WoocommerceApiClient not working in another FORM -

i using woocommercesharp woocommerce api tool zacharykeeton/sharpcommerce. link: enter link description here strange. when use code in program.cs: var api = new woocommerceapiclient(storeurl, consumerkey, consumersecret); var parameters = new dictionary<string, string>(); var _cat = api.products.categories.get().result; it returns categories wordpress website , works fine. when want use same code in form not work , freezes @ var _cat = api.products.categories.get().result; line. i added line in program.cs line: application.enablevisualstyles(); application.setcompatibletextrenderingdefault(false); application.run(new form2()); when use code @ form load event freezes: var api = new woocommerceapiclient(storeurl, consumerkey, consumersecret); var _cat = api.products.categories.get().result; var parameters = new dictionary(); this freezes call: var _cat = api.products.categories.get().result;

Assistance with SQL commands to get certain columns? -

Image
i trying import data excel file sql database. have written function select data excel file using sql statements. part works fine having difficulty writing sql statement since table not standard format. i have situation this: notice how there separation in how data listed between plant , col1. i want select column name (from col1 col6), plant, vehicle, , date category falls in( category1, category2) , vehicle = vehicle , plant in(plant1, plant2) i can in multiple steps or use programming language assistance want contain as possible sql make more efficient. have method separate data using programming language slow, being why trying this. the expected output aiming this:

Use obtain in tactic mode in Lean theorem prover -

how use hypothesis of shape h : exists x, p x in tactic mode? in term mode use obtain x hx, h, it's same syntax: example (a : type) (p : × a) : := begin obtain x y, p, x end you can of course re-enter tactic mode using begin...end after from .

ckeditor4.x - CKEditor Support for Microsoft Edge and/or Internet Explorer 11 -

where find browser (or system) requirements ckeditor 4.4.3, 4.4.8, , 4.5.9? kind regards, oliver here complete list of ckeditor browser support .

c# - Capture text inside start/end character but ignore doubled end character -

i trying text inside start/end characters ("<" ">") regex, while ignoring doubled end character inside text (so "<<" should included in captured data). i tried <([^>]*)> and <(.*?)>(?!>) but failing in following case: input: <test>>value> expected output: test>>value but regex capture part of strings. the first 1 captures test and second test> sadly out of ideas on how further approach problem. 1 of regex gods have ideas how solve this? edit: thanks answers, sadly not match requirement have (which dropped keep question short possible thinking wouldnt matter... lesson learned) input: <test>>value><test> expected output: test>>value test using zero-width negative lookahead assertion match > not followed > terminate match seems simplest way: <(.*)>(?!>) captures test>>more when matched against <test...