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
$conn = ldap_connect($host, $port); | |
if ($conn) { | |
echo "ldap connected\n"; | |
if (ldap_bind($conn, $bind_dn, $password)) { | |
echo "bind suceeded\n"; | |
$search_result = ldap_search($conn, $base_dn, "(&(objectClass=person)(uid={$username}))"); | |
if ($search_result) { | |
echo "search suceeded\n"; | |
$entries = ldap_get_entries($conn, $search_result); | |
if (0 < count($entries)) { |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <GLUT/glut.h> | |
#define KEY_ESC 27 | |
#define WINDOW_POS_X 100 | |
#define WINDOW_POS_Y 100 | |
#define DEF_SCREEN_WIDTH 640 | |
#define DEF_SCREEN_HEIGHT 360 |
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
package net.tai2.test; | |
import java.io.IOException; | |
import java.io.UnsupportedEncodingException; | |
import java.net.DatagramPacket; | |
import java.net.DatagramSocket; | |
import java.net.InetAddress; | |
import java.net.InetSocketAddress; | |
import java.net.PortUnreachableException; | |
import java.net.SocketTimeoutException; |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#include <time.h> | |
#include <GLUT/glut.h> | |
#define KEY_ESC 27 | |
#define WINDOW_POS_X 100 | |
#define WINDOW_POS_Y 100 |
- Explicit is better than implicit.
- Design From The Client Side
- 高凝集・疎結合
- テストしやすいインターフェイス
- 異なる抽象度のレイヤー構造
- デバッグ機能の作り込みはたいせつ
- コメントは必要最低限に(コードそのものをドキュメントにする)
- メッセージパッシングはすばらしい
- ボイラープレートの最小化
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
void | |
hsv_to_rgb(double h, double s, double v, double *r, double *g, double *b): | |
if (s * v == 0) { | |
*r = *g = *b = v; | |
} else { | |
hi = ((int)(floor(3 * h / M_PI))) % 6 | |
f = 3 * h / M_PI - hi; | |
p = v * (1.0 - s) | |
q = v * (1.0 - f * s) | |
t = v * (1.0 - (1.0 - f) * s) |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <math.h> | |
#include <GLUT/glut.h> | |
#define KEY_ESC 27 | |
#define WINDOW_POS_X 100 | |
#define WINDOW_POS_Y 100 | |
#define DEF_SCREEN_WIDTH 640 |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <GLUT/glut.h> | |
#include <FreeImage.h> | |
#define MIN(x,y) ((x) > (y) ? (y) : (x)) | |
#define KEY_ESC 27 | |
#define WINDOW_POS_X 100 |