w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
I want to set authenticated users' root to a nested resource, their dashboard, instead of the home#index page non-authenticated users use as root
Option 1: In your dashboards controller, change to: @user = current_user @dashboard = current_user.dashboard This will also prevent users from seeing other user's dashboards. Option 2: Now, if users can see other user's dashboard fine, then change your route: root :to => "dashboards#find", as: :authenticated_root and in your dashboards controller: def find redirect_to user_dashboard_path(current_user, current_user.dashboard) end

Categories : Ruby On Rails

Possible to have multiple git users logged in as root?
It would be safer to manage that kind of access control with an authorization layer like gitolite, instead of relying on system account. That way, you are controlling who can pull what. Although that wouldn't control the "where" part (where the users would pull those repos to)

Categories : Linux

Unlimited users Wifi AP android mode (no ROOT privileges)
The Android limit is hardcoded at a system level, and probably at a protocol level too. Modifying it will at the very least require root privileges, and maybe even a direct rewrite of the Android code at the system level.

Categories : Java

How to make gradle generate a valid pom.xml file at the root of a project for maven users?
You can use the gradle maven plugin. This adds the pom convention method to your project, which you can use in a task to generate a pom.xml file, like apply plugin: 'maven' task createPom << { pom { project { groupId 'org.example' artifactId 'test' version '1.0.0' inceptionYear '2008' licenses { license { name 'The Apache Software License, Version 2.0' url 'http://www.apache.org/licenses/LICENSE-2.0.txt' distribution 'repo' } } } }.writeTo("pom.xml") } Then you call gradle createPom to generate the pom.xml in the project root. Of all the things in the pom definition, you should really provide

Categories : Java

For a Ruby CLI, what is the most reliable way to change directory to users root/home directory?
To summarize Avdi Grimm's screencast on the same subject, If you're using a Ruby version greater than 1.9, the Dir module provides a method #home. However, this depends on the environment variable HOME set on the user's shell session. To reliably get the home dir, you should pass in the login name of the current user to the Dir.home command. Or, in code: # Works if HOME is set in the environment i.e., if "echo $HOME" returns the home directory # when that command is run on the command-line Dir.home # => /Users/<username>, Works if HOME is set # If the HOME environment variable is not set, you should explicitly pass in the username # of the currently logged-in user Dir.home(username) # => /Users/<username> # The current username can be obtained using username

Categories : Ruby

Linux skip /root/.gvfs when executing df command with non-root user
I got the solution for my own question :) In df command you can pass the file system types which you would like to exclude, in this case it is 'fuse.gvfs-fuse-daemon'. So when I execute the below the command I no more get this message "df: `/root/.gvfs': Permission denied" df -x fuse.gvfs-fuse-daemon For more details one can look into df --help option.

Categories : Linux

Root immediate child nodes icons not visible when hiding root
JTree#setShowsRootHandles(boolean newValue) controls the state of the handles for root elements. Normally, this is false. Try changing to true

Categories : Java

Is sudo-ing tomcat's startup with a non-root user the same as running it as root?
Do be aware that the recommended solution to run tomcat on port 80 is to use mod-jk with the Apache web server, not to have tomcat listen on port 80 directly.

Categories : Unix

Reset MAMP Pro username and password to root/root
Assuming you still know the password, you can change the password back to root using /Applications/MAMP/Library/bin/mysqladmin -u root -p password root It'll prompt you to enter a password again, after which it'll be reset to root

Categories : Mysql

Read and Write root folder wihout root
You can use run-as on some devices to execute commands as a particular package. Google have fixed this on Jelly Bean so it no longer works: adb shell run-as app.package.name cp /data/data/package.name/file.txt /sdcard/ exit adb pull /sdcard/file.txt ~/ Here is a good article explaining file access in Android without root permissions, including a one-liner for the above script. It details how to use the new backup command: backup -f ~/data.ab -noapk app.package.name And how to extract the contents of the resulting .ab file: dd if=data.ab bs=1 skip=24 | openssl zlib -d | tar -xvf - You will most likely need the android.permission.BACKUP permission.

Categories : Android

SVN (svnserve) virtual root --root= not recognized
svn+ssh handles the whole transaction including writing and reading the files so it ignores the --root parameter in svnserve. Here is how to fix it over at serverfault -- Basically you just make svnserve into a script that calls svnserve with the proper variables.

Categories : Svn

Dialog not restricted to specified height
just add following css class in your css file <style type="text/css"> .ui-dialog-content { height: 450px !important; } </style> and please do let me know if you still face problem

