1
General Programming / Re: Anyone want to work on a Java project together?
« on: October 21, 2005, 10:32:29 pm »
Well, no one else would like to try out this project?!
Come on join up!
Come on join up!
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.
Guys, no offense, but I think this project is doomed to fail.If you're saying that because you think we will have problems in organizing it...
dMSN is a Java client capable of connection to ICQ, AIM, and MSN
public void InsertDword(int dWordheader){
addByte((byte)((dWordheader & 0x000000FF) >> 0));
addByte((byte)((dWordheader & 0x0000FF00) >> 8));
addByte((byte)((dWordheader & 0x00FF0000) >> 16));
addByte((byte)((dWordheader & 0xFF000000) >> 24));
}
"Roasting is performed by first xoring each byte in the password with the equivalent modulo byte in the roasting array ( 0xF3, 0x26, 0x81, 0xC4, 0x39, 0x86, 0xDB, 0x92, 0x71, 0xA3, 0xB9, 0xE6, 0x53, 0x7A, 0x95, 0x7C )"
/*
* Main.java
* Created on October 1, 2005, 6:17 PM
* @author Andy
*/
/*
* Binary -> Base10 Converter
*/
package binconv;
public class Main {
static char[] binary;
static String binaryStr;
public static boolean isBinary() {
for (int i = 0; i < binary.length; i++) {
if (binary[i] != '1' && binary[i] != '0')
return false;
}
return true;
}
public static void main(String[] args) {
final int AGAIN = 1;
final int END = 2;
int decision;
EasyReader in = new EasyReader(); // EasyReader and EasyWriter == best IO classes in Java!!
System.out.println("INSTRUCTIONS:" +
"Write a number in binary and it will be converted to base ten." +
"Don't try to flip out my program I prevented you from writing 0 > n > 1");
do { // repeat binary converter while user wants to
do { // if user gives non-binary number, repeat
System.out.println("Binary number: ");
binaryStr = in.readLine();
binary = binaryStr.toCharArray();
}
while(!isBinary());
int digits = binary.length;
int accum = 0;
int add = 1; // the value of 2^n that i will add
for (int i = 0; i < digits; i++)
if (i > 0)
add = add * 2;
for (int j = 0; j < digits; j++) {
if (binary[j] == '1')
accum += add;
add = add / 2;
}
System.out.println("Binary: " + binaryStr + " = Base 10: " + accum);
do { // if user doesn't give a valid answer, repeat
System.out.println("Again? 1. Yes 2. No");
decision = in.readInt();
}
while (decision != AGAIN && decision != END);
}
while (decision == AGAIN);
}
}