Posts

Showing posts from September, 2013

How do I copy a file in python? -

how copy file in python? couldn't find under os . shutil has many methods can use. 1 of is: from shutil import copyfile copyfile(src, dst) copy contents of file named src file named dst . destination location must writable; otherwise, ioerror exception raised. if dst exists, replaced. special files such character or block devices , pipes cannot copied function. src , dst path names given strings.

C - How to read a string with only spaces using scanf -

this question has answer here: how allow spaces entered using scanf? 11 answers i'm little problem while doing excercise learn c. problem is: need read string user, if types space, need print space. that's okay in theory. but, when type space while program running, doesn't understand string , keeps waiting me type other things. i'm using scanf("%[^\n]", string_name_here); i appreciate help, , have nice day! o/ , sorry bad english, hope can understand :) using char *fgets(char *str, int n, file *stream) make day. according man : fgets() reads in @ 1 less size characters stream , stores them buffer pointed s. reading stops after eof or newline. if newline read, stored buffer. terminating null byte ('\0') stored after last character in buffer. example program #include <stdio.h> #define maxstr 21

c# - Orchard CMS failing to discover resources defined in a theme after Publish from Visual Studio -

so, tried publish (both web deploy , file system) orchard instance. have quite few custom modules , custom theme. have resourcemanifest : iresourcemanifestprovider in theme's project. yes theme has own project , included in solution. scripts , styles defined working beautifully when debug , work on dev environment. far good. today tried setup test environment of current version. tried essential without copy/pasting whole folder structure. naturally tried publish orchard.web project. , after short struggle right permissions applied...it worked , access site. unfortunately when navigated 1 of custom pages has style.require("resource defined in theme") crashed error message resource name "bla bla" cannot found. i tried publish both debug , release configuration didn't help. tried move styles theme project more concrete custommodule didn't discover it. could caching? should restart iis or website in iis? somehow these new definitions cannot detec

ios - I was wondering if it's possible to pass text from an UITextField to SLComposeViewController? -

i wondering if it's possible pass text uitextfield slcomposeviewcontroller? if nice! trying let user input his/hers input text field , pass data (text) social compose view controller (so user may share facebook or twitter) did manage pass image view post want user able input text post text field because plan on passing data app , have post multiple social media (or own website app instance). any appreciated if want code posted please don't hesitate ask in advance! you can use setinitialtext method add block of text slcomposeviewcontroller . must done before slcomposeviewcontroller displayed, should allow like: [somecomposerview setinitialtext:sometextview.text]

python - How to use from parameter in search api of Tweepy -

i using tweepy python library fetching data twitter. want tweet user1 tweeted user3 containing word1, word2, #hashtext1 etc. query = "word1 word2 #hashtext1" max_tweets = 10 searched_tweets = [status status in tweepy.cursor(api.search, q=query, from='user2' to='user2').items(max_tweets)] the problem facing not able use from in function keyword in python. when removed from parameter query works fine. i have looked source code of tweepy here . says valid parameter. please help.

java - Set up wildfly as a service in OS X -

how can set wildfly 9 service in os x el capitan enable start on boot , enable start,restart , stop commands like sudo /usr/sbin/widlfy start in os x de facto standard start , execute process @ specified time (eg. @ startup, scheduled intervals, etc.) create launch agent or launch daemon. depending on task(s) want run should indicative of whether it's agent or daemon. ↳ creating launch daemons , agents

javascript - Disable a specific linter rule in Atom (for js-standard) -

how tell atom linter, js-standard , ignore rule? want ignored project-wide, , thought achieve package.json or .eslintrc can't either work. rule want disable camelcase i should able in package.json file, because js-standard linter has option called honorstylesettings : honors style settings defined in package.json. current style settings supported: ignore parser what's syntax of these settings? for record, here's how use js-standard in atom while selectively disabling rule. disable linter-js-standard atom package install linter-eslint add .eslintrc file: { "extends": ["standard"], "rules": { "camelcase": 0 } } you may need install standard , eslint via npm, if don't have them already.

Dynamics Crm 2013+ open custom activity throws "record unavailable" message - team does not exist -