Categories : Jquery

Restricted low-ascii character in AS3
Different operating systems use different characters to mark the end of line: Unix / Linux / OS X uses LF (line feed, ' ', 0x0A) Macs prior to OS X use CR (carriage return, ' ', 0x0D) Windows / DOS uses CR+LF (carriage return followed by line feed, ' ', 0x0D0A) In your case, ascii 13 = carriage return. It is probable that one of your air project configuration files has an embedded carriage return that is causing this error. You should try a utility such as linebreaks Less likely but not impossible, is that one of your actual file names contains a carriage return. For that you will need to try and rename the files till you find the correct one.

Categories : Actionscript

How to manage restricted profiles in android app?
The UI for users to control the restrictions you've built is managed by the system's Settings application. To make your app's restriction settings appear to the user, you must declare the restrictions your app provides by creating a BroadcastReceiver that receives the ACTION_GET_RESTRICTION_ENTRIES intent. The system invokes this intent to query all apps for available restrictions, then builds the UI to allow the primary user to manage restrictions for each restricted profile. For more info look at http://developer.android.com/about/versions/android-4.3.html#RestrictedProfiles

Categories : Android

How to add spans to all areas of a node that isn't restricted
Match all contents of the h1 and use .not() to remove the safe from your selection. Then use .wrap() to make them "disappear". http://api.jquery.com/not/

Categories : Javascript

Restricted Function with libsandbox and pysandbox
The RF result code was most likely due to unexpected syscalls for file operations (i.e. SYS_open(), SYS_close(), SYS_stat(), ...). It so happens when (1) the target program actually does file operations, and (or) when (2) it was dynamically linked and needs to load .so libraries in runtime. Since your target program does not invoke file operations, it belongs to the latter case. Then, to resolve the RF outcome, either, statically link the target program to avoid dependencies on shared libraries; or, extend the policy rules in the wrapper script to handle relevant SYSCALL / SYSRET events; DISCLAIMER: I am the author of libsandbox.

Categories : Python

How to get unique values when restricted to select * using SQL
here is a quick solution: Use it as subquery select created_user, MAX(created_date) from ( select * from gisadmin.FORESTRY_LOCATIONLOG_vw WHERE 1=1 //append this ) Group by created_user Notice that I added 1=1 which will always be evaluated to true to handle your Where clause.

Categories : SQL

Type 'string' not supported in restricted C++-AMP
The error message is correct C++ AMP does not support string or chars unfortunately. The smallest data type supported is int. There are tricks/techniques to get around this limitation they involve making the chars bigger into ints. There is a good article about how to do this here: C++ AMP: It's got character, but no char! and another here with source code String search sample with C++ AMP.

Categories : Misc

"com.example is restricted" when uploading APK to Play Store
The error message is telling it all. You need to use a package name of your own. The package name is the identitiy of the application. To rename the package name, In eclipse right click on the project in project explorer. Then Android Tools > rename Aplication Package name. Then enter the new package name. Also make sure that you are trying to upload a release build

Categories : Android

Restricted profiles settings not being remembered
Turns out that you need to add some code when generating the RestrictionEntry Though I will update so that people don't have to hunt... In your receiver call final Bundle oldRestrictions = intent.getBundleExtra(Intent.EXTRA_RESTRICTIONS_BUNDLE); then when creating the entry reference it. e.g. RestrictionEntry myEntry = new RestrictionEntry(KEY, oldRestrictions.getBoolean(KEY, false)); myEntry.setType(RestrictionEntry.TYPE_BOOLEAN); myEntry.setTitle("KEY TITLE"); newEntries.add(myEntry);

Categories : Android

How to get a result from a restricted list of data?
You are not using your controle parameter. The query has no where clause, thus is returning all the data instead of filtering. Your query should probably look more like: public List getControle_versao(int controle) { return (List) session.getCurrentSession().createQuery( "FROM Receita WHERE controle = " + controle + " ORDER BY titulo").list(); }

Categories : Java

Android Distribution Restricted Certificate
You need to generate a developer private digital signing key .You can use standard tools — Keytool and Jarsigner — to generate keys and sign your application .apk files I would suggest you to read this link completely if you have not done http://developer.android.com/tools/publishing/app-signing.html

Categories : Android

Lint restricted macro name list
The chances are that you're using a macro name such as _HEADER_FILE_H_ which is reserved to the implementation and PC Lint is telling you about this error. After removing the horizontal scroll bar, it appears that the name you are misusing is defined. The C preprocessor uses the name defined for: #if defined(SOME_MACRO) You cannot, therefore, write: #define defined(x) ((x) != 0) or anything similar. You should treat defined as a keyword, at least in pre-processor directives (and you can't treat it as a macro outside of pre-processor directives). Although you could use it as a variable name (and you could use endif and define and elif as variable names too), you'd be best off not using it and treating them as reserved words. The C11 standard (ISO/IEC 9899:2011) says: 7.1.

