Slavi 94 Master Poster Featured Poster

Glad it works then ;)

Slavi 94 Master Poster Featured Poster

I don't see anything wrong with the code, tried running it using terminal as well, works fine. Could be something with Netbins itself

Slavi 94 Master Poster Featured Poster

You can disable that from within the application^, although its on be default ..

Slavi 94 Master Poster Featured Poster

make a print method which is being called after each transaction and prints the updated contents

Slavi 94 Master Poster Featured Poster

Have you considered the case that they have but their native language is not English and they actually didn't know that it was a grammer mistake? :D

Slavi 94 Master Poster Featured Poster

You can use packet analyzing tool, for example using Wireshark. It will display all the traffic in and out

But doing DDOS is not really something that you have to do yourself anymore rea
lly ... I've seen many online services offer to do it for you, at exact time of your wish and a duration of your wish. Further, I've even seen people sharing GUI's to their botnets for free etc(which I doubt they have no "bonus" inside or something)

Slavi 94 Master Poster Featured Poster

What I would do instead is something like this pseudo code

input from user // such as(name name1 name2)
split the input from user and your regex is space, into an array of Strings
at this point you have 3 strings into an array, your initials are the first char
for each of those strings 

String name = input.scanner(System.in);
String[] names = name.split(" ");
for (String s : names) System.out.print(s.chatAt(0));
Slavi 94 Master Poster Featured Poster

Hi James,
Why would it be an overkill when having a couple of lines in a file? You don't really need good performance for that?
Also, why wouldn't it work if you just read a line as a string and see whether it contains "0" ?

Slavi 94 Master Poster Featured Poster

and to add to both of them ^^

Using Scanner in java, you can read text files, and do it by reading an entire line from the file at a time
Once you have a line available, you can check if it contains 0, if it doesn't you print yes, if it does, you print no

Slavi 94 Master Poster Featured Poster

