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
var ms = new ManualResetEvent(false); | |
var t1 = new Thread(new ParameterizedThreadStart(x => | |
{ | |
Console.WriteLine("1 numaralı thread 1. sinyali sinyal bekliyor"); | |
ms.WaitOne(); | |
Console.WriteLine("1 numaralı thread 1. sinyali aldı"); | |
Console.WriteLine("1 numaralı thread 2. sinyali sinyal bekliyor"); | |
ms.WaitOne(); | |
Console.WriteLine("1 numaralı thread 2. sinyali aldı"); |
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
class Program | |
{ | |
static var are = new AutoResetEvent (false); | |
static void Main() | |
{ | |
var t1 = new Thread (Task); | |
t1.Start(); | |
Thread.Sleep (3000); | |
are.Set(); //send a signal |
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
using System.Text; | |
using RabbitMQ.Client; | |
using RabbitMQ.Client.Events; | |
var factory = new ConnectionFactory(); | |
//AMQP URL | |
factory.Uri = new Uri("amqps://fxunuiqu:[email protected]/fxunuiqu"); | |
var queueName = "test-queue"; | |
using var connection = factory.CreateConnection() ; |
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
using System.Text; | |
using RabbitMQ.Client; | |
var factory = new ConnectionFactory(); | |
//AMQP URL | |
factory.Uri = new Uri("amqps://fxunuiqu:url_adres"); | |
var queueName = "test-queue"; | |
using (var connection = factory.CreateConnection()) | |
{ |
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
from flask import Flask | |
import webview | |
import sys | |
import threading | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello World!' |
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 webview | |
import base64 | |
def open_file_dialog(window): | |
file_types = ('Image Files (*.bmp;*.jpg;*.gif;*.png)', | |
'All files (*.*)') | |
path = window.create_file_dialog(webview.OPEN_DIALOG, | |
allow_multiple=False, | |
file_types=file_types) |
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 random | |
import webview | |
html = """ | |
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h1>JS API Example</h1> |
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
class Program | |
{ | |
private static T Deserialize(string objStr) | |
{ | |
byte[] b = Convert.FromBase64String(objStr); | |
using (var stream = new MemoryStream(b)) | |
{ | |
var formatter = new BinaryFormatter(); | |
stream.Seek(0, SeekOrigin.Begin); | |
return (T)formatter.Deserialize(stream); |
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
class Program | |
{ | |
static List<T>[] Partition<T>(List<T> list, int totalPartitions) | |
{ | |
if (list == null) | |
throw new ArgumentNullException("list"); | |
if (totalPartitions < 1) | |
throw new ArgumentOutOfRangeException("totalPartitions"); | |