Posts

jquery - MVC Controller returning JSON to populate Select list but value needs to have a colon -

we have mvc controller returns json want. populate select list options values have colon in them. json: {result: {["valueone": "option 1: option", "valuetwo" : "option 2: other option"]} we populating list jquery $.ajax $("#eventnamedropdownlist").change(function () { geteventdatesandtimes(); }) function geteventdatesandtimes() { var eventname = $('#eventnamedropdownlist').val();// on eventnamedropdownlist value coming "option 1:" instead of whole value. var url = '@url.action("geteventdatetimebyname", "product")'; $("#eventidanddatedropdownlist").find('option').remove().end(); // clear before appending new list $.ajax({ url: url, type: "get", cache: false, datatype: "j...

VB.NET 'Outlining' bugs/features in Visual Studio 2015 Update 2 -

fresh install of visual studio 2015 update 2. have visual studio 2010 sp2 installed. running windows 8.1 pro x64. i'm having 2 problems outlining in vb.net vs 2015 in right-click context menu, when click "collapse definitions", regions in file not collapsed. in vs 2010 in same project, regions collapsed. has there been change in how "collapse definitions" behaves @ point between vs 2010 , vs 2015? (see screenshot) - #region "public methods" (and every other region) not collapse, far collapses. for sub or function has xml doc comments attached it: if collapse sub , xml comments, collapsed method description (i.e. line directly above public sub... ) displays '''<summary> in front of actual typed description. in vs 2010, when xml comments collapsed, '''<summary> disappears , see start of actual method description. refer again above screenshot i installed vs 2015 yesterday , installed update 2...

python - Why does running the Flask dev server run itself twice? -

i'm using flask developing website , while in development run flask using following file: #!/usr/bin/env python datetime import datetime app import app import config if __name__ == '__main__': print '################### restarting @', datetime.utcnow(), '###################' app.run(port=4004, debug=config.debug, host='0.0.0.0') when start server, or when auto-restarts because files have been updated, shows print line twice: ################### restarting @ 2014-08-26 10:51:49.167062 ################### ################### restarting @ 2014-08-26 10:51:49.607096 ################### although not problem (everything rest works expected), wonder why behaves this? ideas? the werkzeug reloader spawns child process can restart process each time code changes. werkzeug library supplies flask development server when call app.run() . see restart_with_reloader() function code ; script run again subprocess.call() . if set use...

hadoop - Install spark on yarn cluster -

i looking guide regarding how install spark on existing virtual yarn cluster. i have yarn cluster consisting of 2 nodes, ran map-reduce job worked perfect. looked results in log , working fine. now need add spark installation commands , configurations files in vagrantfile. can't find guide, give me link ? i used guide yarn cluster http://www.alexjf.net/blog/distributed-systems/hadoop-yarn-installation-definitive-guide/#single-node-installation thanks in advance! i don't know vagrant, have installed spark on top of hadoop 2.6 (in guide referred post-yarn) , hope helps. installing spark on existing hadoop easy, need install only on one machine. have download 1 pre-built hadoop version it's official website (i guess can use without hadoop version need point direction of hadoop binaries in system). decompress it: tar -xvf spark-2.0.0-bin-hadoop2.x.tgz -c /opt now need set environment variables. first in ~/.bashrc (or ~/.zshrc ) can set spark...

xml - How move Child Nodes along with values to grand parent node -

i tried few different ways transfer child nodes grand parent, pattern match happening 1 child node not recursively. appreciate here. <grandparent1> <parent1> <child1>1</child1> <child2>2</child2> </parent2> </grandparent1> should become <grandparent1> <child1>1</child1> <child2>2</child2> </grandparent1> size of child nodes varies. appreciate here this easy using xslt's recursive processing model . first, use identity transform template recursively copy as is . add exception parent nodes , make them continue recursion without copying themselves. xslt 1.0 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/> <xsl:strip-space elements="*"/> <!-- identity t...

ios - How to fit UIImageView around UIImage in UIStackView -

Image
i trying uiimageview fit around uiimage. should but happening how can fix this?

How to get unlock metadata in Android e.g. fingerprint vs passcode? -

i have application implements deviceadminreceiver . when user attempts unlock device, able determine method (e.g., pin or fingerprint reader) used. the reason because possible fingerprint reader errors exceed threshold failed unlocks specified user's policy, , when happens, user's data wiped device manager. poor user experience lose data because hand brushed against phone in bag while looking else. able smarter how fingerprint scanner failures counted against policy threshold vs. how pins or password attempts counted. as far can tell, android not give me information, thought might ask wider community on chance i'm missing something.