Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Lykos

Pages: [1] 2
1
Found it on the Webs / Re: If ever there was an apple fanboi...
« on: January 08, 2013, 09:02:29 pm »
I'll concede that I probably should have left the "circlejerk" part of it out, but this thread honestly has become that.

You're making a lot of weird assumptions off my post.  I also never insulted you guys, outside of the circlejerk statement which I just addressed. 

Where did I ever say I'm not a tech enthusiast?  I said not everyone out there is a tech enthusiast, like WE are.  "We" includes me.  I'm a CoSci student in Uni, been into programming, security, etc since I was young. 

I'll clarify, since you hopped on me about the "easily and conveniently" thing.  I use my iPod for email, GPS, calendar, music, social media, pictures and video, games to keep me occupied in between classes.  It does all this great, does what I need it to do.  I don't need my 4" iPod to break into Wifi networks, do programming, etc.  You launched right into talking about Linux, so you basically compared Linux, a full-blown desktop OS, to my iPod as far as functionality.  Cool lol.  Nowhere did I say that my iPod is more functional than Linux. 

Quote
Ease of use and convenient access doesn't excuse a whole host of other problems, why do you think we put up with having to configure Linux?

What "whole host of other problems" does the ease and convenience of my iPod open up?  Just curious. 

Also, yes, you guys have been indirectly insulting people who use Apple products this entire thread.  I'll point out the more direct "dumb bimbos" statement as well.

2
Found it on the Webs / Re: If ever there was an apple fanboi...
« on: January 08, 2013, 08:31:18 pm »
Wow, this is a circlejerk of epic proportions. 

Now I'm starting to feel like I'm some sort of inbred moron for using the Touch 5, which is I'm sure what you guys would say.  However, it does exactly what I need it to.  Easily and conveniently.

Not everyone out there is a tech enthusiast like we are, people.  Chill out.  No normal computer user wants to go through the hassle of configuring and keeping up with Linux.  And some people just don't like Windows and Android.  That's their choice, their problem.  Deal with it and move on with your lives. 

None of us here like Apple.  We get that.  And yet somehow you guys are arguing with each other trying to convince each other that Apple is bad when you all already believe that.



3
News and Announcements / Re: New Web Server
« on: December 12, 2012, 09:26:17 pm »
It's what happens when your administration team actually knows what the fuck is going on. Not implying that your old site isn't good. I'm just implying that we are better.

Hahaha, the old site is dead now so by default you guys are better.  But yes, more active management and site overall, so definitely better.

4
News and Announcements / Re: New Web Server
« on: December 12, 2012, 07:32:12 pm »
Props for actually doing a good job on this.  The last forum I was a part of moved servers and now has more downtime than uptime.  Also took them about a week to move over.  So very well done, guys.  Very well done.

5
General discussion / Re: Evilzone's Christmas and New Year gifts
« on: December 12, 2012, 05:40:55 pm »
Anybody know what they're getting for christmas?

An xBox I believe.

Thanks for the stuff, EvilZone :)

6
Java / Re: Java assignments
« on: December 12, 2012, 05:28:22 pm »
Hey Lycos,your code doesn't work. :o
Have you tried running it before posting? 8)

Yes, many times.  And since I don't have my main computer running right now, I just copied and pasted the code I posted into a new project on this computer.  My code works perfectly.  I have no idea what you're talking about.  Care to elaborate on what error you're getting, or how it doesn't work? 

7
Java / Re: Java assignments
« on: December 12, 2012, 04:09:57 am »
I'll be able to work on this again in a couple days.  I have final exams right now that I have to study for, so no spare time unfortunately.  Thanks for responding about the bounds.  And yes, I have experience with exception handling so I'll put that in as well when I get the chance, hopefully over this weekend.

8
General discussion / Re: Show your desk 2012
« on: December 10, 2012, 03:05:08 am »
I'll join in.  Dorm room lol.



9
General discussion / Re: How to become a hacker?
« on: December 09, 2012, 10:43:13 pm »
I'm just gonna leave this here:


http://www.catb.org/esr/faqs/hacker-howto.html






There is no easy way.  There is no shortcut.  There is no "guide" to being a hacker.  To become a hacker, you need to learn, grow, explore, create, destroy.  Do things no one has ever done before.  Learn to program, learn hardware and software inside and out.  Learn everything.

10
Java / Re: Java assignments
« on: December 09, 2012, 07:50:42 pm »
Here's my condensed code, using getInput() for the shiftAmount and also taking in the string to shift.  Just had to parseInt to get getInput()'s value into int.


Code: [Select]

