Skip to content

Instantly share code, notes, and snippets.

@cpinto
cpinto / hacked up ntlm proxy tunnel
Created July 28, 2009 12:04
I use this program to wrap putty, which doesn't support NTLM auth, setting the proxy type to telnet and create a SOCKS proxy to a remote SSH server.
package ntlmptunnel;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.NTCredentials;
@whyrusleeping
whyrusleeping / kbNonblock.c
Created October 30, 2012 21:49
Non Blocking Keyboard Input (C++)
#include <termios.h>
#include <stdlib.h>
void RestoreKeyboardBlocking(struct termios *initial_settings)
{
tcsetattr(0, TCSANOW, initial_settings);
}
void SetKeyboardNonBlock(struct termios *initial_settings)
{
@ClickerMonkey
ClickerMonkey / Blend.java
Created November 18, 2013 19:58
Software graphics library with blending, textures, and simple primitives.
public abstract class Blend
{
public static final Blend Alpha = new Blend()
{
public int blend( int o, int n )
{
return Color.mixRGB( o, n, Color.alpha( n ), Color.alpha( o ) );
}
};
@vurtun
vurtun / gui.md
Last active October 4, 2023 15:44

Graphical User Interfaces

For the last few weeks I spend some time coding, writing and cleaning up my notes from almost a year since I published nuklear.

Basically this is a possible implementation for a graphical user interface builder backend with support for an immediate mode style API. So it provides a way to define non-mutating UI state, an immediate mode style API for dynamic UI components (lists,trees,...) and a combination of both.

The core implementation is ~800 LOC without any kind of default widgets or extensions. At first this seems quite counter intuitive. However since the inherent design allows for lots of different ways to define any widget like buttons it does not make sense to provide a specific default implementation. The way this code was architectured furthermore removes the need for style/skinning configurations used in Nuklear since widget painting is just calling a small

Graphical User Interfaces

Last time I wrote a little bit about my current GUI research progress. There are some things that were misunderstood so I want to clarify some fundamental design decisions and finally write up some current problems and their solutions.

First up I want to clarify a component is not another term for what is usually refered to as widget. Instead wigets in this implementation are made out of n >= 1 components. Components themself are just rectangles with attributes left, right, top, bottom, center_x, center_y, width and height some behavior flags and an optional surface to draw into. For example a scroll regions is made up out of at least three