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<string.h> | |
int ipv4_to_string(uint32_t ipaddr, char *str) { | |
memset (str, 0, sizeof(char) * 50); | |
sprintf(str, "%d.%d.%d.%d", (ipaddr >> 24)&0xFF, | |
(ipaddr >> 16)&0xFF, (ipaddr >> 8)&0xFF, (ipaddr)&0xFF); |
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 "net" | |
import "fmt" | |
func main() { | |
ifaces, err := net.Interfaces() | |
_ = err // handle err | |
for _, v := range ifaces { | |
addrs, err := v.Addrs() |
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
$scope.edit=(who,index)-> | |
modalInstance = $uibModal.open | |
templateUrl: 'editModal' | |
resolve : | |
scheduleType : -> $scope.scheduleType | |
devices : ->$scope.devices | |
controller: [ '$scope', '$uibModalInstance', 'scheduleType', 'devices', ($scope, $uibModalInstance, scheduleType, devices)-> | |
$scope.scheduleType = scheduleType | |
$scope.devices = devices | |
$scope.ui = {} |
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> | |
struct test { | |
char a; | |
int b; | |
char c; | |
long 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdarg.h> | |
void CLI_TMP(char *msg, ...) | |
{ | |
va_list argptr; | |
int a,b; | |
char *c; |
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 int (*g)(int, int); | |
//function宣告 | |
int doAdd(int, int); | |
int doMinus(int, int); | |
g table[] = { | |
doAdd, |
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> | |
int main() { | |
uint32_t ipaddr; | |
ipaddr = 3764655192ul; // 224.100.20.88 | |
printf("%d.%d.%d.%d\n", | |
(ipaddr>>24)&0xFF, | |
(ipaddr>>16)&0xFF, |
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
os = require 'os' | |
dgram = require 'dgram' | |
test_receive = (ifaddr)-> | |
MDNS_PORT = 5353 # OSX refuses app to use port 5353 | |
MDNS_ADDRESS = "224.0.0.251" | |
s = dgram.createSocket('udp4') | |
ver = Number(process.versions.node.split('.')[1]) | |
if ver==10 |