w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
String Editing in R - Trouble with Parentheses
Parentheses are usually special characters in regular expressions, and also in those used by R. You have to escape them with the backslash . The trouble is that the backslash needs to be escaped in R strings as well, with a second backslash, which leads to the following rather clumsy construction: gsub(" *\([^)]*\) *", " ", "abc def (foo) abc (def)") Careful with spaces, these are not handled correctly by my gsub call.

Categories : Regex

How to deploy a Node.js web role along with a .NET web role in azure cloud service project?
The development experience probably will be smoother if the Node.js component of the application is deployed as a separate cloud service instance. But it is possible to automate the deployment using startup taks as described in Run Startup Tasks in Windows Azure. You can create a command batch file to download anything you need and install it on the instance. You can run it with administrative privilege. You can listen to a port and have it set up as a cloud service endpoint. You can even deploy the files as part of your cloud service project and just configure and run them through the startup task. Use RDS to debug this script via logging and system events.

Categories : Dotnet

Dynamic Role from database to show content to user based on their role
Maybe you want to store the different ROLES in a Properties file and get them in the code, like: @PreAuthorize("hasRole(" + PropertyManager.getProperty("role.admin") + "')" + '"') Or when you configure the GRANT permissions to the different users you are possibility to select different columns for each role. So in the Controller of the app redirect to the specific method

Categories : Java

Connect Web Role to Web Site Role in the same windows azure solution
https://connect.microsoft.com/VisualStudio/feedback/details/790187/vs2012-add-service-reference-discover-services-in-solution-feature-creates-empty-proxy The types in the WCFRole and WebsiteRole are colliding. Right click and the Service Reference -> Configure service reference -> Uncheck the "Reuse reference Types" working like a charm now :)

Categories : Wcf

Whats the difference between role and name in symfony2 role class?
The security.yml role_hierarchy is to do with role's inheritance. It allows you to create many roles and then state that some roles inherit other roles. http://symfony.com/doc/current/book/security.html#hierarchical-roles ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] The above means that if as a user I have the role "ROLE_SUPER_ADMIN" (which comes from the role field in your group entity) then I also inherit the roles "ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH". so: ROLE_TO_INHERIT: [ROLES_TO_INHERIT_FROM] So your name field has no meaning in security.yml only your role field. Role hierarchy is separate to where you store your roles. It is an extra level of configuration so that, for example, you don't need to add 3 roles to every super admin user but rather

Categories : PHP

Web Role vs Worker Role in Cloud Services / Node.js
The difference is that Node Web Role will runs through IIS. But Node Web Worker is VM and runs through node.exe it self as clustered worker. Main difference here is that your virtual hosts and web platform setup will depend on the option you choose. As you aware setting up IIS is very different from node.exe it self. So with Web Role it will proxy all traffic through IIS rather than directly through node master process. Cons/Pros: Main advantage of Web Worker as it does not relies on any stack and you have full control over what runs there and how it affects your app. As well if you already have something ready, you can reuse it without big problems. In mean time you will need to manage your stack your self, by implementing master node process and then forking workers your self. While u

Categories : Node Js

Deploying WCF Service on Azure : Web Role or Worker Role?
A web role assumes that the application will be hosted in IIS. If your service does not require any of the benefits provided by IIS or its HTTP stack, then hosting it in a worker role may do you perfectly fine and also provide you a lower resource utilization for that service (since there's no "overhead" for the IIS server).

Categories : Wcf

Role of data-role attribute in html markup
In summary: "The value of the role data attribute is the name of the widget in lower case e.g. "autocomplete", "dropdownlist" etc." You can find info here: http://docs.kendoui.com/getting-started/data-attribute-initialization#example---initialize-a-kendo-ui-widget-using-a-data-attributes

Categories : Javascript

Posting from web role to another web role Windows Azure
It is better to make the API call from server side such as MVC controller in your web app. You can include security key and other things that you don't want to expose to others. When you make API call directly from javascript for another subdomain or url, you are creating cross-domain ajax request. In your javascript, you will make an ajax call to your controller action in your web app. Web app will make the call to whatever service it is talking to. You can also test your API from fiddler with POSt/GEt/PUt/DELETE requests. If you want to directly call from javascript and host web roles under different subdomains, you need to make CORS request: http://www.html5rocks.com/en/tutorials/cors/. You can also look at this related question: Running WebApi alongside MVC project in Azure

Categories : Azure

What is the role for a controller and what is the role for $scope in AngularJS?
The $scope is an object that both the view and the controllers know... It's not actually the controller itself, but through it you can pass in references to data and methods and use them inside of the view. The controller in angular is more like a presentation model, which holds up an object which is a "mutual friend" of both the view and the controller... that's how I like to think of it at least :)

