Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <string.h>
#define true 1
#define false 0
typedef int bool;
void reverse_sentence(char str[]);
void reverse_string(char str[], int start, int end);
import java.util.*;
class Node {
Node left;
Node right;
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root_about"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageView
android:id="@+id/iv_icon"
android:layout_width="wrap_content"
package cn.yo2.aquarium.alertdialogtest;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
<?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">
<Button android:id="@+id/btn_show_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="show dialog 1" />
<Button android:id="@+id/btn_show_2"
package cn.yo2.aquarium.webviewtest;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class Main extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
<?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">
<WebView
android:id="@+id/webview_1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.0"/>
<WebView
/*
* Quicksort sorts by employing a divide and conquer strategy to divide a
* list into two sub-lists.Full example of quicksort on a random set of
* numbers. The boxed element is the pivot. It is always chosen as the
* last element of the partition.
*
* The steps are:
* 1. Pick an element, called a pivot, from the list.
* 2. Reorder the list so that all elements which are less than the pivot
* come before the pivot and so that all elements greater than the pivot
/*
* Exercise 5-4. Write the function strend(s,t), which returns 1 if the
* string t occurs at the end of the string s, and zero otherwise.
*/
#include <stdio.h>
#include <string.h>
int strend(char *s, char *t)
{
@shaobin0604
shaobin0604 / tcpl-ex-5-1.c
Created November 26, 2009 07:19
Exercise 5-1
/*
* Exercise 5-1. As written, getint treats a + or - not followed by a
* digit as a valid representation of zero. Fix it to push such a character
* back on the input.
*/
#include <stdio.h>
#include <ctype.h>
int getch(void);