This file contains hidden or 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
When two pointers are compared, the result depends on the relative locations in the | |
address space of the objects pointed to. If two pointers to object types both point to the | |
same object, or both point one past the last element of the same array object, they | |
compare equal. If the objects pointed to are members of the same aggregate object, | |
pointers to structure members declared later compare greater than pointers to members | |
declared earlier in the structure, and pointers to array elements with larger subscript | |
values compare greater than pointers to elements of the same array with lower subscript | |
values. All pointers to members of the same union object compare equal. If the | |
expression P points to an element of an array object and the expression Q points to the | |
last element of the same array object, the pointer expression Q+1 compares greater than |
This file contains hidden or 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
use std; | |
fn main() { | |
let j = std::json::from_str("[]"); | |
io::println(#fmt["%?", j]); | |
} |
This file contains hidden or 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 <stdio.h> | |
#include <netinet/in.h> | |
#include <sys/socket.h> | |
void ffunc(struct sockaddr_in s, struct sockaddr_in (*cb)(struct sockaddr_in)) { | |
printf("rust -> c\n"); | |
printf(" family: %u\n", s.sin_family); | |
printf(" port: %u\n", s.sin_port); | |
printf(" addr: %u\n", s.sin_addr.s_addr); | |
s.sin_family = AF_UNIX; |
This file contains hidden or 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
./bindgen.rs:241:30: 241:50 error: unresolved name: CXType_FunctionProto | |
./bindgen.rs:241 if def_ty.kind == CXType_FunctionProto || | |
^~~~~~~~~~~~~~~~~~~~ | |
./bindgen.rs:242:30: 242:52 error: unresolved name: CXType_FunctionNoProto | |
./bindgen.rs:242 def_ty.kind == CXType_FunctionNoProto { | |
^~~~~~~~~~~~~~~~~~~~~~ | |
./bindgen.rs:311:18: 311:31 error: unresolved name: CXType_Record | |
./bindgen.rs:311 if ty.kind == CXType_Record || ty.kind == CXType_Enum { | |
^~~~~~~~~~~~~ | |
./bindgen.rs:311:46: 311:57 error: unresolved name: CXType_Enum |
This file contains hidden or 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
# encoding: utf-8 | |
require 'open-uri' | |
require 'pdf/reader' | |
io = open('http://www.nctu.edu.tw/campus/bulletin/Calendar/calendar2011.pdf') | |
reader = PDF::Reader.new(io) | |
sems = reader.pages.map do |page| | |
sem = page.text.scan( | |
/本學期自(\d+)年(\d+)月(\d+)日.+至(\d+)年(\d+)月(\d+)日/ |
This file contains hidden or 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
--- sys/sys/ucontext.h.orig 2012-01-31 09:46:57.398803502 +0800 | |
+++ sys/sys/ucontext.h 2012-01-31 09:47:09.813803548 +0800 | |
@@ -79,7 +79,7 @@ | |
int swapcontext(ucontext_t *, const ucontext_t *); | |
#if __BSD_VISIBLE | |
-size_t __getcontextx_size(void); | |
+__size_t __getcontextx_size(void); | |
int __fillcontextx(char *ctx); | |
#endif |
This file contains hidden or 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
diff --git a/Network/SimpleIRC/Messages.hs b/Network/SimpleIRC/Messages.hs | |
index ee729ef..33291d4 100644 | |
--- a/Network/SimpleIRC/Messages.hs | |
+++ b/Network/SimpleIRC/Messages.hs | |
@@ -170,6 +170,6 @@ showCommand (MNick nick) = "NICK " `B.append` nick | |
showCommand (MNotice chan msg) = "NOTICE " `B.append` chan `B.append` | |
" :" `B.append` msg | |
showCommand (MAction chan msg) = showCommand $ MPrivmsg chan | |
- ("\x01 ACTION " `B.append` msg | |
- `B.append` "\x01") |
This file contains hidden or 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
# Contributor: Rainy <rainylau(at)gmail(dot)com> | |
# Contributor: Lee.MaRS <leemars at gmail dot com> | |
# Contributor: Daniel J Griffiths <[email protected]> | |
# Maintainer: Brad Fanella <[email protected]> | |
pkgname=ibus | |
pkgver=1.3.9 | |
pkgrel=3 | |
pkgdesc='Next Generation Input Bus for Linux.' | |
arch=('i686' 'x86_64') |
This file contains hidden or 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
<?php | |
function f() { | |
return array(1); | |
} | |
echo f()[0]; | |
?> |
This file contains hidden or 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
char** vectorToCharPtrs(vector<const char*> args) { | |
int size = args.size; | |
char **argv = new char*[size]; | |
for(int c = 0; c < size; ++c) { | |
argv[c] = args[c]; | |
} | |
return argv; | |
} |