Thursday, 12 September 2013

Admob Help Please It's a challenge

Admob Help Please It's a challenge

Okay guys I have done everything I can think of before bother you for
help. And usually I've very good at picking up on this stuff but I am
truly at a loss. I have tried different tuts, mixed and match with no
success. I'm just looking for a detailed (SIMPLE) method to get admod
showing at the top and the bottom (Not at the same time but easily edited
to move to either)
I'm using dreamweaver 5.5 to build and the updated JARS for everything. I
have all the admod stuff in place and the light is green. I had a bunch of
errors at first but I was finally able to get the app to load in the
emulator and it looks great but no ads ever showed after 4 days of fooling
around with it.
Not the working code I had it messed up :)
I'm not lazy just frustrated so an easy, complete cut and pasted would be
a life saver. I do think one of my earlier problems was I wasn't leaving
enough space.
Okay here are my codes: (And it is not loading in the emulator)
DEFAULT ACTIVITY JAVA:
package ___BUNDLE___;
import android.app.Activity;
import android.os.Bundle;
import com.phonegap.*;
public class DefaultActivity extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.setIntegerProperty( "splashscreen", R.drawable.splash );
super.loadUrl("file:///android_asset/www/index.html", 1000);
}
}
MAIN:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

</LinearLayout>

MANIFEST:
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- A full list of available permissions is available at
http://developer.android.com/reference/android/Manifest.permission.html
-->
<application android:icon="@drawable/icon"
android:label="@string/app_name" android:debuggable="true">
<activity android:name=".DefaultActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
/>
</application>
<uses-sdk android:minSdkVersion="7" />
And if this is junk I'll take one that will work I just really need to get
this app up and running...
Thank you in advance I know you guys are great here and I will give the
knowledge back to others in need.
One side note for some reason all my packages say DefaultActivity instead
of the package name (I'm talking in my projects list) I can't figure out
how to make it show it's true name. Yeah I know, but hey I'm trying hard
to learn it....
Thanks (I used CTL K but it's not doing it well sorry)

How to get a style with multiple values in jquery?

How to get a style with multiple values in jquery?

I have this div:
<div id="centerFrame" style="border-top-left-radius: 25px 0px;"></div>
but when i try to get the value it always returns 0px, how can I get both
values?
console.log($("#centerFrame").css("border-top-left-radius"));
>>0px

Java not working on Wordpress front page

Java not working on Wordpress front page

I have a form that runs its data through a Javascript filter. In
Wordpress, it works wonderfully when the form is in the sidebar, but not
when it's on the front page. I've used wp_enqueue to call the script, hard
coded the script into the header, called for it in the footer... nothing
works.

Three time firing of click event on dynamically created element

Three time firing of click event on dynamically created element

I am facing very simple problem. I am trying to add click event on the
dynamically generated elements like this
$(document).ready(function(){
$('ul').on('click', 'li.clickable', function() {
console.log( $(this).text() );
});
});
<ul id="codingView">
<li id="" style="display:none;" class="clickable"><span></span></li>
</ul>
Here I have created two li elements dynamically.
The problem is that console is writing 3 times on every click on li. Why?
Any workaround.

Wordpress - Payfast Gateway for Membership Plugin

Wordpress - Payfast Gateway for Membership Plugin

I am looking for a payfast gateway definition for the membership plugin. I
think a user called DieterW may be able to help me because I saw this post
of his:
http://premium.wpmudev.org/forums/topic/payment-gateways-and-integration-membership-plugin
I am hoping it is the same user on this site. If anyone else has some
advice on how I could approach this, it would be greatly appreciated. I
might have to try and write it myself but I don't want to spend too much
time on it.
Thanks.

Wednesday, 11 September 2013

Install numpy for Python3 command not found error

Install numpy for Python3 command not found error

$ sudo python3 setup.py install
sudoFpython3Fcommand not found
I have rhel/redhat. Those threads about apt-get don't work. Does anyone
has an idea?

Update records imminently after rails controller action?

Update records imminently after rails controller action?

My app has activity notifications, each has a flag 'seen' which I use to
check if the user has looked at them.
My controller looks like this:
def index
@unseen_activities = current_user.notifications.unseen.order(:updated_at
=> :desc)
@seen_activities = current_user.notifications.seen.order(:updated_at =>
:desc)
# mark them as viewed
current_user.notifications.update_all(:seen => true)
end
But the activities are all loaded as having been seen, even though this is
updated after the collections are made. What am I missing? #noob