[Show all top banners]

Ayus
Replies to this thread:

More by Ayus
What people are reading
Subscribers
:: Subscribe
Back to: Computer/IT Refresh page to view new replies
 IT -- Solutions Center[Forum]

[Please view other pages to see the rest of the postings. Total posts: 182]
PAGE: <<  1 2 3 4 5 6 7 8 9 10 NEXT PAGE
[VIEWED 129619 TIMES]
SAVE! for ease of future access.
The postings in this thread span 10 pages, View Last 20 replies.
Posted on 02-14-11 10:39 PM     Reply [Subscribe]
Login in to Rate this Post:     1       ?     Liked by
 


Shoot out your problems...
Lets share and expand the knowledge.....!!!!



We are open to share on(any IT related stuffs) :

- Javascript/JQuery/Ajax
- Java,JSP,Servlets and Frameworks
- WebServices
- Unix, Linux, Webserver Administration


+ many more !!!!

 
Posted on 02-18-11 3:43 PM     [Snapshot: 797]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

I dont think cyclic inheritence is supported in any language except for english.

Java doesnt support  multiple inhertiance, but it can be done by
src:http://csis.pace.edu/~bergin/patterns/multipleinheritance.html


General Multiple Inheritance

We can use the above to see how to provide general multiple inheritance. The difference here is that we may not be able to design one of the classes to be a mixin. In the usual case, the two classes are predefined and do not require services from each other. This means that the MRequires interface is not needed. However, we still need to define one interface, since Java won't let us mix two classes together.

If we do have the luxury of designing at least one of the classes then we can proceed as before, treating that class as the mixin and defining an interface that it will implement. Otherwise we need to do a bit more. Suppose that we would like to mix the class Parent of the previous section with a class Other defined below.

Class Other
{	public Other(int value) { ... }
	
	public void whatever()
	{...
	}
}

Since Java will let us extend only one class, we need to define an interface that declares the public features of the other. We will do this to make our life simple here, though you may choose to do the next step for the class of least importance and whose methods are going to be called least often. Here we will define an interface to give the public methods of the class Other.

Interface OtherInterface
{	void whatever();
}

We can now build a subclass of Other by doing nothing more than implementing this new interface and providing any required constructors (which are not inherited).

class OtherChild extends Other implements OtherInterface
{	public OtherChild (int value){ super(value); }
}

If we had the freedom to modify class Other we could avoid the class OtherChild and just have Other implement this new interface.

This new class is just like an Other, but it advertises that it implements the OtherInterface. From here we can proceed as in the mixin case by extending the Parent class, implementing he OtherInterface and creating a new OtherChild object to which we delegate the messages defined in the OtherInterface.

Class ParentChild extends Parent implements OtherInterface
{	public ParentChild(...) { child = new OtherChild(...); ... }

	public void whatever() { child.whatever(); }

	private final OtherInterface child;
}

So, in this class we have merged the actual implementations of two other classes, Parent and Other without modifying either class. This is general multiple inheritance. In Java we needed to define and implement interfaces and use delegation to an object of one of the classes to achieve this.

Conclusion

Multiple inheritance is needed only rarely. The fact that it is a bit awkward to achieve in Java is not a disadvantage as it may discourage you from using it in those cases in which a better solution is available. However, you should be aware that extensions to Java are not necessary to achieve the use of most features that Java seems to lack. Rather the Java was a good, sound, and complete language design that supports the kinds of things that developers need. It takes skill, however, to see how to achieve some of the less used idioms such as multiple inheritance.


 
Posted on 02-18-11 4:05 PM     [Snapshot: 807]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

I was wrong :)
seems no programming laguage supports cyclic inheritence
thx prankster
 
Posted on 02-18-11 6:32 PM     [Snapshot: 833]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

another question
how do you handle multiple submissions in struts ?


 
Posted on 02-18-11 8:36 PM     [Snapshot: 848]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Your question is not clear. But as for my understanding, do you mean more than one buttons on same page?
for e.g. update, delete, add etc?
In this scenario, either you can go individual action class for each button or use Dispatch Action with only one action class.
I prefer going for Dispatch Action class.
You can find tutorials on DispatchAction.

