Friday, June 17, 2011

How to use Old Addons in Mozilla FireFox

DISCLAIMER: This does not work for all addons!


When going to a Mozilla FireFox add-on download page (eg. https://addons.mozilla.org/en-US/firefox/addon/cookieswap/), the extension does not work on my 4.0.1 browser. Check your FireFox version by clicking Help > About FireFox.

We must change its compatibility by downloading the add-on. Dont click download directly because it tries to install the addon and will say the version is too old, so Right Click and Save Link As.. and save the ".xpi" file. (eg. https://addons.mozilla.org/firefox/downloads/latest/3255/addon-3255-latest.xpi)

The downloaded ".xpi" file is simply a ".zip" file. Double-click on the file and open it up and edit the "install.rdf" file. Change the "*.*.*" to the version of your browser. (eg. 4.0.*), leave the *(wildcard) at the end for further updates.

Source List
http://www.palaestratraining.com/blog/2008/07/firefox-3-make-older-add-ons-to-work/
http://kb.mozillazine.org/Install.rdf

Thursday, June 16, 2011

How to add the Force Quit Button in Ubuntu 11.04+

If you use Ubuntu 11.04+ Unity(app panel to the left), you cannot add application shortcuts to the top panel any more. In order to add a Force Quit Button in the apps panel:

Open the "Terminal" and Copy and Paste, hit enter:

gedit ~/.local/share/applications/quit.desktop

Copy and Paste in the Text Document and hit enter:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=xkill
Name=Force Quit
Icon=/usr/share/icons/Humanity/actions/48/process-stop.svg--adjust

Save the Text Document, then open home folder (view > show hidden files), browse to

.local/share/applications

And drag the quit.desktop onto the launcher

If you are using Gnome (Classic), here is what it would look like:


Saturday, June 4, 2011

How to Hack WebAssign's Watch It

If you use WebAssign, sometimes they give you the button to the "Watch It" which are very helpful. However, you might be able to find the watch it to more than just the problems they give you..

If the URL looks like:
http://www.cengage.com/physics/book_content/1439048622_serway/SerPSE8e_w_player/SerPSE8e_21_033.html

or

http://www.webassign.net/v4cgi/extra/bc_enhanced/index.tpl?asset=watch_it_player&asset_url=/bc_enhanced/SerPSE8_w_player/SerPSE8_25_033.html&UserPass=

Change the URL "SerPSE8_21_033.html"
The "21" is the "chapter" and then the "33" is the "problem number".

Monday, May 30, 2011

How to write HelloWorld in C?


HelloWorld.c

#include <stdio.h>
int main() {
  printf("Hello world!\n");
}

HelloWorld in C++


HelloWorld.cpp

#include <iostream>

using namespace std;

int main() {
cout << "HelloWorld" << endl;
return 0;
}

HelloWorld in Java

For a pure Java HelloWorld:

HelloWorld.java

public class HelloWorld {
 public static void main(String[] args) {
  System.out.println("HelloWorld");
 }
}

javac HellWorld.java

java HelloWorld

HelloWorld in Android

1) Download Eclipse IDE: http://www.eclipse.org/downloads/
2) Download Android SDK for Eclipse: http://developer.android.com/sdk/index.html
-Installing Setup: http://developer.android.com/sdk/installing.html
3) Beginning Tutorial: http://developer.android.com/resources/tutorials/hello-world.html


HelloWorld.java
location: HelloWorld > src > com.HelloWord > HelloWorld.java
package com.HelloWorld;

import android.app.Activity;
import android.os.Bundle;

public class Hello extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
    }

}

main.xml

location: HelloWorld > res > layout > main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
</LinearLayout>

strings.xml

location: HelloWorld > res > values > strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">Hello World, Hello!</string>
    <string name="app_name">HelloWorld</string>
</resources>

AndroidManifest.xml

location: HelloWorld > AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.HelloWorld"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="3" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Hello"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>


Notice: "System.out.println("HelloWorld!");" is not being used because "HelloWorld" is a string pulled from "strings.xml" which is used in the "main.xml"