Welcome To Snipplr


Everyone's Recent Snippets Tagged c



*save as proxy.asxh and put it in your IIS virtual directory *consider using other methods to circumvent XSS: JSONP, dojox.io.xhrWindowNamePlugin, etc.
0 783 posted 15 years ago by stoyan
*IE7 sometimes complains that a JavaScript script is running too slow and asks the user whether they want to terminate it or continue. *To get rid of this annoying popup a few changes need to be made to the registry. *ref: http://www.itwriting.com...
0 869 posted 15 years ago by stoyan
Use this to quickly clean-up a file which has opening braces on a new line, a particular annoyance of mine.
1 825 posted 15 years ago by Zenithus
Displaying values as hex in a PropertyGrid by using a TypeConverter class. The TypeConverter class is assigned as a property to the PropertyGrid's data element. Consider improving by making the UInt32HexTypeConverter a generic/template as in HexTy...
0 1607 posted 15 years ago by jimfred
1 891 posted 15 years ago by njhamann
Stupidly simple -- just one pitfall: class to be bound must have Get/Set methods for reflection to discover. Which is annoying when it comes to client side classes auto generated from WSDL.
0 945 posted 15 years ago by rengber
Useful for SBApplication scripting bridge.
0 1124 posted 15 years ago by iloveitaly
Basic example of calling a web service from code using GET. You can pass parameters in as query vars. Assumes return type of service is "String". Example return xml: <?xml> <string>US</string> @SNIPPLR TEAM: Please let me put xml at...
3 1361 posted 15 years ago by jasonseney
Here are some example string formats. As I discover more I will add them here.
6 930 posted 15 years ago by stewshack
This is how I read a file using C#.
3 899 posted 15 years ago by stewshack
## Markup ## _Using square [ ] brackets for compatibility with Snipplr comment form_ [asp:PlaceHolder ID="StuffHolder" runat="server" ] <p>Some stuff in here</p> [/asp:PlaceHolder] ## Code Behind ## HtmlAttr[] attribu...
1 1268 posted 15 years ago by jasonseney
This OnSize function resizes one large control in a dialog. The one control grows horizontally and vertically to fill the dialog. It's position remains unchanged. Other controls (buttons etc) would typically be above the one resizable control.
0 2836 posted 15 years ago by jimfred
Say that you have a collection of objects empty but for IDs. You want to do a foreach loop through those objects and lookup detail one at a time. Unfortunately, in the foreach, you can't replace the references, you can only copy the new detail...
1 1124 posted 15 years ago by rengber
1 1610 posted 15 years ago by Unsafe
This is stupidly simple, but I always forget it.
1 945 posted 15 years ago by rengber
0 591 posted 15 years ago by edgsv
/** * @brief 给定n个整数,求一个最小的数,使得它们除以这个数的余数不重复 * @author soulmachine * @param[in] numbers 整数数组 * @param[in] count 整数个数 * @param[in] max_norm 模的最大值 * @return...
0 1006 posted 15 years ago by soulmachine
Will return a string that has any matched URLs wrapped in `<a>` tags. Example: `"This is a link to http://foobar.com . Please visit !"` Becomes: `"This is a link to <a href='http://foobar.com'>http://foobar.com</a> . Please visit!"` Note: Op...
2 4689 posted 15 years ago by jasonseney
Example uses an object from 3rd party API. Needed to turn it into xml for returning from a webservice.
0 730 posted 15 years ago by jasonseney
Specifically, this code enables you to pass a string from C# into C++ managed code and then get a C++ pointer to the string's chars. [Marshal.StringToHGlobalAnsi Method](http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marsha...
0 2691 posted 15 years ago by pckujawa
Sometimes I want a complete path to a file in the current working directory to make error messages clearer. The URL has alternate approaches.
0 968 posted 15 years ago by jimfred
usage: SomeDropDownList.Set("Some String Value");
1 951 posted 15 years ago by naspinski
Código para proyecto de Arquitectura y Organización de Computadores con C++ y lenguaje ensamblador.
0 665 posted 16 years ago by bedomax
This uses the concatenation operator "##" to insert a comment "//"
0 4536 posted 16 years ago by jimfred
This function provides C# with functionality similar to the apparently deprecated my.Computer.FileSystem.FindInFiles under the Microsoft.VisualBasic namespace. Example usage: IEnumerable<string> oemFiles = FindInFiles(...
1 1325 posted 16 years ago by jimfred
Código en C con Ensamblador para GCC
0 810 posted 16 years ago by bedomax