Posts

dictionary - Want ability to save and load the ESRI map in my Application -

we developing app. user can draw object on map , want save location , map extent drawn graphics on our server using serialize json representation of state. , when user come afterward clicking location item want re-render same state last graphics had drawn on using same serialize json object server. how achieve feature in arcgis javascript api. need write our own feature layer if yes how it? typically use feature service store , serve data (graphics). can define , publish feature service either using local arcgis server installation , or in cloud on arcgis online . once have feature service published, connect using arcgis api javascript (jsapi) featurelayer . see of editing samples idea of different ways can use featurelayer , other modules jsapi manage data in feature service. you can (optionally) create web map references feature layer defines other map properties initial extent, basemap, etc , have app load web map. as far persisting other parts of map state (ext...

python - Why is my widget being overlapped? -

i using bryan oakley's code @ tkinter adding line number text widget create text widget line numbers. want create custom widget can use text widget optional line numbers. in: t = linedtext(top) t.insert("insert", "hello") t.show() but of now, when show line numbers, covers text widget. window resized automatically. why happening? code: import tkinter tk class textlinenumbers(tk.canvas): def __init__(self, *args, **kwargs): tk.canvas.__init__(self, *args, **kwargs) self.textwidget = none def attach(self, text_widget): self.textwidget = text_widget def redraw(self, *args): '''redraw line numbers''' self.delete("all") = self.textwidget.index("@0,0") while true : dline= self.textwidget.dlineinfo(i) if dline none: break y = dline[1] linenum = str(i).split(".")[0] self.c...

angularjs - View(Template) does not update when the controller changes -

i have directive pushes element array, , shows elements on view, problem though array gets updated (the log shows correct values) view keeps showing empty array. doing wrong? note: not need parent's $scope anything, i'm adding/modifying on directive's scope. directive: app.directive('streaming', function(){ return { restrict: 'ea', scope: { live: '&', data: '&', }, controller: function($scope){ $scope.messages=[]; //..... //eventually reaches $scope.messages.push({..}); }, templateurl: '/directives/templates/streaming.html' }}); template: <div class="row" > <canvas id="canvas" width="640px" height="360px"></canvas> </div> <div ng-show="live" id="chat"> {{messages}} <div ng-repeat="m in message...

vb.net - Get certain part of string -

so im getting client, computer name , ip. im getting server picks them in textbox multiline. so, im getting message this: name: xxx-pc; ip: xxx.xxx.xxx.xxx ! want take name , ip form, how extract name/ip when lenght different? thanks this candidate regex.match() using pattern "^name: (.*?); ip: (.*?)$" breakdown: ^ - beginning of string name: - literal string (.*?) - 0 or more characters stored in capture group 1 ; ip: - literal string (.*?) - 0 or more characters stored in capture group 2 $ - end of string code sample: imports system imports system.text.regularexpressions public module module1 public sub main() dim data string = "name: xxx-pc; ip: xxx.xxx.xxx.xxx" dim name string = string.empty dim ip string = string.empty dim match = regex.match(data, "^name: (.*?); ip: (.*?)$") if match.success name = match.groups(1).value ip = match.groups(2).value...

asp.net - One to Many Assosiation without a collection on many Side EF -

i have baseentity : public class baseentity<t> { public baseentity() { this.createddate = system.datetime.now; this.updatetddate = system.datetime.now; } [system.componentmodel.dataannotations.key] [system.componentmodel.dataannotations.required] [system.componentmodel.dataannotations.schema.column("id")] [system.componentmodel.dataannotations.schema. databasegenerated(system.componentmodel.dataannotations.schema.databasegeneratedoption.identity)] public t id { get; set; } [system.componentmodel.dataannotations.required] [system.componentmodel.dataannotations.schema.foreignkey("created_by")] public virtual bonchaghwebapplication.models.core.user createdby { get; set; } [system.componentmodel.dataannotations.required] [system.componentmodel.dataannotations.schema.foreignkey("updated_by")] public virtual bonchaghwebapplication.models.core.user updatedby { get; set; }...

shell - Bash: Reading quoted/escaped arguments correctly from a string -

i'm encountering issue passing argument command in bash script. poc.sh: #!/bin/bash args='"hi there" test' ./swap ${args} swap: #!/bin/sh echo "${2}" "${1}" the current output is: there" "hi changing poc.sh (as believe swap want correctly), how poc.sh pass "hi there" , test 2 arguments, "hi there" having no quotes around it? a few introductory words if @ possible, don't use shell-quoted strings input format. it's hard parse consistently: different shells have different extensions, , different non-shell implementations implement different subsets (see deltas between shlex , xargs below). it's hard programatically generate. ksh , bash have printf '%q' , generate shell-quoted string contents of arbitrary variable, no equilavent exists in posix sh standard. it's easy parse badly . many folks consuming format use eval , has substantial security concerns. n...

algorithm - A graph with n nodes and n vertices can contain just one cycle -

if graph unweighted g have same number of nodes , edges , correct assume graph g contain 1 cycle ? can proved ? edit: , node conected if , if there 1 component in graph. in other words, if each node, there path node in graph, can assume there 1 cycle.