we have cases user gets 'record unavailable' error message when trying open custom activity. not happen records , in each case user trying open record owner. in trace file following error appearing when happens: crm exception: message: team id = 97d71e7a-50c6-e211-93d3-0050569e39a0 not exist, errorcode: -2147220969 the above guid, user id , not team id, not sure why crm thinks team. owner fields in record have correct owner details , owneridtype 8, systemuser. a workaround have found, assign record user, assign original owner. reason fixes it. have checked record in database before , after apply fix mentioned above , there no obvious differences. owner fields appear correct. any ideas appreciated.

php - Is this code protected against SQL injection? -

i'm not familiar newer php commands, wanted check if code below protected against sql injection? $mysqli = new mysqli($server,$user , $password, $db_name); $stmt1 = $mysqli->prepare("insert $db_table (request_date, from_city, from_country, to_city, to_country, travel_date, return_date, minus, plus, currency) values(?,?,?,?,?,?,?,?,?,?)"); $date = date('y-m-d h:i:s'); $stmt1->bind_param("ssssssssss",$date, $_post['from_city'], $_post['from_country'], $_post['to_city'], $_post['to_country'], $_post['travel_date'], $_post['return_date'], $_post['minus'], $_post['plus'],

javascript - Handlebars.js Not Printing Object Key Value ( V4.0.5 ) -

i'm running strange issue. handlebars not seem want print value object. printing other values object in template, returning blank 1 specific field ( , it's not empty string). see below. (network.colors.navbar field issue) template: <script> window.networkinfo = {{{json network}}}; </script> </head> <body class="animated-content infobar-overlay {{ network.colors.navbar }} "> <div class="master-overlay" style="display:none;"></div> output: <script> window.networkinfo = {"_id":"5744b94d4acb546c653cbf73","host":"159.203.100.31","name":"deximedia","email":"hello@deximedia.com","colors":{"brand":"navbar-brand-warning","navbar":"navbar-indigo","sidebar":"sidebar-indigo"}}; </script> </head> <body class="animated-conten

Prolog: a compiled or interpreted language or both? -

there compilers prolog other websites language interpreted language. i'm confused if prolog interpreted language. can please clarify if language is? compiled language or interpreted language? to answer lets nail down definitions. a compiled language 1 converts source code files form (binary, byte code, etc.) standalone execution or library linking other programs. constructs fixed , cannot amended. an interpreted language 1 converts construct form can executed after conversion. each converted construct typically put store can referenced later constructs. now many programming languages can both compiled , interpreted, there no rule says programming language can 1 or other. in days programming languages 1 or other, e.g. c++ - compiled, basic - interpreted. now answer question: prolog: compiled or interpreted language or both? the prolog language can compiled , can interpreted answer both. the reason seeing different answers different sites asking lang

css - Bootstrap 4 accepting offset-md-*, instead col-offset-md-* Naming Convention Bug -

Image
i'm beginner in bootstrap 4. i started learning , sadly, have been encountering problems already. modified code bootstrap 4 manual itself. however, fails miserably, offset not working properly. code simple , doesn't require lot of code though. edit: may 25, 2016 [12:35 pm (gmt+8)]: using boootrap 3.3.6 release, col-md-offset-* working. however, in bootrap 4 has failure. issue has been posted on https://github.com/twbs/bootstrap/issues/19966 ! this code used: <!-- contains .red, .blue , .green classes --> <style> ... </style> <div class="container"> <div class="row"> <div class="col-md-4 red"> hello world </div> <div class="col-md-4 col-offset-md-4 green"> hello world </div> <div class="col-md-4 col-offset-md-4 blue"> hello world </div> </div> so, doub

localhost - PHP error with mailserver " Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0" in context to email -

i setting localhost php server play around mailservers. have php.int set provider's info , have seemingly valid php file trying run: (info changed, obvious reasons.) <?php $to = 'example@gmail.com'; $headers = ""; $headers .= "from: wifi metropolis <sitename@hostname.com> \r\n"; mail ($to, string, string , $headers); ?> when navigate file (new.php), error: warning: unknown: failed open stream: no such file or directory in unknown on line 0 fatal error: unknown: failed opening required 'folder' (include_path='.;c:\php\pear') in unknown on line 0 i new php, me find solution issue? thanks!

jQuery Multiple $(this) not working -