/**
 * @author: Lykos
 * @version: 0.6
 * @description: Simple shift cipher.  Takes a string from the user, and the user enters the amount to shift it by.
 */


import java.util.Scanner;
public class Main
{
    public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);
        String userInput = "";
        while(true)
        {
            System.out.println("Enter the string you would like to cipher: ");
            userInput = getInput();
            if(userInput.equalsIgnoreCase("exit") || userInput.equalsIgnoreCase("quit"))
            {
                break;
            }
            System.out.println("Enter the amount you would like to shift the string by: ");
            int shiftAmount = Integer.parseInt(getInput());
            System.out.println(encode(userInput, shiftAmount));
        }
        input.close();
    }
   
    private static String getInput()
    {
        Scanner input = new Scanner(System.in);
        String userInput = input.nextLine();
        input.close();
        return userInput;
    }
   
    private static String encode(String input, int shiftAmount)
    {
        char[] charArray = input.toCharArray();
        for(int index = 0; index < charArray.length; index++)
        {
            charArray[index] += shiftAmount;
        }
        String s = new String(charArray);
        return s;
    }
}


Haven't figured out how to incorporate % into this yet.  I haven't actually been able to find the bounds.  I've done z and then shifted it by some arbitrarily high number (such as 1000000000) and still get stuff back.  It was a chinese character, if I remember right.  So I guess I need to know where you want the bounds to be, Deque, cause it doesn't seem to have one right now.  Maybe just from 32 to 126 on the ASCII chart?  That's everything from spacebar to ~, which would be the typical input (at least for an english speaker).  If that's the bounds you want, I think I could incorporate % pretty easily.






Anyway, for an explanation of %, or Modulo, for Mr. Perfect:


% is called the modulo operator.  It returns the remainder of a division equation.  So take this for example:


Code: [Select]
2 / 2 = 1 (typical division equation).
2 % 2 = 0 (Since 2 goes into 2 a set amount of times, there is no remainder).


Another example:
Code: [Select]
3 % 2 = 1 (2 goes into 3 once, with one unit left over).
5 % 2 = 1 (2 goes into 5 twice, with one unit left over). 
11 % 3 = 2 (3 goes into 11 three times, which equals 9, and 11 - 9 = 2 for the remainder).


For an example of this in a real program, we can use modulo to figure out whether a number is even or not:
Code: [Select]
//Omitting the code where we get an int from the user and assign it to a variable named userInput


if(userInput % 2 == 0)
{
     System.out.println("This number is even!"); // Number is even because when divided by two, there is no remainder. 
}
else
{
     System.out.println("This number is odd!"); // Number is odd if there is a remainder when dividing by 2. 
}


Hopefully this clears it up.  Modulo, %, just returns the remainder from a division equation.  Let me know if this isn't clear enough, I can try to explain in a different way.

11
Projects and Discussion / Re: rate this code
« on: December 09, 2012, 08:29:20 am »
This took me a little bit of looking at it to figure out why it would be looping infinitely... then I saw it.


Then my mind broke. 


Definitely should just be "return d", as these other fine people have said.

12
Java / Re: Java assignments
« on: December 09, 2012, 08:21:40 am »
Assignment 3:


Code: [Select]

/**
 * @author: Lykos
 * @version: 0.5
 * @description: Simple shift cipher.  Takes a string from the user, and the user enters the amount to shift it by.
 */


import java.util.Scanner;
public class Main
{
    public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);
        String userInput = "";
        while(true)
        {
            System.out.println("Enter the string you would like to cipher: ");
            userInput = getInput();
            if(userInput.equalsIgnoreCase("exit") || userInput.equalsIgnoreCase("quit"))
            {
                break;
            }
            System.out.println("Enter the amount you would like to shift the string by: ");
            int shiftAmount = getShift();
            System.out.println(encode(userInput, shiftAmount));
        }
        input.close();
    }
   
    private static int getShift()
    {
        Scanner input = new Scanner(System.in);
        String shiftAmount = input.nextLine();
        int shift = Integer.parseInt(shiftAmount);
        input.close();
        return shift;
    }
   
    private static String getInput()
    {
        Scanner input = new Scanner(System.in);
        String userInput = input.nextLine();
        input.close();
        return userInput;
    }
   
    private static String encode(String input, int shiftAmount)
    {
        char[] charArray = input.toCharArray();
        for(int index = 0; index < charArray.length; index++)
        {
            charArray[index] += shiftAmount;
        }
        String s = new String(charArray);
        return s;
    }
}


