分类目录
文章索引模板
20090413 svn non-lf code - 八月 18, 2009 by yippee

svn non-lf

有点怀疑是TSVN采取了BSTR提交,UNICODE/UTF-8,而SVN采取ANSI判断\\R\\N

因此导致这个问题。

从代码来看
1.56支持APACHE 2.0
1.6*版本支持APACHE 2.2

查找相关的代码,发现

subversion-1.6.0\\subversion\\libsvn_repos
fs-wrap.c

static svn_error_t *
validate_prop(const char *name, const svn_string_t *value, apr_pool_t *pool)

 /* Disallow inconsistent line ending style, by simply looking for
           * carriage return characters (\’\\r\’). */
          if (strchr(value->data, \’\\r\’) != NULL)
            &leftsign;
              return svn_error_createf
                (SVN_ERR_BAD_PROPERTY_VALUE, NULL,
                 _("Cannot accept non-LF line endings in \’%s\’ property"),
                   name);
            &rightsign;
        &rightsign;

从测试代码来看
/* Expect failure of invalid commit in these cases:
 *  – log message contains invalid UTF-8 octet (issue 1796)
 *  – log message contains invalid linefeed style (non-LF) (issue 1796)
 */
static svn_error_t *
prop_validation(const char **msg,
                svn_boolean_t msg_only,
                svn_test_opts_t *opts,
                apr_pool_t *pool)

  const char *non_lf_string = "a\\r\\nb\\n\\rc\\rd\\n";

从这里似乎看不出多少东西

从TSVN的代码来看

http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk/src/TortoiseProc/CommitDlg.cpp

BSTR commitMessage = m_sLogMessage.AllocSysString();

if (FAILED(hr = pProvider2->CheckCommit(GetSafeHwnd(), parameters, repositoryRoot, commonRoot, pathList, commitMessage, &temp)))
   &leftsign;
    CString sErr;
    sErr.Format(IDS_ERR_FAILEDISSUETRACKERCOM, m_bugtraq_association.GetProviderName(), _com_error(hr).ErrorMessage());
    CMessageBox::Show(m_hWnd, sErr, _T("TortoiseSVN"), MB_ICONERROR);
   &rightsign;

调用了一个接口

http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk/src/IBugTraqProvider/

/** Called right before the commit dialog is dismissed. This is the last chance to reject
  * a commit. You can check the commit log message here and return an error message if it does not
  * match your specification. An empty error string means the commit is allowed.
  */
 HRESULT CheckCommit (
  [in] HWND hParentWnd,
  [in] BSTR parameters,
  [in] BSTR commonURL,
  [in] BSTR commonRoot,
  [in] SAFEARRAY(BSTR) pathList,
  [in] BSTR commitMessage,
  [out, retval] BSTR * errorMessage
  );

标签:, ,
20080819 c# wpf code animate - 四月 15, 2009 by yippee

20080819 c# wpf code animate

http://www.yippeesoft.com

Calvin Hsia\’s WebLog : WPF Animation: Use dynamic XAML to animate movies using XAMLReader or animate in code using BeginStoryBoard
http://blogs.msdn.com/calvin_hsia/archive/2007/11/28/6583391.aspx
Dim XAMLMediaElem = _

                <MediaElement

                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

                    Name="MyVid" Height="50.5">

                    <MediaElement.Triggers>

                        <EventTrigger RoutedEvent="MediaElement.Loaded">

                            <EventTrigger.Actions>

                                <BeginStoryboard>

                                    <Storyboard>

                                        <MediaTimeline Source=<%= cSrcFile %>

                                            Storyboard.TargetName="MyVid"

                                            RepeatBehavior="Forever"/>

                                    </Storyboard>

                                </BeginStoryboard>

                            </EventTrigger.Actions>

                        </EventTrigger>

                    </MediaElement.Triggers>

                </MediaElement>

            MyVid = Windows.Markup.XamlReader.Load(XAMLMediaElem.CreateReader)

 

            \’ Equivalent of XAML in code:

            \’Dim tr As New EventTrigger

            \’MyVid.Triggers.Add(tr)

            \’tr.RoutedEvent = MediaElement.LoadedEvent

            \’Dim BeginSB As New Windows.Media.Animation.BeginStoryboard

            \’tr.Actions.Add(BeginSB)

            \’Dim Sboard As New Windows.Media.Animation.Storyboard

            \’BeginSB.Storyboard = Sboard

            \’Dim medTimeLine As New Windows.Media.MediaTimeline(New Uri(cSrcFile))

            \’medTimeLine.RepeatBehavior = Windows.Media.Animation.RepeatBehavior.Forever

            \’Sboard.Children.Add(medTimeLine)

Calvin Hsia\’s WebLog : WPF Animation: Use dynamic XAML to animate movies using XAMLReader or animate in code using BeginStoryBoard
http://blogs.msdn.com/calvin_hsia/archive/2007/11/28/6583391.aspx

Andrej Tozon\’s blog : Silverlight 2.0: Creating a basic animation through code
http://tozon.info/blogs/andrej/archive/2008/03/10/Silverlight-2.0_3A00_-Creating-a-basic-animation-through-code.aspx

Calvin Hsia\’s WebLog : Use ElementHost to Add WPF to your Wndows Forms or put your WinForm controls in your WPF app using WindowsFormsHost
http://blogs.msdn.com/calvin_hsia/archive/2007/12/11/6740119.aspx

vbfeeds.com/Post
http://vbfeeds.com/post.aspx?id=5324

Calvin Hsia\’s WebLog : WPF Animation: Use dynamic XAML to animate movies using XAMLReader or animate in code using BeginStoryBoard
http://blogs.msdn.com/calvin_hsia/archive/2007/11/28/6583391.aspx

Calvin Hsia\’s WebLog : Use ElementHost to Add WPF to your Wndows Forms or put your WinForm controls in your WPF app using WindowsFormsHost
http://blogs.msdn.com/calvin_hsia/archive/2007/12/11/6740119.aspx

XamlReader.Load changes in SL 2.0 : The Official Microsoft Silverlight Site
https://silverlight.net/forums/t/13961.aspx

marec 2008 – Prispevkov – Zunanji viri
http://codezone-si.info/blogs/aggregated/archive/2008/03.aspx?PageIndex=2

Andrej Tozon\’s blog : Silverlight 2.0: Creating a basic animation through code
http://tozon.info/blogs/andrej/archive/2008/03/10/Silverlight-2.0_3A00_-Creating-a-basic-animation-through-code.aspx

A Simple Particle System – Silverlight Games 101
http://silverlightrocks.com/community/blogs/silverlight_games_101/archive/2007/08/21/a-simple-particle-system.aspx

Object creation by using xaml fails : The Official Microsoft Silverlight Site
http://silverlight.net/forums/p/18734/64429.aspx

Runtime Alternative to XamlReader.Load in Silverlight 2 Beta 2 – Learning Silverlight
http://silverlightaddict.com/blogs/learningsilverlight/archive/2008/06/07/runtime-alternative-to-xamlreader-load-in-silverlight-2-beta-2.aspx

Runtime Alternative to XamlReader.Load in Silverlight 2 Beta 2 – RogerGuess
http://fwdnug.com/blogs/rogerguess/archive/2008/06/07/runtime-alternative-to-xamlreader-load-in-silverlight-2-beta-2.aspx

Calvin Hsia\’s WebLog : Use the DispatcherTimer, Popup and even a movie to enhance your data presentation
http://blogs.msdn.com/calvin_hsia/archive/2007/11/21/6460073.aspx

Animation Overview
http://msdn.microsoft.com/en-us/library/ms752312.aspx

DoubleAnimation方法 – 我和未来有约会 – 博客园
http://www.cnblogs.com/nasa/archive/2008/02/15/1069819.html

标签:, , ,
20080326 gzip ICSharpCode 日历控件 - 十二月 21, 2008 by yippee

20080326 gzip ICSharpCode 日历控件
http://www.yippeesoft.com

GZip
        加入ICSharpCode.SharpZipLib.dll的引用,在#Develop的安装目录下的\\SharpDevelop\\bin目录下。然后在程序中使用using语句把GZip类库包含进来。

由于GZip没有BZip2的简单解压缩方法,因此只能使用流方法来进行解压缩。具体的方法见程序的说明。

