input
stringlengths
51
42.3k
output
stringlengths
18
55k
Image loop only returns one image but should return them all <pre><code>function all_images(&amp;$post){ $content = $post-&gt;post_content; if(preg_match_all('/&lt;img[^&gt;]+src="(.*?)"[^&gt;]*&gt;/', $content, $results)){ $i = 0; $count = count($results); $count = $count - 1; while($i &lt; $count) { foreach($r...
<p>$results[1] should be an array of all the matches on the first parenthesized subpattern, so something as simple as this should work:</p> <pre><code>if(preg_match_all('/&lt;img[^&gt;]+src="(.*?)"[^&gt;]*&gt;/i', $content, $results)){ foreach($results[1] as $src) { echo "src is $src&lt;br&gt;"; } ...
How do I correct the error for this program to execute? <p>I have tried everything, this is my first C++ program and it not coming out right. I am receiving two error message. <code>error7:1 warning: character constan too long for its type.</code> and <code>7:error: expe</code></p> <pre><code>//My first C++ program #i...
<p>Your code should be fixed like so:</p> <pre><code>#include &lt;iostream&gt; int main() { std::cout &lt;&lt; "I will get it" &lt;&lt; std::endl; std::cout &lt;&lt; "I hope so" &lt;&lt; std::endl; return 0; } </code></pre>
set a default page in dynamic data <p>i am trying to set up a default page for my dynamic data website.. the problem is that its a template </p> <p>so it would be something like this: Orders/List.aspx</p> <p>can anyone please help me out with this..</p> <p>Thanx</p> <p>Owais F</p>
<p>You can create a Default.aspx page outside of your DynamicData folder as the default and just have that page redirect to the Orders/List.aspx page.</p> <pre><code>protected void Page_Init(object sender, EventArgs e) { Response.Redirect("Orders/List.aspx"); } </code></pre>
What is the opposite of Type.MakeByRefType <p>The <a href="http://msdn.microsoft.com/en-us/library/system.type.makebyreftype.aspx" rel="nofollow"><code>Type.MakeByRefType</code></a> method in .NET returns a by-ref version of a type, e.g. passing the type of <code>System.Int32</code> returns a type representing <code>Sy...
<p>According to the docs for <code>IsByRef</code>, you can use <a href="http://msdn.microsoft.com/en-us/library/system.type.getelementtype.aspx">Type.GetElementType</a>. I don't have time to try this at the minute though...</p>
Databinding a Custom Control <p>I have a Custom Control (Windows Form) that is a lookup text box. A property on the Control is Current Selection which is a Custom Object containing "Identifier", "Code" and "Description". This property is Databound using a BindingSource.</p> <p>Displaying the information works great. O...
<p>Implementing INotifyPropertyChanged seems to be the solution!</p> <pre><code> #region IPropertyChanged public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName) { OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); ...
SQL Base32 Conversion <p>I am writing a SQL Function that will take in a decimal and return the base32 representation of that decimal.</p> <p>My problem is with the decimal to ascii conversion. </p> <p>I am allowed to run the following query and return an ascii character</p> <p>"SELECT CHAR( 65 )" which returns "A"<...
<p>How are you declaring @OutputChar?</p> <p>If you have:</p> <pre><code>DECLARE @OutputChar CHAR(255) </code></pre> <p>then every time you concantenate, it will truncate it to 255. CHAR includes the whitespace at the end, maybe you mean to use varchar instead of CHAR?</p>
Resources for designing .dll structure <p>I just came out of a design meeting and had a question posed to me about where I got one of my ideas about how to structure some .dlls of a project we are building. To be honest I have no idea where this "idea" came from it just seemed like natural knowledge to me. However it w...
<p>If you have a chance, have a look at the book by Robert C. Martin:</p> <p><a href="http://search.barnesandnoble.com/Agile-Principles-Patterns-and-Practices-in-C/Martin-Robert-Martin-Micah-Martin-Robert-Martin-Micah/e/9780131857254" rel="nofollow">Agile Principles, Patterns, and Practices in C#</a> (This is the new ...
How do I get the type object of a genericized Enum? eg: EnumSet.noneOf(<huh?>) <p>I have a generic type that is parameterized on some Enum, declared like this:</p> <pre><code>public class FlagsField&lt;T extends Enum&lt;T&gt;&gt; { private EnumSet&lt;T&gt; _flagSet; public FlagsField() { _flagSet = E...
<p>You've run into <a href="http://java.sun.com/docs/books/tutorial/java/generics/erasure.html" rel="nofollow">type erasure</a>. Your constructor is going to need to look like:</p> <pre><code>public FlagsField(Class&lt;T&gt; enumClass) { _flagSet = EnumSet.&lt;T&gt;noneOf(enumClass); } </code></pre>
Nhibernate: Make Many-To-Many Relationship to Map as One-To-One <p>I have two items A and B, which have a uni directional one-to-one relationship. (A has one B)</p> <p>In the database these are represented by ATable and BTable, and they are linked together by ABTable. (From the database setup it appears there is a m...
<p>Are you sure you mean a one-to-one? I've had so many people ask for one-to-one's when they <a href="http://blog.jagregory.com/2009/01/27/i-think-you-mean-a-many-to-one-sir/" rel="nofollow">really mean many-to-one's</a>.</p> <p>Anyway, short of changing your schema, the easiest thing is what you suggested; however, ...
Problem installing OpenID on ASP.NET MVC Site <p>I am trying to install openID into my web site project that is using ASP.NET MVC, specifically with Yahoo</p> <p>Yahoo keeps giving me this : <strong>"Warning: This website has not confirmed its identity with Yahoo! and might be fraudulent. Do not share any personal inf...
<p>Check that your openid.return_to parameter is found in your YADIS/XRDS document, including matching capitalization.</p>
WPF: How do I set the Owner Window of a Dialog shown by a UserControl? <p>I've got a WPF application with these three types of things...</p> <ul> <li>WindowMain</li> <li>UserControlZack</li> <li>WindowModal</li> </ul> <p>UserControlZack1 sits on my WindowMain...</p> <pre><code>&lt;Window x:Class="WindowMain" ...
<p>Try to use </p> <pre><code>.Owner = Window.GetWindow(this) </code></pre>
Group by like row filtering <p>Lets say I have a table describing cars with make, model, year and some other columns.</p> <p>From that, I would like to get one full row of each make and model for latest year.</p> <p>Or to put it in another way. Each row would have unique combination of make and model with other data ...
<p>MySQL solution:</p> <pre><code>SELECT * FROM cars GROUP NY CONCAT(make, "-", model) ORDER BY year DESC; </code></pre>
How Do You Pass a Message From One Program To Another? <p>I have a .Net 3.0 application that needs to pass an integer to another program on the same machine. I was using a WCF service to do this, but ran into user rights issues when trying HOSTING the service on the local box. Any thoughts on how to accomplish this w...
<p>WCF is still the way to go here.</p> <p>Generally, for inter-process communication on the same machine, you would use the named pipe channel. If you are not using this, I suggest you do and then determine what the error in hosting is.</p> <p>If both programs have message loops that are being processed, and you ar...
Please Critique my PHP authentication efforts <p>After posting <a href="http://stackoverflow.com/questions/443988/simple-authorisation-login-capability-in-php">this</a> a while back, I decided to create my own Registration / Authentication capability in PHP. I'd love anyone to point out the flaws / opportunities for i...
<ol> <li><p>Why 6 characters? Make it bigger and require a minimum of 6 (or more) characters. There is no excuse for limiting the number of characters in the password to 6.</p></li> <li><p>Put more than the user name in the session. But to do this safely, you must change the salt every login:</p></li> </ol> <p>A- From...
How to change the star images of the RatingBar? <p>With <code>Android SDK 1.1 r1</code>, is there any way to change the <code>RatingBar</code> widget class's star image with my own? Is this possible at all? If so, then how? </p> <p>Thanks.</p>
<p>Not sure about 1.1, but with 1.6 and later you can just extend <code>Widget.RatingBar</code> style and override the properties that are responsible for star drawables (in <code>values/styles.xml</code>):</p> <pre><code> &lt;style name="myRatingBar" parent="@android:style/Widget.RatingBar"&gt; &lt;item name=...
Is it bad practice to run tests on a DB instead of on fake repositories? <p>I know what the advantages are and i use fake data when i am working with more complex systems.</p> <p>What if I am developing something simple and I can easily set up my environment in a real DB and the data being accessed is so small that th...
<p>The reasons to use fake data instead of a real DB are:</p> <ol> <li>Speed. If your tests are slow you aren't going to run them. Mocking the DB can make your tests run much faster than they otherwise might.</li> <li>Control. Your tests need to be the sole source of your test data. When you use fake data, your te...
How to read an INI file in ruby <p>How do I read/write an ini file in ruby. I have an ini file that I need to</p> <ol> <li>read</li> <li>change an entry</li> <li>write out to a different location</li> </ol> <p>How would I do that in ruby? The documentation on this is bleak.</p>
<p>I recently used <a href="http://rubygems.org/gems/inifile" rel="nofollow">ruby-inifile</a>. Maybe it's overkill compared to the simple snippets here...</p>
Windows shell command to get the full path to current directory? <p>Is there a Windows command line command that I can use to get the full path to current working directory? Also, how can I store this path inside a variable used in a batch file?</p>
<p>Use <code>cd</code> with no arguments if you're using the shell directly, or <code>%cd%</code> if you want to use it in batch file (behaves like environment var).</p>
Python parsing <p>I'm trying to parse the title tag in an RSS 2.0 feed into three different variables for each entry in that feed. Using ElementTree I've already parsed the RSS so that I can print each title [minus the trailing <code>)</code>] with the code below:</p> <blockquote> <pre><code>feed = getfeed("http://ww...
<p>Don't let regex scare you off... it's well worth learning.</p> <p>Given the examples above, you might try putting the trailing parenthesis back in, and then using this pattern:</p> <pre><code>import re pat = re.compile('([\w\s]+)\(([\w\s]+)(\d+/\d+)\)') info = pat.match(s) print info.groups() ('Michael Schenker G...
Nameless enums in templates <p>Alot templated code looks like this:</p> <pre><code>template &lt;typename T&gt; class foo { enum { value = &lt;some expr with T&gt; }; }; </code></pre> <p>An example can be seen <a href="http://zwabel.wordpress.com/2008/12/18/c-template-support-in-kdevelop4-another-milestone/" rel="n...
<p>A static const variable would take up memory (like Sean said), whereas enums do not take any memory. They only exist in the compiler's world. At runtime they are just regular integers.</p> <p>Other than that it would work, except for bad implementation of the standard by the compiler.</p> <p>There is a thorough <a...
IHierarchicalDataSource, Hierarchy structure, ASP.NET <p>I am building a hierarchy structure from scratch and I am trying to determine the best route to take. I found the following link below from another StackOverflow question:</p> <p><a href="http://www.intelligententerprise.com/001020/celko.jhtml" rel="nofollow">N...
<p>SQL 2005 added support for recursive queries. I'm using a recursive query to return a tree of data that populates a TreeView. For each record, I find the matching parent node from the TreeView and add its new child.</p> <p>For updates you could serialize the tree to XML, then use the XML features in sql 2005 to r...
Use windows authentication with ASP.Net AJAX <p>I'm working on my first application using ASP.Net with web services and I'm having an authentication issue. At least I think that's the issue.</p> <p>When I run the application locally in debug mode it works fine. It even works when I run it out of debug mode (through II...
<p>Ensure IE is correctly identifying the zone as the Intranet so it will automatically send the username for it. If its not, you'll need to manually add the URL to the Intranet Zone in the IE settings. </p> <p>That should resolve it, and depending on your config you may need to add to your web.config </p> <p>What is...
How do I enumerate JvMemoryData...Or, how do I create a hash with a single key and multiple values? <p>I am using <a href="http://sourceforge.net/projects/jvcl" rel="nofollow">JvMemoryData</a> to populate a JvDBUltimGrid. I'm primarily using this JvMemoryData as a data structure, because I am not aware of anything else...
<p>One way would be to create a TStringList, and have each item's object point to another TList (or TStringList) which would contain all of your values. If the topmost string list is sorted, then retrieval is just a binary search away.</p> <p>To add items to your topmost list, use something like the following (SList ...
Use of Haskell state monad a code smell? <p>God I hate the term "code smell", but I can't think of anything more accurate.</p> <p>I'm designing a high-level language &amp; compiler to <a href="http://compsoc.dur.ac.uk/whitespace/">Whitespace</a> in my spare time to learn about compiler construction, language design, a...
<p>I've written multiple compilers in Haskell, and a state monad is a reasonable solution to many compiler problems. But you want to keep it abstract---don't make it obvious you're using a monad.</p> <p>Here's an example from the Glasgow Haskell Compiler (which I did <em>not</em> write; I just work around a few edges...
PHP&MySQL: Is it possible after running mysql_query with an insert to get the ID of the new row? <p>Is there a straightforward way to run mysql_query with an insert and get the ID of the new row, for example in the return? Or will I have to do another query with select to check it?</p>
<p>mysql_insert_id()</p> <p>or</p> <p>select last_insert_id()</p>
Best way of Multithreading <p>I have a college assignment due quite soon, and I need to be able to call a C++ dll that takes a long time (possibly infinte, it relies on user input)to execute. Im calling this through VB. My VB GUI freezes up when this happens, and I would like to keep the GUI responsive, so that the use...
<p>The best way to handle threading in VB.NET is via the <a href="http://msdn.microsoft.com/en-us/library/system.threading.aspx" rel="nofollow">System.Threading</a> namespace.</p> <p>You might also look into <strong>Application.DoEvents()</strong></p>
How do I create tables with sections and headers in ASP.NET? <p>I have some data that must be presented in tabular form with multiple sections. In particular, Each section of data is broken up (with it's own headers) by day. This is basically a one-off single page deal, and won't really be maintained, so I don't want...
<p>Have a look at asp:table. You can programmaticaly add the rows and columns in some nested conditional iterations in code.</p>
Is it possible to deserialize XML into List<T>? <p>Given the following XML:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;user_list&gt; &lt;user&gt; &lt;id&gt;1&lt;/id&gt; &lt;name&gt;Joe&lt;/name&gt; &lt;/user&gt; &lt;user&gt; &lt;id&gt;2&lt;/id&gt; &lt;name&gt;John&lt;/name&gt; &...
<p>You can <em>encapsulate</em> the list trivially:</p> <pre><code>using System; using System.Collections.Generic; using System.Xml.Serialization; [XmlRoot("user_list")] public class UserList { public UserList() {Items = new List&lt;User&gt;();} [XmlElement("user")] public List&lt;User&gt; Items {get;set;...
Forms Authentication across Sub-Domains <p>Is it possible to authenticate users across sub-domains when the authentication takes place at a sub-domain instead of the parent domain? </p> <p>For example:</p> <p>User logs into site1.parent.com, and then we need to send them to reporting.parent.com.</p> <p>Can I authent...
<p>When you authenticate the user, set the authentication cookie's domain to the second-level domain, i.e. parent.com. Each sub-domain will receive the parent domain's cookies on request, so authentication over each is possible since you will have a shared authentication cookie to work with.</p> <p>Authentication cod...
Pros/Cons of Binary Reference VS WCF <p>I am in the process of implementing an enhancement to an existing web application(A). The new solution will provide features(charts/images/data) to the application A. The new enhancement will be a new project and will generate new assemblies. I am trying to identify what would be...
<p>If you decouple the two pieces sufficiently, you will also permit the use of clients running something other than .NET. Using the first option, you could only support .NET clients. This may turn out to be important, even if today you are absolutely certain that only .NET will ever be used - tomorrow, your company ma...
replace urls <p>I have a huge txt file and Editpad Pro list of urls with images on the root folder. </p> <pre><code>http://www.othersite.com/image01.jpg http://www.mysite.com/image01.jpg http://www.mysite.com/category/image01.jpg </code></pre> <p>How can I change only that ones that has images on the root using regex...
<p><strong>Search and replace</strong> (case insensitive, regular expression):</p> <pre><code>http://www\.mysite\.com/([^/]*\.(?:jpg|gif|png)) </code></pre> <p>with:</p> <pre><code>http://www\.NEW_WEBSITE\.com/\1 </code></pre> <hr> <p><strong>EDIT</strong></p> <p>And yes, this will also re-base files such as <cod...
C++ string memory management <p>Last week I wrote a few lines of code in C# to fire up a large text file (300,000 lines) into a Dictionary. It took ten minutes to write and it executed in less than a second. </p> <p>Now I'm converting that piece of code into C++ (because I need it in an old C++ COM object). I've spent...
<p>This sounds very much like the Raymond Chen vs Rico Mariani's C++ vs C# Chinese/English dictionary performance bake off. It took Raymond several iterations to beat C#.</p> <p>Perhaps there are ideas there that would help.</p> <p><a href="http://blogs.msdn.com/ricom/archive/2005/05/10/performance-quiz-6-chinese-e...
finding the type of an element using jQuery <p>In jQuery, if I have a reference to an element, how can I determine what kind of element it is, for example, an input or an dropdown? Is there any way to find out?</p> <p>Duplicate:</p> <p><a href="http://stackoverflow.com/questions/341900/how-can-i-determine-the-elemen...
<p>The following will return true if the element is an input:</p> <pre><code>$("#elementId").is("input") </code></pre> <p>or you can use the following to get the name of the tag:</p> <pre><code>$("#elementId").get(0).tagName </code></pre>
Calling another controller action after the current controller action has finished executing <p>What I am trying to achieve:</p> <ol> <li><p>After <strong>each</strong> view has finished executing I would like to make a separate http call to an external partner.</p></li> <li><p>I need to pass one of the view's content...
<p>This will call a second controller action from the first controller action within the same controller:</p> <pre><code> public ActionResult FirstAction() { // Do FirstAction stuff here. return this.SecondAction(ArgumentsIfAny); } public ActionResult SecondAction() { // Do ...
Using scandir() to find folders in a directory (PHP) <p>I am using this peice of code:</p> <pre><code>$target = 'extracted/' . $name[0]; $scan = scandir($target); </code></pre> <p>To scan the directory of a folder which is used for zip uploads. I want to be able to find all the folders inside my <code>$target</code...
<p>To determine whether or not you have a folder or file use the functions <code>is_dir()</code> and <code>is_file()</code></p> <p>For example:</p> <pre> $path = 'extracted/' . $name[0]; $results = scandir($path); foreach ($results as $result) { if ($result === '.' or $result === '..') continue; if (is_dir(...
Best way to stream files in ASP.NET <p>What's the best way to stream files using ASP.NET?</p> <p>There appear to be various methods for this, and I'm currently using the <a href="http://msdn.microsoft.com/en-us/library/12s31dhy(v=vs.110).aspx" rel="nofollow">Response.TransmitFile()</a> method inside an http handler, w...
<p>I would take things outside of the "aspx" pipeline. In particular, I would write a ran handler (ashx, or mapped via config), that does the <em>minimum</em> work, and simply writes to the response in chunks. The handler would accept input from the query-string/form as normal, locate the object to stream, and stream t...
Coding guides: How do you split up your large source files? <p>The project I'm working on has just hit 4200 lines in the main C# file, which is causing Intellisense to take a few seconds (sometimes up to 6 or so) to respond, during which Visual Studio locks up. I'm wondering how everyone else splits their files and wh...
<p>I think your problem is summed up with the term you use: "Main C# file".</p> <p>Unless you mean main (as in the method main()) there is no place for that concept. </p> <p>If you have a catch-all utility class or other common methods you should break them into similar functional parts.</p> <p>Typically my files a...
Very simple web page won't display on IE but will on everything else <p>I have just started making web pages and I'm having lots of trouble with this very simple web page. I can't make anything appear on IE but it works fine on everyother browser. I'll take the liberty of putting all the code in my question because it ...
<p>For future reference: <a href="http://validator.w3.org/#validate_by_input" rel="nofollow">http://validator.w3.org/#validate_by_input</a> Use it for resolving html issues.</p>
Displaying MySQL tables as ASCII in blog posts <p>I would like to quickly display MySQL recordsets in blog posts, using a similar ASCII layout to that used by mysql.com in their help pages. I'm using wordpress v2.7. Any ideas? I should also add that I'm using wp-syntax for syntax highlighting, so it's really just gener...
<p>If you mean things like</p> <pre> +----+------+ | id | name | +----+------+ | 1 | Bob | | 2 | Mary | | 3 | Jane | | 4 | Lisa | +----+------+ </pre> <p>then just running the query from the MySQL commandline should suffice, as the results are formatted when running queries in interactive mode on the commandline...
Planning for parallelism <p>If you plan to write a very computationally intensive parallel application, what guidelines would you use to design your objects (whether classes or structs, or anything else) to maximize your potential of getting the most out of the parallelism.</p> <p>I am thinking of an application that ...
<p>If you can get away with using a lot of immutable data structures, that will save you a lot of time, typing, and headache.</p>
Monitoring user idle time <p>Developing a mac app, how can I tell whether the user is currently at their computer or not? Or how long ago they last pressed a key or moved the mouse?</p>
<p>it turns out the answer was here</p> <p><a href="http://osdir.com/ml/python.pyobjc.devel/2006-09/msg00013.html" rel="nofollow">http://osdir.com/ml/python.pyobjc.devel/2006-09/msg00013.html</a></p>
How do I use jQuery's form.serialize but exclude empty fields <p>I have a search form with a number of text inputs &amp; drop downs that submits via a GET. I'd like to have a cleaner search url by removing the empty fields from the querystring when a search is performed.</p> <pre><code>var form = $("form"); var seri...
<p>I've been looking over the <a href="http://docs.jquery.com/">jQuery docs</a> and I think we can do this in one line using <a href="http://docs.jquery.com/Selectors">selectors</a>:</p> <pre><code>$("#myForm :input[value!='']").serialize() // does the job! </code></pre> <p>Obviously #myForm gets the element with id ...
Is there a way to exclude large files or certain file types from an SVN update? <p>Just wondering if its possible to exclude large files or certian file types from an SVN update?</p> <p>I ask because I am doing a checkout from home, but we have got several large .flv files in trunk which I do not need at this time and...
<p>Use Subversion 1.5 on your client and make use of <a href="http://subversion.tigris.org/svn%5F1.5%5Freleasenotes.html#sparse-checkouts" rel="nofollow">Sparse Checkouts</a>. This will only work if you can ensure all of the large files are in the same place.</p>
Building a large form, need advice <p>I have to build a large form for users to fill out in order to apply for graduate study at the college I work for. There will be a large amount of information to collect (multiple addresses, personal information, business information, past school information, experience, etc...) an...
<p>You need to use multiple pages, and you need to include a mechanism whereby users can leave, and come back and fill out the rest of the form later (or if they're accidentally disconnected). Otherwise you're going to have all sorts of user issues, not due to your service, but because they're using computers and inte...
gsoap - WS-Addressing elements in the SOAP Header <p>I need to add WS Addressing in my Soap header (I am using the gsoap framework). Is there a way to add that automatically? I looked up gsoap documentation but didnt find any info on that. So right now I have manually added the WS-Addressing to my SOAP_ENV_Header as sh...
<p>You can define the SOAP_ENV_Header in your typemap.dat like so:</p> <pre><code>wsa = &lt;http://schemas.xmlsoap.org/ws/2004/08/addressing&gt; SOAP_ENV__Header =\ #import "wsa.h"\n\ struct SOAP_ENV__Header\n\ {\n\ mustUnderstand _wsa__MessageID wsa__MessageID 0;\n\ mustUnderstand _wsa__RelatesTo * wsa__Re...
How does unit testing work when the program doesn't lend itself to a functional style? <p>I'm thinking of the case where the program doesn't really compute anything, it just DOES a lot. Unit testing makes sense to me when you're writing functions which calculate something and you need to check the result, but what if y...
<p>I'm not an expert on this but have been confused for a while for the same reason. Somehow the applications I'm doing just don't fit to the examples given for UNIT testing (very asynchronous and random depending on heavy user interaction) I realized recently (and please let me know if I'm wrong) that it doesn't make ...
How to use global caching in php? <p>ello all im new to php and server scripting ( coming from the java/cpp background ) my question is , if i like to be able to build some kind of single tone cache that will hold me data in memory in all the web application life , something that when i start the web server it will st...
<p>For this in PHP you need <a href="http://au2.php.net/apc" rel="nofollow">APC</a>, which comes pretty much as standard with PHP these days (and will be standard as of PHP 6)--all you have to do is enable it in the config--or <a href="http://www.danga.com/memcached/" rel="nofollow">memcached</a>, particularly if you'v...
How can I stop IDLE from printing giant lists? <p>Sometimes I'll be working with, say, a list of thousands of items in IDLE, and accidently print it out to the shell. When this happens, it crashes or at least very significaly slows down IDLE. As you can imagine, this is extremely inconvenient. Is there a way to make it...
<p>As above, try a custom print function like:</p> <pre><code>def my_print(obj): if hasattr(obj, '__len__') and len(obj) &gt; 100: print '... omitted object of %s with length %d ...' % (type(obj), len(obj)) else: print obj </code></pre>
Displaying Hebrew text in ASP <p>I am working on ASP application that reads data from sql server and displays it in a table. All my Hebrew text is replaced with "?????". </p> <p>I installed and Configured Hebrew Font in Regional options. I have set the appropriate Charset in Head,Meta tag I am able to see proper Hebre...
<p>Make sure the column is set to store Unicode. For example, <code>nvarchar</code> instead of <code>varchar</code>, or <code>ntext</code> instead of <code>text</code>.</p>
Access Violation <p>Greetings everyone, going to need some help in clearing this exception.</p> <p>I get the following when debugging my compiled program in Microsoft Visual C++ 6.0:</p> <pre><code>Loaded 'ntdll.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbo...
<p>a = S_order [i];<br /> b = S_order [i + 1];<br /> distance += CityArray [a][b]; &lt;--- This looks suspicious. When i = 14, b = 15...clearly outside the range... my 2 cents</p>
How to ensure buttons reversed by CSS are spaced evenly? <p>I have a wizard-style HTML form with a row of submit buttons for the Back/Next/Cancel actions (in that order). The form can also contain a varying number of input fields, such as text fields, radio buttons, checkboxes, dropdowns (select tags), and textareas. T...
<p>Have you considered using <a href="http://tapestryjava.blogspot.com/2005/06/html-form-trick.html" rel="nofollow">this trick</a>? Basically you just have a hidden button appear first which does the desired action.</p>
Search and replace text contents of a tag <p>I am trying to specifically to pad out the /'s in an a tag's text.</p> <pre><code>1234/1234/ABCDE =&gt; 1234 / 1234 / ABCDE </code></pre> <p>In context; if I have an a tag:</p> <pre><code>&lt;a href="http://www.domain.com/path/to/page.html"&gt;12 34/1234A/BC DEFG&lt;/a&gt...
<p>This isn't really the kind of thing regular expressions are good at doing. You'll probably be better off using an HTML or XML parser - it creates a tree of nodes out of the document, and then you can just step through all the text nodes that are inside of tags and add spaces as needed.</p>
Download textarea contents as a file using only Javascript (no server-side) <p>I am being asked to make a "download" button that downloads the contents of a textarea on the same page as a file, with the browser's "Save As..." dialog showing up. Copy/paste would do the job just fine, but it is a "requirement".</p> <p>R...
<p>This may be what you are looking for: <a href="http://thiscouldbebetter.wordpress.com/2012/12/18/loading-editing-and-saving-a-text-file-in-html5-using-javascrip/">http://thiscouldbebetter.wordpress.com/2012/12/18/loading-editing-and-saving-a-text-file-in-html5-using-javascrip/</a></p> <p>It uses the browser's downl...
Object Oriented Analysis and Design <p>Why I can't able to specify static type of methods in interface.</p> <p>Is there any alternative to do this??</p> <p>but I should use only inerface insted of abstract class.</p> <p>/</p> <p>Is there any problem in specifing acess specifier in interface? </p> <p>I want to spec...
<p>I don't know what language you're taking about but I'll answer as if in C#.</p> <p>Why I can't able to specify static type of methods in interface. Is there any alternative to do this??</p> <p>It is because you can't override static methods. What are you trying to achieve?</p> <p>Members in interfaces are always ...
getting System.ServiceModel.AddressAccessDeniedException on Vista for WCF service <p>We have an application that starts a WCF server and the app reads from it.</p> <p>It starts and can be read fine on all Windows XP machines.</p> <p>On our Vista machine, however, we get:</p> <pre><code>System.ServiceModel.AddressAcc...
<p>I had a similar issue with Windows 7 running Visual Studio 2010. My solution was a simple WCF service library with a simple console project serving as the WCF service host.</p> <p>My base address in app.config was "http://localhost:8080/BookService" and I forgot that I had to start Visual Studio as an administrator...
How can I create a Installer package for iPhone? <p>How can I create a Installer package for iPhone ?</p>
<p>You should expose your question in a detailed and better way. Are you using xcode? It has everything you need to build your app for the iPhone.</p> <p>You just code the app, and hit the button "build" or "build and run" and the .app file is automatically generated.</p>
Eclipse C++ debugging breaks in STL <p>I'm new to debugging with Eclipse.</p> <p>I try to debug my app to know where it segfaults.</p> <p>The problem is that Eclipse breaks within the STL, which is very annoying.</p> <p>For example: I created a breakpoint in my source file on line 134, which works fine but if I hit ...
<p>Perhaps that's where it segfaults?</p>
Problems title-casing a string in Python <p>I have a name as a string, in this example "markus johansson".</p> <p>I'm trying to code a program that makes 'm' and 'j' uppercase:</p> <pre><code>name = "markus johansson" for i in range(1, len(name)): if name[0] == 'm': name[0] = "M" if name[i] == " ": ...
<pre><code>&gt;&gt;&gt; "markus johansson".title() 'Markus Johansson' </code></pre> <p>Built in string methods are the way to go.</p> <p>EDIT: I see you want to re-invent the wheel. Any particular reason ? You can choose from any number of convoluted methods like:</p> <pre><code>' '.join(j[0].upper()+j[1:] for j in...
Circular file logging <p>I would like to know if there are any logger libraries for C , that can do circular file logging?</p> <p>I am currently looking at log4C, But cant find enough docs on it that can say it will do circular logging.</p> <p>if anyone has done this. kindly let me know.</p> <p>Thanks</p>
<p><em>here is an example</em></p> <p>This is a cut down version. In ours we use vargs and format them before calling log_it.</p> <p><hr /></p> <pre><code>typedef const char* c_str; FILE* log_fp = 0; const int max_log_size = 4 * 1024 * 1024; const int max_no = 5; c_str prefix = "logs_"; c_str postfix = ".txt"; void...
Convert from enum ordinal to enum type <p>I've the enum type <code>ReportTypeEnum</code> that get passed between methods in all my classes but I then need to pass this on the URL so I use the ordinal method to get the int value. After I get it in my other JSP page, I need to convert it to back to an <code>ReportTypeEnu...
<pre><code>ReportTypeEnum value = ReportTypeEnum.values()[ordinal] </code></pre>
How to create a photo gallery with slideshow effect of the images placed in server folder using jsp/servlet/javascript <p>I need to create slideshow of the images which are in server.These images would be changing as the user uploads. I need this using jsp/javascript/servlet/ajax</p>
<p>Generally when the page loads, the slideshow code already has a list of the available files. It would need to use AJAX to poll the server periodically to determine if this list has changed (a user had uploaded a file). Typically you'd just replace the array or string holding the list of files in the AJAX call.</p> ...
How to import a function from a DLL made in Delphi? <p>Can you tell me how do i use the following functions in my C program.</p> <p>Delphi DLL - Exported functions :</p> <pre><code>function GetCPUID (CpuCore: byte): ShortString; stdcall; function GetPartitionID(Partition : PChar): ShortString; stdcall; </code></pre> ...
<p>Since you don't have the source to the DLL, you'll need to get a little creative on the C side of things. Even though the ShortString is listed as the function result, it is actually the responsibility of the <strong>caller</strong> to provide a location in which to place the result. Because this is a stdcall functi...
Best practices for building and packaging on AIX <p>Does anyone know where i can find some best practices guide for building and packaging C applications on AIX.</p> <p>I m using the xlc compiler and make.</p> <p>Thanks</p>
<p>Maybe <a href="http://publibn.boulder.ibm.com/doc%5Flink/en%5FUS/a%5Fdoc%5Flib/aixprggd/genprogc/pkging%5Fsw4%5Finstall.htm" rel="nofollow">here</a> ?</p>
How can I keep XML comments for method descriptions in a separate file? <p>This question stems from this question <a href="http://stackoverflow.com/questions/288298/code-documentation-how-much-is-too-much">Code documentation how much is too much?</a></p> <p>One the answers was to keep your xml documentation in a sepa...
<p>The answer is simple. Read the produced xml files. They give an idea how the separated xml files should look like.</p> <p>Reading the produced xml files and how method is described (with parameters and such):</p> <pre><code>&lt;member name="M:BitFactory.Logging.Logger.DoLog(BitFactory.Logging.LogEntry)"&gt; &l...
Using GetHashCode to "secure" users passwords <p>The company I work for has taken on a support contract for a large order processing system. As part of the initial system audit I noticed that the passwords stored in the database were actually the hashcode of the password.</p> <p>Essentially:</p> <pre><code>string pwd...
<p>You should use a salted, cryptographically strong hash, such as <code>SHA256Managed</code>.</p> <p>Jeff Attwood has a few good posts on this topic:</p> <p><a href="http://www.codinghorror.com/blog/archives/000949.html" rel="nofollow">Rainbow Hash Cracking</a></p> <p><a href="http://www.codinghorror.com/blog/archi...
Do you use the original (German) apple keyboard/keyboard layout when programming on mac? <p>I'm a programmer, working with different languages/Formats (Java, Python, XML, HTML, Objective-C etc.). From time to I've to work on a Mac and I'm not very comfortable with the German keyboard layout for programming.</p> <p>Is ...
<p>I recently did an internship in England and used this opportunity to switch to the English keyboard layout. The switch was nearly completely straightforward and I can heartily recommend it, especially since you can still type the German umlauts very well on the English keyboard layout (Alt+u, then a/o/u types the co...
Comparing struts ognl value to scriptlet value in JSP <p>I have to compare this to a value like below:</p> <pre><code>${page_id } ---- &lt;% out.print(a); %&gt; &lt;c:if test="${page_id != a}"&gt; </code></pre> <p>How can I do this?</p>
<p>Presuming that "a" is a scriptlet variable. El expressions map to page/request/session/application attributes in scope.</p> <p>${page_id} is approximately equivalent to pageContext.findAttribute("page_id");</p> <p>To be able to compare them, you need to get them into the same space. One way of doing this is with s...
Multiple Java projects and refactoring <p>I have recently joined a project that is using multiple different projects. A lot of these projects are depending on each other, using JAR files of the other project included in a library, so anytime you change one project, you have to then know which other projest use it and u...
<h3>Approach 1: Using Hudson</h3> <p>If you use a continuous integration server like <a href="http://hudson-ci.org/" rel="nofollow">Hudson</a>, then you can configure upstream/downstream projects (see <a href="http://wiki.hudson-ci.org/display/HUDSON/Terminology" rel="nofollow">Terminology</a>).</p> <blockquote> <p...
Appropriate placement for my testcases belonging to a non-app in Django <p>I have built my website in Django. And like any other django project I have got apps inside the project root directory and some special folders like(extensions a.k.a custom django command extensions). With an app, we dont have any problem with h...
<p>I think it will work to put them in a <code>tests/</code> directory at the project level.</p> <p>If, for some reason, it doesn't then try creating an empty <code>models.py</code> in your extensions directory.</p>
Arrays as objects <p>I there a method to allow me to use an array as an object?</p> <p>I have the following code in my main class</p> <pre><code>function __construct() { require 'config.php'; $this-&gt;config = new PHPSO_Config(); } </code></pre> <p>where the PHPSO_Config class looks something like this</...
<p>You can cast an array to an object using </p> <pre><code>$myObject = (object) $myarray; </code></pre> <p>thus the following should work (untested):</p> <pre><code>function __construct() { require 'config.php'; $this-&gt;config = (object) array("username" =&gt; "root"); } </code></pre> <p>then $c...
What image type should I use when? GIF, JPG or PNG? <p>I am trying to create a personal home page for myself to learn more about web design (JavaScript, using Photo Shop, etc). I plan on having a graphical menu on the left, a banner across the top and also a "Photos" section where I can display photos of various pictur...
<p>XKCD style comic strip that explains it:</p> <p><img src="http://i.stack.imgur.com/XeIwO.png" alt="alt text"></p> <p><a href="http://lbrandy.com/blog/2008/10/my-first-and-last-webcomic/" rel="nofollow">http://lbrandy.com/blog/2008/10/my-first-and-last-webcomic/</a></p>
Is there a java implementation of the ActiveRecord pattern that is built on top of Hibernate, similar to Castle Windsor? <p>I am looking for a Java implementationation of the ActiveRecord pattern which is built on top of Hibernate.</p> <p>In .Net there is a open source project <a href="http://www.castleproject.org/act...
<p>I released a project called ActiveJDBC: <a href="http://javalite.io/" rel="nofollow">http://javalite.io/</a>. This is what you are looking for thanks igor</p>
Web-based groupware for small company? <p>I'm looking for an open-source, web-based solution to provide a small company with the following groupware features: - calendar/planner - contacts - emails - document management (let people work on MS/OpenOffice docs on a shared drive, and have the server update the list of ava...
<p>To expand on TheTXI's answer (which was posted while I was typing this) -- <a href="http://technet.microsoft.com/en-us/windowsserver/sharepoint/default.aspx" rel="nofollow">Windows SharePoint Services</a> is free. Don't confuse it with SharePoint Server which has a richer publishing &amp; user profile model (among ...
Linearly recursive list-difference function in Common Lisp <p>I was going through <a href="http://www.cs.sfu.ca/CC/310/pwfong/Lisp/1/tutorial1.html" rel="nofollow">this</a> tutorial for fun, and got stuck on the very last thing he says, "Exercise: Give a linearly recursive implementation of union and difference." (for ...
<p>The <a href="http://mathworld.wolfram.com/SetDifference.html">set difference</a> operation L1 \ L2 is defined as all elements e such that e is in L1 but e not in L2. So it looks to me like your second attempt is actually correct:</p> <blockquote> <p>Similarly, if I change the L2 in line 3 to "nil", then it jus...
Validate on text change in TextBox <p>I have implemented validation rules on a textBox in my WinForm and it works well. However it checks the validation only when I tab out of the field. I would like it to check as soon as anything is entered in the box and everytime the content changes. Also I'd like it to check valid...
<p>TextChanged event</p> <p>in the future you can find all of the events on the MSDN library, here's the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox%28VS.80%29.aspx" rel="nofollow">TextBox class reference</a>:</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.windows.for...
Use of Global.asax in distributed approach ie Web garden <p>I understand the limitations of using application state and session state accross multiple application pools, that they cannot be shared. What about the Global.asax file is a single instace created per application pool or does it reside in a higher level some...
<p>Global.asax (which is just a class file for HttpApplication) is contained by whatever application pool the site resides in. Just the same as any other class in your site. If you are using web gardening, then the same rules that apply to application/session state applies to code in global.asax. In other words, if you...
Sharepoint Workflow Fails When First Run But Succeeds When Run Manually <p>We are using an infopath form that when submitted is supposed to fire off a custom .NET workflow. Basically, the information within the form is used to create a new sharepoint site. What I am seeing happen is that the first time the workflow run...
<p>I'm guessing this has to do with the workflow being fired asynchronously from the commit operation that sets the fields values. Can you try and fetch the item explictly from the list instead of using the Item from the workflow properties. something like the following:</p> <pre><code>SPListItem l_item = wo...
When do Extension Methods break? <p>We are currently discussing whether Extension methods in .NET are bad or not. Or under what circumstances Extension methods can introduce hard to find bugs or in any other way behave unexpectedly.</p> <p>We came up with:</p> <ul> <li>Writing an extension method for types that are n...
<p>Some curiosities:</p> <ul> <li>extension methods might be called on <code>null</code> instances; this might be confusing (but sometimes useful)</li> <li>the "hiding" issue is a biggie if they have different intent</li> <li>equally, you might get a different extension method with the same name from 2 different names...
Extending WebFormView in MVC <p>I want to extend the WebFormViewEngine so that I can perform some post-processing - I want it to do it's stuff, then hand me the Html back, so I can do put some final touches to it. It needs to be done as a View/ViewEngine because I need access to the ViewData.</p> <p>Unfortunately the...
<p>You can use Action Filters to do this. Check out <a href="http://www.asp.net/LEARN/mvc/tutorial-14-cs.aspx" rel="nofollow">this tutorial</a> at asp.net/mvc. You want to use a ResultsFilter.</p> <p>As an alternate, you can override the virtual OnResultExecuted method of the Controller.</p>
Maximum number of workable tables in SQL Server And MySQL <p>I know that in SQL Server, the maximum number of "objects" in a database is a little over 2 billion. Objects contains tables, views, stored procedures, indexes, among other things . I'm not at all worried about going beyond 2 billion objects. However, what ...
<p>No difference, assuming constant amount of data.</p> <p>Probably a gain in practical terms because of things like reduced maintenance windows (smaller index rebuilds), ability to have read-only file groups etc.</p> <p>Performance is determined by queries and indexes (at the most basic level): not number of objects...
Install PHP 5 without libxml2 <p>I am trying to install a copy of PHP 5 to my home directory on the school computer. The problem is that whenever I try, it complains that my copy of libxml2 is too outdated to work.</p> <p>Is there any way I can install this <strong>without</strong> upgrading libxml2, since I don't ha...
<p>Alternatively, you can make an install of libxml in your home directory and pass configure the location where you've installed it, i.e.</p> <pre><code>--with-libxml-dir=&lt;your local install&gt; </code></pre> <p>When installing libxml, you just have to use the <code>--prefix=</code> option with configure to indic...
View all link within <h1></h1>, need to set style on it, to make link small <p>I am trying to make the "view all" link to the right of each h1 header to be smaller.</p> <pre><code>.view-all a:link, .view-all a:visited { text-size:.5em; } &lt;h1&gt;Student Activities &lt;span class="view-all"&gt; &lt;a href="/stud...
<p>Try font-size instead. </p>
Counting with an Integer Divide-based routine - Is there a formulaic approach? <p>Consider a routine that counts by successive divide w/ remainder operations. </p> <p>Starting with a 64-bit dividend, the routine divides by a constant divisor.<br /> If the remainder is 0, the routine returns.<br /> Otherwise, a new ...
<blockquote> <p>Would some dividends cause this to loop forever? </p> </blockquote> <p>Dividend = 0x1ffffffffL, Divisor = 2 is a fairly obvious example, and the whole family (Divisor&lt;&lt;32)-1, Divisor are fixed points.</p> <p>Working from these, many cyclic combinations of initial dividend and divisor can be fo...
Why are these Div tags not nesting properly? <p>If anyone can give any insight here it would be very much appreciated. I want to create output that shows reservations in fitness classes on various dates. The idea is to have three across and however many rows are needed to cover all of the dates. To do this, I'd like t...
<p>Your ListSetContainer needs to contain some non-floated content for it to hava a height/width. Floating an element takes it out of the normal layout hierarchy and thus the container, containing only the ListSets, doesn't contain anything that gets rendered normally. Add a non-breaking space to the container, then ...
How can I set autoincrement format to 0001 in MySQL? <p>How can I make MySQL auto increment in 4 digit format?</p> <p>So instead of '1' make '0001'?</p>
<p>Try adding ZEROFILL attribute to the field.</p>
Anyway to error check PHP in Dreamweaver? <p>I do all my PHP coding in Dreamweaver (currently version CS3) I am used to it and like it. There is one thing I would like though, is to be able to check for errors. Currently I don't see them until I upload the page to a server. Is there anyway to setup PHP error checking i...
<p>Do you mean as you type? Since PHP isn't compiled, it's not as easy to do as with a language like Java or C#. The closest you can come to that is with <a href="http://www.icosaedro.it/phplint/" rel="nofollow">PHPLint</a>. Unfortunately, you have to do some hackery with Cygwin to get it to work under Windows.</p> <p...
Continuous Integration stack on Windows with Mercurial + Mercurial Queues? <p>We've been using Mercurial with Mercurial Queues (+guards for patches) for source control of a number of Windows ASP.Net projects. </p> <p>I'm interested in setting up a Continuous Integration environment for this but am getting lost in con...
<p>We use hudson and mercurial together and have been quite successful. They are both flexible enough to about anything you want.</p>
Preventing directory traversal with web-facing application - are regular expressions bullet-proof? <p>I am in a situation where I need to allow a user to download a file dynamically determined from the URL. Before the download begins, I need to do some authentication, so the download has to run through a script first. ...
<p>I would recommend using <a href="http://www.php.net/manual/en/function.realpath.php"><code>realpath()</code></a> to convert the path into an absolute. Then you can compare the result with the path(s) to the allowed directories.</p>
MVC Ajax UpdatePanel <p>I know (at least i'm pretty sure) there isn't a control for MVC like the asp:UpdatePanel. Can anyone give me some idea on how to do this.</p> <p>I have a collection that i add entries to from my repository &amp; services layers. in my masterpage i would like to show an alert depending on if the...
<p>Stay away from the UpdatePanel concept all together.</p> <p>ASP.NET MVC includes jQuery, which is fully supported by Microsoft now. You will want to create partial views (RenderPartial) that make calls back to a method on a controller, that returns JSON.</p> <p>Then, use jQuery to wire up the control and partial ...
How to extract leaf nodes from Oracle XMLTYPE <p>I want to extract only the leaf nodes from an XMLTYPE object in Oracle 10g</p> <pre><code>SELECT t.getStringVal() AS text FROM TABLE( XMLSequence( XMLTYPE( '&lt;xml&gt; &lt;node&gt; &lt;one&gt;text&lt;/one...
<p>Nevermind, I found it:</p> <pre><code>WHERE t.existsNode( '/*//*' ) = 0 </code></pre>
SqlTransaction has completed <p>I have an application which potentially does thousands of inserts to a SQL Server 2005 database. If an insert fails for any reason (foreign key constraint, field length, etc.) the application is designed to log the insert error and continue.</p> <p>Each insert is independent of the othe...
<p>Difficult to help without seeing code. I assume from your description you are using a transaction to commit after every N inserts, which will improve performance vs committing each insert provided N is not too big.</p> <p>But the downside is: if an insert fails, any other inserts within the current batch of N will...
Java InputStream blocking read <p>According to the java api, the <code>InputStream.read()</code> is described as:</p> <blockquote> <p>If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is de...
<p>The underlying data source for some implementations of <code>InputStream</code> can signal that the end of the stream has been reached, and no more data will be sent. Until this signal is received, read operations on such a stream can block. </p> <p>For example, an <code>InputStream</code> from a <code>Socket</code...
Generating a WiX XML file at build and components questions <p>I am trying to write an installer for a website I created. In the WiX tutorial it says "Again, a component should only contain items that belong together so strongly that they always need to be installed or removed together.". I believe an entire website fi...
<p>A Component's Files cannot span directories. Limitiation of the Windows Installer. Getting stable Component Ids is a tricky problem, but there are a few new tricks in WiX v3 that can handle this for you. The Component/@Guid="*" is the trick. The new (like last week) heat.exe will generate Fragments for you that ...
Which Java oriented lexer parser for simple project (ANTLR, DIY, etc) <p>I am working on a small text editor project and want to add basic syntax highlighting for a couple of languages (Java, XML..just to name a few). As a learning experience I wanted to add one of the popular or non popular Java lexer parser.</p> <p...
<p>ANTLR or JavaCC would be the two I know. I'd recommend ANTLR first.</p>
MS SQL Server 2008 - Confusion in migrating from MySQL re: "select XYZ from TABLE" <p>So I'm just confused here.</p> <p>I've got to migrate my database from MySQL to MS SQL Server 2008. I've transferred the data via the "MS SQL Data Wizard" app from SQL Maestros. It took the data+structure from my MySQL database "gk...
<p>Try this, if you haven't already:</p> <pre><code>USE gk GO SELECT * FROM tablename </code></pre>
Start Directory in Windows Explorer running Vista not set properly? <p>When I right click on Windows Explorer, select Properties, it opens a panel, I set the value of "Start In" to "C:\", which means I want it to point to my C: drive when I open explorer, but it's not working, it always points to "Documents". On XP I d...
<p>Use the explorer start params, e.g.,:</p> <pre><code>%SystemRoot%\explorer.exe /e,D:\Downloads </code></pre>
Which generic collection to use? <p>I have 2 separate classes:</p> <ul> <li>AreaProperties </li> <li>FieldProperties</li> </ul> <p>1 AreaProperties can map to 1 FieldProperties. Without changing the design, I want a method to return a <code>List&lt;&gt;</code> of these objects</p> <p>What generic collection in C# wo...
<p>You can create a class/struct that has two members - AreaProperties &amp; FieldProperties and return a list of that class</p> <pre><code>class Pair&lt;T1, T2&gt; { T1 t1; T2 t2; } List&lt;Pair&lt;AreaProperties, FieldProperties&gt;&gt; Save(){ ...} </code></pre> <p>Or use System.Collections.Generic.KeyV...
Fail to install my NetBeans plugin <p>Playing around with creating a NetBeans plugin but I am making very little progress since the process of installing the module fails. What I am doing is right-clicking on the and choosing the 'Install/Reload in Development IDE' option and it fails with the following exception:</p> ...
<p>Apperently this is a NetBeans issue for Mac OS X...</p> <p><a href="http://forums.netbeans.org/viewtopic.php?p=26822#26822" rel="nofollow">Answer from netbeans forums</a></p>
Any way to make XmlSerializer output xml in a defined order? <p>Currently I'm using XmlSerializer to serialize and deserialize an object. The xml is generated in an undefined order which is understandable but makes it annoying when comparing versions of the object, since the order of properties is different each time. ...
<p>The XmlElement attribute has an <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlelementattribute.order.aspx">order property</a>. You can use that as a start.</p> <p>If you need to find the diff in Xml files, you might want to take a look at <a href="http://msdn.microsoft.com/en-us/libra...
WCF Server without config file <p>I'm tired of dealing with config files so I'm trying to setup a WCF service in code only.</p> <p>So far I have this:</p> <pre><code> m_ServiceHost = New ServiceHost(Me) m_ServiceHost.AddServiceEndpoint( GetType(Aam.AamServiceFramework.IServiceMonitor), Ne...
<pre><code> m_ServiceHost.Description.Behaviors.Add(New ServiceMetadataBehavior()) m_ServiceHost.AddServiceEndpoint( GetType(IMetadataExchange), MetadataExchangeBindings.CreateMexTcpBinding(), "net.tcp://localhost:6595") </code></pre>