yashsingh1/xdaforums huggingface dataset:
[Sprint Samsung Galaxy S III] amiblindyet:
I have an HTC Evo rom with a messaging app that has iOS style, color emoji baked in. The rom was ported from the Galaxy anyway so I don't understand why I can't get it to work. I've only had this phone for 2 days but I feel like the Evo was so much easier.
[Sprint Samsung Galaxy S III] mstrmscn:
Are you trying to flash the rom or extract the messaging apk and load it that way? It probably won't work because it's designed for the OG EVO. Sense and TouchWiz are different.
[Sprint Samsung Galaxy S III] amiblindyet:
Edit: The app does work, and so does the emoji. But because the apk is different than the one that came with the rom it doesn't show up in the launcher, just the app tray. But I guess this will be my project for my first SGS3 rom.
[Sprint Samsung Galaxy S III] mstrmscn:
What's the name of the app?
[Sprint Samsung Galaxy S III] amiblindyet:
It's messaging.apk but it was from an AOSP rom. I installed the AOKP Jellybean rom and it has native emoji in the messaging app.
[Off-topic] Enraged21:
Need help on some java homework. I just started the class, haven't really learned anything and already have an assignment. Don't know much. Can someone point me in the right direction?

Assignment 1

You will use your knowledge of Java programming to create a test program for the seven dwarfs. Let’s pretend that Disney has hired you to make a java program that will test the knowledge of its users. The program will print a positive statement if they are correct and a negative statement if they are wrong. The program will complete the following:

Begin Program

Ask user to pick a valid dwarf from a list (created by you) printed to the user.

-	They will pick an integer that represents a dwarf.

-	For example, 1. Sleepy, 2. Heathcliff, 3. Joey

After selection the program will print if it is valid dwarf or not

The program will ask the user to pick from a list seven times.

If the user gets all seven selections correct, then a message will print to the user saying you get a gold star

This program can be completed by applying the knowledge learned by using the videos and lecture.
[Off-topic] DomOctober:
That's a relatively complex assignment for a new class. I wish I could provide you with the appropriate code, but I'm too a beginner and I just thought I'd offer these helpful videos. They're helping me out, and I hope they get you facing the right direction.

http://m.youtube.com/course?list=ECDAA5DE54FB5215EC
[Off-topic] ak700:
Hmm I think I got this -

// Begin program by importing io
// reinitialize buffered reader

int ans;
int result = 0;

System.out.println("Add your disney question over here whoes correct answer is option #3");

System.out.println("Option 1 - dwarf #1");
System.out.println("Option 2 - dwarf #2");
System.out.println("Option 3 - dwarf #3");
...// do the same till 7
System.out.println("Option 7 - dwarf #7");
// yeah i don't know the name of the dwarf, deal with it!

int ans=Integer.parseInt(br.readLin());
switch (ans)
case 3: System.out.prinltn("youyr answer is correct!");
result ++
break;

default : System.out.println("Your answer is wrong");
break;

// now copy the same set of code from the print till my last break. after doing that 6 more times i.e. 7 question in total, do this

if ( result = 7)
System.out.println("You got a gold star ")'

else

System .out .println("you are dead");

I think this should be enough. All the best! Feel free to PM, i am expert at java programs
[Off-topic] slow_DC4:
^What he said.

Instead of using BufferedReader, I would use the Scanner's nextInt() method, that way you wouldn't have to use the parseInt() method (just personal preference). Also the last "if" statement has to be changed to ==.
[Off-topic] Enraged21:
Thanks man!

I'll definitely try this out when I get home.
[Off-topic] anasdcool71:
It would be "br.readLine()", not br.readLin()"....and == instead of = in 'if' statement....incase you don't know how to import io and initialize BufferedReader, here's the code :-

import java.io.*;
public class your_class_name
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
//rest of the previous code that ak700 wrote
}//end of method
}//end of class

That's it! You've done your homework!
[Off-topic] Enraged21:
lol Thanks everyone!
[Off-topic] ak700:
Yeah I know. Just gave him a framework outline.
[Off-topic] anasdcool71:
Don't open {} for 'case'....
[Off-topic] Enraged21:
I don't think that made a difference.

Plus case 1 is still computing wrong and I can't figure out why.

I formatted it the same way as case 0.
[Off-topic] anasdcool71:
I think i got it. Use 'else if' after the first 'if', instead of so many 'if blocks. And why are you adding the previous tax in each 'if' statement?

