w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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

Document root element "hibernate-configuration", must match DOCTYPE root "hibernate-mapping"
DOCTYPE for <hibernate-configuration> should be: <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

Categories : Hibernate

is there any method to draw a tree with a root , the root's previous nodes and successor nodes?
Couple of ideas you might find useful: You can use the tree layout to place the nodes in the canvas, create link objects pointing back and forth, then bind the link objects to a diagonal. http://www.durablejs.org/examples/flowchart/1/admin.html You can also use place the nodes using a pack layout, create the link objects pointing back and forth, and bind the links to a Bezier curve. http://www.durablejs.org/examples/statechart/1/admin.html You can find the code for the graphs above: https://github.com/jruizgit/durable/tree/master/lib/durabjevisual.js

Categories : D3 Js

Including from child theme root or else include from parent theme root
To answer your question directly based on your sample, i would not check to see if the file has been placed in the child theme. If a child-theme developer has customized the file, they can simply declare the function and include their own file (wherever they place it). There is no risk of code duplication because your sample function is simple enough. Even if you simplified your code for the purposes of placing it here....you can always keep includes wrapped in a very simple function that can be declared by a child theme. This will keep PHP running efficient and not having to check for files all the time.

Categories : Wordpress

How can I remove the root node and make the first child the new root node with XSLT?
Add a rule to the identity transform that adds nothing to the result tree for your document element other than the processing of its children: <?xml version="1.0" encoding="US-ASCII"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/*"> <xsl:apply-templates select="*[1]"/> </xsl:template> <xsl:template match="@*|node()"><!--identity for all other nodes--> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> (edited to be agnostic to the name of the document element) (edited again to only preserve the first child element of the document element)

Categories : Xml

Defining root of HTML in a folder within the site root folder
You need to set the base tag. If you add the tag in your page <head> like this: <base href="http://yoursite.tld/folder/"> it should display images and with sources relative to this base path.

Categories : HTML

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

Reference another Aggregate Root inside another Aggregate root?
By the sounds of it you have an Installation AR. When requiring an AR in another you should model the contained AR as a only the ID in the container or a VO if required. You need to have hard edges around your ARs. Back to the Order / OrderLine example :) An OrderLine seems to 'require' a Product but you shouldn't ever give a Product instance tot eh OrderLine. Instead only model, say, the ProductName and ProductId as a VO in the OrderLine. Now you have a distinct edge to your Order AR. Hope that helps somewhat.

Categories : Entity Framework

wrong child root name in rabl and can't set child root name
I've encountered the same exact bug, the problem seems to be setting the object_root to false. Following the comment of Bigxiang I have experimented a bit and found that this works fantastically: child( {:rsvp => :rsvp}, {:object_root => false} ) do extends "users/index" end Note both the round parentheses "()" and braces "{}".

Categories : Ruby On Rails

Is it webapp-root/META-INF or webapp-root/WEB-INF/classes/META-INF (Tomcat 7)
I guess it is all right. They both might have slightly different purposes. webapp-root/META-INF is directory for metadata of the web application, which you can access via servletContext.getResource("/META-INF/foo"). webapp-root/WEB-INF/classes/META-INF is directory for metadata of java classes, which you can read via getContextClassLoader().getResource("/META-INF/foo").

Categories : Spring

Where is Doc Root
You can not say in advance if $_SERVER['DOCUMENT_ROOT'] contains a slash at the end or not. It varies according to the environment. In most cases, it doesn't have the trailing /, but in Windows, a trailing slash will cause issues. The solution here, as Dave suggested, would be to append the trailing slash if it doesn't exist. $_SERVER['DOCUMENT_ROOT'] = sprintf('%s/', rtrim($_SERVER['DOCUMENT_ROOT'], '/')); An alternative solution: $_SERVER['DOCUMENT_ROOT'] .= (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/')?'':'/'; Hope this helps!

Categories : PHP

How to get the root directory
Use Path.GetPathRoot method provided by the framework Gets the root directory information of the specified path For your case you can use: string rootPath = Path.GetPathRoot(filename);

Categories : C#

How to use root privileges in my app
This is what I have found you must specify android.permission.FACTORY_TEST permission. docs here For accessing root permission you can use p = Runtime.getRuntime().exec("su"); Source : Here

Categories : Android

XML::LibXML: doc - root
Any prefixes defined in the topic node are adopted by the xpc, so the two are different if there are prefixes defined on the root node. use warnings; use strict; use feature qw( say ); use XML::LibXML qw( ); my $xml = <<'__EOI__'; <root xmlns:foo="uri:xxx"> <foo:bar/> </root> __EOI__ my $doc = XML::LibXML->load_xml( string => $xml ); my $root = $doc->documentElement(); { my $xpc = XML::LibXML::XPathContext->new($doc); say "doc:"; say $_->nodeName for $xpc->findnodes('foo:bar'); } say ""; { my $xpc = XML::LibXML::XPathContext->new($root); say "root:"; say $_->nodeName for $xpc->findnodes('foo:bar'); } doc: root: foo:bar

Categories : Xml

Difference between root to and get
root_to: is used to show the home page. i.e., page which is user landed into site. To solve your problem: First provide route to static_pages/home using get "static_pages/home" and then add root to: "static_pages#home"

Categories : Ruby On Rails

How to get root dir in Symfony2
I want to make everyone aware that this is the Service Locator, which is an anti-pattern. Any developer should be able to see what a class, or controller, requires to function from the method signature only. Injecting a whole "container" is very generic, hard to debug and isn't the best way of doing things. You should use a Dependency Injection Container that allows you to inject specifically what you want anywhere in your application. Be specific. Check out a seriously awesome recursively instantiating dependency injection container called Auryn. Where your framework resolves your controller / action, place it there and use the container to create the controller and run the method instead. Boom! Instant SOLID code. You're correct, the service container is accessed using $this->ge

Categories : PHP

Root log all level
This appears to be the way log4net works. When your config file is processed it behaves as if it has been configured like: <logger name="IBatisNet.DataMapper.Commands.DefaultPreparedCommand" additivity="false"> <level value="DEBUG" /> <appender-ref ref="SpecificAppender"/> <appender-ref ref="ConsoleAppender" /> <appender-ref ref="LogBufferingAppender" /> </logger> Fortunately there is a workaround and that is to set a level filter on your appenders, e.g. for the ConsoleAppender: <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"> <layout type="log4net.Layout.PatternLayout"> <param name="ConversionPattern" value="%d{HH:mm:ss,fff} [%t] %-5p %c{1} - %m%n" /> </layout> <filter ty

Categories : C#

zip with php in root directory
Use the second parameter of ZipArchive::addFile() to specify under which file name the file appears in the archive. basename($file) is a good candidate for that.

Categories : PHP

Getting root of expression
I have found the complete solution to my answer which has two parts: Why the DisplayClass and what it means can be found in the answer to this question: What does “DisplayClass” name mean when calling lambda? How to get the actual root of the expression (which is possible by the way) can be found in this questions answer: Getting the object out of a MemberExpression.

Categories : C#

Can't run systrace as root
The adb sources do this: property_get("ro.debuggable", value, ""); if (strcmp(value, "1") != 0) { snprintf(buf, sizeof(buf), "adbd cannot run as root in production builds "); In other words, if it doesn't see ro.debuggable set to 1 it won't let you run adb root. Check the contents of your /default.prop.

Categories : Android

How do I get the root url of the site?
$root = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/'; If you're interested in the current script's scheme and host. Otherwise, parse_url(), as already suggested. e.g. $parsedUrl = parse_url('http://localhost/some/folder/containing/something/here/or/there'); $root = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . '/'; If you're also interested in other URL components prior to the path (e.g. credentials), you could also use strstr() on the full URL, with the "path" as the needle, e.g. $url = 'http://user:pass@localhost:80/some/folder/containing/something/here/or/there'; $parsedUrl = parse_url($url); $root = strstr($url, $parsedUrl['path'], true) . '/';//gives 'http://user:pass@localhost:80/'

Categories : PHP

C# find Nth Root
static double NthRoot(double A, int N) { return Math.Pow(A, 1.0 / N); } From Wikipedia: In calculus, roots are treated as special cases of exponentiation, where the exponent is a fraction: sqrt[n]{x} ,=, x^{1/n}

Categories : C#

C# XML 'colon' in root name possible?
The "site:" bit with the colon in is actually your XML Namespace, set this property instead. Look at this question: How to create XmlElement attributes with prefix?

Categories : C#

How to delete a registry root through C#
I think you want: Microsoft.Win32.Registry.LocalMachine.DeleteSubKey(@"SoftwareABC"); Be wary: LOCAL_MACHINE is protected, and without Admin privileges, this is likely to fail. I wonder if your difficulty in searching is simply terminology. Everything that is not a value is a key. In your words, "folder" equals key. It just a nested structure with values along the way.

Categories : C#

How to npm install global not as root?
That's pretty much all you need to do if you are installing binary utilities (which I gather you are as you updated your PATH). NODE_PATH will only need to be set you have installed a module that you want to require() from unrelated node scripts, but you shouldn't really do this anyway. Modules that are required as dependencies for other modules/scripts should be installed locally (i.e. specified in a package.json) as that way you keep strict control over versions. Edit: The accepted answer here explains it much better than I was able to: How do I install a module globally using npm?

Categories : Node Js

css root element margin
It doesn't make sense to add margins to the <HTML> element. You should only add margins to the <body> and the elements that are in it. Check also http://www.w3.org/TR/html401/struct/global.html#h-7.3 for the spec

Categories : HTML

Problems with ROOT and libbz2
Oook, the problem is rootcint cannot interprate extern "C". The solution is to replace the following code in bzlib.h #ifndef BZ_IMPORT #define BZ_EXPORT #endif #ifndef BZ_NO_STDIO /* Need a definitition for FILE */ #include <stdio.h> #endif #ifdef _WIN32 # include <windows.h> # ifdef small /* windows.h define small to char */ #

Categories : C++

Defining root URL in Simfony2
Move the Symfony folder and all it's contents to someplace else such as /home/work/Symfony Copy Symfony/web/.htaccess and app.php to http://www.host.tld/ (i.e. www or public-html or htdocs) Edit app.php and adjust the require statements to point to /home/work/Symfony/app run app/console assets:install http://www.host.tld/ At this point, the app should run from www.host.tld assuming your caching permissions are setup correctly. The routes will have the generated desired paths in them. No real need to change your web configuration.

Categories : Symfony2

Edit a file outside the web root
Probably by bind mounts (assuming Linux), so that the file is in it's original location as well as in the web root. Or by priviledge separation. The web root sends a query to some worker job, that has access to all the needed files.

Categories : PHP

Ember routes specifying a different root url
For the behavior you need you should also define the namespace on the adapter additionally to the url in the store. For example: App.Adapter = DS.RESTAdapter.extend({ namespace: 'emberApp' }); Videos.Store = DS.Store.extend({ revision: 12, url: "http://localhost/", adapter: App.Adapter }); This will result in http://localhost/emberApp/ as your base url. Have also a look here for info on that. Hope it helps.

Categories : Javascript

Subdomain redirecting to root in MVC 3
I think you are missing regex.Split(url); See more var url = httpContext.Request.RawUrl; Regex regex = new Regex("/"); string[] substrings = regex.Split(url); var index = host.IndexOf("."); var subDomain = host.Substring(0, index);