i use 2 $(this) in function second $(this) not working $('.port-cat li').on( 'click', function() { $(this).addclass('current-cat').siblings().removeclass('current-cat'); $(this).parents('.portfolio_cat').removeclass('current-cat'); // code not working }); but if remove first $(this) code start working $('.port-cat li').on( 'click', function() { $(this).parents('.portfolio_cat').removeclass('current-cat'); // it's working }); how make both $(this) code working without removing one? you have add other class use $(this).addclass('current-cat').siblings().removeclass('current-cat'); so li element has 2 class. can't use $(this) more, use $("classname") replace $(this).

dictionary - How can I make a partial plot with healpix? -

i want zoom in particular region of sky, , plot map of region (e.g., cold spot). how can healpix? not find options mollview...etc. try using gnomview : can choose center coordinates (with rot ) want plot , size in x , y ( xsize , ysize ). render gnomonic projection of part of sky interested in.

ios - GcmExample.xcodeproj sample app not found in pod -

i'm following official guide google cloud messaging ios : start sample using following command terminal: pod try google select option gcmexample.xcodeproj prompt. but here's console output: pod try google updating spec repositories trying google 1: samples/analytics/analyticsexample.xcodeproj 2: samples/signin/signinexample.xcodeproj project open there no option gcmexample @ all. i couldn't find directory, solution fire terminal , hit -> ->cd yourcloningdirectory ->git clone https://github.com/googlesamples/google-services.git then after cloning or downloading ->cd google-services(downloaded directory)->ios->gcm-> here gcmexample.xcodeproj . ->pod install (if failed install/not found repo,try updating podfile source ' https://github.com/cocoapods/specs.git ' pod 'google/cloudmessaging' ) ->open gcmexample.xcworkspace here working demo project.

php - WordPress Custom Form submit data view on admin panel? -

Image
i created custom form on site 2 fields , submit button. take @ form: <div class="control-group"> <label class="control-label" for="name">name</label> <div class="controls"> <input type="text" name="name" placeholder="your name" class="form-control"> </div> </div> <div class="control-group"> <label class="control-label" for="number">mobile</label> <div class="controls"> <input type="number" name="number" placeholder="017xxxxxxxx" class="form-control"> </div> </div> <button type="submit" value="sub" name="sub" class="btn btn-success btn-block btn-sm martop15">submit!</button> when site visitor submit form, want display submitted data onto wordpress admin panel, can

SSAS: Slower processing when measure groups are partitioned -

i have 1 year of data , tried partitioning large measure groups per month. oblivious reason why partitioning process latest data coming in. there instances need process whole cube/all partitions. problem encountering processing of partitioned measuregroup using processfull 100% slower compared non-partitioned measuregroups. have tried processing sequentially , in parallel. there need configure in server?

python - How to I modify an external list? -

i'm trying code thing in python, , have bumped road block. have list, , want modify it, , keep changes after program exited. have no clue start. essentially, want list can accessed , modified, , saved , not reset after thing using closed. edit: here idea; there list have, let's call basket. want code program add , remove 'basket', , keep changes after close program. hope clarifies... , tried using global, got funny, deleted version. you can use json, pickle, or similar library write data file , read , store in list. create file save.json in current working directory contains json-information list. notice list contain numbers added before, doesn't "forget" added list since it's saved in file. import os import json foo = [1,2,5,9] #default #if safe file exists, load contents foo list if os.path.isfile("save.json"): open("save.json", "r") file: foo = json.loads(file.read()) foo.append(int(i

Nativescript android build error -

today of sudden unable build app android on {n} 2.0.1 this error @ end of process : execution failed task ':processf0debugresources'. > com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command '/usr/local/opt/android-sdk/build-tools/23.0.3/aapt'' finished non-zero exit value 1 what causing this? removing , adding platform solved issue tns platform remove android tns platform add android

python - Using re to sanitize a word file, allowing letters with hyphens and apostrophes -

here's have far: import re def read_file(file): words = [] line in file: word in line.split(): words.append(re.sub("[^a-z]", "", word.lower())) as stands, read in "can't" "cant" , "co-ordinate" "coordinate". want read in words these 2 punctuation marks allowed. how modify code this? there can 2 approaches: 1 suggested ritesht93 in comment question, though i'd use words.append(re.sub("[^-'a-z]+", "", word.lower())) ^^ ^ - 1 or more occurrences remove in 1 go | - apostrophe , hyphen added the + quantifier remove unwanted characters matching pattern in 1 go. note hyphen added @ beginning of negated character class , not have escaped. note: still recommended escape if other, less regex-savvy developers going maintain later . the second approach helpful if have unicode letters. ur'((?![-

javascript - WebGL How to render simple 3D triangle -

what want do: render triangle (x, y, z) points: var v1 = new three.vector3(0, 0, 0); var v2 = new three.vector3(600, 0, 0); var v3 = new three.vector3(300, 0, 600); var v4 = new three.vector3(300, 600, 300); what tried , not work: <html> <head> <title>my first three.js app</title> <style> canvas { width: 100%; height: 100%; } </style> <!-- <script src="../../scripts/three.min.js"></script> --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="https://assignments-dot-udacity-extras.appspot.com/media/js/cs291/three.min.js"></script> <script src="https://assignments-dot-udacity-extras.appspot.com/media/js/cs291/orbitandpancontrols.js"></script> </head> <body> <div id="container"> <

c++ - What is equivalent of socket programming's select() in MPI? -

in socket programming, have select() function allows simultaneously check multiple sockets. want know there such feature available in mpi library well? in first loop of following code, sending multiple nonblocking send , receive requests 1 every other node. in second loop instead of waiting each node in sequential order, want start processing data of node sends data first. want know there way that? for(id=0; id<numtasks; id++){ if(id == taskid) continue; if(sendcount[id] != 0) mpi_isend(sendbuffer[id], n*sendcount[id], mpi_double, id, tag, mpi_comm_world, &reqs[id]); if(recvcount[id] != 0) mpi_irecv(recvbuffer[id], n*recvcount[id], mpi_double, id, tag, mpi_comm_world, &reqs[id]); } for(id=0; id<numtasks; id++){ if(id == taskid) continue; if(recvcount[id] != 0){ mpi_wait(&reqs[id], &status); for(i=0; i<recvcount[id]; i++) splitdata(n, recvbuffer[id] + n*i,

android - Add the new items display top of position in Recycler View -

if add new item wishlist recyclerview can added @ last row, want display @ top of 0th position in recyclerview. tried display first position of recyclerview, doesn't workout well. code data.add(new cartitemmodel(prodcutname, product_alias, mrpprice, sales, offer, imagone, productid)); wishadapter = new wishlistadapter(data, wishlist_items.this); recyleitems.setadapter(wishadapter); wishadapter.notifyiteminserted(0); you have list of items. when want add item top use data.add(0,new cartitemmodel(prodcutname, product_alias, mrpprice, sales, offer, imagone, productid)); wishadapter.notifyiteminserted(0); this work adding item top of list.

JSON file store in PHP variable -

when open https://graph.facebook.com/me?access_token=xxxx json file. want store in php variable , use json_decode() function convert string. how can directly store json content in php variable giving link. simplest solution use http stream wraper file_get_contents() . $data = json_decode( file_get_contents('theurl') ); if need more control on http request made, take @ stream context options . if need more error handling take @ stream notifications . can use $fp = fopen('http://....', 'rb'); if ( !$fp ) { someerrorhandling(); } $data = json_decode( stream_get_contents($fp) ); in case can combine stream_get_meta_data() more http relaed stuff request/stream. see also: allow_url_fopen (because url wrappers can disabled via configuration...)

Why Doesn't HTML Use A Coordinate-Based Format? -

why doesn't it? also, there co-ordinate-based alternative html? i.e. img tag be; <img src="cats.jpg" x="100" y="200"> is efficiency? because has css , box model instead. simple, flexible , allow greater control using co-ordinates. can use pixel values , 'absolute' positioning attribute similar there many scenarios not ideal.

html - Can you explain the magic of these shiny app example? -

here famous example of shinyapp on rstudio main page. ui.r define 2 tabpanels in webpage.the first tab renders map, , second tab if selecting date full datetable according selectinput . part of code: ... tabpanel("data explorer", fluidrow( column(3, selectinput("states", "states", c("all states"="", structure(state.abb, names=state.name), "washington, dc"="dc"), multiple=true) ), column(3, conditionalpanel("input.states", selectinput("cities", "cities", c("all cities"=""), multiple=true) ) ), column(3, conditionalpanel("input.states", selectinput("zipcodes", "zipcodes", c("all zipcodes"=""), multiple=true) ) ) ), fluidrow( column(1, numericinput("minscore", "min score&q

android - How to send a stream of characters on long press of button -

how send stream of characters on long press of button. here code on longclick of button, btndown.setonlongclicklistener(new view.onlongclicklistener() { @override public boolean onlongclick(view v) { sendmessage("s");//here wanted send example sssss on long press of button } }); i want send stream of character on long press of button until user releases button. try make custom listner string mstring=""; public class continousrepeatlistener implements view.ontouchlistener { private handler handler = new handler(); private int initialinterval; private final int normalinterval; private final view.onclicklistener clicklistener; private runnable handlerrunnable = new runnable() { @override public void run() { handler.postdelayed(this, normalinterval); clicklistener.onclick(downview); } }; private view downview; /** * @param initialinterval interval after first click event

php - Get discounted price within custom plugin from another WooCommerce plugin -

i've developed custom plugin wordpress / woocommerce listing out wishlist of products. 1 thing can't work out how retrieve price processed hooks / filters added other plugins: woocommerce role pricing (light) . i have woocommerce role pricing (light) installed , discounted price based on user role. programmatically discounted price in context of plugin i'm building. instantiating product via wc_product works single full price only. ie: $wooproduct = new wc_product( $val->product_id ); $price = $wooproduct->get_price(); //^^ above price wrong , not discounted. in context of i'm building: // loop on products / populate quantity 0 if no quantity or entry found on existing product. foreach ($products $key => $val) { $wooproduct = new wc_product( $val->product_id ); $price = $wooproduct->get_price(); //$price wrong here , not discounted role pricing light $name = $wooproduct->post->post_title; $id = $wooproduct-&g

android - Showing a DialogFragment throws "Can not perform this action after onSaveInstanceState" error -

problem hi, i'm creating android , ios module titanium has sendlog method sends arbitrary json data server , returns url if matches predefined filters. url should opened in modal dialog webview. i've written native ios , android libraries , wrapped them titanium modules. on ios works fine on android can't open dialog (see error stack trace below). right there's 1 log message triggers same webpage testing purposes. on android fails silently. test case var mupets = require("be.iminds.mupets"); mupets.initialize("wappr", "http://tocker.iminds.be:3000/log/report.json", 1, 100, 3); var esmlog = { bar: "foo" }; mupets.sendlog("es-test-01",json.stringify(esmlog)); after piece of code (after 10 seconds max), module should show native dialog following webpage inside: http://tocker.iminds.be:3000/es/sheets/test-01/index.html instead, error consistently: logs java.lang.illegalstateexception: can not perform

javascript - How does @withViewPort decorator work in React? -

i reading decorators , fount @withviewport usage : import react 'react'; import withviewport 'react-decorators/withviewport'; @withviewport class mycomponent { render() { let { width, height } = this.props.viewport; return <div>viewport: {width + 'x' + height}</div>; } } react.render(<mycomponent />, document.body); how work @withviewport decorator work? have state , these state changes while resizing window size? it's higher order component adds handler listening window.resize component. src: https://github.com/kriasoft/react-decorators/blob/master/src/withviewport.js the decorator same doing: const mycomposedcomponent = withcomponent(mycomponent); render(<mycomposedcomponent />, document.body);

sql - Table design for payments -

i have table holds data person on project. table has start date field nullable end date field. so, person on project start end . at moment, billable project. have new requirement that, period, can non-billable, yet, still working on project. so, have been assigned project, , working, reason, client isn't billed part of period assigned, or maybe billed @ lower rate. my idea have exclusion type table, linked person assignment table have start date, , end date, , rate column, set 0 no-charge, or else, works override value period. does seem valid design? person billed 95% of time, , never had exclusion, makes more sense me have exclusion table. if has idea of how better, great. at moment, have 'calendar' table, join based on start/end date of person's schedule daily rate. so, join exclusion date well, see if there override of rate? issues might find design, lot of joins based on: on datevalue between start , end and not sure they're efficient jo

laravel - Has many through many-to-many -

i have following table layout: deals: - id - price products: - id - name deal_product: - id - deal_id - product_id metrics: - id - name metric_product: - id - metric_id - product_id - value products , metrics have many-to-many relationship pivot column of value. deals , products have many-to-many relationship. i can metrics product $product->metrics , want able metrics products related deal, this: $deal->metrics . i have following in deal model: public function metrics() { $products = $this->products()->pluck('products.id')->all(); return metric::wherehas('products', function (builder $query) use ($products) { $query->wherein('products.id', $products); }); } but doesn't return relationship, cannot eager load or related models it. it needs in relationship format, because need eager loaded use case. thanks help! if want have custom relation, can create own extends relation abstract

PHP: Caching system creates an extra 404 error file -

i have caching system on php website. works charm, whenever cache file created, cache file generated 404 page well. example: visit page-2, caching system detects new cache-file needs created. creates file page-2 (and serve other people late), file 404 page. question: why 404 cache-page created? i tried find out why, stuck ... this code header include: <?php $url = $_server["script_name"]; $break = explode('/', $url); $file = $break[count($break) - 1]; $cachefile = $_server['http_host'].$_server['request_uri']; $urlpage = $cachefile; $cachefile = md5($cachefile).".html"; if (!empty($param1) ){$cachetime = 86400;} elseif (!empty($param2) ){$cachetime = 86400;} elseif (!empty($param3) ){$cachetime = 86400;} elseif ($page == 'random' ){$cachetime = 0;} else {$cachetime = 60;} $cachefileloc = __dir__ . '/../_cache/' .$cachefile; // serve cache if younger $cachetime if (file_exists($cache

java - Computer Vision - filtering convex hulls and convexity defects with OpenCV -

Image
i have problem processing digital signals. trying detect fingertips, similar solution presented here: hand , finger detection using javacv . however, not using javacv opencv android different. have managed steps presented in tutorial, filtering of convex hulls , convexity defects. how image looks like: here image in resolution: as can see, there many yellow points (convex hulls) , many red points (convexity deffects). between 2 yellow points there no red point, quite strange (how convex hulls calculated?) what need create simillar filtering function in link provided before, using data structures of opencv. convex hulls type of matofint ... convexity defects type of matofint4 ... i created additional data structures, because stupid opencv uses different types of data containing same data, in different methods... convexhullmatofint = new matofint(); convexhullpointarraylist = new arraylist<point>(); convexhullmatofpoint = new matofpoint(); convexhullmatofpoint

javascript - JQuery Ajax Form sends 2 email -

anyone knows why receive 2 emails instead of 1??? i'm new jquery , ajax, in code working sending 2 email each time. html <form class="well form-horizontal" action=" " method="post" id="contact_form"> <fieldset> ... <!-- mensaje enviado con exito --> <div class="alert alert-success" role="alert" id="success_message">tu mensaje se ha enviado con exito <i class="glyphicon glyphicon-thumbs-up"></i> gracias por contactar con nosotros, en breve responderemos tu mensaje.</div> <!-- boton submit --> <div class="form-group"> <div class="col-md-12 derecha"> <button type="submit" name="submit" class="btn btn-warning">enviar <span class="glyphicon glyphicon-send"></span> </button> </div> </div>

service - How to integrate with Facebook and Google Plus accounts? -

i not understanding how integrate facebook , google plus accounts retrieve user data , utilize data registering customer service portal. requirement similar functionality see in mobile application flipkart, amazon. please guide me on this.

javascript - What are the main differences between Babel and TypeScript -

i know typescript used write angular2, makes better choice wants angular2, when @ babel looks typescript. i noticed many known companies stick babel. some questions: what advantages have on each other? which make them better or worse choice project/developer? what major differences between them , make them unique? typescript superset of javascript compiles down plain javascript (es3+). main goal of typescript enable developers leverage excellent static typing capabilities. suitable large applications benefit features like: type annotations & type inference. generics. interfaces, enums, namespaces, modules , classes (the latter 2 available in es6). safe refactoring. as far aware, babel "transpiles" newer ecmascript features down format supported older ecmascript environments. suitable developers want write plain javascript using newer language features.

java - How SLF4J handle structured logging -

anyone knows how structured logging implemented slf4j? there open source out there handling this? thank you! there an example in github implemented using slf4j . hope you. for more learning can go through tutorial. structured logging in logback using mdc master java logging

node.js - Grunt Warning: Object #<Object> has no method 'isAbsolute' -

this error shows when running grunt responsive-images-extender plugin. configuration: responsive_images_extender: { target: { options: { sizes: [{ selector: 'img', sizelist: [{ cond: 'min-width: 300px', size: '50vw' }, { cond: 'min-width: 700px', size: '70vw' }, { cond: 'default', size: '100vw' }] }] }, files: [{ expand: true, src: ['**/*.{html,htm,php}'], cwd: 'src/', dest: 'dist/' }] } } even options blank, same error. causes error? feel typo, don't see it. it because using old version of nodejs. function deprecated , updating nodejs solve issue.

PHP mail() / sendmail not working since Apache 2.4 PHP7 upgrade -

since upgrading php7 every single script on server using php mail function no longer works :-( at same time, upgraded apache 2.2 2.4, , have feeling possibly problem lies. my php.ini file contains: sendmail_path = /usr/sbin/sendmail -t -i sendmail send emails if try command line, know working. have found error believe possibly related apache , permissions in exim_paniclog: unable set gid=995 or uid=0 (euid=0): forcing real = effective i hope may have come across problem , possibly shed light on me. in advance! three things try: 1) in exim, set trusted_users = apache (or whatever web server user is). 2) try turning off selinux , resarting everything. if works now, didn't work previously, you'll need either disable selinux or learn how configure allow need. 3) see http://blog.gaiterjones.com/send-php-mail-ubuntu-upgrade/ . explicitly define itk mpm module limitgidrange parameter in /etc/apache2/mods-available/mpm_prefork.conf module configurati

android - Refresh listview in fragment upon returning from fragment detail -

my application has principal activity action bar , tabs menu. every tab fragment listview. when click in listview, fragment detail open. when click button, listview appears not elements appear; of them appear in white. if touch refresh, appears fine. the onactivityresult doesn't execute. my idea notifydatasetinvalidated() refresh. how can that? you can try use public void onresume() { // todo auto-generated method stub super.onresume(); filllistview(); } this method called every time return detail fragment. hope helps!!!

ios - Best practice to replace a synchronous NSURLConnection with NSURLSession -

as nsurlconnection sendsynchronousrequest:returningresponse:error:&connectionerror is set deprecated have replace importer wrote long time ago. the importer following: it fetches data api-a. data there can on multiple pages. it uses data first fetch (also multipage) query data api-b , merges results api-b query merged data api-a i implemented background-operation use methods each api called recursively if there mulitple pages request. but nsurlsession not support synchronous request see option have lot of overhead (e.g. ivars) control what's called in completion block (e.g. next page or start query api-b). so, elegant solution bring nsurlsession. nb: make sure, previous solution not block main thread @ all. easiest way control merge of 2 sources. this answer not supposed best practice. practical me. faced situation when bunch of synchronous requests executed in background , order of execution matters i've ended using following: syncrequ

python - Django Max of related entity -

in sql prompt when try this: select app_name, max(snap_snapinfo.id) snap_snaptopo inner join snap_snapinfo on snap_snaptopo.snp_id = snap_snapinfo.id app_name in ('invoiceserv','cal_host') , stream = 'live' , snp_id <= 135353 group app_name; i this: cal_host 126972 invoiceserv 127240 in django not able program same requirement >>> st = snaptopo.objects.filter(app_name__in=['invoiceserv','cal_host'], ... snp__stream='live', ... snp__id__lte=125353).values('app_name', 'snp__id').\ ... annotate(snpid=max('snp__id')) >>> print st.query select "snap_snaptopo"."app_name", "snap_snaptopo"."snp_id", max("snap_snaptopo"."snp_id") "snpid" "snap_snaptopo" left outer join "snap_snapinfo" on ("snap_snaptopo"."snp_i

javascript - Cascade dropdown not working using JS -

i have 1 file php , js. in file have 3 dropdowns, tried apply cascading it's not working. when choose option in first dropdown, 2nd dropdown down have no value. how fix this? php dropdown: <form action='' method='post' name='resumedatabank' id='resumedatabank'> <div class="div-select"> <label for="list_position" id="#ddress_search label">position</label> <br/> <select name="list_position" id="filterbyposition"> <option name="default" class="filter_by" selected="selected" value="select position">select position</option> <?php foreach($query_position $option){ if(isset($_post['list_position']) && $_post['list_position'] == $option->position) echo '<option name="list_position" class="filter_by" selected value="'

wpf - Hide cursor when idle -

in wpf app, want hide cursor when hasn't moved number of seconds. if moved, want show again. ideas? you use mousemove event : tested code: mytimer = new timer(3000); mytimer.autoreset = false; mytimer.elapsed += delegate { mouseext.safeoverridecursor(cursors.none); }; //hide cursor private void myview_mousemove(object sender, mouseeventargs e) { mytimer.stop(); mouse.overridecursor = null; //show cursor mytimer.start(); } this helper dispatching call override cursor: public static class mouseext { public static void safeoverridecursor(cursor cursor) { application.current.dispatcher.invoke(new action(() => { mouse.overridecursor = cursor; })); } } when timer elapses cursor hidden. when moved reappears , timer reset.

centos6 - Error installing Hmisc in R 3.3.0 on centos 6.7 -

i have installed r 3.3.0 on centos 5.2 server, , trying install packages need run shiny app; 1 of packages hmisc , causing error. unfortunately, have no idea how proceed. advise please? need add additional libraries via yum install ? many thanks gcc: /builddir/build/build/r-3.3.0/zlib-1.2.8/target/usr/lib64/libz.a: no such file or directory gcc: /builddir/build/build/r-3.3.0/bzip2-1.0.6/target/usr/lib64/libbz2.a: no such file or directory gcc: /builddir/build/build/r-3.3.0/xz-5.2.2/target/usr/lib64/liblzma.a: no such file or directory gcc: /builddir/build/build/r-3.3.0/pcre-8.38/target/usr/lib64/libpcre.a: no such file or directory gcc: /builddir/build/build/r-3.3.0/curl-7.48.0/target/usr/lib64/libcurl.a: no such file or directory > sessioninfo() r version 3.3.0 (2016-05-03) platform: x86_64-redhat-linux-gnu (64-bit) running under: centos release 6.7 (final) locale: [1] lc_ctype=en_us.utf-8 lc_numeric=c [3] lc_tim

What functionality will I lose downgrading jQuery from 2.0 to 1.10? -

we implementing new website used alongside existing system. current system uses ie8 in setting new site, jquery2.0 has been used. if downgrade jquery 1.10, lose of functionality? the blog ( http://blog.jquery.com/2013/07/03/jquery-1-10-2-and-2-0-3-released/ ) isn't clear. is going complex job downgrade? no. jquery 1.9+ , 2.0+ same newer browsers. difference between 1.9x , (including 1.10) , 2.0 , 2.0+ branch gets rid of code provides support legacy browsers. newer browsers, shouldn't see difference (except possibly faster jquery because of smaller size.)

c# - Push Notification Trigger on Windows Phone 8.1 Silverlight -

i'm working on "feature" push notification trigger available in windows phone 8.1. goal make work windows phone silverlight 8.1 project. far know, should work based on reading. after 2 days, i'm totally stuck. no matter i'm trying. when send raw notification app, app canceled , i'm windows menu. the output : program '[1852] backgroundtaskhost.exe' has exited code 1 (0x1). program '[2712] aghost.exe' has exited code 1 (0x1). state : the app receives notification. trigger onpushnotificationreceived. (after event, app canceled) the push notification task declared , entry point defined push.notification . i create windows runtime component windows phone 8.1 in order run background task. the background task registered. private async void registerbackgroundtask() { unregisterbackgroundtask(taskname); backgroundaccessstatus backgroundstatus = await backgroundexecutionmanager.requestaccessasync(); if (backgroundstatus !

php - How to validate on max file size in laravel? -

i trying validate on max file size of 500kb in laravel : $validator = validator::make($request->all(), [ 'file' => 'size:500', ]); but says file should 500 kb big. how can edit rule gives error when bigger 500kb? ive tried : 'file' => 'size:>=500' 'file' => 'size:max:500' the documentation says nothing this: size:value the field under validation must have size matching given value. string data, value corresponds number of characters. numeric data, value corresponds given integer value. files, size corresponds file size in kilobytes. according documentation: $validator = validator::make($request->all(), [ 'file' => 'max:500000', ]); the value in kilobytes. i.e. max:10240 = max 10 mb.