instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I have a QIDI Tech 1. It has a heated bed, and a cooling fan attachment. Whenever I print without a raft, the first inch or two of material laid down does not adhere to the bed, but the rest of the first layer is flawless.</p>
<p>I have tried speeding up and slowing down the first layer walls, but the problem remai... | <p>I've had this problem in the past with a Flux Delta printer. The first attempt to resolve it was to always use a brim along with a raft. The brim will often have settings to allow number of passes as well as number of layers. If you are not using the brim to provide adhesion, you still can use it to prime the nozzle... | <p><strong>I'd recommend using the "skirt" function</strong> if you're not already. </p>
<p>The idea is to print a few perimeter layers around where your part will be, but not actually touching your part. </p>
<p>Most slicers support this and you can choose how much skirt you want to print. This addresses the issu... | 401 |
<p>I'm creating a public internet facing website which contains the email address of their salespeople. </p>
<p>What kind of programming options do I have to generate the "mailto" and display the email from that address but limit the spambots from picking up the address? </p>
| <p>I know that Facebook does it by displaying an image instead of text. Sure, they could use OCR on the image, but why bother for just one email address?</p>
<p>If you really didn't want spam bots to get an email address, <strong>the best way is to never show it to anyone</strong>. Show a link to "Contact this person"... | <p>I see the mailto: protocol almost dead anyway... It is convenient, but too easy to parse and gather.</p>
<p>Plus it has its downsides: if you are on a Web cafe, it won't work because it will call whatever default e-mail client it has (if it has any!) and it is not set up on your account. Same if you use exclusively... | 39,780 |
<p>Is it possible to create a footer div that sits at the bottom of a site regardless of how much information is present in the middle?</p>
<p>Currently the div I have is positioned depending on how much content i have in the body.</p>
<blockquote>
<h3>See also:</h3>
<p><a href="https://stackoverflow.com/quest... | <p>I am by no means a css expert, but this works for me across the major browsers:</p>
<pre><code>.d_footer
{
position:fixed;
bottom:0px;
background-color: #336699;
width:100%;
text-align:center;
padding-top:5px;
padding-bottom:5px;
color:#ffffff;
}
</code></pre>
| <p>JonathanMueller is right, that works perfectly.</p>
<p>I had been looking through posts trying to do it like this. All I could find was fixed to the bottom of the window.
Thanks!</p>
| 23,532 |
<p>I have some Jasper reports which are displayed in HTML format. I would like the width of the columns in the HTML tables to automatically resize to fit the content of the widest cell (in that column), such that all the data is displayed.</p>
<p>Currently this does not happen because the HTML generated by Jasper spec... | <p>While not perfect, you could flag the field to stretch with overflow. This would at least give you all the data. In your jrxml file it would be similar to:</p>
<pre><code><textField isStretchWithOverflow="true" hyperlinkType="None">
<reportElement style="Report Sub-Title" x="0" y="84" width="802" heigh... | <p>In iReport there is an option called "Stretch Type". Select "Relative to Band Height"</p>
| 38,502 |
<p>I found a clear squared bug on IE7/8, which appears via automation (<a href="https://stackoverflow.com/questions/246365/how-to-manage-full-screen-in-ie-via-automation-flash-player-like">still looking</a> for a workaround, btw). </p>
<p>So, I tried with no luck to find a way to log this bug. Tried the <a href="http:... | <p>According to <a href="http://blogs.msdn.com/ie/archive/2008/07/30/wanted-ie8-beta-testers.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/ie/archive/2008/07/30/wanted-ie8-beta-testers.aspx</a>:</p>
<blockquote>
<p>Currently the only way to directly
file a bug with the IE Team is to be a
part of the IE8 ... | <p>As Phil said, using the IE Feedback system is your best bet, although results vary from "yeah thanks for the report" to "sorry maybe in the next release" ;-)</p>
<p>Can you elaborate on the bug or provide some code? We may have an answer if we know the exact issue. I'd also be happy to submit the bug for you in c... | 32,218 |
<p>I am trying to use VBScript to do an XSLT transform on an XML object.<br>
The XSL file I'm translating includes the <code><xsl:import href="script.xsl"/></code> directive. If I use the absolute URL (<code>http://localhost/mysite/script.xsl</code>), it imports the style sheet fine; however, if I use the relativ... | <p>The current directory for xsl:import, xsl:include, and the document() function is the directory containing the transform that uses them. So the xsl:import directive that you've said you're using ought to be working.</p>
<p>The only thing I can think of that might affect this: if you use a relative path, the file'... | <p>You need a variable that defines the approot, or webroot when loading JS, Image or CSS files.</p>
<pre><code> <xsl:import href="{$approot}/somedir/script.xsl"/>
</code></pre>
<p>or if you have the value in the XML,</p>
<pre><code> <xsl:import href="{/root/@approot}/somedir/script.xsl"/>
</code></pre>
| 17,174 |
<p>So I've got a hobby site I'm working on. I've got items that are tagged and I want to associate those items with photos from Flickr. Even with restrictive searches, I might get results numbering in the thousands.</p>
<p>Requirements:</p>
<ol>
<li>I want to display between 10-20 pictures but I want to randomize t... | <p>Not Exactly a sexy piece of code but their doesn't seem to be an automated way to find the row without just looping the table.</p>
<pre><code> DataRowView newRowView = null;
foreach (DataRowView tempRowView in myDataTable.DefaultView)
{
if (tempRowView.Row == rowToMatch)
... | <pre><code>row.Table.DefaultView[row.Table.Rows.IndexOf(row)]
</code></pre>
<p>This is an okay answer. But if you find yourself in this situation, you should consider learning more about DataViews and how they are used, then refactor your code to be view-centric rather than table-centric.</p>
| 5,241 |
<p>Suppose you have a file that contains IP addresses, one address in each line:</p>
<pre><code>10.0.10.1
10.0.10.1
10.0.10.3
10.0.10.2
10.0.10.1
</code></pre>
<p>You need a shell script that counts for each IP address how many times it appears in the file. For the previous input you need the following output:</p>
<... | <pre><code>sort ip_addresses | uniq -c
</code></pre>
<p>This will print the count first, but other than that it should be exactly what you want.</p>
| <p>Sort may be omitted if order is not significant</p>
<pre><code>uniq -c <source_file>
</code></pre>
<p>or</p>
<pre><code>echo "$list" | uniq -c
</code></pre>
<p>if the source list is a variable</p>
| 49,905 |
<p>I would like to begin developing for the Blackberry platform and, specifically, the Bold and also the Storm device which is coming out soon. Do I need to get into Java and J2ME or can I develop sites in ASP.NET and just keep utilizing the skills I already have? </p>
<p>I am completely new to mobile platform devel... | <p>This <a href="https://stackoverflow.com/questions/59424/creating-a-mini-site-in-aspnet-that-works-on-blackberry-windows-mobile-and-ipho">question</a> might help you. "Creating a mini-site in asp.NET that works on blackberry, Windows Mobile, and iPhone"</p>
| <p>Please read this <a href="https://web.archive.org/web/20150107061257/https://www.oracle.com/technetwork/systems/index-139239.html" rel="nofollow noreferrer">https://web.archive.org/web/20150107061257/https://www.oracle.com/technetwork/systems/index-139239.html</a></p>
<p>It talks about how one application should not... | 37,041 |
<p>How effective is naive Bayesian filtering for filtering spam?</p>
<p>I heard that spammers easily bypass them by stuffing extra non-spam-related words. What programming techniques can you use with Bayesian filters to prevent that?</p>
| <p>Paul Graham was the guy to really introduce the idea of using Bayesian spam filtering to the web at large with his original article <a href="http://www.paulgraham.com/spam.html" rel="noreferrer"><em>A Plan for Spam</em></a>, back in August 2002. Then, <a href="http://www.paulgraham.com/better.html" rel="noreferrer"... | <p>You're right, naive Bayesian filters are susceptible to <a href="http://en.wikipedia.org/wiki/Bayesian_poisoning" rel="nofollow noreferrer">Bayesian poisoning</a>.</p>
| 47,236 |
<p>We are considering Microsoft DSL toolkit for creating some abstract designers. I already did some POCs, but would like to get some opinions on the same.</p>
<p>Any one here to share their experiences working with Microsoft DSL Toolkit and T4? Also, any pointers to open source DSL projects will help - Eg. Microsoft ... | <p>We have done considerable work with the DSLs and have a number of them for in house and client based consultant use, though it has not me who has done most work with them. Once you have ironed out the modeling(no small feat) I would say that these are great tools. </p>
<p>I cannot point you at any open source proj... | <p>I´m definitely a serious taker. Ivé recently made a dsl to model orderprocesses for a orderingsystem. We use a windowsservice that that connects to different webservices based on which processtatus a specific row has and then changes the status based on the outcome (Next,Error,Denial). It was very timeconsuming to e... | 48,260 |
<p>Basically, what I need is something like <a href="http://www.dependencywalker.com/" rel="noreferrer">Dependecy Walker</a>, but it should work with .NET applications. Is there anywhere such tool?</p>
| <p><a href="http://www.red-gate.com/products/reflector/index.htm" rel="noreferrer">Reflector</a> - previously from Lutz Roeder, now from Red-Gate software.</p>
| <p>Dependency Walker will work with .Net too.</p>
<blockquote>
<p>the .Net layer still needs to call
down to the core Windows functions
like LoadLibrary and GetProcAddress to
do the actual work. It is at this
core level that Dependency Walker
understands what is going on. So,
while Dependency Walker ma... | 24,026 |
<p>I want to serialize the following Xml structure:</p>
<pre><code> <XmlRootElement>
<Company name="Acme Widgets LLC">
<DbApplication name="ApplicationA" vendor="oracle">
<ConnSpec environment="DEV"
server="DBOraDev1201"
database... | <p>If you are using <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx" rel="nofollow noreferrer">XmlSerializer</a> you need to indicate it how to serialize your collections:</p>
<pre><code>public class XmlRootElement
{
[XmlElement(ElementName="Company")]
public Compan... | <p>An alternative to adding XMl serialization attributes to all of your classes is to implement the <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.ixmlserializable.aspx" rel="nofollow noreferrer">IXmlSerializable</a> interface on the root element container class. The <strong>ReadXml</strong> ... | 42,341 |
<p>The problem itself is simple, but I can't figure out a solution that does it in one query, and here's my "abstraction" of the problem to allow for a simpler explanation:</p>
<p><strong>I will let my original explenation stand, but here's a set of sample data and the result i expect:</strong></p>
<p>Ok, so here's s... | <p>This is fairly similar to what you wrote, but should be fairly speedy as NOT EXISTS is more efficient, in this case, than NOT IN...</p>
<pre><code>mysql> select * from foo;
+----+-----+
| id | col |
+----+-----+
| 1 | Bar |
| 1 | Foo |
| 2 | Foo |
| 3 | Bar |
| 4 | Bar |
| 4 | Foo |
+----+-----+
SEL... | <p>You can use joins instead of the exists and this may improve the query plan in cases where the optimizer is not smart enough:</p>
<pre><code>SELECT f1.id
,f1.col
FROM foo f1
LEFT JOIN foo f2
ON f1.id = f2.id
AND f2.col = 'Foo'
WHERE f1.col = 'Foo'
OR ( f1.col = 'Bar' AND f2.id IS NULL )
</code></pre>
| 18,157 |
<p>I am using the Maven (2) Cobertura plug-in to create reports on code coverage, and I have the following stub I am using in a method:</p>
<pre><code>try {
System.exit(0);
} catch (final SecurityException exception) {
exception.printStackTrace();
}
System.err.println("The program never exited!");
</code></pre... | <p>I would look at the coverage report. Double check my tests. Notice that the code really is getting covered and not worry about hitting 100%. Code coverage is best used to find areas that you may have neglected to hit with your tests, but just focusing on getting 100% coverage as a goal is bad habit that can lead ... | <p>I know this is an old question and that Cobertura has already fixed this, but for completeness the missing coverage on the "}" was caused by the internal automatically "finally" block.</p>
<p>See your code as this:</p>
<pre><code>try {
System.exit(0);
} catch (final SecurityException exception) {
exception... | 23,865 |
<p>What are the best ways of developing a subscription type website that provides lesson content (like Lynda.com)?</p>
<p>How do you protect the content from download (audio and video)?</p>
<p>What's the best way to handle passwords?
Can the user have a login name and password, and then also have an additional passwo... | <ol>
<li><p>Protecting content is pretty easy: simply write a page which has access to the user's session / security details and check to see if they are authorized to download the file that was requested. You could do this easily with a Java Servlet or any other web platform like ASP.NET, PHP, etc.</p></li>
<li><p>I ... | <p>NOTE: Looking back through this, I see a lot of missing detail and edge cases to identify. I'm leaving it in this form because I think it is useful to provide the sense of it (even though the details are not quite fully-formed) so you can see what you would be in for. You'd need to work through a threat model to h... | 42,635 |
<p>Looking for an example that:</p>
<ol>
<li>Launches an EXE</li>
<li>Waits for the EXE to finish.</li>
<li>Properly closes all the handles when the executable finishes.</li>
</ol>
| <p>Something like this:</p>
<pre><code>STARTUPINFO info={sizeof(info)};
PROCESS_INFORMATION processInfo;
if (CreateProcess(path, cmd, NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo))
{
WaitForSingleObject(processInfo.hProcess, INFINITE);
CloseHandle(processInfo.hProcess);
CloseHandle(processI... | <p>Here is a solution for <code>CreateProcessA</code></p>
<pre><code>STARTUPINFOW initInfo = { 0 };
initInfo.cb = sizeof(initInfo);
PROCESS_INFORMATION procInfo = { 0 };
CreateProcessA(PATH_FOR_EXE, NULL, NULL, NULL, FALSE, 0, NULL, NULL, (LPSTARTUPINFOA)&initInfo, &procInfo);
</code></pre>
| 6,406 |
<p>Is it possible to embed an inline search box into a web page which provides similar functionality to the <a href="http://www.ie7pro.com/inline-search.html" rel="noreferrer">IE7Pro Inline Search</a> or similar plugins for Firefox/Safari?</p>
| <p>If I understand your schema and question correctly, how about something like this:</p>
<pre><code>select student_name, score
from students
join (select student_answers.student_id, count(*) as score
from student_answers, answer_key
group by student_id
where student_answers.question_id = ans... | <p>The architecture you are talking about could become very cumbersome in the long run, and if you need to change the questions it means more changes to the UDF you are using.</p>
<p>I would think you could probably do your analysis in code without necessarily de-normalizing your database. De-normalization could also... | 4,244 |
<p>I know a role name and want to find all users in this role.
How do I acheive this in SQL Server 2000 (in the SQL script, not in Management Studio or other tool)?</p>
| <p>You can use the following stored procedures:</p>
<p>For fixed server roles, the stored procedure is <a href="http://msdn.microsoft.com/en-us/library/ms188772.aspx" rel="nofollow noreferrer">sp_helpsrvrolemember</a>:</p>
<pre><code>exec sp_helpsrvrolemember 'role'
</code></pre>
<p>For general roles, the stored pro... | <p>Just use SQL-DMO:
Replace <em>rolename</em> with your role</p>
<pre><code>exec sp_helprolemember rolename
</code></pre>
| 24,964 |
<p>I need to serialize a huge amount of data (around 2gigs) of small objects into a single file in order to be processed later by another Java process. Performance is kind of important. Can anyone suggest a good method to achieve this?</p>
| <p>Have you taken a look at google's <a href="http://code.google.com/p/protobuf/" rel="nofollow noreferrer">protocol buffers</a>? Sounds like a use case for it.</p>
| <p>You should probably consider a database solution--all databases do is optimize their information, and if you use Hibernate, you keep your object model as is and don't really even think about your DB (I believe that's why it's called hibernate, just store your data off, then bring it back)</p>
| 15,762 |
<p>I need to validate the email address of my users. Unfortunately, making a validator that <a href="https://www.rfc-editor.org/rfc/rfc2822#section-3.4.1" rel="nofollow noreferrer">conforms to standards</a> is hard.</p>
<p><a href="http://www.ex-parrot.com/%7Epdw/Mail-RFC822-Address.html" rel="nofollow noreferrer">Here... | <p>I found a library in google code: <a href="http://code.google.com/p/php-email-address-validation/" rel="noreferrer">http://code.google.com/p/php-email-address-validation/</a></p>
<p>Are there any others?</p>
| <p>I'd recommend to look at the source code of Zend_Validate_EmailAddress [<a href="http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Validate/EmailAddress.php" rel="nofollow noreferrer">source</a>].</p>
<p>Once you have your dependencies fixed, you can simply do the following:</p>
<pre><code>$mail_va... | 19,498 |
<p>If I have two things which are hex, can I someone how append their binary together to get a value?</p>
<p>In C++,
say I have</p>
<pre><code>unsigned char t = 0xc2; // 11000010
unsigned char q = 0xa3; // 10100011
</code></pre>
<p>What I want is somehow,
<code>1100001010100011</code>, is this possible using bit-w... | <p>Yes it's possible.</p>
<p>Just use the left-bitshift operator, shifting to the left by 8, using at least a 16-bit integer. Then binary OR the 2nd value to the integer. </p>
<pre><code>unsigned char t = 0xc2; // 11000010
unsigned char q = 0xa3; // 10100011
unsigned short s = (((unsigned short)t)<<8) | q; /... | <p>There is no append in binary/hex because you are dealing with Numbers (can you append 1 and 2 and not confuse the resulting 12 with the "real" 12?)</p>
<p>You could delimit them with some special symbol, but you can't just "concatenate" them.</p>
| 32,088 |
<p>I would like to automate the deployment of my SSIS and SSAS artifacts to remote development SQL Server 2005 & 2008 instances on a scheduled basis. </p>
<p>What would be the best solution for this? I am using TFS 2008 as the source control system, so I'd like to integrate the solution with MSBuild and a schedu... | <p>SSIS is the easiest, when I was using SSIS, we stored our packages in a file and all we to do was copy the file to the correct directory in C:\Program Files\Microsoft SQL Server\90\DTS\Packages. Which you can do by adding a Copy task to the end of your MSBuild. I am not sure if the xml will be available by default i... | <p>I found lots of posts advocating scripting VS to automate the build, which isn't always possible in a CI environment.</p>
<p>With a bit more digging I also found <a href="http://sqlsrvanalysissrvcs.codeplex.com/" rel="nofollow">http://sqlsrvanalysissrvcs.codeplex.com/</a> which includes an msbuild task for creating... | 40,463 |
<p>I recently started a new webforms project and decided to separate the business classes from any DBML references. My business layer classes instead access discrete Data layer methods and are returned collections of DTO's. So the data layer might project DTO's like the following:</p>
<pre><code>(from c in dataContext... | <p>I don't know if it's best practice but I have written similar code in the not so recent past because I too felt that I could improve the separation of concerns by using my own classes instead of the LINQ-designer-generated ones within my application.</p>
<p>You may want to consider just returning an IQueryable<C... | <p>In my opinion in most cases DTO objects are not needed when dealing with LINQ. Generated LINQ classes can be easily tested. LINQ gives you ability to query your data from different sources using identical queries. It gives you ability to test your queries against lists of objects instead of real db.</p>
| 7,413 |
<p>I'm using a Monoprice Maker Select v2 (a Monoprice-branded Wanhao i3 duplicator) and would like to calibrate temperature readings for my hotend.</p>
<p>I used a thermal probe on my multimeter to determine the hotend is running about 5 degrees C above it's reported temperature (setting it to 200 degrees reads 205 on... | <p>Unless you are using a calibrated temperature sensor, it is a question what the temperature will be. </p>
<p>Actually it doesn't really matter what the temperature exactly is, you just need to find the sweet spot for your filaments on your machine. With respect to reported temperatures by others, your settings may ... | <p>Temperature from thermosensors gets collected as a resistance value that changes with temperature. The chip in your board decides the temperature from this value based on a temperature-resistance table.</p>
<p>If you are using Marlin Firmware, the setting which table is referenced by your machine to get its values ... | 1,125 |
<p>I am trying to <strong>programmatically</strong> create an SSIS package containing a simple data flow from table A to table B in the same database. I am using the example given <a href="http://technet.microsoft.com/en-us/library/ms136020.aspx" rel="nofollow noreferrer">here</a>.
The package gets created and saved to... | <p>Yes, this is one of my frustrations with SSIS: that they do not provide simple table or map of the new terminology. </p>
<p>You can use a small piece of code to discover components available for use.</p>
<p>The code is located here:
<a href="http://msdn.microsoft.com/en-us/library/ms136106.aspx" rel="nofollow nor... | <p>I used to have a copy of <a href="http://www.wrox.com/WileyCDA/WroxTitle/Professional-SQL-Server-2005-Integration-Services.productCd-0764584359.html" rel="nofollow noreferrer">SQL Server 2005 Integration Services</a>, a Wrox book. I am pretty sure it has a whole chapter or two dedicated to programmatically working ... | 27,291 |
<p>I know what Hungarian refers to - giving information about a variable, parameter, or type as a prefix to its name. Everyone seems to be rabidly against it, even though in some cases it seems to be a good idea. If I feel that useful information is being imparted, why shouldn't I put it right there where it's availabl... | <p>Most people use Hungarian notation in a wrong way and are getting wrong results. </p>
<p>Read this excellent article by Joel Spolsky: <a href="http://www.joelonsoftware.com/articles/Wrong.html" rel="noreferrer">Making Wrong Code Look Wrong</a>.</p>
<p>In short, Hungarian Notation where you prefix your variable nam... | <ul>
<li>They're a humongous eyesore</li>
<li>Your IDE should be able to tell you all you need to know about a variable's type</li>
<li>Good names (which HN gets in the way of) should communicate to you everything else you need to know about a variable.</li>
</ul>
| 13,711 |
<p>Suppose there is a fully populated array of data String[n][3] myData.</p>
<p>I want to do this:</p>
<pre><code>for (String[] row : myData)
{
SQL = "update mytable set col3 = row[2]
where col1 = row[0] and col2=row[1];"
}
</code></pre>
<p>Obviously I've left a lot out, but I want to express the idea as succ... | <p>If you are using Sql Server you can use SqlBulkCopy. You would first have to put your data in a DataTable, which would be pretty easy since you already have it in a string array.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx" rel="nofollow noreferrer">http://msdn.mi... | <p>Not really. You could create the string with the same loop, then pass your values as parameters, but that will still be multiple database commands.</p>
<pre><code>for each whatever
sql += "UPDATE ... ;"
end for
execute (sql)
</code></pre>
| 22,265 |
<p>I recently heard of WSDL.Exe, but I am not sure where to find this program.
Does anyone know where I can find or download it?</p>
| <p>You'll get it as part of a Visual Studio install (if you included the SDK), or in a standalone SDK install. It'll live somewhere like <code>C:\program files\Microsoft Visual Studio 8\SDK\v2.0\Bin</code></p>
<p>If you don't already have it, you can download the .NET SDKs from<br>
<a href="http://msdn.microsoft.com/e... | <p>It is included with .NET (not sure if only in the SDK).</p>
| 12,598 |
<p>I have a Java method which returns an array of doubles. I would then like to store these values in individual variables in the calling function. Is there an elegant way of doing this in Java.</p>
<p>I could write it as this:</p>
<pre><code>double[] returnValues = calculateSomeDoubles();
double firstVar = returnVa... | <p>Basically no, this isn't possible.</p>
<p>You'll have to return an object that contains the values.</p>
<pre><code>MyObject myObject = calculateMyObject();
</code></pre>
| <p>My first instinct is to question your motivation for doing something like this. If you have a group of related doubles in your program, why aren't you storing them in a List?</p>
<p>If you were you could do something like this:</p>
<pre><code>List<Double> myVars = Arrays.asList(calculateSomeDoubles());
</co... | 46,986 |
<p>Below is the code I use to build an HTML table on the fly (using JSON data received from the server).</p>
<p>I display an animated pleasewait (.gif) graphic while the data is loading. However, the graphic freezes while the JavaScript function is building the table. At first, I was just happy to make this happen (di... | <p>You basically want to set up your loops so they yield to other threads every so often. Here is some example code from <a href="http://www.julienlecomte.net/blog/2007/10/28/" rel="noreferrer">this article</a> on the topic of running CPU intensive operations without freezing your UI:</p>
<pre><code>function doSomethi... | <p>You could insert the table into the DOM bit by bit. Honestly I'm not entirely sure if this will help with your problem, but it's worth a try. I'd do it roughly like this (untested code, could be refine some more):</p>
<pre><code>$("#result").append('<table id="myTable" cellspacing=0 cellpadding=2 border=1><... | 12,906 |
<p>I have a client server application that sends XML over TCP/IP from client to server and then broadcast out to other clients. How do i know at what the minimun size of the XML that would warrant a performance improvement by compression the XML rather than sending over the regular stream.</p>
<p>Are there any good m... | <p>Xml usually compresses very well, as it tends to have a lot of repetition.</p>
<p>Another option would be to swap to a binary format; BinaryFormatter or NetDataContractSerializer are simple options, but both are notoriously incompatible (for example with java) compared with xml.</p>
<p>Another option would be a port... | <p>By all means compress it always.</p>
<p>It will save you bandwidth for anything with more then 2 tags.</p>
| 29,270 |
<p>With which tool / library it is possible to update an existing database structure. On the update of the software it is also needed to change the database. Because there can be different versions of the software it should compare the current status with the target status of the database. It should:</p>
<ul>
<li>add ... | <p>Check out <a href="http://www.liquibase.org/" rel="nofollow noreferrer">Liquibase</a>. A database migrations tool, like <a href="http://code.google.com/p/dbmigrate/" rel="nofollow noreferrer">dbmigrate</a>, might also be worth a lok.</p>
| <p><a href="http://autopatch.sourceforge.net/" rel="nofollow noreferrer">Autopatch</a> is what we are using. It works pretty well.</p>
<p>It allows sql patches, data patches, and java patches all applied to your sql database.</p>
| 13,495 |
<p>Anyone know uf there's a dll/runner anywhere that returns TAP output from an NUnit test suite?</p>
| <p>Seems unlikely to me, since there is an impedance mismatch. TAP has no concept for what NUnit calls a test, and what TAP calls a test usually corresponds to an NUnit assertion, but not precisely. So I’m not sure how the thing you’re looking for would work at all. (But maybe a heuristic could work well enough.)</p>
| <p>At the very least, a simple pass/fail for each TestFixture run would allow the output to be sucked into other TAP results for aggregating results/reports. Maybe it's as simple as a xslt to transform the xml report into TAP</p>
| 9,741 |
<p>Is it possible to do something like this?</p>
<pre><code>var pattern = /some regex segment/ + /* comment here */
/another segment/;
</code></pre>
<p>Or do I have to use new <code>RegExp()</code> syntax and concatenate a string? I'd prefer to use the literal as the code is both more self-evident and concise.</p... | <p>Here is how to create a regular expression without using the regular expression literal syntax. This lets you do arbitary string manipulation before it becomes a regular expression object:</p>
<pre><code>var segment_part = "some bit of the regexp";
var pattern = new RegExp("some regex segment" + /*comment here */
... | <p>I prefer to use <code>eval('your expression')</code> because it does not add the <code>/</code>on each end<code>/</code> that <code>='new RegExp'</code> does.</p>
| 22,436 |
<p>Timezone information for Java are kept in a folder called "zi". For eg.
C:\Program Files\Java\jdk6\jre\lib\zi</p>
<p>files in this folder are in binary format. But it is very important for me to see exactly what they say.</p>
<p>Can anyone share a way, to read these files, or are they Sun proprietary?</p>
| <p>A <a href="https://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#generic-relations" rel="noreferrer">generic relation</a> seems to be the solution. But it will complicate things even further.</p>
<p>It seems to me; your model structure is already more complex than necessary. I would simply merge all three... | <p>My gut would be to suggest removing the abstract modifier on the base class. You'll get the same model structure, but Answer will be it's own table. The downside of this is that if these are large tables and/or your queries are complex, queries against it could be noticeably slower.</p>
<p>Alternatively, you coul... | 47,963 |
<p>Would anyone recommend a particular JavaScript charting library - specifically one that doesn't use flash at all?</p>
| <p>There is a growing number of Open Source and commercial solutions for pure JavaScript charting that do not require Flash. In this response I will only present Open Source options.</p>
<p>There are 2 main classes of JavaScript solutions for graphics that do not require Flash:</p>
<ul>
<li>Canvas-based, rendered in ... | <p>Check out <a href="http://zingchart.com" rel="nofollow">ZingChart HTML5 Canvas, SVG, VML and Flash Charts</a>. Very powerful and compatible library. I'm on the Zing team - mention us on twitter <a href="http://twitter.com/zingchart" rel="nofollow">@zingchart</a> or shoot any questions to support@zingchart.com.</p>
| 14,588 |
<p>I want to create a C# program to provision Windows Mobile devices. I have found MSDN documentation on a function called <a href="http://msdn.microsoft.com/en-us/library/ms852998.aspx" rel="nofollow noreferrer">DMProcessConfigXML</a>, but no instructions on how to use this function.</p>
<p>How can I use this functio... | <p>From managed code, you can call ConfigurationManager.ProcessConfiguration found in the Microsoft.WindowsMobile.Configuration
namespace. <a href="http://msdn.microsoft.com/en-us/library/microsoft.windowsmobile.configuration.configurationmanager.processconfiguration.aspx" rel="noreferrer">msdn</a>
Here is sample code... | <p>I looked at the MSDN and indeed very little information is available. I did some google searching and I found this <a href="http://cowo.supersized.org/archives/14-Example-usage-of-DMProcessConfigXML-on-WinCE-5.0.html" rel="nofollow noreferrer">example</a>. Also this <a href="http://blogs.msdn.com/andrewarnottms/arch... | 46,239 |
<p>I have created a TCP client that connects to a listening server.
We implemeted TCP keep alive also.
Some times the client crashes and core dumped.
Below are the core dump traces.</p>
<p>Problem is in linux kernel version Update 4, kernel 2.6.9-42.0.10.</p>
<p>we had two core dumps.</p>
<pre><code>(gdb) where
#0 0... | <p><code>_dl_sysinfo_int80</code> is just a function which does a system call into the kernel. So the core dump is happening on a system call (probably the one used by <code>connect</code> in the first example and <code>nanosleep</code> in the second example), probably because you are passing invalid pointers.</p>
<p>... | <p>Your program almost cetainly did <strong>not</strong> coredump in either of the above places.</p>
<p>Most likely, you either have multiple threads in your process (and some other thread caused the core dump), or something external caused your process to die (such as <code>'kill -SIGABRT <pid>'</code>).</p>
<... | 43,736 |
<p>I wanted to pass <code>calendar1.Selecteddate</code> in a <code>query string</code> from <code>gridview</code> in one page to another <code>gridview</code> (I have written <code>sqlquery</code> in that <code>gridview</code>) in another page. As seen in the below code I tried passing it but this did not work. Can any... | <p>One solution is to build your URL string in the code-behind, instead of building it in the markup.</p>
<p>Override the RowDataBound method on the GridView and build the hyperlink programmatically:</p>
<pre><code>protected override gv1_RowDataBound(object sender, GridViewRowEventArgs e)
{
HyperLink hl = new Hyper... | <p>In the example you've provided it would treat that calendar part of the string as a literal and pass the exact value you have typed.
In order to obtain the data using you would need to do something similar to:</p>
<pre><code><asp:HyperLinkField DataNavigateUrlFormatString="<%=GetSelectedDate()%>....
</code... | 39,295 |
<p>How is Silverlight going to change the internet in the next 10 years?</p>
<p>Is this going to be a scene changer or just another blip?</p>
| <p>People often underestimate Microsoft. I don't know if it's going to change the Internet, but Silverlight will probably become pretty widely used, especially in web-based business applications that require rich interfaces. Flash is good, but being able to develop rich web interfaces with .NET and WPF is much nicer, p... | <p>I personally think Silverlight will be popular, its got a good "feel" about it IMO as a developer.</p>
<p>The cross-platform issue will be solved soon, as Mono continues to grow fast.</p>
<p>But I think it will be a very long time before anything knocks Flash/Flex off its perch on the top of RIA development platfo... | 29,974 |
<p>I'm running in a strange issue.
My controller calls a drb object</p>
<pre><code>@request_handler = DRbObject.new(nil, url)
availability_result = @request_handler.fetch_availability(request, @reservation_search, params[:selected_room_rates])
</code></pre>
<p>and this Drb object is making some searches.</p>
<p>but... | <p>The error means that you're trying to serve an object that's been garbage collected, which usually happens because the object went out of scope on the <strong>server</strong>.</p>
<p>Your safest bet is figuring out why the object was prematurely garbage-collected in the first place. Alternatively, you could disable... | <p>Is it possible you are calling DRb.start_service more than once in the server?</p>
| 32,364 |
<p>Does anybody have experience of a decent J2SE (preferably at least Java JDK 1.5-level) Java Virtual Machine for Windows Mobile 6? If you know of any CLDC VMs, I'm also interested because even that would be better than what we <a href="http://www.nsicom.com/Default.aspx?tabid=138" rel="nofollow noreferrer">currently ... | <p>Yes, I've tried doing things with Java on Windows Mobile. I tried really hard. The best advise I can give you is: Stop right now, and start using .NET Compact Framework.</p>
<p>Anyway, the two 'good' JVMs for WM are <a href="http://www-01.ibm.com/software/wireless/weme/" rel="nofollow noreferrer">IBM-J9</a> and NSI... | <p>You might also look at <a href="http://www.skelmir.com/solutions/handheld.html" rel="nofollow noreferrer">Skelmir's CEEJ</a>. It's been several years since I used it, but even then I was impressed with their code coverage and especially the performance.</p>
| 10,181 |
<p>We have a few XML based interfaces that is quite well documented in XSD schemas. The interfaces are now going to be publicly available and we would like to create reference documentation for them.</p>
<p>Is there a tool that can automatically convert XSD files into some more readable format?</p>
| <p><a href="http://xml.fiforms.org/xs3p/" rel="nofollow noreferrer">xs3p</a> might do what you want (see also <a href="https://sourceforge.net/projects/xs3p/" rel="nofollow noreferrer">their SourceForce page</a>).</p>
| <p>It's should not be to hard to convert it (or write in advance) to <a href="http://www.docbook.org/" rel="nofollow noreferrer">docbook</a> format.</p>
| 29,433 |
<p>Could someone supply some code that would get the xpath of a System.Xml.XmlNode instance?</p>
<p>Thanks!</p>
| <p>Okay, I couldn't resist having a go at it. It'll only work for attributes and elements, but hey... what can you expect in 15 minutes :) Likewise there may very well be a cleaner way of doing it.</p>
<p>It is superfluous to include the index on every element (particularly the root one!) but it's easier than trying t... | <pre><code> public static string GetFullPath(this XmlNode node)
{
if (node.ParentNode == null)
{
return "";
}
else
{
return $"{GetFullPath(node.ParentNode)}\\{node.ParentNode.Name}";
}
}
</code></pre>... | 29,860 |
<p>I need a regex that matches all strings ending in .cs, but if they end in .g.cs they should not match. I'm using .NET regular expressions.</p>
| <p>This will match the end if it's .cs but not .g.cs</p>
<pre><code>(?<!\.g)\.cs$
</code></pre>
<p>For the entire string start to finish, something like this:</p>
<pre><code>^.*(?<!\.g)\.cs$
</code></pre>
| <p>In a regex engine without negative lookbehind:</p>
<pre><code>^(.*[^g]|.*[^.]g|)\.cs$
</code></pre>
<p>Linguistically, general lookahead/lookbehind is non-regular, so it isn't a "regular expression" even though it's really convenient...</p>
<p>Irrelevant because you state that you're using .NET's regular expressi... | 26,467 |
<p>Is it possible to get the system proxy configuration in Java?</p>
<p>In the Java Control Panel, you can set a proxy configuration. How can I access to that proxy configuration in order to open URL connections behind a proxy?</p>
| <p>oh, just look at <a href="https://stackoverflow.com/questions/376101/setting-jvm-jre-to-use-windows-proxy-automatically">that</a> question.
there was a sample with a solution.</p>
<p>currently all samples I've seen use SUN's undocumented APIs (com.sum packages), which result in warnings at compile time...</p>
| <p>The Java Plugin gets it from the system settings. If the app has to be started as either applet or webstart you can use the webstart/applet APIs for this. Otherwise you have to use native code. Look at the various JniWrapper's WinPack and the JDIC libs - they might have done the heavy lifting for you.</p>
| 28,034 |
<p>I want to draw DirectX content so that it appears to be floating over top of the desktop and any other applications that are running. I also need to be able to make the directx content semi-transparent, so other things show through. Is there a way of doing this?</p>
<p>I am using Managed DX with C#.</p>
| <p>I found a solution which works on Vista, starting from the link provided by OregonGhost. This is the basic process, in C# syntax. This code is in a class inheriting from Form. It doesn't seem to work if in a UserControl:</p>
<pre><code>//this will allow you to import the necessary functions from the .dll
using Syst... | <p><a href="http://learnwpf.com/" rel="nofollow noreferrer">WPF</a> is also another option.</p>
<blockquote>
<p>Developed by Microsoft, the Windows Presentation Foundation (or WPF) is a computer-software graphical subsystem for rendering user interfaces in Windows-based applications.</p>
</blockquote>
| 17,867 |
<p>We have an application that has to be flexible in how it displays it's main form to the user - depending on the user, the form should be slightly different, maybe an extra button here or there, or some other nuance. In order to stop writing code to explicitly remove or add controls etc, I turned to visual inheritan... | <p>I thought they had more or less sorted the desktop designer issues in 2005.
Have you tried the usual culprits?</p>
<ul>
<li>No abstract control types</li>
<li>No constructor arguments in any form</li>
<li>Initialisation moved to Form_Load as opposed to the Ctor</li>
<li>No controls in the same project as the userco... | <p>Read this: <a href="http://cs.rthand.com/blogs/blog_with_righthand/archive/2005/11/10/186.aspx" rel="nofollow noreferrer">http://cs.rthand.com/blogs/blog_with_righthand/archive/2005/11/10/186.aspx</a></p>
<p>AFAIK, there are still issues with Visual Inheritance and objects that rely on collections for the design el... | 7,204 |
<p><a href="https://stackoverflow.com/q/133925">JavaScript post request like a form submit</a> shows you how to submit a form that you create via POST in JavaScript. Below is my modified code.</p>
<pre><code>var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", "t... | <p>Add </p>
<pre><code><form target="_blank" ...></form>
</code></pre>
<p>or</p>
<pre><code>form.setAttribute("target", "_blank");
</code></pre>
<p>to your form's definition.</p>
| <p>I know this basic method:</p>
<p>1)</p>
<pre><code><input type=”image” src=”submit.png”> (in any place)
</code></pre>
<p>2)</p>
<pre><code><form name=”print”>
<input type=”hidden” name=”a” value=”<?= $a ?>”>
<input type=”hidden” name=”b” value=”<?= $b ?>”>
<input type=”hidd... | 21,580 |
<p>I have a requirement to export the results of a SQL query to excel. I am currently exporting it into 2007 format, but everything I have found will only run in a x86 enviroment. The web site where the export is to take place is running on a x64 version of IIS.</p>
<p>Changing IIS to run x86 is not an option. My curr... | <p>Personally from an ASP.NET application standpoint I have found that using XML and XSLT to go into the Excel XML format is the most effective, and really trouble free way to go. There are no costs involved, and once you get the hang of it, it is really quick!</p>
<p>In addition to that, I'm personally strongly agai... | <p>I agree with Mitchel Sellers.
Another way is create a simple html document with table, the excel will quite accept.</p>
<p>Example:</p>
<pre><code><html><body>
<table>
<tr><td>First column</td><td>Second column</td></tr>
<tr><td>Value of first row i... | 28,037 |
<p>Ok... I'm new to WPF, but I kind of know how to do things using DataTriggers and Converters.</p>
<p>But, what I want to seems a little more complex than that. Let me give you the details:</p>
<p>The DataContext for the ListView control is an IList of objects (object=Room). These are the available rooms. I've go... | <p>You can write a MultiValueConverter which returns Visibility back and takes DataContext as the first Converter Value and the specific 'Room' object as the second Value(Use ElementName binding with Element as 'Room')
If the Values matches then show the Image control ie, imgControl.Visibility bind to the Converter</p... | <p>Assuming your room object contains the picture or a link to the picture you can use the SelectedIndex property of ListView and bind to the picture field.</p>
<pre><code><TextBox Name="Room" Text="{Binding ElementName=RoomsList.SelectedItem, Path=Picture}" />
</code></pre>
<p>Where Roomlist.Picture is the pho... | 38,566 |
<p>These days I keep most of my development notes and documentations in Google Docs. There are time that I'd like to download everything. How is this possible on a Mac and Linux computers, without doing each one individually? Google used to have the ability to download all spreadsheets. However, I can no longer fin... | <p>If you install google gears into your browser: <a href="http://gears.google.com/" rel="nofollow noreferrer">http://gears.google.com/</a></p>
<p>You can use the built-in offline functionality inside of google docs</p>
<p>If you really want to roll up your sleeves, use the gdata API</p>
<p><a href="http://code.goog... | <p>GDocBackup <a href="http://gs.fhtino.it/gdocbackup" rel="nofollow noreferrer">http://gs.fhtino.it/gdocbackup</a><br>
C#, Open Source, runs on Win + Net and Linux + Mono (not tested on Mac + Mono, sorry).</p>
| 34,395 |
<p>I'm trying to debug a deadlock in a multi-threaded Python application after it has locked up. Is there a way to attach a debugger to inspect the state of the process? </p>
<p>Edit: I'm attempting this on Linux, but it would be great if there were a cross-platform solution. It's Python after all :)</p>
| <p>Yeah, gdb is good for lower level debugging.</p>
<p>You can change threads with the <em>thread</em> command.</p>
<p>e.g</p>
<pre><code>(gdb) thr 2
[Switching to thread 2 (process 6159 thread 0x3f1b)]
(gdb) backtrace
....
</code></pre>
<p>You could also check out Python specific debuggers like <a href="http://win... | <p>What platform are you attempting this on? Most debuggers allow you to attach to a running process by using the process id.
You can either output the process id via logging or using something like Task Manager.
Once that is achieved it will be possible to inspect individual threads and their call stacks.</p>
<p>EDIT... | 6,996 |
<p>Is there a way to make a DataGridView have no cell selected? I notice even when it loses focus() it has a at least one active cell. Is there another mode that allows this? or some other trick? </p>
| <p>DataGridView.CurrentCell property can be used to clear the focus rectangle.</p>
<blockquote>
<p>You can set this property
(DataGridView.CurrentCell) to null to
temporarily remove the focus
rectangle, but when the control
receives focus and the value of this
property is null, it is automatically
set to... | <p>I know this is an old question and WinForms is superseded (but not for a long while still in our shop anyway), so this is still relevant to us and I suspect a few others too.</p>
<p>Instead of fiddling with the selection or <code>CurrentCell</code>, I found the implementation to simply change the row selection colo... | 44,308 |
<p>I'm looking to dynamically control a set of drop downs so that they'll filter their items after another drop down's index has been changed.</p>
<p>I'm working in C#/ASP.net and it would be great if I could get the necessary data straight from Sql Server. I suppose I could generate an xml file whenever new data is u... | <p>Check out the <a href="http://www.asp.net/ajax/ajaxcontroltoolkit/samples/CascadingDropDown/CascadingDropDown.aspx" rel="nofollow noreferrer">CascadingDropDown Control</a>. It's part of the ASP.NET Ajax Control Toolkit.</p>
| <p>You can use onchange event of one drop down and on the event you can change the another dropdown contents using ajax</p>
| 49,929 |
<p>Hey I am coding using Visual Studio 2003. My program worked fine until I introduced a dll I made using CreateObject.
Code:</p>
<pre><code>Set docs2 = server.CreateObject("DocGetter.Form1")
docs2.GetDocument oXMLDom,numID
</code></pre>
<p>It appears to be getting stuck at this code. I've already used regasm to regi... | <p>Add a reference to the dll in your project and instantiate the object like this:</p>
<pre><code>Dim docs2 As New DocGetter.Form1()
</code></pre>
<p>If that doesn't make sense, then fix it so it does. There's no good reason to use CreateObject in .Net code. (Okay, that's hyperbole. But the principal is sound).</p... | <p>Can you clarify - is this a web app or a client (winform) app? Form1 sounds like a winform. ASP.NET runs at the server, so showing a form would be inappropriate - it would happen at the server, not the client. In short, don't do this!</p>
<p>I also can't see where "stored procedures" figures in this, so I've remove... | 45,695 |
<p>If I create a class <code>A</code> as follows:</p>
<pre><code>class A:
def __init__(self):
self.name = 'A'
</code></pre>
<p>Inspecting the <code>__dict__</code> member looks like <code>{'name': 'A'}</code></p>
<p>If however I create a class <code>B</code>:</p>
<pre><code>class B:
name = 'B'
</cod... | <p><code>B.name</code> is a class attribute, not an instance attribute. It shows up in <code>B.__dict__</code>, but not in <code>b = B(); b.__dict__</code>.</p>
<p>The distinction is obscured somewhat because when you access an attribute on an instance, the class dict is a fallback. So in the above example, <code>b.... | <pre><code>class A:
def _ _init_ _(self):
self.name = 'A'
a = A()
</code></pre>
<p>Creates an attribute on the object instance a of type A and it can therefore be found in: <code>a.__dict__</code></p>
<pre><code>class B:
name = 'B'
b = B()
</code></pre>
<p>Creates an attribute on the class B and the ... | 5,638 |
<p>When I shrink a sql server database using the GUI (All Tasks->Shrink Database->Accept all defaults, click OK), it finishes quickly.</p>
<p>But if I run this command, it takes a very very long time.</p>
<pre><code>DBCC SHRINKDATABASE('my_database')
</code></pre>
<p>What am I missing?</p>
<p>This is in SQL Server ... | <p>If I recall correctly the interface will leave about 20% grown space, running DBCC SHRINKDATABASE without any parameters shrinks it to as small as possible.</p>
<p>I don't have Enterprise Manager handy to check the defaults. But you should notice a smaller database file with the manual run than the GUI run, thus t... | <p>Details about the DBCC SHRINKDATABASE can be found here: <a href="http://msdn.microsoft.com/en-us/library/ms190488.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms190488.aspx</a>. Notice this is for SQL Server 2005 -> </p>
| 24,749 |
<p>Using <a href="http://www.codeplex.com/aspnet" rel="nofollow noreferrer">preview 4</a> of <a href="http://asp.net/mvc" rel="nofollow noreferrer">ASP.NET MVC</a>
Code like:</p>
<pre><code><%= Html.CheckBox( "myCheckBox", "Click Here", "True", false ) %>
</code></pre>
<p>only outputs:</p>
<pre><code><inpu... | <p>Try this: </p>
<pre><code><%= Html.CheckBox("myCheckbox", "Click here", "True", false, new {_id ="test" })%>
</code></pre>
<p>For any keyword you can use an underscore before the name of the attribute. Instead of class you use _class. Since class is a keyword in C#, and also the name of the attribute in HT... | <p>Apparently this is a bug. Because they are adding it to potential rendering values, they just forgot to include it. I would recommend creating a bug on codeplex, and download the source and modify it for your needs.</p>
| 2,964 |
<p>I am looking for a solution to export Shared Outlook Calendars (yes, I'm using exchange server and yes I can copy calendar to my local folders, which would allow me to export. However, what if there are more than 50 calendars, which I need to export? Is there a way of automating the process?). </p>
<p>I am interest... | <p><a href="http://msdn.microsoft.com/en-us/library/bb204119(EXCHG.80).aspx" rel="nofollow noreferrer">Exchange Web Services (EWS)</a> allows you to do this</p>
| <p><a href="http://sourceforge.net/projects/outlook2ical/" rel="nofollow noreferrer"><H2>outlook2ical</h2></a> has a VBMacro to export outlook calendar to iCal format.</p>
<p>You might check if its worth the time to port to C#.</p>
| 7,710 |
<p>how do i insert items into an html listbox from a database?
im using asp c#. i cant make the listbox run at server because the application wont work if i do that. so i have to insert values from a database into an html listbox. I just need to display 1 column of data. cheers..</p>
| <p>You could use a Literal, build the HTML for the listbox, and set the .Text of the Literal.</p>
<p>You could either string together the HTML for the listbox <a href="http://htmlhelp.com/reference/html40/forms/select.html" rel="nofollow noreferrer">manually</a>, or you could build a Listbox in C# and use <a href="htt... | <p>There are two ways of doing this I can think of:</p>
<p>First, you can place an <code><asp:Placeholder /></code> tag on the page and generate the listbox in code:</p>
<pre><code>var select = new HtmlSelect() { Size = 5 };
//assuming the data has been placed in an IEnumarble
foreach (var item in items)
{
... | 37,066 |
<p>I use K2 as my workflow engine. For some reason my processes are not available in any of the reporting views (on the workspace). Do I have to do something special when deploying to get them there?</p>
| <p>Your k2 process should appear in the reports automatically. If it does not, maybe it has never been started?</p>
<p>Look at the _ProcInst table in the K2Server database to see if it's there.</p>
| <p>TrueWill's comments are correct. However, the most likely cause of not seeing specific process data is the lack of required permissions. Make sure your account has either View, View Participate, or the Admin right on the process depending upon the requirement. View Participate requires that you participated in th... | 21,928 |
<p>So i have a source tree that i want to clean up in CVS.</p>
<p>What a really want is to branch the old stuff off, but never merge in back in. But so i can have an eclipse workspace to access and make some changes if i need to.</p>
<p>And then we clean up the main trunk (by removing things we dont need anymore) and... | <p>If you are not using it any more why not just tagging it as a version an proceed with the clean up in the HEAD.</p>
<p>That is what we do in our development tree. If we need to correct something that applies to an old version we just branch that version at that time, but not before.</p>
| <p>With CVS it's a lot easier to tag and deal with branches only when you need to make the changes - that seems to be the best practice. Here's a site I found helpful back before we switched to SVN:</p>
<p><a href="http://owen.sj.ca.us/rkowen/howto/cvs.html#branches" rel="nofollow noreferrer">http://owen.sj.ca.us/rkow... | 38,153 |
<p>I have seen samples of closure from - <a href="https://stackoverflow.com/questions/36636/what-is-a-closure">What is a 'Closure'?</a></p>
<p>Can anyone provide simple example of when to use closure?<br></p>
<p><b>Specifically, scenarios in which closure makes sense?</b><Br></p>
<p>Lets assume that the lang... | <p>Closures are simply great tools. When to use them? Any time you like... As has already been said, the alternative is to write a class; for example, pre C# 2.0, creating a parameterised thread was a real struggle. With C# 2.0 you don't even need the `ParameterizedThreadStart' you just do:</p>
<pre><code>string name ... | <p>In Lua and Python it's a very natural thing to do when "just coding", because the moment you reference something that's not a parameter, you're making a closure. (so most of these will be quite dull as examples.)</p>
<p>As for a concrete case, imagine an undo/redo system, where the steps are pairs of (undo(), redo(... | 32,021 |
<p>I have 2 classes with a LINQ association between them i.e.:</p>
<pre><code>Table1: Table2:
ID ID
Name Description
ForiegnID
</code></pre>
<p>The association here is between <strong>Table1.ID -> Table2.ForiegnID</strong></p>
<p>I need to be able to change the value of Table2... | <p>Check out the designer.cs file. This is the key's property</p>
<pre><code>[Column(Storage="_ParentKey", DbType="Int")]
public System.Nullable<int> ParentKey
{
get
{
return this._ParentKey;
}
set
{
if ((this._ParentKey != value))
{
//This code is added b... | <p>You wanna to associate with another record in table1 or change table1.id?
if it's option 1, you need to remove that association and set a new one.
If option 2, check you db and see if update cascade yes enabled for this fk and than get record and change value of id.</p>
| 24,065 |
<p>I am using the Skype4Com COM object to intercept audio from the microphone. I know that it is 16 bit mono, but how do I find out what its sample rate is?</p>
| <p>It would seem that there is no facility in Skype4Com to determine the microphone sample rate at the moment. My experiments indicate that it is 16kHz. </p>
| <p>It would seem that there is no facility in Skype4Com to determine the microphone sample rate at the moment. My experiments indicate that it is 16kHz. </p>
| 33,984 |
<p>I would like to know how long it's been since the user last hit a key or moved the mouse - not just in my application, but on the whole "computer" (i.e. display), in order to guess whether they're still at the computer and able to observe notifications that pop up on the screen.</p>
<p>I'd like to do this purely fr... | <p><a href="http://www.gajim.org/" rel="nofollow noreferrer">Gajim</a> does it this way on Windows, OS X and GNU/Linux (and other *nixes):</p>
<ol>
<li><a href="https://dev.gajim.org/gajim/gajim/blob/89c7eb6e6ab3f61a188c6cee063a000526df522c/gajim/common/sleepy.py" rel="nofollow noreferrer">Python wrapper module</a> (a... | <p>I got an answer regarding mouse-clicks suggesting to use <a href="http://www.cs.unc.edu/Research/assist/developer.shtml" rel="nofollow noreferrer">pyHook</a>:</p>
<p><a href="https://stackoverflow.com/questions/165495/detecting-mouse-clicks-in-windows-using-python">Detecting Mouse clicks in windows using python</a>... | 26,691 |
<p>I've run into a strange syntax in <a href="http://boo.codehaus.org/Closures" rel="nofollow noreferrer">Boo Language Guide</a> :</p>
<pre><code>setter = { value | a = value }
</code></pre>
<p>What does the | operator mean?</p>
| <p>The documentation of Boo seems to be lacking in this area -- it seems that </p>
<pre><code>setter = { value | a = value }
</code></pre>
<p>is shorthand for</p>
<pre><code>setter = def(value):
a = value
</code></pre>
| <p>That syntax for specifying code blocks (anonymous functions) has been borrowed from <a href="http://blog.codahale.com/2005/11/24/a-ruby-howto-writing-a-method-that-uses-code-blocks/" rel="nofollow noreferrer">Ruby</a> and <a href="http://web.cecs.pdx.edu/~harry/musings/SmalltalkOverview.html#Blocks" rel="nofollow no... | 5,744 |
<p>I flatter myself that I'm a good programmer, and can get away with graphic design. But something I'm incapable of doing is coming up with good names - and it seems neither are the people I work with. We're now in the slightly ludicrous situation that the product we've been working on for a couple of years is being i... | <p>When it's for something that "matters", I plop down the $50 and have the folks at PickyDomains.com help out. That also results in a name that's available as a .com.</p>
<p>For guidelines, here's an extract from my own guide on naming open source projects:</p>
<ol>
<li>If the name you're thinking of is directly pul... | <p>Names -- you can try yourselves or ask friends/customers about what they are thinking about when listen/use your product (I don't know correct English word for that -- if two things have something in common they are associated?).</p>
<p>Or, depends on what kind of product is it, ask someone with unlimited imaginati... | 4,234 |
<p>I'm trying to create a LINQ to SQL class that represents the "latest" version of itself.</p>
<p>Right now, the table that this entity represents has a single auto-incrementing ID, and I was thinking that I would add a version number to the primary key. I've never done anything like this, so I'm not sure how to proc... | <p>If you can avoid keeping a history, do. It's a pain.</p>
<p>If a complete history is unavoidable (regulated financial and medical data or the like), consider adding history tables. Use a trigger to 'version' into the history tables. That way, you're not dependent on your application to ensure a version is recorded ... | <p>The best way to proceed is to stop and seriously rethink your approach. </p>
<p>If you are going to keep different versions of the "object" around, then you are better off serializing it into an xml format and storing that in an XML column with a field for the version number.</p>
<p>There are serious consideratio... | 46,474 |
<p>The <strong>C</strong> preprocessor is justifiably feared and shunned by the C++ community. In-lined functions, consts and templates are usually a safer and superior alternative to a <code>#define</code>.</p>
<p>The following macro: </p>
<pre><code>#define SUCCEEDED(hr) ((HRESULT)(hr) >= 0)
</code></pre>
<p>... | <p>As wrappers for debug functions, to automatically pass things like <code>__FILE__</code>, <code>__LINE__</code>, etc:</p>
<pre><code>#ifdef ( DEBUG )
#define M_DebugLog( msg ) std::cout << __FILE__ << ":" << __LINE__ << ": " << msg
#else
#define M_DebugLog( msg )
#e... | <pre><code>#define COLUMNS(A,B) [(B) - (A) + 1]
struct
{
char firstName COLUMNS( 1, 30);
char lastName COLUMNS( 31, 60);
char address1 COLUMNS( 61, 90);
char address2 COLUMNS( 91, 120);
char city COLUMNS(121, 150);
};
</code></pre>
| 12,178 |
<p>Where is the location of my oracle event log (on a default Linux installation)?</p>
| <pre><code>select value from v$parameter where name = 'background_dump_dest'
</code></pre>
| <p>Using @<a href="https://stackoverflow.com/questions/197033/where-is-the-oracle-event-log-located#197108">cagcowboy's answer</a>, a default <a href="http://www.oracle.com/technology/products/database/xe/index.html" rel="nofollow noreferrer">Oracle XE</a> installation on Linux writes out to:</p>
<pre><code>/usr/lib/or... | 23,950 |
<p>I'm trying to implement some drag and drop functionality for a material system being developed at my work. Part of this system includes a 'Material Library' which acts as a repository, divided into groups, of saved materials on the user's hard drive.</p>
<p>As part of some UI polish, I was hoping to implement a 'hi... | <p>Remote debugging is a godsend for debugging visual issues. It's a pain to set up, but having a VM ready for remote debugging will pay off for sure.</p>
<p>What I like to do is set a ton of breakpoints in my paint handling, as well as in the framework paint code itself. This allows you to effectively "freeze frame" ... | <p>It almost looks like the CStatic doesn't know that it needs to repaint itself, so the background color of the draggable object is left behind. Maybe try to invalidate the CStatic, and see if that helps at all?</p>
| 9,998 |
<p>If I have interface IFoo, and have several classes that implement it, what is the best/most elegant/cleverest way to test all those classes against the interface?</p>
<p>I'd like to reduce test code duplication, but still 'stay true' to the principles of Unit testing.</p>
<p>What would you consider best practice? ... | <p>If you have classes implement any one interface then they all need to implement the methods in that interface. In order to test these classes you need to create a unit test class for each of the classes.</p>
<p>Lets go with a smarter route instead; if your goal is to <strong>avoid code and test code duplication</st... | <p>I don't use NUnit but I have tested C++ interfaces. I would first test a TestFoo class which is a basic implementation of it to make sure the generic stuff works. Then you just need to test the stuff that is unique to each interface.</p>
| 6,002 |
<p>I'm about to write a little GUI app that will sit in the system tray, doing a little FTP and ODBC. </p>
<p>I'd like to develop in Linux, if possible.</p>
<p>What would you recommend?</p>
<p>Thanks a bunch!</p>
| <p>I'll probably be down mod but I think that <a href="http://www.freepascal.org" rel="nofollow noreferrer">FreePascal</a> is your best bet.</p>
<p>Most, if not all, of the functionalities are cross platform and resolved quite nicely. I'm not sure, but I could investigate, but the TTrayIcon is cross-platform and that'... | <p>Mono by Miguel de Izaca - now owned / sponsored by Novell. It gives you 90% of the .NET framework in Linux. </p>
| 19,114 |
<p>I have a <code>modal dialog</code> form which has some "help links" within it which should open other non-modal panels or dialogs on top of it (while keeping the main dialog otherwise modal). </p>
<p>However, these always end up behind the mask. <code>YUI</code> seems to be recognizing the highest <code>z-index</... | <p>By default, YUI manages the z-index of anything that extends YAHOO.widget.Overlay and uses an overlay panel. It does this through the YAHOO.widget.Overlay's "bringToTop" method. You can turn this off by simply changing the "bringToTop" method to be an empty function:</p>
<pre><code>YAHOO.widget.Overlay.prototype.... | <p>The original dialog can't be modal if the user is supposed to interact with other elements—that's the definition of modal. Does the original dialog <em>really</em> need to be modal at all? If so, have you tried toggling the modal property of the original dialog before you open the other elements?</p>
| 10,286 |
<p>There are numerous <a href="http://en.wikipedia.org/wiki/Agile_software_development" rel="nofollow noreferrer">Agile software development</a> methods. Which ones have you used in practice to deliver a successful project, and how did the method contribute to that success? </p>
| <p>I've been involved with quite a few organisations which claimed to work in an 'agile' way, and their processed usually seemed to be base on XP (extreme programming), but none of them ever followed anywhere near all the practices.</p>
<p>That said, I can probably comment on a few of the XP practices</p>
<ul>
<li><p... | <p>I've been working with a team using XP and Scrum practices sprinkled with some lean. It's been very productive.</p>
<p><strong>Daily Standup</strong>- helps us keep complete track of what and where everyone is working on.</p>
<p><strong>Pair Programming</strong>- has improved our code base and helped remove "sill... | 2,829 |
<p>I have the following line:</p>
<pre><code>"14:48 say;0ed673079715c343281355c2a1fde843;2;laka;hello ;)"
</code></pre>
<p>I parse this by using a simple regexp:</p>
<pre><code>if($line =~ /(\d+:\d+)\ssay;(.*);(.*);(.*);(.*)/) {
my($ts, $hash, $pid, $handle, $quote) = ($1, $2, $3, $4, $5);
}
</code></pre>
<p>Bu... | <p>The greedy operator tries to grab as much stuff as it can and still match the string. What's happening is the first one (after "say") grabs "0ed673079715c343281355c2a1fde843;2", the second one takes "laka", the third finds "hello " and the fourth matches the parenthesis.</p>
<p>What you need to do is make all but t... | <p>Try making the first 3 <code>(.*)</code> ungreedy <code>(.*?)</code></p>
| 31,920 |
<p>I am building a C# ActiveX DLL... do I use REGASM or REGSVR32 to register it?</p>
<p>How do I register the 64-bit interface vs the 32-bit interface?</p>
| <p>You need to use <a href="http://msdn.microsoft.com/en-us/library/tzat5yw6%28v=vs.80%29.aspx" rel="noreferrer"><code>regasm.exe</code></a> to register both the 32 bit and 64 bit interfaces I believe you need to run each of the <code>regasm.exe</code>'s in:</p>
<pre><code>C:\Windows\Microsoft.NET\Framework\v2.0.50727... | <p>If the DLL is build in format of "Any CPU", no matter if you choose regasm in </p>
<pre><code>C:\Windows\Microsoft.NET\Framework\v2.0.50727
</code></pre>
<p>or </p>
<pre><code>C:\Windows\Microsoft.NET\Framework64\v2.0.50727
</code></pre>
<p>DLL would be registered as 32-bit.</p>
| 48,642 |
<p>Since I started studying object-oriented programming, I frequently read articles/blogs saying functions are better, or not all problems should be modeled as objects. From your personal programming adventures, when do you think a problem is better solved by OOP?</p>
| <p>There is no hard and fast rule. A problem is better solved with OOP when you are better at solving problems and thinking in an OO mentality. Object Orientation is just another tool which has come along through trying to make computing a better tool for solving problems. </p>
<p>However, it can allow for better c... | <p>I tell you when OOP is bad. </p>
<p>When the architect writes really complicated, non-documented OOP code. Leaves half way through the project. And many of his common code pieces he used across various project has missing code. Thank god for .NET Reflector.</p>
<p>And the organization was not running Visual So... | 2,843 |
<p>I am wondering if anyone has any experience using a JQuery plugin that converts a html </p>
<pre><code><select>
<option> Blah </option>
</select>
</code></pre>
<p>combo box into something (probably a div) where selecting an item acts the same as clicking a link.</p>
<p>I guess you coul... | <p>The simple solution is to use</p>
<pre><code>$("#mySelect").change(function() {
document.location = this.value;
});
</code></pre>
<p>This creates an onchange event on the select box that redirects you to the url stored in the value field of the selected option.</p>
| <p>This bit of javascript in the 'select':</p>
<pre><code>onchange="if(this.options[this.selectedIndex].value!=''){this.form.submit()}"
</code></pre>
<p>It's not ideal (because form submissions in ASP.NET MVC which I'm using don't appear to use the routing engine for URLs) but it does its job.</p>
| 7,141 |
<p>What are pros and cons of having dedicated application pools over keeping web applications in one default app pool?</p>
| <p>Pros:</p>
<ul>
<li>Applications are isolated from each other, unless IIS goes with it, an app pool locking will only take out applications in that pool</li>
<li>Ability to run applications under different ASP.NET runtimes, one pool for 1.1 another for 2.0 if needed</li>
<li>Ability to have different app pool settin... | <p>If you have separate apppools then you pay a penalty in the initial load time of the first person to visit your site and spin back up the apppool after it recycles.</p>
<p>For example let's say overnight no-one hits your server, IIS will spin down (default 20mins I believe). The first person to visit the server wil... | 27,573 |
<p>So I have an Access application, and I'd like some forms to be maximised when they are opened, and others to be medium-sized when they are opened. However, if I try something like this:</p>
<pre><code>Private Sub Form_Activate()
DoCmd.Maximize
End Sub
</code></pre>
<p>or</p>
<pre><code>Private Sub Form_Activat... | <p><a href="https://stackoverflow.com/questions/217132/controlling-size-of-forms-in-access#217137">ΤΖΩΤΖΙΟΥ</a> is 100% right when saying that either all are maximised, or none. If you really want to manage this issue, you'll have to read a little bit <a href="http://www.utteraccess.com/forums/printthread.php?Cat=&... | <p>You can use MoveSize:</p>
<pre><code>DoCmd.MoveSize 100,100
</code></pre>
<p>Further information: <a href="http://msdn.microsoft.com/en-us/library/aa141514(office.10).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa141514(office.10).aspx</a></p>
| 26,689 |
<p>The windows installed on my machine has the locale <code>en_AU</code> and that's what JasperReports uses. I already tried changing the locale of all users, including the Administrator but it still uses <code>en_AU</code>.</p>
<p>How can I change that locale? Is it possible to change the <code>REPORT_LOCALE</code> p... | <p>The locale is set during execution, not in the JRXML.</p>
<p>Using Java, set the <code>REPORT_LOCALE</code> parameter for the report's parameter map. For example:</p>
<pre><code>InputStream reportTemplate = getReportTemplate();
JRDataSource dataSource = getDataSource();
java.util.Map parameters = getParameters();... | <p>You can set the locale on JVM that executes the <code>JasperFillManager</code> code if you do not want to change the code:</p>
<pre><code>java -Duser.language=de -Duser.country=CH ...
</code></pre>
| 30,858 |
<p>I am working on a VB.NET WinForms app that was "upgraded" by Visual Studio (originally 1.0 or 1.1) from VB6 code (which was itself upgraded from VB5). Except for the few new forms I've created since taking over maintenance of this app, all of the forms in the application have a method called DefInstance which allows... | <p>I received this answer from a Microsoft employee:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa289529%28VS.71,printer%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa289529(VS.71,printer).aspx</a></p>
<p>In short, DefInstance is a "not best practices" compatibility method ... | <p>As you mention, it lets you get a reference to the form. </p>
<p>I've seen lots of VB written like this:</p>
<pre><code>Private Sub Command_Click()
Call DoStuff
End Sub
Private Sub DoStuff()
Form1.myTextbox.Text = "Bad Idea"
End Sub
</code></pre>
<p>DefInstance allows DoStuff() to continue working without ... | 28,695 |
<p>I've seen some Python programmers use the following style fairly consistently (we'll call it style 1):</p>
<pre><code>import some_module
# Use some_module.some_identifier in various places.
</code></pre>
<p>For support of this style, you can cite the <a href="http://www.python.org/dev/peps/pep-0020/" rel="nofollow... | <p>There are uses for both cases, so I don't think this is an either-or issue.
I'd consider using from module <code>import x,y,z</code> when:</p>
<ul>
<li><p>There are a fairly small number of things to import</p></li>
<li><p>The purpose of the functions imported is obvious when divorced from the module name. If the ... | <p>I believe in newer versions of Python (2.5+? must check my facts...) you can even do:</p>
<pre><code>import some_other_module as some_module
</code></pre>
<p>So you could still go with style 1 and swap in a different module later on.</p>
<p>I think it generally maps to how much you want to clutter up your namespa... | 22,560 |
<p>Is there a way to change the way asp.net generates elements in the WSDL generated from a .asmx file? Specifically, it seems to mark all elements minoccurs="0" and there are some elements that I want to be minoccurs="1" (aka required fields). </p>
<p>One of these is an argument to the web service (e.g. foo(arg1, a... | <p>I think that the <code>XmlElement(IsNullable = true)</code> attribute will do the job:</p>
<pre><code>using System.Xml.Serialization;
[WebMethod]
public string MyService([XmlElement(IsNullable = true)] string arg)
{
return "1";
}
</code></pre>
<hr>
<p>EDIT [VB version]</p>
<pre><code>Imports System.Xml.Serial... | <p>The only way I know of (short of upgrading to WCF) is to use the [XmlSchemaProvider] attribute. This permits you tio indicate a method that will return the schema that will be emitted as part of the WSDL.</p>
<p>By the time you get to this point, you may find it better to simply write your own WSDL, by hand, so you... | 22,880 |
<p>I have a form a user can enter their name, then it will add it to $message to be sent in an email.</p>
<p>Is it better to use <code>$_POST</code> or <code>$_REQUEST</code>?</p>
<p>Here is a snippet of using <code>$_REQUEST</code></p>
<pre><code>$message.= "Name: ".$_REQUEST["fname"]." ".$_REQUEST["mname"]." ".$_R... | <p>The answer is: It depends on how you want it to be used.</p>
<p>If you're using <code>$_POST</code>, that means it can only come in via POST.
If you're using <code>$_REQUEST</code>, that means you accept POST, GET (and COOKIE, but it's mainly the first two we're interested in).</p>
<p>For something like this, <cod... | <p>_POST if data is being updated somewhere (i.e. if the action has a side-effect), _REQUEST otherwise, <strong>and</strong> if you don't care whether or not the data comes via GET, POST, or any other method.</p>
| 29,722 |
<p>Suppose you store instances of a class in a relational table. How would you go about persisting a static attribute of that class? For example:</p>
<pre><code>class WebSiteUser {
private static $common_homepage_content;
private $username;
private $password_hash;
...
}
</code></pre>
<p>Corresponding ... | <p>As static variables make sense for a class but not on the instance level it can't go inside the table that has instance variables. In the table that you are creating there can be multiple username characters and corresponding password_hashes but putting common_homepage_content in each record would be duplication of ... | <p>As static variables make sense for a class but not on the instance level it can't go inside the table that has instance variables. In the table that you are creating there can be multiple username characters and corresponding password_hashes but putting common_homepage_content in each record would be duplication of ... | 49,872 |
<p>I was wondering if anyone could suggest a utility library that has useful functions for handling dates in ASP.NET easily taking away some of the leg work you normally have to do when handling dates?</p>
<p>Subsonic Sugar has some really nice functions:</p>
<p><a href="http://subsonichelp.com/html/1413bafa-b5aa-99a... | <p>Is there a specific problem you are trying to handle with dates? If the existing date API in .NET can handle your problem cleanly, I see no reason to consider a 3rd party library to do it. When I was in .NET, we had to deal with dates quite a bit, and the standard libraries provided a fair amount of functionality ... | <p>What exactly do you want to do that System.DateTime and System.Timespan can't handle?</p>
| 8,687 |
<p>I am adding a custom background image to my navigation bar by creating an image view and doing a <code>[navigationController.navigationBar addSubview:imageView]</code>.</p>
<p>The background comes in fine. But as soon as I do this, my other navigation items start behaving in a strange manner. Sometimes the <code>na... | <p>When in the view setup process are you adding your subview? You may be doing it after your other nav items have been added, and so it's covering them. Try either adding it in your -loadView method, or waiting until -viewWillAppear:, and using -sendSubviewToBack: after adding it.</p>
| <p>Setting the imageView to index 0 and solved my problem.</p>
| 49,458 |
<p>How can I access Ethernet statistics from C/C++ code like <strong>netstat -e</strong>?</p>
<pre><code>Interface Statistics
Received Sent
Bytes 21010071 15425579
Unicast packets 95512 94166
Non-unicast packets 12510 ... | <p>The WMI will provide those readings:</p>
<pre><code>SELECT * FROM Win32_PerfFormattedData_Tcpip_IP
SELECT * FROM Win32_PerfFormattedData_Tcpip_TCP
SELECT * FROM Win32_PerfFormattedData_Tcpip_UDP
SELECT * FROM Win32_PerfFormattedData_Tcpip_ICMP
SELECT * FROM Win32_PerfFormattedData_Tcpip_Networkinterface
</code></pr... | <p>See Google Groups, original netstats source code has been posted many times (win32 api)</p>
| 27,251 |
<p>I'm looking for a light version of REST for a Java web application I'm developing. </p>
<p>I've looked at RESTlet (www.restlet.org) and the REST plugin for Struts 2, but I haven't made up my mind. I'm leaning towards RESTlet, as it seems to be lighter.</p>
<p>Has anyone implemented a RESTful layer without any of t... | <p>I'm a huge fan of JAX-RS - I think they've done a great job with that specification. I use it on a number of projects and its been a joy to work with. </p>
<p>JAX-RS lets you create REST resources using POJOs with simple annotations dealing with the URI mappings, HTTP methods and content negotiation all integrated ... | <p>I am working on a REST API for <a href="http://www.gliffy.com" rel="nofollow noreferrer">gliffy.com</a> and we ended up rolling our own. We didn't want to have to bring in Struts 2, Spring, or any other framework. I looked at RESTLet and found it incredibly confusing and over complicated.</p>
<p>Apache has an imp... | 9,184 |
<p>So I am wondering if there is a definitive answer to this question.<br>
Also, does it matter if the index is clustered vs. non-clustered.
Is it the same in all RDBMS implementations or is the exact behavior going to be proprietary?</p>
| <p>SQL is a declarative language, not a procedural one. Each SQL implementation is going to have its own quirks about implementation details like which indexes get used, how the optimizer decides which indexes to use, what the SQL programmer can do to affect the choice, and so on.</p>
| <p>This is tough to answer because I think no one really knows, including the DBMS engineers! LOL, that is sarcasm, but what I really mean is that it is inherently non-deterministic. I could be wrong, but it really does boil down to the DB engine implementation, since the ANSI SQL standard, or any other standard does n... | 35,405 |
<p>I have a cross platform program that runs on Windows, Linux and Macintosh. My windows version has an Icon but I don't know how to make have one for my Linux build.
Is there a standard format for KDE, Gnome etc. or will I have to do something special for each one?</p>
<p>My app is in c++ and distributed as source so... | <p>For Gnome and Kde, you would probably want to include a desktop file with your app that defines how it will be launched. The specification can be found <a href="http://standards.freedesktop.org/desktop-entry-spec/latest/index.html" rel="noreferrer">here</a>. If you have an installer included with your app, you would... | <p>KDE community with it's KDE 4 series started to use CMake as a build system. They developed a CMake macro that knows how to set an icon for your application regardles of the platform (windows (embedded in exe), mac (.app bundles), linux (.desktop files) etc.)</p>
<p>Maybe you can use it.</p>
| 14,483 |
<p>I have a few ASP.Net database front-end websites where MS Access is the back-end. I am trying to use ASP.Net dynamic data website. Should I change this database to SQL Server Express or something else to make it easier or should this work from with MS Access.</p>
| <p>Pick SQL Express for these reasons:</p>
<ol>
<li><strong>Scaling</strong>: MS Access will never scale. Once you get over about 10 concurrent connections you will start to see trouble. SQL Express will scale. You can always move SQL Express up to a full-blow SQL Server installation. While this is somewhat true o... | <p>You can use LINQ to DataSets to use Linq against an Access .mdb or .accdb database.</p>
<p>You can read more at <a href="http://msdn.microsoft.com/en-us/library/bb386977.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/bb386977.aspx</a> and <a href="http://blogs.msdn.com/adonet/archive/2007/... | 37,361 |
<p>Other than <a href="http://couchdb.org" rel="nofollow noreferrer">CouchDB</a> and Native XML Databases (such as <a href="http://exist-db.org" rel="nofollow noreferrer">eXist</a>), which databases can store and query un- and semi-structured data?</p>
<p>I've been handed lots of data in different formats (XML, JSON, ... | <p>Most modern RDBMS support an xml datatype, think an xml document is a value in a table field, with XPath/XQuery to retrieve data from the value. Similiarly you can use a CLOB datatype to represent a large block of characters (i.e. an unstructured document); in which case Oracle, SQL Server, and others have extensio... | <p>Microsoft SQL Server has an XML column type starting in 2005.</p>
| 28,087 |
<p>What libraries exist for other programming languages to provide an Erlang-style concurrency model (processes, mailboxes, pattern-matching receive, etc.)?</p>
<p>Note: I am specifically interested in things that are intended to be similar to Erlang, not just any threading or queueing library.</p>
| <p>Message Passing Interface (MPI) (<a href="http://www-unix.mcs.anl.gov/mpi/" rel="noreferrer">http://www-unix.mcs.anl.gov/mpi/</a>) is a highly scalable and robust library for parallel programming, geared original towards C but now available in several flavors <a href="http://en.wikipedia.org/wiki/Message_Passing_Int... | <p>For python you can try using <a href="http://pyprocessing.berlios.de/" rel="nofollow noreferrer">processing module</a>.</p>
| 4,219 |
<p>Is there a maximum length when using window.returnValue (variant) in a modal? </p>
<p>I am calling a modal window using showModalDialog() and returning a comma delimited string. After selecting a group of users, I am putting them into a stringbuilder to display in a literal.</p>
<pre><code>Dim strReturn As New S... | <p>First, in what browser are you having problems? <code>window.returnValue</code> isn't even supported in Firefox, maybe not even other browsers.</p>
<p>Second, have you looked the value of <code>strUsers</code> after building it to make sure there are no single or double quotes in that string?</p>
<p>I would guess ... | <p>My users have to use IE6 (not my call), and the modal is already wired for IE so that is why I am using showModalDialog.</p>
<p>strUsers will always be a comma delimited list of integers</p>
<pre><code>E.G.: 384834,583882,343993,391823,302103
</code></pre>
| 26,241 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.