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
-module(device_server). | |
-compile(export_all). | |
start() -> | |
{ok, Listen} = gen_tcp:listen(51, [binary, | |
{reuseaddr, true}, | |
{active, true}]), | |
{ok, Socket} = gen_tcp:accept(Listen), | |
gen_tcp:close(Listen), |
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
int findMin(int d1, int d2, int d3) | |
{ | |
/* | |
* return min of d1, d2 and d3. | |
*/ | |
if(d1 < d2 && d1 < d3) | |
return d1; | |
else if(d1 < d3) | |
return d2; | |
else if(d2 < d3) |
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> | |
typedef struct _mountain{ | |
int s; | |
int h; | |
} MOUNTAIN; | |
void sort_mountain(MOUNTAIN *m,int c) { | |
int i,j; | |
MOUNTAIN tmp; |
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 <string.h> | |
#include <ctype.h> | |
#define MAX_ROW 64 | |
#define MAX_COLUMN 64 | |
#define ctoi(C) (C - '0') | |
typedef struct _room_pos { | |
int m; |
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 <string.h> | |
#define mid(A,B,C) ((A >= B && A <= C) || (A >= C && A <= B)?A:(((B >= A && B <= C) || (B >= C && B <= A))?B:C)) | |
int main(int argc, char *argv[]) | |
{ | |
char lock_up[80]; | |
char lock_down[80]; | |
char key[80]; | |
int lock_max,key_max; |
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 <stdlib.h> | |
#include <ctype.h> | |
#include <string.h> | |
#define MAX 21 | |
typedef struct _list { | |
int n; | |
struct _list *next; |
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 | |
class Crawler | |
{ | |
private $_group_id = ''; | |
private $graph_api = 'https://graph.facebook.com'; | |
public function __construct($group_id) { | |
$this->_group_id = $group_id; | |
} | |
public function getGroup() { |
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
-module(xbase). | |
-export([count/2]) | |
count(Base,Max) -> | |
count(($0+Base),"0",lists:reverse(integer_to_list(Max))). | |
count(_,Current,Current) -> | |
io:format("~s~n",[lists:reverse(Current)]), | |
ok; | |
count(Base,Current,Max) -> | |
io:format("~s~n",[lists:reverse(Current)]), |
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
public class Solve { | |
public static void main(String [] args) { | |
int T = 0,O = 0,G = 0,D = 0; | |
int temp; | |
for (int oo = 3; oo <= 9; oo++) { | |
if ( ((((4*oo)+(40*oo)) % 100) / 10) == oo) { | |
temp = ((4*oo)+(40*oo)); | |
for (int tt = 1; tt <= 9; tt++) { | |
if ( (((((400*tt) + temp)) / 100) % 10) == oo) { | |
int result = (400*tt) + temp; |
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
package main | |
import ("fmt"; "os") | |
func main() { | |
for i := 1; i < len(os.Args); i++ { | |
if i > 1 { | |
fmt.Print(" ") | |
} | |
fmt.Print(os.Args[i]) | |
} |
OlderNewer