Categories : Misc

How can we use app engine users API (java) with other google APIs to get users' profile pictures?
To get a user's profile picture from Google+ you need to use G+ API which requires using OAuth2. Here is a very simple example how you can get a person's profile info (including profile picture) : https://developers.google.com/+/api/latest/people/get?hl=en#examples Hope this will help you :)

Categories : Google App Engine

Unable to findnodes() restricted just to current parent
Instead of always using $tree as the starting point for the findnodes method, you can use any other node, especially also child nodes. Then you could use a relative XPath expression. For example: for my $record ($tree->findnodes('/Wrapper/Record')) { for my $assembly ($record->findnodes('./Assembly')) { for my $part ($assembly->findnodes('./Part')) { } } }

Categories : Misc

What are the best practices when designing restricted areas in rails?
I would suggest you check out CanCan if you want to keep your code nice and DRY -the way you're currently doing it will lead to lots of repeated code and might become unmanageable. Once installed, CanCan will generate an 'Ability' file where you can define what users can or cannot do. in you case for example, you might have def initialize(user) user ||= User.new # guest user (not logged in) if user.admin? can :manage, :all else can :read, :all end end Then in your views, you can do a simple check to see whether or not a user has the ability to modify that object. For instance: <% if can? :create, Project %> <%= link_to "New Project", new_project_path %> <% end %> It's a super useful gem and very well documented!

Categories : Ruby On Rails

ACC2010: date picker in restricted folder not available
I have developed a complete datepicker solution that is not ActiveX driven and works in all current Windows environments. So, yes, there is a workaround. However, it's just not possible to explain it in this forum. It involves creating a new calendar form from scratch. Besides, a lot of Active X functionality in 2K7 is spotty and most people are moving away from it.

Categories : Ms Access

Test/run a C# application with restricted CPU/RAM in Visual Studio?
a method would be to get data from resource monitor & then set an upper limit according to it so when the ram/cpu utilization reaches there the process goes to wait state (regardless of what that makes the utilization higher) .

Categories : C#

Create PHP page restricted to groups Joomla
Probably the easiest way is to utilize the Joomla framework to get the user's id, query the database for a matching record in the #__user_usergroup_map table. The code below hasn't been tested and will require you to load the Joomla framework into your script. $user =& JFactory::getUser(); $userID = $user->get('id'); // allowed group_id $groupID = 7; $db =& JFactory::getDBO(); $query = $db->getQuery(true); $query->select('user_id'); $query->from('#__user_usergroup_map'); $where->where('user_id = ' . $userID . 'and group_id = ' . $groupID); $db->setQuery($query); $db->Query(); $num_rows=$db->getNumRows(); if ($num_rows === 1) { // only one matching record } else { // Sorry, you aren't allowed here. }

Categories : PHP

Reading configuration section from a restricted appdomain
In fact, ConfigurationSections were defined in a full trust assembly. So the partial trust caller could not read the configuration section, even if the require permission = false was present. I found a workaround, mark the assembly that contains the configuration section definition with this attribute : AllowPartiallyTrustedCallers

Categories : C#

NoClassDefFoundError: org.slf4j.LoggerFactory is a restricted class
I had similar issues and reverted to JDK 1.7.0_21 to solve them. Archived JDK downloads

Categories : Java

ff object length is restricted to 32 bit integer in 64 bit Windows
I resolved the problem by changing/recompiling source of the package. Among lots of features from ff, I only needed to create ff object and to call get/set subscript methods so my scope was narrow enough for me to do this in a night but all credit goes to the original author who organized the source very well. In fact, the author well prepared for this issue and made C macros for different type of index and size. I just used the C macros to do what I want. Here is roughly what I did. Remove all error checking integer for size (length) of ff object in ff function Use as.double instead of as.integer when passing the size and pagesize to C function new. In ff.h, I redefined following macro and its corresponding part in ff.cpp #define FF_DECL_TYPE(NAME,TYPE) FF_DECL_TYPE2(NAME,TYPE,in

Categories : R

