₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,330,989 members, 8,448,112 topics. Date: Sunday, 19 July 2026 at 07:00 PM

Toggle theme

Csharpjava's Posts

Nairaland ForumCsharpjava's ProfileCsharpjava's Posts

1 2 3 4 5 6 7 8 9 10 11 12 (of 12 pages)

ProgrammingRe: How Do I Do My Analysis And Design? by csharpjava(m): 6:57pm On Jun 20, 2011
@Nov1ce
Try these series of videos on youtube, I found it very helpful when I was doing the same module and after completed the module I felt writing programming codes was like child’s play grin

1.01
https://www.youtube.com/watch?v=RRXe1omEGWQ&feature=related

1.02
https://www.youtube.com/watch?v=WvAHT3V_dlw&NR=1

Note that the word 'stereotype' means inheritance or interface.

You'll also find this presentation slide useful for turning your usecase diagram into class diagram:
http://www.authorstream.com/Presentation/tallurijkumar-64216-class-diagrams-uml-final-science-technology-ppt-powerpoint/
ProgrammingRe: I Want To Learn Computer Programming, What Language Should I Learn First? by csharpjava(m): 1:14pm On May 29, 2011
My advice for you is to start with C# and ASP.Net, this will allow you to start developing web applications straightaway.
ProgrammingRe: Who Will Hlp Me With Materials On Java? by csharpjava(m): 2:30am On May 25, 2011
Seun
No Fayimora, that's not how we do it on Nairaland. We don't discourage newbies, we welcome them and we answer their questions.
If there's an old thread that might be useful, we simply link to it. The first response a newbie gets shouldn't be "can't you search the forum?".  That won't do.
Thanks Seun, this is the kind of nonsense I find on other programming forums, they behave as if they own the programming language someone is asking for help about.
ProgrammingRe: Aspiring To Be Programmer: How To Cope by csharpjava(m): 7:14pm On May 21, 2011
A person that wants a career as a programmer should be ready to learn software architecture in addition to coding. In programming a programmer is an architect and a builder at the same time. Here are some useful links below relating to software architecture:


https://www.youtube.com/watch?v=RRXe1omEGWQ

http://www.agiledata.org/essays/objectOrientation101.html
ProgrammingRe: Abstract, Interface And Adapter Classes by csharpjava(op): 11:19am On May 21, 2011
Otuabaroku

You did not try at all. Why should you advise me to try it, when you know that it has an obvious short coming.
I have not tried it yet. Have you? If yes what were the issues found?
ProgrammingRe: Abstract, Interface And Adapter Classes by csharpjava(op): 11:45am On May 19, 2011
Just thinking aloud ;is there  any possible issue developing Mail application with RMI instead of SMTP in javamail API?
Try it with RMI and let us have the results of your Thinking Aloud Protocols so that we can analyse them here.
ProgrammingRe: Abstract, Interface And Adapter Classes by csharpjava(op): 12:13am On May 19, 2011
candylips
code with multiple interface inheritance can be nasty as well. sometimes u see code with an interface hierarchy running 10 interfaces deep
With multiple interface inheritance the methods are blank, the compiler will only use the methods you write in your class. But with multiple inheritance if there are two methods with the same name in the classes inherited and you do not sort this out in your class the compiller will pick anyone for you, this can lead to a serious bug in your program.

Let me know if there are issues I have not covered regarding nested interface inheritance.
ProgrammingRe: Abstract, Interface And Adapter Classes by csharpjava(op): 8:58pm On May 16, 2011
When will u use abstract class instead or interface and vice versa
When you need multiple inheritance from Abstact Classes in a language like Java that does not support multiple inheritance, then you'll need to use an interface.

C++ allows multiple inheritance but you must be sure you know what you are doing.
ProgrammingRe: Abstract, Interface And Adapter Classes by csharpjava(op): 1:13pm On May 16, 2011
Otuabaroku
@csharpjava , thank you for the explanation. From what you have explained, it seem to me they both have the same function and similar. The big question now is why should I use interface instead of abstract class or why should I use abstract instead of interface. Are there some occasion where abstract is better to use or are there some occasion where interface are better to use. What would inform your opinion when choosing between the two?
In Java and similar languages you cannot inherit more than one class so if you need to inherit more than one class then you'll need to create an interface. See example below on how to inherit one class and implement more than one interface:

public class SomeClass extends JFrame implements ActionListener, Shape
ProgrammingAbstract, Interface And Adapter Classes by csharpjava(op): 10:57am On May 16, 2011
For those that are interested in this information:

