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 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) | |
{ |
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
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%}" |
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 <windows.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <tchar.h> | |
// Global variables | |
// The main window class name. | |
static TCHAR szWindowClass[] = _T("win32app"); |
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
MIGRATION_HOST='localhost' | |
MIGRATION_USER='maintain_sb' | |
MIGRATION_PASSWD='' | |
MIGRATION_DB='maintain' |
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
if not obj and pk: | |
obj = get_object_or_404(Klass, pk=pk) | |
elif not obj and pk: | |
raise Exception("pk or obj required.") |
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
====================================================================== | |
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) |
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
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() |
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
function foo() | |
{ | |
my_async(args, function(){ | |
return val; //this returns from foo() | |
}) | |
} | |
var val = foo(); //same val as returned by asnyc function |
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
;*********************************************************** | |
;* | |
;* robot.asm | |
;* | |
;* This is the RECEIVE file for Lab 8 of ECE 375 | |
;* | |
;*********************************************************** | |
;* | |
;* Author: Enter your name | |
;* Date: Enter Date |
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
#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 |
OlderNewer