text:
Q: D3 append data to div when region on map is clicked I'm quite new to D3, so please bear with my limited understanding. However, I'm glad for any feedback.
My goal is to draw a map based on a json file, and when a user clicks on a particular region, information over that region stored in the json is carried over to update a div element.
Drawing the map works well but I really don't find a way update the div "infobox" element dynamically when a region on the map is clicked.
Here's my code (or codepen):
This is the HTML:

 Wählen Sie eine Gemeinde aus:

Testtext

Test phone number Tel: +41 123456789, E-Mail: test.tester@nothing.ch

This is the Javascript:
var w = 500;
var h = 500;
var svg = d3.select("div#default3").append("svg").attr("preserveAspectRatio", "xMinYMin meet")
.attr("viewBox", "0 0 " + w + " " + h).style("background","#c9e8fd")
.classed("svg-content", true);
var svg2 = d3.select("div#default3").append("svg")

var projection = d3.geoMercator().translate([w/2, h/2]).scale(50000).center([8.548589899,47.15309567]);
var path = d3.geoPath().projection(projection);

var map = {"type":"FeatureCollection","features":[
{"type":"Feature","id":"1701","properties":{"name": "Baar", "BZNR": 900, "KTNR": 9, "GRNR": 6, "AREA_HA": 2485, "X_MIN": 680116, "X_MAX": 686287, "Y_MIN": 222816, "Y_MAX": 230856, "X_CNTR": 682600, "Y_CNTR": 227800, "Z_MIN": 419, "Z_MAX": 841, "Z_AVG": 531, "Z_MED": 520, "Z_CNTR": 445, "E_MIN": 2680116, "E_MAX": 2686287, "N_MIN": 1222816, "N_MAX": 1230856, "E_CNTR": 2682600, "N_CNTR": 1227800, "SEE_HA": 0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.574363083557836, 47.21706812989359 ], [ 8.577749613288111, 47.215011706103219 ], [ 8.576129062899831, 47.212032985974268 ], [ 8.561539972359638, 47.203882617691455 ], [ 8.557552604746339, 47.194817768412044 ], [ 8.557244754483197, 47.186248443922757 ], [ 8.554398710359168, 47.181794306956746 ], [ 8.560778412848412, 47.173910281626519 ], [ 8.559117488870253, 47.165859863203018 ], [ 8.561384354255475, 47.159890945858365 ], [ 8.560275553641809, 47.154798812828808 ], [ 8.563597065244437, 47.154010950380737 ], [ 8.562838131938173, 47.15295517749292 ], [ 8.558540006941621, 47.150867920584112 ], [ 8.558501419349682, 47.15087498685179 ], [ 8.555291165831276, 47.157370297474216 ], [ 8.551342320685508, 47.156276363498684 ], [ 8.543679267101627, 47.157465336542401 ], [ 8.535951863736321, 47.164940315479079 ], [ 8.536293022823976, 47.168043966644724 ], [ 8.5397311661049, 47.169056837496512 ], [ 8.539069556134105, 47.171367603461363 ], [ 8.53559303974613, 47.174662029650463 ], [ 8.530554339832346, 47.173676871307201 ], [ 8.529344865027788, 47.17629102113564 ], [ 8.523346138598873, 47.178906406762174 ], [ 8.52756304680041, 47.18323386967333 ], [ 8.525258436702931, 47.185849922878994 ], [ 8.523382565003908, 47.186430189628375 ], [ 8.520630765439529, 47.182751417086692 ], [ 8.516618666718474, 47.18206585376663 ], [ 8.506786347744949, 47.188078672237403 ], [ 8.50054711712796, 47.184166035876821 ], [ 8.497364669858559, 47.186360817103917 ], [ 8.499877703474164, 47.189721561701816 ], [ 8.4996184797614, 47.192909776148298 ], [ 8.503836336388623, 47.19772679331934 ], [ 8.496166550984272, 47.200144249999916 ], [ 8.496470339921531, 47.20365874708618 ], [ 8.50271249624295, 47.208775140954153 ], [ 8.49839421947333, 47.212069531500916 ], [ 8.512332083786385, 47.215518958954426 ], [ 8.512563831979756, 47.219414804884863 ], [ 8.531079447754902, 47.217562733739989 ], [ 8.5326170255299, 47.221369414029837 ], [ 8.536362115720015, 47.220600668325694 ], [ 8.539155139361812, 47.222905497500477 ], [ 8.543440106770262, 47.222047006513243 ], [ 8.552954839643645, 47.221655523916631 ], [ 8.553836421582767, 47.223237112064297 ], [ 8.560344781729905, 47.219544134669995 ], [ 8.574363083557836, 47.21706812989359 ] ] ] ] } },
{"type":"Feature","id":"1702","properties":{"name": "Cham", "BZNR": 900, "KTNR": 9, "GRNR": 6, "AREA_HA": 1773, "X_MIN": 673934, "X_MAX": 678885, "Y_MIN": 224570, "Y_MAX": 231889, "X_CNTR": 677400, "Y_CNTR": 226100, "Z_MIN": 387, "Z_MAX": 468, "Z_AVG": 423, "Z_MED": 425, "Z_CNTR": 414, "E_MIN": 2673934, "E_MAX": 2678885, "N_MIN": 1224570, "N_MAX": 1231889, "E_CNTR": 2677400, "N_CNTR": 1226100, "SEE_HA": 0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.446639984374663, 47.223378925509728 ], [ 8.447923373865144, 47.220109727055956 ], [ 8.452096960209827, 47.219600417225202 ], [ 8.452944758306009, 47.217760568621372 ], [ 8.456678015754976, 47.218571838952265 ], [ 8.461402994994117, 47.213631061500841 ], [ 8.470090427865324, 47.213404438513024 ], [ 8.473835673159703, 47.210624265133092 ], [ 8.473296587156355, 47.20852534322114 ], [ 8.476219839913568, 47.210021420919006 ], [ 8.479897424251535, 47.208621545882352 ], [ 8.473914888453578, 47.207381748287901 ], [ 8.476795078387987, 47.205586049916718 ], [ 8.468986058968401, 47.198863614230689 ], [ 8.475071503183424, 47.195796147715789 ], [ 8.473350807222008, 47.19321227816566 ], [ 8.478111649485212, 47.189897691444614 ], [ 8.477088357376482, 47.185323254532754 ], [ 8.475715596314114, 47.183116921382293 ], [ 8.466727136087206, 47.178382510609993 ], [ 8.461462374888836, 47.178552995575096 ], [ 8.453869571792026, 47.173782555928213 ], [ 8.448469235421182, 47.175827036141804 ], [ 8.447381652392583, 47.180102806850492 ], [ 8.435012704625866, 47.182759535013595 ], [ 8.425578463967254, 47.190306755459531 ], [ 8.422956600520612, 47.199190179474023 ], [ 8.425494282605229, 47.202252182490028 ], [ 8.415767280977155, 47.215959197018563 ], [ 8.417025830447066, 47.233772005320631 ], [ 8.41827718044482, 47.226771532975206 ], [ 8.421684644898367, 47.223320678310493 ], [ 8.429758733483061, 47.224951017553032 ], [ 8.437157020624317, 47.223686548401247 ], [ 8.441121669856212, 47.225215216385806 ], [ 8.443800335498009, 47.222637513284667 ], [ 8.446639984374663, 47.223378925509728 ] ] ] ] } },
{"type":"Feature","id":"1703","properties":{"name": "Hünenberg", "BZNR": 900, "KTNR": 9, "GRNR": 6, "AREA_HA": 1841, "X_MIN": 672418, "X_MAX": 677552, "Y_MIN": 223040, "Y_MAX": 233506, "X_CNTR": 674900, "Y_CNTR": 225200, "Z_MIN": 386, "Z_MAX": 496, "Z_AVG": 415, "Z_MED": 397, "Z_CNTR": 447, "E_MIN": 2672418, "E_MAX": 2677552, "N_MIN": 1223040, "N_MAX": 1233506, "E_CNTR": 2674900, "N_CNTR": 1225200, "SEE_HA": 0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.41399877452896, 47.243670898834004 ], [ 8.416486668270229, 47.241322260155812 ], [ 8.414195709659452, 47.239154921884492 ], [ 8.417025830447066, 47.233772005320631 ], [ 8.415767280977155, 47.215959197018563 ], [ 8.425494282605229, 47.202252182490028 ], [ 8.422956600520612, 47.199190179474023 ], [ 8.425578463967254, 47.190306755459531 ], [ 8.435012704625866, 47.182759535013595 ], [ 8.447381652392583, 47.180102806850492 ], [ 8.448469235421182, 47.175827036141804 ], [ 8.453869571792026, 47.173782555928213 ], [ 8.452574702205602, 47.171278918477356 ], [ 8.455679445550032, 47.167139647156311 ], [ 8.449283039472595, 47.164394543195357 ], [ 8.446716925810644, 47.15884367702634 ], [ 8.430062765957206, 47.15797370341965 ], [ 8.429866961501867, 47.155730595746064 ], [ 8.424061396016997, 47.156233989385775 ], [ 8.416210583968919, 47.1541810109427 ], [ 8.414208577273302, 47.157056332488516 ], [ 8.414523476745208, 47.157395029191996 ], [ 8.415304129651181, 47.164129705136709 ], [ 8.411878211443202, 47.173264370965867 ], [ 8.40252305360867, 47.176692461674122 ], [ 8.400263233063951, 47.18358189295482 ], [ 8.405292241537461, 47.195727625503061 ], [ 8.400486077300734, 47.20832981345157 ], [ 8.40081784279724, 47.215096577273179 ], [ 8.396486113259806, 47.219965554935023 ], [ 8.396021387219646, 47.228876166368877 ], [ 8.405824046318724, 47.236715910183563 ], [ 8.40812851571196, 47.242462433176122 ], [ 8.410801678201864, 47.245495609715405 ], [ 8.410073365007364, 47.248375752391922 ], [ 8.41399877452896, 47.243670898834004 ] ] ] ] } },
{"type":"Feature","id":"1704","properties":{"name": "Menzingen", "BZNR": 900, "KTNR": 9, "GRNR": 6, "AREA_HA": 2751, "X_MIN": 684571, "X_MAX": 693051, "Y_MIN": 222511, "Y_MAX": 228913, "X_CNTR": 687300, "Y_CNTR": 226000, "Z_MIN": 510, "Z_MAX": 1208, "Z_AVG": 819, "Z_MED": 803, "Z_CNTR": 809, "E_MIN": 2684571, "E_MAX": 2693051, "N_MIN": 1222511, "N_MAX": 1228913, "E_CNTR": 2687300, "N_CNTR": 1226000, "SEE_HA": 0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.610796547527301, 47.202682085059507 ], [ 8.615157190374344, 47.19934685405979 ], [ 8.617393145767386, 47.192289038134611 ], [ 8.620901415172877, 47.190329657368494 ], [ 8.620629861905112, 47.187746070518699 ], [ 8.628113799231242, 47.179512634649889 ], [ 8.623993307337624, 47.173338601394185 ], [ 8.632798241723968, 47.171871448549524 ], [ 8.639363926664023, 47.171469261222754 ], [ 8.641671450294997, 47.168929387216004 ], [ 8.652286176499905, 47.171038156066963 ], [ 8.660730277654967, 47.170310373113757 ], [ 8.661229145199732, 47.160951267179975 ], [ 8.665773195360254, 47.15966567910035 ], [ 8.660390697982068, 47.158012677643455 ], [ 8.659537577750591, 47.151639608081702 ], [ 8.636659395186847, 47.151490364862774 ], [ 8.622462916156875, 47.153427923444276 ], [ 8.617822930062164, 47.15169363911626 ], [ 8.612129896348389, 47.154374062160201 ], [ 8.59986962365317, 47.153480774964926 ], [ 8.594513672944244, 47.150506485939502 ], [ 8.591289367451356, 47.150447401837972 ], [ 8.587295774306398, 47.153437863491163 ], [ 8.580227447704887, 47.150894697208713 ], [ 8.569010063863216, 47.150940209784842 ], [ 8.56490422564058, 47.148063407898846 ], [ 8.562838131938173, 47.15295517749292 ], [ 8.563597065244437, 47.154010950380737 ], [ 8.560275553641809, 47.154798812828808 ], [ 8.561384354255475, 47.159890945858365 ], [ 8.559117488870253, 47.165859863203018 ], [ 8.560778412848412, 47.173910281626519 ], [ 8.554398710359168, 47.181794306956746 ], [ 8.557244754483197, 47.186248443922757 ], [ 8.558639471154235, 47.185330436294286 ], [ 8.565217715342987, 47.188221463084666 ], [ 8.568104311894709, 47.187439068081339 ], [ 8.575958692034058, 47.193503601065608 ], [ 8.585494318174167, 47.191319297875168 ], [ 8.592543848297007, 47.187063408106276 ], [ 8.600538318279941, 47.189982924692998 ], [ 8.609243331108823, 47.187475244578536 ], [ 8.611181977562538, 47.188985525896747 ], [ 8.60726639973281, 47.192516774978934 ], [ 8.607492915891344, 47.201048918436229 ], [ 8.603149949772485, 47.203038088195747 ], [ 8.606041239212393, 47.205241984355496 ], [ 8.610796547527301, 47.202682085059507 ] ] ] ] } },
{"type":"Feature","id":"1705","properties":{"name": "Neuheim", "BZNR": 900, "KTNR": 9, "GRNR": 6, "AREA_HA": 793, "X_MIN": 684755, "X_MAX": 688863, "Y_MIN": 226647, "Y_MAX": 230381, "X_CNTR": 686100, "Y_CNTR": 228900, "Z_MIN": 481, "Z_MAX": 768, "Z_AVG": 653, "Z_MED": 661, "Z_CNTR": 664, "E_MIN": 2684755, "E_MAX": 2688863, "N_MIN": 1226647, "N_MAX": 1230381, "E_CNTR": 2686100, "N_CNTR": 1228900, "SEE_HA": 0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.577168878118224, 47.218660386367645 ], [ 8.583390199776977, 47.217486699655936 ], [ 8.58101389764583, 47.214567079047718 ], [ 8.582601548333454, 47.210645577658383 ], [ 8.587879720218901, 47.212569933088012 ], [ 8.594160573909701, 47.212053697078979 ], [ 8.59769222806848, 47.208944738028933 ], [ 8.596328429443924, 47.204890712606613 ], [ 8.598350905689687, 47.201773611320178 ], [ 8.603149949772485, 47.203038088195747 ], [ 8.607492915891344, 47.201048918436229 ], [ 8.60726639973281, 47.192516774978934 ], [ 8.611181977562538, 47.188985525896747 ], [ 8.609243331108823, 47.187475244578536 ], [ 8.600538318279941, 47.189982924692998 ], [ 8.592543848297007, 47.187063408106276 ], [ 8.585494318174167, 47.191319297875168 ], [ 8.575958692034058, 47.193503601065608 ], [ 8.568104311894709, 47.187439068081339 ], [ 8.565217715342987, 47.188221463084666 ], [ 8.558639471154235, 47.185330436294286 ], [ 8.557244754483197, 47.186248443922757 ], [ 8.557552604746339, 47.194817768412044 ], [ 8.561539972359638, 47.203882617691455 ], [ 8.576129062899831, 47.212032985974268 ], [ 8.577749613288111, 47.215011706103219 ], [ 8.574363083557836, 47.21706812989359 ], [ 8.577168878118224, 47.218660386367645 ] ] ] ] } },
{"type":"Feature","id":"1706","properties":{"name": "Oberägeri", "BZNR": 900, "KTNR": 9, "GRNR": 6, "AREA_HA": 3003, "X_MIN": 687663, "X_MAX": 695749, "Y_MIN": 216326, "Y_MAX": 224372, "X_CNTR": 689200, "Y_CNTR": 221100, "Z_MIN": 723, "Z_MAX": 1422, "Z_AVG": 915, "Z_MED": 925, "Z_CNTR": 736, "E_MIN": 2687663, "E_MAX": 2695749, "N_MIN": 1216326, "N_MAX": 1224372, "E_CNTR": 2689200, "N_CNTR": 1221100, "SEE_HA": 0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.610834003974261, 47.118201258995896 ], [ 8.609063923087566, 47.114992364353142 ], [ 8.599358767736799, 47.115481821509277 ], [ 8.601317601276365, 47.121115694378553 ], [ 8.610834003974261, 47.118201258995896 ] ] ], [ [ [ 8.695822004487972, 47.162940182803048 ], [ 8.701158410928659, 47.150946112328803 ], [ 8.68849684576012, 47.146083753031903 ], [ 8.6842565059601, 47.140784637214253 ], [ 8.68706729635487, 47.1363098104339 ], [ 8.68178477223192, 47.125023013451418 ], [ 8.678274835198206, 47.124526432616669 ], [ 8.67072358459937, 47.119122480500884 ], [ 8.671818497111264, 47.115685574958988 ], [ 8.659800641300127, 47.114677914186792 ], [ 8.659773489172197, 47.11092135096083 ], [ 8.649317174184739, 47.103438734270476 ], [ 8.644910552442544, 47.095860217570227 ], [ 8.641343422265862, 47.09438667261999 ], [ 8.634636519828435, 47.093345190094517 ], [ 8.611784251199195, 47.094974107703713 ], [ 8.608699200635833, 47.094451867948422 ], [ 8.607450045473028, 47.09199704725728 ], [ 8.605713486461259, 47.105323386760574 ], [ 8.610638490040943, 47.104179609823674 ], [ 8.618229544047518, 47.106080274456261 ], [ 8.61545722326067, 47.107265526157249 ], [ 8.615303160279016, 47.109762307773025 ], [ 8.610877647625879, 47.109005492955973 ], [ 8.610572668356212, 47.113710280835477 ], [ 8.621484448655124, 47.114195457109091 ], [ 8.624364460226401, 47.113034051695344 ], [ 8.624319217527326, 47.10756942313666 ], [ 8.63065702169243, 47.102264682808006 ], [ 8.640093095917059, 47.103580246542862 ], [ 8.64333123044711, 47.114354705967337 ], [ 8.630147692919845, 47.129705018570434 ], [ 8.620017891442906, 47.133433133029662 ], [ 8.613000362263705, 47.132054128068546 ], [ 8.604675188818925, 47.137448096867864 ], [ 8.598008216011726, 47.136915343575573 ], [ 8.598311653363494, 47.145254373829459 ], [ 8.594513672944244, 47.150506485939502 ], [ 8.59986962365317, 47.153480774964926 ], [ 8.612129896348389, 47.154374062160201 ], [ 8.617822930062164, 47.15169363911626 ], [ 8.622462916156875, 47.153427923444276 ], [ 8.636659395186847, 47.151490364862774 ], [ 8.659537577750591, 47.151639608081702 ], [ 8.660390697982068, 47.158012677643455 ], [ 8.665773195360254, 47.15966567910035 ], [ 8.674978204275737, 47.159444857675219 ], [ 8.692194743996895, 47.163400348676547 ], [ 8.695822004487972, 47.162940182803048 ] ] ] ] } },
{"type":"Feature","id":"1707","properties":{"name": "Risch", "BZNR": 900, "KTNR": 9, "GRNR": 6, "AREA_HA": 1486, "X_MIN": 673814, "X_MAX": 679700, "Y_MIN": 218550, "Y_MAX": 224986, "X_CNTR": 675100, "Y_CNTR": 221600, "Z_MIN": 400, "Z_MAX": 679, "Z_AVG": 440, "Z_MED": 429, "Z_CNTR": 428, "E_MIN": 2673814, "E_MAX": 2679700, "N_MIN": 1218550, "N_MAX": 1224986, "E_CNTR": 2675100, "N_CNTR": 1221600, "SEE_HA": 0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.467037874363832, 47.118535738090351 ], [ 8.454105924336865, 47.113696624217752 ], [ 8.449443131650529, 47.130961238436392 ], [ 8.445423932875574, 47.1288462727031 ], [ 8.441609146223463, 47.129473319398116 ], [ 8.430394442597567, 47.123319941231003 ], [ 8.420315977824389, 47.122628757099747 ], [ 8.415394210144473, 47.124415272996622 ], [ 8.416758971969584, 47.130557447577523 ], [ 8.41220557848721, 47.140566751974859 ], [ 8.414867473099555, 47.145261503950955 ], [ 8.411953002750403, 47.153606946803563 ], [ 8.414208577273302, 47.157056332488516 ], [ 8.416210583968919, 47.1541810109427 ], [ 8.424061396016997, 47.156233989385775 ], [ 8.429866961501867, 47.155730595746064 ], [ 8.430062765957206, 47.15797370341965 ], [ 8.446716925810644, 47.15884367702634 ], [ 8.449283039472595, 47.164394543195357 ], [ 8.455679445550032, 47.167139647156311 ], [ 8.461608952187399, 47.155910763992381 ], [ 8.4611397923645, 47.15183172722115 ], [ 8.457306993673274, 47.147912126865194 ], [ 8.457908213947251, 47.141418023977018 ], [ 8.468822253828129, 47.136848201487282 ], [ 8.463645018969197, 47.129294379448638 ], [ 8.464122819256579, 47.121590136019677 ], [ 8.467037874363832, 47.118535738090351 ] ] ] ] } },
{"type":"Feature","id":"1708","properties":{"name": "Steinhausen", "BZNR": 900, "KTNR": 9, "GRNR": 6, "AREA_HA": 504, "X_MIN": 678073, "X_MAX": 680715, "Y_MIN": 226515, "Y_MAX": 229587, "X_CNTR": 679300, "Y_CNTR": 227900, "Z_MIN": 411, "Z_MAX": 528, "Z_AVG": 443, "Z_MED": 435, "Z_CNTR": 430, "E_MIN": 2678073, "E_MAX": 2680715, "N_MIN": 1226515, "N_MAX": 1229587, "E_CNTR": 2679300, "N_CNTR": 1227900, "SEE_HA": 0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.49839421947333, 47.212069531500916 ], [ 8.50271249624295, 47.208775140954153 ], [ 8.496470339921531, 47.20365874708618 ], [ 8.496166550984272, 47.200144249999916 ], [ 8.503836336388623, 47.19772679331934 ], [ 8.4996184797614, 47.192909776148298 ], [ 8.499877703474164, 47.189721561701816 ], [ 8.488660700628294, 47.185134834421724 ], [ 8.485540131055691, 47.186693432161348 ], [ 8.477088357376482, 47.185323254532754 ], [ 8.478111649485212, 47.189897691444614 ], [ 8.473350807222008, 47.19321227816566 ], [ 8.475071503183424, 47.195796147715789 ], [ 8.468986058968401, 47.198863614230689 ], [ 8.476795078387987, 47.205586049916718 ], [ 8.473914888453578, 47.207381748287901 ], [ 8.479897424251535, 47.208621545882352 ], [ 8.489131825620536, 47.210813665472891 ], [ 8.49839421947333, 47.212069531500916 ] ] ] ] } },
{"type":"Feature","id":"1709","properties":{"name": "Unterägeri", "BZNR": 900, "KTNR": 9, "GRNR": 6, "AREA_HA": 2562, "X_MIN": 683681, "X_MAX": 689775, "Y_MIN": 215401, "Y_MAX": 223133, "X_CNTR": 686900, "Y_CNTR": 221300, "Z_MIN": 684, "Z_MAX": 1579, "Z_AVG": 901, "Z_MED": 859, "Z_CNTR": 725, "E_MIN": 2683681, "E_MAX": 2689775, "N_MIN": 1215401, "N_MAX": 1223133, "E_CNTR": 2686900, "N_CNTR": 1221300, "SEE_HA": 0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.594513672944244, 47.150506485939502 ], [ 8.598311653363494, 47.145254373829459 ], [ 8.598008216011726, 47.136915343575573 ], [ 8.588369168161412, 47.137650996437152 ], [ 8.593694489526428, 47.133476782538082 ], [ 8.595680723183504, 47.128362467567882 ], [ 8.591395507796152, 47.12272225569204 ], [ 8.601317601276365, 47.121115694378553 ], [ 8.599358767493174, 47.115481810266921 ], [ 8.609063923087566, 47.114992364353142 ], [ 8.610834003974261, 47.118201258995896 ], [ 8.621484448655124, 47.114195457109091 ], [ 8.610572668356212, 47.113710280835477 ], [ 8.610877647625879, 47.109005492955973 ], [ 8.615303160279016, 47.109762307773025 ], [ 8.61545722326067, 47.107265526157249 ], [ 8.618229544047518, 47.106080274456261 ], [ 8.610638490040943, 47.104179609823674 ], [ 8.605713486461259, 47.105323386760574 ], [ 8.607450045473028, 47.09199704725728 ], [ 8.595487135703667, 47.091290358970262 ], [ 8.587329997488803, 47.085681404760763 ], [ 8.577592363475485, 47.084484573918672 ], [ 8.566335765639648, 47.095868040771101 ], [ 8.55902034719384, 47.106583403721224 ], [ 8.561612602252222, 47.108975907176763 ], [ 8.559901503867325, 47.114463679671481 ], [ 8.556173983086852, 47.116821153053657 ], [ 8.549185683973169, 47.117243585321333 ], [ 8.545097267943609, 47.122964924718673 ], [ 8.545588562843543, 47.126943569647828 ], [ 8.541666145936555, 47.133838738009146 ], [ 8.543469541023963, 47.141228691964699 ], [ 8.558385115648559, 47.150794685422369 ], [ 8.558540006941621, 47.150867920584112 ], [ 8.562838131938173, 47.15295517749292 ], [ 8.56490422564058, 47.148063407898846 ], [ 8.569010063863216, 47.150940209784842 ], [ 8.580227447704887, 47.150894697208713 ], [ 8.587295774306398, 47.153437863491163 ], [ 8.591289367451356, 47.150447401837972 ], [ 8.594513672944244, 47.150506485939502 ] ] ] ] } },
{"type":"Feature","id":"1710","properties":{"name": "Walchwil", "BZNR": 900, "KTNR": 9, "GRNR": 6, "AREA_HA": 1354, "X_MIN": 680043, "X_MAX": 685613, "Y_MIN": 215996, "Y_MAX": 220189, "X_CNTR": 681700, "Y_CNTR": 217200, "Z_MIN": 413, "Z_MAX": 1250, "Z_AVG": 789, "Z_MED": 898, "Z_CNTR": 446, "E_MIN": 2680043, "E_MAX": 2685613, "N_MIN": 1215996, "N_MAX": 1220189, "E_CNTR": 2681700, "N_CNTR": 1217200, "SEE_HA": 0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.545097267943609, 47.122964924718673 ], [ 8.549185683973169, 47.117243585321333 ], [ 8.556173983086852, 47.116821153053657 ], [ 8.559901503867325, 47.114463679671481 ], [ 8.561612602252222, 47.108975907176763 ], [ 8.55902034719384, 47.106583403721224 ], [ 8.566335765639648, 47.095868040771101 ], [ 8.563282382855592, 47.092611539558824 ], [ 8.544200080790008, 47.09445706470926 ], [ 8.539868270608254, 47.091999583926317 ], [ 8.525701888560791, 47.091654913569094 ], [ 8.522295312551746, 47.090048298484213 ], [ 8.503686073925252, 47.108602184925999 ], [ 8.500382350477977, 47.114639274566194 ], [ 8.506782394159819, 47.119773695645563 ], [ 8.509107912195235, 47.124933440104286 ], [ 8.515959966620805, 47.125421795283437 ], [ 8.517796097103604, 47.127381774456502 ], [ 8.530799097054077, 47.12736397036339 ], [ 8.534252086608777, 47.120430748052918 ], [ 8.545097267943609, 47.122964924718673 ] ] ] ] } },
{"type":"Feature","id":"1711","properties":{"name": "Zug", "BZNR": 900, "KTNR": 9, "GRNR": 6, "AREA_HA": 2163, "X_MIN": 678486, "X_MAX": 686486, "Y_MIN": 215061, "Y_MAX": 227088, "X_CNTR": 681800, "Y_CNTR": 224700, "Z_MIN": 409, "Z_MAX": 1579, "Z_AVG": 581, "Z_MED": 426, "Z_CNTR": 450, "E_MIN": 2678486, "E_MAX": 2686486, "N_MIN": 1215061, "N_MAX": 1227088, "E_CNTR": 2681800, "N_CNTR": 1224700, "SEE_HA": 0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.577592363475485, 47.084484573918672 ], [ 8.569542347835352, 47.081215582532089 ], [ 8.563330569090509, 47.081771601985707 ], [ 8.563282382855592, 47.092611539558824 ], [ 8.566335765639648, 47.095868040771101 ], [ 8.577592363475485, 47.084484573918672 ] ] ], [ [ [ 8.497364669858559, 47.186360817103917 ], [ 8.50054711712796, 47.184166035876821 ], [ 8.506786347744949, 47.188078672237403 ], [ 8.516618666718474, 47.18206585376663 ], [ 8.520630765439529, 47.182751417086692 ], [ 8.523382565231877, 47.186430200870667 ], [ 8.525258436702931, 47.185849922878994 ], [ 8.52756304680041, 47.18323386967333 ], [ 8.523346138598873, 47.178906406762174 ], [ 8.529344865027788, 47.17629102113564 ], [ 8.530554339832346, 47.173676871307201 ], [ 8.53559303974613, 47.174662029650463 ], [ 8.539069556134105, 47.171367603461363 ], [ 8.5397311661049, 47.169056837496512 ], [ 8.536293022823976, 47.168043966644724 ], [ 8.535951863966842, 47.164940326721435 ], [ 8.543679267101627, 47.157465336542401 ], [ 8.551342320919227, 47.156276374741061 ], [ 8.555291165831276, 47.157370297474216 ], [ 8.558501419349682, 47.15087498685179 ], [ 8.558385115648559, 47.150794685422369 ], [ 8.543469541023963, 47.141228691964699 ], [ 8.541666145936555, 47.133838738009146 ], [ 8.545588562843543, 47.126943569647828 ], [ 8.545097267943609, 47.122964924718673 ], [ 8.534252086608777, 47.120430748052918 ], [ 8.530799097054077, 47.12736397036339 ], [ 8.517796097103604, 47.127381774456502 ], [ 8.515959966620805, 47.125421795283437 ], [ 8.509107912195235, 47.124933440104286 ], [ 8.506782394159819, 47.119773695645563 ], [ 8.500382350477977, 47.114639274566194 ], [ 8.495444757230556, 47.123371952242799 ], [ 8.506343557196965, 47.136260425111438 ], [ 8.506041379409941, 47.146760617880133 ], [ 8.511198630544582, 47.154054962739224 ], [ 8.514476701115894, 47.169475087264608 ], [ 8.496964114146397, 47.176853840537611 ], [ 8.479356696246692, 47.178537851784647 ], [ 8.478699018345523, 47.181976400434017 ], [ 8.475715596314114, 47.183116921382293 ], [ 8.477088357376482, 47.185323254532754 ], [ 8.485540131055691, 47.186693432161348 ], [ 8.488660700628294, 47.185134834421724 ], [ 8.499877703697207, 47.18972157294418 ], [ 8.497364669858559, 47.186360817103917 ] ] ] ] } },
{"type":"Feature","id":"9001","properties":{"name": "Zugersee", "BZNR": 0, "KTNR": 0, "GRNR": 0, "AREA_HA": 0, "X_MIN": 676884, "X_MAX": 682743, "Y_MIN": 212835, "Y_MAX": 226295, "X_CNTR": 681200, "Y_CNTR": 215500, "Z_MIN": 0, "Z_MAX": 0, "Z_AVG": 0, "Z_MED": 0, "Z_CNTR": 0, "E_MIN": 2676884, "E_MAX": 2682743, "N_MIN": 1212835, "N_MAX": 1226295, "E_CNTR": 2681200, "N_CNTR": 1215500, "SEE_HA": 3844 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.518902173309231, 47.06147872836263 ], [ 8.514157331925635, 47.061431835819675 ], [ 8.508744413418153, 47.068102828272814 ], [ 8.487080741258049, 47.078715603850981 ], [ 8.470197146383185, 47.087752326019071 ], [ 8.463746648213, 47.095861135297518 ], [ 8.476220497090168, 47.106269594515368 ], [ 8.486089982167478, 47.109629176249193 ], [ 8.487019430723644, 47.113915680957263 ], [ 8.473291177191017, 47.114414378481086 ], [ 8.467037874363832, 47.118535738090351 ], [ 8.464122819256575, 47.121590136019684 ], [ 8.463645018969197, 47.129294379448638 ], [ 8.468822254044422, 47.136848212729809 ], [ 8.457908213947251, 47.141418023977018 ], [ 8.457306993673294, 47.147912126865215 ], [ 8.461139792364509, 47.151831727221165 ], [ 8.461608952187399, 47.155910763992381 ], [ 8.455679445763687, 47.167139658398824 ], [ 8.45257470220559, 47.171278918477356 ], [ 8.453869571792026, 47.173782555928213 ], [ 8.461462374888837, 47.17855299557511 ], [ 8.466727136087194, 47.17838251061 ], [ 8.475715596314114, 47.183116921382293 ], [ 8.478699018345518, 47.181976400434003 ], [ 8.479356696246692, 47.17853785178464 ], [ 8.496964114146397, 47.176853840537611 ], [ 8.514476701115896, 47.169475090658608 ], [ 8.511198630544582, 47.154054962739224 ], [ 8.506041379409945, 47.14676061788014 ], [ 8.506343557196965, 47.136260425111438 ], [ 8.495444757230567, 47.123371952242799 ], [ 8.500382350477977, 47.114639274566194 ], [ 8.503686073925252, 47.108602184925985 ], [ 8.522295312551762, 47.090048298484213 ], [ 8.528212474675744, 47.071055353894792 ], [ 8.518902173309231, 47.06147872836263 ] ] ] ] } },
{"type":"Feature","id":"9002","properties":{"name": "Aegerisee", "BZNR": 0, "KTNR": 0, "GRNR": 0, "AREA_HA": 0, "X_MIN": 687237, "X_MAX": 691411, "Y_MIN": 217452, "Y_MAX": 221450, "X_CNTR": 689500, "Y_CNTR": 219600, "Z_MIN": 0, "Z_MAX": 0, "Z_AVG": 0, "Z_MED": 0, "Z_CNTR": 0, "E_MIN": 2687237, "E_MAX": 2691411, "N_MIN": 1217452, "N_MAX": 1221450, "E_CNTR": 2689500, "N_CNTR": 1219600, "SEE_HA": 728 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 8.588369168161423, 47.137650996437166 ], [ 8.598008216011742, 47.136915343575595 ], [ 8.604675188818925, 47.137448096867864 ], [ 8.613000362263703, 47.13205412806856 ], [ 8.620017891442906, 47.133433133029662 ], [ 8.630147692919847, 47.129705018570426 ], [ 8.643331230447103, 47.114354705967344 ], [ 8.640093095917065, 47.103580246542862 ], [ 8.63065702169243, 47.102264682808006 ], [ 8.624319217527335, 47.10756942313666 ], [ 8.624364460226396, 47.113034051695351 ], [ 8.621484448655124, 47.114195457109091 ], [ 8.601317601276373, 47.121115694378538 ], [ 8.591395507796173, 47.122722255692032 ], [ 8.595680723183504, 47.128362467567882 ], [ 8.593694489526422, 47.133476782538082 ], [ 8.588369168161423, 47.137650996437166 ] ] ] ] } }
]};

