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, re | |
from PyQt5.QtCore import * | |
from PyQt5.QtGui import * | |
from PyQt5.QtWidgets import * | |
class SliderColorChooser(QWidget): | |
# Choose colors using a slider interface | |
# TODO this currently uses standard Qt Widgets, maybe write some of our own? |
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
# A simple example to implement a layer feature, it tests: | |
# -- Layers | |
# -- .gif load and aniamiton | |
# -- Zooming | |
# | |
# All if this should be done using the QGraphicsView Framework | |
import sys | |
from PyQt5.QtCore import * | |
from PyQt5.QtGui import * |
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
// Filename: Downloader.cs | |
// Author: Benjamin N. Summerton <define-private-public> | |
// License: Unlicense (http://unlicense.org/) | |
using System; | |
using System.IO; | |
using System.Text; | |
using System.Net.Http; | |
using System.Threading; | |
using System.Threading.Tasks; |
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
// Filename: HttpServer.cs | |
// Author: Benjamin N. Summerton <define-private-public> | |
// License: Unlicense (http://unlicense.org/) | |
using System; | |
using System.IO; | |
using System.Text; | |
using System.Net; | |
using System.Threading.Tasks; |
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
// Filename: DnsExample.cs | |
// Author: Benjamin N. Summerton <define-private-public> | |
// License: Unlicense (http://unlicense.org/) | |
using System; | |
using System.Net; | |
namespace DnsExample | |
{ | |
class DnsExample |
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
// Filename: IPAddressExample.cs | |
// Author: Benjamin N. Summerton <define-private-public> | |
// License: Unlicense (http://unlicense.org/) | |
using System; | |
using System.Net; | |
namespace IPAddressExample | |
{ | |
class IPAddressExample |
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
// Filename: IPEndPointExample.cs | |
// Author: Benjamin N. Summerton <define-private-public> | |
// License: Unlicense (http://unlicense.org/) | |
using System; | |
using System.Net; | |
namespace IPEndPointExample | |
{ | |
class IPEndPointExample |
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
// Filename: TcpChatMessenger.cs | |
// Author: Benjamin N. Summerton <define-private-public> | |
// License: Unlicense (http://unlicense.org/) | |
using System; | |
using System.Text; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.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
// Checks if a socket has disconnected | |
// Adapted from -- http://stackoverflow.com/questions/722240/instantly-detect-client-disconnection-from-server-socket | |
private static bool _isDisconnected(TcpClient client) | |
{ | |
try | |
{ | |
Socket s = client.Client; | |
return s.Poll(10 * 1000, SelectMode.SelectRead) && (s.Available == 0); | |
} | |
catch(SocketException se) |
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
// Filename: GuessMyNumberGame.cs | |
// Author: Benjamin N. Summerton <define-private-public> | |
// License: Unlicense (http://unlicense.org/) | |
using System; | |
using System.Net.Sockets; | |
using System.Threading; | |
namespace TcpGames | |
{ |
OlderNewer