instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I'm using a WPF RichTextBox control to input some text with user formatting capability, including font size adjustment. The built-in commands for IncreaseFontSize and DecreaseFontSize will adjust the font size by 0.75pt each time the command is executed. I would like to increase the granularity to 2pt.</p>
<p>Can... | <p>Unfortunately the value is hard-coded and you cannot change it. The fastest way to implement this is to use the TextRange class. Something like this:</p>
<pre><code>var range = new TextRange( rtb.Document.ContentStart, rtb.Document.ContentEnd );
range.ApplyPropertyValue( TextElement.FontSizeProperty, 30.0 );
</code... | <p>That doesn't work for InlineContainers that are text blocks</p>
| 38,548 |
<p>I am <strong>very</strong> new to the entity framework, so please bear with me...</p>
<p>How can I relate two objects from different contexts together?</p>
<p>The example below throws the following exception:</p>
<blockquote>
<p>System.InvalidOperationException: The
relationship between the two objects
cann... | <p>You will have to use the same context (you can pass the context to the getdefaultrole method) or rethink the relationships and extend the entity.</p>
<p>EDIT: Wanted to add this was for the example provided, using asp.net will require you to fully think out your context and relationship designs.</p>
<p>You could s... | <p>Yep - working across 2 or more contexts is not supported in V1 of Entity Framework.</p>
<p>Just in case you haven't already found it, there is a good faq on EF at <a href="http://blogs.msdn.com/dsimmons/pages/entity-framework-faq.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/dsimmons/pages/entity-framework-... | 19,234 |
<p>I have a number of string arrays. The string in every array are ordered the same way, according the same criteria. However, some string may be missing from some arrays, and there may be no array that has a complete set of strings. Moreover, the criteria used to compare the strings is not available to me: outside of ... | <p>One possible way I can think of, though probably not the most efficient:</p>
<p>Im going to use your example to explain:</p>
<pre><code>A B D
A B C
A C D
</code></pre>
<p>create a an array of the unique characters, so you would get (for example):</p>
<pre><code>A B D C
</code></pre>
<p>Also you should probably ... | <p>Partial solution:</p>
<p>You need to determine an ordering. You could do that by asking you data to "vote" on how many times one symbol is preceding another. You will need a square matrix with the size equal to the number of symbols. Initialize it to all zeros, then scan all your input strings, adding 1 to M(a,b... | 36,212 |
<p>I'm trying to have two inputs (one textbox, one drop down) to have the same width.
You can set the width through css, but for some reason, the select box is always a few pixels smaller.
It seems this only happens with the xhtml 1.0 strict doctype
Any suggestions/ideas about the reason/work around?</p>
<p>Having the... | <p>You could try resetting the margins, padding and borders to see if that helps:</p>
<pre><code>.searchInput {
margin:0;
padding:0;
border-width:1px;
width:1000px;
}
</code></pre>
| <p>It seems only with the doctype added this happens.
Corrected the example.</p>
| 19,581 |
<p>Background</p>
<p>I have been asked by a client to create a picture of the world which has animated arrows/rays that come from one part of the world to another. </p>
<p>The rays will be randomized, will represent a transaction, will fade out after they happen and will increase in frequency as time goes on. The ... | <blockquote>
<p>The client will present this as a slide in a presentation in a windows machine</p>
</blockquote>
<p>I think this is the key to your answer. Before going to a 3d implementation and writing all the code in the world to create this feature, you need to look at the presentation software. Chances are, yo... | <p>It depends largely on the effort you want to expend on this, but the basic outline of an easy way. Would be to load an image of an arrow, and use a drawing library to color and rotate it in the direction you want to point(or draw it using shapes/curves).</p>
<p>Finally to actually animate it interpolate between the... | 33,570 |
<p>Do you have any ideas how to call DoEvents from a C# DLL</p>
| <p>Don't. It's sketchy enough when you are the app controlling the event loop; pumping messages from a DLL just adds to the risk that you'll end up hitting code a naive programmer didn't make safe for re-entrancy.</p>
| <p>Write a interface for the EXE and have your main form or main class implement it.
Then register that object implementing the interface with the DLL.
Assign it to a variable of the that interface type
Make a Subroutine that is visible throughout the DLL.
In the Subroutine check to see if the variable is nothing i... | 35,655 |
<p>Is it in best interests of the software development industry for one framework, browser or language to <strong>win the war</strong> and become the de facto standard? On one side it takes away the challenges of cross platform, but it opens it up for a single point of failure. Would it also result in a stagnation of... | <p>Defacto standards are bad because they are usually controlled by a single party. What is best for the industry is for there to be a foundation of open standards on top of which everyone can compete. </p>
<p>The web is a perfect example. When IE won the browser war, it stagnated for <em>years</em>, and is only just ... | <p>No. Competition is good. It may make a web developers job easier, but I think it's bad for the industry. I personally prefer having choices. </p>
<p>I believe Joel Spolsky's technique of creating his own language (Wasabi) to insulate his company from being platform specific is a good one. I also believe it is... | 3,401 |
<p>during beta testing we discovered connection pooling error messages . Therefore I have been going through the code and closing down the SqlDataReader objects wherever they have been left unclosed. What I need to know is how to close a datareader (or if there is a need at all to close) that is specified in the Select... | <p>I tend to use the "using" keyword, especially when dealing with opening and closing connections to a database. "using" is a shortcut to the Dispose pattern - <a href="http://msdn.microsoft.com/en-us/library/yh598w02(VS.80).aspx" rel="noreferrer">here</a> is a link to the MSDN writeup, and <a href="http://davidhayden... | <p>I agree, that for the ObjectDataSource the closing should be handled by its Select method. My ObjectDataSource Select method returns a SqlDataReader. My concern is ... will the SqlDataReader be rendered useless when closed after returning it to the UI. e.g. see the following sample code. I have not tried it and don'... | 27,011 |
<p>I am using StretchImage because the box is resizable with splitters. It looks like the default is some kind of smooth bilinear filtering, causing my image to be blurry and have moire patterns. </p>
| <p>I needed this functionality also. I made a class that inherits PictureBox, overrides <code>OnPaint</code> and adds a property to allow the interpolation mode to be set:</p>
<pre><code>using System.Drawing.Drawing2D;
using System.Windows.Forms;
/// <summary>
/// Inherits from PictureBox; adds Interpolation Mo... | <p>When resizing an image in .net, the System.Drawing.Drawing2D.InterpolationMode offers the following resize methods:</p>
<ul>
<li>Bicubic</li>
<li>Bilinear</li>
<li>High</li>
<li>HighQualityBicubic</li>
<li>HighQualityBilinear</li>
<li>Low</li>
<li>NearestNeighbor</li>
<li>Default</li>
</ul>
| 4,885 |
<p>I'm interested in finding out how the recently-released (<a href="http://mirror.facebook.com/facebook/hive/hadoop-0.17/" rel="noreferrer">http://mirror.facebook.com/facebook/hive/hadoop-0.17/</a>) Hive compares to HBase in terms of performance. The SQL-like interface used by Hive is very much preferable to the HBase... | <p>It's hard to find much about Hive, but I found this <a href="http://wiki.apache.org/hadoop/Hive" rel="noreferrer">snippet</a> on the Hive site that leans heavily in favor of HBase (bold added):</p>
<p>Hive is based on Hadoop which is a batch processing system. Accordingly, this system does not and <strong>cannot pr... | <p>To compare Hive with Hbase, I'd like to recall the definition below:</p>
<blockquote>
<p>A database designed to handle transactions isn’t designed to handle
analytics. It isn’t structured to do analytics well. A data warehouse,
on the other hand, is structured to make analytics fast and easy.</p>
</blockquote... | 4,391 |
<p>I have a web application written in C# that consumes several internal web services. We have a development tier, a testing tier, and a production tier. Also, we use the <code>WSDL.exe</code> command to generate a <code>Proxies.cs</code> file for a given tier's web services.</p>
<p>When we are ready to deploy our c... | <p>There are a number of way to do it. A NAnt build script will do it, but I think the most commonly accepted method now is to use MSBuild. See <a href="http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx" rel="nofollow noreferrer">MSDN</a> for details.</p>
| <p>Our company uses a combination of NANT + Cruise Control + Custom Utility apps to build our products. More specifically, the <a href="http://nant.sourceforge.net/release/latest/help/tasks/exec.html" rel="nofollow noreferrer"> task</a> in NANT will allow you to fire off those command-line applications such as WSDL.ex... | 3,856 |
<p>I'm trying to set up a Creality Sprite Extruder on my Ender 3 Pro without using the kit (installing the extruder alone).</p>
<p>I can see <a href="https://store.creality.com/products/sprite-extruder-pro-kit-300%E2%84%83-printing?official-website-top=&spm=..product_0f7e137a-4505-43ca-958f-022f372863a0.products_di... | <p>Since I have been unable to find a way to fix the E3D V6 clone hotend I have instead replaced it with a Creality Mk 8 that I had on-hand, which has so far worked flawlessly.</p>
<p>I am assuming that the improved performance is related to the use of a shorter nozzle and/or the Bowden tube butting directly against th... | <p>I had issues with my all metal hot-end where I got heat creep. I ended up doing e-steps, PID tune, and ensuring my speed wasn't too slow either. Is your printer in an enclosure? I found that mine being in an enclosure caused the hotend to not cool sufficiently, so I had to lower the hot bed temp by 10 degrees and th... | 2,171 |
<p>In a multitasking operating system context, sometimes you hear the term round-robin scheduling. What does it refer to?<br>
What other kind of scheduling is there?</p>
| <p><strong>Round Robin Scheduling</strong></p>
<p>If you are a host in a party of 100 guests, round-robin scheduling would mean that you spend 1 minute (a fixed amount) per guest. You go through each guest one-by-one, and after 100 minutes, you would have spent 1 minute with each guest. More on <a href="http://en.wiki... | <p>Round robin is a simple scheduling algorithm where time is divided evenly among jobs without priority.</p>
<p>For example - if you have 5 processes running - each process will be allowed to run for 1/5 a unit of time before another process is allowed to run. Round robin is typically easy to implement in an OS.</p>
| 10,474 |
<p>While reading a file (ifstream), is there any way to direct it to make a new line?</p>
<p>For instance, I would like for THIS to happen:</p>
<p>myfile>>array[1]>>array[2]>>endl;</p>
<p>Obviously, the "endl" just isn't allowed. Is there another way to do this?</p>
<p>Edit---thanks for the quick responses guys! <... | <p>Read your two items, then call <code>myfile.ignore(8192, '\n')</code></p>
| <p>This should work:</p>
<pre><code>stringstream stream;
string sLine;
int iLine;
while (cin)
{
getline(cin, sLine);
stream << sLine;
stream >> data[iLine][0] >> data[iLine][1];
}
</code></pre>
<p>Customized version of an earlier answer.</p>
| 49,750 |
<p>I have an application which is .NET 2.0, running on Windows XP Professional. This app uses the Serial Port to communicate with some custom devices.</p>
<p>For some reason, a few of our custom built PCs have an issue with the Serial Port, where it will stop functioning after a few weeks of use. Other that auto-reb... | <p>I've used Sax CommStudio in the past, but now I just use System.IO.Ports.SerialPort.</p>
<p>By any chance are you using a USB serial port? I've had problems with those going BSOD and whatnot. If that's the case, you have a driver problem, not a software problem.</p>
<p>If you want to do some troubleshooting outsid... | <p>You mention you are running on Windows XP and .NET 2.0, .NET may well be your problem since there are bugs affecting serial ports in most versions of .NET. The minimum version that I'd recommend for using serial ports is .NET 3.5 SP1.</p>
<p>See also:
<a href="http://blog.zachsaw.com/2010/07/net-serialport-woes.htm... | 43,483 |
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/210564/pdo-prepared-statements">PDO Prepared Statements</a> </p>
</blockquote>
<p>I'm using the mysqli extension in PHP and I'm wondering, is there possibly any way to see a prepared query as it will be execute... | <p>Turn on <a href="http://dev.mysql.com/doc/refman/5.0/en/query-log.html" rel="noreferrer">mysql query logging</a> and it will log all queries to a text file for you to review.</p>
| <p>See it where?
If it's your code you have the query and you have the prepared parameters, log them separately or replace in the original query string.
If the binding will fail you will get an error, otherwise you should expect the same values to be "filled" in as you specified them.</p>
| 39,246 |
<p>If I have a query like, </p>
<pre><code>DELETE FROM table WHERE datetime_field < '2008-01-01 00:00:00'
</code></pre>
<p>does having the <code>datetime_field</code> column indexed help? i.e. is the index only useful when using equality (or inequality) testing, or is it useful when doing an ordered comparison as... | <p>Maybe. In general, if there is such an index, it will use a range scan on that index if there is no "better" index on the query. However, if the optimiser decides that the range would end up being too big (i.e. include more than, say 1/3 of the rows), it probably won't use the index at all, as a table scan would be ... | <p>Except you don't have this bug in mysql <a href="http://bugs.mysql.com/bug.php?id=58190" rel="nofollow">http://bugs.mysql.com/bug.php?id=58190</a></p>
| 15,346 |
<p>I started using a a library which I reference from the GAC during development. I want the dll included in the project bin directory when I promote it to the webserver. I also need my local and the server web.config to be different. Before I started using this library I really enjoyed using the publish website featur... | <p>Regarding the web.config deployment problem: Scott Guthrie wrote about here:</p>
<p><a href="http://weblogs.asp.net/scottgu/archive/2007/09/21/tip-trick-automating-dev-qa-staging-and-production-web-config-settings-with-vs-2005.aspx" rel="noreferrer"><strong>Tip/Trick: Automating Dev, QA, Staging, and Production Web... | <p>I found that making production Web.Config readonly on target server works fine when Publishing with Visual Studio 2010. </p>
<p>Hope this helps.</p>
| 40,584 |
<p>I frequently have problems dealing with <code>DataRows</code> returned from <code>SqlDataAdapters</code>. When I try to fill in an object using code like this:</p>
<pre><code>DataRow row = ds.Tables[0].Rows[0];
string value = (string)row;
</code></pre>
<p>What is the best way to deal with <code>DBNull's</code> in ... | <p>Nullable types are good, but only for types that are not nullable to begin with.</p>
<p>To make a type "nullable" append a question mark to the type, for example: </p>
<pre><code>int? value = 5;
</code></pre>
<p>I would also recommend using the "<code>as</code>" keyword instead of casting. You can only use the... | <p>If you are concerned with getting DBNull when expecting strings, one option is to convert all the DBNull values in the DataTable into empty string.</p>
<p>It is quite simple to do it but it would add some overhead especially if you are dealing with large DataTables. Check this <a href="http://www.ddejan.com/post/20... | 4,640 |
<p>I want to introduce some tracing to a C# application I am writing. Sadly, I can never really remember how it works and would like a tutorial with reference qualities to check up on every now and then. It should include:</p>
<ul>
<li>App.config / Web.config stuff to add for registering TraceListeners</li>
<li>how to ... | <p>I followed around five different answers as well as all the blog posts in the previous answers and still had problems. I was trying to add a listener to some existing code that was tracing using the <code>TraceSource.TraceEvent(TraceEventType, Int32, String)</code> method where the <code>TraceSource</code> object wa... | <p>DotNetCoders has a starter article on it: <a href="http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=50" rel="nofollow noreferrer">http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=50</a>. They talk about how to set up the switches in the configuration file and how to write the code, ... | 4,725 |
<p>I have a program that uses the built in webbrowser control. At some point during the usage of this, I'm not sure at what point, but it appears to be random, I get the following error:</p>
<pre><code>System.AccessViolationException
FullText = System.AccessViolationException: Attempted to read or write protected me... | <p>We have recently had a similar problem on the machines of several customers. The problem turned out to be a bug in the MSHTML control in certain environments. A common symptom for the problem seems to be the broken registration of the jscript.dll library.</p>
<p>Symptoms that may help to diagnose if it's the same pr... | <p>Just a suggestion, I'm no expert on this but have used the WebBrowser a lot in previous applications, but why dont you write a function to wait 1 second before attempting to pass the browser anything and always check the readystate beforehand aswell.
Might slow it down a bit but it should make it bullet proof. :)</p... | 21,567 |
<p>And on top of that, are there cases where one has to use the global assembly cache or where one cannot use it?</p>
| <ul>
<li>Loading assemblies from GAC mean less overhead and security that your application will always load correct version of .NET library</li>
<li>You shouldn't ngen assemblies that are outside of GAC, because there will be almost no performance gain, in many cases even loss in performance.</li>
<li>You're already us... | <p>In all my life, I have had maybe one application where I had to put an assembly in the GAC, simply because these assemblies were part of a framework that a number of applications would use it, and it seemed right to put them into the GAC.</p>
| 4,349 |
<p>I understand that I can specify system properties to Tomcat by passing arguments with the -D parameter, for example "<strong>-Dmy.prop=value</strong>".</p>
<p>I am wondering if there is a cleaner way of doing this by specifying the property values in the context.xml file or some other tomcat configuration file. I w... | <p>(Update: If I could delete this answer I would, although since it's accepted, I can't. I'm updating the description to provide better guidance and discourage folks from using the poor practice I outlined in the original answer).</p>
<p>You can specify these parameters via context or environment parameters, such as ... | <p>If you want to define an environment variable in your context base on documentation you shod define them as below </p>
<pre><code><Context ...>
...
<Environment name="maxExemptions" value="10"
type="java.lang.Integer" override="false"/>
...
</Context>
</code></pre>
<p>Also use the... | 48,716 |
<p>I have an assembly that may be used by more than one process at a time. If I am using a static class, would the multiple processes all use the same "instance" of that class? </p>
<p>Since the processes are separate, would these be running under difference Application Domains, hence have the static "instances" sep... | <p>Multiple threads would share an instance. For this reason a static class can be convenient for passing state between threads, but you need to be very careful not to introduce race conditions (<code>Monitor</code> or <code>lock</code> your properties).</p>
<p>However, multiple <em>processes</em> should be in separa... | <p>The scope of a static class is limited to the application domain. Each app domain will have its own copy of any static variables you might have. If your "processes" are threads within the same app domain, then they will share the static values. But if they are actual separate Windows processes, then they will have d... | 36,097 |
<p>It looks like if I load dynamic content using <code>$.get()</code>, the result is cached in browser.</p>
<p>Adding some random string in QueryString seems to solve this issue (I use <code>new Date().toString()</code>), but this feels like a hack. </p>
<p>Is there any other way to achieve this?
Or, if unique string... | <p>I use <code>new Date().getTime()</code>, which will avoid collisions unless you have multiple requests happening within the same millisecond:</p>
<pre><code>$.get('/getdata?_=' + new Date().getTime(), function(data) {
console.log(data);
});
</code></pre>
<p><strong>Edit:</strong> This answer is several years ... | <p>append <code>Math.random()</code> to the request url</p>
| 48,004 |
<p>I have a <code>DataGridView</code> bound to a <code>DataView</code>. The grid can be sorted by the user on any column.</p>
<p>I add a row to the grid by calling NewRow on the <code>DataView</code>'s underlying <code>DataTable</code>, then adding it to the <code>DataTable</code>'s Rows collection. How can I select t... | <p>As soon as you update the bound DataTable, a "RowsAdded" event is fired by the DataGridView control, with the DataGridViewRowsAddedEventArgs.RowIndex property containing the index of the added row.</p>
<pre><code>//local member
private int addedRowIndex;
private void AddMyRow()
{
//add the DataRow
... | <p>Assuming you have some sort of unique identifier in your data source you could iterate over your collection of rows and compare, as such:</p>
<pre><code>Dim myRecentItemID As Integer = 3
For Each row As GridViewRow In gvIndividuals.Rows
Dim drv As DataRowView = DirectCast(row.DataItem, DataRowView)
If CInt... | 23,233 |
<p>I am using Excel where certain fields are allowed for user input and other cells are to be protected. I have used Tools Protect sheet, however after doing this I am not able to change the values in the VBA script. I need to restrict the sheet to stop user input, at the same time allow the VBA code to change the cell... | <p>Try using </p>
<pre><code>Worksheet.Protect "Password", UserInterfaceOnly := True
</code></pre>
<p>If the UserInterfaceOnly parameter is set to true, VBA code can modify protected cells.</p>
| <p>I selected the cells I wanted locked out in sheet1 and place the suggested code in the open_workbook() function and worked like a charm.</p>
<pre><code>ThisWorkbook.Worksheets("Sheet1").Protect Password:="Password", _
UserInterfaceOnly:=True
</code></pre>
| 15,246 |
<p>So I've got maybe 10 objects each of which has 1-3 dependencies (which I think is ok as far as loose coupling is concerned) but also some settings that can be used to define behavior (timeout, window size, etc).</p>
<p>Now before I started using an Inversion of Control container I would have created a factory and m... | <p>The relationship between class complexity and the size of the IoC constructor had not occurred to me before reading this question, but my analysis below suggests that having many arguments in the IoC constructor is a <a href="https://stackoverflow.com/questions/114342/what-are-code-smells-what-is-the-best-way-to-cor... | <p>It all depends upon what kind of container that you have used to do the IOC and what approaches the container takes whether it uses annotations or configuration file to saturate the object to be instiantiated. Furthermore, if your constructor parameters are just plain primitive data types then it is not really a b... | 14,970 |
<p>I am using Infragistics UltraGrid in a Windows Forms application.<br>
I need an event which is raised on cell value change.<br>
I've tried many events like <code>AfterCellActivate</code>, <code>AfterCellUpdate</code> but was unable to find the right one. </p>
| <p>AfterCellUpdate is what you want, but you may need to call:</p>
<ul>
<li>YourGridControl.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode)</li>
<li>YourGridControl.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode)</li>
</ul>
<p>to actually trigger the update, depend... | <p>AfterCellUpdate should be the right event...
Make sure the event is enabled in the EventManager!</p>
| 40,515 |
<p>To calculate a top position for an element of variable height, I was thinking of doing the following:</p>
<ol>
<li>Move the element 1000px off the top of the viewport</li>
<li>Set the element to display: block</li>
<li>Get the height of the element</li>
<li>Set the element to display: none</li>
<li>Continue on as i... | <p>I'd look at <a href="http://prototypejs.org/assets/2008/9/29/prototype-1.6.0.3.js" rel="nofollow noreferrer">prototype's implementation</a> of <code>getDimensions</code>.</p>
<p>It sets the position to absolute, visibility to hidden, and display to block briefly. I've written one which handles getting the height of... | <p>can you not just set the visibility to hidden and get the offsetHeight?</p>
| 38,594 |
<p>I have Sun webserver iws6 (iplanet 6) proxying my bea cluster.
My cluster is under /portal/yadda.
I want anyone who goes to </p>
<pre><code>http://the.domain.com/
</code></pre>
<p>to be quickly redirected to </p>
<pre><code>http://the.domain.com/portal/
</code></pre>
<p>I have and index.html that does a post and... | <p>Does this help?
<a href="http://docs.sun.com/source/816-5691-10/essearch.htm#25618" rel="nofollow noreferrer">http://docs.sun.com/source/816-5691-10/essearch.htm#25618</a></p>
<hr>
<p>To map a URL, perform the following steps:</p>
<p>Open the Class Manager and select the server instance from the drop-down list.</... | <p>You should be able to configure the webserver to do a header redirect (301 or 302 depending on your situation) so it redirects without ever loading an HTML page. This can be done in PHP as well:</p>
<pre><code><?php
header("Location: http://www.example.com/"); /* Redirect browser */
/* Make sure that code belo... | 8,880 |
<p>Materials used in space need to not outgas significantly </p>
<p>An answer to this question: <a href="https://3dprinting.stackexchange.com/questions/91/would-3d-printed-objects-outgas-in-vacuum?newreg=63cb72665132436c92ff1a842afac664">Would 3d-printed objects outgas in vacuum?</a></p>
<p>referred to the NASA outg... | <p>If you have a makerspace in your area, you'll likely find individuals with reasonable mechanical skills suitable for simple kit assembly. Most kits are engineered to be reasonable assembly, not rocket surgery. Makers are by nature capable of construction, often from raw materials, and kits are typically not particul... | <p>I agree that a local makerspace is a good option, but I will say this...</p>
<p>Buying a kit and building it yourself, even with some frustration and learning curves, will help immensely with your ability to calibrate and troubleshoot issues later. If someone else builds it for you, chances are if something goes w... | 720 |
<p>We have an application that does single sign-on using a centralized authentication server (CAS). We'd like to do single sign-out, such that if the user logs out of one application (say a front-end portal), the user is automatically signed out of all applications using the same single sign-on ticket.</p>
<p>The exp... | <p>After doing a bit of digging around and considering the answers provided so far I've come up with an alternative that lets me continue to use InProc session. Basically, it consists of extending the HttpModule that already handles single sign-on to detected CAS sign outs and redirect the browser to the application s... | <p>No can do.</p>
<p><a href="http://forums.asp.net/p/416094/416094.aspx#416094" rel="nofollow noreferrer">http://forums.asp.net/p/416094/416094.aspx#416094</a></p>
| 32,179 |
<p>If I wanted to find checked check boxes on an ASP.NET page I could use the following LINQ query.</p>
<pre><code>var checkBoxes = this.Controls
.OfType<CheckBox>()
.TakeWhile<CheckBox>(cb => cb.Checked);
</code></pre>
<p>That works fine if the checkboxes are ... | <p>Take the type/ID checking out of the recursion, so just have a "give me all the controls, recursively" method, e.g.</p>
<pre><code>public static IEnumerable<Control> GetAllControls(this Control parent)
{
foreach (Control control in parent.Controls)
{
yield return control;
foreach(Contr... | <p>My suggestion to make the <code>AllControls</code> recursive is:</p>
<pre><code> public static IEnumerable<Control> AllControls(this Control parent)
{
foreach (Control control in parent.Controls)
{
yield return control;
}
foreach (Control control in parent.C... | 31,661 |
<p>I'm trying to add HyperLinkColumns dynamically to my GridView. I have the following code:</p>
<pre><code>HyperLinkColumn objHC = new HyperLinkColumn();
objHC.DataNavigateUrlField = "title";
objHC.DataTextField = "Link text";
objHC.DataNavigateUrlFormatString = "id, title";
objHC.DataTextFormatString = "{2}";
GridV... | <p>You might want to add it when the row is binded:</p>
<pre><code>protected void yourGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
HyperLink hlControl = new HyperLink();
hlControl.Text = e.Row.Cells[2].Text; //Take back the text (let say you want it in cell of index 2)
hlControl.N... | <p>It seems you have got things mixed up. I don't know - how that code compiles?</p>
<p>GridView's column collection can accept columns of type "DataControlField".
I think you need to initialize HyperLinkField and set relevant properties (text, NavigateUrl, HeaderText, Target) and add it to the columns collection.</p>... | 42,047 |
<p>I am using Carbide (just upgraded to 2.0) to develop an S60 3rd Edition application.</p>
<p>I would like to know the easiest way to change the icon (both the application icon on the device menu <strong>and</strong> the icon at the top left of the main view) because I have the need to skin my application in many dif... | <p>To change the app icon when you run your app use (in the status bar):</p>
<pre><code>CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
CAknContextPane* cp=(CAknContextPane *)sp->ControlL(TUid::Uid(EEikStatusPaneUidContext));
_LIT(KContextBitMapFile, "my_bitmap_file.mbm");
CFbsBitmap* bitmap = iEi... | <p>With latest QMake and Qt SDK (4.6.2) you don't need to create any .mif file yourself. An SVG file will do.</p>
<p>For more detailed instructions see: <a href="http://qt-mobility.blogspot.com/2010/03/how-to-set-qt-application-icon-and.html" rel="nofollow noreferrer" title="How to Set Qt Application Icon and Title in... | 47,326 |
<p>Ubuntu has 8 run levels (0-6 and S), I want to add the run level 7.</p>
<p>I have done the following:</p>
<p>1.- Created the folder <strong>/etc/rc7.d/</strong>, which contains some symbolic links to <strong>/etc/init.d/</strong></p>
<p>2.- Created the file <strong>/etc/event.d/rc7</strong> This is its content:</... | <p>You cannot; the runlevels are hardcoded into the utilities. But why do you need to? Runlevel 4 is essentially unused. And while it's not the best idea, you could repurpose either runlevel 3 or runlevel 5 depending on if you always/never use X.</p>
<p>Note that some *nix systems have support for more than 6 runlevel... | <p>I'm not sure how to add them (never needed to), but I'm pretty sure <code>/etc/inittab</code> is where you'd add runlevels.</p>
<p>Although I'd have to agree with Zathrus that other runlevels are available but unused. On Debian, only 1 and 2 are used, really. I'm not sure how Ubuntu has it set up, though. However, ... | 13,803 |
<p>I am trying to parse JSON in an Adobe Flex app, using http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/'>This Tutorial</p>
<p>Unfortunately, Flex Builder 3 is flagging a "Access of undefined property JSON" error on the line</p>
<p><code>var arr:Array = (JSON.decode(raw... | <p>You need to download, install, and reference the utility library that contains the JSON routines. See <a href="http://labs.macromedia.com/wiki/index.php/ActionScript_3:resources:apis:libraries#corelib" rel="noreferrer">http://labs.macromedia.com/wiki/index.php/ActionScript_3:resources:apis:libraries#corelib</a></p>
... | <p>Check your input file for validity. GI=GO.</p>
<p>I would try including in in a HTML page with Firefox + Firebug and seeing if you get a similar error there.</p>
| 35,269 |
<p>I have an Anet A8 and have a problem with my first layer. I printed nice prints but starting today the first layer is tearing in the middle:</p>
<p><a href="https://i.stack.imgur.com/4BiUc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4BiUc.jpg" alt="enter image description here"></a></p>
<p><... | <p>The great pics really help with the answerability of this question. From how catastrophic the failure is, and how it's clearly independent of any specialty needs for the particular print such as tiny bed-adhesion contacts, sharp overhangs, bridges, etc. this is definitely not a problem with temperature. Different pe... | <p>I found the solution to be the exact opposite. My bed was too low (as in too far from the hotend). All the above mentioned aside, I did also drop the flow rate on the brim and initial layer by roughly 2-3 %. Now it prints perfectly again. (your mileage may vary)</p>
| 1,447 |
<p>I am looking for any strategies people use when implementing server applications that service client TCP (or UDP) requests: design patterns, implementation techniques, best practices, etc.</p>
<p>Let's assume for the purposes of this question that the requests are relatively long-lived (several minutes) and that th... | <p>The modern approach is to make use of the operating system to multiplex many network sockets for you, freeing your application to only processing active connections with traffic.</p>
<p>Whenever you open a socket it's associated it with a selector. You use a single thread to poll that selector. Whenever data arrive... | <p>G'day,</p>
<p>I'd start by looking at the metaphor you want to use for your thread framework.</p>
<p>Maybe "leader follower" where a thread is listening for incoming requests and when a new request comes in it does the work and the next thread in the pool starts listening for incoming requests.</p>
<p>Or thread p... | 5,213 |
<p>I can use properties of an Excel Worksheet to tell if the worksheet is protected (Worksheet.Protection, Worksheet.ProtectContents etc).</p>
<p>How can I tell using VBA if the entire workbook has been protected?</p>
| <p>Found the answer myself:</p>
<p>I need the <code>Workbook.ProtectStructure</code> and <code>Workbook.ProtectWindows</code> properties.</p>
| <p>Worksheet.ProtectedContents is what you would need to use, on each Worksheet.</p>
<p>So I would set up a loop like this:</p>
<pre><code>Public Function wbAllSheetsProtected(wbTarget As Workbook) As Boolean
Dim ws As Worksheet
wbAllSheetsProtected = True
For Each ws In wbTarget.Worksheets
If ws.ProtectCon... | 14,811 |
<p>Say I only needed to use findall() from the re module, is it more efficient to do:</p>
<pre><code>from re import findall
</code></pre>
<p>or </p>
<pre><code>import re
</code></pre>
<p>Is there actually any difference in speed/memory usage etc?</p>
| <p>There is no difference on the import, however there is a small difference on access.</p>
<p>When you access the function as</p>
<pre><code>re.findall()
</code></pre>
<p>python will need to first find the module in the global scope and then find findall in modules dict. May make a difference if you are calling i... | <p>There is no difference, except for what names from re are visible in you local namespace after the import.</p>
| 45,111 |
<p>I've gone through most of the example code and I still need some help. I want to make an uber-simple app: show one screen at startup with a label and a button. click the button and we slide over to another screen (I suppose these are called views) which has another label and the "back" button in the top menu bar.... | <p>Take a look at the NavBar sample on Apple's Developer website. <a href="http://developer.apple.com/iphone/library/samplecode/NavBar/index.html" rel="nofollow noreferrer"><a href="http://developer.apple.com/iphone/library/samplecode/NavBar/index.html" rel="nofollow noreferrer">http://developer.apple.com/iphone/librar... | <p>You can checkout how to get started with that using this tutorial: <a href="http://www.wattz.net/article/creating_a_simple_view_transitions_app/" rel="nofollow noreferrer">at wattz.net</a></p>
| 28,534 |
<p>Is it possible to use an ocx (ActiveX Control) on a winform (probably adding it programatically) without first having the ocx registered with regsrv32?</p>
<p>What I'm trying to achieve is to enable xcopy installation. I've had the "AxInterop.<em>.dll" and "Interop.</em>.dll" file generated from my dev machine.</p>... | <p>Yes, this can be done. You must assume your application will only be deployed on Windows XP (or Windows Server 2003) or later, and then you can use what is called 'registration free COM' to make this happen. </p>
<p>Essentially what you do is create a manifest file for the ActiveX control DLL so the Windows loade... | <p>After 10 hours of searching how to run VB6 app with OCX on Win7 without registering it and admin rights, I found few click solution here : <a href="http://mmm4vb6.atom5.com/yes-update-0-12-5479.html#c" rel="nofollow">http://mmm4vb6.atom5.com/yes-update-0-12-5479.html#c</a></p>
<p>Need to check Embed Manifest to mak... | 29,054 |
<p>Courses for people who are being introduced to programming very often include a code project, which I think is a nice way to learn. However, such projects often feel too artificial, and are thus not very rewarding to work on.</p>
<p>What are your ideas of rewarding code projects? (Preferably easy to begin, and exte... | <p>As has been stated a few times, what you are trying to teach the beginner is very important to the project.</p>
<p>My advice to you for planning something like this:</p>
<p>1) Avoid making a computer game</p>
<p>A computer game, while fun to build, doesn't reward the programmer with results early on (it's very co... | <p>It really depends on what you're trying to teach the beginner. If you're trying to teach syntax, then simple "Hello World" programs and ones that spit out every odd number between 1 and 100 are fine to get them started. If you're trying to teach data structures, then maybe something like a 20 questions game or som... | 4,635 |
<p>I can follow most of Apple's WiTap sample, but am sort of stumped on this bit in the send method:</p>
<pre><code>- (void) send:(const uint8_t)message
{
if (_outStream && [_outStream hasSpaceAvailable])
if([_outStream write:(const uint8_t *)&message maxLength:sizeof(const uint8_t)] == -1)
[se... | <p>Basically, <code>[view tag] | 0x80</code> is setting the high bit in that value (so 00010011 would become 10010011) and <code>[view tag] & 0x7f</code> is removing it (10010011 -> 00010011). </p>
<p>Take a look at the <code>[AppController stream:handleEvent:]</code> method. You'll see this code:</p>
<pre><code>... | <p>I believe the reason why is that the high-order bit is another piece of the data passed from one peer to the other. It specifies whether the message is for the "start" of the tap or the "end" of the tap. </p>
<p>Based on that bit, the receiver either activates the tap view or deactivates it.</p>
<p>So in essence, ... | 40,139 |
<p>If I do something like:</p>
<pre><code>$ cat /bin/ls
</code></pre>
<p>into my terminal, I understand why I see a bunch of binary data, representing the ls executable. But afterwards, when I get my prompt back, my own keystrokes look crazy. I type "a" and I get a weird diagonal line. I type "b" and I get a degree s... | <p>Because somewhere in your binary data were some control sequences that your terminal interpreted as requests to, for example, change the character set used to draw. You can restore everything to normal like so:</p>
<pre><code>reset
</code></pre>
| <p>If you really must dump binary data to your terminal, you'd have much better luck if you pipe it to a pager like <code>less</code>, which will display it in a slightly more readable format. (You may also be interested in <code>strings</code> and <code>od</code>, both can be useful if you're fiddling around with bina... | 14,754 |
<p>Session transcript:</p>
<pre><code>> type lookma.c
int main() {
printf("%s", "no stdio.h");
}
> cl lookma.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
lookma.c
Microsoft (R) Incremental Link... | <p>In strict compliance mode (that means "in theory"), you invoke undefined behaviour (which is bad) when you call a function that takes a variable number of arguments without a prototype declaration of the function in scope. That means that the compiler is allowed to do anything it likes with a program that uses <cod... | <p><code>printf()</code> is located in the standard C library and the linker always links the standard library to your executable, so any standard functions will be found and there will be no linking problems.</p>
<p>Failure to include the appropriate header results in using a function that wasn't prototyped that can l... | 43,693 |
<p>So I'm embarking on an <code>ASP.NET MVC</code> project and while the experience has been a good one overall, I'm not quite as pleased with the spaghetti mess that my controllers have become. I've looked around online (CodeCampServer, etc...) and they all seem to suffer the same issue wherein controller methods viol... | <p>ASP.NET Preview 5 (available on <a href="http://www.codeplex.com/aspnet" rel="noreferrer">CodePlex</a>) has an answer for this: the [AcceptVerbs] attribute. Phil Haack has a <a href="http://haacked.com/archive/2008/08/29/how-a-method-becomes-an-action.aspx" rel="noreferrer">blog post</a> discussion how it's used.</p... | <p>How are different people handling this issue? I know that i just spent a couple hours reviewing the jumble inside of the model folder. I'm finding creating folders is helpful in reducing the visual clutter, using matching namespaces helps alot too.</p>
<p>But my controllers are monoliths at the moment. the troub... | 5,689 |
<p>My development team uses source safe at a very basic level. We're moving into some more advanced and extended development cycles and I can't help but think that not using branching and merging in order to manage changes is going to be biting us very soon. </p>
<p>What arguments did you find most useful in order to ... | <p>First, teach them how to use SourceSafe in an efficient way. </p>
<p>If they are smart enough, they will begin to love the advantages of using a version-control system, and if so, they will soon reach the limits of SourceSafe. That's where they will be the more able to listen to your arguments for switching to a be... | <p>We used to use SourceSafe. Then, when I joined the team I was in a different location and even though we have a fairly good LAN when I tried to check out the latest version it took 40 minutes. I persuaded them to convert to CVS (we now use SVN) and the checkout time dropped to a couple of minutes. SourceSafe was ju... | 14,081 |
<p>What is the best way to determine how many window handles an application is using? Is there a tool or a WMI performance counter that I could use?</p>
<p>I would like to run up an app and watch a counter of some sort and see that the number of window handles is increasing. </p>
<pre><code>for (int i=0; i < 1000... | <p>Perfmon, which comes with your computer can do it. You can also add a column to your task manager processes tab (Handle Count).</p>
<p>Instructions for Perfmon</p>
<ol>
<li>Add a counter (click the +)</li>
<li>Choose Process under Performance object</li>
<li>Choose Handle Count under the counter list</li>
<li>Cho... | <p>The handle count shown by taskmanager is the same as the one shown by PerfMon</p>
<p>ProcessExplorer tool from sysinternals can list the different type of handles + their names a process uses and you can get a good idea by browsing that list about the composition of the handles your program uses. </p>
<p>But I'm a... | 24,035 |
<p>Is there any way for the main form to be able to intercept events firing on a subcontrol on a user control?</p>
<p>I've got a custom user-control embedded in the main Form of my application. The control contains various subcontrols that manipulate data, which itself is displayed by other controls on the main form.... | <p>The best practice would be to expose events on the <code>UserControl</code> that bubble the events up to the parent form. I have gone ahead and put together an example for you. Here is a description of what this example provides.</p>
<ul>
<li><code>UserControl1</code></li>
<li>Create a <code>UserControl</code> with... | <p>I would like to chime in that, as described, it actually sounds like you're chasing a red herring. While it seems like you have a situation where the lack of event bubbling in WinForms is causing you trouble, the reality is that a poor architecture is forcing you into needing event bubbling when you shouldn't.</p>
... | 19,723 |
<p>I am using ASP.NET 2.0 with AJAX Extensions (1.0?) and am wondering if it is possible to call a method asynchronously and have the results populate on the page after it has been loaded.</p>
<p>I have a gridview that is populated by a fairly long-running SQL query. I would prefer to have the page come up and the res... | <p>You can use an asp:UpdatePanel and insert the gridview in there. They just call the AJAX call during load. You use the Sys.Application.load event. Check it out here for more information: <a href="http://www.asp.net/ajax/documentation/live/overview/AJAXClientEvents.aspx" rel="nofollow noreferrer">http://www.asp.ne... | <p>You can place a hidden button inside your updatepanel and do a PostBack to that button.
Is not an elegant solution but it works fine.</p>
<p>Inside your updatepanel you will write something like this.</p>
<pre><code><div style="visibility:hidden">
<asp:Button ID="btnLoad" OnClick="btnLoad_Click" runat="... | 19,594 |
<pre><code>Function FillAdminAccount() As Boolean
FillAdminAccount = True
Try
SQLconn.ConnectionString = "connect timeout=9999999;" & _
"data source=" & DefaultIserver & ";" & _
"initial catalog=" & Defau... | <p>NEVER store actual passwords in the db. Now it looks like your passwords <em>might</em> not quite be plain text because of the convert/cast operations, but you still have a problem. At very least any encryption used is easily reversible, and if your sql server ever ends up on a different machine from the applicati... | <p>Could it be </p>
<pre><code>as varchar) as 'userpassword'
</code></pre>
<p>should be </p>
<pre><code>...as varchar) as [userpassword] ..
</code></pre>
<p>or</p>
<pre><code>...as varchar) as userpassword ..
</code></pre>
| 19,392 |
<p>I absolutely love the <a href="http://winscp.net/eng/docs/task_keep_up_to_date" rel="noreferrer">Keep Remote Directory Up-to-date</a> feature in <a href="http://winscp.net/" rel="noreferrer">Winscp</a>. Unfortunately, I can't find anything as simple to use in OS X or Linux. I know the same thing can <em>theoreticall... | <p>How "real-time" do you want the syncing? I would still lean toward rsync since you know it is going to be fully supported on both platforms (Windows, too, with cygwin) and you can run it via a cron job. I have a super-simple bash file that I run on my system (this does <em>not</em> remove old files):</p>
<pre><code... | <p>You can also use Fetch as an SFTP client, and then edit files directly on the server from within that. There are also SSHFS (mount an ssh folder as a Volume) options. This is in line with what stimms said - are you sure you want stuff kept in sync, or just want to edit files on the server?</p>
<p>OS X has it's ow... | 3,069 |
<p>I'm working with embedded C for the first time. Although my C is rusty, I can read the code but I don't really have a grasp on why certain lines are the way the are. For example, I want to know if a variable is true or false and send it back to another application. Rather than setting the variable to 1 or 0, the ori... | <p><code>0xFF</code> sets all the bits in a char. </p>
<p>The original implementer probably decided that the standard <code>0</code> and <code>1</code> wasn't good enough and decided that if all bits <em>off</em> is <em>false</em> then all bits <em>on</em> is <em>true</em>.</p>
<p>That works because in C any value ot... | <p>Here's a likely reason: <code>0xff</code> is the binary complement of <code>0</code>. It may be that on your embedded architecture, storing <code>0xff</code> into a variable is more efficient than storing, say, <code>1</code> which might require extra instructions or a constant stored in memory.</p>
<p>Or perhaps ... | 24,052 |
<p>Is there a way to mock object construction using JMock in Java? </p>
<p>For example, if I have a method as such:</p>
<pre class="lang-java prettyprint-override"><code>public Object createObject(String objectType) {
if(objectType.equals("Integer") {
return new Integer();
} else if (objectType.equal... | <p>The only thing I can think of is to have the create method on at factory object, which you would than mock. </p>
<p>But in terms of mocking a constructor call, no. Mock objects presuppose the existence of the object, whereas a constructor presuppose that the object doesn't exist. At least in java where allocation ... | <p>I hope there is none.
Mocks are supposed to mock interfaces, which have no constructors... just methods. </p>
<p>Something seems to be amiss in your approach to testing here. Any reason why you need to test that explicit constructors are being called ?<br>
Asserting the type of returned object seems okay for testi... | 11,743 |
<p>How can I read a Chinese text file using C#, my current code can't display the correct characters:</p>
<pre><code>try
{
using (StreamReader sr = new StreamReader(path,System.Text.Encoding.UTF8))
{
// This is an arbitrary size for this example.
string c = null;
while (sr.Peek() &... | <p>You need to use the right encoding for the file. Do you know what that encoding is? It might be UTF-16, aka Encoding.Unicode, or possibly something like Big5. Really you should try to find out for sure instead of guessing though.</p>
<p>As leppie's answer mentioned, the problem might also be the capabilities of the... | <p>I just encountered the same problem as yours and I solve it now. I think the main problem would be from txt editor. When you save text in .txt format using notepad, you can choose the encoding at the bottom. The default encoding is ANSI which does not support Chinese stream reading (depends on your computer) while U... | 43,689 |
<p>I am having trouble retrieving results from my datareader in visual studio 2008. I have several stored Procs in the same database. I am able to retrieve values from those that dont receive input parameters. However, when i use the executreReader() method on a stored proc with input parameters i get an empty dataread... | <p>Are you ever adding the parameters to the SqlCommand's Parameter collection? You mentioned that the ones that aren't working are the ones that take input params, yet in your code you don't have anything like this:</p>
<pre><code>cmdPopulateFilterDropDowns.Parameters.AddWithValue(...);
</code></pre>
| <p>When do you get the "IEnumerable returned no results" error? Could you show an example of how you're accessing the DataReader?</p>
<p>What happens if you set a breakpoint before the return, and run </p>
<pre><code>rdrFilterSearch.GetString(0);
</code></pre>
<p>in the immediate window?</p>
| 48,348 |
<p>We have built an application that receives several files in different formats, pdf, tiff, jpeg, doc, etc. After received, they are converted to tiff files using a third party printing driver which is installed locally on the server and set up as the default printer. In order to do that we open a System.Diagnostics.P... | <p>First thing I'd suggest is to <strong>have the service run under the context of a specific user</strong>. Then log into the server as that user and make sure that the printer is installed, set as the default, etc.</p>
<p>Secondly, <strong>ditch the MS Paint solution</strong> to simplify things. You can load the i... | <p>I'm not sure about the part about MSPaint... but if your app works as a console app but not as a service, chances are that the server doesn't have permission to do something that your user account does. </p>
<p>You might want try having the service log on as you to rule out permissions issues.</p>
| 32,870 |
<p>I have a performance problem with my ruby on my machine, which I think I have isolated to loading libraries (when #require is called), so I'm trying to work out whether ruby is searching too many folders for libraries.</p>
<p>When I run </p>
<pre><code>$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: ... | <p>Yep. That all looks pretty standard to me. My mac running MacOS 10.5 similarly has nothing in ~/.gem/ruby/1.8/gems/ and quite a bit in the other two locations.</p>
| <p>As Gabe mentioned, yes, this is normal.</p>
<p>A little more info:</p>
<p>/System/Library/Frameworks/Ruby.framework <-- used system wide for all users, usually owned by root.
When you 'sudo gem install ...' the gem you're installing goes here...</p>
<p>/Users/matt/.gem <-- user 'matt' has his own gem direct... | 30,376 |
<p>Just trying to make the enter key pressed after a time delay in vb6, all the examples I find don't seem to be working, any help?</p>
<p>Just trying to simulate a keystroke. Focus doesn't matter.</p>
| <p>You may need to supply more details. But IF you are trying to send a enter key to a VB6 authored application and it is not picking it up it usually the fact you didn't set the KeyPreview property of the form to true. Without the control with the current focus soaks up the keypress you sent.</p>
<p>If you authored t... | <p>If you are trying to trigger an event handler you could call it in code instead of sending a key press.</p>
| 41,689 |
<p>There's not a lot to add to the subject really.</p>
<p>I am after a free task board/ burndown reporting tool for Windows.</p>
| <p>If you're willing to host your tool,</p>
<ul>
<li>TargetProcess
(<a href="http://www.targetprocess.com/Product/agile_tour.aspx" rel="noreferrer">http://www.targetprocess.com/</a>)</li>
<li>XPlanner(<a href="http://xplanner.codehaus.org/" rel="noreferrer">http://xplanner.codehaus.org/</a>)</li>
</ul>
<p>If not,</p>
<... | <p>If your project is open source, non-profit or a classroom you can get free access to Atlassians' JIRA + Greenhopper (and other tools) for agile project management. Otherwise small teams can get access for a nominal fee. </p>
<p>see <a href="http://www.atlassian.com/software/greenhopper/overview" rel="nofollow">http... | 31,859 |
<p>For a rigorous marker of the source database state, I'd like to capture the @@DBTS
of an external database in a sproc. Yeah, I think I could issue </p>
<blockquote>
<code>
<br/>USE ExternalDB
<br/>GO
<br/>
<br/>SELECT @myVarbinary8 = @@DBTS
<br/>GO
<br/>
<br/>USE OriginalDB
<br/>GO
</code>
</blockquote>
<p>but, e... | <p>one way is to put that scalar function in the master database and mark it as system object. that way it gets called in the context of the current database
see here for more info:
<a href="http://weblogs.sqlteam.com/mladenp/archive/2007/01/18/58287.aspx" rel="nofollow noreferrer">http://weblogs.sqlteam.com/mladenp/ar... | <p>Thanks for the info, Mladen, that tip is good to know :)</p>
<p>But while that helps me call a function residing in master from in the current database context "ContextCurrent", what I really want is to be able to call the scalar-valued function from the context of the source database "ContextSource".</p>
<p>While... | 33,399 |
<p>I've read about and dabbled with some including active record, repository, data transfer objects. Which is best?</p>
| <p>'Best' questions are not really valid. The world is filled with combination and variations. You should start with the question that you have to answer: What problem are you trying to solve. After you answer that you look at the tools that work best with the issue.</p>
| <p>It really depends on your task. At least you should know and <em>understand</em> all database access patterns to choose one most suitable for current problem.</p>
| 12,933 |
<p>Java process control is notoriously bad - primarily due to inadequate support by the Java VM/JDK classes (e.g. java.lang.Process).</p>
<p>I am wondering, are there any good open source libraries out there that are reliable.</p>
<p>The requirements would be:</p>
<ol>
<li>OSS</li>
<li>Start/Stop processes</li>
<li>... | <p><a href="http://wrapper.tanukisoftware.org/doc/english/download.jsp" rel="noreferrer">Java Service Wrapper</a> might be what you're looking for. It's cross-platform, can be used to start things as a Windows service, capture IO, and generally completely manage any java app. It's very light weight and well designed. A... | <p>One more requirement... cross platform support for killing of an orphaned process. With <code>java.lang.Process</code> (and Apache Commons Exec), there is no way to kill external processes when the Java application does a hard stop (kill -9). I'd really like to find a library that can handle the problem better.</p>
... | 23,483 |
<p>1.exe doesn't give enough time for me to launch the IDE and attach 1.exe to the debugger to break into.</p>
| <p>I would suggest taking the same approach as with NT services in this case. They will also start and usually not give you enough time to attach the debugger for the start-up routines.</p>
<p>Details are described here: <a href="http://www.debuginfo.com/articles/debugstartup.html" rel="noreferrer">http://www.debuginf... | <p>I assume you have the source to 1.exe (if you're debugging it), then just insert a statement near the beginning that will cause it to hang around long enough to attach a debugger. ( getch() if you're desperate and it's not interactive. )</p>
<p>After the attach, just skip to the next statement and let it go.</p>
| 10,142 |
<p>I personally don't use FxCop yet. We want to work out the unit testing first before going with code analysis. However, which rules would you permanantly deactivate? Which rules would you deactivate temporarily and in which situation?</p>
| <p>I dislike rule CA1021: Avoid out parameters. Out parameters are useful for many different patterns (including the .Net Try* pattern). Out can certainly be overused but really it seems overkill to have an FxCop rule for it. </p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms182131(VS.80).aspx" rel="nofollo... | <p>It complains about "ID" and suggests "Id"... even though that follows the "two-character-abbreviations-are-all-capped" rule :O)</p>
| 32,104 |
<p>I have a table of events, I need to find all tail events of type 1 and all head events of type 1. </p>
<p>So, for the set of events in this order [1, 1], 3, 1 ,4, 5, [1,1,1] the brackets denote head and tail events of type 1. </p>
<p>This is much better illustrated in SQL:</p>
<pre><code>drop table #event
go
cre... | <p>To generate a large subset of data you can use this: </p>
<pre><code>declare @i int
set @i = 10000
while @i > 5
begin
insert into #event values (@i, '2000-01-01', 1)
insert into #event values (@i, '2000-01-02', 1)
insert into #event values (@i, '2000-01-03', 3)
insert into #event values (@i,... | <p>From what I understand you are after is the head and tail, ordered by day**, for each ID**. The head and tail being all the records until record where the type is not one is encountered.</p>
<p>This is a different way of doing it, it may be faster</p>
<pre><code>;WITH Ranked AS (
SELECT
*,
Row... | 36,387 |
<p>Simple question; what's better and why?</p>
<pre><code>
out.resize( in.size() );
T1::iterator outit = out.begin();
for( inIt = in.begin() to end, ++inIt, ++outIt )
*outit = *inIt
OR
out.erase();
for( inIt = in.begin() to end, ++inIt )
out.push_back( inIt );
</code></pre>
<p>I... | <p>The second, and if you're concerned about multiple extensions use out.reserve(). The right answer to adding to a vector is almost always push_back or back_inserter, which avoid some possible problems (exception guarantees, constructors, writing past the end, for example) that you'd have to pay attention to with oth... | <p>I prefer push_back over array assignment as push_back will work with or without randomaccessiterators. Array assignment requires them. If you force randomaccessiterators now you can't easily change the container in the future. Of course, to avoid resize issues you call vector::capacity instead of resize.</p>
| 49,976 |
<p>What's the best lifetime model for a <code>DataContext</code>? Should I just create a new one whenever I need it (aka, function level), should I keep one available in each class that would use it (class level), or should I create a static class with a static DataContext (app-domain level)? Are there any considered b... | <p>You pretty much need to keep the same data context available throughout the lifetime of the operations you want to perform if you're ever going to be storing changes which are to be <code>.SubmitChanges()</code>'d later, as otherwise you will lose those changes.</p>
<p>If you're just querying stuff then it's fine t... | <p>I think Jeff Atwood talked about this in the <a href="http://herdingcode.com/?p=36" rel="nofollow noreferrer">Herding Code podcast</a>, when he was questioned about the exact same thing. Listen to it towards the last 15-20 minutes or so.</p>
<p>I think in SO, the datacontext is created in the Controller class. Not ... | 5,342 |
<p>When using topfunky's <a href="http://nubyonrails.com/articles/automation-with-rstakeout" rel="nofollow noreferrer">RStakeout</a>, the color in the result of the <code>spec</code> command is lost. This happens even when adding the <code>--color</code> flag.</p>
| <p>You have to set the environment variable <code>AUTOTEST</code> to true. Spec detects whether it is being run by a process and disables color if it is (to make the output easier to parse).</p>
<p>To set the environment variable in bash:</p>
<pre><code>export AUTOTEST=true
</code></pre>
<p>or in fish:</p>
<pre><co... | <p>You have to set the environment variable <code>AUTOTEST</code> to true. Spec detects whether it is being run by a process and disables color if it is (to make the output easier to parse).</p>
<p>To set the environment variable in bash:</p>
<pre><code>export AUTOTEST=true
</code></pre>
<p>or in fish:</p>
<pre><co... | 39,628 |
<p>I am dealing with <a href="http://framework.zend.com/manual/en/zend.form.html" rel="nofollow noreferrer"><code>Zend_Form</code></a> right now and I am having a difficult time figuring out how to:</p>
<ol>
<li>Use custom images for form buttons and,</li>
<li>Insert text and links in specific places (in my case I wan... | <p>I think Zend_Form_Decorators may help you: <a href="http://framework.zend.com/manual/en/zend.form.decorators.html" rel="nofollow noreferrer">http://framework.zend.com/manual/en/zend.form.decorators.html</a></p>
| <p>You can write straight up HTML in your view, just make sure that the element names, select options, hidden values etc. correspond to your Zend_Form elements (or set the element decorators to just ViewHelper and use <code>echo $this->form->element</code> where the elements should be). It's just the same POST data any... | 42,971 |
<p>Hello fellow stackoverflowers!</p>
<p>I have a word list of 200.000 string entries, average string length is around 30 characters. This list of words are the key and to each key i have a domain object. I would like to find the domain objects in this collection by only knowing a part of the key. I.E. the search stri... | <h2>Suffix Array and <em>q</em>-gram index</h2>
<p>If your strings have a strict upper bound on the size you might consider the use of a <a href="http://en.wikipedia.org/wiki/Suffix_array" rel="noreferrer"><strong>suffix array</strong></a>: Simply pad all your strings to the same maximum length using a special charact... | <p>Would you get any advantage having your trie keys comparable to the size of the machine register? So if you are on a 32bit box you can compare 4 characters at once instead of each character individually? I don't know how bad that would increase the size of your app.</p>
| 24,704 |
<p>I have a label function like :</p>
<pre><code>private function formatDate (item:Object, column:DataGridColumn):String
{
var df:DateFormatter = new DateFormatter();
df.formatString = "MM/DD/YY";
if (column.dataField == "startDate") {
return df.format(item.startDate);
}
return "ERR";
}
<... | <p>You can define another function, let's call it <code>partial</code> that binds some extra arguments to your function:</p>
<pre><code>function partial( func : Function, ...boundArgs ) : Function {
return function( ...dynamicArgs ) : * {
return func.apply(null, boundArgs.concat(dynamicArgs))
}
}
</code></pre>... | <p>here is more generic way:</p>
<pre><code>public static function getDateLabelFunction(dateFormatString:String=null, mxFunction:Boolean = false) : Function {
var retf:Function;
// defaults
if(dateFormatString == null) dateFormatString = "MM/DD/YY";
if(mxFunction) {
retf = ... | 38,589 |
<p>I can't seem to find an answer to this problem, and I'm wondering if one exists. Simplified example:</p>
<p>Consider a string "nnnn", where I want to find all matches of "nn" - but also those that overlap with each other. So the regex would provide the following 3 matches:</p>
<ol>
<li><b>nn</b>nn</li>
<li>n<b>nn<... | <p>Update 2016:</p>
<p>To get <code>nn</code>, <code>nn</code>, <code>nn</code>, <a href="https://stackoverflow.com/users/772095/sdjmchattie">SDJMcHattie</a> proposes in <a href="https://stackoverflow.com/questions/320448/overlapping-matches-in-regex/320478?noredirect=1#comment57488084_320478">the comments</a> <a href=... | <p>AFAIK, there is no pure regex way to do that at once (ie. returning the three captures you request without loop).</p>
<p>Now, you can find a pattern once, and loop on the search starting with offset (found position + 1). Should combine regex use with simple code.</p>
<p>[EDIT] Great, I am downvoted when I basicall... | 41,450 |
<p>Why is using '*' to build a view bad ?</p>
<p>Suppose that you have a complex join and all fields may be used somewhere.</p>
<p>Then you just have to chose fields needed.</p>
<pre><code>SELECT field1, field2 FROM aview WHERE ...
</code></pre>
<p>The view "aview" could be <code>SELECT table1.*, table2.* ... FROM ... | <p>I don't think there's much in software that is "just bad", but there's plenty of stuff that is misused in bad ways :-)</p>
<p>The example you give is a reason why * might not give you what you expect, and I think there are others. For example, if the underlying tables change, maybe columns are added or removed, a ... | <p>And if you have joins using select * automatically means you are returning more data than you need as the data in the join fields is repeated. This is wasteful of database and network resources. </p>
<p>If you are naive enough to use views that call other views, using select * can make them even worse performers (... | 32,853 |
<p>I have a form that is sending in sizes of things, and I need to see what the strings are equal to so that I can set the price accordingly. When i try to do this, it says that they are not equal, and i get no prices. This is the code i'm using:</p>
<pre><code>if ($_POST['sizes'] == "Small ($30)"){$total = "30";}
if ... | <p>What <a href="https://stackoverflow.com/questions/184703/compare-strings-given-in-post-with-php/184737#184737">Paul Dixon said</a> is correct. Might I also recommend using a switch statement instead of that clunky chunk of if statements (which actually has a logic bug in it, I might add - <code>$total</code> will a... | <p>Is $total a string? </p>
<p>$total = "30"; is the syntax for a string. $total = 30; would be correct for Numeric. </p>
| 22,338 |
<p>The login page in my Tapestry application has a property in which the password the user types in is stored, which is then compared against the value from the database. If the user enters a password with multi-byte characters, such as:</p>
<pre><code>áéíóú
</code></pre>
<p>...an inspection of the return value of ge... | <p>VPC to Hyper-V is one way.</p>
| <p>You should review Windows 2008 R2 SP1 upgrade with RemoteFX, it comes with a new video driver for VM's that allow 3D, extended desktops and more. It will help resolve some of the issues you are seeing today.</p>
<p>Both the Host server and VM need to be running SP1 of Windows 2008 R2.</p>
<p><a href="http://blogs.... | 6,478 |
<p>As <a href="https://blog.stackoverflow.com/2008/09/podcast-20/">Jeff Atwood asked</a>: "What’s your logging philosophy? Should all code be littered with <code>.logthis()</code> and <code>.logthat()</code> calls? Or do you inject logging after the fact somehow?"</p>
| <p>My logging philosophy is pretty easily summarized in four parts:</p>
<p>Auditing, or business logic logging</p>
<blockquote>
<p>Log those things that are required to be logged. This comes from the application requirements, and may include logging every change made to any database (as in many financial applications)... | <p>I agree with Adam, but I also would consider logging things of interest or things that you can demonstrate as achievements as a kind of proof of them happening.</p>
| 6,633 |
<p>I'm running some <a href="http://jakarta.apache.org/jmeter/" rel="noreferrer">JMeter</a> tests against a Java process to determine how responsive a web application is under load (500+ users). JMeter will give the response time for each web request, and I've written a script to ping the Tomcat Manager every X seconds... | <p>Use <code>top -b</code> (and other switches if you want different outputs). It will just dump to stdout instead of jumping into a curses window.</p>
| <p>also use 1 as iteration count, so you will get current snapshot without waiting to get another one in $delay time.</p>
<pre><code>top -b -n 1
</code></pre>
| 7,305 |
<p>I've long toyed with the idea of some kind of auto-cleanup page that performs routine maintenence tasks and is called out of scope of the current page execution by means of calling a 1x1 pixel gif with the asp.net page as the src parameter. One thing I've never really decided on, however, is how to handle the timing... | <p>I have come across this situation many times and I generally just end up using task scheduler to just call the page, that way it is consistent and reliable. The problem with relying on a page to be called is that you have to be sure that there will always be requests to your page. If you can guarantee that, then jus... | <p>I would set a timer and run the cleanup task when the timer fires. If you'd like to base the cleanup on the number of requests, you could make a shorter timer interval and then check the request count when the timer fires; if the request count is too low, then skip the cleanup.</p>
| 37,232 |
<p>If i can use</p>
<pre><code><td><textarea><bean:write name="smlMoverDetailForm" property="empFDJoiningDate"/>
</textarea></td>
</code></pre>
<p>to displace a value how can i use the struts tags to save a vaiable to the sesssion </p>
<p>in sudo code</p>
<pre><code>session.setAttribut... | <p>I don't think so.
Struts tags are only available in jsp pages.</p>
<p>But you can do something like this:</p>
<p>if the bean smlMoverDetailForm is in scope request</p>
<pre><code>session.setAttribute("test",((THECLASSOFTHEBEAN)request.getAttribute("smlMoverDetailForm")).getEmpFDJoiningDate());
</code></pre>
<p>e... | <p>Late but possible. You can set the session scope to your form bean in <code>struts-config.xml</code> file when you map the action. </p>
| 25,520 |
<p>I am trying to sort a dict based on its key and return an iterator to the values from within an overridden iter method in a class. Is there a nicer and more efficient way of doing this than creating a new list, inserting into the list as I sort through the keys?</p>
| <p>How about something like this:</p>
<pre><code>def itersorted(d):
for key in sorted(d):
yield d[key]
</code></pre>
| <p>Assuming you want a default sort order, you can used <code>sorted(list)</code> or <code>list.sort()</code>. If you want your own sort logic, Python lists support the ability to sort based on a function you pass in. For example, the following would be a way to sort numbers from least to greatest (the default behavi... | 12,793 |
<p>I finally got to work with canvas only to find out that it is not implemented in IE. I tried explore canvas from google to use it in Internet Explorer, but it's not working for my code (<a href="http://uptowar.com/test.php" rel="nofollow noreferrer">http://uptowar.com/test.php</a> - little bug though that it is not ... | <p><a href="http://raphaeljs.com/" rel="nofollow noreferrer">RaphaelJS</a> is a great cross-browser JavaScript library that might do exactly what you need. I highly recommend it. If you visit the site there is even a specific example that involves rotating an image.</p>
| <p>perhaps just use an animated .gif file</p>
<p>Flash is another alternative if you want more control.</p>
| 47,724 |
<p>I have built a couple of 3d printers now and I'm having a little trouble with one I'm currently on. I frankensteined this one with two of my other printers that I had built. I took the Arduino mega and ramps 1.4 out of the older one and wired it up to the newer one. When I plug the printer in and try to move the ste... | <p>From an electrical standpoint, a two-phase stepper motors (what most 3D printers use) works the same backwards and forwards, the phase just reverses. If you are stalling on only one direction, I would look to see if you have a mechanical bind in that direction. Generally a wiring issue will cause the motor to eith... | <p>Sounds like you are configured for NC switches but are using NO switches, causing them to invert their reported state. Issue a <strong>M119</strong> command and see if the endstop statuses are correct when none are triggered.</p>
| 772 |
<p>I want to output a timestamp with a PST offset (e.g., 2008-11-13T13:23:30-08:00). <code>java.util.SimpleDateFormat</code> does not seem to output timezone offsets in the <em>hour:minute</em> format, it excludes the colon. Is there a simple way to get that timestamp in Java?</p>
<pre><code>// I want 2008-11-13T12:23... | <p>Starting in Java 7, there's the <code>X</code> pattern string for ISO8601 time zone. For strings in the format you describe, use <code>XXX</code>. <a href="http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html#iso8601timezone" rel="noreferrer">See the documentation</a>.</p>
<p>Sample:</p>
<pre><... | <p>I tested a lot with this one, works well for me... In particular when it comes to parsing (and for formatting too), it is the closest I have found so far</p>
<pre><code>DateTimeFormatter rfc3339Formatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
DateTimeFormatter rfc3339Parser = new DateTimeFormatterBuilder()
.... | 36,836 |
<pre><code>echo "<td><a href='delete.php?id=$row[id]&&category=$a' onclick='return confirm(\'are you sure you wish to delete this record\');'>delete</a></td>";
</code></pre>
<p>Above is the code I am trying to use. Every time it does nothing and I cannot see how I can use 'proper' JavaS... | <p>It is also a bad idea to use GET methods to change state - take a look at the guidelines on when to use GET and when to use POST ( <a href="http://www.w3.org/2001/tag/doc/whenToUseGet.html#checklist" rel="nofollow noreferrer">http://www.w3.org/2001/tag/doc/whenToUseGet.html#checklist</a> )</p>
| <p>And if you insist on using the echo-thing:</p>
<pre><code>echo "<td><a href='delete.php?id=$row[id]&&category=$a' onclick='return confirm(\\'are you sure you wish to delete this record\\');'>delete</a></td>";
</code></pre>
<p>-- because the escaping is treated from the php-interpret... | 24,056 |
<p>We've written a plugin to the Xinha text editor to handle footnotes. You can take a look at:
<a href="http://www.nicholasbs.com/xinha/examples/Newbie.html" rel="nofollow noreferrer">http://www.nicholasbs.com/xinha/examples/Newbie.html</a></p>
<p>In order to handle some problems with the way Webkit and IE handle li... | <p>It's not visible in the snippet above, but newel has been appended to the dom using another element that was itself appended to the DOM. When inserting a dom element, you have to re-retrieve your handle if you wish to reference its siblings, since the handle is invalid (I'm not sure, but I think it refers to a DOM ... | <p>I've had the unfortunate experience of debugging this IE exception many different times while implementing a WYSIWYG editor, and it always arises from accessing a property on a DOM node (such as .parentNode) or passing a DOM node to a function (such as moveToElementText) while the DOM node is not currently in the do... | 14,906 |
<p>I am designing a windows service and now deploying it.</p>
<p>I have the code:</p>
<p>ServiceInstaller serviceInstaller1 = new ServiceInstaller();</p>
<p>This instantiates the object (obviously, but throws the following compile-time error:</p>
<p>Error 1 The type 'System.Configuration.Install.ComponentInstal... | <p>Is this error on your dev machine when building (which is what it looks like)? Or on the target machine when installing?</p>
<p>If the former: do what it says: add the required reference; References->Add Reference->System.Configuration.Install</p>
<p>It should already be installed in the GAC of the target machine,... | <p>System.Configuration.Install should be in the GAC. Is it not there? Does the target machine only have .NET 1.0 or 1.1? Or does the app.config (which you say you might not have present) stipulate one of those earlier .NET Framework versions should be used?</p>
<p>Ah, it is on the dev machine. Then you should go with... | 33,196 |
<p>I have been using <a href="http://www.plt-scheme.org/" rel="noreferrer">PLT Scheme</a>, but it has some issues. Does anyone know of a better implementation for working through SICP?</p>
| <p>Use <a href="http://www.gnu.org/software/mit-scheme/" rel="noreferrer"><strong>MIT Scheme</strong></a>.</p>
<p>It's recommended by the authors of SICP, and is used at MIT for the <strong>6.001: Structure and Interpretation of Computer Programs</strong> course.</p>
| <p>I'm now working through SICP using <a href="https://cisco.github.io/ChezScheme/" rel="nofollow noreferrer">Chez Scheme</a>. It's a pretty old dialect of Scheme, so presumably it isn't too far from what SICP was written around.</p>
<p>Note that the Chez Scheme project page links a Windows binary and source that can ... | 32,596 |
<p>Anybody out there using BGL for large production servers? </p>
<ul>
<li>How many node does your network consist of? </li>
<li>How do you handle <a href="http://en.wikipedia.org/wiki/Community_structure" rel="nofollow noreferrer">community detection</a> </li>
<li>Does BGL have any cool ways to detect communities?... | <p>I've used the BGL for graphs with millions of nodes, but the size of the graph you can use depends on what algorithm you are trying to run. You can quickly compute distances between nodes. There are 4 shortest path algorithms which are most applicable depending on your data: (single pairs of points, for all pairs ... | <p>As far as I know BGL doesn't have any algorithms specifically for community detection.</p>
<p>By "island" do you mean a disconnected subgraph?</p>
<p>Also, graphs do not have any notion of 'distance'. </p>
<p>This 'social distance' is something that you are going to have to define. Once you've done that a large p... | 34,280 |
<p>My professor wrote this shell script to time my program, and display the results. For some reason it just outputs 0s with my program. He provided the following files:</p>
<pre><code>timeit.csh
sequence
ecoli2500.txt
ecoli3000.txt
ecoli5000.txt
ecoli7000.txt
ecoli8000.txt
ecoli9000.txt
ecoli... | <p>Fixed. The problem was here:</p>
<pre><code> nice /usr/bin/time -p $program <
</code></pre>
<p>in the script. My computer doesn't execute shell scripts without a "./" before the command. My professors computer must be different. Changing the script to </p>
<pre><code>nice /usr/bin/time -p ./$program <
<... | <p>I'm not sure what the state of the environment (eg: PATH) or the state of the files and permissions are, but it could be as simple as a permissions problem with the sequence shell script (which I think you're saying contains 'java EditDistance'). If you 'chmod +x sequence', does it work? The other issue is that it... | 24,325 |
<p>Some requirements:</p>
<ul>
<li>Step-by-step debugging & Break Points</li>
<li>View variable values while debugging</li>
<li>IntelliSense (auto-completion). Ideally done with "smarts" so it only shows you the syntactically valid options to complete something. E.g., Textbox. would trigger members of that class... | <p>Step by step debugging with variable view (and often with additional views like stack or global variables etc) is working in some IDEs. <strong>FlexBuilder</strong>, <strong>FDT3 Enterprise</strong> (only the enterprise version allows debugging), <strong>FlashDevelop</strong> (with extra plug-in). You can also try t... | <p>Quite a few prominent Flex+Flash developers swear by <a href="http://fdt.powerflasher.com/" rel="nofollow noreferrer" title="FDT">FDT</a></p>
<p>It's an Eclipse plugin, and it's probably the most expensive Flex development tool out there, but it's very good. </p>
| 40,193 |
<p>You know that particular part of your code that is essential for the project but will probably take a lot of time to get it done? Do you ever get the feeling that you'd rather work on something else (probably less important) or not code at all instead of working on that part? That beast you try so hard to avoid and ... | <p>I'll tell a story of a case in which this happened to me.</p>
<p>I wanted to implement a new frametype decision algorithm for x264 that used forward dynamic programming (the Viterbi algorithm). But it was going to be complicated, messy, ugly, and so forth. And I really didn't want to do it. I tried to pawn off t... | <p>I agree with you that many large, important parts of a software are not fun to write. I usually start my development day with some smaller things, like adding a feature here, or fixing a bug there. When it's time, I start with the large part, but when I just can't see the thing any more, I do something different. Th... | 17,561 |
<p>How do you use the the org.springframework.ws.transport.jms.WebServiceMessageDrivenBean class from the Java Spring Framework - Spring-WS project?</p>
<p>There is very little documentation or examples available on the web.</p>
| <p>From what I gather from reading the <a href="http://static.springframework.org/spring-ws/sites/1.5/apidocs/org/springframework/ws/transport/jms/WebServiceMessageDrivenBean.html" rel="nofollow noreferrer">javadocs</a> it looks like this allows a Spring <a href="http://static.springframework.org/spring-ws/sites/1.5/ap... | <p>Using the WebServiceMessageDrivenBean is very similar to the Spring support for Message Driven Beans (MDBS).</p>
<p>First you create a MDB:</p>
<pre><code>public class HelloWorldMessageDrivenBean extends WebServiceMessageDrivenBean {
private static final long serialVersionUID = -2905491432314736668L;
}
</code>... | 5,874 |
<p>i've created a Form Panel, and i'm rendering couple of Combo Boxes in the panel with a store which is populated via an response handler.
the problem if i want to render the panel again it renders the combo boxes without the store, though i'm re-constructing the panel.
i tried to debug to figure out the cause and sur... | <p>Thanks for your comments, actually i tried the plugin approach but couldn't understand it completely as to how will i get the handle to the store which is not an exposed element of the component.</p>
<p>Anyways i tried something else, while debugging i found that though i'm creating the component again on click of ... | <p>Have you tried <code>doLayout()</code> method of <code>FormPanel</code>?</p>
| 11,606 |
<p>Are there any rapid Database protoyping tools that don't require me to declare a database schema, but rather create it based on the way I'm using my entities.</p>
<p>For example, assuming an empty database (pseudo code):</p>
<pre><code>user1 = new User() // Creates the user table with a single id column
user1.fir... | <p><a href="http://code.google.com/appengine/" rel="nofollow noreferrer">Google's Application Engine</a> works like this. When you download the toolkit you get a local copy of the database engine for testing.</p>
| <p>May be not exactly responding to your <em>general</em> question, but if you used <a href="http://www.hibernate.org" rel="nofollow noreferrer">(N)Hibernate</a> then you can automatically generate the database schema from your hbm mapping files.</p>
<p>Its not done directly from your code as you seem to be wanting bu... | 5,215 |
<p>Let's say that I have two arrays (in Java),</p>
<p>int[] numbers; and int[] colors;</p>
<p>Each ith element of numbers corresponds to its ith element in colors.
Ex, numbers = {4,2,1}
colors = {0x11, 0x24, 0x01}; Means that number 4 is color 0x11, number 2 is 0x24, etc.</p>
<p>I want to sort the numbers array... | <p>You could use sort() with a custom comparator if you kept a third array with the index, and sorted on that, leaving the data intact.</p>
<p>Java code example:</p>
<pre><code>Integer[] idx = new Integer[numbers.length];
for( int i = 0 ; i < idx.length; i++ ) idx[i] = i;
Arrays.sort(idx, new Compara... | <p>You need to sort the colors array by its relative item in the numbers array. Specify a comparator that compares numbers and use that as the comparison for the colors array.</p>
| 13,738 |
<p>I'm looking for Java code that can be used to generate sound at runtime - NOT playback of existing sound files.</p>
<p>For example, what's the best code for generating a sawtooth waveform at 440 Hz for a duration of 2 milliseconds? <b>Source code appreciated!</b></p>
<p>I remember my Commodore 128 had a simple Sou... | <p>You can easily generate sampled sound data in Java and play it back without using native code. If you're talking MIDI things may get tricky, but I've not dabbled in that area.</p>
<p>To generate sampled sound data, you have to thing of the process backwards. We're going to act like the A-to-D and sample a continuou... | <p>What you want is probably not a sound API but some kind of synthesizer code, I'm pretty sure you need more low-level sound driver control than Java would allow (it being a interpreted language normally running in a "sandbox"). </p>
<p>But the good news is that a quick search for "<a href="http://www.google.com/sear... | 37,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.