Promise.all([map]).then(function(values){

svg.append('rect')
.attr('width', w)
.attr('height', h)
.attr('fill', 'white')

svg.selectAll("path")
  .append("g")
    .data(values[0].features)
    .enter()
    .append("path")
    .attr("d", path)
.style("stroke", "black")
.attr("opacity",function(d) {
if (d.id == 1702 | d.id == 1703 | d.id == 1704 | d.id==1705 | d.id==1708 | d.id==1710 | d.id == 1701 | d.id==1706 | d.id==1709) {
return ".5"
} else{
return "1"
}
})
.style("fill", function(d) {
  if (d.id == 1702 | d.id == 1703) {
    return "#529C07";//grün
  } else if  (d.id == 1711 | d.id==1707) {
return "#F28C08 ";//orange
}else if  (d.id == 1704 | d.id==1705 | d.id==1708 | d.id==1710) {
return "#FFF700";//gelb
}else if  (d.id == 1701 | d.id==1706 | d.id==1709) {
return "#0022FF";//blau
} else if  (d.id == 9001 | d.id==9002 ) {
return "#DEDEDE";//grau für seen
} else{
return "white"
}
})
.on('mouseover', function (d, i) {
      d3.select(this).transition()
           .duration('50')
           .attr('opacity', '1')})
.on('mouseout', function (d, i) {
if (d.id != 9001 | d.id!=9002){
      d3.select(this).transition()
           .duration('50')
           .attr('opacity', '.5')}})
.on("mousemove", function(d,i){
            d3.select(this)
                .append("svg:title")
                .text(function (d) { return d.properties.name })
})
  .on("click", function(d,i) {
            d3.select("#infobox")
                .select("#gname")
                  .text(function (d) { return "Ausgewählte Gemeinde: " + d.properties.name});
   d3.select("#infobox")
                .select("#areaha")
                  .text(function (d) { return "Hektar: " + d.properties.AREA_HA});
            })
;

});