An Abstract Class - Does not allow you to create objects, you can only inherit from an Abstract Class and you must use all the Abstract methods in an Abstract Class in the class that inherits from it.

Interface - Is a class that only contains Abstract Methods, with no Attributes or Fields and you must use all the Abstract methods in an Interface when you implement it. It allows you to borrow from more than one class, by using the the word "implements" followed by a comma if using more than one interface Eg: public class SomeClass extends JFrame implements ActionListener, Shape - to as many as you want.

[size=16pt]An Adapter Class - Allows us to use 419 grin when using an interface[/size]

Abstract and Interface classes allow programmers to write applications that can work with each other. Eg: The software in a keyboard has an interface that allows it to work with the software in the monitor in order to display the characters on the screen.
ProgrammingRe: Please Does Anybody Know How To Use Matlab For Programming.please I Need it Urgently. by csharpjava(m): 6:50pm On May 15, 2011
There are good video tutorials on youtude to get you started:


https://www.youtube.com/watch?v=s1McIoTovsk

I've just realised that this thread was started in December 25, 2008 @ 04:06 AM
ProgrammingRe: Java Cafe by csharpjava(m): 1:27am On May 15, 2011
Dolemite

The code should look like this:

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class MovingBox extends JFrame implements ActionListener
{

private boolean isRight = true;
private JButton MoveLeftButton = new JButton("Moving Box Right"wink;
private JButton MoveRightButton = new JButton("Moving Box Left"wink;

public MovingBox()
{
       
     setTitle("Moving Box"wink;
setLayout(new FlowLayout());
add(MoveLeftButton);
add(MoveRightButton);
setSize(500,200);
setLocation(300,300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
MoveRightButton.addActionListener(this);
MoveLeftButton.addActionListener(this);
getContentPane().setBackground(Color.yellow);
setVisible(true);
    }
   
public void paint(Graphics g)
{
super.paint(g);

if(isRight == true)
{
g.drawRect(100,100,90,90);
g.setColor(Color.blue);
g.fillRect(100,100,90,90);
   

}
else
{
g.drawRect(300,100,90,90);
g.setColor(Color.blue);
g.fillRect(300,100,90,90);;
     

}
}

public void actionPerformed(ActionEvent e)
{
if(e.getSource() == MoveRightButton)
{
isRight = true;
repaint();
}

if(e.getSource() == MoveLeftButton)
{
isRight = false;
repaint();
}
}
}
public class runMovingBox {

public static void main(String[] args) {

new MovingBox();
}
}
ProgrammingRe: You Will Surely Want To See This by csharpjava(m): 10:55pm On May 14, 2011
Fayimora
Way to goooo,  Now we are talking,  nice one @csharp
Nice to know we share a common ground on this occassion
ProgrammingRe: You Will Surely Want To See This by csharpjava(m): 10:38pm On May 14, 2011
I commend you for your effort. Though I have not had the time to try out your software yet but when I do, I will check it for accessibility and usability, nowadays for a software to be very successful it has to undergo these accessibility and usability checks.

You can find out more at: http://www.usabilityhome.com
ProgrammingRe: Design And Implementation Of A Web Based Student Academic Record Generating System. by csharpjava(m): 10:50pm On May 11, 2011
It will be easier for you to use tables to present the data from the database see example below:

<html>
<body>
<?php
$dbhost = "localhost";
$dbuser = "dbusername";
$dbpass = "dbpassword";
$dbname = "dbname";
//Connect to MySQL Server
mysql_connect($dbhost, $dbuser, $dbpass);
//Select Database
mysql_select_db($dbname) or die(mysql_error());
// Retrieve data from Query String
$age = $_GET['age'];
$sex = $_GET['sex'];
$wpm = $_GET['wpm'];
// Escape User Input to help prevent SQL Injection
$age = mysql_real_escape_string($age);
$sex = mysql_real_escape_string($sex);
$wpm = mysql_real_escape_string($wpm);
//build query
$query = "SELECT * FROM StudentRecord WHERE ae_sex = '$sex'";
if(is_numeric($age))
$query .= " AND ae_age <= $age";
if(is_numeric($wpm))
$query .= " AND ae_wpm <= $wpm";
//Execute query
$qry_result = mysql_query($query) or die(mysql_error());

//Build Result String
$display_string = "<table>";
$display_string .= "<tr>";
$display_string .= "<th>Name</th>";
$display_string .= "<th>Age</th>";
$display_string .= "<th>Sex</th>";
$display_string .= "<th>WPM</th>";
$display_string .= "</tr>";

// Insert a new row in the table for each person returned
while($row = mysql_fetch_array($qry_result)){
$display_string .= "<tr>";
$display_string .= "<td>$row[ae_name]</td>";
$display_string .= "<td>$row[ae_age]</td>";
$display_string .= "<td>$row[ae_sex]</td>";
$display_string .= "<td>$row[ae_wpm]</td>";
$display_string .= "</tr>";

}
echo "Query: " . $query . "
";
$display_string .= "</table>";
echo $display_string;
?>
</body>
</html>
Source: http://www.tizag.com/ajaxTutorial/ajax-mysql-database.php
ProgrammingRe: Design And Implementation Of A Web Based Student Academic Record Generating System. by csharpjava(m): 10:23pm On May 10, 2011
ogzille
@csharpjava, he said web based!
My suggestion is the first step to creating a web based application with C# on a windows computer, the second stage is to deploy the application onto a web server.

The poster has not told us whether the application should be deployed onto a web server.
ProgrammingRe: Design And Implementation Of A Web Based Student Academic Record Generating System. by csharpjava(m): 12:28pm On May 10, 2011
I will recommend you use C# if you known some Java as the syntax are very similar. For the database I will recommend ms access. You will need to setup IIS on your computer so that you can test your application locally on a windows computer.
ProgrammingRe: Please Read by csharpjava(m): 5:19am On May 09, 2011
A kid can easily master pseudo codes and algorithms in no time but what separates the boys from the men is software architecture or analysis, modelling and design. You can find out more about some of the processes that are required at this link http://www.agiledata.org/essays/objectOrientation101.html. So guys relax pseudo codes and algorithms are no big deal. Programming should be fun for those trying to learn it, so let us continue to provide codes for those who need codes.
ProgrammingRe: Help On Java by csharpjava(m): 7:38pm On May 08, 2011
Try this youtube video it should make it simple for you to understand


https://www.youtube.com/watch?v=3ILIFUoFxmE
ProgrammingRe: Please Read by csharpjava(m): 11:05am On May 08, 2011
Everyone knows that its better to teach a man to fish than to feed him with fish
And how do you teach a man to fish, tell him to go and read it in a book grin No you take him to the river and you show him step by step how it is done, there after he can read a  book if he wants to have a technical understanding. Same with programming you give out the code first and then they can read the rest in a book.

On this site you will see loads of code to help those that are trying to learn programming: http://www.java2s.com/Code/JavaAPI/CatalogJavaAPI.htm
ProgrammingRe: I Want To Be Developing .jar Aps For Nokia Phones. Where Do I Start?developing .jar Mobile Apps What by csharpjava(m): 9:52am On May 08, 2011
If you decide to use java then you need an emulator first so that you can run your mobile apps on a computer before deploying it on mobile devices.
I will find time to come back and give you sample codes to get you started.
ProgrammingRe: Please Read by csharpjava(m): 12:10am On May 08, 2011
Number_One
So the chic was helped with her assignment. Nice. So much for HALF BAKED graduates.
Who do you blame, HALF BAKED graduates or HALF BAKED lectures?

You lack the exposure to what a computer science degree course should really be like, with the right lecturers and resources no one will come here asking for help.

You cannot teach someone programming with pseudo codes and algorithms without first showing them the codes, you guys like doing your things the opposite way so that people can worship you.
ProgrammingRe: Please Read by csharpjava(m): 10:32pm On May 07, 2011
segsalerty

I was asked to provide a link to show codes I have given out. At first I showed a comment I received for my codes but I was told that was not enough, see quotes below.

Number_One
So how many codes have you given out? (pls provide links to the codes so we can verify. Anyone can claim they have provided codes for others).
I hope you aren't one of 'em Leechers we are talking about.
Number_One
P.S: Just like I thought, you didn't provide a hyperlink to the page where you posted your code. How can we verify it?
ProgrammingRe: Please Read by csharpjava(m): 6:15pm On May 07, 2011
Number_One
P.S: Just like I thought, you didn't provide a hyperlink to the page where you posted your code. How can we verify it?
Here is the link: https://www.nairaland.com/nigeria/topic-634619.96.html

If someone has made the effort to write a piece of code and wants help with some coding then I don't see why we should not help provide the codes.
ProgrammingRe: Please Read by csharpjava(m): 11:16am On May 07, 2011
Number_One
So how many codes have you given out? (pls provide links to the codes so we can verify. Anyone can claim they have provided codes for others).
I hope you aren't one of 'em Leechers we are talking about.
Create your own programming language and then tell those that want to learn your language to follow your psudo codes and algorithms. But for Java and all the orther languages you did not create it is not your duty to tell others how they should learn it.

People like you cannot make a bicycle spoke but you try to make it hard for people who want to learn how to ride a bicycle.

Below is the comment I got from someone I helped with thier GUI coding on this forum.
Oh wow man thank you!! soooooooooo much, you don't know how BIG this is for me THANKS!!
ProgrammingRe: Help On Java by csharpjava(m): 11:43pm On May 06, 2011
Dolemite
Oh wow man thank you!! soooooooooo much, you don't know how BIG this is for me THANKS!!
This makes me feel better than all the pseudo codes and algorithms in this world grin grin
ProgrammingRe: Please Read by csharpjava(m): 9:48pm On May 06, 2011
Also, why the indirect speeches?
My post is to anyone that believes the best way to help others is through pseudo codes and algorithms, I find this to be putting the cart before the horse, the best approach for those learning to program is to see the coding first then pseudo code and algorithms after. 

What makes me come to this forum all the time is because I admire the way people help by providing codes for others.
ProgrammingRe: Please Read by csharpjava(m): 10:53am On May 06, 2011
Writing codes is no big deal, I don't see why people are not willing to give others the code they need to help them with their programming. All the coding for C# and VB.Net  APIs are available for anyone to see.

Those coming here to say they will not give codes to others, should know that they have not created any programming language of their own and the coding they don't want to give to others has already been written by those who created the programming language.

If you feel you know how to write codes very well then you should go and develop your own programming language and then don't give codes to anyone trying to learn the language you have created and just tell them to use your pseudo code and algorithms.
ProgrammingRe: Help On Java by csharpjava(m): 11:02am On May 05, 2011
Fayimora
The way i normally explain things are;
You ask a question, i give you a pseudo code. You try it until you get stuck. You come back with your code and i tell you where you have gone wrong and tell you what to do again.
It goes on in that loop until you et it. When you learn to think for yourself, then you have the tendencies to solve any problem no matter how large it is.
You are from a computer science background, your approach is good in the lab as you have all the time in the world to keep going in a loop. In the real world of application development the approach is that of Software Engineering, which is “if a code already exist use it” if you ask me why? Well it is because if you have a deadline in which to complete a project, then you just need the code, but the algorithms you can work out after. This is the reason some people come here just for the code only. For algorithms and the pseudo code they can work that out after.
ProgrammingRe: Help On Java by csharpjava(m): 2:26pm On May 04, 2011
Dolemite
Oh wow man thank you!! soooooooooo much, you don't know how BIG this is for me THANKS!!
No worries!! you can always give me a shout if you need anymore assistance.
ProgrammingRe: Help On Java by csharpjava(m): 12:01pm On May 04, 2011
Dolemite

These three classes should get you started just follow the way I have done it upto my comment "// This is where I have got to" in the AircraftGUI Class where all the GUI coding should take place. Create new JLabels and replace all the System.out.println with these JLabels. For the other methods just create new buttons, add addActionListener(this) to them and follow how I used the first button I named AddPassangerButton for the addPassenger method.

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;


public class AircraftGUI extends JFrame implements ActionListener
{

    private ArrayList<Passenger>pass=new ArrayList<Passenger>();
    private int seats=250;
    private final int WEIGHT= 21300;
    private String name;
    private int fare;
    private int weight;
    private int luggage;
    private int tpw;
    private int totalfares;
    private Passenger p;
   
   
   
private JLabel nameInLabel = new JLabel("name"wink;
private JTextField nameInField = new JTextField(5);
private JLabel fareInLabel = new JLabel("fare"wink;
private JTextField fareInField = new JTextField(5);
private JLabel weightInLabel = new JLabel("weight"wink;
private JTextField weightInField = new JTextField(5);
private JLabel luggageInLabel = new JLabel("luggage"wink;
private JTextField luggageInField = new JTextField(5);
private JButton AddPassangerButton = new JButton("Add Passanger"wink;
private JTextArea displayArea = new JTextArea(2,20);

public Aircraft() // Constructor
{
setTitle("Aircraft GUI"wink;
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new FlowLayout());
setSize(240,500);
setLocation(300,300);

add(nameInLabel);
add(nameInField);
add(fareInLabel);
add(fareInField);
add(weightInLabel);
add(weightInField);
add(luggageInLabel);
add(luggageInField);
add(AddPassangerButton);
add(displayArea);

AddPassangerButton.addActionListener(this);
setVisible(true);
}

  public void actionPerformed(ActionEvent e)
{
String nameInEntered = nameInField.getText();
String fareInEntered = fareInField.getText();
String weightInEntered = weightInField.getText();
String luggageInEntered = luggageInField.getText();

int fare = Integer.parseInt(fareInEntered);
int weight = Integer.parseInt(weightInEntered);
int luggage = Integer.parseInt(luggageInEntered);

                                if(e.getSource() == AddPassangerButton) // Run addPassenger method
{
if(nameInEntered.length() == 0 || fareInEntered.length() ==0  || weightInEntered.length() == 0 || luggageInEntered.length() ==0)
{
displayArea.setText("name, fare, weight, luggage must be entered"wink;
}

else
{
    addPassenger(nameInEntered, fare, weight, luggage);
     }
}
           }
   
    public void addPassenger(String nameIn,int fareIn, int weightIn, int luggageIn){
       name=nameIn;
       fare=fareIn;
       weight=weightIn;
       luggage=luggageIn;
       p= new Passenger(name,fare,weight,luggage); //passenger object
       tpw=weightIn+luggageIn; //calculates and adds the tpw
       if(tpw>=50&&tpw<=100&&tpw<WEIGHT&&seats>0){
           pass.add(p); //adds the passenger
           fare=fareIn+((tpw-50)*5); //calculates the fare
           totalfares=totalfares+fareIn;
           displayArea.setText("You have just added"+nameIn
            + "\n"
            + "Fare is"+fare);
           seats--;
           System.out.println(seats+"left"wink;
        }else if(tpw>=100&&tpw<=150&&tpw<WEIGHT&&seats>0){
       pass.add(p); //adds the passenger
       fare=fare+((tpw-100)*10);
       totalfares=totalfares+fareIn; //collects the total fares
      displayArea.setText("You have just added"+nameIn
            + "\n"
            + "Fare is"+fare);
       seats--;
       System.out.println(seats+"left"wink;//print out the name of the passanger u just added by getting its name u initialized
    }
    else {
         displayArea.setText("Passenger cannot be added!!"wink; // This is where I have got to
    }
}

    public ArrayList<Passenger> getPassengers(){
        System.out.println(pass);
        return pass;
    }
    public int getTotalfares(){
        System.out.println(totalfares);
        return totalfares;
    }
     public void removePassenger(String nameIn){
       Iterator<Passenger> i = pass.iterator();
       while(i.hasNext()){
           if(i.next().getName().equals(nameIn)){
               i.remove();
               totalfares=totalfares-fare;
               System.out.println(nameIn+ "has been removed"wink;
            }
        }
    }
    public void searchPassenger(String nameIn){
        Passenger pFound;
        Iterator<Passenger> i = pass.iterator();
        while(i.hasNext()){
            if(i.next().getName().equals(nameIn)){
               System.out.println(nameIn+ "is in the list"wink;
               pFound=i.next();
               break;
               
            }
        }
    }

}
public class Passenger {

private String name;
    private int fare;
    private int weight;
    private int luggage;
    private int tpw;
    private int totalTpw;
   
    public Passenger(String nameIn, int fareIn, int weightIn, int luggageIn){
        name=nameIn;
        fare=fareIn;
        weight=weightIn;
        luggage=luggageIn;
     }
    public int setWeight(int weightIn){
        weight=weightIn;
        return weight;
    }
    public String getName(){
        return name;
    }
    public int getFare(){
        return fare;
    }
    public int getWeight(){
        return weight;
    }
    public int getLuggage(){
        return luggage;
    }
    public int setTpw(){
        tpw=weight*luggage;
        return tpw;
    }
     public String toString(){
      return name + " " + fare + " " +weight+ " " +luggage;
    }

}
public class RunAircraftGUI{

public static void main(String[] args)
{
new AircraftGUI();
}
}
ProgrammingRe: Help On Java by csharpjava(m):
Fayimora

Programming is one of the few professions where programmers are very selfish in helping those that are learning, with coding. I'm sure you cannot work in an agile environment, in which pair programming is a must (an XP development technique used by agile methodology) in this type of environment you are not allowed to hide your codes.

You start your programming career as a trainee and you are trained by advanced programmers, no amount of books you read can make you a very good programmer unless you see the way other programmers have written their codes.

This is not a forum for those doing their PHD, so you need to stop asking those asking for help here to go and read books, they won't come here if they can find all the answers they want in books.

1 2 3 4 5 6 7 8 9 10 11 12 (of 12 pages)