Version: 2022.02.25a
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 <stdlib.h> | |
#include <stdio.h> | |
#include <time.h> | |
#include <pthread.h> | |
#define sensor_alto1 100; | |
#define sensor_alto2 150; | |
#define sensor_alto3 200; | |
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
int but; | |
void main() | |
{ | |
char x = 0; | |
int i=0; | |
bit Play; | |
bit LastStatusPlay; | |
bit LastStatusClear; |
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
# coding: utf-8 | |
import unittest | |
# Unit tests for kata 'domevent' | |
''' Synchronous domain events in pure Python. | |
#- triggering an event | |
#- registering a callback | |
#- triggering an event with 1 handler | |
#- triggering an event with 2 handlers |
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
const BaseForm = Vue.extend({ | |
template: ` | |
<form> | |
<block name="header"> | |
<h1>{{ title }}</h1> | |
</block> | |
<block name="content">Form inputs go here</block> | |
<block name="actions"> | |
<button @click="saveRecord">Save</button> | |
<button @click="deleteRecord">Delete</button> |
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
{ | |
"completed": [ | |
{ | |
"id": "1562788901_f9750ff9-f3ae-4865-a9ea-1339d644f2f5", | |
"email": "[email protected]", | |
"pending_at": 1562788901, | |
"last_seen": 1562789081, | |
"completed_at": 1562789081, | |
"success": true, | |
"reason": null, |
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 signals and slugify | |
from django.db.models import signals | |
from django.template.defaultfilters import slugify | |
# function for use in pre_save | |
def yourmodel_pre_save(signal, instance, sender, **kwargs): | |
if not instance.slug: | |
slug = slugify(instance.attribute) # change the attibute to the field that would be used as a slug | |
new_slug = slug |
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
Traceback (most recent call last): | |
File "services.py", line 11, in <module> | |
url, | |
File "/Users/gbrennon/Documents/Projects/Sercortes/sercortes/env/lib/python3.6/site-packages/zeep/client.py", line 62, in __init__ | |
wsdl, self.transport, settings=self.settings) | |
File "/Users/gbrennon/Documents/Projects/Sercortes/sercortes/env/lib/python3.6/site-packages/zeep/wsdl/wsdl.py", line 84, in __init__ | |
root_definitions = Definition(self, document, self.location) | |
File "/Users/gbrennon/Documents/Projects/Sercortes/sercortes/env/lib/python3.6/site-packages/zeep/wsdl/wsdl.py", line 184, in __init__ | |
self.messages = self.parse_messages(doc) | |
File "/Users/gbrennon/Documents/Projects/Sercortes/sercortes/env/lib/python3.6/site-packages/zeep/wsdl/wsdl.py", line 336, in parse_messages |
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 base64 | |
from django.core.files.base import ContentFile | |
from rest_framework import serializers | |
class Base64ImageField(serializers.ImageField): | |
def from_native(self, data): | |
if isinstance(data, basestring) and data.startswith('data:image'): | |
# base64 encoded image - decode |
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 socket | |
HOST = '' | |
PORT = 5000 | |
tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
orig = (HOST, PORT) | |
tcp.bind(orig) | |
tcp.listen(1) | |
while True: |
NewerOlder