Categories : Javascript

How to add an user to sysadmin role using ALTER ROLE?
alter role is for database roles, but sysadmin is server role. Try alter server role instead: ALTER SERVER ROLE server_role_name ADD MEMBER p_sys

Categories : Sql Server

Azure Web Role can't see VM's internal IP (but VM can see web role)
For completeness, moving my comment to an answer: While the virtual network is allowing traffic in both directions, you'll need to enable ICMP via the firewall, which will then let your pings work properly.

Categories : Azure

How to deny a user in a role unless they are in another role in .NET c#
Isn't it enough to allow Admin specifically before your deny rule? The authorization rules are checked from top to bottom until a match is found. <authorization> <allow roles="Admin"/> <deny users="?" roles="ROLE1"/> </authorization>

Categories : C#

Connecting an Azure worker role to a dedicated cache worker role
Hello maybe you should try to set the connection between them using Inter Role Communication, you can find an answer for how to make the inter role communication in the following stackoverflow website: How to do inter-role communication with Azure? you can also find more details in the following link: http://blogs.msdn.com/b/avkashchauhan/archive/2011/10/30/communication-between-windows-azure-roles.aspx I hope this helps you solve your problem please let me know if you need anything else.

Categories : Caching

Kendo Grid - Line Editing Using A Drop-Down List Editor (Editing Custom Editor)
Try changing the following. var Category = [ { 'CategoryName': 'Beverages', 'CategoryID': 1 }, { 'CategoryName': 'Condiments', 'CategoryID': 2 }, { 'CategoryName': 'Confections', 'CategoryID': 3 }, { 'CategoryName': 'Dairy Products', 'CategoryID': 4 }, { 'CategoryName': 'Grains/Cereals', 'CategoryID': 5 }, { 'CategoryName': 'Meat/Poultry', 'CategoryID': 6 }, { 'CategoryName': 'Produce', 'CategoryID': 7 }, { 'CategoryName': 'Seafood', 'CategoryID': 8 } ]; and as the datasource use $('<input required data-text-field="CategoryName" data-value-field="CategoryID" data-bind="value:' + options.field + '"/>') .appendTo(container) .kendoDropDownList({ autoBind: fal

Categories : Javascript

Instantiating a worker role from a worker role
If your worker roles are different applications, you could make use of Service Management API to create a new deployment for WR-2 from WR-1. What you would do is put the package and configuration files of WR-2 in blob storage and when WR-1 has done putting all the messages in the queue, you create a new deployment of WR-2. To create a deployment programmatically using Service Management API, please see here: http://msdn.microsoft.com/en-us/library/windowsazure/ee460813.aspx. However you would need to ensure that once WR-2 has done all the data, it is destroyed by WR-1 so that you don't keep on incurring charges. Other possibility is to run your worker role instances to run in Master/Slave configuration. Let's say there are 2 instances of your worker role running. One of the instance would

Categories : C#

What is the role of std::forward_iterator_tag?
At the risk of quoting your link.. Empty class to identify the category of an iterator as a forward iterator: It is used as a tag to identify the kind of iterator, so that the functions, here _M_range_insert can act appropriately. Since it is a type name, it can be used to trigger different overloads. In my impl, I have void _Insert(const_iterator _Where, _Iter _First, _Iter _Last, _Int_iterator_tag) void _Insert(const_iterator _Where, _Iter _First, _Iter _Last, input_iterator_tag) void _Insert(const_iterator _Where, _Iter _First, _Iter _Last, forward_iterator_tag) Among other overloads.

Categories : C++

Is it possible to get all the parent of a particular role in SQL?
Yes it's possible. You can use recursive CTE for it. http://msdn.microsoft.com/en-us/library/ms186243(v=sql.105).aspx ;WITH RCTE AS ( SELECT ROLE_ID, PARENT_ROLE_ID FROM Table1 WHERE ROLE_ID = 8 UNION ALL SELECT t.ROLE_ID, t.PARENT_ROLE_ID FROM RCTE r INNER JOIN Table1 t on r.PARENT_ROLE_ID = t.ROLE_ID ) SELECT * FROM RCTE SQLFiddle DEMO

Categories : SQL

Logging in Web role MVC
Windows Azure Diagnostics enables you to collect diagnostic data from a worker role or web role running in Windows Azure. The Windows Azure diagnostic monitor runs in Windows Azure and in the compute emulator to collect diagnostic data for a role instance. Log data will be periodically saved to a storage account where it can be examined. For step-by-step instructions refer to Enabling Diagnostics in Windows Azure. For additional information refer to Collect Logging Data by Using Windows Azure Diagnostics, Diagnostics and Debugging in Windows Azure and Windows Azure Diagnostics–From the Ground Up. For advanced dianostic management features check Azure Diagnostics Manager (free trial available).

Categories : Asp Net Mvc

How to get the role of a user?
To get the details from user id when you are in the profile page of that user use the $account variable. More details in the user-profile.tpl.php template inside ROOT/modules/user. Example, get user id: $account->uid;

Categories : Drupal

User role aware UI
A few answers: Is there a know and proven way for dealing with this? Yes, there are a few ways. What you are looking for is called externalized authorization (that's a principle). Different frameworks and languages have different means of achieving that e.g. Spring Security / Spring EL (in the Java Spring world) or MS Claims in the .NET world. There are technical solutions and there are standards (e.g. RBAC, ABAC, XACML...) ABAC, the attribute-based access control model will let you define authorization in a central location called Policy Decision Point (PDP) and then connect your different applications and tiers to the PDP via Policy Enforcement Points (PEP). This means you can apply the same authorization rules to the presentation tier (WPF) and to other layers (e.g. the service layer

Categories : Misc

How to allow assign only users with specified role?
You should write a custom validation method. Something like this should do it for you. validate :check_doctor def check_doctor errors.add(:doctor, "User is not a doctor") unless self.doctor && self.doctor.role == "doctor" end

Categories : Ruby On Rails

Is it possible to get Role information via Hive QL?
to view roles : SHOW ROLE GRANT principal_specification to view privilages : SHOW GRANT principal_specification [ON object_type priv_level [(column_list)]] where : principal_specification : USER user | GROUP group | ROLE role For more details look here

Categories : Hadoop

Azure Web Role Deployment
You can use cspack to actually create the package, but from your question it sounds more like you are asking can you publish an already created package. The answer is yes. There are multiple ways to do this and I'll provide three: 1) The management portal: you can deploy a package if you have the cspkg and csconfig files. Under the Cloud Services you can select a cloud service and select to deploy to the production or staging slot. You can also do this as part of creating a new cloud service in the portal. http://www.windowsazure.com/en-us/manage/services/cloud-services/how-to-create-and-deploy-a-cloud-service/ 2) You can use Windows Azure PowerShell and CLI command line tools to deploy an already packaged deployment. In fact, you can also automate packaging and deploying. http://m

Categories : Azure

Web Role local storage URI
There is. However I really do not understand the reason for doing this? The only reason I see is some misunderstanding or not fully understanding the capabilities of the Windows Azure Platform Services (Storage, Cloud Service / Web Roles). You have to know that local storage is not synced between role instances. Also if hardware failure happens, a role healing process will instantiate an entirely new VM with fresh image from your cloud service package. This will lead to an absolutely empty local storage resource. Windows Azure Load Balancer (the thing that sits in front of your web and worker roles, more here) uses Round Robin algorithm. Meaning that even if with one request user uploads file to your web role. The next request (that you will probably want to show preview) might go to anot

Categories : Azure

How to get .publishsettings for Web Deployable Web Role?
If you are using Visual Studio 2012 or greater, the server explorer to the left will have several Azure items. Specifically the Windows Azure Compute is what we are looking for, right click on that and say 'add deployment environment'. You will then be prompted with a dialog that allows you to sign in and download publish settings file:

Categories : Azure

How can I run a MVC-4 app in a Azure Worker Role?
What is your scenario for wanting to do this? Worker Roles do not have IIS installed, so you won't be able to run MVC4 in a worker role. If you are just wanting to have a Run() method in an MVC4 webrole then you can add the following to WebRole.cs (much like the article you linked mentions). This will cause the following code to run in the WaIISHost.exe process while your MVC4 code runs in w3wp.exe. public override void Run() { // Your code here base.Run(); }

Categories : C#

Azure web role not starting
If you can establish a remote desktop connection with the machine, then do that and, rather than just looking in the Event Viewer, open up IIS Manager and browse to your website. For me, this will often show an ASP.NET yellow screen error identifying any required files that have not been included within your deployed Azure package. You should mark those files as "Copy Local=true" and redeploy - you may need to do this a number of times to catch all of the missing files.

Categories : Misc

How to Login user According to role in yii?
I have solved these question answer click here Thanks hari maliya

Categories : Misc

How to get a list of users in a certain role?
user_roles() is actually implemented in such a way that it searches the roles database table to extract all roles. You could do similar thing and search the users table for a given role. Please look at the function below function getUsersByRole($rid = 1) { // rid = Role Id from users_roles table $query = db_select('users', 'u'); $query->fields('u', array('uid', 'name')); $query->innerJoin('users_roles', 'r', 'r.uid = u.uid'); $query->condition('r.rid', $rid); $query->orderBy('u.name'); $result = $query->execute(); $users = array(); foreach ($result as $user) { $users[] = $user; } return $users; } $users = getUsersByRole(3); var_dump($users); Make sure you will run it within Drupal environment.

Categories : PHP

Role of tty in Linux kernel
This file is to support tty on user level interface or console.This also implements echoing. tty: Print file name of terminal on standard input.For more info give info tty command on shell.

Categories : C

Role authentication and authorization
You are first allowing a role, but then denying all users. The rules are executed in order so try to specify the most specific rule as the last. <deny users="*"/> <allow roles="emailshare"/> Another thing, you are not setting the Principal after authenticating the user from the DB. You need to set the user in the HttpContext and flag is as Authenticated. Otherwise if (Request.IsAuthenticated) will always be false. GenericIdentity userIdentity = new GenericIdentity(ticket.Name); GenericPrincipal userPrincipal = new GenericPrincipal(userIdentity, roles); Context.User = userPrincipal; Note that the roles parameter is a comma-seperated string. Also, wwouldn't it be easier to use the build-in provider model? That prevents you for writing all the authenticati

Categories : C#

@RunAs and Role Propagation
I figure out the problème. Actually in the mapping the <principal-name></<principal-name> must be specified with the username associated to the group.

Categories : Security

How can I get the Role for a user after Login?
you could try using HttpContext.Current.User.IsInRole("role") I'm not 100% sure on when the Roles security class gets updated after a login - but I bets its not until the forward page gets called and a whole new request is generated.

Categories : C#

Role of value="" in
In AngularJS value attribute for the input type not really matters anything. What all matters here is the ng-model. ng-model in AngularJS is similar to value in normal php forms. Its not really related to input type, even in AngularJS forms you have to specify the input type for the attribute like input type="text" or input type="email" or something. value is not so important in AngularJS forms.

Categories : Javascript

Configuring Associated WCF Web Role IP on Azure
Since you have different web roles for WCF and ASP.Net, their url would only differ by port number, why do you want to bind to IP address? For such variation you can user web.config transformation and define web.config entries for production deployment, by creating a deployment config such as web.cloud.config. Update: If the endpoint is internal then the above model does not apply. IP gets generated randomly and has to binded at runtime. See this post

Categories : C#

Role of new keyword in Java
Yes - every time you use new (as a keyword) a new object will be created. In this case: Mixer m3 = new Mixer(m2); The line Mixer m3 = new Mixer(m2); invokes a constructor which does not create any new object. Your reasoning is completely incorrect. A new Mixer is being created using m2 as a parameter. Usually this indicates a copy constructor - creating a new Mixer with the same properties as the old one (but it is always a new, distinct object, and doesn't technically have to copy the properties of the object passed in at all.)

Categories : Java

Authentication and role authorization in ASP.NET MVC 4
It depends how custom you need: 1) Try something, that exists already. As long as you're using EF, you may try https://efmembership.codeplex.com. Haven't tried it, but from first look, looks reasonable and configurable. There are also other MembershipProvider implementations on nuget gallery if previous one does not fit. 2) If really nothing fits into your scenario from existing in nuget gallery, implement membership provider by your self. Example may be here: http://blog.ianchivers.com/2012/03/entity-framework-custom-membership.html or there even video how to do it: http://www.asp.net/web-forms/videos/how-do-i/how-do-i-create-a-custom-membership-provider

Categories : C#

Role Based Navigation
SOLUTION As suggested, I created a ChildAction called Menu and partial views for each role. Inside the action I do some role checking using some conditional statements and render the appropriate view. This keeps the conditional statements out of the views which makes it a lot cleaner solution. I'm sure there are a few things that could be done to tidy it up and I will continue trying to improve it. Here is the solution I used. In the layout view where I wanted the menu to appear I used this. @Html.Action("Menu", "Navigation") Then I created a controller called Navigation and added a single Action called Menu. public class NavigationController : Controller { [ChildActionOnly] public ActionResult Menu() { if (Roles.IsUserInRole("Administrator")) {

Categories : Asp Net Mvc

Get the number of users for each role
You can use Roles.GetUsersInRole. For example: If Roles.GetUsersInRole(strRole).Count > 0 Then 'do NOT delete this role End If

Categories : Misc



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.