Posts

Showing posts from April, 2011

javascript - Understand adding rows on click, confusion with .cloneNode(true); -

consider http://jsfiddle.net/99cl3/224/ , adds rows on click html <br /><br /> <table id="tbl"> <tr> <td><input type="text" name="links" /></td> <td><input type="text" name="keywords" /></td> <td><input type="text" name="violationtype" /></td> <td><input type="submit" class="button" value="add line" onclick="addfield(this);" /></td> </tr> </table> js function addfield(n) { var tr = n.parentnode.parentnode.clonenode(true); document.getelementbyid('tbl').appendchild(tr); } i'm trying understand why code adds rows on click works. first realize take click (the input), , go 2 parent nodes above it. first .parentnode points td , , next tr . making table on click these new properties. quest...

Spring mvc requested resource is not available -

application , browser cannot render resource of app. saw lot of similar questions , not find solution. app works fine through json(ie without view) there config @configuration @enablewebmvc @componentscan("ru.practice.web") public class chatlocalwebconfig extends webmvcconfigureradapter { @bean public viewresolver viewresolver() { internalresourceviewresolver resolv = new internalresourceviewresolver(); resolv.setprefix("web-inf/views/"); resolv.setsuffix(".jsp"); resolv.setviewclass(jstlview.class); return resolv; } } initializer public class chatlocalinitializer extends abstractannotationconfigdispatcherservletinitializer { @override protected string[] getservletmappings() { return new string[] { "/" }; } @override protected class<?>[] getrootconfigclasses() { return new class<?>[] { chatlocalwebconfig.class }; } @override protected class<?>[] getservletconfigclasses() { return new class...

My Meteor projects skip MongoDB-startup -

three weeks ago meteor projects worked fine, today noticed all meteor projects skip 'start-mongodb' step , or @ least seems way. projects rely on 1 or more collections stuck on 'starting app' step, while new projects start (probably because no mongodb doesn't cause problems them). note: i'm having these problems while running applications locally on laptop. most posts can find apps freezing on 'starting app' mention app can't connect mongodb, relates case, because never started, i don't know how tell meteor should start mongodb first before running of apps . any tips on matter? have set environment variable mongo_url ? if so, meteor (aka meteor run ) not start mongodb.

Getting Success/Failure Response from PowerShell Enable/Disable User script -

how success/failure response powershell enable/disable user using following scripts.i need update status of user. get-aduser -filter mail -eq $mail | disable-adaccount get-aduser -filter 'mail -eq "ed@gmail.com"' | enable-adaccount please advice me resolve this. just add -passthru parameter enable-adaccount , pass user object along properties. want select enabled user property. get-aduser -filter 'mail -eq "ed@gmail.com"' | enable-adaccount -passthru | select-object enabled

calculated columns - Min value with GROUP BY in Power BI Desktop -

Image
id datetime new_column datetime_rankx 1 12.01.2015 18:10:10 12.01.2015 18:10:10 1 2 03.12.2014 14:44:57 03.12.2014 14:44:57 1 2 21.11.2015 11:11:11 03.12.2014 14:44:57 2 3 01.01.2011 12:12:12 01.01.2011 12:12:12 1 3 02.02.2012 13:13:13 01.01.2011 12:12:12 2 3 03.03.2013 14:14:14 01.01.2011 12:12:12 3 i want make new column, have minimum datetime value each row in group id. how in power bi desktop using dax query? use expression: newcolumn = calculate( min( table[datetime]), filter(table,table[id]=earlier(table[id]) ) ) in power bi using table data produce this: update: explanation , earlier function usage. basically, earlier function give access values of different row context. when use calculate function creates row context of whole table, theoretically iterates on every table row. same happens when use filter function iterate on whole table , evaluate every row against filter co...

graph - Python: Find the total weights of a subgraph's outside edges -

i'm using python-igraph extract subgraph non-directed graph. nodes locations, , subgraph represents nodes/edges within radius node. i need find weights connect outside nodes of subgraph main graph, there simple way of doing this? i'm not sure of formally called. this total weight of cut between chosen set of nodes , rest of graph. can try this: your_nodes = [1, 2, 3] other_nodes = sorted(set(range(graph.vcount())) - set(your_nodes)) weight_of_cut = sum(graph.es.select(_between=(your_nodes, other_nodes))["weight"])

c# - Database Vender Error 245 -

Image
my code generates error message. how can correct this? rpt.bills_per_month rpt = new rpt.bills_per_month(); rpt.setparametervalue("@date", datetimepicker1.text.tostring()); rpt.rpt frm = new rpt.rpt(); frm.crystalreportviewer1.reportsource = rpt; frm.showdialog(); alter proc [dbo].[month_bills] @date nvarchar(20) select * pay_bills ((datepart(mm, date_of_pay) = @date) , (datepart(yy, date_of_pay) = @date))

spring-boot using multiple view resolvers from xml configuration not redirecting correctly -

i have legacy application using spring xml migrating spring-boot. the application starts , authentication page, mapped in applicationcontext-login.xml . on login successful should load web-inf/client/home.jsp, but, instead, tries load /web-inf/auth/home.jsp , 404. in startup log see mapping paths. why conflicting on these redirects , can fix this? encounter issues because of multiple @importresource containing view resolvers? extract security http configuration: <s:http use-expressions="true" entry-point-ref="delegatingauthenticationentrypoint"> <s:form-login login-page="/auth/login" login-processing-url="/auth/j_spring_security_check" authentication-failure-url="/auth/login-secure?loginfailed=true" default-target-url="/auth/defaultentry"/> <s:logout logout-url="/auth/logout" logout-success-url="/auth/...

ruby on rails - Dividing up an index params into multiple pages -

i have list of records have displayed on index page. (they displayed in table form). because there number of them trying divide them 30 records per page. i've created search params functionality index displayed beneath it. the problem having having trouble getting more 1 page render on list. of right have 150 records. have 1 page listed 30 records on , not able sort through them. have idea missing? here segment in code gets addresssed. def search_params default_index_params.merge(params.fetch(:record_collection, {})).with_indifferent_access end def default_index_params { per: 30, page: 1, sort_by: "created_at", sort_direction: "desc", customer_id: 0 } end in view, have little bit of coffee-script plays role in table itself. don't know if root of problem, have here well. :coffeescript $('#record_table').datatable aasorting: [[1, 'asc']] bpaginate: false bfilter: f...

module - ansible shell escape single and double quotes -

i'm trying execute command: ps -eo pid,args --cols=10000 | awk '/\/opt\/logstash\/logstash-1.5.3\// && $1 != procinfo["pid"] { print $1 }' whith ansible -m shell module ( not working example): ansible -m shell -a '"'ps -eo pid,args --cols=10000 | awk '/\/opt\/logstash\/logstash-1.5.3\// && $1 != procinfo[\'pid\'] { print $1 }' '"' one of ways put file, still nice run command - ideas? bash escaping rules do: ansible localhost -m shell -a "ps -eo pid,args --cols=10000 | awk '/\\/opt\\/logstash\\/logstash-1.5.3\\// && \$1 != procinfo[\"pid\"] { print \$1 }'"

c# - Stopped with Exit Code = '-1073740791'. How can I debug it? -

i have windows service started , after time shuts down following exit code: -1073740791. status_stack_buffer_overrun. how can debug? how know happening. tried attaching debugger (with "enable native code debugging" enabled) , selected exceptions doesn't stop. service exits.

javascript - how to dispatch an redux action when refreshing the page or directly enter the URL with react-router -

i using react-router build assets management app. app should provide dedicated asset editing page every individual asset, in route component have this: <router history={browserhistory}> <route path="/" component={app}> <route path="home" component={home}/> <route path="/assets/:assetsid" component={assetspage}/> </route> </router> when user on home page, can click on assets bring assets page. click fire async action fetch assets api , update assets page. the problem flow that, when user in specific assets page , clicks refresh, or directly enters specific assets url. action not fired, , page not populated data how should solve problem ?

javascript - Trying to get parent id and child id using document.getElementById. Error when trying to select both -

i'm using switch statement alter display of label based on dropdown selection. i have div id 'titlebox' , nested 'a' id 'generatepid'. in switch statement, when select 'titlebox' using document.getelementbyid, can't find 'generatepid' , unable property 'style' of undefined or null reference when remove line selecting 'titlebox' 'generatepid' found. <div id="titlebox" class="celltitle" style="width:40px"> <a href="javascript:generatep();" title="xxx." id="generatepid" name= "generatepid">generate</a></div> function onselectcombo(){ var txt = var.getselectedtext(); switch(txt) { case "a": document.getelementbyid('generatepid').style.display='none'; break; case "b": document.getelementbyid('generatepid').style.display='none'; ...

Writing vertex to OrientDB with gremlin-scala wrapper -

i'm using "com.michaelpollmeier" %% "gremlin-scala" % "3.2.0.1" "com.michaelpollmeier" % "orientdb-gremlin" % "3.2.0-incubating.1-snapshot" store domain objects vertices orientdb (v2.1.20) i understand it's pretty bleeding edge code i'd pointers understand why driver throwing exception: caused by: com.orientechnologies.orient.core.exception.odatabaseexception: error on deserialization of serializable @ com.orientechnologies.orient.core.serialization.serializer.record.binary.oserializablewrapper.fromstream(oserializablewrapper.java:47) @ com.orientechnologies.orient.core.serialization.serializer.record.binary.orecordserializerbinaryv0.readsinglevalue(orecordserializerbinaryv0.java:382) ... 13 more caused by: java.lang.classnotfoundexception: com.esc.domain.address any hint appreciated what's going on :) best, edoardo eventually found cause (see github issue it) in...

reactjs - What data should be held in the Redux Store -

currently working on learning react , redux. question content should storing in redux data tree? for example, there 3 different pages: contacts posts comments now each of pages above pulling necessary data database. suppose load in of data @ once, , keep in store (even if on separate page)? or suppose load in necessary pieces of data specific page in store, , still keep other fields in store, make them empty?

linking postscript pdfmark DST with latex hypertarget/bookmark -

%!ps /helvetica findfont 20 scalefont setfont 20 dup moveto (comparator) show newpath [ /rect [ 20 dup moveto (comparator) false charpath pathbbox newpath ] /dst /color [.7 0 0] %use page 2 make work temporary /subtype /link /ann pdfmark showpage for above postscript, donot know destination page number until full pdf generated.the description comparator found @ end of pdf in description table.i tried link via latex \hypertarget didn't work. comparator in pdf can exists more once , should be linked description table @ end. way best complete task? please advise.

javascript - React onClick event not being picked up -

i working on search component auto-complete functionality , running strange behavior. component consists of input ( searchinput ) , list of type-ahead results ( searchresultwrapper ). clicking on type-ahead result should populate searchinput field selected result , hide type-ahead results. losing focus on field should hide results. sample code can found here: https://jsfiddle.net/chez/h22qfx45/ . the issue comes when comment in closeresults function responsible changing state of component hide type-ahead results. when code activated, onclick handler searchresult no longer picked react. there fundamental concept missing here. react disconnecting event listeners searchresult component since hidden? there's thing in js : onblur called before onclick . to solve it, need replace onclick onmousedown . here's code : https://jsfiddle.net/h22qfx45/5/ source : onclick() , onblur() ordering issue

Xamarin image locations in the folder -

i trying reverse engineer xamarin project , write native android program. not being familiar xamarin , not wanting open visual studio ide :-) images of project. trying find icon , splash screens in sln folder couldn't find anywhere. in xamarin android projects, images located in resources folder.

wpf - Choice to close the parent window when closing a child window -

i have main window opens subwindow using: this.hide(); this.showintaskbar = false; login = new frmlogin(this); login.closed += (s, args) => this.close(); login.show(); this works good, sub window opened , if user clicks x button, both windows close. there button in window task however, , if successful, must reopen main window , close sub window: // main reference main window, this. sub window main.showintaskbar = true; main.show(); main.bringintoview(); this.close(); when this.close called, main window close well. can't seem separate such if user clicks x button, closes if user login successfully, sub window closed , main window unhidden. if remove line: login.closed += (s, args) => this.close(); then login work if user clicks x button, sub window closes main window still rubbing in background you can in various way. without changing can put boolean property in frmlogin, public bool closemainform { get; private set; } default value should tru...

Set an image as a background in an android application -

this question has answer here: set background image whole application in android 2 answers how set image background whole activities in android application? ( know how set each activity. want know there way write 1 line of code can affect activities?) you can this: <style name="apptheme" parent="theme.appcompat.noactionbar"> <!-- customize theme here. --> <item name="android:windowbackground">@drawable/picture_name</item> </style>

javascript - Using for-of / for each array of states to manipulate dom -

i wondering how automate below in kind of for-of way. if want perform same test , action many specific states (not all), how go doing var anarray = [firstname, lastname]; (anarray q){ if(this.state.q.length > 1 || this.state.q.length == 0){ document.getelementbyid(tostring(q)).classname="someclass"; }else{ document.getelementbyid(tostring(q)).classname="anotherclass"; } } in return: return function(e) { var state = {}; state[key] = e.target.value; this.setstate(state, () => { if(validate(this.state.dob)){ document.getelementbyid("dob").classname="inputyay"; }else{ document.getelementbyid("dob").classname="inputerr"; } //firstname if(this.state.firstname.length > 1 || this.state.firstname.length == 0){ document.getelementbyid("firstname").classname="inputyay"; }else{ document.getelementbyid("firstname").clas...

access vba - Pass Username through LoginForm, to GreetingForm, to NavigationForm -

i have problem database. when login username loginform greetingform opens , loginform closes. username appears on greetingform, when click on button on greetingform closes , open navigationform username not appear on navigationform. can please me fix problem. click on link below see more details. click on link please i create tempvars . these introduced in access 2007 , unlike public variables, hold value under duress of code error. tempvars global , can created in module type , supported in queries. i change textbox combobox. can refer column number select initials.(column width 0cm) how use: option compare database option explicit public g_username tempvars private sub cmdlogin_click() if isnull(cbo_username) msgbox "please select user" else tempvars!g_username = me.cbo_username.column(1) docmd.close if currentproject.allforms("greetingform").isloaded = false docmd.openform "greetingform", acnormal,...

c++ - Can't store boost::bind functions in std::map -

this question exact duplicate of: storing boost::bind functions in std::map 2 answers i trying map functions using std::bind , std::map #include <boost/bind/bind.hpp> #include <boost/function/function0.hpp> #include <map> class foo { public: foo(); void bar(bool i) {cout << << endl;} private: typedef boost::function<void(bool)> function; std::map<int, function> functionmap; } foo::foo() { functionmap[0] = boost::bind(&foo::bar, this, _1); } the error getting following: error c2582: 'operator =' function unavailable in 'boost::function< signature>' what problem be? you need include <boost/function.hpp> , compiles: #include <iostream> #include <boost/bind/bind.hpp> #include <boost/function.hpp> #include <map> class ...

leaflet - Leafet e.target.getLatLng() not working when paired with markercluster -

i'm using leafet (django-leaflet more precise) , i've been able form .on(click) on marker pans marker , zooms in zoom 10. done using map.setview(e.target.getlatlng(),10); however, have implemented leaflet markercluster , seems getlatlng() undefined function now? code without markercluster, works perfectly: function oneachfeature(feature, layer) { layer.bindpopup(feature.properties.name).on('click', clickzoomy); function clickzoomy(e) { if (map.getzoom() < 10){ map.setview(e.target.getlatlng(),10) //zoom } else{ map.setview(e.target.getlatlng()) }}; here code i'm using markercluster: var multimarker = new l.markerclustergroup(); multimarker.addlayer(l.marker([52.526013, 13.398351],{icon: markhospital})).on('click', clickzoom); multimarker.addlayer(l.marker([52.513666, 13.389633],{icon: markhospital})).on('click', clickzoom); multimar...

java - Taking Inputs in single array in multiple lines (Test Cases) -

i able take inputs in single line in array code below,but want be- 3 //no of test cases 640 480 // new line 120 300 // new line 180 180 // new line "3"is no of test cases,the 6 numbers need stored in single array,how should it? bufferedreader br = new bufferedreader(new inputstreamreader(system.in)); system.out.println("enter min length:-"); string lt = br.readline(); //ignore int length= integer.parseint(lt); system.out.println("enter test cases:-"); string temp = br.readline(); //test-case input int testcases = integer.parseint(temp); system.out.println("enter w , h"); string array = br.readline(); //this takes input in single line string no[] = array.trim().split("\\s+"); int intarray[]= new int[testcases]; for(int =0;i<intarray.length;i++) { intarray[i]=integer.parseint(no[i]); } system.out....

javascript - How to simplify this D3 code? -

i've got csv data looks this, showing pass rates organisation year: org,org_cat,2004_passed,2004_total,2005_passed,2005_total,2006_passed,2006_total gsk,industry,35,100,45,100,55,100 i'm working in d3, , i'd end dictionary of organisations this: data = { 'gsk': { 'org_cat': 'industry', 'data': [ { 'year': 2004, 'passed': 35, 'total': 100 }, { 'year': 2005, 'passed': 45, 'total': 100 }, { 'year': 2006, 'passed': 55, 'total': 100 } ] ] } most of straightforward, i've got messy code year columns: var data = {}; alldata.foreach(function(d) { data[d.org] = { 'category': d.org_cat, 'data': [] }; (var k in d) { var temp = {}; (var k in d) { if (patt.test(k)) { var res = k.split("_"); if (res[0] in temp) { temp[res[0]][res[1]] = +d[k]; ...

.net - How to get all the cookies issued by a webpage in c#? -

Image
i want cookies issued page. using chrome's developer tool, can see page issues adsense cookies. when try using httpwebrequest cant see these cookie using response.cookies. example, visiting page: http://smallbiztrends.com/ can see there adsense cookies using developer tool cant access cookie using httpwebrequest... does has solution this? doing wrong? those cookies come several <iframe> on html page served website. if want cookies need fetch html , parse tags , load src attributes. do notice of these might require javascript run ... need functionality browser offers. simple webrequest not enough. if you're going give try make sure create cookiecontainer , set instance everytime request: var cookies = new cookiecontainer(); webrequest req = webrequest.create(formurl); req.cookiecontainer = cookies; // lots of handling // next request req = webrequest.create(formurl); req.cookiecontainer = cookies; // reuse cookies

How to print matrix data of patches from Netlogo in a excel file? -

i particularly working "flocking" model of netlogo. want select agent , if other agent there next 3 patches of selected agent.i want check around agent matrix form of data , save in excel/cvs file. unfortunately don't have definitive answer you, i'd imagine you'll want of sort: globals [ output_matrix] patches-own [occupied?] setup clear-all reset-ticks create-turtles 50 set output_matrix [] end go move tick end move ask turtles [set heading random-float 361 forward random-float 2 ] ask patches [count turtles-here > 0] [set occupied? 1] ask patches [count turtles-here = 0] [set occupied? 0] check_surroundings end check_surroundings ask turtles [ ifelse any? turtles-on patch-ahead 1 [set output_matrix lput 1 output_matrix] [set output_matrix lput 0 output_matrix]] ask turtles [ ifelse any? turtles-on patch-ahead 2 [set output_matrix lput 1 output_matrix] [set output_matrix lput 0 output_matrix]] as...

javascript - Set selected drop down option in Angular JS -

i have drop down list of results. <div ng-app="myapp" ng-controller="myctrl"> <select ng-model="selectedname" ng-options="item.value item in names track item.id"> </select> </div> <script> var app = angular.module('myapp', []); app.controller('myctrl', function($scope) { $scope.names = [ {"id":1,"value":"nhq"}, {"id":2,"value":"chapter"}, {"id":3,"value":"other"} ]; now want pro grammatically set selected item value in drop down . still initialized blank. i did : $scope.selectedname = "other"; but apparently did not work. missing ? p.s. $scope.selectedname can set . trial , simplified version of problem. use $scope.selectedname = $scope.names[2]; since names array of object , need provide select object set default. var app = angular....

Scraping Table With Python/BS4 -

im trying scrape "team stats" table http://www.pro-football-reference.com/boxscores/201602070den.htm bs4 , python 2.7. im unable anywhere close it, url = 'http://www.pro-football-reference.com/boxscores/201602070den.htm' page = requests.get(url) soup = beautifulsoup(page.text, "html5lib") table=soup.findall('table', {'id':"team_stats", "class":"stats_table"}) print table i thought above code work no luck. the problem in case "team stats" table located inside comment in html source download requests . locate comment , reparse beautifulsoup "soup" object: import requests bs4 import beautifulsoup, navigablestring url = 'http://www.pro-football-reference.com/boxscores/201602070den.htm' page = requests.get(url, headers={'user-agent': 'mozilla/5.0 (macintosh; intel mac os x 10_11_4) applewebkit/537.36 (khtml, gecko) chrome/51.0.2704.103 safari/537.36...

mongodb - Merge duplicates and remove the oldest -

i have collection there duplicate documents. in example: first document: { "_id" : objectid("56f3d7cc1de31cb20c08ae6b"), "addeddate" : isodate("2016-05-01t00:00:00.000z"), "place": "thisplace", "presentindb" : [ { "indb" : isodate("2016-05-01t00:00:00.000z") } ], "checked" : [], "link": "http://www.mylink.com/first/84358" } second document: { "_id" : objectid("577740526c1e542904725238"), "addeddate" : isodate("2016-05-02t00:00:00.000z"), "place": "thisplace", "presentindb" : [ { "indb" : isodate("2016-05-02t00:00:00.000z") }, { "indb" : isodate("2016-05-03t00:00:00.000z") } ], "checked" : [ { ...

ios - Changing the gravity pull on specific nodes with SpriteKit -

i'm trying make game nodes fall top of screen bottom, i've done using gravity. want move nodes left side right. i wondering if change gravity pull on different nodes instead of them falling down screen gravity pull selected nodes left right. i know can using nstimer , function wondering if gravity. i have tried googling answer can't find answer applying 2 gravity pulls. i don't think can have 2 distinct gravity forces same physics world. however if want node "fall" right could apply acceleration (same gravity opposite direction) specific body (this cancel gravity pull) apply 1 more acceleration versus right specific node.

python - Join and sum on subset of rows in a dataframe -

i have pandas dataframe stores date ranges , associated colums: date_start date_end ... lots of other columns ... 1 2016-07-01 2016-07-02 2 2016-07-01 2016-07-03 3 2016-07-01 2016-07-04 4 2016-07-02 2016-07-07 5 2016-07-05 2016-07-06 and dataframe of pikachu sightings indexed date: pikachu_sightings date 2016-07-01 2 2016-07-02 4 2016-07-03 6 2016-07-04 8 2016-07-05 10 2016-07-06 12 2016-07-07 14 for each row in first df i'd calculate sum of pikachu_sightings within date range (i.e., date_start date_end ) , store in new column. end df (numbers left in clarity): date_start date_end total_pikachu_sightings 1 2016-07-01 2016-07-02 2 + 4 2 2016-07-01 2016-07-03 2 + 4 + 6 3 2016-07-01 2016-07-04 ...

javascript - Angularjs saving user input data and generate it to a json file -

i pretty new angularjs , web app development. i'm making simple web app. first, reads default settings json file. on web, users able change these settings. however, stuck on how save changes made users , how generate them new json file. don't know should put in controller. tried different methods found online none of them worked. please assist. app.js - did read file part need save file part. var app1 = angular.module("myapp", []) app1.controller("myappctrl", function ($scope, $http) { $http.get('src/default.json').then(function(response){ $scope.messes = response.data; }); }); logically should work server side processing in situation. write server api (in php, node.js, java etc) accept json, convert json file , stores somewhere , returns downloadable link of physical json file. so in case: $http.get('src/default.json').then(function(response){ $scope.messes = response.data; // per...

android - Error while compiling cm13 (6.0.1) -

hi trying compile cm13 old device gt-i8552 runs msm7x27 , here error. http://pastebin.com/raw/kwv9gwzc and here source of display-caf using base https://github.com/cm13-y300/android_hardware_qcom_display-caf/tree/cm-13.0/libgralloc any appreciated ! thanks

java - Class not found in META-INF/lib after deployment on Glassfish although all jars are there -

i'm facing following problem: while deploying eclipse ejb-project glassfish server, i'm getting "class [ ... ] not found" in server's log 1 of beans. therefore, eclipse tells me "deploy failing". the definitive cause error i'm using class 3rd party jar (apache shiro). while/after deployment, glassfish not able find used class. if skip 1 , line of code using class apache shiro, works fine. i use maven dependency management , correctly added maven dependencies java build path (so not face errors while implementing code) , ejb deployment assembly. the maven dependencies (all needed jars) correctly packeted in ejb-jar-file underneath meta-inf/lib. double checked (1) exporting , inspecting ejb-jar-file eclipse export , (2) analysing files on glassfish server. apache shiro jars deployed under domain1/eclipseapps/ my-app-root /meta-inf/lib (i tried meta-inf/classes same error). by way: when added apache shiro jars under domain1/lib, worked fine....

javascript - Hiding background elements is a good idea? -

i have mobile website. it's ajax based , when clicking row table in main screen, div populated ajax data , fades in, occupying whole window, in fixed position. user can navigate div if it's separate window can out main table (fading out fixed div). so, when user navigate fixed div, in reality there main page body in background. disabling/hiding background main page make website more lightweight mobile or not? structure similar to: <html> <head> <script> function navigatein(url){ $.get(url,function(data){ //get data url $('#navigate').html(data); //put data div $('#navigate').fadein(200,function(){ //fade in div //now, after div faded in, hide background: $('#main').css('overflow','hidden'); //is helpful? $('#main').css('visibility','hidden'); //is helpful? $('#main').css('display','none'); //is helpful? void scrolltop of body, it's not greatest choice }); }); } fu...

scheme - Ascending Numbers in Macro Definition -

i use racket's pattern-matching construct match , , thought way myself debugging programs using match , , learn how racket/scheme macros work, create macro includes information pattern matched. in other words, i'm looking create macro that, given this: (match/debug 'two ['one 1] ['two 2]) outputs this: case 2 <-- printed 2 <-- returned value the main obstacle far has been trying numbers signifying resolved case show correctly. my target try write expand this: (match 'two ['one (displayln "case 1") 1] ['two (displayln "case 2") 2]) but haven't been able figure out way generate "case #" strings. here attempted macro definition: (define-syntax-rule (match/debug id [pattern value] ...) (let ([index 0]) (match id [(begin (set! index (add1 index)) pattern) (printf "case ~a\n" index) value] ...))) it appears though syntax of match...

asp.net web api - how to implement Complex Web API queries in ASP Core -

i'm new web api design, i've tried learn best practices of web api design using these articles: 1. microsoft rest api guidelines 2. web api design-crafting interfaces developers love "apigee" apigee recommending web api developers use these recommendations have better apis. quote here 2 of recommendations: need c# code implementing these recommendations in web apis (in asp core) back-end native mobile apps , angularjs web site. sweep complexity behind ‘?’ apis have intricacies beyond base level of resource. complexities can include many states can updated, changed, queried, attributes associated resource. make simple developers use base url putting optional states , attributes behind http question mark. red dogs running in park: get /dogs?color=red&state=running&location=park partial response allows give developers information need. take example request tweet on twitter api. you'll more typical twitter...

Signalr: Websockets connection issue -

our application uses signalr , have enabled websockets in our applicaiton. getting below error in browser console window , during same time auto update not working. after relaunch started working. firefox: "the connection ws://xx.xx.xx.xx:xxxxx/signalr/connect?transport=websockets&connectiontoken=%2f54bwg4ui3mbjpk2t8dfs9akllctaedq1sheasz6e3h2lvt0wybbggvci2alnsjf0aqy4azmtp6fs0xl07td8kkfyhamiel4gjlcxp%2bhlfy3k226j%2b4fxhvb8vvblewc&connectiondata=%5b%7b%22name%22%3a%22pushdatahub%22%7d%5d&tid=7 interrupted while page loading." chrome: jquery.signalr-1.0.0.min.js:10 websocket in closing or closed state. please refer below setup done on server. .net framework 4.6.1 in server. websockets enabled in iis/application httpruntime set in web.config server uses signalr hub sample client code: $scope.ishubconnectionfailed = false; $scope.connection = $.hubconnection(appurl); $scope.hubproxy = $scope.connection.createhubproxy(app.chathub); $scope.connec...

angularjs - UI-Bootstrap Typeahead on a Modal -

i wanted place typeahead directive on modal dialog. problem when typeahead show it's list of possible matches behind modal-footer div. played append-to-body whole list behind modal dialog. played append-to no luck. suggestion? the solution add attribute html: typeahead-append-to-body="true" and in css file this: .dropdown-menu { z-index:9999; } now typeahead displays correctly on modal dialog.

python - Using dataframe in a class to filter results -

i've created class preprocess document pandas dataframes. however, i'm having trouble using filters within class. code below: class dataframe: def __init__(self, my_dataframe): self.my_dataframe = my_dataframe self.my_dataframe = self.filter_priv() def filter_priv(self): df = self.my_dataframe.copy() df = df[~(df.priv_id > -1) | ~(df.restriction_level > 0)] df1 = dataframe(df) df my output non filtered results. input file has 262,000 records, , filter, when called outside class filters df down 11,000 records. ideas why not filter in class? you're problem might you're using variable "df" initialize dataframe class, variable df hasn't been defined yet...

Determine if cell exists in a specified range w/ Powershell Excel COM -

for example, i'm looking determine following logic: if (b2 in a1:b20) # if cell b2 within range a1:b20 { return $true } is there function within excel can used this? read =countif() function not able working. again using excel com object within powershell. thanks since cell names coordinates, purely question of arithmetic comparison, no need involve excel itself: function test-cellinrange { param( [validatepattern('^[a-z]+\d+$')] [string]$cell, [validatepattern('^[a-z]+\d+\:[a-z]+\d+$')] [string]$range ) # grab x , y coordinates range input, sort in ascending order (low high) $p1,$p2 = $range -split ':' $xpoints = ($p1 -replace '\d'),($p2 -replace '\d') |sort-object $ypoints = ($p1 -replace '\d'),($p2 -replace '\d') |sort-object # grab x , y coordinate cell $cellx = $cell -replace '\d' $celly = $cell -replace '\d' ...

java - Selenium Web driver select data from drop down by reading drop down value from excel sheet -

Image
i trying select drop down value reading drop down value excel. tried following code however, not selecting value per data mentioned in excel sheet. me data populating correctly in respective field except gender drop down. following screen shot of html code , ui: following html code: <td class="codetable last-cell" headers="n224aa-4-2"> <div id="widget___o3id7" class="dijit dijitreset dijitinline dijitleft codetable dijittextbox dijitcombobox" lang="en-us" role="listbox" dir="ltr" widgetid="__o3id7" aria-expanded="false"> <div class="dijitreset dijitright dijitbuttonnode dijitarrowbutton dijitdownarrowbutton dijitarrowbuttoncontainer" role="presentation" data-dojo-attach-point="_buttonnode, _popupstatenode" popupactive="true"> <input class="dijitreset dijitinputfield dijitarrowbuttoninner" type="text" r...

nginx not running that displays 404 message -

i've been following directions based on http://linoxide.com/linux-how-to/install-configure-femp-stack/ so far when ran ip address http://ip address got error says "404 not found." i've enable sysrc nginx_enable=yes , 1 works next tried nginx -t , part works , says: nginx: configuration file /usr/local/etc/nginx/nginx.conf syntax ok nginx: configuration file /usr/local/etc/nginx/nginx.conf test successful then tried nginx result , it didn't work , got message saying "invalid option: "result"" didn't work tried service nginx start , start running , when type ip address kept getting 404 message.

google apps script - GAS Split one cell and fill down another -

Image
i have following situation: column g column h |black, brown, grey| | dog | |calico | | cat | |green, blue | | bird| | ... | | ... | i split , fill down this: column g column h |black | |dog | |brown | |dog | |grey | |dog | |calico| |cat | |green | |bird| |blue | |bird| |... | | ...| looking @ script split comma delineated cell ( function split text in cell , create column ) can follow split it's filling down portion having trouble with. understand should set while loop first cell var = , second cell var = j. dump split contents of array , fill down array.length. however, can't seem syntax correct. i'm pretty new js , gas appreciated. thanks help. -jh here's custom function should work you: /** * splits array commas in column given index, given delimiter * @param {a2:b20} range range reference * @param {2} coltosplit column index * @param {","} delimiter character split * @cust...

node.js - Change the speed of a stepper motor with an Arduino and Nodejs -

my stepper motor controlled using l293d driver connected ardiuno. using serial connection control motor nodejs. want speed of motor change when move slider unable write function performs right outcome. the code based tutorial, http://www.barryvandam.com/node-js-communicating-with-arduino/ #include <spi.h> //#include <arest.h> #include <stepper.h> #include <wire.h> // forward/reverse read vars string inputstring = ""; // string hold incoming data boolean togglecomplete = false; // whether string complete boolean pwmcomplete = false; int lastcommand = 0; int velocity = 0; int ina1 = 12; // input 1 of stepper int ina2 = 11; // input 2 of stepper int inb1 = 10; // input 3 of stepper int inb2 = 9; // input 4 of stepper int steps = 0; int rpm = 0; #define steps 200 stepper motor(steps, ina1, ina2, inb1, inb2); //int speed; void setup() { pinmode(ina1, output); pinmode(ina2, output); pinmode(inb1, ou...

r - Column is NULL when printed as individual field or column, filled when whole data frame is printed -

when create column of counts using dplyr, appears filled correctly, until try use counts column on own. example: create dataframe: v1 <- c("test", "test", "test", "test", "testing", "testing","me-tested", "re tested", "re testing") v2 <- c("othertest", "anothertest", "testing", "123", "random stuff", "irrelevant", "tested", "re-test", "tests") v3 <- c("type1", "type2", "type1", "type2", "type3", "type2", "type2", "type2", "type1") df <- data.frame(v1, v2, v3) then, use dplyr create column of counts: df$counts <- df %>% group_by(v3) %>% mutate(count = n()) this gives expected result: > df v1 v2 v3 counts.v1 counts.v2 counts.v3 counts.count 1 test other...