Create generic Interface restricted to own class
Are you looking for public interface Thing<V> { public V createCopy(V original); } ? If not, can you explain in more detail what it means to you to "create a generic interface for two classes"?

Categories : Java

How to let a non-signed in user access a restricted page only once?
The most prescient solution is to create a session variable for guest users containing a boolean value indicating whether or not they have visited the page or not (and consequently enabling access if they have not visited, and vice-versa): # in your controller before_filter :check_guest, :only => :show private def check_guest # if user isn't logged in if current_user.nil? # if user has already viewed, redirect if session[:viewed] == true flash[:alert] = "Please sign in first" redirect_to sign_up_url(:subdomain => false) # if user hasn't viewed, allow access, but flag as having viewed else session[:viewed] = true end end end Though using sessions is a de-facto approach to this particular issue, there are limits to its implementation:

Categories : Ruby On Rails

How do I check if a String contains restricted words using Regex?
Instead of using such complicated regular expressions, you can state: the regex: "PO BOX|P0 DRAWER|POSTOFFICE| PO | BOX |C/O|C.O.| ICO | C/O | C |C/0|P O BOX|P 0 BOX|P 0 B0X|P0 B0X|P0 BOX|P0BOX|P0B0X|POBX|P0BX|POBOX|P.0.|P.O|P O | P 0 |P.O.BOX|P.O.B|POB |P0B|P 0 B|P O B| CARE |IN CARE| APO | CPO | UPO |GENDEL|GEN DEL|GENDELIVERY|GEN DELIVERY|GENERALDEL|GENERAL DEL|GENERALDELIVERY|GENERAL DELIVERY" And negate the answer. When you compile the regex (in Java) the resulting mechanism will become more efficiënt. (Java uses DFA minimalisation).

Categories : Java

Restricted pages with client side templating
Depending upon the framework you can restrict this from the server and you would not loose any Angular goodies. The way you include templates into Angular is by either using ng-view or ng-include. ng-view template is configure during the route definition. Since these templates are loaded from server you can always control loading of these template. ng-include too can take server side templates, and the same restriction can be enforced using AngularJS. We use ASP.Net MVC so in ASP.Net you can put AuthorizeAttribute over the controller (server side) method that returns the view to controller what get's returned to client. Also keep in mind, once a template is loaded it would be cached by Angular's template cache so it would not be fetched until the page is refresh (browser navigation

Categories : Java

Fitting restricted cubic splines in a cox model
The 'rms' package uses rcs (restricted cubic splines) which Harrell specifically states are linear in the tails and that agrees with my experience. You do not get auto df estimation as you might in the 'mgcv' package..

Categories : R

AuthorizeAttribute MVC, restricted based on user types?
The AuthorizeAttribute is placed on controller or action methods to prevent them from executing for unauthorize individuals. In your case, what you want to do is prevent a menu from being displayed based on the type of users. For this, you would use Roles that determine what permissions each user has. Then on the view, you would use the User.IsInRole("roleName") to determine if they are in the role and act accordingly. For instance, here is how you would only show the "Manage Users" menu item to an admin: @if(User.IsInRole("Admin")) { <li><a href="/admin/users">Manage Users</a> } Also, in the Users action method, you would decorate it with the AuthorizeAttribute to prevent users that are not in the "Admin" role from accessing the page. [Authorize(Roles("Admin")

Categories : Authentication

illegal external reference in amp-restricted function
You can declare perm[] as a static array within your Perlin class and then add an array_view<const unsigned int, 1> as a member variable to the class and initialize it in the class constructor. You can then capture [this] in your restrict(amp) lambda and access the contents of your perm[] within each function. tile_static is used to tell the compiler which type of memory to store data in. tile_static memory is a limited amount of much faster memory local to each tile. If your C++ AMP lambda reads each value of the perm array_view many times then you may see performance improvements by placing the data into tile_static memory.

Categories : C++

Login system using physical postgres users not "logical" users
To achieve your goal all inserts, updates and deletes, need to leave a trail that is difficult, if not impossible for a standard user to change. you can create: 1) Two schemas: one for common tables, one for security stuff like login/pass(hash) table, user session log, change log table, etc. 2) Two users: one common user, that can only use dml on common schema (no ddl), one superuser. 3) Login function that will check provided user/pass against login/pass table and log successful/failed attempts into user session log (you need SECURITY DEFINER function) 4) Set of audit triggers on common schema tables that will check the user privileges and log any changes, made by the user (SECURITY DEFINER functions here too).

Categories : Security



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