Not much really had to be changed.  Originally I did the code for getShift() in the main method, then remembered it'd be better to make a different method for it.  So did that, then just had to make another parameter for encode. 


Kinda dreading incorporating Swing into this.  Seems like that's gonna be a lot of re-doing code.  I've just barely touched the surface of Swing though, so maybe there's some shortcuts/convenient things I don't know.


Anyway, this is fun shit.  Thank you very much for doing this, Deque.  This should definitely keep me working during break, since I'm done with CoSci classes for a month.  I appreciate this a lot.

13
Java / Re: Java assignments
« on: December 09, 2012, 06:22:47 am »
Alright, so Deque, I get what you're saying about wanting the loop condition to handle when to end the loop, but I'm not quite sure how to do that.  I've tried putting the condition of if the input is exit or quit in the condition, but it ends up printing out the encoded string and THEN exiting when I do that.  Same with do-while.  Saying exit or quit makes the program stop, but it also spits back the encoded message first, which is not what I want.  I guess I could possible do a nested while loop and this would take care of that, but also be much less elegant and end up making future programmers have to look through two loops instead of one.  So maybe I'm missing something here, but having while(true) and then break seems like the best way so far.  Any hints in the right direction would be appreciated.


So here is my modularized code, like you wanted:


Code: [Select]

/**
 * @author: Lykos
 * @version: 0.3
 */


import java.util.Scanner;
public class Main
{
    public static void main(String[] args)
    {
        String userInput = "";
        while(true)
        {
            System.out.println("Your input?");
            userInput = getInput();
            if(userInput.equalsIgnoreCase("exit") || userInput.equalsIgnoreCase("quit"))
            {
                break;
            }
            System.out.println(encode(userInput));
        }
    }
   
    private static String getInput()
    {
        Scanner input = new Scanner(System.in);
        String userInput = input.nextLine();
        input.close();
        return userInput;
    }
   
    private static String encode(String input)
    {
        char[] charArray = input.toCharArray();
        for(int index = 0; index < charArray.length; index++)
        {
            ++charArray[index];
        }
        String s = new String(charArray);
        return s;
    }
}


Not gonna lie, the encode method pissed me off a little till I switched to a traditional for loop instead of the for-each.  Not sure if you want the main method to be cut down more than this or not.  I'll try something after I post this to see if I can cut it down a little more, but for now, there we go. 


14
Java / Re: Java assignments
« on: December 07, 2012, 10:34:32 pm »
Not sure how to exit programs in Java without System.exit(0), unless I just flat out don't need to use it.  Took out the boolean, and replaced the System.exit with break to simply get out of the loop.  Not sure if that's what you pushing me towards or not.  Might be something I don't know about.  I'll edit this post with assignment 2 when I finish it.


Assignment 1:
Code: [Select]

import java.util.Scanner;


public class Main
{


    public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);
        while(true)
        {
            System.out.println("Your input?");
            String userInput = input.nextLine();
            if(userInput.equalsIgnoreCase("exit") || userInput.equalsIgnoreCase("quit"))
            {
                break;
            }
            else
            {
                System.out.println(userInput + "\n");
            }
        }
        input.close();
    }
}




Assignment 2:
Code: [Select]

import java.util.Scanner;


public class Main
{


    public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);
        while(true)
        {
            System.out.println("Your input?");
            String userInput = input.nextLine();
            char[] charArray;
            charArray = userInput.toCharArray();
            if(userInput.equalsIgnoreCase("exit") || userInput.equalsIgnoreCase("quit"))
            {
                break;
            }
            else
            {
                for(char c : charArray)
                {
                    System.out.print(++c);
                }
                System.out.println();
            }
        }
        input.close();
    }
}


The .toCharArray is something I had no idea about.  Not sure if that is the best way to do this, but it seemed like it was either this or splitting the string at every dang ASCII character and then adding that to the array.  So .toCharArray seems like a really cool thing that I can definitely make use of in other programs as well.

15
Java / Re: Java assignments
« on: December 06, 2012, 10:27:20 pm »

Hereeee we go.  Looking forward to continuing this.  Grats on the kid :)

Code: [Select]

import java.util.Scanner;


public class Main
{


    public static void main(String[] args)
    {
        boolean done = false;
        Scanner input = new Scanner(System.in);
        while(!done)
        {
            System.out.println("Your input?");
            String user_input = input.nextLine();
            if(user_input.equalsIgnoreCase("exit") || user_input.equalsIgnoreCase("quit"))
            {
                System.exit(0);
            }
            else
            {
                System.out.println(user_input + "\n");
            }
        }
    }
}

Pages: [1] 2