Search Results

Search found 17567 results on 703 pages for 'non admin'.

Page 13/703 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • non-static variable cannot be referenced from a static context (java)

    - by Greg
    I ask that you ignore all logic.. i was taught poorly at first and so i still dont understand everything about static crap and its killing me. My error is with every single variable that i declare then try to use later inside my methods... i get the non-static variable cannot~~ error I can simply put all the rough coding of my methods inside my cases, and it works but then i cannot use recursion... What i really need is someone to help on the syntax and point me on the right direction of how to have my methods recognize my variables at the top... like compareCount etc thanks public class MyProgram7 { public static void main (String[]args) throws IOException{ Scanner scan = new Scanner(System.in); int compareCount = 0; int low = 0; int high = 0; int mid = 0; int key = 0; Scanner temp; int[]list; String menu, outputString; int option = 1; boolean found = false; // Prompt the user to select an option menu = "\n\t1 Reads file" + "\n\t2 Finds a specific number in the list" + "\n\t3 Prints how many comparisons were needed" + "\n\t0 Quit\n\n\n"; System.out.println(menu); System.out.print("\tEnter your selection: "); option = scan.nextInt(); // Keep reading data until the user enters 0 while (option != 0) { switch (option) { case 1: readFile(); break; case 2: findKey(list,low,high,key); break; case 3: printCount(); break; default: outputString = "\nInvalid Selection\n"; System.out.println(outputString); break; }//end of switch System.out.println(menu); System.out.print("\tEnter your selection: "); option = scan.nextInt(); }//end of while }//end of main public static void readFile() { int i = 0; temp = new Scanner(new File("CS1302_Data7_2010.txt")); while(temp.hasNext()) { list[i]= temp.nextInt(); i++; }//end of while temp.close(); System.out.println("File Found..."); }//end of readFile() public static void findKey() { while(found!=true) { while(key < 100 || key > 999) { System.out.println("Please enter the number you would like to search for? ie 350: "); key = scan.nextInt(); }//end of inside while //base if (low <= high) { mid = ((low+high)/2); if (key == list[mid]) { found = true; compareCount++; }//end of inside if }//end of outside if else if (key < list[mid]) { compareCount++; high = mid-1; findKey(list,low,high,key); }//end of else if else { compareCount++; low = mid+1; findKey(list,low,high,key); }//end of else }//end of outside while }//end of findKey() public static void printCount() { System.out.println("Total number of comparisons is: " + compareCount); }//end of printCount }//end of class

    Read the article

  • Separating admin and frontend sessions in magento

    - by Hugues ALARY
    Hello, Is it possible to have two different memcached server to separate admin sessions of the frontend sessions in magento ? It is actually possible to separate sessions and file cache, but it applies on both admin and frontend, which dissallow to clear, for example, only admin sessions. If you want to clear admin sessions, you have to clear all sessions : admin and frontend. Thanks, Hugues.

    Read the article

  • Possible ways to keep XP admin password encrypted using c#

    - by srk
    My application runs on windows XP restricted user account. The application needs Domain Name, Admin User ID, Admin Password in order to work out with Impersonation class for executing some piece of code with admin privileges. The Admin will also change the Password every 90 days. Due to security reasons, i cannot maintain the admin credentials in my app.config file. What else would be best idea ?

    Read the article

  • What's the best way to customize / add pages to the admin generator?

    - by Guillaume Flandre
    I'm using Symfony 1.4 and Doctrine. My application's backend was built using Symfony's admin generator. It works great when I want to display basic stuff. But tehre's not a lot of documentation on how to enhance it and add new pages. Let's take an example: I want to list published items on one page and to-be-published items on another one. I've used several ways to that in my application but can't figure out what the best way is: playing with filters and then modify templates depending on where you are? creating another module calling a different table_method? some other technique I don't know about? What's the best practice here? How do you guys usually do to customize your admin?

    Read the article

  • How do I flag only one of the formsets in django admin ?

    - by azuer88
    I have these (simplified) models: class Question(models.Model): question = models.CharField(max_length=60) class Choices(models.Model): question = models.ForeignKey(Question) text = models.CharField(max_length=60) is_correct = models.BooleanField(default=False) I've made Choices as an inline of Question (in admin). Is there a way to make sure that only one Choice will have is_correct = True? Ideally, is_correct will be displayed as a radio button when it is displayed in the admin formset (TabularInline). My first solution was to override the validation of the formset but did understand how to do this. (is_correct is displayed as checkbox, and I'd display an error that only one is_correct should be selected.)

    Read the article

  • How can I call model methods or properties from Django Admin?

    - by kg
    Is there a natural way to display model methods or properties in the Django admin site? In my case I have base statistics for a character that are part of the model, but other things such as status effects which affect the total calculation for that statistic: class Character(models.Model): base_dexterity = models.IntegerField(default=0) @property def dexterity(stat_name): total = self.base_dexterity total += sum(s.dexterity for s in self.status.all()]) return total It would be nice if I could display the total calculated statistic alongside the field to change the base statistic in the Change Character admin page, but it is not clear to me how to incorporate that information into the page.

    Read the article

  • How to allow sorting in the Django admin by a custom list_display field, which doesn't have a DB fie

    - by Gj
    I have a custom list_display field which is responsible for a column of integers in one of my admin pages. I need to allow staff members to sort according to it. There's a solution for how to acheive that if the integer represents a count/average/etc of some DB field, which is not the case for me. [ the solution for that case is here: http://stackoverflow.com/questions/2168475/django-admin-how-to-sort-by-one-of-the-custom-list-display-fields-that-has-no-da ] Any ideas how I can achieve this sorting without actually creating and maintaining a DB field for the values?

    Read the article

  • How To Collapse Just One Field in Django Admin?

    - by Apreche
    The django admin allows you to specify fieldsets. You properly structure a tuple that groups different fields together. You can also specify classes for certain groups of fields. One of those classes is collapse, which will hide the field under a collapsable area. This is good for hiding rarely used or advanced fields to keep the UI clean. However, I have a situation where I want to hide just one lonesome field on many different apps. This will be a lot of typing to create a full fieldset specification in every admin.py file just to put one field into the collapsed area. It also creates a difficult maintenance situation because I will have to edit the fieldset every time I edit the associated model. I can easily exclude the field entirely using the exclude option. I want something similar for collapse. Is this possible?

    Read the article

  • Showing custom model validation exceptions in the Django admin site.

    - by Guy Bowden
    I have a booking model that needs to check if the item being booked out is available. I would like to have the logic behind figuring out if the item is available centralised so that no matter where I save the instance this code validates that it can be saved. At the moment I have this code in a custom save function of my model class: def save(self): if self.is_available(): # my custom check availability function super(MyObj, self).save() else: # this is the bit I'm stuck with.. raise forms.ValidationError('Item already booked for those dates') This works fine - the error is raised if the item is unavailable, and my item is not saved. I can capture the exception from my front end form code, but what about the Django admin site? How can I get my exception to be displayed like any other validation error in the admin site?

    Read the article

  • What is a Non-Functional Requirement?

    - by atconway
    In my breakdown of work I have to define work against 'Functional' and 'Non-Functional' design elements / work in my applications. I read the description from Wikipedia here: https://en.wikipedia.org/wiki/Non-functional_requirement but as typical the description did not speak exactly to me to clear up my understanding. Can someone please explain in terms of an example when creating an application from scratch, what would be defined as a 'Non-Functional' requirement?

    Read the article

  • A Bite With No Teeth&ndash;Demystifying Non-Compete Clauses

    - by D'Arcy Lussier
    *DISCLAIMER: I am not a lawyer and this post in no way should be considered legal advice. I’m also in Canada, so references made are to Canadian court cases. I received a signed letter the other day, a reminder from my previous employer about some clauses associated with my employment and entry into an employee stock purchase program. So since this is in effect for the next 12 months, I guess I’m not starting that new job tomorrow. I’m kidding of course. How outrageous, how presumptuous, pompous, and arrogant that a company – any company – would actually place these conditions upon an employee. And yet, this is not uncommon. Especially in the IT industry, we see time and again similar wording in our employment agreements. But…are these legal? Is there any teeth behind the threat of the bite? Luckily, the answer seems to be ‘No’. I want to highlight two cases that support this. The first is Lyons v. Multari. In a nutshell, Dentist hires younger Dentist to be an associate. In their short, handwritten agreement, a non-compete clause was written stating “Protective Covenant. 3 yrs. – 5mi” (meaning you can’t set up shop within 5 miles for 3 years). Well, the young dentist left and did start an oral surgery office within 5 miles and within 3 years. Off to court they go! The initial judge sided with the older dentist, but on appeal it was overturned. Feel free to read the transcript of the decision here, but let me highlight one portion from section [19]: The general rule in most common law jurisdictions is that non-competition clauses in employment contracts are void. The sections following [19] explain further, and discuss Elsley v. J.G. Collins Insurance Agency Ltd. and its impact on Canadian law in this regard. The second case is Winnipeg Livestock Sales Ltd. v. Plewman. Desmond Plewman is an auctioneer, and worked at Winnipeg Livestock Sales. Part of his employment agreement was that he could not work for a competitor for 18 months if he left the company. Well, he left, and took up an important role in a competing company. The case went to court and as with Lyons v. Multari, the initial judge found in favour of the plaintiffs. Also as in the first case, that was overturned on appeal. Again, read through the transcript of the decision, but consider section [28]: In other words, even though Plewman has a great deal of skill as an auctioneer, Winnipeg Livestock has no proprietary interest in his professional skill and experience, even if they were acquired during his time working for Winnipeg Livestock.  Thus, Winnipeg Livestock has the burden of establishing that it has a legitimate proprietary interest requiring protection.  On this key question there is little evidence before the Court.  The record discloses that part of Plewman’s job was to “mingle with the … crowd” and to telephone customers and prospective customers about future prospects for the sale of livestock.  It may seem reasonable to assume that Winnipeg Livestock has a legitimate proprietary interest in its customer connections; but there is no evidence to indicate that there is any significant degree of “customer loyalty” in the business, as opposed to customers making choices based on other considerations such as cost, availability and the like. So are there any incidents where a non-compete can actually be valid? Yes, and these are considered “exceptional” cases, meaning that the situation meets certain circumstances. Michael Carabash has a great blog series discussing the above mentioned cases as well as the difference between a non-compete and non-solicit agreement. He talks about the exceptional criteria: In summary, the authorities reveal that the following circumstances will generally be relevant in determining whether a case is an “exceptional” one so that a general non-competition clause will be found to be reasonable: - The length of service with the employer. - The amount of personal service to clients. - Whether the employee dealt with clients exclusively, or on a sustained or     recurring basis. - Whether the knowledge about the client which the employee gained was of a   confidential nature, or involved an intimate knowledge of the client’s   particular needs, preferences or idiosyncrasies. - Whether the nature of the employee’s work meant that the employee had   influence over clients in the sense that the clients relied upon the employee’s   advice, or trusted the employee. - If competition by the employee has already occurred, whether there is   evidence that clients have switched their custom to him, especially without   direct solicitation. - The nature of the business with respect to whether personal knowledge of   the clients’ confidential matters is required. - The nature of the business with respect to the strength of customer loyalty,   how clients are “won” and kept, and whether the clientele is a recurring one. - The community involved and whether there were clientele yet to be exploited   by anyone. I close this blog post with a final quote, one from Zvulony & Co’s blog post on this subject. Again, all of this is not official legal advice, but I think we can see what all these sources are pointing towards. To answer my earlier question, there’s no teeth behind the threat of the bite. In light of this list, and the decisions in Lyons and Orlan, it is reasonably certain that in most employment situations a non-competition clause will be ineffective in protecting an employer from a departing employee who wishes to compete in the same business. The Courts have been relatively consistent in their position that if a non-solicitation clause can protect an employer’s interests, then a non-competition clause is probably unreasonable. Employers (or their solicitors) should avoid the inclination to draft restrictive covenants in broad, catch-all language. Or in other words, when drafting a restrictive covenant – take only what you need! D

    Read the article

  • Inserting default "admin" user into database during Rails App startup

    - by gbc
    I'm building my first real rails application for a little in-house task. Most of the application tasks require authentication/authorization. The first time the app starts up (or starts with a wiped db), I'd like the process to be: User logs into the admin panel using "admin" & "admin" for authentication info. User navigates to admin credentials editing page and changes name and password to something safer so that "admin" & "admin" is no longer a valid login. To achieve this result, I'd like to stuff a default username & password combination into the database on if the application starts up and detects that there are no user credentials in the 'users' table. For example: if User.count == 0 User.create(:name => "admin", :password => "admin") end However, I'm unsure where to place that code. I tried adding an initializer script in the config/initializers, but the error I received appeared to indicate that the model classes weren't yet loaded into the application. So I'm curious to know at what point I can hook into the application startup cycle and insert data into the database through ActiveRecord before requests are dispatched.

    Read the article

  • Regain Sudo rights after removing from admin group

    - by berkes
    Hello, I accidentally removed myself from the admin group when editing the user. Now I can no longer use sudo. The error says: ber is not in the sudoers file. This incident will be reported. I booted up in rescue mode, but, when going into root prompt, it asks me for the root password. I don't have one, and providing with my own (first and only ubuntu-user) password, it won't allow entrance. My harddisk is encrypted, but only the /home/user part, not the entire disk, afaik. What can I do?

    Read the article

  • Windows : Désactiver les privilèges d'admin sécuriserait les ordinateurs, en empêchant l'installatio

    Désactiver les privilèges d'admin sécuriserait les ordinateurs, en empêchant l'installation de malwares Une étude orchestrée par BeyondTrust s'est penchée sur les failles de sécurité atteignant les systèmes Microsoft. Elle montre que les dangers des vulnérabilités peuvent être minimisés si les utilisateurs concernés attendent que les administrateurs des systèmes y appliquent les patchs mensuels fournis par Microsoft. La découverte clé de ce travail est le fait qu'un système soit plus sûr si les droits d'administrateur sont supprimés. Ces droits permettent à un individu d'endosser le rôle de responsable du système, et de l'administrer. Il peut alors contrôler quels logiciels et composants peuvent être ...

    Read the article

  • Admin user runs slower than the guest account

    - by Mykid
    My user is the Admin, it runs fine, not bugs or anything, I used Ubuntu Tweak for a few things like logging options and the sidebar and Unity Tweak for hotcornes and minimize window and that's about it. My second user (for my mother) is faster. I don't know how or why. Let me know what I need to enter on the terminal to give you more info, if you think it's normal also let me know. I have a Compaq Presario CQ56, Ubuntu 14.04 64bit dual boot with Windows 7 Premium, 3GB of ram DDR3, Celeron(R) Dual-Core CPU T3500 @ 2.10GHz × 2.

    Read the article

  • Great non-obvious java tricks

    - by folone
    Consider having a class: public class Test { public static void main(String [] args) { for (int i = 0; i < args.length; i++) { System.out.println(args[i]); } } } What happens if you run it: java Test *? Answer: it prints out all the filenames in current directory. Got more such tricks?

    Read the article

  • Modifying a const through a non-const pointer

    - by jasonline
    I'm a bit confused what happened in the following code: const int e = 2; int* w = ( int* ) &e; // (1) cast to remove const-ness *w = 5; // (2) cout << *w << endl; // (3) outputs 5 cout << e << endl; // (4) outputs 2 cout << "w = " << w << endl; // (5) w points to the address of e cout << "&e = " << &e << endl; In (1), w points to the address of e. In (2), that value was changed to 5. However, when the values of *w and e were displayed, their values are different. But if you print value of w pointer and &e, they have the same value/address. How come e still contained 2, even if it was changed to 5? Were they stored in a separate location? Or a temporary? But how come the value pointed by w is still the address of e?

    Read the article

  • Doctrine Searchable with non-ASCII characters

    - by oyerli
    Hi, I have text in Turkish language: "selam günaydin". Doctrine searchable converts it to keywords in table: -selam -guenaydin So "guenaydin" was saved in table as keyword "günaydin" so when somebody writes in search "günaydin" he gets nothing - what can I do?

    Read the article

  • Performing non-blocking requests? - Django

    - by RadiantHex
    Hi folks, I have been playing with other frameworks, such as NodeJS, lately. I love the possibility to return a response, and still being able to do further operations. e.g. def view(request): do_something() return HttpResponse() do_more_stuff() #not possible!!! Maybe Django already offers a way to perform operations after returning a request, if that is the case that would be great. Help would be very much appreciated! =D

    Read the article

  • Non-english domain naming issues in programming

    - by Svend
    Most programming code, I imagine is written in english. But I'm curious how people handling the issue of naming herein. Alot of programming is done within some bussiness domain, usually with well established terms for certain procedures, items. I'm from Denmark for instance, and something I work alot with has a term called "indblikskode", which sorta translates to "insight code". So, do I use the line "string indblikskode = ..." in the C# code for some webservice related to this? Or do I try to use a translation, such as "insightcode"? The bussiness I'm in isn't even consistent in it's language, for instance using the term "organisatorisk enhed" (organizatorical unit), but just as often using the abbreviation "OU", which is obviously abbreviated from the english. How do other people handle this naming issue, while keeping consistent, and sane (in everything from simple variable names in your code, to database tables, to server names)? Duplicates: Should identifiers and comments be always in English or in the native language of the application and developers? Do you use another language instead of english ?

    Read the article

  • Select fields containing at least one non-space alphanumeric character

    - by zzapper
    (Sorry I know this is an old chestnut; I have found similar answers here but not an exact answer) These are frequent hand written queries from a console so I is what I am looking for is the easiest thing to type SELECT * FROM tbl_loyalty_card WHERE CUSTOMER_ID REGEXP "[0-9A-Z]"; or SELECT * FROM tbl_loyalty_card WHERE LENGTH(CUSTOMER_ID) >0; -- could match spaces Do you have anything quicker to type even if it's QAD?

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >