Restore health in blood and glory 2 legend
In blood and glory 2 legend can do you restore health without potions or
leveling up and if yes how
Saturday, 10 August 2013
How to sit these div's side by side
How to sit these div's side by side
I have a 'container' that has either one or two div's in it: think
'content area' with optional 'sidebar'. The sidebar is on the right, the
content area on the left. When the sidebar appears it is a fixed width.
How can I get this to work without javascript, and without putting
additional tags or styles in the html on the fly?
Here's the basic code:
<div id='container'>
<div id='content-area'> ... </div>
<div id='sidebar' style='width: 200px;'> ...</div>
</div>
I tried simply floating one to the left, the other to the right, but in
that case the content still retains full-width, and is laid out once clear
of the sidebar. If I knew which pages the sidebar was going to appear on I
could give the container a class (on those pages only) and give the class
a fixed width. But I don't know which pages the sidebar will appear on!
I have a 'container' that has either one or two div's in it: think
'content area' with optional 'sidebar'. The sidebar is on the right, the
content area on the left. When the sidebar appears it is a fixed width.
How can I get this to work without javascript, and without putting
additional tags or styles in the html on the fly?
Here's the basic code:
<div id='container'>
<div id='content-area'> ... </div>
<div id='sidebar' style='width: 200px;'> ...</div>
</div>
I tried simply floating one to the left, the other to the right, but in
that case the content still retains full-width, and is laid out once clear
of the sidebar. If I knew which pages the sidebar was going to appear on I
could give the container a class (on those pages only) and give the class
a fixed width. But I don't know which pages the sidebar will appear on!
Friday, 9 August 2013
Hide UITableViewCell content under translucent UINavigationBar
Hide UITableViewCell content under translucent UINavigationBar
I would like to have translucent UINavigationBar. Which I have achieved with,
self.navigationController.navigationBar.translucent = YES;
const float colorMask[6] = {222, 255, 222, 255, 222, 255};
UIImage *img = [[UIImage alloc] init];
UIImage *maskedImage = [UIImage imageWithCGImage:
CGImageCreateWithMaskingColors(img.CGImage, colorMask)];
[self.navigationController.navigationBar setBackgroundImage:maskedImage
forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
However, when I scroll my UITableView all the content of UITableViewCell
shows up underneath UINavigationBar.
Goal: I would like to have an effect such as new Yahoo Weather App.
translucent UINavigationBar yet the table view content disappears
underneath navigation bar.
What I have tried so far:
I tried to set the content inset of UITableView. However, No luck.
self.tableView.contentInset =
UIEdgeInsetsMake(self.navigationController.navigationBar.frame.size.height,
0,0,0);
I would like to have translucent UINavigationBar. Which I have achieved with,
self.navigationController.navigationBar.translucent = YES;
const float colorMask[6] = {222, 255, 222, 255, 222, 255};
UIImage *img = [[UIImage alloc] init];
UIImage *maskedImage = [UIImage imageWithCGImage:
CGImageCreateWithMaskingColors(img.CGImage, colorMask)];
[self.navigationController.navigationBar setBackgroundImage:maskedImage
forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
However, when I scroll my UITableView all the content of UITableViewCell
shows up underneath UINavigationBar.
Goal: I would like to have an effect such as new Yahoo Weather App.
translucent UINavigationBar yet the table view content disappears
underneath navigation bar.
What I have tried so far:
I tried to set the content inset of UITableView. However, No luck.
self.tableView.contentInset =
UIEdgeInsetsMake(self.navigationController.navigationBar.frame.size.height,
0,0,0);
Android app crashes and returns to menu and then works
Android app crashes and returns to menu and then works
I'm writing a app with some info on ingress. This is my first app so i'm
kinda new to android.
I have a menu which consist of 8 buttons. For one of them it opens a
activity that has two imagebuttons. Each imagebutton opens a different
activity that has only a textview in it.
My problem is this. When I first run the app it crashes if i hit either of
the image buttons. it then returns to the menu. If i go back to either
imagebutton, now it works.
I'm running my app on a GS4. debugging it gave me the error source not
found. not sure whats wrong.
the class with the two buttons
public class Factions extends Activity implements View.OnClickListener {
ImageButton resis, enligh;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_factions);
setup();
}
private void setup() {
resis = (ImageButton) findViewById(R.id.ibResistance);
resis.setOnClickListener(this);
enligh = (ImageButton) findViewById(R.id.ibEnlightened);
enligh.setOnClickListener(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.factions, menu);
return true;
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent i;
switch (v.getId()) {
case R.id.ibEnlightened:
i = new Intent(getApplicationContext(), AboutEnlightened.class);
startActivity(i);
break;
case R.id.ibResistance:
i = new Intent(getApplicationContext(), AboutResistance.class);
startActivity(i);
break;
}
}
}
the xml for that class
<ImageButton
android:id="@+id/ibResistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="@drawable/resistance_logo_button" />
<ImageButton
android:id="@+id/ibEnlightened"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="@drawable/enlightened_logo_button" />
the class for the two textviews only have the onCreate and
onCreateOptionsMenu methods. i don't need to change them or add anything
to it. If you need any other info let me know. Thanks in advance.
the logcat shows this
08-09 22:07:00.541: I/dalvikvm(11028): at
android.content.res.Resources.loadDrawable(Resources.java:2854) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.content.res.TypedArray.getDrawable(TypedArray.java:602) 08-09
22:07:00.541: I/dalvikvm(11028): at android.view.View.(View.java:3460)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.view.ViewGroup.(ViewGroup.java:446) 08-09 22:07:00.541:
I/dalvikvm(11028): at android.widget.LinearLayout.(LinearLayout.java:176)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.widget.LinearLayout.(LinearLayout.java:172) 08-09 22:07:00.541:
I/dalvikvm(11028): at java.lang.reflect.Constructor.constructNative(Native
Method) 08-09 22:07:00.541: I/dalvikvm(11028): at
java.lang.reflect.Constructor.newInstance(Constructor.java:417) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.view.LayoutInflater.createView(LayoutInflater.java:593) 08-09
22:07:00.541: I/dalvikvm(11028): at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.view.LayoutInflater.onCreateView(LayoutInflater.java:666) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.view.LayoutInflater.inflate(LayoutInflater.java:467) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.view.LayoutInflater.inflate(LayoutInflater.java:397) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.view.LayoutInflater.inflate(LayoutInflater.java:353) 08-09
22:07:00.541: I/dalvikvm(11028): at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:327)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.app.Activity.setContentView(Activity.java:1928) 08-09
22:07:00.541: I/dalvikvm(11028): at
com.kaveman.ingress.faqs.AboutResistance.onCreate(AboutResistance.java:12)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.app.Activity.performCreate(Activity.java:5250) 08-09 22:07:00.541:
I/dalvikvm(11028): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2297)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.app.ActivityThread.access$700(ActivityThread.java:152) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.os.Handler.dispatchMessage(Handler.java:99) 08-09 22:07:00.541:
I/dalvikvm(11028): at android.os.Looper.loop(Looper.java:137) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.app.ActivityThread.main(ActivityThread.java:5328) 08-09
22:07:00.541: I/dalvikvm(11028): at
java.lang.reflect.Method.invokeNative(Native Method) 08-09 22:07:00.541:
I/dalvikvm(11028): at java.lang.reflect.Method.invoke(Method.java:511)
08-09 22:07:00.541: I/dalvikvm(11028): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
08-09 22:07:00.541: I/dalvikvm(11028): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 08-09
22:07:00.541: I/dalvikvm(11028): at dalvik.system.NativeStart.main(Native
Method) 08-09 22:07:00.541: D/skia(11028): --- allocation failed for
scaled bitmap 08-09 22:07:00.541: D/AndroidRuntime(11028): Shutting down
VM 08-09 22:07:00.541: W/dalvikvm(11028): threadid=1: thread exiting with
uncaught exception (group=0x41173ac8) 08-09 22:07:00.571:
E/AndroidRuntime(11028): FATAL EXCEPTION: main 08-09 22:07:00.571:
E/AndroidRuntime(11028): java.lang.RuntimeException: Unable to start
activity
ComponentInfo{com.kaveman.ingress.faqs/com.kaveman.ingress.faqs.AboutResistance}:
android.view.InflateException: Binary XML file line #1: Error inflating
class 08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2247)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2297)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.app.ActivityThread.access$700(ActivityThread.java:152) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.os.Handler.dispatchMessage(Handler.java:99) 08-09 22:07:00.571:
E/AndroidRuntime(11028): at android.os.Looper.loop(Looper.java:137) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.app.ActivityThread.main(ActivityThread.java:5328) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
java.lang.reflect.Method.invokeNative(Native Method) 08-09 22:07:00.571:
E/AndroidRuntime(11028): at
java.lang.reflect.Method.invoke(Method.java:511) 08-09 22:07:00.571:
E/AndroidRuntime(11028): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
dalvik.system.NativeStart.main(Native Method) 08-09 22:07:00.571:
E/AndroidRuntime(11028): Caused by: android.view.InflateException: Binary
XML file line #1: Error inflating class 08-09 22:07:00.571:
E/AndroidRuntime(11028): at
android.view.LayoutInflater.createView(LayoutInflater.java:619) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.view.LayoutInflater.onCreateView(LayoutInflater.java:666) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.view.LayoutInflater.inflate(LayoutInflater.java:467) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.view.LayoutInflater.inflate(LayoutInflater.java:397) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.view.LayoutInflater.inflate(LayoutInflater.java:353) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:327)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.app.Activity.setContentView(Activity.java:1928) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
com.kaveman.ingress.faqs.AboutResistance.onCreate(AboutResistance.java:12)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.app.Activity.performCreate(Activity.java:5250) 08-09 22:07:00.571:
E/AndroidRuntime(11028): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
08-09 22:07:00.571: E/AndroidRuntime(11028): ... 11 more 08-09
22:07:00.571: E/AndroidRuntime(11028): Caused by:
java.lang.reflect.InvocationTargetException 08-09 22:07:00.571:
E/AndroidRuntime(11028): at
java.lang.reflect.Constructor.constructNative(Native Method) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
java.lang.reflect.Constructor.newInstance(Constructor.java:417) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.view.LayoutInflater.createView(LayoutInflater.java:593) 08-09
22:07:00.571: E/AndroidRuntime(11028): ... 23 more 08-09 22:07:00.571:
E/AndroidRuntime(11028): Caused by: java.lang.OutOfMemoryError 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:817)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.content.res.Resources.loadDrawable(Resources.java:2854) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.content.res.TypedArray.getDrawable(TypedArray.java:602) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.view.View.(View.java:3460) 08-09 22:07:00.571:
E/AndroidRuntime(11028): at android.view.ViewGroup.(ViewGroup.java:446)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.widget.LinearLayout.(LinearLayout.java:176) 08-09 22:07:00.571:
E/AndroidRuntime(11028): at
android.widget.LinearLayout.(LinearLayout.java:172) 08-09 22:07:00.571:
E/AndroidRuntime(11028): ... 26 more
I'm writing a app with some info on ingress. This is my first app so i'm
kinda new to android.
I have a menu which consist of 8 buttons. For one of them it opens a
activity that has two imagebuttons. Each imagebutton opens a different
activity that has only a textview in it.
My problem is this. When I first run the app it crashes if i hit either of
the image buttons. it then returns to the menu. If i go back to either
imagebutton, now it works.
I'm running my app on a GS4. debugging it gave me the error source not
found. not sure whats wrong.
the class with the two buttons
public class Factions extends Activity implements View.OnClickListener {
ImageButton resis, enligh;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_factions);
setup();
}
private void setup() {
resis = (ImageButton) findViewById(R.id.ibResistance);
resis.setOnClickListener(this);
enligh = (ImageButton) findViewById(R.id.ibEnlightened);
enligh.setOnClickListener(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.factions, menu);
return true;
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent i;
switch (v.getId()) {
case R.id.ibEnlightened:
i = new Intent(getApplicationContext(), AboutEnlightened.class);
startActivity(i);
break;
case R.id.ibResistance:
i = new Intent(getApplicationContext(), AboutResistance.class);
startActivity(i);
break;
}
}
}
the xml for that class
<ImageButton
android:id="@+id/ibResistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="@drawable/resistance_logo_button" />
<ImageButton
android:id="@+id/ibEnlightened"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="@drawable/enlightened_logo_button" />
the class for the two textviews only have the onCreate and
onCreateOptionsMenu methods. i don't need to change them or add anything
to it. If you need any other info let me know. Thanks in advance.
the logcat shows this
08-09 22:07:00.541: I/dalvikvm(11028): at
android.content.res.Resources.loadDrawable(Resources.java:2854) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.content.res.TypedArray.getDrawable(TypedArray.java:602) 08-09
22:07:00.541: I/dalvikvm(11028): at android.view.View.(View.java:3460)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.view.ViewGroup.(ViewGroup.java:446) 08-09 22:07:00.541:
I/dalvikvm(11028): at android.widget.LinearLayout.(LinearLayout.java:176)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.widget.LinearLayout.(LinearLayout.java:172) 08-09 22:07:00.541:
I/dalvikvm(11028): at java.lang.reflect.Constructor.constructNative(Native
Method) 08-09 22:07:00.541: I/dalvikvm(11028): at
java.lang.reflect.Constructor.newInstance(Constructor.java:417) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.view.LayoutInflater.createView(LayoutInflater.java:593) 08-09
22:07:00.541: I/dalvikvm(11028): at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.view.LayoutInflater.onCreateView(LayoutInflater.java:666) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.view.LayoutInflater.inflate(LayoutInflater.java:467) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.view.LayoutInflater.inflate(LayoutInflater.java:397) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.view.LayoutInflater.inflate(LayoutInflater.java:353) 08-09
22:07:00.541: I/dalvikvm(11028): at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:327)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.app.Activity.setContentView(Activity.java:1928) 08-09
22:07:00.541: I/dalvikvm(11028): at
com.kaveman.ingress.faqs.AboutResistance.onCreate(AboutResistance.java:12)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.app.Activity.performCreate(Activity.java:5250) 08-09 22:07:00.541:
I/dalvikvm(11028): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2297)
08-09 22:07:00.541: I/dalvikvm(11028): at
android.app.ActivityThread.access$700(ActivityThread.java:152) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.os.Handler.dispatchMessage(Handler.java:99) 08-09 22:07:00.541:
I/dalvikvm(11028): at android.os.Looper.loop(Looper.java:137) 08-09
22:07:00.541: I/dalvikvm(11028): at
android.app.ActivityThread.main(ActivityThread.java:5328) 08-09
22:07:00.541: I/dalvikvm(11028): at
java.lang.reflect.Method.invokeNative(Native Method) 08-09 22:07:00.541:
I/dalvikvm(11028): at java.lang.reflect.Method.invoke(Method.java:511)
08-09 22:07:00.541: I/dalvikvm(11028): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
08-09 22:07:00.541: I/dalvikvm(11028): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 08-09
22:07:00.541: I/dalvikvm(11028): at dalvik.system.NativeStart.main(Native
Method) 08-09 22:07:00.541: D/skia(11028): --- allocation failed for
scaled bitmap 08-09 22:07:00.541: D/AndroidRuntime(11028): Shutting down
VM 08-09 22:07:00.541: W/dalvikvm(11028): threadid=1: thread exiting with
uncaught exception (group=0x41173ac8) 08-09 22:07:00.571:
E/AndroidRuntime(11028): FATAL EXCEPTION: main 08-09 22:07:00.571:
E/AndroidRuntime(11028): java.lang.RuntimeException: Unable to start
activity
ComponentInfo{com.kaveman.ingress.faqs/com.kaveman.ingress.faqs.AboutResistance}:
android.view.InflateException: Binary XML file line #1: Error inflating
class 08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2247)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2297)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.app.ActivityThread.access$700(ActivityThread.java:152) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.os.Handler.dispatchMessage(Handler.java:99) 08-09 22:07:00.571:
E/AndroidRuntime(11028): at android.os.Looper.loop(Looper.java:137) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.app.ActivityThread.main(ActivityThread.java:5328) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
java.lang.reflect.Method.invokeNative(Native Method) 08-09 22:07:00.571:
E/AndroidRuntime(11028): at
java.lang.reflect.Method.invoke(Method.java:511) 08-09 22:07:00.571:
E/AndroidRuntime(11028): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
dalvik.system.NativeStart.main(Native Method) 08-09 22:07:00.571:
E/AndroidRuntime(11028): Caused by: android.view.InflateException: Binary
XML file line #1: Error inflating class 08-09 22:07:00.571:
E/AndroidRuntime(11028): at
android.view.LayoutInflater.createView(LayoutInflater.java:619) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.view.LayoutInflater.onCreateView(LayoutInflater.java:666) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.view.LayoutInflater.inflate(LayoutInflater.java:467) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.view.LayoutInflater.inflate(LayoutInflater.java:397) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.view.LayoutInflater.inflate(LayoutInflater.java:353) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:327)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.app.Activity.setContentView(Activity.java:1928) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
com.kaveman.ingress.faqs.AboutResistance.onCreate(AboutResistance.java:12)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.app.Activity.performCreate(Activity.java:5250) 08-09 22:07:00.571:
E/AndroidRuntime(11028): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
08-09 22:07:00.571: E/AndroidRuntime(11028): ... 11 more 08-09
22:07:00.571: E/AndroidRuntime(11028): Caused by:
java.lang.reflect.InvocationTargetException 08-09 22:07:00.571:
E/AndroidRuntime(11028): at
java.lang.reflect.Constructor.constructNative(Native Method) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
java.lang.reflect.Constructor.newInstance(Constructor.java:417) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.view.LayoutInflater.createView(LayoutInflater.java:593) 08-09
22:07:00.571: E/AndroidRuntime(11028): ... 23 more 08-09 22:07:00.571:
E/AndroidRuntime(11028): Caused by: java.lang.OutOfMemoryError 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:817)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.content.res.Resources.loadDrawable(Resources.java:2854) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.content.res.TypedArray.getDrawable(TypedArray.java:602) 08-09
22:07:00.571: E/AndroidRuntime(11028): at
android.view.View.(View.java:3460) 08-09 22:07:00.571:
E/AndroidRuntime(11028): at android.view.ViewGroup.(ViewGroup.java:446)
08-09 22:07:00.571: E/AndroidRuntime(11028): at
android.widget.LinearLayout.(LinearLayout.java:176) 08-09 22:07:00.571:
E/AndroidRuntime(11028): at
android.widget.LinearLayout.(LinearLayout.java:172) 08-09 22:07:00.571:
E/AndroidRuntime(11028): ... 26 more
R language how to access wts of a class objects
R language how to access wts of a class objects
i have built a neural net class object using
http://www.inside-r.org/r-doc/nnet/nnet and i am trying to access values
returned by that object.
Values section of page http://www.inside-r.org/r-doc/nnet/nnet says that
"object of class "nnet" or "nnet.formula". Mostly internal structure, but
has components
wts the best set of weights found".
But how to get those weights?
i tried my neuralnetobject$wts but didnt get anything in return. I also
tried neuralnetobject$finalModel$wts...but didnt get what i was looking
for :(
i have built a neural net class object using
http://www.inside-r.org/r-doc/nnet/nnet and i am trying to access values
returned by that object.
Values section of page http://www.inside-r.org/r-doc/nnet/nnet says that
"object of class "nnet" or "nnet.formula". Mostly internal structure, but
has components
wts the best set of weights found".
But how to get those weights?
i tried my neuralnetobject$wts but didnt get anything in return. I also
tried neuralnetobject$finalModel$wts...but didnt get what i was looking
for :(
How do I work around a "Could not resolve host: (nil)..." error when installing Homebrew?
How do I work around a "Could not resolve host: (nil)..." error when
installing Homebrew?
I'm trying to install Homebrew on OS X 10.8.4, and get the following:
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press ENTER to continue or any other key to abort
==> Downloading and Installing Homebrew...
error: Could not resolve host: (nil); nodename nor servname provided, or
not known while accessing
https://github.com/mxcl/homebrew/info/refs?service=git-upload-pack
fatal: HTTP request failed
Failed during: git fetch origin master:refs/remotes/origin/master -n
What is causing this problem? How do I work around it?
Update (with answers to the questions in sameetandpotatoes's comment):
$ curl -Lsf http://github.com/mxcl/homebrew/tarball/master | tar xz
--strip 1 -C /usr/local
bin/: Can't update time for bin
share/: Can't update time for share
share/man/: Can't update time for share/man
share/man/man1/: Can't update time for share/man/man1
tar: Error exit delayed from previous errors.
$ ruby --version
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build
5658) (LLVM build 2336.11.00)
I haven't installed Xcode. But I did install "Command Line Tools (OS X
Mountain Lion) for Xcode - April 2013" from
https://developer.apple.com/downloads/index.action.
installing Homebrew?
I'm trying to install Homebrew on OS X 10.8.4, and get the following:
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press ENTER to continue or any other key to abort
==> Downloading and Installing Homebrew...
error: Could not resolve host: (nil); nodename nor servname provided, or
not known while accessing
https://github.com/mxcl/homebrew/info/refs?service=git-upload-pack
fatal: HTTP request failed
Failed during: git fetch origin master:refs/remotes/origin/master -n
What is causing this problem? How do I work around it?
Update (with answers to the questions in sameetandpotatoes's comment):
$ curl -Lsf http://github.com/mxcl/homebrew/tarball/master | tar xz
--strip 1 -C /usr/local
bin/: Can't update time for bin
share/: Can't update time for share
share/man/: Can't update time for share/man
share/man/man1/: Can't update time for share/man/man1
tar: Error exit delayed from previous errors.
$ ruby --version
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build
5658) (LLVM build 2336.11.00)
I haven't installed Xcode. But I did install "Command Line Tools (OS X
Mountain Lion) for Xcode - April 2013" from
https://developer.apple.com/downloads/index.action.
python float formatting weirdness?
python float formatting weirdness?
I'm trying to debug two different python scripts that execute very similar
code. These scripts set a, which is a simple float.
For script 1:
ipdb> print sys.version
2.7 (r27:82500, Jul 15 2010, 13:04:38)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)]
ipdb> type(a)
<type 'float'>
ipdb> print a
17.23105
ipdb> print '{0:.4f}'.format(a)
17.2311
For script 2:
ipdb> print sys.version
2.7 (r27:82500, Jul 15 2010, 13:04:38)
ipdb> print type(a)
<type 'float'>
ipdb> print a
17.23105
ipdb> print '{0:.4f}'.format(a)
17.2310
How is it possible that a formats differently in the two cases? In what
ways can a possibly differ between the two scripts, if I've already
checked that their value is the same at 17.23105 ? (unfortunately the
python code that originally sets a is very, very long... I wouldn't want
to bore everyone with 1000+ lines)
I'm trying to debug two different python scripts that execute very similar
code. These scripts set a, which is a simple float.
For script 1:
ipdb> print sys.version
2.7 (r27:82500, Jul 15 2010, 13:04:38)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)]
ipdb> type(a)
<type 'float'>
ipdb> print a
17.23105
ipdb> print '{0:.4f}'.format(a)
17.2311
For script 2:
ipdb> print sys.version
2.7 (r27:82500, Jul 15 2010, 13:04:38)
ipdb> print type(a)
<type 'float'>
ipdb> print a
17.23105
ipdb> print '{0:.4f}'.format(a)
17.2310
How is it possible that a formats differently in the two cases? In what
ways can a possibly differ between the two scripts, if I've already
checked that their value is the same at 17.23105 ? (unfortunately the
python code that originally sets a is very, very long... I wouldn't want
to bore everyone with 1000+ lines)
Subscribe to:
Posts (Atom)