Jump to content

  • Log In with Google      Sign In   
  • Create Account


Instigator

Member Since 11 Oct 2006
Offline Last Active Jul 21 2013 10:11 PM

Topics I've Started

Searching Algorithm on Matrix Type Data

16 May 2013 - 11:18 AM

I would like to implement an efficient algorithm to search data as part of the following format.

 

|X|Y|100 character length string|

 

All columns are non-unique. Which means you can have

 

|5.5|23.4|SOME TEXT|

|10.1|12.2|SOME TEXT|

|10.1|10.1|MORE TEXT|

 

 

An example of a query would be :

 

- FindText("SOME*") /*Returns all rows with this text */

- FindX(10.1)

- FindY(10.1)

.

.

 

Will a simple array suffice or is their an algorithm more efficient I should  read about? 


Brain Development

08 December 2012 - 07:26 PM

Hi,

So I'm going to be turning 25 years old in a few months. Lately I have been hearing that your brain stops developing at 25 years old. This is worrying because there is still so much I want to learn in life (musical instruments, another language and learning to be a good sales rep).

It would help if someone over the age of 25 with an ambitious attitude to learn share your experiences?

I'm really feeling old right now and it would help to hear!

Chaos Theory

01 October 2012 - 07:11 AM

Hi,

I am looking for a demo of Chaos theory in action. What practical examples can be rendered showing its use?

Java Throw Exception

21 September 2012 - 09:36 AM

Hello,
I have an application which excepts a username and password input from the user. Then attempts a network connection, 3 classes deep from my form events (the view). So deep in my networking connection I want to throw and Exception and log some text for the user to see. So..

with in this method I have something like..
public boolean doAConnect() [b]throws Exception[/b]
{
//check invalid usernamepassword here...
if (errorCode == invalidUsernamePass)
   throw new Exception("Invalid Username and Password);


the problem is that in my view when I use the try/catch, I am getting a "Java.lang.exception error: <error message here>". I only want the error message I set! Any ideas how I can just show the message to the user without the "Java.lang.Exception error:" pre-pended onto my string?
try{
	 doAConnect()
}
catch(Exception e)
{  
	Dialog.alert(e.toString());
}

Java Syntax Question

01 September 2012 - 02:54 PM

I've recently been trying to undertand ternary operators and found an example using java - here -

public class EmpComparator implements Comparator {
  public int compare(Object obj1, Object obj2) {
	Person emp1 = (Person) obj1;
	Person emp2 = (Person) obj2;
	int nameComp = emp1.getFirstName().compareTo(emp2.getFirstName());
	return ((nameComp == 0) ? emp1.getLastName().compareTo(
		emp2.getLastName()) : nameComp);
  }


I am feeling really sick right now because of 2 things in this example which I'm obviously missing

1. Why doesn't he just return the "nameComp" variable..
2. In the "true" part of the ternary value he does "emp1.getLastName().compareTo(emp2.getLastName())" why.. the value is already in nameComp.

Please explain

Thanks!

PARTNERS