Search Results

Search found 4793 results on 192 pages for 'protected'.

Page 3/192 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Best practices to test protected methods with PHPUnit

    - by GrGr
    Hello, I found the discussion on Do you test private method informative. I have decided, that in some classes, I want to have protected methods, but test them. Some of these methods are static and short. Because most of the public methods make use of them, I will probably be able to safely remove the tests later. But for starting with a TDD approach and avoid debugging, I really want to test them. I thought of the following: Method Object as adviced in an answer seems to be overkill for this. Start with public methods and when code coverage is given by higher level tests, turn them protected and remove the tests. Inherit a class with a testable interface making protected methods public Which is best practice? Is there anything else? It seems, that JUnit automatically changes protected methods to be public, but I did not have a deeper look at it. PHP does not allow this via reflection.

    Read the article

  • Outlook 2007 Backup to D:\Outlook Fails - Access Denied, Write-Protected or File In Use

    - by nicorellius
    I can successfully save the Outlook PST file to the default location on the C drive (C:\Documents and Settings\user\ ... \Outlook) but when I change the backup save to directory to Outlook on the D drive I get the error: Cannot copy Outlook: Access is denied. Make sure the disk is not full or write protected and that the file is not currently in use. I suppose it is not that crucial that I save this file here, but I have never seen this problem before and I have made this same change in the past. I did some searching in this knowledge exchange as well as elsewhere on changing permissions, etc, but this didn't help. I discovered that the folder on my D drive (called Outlook) is not write-protected and nor is it read-only, as I can save to and modify files in that directory, as well as rename and delete the directory itself. At the time when I installed this version of Outlook, I used a previously saved Personal Folder (a backup PST file) and I thought having this still open in Outlook was causing the trouble. But I closed it and still have the same problem. I know this is probably a silly error on my part but I would like to figure it out. I'm new to superuser, but the answers I see are usually very good, so I thought I would post my first question. Thanks in advance.

    Read the article

  • allow public access to subfolder of protected folder on apache

    - by UnnamedMook
    I have password-protected the root folder of my website while i do maintenance, but I want to display a custom 401 error page to let people know the site is under construction. Unfortunately, my web host doesn't allow me write access to anything outside the root folder of my website, so this custom error page must by stored in the root folder or one of its subfolders. Instead of my custom error page I get the Apache default error page and it also says "Additionally, a 401 Authorization Required error was encountered while trying to use an ErrorDocument to handle the request." I searched for ways to make a subfolder of a protected directory public, and all I could find was to use the "Satisfy any" directive, but this doesn't work for me. It doesn't work on a file-only basis either, as with the .htaccess file below. #Authorization Restriction AuthType Basic AuthName "Access to root" AuthUserFile ********************************* Require user *********** Order Allow,Deny Satisfy any #Error Documents ErrorDocument 401 Error-401.html #Allow access to error documents <Files Error-*,html> Order Deny,Allow Allow from all Satisfy any </Files> I can only use .htaccess files; I don't have access to httpd.conf

    Read the article

  • What does it means? [c#]

    - by masoud ramezani
    If we define a property as public property and in this property we have a protected getter. what does it means? if property is public, what does defining a protected getter for that, means? please see below code: public ISessionFactory SessionFactory { protected get { return sessionFactory; } set { sessionFactory = value; } }

    Read the article

  • Does nginx auth_basic work over HTTPS?

    - by monde_
    I've been trying to setup a password protected directory in a SSL website as follows: /etc/nginx/sites-available/default server { listen 443: ssl on; ssl_certificate /usr/certs/server.crt; ssl_certificate_key /usr/certs/server.key; server_name server1.example.com; root /var/www/example.com/htdocs/; index index.html; location /secure/ { auth_basic "Restricted"; auth_basic_user_file /var/www/example.com/.htpasswd; } } The problem is when I try to access the URL https://server1.example.com/secure/, I get a "404: Not Found" error page. My error.log shows the following error: 011/11/26 03:09:06 [error] 10913#0: *1 no user/password was provided for basic authentication, client: 192.168.0.24, server: server1.example.com, request: "GET /secure/ HTTP/1.1", host: "server1.example.com" However, I was able to setup password protected directories for a normal HTTP virtual host without any problems. Is it a problem with the config or something else?

    Read the article

  • Spell check doesn't work in protected forms in Word 2011 for Mac

    - by Erin
    We have a form template many staff members use. We created it in Word 2004 for Mac, and I was told a shortcoming was there was no way to turn on the spell checker (a real hassle!). I hoped this would be fixed in 2011, but when I open the form and save it as a .docx, the spell check still doesn't work. Many menu choices, including Language and Spelling and Grammar are grayed. Is there any way to get spell check in a protected, fillable form?

    Read the article

  • How to crack a password protected zip file.

    - by Shadow Frunchak
    I recently downloaded a piece of software that came in a .ZIP archive, but the .EXE software inside of the archive had a password on it. The website that I would have gotten the password from closed a while ago. Because the executable is password protected it cannot be extracted. I'm on Windows 7 Home Premium, and I use winrar for my archives. So, I guess my question is is it possible to crack a password for a file within an archive without extracting it?

    Read the article

  • Common protected data member in base class?

    - by EXP0
    I have a base class and several derived classes. The derived classes use some common data, can I just put those common data as protected member of the base class? I know the protected member breaks encapsulation sometimes, so I wonder if there is any good approach. Here is a specific example: class Base{ public: virtual void foo() = 0; void printData(); protected: std::vector<std::string> mData; } class Dr1 : public Base{ public: virtual void foo(); //could change mData } class Dr2 : public Base{ public: virtual void foo(); //could change mData } If I put mData into Dr1 and Dr2 as private member, then I need to put it in both of them, and I can not have printData() in Base since printData() need access to mData unless I make printData() virtual and have identical function in both Dr1 and Dr2, which doesn't make much sense to me. Is there a better way to approach this without using protected member? Thank you.

    Read the article

  • error: 'void Base::output()' is protected within this context

    - by Bill
    I'm confused about the errors generated by the following code. In Derived::doStuff, I can access Base::output directly by calling it. Why can't I create a pointer to output() in the same context that I can call output()? (I thought protected / private governed whether you could use a name in a specific context, but apparently that is incomplete?) Is my fix of writing callback(this, &Derived::output); instead of callback(this, Base::output) the correct solution? #include <iostream> using std::cout; using std::endl; template <typename T, typename U> void callback(T obj, U func) { ((obj)->*(func))(); } class Base { protected: void output() { cout << "Base::output" << endl; } }; class Derived : public Base { public: void doStuff() { // call it directly: output(); Base::output(); // create a pointer to it: // void (Base::*basePointer)() = &Base::output; // error: 'void Base::output()' is protected within this context void (Derived::*derivedPointer)() = &Derived::output; // call a function passing the pointer: // callback(this, &Base::output); // error: 'void Base::output()' is protected within this context callback(this, &Derived::output); } }; int main() { Derived d; d.doStuff(); }

    Read the article

  • Call a protected method from outside a class in PHP

    - by Chad Johnson
    I have a very special case in which I need to call a protected method from outside a class. I am very conscious about what I do programmingwise, but I would not be entirely opposed to doing so in this one special case I have. In all other cases, I need to continue disallowing access to the internal method, and so I would like to keep the method protected. What are some elegant ways to access a protected method outside of a class? So far, I've found this. I suppose it may be possible create some kind of double-agent instance of the target class that would sneakily provide access to the internals...

    Read the article

  • Can I make controls defined in my markup public instead of protected

    - by RoboShop
    Say I have a web site with a master page and an aspx page. In my ASPX page, I am pointing to my masterpage with the MasterType tag. <%@ MasterType VirtualPath="~/mymasterpage.master" % Say, I've defined a label in the markup of my master page. If you look at the designer code, this label should be something like this. protected global::System.Web.UI.WebControls.Label label1; Now in my content page, I would like to reference this label. If I type in this "Master.label1", the complier will complain that the control is inaccessible due to the protection level" and rightly so, as label1 is automatically defined as "protected". My question is, if I define controls in my markup page, is it possible to set these controls as public instead of protected? I do not see an attribute for it. thanks in advance.

    Read the article

  • Check whether Excel file is Password protected

    - by Torben Klein
    I am trying to open an Excel (xlsm) file via VBA. It may or may not be protected with a (known) password. I am using this code: On Error Resume Next Workbooks.Open filename, Password:=user_entered_pw opened = (Err.Number=0) On Error Goto 0 Now, this works fine if the workbook has a password. But if it is unprotected, it can NOT be opened. Apparently this is a bug in XL2007 if there is also workbook structure protection active. (http://vbaadventures.blogspot.com/2009/01/possible-error-in-excel-2007.html). On old XL2003, supplying a password would open both unprotected and password protected file. I tried: Workbooks.Open filename, Password:=user_entered_pw If (Err.Number <> 0) Then workbooks.open filename This works for unprotected and protected file. However if the user enters a wrong password it runs into the second line and pops up the "enter password" prompt, which I do not want. How to get around this?

    Read the article

  • Check wether Excel file is Password protected

    - by Torben Klein
    I am trying to open an Excel (xlsm) file via VBA. It may or may not be protected with a (known) password. I am using this code: On Error Resume Next Workbooks.Open filename, Password:=user_entered_pw opened = (Err.Number=0) On Error Goto 0 Now, this works fine if the workbook has a password. But if it is unprotected, it can NOT be opened. Apparently this is a bug in XL2007 if there is also workbook structure protection active. (http://vbaadventures.blogspot.com/2009/01/possible-error-in-excel-2007.html). On old XL2003, supplying a password would open both unprotected and password protected file. I tried: Workbooks.Open filename, Password:=user_entered_pw If (Err.Number <> 0) Then workbooks.open filename This works for unprotected and protected file. However if the user enters a wrong password it runs into the second line and pops up the "enter password" prompt, which I do not want. How to get around this?

    Read the article

  • java protected method accessibility

    - by JavaUser
    In the below code the Consumer class can access the protected method of Parent class.How is it possible since there is no relation between Parent and Consumer class.Please explain class Parent { public void method1(){ System.out.println("PUBLIC METHOD"); } private void method2(){ System.out.println("PRIVATE METHOD"); } protected void method3(){ System.out.println("PROTECTED METHOD"); } } public class Consumer { public static void main(String[] args){ Parent parentObj = new Parent(); parentObj.method1(); //parentObj.method2(); parentObj.method3(); } } Thanks

    Read the article

  • mount: cannot remount block device /dev/sda5 read-write, is write-protected

    - by marc.riera
    So, this is it. Everything is working as usual except the disk is read only and dont want to change back. ^_^! thanks. root@NODE02:/tmp# df . Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda5 461490504 179502128 258545928 41% / root@NODE02:/tmp# mount -o rw,remount /dev/sda5 mount: cannot remount block device /dev/sda5 read-write, is write-protected root@NODE02:/tmp# touch helll touch: cannot touch `helll': Read-only file system It's not multipath. It's nothing special. Just a server with ubuntu 9.10. makes no sense for me, does it?

    Read the article

  • Allow from referer for HTTP-basic protected SSL apache site

    - by user64204
    I have an apache site protected by HTTP basic authentication. The authentication is working fine. Now I would like to bypass authentication for users that are coming from a particular website by relying on the HTTP Referer header. Here is the configuration: SetEnvIf Referer "^http://.*.example\.org" coming_from_example_org <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Deny from all Allow from env=coming_from_example_org AuthName "login required" AuthUserFile /opt/http_basic_usernames_and_passwords AuthType Basic Require valid-user Satisfy Any </Directory> This is working fine for HTTP, but failing for HTTPS. My understanding is that in order to inspect the HTTP headers, the SSL handshake must be completed, but apache wants to inspect the <Directory> directives before doing the SSL handshake, even if I place them at the bottom of the configuration file. Q: How could I workaround this issue? PS: I'm not obsessed with the HTTP referer header, I could use other options that would allow users from a known website to bypass authantication.

    Read the article

  • media is write protected when using diskshadow.exe, start-bitstransfer powershell cmdlet

    - by Aaron - Solution Evangelist
    i am trying to use the powershell start-bitstransfer cmdlets to transfer a file i have exposed using a vss snapshot (via diskshadow), but unfortunately i am receiving the following error: Start-BitsTransfer : The media is write protected. At line:1 char:49 + Import-CSV c:\hda1\bits.txt | start-bitstransfer <<<< -transfertype upload -Authentication "Basic" -Credential $cred + CategoryInfo : InvalidOperation: (:) [Start-BitsTransfer], Exception + FullyQualifiedErrorId : StartBitsTransferCOMException,Microsoft.BackgroundIntelligentTransfer.Management.NewBits TransferCommand we really want to utilize the bits endpoint we are attempting to transfer the files to. is there any other way we can go about this (aside from copying the files elsewhere first, unless we can copy one slice at a time and transfer that)?

    Read the article

  • how to stop a driver from running - it self protected and rootkit hidden

    - by Aristos
    I have this serous problem For the first time I can not stop a program from running. Something is on one laptop computer that is run as system legacy driver, and self protected and hidden on service as rootkit. Anything I try to remove fails. When a program or anti toolkit try to remove the hidden registry setting for make it stop I get this error : "a device attached to the system is not functioning" So any idea that can help me stop it from running, or even delete it on start up ? My one limitation is that the hard drive is on a laptop and I can not remove it and attact it to somewhere else. This program not let me, touch the registry, do not let me touch the file, do not let me touch the file, The move on boot fail to delete it, the rootrepeal fail to delete it, the rootkiet reveal from sysinternals fail to reveal it ! everything fails. Do how have any experience on this, or do you have any suggestion how to stop this driver from run ?

    Read the article

  • Is there a way to permanently remove highlighting from editable areas within a protected word docume

    - by CT
    Is there a way to permanently remove highlighting from editable areas within a protected word document? This is in relation to a previous question I had on locking portions of a Word Document located here: http://superuser.com/questions/143860/can-i-lock-or-make-uneditable-portions-of-a-word-document Using this solution, any editable area is highlighted. You can uncheck the Highlight editable area box within the Protect Document bar but if you save and reopen the area is highlighted again. The document is on a network drive. If another user were to open the document it would also be highlighted. Is there anyway to permanently turn this highlighting off so that when a user accesses the document from the network they do not see this highlighting? Using Word 2007.

    Read the article

  • Password protected traffic meter

    - by UncleBob
    Hi first, I have a small problem for which I haven't found a solution yet. I live in Bosnia and share the Internet connection with the landlady, and as is usual in Bosnia, we do not have a flat rate, but a 15 Giga traffic limite. That would actually be more than enough, if the son of the landlady wouldn't be watching videos all the time, so the bills are truning out rather expensive. I have already installed a traffic monitoring program, but he apparently turns it off as soon as he comes close to his limit and then denies that he consumed any more. I therefore need at least a measurement program that is password protected and / or notes in the log when it's been turned off. Even better would be a program that just cuts his access when he exceeds his share, ie a mixture of Traffic meter and Parental Guard. Can someone help me out here?

    Read the article

  • Word 2010, how to update protected document

    - by Seth
    The document has one "Section Break" with e.g. "Text Form Fields" above. To make this Form Field work properly I use "Restrict Editing", allow "Filling in Forms", "Select Sections" and then protect Section 1. Then "Start Enforcing Protection". Now when the document is protected above the Section Break you can't use CTRL-Aand F9 to make an update of the fields, etc. of the document below the Section Break. Is there any solution for this problem?

    Read the article

  • c++ protected pointer member to the same class and access privileges

    - by aajmakin
    Hi, Example code is included at the bottom of the message. I'm puzzled about the protected access specifier in a class. I have define a class node which has a protected string member name string name; and a vector of node pointers vector args; Before I thought that a member function of node could not do args[0]-name but a program that does just this does compile and run. However, now I would like to inherit this class and access the name field in one of the args array pointers from this derived class args[0]-name but this does not compile. When I compile the example code below with the commented sections uncommented, the compiler reports: Compiler output: g++ test.cc -o test test.cc: In member function 'void foo::newnode::print_args2()': test.cc:22: error: 'std::string foo::node::name' is protected test.cc:61: error: within this context Compilation exited abnormally with code 1 at Thu Jun 17 12:40:12 Questions: Why can I access the name field of the node pointers in args in class node, because this is what I would excpect from a similarly defined private field in Java. How can I access those fields from the derived class. Example code: #include <iostream> #include <vector> using namespace std; namespace foo { class node; typedef std::vector<node*> nodes; class node { public: node (string _name); void print_args (); void add_node (node* a); protected: nodes args; string name; }; } foo::node::node (string _name) : args(0) { name = _name; } void foo::node::add_node (node* a) { args.push_back(a); } void foo::node::print_args () { for (int i = 0; i < args.size(); i++) { cout << "node " << i << ": " << args[i]->name << endl; } } // namespace foo // { // class newnode : public node // { // public: // newnode (string _name) : node(_name) {} // void print_args2 (); // protected: // }; // } // void foo::newnode::print_args2 () // { // for (int i = 0; i < args.size(); i++) // { // cout << "node " << i << ": " << args[i]->name << endl; // } // } int main (int argc, char** argv) { foo::node a ("a"); foo::node b ("b"); foo::node c ("c"); a.add_node (&b); a.add_node (&c); a.print_args (); // foo::newnode newa ("newa"); // foo::newnode newb ("newb"); // foo::newnode newc ("newc"); // newa.add_node (&newb); // newa.add_node (&newc); // newa.print_args2 (); return 0; }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >