The mails from 126.com seems to be rejected by php.net
I remember that I tested the forwarding email address after I got a CVS account at php.net, and it worked fine. But today when I test it again, I found the mails sending from 126.com was rejected by php.net for the reason "4.7.1 our policy says no mail from your domain". And then I sent two mails from hotmail and yahoo, all succeeded.

Maybe the spam mails from domain 126.com are a little much. But I still intend to use this forwarding email address for the programs such as PEAR packages.
Current language: English · 其他语言: 中文 (简体)
Crypt_XXTEA 0.9.0 has been released
In November the last year, I received an email which informed me that the encryption result of my Crypt_XXTEA package differs from some other implementations. And I made a reply to explain the reason.

XXTEA is a block cipher which requires the block size is at least two words, i.e. 32 bits. If the length of string is not multiples of 4, the last block must be fill up to 32 bits by some junk data. Thus the decrypted string will have the junk data at its end too. To solve this problem, the initial version of Crypt_XXTEA appends the length of string to the end of the converted long integer array, which can be used to cut the decrypted string to get the correct result.

Rencently, considered that this default behavior may confuse the user, I made some modifications. In the version of 0.9.0, users can handle the converting between string and long integer array with their own functions.

Link: http://pear.php.net/package/Crypt_XXTEA
Current language: English · 其他语言: 中文 (简体)
A simple class that reads UTF-8 or GBK encoding text file
  1. public static class TextFileReader
  2. {
  3.     public static string ReadFile(string path)
  4.     {
  5.         FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read,
  6.                             FileShare.Read, 8192, FileOptions.SequentialScan);
  7.         return ReadStream(stream);
  8.     }
  9.  
  10.     public static string ReadStream(Stream stream)
  11.     {
  12.         byte[] bytes = new byte[stream.Length];
  13.         long length = (stream.Length > 8192) ? (long)8192 : stream.Length;
  14.         byte first;
  15.         long pos = 0;
  16.         bool is_utf8 = true;
  17.         while (pos < length)
  18.         {
  19.             first = bytes[pos++] = (byte)stream.ReadByte();
  20.             if (first < 192)
  21.             {
  22.             }
  23.             else if (first < 224)
  24.             {
  25.                 if ((length - pos > 1) &&
  26.                     (bytes[pos++] = (byte)stream.ReadByte()) < 128)
  27.                 {
  28.                     is_utf8 = false;
  29.                     break;
  30.                 }
  31.             }
  32.             else if (first < 240)
  33.             {
  34.                 if ((length - pos > 2) &&
  35.                     !((bytes[pos++] = (byte)stream.ReadByte()) > 127
  36.                     && (bytes[pos++] = (byte)stream.ReadByte()) > 127))
  37.                 {
  38.                     is_utf8 = false;
  39.                     break;
  40.                 }
  41.             }
  42.             else
  43.             {
  44.                 if ((length - pos > 3) &&
  45.                     !((bytes[pos++] = (byte)stream.ReadByte()) > 127
  46.                     && (bytes[pos++] = (byte)stream.ReadByte()) > 127
  47.                     && (bytes[pos++] = (byte)stream.ReadByte()) > 127))
  48.                 {
  49.                     is_utf8 = false;
  50.                     break;
  51.                 }
  52.             }
  53.         }
  54.         if (pos < stream.Length)
  55.         {
  56.             stream.Read(bytes, (int)pos, (int)(stream.Length - pos));
  57.         }
  58.         if (is_utf8)
  59.         {
  60.             return Encoding.UTF8.GetString(bytes);
  61.         }
  62.         else
  63.         {
  64.             return Encoding.Default.GetString(bytes);
  65.         }
  66.     }
  67. }
Current language: English · 其他语言: 中文 (简体)
MIM DB Tools
Link: project at sf.net
Current language: English · 其他语言: 中文 (简体)
Crypt_XXTEA has been released
In fact the effective codes are mostly written by andot. I just modified it to meet the PEAR coding standards, added some comments and then committed it to pear.php.net.

Link: http://pear.php.net/package/Crypt_XXTEA
Current language: English · 其他语言: 中文 (简体)
Windows Media Player 11
There is a big difference between WMP 11 and 10, which makes it quite difficult to adapt.

Personal opinion: the new version of WMP is a smart aleck who makes the user lose more control and permission.

Current language: English · 其他语言: 中文 (简体)
The disk space is never enough
Current language: English · 其他语言: 中文 (简体)
Miranda IM Database Reader project pages
SourceForge.net:

http://sourceforge.net/projects/mimdbreader/

PHP Classes:

http://www.phpclasses.org/browse/package/3010.html
Current language: English · 其他语言: 中文 (简体)
Miranda IM Database Reader committed
MIM DB Reader is a PHP class that can read the database of Miranda IM, by which you can retrieve contact settings, chat history and other information.

----
Besides PHP Classes, I also committed it to SourceForge.net this time.

The committing on sf.net ought to be proven earlier, while the one on PHP Classes may take some time.
Current language: English · 其他语言: 中文 (简体)
Gender Guesser has been published
Gender Guesser:

http://www.phpclasses.org/browse/package/2701.html

All classes I published on PHP Classes:

http://www.phpclasses.org/browse/author/168501.html
Current language: English · 其他语言: 中文 (简体)
More entries: [1] [2] [3] [4] [5]
« Previous page · Next page »