Posts

Showing posts from May, 2013

Spark REPL doesn't run due to an error -

i got pre-built spark 1.4.1 , i'm running hdp 2.6. when run spark-shell gives me error message follows. because i'm missing jar file ? error actor.oneforonestrategy: java.lang.nullpointerexception @ org.apache.spark.deploy.client.appclient$clientactor$$anonfun$receivewithlogging$1.applyorelse(appclient.scala:160) @ scala.runtime.abstractpartialfunction$mcvl$sp.apply$mcvl$sp(abstractpartialfunction.scala:33) @ scala.runtime.abstractpartialfunction$mcvl$sp.apply(abstractpartialfunction.scala:33) @ scala.runtime.abstractpartialfunction$mcvl$sp.apply(abstractpartialfunction.scala:25) @ org.apache.spark.util.actorlogreceive$$anon$1.apply(actorlogreceive.scala:59) @ org.apache.spark.util.actorlogreceive$$anon$1.apply(actorlogreceive.scala:42) @ scala.partialfunction$class.applyorelse(partialfunction.scala:118) @ org.apache.spark.util.actorlogreceive$$anon$1.applyorelse(actorlogreceive.scala:42) @ akka.actor.actor$class.aroundreceive(actor.sc

excel - vba: Identify row using 2 criteria and return other data from row -

Image
i trying find code looks @ 2 criteria in spreadsheet1 , finds row corresponds in spreadsheet2 , returns third piece of data in spreadsheet2 spreadsheet1. need in vba because loops, because done again , again, , because data spreadsheet2 imports database , change on time. if possible nice if code allowed identifying 3rd criteria on spreadsheet2. example is: spreadsheeet 1 product id actcode: a0003 11111 12345 22222 ... spreadheet 2 productid activitycode datedue 11111 a0001 7/15/15 11111 p7530 7/30/15 11111 a0003 8/1/15 12345 a0003 12/15/15 12345 a0007 1/1/15 22222 a0001 2/1/15 ... where want spreadsheet1 end up: spreadsheeet 1 product id actcode: a0003 11111 8/1/15 12345 12/15/15 22222 - ... i have tried ton of things on past few days. 1) vlookup/index/match combos have never worked, 2) filtering spreadsheet2 productid , activitycode , copying sp

c++ - How to get more information about cv::Stitcher failing -

Image
i have 2 cameras looking overhead @ square object, , i'd take 2 images , combine them 1 image (approximately) representative of overall area. the views 2 cameras so: the left edge of left image should stitch right edge of right image, dotted black line being point overlap. my first attempt stitch images using technique in tutorial: http://ramsrigoutham.com/2012/11/22/panorama-image-stitching-in-opencv/ #include <stdio.h> #include <iostream> #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/nonfree/nonfree.hpp" #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/imgproc/imgproc.hpp" using namespace cv; void readme(); /** @function main */ int main( int argc, char** argv ) { if( argc != 3 ) { readme(); return -1; } // load images mat image1= imread( argv[2] ); mat image2= imread( argv[1] ); mat gray

Facebook Marketing API - Create ad without business page -

is possible create ad via facebook marketing api without having or using facebook business page? hadn't found reference confirms guess. i'll appreciate help, thanks! yes, can create link ad not connected page using adcreative fields title, body, object_url, , image_file or image_hash. actor_id use fb user id can reading /me endpoint. more info on adcreatives @ https://developers.facebook.com/docs/marketing-api/adcreative/v2.4 here's curl example page. -f 'object_url=https://www.link.com' \ -f 'title=my title' \ -f 'body=my ad body' \ -f 'image_hash=<image_hash>' \ -f 'actor_id=<actor_id>' \ -f 'access_token=<access_token>' \ https://graph.facebook.com/<api_version>/act_<ad_account_id>/adcreatives

html - Why does my mobile device still treat my viewport as a desktop? -