System.out.println("Sent from my SGY");
[Off-topic] Enraged21:
It wouldn't compute any other way
[Off-topic] Enraged21:
same problem still. Not computing case 1 properly.

Enter test case: 1

Enter taxable amount: $300339

Tax is: $76,932.87 (When it should be $78,777.87)

So I'm only off by a little
[Off-topic] stephj:
Have a look at this:

http://www.maxi-pedia.com/tax+rates+2009+schedule+table

Mainly the part after the tax calculator.

You only need to calculate the tax for the last unfilled tax band. The tax due for the lower filled tax band(s) is a fixed amount.

The tax owed on 300339 is (300339-171550) * 0.33 + 41754.00 = 84254.37

Try it in the calculator on the page above.

41754.00 is the sum of the tax due on the 10% to 28% bands.

Which is:

10% 835.00
15% 3840.00
25% 12075.00
28% 25004.00
[Off-topic] Enraged21:
I'm on to Assignment 4. Its on the Luhn Validating Credit Cards.

Issue i'm having with this assignment is no matter what test cases I run, each Credit Card number I test is coming out valid when at least one of them should be invalid.

Here's the code:

import java.util.Scanner;

public class javaAssign4 {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

System.out.println("Enter Credit Card number: ");
long ccNum = input.nextLong();
int number = 0;

long total = sumEven(number) + sumOdd(number);

if (isValid(total)) {
System.out.println("The Credit Card number is valid.");
} else
System.out.println("The Credit Card number is invalid.");
}

public static boolean isValid(long total) {
if (total % 10 == 0) {
return true;
}
return false;
}

public static int sumEven(long number) {
int sum = 0;
int remainder;
number %= 10;
while (number % 10 != 0 || number / 10 != 0) {
remainder = (int) (number % 10);
sum += sumResult(remainder * 2);
number /= 100;
}
return sum;
}

public static int sumResult(int number) {
if (number > 9) {
return (number % 10 + number / 10);
}
return number;
}

public static int sumOdd(long number) {
int sum = 0;
int remainder;

while (number % 10 != 0 || number / 10 != 0) {
remainder = (int) (number % 10);
sum += sumResult(remainder);
number /= 100;
}
return sum;
}

}

Here are the test cases:

Case 1:

Enter a credit card number as a long integer: 4246345689049834

4246345689049834 is invalid

Case 2:

Enter a credit card number as a long integer: 4388576018410707

4388576018410707 is valid
[Off-topic] shanman-2:
Try using 'if' instead of 'while' and divide by 2 to determine if the number is odd or not.

sent from the....
[Off-topic] Enraged21:
Tried. Can't seem to get it right.
[Off-topic] Enraged21:
Java Programming

Assignment 4

Project: Validating Credit Cards

Problem Description:

Credit card numbers follow certain patterns. A credit card number must have between 13 and 16 digits. It must start with:

4 for Visa cards

5 for Master cards

37 for American Express cards

6 for Discover cards

In 1954, Hans Luhn of IBM proposed an algorithm for validating credit card numbers. The algorithm is useful to determine if a card number is entered correctly or if a credit card is scanned correctly by a scanner. Almost all credit card numbers are generated following this validity check, commonly known as the Luhn check or the Mod 10 check, which can be described as follows (for illustration, consider the card number 4388576018402626):

1. Double every second digit from right to left. If doubling of a digit results in a two-digit number, add up the two digits to get a single-digit number.

2 * 2 = 4

2 * 2 = 4

4 * 2 = 8

1 * 2 = 2

6 * 2 = 12 (1 + 2 = 3)

5 * 2 = 10 (1 + 0 = 1)

8 * 2 = 16 (1 + 6 = 7)

4 * 2 = 8

2. Now add all single-digit numbers from Step 1.

4 + 4 + 8 + 2 + 3 + 1 + 7 + 8 = 37

3. Add all digits in the odd places from right to left in the card number.

6 + 6 + 0 + 8 + 0 + 7 + 8 + 3 = 38

4. Sum the results from Step 2 and Step 3.

37 + 38 = 75

5. If the result from Step 4 is divisible by 10, the card number is valid; otherwise, it is invalid. For example, the number 4388576018402626 is invalid, but the number 4388576018410707 is valid.

Write a program that prompts the user to enter a credit card number as a long integer. Display whether the number is valid or invalid.

_______________________________________________________________________________________________________

Here's the program if that would help someone help me.

