Sayed Ibrahim Hashimi

Ranch Hand
+ Follow
since May 17, 2001
Merit badge: grant badges
For More
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sayed Ibrahim Hashimi

Hi,
I'm looking for employment to be a Software Engineer as a contractor in the North/Central Florida area.
Specifically looking for employment dealing with JXTA.
I'm a member of the JXTA Usability Committee, and a contributor to several projects as well.
I may be contacted at sayed.hashimi@gmail.com for more information.

--
Sayed Ibrahim Hashimi
18 years ago
You'd have to check if there were tab at begining and end of the string, and from there it is simple math.
18 years ago
Another option would be to create a StringTokenizer with the tab character being the delimeter, and call countTokens(). I think you could also use regular expressions. I have no idea which method would be better performance wise especially for large strings. If you find out let us know.
[ March 30, 2005: Message edited by: Sayed Ibrahim Hashimi ]
18 years ago
What is your goal in studying them? Just general knowledge or something specific? Also what is you experience level, certaily this will dictate what things you can do.
Is there is a particular project that you have interest in, I'd say the best way to learn it is to start contributing to it. As you submit patches you will learn more and more. If you don't have one that you like let us know what you interest are and maybe someone can point you into a good direction for a project.
19 years ago

Originally posted by Joe Nguyen:
Let forget about class perspective for a moment and discuss about general OO practice.

Suppose there is a class Person and let create two instances of the class Person. One is John and the other is Michelle. It would not be right to let John directly modifies Michelle's favorite sport without letting michelle knows (assume favoriteSport is a private variable of class Person).

As long as direct access to private variable is permitted, the other object does not need/want to invoke getter/setter method.



This doesn't seem right because you are bringing the human aspect into it. I would hate if someone else decided what my favorite sport is (its chess in case you were wondering).
But what if we are dealing with a linked list when items are moved around it may be necessary to change the references for other members of the list and I don't think that they should be required to make the method calls to do such, especially if you are dealing with large lists and preformace is a great concern and seeing how it is the code that lies in the class doing such why not let them change it? The idea here is to dis-allow other types of objects access to private data not code within the same class.
19 years ago

Originally posted by Randy Nichols:

But wouldn't that also be a reason for wanting it to NOT be visible, so I could put "setter" and "getter" methods on the object where I'd put the notify code, and make sure others don't access the private members without my knowing?


I think that you have to view this from a class perspective not an instance perspective. The creators of the class should know the constraints that are implemented within the class, and should have the freedom to not be required to use get/set like outside classes do.

With that being said they should also notify anyone who is interested. I would agree that it is better practice to use the get/set.
[ March 24, 2005: Message edited by: Sayed Ibrahim Hashimi ]
19 years ago
Hi,
I don't think this is a violoation of encapsulation(although some may disagree). The whole idea of encapsulation and data hiding is to prevent objects from modifying when they don't know exactly what they are dealing with. For example if I had a class that contained an int, this int would be private and I would make public get/set methods for it.
Assume that this class has a set of listeners associated with it that would need to be notified that its value has changed. Objects of different classes may not know about this but certainly objects of the same class know, so its ok to let them take care of it. In the sample that I provided you in the changeOther() method it would also have to notify those liseteners.
I hope this makes sense, and also hope that too many people won't disagree.

--
Sayed Hashimi
19 years ago
What about this:

With the results:
test2.num before: 555
test2.num after: -12
19 years ago


But cant get it to work quite right, i think i might need a set or sortedset, but i cant figure out how to correctly put in primatives and then get them out etc.



If you want to add primitives to those data structures then you first need to wrap them up into an object. So if you are using ints then use the Integer class to do this, for double use Double, for boolean use Boolean. Here is an example

Hope this helps,
Sayed Ibrahim Hashimi
19 years ago
Dale,
Thanks for the idea, I'm going to look into this and continue trying some other ideas.

Thanks,
Sayed Ibrahim Hashimi
19 years ago
Hi,
I posted this topic in the applets forum about a week ago, but have not received any responses so thought I'd post it here.


I have created an applet that uses Swing. I would like to make sure that for users that don't have the appropriate plug in installed that they will also be able to use it. I was wondering what the best approach for this would be. Wether for them to download the plugin, or for me to include the swingall.jar in my applet?

Thanks in advance,
Sayed Ibrahim Hashimi
[ March 16, 2005: Message edited by: Sayed Ibrahim Hashimi ]
19 years ago
I certainly agree that it's sloppy coding, and would never perform it in any usable class. I just created the example previously because of the boolean comment.
19 years ago
Hi,
I just ran this code:

With the result being:
int result: 9
String result: the test did work!!!


So these seem to work fine.
19 years ago
Hi,
You can definetly do this with RegEx. Here is an awesome resource that will help you text your regulare expressions http://www.fileformat.info/tool/regex.htm

hope this helps
19 years ago
Hi,
I have created an applet that uses Swing. I would like to make sure that for users that don't have the appropriate plug installed that they will also be able to use. I was wondering what the best approach for this would be. Wether for them to download the plugin, or for me to include the swingall.jar in my applet?

Thanks in advance,
Sayed Ibrahim Hashimi
[ March 10, 2005: Message edited by: Sayed Ibrahim Hashimi ]
19 years ago