|
Regardless of who you find, the chances are very high you will get ripped off if you have "no experience"; either intentionally or through misunderstandings. In particular, beware of the "up front" payment. Ask to see the "work" (and retain a copy) before paying anything, or you will be sorry.
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 automating a login procedure that involves email validation which means there can be 15 minutes till i even get to the start of the automation. so it would be nice to pick up where i left off. how exactly would i do that? i tried
options.setExperimentalOption("debuggerAddress", "127.0.0.1:9222");
but i cant connect to port. any other way?
|
|
|
|
|
Here is that simple but magical Java and Python code. You can easily convert it into a Programming language of your choice.
Java Code
System.setProperty("webdriver.chrome.driver", "C:\\selenium\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("debuggerAddress", "127.0.0.1:9222");
WebDriver driver = new ChromeDriver(options);
System.out.println(driver.getTitle());
|
|
|
|
|
First off I am a newbie and I hope you can understand what I trying to imply, thanks for understanding.
the problem is its seem my method cant pass the string value that inputted by user
Imgur: The magic of the Internet[^]
I want to convert the input of faculty id and name as one string and return it as string when show the data.
this is the uml view, I aware the uml may differ with my code, but the big picture of implementation still same.
[^]
this is the code that solely focus on Faculty view
the fragment of the code is here
Data access object contain method add, delete, show
package penugasan;
public class DataAccesObject {
private Database dataBase;
private long currentFalcutyID;
private String currentFalcutyName;
private long currentStudentID;
private String currentStudentName;
public String string;
public String name;
public DataAccesObject() {
this.dataBase = new Database();
}
public boolean deleteFaculty(Long ID){
final Faculty[] faculty = this.dataBase.getFaculty();
for (int i = 0; i < faculty.length; ++i) {
if (faculty[i] != null && faculty[i].getID().equals(ID)) {
faculty[i] = null;
return true;
}
}
return false;
}
public boolean createFaculty(Long ID, String name){
final Faculty faculty = new Faculty(ID, name);
this.currentFalcutyID = ID;
this.currentFalcutyName = name;
final Faculty[] faculty2 = this.dataBase.getFaculty();
if (faculty2[ID.intValue()] == null) {
faculty2[ID.intValue()] = faculty;
return true;
}
return false;
}
public String readFaculties(){
String string = "";
final Faculty[] faculty = this.dataBase.getFaculty();
for (int i = 0; i < faculty.length; ++i) {
if (faculty[i] != null) {
string = string + faculty[i].getID() + " " + faculty[i].getName() + "\n";
}
}
return string;
}
public Faculty readFacultyByName(String name){
final Faculty[] faculty = this.dataBase.getFaculty();
for (int i = 0; i < faculty.length; ++i) {
if (faculty[i] != null && faculty[i].getName().equals(name)) {
return faculty[i];
}
}
return null;
}
}
Facultyview
package penugasan;
import java.util.Scanner;
public class FacultyView {
private DataAccesObject dao;
public String name;
public FacultyView(DataAccesObject dao) {
this.dao = dao;
}
public void start() {
this.showFaculty(this.dao.readFaculties());
System.out.println("Faculty View Menu : ");
System.out.println("1 Create Faculty");
System.out.println("2 Delete Faculty");
System.out.println("3 Main Menu");
System.out.print("Input your choice : ");
final String nextLine = new Scanner(System.in).nextLine();
if (nextLine.equals("1")) {
this.createFaculty();
}
else if (nextLine.equals("2")) {
this.deleteFaculty();
}
else {
if (nextLine.equals("3")) {
return;
}
System.out.println("Unrecognize Menu\n\n");
this.start();
}
}
public void showFaculty(final String name) {
System.out.println("\n\nList Of Faculty : ");
System.out.println(name);
}
public void createFaculty() {
System.out.print("\nInput ID : ");
final String nextLine = new Scanner(System.in).nextLine();
System.out.print("Input Name : ");
final String nextName = new Scanner(System.in).nextLine();
this.dao.createFaculty(Long.parseLong(nextLine), nextName);
this.start();
}
public void deleteFaculty() {
System.out.print("\nInput ID : ");
this.dao.deleteFaculty(Long.parseLong(new Scanner(System.in).nextLine()));
this.start();
}
}
Class Database to store array of Faculty
package penugasan;
public class Database{
private Faculty[] faculties;
public Database() {
Faculty faculty = new Faculty();
}
public Faculty[] getFaculty() {
this.faculties = new Faculty[10];
return faculties;
}
}
package penugasan;
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
DataAccesObject dao = new DataAccesObject();
FacultyView facultyView = new FacultyView(dao);
StudentView studentView = new StudentView(dao);
while(true){
System.out.println("\nMain Menu : ");
System.out.println("1. Student");
System.out.println("2. Faculty");
System.out.println("3. Exit");
System.out.println("Input your choice : ");
Scanner scanner = new Scanner(System.in);
String choice = scanner.nextLine();
if (choice.equals("1")){
studentView.start();
}else if (choice.equals("2")){
facultyView.start();
}else if(choice.equals("3")){
System.exit(0);
}else {
System.out.println("Wrong Choice");
}
}
}
}
for full code here
https://codeshare.io/G88rDB[^]
modified 27-Sep-19 20:58pm.
|
|
|
|
|
Please edit your question and add the proper details, correctly formatted, rather than links to other sites.
You can also find lots of useful information at The Java™ Tutorials[^].
|
|
|
|
|
Is this good, really sorry if the format still messy
|
|
|
|
|
Yes, the formatting is correct, thank you. However, it is no good just dumping the code with a simple, "I want to do ..." statement. You need to explain in proper detail what is not working and where in the code the problem occurs.
|
|
|
|
|
I'm working on a Java Swing application that will allow users to add index cards to a virtual corkboard. One of the big functionalities I want is for the user to be able to drag and drop cards to reorder them. I don't want to simply position cards at the exact X and Y mouse coordinates where the user releases the mouse button, getting that to work would be relatively trivial. I want the cards to "snap" into place, in a FlowLayout.
Problem is I'm not sure how to accomplish that with the typical MouseListener and MouseMotionListener. Right now my code is organized into a sort of MVC architecture. Here is my code on Github. Everything is just being committed to master for now.
I'm working with a sort of loose MVC type architecture. I have a MainController that has all other child controllers as it's properties. All the other child controllers also take the MainController instance in their constructors. The MainController basically controls the main JFrame of the app and the menu bar. It also acts as a hook for all of the other controllers to communicate with each other.
The ProjectController controls mouse and key events on the "corkboard" area.
The AddCardController is pretty simple, just controls the Add a card window.
Here's where it gets tricky:
The CardController controls mouse events on a particular card. Each card has an instance of the Card model, and it's own CardController, and it's own CardTemplate in the views folder. So every card the user creates is basically an instance of CardController. All the CardControllers are stored in an ArrayList on the MainController. And because every card on the board has it's own CardController, the EditCardController is created inside CardController, so those two are tied together.
This kind of works okay, but I have no idea how to get drag and drop with snapping to work with this architecture (or any architecture for that matter). Each CardTemplate -which is kind of just a component, it extends JPanel but I put it in the views folder for some reason (probably need to change that)- has it's CardController as it's MouseListener.
Can anyone give me advice on how to organize my code so that I can do dragging and dropping with snapping? Should I even hope to use a MouseListener or MouseMotionListener for this?
|
|
|
|
|
|
A SMS API is well-defined software interface which enables code to send short messages via a SMS Gateway.As the infrastructures for SMS communications and the internet are mostly divided, SMS APIs are often used to 'bridge the gap' between telecommunications carrier networks and the wider web. SMS APIs are used to allow web applications to easily send and receive text messages through logic written for standard web frameworks
|
|
|
|
|
Please don't repost if your question does not appear immediately: all of these went to moderation and required a human being to review them for publication. In order to prevent you being kicked off as a spammer, both had to be accepted, and then I have to clean up the spares. Have a little patience, please!
I've deleted the other version.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
There really is no "best" that applies to everyone; what is best for your application is going to depend more on what your capabilities are in any given language
Director of Transmogrification Services
Shinobi of Query Language
Master of Yoda Conditional
|
|
|
|
|
There is no best language, your program should be taken into account.
|
|
|
|
|
Java and Microsoft .NET are two leading technologies intended for the development of desktop and server-side applications. Both platforms enable the use of high-level programming languages to build large-scale applications. While both Java and .NET are often referred to as frameworks, only .NET is actually a framework in the strictest meaning of this word. In fact, the .NET platform uses ASP.NET as a web application framework to allow developers to create web apps.
|
|
|
|
|
How to create restaurant reservation booking using a Java code?
|
|
|
|
|
The same way you would do it in any programming language:
- Gather the requirements of the project
- List the inputs and outputs of the project
- Create an overall design (UML diagrams)
- Create the detailed design for each phase or sub-project
- Design the test requirements
etc.
|
|
|
|
|
Hi guys,
I know how to write code in Java (basic and intermediate level). However, I have very little experience in looking at other peoples' code (experts) and understanding those. I know this is very much required in the industry. I would like to understand how architectures, e.g. MVC and design patterns are implemented by experts.
Therefore, I am asking your recommendations for existing GITHUB projects for learning. I would like to look at a project with the following properties:
1. Built with CORE java. It should have some sort of GUI (maybe JavaFX, which I know isn't CORE java).
2. Followed some architecture and design patterns.
3. It can be a game for example.
4. It should have at least some documentation.
I have searched GUTHUB projects and too much choice has overwhelmed me. Please provide your valuable suggestion so that I can at least start somewhere.
Bye.
|
|
|
|
|
|
Try to see some other forums maybe it will help.
|
|
|
|
|
|
I wanna create a library for sending notification to my android app but i don't know how it works and what kind of data i should give to the function in the class. this is my code for sending notification but i don't know how to put it in the class for using in another sections of the app. This code works in MainActivity
Intent intent = new Intent(context, MainActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder b = new NotificationCompat.Builder(context);
b.setAutoCancel(true)
.setDefaults(Notification.DEFAULT_ALL)
.setWhen(System.currentTimeMillis())
.setSmallIcon(R.drawable.ic_launcher_background)
.setTicker("Hearty365")
.setContentTitle("Default notification")
.setContentText("Lorem ipsum dolor sit amet, consectetur adipiscing elit.")
.setDefaults(Notification.DEFAULT_LIGHTS | Notification.DEFAULT_SOUND)
.setContentIntent(contentIntent)
.setContentInfo("Info");
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(1, b.build());
|
|
|
|
|
My simple HttpServlet is called twice everytime I invoke on my endpoint:
http://cdctst1j:15611/TomSampleServlet/TomSampleServletClient
Could you please help me to take a look?
It is very simple.
My files:
1. WEB-INF\classes\TomSampleServletClient.java:
import java.io.IOException;
import java.net.URL;
import java.net.HttpURLConnection;
import java.lang.ClassNotFoundException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public final class TomSampleServletClient extends HttpServlet {
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
xxxx;
xxxx;
}
}
2. WEB-INF\web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<servlet>
<servlet-name>TomSampleServletClient</servlet-name>
<servlet-class>TomSampleServletClient</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TomSampleServletClient</servlet-name>
<url-pattern>/TomSampleServletClient</url-pattern>
</servlet-mapping>
</web-app>
Thanks so much.
|
|
|
|
|
Knowing not much about "servlets", maybe "mapping" something to itself might be something?
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
I am developing a standalone Java application using an embedded Derby database. Can someone help me understand how I could create all the tables of the database should they not exist within the Java code itself?
|
|
|
|
|
Gregory Guy wrote: Can someone help me understand how I could create all the tables of the database An impossible question to answer. You need to com back with a specific detailed question. And if you are not sure how to use Derby, then go to Apache Derby[^].
|
|
|
|