In search of a genius

I'm in big trouble ... I'm way behind in my project and I've got a very simple problem that is wrecking my head. Here's a simplified version of the problem ...
import java.net.*;
import java.io.*;
public class CheckStream1 {
private ObjectInputStream inStream;
public CheckStream1() {
try {
ServerSocket serverSocket=new ServerSocket(23456);
Socket mySocket=serverSocket.accept();
System.out.println("Accepting connection");
inStream=new ObjectInputStream(mySocket.getInputStream());
System.out.println("reading from Client");
int message=getMessage();
System.out.println("you got mail");
catch(IOException e) {
System.exit(0);
public int getMessage() {
try {
System.out.println("Trying to receive an int");
int received=inStream.readInt();
System.out.println("Message received");
return received;
catch(IOException e) {
System.out.println("EXCEPTION");
System.out.print(e);
System.exit(0);
return 0;
public static void main(String[] args)throws Exception {
new CheckStream1();
import java.net.*;
import java.io.*;
public class CheckStream2 {
private ObjectOutputStream outStream;
public CheckStream2() {
try {
Socket newSocket=new Socket("LOCAL-HOST", 23456);
outStream=new ObjectOutputStream(newSocket.getOutputStream());
send();
catch(IOException e) {
System.exit(0);}
public static void main(String[] args)throws Exception {
new CheckStream2();
public synchronized void send() {
System.out.println("trying to send an int");
try {
outStream.writeInt(123);
System.out.println("successfully sent an int");
catch(IOException e) {
System.exit(0);
So as you've guessed I want to send messages from client to server and eventually vice versa. The error I'm getting is a SocketException claiming that the connection was reset by a peer. I'm using Windows 98 SE. Could someone please tell me how I can fix this problem so that I can get my project back on track and make it into 4th year? The InStream just doesn't seem to be reading anything. HELP!
Thanks in advance
NIALL

Thanks all .. I figured it out, all your points were valid but not quite the answer. I didn't literally mean "Local-Host" as the string, I was using an appropriate one. flush() isn't required in this particular situation. Anyway it doesn't matter ... I just thought I should post again to say I managed to get it working :) and I love you all for helping ;)

Similar Messages

  • Searching for a genius

    I'm doing this third year project and fast running out of time. All I need now is a board representation. Can someone please tell me that it is possible to paint an Object (say a red counter) on a jpg or gif? I know zilch about graphics so could someone please inform me how to place an object on a jpg background, then for it to disappear and reappear somewhere else? If I could get that far then I would be able to finish off my networked board game in under an hour. This is the part that I've put on the long finger and I've come to the best for guidance. I've read some of the stuff posted here and you guys are unbelievable!

    try this:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MoveIt extends JFrame
    public MoveIt()
         addWindowListener(new WindowAdapter()
              public void windowClosing(WindowEvent e)
                   dispose();
                   System.exit(0);
         setSize(700,400);
         Board board = new Board();
         getContentPane().add(board);
         board.setLayout(null);
         Planet pl1 = new Planet("f1.gif");
         pl1.setBounds(20,20,100,100);
         board.add(pl1);
         Planet pl2 = new Planet("f2.gif");
         pl2.setBounds(220,220,100,100);
         board.add(pl2);
         setVisible(true);
    public class Board extends JPanel
         Image img;
    public Board()
         img = getToolkit().getImage("usa.gif");
         MediaTracker tracker = new MediaTracker(this);
         tracker.addImage(img,0);
         try   {tracker.waitForID(0);}
         catch (InterruptedException e){}
    public void paintComponent(Graphics g)
         super.paintComponent(g);
         g.drawImage(img,0,0,null);
    public class Planet extends JLabel
         int mx,my;
    public Planet(String name)
         super(new ImageIcon(name));
         addMouseListener(new MouseAdapter()
         {     public void mousePressed(MouseEvent m)
                   mx   = m.getX();
                   my   = m.getY();
         addMouseMotionListener(new MouseMotionAdapter()
         {     public void mouseDragged(MouseEvent m)
                   int x = getX() + m.getX() - mx;
                   int y = getY() + m.getY() - my;
                   setLocation(x,y);
    public static void main(String[] args)
         new MoveIt();
    }Noah

  • The new update is terrible!!!! I can not access search or genius in my ipod store

    Every time i try and search or use genius on the app store it closes and frankly i'm getting fed up and it's apples loss as i can't buy the apps i'm searching for

    I have the same exact problem! Please fix apple!

  • Choices at bottom of app store application change randomly

    After updating my iPhone 4 to iOS 6 the choices at the bottom of the app store application changes every few times I access the application. Sometimes they are from left to right Featured, Genius, Charts, Search, Update and some other times they are Genius, Search, Update, Charts, Genius.
    has anyone else noticed such a behavior?

    Yes. That is quite normal. The order doesn't matter.

  • Itunes app no longer showing genres or the top charts/genius bar in the top bar ... it only displays a faint music in the centre with just the search box..why? i need them back:-(

    itunes app no longer showing genres or the top charts/genius bar in the top bar ... it only displays a faint music in the centre with just the search box..why? i need them back:-(

    The iTunes Store listing of your podcast is simply reflecting the contents of your podcast feed. Make sure all of the content you want displayed in the iTunes Store is still contained within your feed.
    Are you able to supply your feed for reference?

  • I upgraded my iphone 4S to ios 6 two weeks ago and yesterday when I tried to go into my App Store the only ares that I could get was Genius, Genius Categories, and Updates..can't get Apps or search in Apps. Anyone else having this issue?

    Is anyone having an issue with the App Store since upgrading to ios 5?  I have iphone 4S and upgraded two weeks ago to ios 5, and yesterday I tried to access the App Store and could only get Genius and Updates....no App Store and couldn't search or go to Catagories in App Store!

    I couldn't find the edit button on my original post so I am posting an update here.
    I have gone through more apps and have had good luck on all but one more.  And it's not that the app doesn't work, I am talking about the Yahoo Weather app, It works fine, but when you swipe between cities the screen lags a bit and it sometimes doesn't move between pages the way it should.  On iOS 7.1.2 it was smooth as butter but on iOS 8.0, not so much.  I will post a note in the app store to let them know.  I really like the Yahoo app better than the new stock app.
    I have been going through my games and they all work fine. Angry Birds (Original and Stella), Canabalt, Minecraft, Bejeweled 2, Silly Walks, PopWords, Doodle Jump, Deep Green all seem to work just fine. 
    Starbucks app works as it should. 
    I will stop back again next week after I have had the weekend to play with it in detail and post my thoughts again.

  • It's been 4 days now my App Store show 2 message it means that I have to update some applications but every time I open my App Store and press update it only shows blank page but if I press genius, top charts, featured, search I can browse them

    It's been 4 days now my App Store show 2 message it means that I have to update some applications but every time I open my App Store and press update it only shows blank page but if I press genius, top charts, featured, search I can browse them

    It's been 4 days now my App Store show 2 message it means that I have to update some applications but every time I open my App Store and press update it only shows blank page but if I press genius, top charts, featured, search I can browse them

  • HT201272 Why can't I search any apps in the store?  I can only see the ones that the Genius thing recommends for me.  This is on my iPhone 4S .

    Why can't I search the App Store on my iPhone 4S?  All I can do is search the recommended ones from Genius.  What do I need to do?

    Apple’s having trouble with the iTunes Store servers right now. Wait for them to resolve the issue.
    Feel free to check up on the issue @ http://www.apple.com/support/systemstatus/
    This outage started @ 5am est (~10 hours ago).
    I'm disappointed in Apple's inability to do the smart thing, and post a notice in the header of the site, this is a user-wide issue, you don't just hide the fact it's happening behind a server status page.

  • I can't search for apps in App Store why not? Genius still works but not search?

    Why can't I search for apps but can still use genius?

    I have same issue. It will let me know to update apps.
    But if I want to search an app my friend may have. Nothing comes up after typing it in the search bar.
    Same with the featured apps or the star charts , nothing comes up.
    Now I just updated my iPad and so far so good. But my iPhone 4S is the problem since upgrading to ios6.
    What to do.....
    Apple...... You shouldn't rush these things.... Take your time and make it right .....
    Any ideas .. Guess we just have to wait for apple to fix the issue...

  • I stumped a Genius Bar guy on two iPhone points

    I recently went to the Soho Apple store and went over all my issues that I have with my iPhone. Most of them I have seen discussed over and over since the release (see my long list below). However here are two issues I have not seen discussed that are highly problematic. When I brought them up to a Genius Bar guy, he said I had found all the issues he knew of and didn't even know about these two:
    First, from your contacts, if you click on an address to look it up in Maps, if that adress contains a Fl.#, Flr.# Fl # Fl. # Floor # or anything like that, Maps cannot find the address. If you delete the Floor number out of your contact, Maps locates the address without issue. Living in NYC, I have a lot of addresses with floor numbers, so this is really annoying.
    Second, if you are on the phone, you cannot edit an existing contact, or create a new one. Why this is the case completely baffles me. Essentially, I have to write down someone's info if they give it to me over the phone and then add it after I've hung up.
    I hope apple takes note of these two biggies and also...my long list of issues:
    No copy and paste
    USB recognition in iTunes is buggy, though better since updates
    Cannot txt to mutliple addresses or forward txts
    No picture texting
    Freezes and crashes of all kinds, though better since updates
    No search feature for address book; Spotlight please??
    Email doesn't flip sideways like Safari
    General volume is too low for phone, external speakers, ringer and alerts
    Calender is not color coded for categories
    No Flash
    All that said, I love my iPhone. I just hope Apple goes the distance in raising it from a B+ to and A+ device.
    Note: I recently went to Scotland for a week. I texted quite a bit, made a few phone calls here and there and had $24 in additional charges on my bill. Not too bad. Just be sure to keep airplane mode on whenever you can, don't use Safari or any web based widgets and you shouldn't ring up a big bill overseas.

    if that adress contains a Fl.#, Flr.# Fl # Fl. # Floor # or anything like that, Maps cannot find the address.
    Google Maps used to have the same problem with Suite, St, #, etc, didn't it? Those seem okay now.
    For fun, I just tried your "Flr#" variations using Google Maps for Windows Mobile (which is almost the same as iPhone but without animated pushpins). That version also fails to find the address... unless it's spelled out explicitly as "Floor", which works.
    So it appears to be a Google problem. We should try the direct Google web service to confirm.
    PS. So I started thinking. Hey, Google has a big office in New York. They even work on Maps there:
    http://www.google.com/support/jobs/bin/static.py?page=why-ny-ny.html
    So don't they ever look up themselves? Wouldn't they figure out that "Flr" was a problem? Haha, no. Because their address is listed as:
    76 Ninth Avenue
    4th Floor
    New York, NY 10011
    With "Floor" spelled out. Which works

  • In Adobe Bridge, how can I display keywords in their hierarchy, do an "aka" keyword assignment, and perform multi-value keyword searches?

    Hi Bridge Geniuses!
    I need your help. I am using Bridge to sort and keyword a pretty big photo archive. I have created a pretty long nested hierarchy (4 layers deep, max) and, for a few reasons, would like the parent tags to be automatically included when I indicate a sub-tag.  The problem I have now is that the keyword list is distractingly long and organized alphabetically. My first question is this: is there a preference setting in Bridge that will ask the program to display the keywords in their hierarchy? That is, will Bridge present the list as, for example, cars à hybrids à Toyotas à Prius. 
    My second question is: if I have two or more names that represent the same keyword, is there an “aka” function in this program that will allow me to direct searches for two or more different words to the same keyword entry? (For example, if I want my searches for “Bruce Wayne” to also show entries marked as “Batman.”)
    Finally, I would like to know if Bridge will perform keyword searches for more than one word at a time. So far, I have tried entering two keywords with overlap at a time, separated by a space or a comma or a semicolon, and the search comes up empty.
    Thank you very much for your help!

    I reset my custom workspace and all seems to be well now. My keywords now show, the number of photos each applies to and I can again search.
    Thank you.

  • IMac is running slow again after upgrading Memory to 6 GB 800 MHz DDR2 SDRAM.  Mail is especially slow.  I have searched the community info, but I am really a novice and most of the solutions appear to be beyond my level of proficiency. Please help!

    I am at a loss. even after reading other questions and responses.  After upgrading to Mt. Lion, everything on my iMac slowed down.  I knew more memory would be needed, so I went from 2G to 6G.  That worked for awhile, but now, about 3 weeks later, things are slowing down again.  Mail is especially slow, when moving from one message to another, and also just plain typing is delayed in mail.  iPhoto has had the spinning wheel issue since change to Mt. Lion, but it eventually stops and the app itself is functional, so this is just annoying as much as anything.
    Any easy, simple to follow instructions would be appreciated.  Is it better for a novice to take to the Genius Bar or to an approved Mac repair center in my area, rather than attempt some of the solutions I've seen offered here.  And, if I do, what's the likelihood the issues will be resolvable?? Clearly, I am not the only one with this issue ...
    Thanks for any help you can offer.

    There are a few other possible causes of generalized slow performance that you can rule out easily.
    Reset the System Management Controller.
    If you have many image or video files on the Desktop with preview icons, move them to another folder.
    If applicable, uncheck all boxes in the iCloud preference pane.
    Disconnect all non-essential wired peripherals and remove aftermarket expansion cards, if any.
    Check your keychains in Keychain Access for excessively duplicated items.
    Boot into Recovery mode, launch Disk Utility, and run Repair Disk.
    If you're booting from an aftermarket SSD, see whether there's a firmware update for it.
    Otherwise, take the steps below when you notice the problem.
    Step 1
    Launch the Activity Monitor application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Activity Monitor in the icon grid.
    Select the CPU tab of the Activity Monitor window.
    Select All Processes from the menu in the toolbar, if not already selected.
    Click the heading of the % CPU column in the process table to sort the entries by CPU usage. You may have to click it twice to get the highest value at the top. What is it, and what is the process? Also post the values for % User, % System, and % Idle at the bottom of the window.
    Select the System Memory tab. What values are shown in the bottom part of the window for Page outs and Swap used?
    Next, select the Disk Activity tab. Post the approximate values shown for Reads in/sec and Writes out/sec (not Reads in and Writes out.)
    Step 2
    If you have more than one user account, you must be logged in as an administrator to carry out this step.
    Launch the Console application in the same way you launched Activity Monitor. Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Select the 50 or so most recent entries in the log. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V). You're looking for entries at the end of the log, not at the beginning.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some personal information, such as your name, may appear in the log. Anonymize before posting. That should be easy to do if your extract is not too long.

  • I bought my MacBook pro in May 2012. for whatever reason the screensaver will not turn on. Took it in to genius bar. They said the software had to be deleted and reloaded. Which they did around 3 weeks ago. Everything was working fine. Now anymore again

    Is anyone else having problems with their screen saver not turning on?  My was working when I first bought the lap top. Then it stopped activating, I could get it to come on from a hot corner, or if I powered off the lap top and the next time I would boot on it would work for a few days but then it would stop. Made an appointment with the Genius bar and they suggested to wipe clean the HD and re-install the software Mountain Lion.  Which was done.  It worked fine for a few weeks, now it has stopped again, and I can not even get it to stay on by activating it from the Hot Corners.
    Anyone else having the same problem?  And if so what have you done to try and correct it?  Apple ran a check on my MacBook and they said there is nothing mechanically wrong with the MacBook that it is the software?????

    Back up all data.
    Triple-click anywhere in the line below to select it:
    pmset -g assertions
    Copy the selected text to the Clipboard (command-C).
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V).
    Post any lines of output that appear below what you entered — the text, please, not a screenshot.

  • Hello  I don't know who to complain to as you do not appear to have a complaints department, despite searching the web, I trust you can pass this to relevant department for action, as I'm very angry over my recent repair.  Following my issue relating to a

    Hello
    I don't know who to complain to as you do not appear to have a complaints department, despite searching the web, I trust you can pass this to relevant department for action, as I'm very angry over my recent repair.
    Following my issue relating to a blank screen 2 weeks ago, your advisor arranged for my iMac to collected by Amsys, for repair and return, this was done and it was returned to me last Tuesday, onWednesday I set up my iMac again and instantly realised I had problems, much worse than before. I called Amsys to inform them of the issue of the computer being very very slow and unable to open iPhoto and pages, and document listing would not show up, plus I had no sound on the mac.They informed me that they had only replaced the video card and what they had done would have not affected the computers performance. He suggested I reinstall OSX again which I did, but this made no difference to the programs, so I called you.
    Your technician on the phone was very good as they have always been, and made an appointment for me to go into the Milton Keynes Apple store the next day at 1 pm, which I did.
    The gentleman on the Genius Bar was very good and was able to run tests on the iMac in my presence, and diagnosed immediately an issue with the sound problem, and advised me that this could not be fixed while I wait and I would need to leave it for repair. I made him aware of the previous repair, and he was able to see via your system, the list of logged issues I have had with this since purchasing in September 2012. I'm sure you can see from the way you record all calls and issues the problems I have had.
    Today I called to ask if my iMac would soon be ready for collection, I was told the repairs had been completed and it was being tested. However to my dismay, I learned of another serious issue relating to the repair carried out by Amsys. I was informed that 6 screws were missing from the the iMac internally, which caused me much distress and concern, they also told me I had to wait even longer as the screws had to be ordered and installed on arrival before I could collect it.
    My issues here are: I trusted the Amsys repairer as it was arranged and recommend by you, it is very evident they are not competent to repair, as they have caused more problems with my iMac on its return, despite enclosing a checklist, fully ticked showing everything working well, it clearly wasn't ! Plus the issue of missing parts (screws) during the repair, I have already expressed my disgust with Amsys, by email and had a response, within the hour, apologising and told me they were looking into this.
    This where I stand on this, I have not had my iMac for  almost two weeks and I do not know when I will get it back. I'm also very worried about what other damage has been caused by Amsys and the quality of my iMac now. I want to know what you, Apple is going to do about this ? I have already been very inconvenienced by this and until now I have been a very loyal apple customer with 2 iPads, and 4 iPhones in our household, not to mention the iMac.
    I feel I have been very let down by this experience, on my iMac, which cost a lot of money, I have also lost a lot of money with lost work and unable to carry out my business without it, and I will be seeking compensation.
    I trust you will take this complaint seriously and pass it to the relevant department for action.
    Yours sincerely
    Des Withey 
    Sent from my iPad
    On 26 Feb 2014, at 11:44, Apple Support <[email protected]> wrote:
    Thanks for contacting us.
    Thanks for contacting Apple Support. If you need more help later, you can open the case below or start a new support request online.
    Case ID:
    Open this case
    Sincerely,
    Apple Support
    Get help online
    Visit Apple Support to learn more about your product, download software updates, and much more.
    Join the conversation
    Find and share solutions with Apple users around the world.
    TM and copyright © 2014 Apple Inc. 1 Infinite Loop, MS 96-DM, Cupertino, CA 95014.
    All Rights Reserved / Privacy Policy / Apple Support / Give us feedback
    On behalf of Apple Distribution International

    Call Apple Customer Relations - 1-800-275-2273.  Ask politely & firmly that you want to be transferred to Customer Relations.  Tell them exactly what you stated in your post.
    GOOD LUCK!
    These are user-to-user forums where everyday folk (volunteers) post questions and offer answers (technical support) to each other.  

  • I have a Mac notebook and it says it's connected to wifi, but when I try to connect to any search engine it does not.  What is causing it to not actually connect.  My pc connects no problem.

    It seems that all apple products used in my house at times will not connect to our wifi.  It's hit and miss.  It says I am connected, but when you try to connect to any search engine it does not.  I have disconnected and reconnected the power to the dsl provider and to our wifi units.  I have rebooted the computers.  I have reentered the password.  Still no connection.   We do not have connectivity issues with our PC products.  Anyone have any answers for me?

    Does the iOS device connect to other networks?
    Does the iOS device see the network?
    Any error messages?
    Do other devices now connect?
    Did the iOS device connect before?
    Try the following to rule out a software problem:                 
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on your router
    .- Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections
    - Wi-Fi: Unable to connect to an 802.11n Wi-Fi network
    - iOS: Recommended settings for Wi-Fi routers and access points
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    If still problem make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar

Maybe you are looking for

  • Result set is too large; data retrieval restricted by configuration

    Hi, While executing query for a given period, 'Result set is too large; data retrieval restricted by configuration' message is getting displayed. I had searched in SDN and I had referred the following link: http://www.sdn.sap.com/irj/scn/index?rid=/l

  • Year to Date error ?

    Hi I have following problem The amount inivoiced from 1st of january 2007 till 18th of march 2007 = *1500* The amount inivoiced from 1st of january 2008 till 18th of march 2008 = 1980 filtering on date 18th of march 2007, the ToDate(amount, year) ret

  • Setting the cookies in jsp

    Hi Iam trying to add the cookie into local machine.Problems is i written cookie program in cookietest.jsp then i incude this jsp into index.jsp.When iam accessing the index.jsp cookies are not setting But when iam acessing cookietest.jsp cookies are

  • Magic keyboard stopped working after latest OS X updates (June 2013)

    My iMac: Just performed the latest OS X updates (M Lion) that appeared sometime late May or June 2013. I think the updates were some camera updates and iTunes, and some other things that needed a restart of the computer. After reboot the magic keyboa

  • EXPORT FILE을 SPLIT하여 받는 방법

    제품 : ORACLE SERVER 작성날짜 : 2002-04-19 EXPORT FILE을 SPLIT하여 받는 방법 ================================= PURPOSE 이 자료는 export시 2GB이상의 export dump file을 만들지 못하는 제약사항에 대하여 여러 export file로 나누어 받는 방법을 설명한다. Explanation !!! IMPORTANT: 이 방법은 반드시 KORN SHELL (KSH)