编译程序,然后在命令行方式下输入GZip   文件名(假设建立的C#文件是GZip,就可以生成压缩文件;输入GZip   -d   文件名,就会解压出文 件来(-d是用来表示解压,你也可以使用其他的符号)。      

using   System;    
using   System.IO;    

using   ICSharpCode.SharpZipLib.GZip;    
   
class   MainClass   
  &leftsign;   
        public   static   void   Main(string[]   args)   
        &leftsign;   
              if   (args[0]   ==   "-d")   &leftsign;   //   解压   
                    Stream   s   =   new   GZipInputStream(File.OpenRead(args[1]));   
                    //生成一个GZipInputStream流,用来打开压缩文件。   
                  //因为GZipInputStream由Stream派生,所以它可以赋给Stream。   
                      //它的构造函数的参数是一个表示要解压的压缩文件所代表的文件流   
                    FileStream   fs   =   File.Create(Path.GetFileNameWithoutExtension(args[1]));   
                    //生成一个文件流,它用来生成解压文件   
                    //可以使用System.IO.File的静态函数Create来生成文件流   
                    int   size   =   2048;//指定压缩块的大小,一般为2048的倍数   
                    byte[]   writeData   =   new   byte[size];//指定缓冲区的大小   
                    while   (true)   &leftsign;   
                          size   =   s.Read(writeData,   0,   size);//读入一个压缩块   
                          if   (size   >   0)   &leftsign;   
                                fs.Write(writeData,   0,   size);//写入解压文件代表的文件流   
                          &rightsign;   else   &leftsign;   
                                break;//若读到压缩文件尾,则结束   
                          &rightsign;   
                    &rightsign;   
                    s.Close();   
              &rightsign;   else   &leftsign;   //   压缩   
                    Stream   s   =   new   GZipOutputStream(File.Create(args[0]   +   ".gz"));   
                    //生成一个GZipOutputStream流,用来生成压缩文件。   
                                                  //因为GZipOutputStream由Stream派生,所以它可以赋给Stream。   
                      FileStream   fs   =   File.OpenRead(args[0]);   
                    /生成一个文件流,它用来打开要压缩的文件   
                    //可以使用System.IO.File的静态函数OpenRead来生成文件流   
                    byte[]   writeData   =   new   byte[fs.Length];   
                    //指定缓冲区的大小   
                    fs.Read(writeData,   0,   (int)fs.Length);   
                    //读入文件   
                    s.Write(writeData,   0,   writeData.Length);   
                    //写入压缩文件   
                    s.Close();   
                    //关闭文件   
              &rightsign;   
        &rightsign;   
  &rightsign;
 使用ICSharpCode.SharpZipLib.dll实现在线解压缩  
 http://blog.csdn.net/MaleLionOfWakeUp/archive/2008/03/18/2193480.aspx

 http://www.dc9.cn/post/Python-gzcompress-php-net.html
 总算在C#.NET,Python,Ruby上实现了php的zlib的gzcompress函数

PRB: 工具箱或菜单项是 VisualBasic IDE 中缺少
症状
当您打开 VisualBasic 项目, 您将不能查看工具箱或几项是从菜单选项丢失。

回到顶端
原因
此问题的一个可能的原因是注册表损坏。

回到顶端
解决方案
要重置为其默认设置, 选项请按照下列步骤操作:
1. 右击主菜单栏并选择 自定义 。 自定义 对话框打开。
2. 选择 工具栏 选项卡并单击 Reset 按钮。
3. 自定义 对话框保持打开, 右击要在主菜单栏 (例如, 文件、 编辑和等等), 重置, 然后选择 重置 选项所有菜单选项。
4. 关闭 自定义 对话框。

I can no longer make exe\’s in VB6.  The Make exe item on the File menu is
grayed out.  I have been creating exe files for at least a year on this
machine, but suddenly no go.  I did have a few VB crashes when I was working
on creating an OCX.  I\’m guessing that one of these crashes caused the
problem.  The only way to make an executable now is to have my project in a
project group.  I can then Make Project Group and select the project that I
want.  It\’s a pain for project groups with lots of projects, however.
http://support.microsoft.com/kb/266747/en-us

http://blog.csdn.net/kimsoft/archive/2006/05/24/753225.aspx
[2008-03-22更新]一个JavaScript WEB日历控件,支持IE6,FireFox,可支持不同语言版本,目前支持中英文

http://www.notii.com/2007/05/top-5-javascript-framework.html
Top 5 Javascript 框架

ExtJS(http://extjs.com/)和DWR( http://www.getahead.ltd.uk/dwr/)。 

http://www.open-open.com/67.htm
Java开源AJAX框架

http://blog.csdn.net/cityhunter172/archive/2006/11/28/1417752.aspx
推荐兼容 IE、 FireFox 的 javascript 日历控件

http://blog.csdn.net/cityhunter172/archive/2006/11/28/1417752.aspx

http://code.google.com/p/kimsoft-jscalendar/downloads/list

http://dev.csdn.net/author/Jason009/65c69cc4e34a4ef783c45add211105e0.html
gzip压缩算法

http://ms.mblogger.cn/downmoon/posts/19951.aspx

http://hi.baidu.com/huohuoluo/blog/item/122bf562f40946dde6113a42.html
一个不错的js日期控件

http://www.cnblogs.com/xgpapa/archive/2007/08/07/846985.html
超级简单好用的JS日期控件

http://hi.baidu.com/sunweiliang/blog/item/d181d5b49b4d7c778ad4b2c5.html
js 日期控件

http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=121&threadID=36592
 JS日期控件

 http://www.iusesvn.com/html/02/9502-2640.html
 SVN总结

标签:, , , , , ,

20080324 ICSharpCode GZipStream - 十二月 20, 2008 by yippee

20080324 ICSharpCode GZipStream
http://www.yippeesoft.com

http://www.cnblogs.com/DreamlikeAttic/archive/2006/07/07/445643.html
在Pocket PC/Smartphone智能设备上编写压缩程序(特别简单,任何人都能简单使用)

2.0里内置了DeflateStream GZipStream压缩算法,没有压缩比的选择,实验了一下一个49,934字节的文件,用gzipstream压缩后35,964,用deflatestream压缩后35,946,用winrar3.62最大压缩26,598,7-zip也可以压缩成gzip,用7-zip选择压缩成gzip并最大压缩后26,485,比winrar都强。显得2.0自带的这个算法真是没用啊。

但是好玩的是,.net里用gzipstream却可以解压用7-zip压缩的gz,这样就可以用7-zip压缩成gz给工程用,比如作成资源,然后光用.net的解压就可以了

xml文件操作时挺有用,可以压缩减少文件尺寸。

压缩:
public static string Compress(string code_type, string text)
&leftsign;
    byte[] buffer = Encoding.GetEncoding(code_type).GetBytes(text);
    MemoryStream ms = new MemoryStream();
    using (GZipStream zip = new GZipStream(ms, CompressionMode.Compress, true))
    &leftsign;
        zip.Write(buffer, 0, buffer.Length);
    &rightsign;

    ms.Position = 0;
    MemoryStream outStream = new MemoryStream();

    byte[] compressed = new byte[ms.Length];
    ms.Read(compressed, 0, compressed.Length);

    byte[] gzBuffer = new byte[compressed.Length];
    System.Buffer.BlockCopy(compressed, 0, gzBuffer, 0, compressed.Length);
 
    return Convert.ToBase64String(gzBuffer);
&rightsign;

解压:
public static string Decompress(string code_type, string compressedText)
&leftsign;
    byte[] gzBuffer = Convert.FromBase64String(compressedText);
    using (MemoryStream ms = new MemoryStream())
    &leftsign;
        int msgLength = BitConverter.ToInt32(gzBuffer, 0);
        ms.Write(gzBuffer, 0, gzBuffer.Length );

        byte[] buffer = new byte[msgLength];

        ms.Position = 0;
        using (GZipStream zip = new GZipStream(ms, CompressionMode.Decompress))
        &leftsign;
            zip.Read(buffer, 0, buffer.Length);
        &rightsign;

        return Encoding.GetEncoding(code_type).GetString(buffer);
    &rightsign;
 

著名的压缩库ICSharpCode.SharpZipLib.GZip我是没有试出来,我认为他没有提供这种不包含头的压缩功能。我压缩出来的都是包含头的。于是我再次寻找到了zlib.net.dll这个是从http://www.zlib.net/官方网站找到的,果然什么东西都得用官方的!
那么代码就是这样的

            byte[] byteData = System.Text.Encoding.UTF8.GetBytes("http://www.dc9.cn");
            MemoryStream ms = new MemoryStream();
            Stream s = new ZOutputStream(ms, 9);
           
            s.Write(byteData, 0, byteData.Length);
            s.Close();
            byte[] compressData = (byte[])ms.ToArray();
            ms.Flush();
            ms.Close();

            FileStream fileStream = new FileStream("C:\\\\dc9.cn.zip", FileMode.Create, FileAccess.Write);
            Console.Write(System.Convert.ToBase64String(compressData, 0, compressData.Length));
            fileStream.Write(compressData, 0, compressData.Length);
            fileStream.Flush();
            fileStream.Close();

我最先想到的是.net framework2.0以来新加入的一个System.IO.Compression;这里面的GZipStream 不提供level,不提供无头压缩。很郁闷。这个压缩出来是直接能用winrar解压的。带头的才能winrar/winzip解压。

            FileStream fileStream = new FileStream("C:\\\\dc9.cn.zip",FileMode.Create,FileAccess.Write);
            MemoryStream ms = new MemoryStream();
            GZipStream compressionStream = new GZipStream(ms,CompressionMode.Compress);
            StreamWriter writer = new StreamWriter(compressionStream);
            writer.Write("http://www.dc9.cn");
            writer.Close();

            fileStream.Write(ms.ToArray(), 0, ms.ToArray().Length);
            fileStream.Flush();
            fileStream.Close();

using ICSharpCode.SharpZipLib.GZip;这个我懒得说了,也是带头的
关键就是

FileStream destinationStream = new FileStream("C:\\\\dc9.cn.zip",FileMode.OpenOrCreate);
GZipOutputStream outStream = new GZipOutputStream(destinationStream);
outStream.Write(buffer, 0, buffer.Length);
outStream.Flush();
outStream.Finish();

标签:, , , , ,
20080324 X509Certificate cer ICSharpCode - 十二月 19, 2008 by yippee

20080324 X509Certificate cer ICSharpCode
http://www.yippeesoft.com

http://support.microsoft.com/kb/318217/zh-cn
PRB: X509Certificate 支持仅 DER Encoded 证书

http://blog.joycode.com/mvm/archive/2006/03/25/73468.aspx
X509Certificate代码示例 (.NET 1.1)

http://blog.csdn.net/nutian/archive/2006/10/26/1352099.aspx
 [C#]使用HttpWebRequest请求远端服务器时如何加载SSL证书

http://www.cnblogs.com/zhifengwu1211/archive/2007/04/27/729360.aspx
在C#中使用 makecert 创建自签名的证书

http://www.microsoft.com/china/technet/security/guidance/secmod27.mspx
如何使用来自 ASP.NET 的客户端证书调用 Web 服务

http://www.bzsh.cn/software/p155/A15519010.shtml
获取已有证书的信息c#有提供方法,但如何根据客户参数与公私钥对生成证书呢??string   certificate   =     @"e:/xxx.cer"; 
                  x509certificate   cert   =       x509certificate.createfromcertfile(certificate); 
                string   resultstrue   =   cert.tostring(true); 
                console.writeline(resultstrue);  

http://msdn2.microsoft.com/zh-cn/library/system.security.cryptography.pkcs.signerinfo.countersignerinfos(VS.80).aspx
SignerInfo.CounterSignerInfos 属性

C#中,byte为无符号8位整数,而Sbyte为有符号8位整数,对应java中的byte类型。
将 byte 转为 sbyte。原理很简单,就是当 byte 小于 128 时其值保持不变,大于等于 128 时就将其减去 256。代码如下:

sbyte[] mySByte = new sbyte[myByte.Length];

for (int i = 0; i < myByte.Length; i++)
&leftsign;
    if (myByte[i] > 127)
        mySByte[i] = (sbyte)(myByte[i] – 256);
    else
        mySByte[i] = (sbyte)myByte[i];
&rightsign;

 
 http://hi.baidu.com/kissrun/blog/item/ea97d218bfbff2b74bedbc33.html
 用ICSharpCode.SharpZipLib.Zip实现下载整个文件目录(小文件推荐)

 2)   你可以使用第三方的类库和工具包 
  http://www.icsharpcode.net/opensource/nziplib/default.asp  

  用SharpZipLib(#ZipLib)压缩MemoryStream

SharpZipLib是一个开源的用C#编写的Zip,GZip,Tar and BZip2库,用于C#的开发.可以在http://www.icsharpcode.net/OpenSource/SharpZipLib/得到.

压缩
为了方便起见,我们添加IO,Text和SharpZipLib名字空间
using System;
using System.IO;
using System.Text;
using ICSharpCode.SharpZipLib.BZip2;
首先,开始压缩.我们创建一个MemoryStream
MemoryStream msCompressed = new MemoryStream();
这次我使用Bzip2,你可用使用zip或tar,然而,他们需要实现一个虚假的文件.选择BZip2而不是Gzip是由于大的数据会压缩的小些.以花费较大的报头为代价.

接下来,我们创建一个BZip2 output stream对象,容纳MemoryStream.
BZip2OutputStream zosCompressed = new BZip2OutputStream(msCompressed);
现在我来解说上面报头的含义.在我的实际测试中使,用GZip时,压缩1字节数据需要28字节的额外报头,那些额外的字节是不能被压缩的.用BZip2时,需要36字节的额外报头.实际上,用BZip2可以压缩一个12892字节的源文件到2563字节,有大概75%的压缩率.另一个测试是从730字节压缩到429字节,最后一个测试是174字节到161字节.显然,任何压缩需要额外的可用空间.

下面我们将数据写入BZip2OutputStream
string sBuffer = "This represents some data being compressed."
byte[] bytesBuffer = Encoding.ASCII.GetBytes(sBuffer);
zosCompressed.Write(bytesBuffer, 0, bytesBuffer.Length);
zosCompressed.Finalize();
zosCompressed.Close();

由于要用到IO和stream方法,要使用字节数组替代字符串.所以我们用字节数组作为输出,然后将压缩的流写入内存流.
bytesBuffer = msCompressed.ToArray();
string sCompressed = Encoding.ASCII.GetString(bytesBuffer);

这样内存流中包含了压缩过的数据,我们将数据用字符数组输出,然后转换成字符串.要注意,这个字符串是乱码,不可读的.如果你想查看数据,我用的方法是把它转换为Base64编码的数据,但是这样会增加大小.运行程序使43字节的未压缩数据变成74字节的压缩数据,如果用base 64编码,会得到100字节的结果:
QlpoOTFBWSZTWZxkIpsAAAMTgEABBAA+49wAIAAxTTIxMTEImJhNNDIbvQ
aWyYEHiwN49LdoKNqKN2C9ZUG5+LuSKcKEhOMhFNg=

解压缩
MemoryStream msUncompressed =
new MemoryStream(Encoding.ASCII.GetBytes(sCompressed));
BZip2InputStream zisUncompressed = new BZip2InputStream(msUncompressed);
bytesBuffer = new byte[zisUncompressed.Length];
zisUncompressed.Read(bytesBuffer, 0, bytesBuffer.Length);
zisUncompressed.Close();
msUncompressed.Close();
string sUncompressed = Encoding.ASCII.GetString(bytesBuffer);

这样sUncompressed将被解压到原始的字符串.文件也是相同的原理.

一个在.net平台上易用的开源制图组件

ZedGraph是一个用来创建2D线,条,饼图的类库,windows窗口控件和asp,asp.net控件.类库提供了高的适用性,几乎图形的每个外表都能被用化修改,图形的默认属性值使其用起来很方便.

ZedGraph源码,示例可用在zedgraph.org上找到.

标签:, , , ,
20080312 codesmith raid - 十二月 10, 2008 by yippee

20080312 codesmith raid
http://www.yippeesoft.com

http://support1.ap.dell.com/cn/zh/forum/pntthd.asp?fid=2&tid=37754
Optiplex系列商用台式机FOR WIN2K/WINXP/WIN2003驱动下载地址

http://blog.csdn.net/Anckly/archive/2006/10/16/1336142.aspx
基于CodeSmith的MVC开发框架构思 

codesmith
CodeSmith 是一种基于模板的代码生成工具,它使用类似于 ASP.NET 的语法来生成任意类型的代码或文本。与其他许多代码生成工具不同,CodeSmith 不要求您订阅特定的应用程序设计或体系结构。使用 CodeSmith,可以生成包括简单的强类型集合和完整应用程序在内的任何东西。

当您生成应用程序时,您经常需要重复完成某些特定的任务,例如编写数据访问代码或者生成自定义集合。CodeSmith 在这些时候特别有用,因为您可以编写模板自动完成这些任务,从而不仅提高您的工作效率,而且能够自动完成那些最为乏味的任务。CodeSmith 附带了许多模板,包括对应于所有 .NET 集合类型的模板以及用于生成存储过程的模板,但该工具的真正威力在于能够创建自定义模板。

CodeSmith 是一种语法类似于asp.net的基于模板的代码生成器,程序可以自定义模板,从而减少重复编码的劳动量,提高效率。
     安装CodeSmith 2.6注册后发现有两个可运行程序CodeSmith Studio.exe和CodeSmith Explorer.exe
     CodeSmith Studio.exe用来创建自定义模板
     CodeSmith Explorer.exe用来导入模板并且生成代码
    打开 CodeSmith Studio.exe,新建一个C#模板。发现有如下类似与asp.net的标识符号
     <%  %>
     <%= %>
     <%@  %>
    <script runat="template"> </script>

    CodeSmith是一个基于模板的代码生成器。模板是所生成代码的式样。开发者或构架师可应用CodeSmith来生成任何文本语言的代码。其结果(生成的代码)可通过属性来自定义并包含在众多的标准属性类型之中。另外,用户还可建立自定义的属性类型。

针对.NET Framework而言,性质可以是任何拥有设计器的.NET对象。例如,它可以是一个简单的分配标题的字符串性质。另一方面,可用TableSchema对象来访问数据库表中的一切内容。

CodeSmith工具的一个强项是它的语法,其与ASP.NET的方法相当。实际上,你可以在CodeSmith模板中应用C#、VB.NET或Jscript。事实上,CodeSmith可输入任何ASCII语言。

win 2008首次登陆创建密码问题??
我从虚拟机安装好了  为什么创建密码不能进入啊?  再复杂 再麻烦的密码也不行啊
设置模式:
Ab_cd@123456

大小写字母 符号 数字

http://hi.baidu.com/u16300/blog/item/79a23a220c864cf7d6cae21a.html
AHCI,全称为Serial ATA Advanced Host Controller Interface(串行ATA高级主控接口),是在Intel的指导下,由多家公司联合研发的接口标准,其研发小组成员主要包括Intel、AMD、戴尔、Marvell、迈拓、微软、Red Hat、希捷和StorageGear等著名企业。AHCI描述了一种PCI类设备,主要是在系统内存和串行ATA设备之间扮演一种接口的角色,而且它在不同的操作系统和硬件中是通用的。

http://blog.csdn.net/alldj/archive/2007/04/13/1564073.aspx
身份证有效性验证

Win2008的版本号是6001,Windows Vista是6000 。同时Win2008 具有很多Windows Vista SP1上的功能
Windows Server 2008没有很多限制如CPU个数、内存容量。我们还要从系统内核处来对比,如系统服务描述表SSDT。没有发现多任何服务号。而不像Windows XP和Windows Server 2003那样。创建进程从ZwCreateProcess变为ZwCreateProcessEx。但是Windows Server 2008的确在Win32服务上比Windows Vista少了很多。

win2003 软RAID
镜像卷可以大大地增强读性能,因为容错驱动程序同时从两个磁盘成员中同时读取数据,所以读取数据的速度会有所增加。当然,由于容错驱动程序必须同时向两个成员写数据,所以它的写性能会略有降低。镜像卷可包含任何分区(包括启动分区或系统分区),但是镜像卷中的两个硬盘都必须是Windows 2003动态磁盘。

⑤RAID-5卷

在RAID-5卷中,Windows 2003通过给该卷的每个硬盘分区中添加奇偶校验信息带区来实现容错。如果某个硬盘出现故障,Windows 2003便可以用其余硬盘上的数据和奇偶校验信息重建发生故障的硬盘上的数据。

由于要计算奇偶校验信息,所以RAID-5卷上的写操作要比镜像卷上的写操作慢一些。但是,RAID-5卷比镜像卷提供更好的读性能。其中的原因很简单, Windows 2003可以从多个磁盘上同时读取数据。与镜像卷相比RAID-5卷的性价比较高,而且RAID-5卷中的硬盘数量越多,冗余数据带区的成本越低。

http://hi.baidu.com/lovefate/blog/item/302ffe24f5a95d378644f97e.html
硬件RAID解决方案速度快、稳定性好,可以有效地提供高水平的硬盘可用性和冗余度,但是居
高不下的价格实在令人可畏。不过可庆幸的是,Windows 2003提供了内嵌的软件RAID功能,并且软RAID可以实现RAID-0、RAID-1、RAID-5。软RAID不仅实现上非常方便,而且还大量地节约了宝贵的资金,确实是Windows 2003 Server的一个很实用的新功能。RAID-5 卷是数据和奇偶校验间断分布在三个或更多物理磁盘的容错卷。

在2001年,英特尔就首次推出了Intel Application Accelerator应用程序加速器,它能够支持ICH、ICH0、ICH2、ICH3、ICH4等南桥芯片组,用于替代先前的Ultra ATA驱动,并发挥系统的最佳性能。到了ICH5R发布之后,英特尔就将应用程序加速器升级为Application Accelerator RAID版,版本也随即更新为3.X版,此时的加速器程序已经是集创建和管理RAID磁盘阵列,并使磁盘性能达到最佳化等功能于一身。近期英特尔推出了最新ICH6R芯片组,其中加入了Intel Matrix Storage Technology(Intel矩阵储存技术),此项技术的最大特色在于提供了"性能、安全和经济"合一的RAID模式,并有效地提升硬盘系统的性能。为了配合ICH6R芯片组的发布,英特尔推出了全新的4.X版加速器驱动,提供了对众多的新技术的支持。近日,英特尔放出了最新7.X版,并将驱动名称改为更富有专业色彩的Matrix Storage Manager,此版驱动能够支持Native Command Queuing(原生命令队列)即我们经常提起的NCQ技术、热插拔技术、电源管理功能等等。

http://www.blogjava.net/flyffa/archive/2008/02/26/46177.html
自己写的一个小的发短信的程序

http://blog.csdn.net/anxing/archive/2006/10/19/1341437.aspx
Cmpp发送wappush

http://noho.blogdriver.com/noho/204457.html
其实WAP Push没有那么神秘- -

在经过一段比较长的时间之后,终于能够成功Login网关,并且能够发送普通的消息了,然而发送WapPush的短消息却一直没有成功。后来发现原来仅仅设置Msg_Fmt为4(Binary/二进制)并不足够,还需要设置TP_udhi为1——发送正常短消息的时候设置的是0,至于说TP_udhi是什么意思一直没有考究出来。其实在开发过程中蛮痛苦的,因为我们刚开始的时候,这几个设置就分别是4和1,但是因为其它的一些地方设置不经意动过了,结果 Login的时候就已经有问题了,而我却一直不知道。最后是让机房的工程师给帮忙截获一下网关上的状态才发现问题的,而试验机房的设备比较奇特,有很多的时候其实有错误的时候,试验网关也不返回错误代码,而是返回正确,这造成了调试难度的增加。

http://hi.baidu.com/snap_bai/blog/item/90c24ef47e5c60ec7709d731.html
http://www.njpro.cn/blogs/blognanjing/pages/CodeSmith-_8269F08F_.aspx
CodeSmith是一个基于模板的代码生成器。模板是所生成代码的式样。开发者或构架师可应用CodeSmith来生成任何文本语言的代码。其结果(生成的代码)可通过属性来自定义并包含在众多的标准属性类型之中。另外,用户还可建立自定义的属性类型。

让Office2003支持Docx等Office2007文档的补丁包

微软官方网站详细信息:
http://support.microsoft.com/kb/923505

补丁包下载地址(可选择其他语言版本):
http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&FamilyID=941b3470-3ae9-4aee-8f43-c6bb74cd1466

简体中文版直接下载地址:
http://download.microsoft.com/download/6/5/6/6568c67b-822d-4c51-bf3f-c6cabb99ec02/FileFormatConverters.exe

标签:,

20070118 CodePlex TortoiseSVN  DDBuildTools - 十月 30, 2008 by yippee

20070118 CodePlex TortoiseSVN  DDBuildTools
http://www.yippeesoft.com

TortoiseSVN
Release Name: 1.4.7

Notes:
Bugfix release.
Linked against Subversion 1.4.6.

感觉这几个升级都是BUG FIX

Using TortoiseSVN with CodePlex

   1. To use TortoiseSVN with CodePlex you will need to download both TortoiseSVN and SvnBridge:

          o Download and install TortoiseSVN from here: http://tortoisesvn.net/downloads
          o Download SvnBridge from here: http://www.codeplex.com/SvnBridge/Release/ProjectReleases.aspx

   1. Go to the Source Control tab of the CodePlex project and make a note of the "Project Name" and "Server URL"
   2. Run SvnBridge.exe and enter the "Server URL" into the "Team Foundation Server" field, then click OK
   3. Open Windows Explorer
   4. Create a new folder where you want to download the source code of the CodePlex project
   5. Right click on the new folder and select "SVN Checkout…"
   6. In the "URL of repository" field enter http://localhost:8081/<projectname> (replace <projectname> with the "Project Name" listed on the Source Code tab of the CodePlex project), then click OK

Description
Run SvnBridge to use TortoiseSVN or other Subversion clients with Team Foundation Server.

Files
Runtime Binary SvnBridge.zip
runtime binary, 130K, uploaded Oct 18 2007 – 4435 downloads

Typical Workflow
Table of Contents

    * Introduction
    * Listing Projects
    * Getting Your First Copy of The Source Code
    * Editing Files
    * Adding Files
    * Deleting Files
    * Undoing Changes
    * Getting Status on Your Changes
    * Updating Your Code
    * Resolving Conflicts
    * Using Syncup
    * Committing Your Changes

What clients can I use for source control with CodePlex?

If you are not a developer or coordinator on a project:

If you are not a developer on a project than you have two choices you can use to anonymously access the source control repository:

    * TortoiseSVN: A GUI source control client that integrates into Windows Explorer and provides edit-merge-commit and offline support.
    * CodePlex Client: A command line source control client that provides edit-merge-commit and offline support.

If you are a developer or coordinator on a project:

If you are a developer or coordinator on a project than the following clients are available for free and can be used with CodePlex:

    * TortoiseSVN: A GUI source control client that integrates into Windows Explorer and provides edit-merge-commit and offline support.
    * CodePlex Client: A command line source control client that provides edit-merge-commit and offline support.
    * Teamprise: A GUI source control client that can run on Windows, Linux, or Macintosh and supports integration with Eclipse.
    * Team Explorer: A GUI source control client that can run stand-alone or integrates with Visual Studio 2005 or 2008.
    * TF.exe: A command line source control client that comes with Team Explorer.
    * MSSCCI Provider: A MSSCCI provider that enables source control integration with MSSCCI enabled IDE\’s such as Visual Studio 2003.

Project Name: DDBuildTools
Server URL: https://tfs03.codeplex.com

基础平台管理系统(FrameWork)
官方论坛:http://framework.supesoft.com/bbs/

帮助文档:http://framework.supesoft.com/help/

他的博客地址 http://lzppcc.cnblogs.com/

DDBuildToolsRelease1.0 (创建数据库文档)

Create DataBase Document

Access/MsSql2000/MsSql2005

下载地址:/Files/lzppcc/DDBuildToolsRelease1.0.rar
源码下载:http://www.codeplex.com/DDBuildTools/SourceControl/ListDownloadableCommits.aspx

Asp.Net通用权限管理系统 专用代码生成工具(DDBuildTools),是supesoft.com为Asp.Net通用权限管理系统开发的一套代码生成工具。其主要功能:
1.根据数据库表结构生成数据库表结构文档
2.根据数据库表结构生成符合 Asp.Net通用权限管理系统 的数据库操作代码(支持Access和MsSql2000/2005)
3.根据数据库表结构生成MsSql2000/2005的表增加/删除/修改 存储过程
3.根据数据库表结构生成符合 Asp.Net通用权限管理系统 的前台表数据的新增/修改/删除/列表/查询的Aspx和cs文件。

详细介绍地址:http://framework.supesoft.com/help/?DDBuildTools.htm
购买方式,请查看http://framework.supesoft.com
主要功能:
1.生成数据库中表结构的文档.
2.支持Access/Mssql200/Mssql2005
3.目前支持中文和英文二套模板.

 FineMessBox弹出窗口js (修改版,增加对Firefox支持)
subModal-1.4 弹出窗口修改版->FineMessBox
一直想找个好点的弹出窗口,在google上搜了也没有搜出好的来.后来朋友给了个submodal,效果还可以,就是样子难看.
ext-2.0 的弹出窗口不错,就拿了他的样式来修改了.就成了现在的FineMessBox.
想想也许也有其它的朋友像我一样一直在找一个好的弹出窗口.就共享出来,大家一起用吧.
原来效果: http://www.subimage.com/dhtml/subModal/
修改后效果: http://demo.framework.supesoft.com/finemessbox
附件下载:/Files/lzppcc/ext2.0MessageBox.rar

标签:, , , , ,

20070928 excel vba unicode - 六月 23, 2008 by yippee

20070928 excel vba unicode
http://www.yippeesoft.com

len("大家好") len("abc") 所返回的值都是 3,因为「大」和「a」都是一个字符。 但是这对一些中文字串处理,例如纯文字的数据文件,却是一个大灾难,因为你必须以byte 来定位每个字符,可是 unicode 却把一切的处理全搞砸了。例如: len("good morning") 返回 12,而 len("今天天气很好") 返回 6 对初学者而言,好不容易能使用 vb 来写程序已经是件了不起的事了,却马上在中文处理上挨了一记闷棍,所受到的打击实在不小。但是不要怕,事实上只要再多了解一些指令,就可以把中文处理的问题解决了。 是什么指令呢?最重要的莫过于 strconv 了。strconv 函数的语法为:strconv(待转换字串, 转换格式) 其中转换格式在这里用到的是: vbunicode 将 ansi 字串转换为 unicode vbfromunicode 将 unicode 字串转换为 ansi 将字串转成 ansi 之后,所有的字串处理指令都要加个 b,例如:leftb, rightb, midb, chrb, instrb, lenb, inputb 等。例用这些指令来处理就行了。 当你处理完毕之后,你可以再将它再转回 unicode,这样就可以使用一般的字串处理指令了。这样讲看得懂吗?如果还是不了解,看看下面的实例说明:简易使用范例看看下面的基本范例您应该就会对 vb 的字串处理方式有些概念。 private sub command1_click () dim sunicode as string dim sansi as string \’ unicode 运算 sunicode = "王小明,a123456789,651023,上海市中山路100号,(02)2345678" debug.print len(sunicode) \’ 返回 44 debug.print mid$(sunicode, 5, 10) \’ 返回 a123456789 debug.print instr(sunicode, "上海市") \’ 返回 23 \’ 将 unicode 字串转成 ansi sansi = strconv(sunicode, vbfromunicode) \’ ansi 运算 debug.print lenb(sansi) \’ 返回 54 debug.print midb$(sansi, 8, 10) \’ 返回 ?????,因为忘了转回 unicode debug.print strconv(midb$(sansi, 8, 10), vbunicode) \’ 返回 a123456789,请注意转回 unicode 的动作一定要做 debug.print instrb(sansi, strconv("上海市", vbfromunicode)) \’ 返回 23, 不要忘了要把"上海市"也转成 ansi,否则会找不到 end sub 读入文本文件在 vb 的小技巧中,有一个是快速读文件法: private sub command1_click () dim sfile as string open "c:\\filename.txt" for input as #1 sfile = input$(lof(1), #1) close #1 end sub 但是很不幸地,如果你读取的文件内含中文字,那上面这段程序会出现 input pastend of file 的错误。因为 lof 返回的是文件的 byte 数,而 input 函数读取的是字符数,由于文件内含中文,因此文件中的字符数将会小于 byte 数,于是就发生错误了。要解决这个问题,我们就要用到 strconv 和 inputb 这两个函数了: private sub command1_click () dim sfile as string open "c:\\filename.txt" for input as #1 sfile = strconv(inputb$(lof(1), #1), vbunicode) close #1 end sub 上面修正程序先用 inputb 将文件读进来,不过使用 inputb 所读入的文件是 ansi格式的,所以要再用 strconv 转成 unicode 才行。随机数据文件许多文字数据文件是以固定字节的位置来加以区格,例如下面的数据格式:王小民650110上海市中山路100号 (02)1234567 张大呆660824花莲县大甲镇广东街23号(03)9876543 像这种类型的文件要如何处理呢?这是就必须用到 type 以及 byte array 了。 private type tagrecord username(5) as byte \’ 姓名 6 bytes birthday(5) as byte \’ 生日 6 bytes address(21) as byte \’ 地址 22 bytes tel(11) as byte \’ 电话 12 bytes crlf(1) as byte \’ 换行字符 2 bytes end type private sub command1_click() dim urecord as tagrecord open "c:\\filename.dat" for random as #1 len = lenb(urecord) get #1, 2, urecord \’ 取第二笔数据 with urecord \’ with … end with 应该会用吧 debug.print .username \’ 返回 ??? debug.print strconv(.username, vbunicode) \’ 返回 "张大呆" end with close #1 end sub 在这个例子中,一定要用到 byte array,因为只有 byte array 才能正确地定位到每个 byte 的位置。以前使用字串来定位的方法已经不适用了,千万要记住!但是使用byte array 所读入的数据是 ansi 格式,若要处理或是做运算的话,记得还要转成unicode 格式才行。 [●] 使用 byte array 除了上面必须使用 byte 精确定位的例子之外,纯文字的处理基本上是用不到 bytearray 的。byte array 通常是用在处理 binary 数据。这方面的问题我们将另文讨论。看吧!只要熟悉使用 strconv,你就可以在 unicode 及 ansi 格式之间自由自在地变来变去

 在vb中如何将一个integer 类型的数据转换成两个Byte类型存储?
Dim l As Integer, k As String
    Dim arr(1) As Byte
    l = -30000
    k = Right(Format("000" + Hex(l)), 4)
    arr(0) = Val("&H" + Left(k, 2))
    arr(1) = Val("&H" + Right(k, 2))

 \’VB中的String是Unicode 
          Dim   str1   As   String 
          Dim   str2   As   String 
          Dim   abyte1()   As   Byte 
          Dim   abyte2()   As   Byte 
          str1   =   "字符串abcd1234" 
          abyte1   =   str1 
          abyte2   =   StrConv(str1,   vbFromUnicode) 
          
          str2   =   abyte1 
          Debug.Print   "Unicode的byte数组直接赋值:"   &   str2 
          str2   =   abyte2 
          Debug.Print   "没转转换为Unicode是这样:"   &   str2 
          str2   =   StrConv(abyte2,   vbUnicode) 
          Debug.Print   "转换为Unicode就可以了:"   &   str2

 

 

存放文本的Byte数组可以与String直接转换。 
  
  dim   a()   as   byte,s   as   string 
  
  ————————— 
  在内存中的相互转换 
  
  s="hggjh" 
  a=s   \’直接转为Unicode编码的数组 
  s=a   \’将Unicode编码的数组转为String 
  ———————————- 
  
  ——————————————- 
  对于存在文件中的文本,读入byte数组为ANSI编码 
  
  s=strconv(a,vbunicode)   \’可将文件读入byte数组转为String 
  a=strconv(s,vbfromunicode)   \’可将String转为ANSI编码存入byte数组  

  一个vb递归的程序,打印collection内容
注意声明中by val语句,VB中默认的参数传递方式是by ref
 
Public Function printCol(col As H2000_HELPERLib.Collection, Optional ByVal nIntent As Integer) As String
    If Not IsNullCollection(col) Then
        nIntent = nIntent + 1
        Debug.Print Space(nIntent * 4) & "(TotalSize = " & col.GetTotalSize & _
                                         "; Count = " & col.Count & ")"
      
        Dim i As Long
        For i = 1 To col.Count
            Dim strLine As String
          
            strLine = Space(nIntent * 4)
            strLine = strLine + col.GetKeyByIndex(i)
            strLine = strLine + vbTab + TypeName(col(i))
          
            Debug.Print strLine
          
            If TypeName(col(i)) = "ICollection" Then
                printCol col(i), nIntent
            End If
        Next
    End If
End Function

标签:, , ,

20070521 wake up on lan code - 一月 31, 2008 by yippee

20070521 wake up on lan code
http://www.yippeesoft.com

<?php

   /***************************************************
    * PHP Class for UDP Magic Packet Wake-on-Lan   
    * ?2002                           
    ***************************************************
    * This class exports 2 functions you would most 
    * probably want to use:                 
    *   void MagicPacket() – class descriptor     
    *   bool wake(string $ip, string $mac[, int $port]) – to wake the computer at the specified
    *                   ip address. The mac argument is the MAC
    *                   address of the NIC you would like to
    *                   wake up. The port argument is any UDP port,
    *                   preferably 9, the UDP discard port.
    *                   Returns true on success, false on failure.
    ***************************************************
    * Usage: $wol = new MagicPacket();         
    *     $wol -> wake(\’192.168.1.201\’,\’001122334455\’, 9);       
    ****************************************************/

class MagicPacket
&leftsign;
   function MagicPacket()
   &leftsign;
       $this -> $ff = chr(0xFF);
   &rightsign;

   function wake($ip, $mac, $port)
   &leftsign;
       $this -> $nic = fsockopen("udp://" . $ip, $port);
       if( !$this -> $nic )
       &leftsign;
           fclose($this -> $nic);
           return false;
       &rightsign;
       else
       &leftsign;
           fwrite($this -> $nic, $this -> generate_magic_packet($mac));
           fclose($this -> $nic);
           return true;
       &rightsign;
   &rightsign;

   function generate_magic_packet($dest_mac)
   &leftsign;
       $packet = "";
       for($i = 0; $i < 6; $i++)
       &leftsign;
           $packet .= $this -> $ff;
       &rightsign;
       for($i = 0; $i < 6; $i++)
       &leftsign;
           $packet .= chr((int)substr($dest_mac, $i, $i + 2));
       &rightsign;
       return $packet;
   &rightsign;
&rightsign;

?>
  

   http://www.depicus.com/wake-on-lan/woli.aspx
   ake on Lan Magic Packets can be sent over the Internet – why not try waking up one of your machines with our free Wake On Wan Service.

   Wake On LAN over the Internet

One example of how to wake up a home or office computer across the Internet is the following.

Assume a home network with a WAN router, in this case a DrayTek Vigor 2500We with firmware version 2.54. The main problem is that you cannot use any of the usual methods to address the target computer. Since it is off, it has no IP address. False advice is widespread, because people keep forgetting this simple fact.

The router has to send a special broadcast packet into the Local Area Network, using the MAC (Media Access Control) address, rather than the IP address. With some routers you may be able to achieve this by sending a Wake-On-LAN packet to the router and forward the port to an internal broadcast address, for example: 192.168.0.255

With most routers, however, this still does not work. You have to rely on the router to have the special ability to forward or send a Wake-On-LAN broadcast packet. In the case of the DrayTek router this can only be achieved through the telnet interface, but unfortunately not yet through the Web interface. An example for the telnet command for this DrayTek router is:

wol up 00E01890A545

Of course you have to replace the hex number with the MAC address of your target computer, and for this particular router you cannot intersperse hyphens as usual. The router needs the address in the direct short hexadecimal format. Check your router\’s manual or help system for its specifics.

procedure TForm1.Button1Click(Sender: TObject);
var
 SendCode:string;
 TempStr:string;
 i:byte;
begin
 SendCode:=StringofChar(#255,6);
 for i:=0 to 15 do
     begin
     TempStr:=TempStr
             +string(char($00))
             +string(char($50))
             +string(char($BA))
             +string(char($EC))
             +string(char($71))
             +string(char($A6));
     end;
 SendCode:=SendCode+TempStr;
 UDPSend(SendCode);
end;
procedure TForm1.UDPSend(SendCode: String);
var
 SendMStream:TMemoryStream;
begin
 SendMStream:=TMemoryStream.Create;
 try
   NMUDP1.ReportLevel:=1;
   NMUDP1.RemoteHost:=\’188.0.255.255\’;
   NMUDP1.RemotePort:=7010;
   SendMStream.Write(SendCode[1],length(SendCode));
   NMUDP1.SendStream(SendMStream);
 finally
   SendMStream.Free;
 end;
end;

/********************************************************************
* created: 2004/06/02
* created: 2:6:2004   10:24
* filename:  c:\\documents and settings\\administrator\\桌面\\wakeup.cpp
* file path: c:\\documents and settings\\administrator\\桌面
* file base: wakeup
* file ext: cpp
* author:  XiaoPing Zhang
*
* purpose:
*********************************************************************/
#include "stdafx.h"
#include

#define  MAC_ADDR_LEN  6
#define  MAGIC_DATA_LEN  102

#pragma comment(lib, "iphlpapi.lib")

BOOL GetMacFromIP(const char * pIP)
&leftsign;
 HRESULT hr;
 IPAddr  ipAddr;
 ULONG   pulMac[2];
 ULONG   ulLen;

 ipAddr = inet_addr ("216.145.25.31");
 memset (pulMac, 0xff, sizeof (pulMac));
 ulLen = 6;

 hr = SendARP (ipAddr, 0, pulMac, &ulLen);
 printf ("Return %08x, length %8d\\n", hr, ulLen);

 size_t i, j;
 char * szMac = new char[ulLen*3];
 PBYTE pbHexMac = (PBYTE) pulMac;

 //
 // Convert the binary MAC address into human-readable
 //
 for (i = 0, j = 0; i < ulLen – 1; ++i) &leftsign;
  j += sprintf (szMac + j, "%02X:", pbHexMac[i]);
 &rightsign;

 sprintf (szMac + j, "%02X", pbHexMac[i]);
 printf ("MAC address %s\\n", szMac);

 delete [] szMac;

 return TRUE;
&rightsign;

// 输入6个字节的mac地址
BOOL WakeupSinglePC(const unsigned char* pMac)
&leftsign;
 // TODO: Add your command handler code here
 if (pMac == NULL)
 &leftsign;
  TRACE("Mac address error!");
  return FALSE; 
 &rightsign;
 
 WSADATA wsaData;
 int err = WSAStartup( MAKEWORD(2, 2), &wsaData );
 if ( err != 0 )
 &leftsign;
  TRACE("WSAStartup error %d !", WSAGetLastError());
  return FALSE;
 &rightsign;
 
 if ( LOBYTE( wsaData.wVersion ) != 2 &line;&line;
   HIBYTE( wsaData.wVersion ) != 2 )
 &leftsign;
  TRACE("WinSock DLL not supports 2.2 !");
  return FALSE;
 &rightsign;
 
 do
 &leftsign;
  SOCKET sFirst = socket(AF_INET, SOCK_DGRAM, 0);
  if (sFirst == INVALID_SOCKET)
  &leftsign;
   TRACE("socket error %d !", WSAGetLastError());
   break;  
  &rightsign;

  do
  &leftsign;
   BOOL bOptVal = TRUE;
   int iOptLen = sizeof(BOOL);
  
   err = setsockopt(sFirst, SOL_SOCKET, SO_BROADCAST, (char*)&bOptVal, iOptLen);
   if (err == SOCKET_ERROR)
   &leftsign;
    TRACE("setsockopt error %d !", WSAGetLastError());
    break; 
   &rightsign;
  
   char szMagicData[MAGIC_DATA_LEN];
   memset(szMagicData, 0xff, sizeof(szMagicData));
  
   for(int i=MAC_ADDR_LEN; i   &leftsign;
    memcpy(szMagicData+i, pMac, sizeof(unsigned char)*MAC_ADDR_LEN);
   &rightsign;
  
   sockaddr_in addr;
   addr.sin_family = AF_INET;
   addr.sin_port = htons(0);
   addr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
  
   err = sendto(sFirst, szMagicData, sizeof(szMagicData), 0, (LPSOCKADDR)&addr, sizeof(addr));
   if (err == SOCKET_ERROR)
   &leftsign;
    TRACE("sendto error %d !", WSAGetLastError());
    break;
   &rightsign;  
  &rightsign; while(0);
 
  err = closesocket(sFirst);
  if (err == SOCKET_ERROR)
  &leftsign;
   TRACE("closesocket error %d !", WSAGetLastError());
   break;
  &rightsign; 
 &rightsign; while(0);
 
 err = WSACleanup();
 if ( err == SOCKET_ERROR )
 &leftsign;
  TRACE("WSACleanup error %d !", WSAGetLastError());
  return FALSE;
 &rightsign;
 
 return TRUE;
&rightsign;

// 输入6个字节的mac地址数组
BOOL  WakeupMultiPC(int iNum, const unsigned char* pszMac[])
&leftsign;
 // TODO: Add your command handler code here
 if (pszMac == NULL)
 &leftsign;
  TRACE("Mac address Error!", WSAGetLastError());
  return FALSE;
 &rightsign;
 
 WSADATA wsaData;
 int err = WSAStartup( MAKEWORD(2, 2), &wsaData );
 if ( err != 0 )
 &leftsign;
  TRACE("WSAStartup Error %d !", WSAGetLastError());
  return FALSE;
 &rightsign;
 
 if ( LOBYTE( wsaData.wVersion ) != 2 &line;&line;
   HIBYTE( wsaData.wVersion ) != 2 )
 &leftsign;
  TRACE("WinSock DLL not supports 2.2");
  return FALSE;
 &rightsign;
 
 do
 &leftsign;
  SOCKET sFirst = socket(AF_INET, SOCK_DGRAM, 0);
  if (sFirst == INVALID_SOCKET)
  &leftsign;
   TRACE("socket error %d !", WSAGetLastError());
   break;  
  &rightsign;
 
  do
  &leftsign;
   BOOL bOptVal = TRUE;
   int iOptLen = sizeof(BOOL);
  
   err = setsockopt(sFirst, SOL_SOCKET, SO_BROADCAST, (char*)&bOptVal, iOptLen);
   if (err == SOCKET_ERROR)
   &leftsign;
    TRACE("setsockopt error %d !", WSAGetLastError());
    break; 
   &rightsign;

   sockaddr_in addr;
   addr.sin_family = AF_INET;
   addr.sin_port = htons(0);
   addr.sin_addr.s_addr = htonl(INADDR_BROADCAST);

   char szMagicData[MAGIC_DATA_LEN];

   for (int index=0; index
   &leftsign;  
    memset(szMagicData, 0xff, sizeof(szMagicData));
   
    for(int i=MAC_ADDR_LEN; i    &leftsign;
     memcpy(szMagicData+i, pszMac[index], sizeof(unsigned char)*MAC_ADDR_LEN);
    &rightsign;
   
    err = sendto(sFirst, szMagicData, sizeof(szMagicData), 0, (LPSOCKADDR)&addr, sizeof(addr));
    if (err == SOCKET_ERROR)
    &leftsign;
     TRACE("sendto error %d !", WSAGetLastError());
     break;
    &rightsign;
   &rightsign;
  
  &rightsign; while(0);
 
  err = closesocket(sFirst);
  if (err == SOCKET_ERROR)
  &leftsign;
   TRACE("closesocket error %d !", WSAGetLastError());
   break;
  &rightsign; 
 &rightsign; while(0);
 
 err = WSACleanup();
 if ( err == SOCKET_ERROR )
 &leftsign;
  TRACE("WSACleanup error %d !", WSAGetLastError());
  return FALSE;
 &rightsign;
 
 return TRUE;
&rightsign;

标签:, ,
20070309 googlecode  CoolLittleThings - 八月 11, 2007 by yippee

20070309 googlecode  CoolLittleThings

看到两个有趣的网站,纪录一下
Google Code是Google之前推出的网站,为表示对开源项目的支持,Google在该网站上贴出了部分搜索技术源代码以及服务的API源代码。之前有消息说,Google将开放Google Code,和著名的sf.net类似,为开源项目提供提供免费服务。

今天,Google Code Project Hosting 服务已正式开放(但是Google Code首页尚无连接)。和sf.net相比,创建项目不需要繁杂的申请,方便许多(Dash以前就因为英语不过关,申请sf.net项目经常被拒)。目前提供的功能还比较简单,仅仅包括 SVN 和 Issue Tracking 2项服务。不过可以在后台设置Google Group关联,也算是多了邮件列表的功能。
利用google的hosting工具建立开源项目

google推出了hosting服务,他是一个可以host你的项目的一个平台,当然你hosting的项目必须是开源的,其实google的 hosting和大名鼎鼎的sourceforge一样,只不过google的hosting是基于SVN的。这样喜欢google的同学可以利用这个来 host你的开源项目了。

首先你必须要有一个google帐号(就是你gmail登录的帐号),然后在浏览器敲入地址http://code.google.com/hosting/如果你登录了的话会出现下图,没有登录的请先登录google。

google_hosting_1.JPG

点击”Create a new project”google hosting将创建一个属于你的项目。

通过简单的几步,你就可以创建一个项目,完成后你可以看到Project Home,Issues,Source,Administer四个选项,

    Project Home:项目的基本描述
    Issues:管理你项目的发布的一些功能
    Source:这里是一些关于源码的设置,包括你如何从客户端check out和update你的项目,
    Administer:这里是管理你的项目的一些设置,包括项目的基本信息,增加项目成员( 通过Project Members增加),Advanced中可以删除你的项目。

OK,你的开源项目建立好了,下面在你的工作机器上配置一下svn客户端,目前使用的多的可能就是tortoisesvn了吧,先到http://tortoisesvn.net/下载一个tortoisesvn,好像最新版本的是1.4.1了吧。安装后重新启动(windows)。建立一个用于你项目的目录如d:/temp,在该文件夹上点击右键选择SVN Checkout…如图:

svn_checkout.JPG

出现让你填写你项目url的界面,这是后注意了,你要得到你项目checkout的url。先登录google然后到http://code.google.com/hosting在浏览器的右上角有一个”My Profile”点击进入后在My Profile页面里选择一个你要checkout的项目,然后选择”Source”选项卡,在Source页面中的”Command-Line Access”中找到https://xxxx.googlecode.com/svn/trunk/其中xxxx是你项目的名称,将这段url填入tortoisesvn,点击”SVN password”链接,获得你在这个项目上的update密码

svn_checkout_2.JPG

确定后,会要求你填入用户名和密码,用户名就是你google的用户名,密码就是刚才我们获取的update密码,点击确定后项目会checkout到你指定的目录中。

Jan 发表于 2006年7月28日 11时42分 星期五       来自全球仓库部门

Jan 写道 "前几天我们报导Google有可能发布一个类似sf.net的工程,今天它已经上线了,Google Code Hosting. 当你在Google Code Hosting上创建自己的工程的时候,Google会自动去sf.net(可能还有其他地方)上搜索是否存在同名的工程,可以在一定程度上防止重复发明轮子,同时也体现了一种对sf.net非常友好的态度。Google Code Hosting采用SVN进行版本控制,可以选择的协议有GPL/LGPL/Apache/Mozilla/BSD/MIT等等,均为开源协议,工程可以直接创建,无需申请,仓库总共有100M空间。
我已经申请了一个玩玩,只能用SVN,密码是GOOGLE自己随机GENERATE。可以匿名访问。

可惜速度稍微慢了些,比SF还要慢。

It\’s the time of year for giving, and thus I have the pleasure of giving you two much-awaited gifts for Google Code\’s project hosting!

File Downloads – this has been the most-requested feature since we launched project hosting here on Google Code. We knew it would be, but wanted to ship earlier rather than later. We think you\’ll like what we did… one-click downloads and scriptable uploads, as well as searchable summaries and labels.

Wikis – all projects now have a tightly-integrated wiki appearing under a new Wiki tab. The really cool thing here is that the content is stored in your Subversion repository under the /wiki/ directory. You can edit the pages with your favorite editor and commit them with your favorite Subversion client! Additionally, you can add labels and page summaries to wiki pages for improved searching.

nstructions:
Your project\’s name must consist of a lowercase letter, followed by lowercase letters, digits, and dashes, with no spaces. The project name will be part of your project\’s URL and cannot be changed later.
Your project\’s summary is a one-line description that will be shown when the project\’s name is shown.
This plain-text description will be the main content of your project\’s home page.
Your choice of license determines how others are allowed to use your work.
Project labels help to classify your project so that other users can easily find it or browse projects by label.

SVN Hosting – 提供专业源代码版本管理服务
http://svn.coollittlethings.com

SVN Hosting有什么用?

    * SVN Hosting让你的团队开发有一个统一的源代码库
    * 你在不同的地方(公司 or 家里),轻松同步你的源代码
    * 两个人修改了同一个文件?不用担心,SVN自动帮你Merge文件
    * Rollback到任意一个时间的代码,源代码的Time Machine

除此之外还有什么?

    * SVN Hostting是开源软件的基石
    * 你可以发布你的源代码让远方的朋友修改完善
    * 你也可以加入你感兴趣的开源项目
    * 马上注册一个帐号?你就可以创建自己的项目,邀请你的项目成员……

简单,专注,乐于分享,做中国最坚持与颠覆的技术团队
1. 什么是Coollittlethings

    Coollittlethings 是一个程序员的团队,同时也是一种Concept, 一种Spirit, 一种Direction。

    CoolLittleThings是为了颠覆我们认为在现在这个行业里错的态度,而去坚持要走的一种新的思路。

    简单-坚持不从"能够做"而去做,而从"需要有"而去做;坚持用最简单而恰到好处的技术手段去实现最复杂的功能。

    专注-要做,就专到某一点上来做,要比别人做得更好甚至最好。

    乐于分享-不重复开发,毫不客气地利用别人现在的架构及接口,同时毫不悭吝地向别人提供接口。做每一样都很小很Cool,但可以组合起来很强大。

2. 为什么会有Coollittlethings

    我们是一班耐不住寂寞的程序员,我们经历和大多数程序员一样的困惑,Coollittlethings是我们经过大量的思考和实践的结果。

    和大家一样我们起初也是对中国的软件行业缺乏信心,找不到方向,盗版横行,黑幕成堆,优汰劣胜,轻佻浮躁,虚妄概念等等……但是我们问自己,会永远这样吗?象Google这样的公司出现,点燃了我们的希望,做程序员原来可以这样,而且应该这样。

    我们想要带给大家的信息是,要做软件,要做好的软件,仍然很难,除了要有工具,掌握工具以外,还要有好的思想。

    因为这样的原因,所以有了Coollittlethings。

    这个事情,注定很难,我们知道王石做房地产的时候也很难,马云做阿里巴巴的时候也很难,所以我们要对自己有信心。

3. 介绍一下Coollittlethings和我们的团队

    我们是坚定的,优秀的,颠覆的,做软件的团队:

    第一,我们厌恶大型系统,许多客户都希望把软件做成“十大杀人武器”,“拿你命3000”这样的软件,对这些系统我们会坚决say no,不管预算多少。我们强项不是做复杂的系统,而是把复杂的系统简化。

    第二,我们不相信CMMI,这不是一个人性化的,符合软件开发实际情况的,好的标准。根据Joel的观点,软件开发仍然是智力密集型的工作,所以要人比制度更加重要。

    第三,我们不相信最hot的炒作概念,不相信J2EE, .Net Framework这些东西可以一夜之间改变程序员的生活,即使是设计模式这样天才的想法也不能适用于任何情况,并且很快地开变软件开发的现状。

    第四,我们认为软件开发仍然是有价值的,如果能力允许,应该尽量用正版软件。流氓软件也许可以一夜暴富,但有信誉的软件供应商,在未来是有价值的。因此,我们也不会因为惧怕丢失用用户而免费发布产品。

    第五,我们认为现在的中国互联网是非常浮躁的,但我们时刻提醒自己戒骄戒躁,保持高度的耐心,继续坚定的推出简单,实用的互联网服务。

    第六,我们相信未来不是微软一家独统天下的,因此Linux和Mac的软件也是我们的目标。

    第七,我们要保持头脑鲜活,对创意的饥饿追求,并坐言起行,立即行动,做创新的实践者。反对“坐谈客尔”。 不仅要有狂热的理想,还要有脚踏实地实践精神。

标签:,
1027 vfw 枚举 编码解码器 CODEC DECODEC - 四月 6, 2007 by yippee

1027 vfw 枚举 编码解码器 CODEC DECODEC

 HIC hic;
ICINFO icinfo;
LPCSTR Drvname;
void* pout;
int i=0;
char str[]="Microsoft H.263 Video Codec";
do
&leftsign;
     if(ICInfo(ICTYPE_VIDEO, i, &icinfo)==0)
   return;
     hic = ICOpen(icinfo.fccType, icinfo.fccHandler,ICMODE_COMPRESS&line;ICMODE_DECOMPRESS);
     if (hic)
     &leftsign;
        ICGetInfo(hic, &icinfo, sizeof(icinfo));
  //        Drvname=GetDriverName(icinfo.szDescription);
  TRACE(CString(icinfo.szDescription));
  TRACE("\\r\\n");
     &rightsign;
    
     i++;
&rightsign;while(1);

控制面板--音频--硬件--视频编码解码器
        Cinepak Codec by Radius Inc.
        ffdshow Video Codec
        Indeo codec by Intel
        ir41_32.ax
        iyuv_32.dll
        Ligos Indeo? XP Video 5.2
        lvcodec2.dll
        Microsoft RLE Codec
        Microsoft Video 1
        msh261.drv
        msh263.drv
        msyuv.dll
        tsbyuv.dll
        vp6vfw.dll
        vp7vfw.dll
        XviD MPEG-4 Video Codec

Loaded \’D:\\WINDOWS\\system32\\iccvid.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\version.dll\’, no matching symbolic information found.
Cinepak Codec by Radius
Loaded \’D:\\WINDOWS\\system32\\lvcodec2.dll\’, no matching symbolic information found.
Logitech Video (I420)
Loaded \’D:\\WINDOWS\\system32\\ir32_32.dll\’, no matching symbolic information found.
Intel Indeo(R) Video R3.2
Intel Indeo(R) Video R3.2
Loaded \’D:\\WINDOWS\\system32\\ir41_32.ax\’, no matching symbolic information found.
Intel Indeo? Video 4.5
Loaded \’D:\\WINDOWS\\system32\\iyuv_32.dll\’, no matching symbolic information found.
Intel IYUV codec
Loaded \’D:\\WINDOWS\\system32\\msrle32.dll\’, no matching symbolic information found.
Microsoft RLE
Loaded \’D:\\WINDOWS\\system32\\msvidc32.dll\’, no matching symbolic information found.
Microsoft Video 1
Loaded \’D:\\WINDOWS\\system32\\msyuv.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\msyuv.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\tsbyuv.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\msyuv.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\msh263.drv\’, no matching symbolic information found.
Microsoft H.263 Video Codec
Loaded \’D:\\WINDOWS\\system32\\msh261.drv\’, no matching symbolic information found.
Microsoft H.261 Video Codec
Loaded \’D:\\WINDOWS\\system32\\ir50_32.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\oleaut32.dll\’, no matching symbolic information found.
Ligos Indeo? XP Video 5.2
Loaded \’D:\\WINDOWS\\system32\\ff_vfw.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\msvcr71.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\clbcatq.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\comres.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\ffdshow.ax\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\comdlg32.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\dinput.dll\’, no matching symbolic information found.
ffdshow Video Codec
Loaded \’D:\\WINDOWS\\system32\\vp6vfw.dll\’, no matching symbolic information found.
VP60? Simple Profile
VP61? Advanced Profile
VP62? Heightened Sharpness Profile
Loaded \’D:\\WINDOWS\\system32\\vp7vfw.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\winspool.drv\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\oledlg.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\dbghelp.dll\’, no matching symbolic information found.
VP70? General Profile
Loaded \’D:\\WINDOWS\\system32\\xvidvfw.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\xvidcore.dll\’, no matching symbolic information found.
Loaded \’D:\\WINDOWS\\system32\\xvidcore.dll\’, no matching symbolic information found.
XviD MPEG-4 Codec

标签:, , ,
0522 2006 Microsoft  CodePlex - 十一月 3, 2006 by yippee

0522 2006 Microsoft  CodePlex

微软动态
微软也推SourceForge模式 发布CodePlex开源项目站
[2006-5-16] 微软官方推出了名为CodePlex的开源项目网站,用户可以使用这个平台发布认领开源项目.感觉很类似Sourceforge.目前这个网站还处在beta测试阶段,微软表示将会在今年6月份的Open Source Business Conference 正式发布这个站点。 [新闻提供者 Ericlee]

上去转悠呢一下,果然和VS2005 相关呢

Welcome to the CodePlex Beta. You can use CodePlex to create new projects to share with your fellow developers around the world, join others who have already started their own project, or simply use the applications on this site and provide feedback.

What is CodePlex?
CodePlex is an online software development environment for open and shared source developers to create, host and manage projects throughout the project lifecycle. It has been written from the ground up in C# using .NET 2.0 technology with Team Foundation Server on the back end. CodePlex is open to the public free of charge.
CodePlex includes the following features:
Release Management
Work Item Tracking
Source Code Dissemination
Wiki-based Project Team Communications
Project Forums
News Feed Aggregation

CodePlex: Code of Conduct
As part of Microsoft\’s commitment to making CodePlex a great place to meet and interact with others around the world, you agree to abide by our Code of Conduct. Your commitment to this Code of Conduct in all message board services, chat areas, news groups, forums, communities, sample uploads, and/or other message or communication facilities (including any contents of any of these services or facilities) designed to enable you to communicate with the public at large or with a group, ensures a positive experience for all our users.

Specific communities, chats, and message boards may also have additional guidelines which govern your use, so be sure to review them in addition to this Code of Conduct. Microsoft is not responsible for the content or activities in any user-created, non-Microsoft managed Communication Service.

All activity on CodePlex is also governed by the CodePlex Terms of Use. To read the CodePlex Terms of Use, please click here.
Respect Others
We encourage everyone to treat each other with mutual respect. Do not use any communication or collaboration services to threaten, harass, stalk, or abuse others participating in these services. Microsoft reserves the right to remove posts that advocate or encourage expressions of violence, bigotry, racism, hatred, or profanity. Microsoft may remove postings that are deemed inappropriate, offensive or that violate guidelines or this Code of Conduct. Microsoft may also eject or ban any user from their area who behaves in a manner deemed inappropriate, offensive or who violates guidelines or this Code of Conduct. By participating in a collaborative service, you agree to be bound to the rules of that area.

Keep It Legal
Microsoft does not allow any illegal activities. You cannot use the CodePlex or Microsoft collaborative services to publish, post, distribute, or disseminate defamatory, infringing, obscene, or other unlawful material or information, specifically, but not limited to, child pornography, bestiality, incest, illegal drugs, software and harassment.. You may not use any of the collaborative services for the purpose of linking to external sites that violate this Code of Conduct.

Do not upload files or post messages that contain photos, music, software or other material protected by intellectual property laws, rights of privacy or publicity or any other applicable law unless you own or control the rights thereto or have received all necessary consents. Microsoft is not responsible for any use of anything you say or post.

Do not post any materials (including software and other information) that could harm (or is designed to harm) other users\’ computers or would allow others to inappropriately access software or Web sites.

In addition to upholding this code of conduct, you are responsible for adhering to all local and national laws that pertain to your location.

帮助:
Create a CodePlex Account
To create a CodePlex account
From the CodePlex home page, click Register.
On the User Registration page, provide a User Name, Password, and E-Mail address.
Click Register.
Retrieve the e-mail sent to you from support codeplex.com, and then click the link provided to complete the registration process.

Creating a Project
To Request the Creation of a New Project on CodePlex, send a request New Project Request Form. Within a few days, you will receive an email from the CodePlex Project Approval Panel, informing you of its decision. If your request is approved, an anticipated onboarding date will be identified. As that date approaches, you will be contacted with further instructions.

To Create a New Project Immediately
If you have not already done so, you can create a new gotdotnet Workspaces project, today. Gotdotnet Workspaces enables you to add your code and documentation check in changes iteratively, track work items, publish releases, obtain community feedback, and attract additional project contributors to your team. By doing so, you can significantly improve the chance that the CodePlex Project Approval Panel will agree to onboard your project quickly.

注册
Passwords require 1 Upper Case, 1 Digit, 1 Special Character and must be at least over 8 characters in length.
Complete
Your account has been successfully created. In order to active your account please check your email and follow the link inside.
 
 Congratulations… You have successfully validated your account. Click here to go to the login screen.

 确认:
 Welcome to CodePlex and thank you for registering for our service.  We are Microsoft’s online offering for distributed collaborative development in the community. Use CodePlex to create new projects to share with your fellow .NET developers around the world, join others who have already started their own project, or simply use the applications on this site and provide feedback.

You can always access CodePlex in one of two ways, either by logging in at www.codeplex.com or if you are participating on a project by using Visual Studio.  If you need basic information on using CodePlex, please visit the CodePlex project on our website.  Enjoy CodePlex and we look forward to supporting your community development.

Connecting to a CodePlex Project using Team Explorer
The first time you connect to a CodePlex project using Team Explorer, you must first select Visual Studio Team Foundation Server as source-control plug in. Once you’ve set up the connection, you will not need to repeat these steps unless you want to make changes to your connection or want to add additional team project connections.

标签:, ,
0217 ACM user breakpoint called code - 五月 23, 2006 by yippee

0217 ACM user breakpoint called code

调试ACM CALLBACK经常出现user breakpoint called from code at 0×77fdjkf
停留在
7C921230   int         3
7C921231   ret

官方解释:
在调试程序中遇到提示“user breakpoint called from code at 0x……(地址)”时,这并不一定是因没用户设置了断点的关系,而是因为系统执行了一个硬编码断点操作(hard coded breakpoint instruction)。

例如在Windows NT下当正被调试的应用程序获得焦点时,如果F12键按下,则Windows NT调用一个类似于DebugBreak()函数的函数,这个被调用的函数执行一个hard coded breakpoint instruction,于是调试器捕捉到这个操作产生的例外,所以中断并给出上述的提示(User breakpoint called from code at <address>)或者是给出Break caused by hard coded breakpoint instruction.,在这样的情况下,只要让调试继续进行即可(按下F5键)。

值得注意的是当程序涉及到全局性的共享内存(对象)时,如CShareFile,这些对象维护着一个全局性的内存块,如果因为程序的疏忽对仍然锁定的对象(locked object)进行释放内存的话,则在NT下也会出现User breakpoint called from code at <address>这样的提示。

此外,在低版本的Visual C++调试器中,在不少地方(例如一些有关打印设备的操作)都用到GlobalLock,编程不当也会导致上述的提示出现,不过在win32中,很多这样的调用已经不再必要了。

希望这些信息能对您有所帮助,建议您检查一些是不是程序当中有一些涉及到释放全局性内存的操作。

有个人也是如此:
VCT3216.acm就在你的%System32%目录下。它是一个audio codec driver。但是它的调试版本中由于某种原因有异常行为。
你可以删除它。但是据Ed Eichman说并不解决问题。
也可以选择pass这个breakpoint对话框,但是你必须连续跳过这个对话框214次!J
我确实这么做过,连续按了214次F5,和214次确定,终于通过了地雷阵。J

Troubleshooting Common Problems with Applications: Debugging in the Real World
Mark Long Microsoft Corporation October 2000
Summary: Provides an introduction to debugging software. Focuses on quickly identifying common hard-failure scenarios. (16 printed pages)
Other Clues
When running under the debugger, you may sometimes get a message saying that a user breakpoint has been hit, and the breakpoint seems to be in a system function. This is normally a sign that something is not as it should be. Look at the following code fragment:
   void * lpMem = malloc(8192);
   free(lpMem);
   free(lpMem);

The second call to free is invalid and generates an INT 3 exception: user breakpoint hit. This exception is not normally fatal outside of the debugger but is a signal that you have a bug in your code. This can be more serious in a multithreaded environment. For example, the following code sometimes hangs:
#include <stdlib.h>
#include <process.h>
void threadfunc(void * pmem)
&leftsign;
   // Do something with pmem
   //…
   // Best free the memory now we\’ve finished with it.
   free(pmem);
&rightsign;

int main(int argc, char* argv[])
&leftsign;
   void * pmem = malloc(8192);
   // Start two worker threads:
   _beginthread( threadfunc, 0, (void *) pmem );
   // Clear up.
   free(pmem);
   return 0;
&rightsign;

On the subject of prevention, Asserts can save you many late nights and have no impact on the size or performance of your release builds. Ideally, each Assert should test only a single condition, since this makes it clear which condition failed. There really isn\’t any point in trying to save space or time by not using Asserts, since only debug builds ever contain the Assert code.

Bad Symbols or No Symbols
A problem with symbols is difficult. Fortunately, WinDbg will try to use the exports of any DLLs that it finds to try to give you some idea of where you are in the DLL. This can be misleading, however, and it is a good idea to look at the offset given from the start of the routine. If the value is very small, it probably is part of that routine. It is suspect if it is larger than 200 bytes or so. Larger offset generally indicates that you might be anywhere other than the stated function.

Bad symbols can be worse than no symbols, as you get misleading information rather than no information. WinDbg lets you work with mismatched symbols, but MSVC does not. You can take a chance on them, and you may find them tolerably accurate, but working with mismatched symbols isn\’t something to do if you may possibly be able to find good symbols.

标签:, , , ,
0217 acm msdn_codec acmMetrics HACMOBJ - 五月 22, 2006 by yippee

0217 acm msdn_codec acmMetrics HACMOBJ
 HACMDRIVER had = NULL;
 mmr = acmDriverOpen(&had, hadid, 0);
 if (mmr) &leftsign;
  printf("   "); show_error(mmr);
 &rightsign; else &leftsign;
  DWORD dwSize = 0;
  mmr = acmMetrics((HACMOBJ)had, ACM_METRIC_MAX_SIZE_FORMAT, &dwSize);
报告:
caps\\caps.cpp(74) : error C2664: \’acmMetrics\’ : cannot convert parameter 1 from \’struct HACMDRIVER__ *\’ to \’struct HACMOBJ__ *\’
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

看看原型:
MMRESULT acmMetrics(
  HACMOBJ hao,  
  UINT uMetric, 
  LPVOID pMetric
);
MMRESULT acmDriverOpen(
  LPHACMDRIVER phad, 
  HACMDRIVERID hadid,
  DWORD fdwOpen      
);

看看定义:
typedef struct HACMDRIVER__* HACMDRIVER
DECLARE_HANDLE(HACMDRIVER);
#define DECLARE_HANDLE(name) typedef HANDLE name

MSDN:mk:@MSITStore:Y:\\开发\\VisualStudio\\MSDN\\MSDN\\techart.chm::/html/msdn_codec.htm
Using CODECs to Compress Wave Audio
Nigel Thompson

April 4, 1997

Click to open or copy the files in the CODEC sample application for this technical article.

Abstract
Microsoft® Windows® 95 and Microsoft Windows NT® operating systems both include CODECs that can compress and decompress wave audio streams. Saving your wave audio data in compressed form can help with data storage requirements and reduce data transmission times when audio is sent over a network.

This article and its accompanying sample code shows how to compress wave audio packets using any of the CODECs installed on a Windows system. By altering the code very slightly it can also be used to decompress compressed data or perform data format conversions.

The sample code was developed using Microsoft Visual C++® version 5.0 and tested on the Windows 95 and Windows NT 4.0 operating systems.

Introduction
Windows 95 and, more recently, Windows NT both include the ability to handle compressed waveform audio and video data streams using installable CODECs.

A CODEC is a small piece of code used to COmpress or DECompress a data stream (hence CO-DEC). Most CODECs handle both compression and decompression. However, some CODECs are designed only to decompress so that proprietary data can be played on a system but the data format cannot be created on that system.

Although a CODEC can be used in principal to compress or decompress any stream of data, various CODECs have been designed to compress certain data types with either higher compression ratios, better fidelity, or real-time performance. For example, the best way to get a high degree of video data compression may not give adequate results when applied to audio data and vice versa.

This article focuses on how to use a CODEC from your own code to compress audio data into one of the formats supported by the CODECs on your system. The primary reason for compressing audio data is to reduce the volume of data required to store a sound sequence. Smaller data volumes mean that less disk space is occupied by the sounds and that they can be transmitted faster over a modem or network link. If the data is compressed into one of the common formats supported by Windows systems, it can be played back directly without the need to decompress it manually—the system will use its own CODECs to decompress the data for playback.

标签:, , ,
0210 SIP RTP CODEC jrtp G729 - 四月 28, 2006 by yippee

0210 SIP RTP CODEC jrtp G729

试图整合RTP和G.729编码部分

目前RTP数据传输OK
G.729通话OK,但是整合到一起就不行了

压缩后传输过去的数据是一致,但是接收方解压后的数据就不对了

原始数据
0012F06C  46464952  02F2E030  45564157  20746D66  00000010  00020001 
0012F084  0000AC44  0002B110  00100004  74636166  00000004  2074755B 
0012F09C  61746164  02F2E000  00000000  00000000  00000000  00000000

压缩数据
00610C28  A0C05EDC  64CDFA00  1D30AC45  A5309888  864720BC  40F2A060 
00610C40  58D50A40  12F9D467  1AF0923B  D445408F  9A378EF9  96C13A80 
00610C58  63F05602  4A40C07B  D60712C1  42FB4270  10CDAA01  0000D643
接收数据
0012F20C  A0C05EDC  64CDFA00  1D30AC45  A5309888  864720BC  40F2A060 
0012F224  58D50A40  12F9D467  1AF0923B  D445408F  9A378EF9  96C13A80 
0012F23C  63F05602  4A40C07B  D60712C1  42FB4270  10CDAA01  FDFDD643 

解压数据
0042FC20  00020002  00020002  00000000  00000000  FFFFFFFF  FFFFFFFF 
0042FC38  FFFFFFFF  00000000  00000000  00000000  00000000  00000000 
0042FC50  00000000  00000000  00000000  00000000  00000000  00000000 
0042FC68  00000000  00000000  00080026  0000FFFC  0003FFFA  00020026

CCodec::CCodec(void)
&leftsign;
 va_g729a_init_encoder();
 va_g729a_init_decoder();
&rightsign;
压缩
bool CCodec::EncodeAudioData(char * pin, int len , char* pout , int* lenr)
&leftsign;
 if(!pin&line;&line;len!=AUDIO_BUFFER_SIZE&line;&line;!pout)
  retrun false;
 va_g729a_encoder((short*)pin,(BYTE*)pout);
 va_g729a_encoder((short*)(pin+160),(BYTE*)pout+10);
 va_g729a_encoder((short*)(pin+320),(BYTE*)pout+20);
 va_g729a_encoder((short*)(pin+480),(BYTE*)pout+30);
 va_g729a_encoder((short*)(pin+640),(BYTE*)pout+40);
 va_g729a_encoder((short*)(pin+800),(BYTE*)pout+50);
 if(lenr)
  *lenr=CODEC_DATA_SIZE;
         retrun true;
&rightsign;

解压
bool CCodec::DecodeAudioData(char * pin, int len , char* pout )
&leftsign;
 if(!pin&line;&line;len!=CODEC_DATA_SIZE&line;&line;!pout)
  return false;
 va_g729a_decoder((BYTE*)pin,(short*)(pout),0);
 va_g729a_decoder((BYTE*)pin+10,(short*)(pout+160),0);
 va_g729a_decoder((BYTE*)pin+20,(short*)(pout+320),0);
 va_g729a_decoder((BYTE*)pin+30,(short*)(pout+480),0);
 va_g729a_decoder((BYTE*)pin+40,(short*)(pout+640),0);
 va_g729a_decoder((BYTE*)pin+50,(short*)(pout+800),0);
 return true;
&rightsign;
压缩前包为960 压缩后为60

标签:, , ,