|
|
I am looking for a medium size open-source project on Github that extensively uses automated tests and the test suites are very well. The testing framework they use is not important but I guess I would prefer JUnit.
I am seeking to see the "state of art" in usage of automated tests in a software project..
Please let me know your opinions and suggestions.
|
|
|
|
|
Member 14677234 wrote: Please let me know your opinions and suggestions. If you are looking for something on Github, you are unlikely to find it here.
|
|
|
|
|
Hi!
I have come up with an idea for an app, and as I googled, I understood that my app should be using Java. So we produce collars for pets and we want to develop some kind of service that could track the current location of a pet and how active it is at the moment.
I don't think that a freelancer would be able to make it, so we're thinking about hiring an outsourcing/offshoring IT company. Any advice about choosing a Java company? Or maybe you have some companies in mind which could help us with the app?
Thanks!
|
|
|
|
|
You are starting from the wrong position. Forget about which programming language to use and concentrate on the actual requirements of your application. The first thing you need is a fairly detailed design spec which you can use to get quotes from different companies. Let the professionals advise on what language to use, based on their experience.
|
|
|
|
|
Thank you very much for the advice, Richard! I'll stick to it 
|
|
|
|
|
Your assumption that "outsourcing / offshoring" is somehow better than a "freelancer" is faulty. You can (and will) get hosed by anybody; especially if you're not an IT "expert" yourself. Be especially wary of the "up front" payment requirement. Anyways, a "Fitbit" "collar" solves half your problems.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I am new to Java, but to expand my knowledge of it. Below is a project that I'm having a very, very difficult time completing. I need to create a method that passes in a two dimensional string array and then sorts the array by the second element.
Method sortContacts()
o Declared as a public static method, it should take a two-dimensional String array as a parameter,
and an integer value for the number of contacts in the array
o Returns nothing
o Sorts the contents of the contact list given as a parameter using the lastName as the sorting
field
o You may use any of the sorting mechanisms described in the text (bubble, insertion or selection)
o Key concept: as you implement the sort, the trick is to identify the dimension for the values you
are comparing and how they relate to the values from your loops.
o Hints:
Do not rely on the array’s length for your loops, instead use the value from the number
of contacts
Your temp variable will be an array of size 3, String[] temp = new String[3];
You will need to use the string1.compareTo(string2) method to compare two strings.
My biggest problem is where to put the temp array.
Sample data: (first name, last name, phone number)
String [][] contactsArray = {
{"Emily","Watson","913-555-0001"},
{"Madison","Jacobs","913-555-0002"},
{"Joshua","Cooper","913-555-0003"},
{"Brandon","Alexander","913-555-0004"},
{"Emma","Miller","913-555-0005"},
{"Daniel","Ward","913-555-0006"},
{"Olivia","Davis","913-555-0007"},
{"Isaac","Torres","913-555-0008"},
{"Austin","Morris","913-555-0009"}
<pre>public static void sortContact(String[][] contactsArray, int numContacts) {
String[] temp = new String[3];
String [] words = contactsArray[3];
for(int i = 0; i < numContacts-1; i++)
{
int smallest = i;
for(int j = i + 1; j < numContacts-1; j++)
{
System.out.println("First: "+words[j]+" " +"Second "+words[i]);
if(words[j].compareTo(words[i]) < 0)
smallest = j;
}
words[i] = words[smallest];
words[smallest] = temp[i];
}
}
There are tons of examples for integer arrays but not a lot for string arrays,
Any suggestions are appreciated.
|
|
|
|
|
Sorting strings is just the same as sorting any other type. The only difference is how you compare the two items to see which should come first. Also, it is not clear exactly what your problem is.
|
|
|
|
|
I need my output to look like this (without the quotes or braces):
{"Brandon","Alexander","913-555-0004"},
{"Joshua","Cooper","913-555-0003"},
{"Olivia","Davis","913-555-0007"},
{"Madison","Jacobs","913-555-0002"},
{"Emma","Miller","913-555-0005"},
{"Austin","Morris","913-555-0009"},
{"Isaac","Torres","913-555-0008"},
{"Daniel","Ward","913-555-0006"},
{"Emily","Watson","913-555-0001"}
I'm new to discussion boards so I may not be presenting the questions/answers properly. Any suggestion about how to explain better are appreciated also.
|
|
|
|
|
Your question states that you are to sort a two dimensional array, but I do not see how that matches with this data. I do not know if this is your homework or you picked a question from some other website. Either way you need to clearly state the structure of the input data, and how it needs to be changed by your code.
|
|
|
|
|
I'm sorry if I misspoke about it being only a two dimensional array.
My array is is set up as
String [][] contactsArray = new String[30][3]; (data provided in first post)
I'm passing the multidimensional array into the Method sortContacts() as one of the parameters. Once the data is passed, I need to sort the array based on the second element (last name).
I know how to use the sample coding below for a single string, but can't figure out how to apply this to a multidimensional array
for (int i = 0; i < num; i++)
{
for (int j = i + 1; j < num; j++)
{
if (names[i].compareTo(names[j])>0)
{
temp = names[i];
names[i] = names[j];
names[j] = temp;
}
}
}
|
|
|
|
|
My apologies also, i misunderstood the question. The issue is that you need to compare the surnames of each entry, and swap the two entries if the first one is greater than the second. This means swapping all three items in the array entry. The following code should do it.
void sortContact(String[][] contactsArray, int numContacts) {
String[] temp = new String[3];
boolean changes;
do {
changes = false;
for(int i = 0; i < numContacts; i++) {
for(int j = i + 1; j < numContacts; j++) {
if(contactsArray[i][1].compareTo(contactsArray[j][1]) > 0) {
temp[0] = contactsArray[i][0];
temp[1] = contactsArray[i][1];
temp[2] = contactsArray[i][2];
contactsArray[i][0] = contactsArray[j][0];
contactsArray[i][1] = contactsArray[j][1];
contactsArray[i][2] = contactsArray[j][2];
contactsArray[j][0] = temp[0];
contactsArray[j][1] = temp[1];
contactsArray[j][2] = temp[2];
changes = true;
}
}
}
} while (changes == true);
}
|
|
|
|
|
In the following example the setBackground() for the TextField element won't work if it is in a Pane inside a ScrollPane which has the style "-fx-background: transparent;" added, but the problem is that I need it, in order to make the ScrollPane transparent. The weird part is that setBackground() works just fine for the Label element I used in this example. I can not use a CSS file in my original project.
Is this a bug or is there a walk-around for this problem?
To test it, just change the following line
Scene scene = new Scene(scroll);
in this:
Scene scene = new Scene(pane);
public class TestingTextFieldBackground extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
Pane pane = new AnchorPane();
pane.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, CornerRadii.EMPTY, Insets.EMPTY)));
pane.setPrefWidth(500);
pane.setPrefHeight(500);
pane.setLayoutX(0);
pane.setLayoutY(0);
ScrollPane scroll = new ScrollPane();
scroll.setContent(pane);
scroll.setLayoutX(0);
scroll.setLayoutY(100);
scroll.setPrefWidth(500);
scroll.setPrefHeight(400);
scroll.setHbarPolicy(ScrollBarPolicy.NEVER);
scroll.setVbarPolicy(ScrollBarPolicy.ALWAYS);
scroll.setStyle(
"-fx-background: transparent; -fx-background-color: transparent; -fx-padding: 0; -fx-background-insets: 0;");
Scene scene = new Scene(scroll);
scene.setFill(Color.TRANSPARENT);
Stage stage = new Stage();
stage.setWidth(500);
stage.setHeight(500);
stage.initStyle(StageStyle.TRANSPARENT);
stage.setScene(scene);
Label label = new Label("Bellow you'll find our clients data. (This text is used just as an example)");
label.setLayoutX(0);
label.setLayoutY(0);
label.setTextFill(Color.YELLOW);
label.setBackground(new Background(new BackgroundFill(Color.BLACK, CornerRadii.EMPTY, Insets.EMPTY)));
pane.getChildren().add(label);
int up = 100;
for (int i = 0; i < 50; i++) {
TextField text = new TextField("Client with ID: " + i + ", has " + up + " dollars in account.");
text.setLayoutX(0);
text.setLayoutY(up);
text.setPrefWidth(450);
text.setBackground(new Background(new BackgroundFill(Color.DARKRED, CornerRadii.EMPTY, Insets.EMPTY)));
pane.getChildren().add(text);
up += 80;
}
stage.centerOnScreen();
stage.show();
}
}
modified 27-Nov-19 12:40pm.
|
|
|
|
|
You need a CSS file with the following lines:
.scroll-pane > .viewport {
-fx-background-color: transparent;
}
This will make the gray area transparent. After that if you want to make the whole ScrollPane transparent, then set it a background with .setBackground() function.
Like this, .setBackground() will work just fine for the nodes that you have problem with.
modified 7-Jun-20 16:06pm.
|
|
|
|
|
function exerciseOne(){
(;;)
for(let i=0; i < 7; i++){
console.log("This is i:",i);
}
console.log(str);
}
function exerciseTwo(){
let count = 0;
for (var i = 0; i < 10; i++) {
count ++;
}
return count;
}
modified 10-Nov-19 17:19pm.
|
|
|
|
|
Are you certain this is Java? It looks more like Javascript to me.
|
|
|
|
|
it is I picked the wrong category sorry I am pressed for time and still working on 1 more assignment because i cannot start the final until i figure these two out and the dead line is tonight
|
|
|
|
|
Is there any way you could still take a look at it for me I have moved it to web dev JS thanks I was just in a hurry they moved the deadline up two weeks on us because of the holidays!!
|
|
|
|
|
Does anyone know how to implement global histogram equalization in java. Thank you
|
|
|
|
|
Often, using the search function leads to remarkably appropriate results. Please, use it.
Code Project: Histogram Equalisation in Java[^]
"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."
|
|
|
|
|
hello guys , I want to store biometric attendace machine data to my local SQL Server 2008 R2, how can i do it ? have you any idea about it
|
|
|
|
|
Yes, it is the same as storing any other data to SQL. Create tables and columns to hold whatever data you wish to keep.
|
|
|
|
|
Find manual. Open manual. Turn to section on "interfacing", file formats, stuff like that.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Hey guys! I want to develop a program on Java for desktop (Windows and MacOS). My app is on engineering calculations in the construction. I want to hire a company on an outsource basis but I really don’t know how to choose and how to work with them. Maybe you know? I am just trying to get into it. I have no experience and now I am just collecting the info. Maybe you can help? 
|
|
|
|
|