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
/* | |
* This Java source file was generated by the Gradle 'init' task. | |
*/ | |
import groovy.lang.GroovyClassLoader; | |
import groovy.cli.commons.CliBuilder; | |
import groovy.cli.Option; | |
import java.io.File; | |
import java.io.IOException; | |
import java.nio.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
declare i32 @atoi(i8* nocapture) | |
declare i32 @printf(i8* noalias nocapture, ...) nounwind | |
@.result_fmt = private unnamed_addr constant [18 x i8] c"pascal(%d,%d)=%d\0A\00" | |
define i32 @pascal(i32 %n, i32 %k) { | |
%n_eq_0 = icmp eq i32 %n, 0 | |
br i1 %n_eq_0, label %base_case_1, label %n_is_not_base | |
n_is_not_base: |
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 "generic_list.hpp" | |
#include <algorithm> | |
#include <cstdlib> | |
using std::for_each; | |
using std::free; | |
using std::malloc; | |
using std::memcpy; | |
using std::memmove; |
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 org.apache.camel.CamelContext; | |
import org.apache.camel.Exchange; | |
import org.apache.camel.Processor; | |
import org.apache.camel.builder.RouteBuilder; | |
import org.apache.camel.impl.DefaultCamelContext; | |
public class CamelDemo { | |
public static void main(String[] args) throws Exception { | |
CamelContext cContext= new DefaultCamelContext(); | |
RouteBuilder builder= new RouteBuilder() { |
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
# compile: gcc -o fib_x64 fib_x64.s -m64 | |
# run: ./fib <number> | |
.global main | |
.data | |
formatstr: .asciz "fib(%d)= %d\n" | |
main: | |
push %r12 | |
movq 8(%rsi),%rdi | |
call atoi |
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
# compile: gcc -o fib fib.s -m32 | |
# run: ./fib <number> | |
.global main | |
.data | |
formatstr: .asciz "fib(%d)= %d\n" | |
main: | |
pop %ecx | |
movl 4(%eax),%edx | |
pushl %edx |
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
/** | |
* Expanded set of callbacks specific to Killing Floor events | |
* @author etsai | |
*/ | |
class KFGameRules extends GameRules | |
abstract; | |
/** | |
* Determines if the perk change should be allowed or not | |
* @param player Controller of the player who wants to change perks |
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
QueryBuilder() { | |
and() { | |
eq(col, val) | |
lt(col, val) | |
} | |
} | |
///< (c1 = v1 || c2 < v2 | |
QueryBuilder() { | |
or() { |
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 javax.naming.NamingEnumeration; | |
import javax.naming.NamingException; | |
import javax.naming.directory.Attributes; | |
import javax.naming.directory.DirContext; | |
import javax.naming.ldap.InitialLdapContext; | |
/** | |
* Example of how to do a dnssd query in Java. Code based on answer from: | |
* http://stackoverflow.com/questions/738750/querying-the-dns-service-records-to-find-the-hostname-and-tcp-ip | |
* @author etsai |
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
/** | |
* Compiled on VS2012 | |
*/ | |
#include <winsock2.h> //winsock | |
#include <windns.h> //DNS api's | |
#include <Rpc.h> | |
#include <iostream> | |
#include <functional> | |
#include <map> |
NewerOlder