Thanks for your support.

A: Your .text functions access the wrong variable. You need to read the data from i, not d:
.on("click", function(d,i) {
  d3.select("#infobox")
    .select("#gname")
      .text(function (d) { return "Ausgewählte Gemeinde: " + i.properties.name});
  d3.select("#infobox")
    .select("#areaha")
      .text(function (d) { return "Hektar: " + i.properties.AREA_HA});
})

The .on("click" handler receives two inputs, (d,i). The first provides the event that happened, with properties such as mouse pointer coordinates. The second provides the data element that was clicked, i.e. one of the objects in your data array.

Note that there are many parts of this code that you should improve. For example:

*

*You shouldn't need to select "#infobox" multiple times. Better store the selection and work on it from there.

*The inner handler of the .text function receives an input d, which overshadows the outer variable d of the .on("click" handler. Better rename that inner variable.

*Drawing and reacting are mixed up too much here. You should separate the steps of adding elements, styling them, and reacting to them. This kind of mixed up looks short and easy, but gets extremely nasty when you need to add things later on, esp. adding/removing/shifting elements.

*The idea of data-driven documents (= "D3") is that properties within the data determine what they will look like. In your case, there should be a property that determines the color coding - you shouldn't check for individual IDs there.


text:
Q: Accessing MySQL database server from Workbench on remote workstation I installed a MySQL database server on Centos 7 on a machine with local IP address 192.168.1.40. I run all the post installation checks to make sure that the database is up and running. (It is)
I then installed MySQL Workbench on a second Windows machine (ip address 192.168.1.3) on the same local network.
It is my understanding that remote connection to a mysql database are disabled so I run on the database the command
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.3' IDENTIFIED BY 'password' WITH GRANT OPTION;

then I added to the /etc/my.cnf the string
bind-address=0.0.0.0

and restarted the server
Trying to connect from the remote workbench to the server i get the error

Did I miss something?

redpajama_set_name: RedPajamaStackExchange


text:
Q: Подружить Java и Python заранее извиняюсь за столь общий и размытый вопрос.
Собираемся писать приложение (некоммерческое) для платформы Android, хотим прикрутить к нему сервер, который будет принимать запросы от приложения и отправлять python команды устройствам.
Кто может посоветовать стек технологий, может кто работал над подобным? Как облегчить задачу по максимуму?

A: Можно через flask сделать вебсервер, минимальный пример:
from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

Чтобы в питон установить его:
pip install flask

Например, запускаю я сервер как локальный с портом 12345:
app.run('localhost', port=12345)

В консоли питона появится сообщение:

*

*Running on http://localhost:12345/ (Press CTRL+C to quit)

Далее, пишу код на java для отправки GET HTTP запроса к тому серверу:
...

public static String getHTML(String urlToRead) throws Exception {
    StringBuilder result = new StringBuilder();
    URL url = new URL(urlToRead);
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    conn.setRequestMethod("GET");
    try (BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {
        String line;
        while ((line = rd.readLine()) != null) {
            result.append(line);
        }
    }
    return result.toString();
}

public static void main(String[] args) throws Exception {
    String html = getHTML("http://localhost:12345/");
    System.out.println(html);
}

Результат:

Hello World!

A: Сделайте RESTful-сервис на aiohttp.


text:
Q: Will have started by the time we get there. Tense options?
How about catching a movie tonight? It starts at 9pm. Our working day
ends at 8:50 pm. The movie will have started by the time we get to the
theater as it'll take us 20 minutes to get there.

One resource says that with phrases such as "before" and "by the time" you can often use future simple and future perfect interchangeably.
Can I use Future Perfect and Future Simple interchangeably in the above example?
I realize now that you can use future simple if you assert something or, in other words, intend to do something by some time in the future, as in:
"I will do my homework by 9pm"

A: If something has not yet happened in the future.
1)

*

*The movie will have started by the time we get to the theater as it'll take us 20 minutes to get there. [FUTURE perfect]

There is an event preceding the getting there in the future: the event is that the movie started before you got there.
Think of it as parallel to:
2)

*

*The movie had started by the time we got there. [PAST perfect]

Think of a timeline (everything in English verbs happens on a timeline]
PAST PERFECT____SIMPLE PAST___|PRESENT 0|_____FUTURE _____FUTURE PERFECT
[Notice the parallelism of the tenses in relation to the present time. Both of them involve another event. The trick is: Sometimes the event is implied and is not stated outrightly.]
Although by the time we get there is present tense, the meaning is future. So anything that comes after it has to be in the future perfect.
[Yes, it can be either before we get there or by the time we get there]


text:
Q: How to remove the specific xml element from xml by SQL I have a xml text like below
<services>
  <service class="DataBuffer.Modules.Contraparty.ContrapartyService, DataBuffer.Modules.Contraparty">
      <host maxMessageSize="104857600">
      </host>
  </service>
  <service class="DataBuffer.Modules.Goods.GoodsService, DataBuffer.Modules.Goods">
      <host maxMessageSize="104857600">
      </host>
   </service>
   <...other service element....>
</services>

I am declaring it in the SQL
DECLARE @doc varchar(1000);
SET @doc ='
<services>
  <service class="DataBuffer.Modules.Contraparty.ContrapartyService, DataBuffer.Modules.Contraparty">
     <host maxMessageSize="104857600">
     </host>
  </service>
  <service class="DataBuffer.Modules.Goods.GoodsService, DataBuffer.Modules.Goods">
     <host maxMessageSize="104857600">
     </host>
  </service>
</services>;'

I need to remove the service XML element that has a class attribute whose value is
DataBuffer.Modules.Contraparty.ContrapartyService, DataBuffer.Modules.Contraparty

How do I remove this element from raw xml text by SQL? Is it possible?

A: Use DELETE (XML DML):
DECLARE @doc xml='<services>
  <service class="DataBuffer.Modules.Contraparty.ContrapartyService, DataBuffer.Modules.Contraparty">
     <host maxMessageSize="104857600">
     </host>
  </service>
  <service class="DataBuffer.Modules.Goods.GoodsService, DataBuffer.Modules.Goods">
     <host maxMessageSize="104857600">
     </host>
  </service>
</services>';

SET @doc.modify('delete //service[@class="DataBuffer.Modules.Contraparty.ContrapartyService, DataBuffer.Modules.Contraparty"]')


text:
Q: Merge multiple videos using FFMPEG in android I'm required to merge 'n' number of mp4 videos. For now I'm using ffmpeg library and achieved merging 2 videos using the following command:
  String[] complexCommand = {"ffmpeg", "-y", "-i", input_video1,
                            "-i", input_video2, "-strict", "experimental",
                            "-filter_complex",
                            "[0:v]scale=hd720,setsar=1:1[v0];[1:v]scale=hd720,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1",
                            "-ab", "48000", "-ac", "2", "-ar", "22050", "-s", "hd720", "-vcodec", "mpeg4", "-b:v", get_br + "k", merged_video_op_path};

But how can I do it for n videos. Is there any command to do it?
Any help would be greatly appreciated.


text:
Q: Causes for Underdispersion in Poisson Regression I am working with count data (number of pregnancies per woman), and using glm Poisson (log-link) to model determinants of the former count variable.
From simple descriptives I observe that my data are overdispersed: Mean = 4.18, Variance = 7.14.
However, after fitting the glm Poisson model with the full set of control, if I run dispersiontest from the R package AER I get a statistically significant underdispersion equal to 0.68, p-value=0.000 (to test for underdispersion: alternative = c("less")).
If some (relevant) controls are omitted from the model (i.e. age, dependency ratio, and dummies for provinces), the model results to be equidispersed (0.98, p-value=0.298).
I see that underdispersion is uncommon, and solution exists to solve for it (e.g., Conway–Maxwell–Poisson regression). In fact, when applying this latter model the equidispersion assumption is satisfied.
However, I am concerned with the reason why I get underdispersion when controlling for such relevant covariates.
Given that overdispersion may arise because of omitted variables, or in presence of clustered observations, I am just wondering if in my case controlling for the clustered nature of the data (survey data, 2-stage clustering sampling), is radically "over" reducing the variance.

A: Undispersion might not be a surprise in this case. From a comment by @Ben Bolker: Suppose (for example) a particular woman has a conditional expected number of pregnancies equal to 1.  Density of Poisson(1) is P(0,1,2,3, ...) = {0.37,0.37,0.18,0.06, ...}. Perfectly reasonable to suppose instead that the distribution might look like {0.2,0.6,0.1,0.05,...}, i.e. more concentrated than Poisson. Women don't have children as a Poisson process! (At least not in modern societies.)
As for the extra question in a comment:  However, my concern regards the fact that underdispersion in the Poisson regression is coming from an originally overdispersed dependent variable.  But, if there is much variation over the dataset in the conditional mean, then, marginally, the variance will be higher than the mean, even it the Poisson assumption is fulfilled, in the conditional distributions.  So talking about an originally overdispersed dependent variable does not make much sense. Over/under-dispersion must be judged after all obviously relevant variables (like groups/clusters) are taken into account.


text:
Q: Python and m2crypto load certificate and private key from string Could you help me with m2crypto?
The code below is to return the 'HTTP / 1.1 403 Forbidden' server.
The certificate and the private key are not loaded in the code:
from M2Crypto import Rand, SSL, httpslib, threading , BIO , X509 , RSA
ctx = SSL.Context('sslv23')
store = ctx.get_cert_store()
bio = BIO.MemoryBuffer()
bio.write( str( open( 'certi.pem', 'r' ).read() ) )
store.add_x509( X509.load_cert_bio(bio) )

# or
# store.add_x509( X509.load_cert_string( str(open( 'certi.pem', 'r' ).read()) ) )

ctx.set_verify( SSL.verify_none, depth=1 )
ctx.set_info_callback()
h = httpslib.HTTPSConnection( 'Server', 443, ssl_context=ctx )
h.set_debuglevel(1)
h.request( 'mysoap' )

and when I do so, it works:
from M2Crypto import Rand, SSL, httpslib, threading , BIO , X509 , RSA
ctx = SSL.Context('sslv23')
ctx.load_cert_chain( str( 'certi.pem' ) )
ctx.set_verify( SSL.verify_none, depth=1 )
ctx.set_info_callback()
h = httpslib.HTTPSConnection( 'Server', 443, ssl_context=ctx )
h.set_debuglevel(1)
h.request( 'mysoap' )

Thank's


text:
Q: Xamarin Google Map I am doing a looping in Xamarin, which add pin into the google map.
Was wondering why it does not render to the Map immediately?
I want to show the pin to be added into the Map one at a time, so I added Sleep for 1 second to delay the plotting.
I think the reason is because its running on code behind for the plotting, hence the method of using the code below will be invalid.
for(int i = 0;i < templist.Count ; i++)
        {
            if (i != 0)
            {
                if (MyMap.Pins.Count > 9) {
                    MyMap.Pins.RemoveAt(0);
                }
            }

            var Item = templist.ElementAt(i);
            string resultDatetimer = Item.DateTimer;
            string resultLocation = Item.Location;
            string resultLatitude = Item.Latitude;
            string resultLongitude = Item.Longitude;

            var position = new Position(Convert.ToDouble(resultLatitude), Convert.ToDouble(resultLongitude));

            var pin1 = new Pin
            {
                Type = PinType.Place,
                Position = position,
                Label = "Date:" + resultDatetimer + ", Location:" + resultLocation
            };

            MyMap.Pins.Add(pin1);

            MyMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(Convert.ToDouble(resultLatitude), Convert.ToDouble(resultLongitude))
                 , Distance.FromMeters(500)));
