Search Results

Search found 874 results on 35 pages for 'scanner'.

Page 11/35 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • What library to use to create a simple port scanner?

    - by durje
    I need advise to create a simple port-scanner, who will need to detect if some specific devices are connected to the network from theire IP/MAC address. I am working on windows 7 and can use preferably C++ Builder 2010 Embarcadero, or java or Qt. The library have to be under a public domain or equivalent, as my software is a proprietary software. What library would you advice? Do you know any free software that I could start from, or any examples? What about using Indy Sockets or Synapse TCP/IP Librarys? Thanks in advance.

    Read the article

  • External USB Fingerprint Reader for Pre-boot Authentication for Dell Laptop

    - by cop1152
    My company just purchased several Dell Latitude E6500 laptops with docking stations and external monitors. These laptops have a fingerprint scanner located next to the keyboard. DOCKED users who prefer to use the included fingerprint scanner for pre-boot authentication are forced to open their laptop in order to access the scanner. This is an inconvenience when the laptop is docked. We are looking for an external, usb fingerprint scanner, that will work with the current preboot authentication setup. I assume that this scanner would have to access the existing credentials for authentication....wherever they are stored. So we would require something that would work PRE-BOOT, use the existing credentials, and not interfere with usage when the machine was not docked, such as when the laptop is being used at home. Does anyone have experience with this scenario? Thanks.

    Read the article

  • Storing strings from a text file/scanner. Array or built-in?

    - by Flowdorio
    This code snippet is to to read a text file, turn the lines into objects through a different public (non changeable) class(externalClass). The external class does nothing but turn strings (lines from the .txt through nextLine) into objects, and is fully functional. The scanner(scanner3) is assigned to the text file. while (scanner3.hasNext()) { externalClass convertedlines = new externalClass(scanner3.nextLine()); I'm not new to programming, but as I'm new to java, I do not know if this requires me to create an array, or if the returned objects are sorted in some other way. i.e is the "importedlines" getting overwritten with each run of the loop(and I need to introduce an array into the loop), or are the objects stored in some way? The question may seem strange, but with the program I am making it would be harder (but definitely not impossible) if I used an array. Any help would be appreciated. As requested, externalClass: public class exernalClass { private String line; externalClass(String inLine){ line = inLine; } public String giveLine() { return line; } }

    Read the article

  • How to stop calling the Activity again when device orientation is changed??

    - by user1460323
    My app uses Barcode Scanner. I want to launch the scanner when I open the app so I have it in the onCreate method. The problem is that if I have it like that, when I turn the device it calls again onCreate and calls another scanner. Also I have the first activity that calls the scanner. it has a menu so if he user presses back, it goes to that menu. If I turn the screen on that menu, it goes to barcode scanner again. To solve it I have a flag that indicates if it is the first time I call the scanner, if it's not I don't call it again. Now the problem is that if I go out of the app and go in again it doesn't go to the scanner, it goes to the menu, becasuse is not the first time I call it. Any ideas?? Is there a way to change the flag when I go out of my main activity or any other solution?? My code. private static boolean first = true; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); integrator = new IntentIntegrator(this); if (first) { first = false; integrator.initiateScan(); } }

    Read the article

  • How can I stop SipVicious ('friendly-scanner') from flooding my SIP server?

    - by a1kmm
    I run an SIP server which listens on UDP port 5060, and needs to accept authenticated requests from the public Internet. The problem is that occasionally it gets picked up by people scanning for SIP servers to exploit, who then sit there all day trying to brute force the server. I use credentials that are long enough that this attack will never feasibly work, but it is annoying because it uses up a lot of bandwidth. I have tried setting up fail2ban to read the Asterisk log and ban IPs that do this with iptables, which stops Asterisk from seeing the incoming SIP REGISTER attempts after 10 failed attempts (which happens in well under a second at the rate of attacks I'm seeing). However, SipVicious derived scripts do not immediately stop sending after getting an ICMP Destination Host Unreachable - they keep hammering the connection with packets. The time until they stop is configurable, but unfortunately it seems that the attackers doing these types of brute force attacks generally set the timeout to be very high (attacks continue at a high rate for hours after fail2ban has stopped them from getting any SIP response back once they have seen initial confirmation of an SIP server). Is there a way to make it stop sending packets at my connection?

    Read the article

  • How do you get Matlab to write the BOM (byte order markers) for UTF-16 text files?

    - by Richard Povinelli
    I am creating UTF16 text files with Matlab, which I am later reading in using Java. In Matlab, I open a file called fileName and write to it as follows: fid = fopen(fileName, 'w','n','UTF16-LE'); fprintf(fid,"Some stuff."); In Java, I can read the text file using the following code: FileInputStream fileInputStream = new FileInputStream(fileName); Scanner scanner = new Scanner(fileInputStream, "UTF-16LE"); String s = scanner.nextLine(); Here is the hex output: Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 00000000 73 00 6F 00 6D 00 65 00 20 00 73 00 74 00 75 00 66 00 66 00 s.o.m.e. .s.t.u.f.f. The above approach works fine. But, I want to be able to write out the file using UTF16 with a BOM to give me more flexibility so that I don't have to worry about big or little endian. In Matlab, I've coded: fid = fopen(fileName, 'w','n','UTF16'); fprintf(fid,"Some stuff."); In Java, I change the code to: FileInputStream fileInputStream = new FileInputStream(fileName); Scanner scanner = new Scanner(fileInputStream, "UTF-16"); String s = scanner.nextLine(); In this case, the string s is garbled, because Matlab is not writing the BOM. I can get the Java code to work just fine if I add the BOM manually. With the added BOM, the following file works fine. Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 00000000 FF FE 73 00 6F 00 6D 00 65 00 20 00 73 00 74 00 75 00 66 00 66 00 ÿþs.o.m.e. .s.t.u.f.f. How can I get Matlab to write out the BOM? I know I could write the BOM out separately, but I'd rather have Matlab do it automatically. Addendum I selected the answer below from Amro because it exactly solves the question I posed. One key discovery for me was the difference between the Unicode Standard and a UTF (Unicode transformation format) (see http://unicode.org/faq/utf_bom.html). The Unicode Standard provides unique identifiers (code points) for characters. UTFs provide mappings of every code point "to a unique byte sequence." Since all but a handful of the characters I am using are in the first 128 code points, I'm going to switch to using UTF-8 as Romeo suggests. UTF-8 is supported by Matlab (The warning shown below won't need to be suppressed.) and Java, and for my application will generate smaller text files. I suppress the Matlab warning Warning: The encoding 'UTF-16LE' is not supported. with warning off MATLAB:iofun:UnsupportedEncoding;

    Read the article

  • Why do I have a dependency to gwt?

    - by stacker
    In a seam-gen generated application the following exception is thrown during deployment: ERROR [LoadMgr3] Not resheduling failed loading task, loadTask=org.jboss.mx.loading.ClassLoadingTask@8c5c9c{classname: org.jboss.seam.remoting.gwt.GWT14Service, requestingThread: Thread[ScannerThread,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@3e4532{ url=f ile:/C:/dev/jboss-4.3.0.GA/server/default/deploy/myapp.ear/ ,addedOrder=50}, loadedClass: nullnull, loadOrder: 2147483647, loadException: java.lang.NoClassDefFoundError: com/google/gwt/user/server/rpc/SerializationPolicyProvider, threadTaskCount: 0, state: 1, #CCE: 1} java.lang.NoClassDefFoundError: com/google/gwt/user/server/rpc/SerializationPolicyProvider at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) ... at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) The problem (and workaround) is described here. Since I don't use gwt, my question is why do I have this dependency when I'm not using gwt at all? Seam version 2.1.2

    Read the article

  • NSScanner scanFloat returning unexpected results

    - by E-Madd
    I'm trying to build a UIColor from a comma-delimited list of values for RGB, which is "0.45,0.53,0.65", represented here by the colorConfig object... NSScanner *scanner = [NSScanner scannerWithString:colorConfig]; [scanner setCharactersToBeSkipped:[NSCharacterSet characterSetWithCharactersInString:@"\n, "]]; float red, green, blue; return [UIColor colorWithRed:[scanner scanFloat:&red] green:[scanner scanFloat:&green] blue:[scanner scanFloat:&blue] alpha:1]; But my color is always coming back as black. So I logged the values to my console and I'm seeing Red = -1.988804, Green = -1.988800, Blue = -1.988796 What am I doing wrong?

    Read the article

  • Write problem - lossing the original data

    - by John
    Every time I write to the text file I will lose the original data, how can I read the file and enter the data in the empty line or the next line which is empty? public void writeToFile() { try { output = new Formatter(myFile); } catch(SecurityException securityException) { System.err.println("Error creating file"); System.exit(1); } catch(FileNotFoundException fileNotFoundException) { System.err.println("Error creating file"); System.exit(1); } Scanner scanner = new Scanner (System.in); String number = ""; String name = ""; System.out.println("Please enter number:"); number = scanner.next(); System.out.println("Please enter name:"); name = scanner.next(); output.format("%s,%s \r\n", number, name); output.close(); }

    Read the article

  • I have applied a check for not allowing alphabets.But its not working.....

    - by bhavna raghuvanshi
    import java.util.Scanner; public class Main extends Hashmap{ public static void main(String[] args) { Hashmap hm = new Hashmap(); int x=0; Scanner input = new Scanner(System.in); do{ System.out.print("Enter any integer value between 1 to 12: "); x = input.nextInt(); }while(x<=0 || x>12); Scanner sc = new Scanner(System.in); //int number; do { while (!sc.hasNextInt()) { System.out.println("That's not a number!"); sc.next(); } x = sc.nextInt(); }while(x>=0); String month = hm.getEntry(x); System.out.println(month); } } here I need to restrict user from entering an alphabet.But its not working. pls help...

    Read the article

  • Is ther anyone familiar with Erica Sadun's APIKit(app private api scanner)?

    - by user262325
    Hello everyone I'm trying to use APIKit to scan my codes to detect if there is private API. apiscanner should run as ./apiscanner ~/Desktop/MyPath/myapp.app I used command 'cd' go to the directory where apiscanner is. But if I call ./apiscanner ~/Desktop/MyPath/MyApp.app on terminal it reports Last login: Sun Jun 13 07:22:07 on ttys002 unknown required load command 0x80000022 Trace/BPT trap logout Even if I copy the files apiscanner and doit to MyPath, then execute, I get the same problem. I think there is something wrong when I run apiscanner under Mac OS X. Welcome any comment Thanks

    Read the article

  • Broken console in Maven project using Netbeans

    - by Maciek Sawicki
    Hi, I have strange problem with my Neatens+Maven installation. This is the shortest code to reproduce the problem: public class App { public static void main( String[] args ) { // Create a scanner to read from keyboard Scanner scanner = new Scanner (System.in); Scanner s= new Scanner(System.in); String param= s.next(); System.out.println(param); } } When I'm running it as Maven Project inside Netbeans console seems to be broken. It just ignores my input. It's look like infinitive loop in System.out.println(param);. However this project works fine when it's compiled as "Java Aplication" project. It also works O.K. if I build and run it from cmd. System info: Os: Vista IDE: Netbeans 6.8 Maven: apache-maven-2.2.1 //edit Built program (using mavean from Netbeans) works fine. I just can't test it using Net beans. And I think I forgot to ask the question ;). So of course my first question is: how can I fix this problem? And second is: Is it any workaround for this? For example configuring Netbeans to run external commend line app instead of using built in console.

    Read the article

  • Check if TIFF file is complete

    - by Davi
    I have a FileSystemWatcher monitoring a directory that receives TIF files from a scanning device. Its necessary to check if the scanning process is done and then read a multipage TIF file, otherwise, the FileSystemWatcher will raise the event before the file be fully scanned. I have something like: private void OnFileCreated(...) { while(IsFileLocked(path)) Thread.Sleep(time); // OK to read } This is what is happening: - Scanner creates the file - FileSystemWatcher detects the file, but its in use - Scanner reads the first page to the file - Scanner releases the file - My code leaves the while(FileInUse(path)) - My code reads the incomplete file (problem) - Scanner adds more pages to the file Let's say the scanner is scanning 100 pages, then, when "OK to read", the file will be incomplete (99 pages left). So, its necessary to know if the file is complete or not. Maybe waiting some time to see if the file is modified, but this time span can be up to hours, because the scanner can get idle scanning the same TIF. Other solution would be checking some flag in the TIF file that indicates that the file is not complete(I've looked for this but don't found anything).

    Read the article

  • Java Regex for matching hexadecimal numbers in a file

    - by Ranman
    So I'm reading in a file (like java program < trace.dat) which looks something like this: 58 68 58 68 40 c 40 48 FA If I'm lucky but more often it has several whitespace characters before and after each line. These are hexadecimal addresses that I'm parsing and I basically need to make sure that I can get the line using a scanner, buffered reader... whatever and make sure I can then convert the hexadecimal to an integer. This is what I have so far: Scanner scanner = new Scanner(System.in); int address; String binary; Pattern pattern = Pattern.compile("^\\s*[0-9A-Fa-f]*\\s*$", Pattern.CASE_INSENSITIVE); while(scanner.hasNextLine()) { address = Integer.parseInt(scanner.next(pattern), 16); binary = Integer.toBinaryString(address); //Do lots of other stuff here } //DO MORE STUFF HERE... So I've traced all my errors to parsing input and stuff so I guess I'm just trying to figure out what regex or approach I need to get this working the way I want.

    Read the article

  • Strange behaviour of NSScanner on simple whitespace removal

    - by Michael Waterfall
    I'm trying to replace all multiple whitespace in some text with a single space. This should be a very simple task, however for some reason it's returning a different result than expected. I've read the docs on the NSScanner and it seems like it's not working properly! NSScanner *scanner = [[NSScanner alloc] initWithString:@"This is a test of NSScanner !"]; NSMutableString *result = [[NSMutableString alloc] init]; NSString *temp; NSCharacterSet *whitespace = [NSCharacterSet whitespaceCharacterSet]; while (![scanner isAtEnd]) { // Scan upto and stop before any whitespace [scanner scanUpToCharactersFromSet:whitespace intoString:&temp]; // Add all non whotespace characters to string [result appendString:temp]; // Scan past all whitespace and replace with a single space if ([scanner scanCharactersFromSet:whitespace intoString:NULL]) { [result appendString:@" "]; } } But for some reason the result is @"ThisisatestofNSScanner!" instead of @"This is a test of NSScanner !". If you read through the comments and what each line should achieve it seems simple enough!? scanUpToCharactersFromSet should stop the scanner just as it encounters whitespace. scanCharactersFromSet should then progress the scanner past the whitespace up to the non-whitespace characters. And then the loop continues to the end. What am I missing or not understanding?

    Read the article

  • String literal recognition problem

    - by helicera
    Hello! I'm trying to recognize string literal by reading string per symbol. Here is a sample code: #region [String Literal (")] case '"': // {string literal ""} { // skipping '"' ChCurrent = Line.ElementAtOrDefault<Char>(++ChPosition); while(ChCurrent != '"') { Value.Append(ChCurrent); ChCurrent = Line.ElementAtOrDefault<Char>(++ChPosition); if(ChCurrent == '"') { // "" sequence only acceptable if(Line.ElementAtOrDefault<Char>(ChPosition + 1) == '"') { Value.Append(ChCurrent); // skip 2nd double quote ChPosition++; // move position next ChCurrent = Line.ElementAtOrDefault<Char>(++ChPosition); } } else if(default(Char) == ChCurrent) { // message: unterminated string throw new ScanningException(); } } ChPosition++; break; } #endregion When I run test: [Test] [ExpectedException(typeof(ScanningException))] public void ScanDoubleQuotedStrings() { this.Scanner.Run(@"""Hello Language Design""", default(System.Int32)); this.Scanner.Run(@"""Is there any problems with the """"strings""""?""", default(System.Int32)); this.Scanner.Run(@"""v#:';?325;.<>,|+_)""(*&^%$#@![]{}\|-_=""", default(System.Int32)); while(0 != this.Scanner.TokensCount - 1) { Assert.AreEqual(Token.TokenClass.StringLiteral, this.Scanner.NextToken.Class); } } It passes with success.. while I'm expecting to have an exception according to unmatched " mark in this.Scanner.Run(@"""v#:';?325;.<>,|+_)""(*&^%$#@![]{}\|-_=""", default(System.Int32)); Can anyone explain where is my mistake or give an advice on algorithm.

    Read the article

  • Pass NSURL from One Class To Another

    - by user717452
    In my appDelegate in didFinishLaunchingWithOptions, I have the following: NSURL *url = [NSURL URLWithString:@"http://www.thejenkinsinstitute.com/Journal/"]; NSString *content = [NSString stringWithContentsOfURL:url]; NSString * aString = content; NSMutableArray *substrings = [NSMutableArray new]; NSScanner *scanner = [NSScanner scannerWithString:aString]; [scanner scanUpToString:@"<p>To Download the PDF, " intoString:nil]; // Scan all characters before # while(![scanner isAtEnd]) { NSString *substring = nil; [scanner scanString:@"<p>To Download the PDF, <a href=\"" intoString:nil]; // Scan the # character if([scanner scanUpToString:@"\"" intoString:&substring]) { // If the space immediately followed the #, this will be skipped [substrings addObject:substring]; } [scanner scanUpToString:@"" intoString:nil]; // Scan all characters before next # } // do something with substrings NSString *URLstring = [substrings objectAtIndex:0]; self.theheurl = [NSURL URLWithString:URLstring]; NSLog(@"%@", theheurl); [substrings release]; The console printout for theheurl gives me a valid URL ending in .pdf. In the class I would like to load the URL, I have the following: - (void)viewWillAppear:(BOOL)animated { _appdelegate.theheurl = currentURL; NSLog(@"%@", currentURL); NSLog(@"%@", _appdelegate.theheurl); [worship loadRequest:[NSURLRequest requestWithURL:currentURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60.0]]; timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0) target:self selector:@selector(tick) userInfo:nil repeats:YES]; [super viewWillAppear:YES]; } However, both NSLogs in that class come back null. What am I Doing wrong in getting the NSURL from the AppDelegate to the class to load it?

    Read the article

  • print a linear linked list into a table

    - by user1796970
    I am attempting to print some values i have stored into a LLL into a readable table. The data i have stored is the following : DEBBIE STARR F 3 W 1000.00 JOAN JACOBUS F 9 W 925.00 DAVID RENN M 3 H 4.75 ALBERT CAHANA M 3 H 18.75 DOUGLAS SHEER M 5 W 250.00 SHARI BUCHMAN F 9 W 325.00 SARA JONES F 1 H 7.50 RICKY MOFSEN M 6 H 12.50 JEAN BRENNAN F 6 H 5.40 JAMIE MICHAELS F 8 W 150.00 i have stored each firstname, lastname, gender, tenure, payrate, and salary into their own List. And would like to be able to print them out in the same format that they are viewed on the text file i read them in from. i have messed around with a few methods that allow me to traverse and print the Lists, but i end up with ugly output. . . here is my code for the storage of the text file and the format i would like to print out: public class Payroll { private LineWriter lw; private ObjectList output; ListNode input; private ObjectList firstname, lastname, gender, tenure, rate, salary; public Payroll(LineWriter lw) { this.lw = lw; this.firstname = new ObjectList(); this.lastname = new ObjectList(); this.gender = new ObjectList(); this.tenure = new ObjectList(); this.rate = new ObjectList(); this.salary = new ObjectList(); this.output = new ObjectList(); this.input = new ListNode(); } public void readfile() { File file = new File("payfile.txt"); try{ Scanner scanner = new Scanner(file); while(scanner.hasNextLine()) { String line = scanner.nextLine(); Scanner lineScanner = new Scanner(line); lineScanner.useDelimiter("\\s+"); while(lineScanner.hasNext()) { firstname.insert1(lineScanner.next()); lastname.insert1(lineScanner.next()); gender.insert1(lineScanner.next()); tenure.insert1(lineScanner.next()); rate.insert1(lineScanner.next()); salary.insert1(lineScanner.next()); } } }catch(FileNotFoundException e) {e.printStackTrace();} } public void printer(LineWriter lw) { String msg = " FirstName " + " LastName " + " Gender " + " Tenure " + " Pay Rate " + " Salary "; output.insert1(msg); System.out.println(output.getFirst()); System.out.println(" " + firstname.getFirst() + " " + lastname.getFirst() + "\t" + gender.getFirst() + "\t" + tenure.getFirst() + "\t" + rate.getFirst() + "\t" + salary.getFirst()); } }

    Read the article

  • Some more multitasking java issues

    - by owca
    I had a task to write simple game simulating two players picking up 1-3 matches one after another until the pile is gone. I managed to do it for computer choosing random value of matches but now I'd like to go further and allow humans to play the game. Here's what I already have : http://paste.pocoo.org/show/200660/ Class Player is a computer player, and PlayerMan should be human being. Problem is, that thread of PlayerMan should wait until proper value of matches is given but I cannot make it work this way. When I type the values it sometimes catches them and decrease amount of matches but that's not exactly what I was up to :) Logics is : I check the value of current player. If it corresponds to this of the thread currently active I use scanner to catch the amount of matches. Else I wait one second (I know it's kinda harsh solution, but I have no other idea how to do it). Class Shared keeps the value of current player, and also amount of matches. By the way, is there any way I can make Player and Shared attributes private instead of public and still make the code work ? CONSOLE and INPUT-DIALOG is just for choosing way of inserting values. class PlayerMan extends Player{ static final int CONSOLE=0; static final int INPUT_DIALOG=1; private int input; public PlayerMan(String name, Shared data, int c){ super(name, data); input = c; } @Override public void run(){ Scanner scanner = new Scanner(System.in); int n = 0; System.out.println("Matches on table: "+data.matchesAmount); System.out.println("which: "+data.which); System.out.println("number: "+number); while(data.matchesAmount != 0){ if(number == data.which){ System.out.println("Choose amount of matches (from 1 to 3): "); n = scanner.nextInt(); if(data.matchesAmount == 1){ System.out.println("There's only 1 match left !"); while(n != 1){ n = scanner.nextInt(); } } else{ do{ n = scanner.nextInt(); } while(n <= 1 && n >= 3); } data.matchesAmount = data.matchesAmount - n; System.out.println(" "+ name+" takes "+n+" matches."); if(number != 0){ data.which = 0; } else{ data.which = 1; } } else{ try { Thread.sleep(1000); } catch(InterruptedException exc) { System.out.println("End of thread."); return; } } System.out.println("Matches on table: "+data.matchesAmount); } if(data.matchesAmount == 0){ System.out.println("Winner is player: "+name); stop(); } } }

    Read the article

  • Missing Dependency Errors when Installing OpenVas Server

    - by David
    I'm trying to install OpenVAS on Red Hat Enterprise Linux 5.5. I've successfully run yum install openvas-client, but yum install openvas-server prints the following errors: --> Finished Dependency Resolution openvas-client-3.0.1-1.el5.art.i386 from installed has depsolving problems --> Missing Dependency: libopenvas_hg.so.3 is needed by package openvas-client-3.0.1-1.el5.art.i386 (installed) openvas-client-3.0.1-1.el5.art.i386 from installed has depsolving problems --> Missing Dependency: libopenvas_nasl.so.3 is needed by package openvas-client-3.0.1-1.el5.art.i386 (installed) openvas-client-3.0.1-1.el5.art.i386 from installed has depsolving problems --> Missing Dependency: libopenvas_omp.so.3 is needed by package openvas-client-3.0.1-1.el5.art.i386 (installed) openvas-scanner-3.2-0.2.el5.art.i386 from atomic has depsolving problems --> Missing Dependency: net-snmp-utils is needed by package openvas-scanner-3.2-0.2.el5.art.i386 (atomic) openvas-client-3.0.1-1.el5.art.i386 from installed has depsolving problems --> Missing Dependency: libopenvas_misc.so.3 is needed by package openvas-client-3.0.1-1.el5.art.i386 (installed) openvas-scanner-3.2-0.2.el5.art.i386 from atomic has depsolving problems --> Missing Dependency: openldap-clients is needed by package openvas-scanner-3.2-0.2.el5.art.i386 (atomic) openvas-client-3.0.1-1.el5.art.i386 from installed has depsolving problems --> Missing Dependency: libopenvas_base.so.3 is needed by package openvas-client-3.0.1-1.el5.art.i386 (installed) Error: Missing Dependency: net-snmp-utils is needed by package openvas-scanner-3.2-0.2.el5.art.i386 (atomic) Error: Missing Dependency: libopenvas_base.so.3 is needed by package openvas-client-3.0.1-1.el5.art.i386 (installed) Error: Missing Dependency: libopenvas_hg.so.3 is needed by package openvas-client-3.0.1-1.el5.art.i386 (installed) Error: Missing Dependency: libopenvas_nasl.so.3 is needed by package openvas-client-3.0.1-1.el5.art.i386 (installed) Error: Missing Dependency: openldap-clients is needed by package openvas-scanner-3.2-0.2.el5.art.i386 (atomic) Error: Missing Dependency: libopenvas_omp.so.3 is needed by package openvas-client-3.0.1-1.el5.art.i386 (installed) Error: Missing Dependency: libopenvas_misc.so.3 is needed by package openvas-client-3.0.1-1.el5.art.i386 (installed) You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest The program package-cleanup is found in the yum-utils package. Notice that each of the missing dependencies is followed by the words (installed) or the words (atomic) - for the name of the repository. When I try to install any of these sub-dependencies, the installation fails (either due to missing dependencies or since the rpm is already installed). For example, if I try to install a rpm for "libopenvas_hg.so.3", I get an error message indicating that it is already installed. Yet "libopenvas_hg.so.3" is listed as a missing dependency. Why? Do I need to uninstall all of the "missing" dependences first?

    Read the article

  • Throwing and catching exceptions in the same function/method

    - by usr
    I've written a function that asks a user for input until user enters a positive integer (a natural number). Somebody said I shouldn't throw and catch exceptions in my function and should let the caller of my function handle them. I wonder what other developers think about this. I'm also probably misusing exceptions in the function. Here's the code in Java: private static int sideInput() { int side = 0; String input; Scanner scanner = new Scanner(System.in); do { System.out.print("Side length: "); input = scanner.nextLine(); try { side = Integer.parseInt(input); if (side <= 0) { // probably a misuse of exceptions throw new NumberFormatException(); } } catch (NumberFormatException numFormExc) { System.out.println("Invalid input. Enter a natural number."); } } while (side <= 0); return side; } I'm interested in two things: Should I let the caller worry about exceptions? The point of the function is that it nags the user until the user enters a natural number. Is the point of the function bad? I'm not talking about UI (user not being able to get out of the loop without proper input), but about looped input with exceptions handled. Would you say the throw statement (in this case) is a misuse of exceptions? I could easily create a flag for checking validity of the number and output the warning message based on that flag. But that would add more lines to the code and I think it's perfectly readable as it is. The thing is I often write a separate input function. If user has to input a number multiple times, I create a separate function for input that handles all formatting exceptions and limitations.

    Read the article

  • Java Program Compilaton on Windows [closed]

    - by Mc Elroy
    I am trying to compile my program on the command line on windows using the java command and it says: Error: could not find or load main class or addition class It is for a program for adding two integers. I don't understand how to resolve the problem since I defined the static main class in my source code here is it: //Filename:addition.java //Usage: this program adds two numbers and displays their sum. //Author: Nyah Check, Developer @ Ink Corp.. //Licence: No warranty following the GNU Public licence import java.util.Scanner; //this imports the scanner class. public class addition { public static void main(String[] args) { Scanner input = new Scanner(System.in);//this creates scanners instance to take input from the input. int input1, input2, sum; System.out.printf("\nEnter First Integer: "); input1 = input.nextInt(); System.out.printf("\nEnter Second Integer: "); input2 = input.nextInt(); sum = input1 + input2; System.out.printf("\nThe Sum is: %d", sum); } }//This ends the class definition

    Read the article

  • Why can't my main class see the array in my calender class

    - by Rocky Celltick Eadie
    This is a homework problem. I'm already 5 days late and can't figure out what I'm doing wrong.. this is my 1st semester in Java and my first post on this site Here is the assignment.. Create a class called Calendar. The class should contain a variable called events that is a String array. The array should be created to hold 5 elements. Use a constant value to specify the array size. Do not hard code the array size. Initialize the array in the class constructor so that each element contains the string “ – No event planned – “. The class should contain a method called CreateEvent. This method should accept a String argument that contains a one-word user event and an integer argument that represents the day of the week. Monday should be represented by the number 1 and Friday should be represented by the number 5. Populate the events array with the event info passed into the method. Although the user will input one-word events, each event string should prepend the following string to each event: event_dayAppoinment: (where event_day is the day of the week) For example, if the user enters 1 and “doctor” , the first array element should read: Monday Appointment: doctor If the user enters 2 and “PTA” , the second array element should read: Tuesday Appointment: PTA Write a driver program (in a separate class) that creates and calls your Calendar class. Then use a loop to gather user input. Ask for the day (as an integer) and then ask for the event (as a one word string). Pass the integer and string to the Calendar object’s CreateEvent method. The user should be able enter 0 – 5 events. If the user enters -1, the loop should exit and your application should print out all the events in a tabular format. Your program should not allow the user to enter invalid values for the day of the week. Any input other than 1 – 5 or -1 for the day of the week would be considered invalid. Notes: When obtaining an integer from the user, you will need to use the nextInt() method on your Scanner object. When obtaining a string from a user, you will need to use the next() method on your Scanner object. Here is my code so far.. //DRIVER CLASS /** * * @author Rocky */ //imports scanner import java.util.Scanner; //begin class driver public class driver { /** * @paramargs the command line arguments */ //begin main method public static void main(String[] args) { //initiates scanner Scanner userInput = new Scanner (System.in); //declare variables int dayOfWeek; String userEvent; //creates object for calender class calendercalenderObject = new calender(); //user prompt System.out.println("Enter day of week for your event in the following format:"); System.out.println("Enter 1 for Monday"); System.out.println("Enter 2 for Tuesday"); System.out.println("Enter 3 for Wednsday"); System.out.println("Enter 4 for Thursday"); System.out.println("Enter 5 for Friday"); System.out.println("Enter -1 to quit"); //collect user input dayOfWeek = userInput.nextInt(); //user prompt System.out.println("Please type in the name of your event"); //collect user input userEvent = userInput.next(); //begin while loop while (dayOfWeek != -1) { //test for valid day of week if ((dayOfWeek>=1) && (dayOfWeek<=5)){ //calls createEvent method in calender class and passes 2 variables calenderObject.createEvent(userEvent,dayOfWeek); } else { //error message System.out.println("You have entered an invalid number"); //user prompts System.out.println("Press -1 to quit or enter another day"); System.out.println("Enter 1 for Monday"); System.out.println("Enter 2 for Tuesday"); System.out.println("Enter 3 for Wednsday"); System.out.println("Enter 4 for Thursday"); System.out.println("Enter 5 for Friday"); System.out.println("Enter -1 to quit"); //collect user input dayOfWeek = userInput.nextInt(); //end data validity test } //end while loop } //prints array to screen int i=0; for (i=0;i<events.length;i++){ System.out.println(events[i]); } //end main method } } /** * * @author Rocky */ //imports scanner import java.util.Scanner; //begin calender class public class calender { //creates events array String[] events = new String[5]; //begin calender class constructor public calender() { //Initializes array String[] events = {"-No event planned-","-No event planned-","-No event planned-","-No event planned-","-No event planned-"}; //end calender class constructor } //begin createEvent method public String[] createEvent (String userEvent, int dayOfWeek){ //Start switch test switch (dayOfWeek){ case 1: events[0] = ("Monday Appoinment:") + userEvent; break; case 2: events[1] = ("Tuesday Appoinment:") + userEvent; break; case 3: events[2] = ("WednsdayAppoinment:") + userEvent; break; case 4: events[3] = ("Thursday Appoinment:") + userEvent; break; case 5: events[4] = ("Friday Appoinment:") + userEvent; break; default: break; //End switch test } //returns events array return events; //end create event method } //end calender class }

    Read the article

  • Java default Integer value is int

    - by Chris Okyen
    My code looks like this import java.util.Scanner; public class StudentGrades { public static void main(String[] argv) { Scanner keyboard = new Scanner(System.in); byte q1 = keyboard.nextByte() * 10; } } It gives me an error "Type mismatch: cannot convert from int to byte." Why the heck would Java store a literal operand that is small enough to fit in a byte,. into a int type? Do literals get stored in variables/registers before the ALU performs arithmatic operations.

    Read the article

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