w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
AngularJS filter with multiple perms
I fixed up your fiddle: http://jsfiddle.net/eQP8S/ <div ng-controller="MyCtrl"> <ol> <li ng-repeat="user in users | filter:{parent_id:0}"> {{user.name}} <ol> <li ng-repeat="child in users | filter:{parent_id:user.id, type:user.type}"> {{child.name}} </li> </ol> </li> </ol> </div> Your main problem was that you were trying to use the "filter" filter with a function, which is okay, but that function isn't allowed to take any parameters. If you actually need to create a filter that takes parameters you have to write a custom filter: http://docs.angularjs.org/guide/dev_guide.templates.filters.creating_filters. But in your case, you can

Categories : Angularjs

Portable JDK for Minecraft modding
I have done this myself because I was in the same position. I tried copying the JDK as well, but that didn't work, could be a mistake on my part. I am using OpneJDK now, and that works perfectly with intelij-idea, I'm sure it works with Eclipse as well. http://openjdk.java.net/

Categories : Java

Java: Game modding, instanceof
I think your problem is this: if ( e != this && e instanceof EntitySkeleton || e instanceof EntityCow && getDistanceToEntity(e) <= killauraRange && mc.thePlayer.canEntityBeSeen(e) && !Camb.friend.contains(e.getEntityName()) ) { You combine a lot of conditions but not in the way you intended. Operators like || and && have rules how they apply just like 2 + 2 * 10 is 22 instead of 40. && has precedence over || just like * has precedence over +. Your condition currently means (e != this && e instanceof EntitySkeleton) || (e instanceof EntityCow && getDistanceToEntity(e) <= killauraRange && mc.thePlayer.canEntityBeSeen(e) && !Camb.friend.contains(e.ge

Categories : Java

Minecraft modding- How to use setBlock on the server side?
The short answer is that you've coded your mod to be single-player only, meaning that it will only operate correctly if the client code and the server code are executing from the same runtime environment and can easily pass object references and values back and forth. The reason your client is reporting that the WorldServer object is null is because it doesn't actually have access to any WorldServer objects when connected to a dedicated server (in SSP the client is running the integrated server, so it DOES have access to it). The same is true for why the server doesn't have access to the WorldClient object. Basically you need to implement client/server packet handlers for the client to send the custom data needed by the server to determine if the player has entered the correct keypad en

Categories : Java

Modding Jquery Photostack Script To Use A Database For Images
Ok, I solved this !, for some reason the photos in the albums had the extension .jpeg and not .jpg, so im not why where I downloaded them from to get that extension. Anyway, I changed $files = glob($location . '/' . $album_name . '/' . $location2 . '/*.{jpg,gif,png}', GLOB_BRACE); and added jpeg $files = glob($location . '/' . $album_name . '/' . $location2 . '/*.{jpg,gif,png,jpeg}', GLOB_BRACE); and now it works perfectly !.

Categories : PHP

How to permanently chmod 777 for PHP
You don't need chmod. Set an ACL on the directory: setfacl -R -d -m u:php:rwx /var/lib/folder/ This gives user php rwx rights for new files (-d = default). You can change the ACL for existing files in the folder with: setfacl -R -m u:php:rwx /var/lib/folder/

Categories : PHP

Chmod for PHP web application
I use 640 on my server. The files are owned by me so I need read and write. Group is www-data so apache can read. PHP scripts don't need execute to run (if using the apache php module which is default. I think you need execute when using cgi), only read. No one else needs access. I have an uploads folder that gives apache write but just that one folder and I typically deny access with .htaccess, disable php to prevent script uploads or put it outside the webroot; depending on the needs of the project.

Categories : PHP

-R not working with chmod?
With the command: chmod -R 664 *.html The shell will expand the file paths given (*.html) and operate just on those. That would be all html files in the current directory. It won't traverse directories unless you have one that matches that pattern, and in that case, everything under that folder would be changed. To do what you want to do, you need to use find: find . -name "*.html" -exec chmod 664 {} ; If the html files you want to change are only one or two levels down, you could do something like this: chmod 664 *.html */*.html */*/*.html etc. But find would be the general solution.

Categories : Bash

How to implement chmod u-w in python
st = os.stat(dest_file) os.chmod(dest_file, st.st_mode & ~stat.S_IWUSR) Explanation: ~ is the bitwise NOT operator, so a bitwise AND with ~stat.S_IWUSR clears the flag from st.st_mode. To illustrate with imaginary values: stat.S_IWUSR 00001000 ~stat.S_IWUSR 11110111 s.st_mode 00101001 s.st_mode & ~stat.S_IWUSR 00100001

Categories : Python

How many combinations can chmod in linux have?
The 3 numbers denote owner/group/world Each of them has read/write/execute bits. You are setting these when it comes to the 3 numbers. So, 000 becomes owner group world rwx rwx rwx 000 000 000 777 (which allows everyone to read, write and execute the file) becomes owner group world rwx rwx rwx 111 111 111 644 allows owner to read/write. Group and world to only read. owner group world rwx rwx rwx 110 100 100 And so on.. In total, there are 8 bits, which can be turned on/off, giving you 8^3. In addition, there are the special modes Sticky bit, SUID and SGID, and their various combinations, further giving you 8 possibilities.

Categories : Linux

Chmod permission on future files
Not usually. You could have a cron job to chmod them. Or you could change the umask of processes writing to that dir to 000 to make it work as you wish. If this is a desktop computer, you can bind a key combination through your desktop environment so once you copy files to the dir, you hit the combination and a chmod is executed.

Categories : Misc

recursively chmod files using RecursiveIteratorIterator
You should keep in mind that your php script needs to be executed as root in order to chmod files. You could also just use sudo chmod -R to recursively apply chmod to the files in a directory and its sub-directories.

Categories : PHP

List too long to chmod recursively
Omit the * after xargs chown because it will try to put the list of all file names twice into the script. Try ls | xargs chown -R apache:apache To avoid problems with spaces and newline characters in file names, I suggest to find . -maxdepth 1 -not -name "." -print0 | xargs --null chown -R apache:apache

Categories : Linux

chmod unable to change permissions
Looks like you've discovered that the Macintosh doesn't strictly agree with the UNIX permission bits. Ultimately, there are ACL bits that MacOS sets and that the Macintosh Finder obeys. To solve your problem quickly, in your Terminal command line, type in "open ." (or the path to your "startup" folder) and that will open up the folder in your Macintosh Finder. Then do a "Get Info" on the file: You can change your permissions here.

Categories : Osx

Function chmod in windows os no like in linux
This function returns the permission bits from the input in octal, so if file permissions on Windows worked the same as on Unix this would work for you: function convertperm($num) { return 0777 & decoct($num); } However, Windows is not Unix: The execution permission you get from stat depends on the file name extension. The Windows version of chmod can only be used to make a file read-write or read-only; you can't remove the "read" permssion. Also, there are no separate permissions for "owner", "group", or "other" since the Unix concept of user groups does not exist on Windows. For example, for 33060 the above function return 444, indicating read-only permissions. If you had set the permissions to 777 in theory you should get back 666 (Windows chmod ignores the execute bit), so

Categories : PHP

(pre)cursive chmod on created directory in Python
os.makedirs takes an optional mode argument that sets the mode of the created directories. os.makedirs(log_dir, 0o664)

Categories : Python

Change file CHMOD when uploading with this code
Two options: First upload file completely, then chmod it. Create empty file, chmod it, then put your data into it. Doing a chmod on a file is rather simple in PHP: chmod("/directory/file", 0755); Just remember that you need to use octal and not decimal to get the correct value of mode; so prepend your "755" with a "0" as shown in the example above! For your code, I would do it like this: public function receive() { ... chmod($this->path . $this->fileName, 0755); return true; } More details related to the CHMOD command in php can be found at http://php.net/manual/de/function.chmod.php.

Categories : File

NativeIO chmod "ENOTDIR" exception in mapreduce
This was an interesting bug: It turned out that i indeed had a FILE created which existed, already, in a place where a directory was needed to be created. That is , some how, I had a file called "tmp" in my file system implementation's root directory ! In any case, the confusion was due to scarce error reporting by the hadoop NativeIO class. I think it is a failure which should be reported and logged better by the underlying NativeIO class .

Categories : Hadoop

Chmod specific directories using Phing FtpDeploy task
You set the permissions correctly on your local system, and use the dirmode="inherit" attribute.

Categories : Wordpress

Why in PHP if you use Mkdir recursive flag do the nest directories not chmod?
mkdir is functioning correctly. The intermediate directories created are set based on the current umask. You want something like: umask(0777); mkdir('path_one/path_two', 0777, true);

Categories : PHP

php chmod returns true for success but doesn't actually change permissions
From the manual The current user is the user under which PHP runs. It is probably not the same user you use for normal shell or FTP access. The mode can be changed only by user who owns the file on most systems. If this script is being run by the webserver (i.e. accessed via a browser), this PHP script will be run as the wrong user. Only the owner of the file (or root) can use chmod, the webserver is probably running as www-data or something, and therefore doesn't have permission to chmod.

Categories : PHP

How to use chmod to hide a folder but allows read/write of the files inside?
Yes, it is possible: chmod works like this chmod u+w pathYouWantToHaveWritePermissionForUser/ chmod u-r pathYouWantToHaveNOreadPermissionForUser/ so for example you have the folder chmod u+w /home/You/save/ chmod u-r /home/You/save/ test it with nano /home/You/save/test tip in something andsave the file. If you tip cd /home/You/save/ ls you will not be able to see any file in this directory. But you could read the file test cat test learn more about chmod reading the man page

Categories : Linux

Raspbian (debian) file permissions do not persist after setting with chmod
The files that I was trying to give "execute" privilege to were on a usb memory stick. When I moved them to the home directory I was able to change them. So, perhaps their location caused my problem. Peter

Categories : Linux

Codeigniter - setting up directories and files permissions (chmod settings)
You want to: chmod -R 0644 application system index.php Assuming that CI is installed in the web root, with the application/ and system/ directories residing therein, which is the default setup. What I typically do is put the application/ and system/ directories outside of the web root when I use Codeigniter, at which point you need to edit your index.php file to reflect that: $system_path = '../system'; $application_folder = '../application'; Note, you'd be adding the ../ (and also need to move those directories one level down) but I digress. The permissions for each directory should be 0755 and for each .php file 0644, wherever you end up putting them. This includes any vendor, 3rdparty, sparks, etc, and any custom asset locations. If using a templating engine of some sort, good

Categories : PHP

How to make Gradle stop trying to chmod MANIFEST.MF on an NTFS drive
Gradle is trying to set default permissions for that file, and I can't see a way to stop it from doing that. (You could make it set different permissions, but I guess that won't help.) Under Windows/NTFS this normally works just fine, so it might be a problem with you Linux NTFS driver or configuration.

Categories : Linux

I've accidently pushed to a git repo with the wrong user account. How can I undo it or change the user?
You can use patch files to modify the author (in the ${editor} step update the author): git format-patch -2 git reset --hard HEAD~2 ${editor} *.patch git am *.patch Then push with force to rewrite commit history: git push -f

Categories : GIT

Is there a way to programmatically insert a new user into a MyWSAT implementation (Windows Forms user registration)?
I can't speak about MyWSAT since I do not use it, however, here's what I do know... Since this is a SQL Server database, I would suggest using SQL Profiler when adding a user. See what comes out of the trace and go from there. With luck, maybe you can use one stored proc to create the user.

Categories : C#

How to assign to workers a proxy that requires user name - password and a custom user agent?
Assign User Agent by Desired Capabilities dcap = dict(DesiredCapabilities.PHANTOMJS) dcap["phantomjs.page.settings.userAgent"] = ( "Your User Agent String here . . .") Found API Reference here for the proxy authorization. Add "--proxy-auth=username:password" to server_args. Like . . . service_args = [ '--proxy=xxx.xxx.xx.xxx:xxxx', '--proxy-auth=username:password', '--proxy-type=http', ] Then use both when starting the webdriver driver = webdriver.PhantomJS(desired_capabilities=dcap,service_args=service_args) This took care of all my issues. EDIT: Unable to reproduce solution. Only proxy is changed with above method. EDIT.02: Issue resolved. It was never a coding issue. A new proxy provider at the server level assigned a default UA that ov

Categories : Python

How to remove extra digits from user input in currency and how to check if the user entered nothing in asp.net c#?
Try to use regular expressions and look for a pattern of XX.XX , if the input is wrong, then the user must fix the input. private void button1_Click(object sender, EventArgs e) { var pattern = @"^[0-9]*(.[0-9]{1,2})?$"; if(Regex.IsMatch(textBox1.Text, pattern)) MessageBox.Show("Correct Input."); else MessageBox.Show("Wrong Input!"); } Regular Expression

Categories : C#

Check whether user is reached to required latlong or not by using current position of user on map android
You can utilise geofencing api to set a geofence centered at the required position(LatLng) and with a radius based on how much time before reaching the actual point, you need an alert and to compensate for any location inaccuracy.

Categories : Android

Need feedback!! Should enterprise level application can user one user to connect sql server database?
There is no limitation on the number of connections per user. Our website does this. All of our code accesses the database with one SQL Server credential. There is, however, a hard limit on the total number of connections (around 30k) to the instance. We found this out the hard way with hundred of databases and connection pooling from tens of application servers.

Categories : Sql Server

When creating a user by Membership.CreateUser, is there a .NET wrapper that can set the user's address, city, state, zip, etc.?
You can create an another table and use foreign key as UserId i.e. UniqueIdentifier and same used in aspnet_Users table. Using the UserId you can manage all membership tables with this new created table.bcoz asp_net_membership table already linked with aspnet_user table. When the status of membership create user will be success, then create a row in newly created table..

Categories : C#

Standard variable naming convention for the viewing user (as opposed to the user being viewed)
I believe if you select one way, be consistent, and document what each naming convention is for then you have to be satisfied. I had the same problem then I noticed the ambiguity lessened and others on my team started to use those terms. I like "er" and "ee" because the endings are consistent across numerous words, such as payer/payee, employer/employee, and so on. Interesting is http://www.worldwidewords.org/articles/ee.htm. Comments For developers, source and target are nice because they are the same number of characters and we understand the terms. Better is Observee instead of Other for Observer, but it still not right. This / That for C# and My / Their for VB.Net

Categories : Misc

After using CreateProcessAsUser to restore user to session 1, user's path's are no longer accessible
Are you accessing these network locations using mapped drives? Mapped drives are stored with a login session. Since the user's profile is not loaded, they will not have access to their "mapped drives". You can use full UNC paths instead.

Categories : C

Rails: Switch User Gem and issues with switching back to original user
I had similar issues with switch user and its switching back option, so at the end I am trying to implement something by myself. I'm using this as a starting point, I hope it helps you as well.

Categories : Ruby On Rails

How can I redirect a user to the product if the user lands on an image popup in Magento?
There are several options. One you can change magento 'view large' image window with some lightbox plugin that would create popup on the page and not new browser window. This would be not indexed by google. Then you can create rewrite from popup addresses to homepage (or product page). If you want to keep the current way of displaying large images then the only way is to check the referer header and if it is not from your shop redirect customer to the page.

Categories : Image

getting "FacebookAuthorizationException: User logged in as different Facebook user" exception - while updating to get new Permission
see this link There is a bug in facbook sdk,when there is no facebbok app installed on device.When user ask for additional permission,it takes user to the login dialog again.

Categories : Facebook

Reusing returned user inputted value from class without re-requesting input from user
You're calling the method that asks the user for their username. Instead, create a private field in your StaffLogin2 class like this: private String username and set it with the returned value from the user like this: public void username() { this.username = JOptionPane.showInputDialog("Enter Username:"); } Then, reference this field elsewhere with by calling the following getter method, which should be in your StaffLogin2 class: public String getUsername() { return username; } One other thing - if you're intending this app to be used by more than one person at a time, you'll want to lose the "static" modifiers on your methods and instantiate a class. Probably a better practice for something like this anyway.

Categories : Java

How to change Symfony2 security plaintext encoders from User to User Interface
PHP documentation: instanceof is smart enough to know that a class that implements an interface is an instance of the interface SymfonyComponentSecurityCoreUserUserInterface implements AdvancedUserInterface which implements UserInterface. Your problem is not the typeof check in FOSUserBundleControllerProfileController but a wrong firewall configuration or the in-memory user not receiving it's roles correctly!

Categories : Security

Let OneToOneField to User only render one text input (for User.first_name) using a ModelForm
I rewrote the question and adapted the code. The answer can be found here.

Categories : Django



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