www.vaannila.com==> ok for struts ,.


 
Posted on 02-18-11 10:15 PM     [Snapshot: 868]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

i am not talking about different buttons,
lets say you are takin care of credit card processing. There can be a circumstance where page reloads twice and two transaction process at the same time.
how can you avoid such multiple submission?
 
Posted on 02-18-11 10:17 PM     [Snapshot: 868]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Love this thread and what prankster said, supported no where but in English haha. If we are to add new queries do we just continue on this thread itself or start a newone!
Btw, what i would like to know is how is the programming like in the professional world? Is it like what we been reading/practising in java 1 & 2 cuz those things dont seem to be complicated enough to be paid 40k+ a year, or is it like i am not getting the point?
 
Posted on 02-18-11 10:30 PM     [Snapshot: 873]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

I am not into professional world too, but as I understand
Java 1 and 2 are just the core , you need it to understand the rest.
In someplace , where you are just developing simple stand alone applicatoin 1 & 2 do a lot.
However, you need more .
Go ahead and post your queries thing or whatever comes up related to the programming here, some one will come up with good solution, at least with good guidelines/links.
 
Posted on 02-18-11 10:53 PM     [Snapshot: 892]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

@dafault,

If pay is loading twice means you are sending two request...in order for page to load u need to send request to server...
for ur example of credit card processing, u can disable the submit button after it gets a hit...and u can disable it until u get response from server....

or you can use javascript for form submission.....before submitting you can count the button click and if button click is more than 1, prompt a msg  user....

but i prefer disabling a button after it gets hit once so that we avoid double/multiple submission....

 
Posted on 02-19-11 12:17 AM     [Snapshot: 911]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

will try that
thanks ayus
 
Posted on 02-19-11 2:45 PM     [Snapshot: 958]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

@
default...
np ..keep posting !

 
Posted on 02-19-11 11:01 PM     [Snapshot: 994]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

framework used: Struts and Hibernate
database : oracle 10

how can I hash the password before I store it in db?
 
Posted on 02-19-11 11:10 PM     [Snapshot: 998]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

hash a password??
Can you explain more clearly ??

 
Posted on 02-19-11 11:16 PM     [Snapshot: 999]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

I mean I dont want to store password directly to database, but want to store hash or one way encrypted value in database.
 
Posted on 02-20-11 12:17 AM     [Snapshot: 1011]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

// sample code--//copy paste these two class to see how it works

import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import sun.misc.BASE64Encoder;
 
public class EncyptionTest {
    public static synchronized String encrypt(String txt_to_excrypt, String algorithm_used_for_encryption) throws Exception {
        MessageDigest msgDigest = null;
        String hashValue = null;
        try {
            msgDigest = MessageDigest.getInstance(algorithm_used_for_encryption);
            msgDigest.update(txt_to_excrypt.getBytes("UTF-8"));
            byte rawByte[] = msgDigest.digest();
            hashValue = (new BASE64Encoder()).encode(rawByte);
        } catch (NoSuchAlgorithmException e) {
            System.out.println("No Such Algorithm Exists");
        }
        return hashValue;
    }
}

// test the above class

public class TestEncryption {
  public static void main(String[]args){
      try {
            String encryptedPassword = new EncyptionTest().encrypt("password", "SHA"); //using SHA algo
            String encryptedPassword1 = new EncyptionTest().encrypt("password", "MD5");//using MD5
            System.out.println("Encrypted Password:\t"+encryptedPassword);
            System.out.println("Encrypted Password-MD5:\t"+encryptedPassword1);

        } catch (Exception ex) {
        }
}}

//output
Encrypted Password:        W6ph5Mm5Pz8GgiULbPgzG37mj9g=
Encrypted Password-MD5:        X03MO1qnZdYdgyfeuILPmQ==