I'm still completely lost here.
[Off-topic] Enraged21:
bump to anyone who knows?
[Off-topic] slow_DC4:
I think what it's doing is that you put 0 (number) rather than ccNum into sumOdd and sumEven methods, which makes total = 0. The Boolean method sees this and uses 0.

This is from what I can see on my phone though, so I could be wrong.
[Off-topic] Archer:
You're setting ccNum as input and then passing number (which is 0) into the sum functions, both of which are wrong because you're just getting the remainder of dividing by 10 (4574187456446 % 10 == 6).

Both those functions need rewriting and you need to pass ccNum to them.
[Off-topic] Enraged21:
so if i'm not supposed to pass ccNum as an input, how should I rewrite that?

because after originally posting this assignment for help, i tried changing the sumEven and sumOdd methods and that didn't work either

my brain is just fried
[Off-topic] slow_DC4:
You are supposed to set ccNum as an input.

In your code, you have:

long ccNum = input.nextLong();
int number = 0;

long total = sumEven(number) + sumOdd(number);

when it runs, it sees it as:

long total = sumEven(0) + sumOdd(0)

what you want is

long total = sumEven(ccNum) + sumOdd(ccNum);

Also your sumOdd and sumEven methods are not doing what they are supposed to be doing. It seems you should break ccNum into an array and loop through to get the values at each element and do whatever math depending on the index.
[Off-topic] stephj:
This C# code does the job. Porting it over to Java should be easy enough.

using System;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace ValCredNum
{
public partial class Form1 : Form
{
Regex rx = new Regex("[^0-9]");
char[] txtchr = new char[16];

public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
int chksum = 0;

if (text1.Text.Length != 16)
{
label2.Text = "Not 16 digits";
}
else
{
if (!rx.IsMatch(text1.Text))
{
text1.Text.CopyTo(0, txtchr, 0, 16);
for (int i = 0; i < 16; i++)
chksum += ((i % 2) == 1) ? txtchr[i] - '0' : ((txtchr[i] - '0') * 2) / 10 + ((txtchr[i] - '0') * 2) % 10;

label2.Text = (chksum % 10 == 0) ? "Checksum valid" : "Checksum invalid";
}
else
label2.Text = "Characters not numeric";
}
}
}
}
[Off-topic] Enraged21:
Onto a new assignment.

I have a coupe questions with this one.

Here's the program:

The Noah's Ark program.

The scenario is this: you are on Noah's ark with a set of animals. As the months pass, the animals begin to breed. You need to keep track of your animal inventory down below.

The ark has 3 types of animals: mammals, birds, and fish. Your program should have at least 2 kinds of mammals (cat, dog), 2 kinds of fish (goldfish, shark), and 2 kinds of birds (eagle, parakeet). You should start the program with 2 animals of each species on the ark, one male and one female.

The program should give you a menu such as follows:

You have been on the ark for 1 month. Would you like to:

1.	Add new Animals

2.	Check how many animals are here

3.	Print all animals

Repeat the above statement for 12 months.

When adding new Animals:

All animals have a name and type (Male or Female)

Structure

There should be parent class of mammal. The child class of mammal will be dog and cat. Ie cat extends mammal.

The parent class will have the basics of all mammal.

Name, Type (Male or Female)

Constructor

Method for a sound – use print statement for sound

Method for eat – use print statement for eat

Ensure that the children classes override the sound and eat methods to produce different outputs.

Overload the eat method in the children classes with a string parameter. – print the string passed in

Same should go for birds and fish. Both of these are parent classes . The child classes would be goldfish and eagle. Ie goldfish extends fish.

How can I make a sub menu, if 1 was chosen, to have an input to ask the user if it's male/female and store that information that was inputted by the user?

Also, I'm not getting what the program is asking me to do. I need to have 4 main classes (Animals, Mammals, Fish, Birds) and 6 subclasses (Cat, Dog, Goldfish, Shark, Eagle, Parakeet) is that correct?

Last, the last part is a blur to me.

"Method for a sound – use print statement for sound

Method for eat – use print statement for eat

Ensure that the children classes override the sound and eat methods to produce different outputs.

Overload the eat method in the children classes with a string parameter. – print the string passed in"

all i have is a bunch of print statements. Don't know what to do..

Program also says to use an Array or an ArrayList to store animals but I still don't get arrays. They make no sense to me no matter how many tutorials I watch; and teacher doesn't quite help
[Off-topic] Enraged21:
So as dumb as it sounds, I don't know how to implement any of it or know where to put what.

I know I need an ArrayList for adding animals if I need too.

and some kind of a loop to loop through each month for the menu.

All this would go in an Animal class.

What goes into the Mammal class and what goes into the Cat class?

To me it seems a lot harder now that I have to use more classes so I don't know what goes where
[Off-topic] Archer:
It sounds to me like they're trying to teach you about inheritance here. You'd create a class of animal, then a class of mammal that inherits animal and therefore has all the same properties and methods, but can also have new ones.
[Off-topic] Enraged21:
null
[Off-topic] Enraged21:
I've worked on a little.

import java.util.Scanner;

public class NoahsArk {

public static void main(String[] args) {

System.out.println("You have been on the Ark for 1 month. Would you like to: ");
System.out.println("1. Add new Animals");
System.out.println("2. Check how many animals are here");
System.out.println("3. Print all Animals");
System.out.println("4. Proceed to the next month");
Scanner input = new Scanner(System.in);

String continueChoice = "4";
while (continueChoice.equals("4")) {
int choice;
choice = input.nextInt();

}

}

}

import java.util.ArrayList;

public class Animals extends NoahsArk {

String name;
String type;
String gender;
int numberOfAnimals = 0;

public Animals (String name, String type, String gender){
this.name = name;
this.type = type;
this.gender = gender;
}

ArrayList<Animals> animals = new ArrayList<Animals>();

public void addAnimal(Animals ann) {
Object animals = null;
((ArrayList<Animals>) animals).add(ann);
}

public int getNumberOfAnimals() {
return animals.size();
}

}

I havent obviously finished but I get stuck quite frequently. I'm trying to make option 4 loop through the menu again, but going onto the next month.

I have to make a way to store inputs from the user such as the animal type, name, and gender and store it within a class. I'm using an ArrayList method.

How would I finish that off for option 1?

How can I merge all this in one class. I'm trying to have my "type" classes such as mammals, birds, and fish extend from Animals, but Animals extends from NoahsArk so its explicit.
[Off-topic] slow_DC4:
import java.util.Scanner;

public class NoahsArk {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);
int month = 1;
int choice = 0;

do{

System.out.println("You have been on the Ark for "+month+" month. Would you like to: ");

System.out.println("1. Add new Animals");
System.out.println("2. Check how many animals are here");
System.out.println("3. Print all Animals");
System.out.println("4. Proceed to the next month");

choice = input.nextInt();

switch (choice){
case 1: //Method to Add animals
break;
case 2: //Method to check amount of animals
break;
case 3: //Method to print animals
break;
case 4: month++;
//Move to next month
break;
}
}
while (choice <= 4);
}
}

Animals doesn't extend Noah's Ark. The types of animals extends from Animals.
[Off-topic] Archer:
You should go back to your teacher and tell them that you don't understand and you need some help.

Coming on here and asking people to do this for you is just masking that fact. You're not going to learn a thing and you'll never be able to program if you carry on.

Why don't you start asking for help with individual portions, like abstract classes and inheritance, rather than saying "make my homework for me".
[Off-topic] Enraged21:
Online class. Tried that already. No help from anywhere.

I'll stop clogging up this thread now.
[Off-topic] Archer:
Keep asking for help, by all means. I was just expressing my opinion that you're not actually going to learn anything if other people just do it for you.
[Off-topic] Enraged21:
No I completely agree.

I practice as much as I get a chance but that's not often. While at work I read/watch tutorials and try and learn new things but its usually the same thing I learned. Full time work + full time school isn't easy. I'm pretty sure most of you know that.

I was just hoping someone could tell me how to structure it, which I understand now, tell me what I'm doing wrong and point me in the right direction. I'm gonna work on the code some more this week and see what I get from there
[Off-topic] Enraged21:
Semester is almost to an end. So this thread will not be needed after these last two assignments. Can anybody take a look over my code and help me make adjustments where need be?

Here's the program:

Here's my code(just one of my classes):

import java.util.Scanner;