i doing quick mobile version of desktop site in bootstrap , running formatting issues. when expand view on desktop, icons show in 3 4 grid fine. when narrow width of window, grid of images acts accordingly , narrows down 1 column 12 images per row, no horizontal side bar. however, when viewing on mobile, my nav bar not 'snap' width of visible resolution per , allows me side scroll - though images still aligned in 1 column of 12 images. navigation acts if being viewed on desktop , not on mobile despite site detecting being viewed on mobile. might hard replicated in fiddle without seeing on mobile, included fiddle see if can tell talking about. /*******general********/ *{ box-sizing: border-box; margin: 0; zoom: 1; font-size: 13px; } body{ background: #f9f9f9 url(../img/crossword.png) repeat top left; font-family: 'open sans', tahoma, sans-serif; max-width: 100%; background-color: #5f5e5e; font-size: 13px; color: #333; o

popup - User can't navigate if dialogue is open -

if dialogue open , user wants open screen or needs close dialogue first , navigate, otherwise can't. i having javafx dialogue working unable figured out how restrict user not navigate anywhere else without closing current dialogue. code: final textfield templatetexbox = new textfield(); final label templatenamelabel = new label("template name"); final label templatetype = new label("type of template"); final checkbox cb = new checkbox("set default template"); final combobox combobox = new combobox(); combobox.getitems().addall("private", "public"); combobox.setprompttext("select template type"); if (getviewmodel().selectedtemplate().get() != null) { templatetexbox.settext(getviewmodel().selectedtemplate().get().getpreference().getname()); cb.setselected(getviewmodel().selectedtemplate().get().getdefaulttemplate()); co

database - How to Print Multiple Report Tabs In Access -

i have form order can put in, , user can select check boxes, , click button generate of different reports checked off. when button pushed, opens of reports current record in print preview, in multiple tabs. wondering if there way user print open report tabs @ once or have go through each tab printing separately? thanks

swift2 - "Binary operator > cannot be applied to two Float operands" error -

i have conditional looks like: if sqrtf(powf(starttouch.x - (touches.first as! uitouch).locationinview(self.view).y, 2) + powf(starttouch.y-(touches.first as! uitouch).locationinview(self.view).y, 2)) > dragthreshold as! float { self.drag = false; } i getting error says binary operator > cannot applied 2 float operands . cannot understand why can't check if float greater float. error trying tell me? the members of cgpoint of type cgfloat , , assuming on 64-bit architecture native type used store cgfloat double - try treating calculated values double s (use sqrt() , pow() instead of float versions)... using dragthreshold double well

objective c - iOS - How to handle large amount of data from webservice -

i getting large amount of data web service. if amount of records return more 1500 or 2000 memory overflows , app crashes. don't need save data locally, have present data user. how can manage not crash , display whole of data? the best way go ahead change web service accept page param , return paginated results. make seamless in tableview, can add infinite scrolling - i.e. if user reaches row <last-10> , send request next set of records , load them in table view. but this, assuming face memory issues if persist 2k records (your data array) in memory. memory management needed there well.

c# - Connection and communication between console and forms project in the same solution -

i have quite small (so far) project consists of core gui tui the tui (console application) communicating console application in order send , retrieve information. the purpose of gui make easier. however, stuck on how make tui communicate gui. far, know can start tui gui this: system.diagnostics.process.start(@"cmd.exe", @"/k c:\project\tui\bin\debug\tui.exe"); but now, not have reference console application , not know send information forth , back. tried search answer, search lead how start them in normal way (not both, together, communicating). so in all, question is: how start console application windows forms project 2 able communicate? you can use input , outut streams of process. read : https://msdn.microsoft.com/de-de/library/system.diagnostics.process.standardinput(v=vs.110).aspx

jquery - How to animate input box and btn search -

i have following code , animation not working expected. on focusout inputbox animates nice btn_search returns place without animation. <div class="form-group"> {!!form::text('pretraga',null,['id'=>'pretraga','class'=>'form-control','placeholder'=>'pretraga...'])!!} </div> <div class="form-group"> {!!form::button('<span class="glyphicon glyphicon-search"></span>', ['id'=>'btn_search', 'class'=>'btn btn-default'])!!} </div> $("#pretraga").click(function (e) { e.preventdefault(); $(this).animate({width: '250px'}, "slow"); }); $("#pretraga").focusout(function(e){ e.preventdefault(); $(this).animate({width: '100%'}, "slow"); });

matlab - Surface intensity for a moving light source -

i’m trying write simulation move light source on surface of object, on each step measure intensity of reflected light light source. then plot intensity each point of surface. each step adding first plot. building picture of surface topography. it bit messy if can suggest way tidy up. x = -10:0.25:10; y = -10:0.25:10; xlength=length(x); ylength=length(y); ymin=min(y); ymax=max(y); xmin=min(x); xmax=max(x); d=zeros(xlength); [x,y] = meshgrid(x,y); z = 10-(x.^2)-(y.^2)+5*sin(x); rnd=rand(xlength); c=randi(xlength); d=randi(xlength); s=1; t=0; i=1:ylength t=t+1; j=1:xlength if s==c if t==d d(s,t)=z(s,t); elseif t==d+1 d(s,t)=z(s,t); elseif t==d+2 d(s,t)=z(s,t); elseif t==d+3 d(s,t)=z(s,t); elseif t==d+4 d(s,t)=z(s,t); elseif t==d+5 d(s,t)=z(s,t); else d(s,t)=0;

javascript - AngularJS - mask/hide XHR network events from debugger -

Image
would check if there such way can prevent javascript events logging debugger image below? i realized can see response data server in debugger. how should hide such not printed out in debugger?

Git merge behavior (ahead of x by y commits) -

i've came across git behavior cannot understand. repo used tens of people. case this: $ git checkout master $ git merge --no-commit feature automatic merge went well; stopped before committing requested $ git status on branch master branch up-to-date 'origin/master'. conflicts fixed still merging. (use "git commit" conclude merge) changes committed: modified: web/webapp/grails-app/views/layouts/empty.gsp $ git commit -m 'commit message' [master e6cc2eb] commit message $ git status on branch master branch ahead of 'origin/master' 21 commits. (use "git push" publish local commits) what confuses me part: your branch ahead of 'origin/master' 21 commits. how come it's not 1? make clear, there single change in empty.gsp file. there 20 more commits, why not show after git status ? hints might missing?

c# - WordprocessingDocument object: get filename property -

is possible filename property of wordprocessingdocument object? know when instantiate object, need provide path file, need filename instantiated object. stream stream = new filestream(@"c:\users\username\documents\document_name.docx", filemode.open, fileaccess.read, fileshare.readwrite); wordprocessingdocument doc = wordprocessingdocument.open(stream, false); i want 'document_name' string doc object. i prefer use office com assemblies communication between application , office document. gives more functionalities , it's quite easy use. include namespace microsoft.office.interoperability.word in code start that. declare word.application object , use open, edit, extract data word document, including documents properties. leave filestream handling large text files.

find correlation images in folders and print result in excel using matlab -

i tried compare template image ( image2 ) image folders names test* ( test1 , test 2 .... test n) find correlation between template image images folder , print result in folder go next folder test2 .. till test n , thats mean result of find correlation each image in folder test1 print excel file named ( name ) store in folder test1 , content of excel file follow : first row contain names of images in folder test1 , second row contain correlation result if 0 or 1 after jump next folder test2 ...test3.... etc the following code tried long time xls_sheet = 'sheet1'; column_range = 'b'; % initialisation of column range srcfolders = dir('d:\test*'); xls_filename = 'result.xls'; folder = 1:length(srcfolders) path = strcat('d:\',srcfolders(folder).name); xlswrite('d:\srcfiles(i)\xls_filename',{srcfolders(folder).name},xls_sheet,folder_range); %writing name of folder in first row sear = strcat(path, '\*.bmp'); srcfiles = dir(s

php - Update some json items in existing file -

i'm trying simple script manipulate json, decode json file , create foreach make ifs looking information live games, live.json file: { match: [ { id: "348324", date: "2015-07-19t21:30:00+00:00", league: "brasileirao", round: "14", hometeam: "joinville", hometeam_id: "1208", homegoals: "1", awayteam: "ponte preta", awayteam_id: "745", awaygoals: "1", time: "67", location: "arena joinville", hometeamyellowcarddetails: { }, awayteamyellowcarddetails: { }, hometeamredcarddetails: { }, awayteamredcarddetails: { } }, { id: "348319", date: "2015-07-19t21:30:00+00:00", league: "brasileirao", round: "14", hometeam: "cruzeiro", hometeam_id: "749", homegoals: "1", awayteam: "avai fc", awayteam_id: "1203", awaygoals: "1", time: "finished", location: "mineir

html - Understanding scope in directive's childs -

i'm trying understand "scopes" in agularjs , can't understand following piece of code: html: <body ng-app="mymodule"> <div ng-controller="myctrl"> <my-component> <h2>attribute</h2> {{isolatedattributefoo}} </my-component> <my-component> <h2>attribute</h2> {{isolatedattributefoo}} </my-component> </div> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script> <script src="app.js"></script> angularjs: var mymodule = angular.module('mymodule', []) .directive('mycomponent', function () { return { restrict:'e', scope:{} }; }) .controller('myctrl', ['$scope', function ($scope) { $scope.isolatedattributefoo = 'hello!'; }]); as can see simple test. far know (from this ex

javascript - SetInterval loop relatively confusing to me -

html <div id="backspace" ng-click="deletestring(''); decrementcursor();"> js <script> $scope.deletestring = function() { if($scope.cursorposval > 0){ //$scope.name = $scope.name - letter; $scope.name = [$scope.name.slice(0, $scope.cursorposval - 1) + $scope.name.slice($scope.cursorposval)].join(''); console.log($scope.name); settimeout(function(){ setcaretposition("inputbox", $scope.cursorposval); }, 30); } else { $scope.cursorposval = 1; } }; </script> i designing on screen touchscreen keyboard. backspace button. going make when click , hold backspace button, starts removing characters automatically. don't know begin creating setinterval, , know setinterval need use here. if i'm not wrong, want while you're keeping button pressed, function repeats itself. you're right setinterval(). howe

ios - How to allow only these orientations in my Cordova/Phonegap app? -

Image
i created ios (iphone) app using cordova , want allow following orientations: portrait landscape left landscape right this means "upside down" should not allowed : i know can set in xcode when ever start new cordova build setting gets overwritten. so checked cordova docs , found this: http://cordova.apache.org/docs/en/5.1.1/config_ref_index.md.html#the%20config.xml%20file it says can set orientation in config.xml this: <preference name="orientation" value="landscape" /> but don't see how can set more fine granular setting described above. how can done? note: on cordova 5.1.1 you can use config.xml' <platform name="ios"> <preference name="orientation" value="all" /> </platform> along shouldrotatetoorientation(degrees) callback stated in docs this: ondeviceready: function() { app.receivedevent('deviceready'); window.shouldrotatetoori

c# - Why are the calculations in my calculator not correct? -

for c# class, required program simple calculator performs basic mathematical operations(add, subtract, multiply, divide). followed professor's video , program works fine. subtract command seems add - in front of result. divide command results in way off. doing wrong? example: 123+2 = 125 (as should) 123 - 2 = -121 124 / 2 = 0.0161290322580645 12.4 * 10 = 124 (correct) here code: public partial class form1 : form { string operand = "", operation = "", memory = ""; public form1() { initializecomponent(); } private void btnnum1_click(object sender, eventargs e) { txtoutput.text += "1"; } private void btnnum2_click(object sender, eventargs e) { txtoutput.text += "2"; } private void btnnum3_click(object sender, eventargs e) { txtoutput.text += "3"; }

sql server - SSIS Data Conversion to OLE DB Destination column mapping -

Image
i using visual studio 2012 (shell) create ssis package import flat file sql server db table. i have flat file source , ole db destination data conversion component in between. i use data conversion tool convert columns source unicode string [dt_wstr] wont unicode non unicode error. i left default output alias names given columns data conversion component original input column name words "copy of" added in front. i have on 200 columns. when double click on destination component , go map columns, see original column names showing first in drop down of available columns map , when scroll down past first 200 original column names converted column names (the ones copy of). i don't know how doing earlier have hit down arrow key twice , switch "column 0" "copy of column 0" able tab thru , map columns. (tab, tab, down arrow key, down arrow key , repeat). now reason have press down arrow key on 200 times past of original columns names able sele

apiblueprint - Use pattern in API Blueprint / MSON -

i'm investigating possibilities of new data structures syntax in api blueprint, mson. possible attach or rather specify pattern (regex)? don't found on topic. to provide regex validation data structure need provide json schema has validation rule. example, following: ### view questions detail [get] + response 200 (application/json) + attributes + question: `favourite programming language?` (string) + schema { "properties": { "question": { "type": "string", "pattern": "^favourite.*$" } } }

set intersection - finding the smallest array that intersects with a set of arrays -

say have 3 arrays - ['a', 'b'] , ['b', 'c'] , ['d'] . if create fourth array intersects these 3 arrays minimal number of elements array i'd ['b', 'd'] . question is... how go finding array? like ['a', 'b', 'c', 'd'] intersects arrays it's not minimal intersection - ['b', 'd'] is. any ideas? i don't have answer algorithm, true that, commenter amit wrote, np-complete problem. problem called hitting set problem, equivalent set cover problem . if you're fine approximation, according wiki article, greedily picking elements hit arrays gets.

php - Read WebPages and export specific data -

using c++ have read specific data webpage (a soccer player page), , want create file player team. first of import page code curl file.txt, than, after read file.txt sent content in string. have split name , specific team. how can split it? have delete html/php tags. (example: <'p name""> ronaldo <\p> ---> ronaldo ) can me please? sorry bad english. thank in advice.

python - sympy solve function as function -

i want solve f(x) (eq(2*f(x)+f(1/x),1/x)) the expected output f(x) = (2-x^2)/(3*x) i try solve((eq(2*f(x)+f(1/x),1/x)),f(x)) this answer contains f(1/x) : (-x*f(1/x) + 1)/(2*x) how f(x) = (2-x^2)/(3*x) in sympy? i don't think sympy solve functional equations in way want, separate particular equation two: 2y+z = 1/x , 2z+y = x y(1/x) = z(x) , let sympy solve both y , z: in [5]: x, y, z = symbol('x'), symbol('y'), symbol('z') in [6]: solve((eq(2*y+z,1/x), eq(2*z+y,x)),y,z) out[6]: {y: (-x**2 + 2)/(3*x), z: (2*x**2 - 1)/(3*x)} so y f(x) want here.

IntelliJ form snapshot fails with exception -

Image
i created simple project scratch test form snapshot functionality. the project has 1 source file , uses defaults of file->new project. source is: package com.company; import javax.swing.*; import java.awt.*; public class main { public static void main(string[] args) { swingutilities.invokelater(new runnable() { @override public void run() { jlabel label = new jlabel("hello"); jframe frame = new jframe("title"); frame.setlayout(new borderlayout()); frame.add(label,borderlayout.center); frame.setsize(400,300); frame.setvisible(true); } }); } } i following exception when try take snap shot: exception in thread "awt-eventqueue-0" java.lang.noclassdeffounderror: com/intellij/designer/designereditorpanelfacade @ java.lang.classloader.defineclass1(native method) @ java.lang.classloa

c# - Can move multiple items simultaneously in ListBox up the list, but not down? -

i have strange bug i'm having hard time figuring out. if select multiple items in listbox , select arrow, items move 1 space if 1 unit. however, not happen when clicking down arrow move items down 1 spot each in list. instead, if select number of items , click down arrow, none of items moves @ all, , if select odd number of items , click down arrow, bottom item moves down 1 space, while others stay are. anyone have idea why might happening? here code i'm using handle moving of items: private void moveiteminselecteditemslistbox(object sender) { if (selecteditemslistbox.selecteditems.count > 0) { // build list of items moved list<object> listofitemstobemoved = new list<object>(); (int = 0; < selecteditemslistbox.selecteditems.count; i++) { listofitemstobemoved.add(selecteditemslistbox.selecteditems[i]); } (int k = 0; k < listofitemstobemoved.count; k++) { var selecteditem = listofitemstobemoved[k];

Making Twisted Python simple client server example to work -

i new twisted python (twisted 12.x, python 2.6.x, unfortunately have use older version), , running client/server in server echoes simple message client (example chap 2 of twisted o'reilly book) running server in terminal, , client in separate terminal. client , server stuck (not returning). failing? server: from twisted.internet import protocol, reactor class echo(protocol.protocol): def datareceived(self, data): self.transport.write(data) class echofactory(protocol.factory): def buildprotocol(self, addr): return echo() reactor.listentcp(50000, echofactory()) reactor.run() client: from twisted.internet import reactor, protocol class echoclient(protocol.protocol): def connectionmade(self): self.transport.write("hello, world!") def datareceived(self, data): print "server said:", data self.transport.loseconnection() class echofactory(protocol.clientfactory): def buildprotocol(self, addr):

ios - UICollectionView and willDisplayCell/SupplementaryView in iOS7 -

as see in documentation methods: - (void)collectionview:(uicollectionview *)collectionview willdisplaycell:(uicollectionviewcell *)cell foritematindexpath:(nsindexpath *)indexpath ns_available_ios(8_0); - (void)collectionview:(uicollectionview *)collectionview willdisplaysupplementaryview:(uicollectionreusableview *)view forelementkind:(nsstring *)elementkind atindexpath:(nsindexpath *)indexpath ns_available_ios(8_0); are available ios8, need perform actions supplementaryview begin displayed in ios7. how can achieve it?

Loading an ado file on Stata -

i had query regarding loading third party programmes onto stata. i using stata version 13.1, , trying use program defined in third-party ado file, written world bank (accessible here ). i have tried putting ado file in c:/ado/plus folder, default directory listed on stata. however, when try run dominance using: dominance y [aw=wt], sortvar(x) stata throws following error: plugin not loaded or not available: use adoonly option i can't find information on how load plugin. it’s making impossible me use programme , run analysis, there i'm doing wrong? the adoonly option corresponds user-written command locpoly , requirement of dominance . the author of dominance assumes have plugin locpoly installed. if don't want install it, need modify dominance ado-file run locpoly, ... adoonly . the option install plugin locpoly . article introducing command here . note locpoly superseded lpoly , stata official command. find statalist thread relevan

javascript - Issue with ng-repeat after calling $compile to bind dynamic HTML in angular -

i'm building application has multiple tabs containing html generated dynamically. clicking tab calls .net mvc controller render razor view, return html angular , display in body of tab. the body of tab needs bound underlying angular model. i'm not sure if best way it, have far, works: function updatehtml(html, tabid) { angular.element(document.getelementbyid('tabbodycontainer')).html(html); $scope.currenttab = tabid; var fnlink = $compile(document.getelementbyid('tabbodycontainer')); // returns link function used bind template scope fnlink($scope); } this works great except when click on tab has repeater. first tab has repeater renders fine on load because first tab generated on page load razor view engine , bound. when click different tab , click back, rows in repeater missing, if repeater didn't bind or dom never updated section after $compile. any ideas? or there better way this? thanks! i wor

html - CSS Push menu will ease in but not east out -

i creating push menu. can menu, body, header, main, , footer push open want it, when close menu, menu disappears, while else eases same opened. want menu ease same way else , not "disappear". i've looked @ code long think , need set of eyes. you can see demo here: http://designs.totaleeyou.com/jml-development/ click main in top left corner. here section of css handles transition: body, body.has-active-menu-push-left, body.has-active-menu-push-right, header.scroll, header ul.logo, #menu-push-left, #menu-push-right, a.menu-close i.fa-times-circle-o, .page-masking { -webkit-transition:all 0.5s; -moz-transition:all 0.5s; -ms-transition:all 0.5s; -o-transition:all 0.5s; transition: 0.5s; } body.has-active-menu-push-left, #menu-push-left { -webkit-transform:translate(100%, 0); -moz-transform:translate(100%, 0); -ms-transform:translate(100%, 0); -o-transform:translate(100%, 0); transform:t

Controlling scroll rate in Selenium Java? -

is there way control rate scroll down in java? public static void scrollpage(webdriver driver) { javascriptexecutor executor = (javascriptexecutor) driver; executor.executescript("window.scrollto(0, document.body.scrollheight);"); } this have scrolls bottom automatically. you can divide scrollheight 100 , use loop scroll step step small delays between steps.

ruby on rails - RubyCas client using https not receiving the CasServer 'LogoutRequest' -

rubycas client using https not receiving casserver 'logoutrequest' i used 'rubycas-client' gem. it's working fine in http (with cluster servers also), when trying use 'https' (using ssl certificate), application server not receiving casserver session 'logoutrequest'. it's still maintaining session. why happening?

Listbox - indicate if there are items below without a scrollbar in a listbox WPF C# -

i'm doing touchable wpf application , in listbox removed scrolls, user can scroll down panning. works fine. want notify user somehow (maybe arrow icon or text "there more items") there more items below, user know can scroll down. ideas how can achieve this?

html - How do I override internet explorer emulation in an iframe? -

the company work forces users visit site ie emulate ie8. need put iframe in content within iframe work ie9 , above. these 3 options i've added iframed page override parent pages ie8 emulation. i've added header: <meta http-equiv="x-ua-compatible" content="ie=edge"> and i've tried these scripts: <!--[if ie]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!--[if ie> <script> if (!document.documentmode || (document.documentmode < 9)) { document.write("<script src="http://html5shiv.googlecode.co..."></script>”); } </script> <![endif]--> is aware alternatives override parent pages emulation of ie8 or doing wrong? this not possible, unfortunately. according microsoft's pages, web pages cannot display in multiple document modes, exception of ie10, can display frame in quirks mode child of standards m

Find missing rows based on two columns and date series – Postgresql -

i try search missing periods (year , month = 201508) , each employe signature 'aa'. searching 1 column works: select * generate_series('2014-12-31','2016-12-31', interval '1 month') dates to_char(dates,'yyyymm') not in (select ts_per ts) http://sqlfiddle.com/#!15/0cafa/4 the output of missing month like march missing. but want output per employee well. missing record jan , march jd , feb , march. bb missing 3 months. jd 201502 jd 201503 201501 201503 bb 201501 bb 201502 bb 201503 here newbie attempt add employee search fails: http://sqlfiddle.com/#!15/0cafa/5 error: syntax error tia clue, sorry not sure want... recommend outer join select * generate_series('2015-01-01','2015-03-01', interval '1 month') dates left outer join ts on concat(ts_sign,ts_per) = concat(ts_sign,to_char(dates,'yyyymm')) to see same , missing, , : select * generate_series('2015-01-01','201

php - Insert two date variables into startDate and endDate fields in the table -

i want insert 2 date variables startdate , enddate fields in table. first $today, next $today plus $duration. i have piece of code used work before, not work again. require_once('connection/config.php'); $today = date("y:m:d"); //get today's date $duration = 14; //get duration $sql_insert = mysql_query("insert adverts (cust_id, startdate, enddate)values('".$today."', (curdate()- weekday(curdate()) +'".$duration."')"); if($sql_insert){echo 'successful';}else {echo 'failed';} this code worked previously. now, it's not working again. insert , returns result enddate '0000-00-00'. i not know why returning '0000-00-00'. please me. thank all. you can't subtract integers dates in mysql (that's oracle thing). you need curdate() - interval weekday(curdate()) day you're trying do.

ruby on rails - Manage users through a CRUD interface with devise errors -

i have establish crud interface devise below code, problem running when try create user following errors. can't edit either. please help. "2 errors prohibited user being saved: email can't blank password can't blank" of course have been entering of information inclduding email , password. follow documentation devise , have read of site devise topics no such problem reported. controller: class userscontroller < applicationcontroller before_filter :authenticate_user! before_action :authorized_user # /users # /users.json def index @users = user.all # respond_to |format| # format.html index.html.erb # format.json { render :json => @users } end # /users/1 # /users/1.json def show @user = user.find(params[:id]) # respond_to |format| # format.html show.html.erb # format.json { render :json => @user } end # /users/new # /users/new.json def new @user = user.new # respond_to |format| #

easypost - Getting a 401 when making a HTTP POST request using CORS in Dart -

i trying build small web app in dart. app calls easypost web service, illustrated curl call: $ curl -x post https://myuserid@api.easypost.com/v2/trackers -d 'tracker[tracking_code]=ez1000000001' -d 'tracker[carrier]=fedex' here dart code attempted match request: // configuration parameters var url = "https://myuserid@api.easypost.com/v2/trackers"; var data = { 'tracker[tracking_code]': '$packageno', 'tracker[carrier]': 'fedex' }; // make request var request = new httprequest(); request ..open("post", url, async: true) ..withcredentials = true ..onloadend.listen((_) => print(request.responsetext)) ..send(data.tostring()); when run in webstorm code fails when making request cors error: post https://api.easypost.com/v2/trackers 401 (unauthorized) xmlhttprequest cannot load https://api.easypost.com/v2/trackers. no 'access-control-allow-origin' header present on requested resource. ori

php - A Database Error Occurred Error Number: 1064 -

i've been working on project , wan't trying figure out how make union mysql method in codeigniter 3, can't find problem have, here's model file i've created, can 1 help: class reference_model extends ci_model { function search($term,$orig){ //affichage des produits par référence $this->db->select('*') ->distinct() ->from('treference') ->like('sreference',$term) ->or_like('nreference', $term) ->or_like('ssearch', $term) ->or_like('ssort', $term) ->get(); $q1 = $this->db->last_query(); if (isset($orig)) { $this->db->select('nmanufacturer') ->distinct() ->from('tmanufacturer') ->where_in('nmanufacturer=treference.nmanufacturer') ->get(); $q2 = $this->db->last_query(); }else { $q2=''; } $query = $thi

html5 - Can an Email get image Url's from a localhost server? -

okay let me explain little better. have mvc project html page , images , have set smtp server send email. when debug webpage localhost url. (localhost:51180) email try send looks this: (simplified version): <html> <body> <img alt="img" src="https://www.google.com/images/srpr/logo11w.png" />*working <img alt='img' src='localhost:51180/images/img.png'/> *not working </body> </html> my problem second pic doesn't work. (if copy past url in web browser while project running can see right path). because website running local on computer , email cant access it? or else? in advance! a couple things try.. #1 try changing url http://localhost:51180/images/img.png . should have protocol in there ( http ) i'm not sure can this... #2 use base 64 encoding of image embed it. e.g.: <img src="base64;==asdlfnlansl;34n5ljl5jslj5;hl;sh5j..." />

c# - Is adding the logic for a event in a separated method to the one that triggers it a good practice? -

for example let's have windows form textboxes numbers , button, , when click on button want take value of of texts , math them. would this: private void btnsomeresult_click(object sender, eventargs e) { dosomemath(); } be better practice say: private void btnsomeresult_click(object sender, eventargs e) { //complex math goes here. } or depend on complexity of operation? example may not needed in simple multiplication, division etc. private void btnsomeresult_click(object sender, eventargs e) { dosomemath(); } this approach better suited because of following reasons if ui changes, replacing button another button need same function, can reuse functionality written. in essence, ui independent of functionality of button control. you can test method (dosomemath) if start unit testing. a still better way data ui elements , pass on method parameters in more specific class/type ensure data independent of ui controls // function reads dat

ruby on rails - Nested Layout not rendering properly -

Image
i have application.html.erb , has this: <!-- truncated brevity --> <body> <%= content_for?(:content) ? yield(:content) : yield %> </body> then have layout family_tree.html.erb that looks this: <%= render template: "layouts/application" %> <main id="view"> <title>timeline!</title> <%= render partial: "tree_header" %> <% content_for :content %> <%= yield %> <% end %> </main> that partial _tree_header.html.erb looks this: <header class="profile-header"> <div class="wrapper"> <div class="profile-author"> <h2 class="center author-name">martha doe <a class="author-description-btn" href=""><i class="icon-list-2"></i></a></h2> <h4 class="author-title">aunt <i class="author-title-circ&qu

ANT - Conditional execution of macro within target -

i'm attempting implement believe should pretty basic conditioning not having success. have target (deploy.development) , within target call 2 macros backup/restore ini file using configuration. outline this: <target name="deploy.development" description="deploy development"> <echo>start: deploy ${mode.dev}</echo> <echo>source: ${dir.source}</echo> <macrobackupsourceconfigfile /> <macroupdateconfigfile keydatasource="${setting.devdsn}" keyserver="${server.devdevweb11}" keyappname="${setting.devappname}" keyapplicationid="${setting.applicationid}"/> <macrocopyfiles dirsource="${dir.source}" dirtarget="${dir.devdevweb11}"/> <macrorestoresourceconfigfile /> <echo>end: deploy ${mode.dev}</echo> </target> in projects ini file not required, therefore not need run either of 2 macros

javascript - Asynchronous code and loops within Node.js? -

i've done hours of research on asynchronous programming, can't seem grasp 1 single concept within node, wondering if here me. i've written following code sample return / output simple string concatenation of strings object: var itemcollection = { item1 : [{ foo : "bar" }, { foo : "bar" }, { foo : "bar" }], item2 : [{ foo : "bar" }, { foo : "bar" }, { foo : "bar" }], item3 : [{ foo : "bar" }, { foo : "bar" }, { foo : "bar" }] } var astring = ""; for(item in itemcollection){ (var = 0; < itemcollection[item].length; i++) { var anitem = itemcollection[item][i]; //somefunctionthatdoesalongiooperation takes item param, plus callback. somefunctionthatdoesalongiooperation(anitem, function(databackfromthisfunction){ // data returned function astring += databackfromthisfunction.datatoappend; }); }

bash - Updating last 2 lines displayed on terminal using shell? -

i'm trying build simple progress bar script display bar current action in progress. with of echo -ne "[||...] processing ${file_name}\r" can display progress bar as: [||||||||............] processing file1 however i'm expecting output this: processing file1 [||||||||............] note: both seperate lines , want update them both script progress. is there way achieve this? you can use tput cuu 2 move cursor 2 lines, , tput el clear current line: while sleep 1 tput el; date tput el; echo "$random" tput cuu 2 done this produce 2 changing lines of e.g. thu jul 23 17:50:46 pdt 2015 23676

Data Comparison in Excel? -

since yesterday i've been struggling thousands of data in excel. reduce amount of data have, decided take important ones , remove others. goes identical strings smaller values in case. let's take 3x2 data: b --------------- 1 | abc123 | 10 | --------------- 2 | abc123 | 50 | --------------- 3 | abc123 | 300 | --------------- so can see there 3 identical strings, yet have different values. want compare values between these identical strings, , keep string biggest value , delete analogues. this simple example. there tons of identical strings in file have different values. , (somehow) biggest 1 optimal one, don't need rest of them. and question is, supposed accomplish this? functions, formulas, anything? i'd appreciate help. lot! you sorting range values(biggest smallest), go data tab, , use 'remove duplicates'. make sure have column selected strings when remove duplicates, , nothing else. otherwise, may lose more data mea