Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Arwa Saad

Greenhorn
+ Follow
since May 05, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Arwa Saad

Hello,
I'm creating a sentiment app using SentiStrength tool.
The problem is that this tool look up for file for comparing purposes. I have placed all the file this tool need in HDFS.
When I try to open it from the map function, it says that it couldn't find the file.

This is the code


As you can see, I have to place the path to this file. I'm sure it is in HDFS but why is can't find it?
4 years ago
Thank you so much Karthik Shiraly! Now it make sense !
I appreciate it
4 years ago
So, I'm working on twitter sentiment analysis. I have created a Reader.java that read twitter, clean them and store them in HDFS. Then the Map function will take the input and do the sentiment work.
Currently, I'm collecting a small number of tweets, but I thought, if I collect a huge number wouldn't be best to put the Reader work in the Map function? for the sake of handling Big data?
I tried doing it but the Map function show me a problem, that there is a need for input.

I'm confused, can anyone explain which solution is the best? Keep Reader or add the code to Map and do some workout for the input file?

Thanks,
4 years ago

Ulf Dittmer wrote:I see. You will most likely still run into the problem of the server not being able to contact the receiving machine (unless they're both on the same network).

If you somehow manage to overcome that, the usual approach to finding the IP of the receiver is to have the receiver check in with the server when the app on the receiving machine starts up. Then the server will have the IP (along with some ID that the receiver had better send, so that the server knows which client/user is running on that machine).



Yes , they are on the same network
also , I manged to get reciver ip by making the sender send it along with the message .

Thank you

----

I still have problem with the following


1/How multiple client can connect with the server ?
I read about the threads but I didn't know where to put it

2/ How the server check if reciever is connected ?



anyone ?

So the server is a Java web app, and your app will run on the sending and receiving cell phones? Since I see Java code for the "client", is this supposed to be a JME or an Android app?



No , the server is not web and my app will work on computers
I forget to mention it but it's not like a real " SMS " system . it's like computers can send to each other short messages through server

Hi ,
I'm creating an SMS application ( It's not a real SMS system , it will work with computers which they can send to each other short messages through server )
where
- The client will type the message ( doesn't exceed 160 ) and the recipient client IP address
- The client will send through the server
- A server receives messages from clients, stores them, and forwards them when the recipient client is connected

The problem :
Client :

1/ How to send the recipient client IP to server ?
In sendPacket , the IPAddress will be server address ( client send through the server ) , I also need to put the receiver IP somewhere where server will forward the msg to recipient client
but I didn't know where to put it


Server :
1/How multiple client can connect with the server ?
I read about the threads but I didn't know where to put it

2/ How the server check if reciever is connected ? I found this code but I'm not sure about it


I found about method Reachable but for some reason it always return false

Here the complete code
Client


Server :


Thank you and I hope you help me

Michael Dunn wrote:you have 3 textFields, with keyListeners on each
before you type anything, their getText() would return an empty string ("")

you type a character into one of the textFields, and your code tries to parse
all 3 textFields at the same time, so when it tries to parse "", it will error

you could test for the source in your KeyListener code, but do you really
want the listener firing on each keyStroke?

A button ("Calculate") might be better suited for the user to press when all
textfields have input data.



thanks you so much !
I understand the problem now and I fixed in my way
here the soultion if anyone want



all I did was that I added 0 to the string !
if the user entered number for example 5
it will be 05 and it's the same as 5 !
but if he entered a char g
it will be 0g --> throw exception !

I'm really thankful for all the great ppl here
thank you so much ! this problem have been bother me for almost a 3 weeks !




8 years ago
Michael Dunn I'm really sorry
that was a bad behaivor from me !
I should have thanked you before
8 years ago

Now , I have another problem
whenever I press a key wither number or letter
it will throw exception !

here the code :


I only need it to throw exception if he entered a letter !
anything wrong with my code ?
8 years ago
I fixed one my problem
so I needed to create an object from JPanel !

now I only need to know that if he entered non-numeric value a new frame will pop out
is there an ActionListener for this ?
8 years ago

Read your code carefully. To what container do you add the JLabel text? Does that have anything to do with the new JFrame?



conatiner cp is the new container
and in this step , I added it to the newest



but you right ! how can I tell the compiler that the new container is for the new JFrame ?
that's one of my problem + thanks for the link , I'll check it

Your new JFrame doesn't block input in the original frame. You need a modal JDialog for that, or easier use JOptionPane and its static methods.



If I can I would do JOptionPane but she only want new frame with JLabel
8 years ago
Hi

I have a question
The teacher asked us for a this code

Using Exception Handling, allow only numeric values to be entered for the dimensions of the shape. If the user enters a non-numeric value, a popup window (i.e., another frame) should appear with a suitable error message displayed in a large font (use JLabel for this message). Make the popup window block input in the original frame until it is closed.



The proplem is where to put the try/catch thing ?
if I put it in the main the compile says it's empty string

sp I moved it to method actionPerformed
it worked but the conainer for the new frame is empty ! although I put Jlabel in it
can you help me ?

this is my try

8 years ago