System.Threading.Thread.Sleep(1000);
        }

A: 1) Do not use System.Threading.Thread.Sleep as that is a blocking call and if you are on the UI thread, your UI/keyboard/touch inputs, etc.. all just froze for that time period, use an awaited Task.Delay instead so the message pump for that thread can continue.
await Task.Delay(1000);

2) If your code is running on a background thread, make sure that you perform your pin add and movetoregion on the ui thread.
Device.BeginInvokeOnMainThread(() =>
{
    MyMap.Pins.Add(pin1);
    MyMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(Convert.ToDouble(resultLatitude), Convert.ToDouble(resultLongitude))
     , Distance.FromMeters(500)));
});


text:
Q: How to toggle button to change header to different color and back to original I want to change the header to yellow to blue and then back to yellow on clicking button in jQuery

$("#title2-button").click(function(){
  if ($("#title2").css("color", "yellow")) {
     $("#title2").removeClass("yellow");
     $("#title2").addClass("blue");
  } else {
    $("#title2").css("color", "yellow");
  }
});
#title2{
  text-align: center;
}

 Weekends and Holidays Included

<button id="title2-button">Alter Second title</button>

A: You can use .toggleClass() like below.
This code basically:

*

*When the button is clicked, it "toggles" the class blue. This means that if #title2 has the class of blue, it removes it. If it doesn't have the class, it adds it. The !important is there to make sure that the class blue overrides the previous color of yellow.

