Posts

Showing posts from January, 2011

javascript - What is the meaning of the third parameter in this dat.gui add function? -

javascript - What is the meaning of the third parameter in this dat.gui add function? - i quite new dat.gui . i've been reading dat.gui's questions , answers in stackoverflow. have 1 question this one. what meaning of 3rd argument in gui.add function? i.e. a[i] for (var i=1; i<7; i++) { controller_names[i] = a[i]; gui.add(controller_names, i, a[i]); } thanks! the 3rd , higher arguments of add function additional parameters given control. example, if command slider, min & max, like: gui.add(gui, 'horizontale', 0, 600); for check box command (boolean property, a[i]), 3rd argument has no effect. you can @ definition of dat.controllers.factory in source code of dat.gui, controllers created. javascript user-interface dat.gui

javascript - Populate function return value into element -

javascript - Populate function return value into <input> element - i writing chat page site. have managed getmyfunction() inquire user name welcome 'username'. problem utilize same name within name input box chat itself, rather user having input name every single time wish write message. have used onclick= prompt user name cannot display name within name box. <form action='submit.php' method='post' name='form'> name:<br><p>click button demonstrate prompt box.</p> <button onclick="myfunction()">try it</button> <p id="demo"></p> <script> function myfunction() { var person = prompt("please come in name", "harry potter"); if (person != null) { document.getelementbyid("demo").innerhtml = "hello " + person + "! how today?"; } } </script> name: <br> <input type='text' name='name...

Java allowing multiple inheritance -

