Skip to content

Instantly share code, notes, and snippets.

View jwasinger's full-sized avatar
💭
👍

jwasinger

💭
👍
View GitHub Profile
int get_ip_from_hostname(char *host, char **output, int ip_v6)
{
int error;
struct addrinfo hints, *res;
struct in_addr addr;
struct in6_addr addr6;
if(!host || !output)
{
url(r'^onid_transition/(?P<user_code>\w+)$', 'list_app.views.onid_transition', name='onid_transition')
#example: https://.../onid_transition/842f3611c9b1f91f68bee646836679
#how I'm currently trying to access the 'user_code' portion of the url in my template to create a link to another view that
#also requires the 'user_code' as a parameter:
"{% url 'list_app:no_onid' user_code=onid_transition.user_code%}"
#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
// Global variables
// The main window class name.
static TCHAR szWindowClass[] = _T("win32app");
MIGRATION_HOST='localhost'
MIGRATION_USER='maintain_sb'
MIGRATION_PASSWD=''
MIGRATION_DB='maintain'
if not obj and pk:
obj = get_object_or_404(Klass, pk=pk)
elif not obj and pk:
raise Exception("pk or obj required.")
======================================================================
ERROR: Test that adding data triggers a rebuild
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jared/projects/cyder/cyder/cydhcp/build/tests/build_tests.py", line 66, in test_build_and_push
self.builder.build()
File "/home/jared/projects/cyder/cyder/cydhcp/build/builder.py", line 114, in build
self.check_syntax()
File "/home/jared/projects/cyder/cyder/cydhcp/build/builder.py", line 140, in check_syntax
self.dhcpd, os.path.join(self.stage_dir, self.check_file)
function foo()
{
var promise = new Promise();
my_async(args, function callback()
{
//do something
...
if(error_happens)
{
promise.reject(error_value); //calls the 'error' function in promise.then()
function foo()
{
my_async(args, function(){
return val; //this returns from foo()
})
}
var val = foo(); //same val as returned by asnyc function
;***********************************************************
;*
;* robot.asm
;*
;* This is the RECEIVE file for Lab 8 of ECE 375
;*
;***********************************************************
;*
;* Author: Enter your name
;* Date: Enter Date
@jwasinger
jwasinger / message_header.c
Last active March 15, 2016 04:24
Message Header RNC
#define TYPE_POST_CHUNK 1
//post chunk followed by ChunkHeader and payload
#define TYPE_REQUEST_CHUNK 2
//request chunk followed by null-terminated chunk file name str
#define TYPE_ACKNOWLEDGE 3
//message followed by nothing
#define TYPE_ERROR 4