/*    while using struts *****************************/
- create a seperate java class for encryption like i did
- create a instance of that class in action class
- pass the received password from form bean to encrypt method like above and get the result in some variable
- store that variable in database ....will be saved as encrypted password


Last edited: 20-Feb-11 12:20 AM
Last edited: 20-Feb-11 01:08 AM
Last edited: 20-Feb-11 01:21 AM
Last edited: 20-Feb-11 01:23 AM

 
Posted on 02-20-11 2:02 AM     [Snapshot: 1044]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

thx,
was looking for this :)

 
Posted on 02-20-11 11:27 AM     [Snapshot: 1079]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

NP. Keep posting ....

 
Posted on 02-20-11 9:00 PM     [Snapshot: 1123]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 


Oracle just realased most Sophisticated High Availability (HA) weblogic tools called WebCenter Suite.

It is just an Oracle Fusion Middleware and a mix of existing Oracle software along with the various products from BEA.

thanks
Last edited: 20-Feb-11 09:23 PM

 
Posted on 02-21-11 11:46 AM     [Snapshot: 1187]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

if you want to code, you can go with Ayus, also heard MD5 is not that good for password protection, try using sha digests.
I found some inbuilt functionality with mysql (always easier and less error prone to use inbuilt api)
src:http://mysqldatabaseadministration.blogspot.com/2006/08/storing-passwords-in-mysql.html

You can apply SHA1 algorithm to a password string:

mysql>  SELECT SHA1('mysecretpassword');
+------------------------------------------+
| SHA1('mysecretpassword') |
+------------------------------------------+
| 08cd923367890009657eab812753379bdb321eeb |
+------------------------------------------+
1 row in set (0.00 sec)


Since SHA is an alias for SHA1, it produces the same result
mysql>  SELECT SHA('mysecretpassword');
+------------------------------------------+
| SHA('mysecretpassword') |
+------------------------------------------+
| 08cd923367890009657eab812753379bdb321eeb |
+------------------------------------------+
1 row in set (0.00 sec)


To store passwords encrypted with SHA1, we need to be able to store 40 characters.
mysql> SELECT CHARACTER_LENGTH(SHA1('mysecretpasswordsssssss'));
+---------------------------------------------------+
| CHARACTER_LENGTH(SHA1('mysecretpassword')) |
+---------------------------------------------------+
| 40 |
+---------------------------------------------------+
1 row in set (0.00 sec)


On the other hand, to store passwords encrypted with MD5, we need the column to be able to hold 32 characters.

mysql>  SELECT MD5('secretpassword');
+----------------------------------+
| MD5('secretpassword') |
+----------------------------------+
| 2034f6e32958647fdff75d265b455ebf |
+----------------------------------+
1 row in set (0.00 sec)

mysql> SELECT CHARACTER_LENGTH(MD5('secretpassword'));
+-----------------------------------------+
| CHARACTER_LENGTH(MD5('secretpassword')) |
+-----------------------------------------+
| 32 |
+-----------------------------------------+
1 row in set (0.00 sec)
Didnt find much on oracle except for following http://psoug.org/reference/dbms_crypto.html Good luck

 
Posted on 02-22-11 10:46 AM     [Snapshot: 1245]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Simple WebSerice tutorial on Netbeans:

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

 
Posted on 02-23-11 9:05 AM     [Snapshot: 1312]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

JSTL TUTORIAL:

http://www.herongyang.com/jsp/jstl.html

 



PAGE: <<  1 2 3 4 5 6 7 8 9 10 NEXT PAGE
Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 60 days
Recommended Popular Threads Controvertial Threads
Supporting issues on principle instead of blind brainwashed support
maga got what they voted for
TPS Automatically Extended for Six Months!!!
Cricketer Sandeep Lamichhane singing & playing guitar
नेपालको टीपीएस चाई हस त नमस्ते नई भाको रच
where are Hunter Biden and Biden got 40k maga hounds?
Trump Said He’s “very happy” with Rising Gas Prices #maga #fafo
Who are the real Sukumbaasis?
Zero Civic Sense: Indians in Nepal
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters