peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Please provide a code if you do not want to see general trouble shooting questions...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

How can I possibly help any of you, if you do not tell me which way you actually displaying these contacts?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Hello all, I've been working on a project where I wish to retrieve two sets of information from a MySQL database using two prepared statements. When I try to do this I get a blank screen, but the first query is successfull executed. Any suggestion would be greatly appreciated.

Thanks.

Not normal behaviour. If adatapost will not solve it please provide code sample of you using.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

While writing and editing this program you have not been careful with brackets. Your class immediately close after main method and showaverage method is left out of the class. So either you move closing bracket at the end of showaverage or you put this method in new class (intern class).
dayForm is local variable so you cannot call it outside of the main method.
Here are correction to the program

public class Form2
{
	public static void main(String[] args){
	
		int[][] dayForm = { {25,15,28,17,19},
		                    {31,21},
		                    {23,24,19,18},
		                    {15,19,22},
		                    {14,17,13,18},
		                    {8,12}};
		
		int[][] boardForm = { {10,18,17,17,15},
		                      {16,9},
		                      {13,19,15,25},
		                      {11,10,8},
		                      {14,17,19,13},
		                      {11,4}};
		
		
		final int SIZE = 4;
		int[] totalday = new int[SIZE];
		
		showaverage(dayForm);	
	}

	public static void showaverage(int[][] arr)
	{
		int total,average;
		int form = 1;
		
		System.out.println("Day Students :");
		 for(int row = 0;row <arr.length;row++)
		{  
			total=0;
			average=0;
			
			for(int col = 0;col < arr[row].length;col++){
				total +=arr[row][col];
			}
			average = total / arr[row].length;
			System.out.println("Form "+form+" average students is "+average);
			form++;
		}
	}
}
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

>>(i)Uploading files(eg:jsp,war et al) to the server.
>>(ii)Code to extract .war files to a folder in the server.
These two are basically same and generally called as deployment.While doing deployment you can either upload all related documents file by file, or you can package documents into WAR file, copy on your server and restart server. Server on start will take care of WAR deployment

>>(iii)Using https for login forms
For this you need to first configure your server and after that you can develop for given task. However you better learn basic at first so later you can do some secure connections etc.

Suggested reading:

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Move that code to servlet, where it actually belong to, and in doing so you will enable yourself for better debugging.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Not sure what sort of research you playing at.
Ganesh5155 posted his requirements in hope that somebody will take pity on him and do his homework. Since hist first and also last post he did not care to comment on anything and not even tried to solve issue. Either he got answer on some other forum, or he sweet-talked some other student to show him solution or he did not submit and failed.
Personally I couldn't care less.If you do not show interest, why shall I help you at all...

Hi All,:)

After many research and referance that I have done I got the answer of Ganesh5155 questions but I am not sure weather my algorithm is right or not because I am in the process of learning Java. So I hope I could get some positive feedback,response and advise from all of you.:icon_smile:

Question (a):-/

Input Num 1=a //read a as an int a
Input Num 2=b //read b as an int b
Input Num 3=c //read c as an int c
Begin
Count average=(a+b+c)/3
End
Print "Count average"

Question (b):icon_frown:

Input Num 1=x // read x as 0<=100
Input Num 2=y//read y as odd numbers
Begin
y=x%2=1 //modulus by 2 gets 1
Total y=y+x //total up all the odd numbers
Total x=x+1//increase the x value
End
Print "Total y"


Thanks:)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

All 3 IDEs that I mentioned are very good. My preference is IntelliJ and I do not like Eclipse (GUI seems to be messy and configurations are over done, too many options equals too many chances to get something wrong). NetBeans is somewhere between these two...

kvprajapati commented: I agree. +11
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Eclipse, NetBeans, IntelliJ IDEA

Difficult to judge performance. In these days it is more matter of personal preferences.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You need to package your web application as WAR or EAR and deploy on Java server like Tomcat, JBoss etc. There is no need for JCreator...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I did not say you are child, I said someone may have set up child protection for online websites.

