This file contains 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 <iostream> | |
#include <string> | |
using namespace std; | |
int main(){ | |
int n; | |
int p; | |
string s; | |
cin >> n; |
This file contains 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
object Main{ | |
def main(args:Array[String]){ | |
Array.fill(10)(readInt).sortWith((a,b) => a > b).slice(0,3).map(println(_)) | |
} | |
} |
This file contains 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.app.Service; | |
import android.content.Intent; | |
import android.os.IBinder; | |
import android.speech.tts.TextToSpeech; | |
import android.util.Log; | |
import android.widget.Toast; | |
public class TTS extends Service implements TextToSpeech.OnInitListener { | |
public static TextToSpeech mTts; |
This file contains 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.content.Intent; | |
import android.util.Log; | |
import android.widget.Toast; | |
public class AlarmReceiver extends BroadcastReceiver{ | |
private final static String TAG = "AlarmReceiver"; |
This file contains 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 setAlarm() { | |
Intent intent = new Intent(getApplicationContext(), AlarmReceiver.class); | |
mSender = PendingIntent.getBroadcast(getApplicationContext(), 0, intent, PendingIntent.FLAG_CANCEL_CURRENT); | |
Calendar calendar = Calendar.getInstance(); | |
calendar.setTimeInMillis(System.currentTimeMillis()); | |
calendar.add(Calendar.SECOND, 10); | |
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); | |
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), mSender); | |
} |
This file contains 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"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.happasuke.newsgetter" > | |
<uses-sdk android:minSdkVersion="10" /> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:theme="@style/AppTheme" > |