*Since the default color  is yellow, if toggleClass removes the class, the color goes back to yellow. If it adds the class, then the color goes to blue (since !important is there, the color would be blue instead of yellow).

$("#title2-button").click(function() {
  $("#title2").toggleClass("blue");
});
#title2 {
  text-align: center;
  color: yellow;
}
.blue {
  color: blue !important;
}

 Weekends and Holidays Included

<button id="title2-button">Alter Second title</button>

A: You can use toggleClass method to do that like this,
$("#title2-button").click(function(){
    $("title2").toggleClass("blue");
  });

A: Use hasClass to check if class is present . Hope this is what you are looking for,thanks

$("#title2-button").click(function(e){

if($('#title2').hasClass('yellow'))
{
$('#title2').removeClass('yellow').addClass('blue')
}
else
$('#title2').removeClass('blue').addClass('yellow')

})
.yellow
{
color:yellow
}
.blue
{
color:blue
}

Some content

<button id="title2-button">Alter Second title</button>


text:
Q: Why does Georgiou complain about orange on the Enterprise bridge when there is none? In DIS season 2 episode 13, when Captain Georgiou walks onto the bridge of the Enterprise, she says

Orange? Really? Ew!

But I see no orange anywhere in that scene. What am I missing here?

A: She's talking about the rails, the console backs and the doors, which were in fact more red than orange even on the original sets, but sometimes looked quite orange with 1960s lighting and cameras:

There's an interview with the production designer responsible on the Star Trek official site here , from which the most relevant sections are perhaps these:

Then, I really wanted to color-code.  So, I was playing a lot with the colors of the Enterprise. There are actually variations [of the red-orange] in the Enterprises . That's very distinct, and I went through the archives at CBS to look at those colors and try and match them, but in a new way.

We couldn't help but laugh out loud when Georgiou walked in and complained, "Orange? Really? Ick!" Was that scripted, or ad-libbed by Michelle Yeoh? And, either way, what was your reaction?
TD: That was scripted. The Enterprise had different colors. They changed it over time. The way it was lit, sometimes it looked really orange and sometimes it looked very red. The orange we'd picked, which was the original orange, was really red. [So] I actually went to the writers and said, "I'm uncomfortable with this line." I did this whole layout of the different oranges and the red we decided we were using, and all of that. We had powder-coated this metal in this red, so there was no going back. I went on and on and on. Alex Kurtzman wrote back, saying, "This is why we love you, Tamara. It's okay. We're gonna say orange. It's okay, don't worry." It was just a funny story. I loved Michelle's line, but to me, like any production designer would think, it was all about, "Do I have the right color?"

So the ultimate answer may well be 'it's a partial in-joke that you're not meant to think too hard about".


text:
Q: Converting String to Date is Formatting Year Incorrectly I am trying to convert a string "05/09/20" to a Date format that will display the entire year.
This seems to be a simple enough process however SimpleDateFormat is returning the year as "0020"
Here is a sample code
import java.text.SimpleDateFormat;
import java.util.Date;
public class StringToDateExample1 {
public static void main(String[] args)throws Exception {
  SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
  String dateInString="05/09/20";
  Date date =  formatter.parse(dateInString);
  System.out.println(formatter.format(date));
}
}

Does anyone know why this is occurring?
Note: if I set simple date format to MM/dd/yy, it understands that the year is 2020

A: You need to parse with a formatter "MM/dd/yy" and write with a formatter "MM/dd/yyyy".
This is because formatters simply shape the representation of an underlying date. Thus, if you want to read one format, and write a different one, you need to use one formatter to read into a date by converting a string of the format it expects into a date object (which does not have an intrinsic format), then pass that date to a different formatter which shapes it into the format you want to write in.
So, you'll be doing the following:
"05/09/20" (string of a certain format)
-A->
{May Ninth 2020} (date, no specific format, it's just an object)
-B->
"05/09/2020" (date expressed as a string in a different format)

Note that B is not the reverse of A, therefore a single formatter cannot perform both.


text:
Q: PHP program to check the connection of Mysql & Memcache My project uses Zend Framework(1.x) and I want to create two methods/functions that can check the connections of Mysql and Memcache, and then I can save the check result in database.
Any function available to check he connection of Mysql & Memcache?
I guess a quick way to check Mysql connection, is just to use function like mysql->connect(), and then check the return value?
For Memcache, if there's no other checking function available, maybe just use something like:
$memcache = new Memcache;
$memcache->connect('localhost', xxxxx);

Is my above method the most effective way? Don't know if there's any functions available or not.


text:
Q: C# Simple encryption for application password? For my application I would like to store passwords and obviously encrypt them. From what I can gather I need one way encryption with salt? My plan is to save the password to the DB once they create an account. Doing so I create a salt and with that then create a hash. When they go to log in I then take the stored salt and take the entered value and loop through each of the credentials re-encrypting it with the stored salt and seeing if it matches the stored hash? Am I correct in doing it this way because each time run the encryption is different from the stored encryption. Below are my salt and encryption methods. All help is greatly appreciated.
public string CreateSalt(string UserName)
    {
        Rfc2898DeriveBytes hasher = new Rfc2898DeriveBytes(UserName, System.Text.Encoding.Default.GetBytes("seaaSalt"), 10000);
        return Convert.ToBase64String(hasher.GetBytes(25));
    }

    public string HashPassword(string Salt, string Password)
    {
        Rfc2898DeriveBytes Hasher = new Rfc2898DeriveBytes(Password,
            System.Text.Encoding.Default.GetBytes(Salt), 10000);
        return Convert.ToBase64String(Hasher.GetBytes(25));
    }


text:
Q: iPhone 6 replacement screen and iOS 9 My 8 year old cracked a (very good) friend's teenager's iPhone 6.  It is only cracked mostly at the bottom around the home button and just barely in front of the actually display so they said not to worry about it (I did mention that it is a VERY good friend, right?)
Anyway, I am going to replace the screen (have done several iOS device screen replacements) but I found one that says to make sure that the phone still has iOS 8.x, not iOS 9.  Why?  I don't want to "fix" the phone and make it not-upgrade-able.  That is not really fixing it.
In my searching I have found old postings about screen issues but none ever seem to be tied to an iOS version.
EDIT: The vendor SPECIFICALLY says:

This screen just fits for the IOS 8.3 SYSTEM,the original version,but not fit the newest IOS 9.0 system.  Please make sure your Iphone keep the IOS 8.3 system before installation.

Is there any firmware on the screen itself?  It is on eBay so I have used the "ask seller a question" but not sure how thorough/technically sound their answer will be.
EDIT 2:
The vendor's reply was what I expected, not helpful.  Just regurgitated the same statement worded slightly different even though I specifically stated that I am tech savvy and would like a detailed, technically sound answer.
As I continued on my quest I thought about the fact that the phone was still under warranty and I did not want to void the warranty.  My friend has "Apple Care" and had already used one screen replacement.  He used his second one for this (I paid the $80 + tax + gas money) and told him if it happens again I would pay the difference between the "Apple Care" cost and whatever they charge him so that it won't be any difference out of pocket for him.

A: There is firmware on all replacement parts. I'd just wait until iOS 9 comes out in September to make sure that the screen is compatible with the new software, just make sure you can return the screen. However, there are some better vendors, like iFixit, that would likely sell screens that will likely be compatible with iOS 9, just be prepared to pay an arm and a leg.

A: I saw the same thing on an eBay listing from a "USA" seller of decent screens. I think they are just confusing the home button with the screen out of ignorance. You have to keep the original home button to do updates or restore your phone. This is true for iPhone 5s on up through 6. It will throw code 53 otherwise. Please post if someone knows otherwise on the actual screen itself. Only the beta for 9 is even out yet.


text:
Q: Need help regarding customizing Dojo/digit tool for ArcGIS Java Script API 2.8 I am developing this tool (Similar tool for the India like 'State' and then          'district' level) and I am trying different methods so please let me know which method is suitable or not suitable to develop similar tool.
Tool Details:
According to the tool the all data and extent is stored in .json file and its reference given in the zoom_to.js file.
Methods that I am following:
1.Instead of .json file I am storing my data in sql server (where column type is geography so that its storing the extent i.e. xmin,ymin etc.) and then assigning those result to that tool.
2.I am modifying the .json file and replacing the values but getting some errors.
3.Created the two combo-box  and assigned  for "State" and for "District" respectively but not getting 'zoom to' effect .
So Please let me know whether I am going to correct direction or not
Thanks in advance : )