As I said before if you do not have password and the default access been changed your only way to get inside of Netgear is to do reset. This however has downside of erasing all setting from router and setting to factory default. The choice is yours.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There is no point in arguing about how long it will take. You can be "A" programmer in no time, but you can be "THE" programmer over period of years not days.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Seems to me, you asking wrong question... (didn't wanted to say stupid)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There are differences between A programmer and THE programmer.
A programmer just seeks short-cuts so he can put Java on his CV.
THE programmer makes everything possible to explore and understand the language...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There are numerous way how to do it like pass control from frame to frame, swap login jpanel with game jpanel

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

essential I appreciate your hard work, but in this case you just provided lazy student with full solution of his assignment and the person neither learn anything and neither said thank you for your work.
In the future if you similar request encourage person to try it on his/her own and just give them small partions rather then whole solution

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

JButton inherits setEnabled(boolean) method from AbstarctButton. When you initialized button set it to false . Once you reach section where you check if all question answered there you can change button state to enabled if everything is OK.
Is that what you been looking for?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Then there may be something wrong with your BD table as that query is just fine. Check this for example

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Take it on the code bases and try to convince other side that your suggestion is better working then the other's side. Instead of calling somebody "half-educated far-East gypsies"

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I suggest that both of you cool down and drop verbal abuse, even if it is mild

Only a coward, and some of them half-educated far-East gypsies will consider somebody else's patience and politeness, as a weakness.

Mr. essential bullcrap.

And I was being polite and patient to my honour, not yours.

Racism is not welcome on this forum and I'm surprised that Dutch person does such thing.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

first of all DO NOT RUSH. Take it steady, or don't do it at all. the only way to success is through work. as to where to start, google beginning java tutorials, and start learning and practicing. :D

good luck :)

We already took deliberation and provided everyone who cares to read it with following thread Starting "Java" [Java tutorials / resources / faq]
that happens to be top of Java forum.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

As expected, it is JavaScript assignment!

Moving to JavaScript section.

PS:If you read the chapter 12 plus chapter 11 you should be able to solve it easily...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
  1. Are you expecting everyone to have this book and know what you talking about? That is impossible.
  2. Your 2nd edition is year 2000 version. Why don't you use the latest one 4th edition? Or perhaps 3rd? Technologies in 2nd edition are nearly decade old, which is a lot.
  3. Is this a Java Server Pages assignment or JavaScript assignment?
  4. We only give homework help to those who show effort
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Welcome to daniweb boffin!

Dunno about video compression, there can be some odd request sometime. However there are plenty of these seeking help with C and C++ (if you do not mind answering beginner questions ;) ).

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Help with what? You can not expect people to investigate your code without problem description...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Welcome to daniweb Jessica.

Please understand this is not 24/7 instance reply service and people reply of their own concern not when somebody demands it.

Make sure that website is not blocked by your firewall at computer. Blocking website from Netgear is likely done in office environment or in case of child protection (instead of making this configuration for each computer on the network)

As in regards of access to your Netgear:

  • to gain access to Netgear use internet browser (Firefox, IE, Safari) and type http://192.168.0.1 (can be different if network IPs been custom configured)
  • default username and password if you did not change it is "admin" and "password"
  • if you changed this details previously and now cannot remember it, there is only one option left as far I know and that is RESET button at the rear of Netgear. BE WARNED, THIS WILL SET YOUR NETGEAR TO DEFAULT FACTORY CONFIGURATION AND REMOVE AND ADJUSTMENTS YOU MADE TO IT. PLEASE MAKE SURE YOU KNOW YOUR CONNECTION SETTINGS BEFORE DOING THIS. The reset button is mostly around plug for power adapter at the rear. For better idea where to locate it, check netgear.co.uk or *.com support section that also host latest firemware and various guides for users.
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Two options:
A) you pass Displayable object from form to form
B) or have "magic" method changeScreen to do the job as in this MIDlet

package contacts;

import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;

import memo.beans.Contact;

public class ContactMIDlet extends MIDlet{

    private Display display;

    public ContactMIDlet(){}

    public void startApp(){
        display = Display.getDisplay(this);
        changeScreen(CoreUI.MAIN_MENU);
    }

    public void pauseApp(){}

    public void destroyApp(boolean unconditional){}

    public void quitApp(){
        destroyApp(true);
        notifyDestroyed();
    }

