怎么通过orig.tar.gz和diff.gz产生debian化了的源码?
...
怎么通过orig.tar.gz和diff.gz产生debian化了的源码?
If you are using the DEB version of webmin, first download the file from the downloads page , or run the command :wget http://prdownloads.sourceforge.net/webadmin/webmin-1.570_all.debthen run the command :dpkg --install webmin_1.570_all.debThe install will be done automatically to /usr/share/webmin, the administration username set toroot and the password to your current root password. You should now be able to login to Webmin at the URL http://localhost:10000/. Or if accessing it remotely, replace localhost with your system's IP address.
格式化数值:有时,我们可能需要将数值以一定的格式来呈现,就需要对数值进行格式化。我们使用格式字符串指定格式。格式字符串采用以下形式:Axx,其中 A 为格式说明符,指定格式化类型,xx 为精度说明符,控制格式化输出的有效位数或小数位数。
| 格式说明符 | 说明 | 示例 | 输出 |
| C | 货币 | 2.5.ToString("C") | ¥2.50 |
| D | 十进制数 | 25.ToString("D5") | 00025 |
| E | 科学型 | 25000.ToString("E") | 2.500000E+005 |
| F | 固定点 | 25.ToString("F2") | 25.00 |
| G | 常规 | 2.5.ToString("G") | 2.5 |
| N | 数字 | 2500000.ToString("N") | 2,500,000.00 |
| X | 十六进制 | 255.ToString("X") | FF |
public class NumericFormats
{
public static void Main()
{
// Display string representations of numbers for en-us culture
CultureInfo ci = new CultureInfo("en-us");
// Output floating point values
double floating = 10761.937554; Console.WriteLine("C: {0}",
floating.ToString("C", ci)); // Displays "C: $10,761.94"
Console.WriteLine("E: {0}",
floating.ToString("E03", ci)); // Displays "E: 1.076E+004"
Console.WriteLine("F: {0}",
floating.ToString("F04", ci)); // Displays "F: 10761.9376"
Console.WriteLine("G: {0}",
floating.ToString("G", ci)); // Displays "G: 10761.937554"
Console.WriteLine("N: {0}",
floating.ToString("N03", ci)); // Displays "N: 10,761.938"
Console.WriteLine("P: {0}",
(floating/10000).ToString("P02", ci)); // Displays "P: 107.62 %"
Console.WriteLine("R: {0}",
floating.ToString("R", ci)); // Displays "R: 10761.937554"
Console.WriteLine();
// Output integral values
int integral = 8395;
Console.WriteLine("C: {0}",
integral.ToString("C", ci)); // Displays "C: $8,395.00"
Console.WriteLine("D: {0}",
integral.ToString("D6", ci)); // Displays D: 008395""
Console.WriteLine("E: {0}",
integral.ToString("E03", ci)); // Displays "E: 8.395E+003"
Console.WriteLine("F: {0}",
integral.ToString("F01", ci)); // Displays "F: 8395.0"
Console.WriteLine("G: {0}",
integral.ToString("G", ci)); // Displays "G: 8395"
Console.WriteLine("N: {0}",
integral.ToString("N01", ci)); // Displays "N: 8,395.0"
Console.WriteLine("P: {0}",
(integral/10000).ToString("P02", ci)); // Displays "P: 83.95 %"
Console.WriteLine("X: 0x{0}",
integral.ToString("X", ci)); // Displays "X: 0x20CB"
Console.WriteLine();
}
}
来源:http://www.cnblogs.com/RickyYan/archive/2009/03/06/1404667.html
今天发现一个很有趣的问题.请看代码:
declare @i int select @i=1declare @l int select @l=dbo.GetSplitLength(@mbh,',') ---字符串分割长度while(@i<=@l)begin insert into #tmbTable(mbhid) select a.mbhid from dockconfig_mbhTable a where a.mbh=dbo.GetSplitOfIndex(@mbh,',',@i)select @i=@i+1end;
-----------------------------------------------
由于dockconfig_mbhTable 表中有上万条数据,执行起来效率低下.经过尝试分析功能的执行时间,发现效率是受函数影响,
但是单独进行函数dbo.GetSplitOfIndex 测试,效率又没有问题.于是稍微修改了下代码:
declare @i int select @i=1declare @l int select @l=dbo.GetSplitLength(@mbh,',')declare @v varchar(20)while(@i<=@l)begin select @v=dbo.GetSplitOfIndex(@mbh,',',@i)insert into #tmbTable(mbhid) select a.mbhid from dockconfig_mbhTable a where a.mbh=@v select @i=@i+1end;
居然…居然效率提高了好几千倍.记录下以后遇到该问题都在进行查询时进行变量申明分开使用函数.
Structure –>byte
1: Public Function RawSerialize(o As Object) As Byte()
2: Dim rawSize As Integer = Marshal.SizeOf(o)
3: Dim buffer As IntPtr = Marshal.AllocHGlobal(rawSize)
4: Marshal.StructureToPtr(o, buffer, False)
5: Dim rawDatas As Byte() = New Byte(rawSize) {}
6: Marshal.Copy(buffer, rawDatas, 0, rawSize) 7: Marshal.FreeHGlobal(buffer) 8: Return rawDatas
9: End Function
byte—>Structure
1: Public Function RawDeserialize(rawdata As Byte(), position As Integer, t As Type) As Object
2: Dim rawsize As Integer = Marshal.SizeOf(t)
3: If rawsize > rawdata.Length Then
4: Return Nothing
5: End If
6: Dim buffer As IntPtr = Marshal.AllocHGlobal(rawsize)
7: Marshal.Copy(rawdata, position, buffer, rawsize) 8: Dim retobj As Object = Marshal.PtrToStructure(buffer, t)
9: Marshal.FreeHGlobal(buffer) 10: Return retobj
11: End Function
Private Sub GridEditExitCheck()TryDim p As SourceGrid.Position = Grid1.Selection.ActivePositionIf p.Row <> -1 AndAlso p.Column <> -1 ThenDim c As SourceGrid.CellContext = New SourceGrid.CellContext(Grid2, p)' c.Value = CType(Grid1.Item(p.Row, p.Column).Editor, SourceGrid.Cells.Editors.TextBox).Control.Textc.EndEdit(False)End IfCatch ex As ExceptionExit TryEnd TryEnd Sub
使用CF上的,发现有一个问题,对其更正为:
1: Public Sub Load(ByVal bytes As Byte())
2: If bytes.Length = 0 Then
3: Exit Sub
4: End If
5: Try
6: mList.Clear() 7: Dim s As Stream = New MemoryStream(bytes)
8: Dim xmlr As XmlTextReader = New XmlTextReader(s)
9: xmlr.WhitespaceHandling = WhitespaceHandling.None 10: xmlr.MoveToContent() 11: Dim items As DataItems
12: Dim nname As String, nvalue As String, ntype As String = ""
13: xmlr.Read() 14: While (True)
15: If xmlr.LocalName = "ntable" Then
16: Exit While
17: End If
18: xmlr.ReadStartElement("items")
19: items = New DataItems()
20: nname = xmlr.Name() 21: nvalue = xmlr.ReadElementString 22: 'ntype=xmlr.reada
23: While (Not xmlr.EOF)
24: items.Add(nname, nvalue) 25: nname = xmlr.Name() 26: If nname = "items" Then Exit While
27: nvalue = xmlr.ReadElementString 28: End While
29: mList.Add(items) 30: xmlr.ReadEndElement() 31: End While
32: Catch ex As Exception
33: Exit Try
34: End Try
35: End Sub
有时添加非官方的源是update后会出现没有公钥的gpg错误提示,说可能会有后门程序等,对于经常update 的来说,听讨厌的。解决的办法是导入公钥,用如下语句:
gpg --keyserver subkeys.pgp.net --recv-keys 提示所缺少的那个公钥
gpg --armor --export 公钥串 | apt-key add -
网络上说的那个wwwkeys.eu.pgp.net好像已经不能使用了.
...SQL处理字符串相似度函数
本函数严格处理字符串,同位置的字符串相同时才算是相似。结果采用小于等于1的小数表示,越靠近1表示相似度越高。
创建一个批处理文件,用来运行cepb.exe。
可以在Windows CE Platform Builder\5.00\CEPB\BIN\ 目录下创建这个批处理,cepb.exe就在这个路径下,所以不需要写入绝对路径,建立一个TXT文件,输入如下内容:
@ehco
start cepb.exe
exit
@ehco
再另存为一个bat文件,双击运行这个BAT文件就打开的PB就可以正常sysgen了。
...