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
fun Context.vibrate() { | |
val vibrator: Vibrator = try { | |
getSystemService(Context.VIBRATOR_SERVICE) as Vibrator | |
} catch (exception: ClassNotFoundException) { | |
exception.recordException() | |
null | |
} ?: return | |
when { | |
VERSION.SDK_INT >= VERSION_CODES.Q -> { |
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"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
x:Class="HW2.PeoplePage" | |
NavigationPage.HasBackButton="True" | |
NavigationPage.HasNavigationBar="False"> | |
<ListView x:Name="PersonView" HasUnevenRows="True" > | |
<ListView.ItemTemplate> | |
<DataTemplate> | |
<ViewCell> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 <pthread.h> | |
#include <semaphore.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define NO_OF_THREADS 10 | |
struct Singleton { | |
char *Data; | |
}; |
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 <pthread.h> | |
#include <semaphore.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define NO_OF_THREADS 10 | |
struct Singleton { | |
char *Data; | |
}; |
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 <stdio.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <semaphore.h> | |
pthread_t Job0, Job1, Job2, Job3, Job4, Job5, Job6, Job7, Job8, Job9; | |
sem_t sem0, sem1, sem2, sem3, sem4, sem5, sem6, sem7, sem71, sem8, sem9, sem61, sem62; | |
void *job0() { | |
sem_wait(&sem0); | |
sleep(2); | |
printf("%s \n", "Job0 is done"); |
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 java.io.*; | |
import java.util.Arrays; | |
/** | |
* Created by yasin_000 on 1.5.2019. | |
*/ | |
public class Utils { | |
public static byte[] fileToBytes(File f) throws IOException{ | |
InputStream fis = new FileInputStream(f); |
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 java.io.File; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
import java.net.URISyntaxException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; |
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
class ThreadActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_thread) | |
val thread = Thread { | |
val person = getPersonInfoById(5) | |
runOnUiThread { | |
progress_bar.visibility = View.GONE |
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.os.Bundle | |
import android.os.Handler | |
import android.os.Message | |
import android.view.View | |
import androidx.appcompat.app.AppCompatActivity | |
import kotlinx.android.synthetic.main.activity_main.* | |
import java.io.BufferedReader | |
import java.io.InputStreamReader | |
import java.net.URL |
NewerOlder