This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| class Node { | |
| Node left; | |
| Node right; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * 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) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * 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); |