Welcome To Snipplr


Everyone's Recent Snippets Tagged c



Useful in cases where the object author has specified their own serialization that doesn't work for you.
1 23 posted 10 years ago by rengber
Definitely falls into the category of "simple thing I shoulda memorized years ago", but whatever:
0 21 posted 10 years ago by rengber
*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 14 posted 10 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 19 posted 10 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 18 posted 10 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 34 posted 10 years ago by jimfred
1 13 posted 10 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 13 posted 10 years ago by rengber
Useful for SBApplication scripting bridge.
0 33 posted 10 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 49 posted 10 years ago by jasonseney
Here are some example string formats. As I discover more I will add them here.
6 31 posted 10 years ago by stewshack
This is how I read a file using C#.
3 21 posted 10 years ago by stewshack
3 13 posted 10 years ago by rtipton
## 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 34 posted 10 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 84 posted 10 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 21 posted 10 years ago by rengber
1 37 posted 10 years ago by Unsafe
This is stupidly simple, but I always forget it.
1 23 posted 10 years ago by rengber
0 9 posted 10 years ago by edgsv
/** * @brief 给定n个整数,求一个最小的数,使得它们除以这个数的余数不重复 * @author soulmachine * @param[in] numbers 整数数组 * @param[in] count 整数个数 * @param[in] max_norm 模的最大值 * @return...
0 12 posted 11 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 99 posted 11 years ago by jasonseney
Example uses an object from 3rd party API. Needed to turn it into xml for returning from a webservice.
0 12 posted 11 years ago by jasonseney
0 12 posted 11 years ago by woofeR
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 103 posted 11 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 14 posted 11 years ago by jimfred