A: There are two json files, one for the states, and one for the counties.
If you replace these two by by corresponding json files for States of India & Districts in India, It should work.
You have said that you have tried 3 things, but it is not clear where you are facing a problem.
If your data is in MS SQL server, generally you need a service to query the database and return a json file. Since in your case, this data is static, there is no point in querying again and again. You should just create the Json files manually once, and use the static files.
To check the Json file, you can use a JSON validator either online ( like  JSONlint) or offline in your text editor(several text editors such as Notepad++ have plugins for this)
Once you have proper Json files, and your tool is configured to access them, it should work. If it does not work, then you'll have to debug using a Javascript debugger like Firebug to diagnose the problem.


text:
Q: I can't fetch the data from reducer to component I'm trying pass the data from reducer to component and receive as props.
But the data return UNDEFİNED, so I have tried console the data on reducer and action, but it's okey. There isn't any problem with the data coming from the API, but it always return to component undefined. Where is my fault?
Action
export default ProfileTab;

import axios from 'axios';
import { BASE, API_KEY } from '../config/env';
export const FETCHED_MOVIES = 'FETCHED_MOVIES';

export function fetchMovies() {
  return (dispatch) => {
    axios
      .get(`${BASE}s=pokemon&apikey=${API_KEY}`)
      .then((result) => result.data)
      .then((data) =>
        dispatch({
          type: FETCHED_MOVIES,
          payload: data.Search,
        }),
      );
  };
}

Reducer
import { FETCHED_MOVIES } from '../actions/movies';

const initialState = {
  fetching: false,
  fetched: false,
  movies: [],
  error: {},
};

export default (state = initialState, action) => {
  switch (action.type) {
    case 'FETCHED_MOVIES':
      return {
        ...state,
        movies: action.payload,
      };
    default:
      return state;
  }
};

Component
import React, { Component } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';

import { fetchMovies } from '../../actions/movies';

class Case extends Component {
  static propTypes = {
    movies: PropTypes.object.isRequired,
  };

  constructor(props) {
    super(props);
  }

  componentDidMount() {
    this.props.fetchMovies();
  }

  onChangeHandler = (e) => {
    this.setState({
      input: e.target.value,
    });
  };

  render() {
    console.log(this.props.movies);

    return (

mert

    );
  }
}

const mapStateToProps = (state) => {
  return {
    movies: state.movies,
  };
};

const mapDispatchToProps = {
  fetchMovies,
};

export default connect(mapStateToProps, mapDispatchToProps)(Case);

A: Do this in the connect statement:
export default connect(mapStateToProps,{fetchMovies})(Case);

And remove the mapDispatchToProps function from your code.
Dispatching props as an object is quite incorrect. Try this, and it should work.

A: That's because your mapDispatchToProps function should return an object and take dispatch as parameter. Each field in your returned object should contain a function that dispatches your action.
So try something like this:
const mapDispatchToProps = dispatch => {
  return {
    fetchMovies: () => dispatch(fetchMovies())
  }
}

A: Although there's already an accepted answer, I'm not sure how correct it is, as it's completely valid to pass mapDispatchToProps the way you did with the latest react (16.13.1) and react-redux (7.2.1) versions (I'm not sure about earlier versions).
Now, assuming your question contains the whole code, there are two important things missing:

*

*Creating the store:
import { createStore } from "redux";
const store = createStore(reducer);

and passing it to the Provider component:
<Provider store={store}>

*If you go ahead and do as above, you'll see that this.props.fetchMovies emits the following error:

Actions must be plain objects. Use custom middleware for async actions.

To fix it, do as it says and add a middleware, e.g. thunk:
import { createStore, applyMiddleware } from "redux";
import thunk from "redux-thunk";
const store = createStore(rootReducer, applyMiddleware(thunk));

What follows is the full code. Note that I "split" fetchMovies into two functions: sync and async, for illustrating the difference usage between the two. I also modified your code (made is shorter, mostly) for this answer's readability. You can also see a live demo here:
File app.js
import React, { Component } from "react";
import { connect } from "react-redux";
import { fetchMoviesSync, fetchMoviesAsyncMock } from "./api";

class App extends Component {
  componentDidMount() {
    this.props.fetchMoviesSync();
    this.props.fetchMoviesAsyncMock();
  }
  render() {
    return (

              {this.props.movies.join("\n")}

    );
  }
}

const mapStateToProps = (state) => ({ movies: state.movies });
const mapDispatchToProps = {
  fetchMoviesSync,
  fetchMoviesAsyncMock
};

export default connect(mapStateToProps, mapDispatchToProps)(App);

File api.js
export const FETCHED_MOVIES = "FETCHED_MOVIES";

export const fetchMoviesSync = () => ({
  type: FETCHED_MOVIES,
  payload: ["movie1", "movie2", "movie3", "movie4"]
});
export const fetchMoviesAsyncMock = () => (dispatch) => {
  dispatch({
    type: FETCHED_MOVIES,
    payload: ["movie5", "movie6", "movie7", "movie8"]
  });
};

File reducer.js
const initialState = {
  movies: [],
};

export default (state = initialState, action) => {
  switch (action.type) {
    case "FETCHED_MOVIES":
      return {
        ...state,
        movies: state.movies.concat(action.payload)
      };
    default:
      return state;
  }
};

File index.js
import React from "react";
import ReactDOM from "react-dom";
import Case from "./app";
import reducer from "./reducer";
import { createStore, applyMiddleware } from "redux";
import { Provider } from "react-redux";
import thunk from "redux-thunk";

let store = createStore(reducer, applyMiddleware(thunk));
ReactDOM.render(
  <Provider store={store}>
    <Case />
  </Provider>,
  document.getElementById("container")
);

File index.html


text:
Q: Increase element width with jqLite In my angularjs directive I want to increase DIV width if vertical scroll bar is visible. I did the following with jQuery:
var gridBody = gridElem.children().eq(1);
var scrollBarWidth = gridBody[0].offsetWidth - gridBody[0].clientWidth;
var lastCol = angular.element(gridElem[0].querySelector('.grid-header-last-cell'));
lastCol.width(lastCol.width() + scrollBarWidth);

It seems to work (not sure about cross browser issues). Notice that width() method is jQuery method but jqLite. How can I achieve the same result with jqLite only?

A: The following worked:
lastCol.css('width', '+=' + scrollBarWidth);


text:
Q: Richfaces 4.1 push without JMS? I used a4j:push in the RF3.2 branch but with RF4.1 it seems to be a bit more complicated. Esspecially the demand for a JMS system is something that needs some studying. While studying I read that JMS is no longer needed but I can't find any demo's. I located the how-to and the demo code in the nightly build but they all seem to use JMS.
Without JMS seems to be a lot simpler :)
Any suggestions?
Thanks,
Milo van der Zee

A: From the Richfaces 4.1 Component Reference:

3.8.6. Using Push without JMS
Since JMS coupling may be unwanted in certain cases, RichFaces
  provides a switch to turn off the JMS integration:
<context-param>
    <param-name>org.richfaces.push.jms.disable</param-name>
    <param-value>true</param-value>
</context-param>

Just add the above context param to your web.xml use the push component without JMS.

A: try RichFaces 4.1 Component Reference again,
there are two samples of usage (TopicsContext and CDI):
http://docs.jboss.org/richfaces/latest_4_X/Component_Reference/en-US/html/chap-Component_Reference-Actions.html#sect-Component_Reference-a4jpush-Using_TopicsContext_to_publish_message

A: I know this post is an old post, but I can see that this thread is one of the top search for this topic.
If you are using Servlet 3.0, no changes in web.xml is required.
First, you need to install atmosphere with the right version. The project that I have worked on is using Richfaces 4.3.6.Final. The version of atmosphere it is compatible is 1.0.17.
<dependency>
    <groupId>org.atmosphere</groupId>
    <artifactId>atmosphere-runtime</artifactId>
    <version>1.0.17</version>
</dependency>

Then you can start using the TopicContext to send notification to the subscribers from the managed bean. Here is how I publish data to the TopicContext.
TopicKey topicKey = new TopicKey("sometopic");
TopicsContext topicsContext = TopicsContext.lookup();

try {
    topicsContext.publish(topicKey, "somenewdata");
} catch (MessageException e) {
    e.printStackTrace();
}

Then you simply need include the push component in the subscribing page.
<a4j:push address="sometopic">
    <a4j:ajax event="dataavailable" oncomplete="someJsMethodToExecuteAfterGettingNotified();"/>
</a4j:push>

Once the setup is success, you can simply call TopicContext#publish anywhere in the managed bean so that the pages that are subscribing to the topic will be automatically notified.


text:
Q: Closing channel on multiple coroutines If I have multiple goroutines reading and writing to the same channel, are there any ways to close the channel at certain point, for example after a fix amount of elements are written.

func foo(c chan int) {
    for i := range c {
        // how to close the channel after 100 integers are written?
        c <- i + 1
        c <- i + 2
    }
}

func bar() {
    c := make(chan int, 200)
    c <- 0
    go foo(c)
    go foo(c)
    go foo(c)
}

A: Give conditional case would work for it:
for i := 0; i <= cap(c); i++ {
        // how to close the channel after 100 integers are written?
        c <- i + 1
        // since you send 2 values to channel for each i loop, you need to half of it.
        if i == 49 { //if you asking why 49, you have sent one value on bar function. Also to make it perfectly 100 integer in total.
             close(ch)
             break // terminating the function after the closing channel, it will run in panic because the function still running and keep sending value on channel which was already closed.
        }
        c <- i + 2
}

Output :
0
1
2
2
3
3
...
50
50

Just give some information about channel, don't use range on channel if you havent sent anything on it...
If you put "i range channel" before you have value on channel, it will not read anything.
Back to again to your code
If you run this code :
func bar() {
    c := make(chan int, 200)
    c <- 0
    go foo(c)
    go foo(c) // run in panic
    go foo(c) // run in panic
}