Categories : C#

how to execute a command as root
If you are a user on your system that has sudo privileges to run commands as root, just pre-pend sudo to the command. system("sudo yum install some-package"); If you want anybody to be able to do it, then you have to be administrator on your system, change the owner of the file to be root, and modify the permissions of your executable to run as root. By doing so, you do not need to modify your system() command string with sudo. chmod +s my_program chown root my_program Realize that doing this may open you up to security problems, unless you have proven that your program has no security issues. The file-system may be such to disallow you from setting the setuid bit on your program. If you need more information along these lines, you should consult SuperUser.

Categories : C

Force web root to use http
Turns out I just needed a pipe without the slash RewriteRule ^|about.php|contact.php|down.php|faq.php|find.php|forgot.php|home.php|index.php|listings.php|viewpost.php$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Categories : Htaccess

.htaccess root issue with php
Make sure you place this in DOCUMENT_ROOT/rest/.htaccess Replace your code with this: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase /rest/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.*)$ api.php?rquest=$1 [QSA,L]

Categories : PHP

where is fs.root (HTML5) in windows
When writing data to the local system, web clients (browsers) do not locally store files according to their virtual file names in the script. As the MDN developer guide notes, "It does not necessarily have a relationship to the local file system outside the browser." (Introduction to the File System API) Therefore, creating a file named "log.txt" in the API does not cause the client to store a real file called "log.txt" on your PC. Google Chrome, for example, will only store a numerically named file (e.g., "00004") in a directory dedicated to sandboxed storage on the client device. The File System API cannot be used to write to the local file system in any way intended for external/outside access to the sandboxed storage area. Also note the to comply with the API spec, client may restrict

Categories : HTML

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