Thursday, 5 September 2013

No Activity found to handle intent errors

No Activity found to handle intent errors

I am stumped, I get No Activity to handle intent, I have checked the
manifest etc. Can someone have a quick look at this and see what I am
doing wrong here.
This is my java class
'import com.one2.indoor.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
public class Menu extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageButton tut1 = (ImageButton) findViewById(R.id.activitymain);
tut1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity (new Intent("com.indoor.ActivityMain"));
}
});
}'
This is my ActivityMain class
'import com.one2.indoor.R;
import android.app.Activity;
import android.os.Bundle;
public class ActivityMain extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.tutorial);
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
}
}'
and finally my manifest
'<activity
android:name="com.indoor.Main"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.indoor.Menu"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="com.indoor.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.indoor.ActivityMain"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="com.indoor.ACTIVITYMAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.indoor.ActivityMain" />
</activity>
</application>
</manifest>
I just cant see it, why I'm getting the error. Any help be much appreciated

How to do a efficiently check if a string partially exists in a much larger set?

How to do a efficiently check if a string partially exists in a much
larger set?

Say I have a Set of Strings:
Set<String> things = new HashSet<String>();
things.add("coffee cup");
things.add("smartphone");
things.add("inkjet printer");
// :
// list could be quite large (100K or so, perhaps loaded from a database)
// :
Now I want to check if another string completely contains any of the
Strings in the above set. So:
"a coffee cup" - matches
"android smartphone" - matches
"inkjet printer for sale" - matches
"laser printer" - does not match
"printer" - does not match
The only way I can think of is iterating through the set (and break-ing if
found). Is there a more efficient and elegant way to do this?

Getting Dictionary From JSON

Getting Dictionary From JSON

I am trying to get Dictionary form json, but the following code dosent
seem to work. I am getting the JSON, but cannot get the dictionary from
it.
NSString *str = [[NSMutableString alloc] initWithData:responseCust
encoding:NSUTF8StringEncoding];
NSLog(@"CUSTOMER string -----################ %@", str);
if(str.length>5)
{
SBJSON *jsonparser=[[SBJSON alloc]init];
NSDictionary *res= [jsonparser objectWithString:str];
NSLog(@"Contants Results %@",res);
[jsonparser release];
[str release];
Thank You.

How to run jetty with https using sbt

How to run jetty with https using sbt

I am using jetty 2.6.1 and sbt 0.7.7.
Currently my app is running on http, but I want to run with https
I tried following approach to run it with https :
http://wiki.eclipse.org/Jetty/Howto/Configure_SSL#Configuring_Jetty_for_SSL
Then i set below code in build.scala file.
override lazy val jettyInstance = new
JettyRunner(customJettyConfiguration)
def customJettyConfiguration = {
val myLog = log
val myJettyClasspath = jettyClasspath
new CustomJettyConfiguration {
def war = "target/scala_2.8.0/tos.war"
def scanDirectories = Nil
def scanInterval = 0
def jettyClasspath = myJettyClasspath
def classpath = jettyRunClasspath
def classpathName = "test"
def log = myLog
override def jettyConfigurationXML =
<Configure id="Server" class="org.mortbay.jetty.Server">
<Call name="addConnector">
<Arg>
<New class="org.mortbay.jetty.security.SslSocketConnector">
<Set name="Port">443</Set>
<Set name="maxIdleTime">30000</Set>
<Set name="handshakeTimeout">2000</Set>
<Set name="keystore"><SystemProperty name="jetty.home"
default=""/>/etc/xinetd.d/keystore</Set>
<Set name="password">password</Set>
<Set name="keyPassword">password</Set>
<Set name="truststore"><SystemProperty name="jetty.home"
default=""/>/etc/xinetd.d/keystore</Set>
<Set name="trustPassword">password</Set>
<Set name="handshakeTimeout">2000</Set>
</New>
</Arg>
</Call>
<Call name="addConnector">
<Arg>
<New class="org.mortbay.jetty.nio.SelectChannelConnector">
<Set name="host"><SystemProperty name="jetty.host"/></Set>
<Set name="port"><SystemProperty name="jetty.port"
default="8080"/></Set>
<Set name="maxIdleTime">30000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">5000</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
</New>
</Arg>
</Call>
</Configure>
}
}
But I did not get my work done.
Please let me know , if i am doing anything wrong.

MYSQL PHP Query: Joining on more than one field

MYSQL PHP Query: Joining on more than one field

My table scheme for a social network site is as follows:
users
id|username
userinfo
id|userid|handle|description
network
id|inviterid|invitedid|status
When one person invites another to join his/her network, an entry is made
into the network table with status 1. If the request is accepted, the
status goes to 2. So far so good.
However, I'm having trouble listing out members of someone's network while
joining with other tables since in effect I have to join on more than one
field since the person can either be the inviter or the invited.
Here is query to get members of network //$id = id of logged in user $sql
= "SELECT * FROM network n LEFT JOIN userinfo ui on n.invitedid= ui.userid
OR n.inviterid = ui.userid LEFT JOINusers u on n.invitedid= u.id OR
n.inviterid = n.id WHERE status='2'
Not all users have userinfo records as not everyone has filled out a
profile. But I want to get these as well.
Above query gives multiple records for users with profiles, records for
the logged in user and excludes any without profile. I want to exclude
logged in user and then one record for each member of his/her network
including members without profiles.
Thanks for any suggestions.

Wednesday, 4 September 2013

Inno Setup:Automatic rollback process

Inno Setup:Automatic rollback process

As part of installation, sometimes i see few erors during a file
replacement etc, so then inno setup gives a message like
"abort/retry/ignore" if the user chooses abort inno setup rollbacks the
installation. So i want to know 2 things here 1)I wanted to know from my
installer, whether a roll back is invoked or not? can inno setup give any
acknowledgeent for automatic rollback happend or not? 2)what are the steps
of rollback, what all does it do in that? a detailed explanation would be
very helpful...

Find and remove partial link from existing href

Find and remove partial link from existing href

I have been finding examples on this but till now I am still so confuse
about getting to work for this.
I have an existing <a href="http://www.sitename.com/dir1/dir2"> and I need
to insert into this link with "upload" dir.
So the end result will be <a href="upload/dir2">
How do I remove http://www.sitename.com/dir1 and insert the "upload" into
the link?
Hope you guys understand what I am trying to do.
Any help would be greatly appreciated, thanks in advance.