It will run in panic, since the channel already closed which mean your channel  not accepting any values again.
Take a look at this picture, let say you make a buffered channel with 3 capacity. And you going to close after receiving 2 values to send it will run in panic if you try to send values on it again.


text:
Q: Saving project as a template for future projects in visual studio express 2012? I have created my own project start up template that I would like to use for most of my future projects building Windows 8 apps with Visual Studio Express 2012.
I have looked online but cannot find any such documentation as to how I would take my existing project as is, and add it to the template list that is available when creating a new project.
Is this possible and how is it done?
I have tried simply opening the project and saving as a new project but the option does not exist for saving as a new project (do not know if it is because I only have Express?)

A: Saving as template:

*

*Click export template in the file menu

*Choose project template

*Give it a name in the next page (templatecardgame or somthing)

Loading the template:

*

*Open project in the file menu

*Select the language in which you made the template

*In the middle screen is your template select it and give it a name

That's all and maybe a little late answer.


text:
Q: SignalR/EPiServer "/signalr/hubs?" 404 on IIS when trying to use Live Monitor I'm trying to get Live Monitor with EPiServer to work.
However, when the page loads,it returns a 302 on /signalr/hubs?, which is just a redirect to our 404 page.
See this screenshot:

This is my startup class:
using Microsoft.Owin;
using Owin;

[assembly: OwinStartup(typeof(MyWebApp.Web.Plumbing.OwinStartup))]

namespace MyWebApp.Web.Plumbing
{
    public class OwinStartup
    {
        public void Configuration(IAppBuilder app)
        {
            app.MapSignalR();
        }
    }
}

I have installed these NuGet packages:

*

*Microsoft.Owin

*Microsoft.Owin.Security

*Microsoft.AspNet.SignalR.Core

*Microsoft.AspNet.SignalR.SystemWeb

*EPiServer.LiveMonitor

I don't have any experience working with this; can anyone help?

A: I did a reinstall of the EPiServer.LiveMonitor package, which pulled all dependecies, including signalr. After that I set up live monitor again, and then tried to load the page. I still got the same result, but this time totally emptying the asp.net cache worked, as oppsed to last time.


text:
Q: Visual Studio - Not Recognizing Controls After Certain Point I am having an issue with Visual Studio. I have a page with a GridView. The code behind recognizes the GridView fine, but none of the elements within it. I tried putting a label before the GridView and it was able to recognize it. This would imply there is some error in my aspx code file, but I have looked it over and all looks well to me.
I have tried deleting .designer.cs file and 'Converting to Web Application'. I have tried copying the code, deleting the files, and recreating them. I have also tried numerous cleans and rebuilds and restarting Visual Studio. Still, no success. I would greatly appreciate any guidance.
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="True" CodeBehind="users.aspx.cs" Inherits="Ticket_System.admin.users" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <asp:GridView ID="userGrid" runat="server" OnRowEditing="userGrid_RowEditing" DataKeyNames="END_USER_ID" AutoGenerateEditButton="True" AutoGenerateColumns="false" OnRowUpdating="userGrid_RowUpdating" OnRowCancelingEdit="userGrid_RowCancelingEdit">

        <Columns>
            <asp:TemplateField HeaderText="User #">
                <ItemTemplate>
                    <asp:Label ID="idLabel" runat="server" Text='<%# Bind("END_USER_ID") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="idText" runat="server" Enabled="false" Text='<%# Bind("END_USER_ID") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Access">
                <ItemTemplate>
                    <asp:Label ID="accessLabel" runat="server" Text='<%# Bind("ACCESS_ROLE.DESCRIPTION") %>'></asp:Label>

                </ItemTemplate>
                <EditItemTemplate>
                </EditItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="User">
                <ItemTemplate>
                    <asp:Label ID="userLabel" runat="server" Text='<%# Bind("USER_NAME") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="userText" runat="server" Text='<%# Bind("USER_NAME") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Password">
                <ItemTemplate>
                    <asp:Label ID="passLabel" runat="server" Text='<%# Bind("PASSWORD") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="passText" runat="server" Text='<%# Bind("PASSWORD") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="First">
                <ItemTemplate>
                    <asp:Label ID="firstLabel" runat="server" Text='<%# Bind("FIRST_NAME") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="firstText" runat="server" Text='<%# Bind("FIRST_NAME") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Last">
                <ItemTemplate>
                    <asp:Label ID="lastLabel" runat="server" Text='<%# Bind("LAST_NAME") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="lastText" runat="server" Text='<%# Bind("LAST_NAME") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Active">
                <ItemTemplate>
                    <asp:Label ID="activeLabel" runat="server" Text='<%# Bind("ACTIVE_FLAG") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="activeText" runat="server" Text='<%# Bind("ACTIVE_FLAG") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>

        </Columns>
    </asp:GridView>

</asp:Content>

EDIT: Just wanted to clarify something. What I mean is that the controls are not even recognized at all in the code behind. For example firstLabel.Text gives me an "does not exist in current context" error.

A: Try using the FindControl() method.
foreach(GridViewRow row in userGrid.Rows) {
    if(row.RowType == DataControlRowType.DataRow) {
        string idText = (string)row.FindControl("idText");
    }
}


text:
Q: rake aborted! development database is not configured I'm helping out a friend modify a rails website he was given, I've only got a surface knowledge of rails and ruby but enough to do what he needs me to do. Trouble is I've run into this error setting up my development environment and I cannot nut it out.
Running:
$ rake db:migrate --trace

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
development database is not configured
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
/home/rory/projects/project_server/ruby_lib/project/lib/project/model.rb:21:in `init'
/home/rory/projects/project_server/ruby_lib/project/lib/project/model.rb:15:in `each'
/home/rory/projects/project_server/ruby_lib/project/lib/project/model.rb:15:in `init'
/home/rory/projects/project_server/ruby_lib/project/lib/project/project.rb:218:in `init' /home/rory/projects/project_server/rails/project_web/config/environments/development.rb:28:in `load_environment'
/var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:386:in `load_environment'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:379:in `load_environment'
/var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:137:in `process'
/var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:113:in `send'
/var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:113:in `run'
/home/rory/projects/project_server/rails/project_web/config/environment.rb:9
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in `gem_original_require'
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
/var/lib/gems/1.8/gems/rails-2.3.14/lib/tasks/misc.rake:4
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/var/lib/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19

Running
$ rake db:create

works as expected, creating the database in mysql.
I have checked the database.yml is correctly indented with spaces not tabs. All the required libraries are installed.
The site runs (and therefore I am running in my development environment):
ruby 1.8.7
rails 2.3.14
database.yml:
development:
  adapter: mysql
  database: development
  username: developer
  password: devpass
  socket: /var/run/mysqld/mysqld.sock

A: +1 on what Edd Morgan said in a comment.
Also, please paste your database.yml. For me it looks like the problem is trivial. The rake task is expecting that you have development db defined and it looks like you don't have it defined. So it raises "development database is not configured".
Most prolly you're missing a definition like:
development:
  adapter: mysql
  encoding: utf8
  host: 'you_host'
  username: 'username'
  password: 'password'


text:
Q: primitive class being ignore when serializing xsd generated class I used xsd.exe to generate a .cs class.
The xsd file as below
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="SendComments">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Input">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="TransId" maxOccurs="1" minOccurs="0" type="xs:string"/>
              <xs:element name="SampleId" minOccurs="0" maxOccurs="1" type="xs:long"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Output" type="xs:string" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

In my generated class, it has the correct field generated.
However, when I call the serializer. The SampleId field being ignored.
Serializer code segment:
var serializer = new XmlSerializer(typeof(SendComments));
            using (StringWriter stringWriter = new StringWriter())
            {
                serializer.Serialize(stringWriter, SPCComment);
                return stringWriter.ToString();
            }

Result:
<?xml version="1.0" encoding="utf-16"?>
<SPCSendComments xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Input>
    <TransId>-</TransId>
  </Input>
</SPCSendComments>

I tried with other .xsd file, all the primitive type (bool, int, long) is being ignored when serializing.
I wonder what will be the cause that primitive type being ignored.

A: Your generated class has an extra field SampleIdSpecified that indicates if the field is null or not. Set that to true and the field will be serialized.
If you set TransId to null, that will also be ignored.
They're being ignored because they're optional fields in your schema. They have minOccurs = 0 which means that they don't need to be there for the XML to be valid.


text:
Q: SQL IN Query performance - better split it or not I get up to 1000 id's from another server to display them for visitors so I have to use the IN query like:
SELECT * FROM `table` WHERE `id` IN (23221, 42422, 2342342....) // and so on, up to 1000

Let's say 1/3 of the visitors will watch though all of the 1000 id's while 2/3 of the them will only watch the first 50.
What would be a better for performance/workload, one query for all the 1000 id's or split them into like 20 queries so 50 id's each? So when the first 50 have been watched, query for the next 50 etc.
EDIT:
I don't need to use LIMIT when spliting, which means the id's in the query would be 50 max. So what's better, one query with 1000 id's at once or 20 queries each 50 id's?
EDIT:
Ok I ask it shortly and more directly: are 1000 id's in one query not too much? I have read here How to optimize an SQL query with many thousands of WHERE clauses that tons of WHERE/OR are bad??

A:
Let's say 1/3 of the visitors will watch though all of the 1000 id's while 2/3 of the them will only watch the first 50.

Since you want to optimize your response as you assumed how visitors will treat it.

What would be a better for performance/workload, one query for all the 1000 id's or split them into like 20 queries so 50 id's each? So when the first 50 have been watched, query for the next 50 etc.

Yes, you are correct you should limit the return response.
This is one example of how you can implement your requirement (I don't know much mysql but this is how you could get desired result).
SELECT * FROM `table` WHERE `id` IN (23221, 42422, 2342342....)
order by `id`
LIMIT 10 OFFSET 10

if it was SQL SERVER:
  create stored proc sp_SomeName
  @id varchar(8000)
  @skip int,
  @take int
  as
  begin
     SELECT * FROM some_table WHERE id IN (23221, 42422, 2342342....)
     order by id
     OFFSET @skip ROWS --if 0 then start selecting from 0
     FETCH NEXT @take ROWS ONLY --if 10 then this is the max returning limit
  end

what above query will do is : It will get all the data of the posted ids, then it will order by id in ascending order. Then from their it will choose just first 10/50/100, next time, it will choose the next 10/50/100 or whatever your take choice is and skip choice is. Hope this helps man :)

A: You can look at the answer provided here:
MySQL Data - Best way to implement paging?
With the LIMIT statement you can return only a portion of the result. And by changing the parameters in the LIMIT statement, you can re-use the query.
Do know that unless you use an 'ORDER BY', an SQL server does not always return the same records. In other words, should a record by unavailable to read due to an update that occurs, while the database-server can read the next record, it will fetch the next record (to give a result as soon as possible). I do not know for sure if the LIMIT forces a database-server to take some sort of order into consideration (I am not that familiar with MySql).


text:
Q: Point the right key with a variable of a json array I get the following json array from an api:
response = {"base":"USD","date":"2015-11-05","rates":
{"AUD":1.3997,"BGN":1.7971,"BRL":3.8008}}

