instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>Lets say I have the option of identifying a code path to take on the basis of a string comparison or else iffing the type:</p> <p>Which is quicker and why?</p> <pre><code>switch(childNode.Name) { case "Bob": break; case "Jill": break; case "Marko": break; } if(childNode is Bob) { } e...
<p>Greg's profile results are great for the exact scenario he covered, but interestingly, the relative costs of the different methods change dramatically when considering a number of different factors including the number of types being compared, and the relative frequency and any patterns in the underlying data.</p> ...
<p>I may be missing something, but couldn't you do a switch statement on the type instead of the String? That is, </p> <pre><code>switch(childNode.Type) { case Bob: break; case Jill: break; case Marko: break; } </code></pre>
11,994
<p>Given </p> <pre><code>@interface Canvas:NSView { NSNumber * currentToolType; ... } </code></pre> <p>declared in my .h file and in the .m file</p> <pre><code>- (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { currentToolType=[[NSNumber alloc]initWit...
<p>You mention that initWithFrame: is called twice. Your initWithFrame: should only be called once (unless you happen to have two Canvas views).</p> <p>Is it possible you have the Canvas view in your nib/xib file and are also creating another in code (with alloc/initWithFrame:)? </p> <p>In which case you have two Can...
<p>You've probably run in to a special case: NSNumber could have cached instances to represent commonly-used numbers.</p> <p>Two observations, though:</p> <ul> <li>You're wasting a whole lot of memory using NSNumber when you could be simply using NSIntegers or maybe an old-fashioned enumerated type, completely avoidi...
42,383
<p>Heres a tricky one . .</p> <p>I have a webpage (called PageA) that has a header and then simply includes an iframe. Lets call the page within the iframe PageB. PageB simply has a bunch of thumbnails but there are a lot so you have to scroll down on PageA to view them all. </p> <p>When i scroll down to the bottom...
<p>@mek after trying various methods, the best solution I've found is this:</p> <p>In the outer page, define a scroller function:</p> <pre><code>&lt;script type="text/javascript"&gt; function gotop() { scroll(0,0); } &lt;/script&gt; </code></pre> <p>Then when you define the iframe, set an onload handler (wh...
<p>I've spent a considerable amount of time trying to figure out how to scroll to the top of the iframe from within the PHP code I was calling (from within the parent ASP.NET page). I never figured I could scroll to the top using the same javascript but in the iframe's onload event. Thanks!</p>
33,682
<p>I've tried restarting apache and the cached pages still appear, so there must be a folder someplace. I don't have a 'public/cache', so what other places should I look? Is there a URL flag that could trigger this effect as well?</p>
<p>You need to touch a file to have phusion clear out, like:</p> <pre><code>touch /webapps/mycook/tmp/restart.txt </code></pre> <p>See the <a href="http://www.modrails.com/documentation/Users%20guide.html#_redeploying_restarting_the_ruby_on_rails_application" rel="noreferrer">docs</a></p>
<p>Ctrl+F5 will forcibly reload the page, and all it's linked assets. </p> <p>It's kind of like clearing the cache for just that one page.</p>
14,317
<p>EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters</p> <p>Our business uses the WebMethods integration server to handle most of our outbound communications, and its FTP functionality leaves something to be desired. We are having a problem that may be specific to WebMethods, but if anyone c...
<p>I tried this in WebMethods IS Version 6.5 Updates WmPRT_6-5-1_SP1, IS_6-5_SP3.</p> <p>It worked perfectly first time.</p> <p>I turned on debugging on the FTP server (Debian's default ftpd). WebMethods' NLST honours the active/passive parameter passed to it.</p> <p>There's nothing special about the NLST command, n...
<p>I'm going to run some new tests with the settings to passive tomorrow when maintenance is done here, but I'm not sure that's the issue. We are able to get a directory listing if there are files or subdirectories in that directory. It only fails when the directory we're NLST-ing on is empty.</p> <p>Would the activ...
8,140
<p>Is there a polynomial time algorithm for finding a Hamiltonian walk in a graph?</p> <p>My algorithm is N factorial and is really slow.</p>
<p>You just asked the <a href="http://en.wikipedia.org/wiki/P_versus_NP" rel="noreferrer">million dollar question</a>. Finding a Hamilton path is an NP-complete problem. Some NP-hard problems can be solved in polynomial time using dynamic programming, but (to my knowledge) this is not one of them.</p>
<p>Depending on just how the graphs you're working with are generated you might be able to get expected polynomial time against a random instance by doing greedy path extension and then a random edge swap when that gets stuck.</p> <p>This works well against randomly generated relatively sparse graphs guaranteed to hav...
11,452
<p>I am putting together an architecture for a mid sized company who want to introduce a BPM (Business Process Management) tool. I understand that this would be helpful and want to introduce it but stuggle to find its appropriate place within the architecture. </p> <p>I want to know when and how you should use a BPM t...
<p>Why do you want to introduce a BPM tool? Is it buzzword compliance? If you are struggling to find a place in the architecture, then I would suspect that the tool isn't going to bring a big win (at least not with your current understanding).</p> <p>Application workflow tools typically concern themselves with modelin...
<p>Why do you want to introduce the business process management tool? There are a number of softwares/ applications out there. If you are looking for the answers for the right time to use business process management, You can use it from the first day to organize the things in a digital way. If you want to use it late...
41,479
<p>While working in a Java app, I recently needed to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be in advance. The best I could come up with off the top of my head was something like this:</p> <pre><code>public String appendWithDelimiter( Stri...
<h3>Pre Java 8:</h3> <p>Apache's commons lang is your friend here - it provides a join method very similar to the one you refer to in Ruby: </p> <p><a href="http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#join(java.lang.Iterable,%20char)" rel="noreferrer"><code>StringUt...
<pre><code>public static String join(String[] strings, char del) { StringBuffer sb = new StringBuffer(); int len = strings.length; boolean appended = false; for (int i = 0; i &lt; len; i++) { if (appended) { sb.append(del); } sb.append(""+strings[i]); ...
8,872
<p>I've got a text file that contains several 'records' inside of it. Each record contains a name and a collection of numbers as data. </p> <p>I'm trying to build a class that will read through the file, present only the names of all the records, and then allow the user to select which record data he/she wants. </p> ...
<p>There are some good answers provided, but I couldn't find some source code that would work in my very simplistic case. Here it is, with the hope that it'll save someone else the hour that I spent searching around. </p> <p>The "very simplistic case" that I refer to is: the text encoding is fixed-width, and the line ...
<p>Are you sure that the file is "too large"? Have you tried it that way and has it caused a problem? </p> <p>If you allocate a large amount of memory, and you aren't using it right now, Windows will just swap it out to disk. Hence, by accessing it from "memory", you will have accomplished what you want -- random ac...
33,303
<p>I'm looking for a library like Cairo, just far faster. It has to be a library that works with C or Python. It also would be nice if I could output to PNG, and SVG. I am looking at Qt's arthur, but that's C++, and I'm not a fan. Any suggestions?</p> <p>Edit: another precondition is that it has to run under Linux.</...
<p>Python has <a href="http://effbot.org/zone/aggdraw-index.htm" rel="nofollow noreferrer">aggdraw</a></p>
<p>OpenGL?</p> <p>It can do 2D pretty well. :)</p>
37,300
<p>In SQL Server Mgt Studio 2005, when I open the Object Explorer to script an object to a new Query Editor window, the tab for that new script window is titled something like 'MyServerName.MyDatabaseName - sqlquery37.sql' </p> <p>Not very descriptive. So when I get a bunch of windows open at the same time, I have no ...
<p>Not [easily] without actually saving the script window to a file - then you get </p> <pre><code>MyServerName.MyDatabaseName - MyFileName.sql </code></pre> <p>as the title.</p> <p>You might be able to change this with a plugin/add-on, but not without writing code.</p>
<p>I recently created <a href="https://connect.microsoft.com/SQLServer/feedback/details/575463/sql-server-management-studio-ui-tabs-are-a-pain-to-use#" rel="nofollow noreferrer">this suggestion</a> in which I offer an alternative UI for the tabs:</p> <p><a href="http://img190.imageshack.us/img190/7130/exampletabs2.png...
37,955
<p>I need to send large files from silverlight 2 beta 2, so I need to set the sendchuncked property to true, but the property doesn't seem to exist. I've seen other posts on the internet where people have been able to set this in Silverlight. </p> <p>I disassebled the .dll at C:\Program Files\Microsoft SDKs\Silverli...
<p>After a bit more of research, I was looking at the documentation for ASP.NET. You need to wire up your own file upload chuncking mechanism. See Tim Heuer's <a href="http://timheuer.com/blog/archive/2008/07/10/embed-fonts-and-file-upload-in-silverlight-2.aspx" rel="nofollow noreferrer">great video</a> about this to...
<p>Could you provide links to those posts? Maybe they refer to a different of Silverlight, some things have been removed from S2B2.</p>
17,035
<p>How do I go about doing this with jQuery?</p> <p>Basically the structure:</p> <pre><code>&lt;form id="myForm"&gt; &lt;iframe&gt; &lt;!-- Normal HTML headers omitted --&gt; &lt;input type=radio name="myRadio" value=1&gt;First &lt;input type=radio name="myRadio" value=2&gt;Second &lt;input type=rad...
<p>Try <code>$('#myForm iframe').contents().find('input[name=myradio]').val()</code></p> <p>I'll assume that the iframe contents have already been loaded and are accessible e.g same domain.</p>
<p>Unless jQuery does some magic I'm not aware of, accessing another frame's DOM requires a little trickery. This may work:</p> <pre><code>var frameDocument = $('#myForm iframe').contentDocument || $('#myForm iframe').contentWindow.document; $(frameDocument).find('input[type=radio][checked]'); </code></pre> <p>And, n...
24,111
<p>Can someone shed some light in why FDM (Fuse Deposition Modelling) is not possible with metals?</p> <p>Has anyone attempted any experiments with it?</p>
<p>Yes, it is possible and it's done all the time. It's more commonly known as welding.</p> <p>We did TIG welding on our Hyrel printers back in 2017.</p> <p><div class="youtube-embed"><div> <iframe width="640px" height="395px" src="https://www.youtube.com/embed/azFY-IqDB_0?start=0"></iframe> ...
<p>For many metals you would need to run the hotend around 1000 °C. Aluminum melts at a lower temperature but needs to be in an inert atmosphere, such as argon. Solder melts at the right temperature, but tends to stick to most metal nozzles. It would start dissolving a brass nozzle thus enlarging the nozzle opening....
2,219
<p>I have a matrix in SQL reporting and I would like it to print on an A4 page. If the matrix has less than 4 columns then it fits but for more than 4 columns I would like the matrix to wrap and show only 4 columns per page. Is this possible? I am using SQL Reporting 2005 in localmode.</p>
<p>I found a work around:</p> <ol> <li>First I added a field to my datasource called column count. Because the datasource is built in a business object it was easy for me to tell how many columns of data there is.</li> <li>Next I created a list on my report and moved my matrix into the list.</li> <li>I made the group ...
<p>I don't think so. I've found that exporting to excel then printing was the most flexable way of printing SSRS matrix reports I've found - esp. since most of my users know excel well. </p>
17,363
<p>I am currently using JUnit 4 and have a need to divide my tests into groups that can be run selectively in any combination. I know TestNG has a feature to annotate tests to assign them to groups, but I can't migrate to TestNG right now. It seems this could easily be accomplished in JUnit with some custom annotations...
<p>JUnit has no such runner at the moment. Addressing the underlying issue, the need to get reasonable assurance from a test suite in a limited amount of time, is our highest development priority for the next release. In the meantime, implementing a Filter that works through annotations seems like it wouldn't be a big ...
<p>You can create suites, although that puts all the configuration in the suite, and not in annotations.</p>
18,520
<p>We're using the following command line from within a Windows Service developed with C# .Net Framework 1.1:</p> <pre><code>net use z: \\myComputer\c$ </code></pre> <p>The service is running under a domain account that is a local administrator on "myComputer". After debugging the code we can see that it does not ret...
<p>From <a href="http://msdn.microsoft.com/en-us/library/ms685143.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms685143.aspx</a>:</p> <blockquote> <p>A service (or any process running in a different security context) that must access a remote resource should use the Universal Naming Conventio...
<p>You probably need to specify the account used for the login. Type <code>net use /?</code> on a command prompt to get help setting that up with the command.</p>
35,693
<p>I want to write a little "DBQuery" function in perl so I can have one-liners which send an SQL statement and receive back and an array of hashes, i.e. a recordset. However, I'm running into an issue with Perl syntax (and probably some odd pointer/reference issue) which is preventing me from packing out the informati...
<p>The nested data structure contains a hash <em>reference</em>, not a hash.</p> <pre><code># Will work (the -&gt; dereferences the reference) $row = $records[$index]; print "This will work: ", $row-&gt;{firstName}, "\n"; # This will also work, by promoting the hash reference into a hash %row = %{ $records[$index] };...
<p>Also note a good perl idiom to use is</p> <pre>for my $rowHR ( @records ) { my %row = %$rowHR; #or whatever... }</pre> <p>to iterate through the list.</p>
7,417
<p>I have an issue with EMMA where it is correctly covering all my various Java projects except one. I am puzzled as to why this occurs as the ANT script appears to be correct. The following expected output is given:</p> <pre><code> [echo] c:\cc_local_home\emmadata\ProjectName [instr] processing instrumentation path ....
<p>What does the <code>&lt;emma.report&gt;</code> element look like?</p> <p>You may want to look at this <a href="http://emma.sourceforge.net/faq.html#q.report.noop" rel="nofollow noreferrer">FAQ</a> concerning this exact message: <a href="http://emma.sourceforge.net/faq.html#q.report.noop" rel="nofollow noreferrer">W...
<pre><code>&lt;target name="emma.report" if="use.emma"&gt; &lt;emma enabled="true"&gt; &lt;report sourcepath="${test.reports.dir}"&gt; &lt;infileset dir="${test.data.dir}" includes="*.emma" /&gt; &lt;html outfile="${test.reports.dir}/coverage.html" /&gt; &lt;/report&gt; &lt;/emma&gt; &lt;/tar...
37,840
<p>Imagine I have these python lists:</p> <pre><code>keys = ['name', 'age'] values = ['Monty', 42, 'Matt', 28, 'Frank', 33] </code></pre> <p>Is there a direct or at least a simple way to produce the following list of dictionaries ?</p> <pre><code>[ {'name': 'Monty', 'age': 42}, {'name': 'Matt', 'age': 28}, ...
<p>Here is the zip way</p> <pre><code>def mapper(keys, values): n = len(keys) return [dict(zip(keys, values[i:i + n])) for i in range(0, len(values), n)] </code></pre>
<pre><code>[dict(zip(keys,values[n:n+len(keys)])) for n in xrange(0,len(values),len(keys)) ] </code></pre> <p>UG-LEEE. I'd hate to see code that looks like that. But it looks right.</p> <pre><code>def dictizer(keys, values): steps = xrange(0,len(values),len(keys)) bites = ( values[n:n+len(keys)] for n in step...
30,311
<p>I have read <a href="https://stackoverflow.com/questions/34571/whats-the-best-way-of-unit-testing-private-methods">this post</a> about how to test private methods. I usually do not test them, because I always thought it's faster to test only public methods that will be called from outside the object. Do you test pri...
<p>I do not unit test private methods. A private method is an implementation detail that should be hidden to the users of the class. Testing private methods breaks encapsulation.</p> <p>If I find that the private method is huge or complex or important enough to require its own tests, I just put it in another class and...
<p>Absolutely YES. That is the point of Unit testing, you test Units. Private method is a Unit. Without testing private methods TDD (Test Driven Development) would be impossible,</p>
13,062
<p>I'm trying to use ASP.net health monitoring to log unhandled exceptions from an asmx web service. I've enabled health monitoring in the web.config but it's not logging anything. Does health monitoring work with asmx web services? I've googled around and seems other people have asked the same question but never got a...
<p>Please do not post a response unless it answers the question being asked. Half answers to something other than the question confuses the reader. Health monitoring has nothing to do with either "really unhandled" ASP.NET exceptions or the Application_Error event.</p> <p>The answer is no. I have digged this a bit a...
<p>It won't work because the unhandled exceptions are not running inside a try/catch of any kind. Because of that, it won't be able to log it. Take a look at this blog post: <a href="http://blogs.msdn.com/tom/archive/2007/12/04/unhandled-exceptions-causing-asp-net-to-crash-in-net-2-0.aspx" rel="nofollow noreferrer">h...
22,718
<p>I've written a fairly simple java application that allows you to drag your mouse and based on the length of the mouse drag you did, it will shoot a ball in that direction, bouncing off walls as it goes.</p> <p>Here is a quick screenshot:<br> <a href="http://img222.imageshack.us/img222/3179/ballbouncemf9.png">alt te...
<p>What you have to do is constantly subtract a small constant (something that represents your 9.8 m/s) from your yVector. When the ball is going down (yVector is already negative), this would make it go faster. When it's going up (yVector is positive) it would slow it down.</p> <p>This would not account for frictio...
<p>You really want to simulate what gravity does - all it does is create force that acts over time to change the velocity of an object. Every time you take a step, you change the velocity of your ball a little bit in order to "pull" it towards the bottom of the widget. </p> <p>In order to deal with the no-friction ...
44,485
<p>Does anybody know of a method for creating custom Performance Counters using ordinary unmanaged Visual C++?</p> <p>I know that it can be done easily using managed C++, but I need to do it using an unmanaged Windows service.</p> <p>I also know that you can retrieve performance counter data, but I need to create som...
<p>See here: <a href="http://msdn.microsoft.com/en-us/library/aa371925.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/aa371925.aspx</a></p> <p>It is not really hard, but a bit tedious as the API involves extensive usage of self-referential, variable-length structures and has to employ some IPC mechani...
<p>I was looking for something a litte easier to implement. I will probably have to use this approach. I was also shown by a colleague (thanks PJ) that there is a Scribble tutorial that has been modified to show how to add a Performance Counter using ATL classes: <a href="http://msdn.microsoft.com/en-us/library/z1xc8...
7,959
<p>Need recommendations for this...</p> <p>I have 2 teams</p> <ol> <li>Enterprise SOA development with InfoPath 2003, BizTalk 2006, MSCRMv3, custom .net2 website and a bunch of webservices using VSStudio 2005 with TFS.</li> <li>Web Team focused on public facing websites - using Adobe Suite, VSStudio 2005.</li> </ol> ...
<p><a href="http://subversion.tigris.org/" rel="nofollow noreferrer">svn</a> - can even keep your locking strategy (if you have to), also you can develop all sorts of pre/post commit hooks to automate deployments/tests etc etc. Easy to setup and manage.</p> <p>Some tools &amp; links</p> <ul> <li><a href="http://www.v...
<p>I would go with TFS for both teams despite the expense. You have the expertise in-house already for that product and it supports the locking model you like.</p> <p>If cost is a problem, go with <a href="http://subversion.tigris.org/" rel="nofollow noreferrer">SVN</a> for the web team, but purchase <a href="http://w...
38,779
<p>Is it possible to create an attribute that can be initialized with a variable number of arguments?</p> <p>For example:</p> <pre><code>[MyCustomAttribute(new int[3,4,5])] // this doesn't work public MyClass ... </code></pre>
<p>Attributes will take an array. Though if you control the attribute, you can also use <code>params</code> instead (which is nicer to consumers, IMO):</p> <pre><code>class MyCustomAttribute : Attribute { public int[] Values { get; set; } public MyCustomAttribute(params int[] values) { this.Values = va...
<p>I use maybe a bit stupid workaround using this trick:</p> <pre><code>public class CLParam : Attribute { /// &lt;summary&gt; /// Command line parameter /// &lt;/summary&gt; public string Names { get; set; } } </code></pre> <p>and then splitting the Names into string[]:</p> <pre><code>var names = loadA...
33,952
<p>I often accidentally create a branch that contains more code than it needs to. When that happens, I delete the branch files, the branch tag, and then start over. The thing that stinks is having to sync the huge pile of data just so I can delete it.</p> <p>Is there a way to delete server-side?</p>
<p>Yes, use sync -k.</p> <p>Add the path you want to delete to your client, e.g.</p> <pre><code>//depot/oops/... //your-client/oops/... </code></pre> <p>Then sync that location using the -k option:</p> <pre><code>p4 sync -k oops/... </code></pre> <p>This will tell Perforce that your client has the files without ac...
<p>Use delete -v:</p> <pre><code>p4 delete -v oops/... </code></pre> <p>This will delete files without syncing into workspace. It is faster than sync -k and then delete.</p>
31,395
<p>i know this should be db 101, but its just not as clear as it can be for me. I am using SQL2005 express and i want to copy data from databaseA to databaseB. DatabaseB already contains existing data - it may even contain data with pk's that have changed or dont exist - for example:</p> <p>DataBase A pk1 = peaches ...
<p>if the servers are on the same network add a linked server (look up in transact sql books online). Then you can run queries across the two servers.</p> <p>SQL Server 2005 Express sucks in that it does not include SSIS. However you can also use BCP (bulk copy, look this up in the transact sql books online as well)...
<p>Not real familiar with the limitations of SQL Server Express, but could you backup? And then import as another database?</p>
25,933
<p>I have an Access Database that outputs a report in Excel format.</p> <p>The report is dependent on a date parameter chosen by the user. This parameter is selected via a textbox (text100) that has a pop up calendar.</p> <p>I would like to use the date in the text box (text100) in the filename.</p>
<p>You have to take responsibility for asking for the parameter. I like using global parameters that I can get/set via global functions - this way they can be set anywhere and the queries can have access to them as well.</p> <p><strong>Just need a couple subs/functions in module:</strong></p> <pre><code>Some Module ...
<p>It's apparent to me that you want to parse a date out of a filename, and then use this date to perform a query... if that's not what you want, please re-formulate the question.</p> <p>I assume the last part is pretty obvious : concatenate the string converted date with the rest of your query string, and submit it t...
46,553
<p>is it possible to convert their method to scrum in a small concern</p>
<p>Two best practices of Scrum are :</p> <ul> <li><p>Grouping your staff in small teams.</p></li> <li><p>Keeping communication quick and efficient (especially meetings).</p></li> </ul> <p>So yeah, definitely, Scrum fit a small organization. In fact, as a small organization, you need less REorganization to start apply...
<p>There are certainly some aspects of scrum that only apply to large teams but it can work in smaller teams too.</p> <p>Like many things, it's a case of just taking what works for your company or team rather than blindly following all of it because "that's what you do".</p> <p>I've seen it work very successfully wit...
44,637
<p>can anyone show me how to get the users within a certain group using sharepoint?</p> <p>so i have a list that contains users and or groups. i want to retrieve all users in that list. is there a way to differentiate between whether the list item is a group or user. if its a group, i need to get all the users within ...
<p>The first thing you need to know is that when you have a list with a User / Group field you must be aware of its type. When you have one user or group within the item value, the field type is SPFieldUserValue. However, if the field has multiple user / group selection the field type is SPFieldUserValueCollection.<br>...
<p>This is better to use <code>web.SiteGroups</code> instead of <code>web.Groups</code> as a group might be inherited by that site.</p>
42,081
<p>I've a performance related question regarding use of StringBuilder. In a very long loop I'm manipulating a <code>StringBuilder</code> and passing it to another method like this:</p> <pre><code>for (loop condition) { StringBuilder sb = new StringBuilder(); sb.append("some string"); . . . sb.append(an...
<p>The second one is about 25% faster in my mini-benchmark.</p> <pre><code>public class ScratchPad { static String a; public static void main( String[] args ) throws Exception { long time = System.currentTimeMillis(); for( int i = 0; i &lt; 10000000; i++ ) { StringBuilder sb = new...
<p>Declare once, and assign each time. It is a more pragmatic and reusable concept than an optimization.</p>
30,012
<p>Business Objects Web Services returns error codes and I have yet to find a good resource where these are listed and what they mean. I am currently getting an "The resultset was empty. (Error: WBP 42019)". Any ideas on where these might be listed? I've called Business Objects support and the tech couldn't even tel...
<p>This is the best place that I have found:</p> <p><a href="http://help.sap.com/businessobject/product_guides/errors/12/0/en/html/idxentries.htm" rel="nofollow">http://help.sap.com/businessobject/product_guides/errors/12/0/en/html/idxentries.htm</a></p> <p>Each error code is a link with a description.</p>
<p>Perhaps <a href="http://resources.businessobjects.com/support/communitycs/TechnicalPapers/pecodes.pdf?recDnlReq=Record&amp;dnlPath=pecodes.pdf" rel="nofollow noreferrer">This</a>? (PDF Link - beware)</p> <p>Found here: (Google cache, as the page appears dead): <a href="http://209.85.173.104/search?q=cache:fyB21Ywrj...
12,253
<p>Our application is written in ActionScript2 and has about 50.000+ lines of code. We want to port it to ActionScript3 and we're trying to find out what our options are. Do we have to do it manually or can we use a converter, and what problems can we expect? </p>
<p>I asked a similar question a little while ago that you might find useful:</p> <p><a href="https://stackoverflow.com/questions/46136/what-is-the-best-approach-to-moving-a-preexisting-project-from-flash-7as2-to-fl">What is the best approach to moving a preexisting project from Flash 7/AS2 to Flex/AS3?</a></p> <p>Som...
<p>I don't think you can ever use an automatic converter for this task. A converter may be able to save you some steps or point out places where change must take place, but you'll have to go over the code manually.</p> <p>For example, referring to a _level0.variableName in AS2 can point to a movieClip on the _root lev...
12,682
<p>I have created a database model in Visio Professional (2003). I know that the Enterprise version has the ability to create a DB in SQL Server based on the data in Visio. I do not have the option to install Enterprise. Aside from going through the entire thing one table and relationship at a time and creating the who...
<p>I have not done this, but here it goes.</p> <ol> <li>Convert Visio file to Visio XML format.</li> <li>Use <a href="http://dia-installer.de/index_en.html" rel="nofollow noreferrer">Dia for Windows</a> and <a href="http://www.redferni.uklinux.net/dia/vdx/" rel="nofollow noreferrer">Dia VDX plug-in</a> to convert Visi...
<p>If you can somehow obtain the type library from the enterprise version you can use VBA to get out the definitions. Secondhand enterprise architect versions of VS 2002 and VS 2003 can be brought from ebay for a few hundred dollars.</p>
5,847
<p>I am working on a Visual Studio 2008 project that is already added to TFS server. I am not sure which settings and policies have been configured for the TFS (this is done by a separate dept, not developers)</p> <p>Every time I make an edit to a code file , the file is checked out automatically (without explicitly c...
<p>It is in Options\SourceControl\Environment</p> <blockquote> <p>Checked out Items: <strong>Check out automatically</strong></p> </blockquote> <p>change it to</p> <blockquote> <p>Checked out Items: <strong>Prompt for exclusive checkouts</strong></p> </blockquote> <p><img src="https://i.stack.imgur.com/68oke.pn...
<ul> <li><p>Close your solution. </p></li> <li><p>Unplug your network cable. </p></li> <li><p>Open your solution. </p></li> <li><p>Visual Studio will tell you that TFS is not available and will open the solution "Offline". </p></li> <li><p>Plug your network cable back in. VS should not take the solution "Online" unt...
27,356
<p>I cant post the code (proprietary issues) but does anyone know what types of things would cause the following error in C#. It is being thrown by a VOIP client that I wrote (using counterpath api) when the call is ended by the other client. The error is:</p> <pre><code>System.AccessViolationException was unhandled ...
<p>List of some possibilities:</p> <ul> <li>An object is being used after it has been disposed. This can happen a lot if you are disposing managed object in a finalizer (you should not do that).</li> <li>An unmannaged implementation of one of the object you are using is bugged and it corrupted the process memory heap....
<p>Here is a more detailed stacktrace. It looks to me like it has something to do with the System.Windows.Form.dll</p> <p>the TargetSite is listed as <code>{IntPtr DispatchMessageW(MSG ByRef)}</code><br> and under module it has System.windows.forms.dll</p>
3,855
<p>I'm trying to create a WSTransfer implementation (I realise Roman Kiss has written one already for WCF - but it doesn't actually meet the specifications)</p> <p>I've ended up abandoning data contracts on the service contacts because WSTransfer is loosely coupled; so each the create message looks like Message Create...
<p>I always try to put the expressions in <code>JOIN</code>'s in the following order:</p> <pre><code>joined.column = leading.column </code></pre> <p>This query:</p> <pre><code>SELECT t.value, d.name FROM transactions t JOIN dimensions d ON d.id = t.dimension </code></pre> <p>can be treated either l...
<p>Part of the reason that this is difficult to visualise each time, is because sometimes the data is modelled as <code>id</code> + <code>child_id</code>, and sometimes it is modelled as <code>id</code> + <code>parent_id</code>. Depending on which way round your data is modelled, you have to place your <code>PRIOR</co...
33,792
<p>Our motor pool wants to scan drivers’ licenses and have the data imported into our custom system. We're looking for something that will allow us to programmatically get the data from the scanner (including the picture) and let us insert it into our application. I was wondering if anyone has had experience with this ...
<p>Try solutions by idScan.net (www.idScan.net) There is SDK that will allow drivers license parsing for all states in the USA and Canadian provinces. You can also purchase hardware such as ID scanner E-seek m250 that reads both 2D barcode and magnetic stripes (software is included). Good luck!</p>
<p>Maybe you want to use magnetic stripe reader, to get driver license info from the card. As I remember most of the Driver licenses just have the data in plain text on those stripes, so it is relatively stright forward programming-wise.<br> MagStripe readers are also cheap now days.</p>
41,684
<p>Is there a method, or some other light-weight way, to check if a reference is to a disposed object?</p> <p>P.S. - This is just a curiousity (sleep well, not in production code). Yes, I know I can catch the <code>ObjectDisposedException</code> upon trying to access a member of the object.</p>
<p>No - default implementation of IDisposable pattern does not support it</p>
<p>What I like to do is declare the objects without initializing them, but set their default values to <code>Nothing</code>. Then, at the end of the loop I write:</p> <pre class="lang-vb prettyprint-override"><code>If anObject IsNot Nothing Then anObject.Dispose() </code></pre> <p>Here is a complete sample:</p> <p...
23,359
<p>I know how to capture a camera snaphot on Windows Mobile 5.0/6 using SHCameraCapture. But is there something more extensive that allows me much finer control? Namely to get available zoom levels and to set the zoom level programmatically, also e.g. different ISO modes / lightsensitivity and setting of macro mode if ...
<p>For the ISO modes, light sensitivity and other advanced controls etc. it is usually device specific from everything I've seen. I know different manufacturers will expose their imager libraries through their SDKs. What sort of mobile device are you using? Check with the manufacturer for an API exposed through their S...
<p>Via some other question on SO I found <a href="http://blogs.msdn.com/marcpe/archive/2006/03/03/542941.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/marcpe/archive/2006/03/03/542941.aspx</a> which offers another (generic) way of accessing the camera. I haven't yet figured out yet what and how I can set option...
31,602
<p>I'm updating a long list of records. In my code, everything run as predicted until it execute the query. I get an </p> <blockquote> <p>Incorrect syntax near 'TempUpdatePhysicalCityStateZip' </p> </blockquote> <p>(my stored procedure name). I've tested it with SQL Server Management Studio and it runs fine. So, I'...
<p>I believe you can get that puzzling error message if you don't specify the command type:</p> <pre><code>cmdUpdate.CommandType = CommandType.StoredProcedure; </code></pre>
<p>Don't you need the @ sign before the parameter?</p> <pre><code> cmdUpdate.Parameters.AddWithValue("@State", i); </code></pre> <p>FWIW, Thats kind of a dirty piece of code there, you will probably have many issues trying to maintain that. For performance reasons you may want to parse out the CityStateZipList before...
35,151
<p>Is there a simple way to cache <code>MySQL queries</code> in <code>PHP</code> or failing that, is there a small class set that someone has written and made available that will do it? I can cache a whole page but that won't work as some data changes but some do not, I want to cache the part that does not.</p>
<p>This is a great overview of how to cache queries in MySQL:</p> <ul> <li><a href="http://www.petefreitag.com/item/390.cfm" rel="noreferrer">The MySQL Query Cache</a></li> </ul>
<p>I would recommend the whole page caching route. If some of the data changes, simply place tokens/placeholders in place of the dynamic data. Cache the entire page with those tokens in place, then post process the tokens for the cached data for the tokens. Thus you now have a cached page that contains dynamic content....
5,784
<p>I've been dealing with 3D printing for 1.5 years, but now own a CR-6 SE myself since the beginning of 2021. Most things are already quite clear but for 2 days I have had a problem with the adhesion of the prints.</p> <p>Nearly all prints I have done so far used the filament shipped with the printer (PLA 1.75) and th...
<p>It is likely the surface was damaged by the chemical cleaning, based on your description and <a href="https://3dprinting.stackexchange.com/questions/15392/cr-6-se-glass-build-plate-no-lifting-possible#comment28974_15392">octopus8's comment</a>. If you are unable to mechanically release the print, there is a chemical...
<p>Sounds like the bed came with a coating on it. If you can't find out what the coating is, but believe you already removed it, you could try glue sticks or hair spray. You can also find glue sticks specified for 3D printing. Elmer's glue sticks work. I'm yet to try glue sticks specified for a 3D printer. You can...
1,838
<p>One of the reasons I usually don't use an IDE for development is that I'm so used to vi keybindings that I usually end up messing up my text and putting in lots of &quot;:w&quot;s, and I can't use vi's powerful regex replace mechanism. Are there any IDEs that allow you to configure vi keybindings or use vi as the e...
<p>There's <a href="http://jvi.sourceforge.net/" rel="nofollow noreferrer">jVi</a> for NetBeans. There's also <a href="http://www.satokar.com/viplugin/" rel="nofollow noreferrer">viPlugin</a> for Eclipse, but it's not free. :(</p>
<p>Most IDE's that I know of (eclipse, netbeasn, VS200X) have replace with regex features available, Im not a big vi user, what do you really want to be able to do?</p> <p>My advice is to really take the time to learn the IDE of choice and you will soon be a very efficient (in different ways) developer within that env...
37,607
<p>I got a webserver with a running application. There's a webpage with a form: some text data and a file upload field. Now, what I would like to have is it working like this:<br> The file is sent to the dedicated server, diffrent then the one application is running on. The server should return some kind of path (or an...
<p>POST to dedicated server, server stores image and calls back to web server through a web service or other to give it any info required.</p>
<p>POST to dedicated server, server stores image and calls back to web server through a web service or other to give it any info required.</p>
8,870
<p>I have a large amount of data I need to store, and be able to generate reports on - each one representing an event on a website (we're talking over 50 per second, so clearly older data will need to be aggregated).</p> <p>I'm evaluating approaches to implementing this, obviously it needs to be reliable, and should b...
<p>Wow. You are opening up a huge topic. </p> <p>A few things right off the top of my head...</p> <ol> <li>think carefully about your schema for inserts in the transactional part and reads in the reporting part, you may be best off keeping them separate if you have really large data volumes</li> <li>look carefully ...
<p>Wow.. This is a huge topic. </p> <p>Let me begin with databases. First get something good if you are going to have crazy amounts to data. I like Oracle and Teradata. </p> <p>Second, there is a definitive difference between recording transactional data and reporting/analytics. Put your transactional data in one are...
31,833
<p>I have a database with user 'dbo' that has a login name "domain\xzy". How do I change it from "domain\xzy" to "domain\abc".</p>
<p>I figured it out. Within SQL Management Studio you have to right-click on the database -> Properties -> Files -> Owner field. Change this field to the login name/account that you want associated with the "dbo" username for that database. Please keep in mind that the login name/account you choose must already be setu...
<p>This is a Windows login, not a SQL Server login, so you cannot 'change' the login name since it is linked to the user account in Active Directory. </p> <p>Create a new Server Login (Windows) mapped to the new windows user (and remove the old one if necessary). Then in login's Security > User Mapping, permission tha...
19,683
<p>Is there a way to tell if an event handler has been added to an object? I'm serializing a list of objects into/out of session state so we can use SQL based session state... When an object in the list has a property changed it needs to be flagged, which the event handler took care of properly before. However now wh...
<p>From outside the defining class, as @Telos mentions, you can only use EventHandler on the left-hand side of a <code>+=</code> or a <code>-=</code>. So, if you have the ability to modify the defining class, you could provide a method to perform the check by checking if the event handler is <code>null</code> - if so, ...
<pre><code>EventHandler.GetInvocationList().Length &gt; 0 </code></pre>
16,571
<p>I have a few text boxes and buttons on my form.</p> <p>Lets say txtBox1 is next to btnSubmit1, txtBox2 is next to btnSubmit2, txtBox3 is next to btnSubmit3.</p> <p>How can I set the focus on btnSubmit3 when the user starts to type something in txtBox3. Meaning..... if a user type in a text box the program will kno...
<p>If you use a panel, you should be able to set a defaultbutton. I´m not sure if it´s an win forms application or a web forms application, but this is how you should do it with web forms:</p> <pre><code>&lt;asp:Panel id="panel1" runat="server" DefaultButton="Button1"&gt; &lt;asp:TextBox id="textbox1" runat="server...
<p>Use JavaScript and add a "onblur" for those TextBoxes...</p> <p>Example:</p> <pre><code>&lt;asp:TextBox ID="t1" runat="server" onblur="CheckIfTextBox1ShouldFocusOnButton1();" /&gt; </code></pre> <p>:)</p>
36,450
<p>I was using an mxml class but since i need to pass some properties at construction time, to make it easier i will convert it to as3 code.</p> <p>The class is RectangleShape and it just draws a rectangle.</p> <p><strong>Original mxml working</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;...
<p>Try setting up the bindings with the BindingUtils class.</p> <p>For example:</p> <pre><code>BindingUtils.bindProperty(component, "height", this, "height"); </code></pre>
<p>I think i pinpointed the problem. Before in the mxml version we had</p> <p>width="{width}" height="{height}"</p> <p>And the degrafa rectangle will automatically fit its parent.</p> <p>But not in the AS version. i should try to reproduce the {width} and {height} in As. Any tool to convert mxml to as?</p>
41,486
<p>I am using SQL Server 2000 and I have two databases that both replicate (transactional push subscription) to a single database. I need to know which database the records came from.</p> <p>So I want to add a fixed column specified in the publication to my table so I can tell which database the row originated from.<...
<p>You could use a calculated column Use the following on the two databases:</p> <pre><code> ALTER TABLE TableName ADD MyColumn AS 'Server1' </code></pre> <p>Then just define the single "master" database to use a VARCHAR column (or whatever you want) that you fill using the calculated columns value.</p>
<p>You can create a view, which adds the "constant" column, and use it as a replication source.</p>
8,969
<p>In Python for *nix, does <code>time.sleep()</code> block the thread or the process?</p>
<p>It blocks the thread. If you look in Modules/timemodule.c in the Python source, you'll see that in the call to <code>floatsleep()</code>, the substantive part of the sleep operation is wrapped in a Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS block, allowing other threads to continue to execute while the current...
<p>it blocks a thread if it is executed in the same thread not if it is executed from the main code</p>
11,844
<p>Should it be possible to directly send G-code to the printer serial connection using pipes under Linux?</p> <p>Example:</p> <pre><code>echo M106 &gt; /dev/ttyUSB0 </code></pre> <p>My controller runs at 250000 baud, I have tried setting the TTY baud rate to 250 kBd with: </p> <pre><code>stty -F /dev/ttyUSB0 25000...
<p>For direct low-level printer control from a terminal, without specific software, I found the following solution with full credit thanks to user: <a href="http://stackexchange.com/users/6463673/meuh">http://stackexchange.com/users/6463673/meuh</a></p> <p>Sharing here as may be of use to other users in the 3d Printin...
<p>That's work solution: <div class="youtube-embed"><div> <iframe width="640px" height="395px" src="https://www.youtube.com/embed/1kcvIRhXkCo?start=0"></iframe> </div></div> you need 2 terminal, one for in and another for out flows </p>
437
<p>My app has a DataGridView object and a List of type MousePos. MousePos is a custom class that holds mouse X,Y coordinates (of type "Point") and a running count of this position. I have a thread (System.Timers.Timer) that raises an event once every second, checks the mouse position, adds and/or updates the count of t...
<p><strong>UPDATE!</strong> -- I <em>partially</em> figured out the answer to <strong>part #1</strong> in the book "Pro .NET 2.0 Windows Forms and Customer Controls in C#"</p> <p>I had originally thought that <strong>Refresh()</strong> wasn't doing anything and that I needed to call the <strong>Invalidate()</strong> m...
<p>Looks like you have your answer right there! Just in cawse you're curious about how to do cross thread calls back to ui: All controls have a Invoke() method (or BEginInvoke()- in case you want to do things asynchronously), this is used to call any method on the control within the context of the main UI thread. So, i...
32,365
<p>Which OS do you prefer to program on? Client or Server</p> <p>There is a school of though that if you are doing (mostly) web programming (or other server based code), you should use a server OS for your dev machine, since that's closer to the environment where your app will be running.</p> <p>Update: I should add,...
<p>OK, I know you're mainly talking about windows but...</p> <p>I used to develop on windows for deployment on *nix servers. Sure there were <em>lots</em> of gotchas with this way of working, but you just kind of get used to it. </p> <p>In October 2005 I switched to Linux, initially as an experiment, but I never went...
<p>Regardless of the operating system you're actually talking about, it shouldn't matter. Most applications you might write won't need to worry about the differences (if there indeed are any). Only in rare cases might you use some specific functionality that might only be available on a "server" edition of your OS.</p>...
8,280
<p>I have a recursive algorithm which steps through a string, character by character, and parses it to create a tree-like structure. I want to be able to keep track of the character index the parser is currently at (for error messages as much as anything else) but am not keen on implementing something like a tuple to ...
<p>Since you've already discovered the pseudo-mutable integer "hack," how about this option:</p> <p>Does it make sense for you to make a separate Parser class? If you do this, you can store the current state in a member variable. You probably need to think about how you're going to handle any thread safety issues, a...
<p>To be honest I would recode the function to make it a linear algorithm that uses a loop. This way you have no chance of running out of heap space if you are stepping through an extremely large string. Also, you would not need to have a the extra parameter just to keep track of the count.</p> <p>This also would prob...
5,499
<p>IO.popen() and system() in Ruby is sorely lacking several useful features, such as:</p> <ul> <li>obtaining the return value of the function</li> <li>capturing both stdout and stderr (seperately and merged)</li> <li>running without spawning an extra cmd.exe or /bin/sh process</li> </ul> <p>Python has a module "subp...
<p>Take a look at the standard Ruby library <a href="http://www.ruby-doc.org/stdlib/libdoc/open3/rdoc/index.html" rel="nofollow noreferrer">open3</a>. This will give you access to stdin, stdout and stderr.</p> <p>There is also an external project called <a href="https://rubygems.org/gems/open4/" rel="nofollow norefer...
<p>I've felt the need to do exactly that when testing git_remote_branch. The tool calls out to the shell and I wanted to capture exactly what was displayed during test runs, no matter what git was displaying, and no matter if it was being spit out in stdout or stderr.</p> <p>I have a module that's perfectly reusable t...
18,691
<p>I'm writing a CLR stored procedure to take XML data in the form of a string, then use the data to execute certain commands etc. </p> <p>The problem that I'm running into is that whenever I try to send XML that is longer than 4000 characters, I get an error, as the XmlDocument object can't load the XML as a lot of t...
<p>I think you want the <code>System.Data.SqlTypes.SqlXml</code> type. For example:</p> <pre><code>using System; using System.Data; using System.Data.SqlClient; using System.Data.SqlTypes; using System.Xml; using Microsoft.SqlServer.Server; public partial class StoredProcedures { [SqlProcedure] public static...
<p>For CLR stored procedures, char, varchar, text, ntext, image, cursor, user-define table types and table cannot be specified as parameters.</p> <p>You should be able the nvarchar(max) type instead of the ntext type.</p>
38,785
<p>I am trying to create a delegate protocol for a custom UIView. Here is my first attempt:</p> <pre><code>@protocol FunViewDelegate @optional - (void) funViewDidInitialize:(FunView *)funView; @end @interface FunView : UIView { @private } @property(nonatomic, assign) id&lt;FunViewDelegate&gt; delegate; @end </...
<p>Forward class syntax is <code>@class Foo;</code>, not <code>@interface Foo;</code>.</p>
<p>It would seem that you can forward declare protocols:</p> <pre><code>@protocol FunViewDelegate; @interface FunView : UIView { @private id&lt;FunViewDelegate&gt; delegate; } @property(nonatomic, assign) id&lt;FunViewDelegate&gt; delegate; @end @protocol FunViewDelegate @optional - (void) funViewDidInitiali...
37,153
<p>Normally stainless steel is magnetic. But whenever i order stainless steel nozzles from Amazon, they are not magnetic. This makes me think they could be brass coated in something like aluminum. However, there are many types of steel.</p> <p>I've attached an image of someone who reviewed these nozzles. He says they ...
<p>Let's preface, that there are a LOT of metal identification methods. For example, I found <a href="http://fac.ksu.edu.sa/sites/default/files/Metal%20Identification%20Ready%20_unprotected.pdf" rel="nofollow noreferrer">this guide</a> helpful and I had been at the scrapyard lately, where I have been told that 90+% of ...
<p>Stainless steel is created by adding elements (usually Chromium, but also Nickel) to steel. These added elements form an oxide layer with the outside air protecting the steel from corroding. </p> <p>Whether stainless steel is magnetic or not depends on the added elements and the micro structure of the steel; some a...
1,480
<p>I'm using a SqlDataSource to populate my GridView, because the two seem to be so tightly coupled together. Since this grid shows results of a search, I have a dynamic sql string being written in my codebehind that references parameters I pass in, such as below:</p> <pre><code>sdsResults.SelectParameters.Add("CodeID...
<p>BTW, my workaround right now lets SqlDataSource pass in the param as an nvarchar. My first line in my SQL then converts that nvarchar param explicitly to a varchar variable, and use that new varchar variable through my script instead.</p> <p>But that seems silly. </p>
<p>Maybe this will work:</p> <pre><code>using System.Data; sdsResults.SelectParameters.Add("CodeID", SqlDbType.VarChar, strCodeID); </code></pre>
38,775
<p>This is not specific to any language, it´s just about best practices. I am using JPA/Hibernate (but it could be any other ORM solution) and I would like to know how do you guys deal with this situation: Let´s suppose that you have a query returning something that is not represented by any of your domain classes. Do ...
<p>We have a situation that sounds similar to yours.</p> <p>We use separate objects for reporting data that spans several domain objects. Our convention is that these will be backed by a view in the database, so we have come to call them view objects. We generally use them for summarising complex data into a flat form...
<p>I typically write a function that performs a query using SQL and then puts the results into either a list or dictionary (in Java, I'd use either an ArrayList or a HashMap).</p> <p>If I found myself doing this a lot, I'd probably create a new file to hold all of these queries. Otherwise I'd just make them functions...
7,482
<p>I have a site that requires Windows Authentication the application obtains the credential from the Security.Prinicipal once the user is autenticated the problem is that my credentials on my local environment are different that the ones stored in the DB and the user preferences cannot be obtain. i am doing the follow...
<p>While you could alter userBL, why wouldn't you instead alter the database records to reflect that they're in a different domain. I'm assuming you're not hitting the production database, so there should be no issues with a 'sanitizing' step that makes the database useable for dev/test.</p> <p>e.g.</p> <pre><code>UP...
<p>Have you looked into using Impersonation in Web.Config to set the id to your test credentials. I would presume that you have a "test" web.config and a "production" web.config. This way you won't have to worry about removing it when you go live.</p>
30,264
<p>Is there a rake task for backing up the data in your database? </p> <p>I already have my schema backed up, but I want to make a backup of the data. It's a small MySQL database. </p>
<p>The below script is a simplified version taken from <a href="http://github.com/engineyard/eycap/tree/master" rel="nofollow noreferrer">eycap</a>, specifically from <a href="http://github.com/engineyard/eycap/tree/master/lib/eycap/recipes/database.rb" rel="nofollow noreferrer">this file</a>.</p> <pre><code>set :dbus...
<p>Make sure to add the "--routines" parameter to mysqldump if you have any stored procs in your database so it backs them up too.</p>
4,704
<p>What are the naming conventions that you use while coding?</p>
<p>I hope we will not discuss prefixes for field names and brace styles here :)</p> <p>Here is my bible for .NET:</p> <p><a href="https://i.stack.imgur.com/aZnVG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aZnVG.jpg" alt="alt text"></a> </p> <p>Also <a href="http://msdn.microsoft.com/en-us/lib...
<p>Folks, please don't post answers like "I like __field" or "I like m__field". It's a very personal and subjective question without a single answers. </p> <p>If <em>you have any guidlines</em> it's already a big win. Worse thing in dev team is a lack of common conventions. </p> <p>It would be nice if would try to de...
15,507
<p>A Wicket application serializes and caches all pages to support stateful components, as well as for supporting the back button, among other possible reasons. I have an application which uses setResponsePage to navigate from screen to screen. Over a pretty short amount of time the session gets rather large because al...
<p><a href="http://apache-wicket.1842946.n4.nabble.com/Wicket-Session-grows-too-big-real-fast-td1875816.html" rel="nofollow noreferrer">http://apache-wicket.1842946.n4.nabble.com/Wicket-Session-grows-too-big-real-fast-td1875816.html</a></p> <p>If you use loads of domain objects on your page, which are eventually tight...
<p>In order to avoid Session choke due to continuous stacking of byte-stream due to serialization in a session and memory usage piling , you can use detachable models by using hooks to arrange for their own storage and restoration at the beginning of each request cycle , this way you have complete control over models c...
35,615
<p>How to get the checked option in a group of radio inputs with JavaScript?</p>
<pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; function testR(){ var x = document.getElementsByName('r') for(var k=0;k&lt;x.length;k++) if(x[k].checked){ alert('Option selected: ' + x[k].value) } } &lt;/script&gt; &lt;/...
<p>generic functions (loosely based on yours )</p> <pre><code>function getRadioGroupSelectedElement(radioGroupName) { var radioGroup = document.getElementsByName(radioGroupName); var radioElement = radioGroup.length - 1; for(radioElement; radioElement &gt;= 0; radioElement--) { if(radioGroup[radio...
19,635
<p>After using Hudson for continuous integration with a prior project, I want to set up a continuous integration server for the iPhone projects I'm working on now. After doing some research it looks like there aren't any CI engines designed specifically for Xcode, but one guy has had success <a href="http://www.pragmat...
<p>I'm successfully using Hudson on the mac with xcodebuild. With the release of the 3.0 iPhone sdk you have compete control over the target, configuration and sdk that the project is to be built against. </p> <p>It's as simple as creating a build step in hudson and telling xcodebuild to build the project:</p> <pre...
<p>Jenkins works fine. You can Either build your xcode project by writing your own shell script then let Jenkins run it, or you can also use xcode plugin.</p> <p>But you have to be aware of the authority problem. With little tweaks in Jenkins configurations, you'll be able to manage your CI server in very little time....
26,178
<p>Is there a Java package providing funcionality like the .Net System.Data namespace ? Specificaly the DataSet and Adaptor classes ?</p>
<p>Use <a href="http://java.sun.com/javase/6/docs/api/java/util/package-summary.html" rel="nofollow noreferrer">java.util</a> for the collections. <a href="http://java.sun.com/javase/6/docs/api/java/sql/package-summary.html" rel="nofollow noreferrer">java.sql</a> for databases.</p>
<p>ADO.NET is a framework with multiple uses, and DataSet is one of the main abstractions. Tell us more about what you want to achieve, and I'm sure somebody will find a Java framework for that purpose.</p> <p>If you want a simple way to map Java objects to a data backend (like XML files), take a look at some of the P...
14,926
<p>I am working on creating a .asmx webservice to meet the specific needs of an integration environment and for the life of me I cannot figure out how to get one section of it to work. The key is that the request WSDL needs to be something like the following. (Note I removed the soap envelope and namespace informatio...
<p>If you have WSDL contract that needs to be implemented, you may try <code>wsdl.exe /serverInterface</code> to get service stub generated.</p>
<p>Maybe an obvious question, but did you try using wsdl.exe to see what it spits out? You can always just use this for guidance (i.e. you don't have to use the class directly).</p>
48,099
<p>I am using Slic3r to generate the GCode for my Marlin-based printer. For some reason with increasing height my print starts to get messed up. On another part it starts to act like this when there are small parts. Is this related to my Slic3r settings, maybe to much filament being extruded or is this due to something...
<p>To me, this looks like a combination of bad filament, high temperature and/or fast speeds.</p> <ul> <li>Too high extrusion temperature will make difficult to let each layer cool enough before the next layer begins. This is why you see the poor results on the smaller areas of the print in your second photo.</li> <li...
<p>This can happen if your filament is having to be pulled off the spool and slipping in the extruder. Check if slippage is happening at the extruder, perhaps see if results change by providing some hand powered help. I have seen this with some glossy PLA I have used.</p>
321
<p>I am evaluating WF for use in line of business applications on the web, and I would love to hear some recent first-hand accounts of this technology.</p> <p>My main interest here is in improving the maintainability of projects and maybe in increasing developer productivity when working on complex processes that chan...
<p>Windows Workflow Foundation is a very capable product but still very much in its 1st version :-(</p> <p>The main reasons for use include:</p> <ol> <li>Visually modeling business requirements.</li> <li>Separating your business logic from the business rules and externalizing rules as XML files.</li> <li>Seperating y...
<p>Never tried WFF, but I remember reading <a href="http://www.bwebcentral.com/blog/3/758" rel="nofollow noreferrer">this article about WFF by Leon Bambrick</a> where he basically says the whole genre of software development tools is nonsense. Might help you decide one way or the other.</p>
14,043
<p>I have a client with a LAMP website serving mostly video. He is currently on one server with all components. He is having some scaling problems. What are some of the techniques that can be used to help.</p> <p>I used separating out the DB to another server with a GB Ethernet between it and the webserver. Maybe addi...
<p>The advice about CloudFront and MemCache etc. is all good, assuming those address the root of your performance issues.</p> <p>On the database side: Profile, profile, profile. Moving the DB to a separate server was (probably) a good step, but if you haven't profiled the queries being run on this DB instance, you d...
<p>Profile to see how much load various parts of his site actually inflict.</p> <p>I presume most of the load is actually serving the videos - use a proxy to redirect this work to a second (,third, fourth...) server.</p>
40,272
<p>As you can see in the image below I have a tree datamodel consisting of groups that can contain other groups plus an arbitary number of items wich again can hold Parameters. The Parameters itself are defined globally and just reoccur in the items. Only the parameter's actual value may differ from parameter usage to ...
<p>I'm not a tree view expert, but it's easy to build something like that without a tree view.</p> <p>Start with an empty VS2008 Wpf Application named WpfTreeGridWhatever</p> <p>First, let's define our model:</p> <pre><code>using System; using System.Collections.Generic; namespace WpfTreeGridWhatever { public c...
<p>You could try just what you suppose in the title of the question - create a TreeListDataGridView. It will be a custom control made up of a TreeView for the top part and a DataGrid for the bottom part - or maybe just an ordinary Grid, depending on the desired effect. That way you'll have your look-and-feel and you'll...
47,753
<p>Is there a "#if DEBUG"-like conditional statement which can be used in VS 2008 for determining if the code is being run from a unit test? (We're using MS's built-in unit testing.)</p> <p>For example: </p> <p><code>#if !UNITTEST</code></p> <p><code>// Do some GUI stuff we don't want to see when unit testing</code>...
<p>I agree with the comments saying to avoid doing this in general - but I've done this in the past myself. IIRC, it was used to switch between a "unit test database" (i.e. throwaway) and a "test database with useful data in" - which had been accidentally wiped by unit tests one too many times...</p> <p>Our solution w...
<p>Note that any such definition is only meaningful at compilation time. Hence you'd have to compile it one way to get the code, and another way to have that code removed. So, you code would be "sensing" that it's being run by the unit test framework. You'd need two separate assemblies. If that's really what you wa...
22,729
<p>I'm building an ASP.NET AJAX application that uses JavaScript to call web services to get its data, and also uses Silverlights Isolated Storage to cache the data on the client machine. Ultimately once the data is downloaded it is passed to JavaScript which displays in on the page using the HTML DOM.</p> <p>What I'm...
<p>Since Silverlight can handle JSON and XML based services, the format of the response is totally irrelevant. What you must consider, however, is the following:</p> <p>1) Silverlight is approximately 1000 times faster than JavaScript 2) If your web service is natively SOAP based, Visual Studio can generate a proxy fo...
<p>Since JavaScript isn't multithreaded, I'm finding that using Silverlight to access/cache the data then pass it to JavaScript for display produces much better performance, while refraining from locking/freezing the browser so the user can keep doing stuff while the data loads.</p>
20,351
<p>Can anyone point me to a good introduction to coding against the paypal API?</p>
<p>Found this article by Rick Strahl recently <a href="http://www.west-wind.com/presentations/PayPalIntegration/PayPalIntegration.asp" rel="noreferrer">http://www.west-wind.com/presentations/PayPalIntegration/PayPalIntegration.asp</a>. </p> <p>Have not implemeted anything from it yet, Rick has quite a few articles ar...
<p>I don't know what your needs are, but you might want to consider <a href="http://code.google.com/apis/checkout/samples/Google_Checkout_Sample_Code_NET.html" rel="nofollow noreferrer">Google Checkout</a>. <a href="http://www.joeaudette.com/paypal-sandbox-doesnt-work.aspx" rel="nofollow noreferrer">Joe Audette</a> wa...
7,649
<p>I want to increment a cookie value every time a page is referenced even if the page is loaded from cache. What is the "best" or most concise way to implement this?</p>
<p>Stolen from <a href="http://www.quirksmode.org/js/cookies.html#script" rel="noreferrer">http://www.quirksmode.org/js/cookies.html#script</a></p> <pre><code>function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var e...
<p>the best way is always the simplest:</p> <pre><code>function getCookie(name) { return (name = (document.cookie + ';').match(new RegExp(name + '=.*;'))) &amp;&amp; name[0].split(/=|;/)[1]; } // the default lifetime is 365 days function setCookie(name, value, days) { var e = new Date; e.setDate(e.getDate() + (...
32,606
<p>Usually, I've seen it with forms, but I've found it helpful to group related sets of data (eg when you have multiple tables on a page, using a fieldset around each table or group of related tables to define a visible meaning and a group name (legend)). Is this abusing the fieldset tag to the point where, in my uses,...
<p>I believe this would be abuse. <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.10" rel="noreferrer">http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.10</a> states "The FIELDSET element allows authors to group thematically related <a href="http://www.w3.org/TR/REC-html40/interact/forms.html...
<p>The fieldset tag is also of use to screen readers and some other assistive technologies.</p>
40,571
<p>Suppose I've found a &ldquo;text&rdquo; somewhere in open access (say, on public network share). I have no means to contact the author, I even don't know who is the author.</p> <p>What can I legally do with such &ldquo;text&rdquo;?</p> <p><strong>Update:</strong> I am not going to publish that &ldquo;text&rdquo;, ...
<p>IANAL: There is no license. The original author (whoever it may be) retains copyright and all the rights associated with it, and has not granted any explicit license to anyone to do anything with their work. Please do check with an actual lawyer versed in copyright, though, since it seems like there should be a way ...
<p>As far as I <em>know</em> (without any legal training) - if you list the text or code or whathaveyou as "anonymous", you're OK. </p> <p>I believe that by listing it as anonymous you're indicating you do not know where it came from, but you're admitting you didn't create it as original work.</p> <p>Extending from t...
9,623
<p>I'm a complete Xcode/Objective-C/Cocoa newbie but I'm learning fast and really starting to enjoy getting to grips with a new language, platform and paradigm.</p> <p>One thing is though, having been using Visual Studio with R# for so long I've kind of been spoiled with the coding tools such as refactorings and compl...
<p>You sound as if you're looking for three major things: code templates, refactoring tools, and auto-completion.</p> <p>The good news is that Xcode 3 and later come with superb auto-completion and template support. By default, you have to explicitly request completion by hitting the escape key. (This actually works...
<p>I found some xtmacro files in Xcode.app package: <strong>/Developer/Applications/Xcode.app/Contents/PlugIns/TextMacros.xctxtmacro/Contents/Resources</strong></p> <p>Installed Xcode ver. 3.2.5.</p>
4,079
<p>At the risk of being downmodded, I want to ask what the best mechanism (best is obviously subjective for the practice violation inherent here) for viewing data from a table, using C#, with a <em>lot</em> of columns. By a lot, I mean something like 1000.</p> <p>Now before you get all click happy, or throw out respo...
<p>Ok, what turned out to be the right answer for me was to use the <a href="http://msdn.microsoft.com/en-us/library/ms251671(VS.80).aspx" rel="noreferrer">ReportViewer control</a>, but not in any manner documented in MSDN. The problem is that I have dynamic data, so I need a dynamic report, and all of the tutorials, ...
<p>How much of the data is critical for the initial view? I can see doing something like a master/detail type grid where you're putting the critical columns (say like 10) onto the datagrid and when the user clicks to view the details, you can take the remaining columns and display them in a "properties area" or somethi...
33,493
<p>What is the best way to find something in a list? I know LINQ has some nice tricks, but let's also get suggestions for C# 2.0. Lets get the best refactorings for this common code pattern.</p> <p>Currently I use code like this:</p> <pre><code>// mObjList is a List&lt;MyObject&gt; MyObject match = null; foreach (M...
<blockquote> <p>@ Konrad: So how do you use it? Let's say I want to match mo.ID to magicNumber.</p> </blockquote> <p>In C# 2.0 you'd write:</p> <pre><code>result = mObjList.Find(delegate(int x) { return x.ID == magicNumber; }); </code></pre> <p>3.0 knows lambdas:</p> <pre><code>result = mObjList.Find(x =&gt; x.ID...
<p>Put the code in a method and you save a temporary and a <code>break</code> (and you recycle code, as a bonus):</p> <pre><code>T Find&lt;T&gt;(IEnumerable&lt;T&gt; items, Predicate&lt;T&gt; p) { foreach (T item in items) if (p(item)) return item; return null; } </code></pre> <p>… but of...
4,364
<p>The company I work for makes hardware that communicates to the computer though a serial port. Third party companies write software that communicates with our hardware. </p> <p>There are times when I need to diagnose our hardware. However, a third party software app connects to the serial port when Windows starts up...
<p>You can use the <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="noreferrer">process explorer</a> tool also from SysInternals to search for open handles. In this case you would want to search for 'Serial' since it uses device names that may not map to com port numbers. (e.g. COM1 is \Dev...
<p><a href="http://technet.microsoft.com/en-us/sysinternals/default.aspx" rel="nofollow noreferrer">Sysinternals</a> has a slew of utilities I find very useful and educational for tracking down what processes are doing to the system.</p> <p>They have a utility that does exactly what you need called <a href="http://tec...
6,361
<p>How can you find the number of occurrences of a particular character in a string using sql?</p> <p>Example: I want to find the number of times the letter ‘d’ appears in this string.</p> <pre><code>declare @string varchar(100) select @string = 'sfdasadhfasjfdlsajflsadsadsdadsa' </code></pre>
<p>Here you go:</p> <pre><code>declare @string varchar(100) select @string = 'sfdasadhfasjfdlsajflsadsadsdadsa' SELECT LEN(@string) - LEN(REPLACE(@string, 'd', '')) AS D_Count </code></pre>
<p>In SQl Server if @string = 'sfdasa ddd' function LEN fails to count trailing white spaces. Solution to LEN's issue is in <a href="https://stackoverflow.com/questions/2025585/len-function-not-including-trailing-spaces-in-sql-server">LEN function not including trailing spaces in SQL Server</a></p>
36,553
<p>Does anyone know how to get the name of the TARGET (/t) called from the MSBuild command line? There are a few types of targets that can be called and I want to use that property in a notification to users.</p> <p>Example:</p> <pre><code>msbuild Project.proj /t:ApplicationDeployment /p:Environment=DEV </code></pre>...
<p>I'm not sure how to do exactly what you ask, but could you pass that string using the /p option?</p> <pre><code>msbuild Project.proj /t:ApplicationDeployment /p:Environment=DEV;MyValue=ApplicationDeployment </code></pre> <hr> <p>The only other way I can see to do it is to use a conditional property in each target...
<p>I'd recommend using a server like CCNET to handle build executions and notification. Sure, you can do things to your MSBuild script to send out notificatioms, but that domain belongs to the build server.</p>
18,082
<p>I am trying to use this in my page class. I only just started using objects in PHP so I'm still a little clueless (but learning as much as I can). This is in my <code>page()</code> function (so called when there is a new instance of page)</p> <pre><code>set_error_handler('$this-&gt;appendError'); </code></pre> <p>...
<p>Few problems with that.</p> <p>First: <pre>'$this->appendError'</pre> is a nogo. It doesn't interpret $this to the current class, php interprets it as the string '$this'.</p> <p>Second: Try <pre>set_error_handler(array($this, 'appendError'));</pre></p> <p>If that doesn't work, replace $this with the classname an...
<p>Read the <a href="http://ca3.php.net/manual/en/language.pseudo-types.php#language.types.callback" rel="nofollow noreferrer">php.net callback documentation</a>. I think example 3 is closest to what you want:</p> <pre><code>// Type 3: Object method call $obj = new MyClass(); call_user_func(array($obj, 'myCallbackMeth...
41,351
<p>I've been preaching both to my colleagues and here on SO about the goodness of using parameters in SQL queries, especially in .NET applications. I've even gone so far as to promise them as giving immunity against SQL injection attacks.</p> <p>But I'm starting to wonder if this really is true. Are there any known SQ...
<p><strong>Placeholders</strong> are enough to prevent injections. You might still be open to buffer overflows, but that is a completely different flavor of attack from an SQL injection (the attack vector would not be SQL syntax but binary). Since the parameters passed will all be escaped properly, there isn't any wa...
<p>It is possible for a stored proc to be vulnerable to special types of SQL injection via overflow/truncation, see: Injection Enabled by Data Truncation here:</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms161953.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms161953.aspx</a></p>
39,451
<p>I am trying to call a WCF webservice (which I developed) from a Silverlight application. For some reason the Silverlight app does not make the http soap call to the service. I know this because I am sniffing all http traffic with Fiddler (and it is not a localhost call).</p> <p>This my configuration in the server r...
<p>If the Silverlight application is not hosted in the same domain that exposes the Web service you want to call, then cross-domain restrictions applies.</p> <p>If you want the Silverlight application to be hosted in another domain than the web service, you may want to have a look on <a href="http://timheuer.com/blog/...
<p>You wouldn't happen to be running from the filesystem would you? If you are serving up the silverlight application your local machine and not using the VS Web Server or IIS, you won't be able to make HTTP calls for security reasons. Similarly if you're loading from a web server, you can't access local resources.</p>...
16,994
<p>Having come across a link on stack overflow, I have found the writings of <a href="http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/" rel="nofollow noreferrer">Miško Hevery</a> very engaging reading. So good that I am seeing a new approach to what I previously thought I was doing quite well.</p> ...
<p>It doesn't provide the information in quite the same way as the Google Testability Explorer, but <a href="http://www.ndepend.com/" rel="nofollow noreferrer">NDepend</a> (non-free) provides a lot of code analysis for .Net assemblies.</p>
<p>You can also use <a href="http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx" rel="nofollow noreferrer">FXCop</a>.</p> <blockquote> <p>FxCop is an application that analyzes managed code assemblies (code that targets the .NET Framework common language runtime) and reports information about the assemblies...
35,492
<p>How do I authenticate against AD using Python + LDAP. I'm currently using the python-ldap library and all it is producing is tears.</p> <p>I can't even bind to perform a simple query:</p> <pre><code>import sys import ldap Server = "ldap://my-ldap-server" DN, Secret, un = sys.argv[1:4] Base = "dc=mydomain,dc=co,...
<p>I was missing </p> <pre><code>l.set_option(ldap.OPT_REFERRALS, 0) </code></pre> <p>From the init.</p>
<p>Use a Distinguished Name to log on your system.<code>"CN=Your user,CN=Users,DC=b2t,DC=local"</code> It should work on any LDAP system, including AD</p>
16,982
<p>Currently my app uses just Direct3D9 for graphics, however in the future I' m planning to extend this to D3D10 and possibly OpenGL. The question is how can I do this in a tidy way?</p> <p>At present there are various Render methods in my code</p> <pre><code>void Render(boost::function&lt;void()&gt; &amp;Call) { ...
<p>Define an interface that is sufficient for your application's graphic output demands. Then implement this interface for every renderer you want to support.</p> <pre><code>class IRenderer { public: virtual ~IRenderer() {} virtual void RenderModel(CModel* model) = 0; virtual void DrawScreenQuad(int x1, ...
<p>I'd say if you want a really complete the answer, go look at the source code for <code>Ogre3D</code>. They have both <code>D3D</code> and <code>OpenGL</code> back ends. Look at : <a href="http://www.ogre3d.org" rel="nofollow noreferrer">http://www.ogre3d.org</a> Basically their API kind of forces you into working ...
8,573
<pre><code>struct elem { int i; char k; }; elem user; // compile error! struct elem user; // this is correct </code></pre> <p>In the above piece of code we are getting an error for the first declaration. But this error doesn't occur with a C++ compiler. In C++ we don't need to use the keyword struct again and again...
<p>Because it takes years for a new Standard to evolve. They are working on a new C++ Standard (<a href="http://en.wikipedia.org/wiki/C%2B%2B0x" rel="noreferrer">C++0x</a>), and also on a new C standard (C1x), but if you remember that it usually takes between 5 and 10 years for each iteration, i don't expect to see it ...
<p>You don't need to develop a new language if you want to use C with C++ typedefs and the like (but without classes, templates etc).</p> <p>Just write your C-like code and use the C++ compiler.</p>
31,598
<p>i am programatically adding Webcontrols in to a User Control i am also adding a javascript event passing the controlID as a parameter but the clientID is the one i assigned a it does not contain the one that asp.net generates</p> <pre><code> var txt = new TextBox(); txt.ID = "MyID"+Number; chkBox.Attribute...
<p>You need to add the control to the control hierarchy before you add the attribute.</p> <pre><code> var txt = new TextBox(); txt.ID = "MyID"+Number; Controls.Add ( txt ); chkBox.Attributes.Add("onClick", "EnableTxtBox('" +txt.ClientID + "');"); </code></pre> <p>ControlCollection is no ordinary collection...
<p>You should be able to add the attribute during OnPreRender(). INamingContainer is so painful sometimes...</p>
38,503
<p>What are the best practices for naming ant targets? </p> <p>For example, what would you expect the target "test" to run? All unit tests? All functional tests? Both?</p> <p>What are the standard names used for running different types of tests (unit/functional/all)? Are there standards for target names to deploy ...
<p>See the <a href="http://wiki.apache.org/ant/TheElementsOfAntStyle#Naming_conventions" rel="noreferrer"><strong>"Naming Conventions"</strong> section</a> on this page : <a href="http://wiki.apache.org/ant/TheElementsOfAntStyle" rel="noreferrer">The Elements of Ant Style</a></p> <blockquote> <p>The following target...
<p>I think this is completely a point of personal preference, but I would use</p> <ul> <li><code>test</code> - for unit tests</li> <li><code>test-integration</code> - for integration tests</li> <li><code>dbtest</code> - for database tests (if they are included in the above item)</li> <li><code>test-all</code> to run a...
44,471
<p>I get the warning "childNodes is null or not an object' with different line numbers, depending on which version of the library I reference (I've tried about three different versions of 1.2.6). Consequently, I get jack for jQuery intellisense.</p> <p>I can hack this to get it to work, but I'd rather not as I don't ...
<p>I ran into this same issue a little while back. Are you using the jQuery UI files as well? I was and it turned out that the jquery ui javascript file was messing up the intellisense somehow. So I created an empty vsdoc.js file for the jquery ui file and then intellisense started working. My jquery ui file was called...
<p>It does work for me; Not sure why it is an error for me and why the fix is needed?</p>
26,895
<p>I am trying to mock-up an API and am using separate apps within Django to represent different web services. I would like App A to take in a link that corresponds to App B and parse the <code>json</code> response. </p> <p>Is there a way to dynamically construct the url to App B so that I can test the code in develop...
<p>You can try <a href="http://danbunea.blogspot.com/2005/11/model-view-presenter-is-testing_27.html" rel="noreferrer">MVP</a> if you want to put the logic of the UI in a separate class..</p> <p>In model view presenter just as Martin Fowler or Michael Feathers say, the logic of the UI is separated into a class called ...
<p>I would only put UI logic in the Form class and put any application logic in its own class:</p> <pre><code>class Form1 : Form { void Button1_Click { Program.DoCommand1(); } } static class Program { internal static void DoCommand1() {/* ... */} } </code></pre>
15,094
<p>I am just curious to know how long, in minutes, does the reporting service take to generate report when it returns 1MB of data. Maybe using views and table is properly index. SSRS reporting and server side generation.</p>
<p>Report generation time has two components: - Data Acquisition time - Render Time</p> <p>So for 1 Mb of data, how many records (rows) are we talking? How many pages will the report have? How many controls per page? Does the report use charting? These are the factors that will determine generation time. </p> ...
<p>I've found, when using BIRT and other reporting systems that the best improvements tend to come by offloading most of the work to the database at the back end.</p> <p>In other words, don't send lots of data across the wire and sort or group it locally. The database is almost certainly going to outperform you with ...
15,956
<p>I'm trying to create a TCP connection and send/read data that uses SSL, but I haven't been able to successfully accomplish this.</p> <p>What I'd like to do is something like this:</p> <pre><code> TcpClient _tcpClient = new TcpClient("host", 110); BinaryReader reader = new BinaryReader(new System.Ne...
<p>BinaryReader reads primitive data types as binary values in a specific encoding, is that what your server sends?<br> If not use StreamReader:</p> <pre><code>TcpClient _tcpClient = new TcpClient("host", 110); StreamReader reader = new StreamReader(new System.Net.Security.SslStream(_tcpClient.GetStream(), true))...
<p>I'm not entirely sure if this will work for your application but I would recommend taking a look at stunnel:<br /> <a href="http://www.stunnel.org" rel="nofollow noreferrer">http://www.stunnel.org</a><br/> <br /> I've used it for wrapping existing TCP connections in the past.</p>
31,445