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 586 posted 14 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 637 posted 14 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 621 posted 14 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 1263 posted 14 years ago by jimfred
1 636 posted 14 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 706 posted 14 years ago by rengber
Useful for SBApplication scripting bridge.
0 865 posted 14 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 1085 posted 14 years ago by jasonseney
Here are some example string formats. As I discover more I will add them here.
6 698 posted 14 years ago by stewshack
This is how I read a file using C#.
3 704 posted 14 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 970 posted 14 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 2414 posted 14 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 874 posted 14 years ago by rengber
1 1329 posted 14 years ago by Unsafe
This is stupidly simple, but I always forget it.
1 701 posted 14 years ago by rengber
0 427 posted 14 years ago by edgsv
/** * @brief 给定n个整数,求一个最小的数,使得它们除以这个数的余数不重复 * @author soulmachine * @param[in] numbers 整数数组 * @param[in] count 整数个数 * @param[in] max_norm 模的最大值 * @return...
0 854 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 4109 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 546 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 1964 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 696 posted 15 years ago by jimfred
usage: SomeDropDownList.Set("Some String Value");
1 690 posted 15 years ago by naspinski
Código para proyecto de Arquitectura y Organización de Computadores con C++ y lenguaje ensamblador.
0 469 posted 15 years ago by bedomax
This uses the concatenation operator "##" to insert a comment "//"
0 2326 posted 15 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 1053 posted 15 years ago by jimfred
Código en C con Ensamblador para GCC
0 586 posted 15 years ago by bedomax