public class McDonalds extends Restaurant {
private String name;
private String location;
private boolean hasPlayPlace;
Scanner input = new Scanner(System.in);

public McDonalds (String name, String location, boolean hasPlayPlace) {
setName(name);
setLocation(location);
setHasPlayPlace(hasPlayPlace);
}

McDonalds location1 = new McDonalds("McDonalds", "Kirkman", false);
McDonalds location2 = new McDonalds("McDonalds 2", "International Dr.", true);

public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLocation() {
return location;
}
public void setLocation(String location){
this.location = location;
}
public boolean isHasPlayPlace() {
return hasPlayPlace;
}
public void setHasPlayPlace(boolean hasPlayPlace) {
this.hasPlayPlace = hasPlayPlace;
}

public void totalPrice() {
double totalPrice = 0;
double tax = 0.06;
totalPrice += (totalPrice * tax);
}

public void menuItems() {
double mcChicken = 1;
double fries = 1.25;
System.out.println("1. Mc Chicken $1");
System.out.println("2. Fries $1.25");
int choice = input.nextInt();
switch (choice){
case 1: mcChicken *= tax;
case 2: fries *= tax;
}
}

public void location() {
//Don't know what's supposed to go in here.
//But I've implemented the method as I was supposed to.
}
}
[Off-topic] Whowahn:
Runescape's in the air.

You Live To Die.
[Off-topic] Enraged21:
Huh??
[Off-topic] Enraged21:
Bump?
[Off-topic] Enraged21:
willing to make a paypal donation to anyone who can help me out...
[Off-topic] Enraged21:
no one?
[Off-topic] LoopDoGG79:
You made this thread on Sept 02 , you still working on it!? :what:
[Off-topic] Enraged21:
Different assignments...
[Off-topic] LoopDoGG79:
So thread is more like java class, not homework. :rolleyes:
[Off-topic] slow_DC4:
I took a quick look at your code, but why are you creating Mcdonalds objects in your McDonalds class. That should be in your test class. Also in your location() method, what do you mean you don't know what goes there, but you've implemented it correctly?

Also, I would post your question in a forum dedicated to java programming, or programming in general. Nothing against this site, it's just that you might get more responses.
[Off-topic] Super2cool:
I stood behind Samsung when Apple bringing unjust charges on against them. I thought Samsung was the defender of Android and the truth but I was WRONG.

Recently, I learned that Samsung promised to take a blogger to the IFA as an independent reporter. This means that the blogger could basically cover whatever he wanted. However, Samsung LIED to him. He was taken to the IFA but he was only allowed to demonstrate Samsung products to the press. He was not actually able to review any products and instead was treated as a Samsung employee.

They even told him that if he doesn't do what he is told then Samsung will leave him in this foreign country. EVIL!!!

Don't believe me? Take a look at the source:

Samsung is Evil
[Off-topic] 063_XOBX:
Scratch that. It's definitely true, however,

And that's from the site the blogger is from.

Article here.
[Off-topic] with33:
Nothing true about that noy a single facts pretty sure it was written by some isheep in hopes that it would make appke look less of a monster.

Use some common sense next time please though i suspect we both knew this was bs lol dumb isheep.
[Off-topic] veeman:
That article is posted by you. Nobody is going to believe you until you provide a link to a reputable source.
[Off-topic] Super2cool:
Its not trolling.. its posted all over the web.

Don't be in blind trust of a corporation... They are not humans.

Take a look here if you don't believe me:

http://thenextweb.com/insider/2012/...oggers-halfway-around-world-threatened-leave/
[Off-topic] MissionImprobable:
Yeah, 'slave labor'; I recall an article about all those slaves being flown across the world, put up in a hotel, all expenses paid and such. So the guy couldn't have covered IFA on his own in his free time? [sarcasm]What a horrible life [/sarcasm]
[Off-topic] Super2cool:
Ok I guess did exaggerate a bit!

However, it is still unacceptable for Samsung to lie to him and then threaten him to leave him in Berlin where the IFA was hosted.
[Off-topic] 063_XOBX:
Sounds more like the Blogger was trying to catch a free round trip to IFA on Samsung's dime without offering anything to them in return. I am waiting for Samsung to chime in (they will) and hear both sides. Then I'm waiting for the inevitable leak of emails or call records or whatever. Then once I know the actual story I will have an opinion.
[Off-topic] Super2cool:
It seemed too good to be true.. but still Samsung should have been more clear of what they expected from the blogger.
[Off-topic] LordManhattan:
This is what happens when you agree with the terms and conditions and choose to ignore them after you've signed. Don't expect Samsung to hold their word when you don't.

(I'm assuming there were some papers that needed to be signed {that you didn't read}. Samsung is after all a multi billion dollar corporation)
[Off-topic] Super2cool:
Yeeah.. they were some papers to sign and this all probaly legal when looking at the papers.

However, it still unethical when you are knowingly trying to scam a person (sort of a scam.. I guess? ..don't know exactly what to call it)
[Off-topic] 063_XOBX:
What is unethical about somebody paying for your trip and lodging and expecting something in return? Samsung has no obligation to pay for bloggers to travel to big events.