Sunday, June 26, 2011

HelloWorld in Bash Scripting


HelloWorld.sh

#!/bin/sh
echo Hello World!
Create a Document > Empty File > Copy and Paste > File > Save As or rename > (file).sh

sh file.sh

HelloWorld with Batch Scripting


HelloWorld.bat

@echo off
echo HelloWorld!
pause
exit
Create a Text Document > Copy and Paste > File > Save As > (name).bat

Double Click on the .bat to run it.

or go to Command Prompt, cd (folder that file is in) then (file).bat

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