state

AngularJS UI Router: Route conflict because of optional parameter

…衆ロ難τιáo~ 提交于 2019-12-01 21:46:48
I have a couple of routes in my AngularJS app, I'm using UI-Router for routing between states/pages in my site. An issue I am having is that I have conflicting routes because of a optional parameter I have/need for the homepage of the site. I have a route for the homepage( example.com ) defined more or less like so: $stateProvider .state('home', { url: '/:filter', params: { filter: { squash: true, value: null } } }); I can activate this state by going to the homepage( example.com ), as well as by adding the optional parameter example.com/apples which I use to filter out the contents on the

How to send data from dialog back to parent container with react?

本小妞迷上赌 提交于 2019-12-01 20:51:14
I have a react-big-calendar (The parent container), I have also a select which, the events of the calendar are fetched according to this select ( doctor name ) and I have a button when I click on it, the dialog will be appears (another component), on this dialog, I have a form to add an event after the select, when I post my API, I save it on local storage, but the event added doesn't appears on my calendar just after refresh the page and reselect the doctor name. But I want, when I click on the save button, will be added directly on the calendar and it will be appeared on the calendar. My

Preserving state in an extension method

送分小仙女□ 提交于 2019-12-01 16:44:06
The C# team has previously considered adding extension properties, events, etc. to C#. Per Eric Lippert: http://blogs.msdn.com/b/ericlippert/archive/2009/10/05/why-no-extension-properties.aspx For these features to be useful however, they would have to be able to store some new kind of state with an object. It seems like the only way to do this would be to use a dictionary and associate each instance of an object with whatever the additional state is. It would be useful if it were possible to copy this functionality "manually" by creating my own dictionary (and perhaps get/set extension

Preserving state in an extension method

混江龙づ霸主 提交于 2019-12-01 14:31:41
问题 The C# team has previously considered adding extension properties, events, etc. to C#. Per Eric Lippert: http://blogs.msdn.com/b/ericlippert/archive/2009/10/05/why-no-extension-properties.aspx For these features to be useful however, they would have to be able to store some new kind of state with an object. It seems like the only way to do this would be to use a dictionary and associate each instance of an object with whatever the additional state is. It would be useful if it were possible to

Bot Framework User Identification

江枫思渺然 提交于 2019-12-01 14:19:13
How does bot framework identify the user so it knows to go and grab correct state data? It identifies user correctly when same channel is used, even on different machines. Does it user IP address or something similar? It is based on the Id property of the user + the channel Id. This user Id depends on the channel: each channel has a specific format of user Id, hence those 2 fields. Examples: Webchat: by default is userid but can be changed: user: { id: 'userid' }, Emulator: user ID is always set to default-user Facebook Messenger: the user ID is a PSID (Page Scoped ID) of the user Slack: the

Bot Framework User Identification

主宰稳场 提交于 2019-12-01 13:32:17
问题 How does bot framework identify the user so it knows to go and grab correct state data? It identifies user correctly when same channel is used, even on different machines. Does it user IP address or something similar? 回答1: It is based on the Id property of the user + the channel Id. This user Id depends on the channel: each channel has a specific format of user Id, hence those 2 fields. Examples: Webchat: by default is userid but can be changed: user: { id: 'userid' }, Emulator: user ID is

how to save the state of switch(button) in android

眉间皱痕 提交于 2019-12-01 12:54:45
问题 I am using switch (like android togglebutton ) instead of normal buttons in my android app. The code works fine while enabling and disabling switches. But i want to store the state of the switch. Suppose i enable the switch and close my application the background code will run fine but the switch state will change to disabled. Every time when i close the application the switch state becomes disabled. Is there any way to store the switch State? mySwitch.setOnClickListener(new View

HttpApplicationState - Why does Race condition exist if it is thread safe?

我与影子孤独终老i 提交于 2019-12-01 10:54:47
I just read an article that describes how HttpApplicationState has AcquireRead() / AcquireWrite() functions to manage concurrent access. It continues to explain, that in some conditions however we need to use an explict Lock() and Unlock() on the Application object to avoid a Race condition. I am unable to understand why a race condition should exist for Application state if concurrent access is implicitly handled by the object. Could someone please explain this to me ? Why would I ever need to use Application.Lock() and Application.Unlock() ? Thank You ! The AcquireRead and AcquireWrite

Android - Check application process State

时间秒杀一切 提交于 2019-12-01 10:45:52
How can I check the state (pause/running/suspended) of a particular process running on the Android device programmatically? I want to include this logic within my application. Using ActivityManager , I am able to retrieve a list of all processes running on the device, but it doesn't show me any process state information. Any idea on how I can retrieve this information? Thanks in Advance. I was wrong when I mentioned in the question that there is no process state information in the list of processes retrived using ActivityManager. ActivityManager am = (ActivityManager)getSystemService(Context

Is it possible to load a template via AJAX request for UI-Router in Angular?

偶尔善良 提交于 2019-12-01 09:52:11
问题 I know this might get an answer here, however that goes more for lazy loading implementation itself. So, this is a typical UI-Router config block: app.config(function($stateProvider, $urlRouterProvider, $injector) { $stateProvider .state('home', { url: '/home', templateUrl: 'view_home.html', // Actually SHOULD BE result of a XHR request .... controller: 'HomeCtrl' }); }); But what if I want to load such templateUrl when it's requested ( $stageChangeStart ) and it would be AJAX request based.