ÔÚlinuxÏÂʹÓÃgtkµÄgdk
aishen944-163.com
תÌùÇë×¢Ã÷³ö´¦£¬Ð»Ð»£¡£¡
Æäʵ͸Ã÷ÌùͼµÄÔÀí¾ÍÊǽøÐÐxorÔËË㣬
»ù±¾¹«Ê½£ºA xor A = 0 A xor 0 = A A xor A xor B = B
¼ÙÈçÏÖÔÚÓÐÁ½ÕÅͼƬ£¬Ò»ÕÅÊÇÎÒÃÇÒª¶ÔÆä½øÐÐÌùͼµÄͼƬA£¬ ÁíÍâÒ»ÕÅÊÇÒª±»ÌùͼµÄͼƬB
1£¬ ¸´ÖÆͼƬBµÄÒ»·Ý¿½±´ÎªC
2£¬ ½«CÖÐÖ¸¶¨µÄ±³¾°É«±äΪȫ°×(0xffffff)£¬ÆäËûÑÕÉ«±äΪȫºÚ(0x00)
3, ÒÀ´ÎÖ´ÐÐÈçÏÂÔËËã:
A xor B
A and C
A xor B
¶ÔÓÚCÖеİ×É«Ö´ÐÐÔËËãºóµÄ½á¹ûÈçÏÂ:
((A xor B) and 0xfffffff) xor B = A xor B xor B = A
¶ÔÓÚCÖеĺÚÉ«Ö´ÐÐÔËËãºóµÄ½á¹ûÈçÏÂ:
((A xor B) and 0x0000) xor B = 0 xor B = B
ÒÔÏÂÊÇ´úÂëʵÀý£¬Àý×ÓÖÐÓõ½µÄÁ½ÕÅͼƬÔÚÕâÀ
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
static GdkPixbuf *bkpixbuf;
static GdkPixbuf *footballpixbuf;
static gboolean
on_expose_event (GtkWidget * widget,
GdkEventExpose * event, gpointer data)
{
cairo_t *cr;
cr = gdk_cairo_create (widget->window);
gdk_cairo_set_source_pixbuf(cr, bkpixbuf, 0, 0);
cairo_paint(cr);
cairo_destroy (cr);
return FALSE;
}
gboolean blttransparent(GdkPixbuf *dest, const GdkPixbuf *src, gint destx, gint desty, guint transcolor) {
GdkPixbuf *maskpixbuf = NULL; /* ÃÉ°å */
guchar *p = NULL, *dp = NULL, *sp = NULL;
gint x = 0, y = 0, i = 0;
/* ¼ì²éÄ¿µÄÇøÓò */
if(destx + gdk_pixbuf_get_width(src) >= gdk_pixbuf_get_width(dest) ||
desty + gdk_pixbuf_get_height(src) >= gdk_pixbuf_get_height(dest)) { /* ³¬³öÄ¿µÄ´óС, ʲôҲ²»×ö */
return TRUE;
}
/* ¼ì²éÑÕÉ«²ÉÑùÊý */
if(gdk_pixbuf_get_bits_per_sample(dest) != 8 ||
gdk_pixbuf_get_bits_per_sample(src) != 8) { // Ö»
Ïà¹ØÎĵµ£º
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <stdio.h>
#include <string>
#include <iostream>
#include <cstring>
using namespace std;
void peek_interfaces(int ......
LinuxÌṩÁË´óÁ¿µÄÃüÁÀûÓÃËü¿ÉÒÔÓÐЧµØÍê³É´óÁ¿µÄ¹¤
×÷£¬Èç´ÅÅ̲Ù×÷¡¢Îļþ´æÈ¡¡¢Ä¿Â¼²Ù×÷¡¢½ø³Ì¹ÜÀí¡¢ÎļþȨÏÞÉ趨µÈ¡£ËùÒÔ£¬ÔÚLinuxϵͳÉϹ¤×÷Àë²»¿ªÊ¹ÓÃϵͳÌṩµÄÃüÁî¡£ÒªÏëÕæÕýÀí½âLinuxϵͳ£¬
¾Í±ØÐë´ÓLinuxÃüÁîѧÆð£¬Í¨¹ý»ù´¡µÄÃüÁîѧϰ¿ÉÒÔ½øÒ»²½Àí½âLinuxϵͳ¡£
²»Í¬Linux·¢ÐаæµÄÃüÁîÊýÁ¿²»Ò»Ñù£¬µ«Linux·¢Ð ......
#ifndef __KERNEL__
#define __KERNEL__
#endif
#ifndef MODULE
#define MODULE
#endif
#include<linux/config.h>
#include<linux/module.h>
#include<linux/version.h>
#include<linux/init.h>
#include<linux/kernel.h>
#include<linux/errno.h>
#include<linux/sche ......
from:http://blog.chinaunix.net/u2/62281/showart_1096746.html
sock_rawÔʼÌ×½Ó×Ö±à³Ì¿ÉÒÔ½ÓÊÕµ½±¾»úÍø¿¨ÉϵÄÊý¾ÝÖ¡»òÕßÊý¾Ý°ü,¶ÔÓë¼àÌýÍøÂçµÄÁ÷Á¿ºÍ·ÖÎöÊǺÜÓÐ×÷ÓõÄ.Ò»¹²¿ÉÒÔÓÐ3ÖÖ·½Ê½´´½¨ÕâÖÖsocket
1.socket(AF_INET, SOCK_RAW, IPPROTO_TCP|IPPROTO_UDP|IPPROTO_ICMP)·¢ËͽÓÊÕipÊý¾Ý°ü
2.socket(PF_PACK ......
<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
Linux
ÊÀ½çºÜ¾«²Ê£¬ÁîÈËÑÛ»¨çÔÂÒ¡£½üÆÚÒÔÀ´£¬¸÷ÖÖÇáÐÍ
Linux
°æ±¾²»¶ÏµÇ̨ÁÁÏ֪࣬ÃûµÄ
Puppy
£¨Ð¡¹·Ö®Ãû£©±ãÊÇÒ»Àý¡£ºÎ¹Ê£¿
......