    /**
     * Method to simplify movement from screen to screen
     * @param _uiClass specifies name of class to be used
     * as declared in the CoreUI interface
     */
    public void changeScreen(String _uiClass) {
        Displayable displayable;
        try {
            displayable = (Displayable) Class.forName(_uiClass).newInstance();
            ((CoreUI) displayable).setUIManager(this);
            display.setCurrent(displayable);
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * Overloaded method of changeScreen just pop-up any alerts as need it.
     * @param d
     */
    public void changeScreen(Displayable d){
        display.setCurrent(d);
    }

    public void changeScreen(String _uiClass, Contact contact) {
        Displayable displayable;
        try {
            displayable = (Displayable) Class.forName(_uiClass).newInstance();
            ((CoreUI) displayable).setUIManager(this, contact);

            display.setCurrent(displayable);
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}

interface CoreUI

package contacts;

import memo.beans.Memo;

public interface CoreUI {

    public final String MAIN_MENU = "contact.gui.MainMenu";
    public final String CONTACT_FORM = "contact.gui.ContactForm";
    public final String VIEW_CONTACTS = "contact.gui.ViewContacts";
    public final String EDIT_CONTACT = "contact.gui.EditContact";

    void setUIManager(ContactMIDlet _mgr);

    void setUIManager(ContactMIDlet _mgr, Contact contact);
}

where EditContact can look like this for start

public class EditContact extends Form implements CoreUI, CommandListener {

    private ContactMIDlet mgr;
    private Contact contact;
    private Command backCommand,  exitCommand,  saveCommand;

    /**
     * Default constructor
     */
    public EditContact() { …
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Isn't API explanation of Random and SecureRandom enough for you?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Use the Commons FileUpload package

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Yes, in doing so you basically remove the repeating code from all button action and have only one that does whole job with only need of integer as parameter.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You need a variable to keep track of currently selected product so you can effectively loop through whatever Collection class you use. Then once button pressed it will read current index position, depending on selected action you should check if requested move is possible and adjust current index position and as last call method to refresh GUI fields.

PS: I'm still half sleep, been just woken by phone :yawn:

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

>Last year I was in Czech republic ( very close to you?) please enter WWVDNZ in Youtube to see my wonderful travel videos and others so no need for exchange trips have been about there bought the T shirt and returned home where I now try to be serious again

Czech republic is our west neighbour. Nice videos from Prague, but no that is not Slovakia, sorry. Same as saying that New Zealand is Australia, simply doesn't mix.

>you are the type of guy I prefer to talk to as far as this (your)organization is concerned.

Dunno why I'm getting such harsh treatment,as far I'm concerned I haven't been offensive in any way. Personally I do not see daniweb as organization, but as community where people can participated of they own will.

>O yes my Youtube channel is clogz1947 and there are lots of ning links there for your other colleagues who received a very nice website to review and were helpless with the URL given to them.NING learning curve and now I own a Ning network as well see one of the videos for the link it took me 6 weeks to get familiar yeah

Ning is popular and successful network as I mentioned in the other thread and therefore has many videos on internet. As for the "other colleagues, they are just members on this website like me or you. I'm not responsible for their behaviour. If you are not happy with them …

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There goes me attempt in flames, no point to repair damage as it is not welcome.

PS: We have sheep in Slovakia too, so I can manage some exchange trip for you. On second though it may not work as I may be busy talking to friends from Amsterdam, Rotterdam and Eidhoven which are great laugh.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

No problem.
If I can advise, try to split your MIDlet and move in classes specifically these dealing with GUI. You will have to write of-course more code, but it will be easier to debug and maintain

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Plain text is OK if you looking for management of small amount of data and not necessary structured/organized. For the above task database would be suitable and I would go for serverless/embedded database like JavaDB, HSQLDB or SQLite then MySQL that need server installation as it gives you mobility

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I'm sorry if you feel offended by comment, but please understand that we go through hundreds of post daily to ensure that forums goes by desired rules which is not easy task.

PS: Gentlemen if you find some post offending or breaking forum rules please feel free to hit "Flag Bad Post" link next to the post and report it with a short explanation.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Ooops size() was incorrect it should be lenght().

Did you attached ItemStateListener to TextFields?

As I said this

public void itemStateChanged (Item item) {		
		if (item instanceof TextField) {
			String teste = ((TextField)item).getString();
			if (teste.size() > 0) {
				recordOK = true;
			}
		}

can be replaced by simple validation method such as

private boolean validation(){
    if(name.getString().length() > 0 && telefone.getString().length() > 0){
        return true;
    }
    return false;
}
Nathan Campos commented: Thanks very much!!!! +1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I am not sure what is wrong or what went wrong .
can you please explain.
clogz14

Hi , welcome to daniweb.
As in regards what Ezzaral meant when he snipped your URLs is that we do not like people posting links to their personal sites. It is far better it you set link in the signature options of Control Panel. Then you can just simply say "please check links in signature for more info". I hope this clarify the issue. If you have some questions you more then welcome to ask

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Your validation process is not working. You are listening for changes on TextField, but you actually never associated this listener with textFields (only associated with ChoiceGroup on line 58). Therefore boolean recordOK will never change state from false to true.
You are overcomplicating your life with setting various listeners that you do not need. Simple solution, on save command call validation method that will have boolean return type and there check if user entered any data.
Also

String teste = ((TextField)item).getString();
if (teste != "") {

can be replaced by

String teste = ((TextField)item).getString();
if (teste.size() > 0) {

Make this changes and let me know if you still have any problems with this MIDlet.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Hi

Can anyone tell me please How i can repair my RAM.

Thanks.

You cannot repair RAM, you can either ask replacement if you have warranty or throw it in the bin and get new one.

PS: If you continue with posting these ridiculous questions you would be looking on site ban soon

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

If you do so, I'm more then happy to check it out again.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Try this

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

No problem description, just dropped code with no comments and no code tags...
Bad, bad, bad!

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
  1. I think adatapost approach is better then messing around with JavaScript
  2. If you want help you better show code, we have no idea what you tried and blind advice will take forever
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Yes, something like that