Java allowing multiple inheritance - i confused regarding concept in multiple inheritance. have 3 classes a, b , c. class { // ... } class b extends { // ... } class c extends b { // ... } i know bad practice of multiple inheritance , read java allows multiple inheritance through interfaces. not getting error in above code. please can explain me clear illustration without using interface. thanks!! this not multi-inheritance. each class has 1 direct super class. if illustration considered multi-inheritance, wouldn't able utilize extends keyword @ all, since each class extends default object class. multi-inheritence class c extends a,b {} and that's illegal in java. java inheritance

c# - Scalability Location Distance Search Over 100,000 LatLng Positions Across USA -

c# - Scalability Location Distance Search Over 100,000 LatLng Positions Across USA - scenario = 1) delivery offices spread out across usa each specifying own maximum delivery radius limit in miles. 2) target address geo converted latlng delivery destination. goal = homecoming dataset of delivery offices (1) who's delivery radius limit falls within distance target address(2) attempt = as starting point problem using first-class work illustration storm consultancy in identifying closest office customer: haversine distance between 2 points my 'offices' table stores office address along lat , lng values , maximum distance 'deliverylimit'. the sql calculate haversine blows mind , beyond understanding! storm sql below, instead of selecting 1 row straight distance calculations, need select offices rows who's max distance delivery limit less distance between office , customer. question1 = how add together max distance limit filter sql query retu...

xaml - Office 365 API - Azure Active Directory bring user's thumbnail Failed -

xaml - Office 365 API - Azure Active Directory bring user's thumbnail Failed - i'm using next code sample : here user's thumbnail of there's business relationship on office 365 tenant windows 8.1 project xaml/c# try { using (var dssr = await user.thumbnailphoto.downloadasync()) { var stream = dssr.stream; var buffer = new byte[stream.length]; await stream.readasync(buffer, 0, (int) stream.length); profileimage = buffer; } } grab (exception ex) { debug.writeline(ex); } however each time seek bring user's thumbnail photo, next error: "resource 'thumbnailphoto' not exist or 1 of queried reference-property objects not present." i'm using admin user (global admin) in add together connected service , sign in . i searched said on : here "and these photos stored in exchange mailbox rather thumbnail photo in...

Fossil svn: linking tickets to a branch -

Fossil svn: linking tickets to a branch - i have 2 branches in fossil repository: possible link ticket 1 of 2 branches, in timeline view can understand branch ticket belongs to? thank in advance sure can. thing need create sure include right reference. in screenshot below, see made ticket wrote in ticket title: test reference branch [94558ab315732e3f] that reference object-id of branch making reference to. @ screenshot below: see took id placed in front end of word "leaf" , identifies branch. on top, in sam screenshot see line "test reference branch [94558ab315732e3f]" branch id clickable. take branch description you not have clickable behaviour in ticket itself. if appear normal text: if @ screenshot of timeline, see started test other way round: add together branch has ticket-id name. thing need differently quote ticket name when creating branch. so: fossil branch new "[c98dd264f1319]" trunk and not: fossil b...

linux - Remove last line from variable string inside the awk script -

linux - Remove last line from variable string inside the awk script - i made next script: awk ' { if ($1 ~ /^d/) { a=a $0; } .... -> rest code if (p == 1) { b=a; print b; } } ' input.txt a - store found result, work later can't alter construction b - store part of a, header input file: d1file text edont show d2file d3file need remove a content @ end: d1file text d2file d3file need remove what do: if $1 starts d store within a variable. later move a b , remove lastly line b, output of b should be: d1file text d2file i looking solution no luck @ all. thinking store a content array , loop using index-1 remove lastly line, couldn't worked. is there way that? awk ' /^d/ { = $0 "\n"} # accumulate lines starting d end { sub(/\n[^\n]*\n$/, "", a); # remove lastly line print } ' input.txt li...

javascript - Rendering of the html page not working -

javascript - Rendering of the html page not working - i using backbonejs framework. under framework, have created app.js uses backbonejs, requirejs, underscore , text.js load html page onto div. console shows html page loaded not able see particular page on screen. below app.js class="lang-js prettyprint-override"> define(function (require) { // "use strict"; var $ = require('jquery'), underscore = require('assets/js/underscore'), backbone = require('assets/js/backbone'), tpl = require('text!views/home.html'), template = _.template(tpl); homecoming backbone.view.extend({ render: function () { el: '#banner', this.$el.html(template()); homecoming this; } }); }); i load home.html main screen(index.html). have called app.js in index.html. console shows next xhr finished loading: "file:///d:/project1/...

objective c - UISplitViewController, make MasterView appear programmatically in portrait iOS 8 -

objective c - UISplitViewController, make MasterView appear programmatically in portrait iOS 8 - i'm trying implement splitviewcontroller in ios 8, due nature of detailview (horizontal collectionview), default behavior (swiping left right) making masterview visible can't used. so i'm trying implement behavior programmaticaly. i've tried send swipe gesture root view of detailview, won't either. i've looked through of answers here on so. of them suggest using method: [splitviewcontroller willrotatetointerfaceorientation:self.interfaceorientation duration:0]; this method deprecated in ios 8. help/lead on matter appreciated. found solution create masterview appear without swipe in portrait mode. [self.splitviewcontroller setpreferreddisplaymode:uisplitviewcontrollerdisplaymodeprimaryoverlay]; ios objective-c uisplitviewcontroller

Default access modifier for class and variable in C#? -

Default access modifier for class and variable in C#? - this question has reply here: what default access modifiers in c#? 6 answers what default access modifier class , variable in c#? for class, there 2 type of access modifier: pulic/ internal. , internal default? variable, there 4 type of access modifier: public/internal/protected/private. , private default? in java, public default access modifier. not know in c#? the default internal class , private class members, recommend declaring explicitly c# access-modifiers

asp.net mvc - Model Binding Multiselect in MVC4 -

asp.net mvc - Model Binding Multiselect in MVC4 - my class public partial class reference { public reference() { this.reference1 = new hashset<reference>(); } public int[] permissions{ get; set;} public virtual icollection<reference> reference1 { get; set; } public int refid { get; set; } public string description { get; set; } } and view @using(@html.beginform()) { @model trials.classes.reference <table> <tr> <td colspan="2"> @html.dropdownlistfor(x => x.refid, @viewbag.role selectlist, new { @class = "dropdown" }) </td> <tr> <td colspan="2"> @html.listboxfor(x => x.permissions, @viewbag.permissions multiselectlist, new { @class = "chosen-s...

Visual Studio Plugin for Team Explorer (TFS) - How to get a selection in query editor? -

Visual Studio Plugin for Team Explorer (TFS) - How to get a selection in query editor? - i developing visual studio plugin extend tfs query handling (2012 version). after lot of (re)search done. what plugin can extend context menu in query editor. there can add together additional filters, works. insert filter above selected row in editor. i cannot find possibility retrieve selection. i fetch current querydocument iworkitemtrackingdocument wtd = getactivedocument(); iquerydocument querydoc = wtd iquerydocument; public iworkitemtrackingdocument getactivedocument() { object _locktoken = new object(); // token used locking document if (dte.activedocument != null) { string activedocumentmoniker = dte.activedocument.fullname; iworkitemtrackingdocument doc = docservice.finddocument(activedocumentmoniker, _locktoken); if (doc != null) { doc.release(_locktoken); } homecoming doc; } homecoming n...

ios - Execute animation of subview subclass -

ios - Execute animation of subview subclass - i have uiviewcontroller called parentviewcontroller. , have uiview custom class called customview. including imageview , function execute animation. customview.h @interface customview : uiview @property (weak, nonatomic) iboutlet uiimageview *human; @property (weak, nonatomic) iboutlet uiimageview *shadow; + (id)customview; - (void)executeanimation; @end and in customview.m ave executeanimation following: -(void)executeanimation{ self.animation1inprogress = yes; [uiview animatekeyframeswithduration:3.0 delay:0.0 options:uiviewanimationcurvelinear animations:^{ self.human.frame = cgrectmake(self.human.frame.origin.x, self.human.frame.origin.y + 300, self.human.frame.size.width, self.human.frame.size.height); } completion:^(bool finished){ self.animation1inprogress = no; }]; } now in parentviewcontroller.m, add together customview without animation //init custom customview = [customview i...

css - Highcharts tooltip hidden behind second chart -

css - Highcharts tooltip hidden behind second chart - our page has big number of horizontal bar charts generated highcharts. long story short, tooltips charts beingness covered charts below , side of them. i've messed around z-index , doesn't seem making difference. i've looked @ previous similar questions, no help. here's example: http://jsfiddle.net/o15gywrv/5/ if hover on first chart, you'll see tooltip covered sec chart. i've tried playing z-index on container , tooltip , i'm not seeing difference: .highcharts-container { overflow: visible !important; z-index: 0 !important; } .highcharts-tooltip { z-index: 9998; } for me, simple css z-index set on hover worked: .highcharts-container:hover { z-index: 1 !important; } css highcharts

php - Laravel, any tips on how to load a specific controller or way to load a function -

php - Laravel, any tips on how to load a specific controller or way to load a function - i'm creating command panel show online players count, putting online players count twitter bootstrap navbar. above image illustration of want. i'm using laravel's cache re-load online players count every 3minutes, , current way load online players set loader each controllers, suggestions? improve thing/way this? is route capable of doing this? or view? php laravel-4 twitter-bootstrap-3

php - How to select two different elements with an XPath query -

php - How to select two different elements with an XPath query - i select <a id="categorybrandicon"> with: $item = $xpath->query("//a[@id='categorybrandicon']")->item(0); how modify code select <a id="categorybrandicon"> , <input type="hidden"> tags? selecting inputs if input[@type='hidden'] don't know how chain two. with css selectors a#categorybrandicon, input[type="hidden"] yes combine them in single xpath query thru pipe. example: $sample_markup = ' <div class="container"> <a id="categorybrandicon" href="#">test</a> <input type="hidden" /> <input type="text" /> <h1>test</h1> </div> '; $dom = new domdocument(); $dom->loadhtml($sample_markup); $xpath = new domxpath($dom); $elements = $xpath->query("//a[@id='categorybrandicon...

ios - Correct syntax for replacement of deprecated "sizeWithFont:constrainedToSize:lineBreakMode" -

ios - Correct syntax for replacement of deprecated "sizeWithFont:constrainedToSize:lineBreakMode" - i have had 10 days of ios/objective-c training (and pretty much no other coding classes) , way out of league on this, inherited huge ios app @ work responsible upgrading ios6-centric ios 7-centric. i'm trying clean of warnings in xcode , cannot figure 1 out. i've searched days , read every reply here on so, none answers question (though have helped me closer, grateful). i know "sizewithfont:constrainedtosize:linebreakmode:" deprecated , needs replaced "boundingrectwithsize:options:attributes:context:", life of me can't figure out how convert existing code old method new. if can 1 straightened out clear 35 other warnings in xcode, same deprecated method used in numerous other places. the research i've done yields few examples of how new method used, appears used in different ways (cgrect , cgsize) , apple's documentation sends me...

php - PHPEXCEL Get mysql column name in Single Row -

php - PHPEXCEL Get mysql column name in Single Row - i working on application, user upload file (any format) , application process per utilize , download it. i want add together column name mysql in single row coming follows: name mobile city mick 9xxxxxxxx ahmedabad my code follows: $result=mysql_query("select * test_excel") or die(mysql_error()); $objphpexcel = new phpexcel(); $objphpexcel->setactivesheetindex(0); $row=1; $q = mysql_query("show columns test_excel"); if (mysql_num_rows($q) > 0) { while ($row_q = mysql_fetch_assoc($q)) { $col='a'; $objphpexcel->getactivesheet()->setcellvalue($col.$row, $row_q['field']); $col++; } $row++; } while($row_data1 = mysql_fetch_assoc($result)){ $col=0; foreach($row_data1 $key=>$value){ $objphpexcel->getactivesheet()->setcellvaluebycolumnandrow($col, $row, $value); $col++; } $row++; } $objwri...

How to extract MP4 seekpoints information from PHP/FFmpeg/MP4Box/Anything? -

How to extract MP4 seekpoints information from PHP/FFmpeg/MP4Box/Anything? - is possible extract seekpoints/keyframes mp4 file in next fashion: keyframe - time range (in seconds) - offset (in bytes) example: 0 - 0s - 77262 1 - 0.5s - 144183 2 - 1s - 222965 3 - 1.5s - 293303 4 - 2s - 362199 5 - 2.5s - 431178 thanks in advance. you can utilize ffprobe . perhaps this: ffprobe -show_frames -select_streams v:0 -show_entries frame=key_frame,coded_picture_number,pkt_pts_time,pkt_pos input.mp4 | grep -a 3 "key_frame=1" results in: key_frame=1 pkt_pts_time=0.000000 pkt_pos=48 coded_picture_number=0 -- key_frame=1 pkt_pts_time=10.000000 pkt_pos=47130 coded_picture_number=250 -- key_frame=1 pkt_pts_time=20.000000 pkt_pos=92713 coded_picture_number=500 -- key_frame=1 pkt_pts_time=30.000000 pkt_pos=138159 coded_picture_number=750 key_frame=1 indicates particular frame key frame. you may have take section_entries if illustration not give want...

python - Django test view issue -

python - Django test view issue - i'm trying test view in django project. can't context view. i'm working in shell. type: >>> django.test.client import client >>> c = client() >>> c.login(username='test', password='test') true >>> response = c.get(reverse('lista_categorie')) >>> response.status_code 200 >>> response.context['categorie'] traceback (most recent phone call last): file "<console>", line 1, in <module> typeerror: 'nonetype' object has no attribute '__getitem__' i have variable 'category' give template context, cannot understand why context empty. status code ok, , content corrisponds template. view: def lista_categorie(request): categorie = categoria.objects.all() homecoming render_to_response('view_categories.html', { 'categorie': categorie, }, context_instance=requestcontext(request)) ...

c++ - "Undefined symbols for Architecture x86_64 " no templates used, possible syntax error -

c++ - "Undefined symbols for Architecture x86_64 " no templates used, possible syntax error - i know mutual question, please bear me. understand seeing past questions: i not using templates, " template class treenode; " before each utilize of template, assuming problem similar, related syntax, or basic. if answered edit question more people benefit it. so have utilize these code operations in main.cpp carry out operations- e.g. utilize deleteitem, retrieve 10 , print whether found, etc. the code follows: //unsortedtype.h #ifndef unsortedtype_h_included #define unsortedtype_h_included #include "itemtype.h" class unsortedtype { public: unsortedtype(); bool isfull() const; int lengthis() const; void retrieveitem(itemtype&item, bool&found); void insertitem(itemtype item); void deleteitem(itemtype item); void resetlist(); void getnextitem(itemtype& item); ...

How to call MATLAB from the command line several times, using the same MATLAB instance every time -

How to call MATLAB from the command line several times, using the same MATLAB instance every time - i have .m script called windows command line (aka or prompt), , phone call script different arguments several times (50+) day. i tried using matlab -r "run script.m" , script correctly executed, everytime issue prompt command new instance of matlab opened, undesirable in case. is there way of identifying there instance of matlab running on windows 7 machine, , forcefulness utilize of same matlab instance on several external calls via windows command line? as discussed here, cannot prevent matlab creating window when starting on windows systems, however, can forcefulness window hidden, using start command -nodesktop , -minimize options together: start matlab -nosplash -nodesktop -minimize -r "run script.m" or simply start matlab -nosplash -nodesktop -minimize -r script ps: although prevent creating new instances of matlab (full ide), ...

iOS Core Bluetooth (LE): App crash when handling different views -

iOS Core Bluetooth (LE): App crash when handling different views - i have 2 views: 1 central tableview discovered devices appear , 1 detailview loads when user selects connect 1 of discovered devices. it works until next point: discovering devices connect device read services, characteristics , subscribe them values of char's beingness read , displayed on detailview when homecoming detailview through "back"-button callback-function override func viewdidappear(animated: bool) { if(!firststart){ tableview.reloaddata() println("appeared!") discoverdevices() } } gets called after end in exc_bad_access. discoverdevices() function following: func discoverdevices() { println("discovering devices......") centralmanager.scanforperipheralswithservices(nil, options: nil) } there seems error in "centralmanager.scanforperipheralswithservices(nil, options: nil)" - after callback. right s...

javascript - ResponsiveSlides.js - go to correct slide in list -

javascript - ResponsiveSlides.js - go to correct slide in list - i'm building portfolio page , i'm bit stuck. loop through images in specific folder , create thumbnail page. simultaneously, building responsiveslides gallery in lightbox. if click on thumbnail open lightbox. however, starts first image of slideshow. how can go image in slideshow clicked on? php (wordpress) <?php /* template name: portfolio category */ get_header(); ?> <?php while ( have_posts() ) : the_post(); ?> <div class="portfolio-container"> <?php $slideshow = array(); if(get_field('image_gallery')): ?> <div class="row"> <?php while(the_repeater_field('image_gallery')): $medium = wp_get_attachment_image_src( get_sub_field('image'), 'medium' )[0]; $full = wp_get_attachment_image_src( get_sub_field('image...

mysql Select the sum of occurances of first alphabetical character -

mysql Select the sum of occurances of first alphabetical character - hi need create select statement outputs sum of first character in field within table output like a,12 b,0 c,20 d,14 e,0 ect... the table called contacts, in above there 12 occurrences of people names begin letter , there 0 occurences of letter b. i hope have explained correctly in order result display missing letters, need manually generate letters (eg. using subquery) select a.letter, count(u.name) totalcount ( select 'a' letter union select 'b' letter union select 'c' letter union -- until z select 'z' letter ) left bring together userlist u on a.letter = left(u.name, 1) -- <== column name grouping a.letter order a.letter mysql

difference - Two codes in python should be giving the same result but they don't -

difference - Two codes in python should be giving the same result but they don't - description: next codes recieves coordinates of 2 dots n dimensions. calculates manhanttan distance of theses 2 dots codes: def manhanttan( ponto1, ponto2 ): totalp1 = 0 totalp2 = 0 x in range( 0, len( ponto1 ) ): totalp1 += ponto1[x] totalp2 += ponto2[x] homecoming abs( totalp1 - totalp2 ) and def manhanttan( ponto1, ponto2 ): total = 0 x in range( 0, len( ponto1 ) ): total += abs( ponto1[x] - ponto2[x] ) homecoming total are giving different results , don't know why. can help me? ps: values in lists positives ps2: first 1 classifications gets k1: expected class: 6, found class: 0 k2: expected class: 6, found class: 0 k3: expected class: 6, found class: 0 k4: expected class: 6, found class: 0 k5: expected class: 6, found class: 0 and other k1: expected class: 6, found class: 6 k2: expected class: 6, found class: 6 ...

objective c - spritekit collisionBitMask pass through each other -

objective c - spritekit collisionBitMask pass through each other - i have 2 nodes - rabbit , slab. how can pass through each other, , i'm doing wrong? static const uint32_t rabbitcategory = 0x1 << 1; static const uint32_t slabcategory = 0x1 << 2; rabbit.physicsbody.categorybitmask = rabbitcategory; rabbit.physicsbody.collisionbitmask = rabbitcategory; slab.physicsbody.categorybitmask = slabcategory; slab.physicsbody.collisionbitmask = slabcategory; i believe want set collisionbitmask category physics body collide: rabbit.physicsbody.categorybitmask = rabbitcategory; rabbit.physicsbody.collisionbitmask = slabcategory; slab.physicsbody.categorybitmask = slabcategory; slab.physicsbody.collisionbitmask = rabbitcategory; objective-c sprite-kit

java - Dinning philosophers algorithm deadlock -

java - Dinning philosophers algorithm deadlock - i have written algorithm solved dinning philosophers problem. giving stackoverflow exception.can 1 help me same. on issue. dinning philosopher problem using multi threading. using arraylist store chopsticks , plates. ` ----------- package com.intech.diningphilosopherproblem; import java.util.concurrent.executorservice; import java.util.concurrent.executors; import java.util.concurrent.timeunit; import javax.annotation.processing.processor; public class myphilosophers { /** * @param args */ static int noofp = ((runtime.getruntime().availableprocessors() * 2) + (1)); // runtime.getruntime().availableprocessors(); public static void main(string[] args) throws interruptedexception { myphilosopherschopstick myps = new myphilosopherschopstick(noofp); executorservice execserv = executors.newfixedthreadpool(5); (int = 0; < 500; i++) { thread.sleep(200); execserv.execute(myps); } ...

regex - Replace repeating character with another repeated character -

regex - Replace repeating character with another repeated character - i replace 3 or more consecutive 0s in string consecutive 1s. example: '1001000001' becomes '1001111111'. in r, wrote next code: gsub("0{3,}","1",reporting_line_string) but replaces 5 0s single 1. how can 5 1s ? thanks, you can utilize gsubfn function, can supply replacement function replace content matched regex. require(gsubfn) gsubfn("0{3,}", function (x) paste(replicate(nchar(x), "1"), collapse=""), input) you can replace paste(replicate(nchar(x), "1"), collapse="") stri_dup("1", nchar(x)) if have stringi bundle installed. or more concise solution, g. grothendieck suggested in comment: gsubfn("0{3,}", ~ gsub(".", 1, x), input) alternatively, can utilize next regex in perl mode replace: gsub("(?!\\a)\\g0|(?=0{3,})0", "1", input, per...

javascript - Why is HTML content not visible in some versions of Chrome? -

javascript - Why is HTML content not visible in some versions of Chrome? - suppose have div content dependent on button click on top of that. content of 3 button clicks stores in variables one , two , three . <div id="onebutton"></div> <div id="twobutton"></div> <div id="threebutton"></div> <div id="content"></div> using jquery, when onebutton div clicked, set html content of variable one content div: $('#content').html(one); now, happens content nowadays in div, not show. shows when hover mouse on div , gets shown in parts (i.e. browser shows part of div mouse is). there tool called active x-ray googles. when activate , take mouse on content div, shown. i not know wrong. have tested in 20 versions of chrome, not work on 1 of them. version not work on latest version of mac os x mavericks on macbook pro retina. javascript jquery html css google-chrome

javascript - Structure application by using jQuery -

javascript - Structure application by using jQuery - i going build application not much rich otherwise can utilize angularjs purpose. wanted organize js code proper modular programming approach. e.g var signupmodule = { elem: $('#id'), // unable access jquery object here init: function (jquery) { alert(jquery('.row').html()); } }; var application = { modules: [], addmodule: function (module) { this.modules.push(module); }, run: function (jquery) { _.each(this.modules, function (module) { //iterate each module , run init function module.init(jquery); }); } } jquery(document).ready(function () { application.addmodule(signupmodule);//add module execute in application application.run(jquery);//bootstrap application }); please @ have updated question actual code the biggest error you've done using anonymous first parameter of anonymous function taken $.each method. first arg...

excel - Finding value in two ranges -

excel - Finding value in two ranges - i have info ranges in 2 columns shown below. utilize "vlookup" formula in order value of columns b. need find value between ranges "60" in column a. naturally, result 4,73%, if utilize "true" alternative in "vlookup". want exact value between 4,73% , 4,64%. please provide valuable answers. thanks. b 50 4,73% 100 4,64% 150 4,55% 200 4,46% 250 4,37% 300 4,28% 350 4,19% 400 4,10% 450 4,01% 500 3,92% 550 3,83% = forecast(60, b2:b12, a2:a12) excel vlookup

javascript - Gulp.js won't reload plain CSS -

javascript - Gulp.js won't reload plain CSS - this gulpfile: var gulp = require('gulp'), watch = require('gulp-watch'), livereload = require('gulp-livereload'); gulp.task('watch', function() { livereload.listen(); gulp.watch('./css/**/*.css', ['css']).on('change', livereload.changed); gulp.watch('./js/**/*.js', ['js']).on('change', livereload.changed); gulp.watch('./**/*.php').on('change', livereload.changed); }); gulp.task('default', [ 'watch']); it reload css 1 time , crash error: [15:30:13] style.css reloaded. [15:30:13] task 'css' not in gulpfile [15:30:13] please check documentation proper gulpfile formatting not sure create of this, had similar issues? first need create task things want css gulp.task('css', function() { homecoming gulp.src('./css/**/*.css') ...

apache - .htaccess - How to set a custom header according to an environement variable? -

apache - .htaccess - How to set a custom header according to an environement variable? - how set custom header via .htaccess according environement variable using if/else directive? #refresh-page <if "%{env:document} == 'loading'"> header set refresh "3" </if> i trying utilize syntax described in documentation apache 2.4 http://httpd.apache.org/docs/2.4/mod/core.html#if test 1 according anubhava's answer rewritecond %{env:document} ^widget$ rewriterule ^.* - [e=refresh:1] #refresh page header set refresh "3" env=refresh rewritecond %{env:refresh} ^1$ rewriterule ^.* loading.html [l] alter env variable store 0 or 1 , can utilize header set this: you can use: # set document=widget (remove if setting this) setenvif host ^ document=widget # set isdoc=1 if document == widget setenvif document widget isdoc # set header if isdoc == 1 header set refresh "3" env=isdoc apache .htacc...

In what time zone are R's file.info()'s mtime expressed? -

In what time zone are R's file.info()'s mtime expressed? - i have file windows (win7) explorer says mtime 24-oct-2014 12:39 . when inquire this/these properties in r using file.info() , getting following: file.info('r:/data/dm29/dm29 - sample_138_20141023_0737.dti') size isdir mode mtime ctime atime exe r:/data/dm29/dm29 - sample_138_20141023_0737.dti 35003850 false 666 2014-10-24 11:39:48 2014-10-23 07:40:32 2014-11-06 11:14:49 no what's going on here? suppose has time zones cannot find reference in help. or perhaps due recent dst switch had? additionally, how can prepare in idiomatic way? next feels bit kludge me. mt <- as.posixct(file.info('r:/data/dm29/dm29 - sample_138_20141023_0737.dti')$mtime, tz='europe/london') attributes(mt)$tzone <- 'europe/amsterdam' r

c - Why pixels are copied backwards? -

c - Why pixels are copied backwards? - i have function converts .bmp .ppm . since .ppm doesn't need padding @ end of each row of pixels, have loop skips padding , writes each pixel .ppm file. however.. copied backwards. rgb->bgr. don't know why, thought fwrite writes bytes in sequence. for(h = height*((width*3) + width%4); h>=0; h -= (width*3) + width%4) { fwrite(&bmpdata[p->__index][54 + h], 1, width*3, fp); } bmpdata 2d buffer containing .bmp file. 54 offset of pixels starts from. what doing wrong? c bitmap buffer pixels

Hierarchical/parent-chid mapping with ElasticSearch -

Hierarchical/parent-chid mapping with ElasticSearch - i've info looks like: { "id": 321, "name": "parent 1", "childs":[ { "id": 3211, "name": "child 1", "data": "some data" }, { "id": 3212, "name": "child 2" }, { "id": 3213, "name": "child 3" } ] } now want query elasticsearch childs has no "data" result this: [ { "id":321, "childs":[ 3212, 3213 ] } ] i read nested objects , parent-child relations in documentation. think need parent-child relation, _id childs , query _ids , not sources. can help me this? thank you you need parent-child. here's mapping: post /my_index { "mappings": { "parents":...

detect wifi status automatically in Android -

detect wifi status automatically in Android - in app have known wifi status automatically user connected wifi or not without user action. want observe when user doesn't utilize app. there way? i'm new android. the best worked me: androidmanifest <receiver android:name="com.aedesign.communication.wifireceiver" > <intent-filter android:priority="100"> <action android:name="android.net.wifi.state_change" /> </intent-filter> </receiver> broadcastreceiver class public class wifireceiver extends broadcastreceiver { @override public void onreceive(context context, intent intent) { networkinfo info = intent.getparcelableextra(wifimanager.extra_network_info); if(info != null) { if(info.isconnected()) { // work. // e.g. check network name or other info: wifimanager wifimanager = (wifimanager)context.getsystemservice(context.wi...

ios - applicationDidEnterBackground is not waiting till method execution is completed -

ios - applicationDidEnterBackground is not waiting till method execution is completed - i save info when app goes in background. doing cancelling nsoperation , saving info in applicationdidenterbackground . not finish execution. how can finish before app goes in background? code : -(void)applicationdidenterbackground:(uiapplication *)application { //function_start // utilize method release shared resources, save user data, invalidate timers, , store plenty application state info restore application current state in case terminated later. // if application supports background execution, method called instead of applicationwillterminate: when user quits. [self performselectoronmainthread:@selector(dispatchstatenotification:) withobject:[nsnumber numberwithint:666] waituntildone:yes ]; // write core info gwscoredatacontroller *datacontroller = [gwscoredatacontroller sharedmanager]; n...

nginx - new relic with multiple apps and multiple accounts in one server -

nginx - new relic with multiple apps and multiple accounts in one server - i have server (nginx + php-fpm) running 3 sites each 1 must reported in separate new relic account. i have php-fpm config , 3 server config settings /etc/nginx/conf.d i set each nginx server config file new relic license , new relic app name takes license set in newrelic.ini. how set don't know, per ini (server config file) or whatever new relic create reports of each site each business relationship associated with? thanks in advance. you can separate sites different new relic accounts 1 of 2 ways: 1) can setup virtual hosts in nginx, , add together different new relic license keys each virtual host. there illustration using apache on new relic docs site. 2) can phone call newrelic_set_appname() via api , alter business relationship during origin of transaction. for example: newrelic_set_appname("app name", "new relic license key"); there more info o...

swing - NetBeans GUI builder cannot find SwingX classes -

swing - NetBeans GUI builder cannot find SwingX classes - i've been thrown existing software development project using maven in netbeans java project. i've fetched source blessed git repo freshly installed netbeans 8. if build , run it, runs. :-) i have edit gui of programme created netbeans gui generator. if seek open gui editor, marks components extends jxpanel invalid, because of next error: java.lang.noclassdeffounderror: org/jdesktop/swingx/jxpanel ... caused java.lang.classnotfoundexception: org.jdesktop.swingx.jxpanel i not understand – files swingx-1.6.jar , swingx-beaninfo-1.6.jar in dependencies section of project (without "!"), i've added them libraries manager, , i've added them palette. programme runs, why, why, why can't netbeans gui editor find classes? what doing wrong? the next excerpt pom.xml: <dependency> <groupid>org.jdesktop</groupid> <artifactid>swingx</artifactid> ...

shell - PHP Overwrite file on other server -

shell - PHP Overwrite file on other server - i have file called updateserver.php has next code: $myfile = fopen("http://173.xxx.xxx.xxx/myurl/demo/path.txt", "w") or die("unable open file!"); i want utilize file edit path.txt file placed on server. possible unable this. i took help : http://php.net/manual/en/features.remote-files.php ps : over-writted files on same server , successful in same. you can't write urls fopen . makes requests. you utilize the curl library create an http set request, have configure server writing to back upwards set requests in fashion. (web servers not default because insane http client able write files server). php shell phpsh

android - My listitem is not getting clicked -

android - My listitem is not getting clicked - i have declared setonitemclick listener in show category dataloaded method. there toast not getting fired if item clicked in list.this dataloaded method called in receivertask class list populated server data #activity class# private arraylist <categorymodel>categorylist; //private static final string[]paths = {"all", "favourites"}; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(com.bioscope.r.layout.categorylist); save=(button)findviewbyid(r.id.save); recievecategoriestask task = new recievecategoriestask(this,"all"); task.execute(); save.setvisibility(view.visible); } public void showcateogrydataloaded(arraylist<categorymodel> categorylist...

android - SqliteDatabase Handler - why does first write query take longer than others -

android - SqliteDatabase Handler - why does first write query take longer than others - i got app database. it gets called 1 time application class , reference forwarded whoever needs it. when gets initialized phone call db = this.getwritabledatabase(); , leave open. while every write operation of simple double takes around 6-10 ms, frist on needs 30-50 ms 8 times long. how come? initialization? thought calling getwritabledatabase() initialize me? or there reason? can read somewhere it, why , how behaves? thanks in advance edit: create more clear: values written way after initialization of db handler, initilization long over. edit 2: digged deeper topic found 2 things: it said queries on unindexed tables slower. true? doesn't android create index sqlite_autoindex_tablename_1. doesn't solve that? that getwritabledatabase() not open gets loaded when first cursor operation (like cursor.move() ) executed? correct? public sqlitedatabase getwritabled...

gem - ruby cannot load such file -

gem - ruby cannot load such file - i know has been done death , seems there dozen questions problem on i'm not finding working answer. i'm using rvm manage rubies, i'm not using custom gemsets. did gem install passivedns-client , installed without giving me errors. i'm not able load gem in scripts or in irb. here output of commands might give context. machine_name:~ user_name$ gem list passive *** local gems *** passivedns-client (1.4.1) machine_name:~ user_name$ rvm gemdir /users/user_name/.rvm/gems/ruby-2.1.3 machine_name:~ user_name$ irb /users/user_name/.rvm/rubies/ruby-2.1.3/bin/irb machine_name:~ user_name$ gem /users/user_name/.rvm/rubies/ruby-2.1.3/bin/gem machine_name:~ user_name$ irb 2.1.3 :001 > $load_path => ["/users/user_name/.rvm/rubies/ruby-2.1.3/lib/ruby/site_ruby/2.1.0", "/users/user_name/.rvm/rubies/ruby-2.1.3/lib/ruby/site_ruby/2.1.0/x86_64-darwin13.0", "/users/user_name/.rvm/rubies/ruby-2.1.3/lib/ruby/...