彈出光碟機代碼

/* * Eject CDs */#include <windows.h>#include <winioctl.h>#include <stdio.h>#include <stdlib.h>/* options */static int unmount_only;static int eject_all;/* wrapper for GetDriveTypeW */static DWORD get_drive_type( WCHAR drive )

寫出健壯的 Bash 指令碼

理檔案名稱中的空格設定的陷阱wikipedia保持原子化許多人用shell指令碼完成一些簡單任務,而且變成了他們生命的一部分。不幸的是,shell指令碼在運行異常時會受到非常大的影響。在寫指令碼時將這類問題最小化是十分必要的。本文中我將介紹一些讓bash指令碼變得健壯的技術。使用set -u你因為沒有對變數初始化而使指令碼崩潰過多少次?對於我來說,很多次。chroot=$1...rm -rf

從LIVE CD恢複GRUB2

How To Re-install GRUB 2 From A Live CDwithout the need to chroot.1)Boot your Ubuntu Karmic Koala or later 'Desktop' Live CD, or anotherKarmic installation such as an operating system in a USB device orwhateveryou have to use as a as a rescue

最簡單的 Git 使用流程

假設你的資料庫預設分支為 master,當你有一個新的項目或者想法時,建立一個分支,然後在分支上開發,最後再合并到 master 上。建立新分支並命名,此處我們建立名為 new_stuff 的分支 git branch new_stuff移到新分支上git checkout new_stuff開始你的工作並儲存結果各種工具.....添加所改動的檔案以便提交git add .提交改動git commit -m "made some changes"回到 master 主分支git

CPU親合力(CPU Affinity)

CPU Affinity作者:Robert Love   翻譯:normalnotebookBind specific processes to specific processors with a new system call. 使用新的系統調用,可以將一個進程綁定到一個特定的CPU上運行。The ability in Linux to bind one or more processes to one or more processors, called CPU affinity, is

Davmail+ThunderBird 串連MS Exchange Server

為了方便,來公司之後直接安裝了Ubuntu10.04的64bit版本,但是在串連公司的exchange郵箱的時候前短時間一直使用web access,速度慢,ckeck郵件也不方便,所以查閱了很多資料,綜合很多朋友的意見,準備試一下 Davmail + ThunderBird 試一下。之所以選用以上的組合,給予下面的survey and test.(1)Ubuntu 原裝版本的Evolution. 還算好用,不過配置後,會出現這個錯誤:引用The Exchange server is not

grub rescue模式下啟動並修複

今天再次遇到grub修複問題,以前也遇到過一次。我裝的ubuntu 10.04和window 7的雙系統,預設的系統啟動項是Ubuntu。因為第一次裝Ubuntu的時候只划了15G(對於長期使用Linux的人來說

[批處理]ini檔案讀取

@echo offset item=set filepath=set section=setlocal EnableDelayedExpansionif not "%~1"=="" ( set filepath=%1) else goto :file_errif not exist %filepath% goto :file_errif not "%~2"=="" ( set section=%2 if "!section:~0,1!"==""^"

等比例縮放邊框函數

等比例縮放邊框:function DrawImage(ImgD,iwidth,iheight){ //參數(圖片,允許的寬度,允許的高度) var image=new Image(); image.src=ImgD.src; if(image.width>0 && image.height>0){ if(image.width/image.height>= iwidth/iheight){

thunderbird匯入outlook總結

thunderbird原來是預設收取郵件後從伺服器刪除的,開啟outlook後發現郵件箱一封郵件都沒有了,害得我費了老大的勁才給還原。現把還原過程總結,希望也給遇到同樣問題的人帶來協助。 1. 下載thunderbird的ImportExportTools擴充,安裝、重啟thunderbird後,選擇要匯出的檔案夾,選中匯出,稍等即可把檔案夾匯出。預設是沒有副檔名的,所以手工加上.mbox。 2.下載IMAPSize,在介面上選擇Tools---mbox2eml,匯出為一大堆eml檔案 3.

git 伺服器架設

建立一個 Git 代碼共用倉程式庫伺服器。1. 伺服器通常用 SSH 協議即可,我們應該為 Git 建立一個專用帳號。$ sudo useradd git$ sudo passwd gitEnter new UNIX password:Retype new UNIX password:passwd: password updated successfully建立一個用來儲存代碼倉庫的目錄,注意賦予 git 帳號讀寫權限。$ sudo mkdir -p

sed 學習筆記

聲明:這些代碼只是為了學習和理解sed命令而為之,並不代表問題的唯一解或最佳解,希望各位拍磚 參考資料:<sed&awk.pdf>等 一. 替換1.神奇變換(y命令的使用)代碼:sed 'y/ori_letter_list/target_letter_list/' filename代碼:cat filename 1234567890 2345678901 3456789012 4567890123測試 將檔案中1換成A 將檔案中2換成B ... 將檔案中0換成J

setupapi + USB + GUID

#include <windows.h> #include <winioctl.h> #include <stdio.h> #include <initguid.h> #include <setupapi.h> #include <string.h> #define MAX_DEVICE 256 wchar_t USBSerial[

GPS資料格式具體含義(SPEC)

GPS固定資料輸出語句($GPGGA)   

使用gimp畫線、矩形、圓等

一直不知道gimp裡面是怎麼畫直線,矩形,圓這些最基本的圖形的,今天終於把它弄明白了,原來它是這麼的簡單而強大。以前在windows下都是用它內建的“畫圖工具,到了linux下,雖有kolourpaint與windows的畫圖工具相媲美(介面相似,功能比ms的多),但我在ubuntu下卻不能裝上能處理中文的kolourpaint版本,想想看,作為一個中國人,卻不能輸入中文,那還得了。雖然用gimp處理這些基本圖形,有殺雞用牛刀之嫌,但掌握它是深入學習gimp的一個基礎功夫。好了,嫌話少說:下面說

Get System Info

Ch15     系統程式設計 1   System 1.1   I/O流 &#61548; public   static   InputStream   in:   讀取字元的標準輸入資料流。 &#61548; public   static   PrintStream   out:   標準輸出資料流。 &#61548; public   static   PrintStream   err:   標準錯誤輸出資料流。 1.2   系統屬性       (1)  

讀取DMI資訊(DOS)

#include <stdio.h>#include<string.h>#include<dos.h>#include<conio.h>unsigned char far *TblAddr_Ptr; /*pointer to SMBIOS Address*/unsigned int TblLen; /*SMBIOS Table length*/typedef struct{ unsigned char type; unsigned char

找出鏈表的中間元素

ListNode* find_midlist(ListNode* head){ ListNode *p1, *p2; if (head == NULL || head->next == NULL) { return head; } p1 = p2 = head; while (1) { if (p2->next != NULL && p2->next->next != NULL)

簡單而又完整的makefile

剛開始學習makefile是一個痛苦的過程,從雜亂無章的規則到一個簡單的makefile再到一個系統化的makefile不是一蹴而就的事情。今天我就寫一個簡單的,規範的(相對而言),功能也算齊全的Makefile。適合於初學者的makefile。希望對新加入linux的同學們有用;一,源檔案準備       假設在專案檔夾(PName)中我們有源檔案:main.c com1.c com2.c com3.c com4.c以及他們的標頭檔;在專案檔夾中有一個子目錄

Using orientation sensors: Simple Compass sample

In this post we will show how to get the sensor informatión of the device to do a simple compass application.Getting the magnetic orientation with the TYPE_ORIENTATION sensor is deprecated, and now you must subscribe to TYPE_ACCELEROMETER and

總頁數: 61357 1 .... 16954 16955 16956 16957 16958 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.