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 android.os.Bundle; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.support.v4.app.Fragment; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.Set; |
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 android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.os.Bundle; | |
| import android.view.Menu; | |
| import java.util.ArrayList; | |
| import java.util.Set; | |
| import android.app.Activity; | |
| import android.bluetooth.BluetoothAdapter; |
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 android.bluetooth.BluetoothSocket; | |
| import android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.content.IntentFilter; | |
| import android.os.Bundle; | |
| import android.view.Menu; | |
| import java.io.IOException; | |
| import java.util.ArrayList; |
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
| public void bluetoothConnection(View view) { | |
| //private final BluetoothSocket mmSocket; | |
| //private final BluetoothDevice mmDevice; | |
| BluetoothConnectThread confectionTest = new BluetoothConnectThread(mBluetoothAdapter); | |
| Toast.makeText(getApplicationContext(), "bluetoothConnection()", | |
| Toast.LENGTH_SHORT).show(); | |
| } | |
| private class BluetoothConnectThread extends Thread { | |
| private final BluetoothSocket mmSocket; |
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
| ----------------------- | |
| BluetoothChat.java | |
| @Override | |
| public boolean onCreateOptionsMenu(Menu menu) { | |
| MenuInflater inflater = getMenuInflater(); | |
| inflater.inflate(R.menu.option_menu, menu); | |
| return true; | |
| } | |
| ------------------------ |
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> | |
| // main(){ | |
| // char myArray[80], search, *ptr; | |
| // int cnt=0; | |
| // printf(" Type a phrase... "); | |
| // gets(myArray); | |
| // printf(" enter a special character to be searched and counted:\n"); | |
| // scanf(" %c", &search); | |
| // ptr = myArray; |
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 <conio.h> | |
| int sOcc(char *ptr, char specialChar); | |
| main(){ | |
| char myArray[80], search, *ptr; | |
| int cnt=0; | |
| printf(" Please enter a phrase... "); | |
| gets(myArray); |
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> | |
| int sOcc(char *ptr, char *specialChar); | |
| main(){ | |
| char myArray[80], search, *ptr; | |
| int cnt=0; | |
| printf("\n Please enter a phrase... "); | |
| gets(myArray); | |
| printf(" Please enter a search char ..."); |
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
| /* Write a c program to convert given number of days to a measure of time | |
| * given in years, weeks and days. For example 375 days is equal to 1 year | |
| * 1 week and 3 days (ignore leap year) | |
| */ | |
| #include <stdio.h> | |
| #define DAYSINWEEK 7 | |
| void main() | |
| { |
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 <stdbool.h> | |
| /* This function calculates (ab)%c */ | |
| int modulo(int a,int b,int c){ | |
| long long x=1,y=a; // long long is taken to avoid overflow of intermediate results | |
| while(b > 0){ | |
| if(b%2 == 1){ | |
| x=(x*y)%c; | |
| } |