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 sys | |
import subprocess | |
import threading | |
import time | |
import io | |
from PyQt4 import QtCore,QtGui | |
import gui | |
import re | |
class MyForm(QtGui.QMainWindow): | |
def __init__(self,parent=None): |
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
# Create your views here. | |
from django.http import HttpResponse | |
from django.template import Context, loader | |
from django.http import Http404 | |
from django import forms | |
from django.shortcuts import render | |
class RegisterForm(forms.Form): | |
login = forms.CharField(max_length=20) | |
password= forms.CharField(max_length=50) | |
email = forms.EmailField() |
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
# Create your views here. | |
from django.http import HttpResponse | |
from django.template import Context, loader | |
from django.http import Http404 | |
from django import forms | |
from index.utilities import * | |
from django.shortcuts import render | |
from index.models import * | |
import hashlib | |
from datetime import datetime |
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 json | |
import requests | |
import os | |
import sqlite3 | |
from datetime import datetime | |
from PyQt4.QtGui import * | |
from PyQt4.QtCore import * | |
import os | |
class Show(QMainWindow): | |
pass |
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
# Create your views here. | |
from django.http import HttpResponse | |
from forms.register import RegisterForm | |
from forms.login import LoginForm | |
from django.shortcuts import render,redirect | |
from main.models import User,Key | |
import hashlib, os | |
from django.template import RequestContext | |
from forms.GPGForm import GPGFormNew | |
import threading |
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 numpy as np | |
import pyopencl | |
host_vec_1 = np.array([37.0,50.0,54.0], dtype=np.float32) | |
host_vec_2 = np.array([35.0, 51.0, 54.0], dtype=np.float32) | |
host_vec_out = np.array(host_vec_1.shape, dtype=np.float32) | |
opencl_source = """ | |
__kernel void vector_add(__global float* c,__global float* a,__global float* b){ | |
unsigned int n = get_global_id(0); |
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 requests | |
import pyserial | |
import time | |
def normalizeData(text): | |
lines = [] | |
for line in text.split('\n'): | |
lines.append(line) | |
data = '' | |
for line in lines: | |
data += line |
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
prg = cl.Program(ctx, """ | |
struct Complex{ | |
float x; | |
float y; | |
}; | |
struct Complex c_pow(const struct Complex c){ | |
struct Complex res; | |
res.x = c.x*c.x-c.y*c.y; | |
res.y = 2*c.x*c.y; | |
return res; |
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> | |
using namespace std; | |
class CLista{ | |
public: | |
struct punkt3D{ | |
double x,y,z; | |
punkt3D *nastepny, *poprzedni; | |
}; | |
CLista(); |
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
1. Zaraz po podłączeniu się do serwera przez jakieś: | |
var socket = io.connect(url); | |
należy wyemitować zdarzenie "hello" i przesłać obiekt o strukturze: | |
{token: <token>}. Po tym zdarzeniu serwer wyemituje zdarzenie "helloResponse" i jeśli bedzie ok to w odpowiedzi będzie struktura {status: "success"}, a jeśli nie to {status: "failed", message: "Invalid token"} (nie uda się tylko jeśli token będzie zły). | |
Dopiero po przywitaniu można odbierać wiadomości i je wysyłać, a zapewnić sobie przywitanie możnaby w promisie, jakoś tak: | |
var greeted = new Promise( (resolve, reject) => { |
OlderNewer