I are 4ner :( <3

Slavi 94 Master Poster Featured Poster

What have you done so far?

Slavi 94 Master Poster Featured Poster

Move

l2=new JLabel();
            l2.setText(a);

before line 39

Slavi 94 Master Poster Featured Poster

your scanner object is supposed to read input from users, not an object of your class that has not even been decleared
I'd suggest you start again from this point, and ask about any line you add in your code that you are not sure about

import java.util.Scanner;
public class HelloWorld{


     public static void main(String []args){
        System.out.println(getInput());
     }
     public static String getInput(){
         Scanner scanner = new Scanner(System.in);
         return scanner.nextLine();
     }
}
Slavi 94 Master Poster Featured Poster

I will try it out tonight on my laptop and both screens at home, will get back with results

Slavi 94 Master Poster Featured Poster

Congratulations Geek, glad to see your passion about security

Slavi 94 Master Poster Featured Poster

You can read through a text file and compare the words in the file to a word of your(or your user's) choice, if there is a match, then the word is in english unless it is not

Slavi 94 Master Poster Featured Poster

Oh wow ;( Sorry mine's pretty bad as well, was leg day yesterday!
Whats wrong with it, did you injure it? If I were you i'd implement a replace method ... =) get better sooner!

Slavi 94 Master Poster Featured Poster

Omg James,
it just hit me :D, fixed and works now, the actual error was that I've used acl for reading both files, and when checking for roles let's say manager, it also has Manager on the file Alice Manager and there, it doesn't have length of 4 or more ... Well, took me quite a while to see it I guess lol, Thank you for your help

Slavi 94 Master Poster Featured Poster

My bad, its Manager not Alice earlier as I mentioned. See this works

for(int i = 0; i<acl.size();i++){
            //System.out.println(acl.get(i));
            if(acl.get(i).contains(role)){
                permissions = acl.get(i).split(":");
            }
        }
        if(permissions[operation].equals("yes")) return true;
        return false;

but this doesnt

for(int i = 0; i<acl.size();i++){
            //System.out.println(acl.get(i));
            if(acl.get(i).contains(role)){
                permissions = acl.get(i).split(":");
                if(permissions[operation].equals("yes")) return true;
            }
        }
        return false;




Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
    at server.CheckPermission.checkPermissions(CheckPermission.java:38)
    at server.CheckPermission.checkUserPermission(CheckPermission.java:74)
    at server.CheckPermission.main(CheckPermission.java:20)

I swear I haven't changed anything else in the code other than move that if statement inside, if i move it out, works great again

Slavi 94 Master Poster Featured Poster
for(int i = 0; i<acl.size();i++){
            //System.out.println(acl.get(i));
            if(acl.get(i).contains(role)){
                permissions = acl.get(i).split(":");
            }
        }
        for (int i = 0; i<permissions.length;i++) System.out.println(permissions[i]);

Output is:

Manager
yes
yes
yes
yes
yes
yes
yes
yes
yes

It is all "yes" because the test was ran for the admin

Hmm, if instead using the for loop I just use System.out.println(permissions[4])
like outside of the loop now it works. Is permissions not initialized completely at this point?

if(acl.get(i).contains(role)){
                permissions = acl.get(i).split(":");

I would expect permissions at that point to contain

    Manager
    yes
    yes
    yes
    yes
    yes
    yes
    yes
    yes
    yes

is that not the case?

Slavi 94 Master Poster Featured Poster

Hello James,
I didn't think of doing it that way perhaps I should implement in might be easier to see who has what permissions. Anyhow permissions is always the same size Alice:yes:yes:yes:yes:yes:yes:yes:yes:yes , which is 10 items so 4 shoudn't be a problem but then again even if I don't use operation but just normal numbers, it works only if the number is 0 and it prints Alice, if its 1 or bigger gives exception, bit of a mistary still

Slavi 94 Master Poster Featured Poster

Hey James,
The reason behind using the permissions as the way that I have them now is because I am implementing Access control List and the same project with Role based access control list. In the first case I have the following:

Operations:Start:Stop:Restart:Status:readConfig:setConfig:Print:Queue:topQueue
Alice:yes:yes:yes:yes:yes:yes:yes:yes:yes
Bob:yes:yes:yes:yes:yes:yes:no:no:no
Cecilia:no:no:yes:no:no:no:yes:yes:yes
David:no:no:no:no:no:no:yes:yes:no
Erica:no:no:no:no:no:no:yes:yes:no
Fred:no:no:no:no:no:no:yes:yes:no
George:no:no:no:no:no:no:yes:yes:no

where, I pass a username, based on that username I get the entire line from the text, in other words if the line contains the username, get the line, split it by ":" and save it into an array. Then use the operation to see if that particuliar permission is going to be granted(it is granted if at the position it has "yes")

For the second case, I have something similiar, one file which contains names and their roles in the company, and another file which has roles mapped to permissions. The problem that I faced here was during the second case using Role based access control. Okay, here is debugging (operation is always a value representing one of the operations in the text file)

As far as debugging goes:

for(int i = 0; i<acl.size();i++){
            //System.out.println(acl.get(i));
            if(acl.get(i).contains(role)){
                permissions = acl.get(i).split(":");
                //
                for(int j = 0; j<permissions.length;j++){
                    //System.out.println(permissions[j]);
                    //System.out.println(operation);
                    if(j==operation){
                        //System.out.println(permissions[j]);
                        System.out.println(permissions[operation]);
                        System.out.println(operation);
                        if(permissions[operation].equals("yes")) return true;
                    }
                }
            }
        }

and the output is

no
4
false

as it should be but if I try the original thing like this

for(int i = 0; i<acl.size();i++){
            //System.out.println(acl.get(i));
            if(acl.get(i).contains(role)){
                permissions = acl.get(i).split(":");
                //
                //for(int j …
Slavi 94 Master Poster Featured Poster

Hey James,

Yep, the permission array holds strings of yes/no and I have another array referencing on which position is what operation. Say we are looking at operation "Print". What I am doing is in different class I pass "Print" into a method, which returns the value of operating,from an array which has stuff such as {"Print", "Start,"Stop" etc you get the idea} and it retuns the position of it, that returned value is then passed as operation. A bit weird was that if I used static values instead of operation, it only worked if the value was 0, and index out of boundary if anything else unless I loop through it

Slavi 94 Master Poster Featured Poster

First of all, there is no need to write into an absolutely dead thread ..
Second, if you can't even think of a loop that can do 1 to 5, you might really want to consider starting from the basics ...
Third .. well here's a loop in 2 versions ..first for and then while loops

for(int i = 0; i<5;i++){
    System.out.println(i);
}

or ...

int i = 0;
while(i<5){
    System.out.println(i);
    i++; // means i = i + 1
}
stultuske commented: or the simpler version: System.out.println("1,2,3,4,5"); :) +13
Slavi 94 Master Poster Featured Poster

I just wanted to say that I think I am hooked to DaniWeb ... I literally have a tab opened all the time and usually reading through most of the things going on, just hope that we'll stay strong and go on!

Slavi 94 Master Poster Featured Poster

Well basically, I was coding earlier and I encountered this

for(int i = 0; i<acl.size();i++){
            //System.out.println(acl.get(i));
            if(acl.get(i).contains(role)){
                permissions = acl.get(i).split(":");
                if(permissions[operation].equals("yes")) return true;
            }
        }

and I was getting index out of boundary exception, but I knew that wasn't the case so I decided to use a for loop to print out the entire content of permissions. Well surprisingly it worked ... so I did this instead to fix my code because I had no better idea what is the reason for my earlier version to fail

for(int i = 0; i<acl.size();i++){
            //System.out.println(acl.get(i));
            if(acl.get(i).contains(role)){
                permissions = acl.get(i).split(":");
                for(int j = 0; j<permissions.length;j++)
                    if(j==operation)
                        //System.out.println(permissions[operation]);
                        if(permissions[operation].equals("yes")) return true;
            }
        }

I would say that the problem was that the compiler wasn't sure whether permissions would have a value at position operation? And using the loop which loops through the array(permissions is String[]) ensures that a value at position will be available if the last if statement is true. Still not sure maybe someone could give me an insight?

Slavi 94 Master Poster Featured Poster

Thanks for link RJ, amazing things on there =)

Slavi 94 Master Poster Featured Poster

I can't express how sad reading this made me, from what I've seen on DaniWeb, he was amazing person, increadably skilled software developer and a human. RIP :(

Slavi 94 Master Poster Featured Poster

Rest in peace mate :(

Slavi 94 Master Poster Featured Poster

The problem is that you want to have your if loop inside the for, because now you execute the for loop, you end up having a value of 15, then your if loop executes with only that value, therefore 1 number was entered and it was odd as well

Slavi 94 Master Poster Featured Poster

What is the structure that you have now?

Slavi 94 Master Poster Featured Poster

Ultimately, if you cannot resolve it I think you can create new project copy/paste the code, then right click your class Run as -> java application , should work

Slavi 94 Master Poster Featured Poster

Perhaps take a look in Here

Slavi 94 Master Poster Featured Poster

@Grib, yep, if you trust your OS its a good solution, high protection etc
I usually store my passwords on an external device which is encrypted, and the file containing the passwords encrypted as well :D But anyway, this topic was a suggestion by @Vega and an example of python code, so let's keep it that way :)

Slavi 94 Master Poster Featured Poster

I agree with both, @stultuske and @James,
This isn't really something you should do while learning java, if you want to make GUI based projects you could implement basic ones to get an idea of how things works(which I assume you know by the way you talk about stuff) such as Calculator/Lock combination to unlock a button or a text something, basically play with basic GUI components and do the entire code yourself.

Anyway, as James mentioned if you still want to go after this, you' ll need javaFX, This is what I used to learn the basics, I am not saying its a great guide but it helped me a lot

Slavi 94 Master Poster Featured Poster

There are couple of nice vids out there saying that long passwords are more secure than something you could remember such as "monkey". Well that is the case simply because it is expected that a long string is less likely to be part of a "dictionary" and it is infeasible to brute force it either. Of course unless chosen randomly and as @rubben said, something that cannot be related to you is definitely the best scenario. I myself, would mainly use words in different language and place special characters on random posititons as well and reach at least 15 characters for my passwords. 15 is not bad I would say mainly because the brute force attack(exhaustive attack which attempts every single permutation of letters) is practically "impossible" to run for characters over length of 10. Hackers would use dictonary attacks instead however the successrate is very unlikely. Something that we could do to reduce the effectiveness of a brute for attack is implementing the so called "slowing" functions, which are made on purpose using XOR or something similiar to compare an existing Hash and a newly generated one when connecting to a web service, for example. This will significantly reduce the chance of having passwords on your service being compromised. Actually, a reason why you should think of methods like this one is because users tend to use the same password over different platforms, usually the case is they'd use it for viral information such as banking web pages as …

Slavi 94 Master Poster Featured Poster

Nope, it lands on the moon first, for a quick beer on the way

How long does it take before whales learn to fly after their birth?

Slavi 94 Master Poster Featured Poster

In wireless communication SSID is the name of the router

Slavi 94 Master Poster Featured Poster

Protection in what way? As in communication to the router? Most routers now AES to encrypt the data, making it for hackers difficult to intercept(Man in the middle attack). If other encrypting algorithm is suggested, I'd advice you just leave it as suggested and go for AES, as thats the standard currently and the best known attacks on it are still practically "impossible". Another issue might be the security protocol used by the routers, the known ones are WEP, WPA and WPA2. WEP has been known to be broken for many many years, I think the world record for breaking it and getting the password to the router is about 7 seconds. WPA was released "quickly" to change WEP, however some flaws were found in it and WPA2 was released fixing those, therefore for security protocol of your wireless router, it is recommended using WPA2.

However, there is something called quick set up, known as WPS, which gives an easy connection to a device that has physical access to a router, as you can just enter a PIN to connect to the router. The problem is that the PIN can be brute forced easily .. there was another problem with the PIN itself which made it possible to brute force WPS in less than 3 hours(3 to 4 hours is average time to break WPS). So I highly recommend you, shutting off WPS option on your router if it is available.

With this said, I am using a TP-link router, …

Slavi 94 Master Poster Featured Poster

Thank you @vegaseat

Slavi 94 Master Poster Featured Poster

And if you want to print the array afterwards, you could do the for loop but instead of writing to exams[i], you just print out the value exams[i]

Slavi 94 Master Poster Featured Poster

What do you need help with at that point?

Slavi 94 Master Poster Featured Poster

Hey mate,
thanks for adding the post. I've actually had the same problem when I added Windows 8.1 to dual boot with my Linux. Everytime I switch between them , the clock completely went nuts and it was really annoying. I think my solution was to go to a registry and set the clock in there to make it persistent, never had issues since

Slavi 94 Master Poster Featured Poster

Create an arrayList that has input type your person object. When a new object has been created, simply add it in the arrayList

ArrayList instead of array because, in an array you have to specify the size of the array upon declaration, of course you could copy and move it to a bigger one if it gets filled but it will be too complicated for a simple project so I'd suggest use Arraylist, for more details on it Click Here

Slavi 94 Master Poster Featured Poster

I bought 2002 Golf, 4 or 5 years ago then I moved abroad and never got the chance to use it properly ;(

Slavi 94 Master Poster Featured Poster

Why, cannot find the driver or do you get an error when trying? If so which exactly ..

Slavi 94 Master Poster Featured Poster

Instead of printing the array(element lookup) at that position, check if the element at that position is equal to the one that the user entered, if it is then increase a count, if not take element at next position and so on until you go through the entire array

after the array is checked, just print out the count value

Slavi 94 Master Poster Featured Poster

That was the reason ,works like a charm now :)

Slavi 94 Master Poster Featured Poster

Pretty much what rubberman said, its VPN's that are used to do so, but you have to be extremely careful on setting up things, such as firewall policies ...

Slavi 94 Master Poster Featured Poster

I think the problem comes from this line
super(0, new SslRMIClientSocketFactory(), new SslRMIServerSocketFactory());
I set the system properties after this line but I think they should be before otherwise the keyStore used is something default but I can't call super unless on the same line, perhaps I should create new instance of the remote server after system props are set?

PS: there was a type in the original version I had "javafx." instead of "javax."