I get that from the following http query:
$http.get(url).success(function(response){

let assume that
quote = "AUD";

How can I point to the AUD value of rates in response (i.e. rate = 1.3997)?
$scope.rate = response.rates.quote;

does not work...

A: this is called accessing  property value of an object this is how we do it

var quote = 'AUD'
var response = {"base":"USD","date":"2015-11-05","rates":
{"AUD":1.3997,"BGN":1.7971,"BRL":3.8008}}
object = JSON.parse(JSON.stringify(response))

document.write(object.rates[quote])

A: If you use
rates.quote

This means that quote is a property of rates object which is not;
The value of quote is the property of  rates
Try like this
$scope.rate = response.rates[quote];

A: This is one of those times when you have to use the square bracket notation instead of dot notation even though they are usually interchangeable. You can only use dot notation when you know the real name of the property.  When you are using a variable as a placeholder you have to use square brackets.

A: Dot notaion has its limit, use brackets as others already suggested.
The dot notation is:

An object property name can be any valid JavaScript string, or anything that can be converted to a string, including the empty string. However, any property name that is not a valid JavaScript identifier (for example, a property name that has a space or a hyphen, or that starts with a number) can only be accessed using the square bracket notation. This notation is also very useful when property names are to be dynamically determined (when the property name is not determined until runtime)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects


text:
Q: Flutter, paint free hand point header position got misplaced I am developing a flutter application. In that am using Paint to draw lines. In free hand line the point header is correctly displaying when we draw a straight line. But when we rotate the line, the point header position got misplaced.
case PaintMode.freeStyleArrow:
  for (var i = 0; i < _offset!.length - 1; i++) {
  if (_offset[i] != null && _offset[i + 1] != null) {

  final _path = Path()
    ..moveTo(_offset[i]!.dx, _offset[i]!.dy)
    ..lineTo(_offset[i + 1]!.dx, _offset[i + 1]!.dy);
  canvas.drawPath(_path, _painter!..strokeCap = StrokeCap.round);
  paintsFreestyleArrow(canvas,_offset[0]!, _offset[_offset.length - 2]!, _painter, size);
}
else if (_offset[i] != null && _offset[i + 1] == null) {
  canvas.drawPoints(PointMode.points, [_offset[i]!],
      _painter!);
}}
break;


text:
Q: Continuous functions and intervals It is known that the image of an interval $I$ by continuous functions $f:\mathbb{R}\to \mathbb{R}$ is another interval $f(I)$. If the interval is compact, that is, closed and bounded, then so is $f(I)$. However, in general $I$ and $f(I)$ can be of different types.
I am trying to study which situations may arise, and find examples or a proof of why a certain case is impossible. For instance, the case $I$ is a bounded open interval and $f(I)$ an open, unbounded interval is possible; it is enough to consider the function $f(x) = 1/x$ and $I = (0,1)$. However, I'm having some troubles with the case $I$ closed and unbounded. I think $f(I)$ cannot be an open interval, but mainly because it seems impossible to draw. How could I proceed to prove this is impossible? I thought about dividing the cases $f(I)$ bounded and unbounded, but I'm stuck at this point. If I am in the wrong, a counterexample would be appreciated.

A: Let $f:[0,+\infty)\to \mathbb{R}$ be given by $f(x)=\frac{x\sin(x)}{1+x}$. Then $f(I)=(-1,1)$.


text:
Q: How to properly send an image to CloudKit as CKAsset? I have an image (UIImage and it's url too) and I'm trying to send it to CloudKit as a CKAsset but I'm having this error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Non-file URL'. Here is the code:
override func viewDidLoad() {
        super.viewDidLoad()

        send2Cloud()
    }

func send2Cloud() {
    let newUser = CKRecord(recordType: "User")

    let url = NSURL(string: self.photoURL)

    let asset = CKAsset(fileURL: url!)

    newUser["name"] = self.name
    newUser["photo"] = asset

    let publicData = CKContainer.defaultContainer().publicCloudDatabase

    publicData.saveRecord(newUser, completionHandler: { (record: CKRecord?, error: NSError?) in

        if error == nil {

            dispatch_async(dispatch_get_main_queue(), { () -> Void in
                print("User saved")
            })

        } else {
            print(error?.localizedDescription)
        }
    })
}

I have the URL, I can print it, copy and paste to my navigator and it will show my image! So, I don't know what is happening here...
It would be easier if I worked with an UIImage instead of it's URL? Because, as I sais before, I have both of them! Any help is very appreciated! Thanks, guys!!

A: I did something a tad different: I made a class that you can use in multiple places, and thanks to the fact that Swift has deinitialization that works (unlike C++), it cleans up after itself:
//
//  ImageAsset.swift
//

import CloudKit
import UIKit

class ImageAsset {

    let image:UIImage

    var url:NSURL?

    var asset:CKAsset? {
        get {
            let data = UIImagePNGRepresentation(self.image)
            self.url = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent(NSUUID().UUIDString+".dat")
            if let url = self.url {
                do {
                    try data!.writeToURL(url, options: [])
                } catch let e as NSError {
                    print("Error! \(e)")
                }
                return CKAsset(fileURL: url)
            }
            return nil
        }
    }

    init(image:UIImage){
        self.image = image
    }

    deinit {
        if let url = self.url {
            do {
                try NSFileManager.defaultManager().removeItemAtURL(url) }
            catch let e {
                print("Error deleting temp file: \(e)")
            }
        }
    }

}

Here's a unit test that exercises it (presumes there is an image named stopwatch in the test target):
//
//  ImageExtensionTests.swift
//

import CloudKit
import XCTest
@testable import BudgetImpactEstimator

class ImageExtensionTests: XCTestCase {

    let testImageName = "stopwatch" // provide the name of an image in test bundle
    override func setUp() {
        super.setUp()
        // Put setup code here. This method is called before the invocation of each test method in the class.
    }

    override func tearDown() {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
        super.tearDown()
    }

    func testConvertingImageToAsset() {
        guard let image = UIImage(named: self.testImageName) else {
            XCTFail("failed to load image")
            return
        }
        let imageAsset = ImageAsset(image: image)
        XCTAssertNotNil(imageAsset)

        guard let asset = imageAsset.asset else {
            XCTFail("failed to get asset from image")
            return
        }

        print("constructed asset: \(asset)")
    }

}

Was originally going to do it as an extension on UIImage but then the deinit made me move to a class.

A: This is Objective C version of how to save an image to Cloudkit
This took quite a bit of digging as there is not much info to go on, but this works
  if([results count] <= 0) {

            NSLog(@"this Record doesnt exist so add it ok!! %@", error);

            CKRecordID *wellKnownID = [[CKRecordID alloc]
                                       initWithRecordName:idString];

            CKRecord *entitiesName = [[CKRecord alloc] initWithRecordType:@"mySavedDetails"
                                                             recordID:wellKnownID];

            [entitiesName setObject:idString
                         forKey:@"myDetailsId"];

            [entitiesName setObject:self.myName.text
                         forKey:@"myName"];

    if (myUIImage.image != nil)
                 {
                     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
                                                                          NSUserDomainMask, YES);
                     NSString *documentsDirectory = [paths objectAtIndex:0];
                     NSString* path = [documentsDirectory stringByAppendingPathComponent:
                                       @"test.png" ];
                     NSData* data = UIImagePNGRepresentation(myUIImage.image.image);
                     [data writeToFile:path atomically:YES];

    //so we get the full path of the uiimage

                     NSLog(@"Path details %@",path);

                     NSURL* myImagePath = nil;
                     myImagePath =
                     [[NSBundle mainBundle] URLForResource:path
                                             withExtension:@"png"];

 //here we change the path of Image which is a string to a URL
                     NSURL *yourURL = [NSURL fileURLWithPath:path];

                     CKAsset* myImageAsset = nil;
                     myImageAsset =
                     [[CKAsset alloc] initWithFileURL:yourURL];

                [entitiesName setObject: myImageAsset
                              forKey:@"myImage"];

                [publicDatabase saveRecord: entitiesName
                          completionHandler:^(CKRecord *savedState, NSError *error) {
                              if (error) {
                                  NSLog(@"ERROR SAVING: %@", error);
                              }

                          }];

                 }

            }

A: In my experience, the only way to save upload UIImage as a CKAsset is to:

*

*Save the image temporarily to disk

*Create the CKAsset

*Delete the temporary file

let data = UIImagePNGRepresentation(myImage); // UIImage -> NSData, see also UIImageJPEGRepresentation
let url = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent(NSUUID().UUIDString+".dat")
do {
    try data!.writeToURL(url, options: [])
} catch let e as NSError {
    print("Error! \(e)");
    return
}
newUser["photo"] = CKAsset(fileURL: url)

// ...

publicData.saveRecord(newUser, completionHandler: { (record: CKRecord?, error: NSError?) in
    // Delete the temporary file
    do { try NSFileManager.defaultManager().removeItemAtURL(url) }
    catch let e { print("Error deleting temp file: \(e)") }

    // ...
}

I filed a bug report a few months ago requesting the ability to initialize CKAsset from in-memory NSData, but it hasn't been done yet.


text:
Q: Setting up Jetty/JDBC workspace I am getting this error when setting up an existing workspace in IntelliJ.
I have setup the database, it exists in pgadmin3 and is searchable. It is set for localhost, port 5432.
2018-07-15 16:27:42.812:INFO:oeja.AnnotationConfiguration:Scanner-1: Scanning elapsed time=629ms
2018-07-15 16:27:42.826:WARN:oejw.WebAppContext:Scanner-1: Failed startup of context o.e.j.w.WebAppContext@5796ab81{/,file:///Users/mihai-oprescu/Documents/witnex/witnex/target/Witnex/,UNAVAILABLE}
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:84)
    at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:71)
    at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:409)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1457)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:848)
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:46)
    at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:192)
    at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:505)
    at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:151)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
    at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:453)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)
    at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:610)
    at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:529)
    at org.eclipse.jetty.util.Scanner.scan(Scanner.java:392)
    at org.eclipse.jetty.util.Scanner$1.run(Scanner.java:329)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
Caused by:
java.lang.IllegalStateException: Nothing to bind for name jdbc/witnex
    at org.eclipse.jetty.plus.webapp.PlusDescriptorProcessor.bindEntry(PlusDescriptorProcessor.java:916)
    at org.eclipse.jetty.plus.webapp.PlusDescriptorProcessor.bindResourceRef(PlusDescriptorProcessor.java:836)
    at org.eclipse.jetty.plus.webapp.PlusDescriptorProcessor.visitResourceRef(PlusDescriptorProcessor.java:256)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:84)
    at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:71)
    at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:409)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1457)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:848)
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:46)
    at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:192)
    at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:505)
    at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:151)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
    at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:453)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)
    at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:610)
    at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:529)
    at org.eclipse.jetty.util.Scanner.scan(Scanner.java:392)
    at org.eclipse.jetty.util.Scanner$1.run(Scanner.java:329)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
[2018-07-15 04:27:43,090] Artifact Witnex.com:war exploded: Artifact is deployed successfully
[2018-07-15 04:27:43,090] Artifact Witnex.com:war exploded: Deploy took 3,117 milliseconds

In my context.xml, i have:
<New id="witnex" class="org.eclipse.jetty.plus.jndi.Resource">
        <Arg>
            <Ref id='wac' />
        </Arg>
        <Arg>jdbc/witnex</Arg>
        <Arg>
            <New class="org.postgresql.ds.PGSimpleDataSource">
                <Set name="User">witnex</Set>
                <Set name="Password">XXXXXXX</Set>
                <Set name="DatabaseName">witnex</Set>
                <Set name="ServerName">localhost</Set>
                <Set name="PortNumber">5432</Set>
            </New>
        </Arg>
    </New>

And my jetty configuration settings:

I am not quite sure how to set the jetty server to read the context.xml, perhaps that's the issue that I'm dealing with here.