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 table like as follows:</p>
<pre>
SoftwareName Count Country
Project 15 Canada
Visio 12 Canada
Project 10 USA
Visio 5 USA
</pre>
<p>How do I query it to give me a summary like...</p>
<pre>
SoftwareName Canada USA Total
Project ... | <pre><code>SELECT SoftwareName,
SUM( CASE Country WHEN 'Canada' THEN [Count] ELSE 0 END ) AS Canada,
SUM( CASE Country WHEN 'USA' THEN [Count] ELSE 0 END ) AS USA,
SUM( [Count] ) AS Total
FROM [Table]
GROUP BY SoftwareName;
</code></pre>
| <p>i think you can use this Link :</p>
<p><a href="https://stackoverflow.com/questions/17165381/sum-of-unique-records-better-performance-than-a-cursor/18657739#18657739">Sum of unique records - better performance than a cursor</a></p>
<p>and i think using PIVOT Function have a best performance rater SUM() function.!<... | 30,947 |
<p>I'm maintaining some code that uses a *= operator in a query to a Sybase database and I can't find documentation on it. Does anyone know what *= does? I assume that it is some sort of a join.</p>
<pre><code>select * from a, b where a.id *= b.id</code></pre>
<p>I can't figure out how this is different from:</p>
... | <p>From <a href="http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc34982_1500/html/mig_gde/mig_gde160.htm" rel="noreferrer">http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc34982_1500/html/mig_gde/mig_gde160.htm</a>:</p>
<p>Inner and outer tables</p>
<p>The terms outer table and inner tab... | <pre><code>select * from a, b where a.id = b.id</code></pre>
<p>Requires that a row exist in where b.id = a.id in order to return an answer</p>
<pre><code>select * from a, b where a.id *= b.id</code></pre>
<p>Will fill the columns from b with nulls when there wasn't a row in b where b.id = a.id.</p>
| 6,190 |
<p>On a 32-bit CPU, an integer is 4 bytes and a short integer is 2 bytes. If I am writing a C/C++ application that uses many numeric values that will always fit within the provided range of a short integer, is it more efficient to use 4 byte integers or 2 byte integers?</p>
<p>I have heard it suggested that 4 byte in... | <p>Yes, you should definitely use a 32 bit integer on a 32 bit CPU, otherwise it may end up masking off the unused bits (i.e., it will always do the maths in 32 bits, then convert the answer to 16 bits)</p>
<p>It won't do two 16 bit operations at once for you, but if you write the code yourself and you're sure it won'... | <p>If you are operating on a large dataset, the biggest concern is memory footprint. A good model in this case is to assume that the CPU is infinitely fast, and spend your time worrying about how much data has to be moved to/from memory. In fact, CPUs are now so fast that it is sometimes more efficient to encode (e.g... | 19,734 |
<p>Recently I've been thinking about <em>finite state machines</em> (FSMs), and how I would implement them in software (programming language doesn't matter).</p>
<p>My understanding is that <em>deterministic state machines</em> are in widespread use (parses/lexers, compilers and so on), but what's the matter with <em>... | <p>Most regular expression engines use <em>non</em>-deterministic automata since they offer much greater flexibility. DFAs are much more restricted. Have a look at some implementations and you'll see this. Microsoft even underlines this fact in their documentation of the .NET <a href="http://msdn.microsoft.com/en-us/li... | <p><a href="http://www.cs.cornell.edu/bigreddata/cayuga/" rel="nofollow noreferrer">Cayuga</a> utilizes non-deterministic finite state machines under the hood for complex event processing. Well, it looks like they call it "Stateful Publish/Subscribe for Event Monitoring", but I believe it is CEP.</p>
<p>I believe some... | 24,198 |
<p>I have a multi-line string that I want to do an operation on each line, like so:</p>
<pre><code>inputString = """Line 1
Line 2
Line 3"""
</code></pre>
<p>I want to iterate on each line:</p>
<pre><code>for line in inputString:
doStuff()
</code></pre>
| <pre class="lang-py prettyprint-override"><code>inputString.splitlines()
</code></pre>
<p>Will give you a list with each item, the <a href="https://docs.python.org/3/library/stdtypes.html#str.splitlines" rel="noreferrer"><code>splitlines()</code></a> method is designed to split each line into a list element.</p>
| <p>I wish comments had proper code text formatting, because I think @1_CR 's answer needs more bumps, and I would like to augment his answer. Anyway, He led me to the following technique; it will use cStringIO if available (BUT NOTE: cStringIO and StringIO are <strong>not the same</strong>, because you cannot subclass ... | 20,781 |
<p>I have a ListView control, and I'm trying to figure out the easiest/best way to disallow changing the selected row(s), without <em>hiding</em> the selected row(s).</p>
<p>I know there's a <code>HideSelection</code> property, but that only works when the <code>ListView</code> is still enabled (but not focused). I ne... | <p>You could also make the ListView ownerdraw. You then have complete control over how the items look whether they are selected or not or whether the ListView itself is enabled or not. The DrawListViewItemEventArgs provides a way to ask the ListView to draw individual parts of the item so you only have to draw the bits... | <p>Implement SelectedIndexChanged and do this</p>
<pre><code> private void listViewABC_SelectedIndexChanged(object sender, EventArgs e)
{
listViewABC.SelectedItems.Clear();
}
</code></pre>
| 3,489 |
<p>I am a programmer who writes a lot of code for desktop applications, now started considering cross-platform apps as an issue but at work I write C# apps and I come from C++ and CS background and of course, I wrote several things in QT/C++. But now I am kinda confused about web applications, I have done some work on ... | <p>The boundaries between desktop and web applications have really blurred. Whilst once upon a time the nature of developing for the web was totally different to developing for the desktop, nowadays you find the same concepts (such as parallelism which you referred to) cropping up in both. Don't think of developing web... | <p>In the near future, the boundary between the web development and the desktop application development will go on erasing. For a professional programmer, learning new things is the real growth. learning web development for an experienced programmer is not a difficult task. you can obviously go ahead and learn the web ... | 16,803 |
<p>Here's an interface:</p>
<pre><code>public interface Foo<T> extends Comparable<Foo<T>> {
...
}
</code></pre>
<p>And there are some classes implementing this interface:</p>
<pre><code>public class Bar extends Something implements Foo<Something> {
public Vector<Foo<Bar>> ... | <p>What all that code boils down to is:</p>
<pre><code>Vector<A> vector = new Vector<B>();
</code></pre>
<p>In this case B extends A, but that's not allowed because the types don't match. To make clear why this doesn't work, imagine the following code:</p>
<pre><code>Vector<Vector<?>> vector ... | <p>You can use</p>
<pre><code>Vector<? extends Foo<?>> vector;
</code></pre>
| 32,275 |
<p>"Assembly [AssemblyName] must have a shared name to be installed globally"</p>
<p>I am getting this error message when I try to deploy some component DLLs for my application to the Global Assembly Cache.</p>
<p>What is a shared name and how do i make sure my DLLs have one?</p>
| <p>A "shared name" must be a synonym for a "<a href="http://msdn.microsoft.com/en-us/library/xc31ft41.aspx" rel="nofollow noreferrer">strong name</a>," which is what I've always read/heard it called. That link shows how to sign an assembly with a strong name so that it can be added to the GAC.</p>
| <p>That's correct, you need to sign your assembly with a <a href="http://msdn.microsoft.com/en-us/library/szdke3d6.aspx" rel="nofollow noreferrer">strong name</a>.</p>
| 46,900 |
<p>What are some popular spam prevention methods besides CAPTCHA?</p>
| <p>I have tried doing 'honeypots' where you put a field and then hide it with CSS (marking it as 'leave blank' for anyone with stylesheets disabled) but I have found that a lot of bots are able to get past it very quickly. There are also techniques like setting fields to a certain value and changing them with JS, calcu... | <p>You could get some device ID software the41 has some fraud prevention software that can detect the hardware being used to access your site. I belive they use it to catch fraudsters but could be used to stop bots. Once you have identified an device being used by a bot you can just block that device. Last time a check... | 13,677 |
<p>A sysadmin teacher told me one day that I should learn to use "make" because I could use it for a lot of other things that just triggering complilations.</p>
<p>I never got the chance to talk longer about it. Do you have any good example ?</p>
<p>As a bonus, isn't it this tool deprecated, and what are modern alter... | <p>One excellent thing make can be used for besides compilation is LaTeX. If you're doing any serious work with LaTeX, you'll find make very handy because of the need to re-interpret .tex files several times when using BibTex or tables of contents.</p>
<p>Make is definitely not deprecated. Although there are different... | <p>The most random use I've ever seen is make being used in place of bash for init scripts on <a href="http://bccd.cs.uni.edu/" rel="nofollow noreferrer">BCCD</a>. It actually worked decently, once you got over the wtf moment....</p>
<p>Think of make as shell scripts with added oomph.</p>
| 12,748 |
<p>I want to grant a user permission to create, alter, and execute stored procedures, but without the ability to create other database objects. I excluded them from the role db_ddladmin, but explicitly granted the permissions "Create procedure" and "Execute". These permssions appear in the effective permissions list.... | <p>A user can create procedures in a schema that they own. So you can set up a schema for the user to do development work. Then, if it needs to be dbo, the admin can put it there when development is done.</p>
| <p>If you can create (or alter) and execute a stored procedure, you can do anything. </p>
<p>Execute on a stored procedure implies all other permissions within the context of that procedure. So if you can change a procedure <em>and</em> run it, there's no point in restricting anything else. You could just make the ... | 28,051 |
<p>I need to add the ability for users of my software to select records by character ranges.<br>
How can I write a query that returns all widgets from a table whose name falls in the range Ba-Bi for example?</p>
<p>Currently I'm using greater than and less than operators, so the above example would become:</p>
<pre><... | <p>Let's skip directly to localization. Would you say "aa" >= "ba" ? Probably not, but that is where it sorts in Sweden. Also, you simply can't assume that you can ignore casing in any language. Casing is explicitly language-dependent, with the most common example being Turkish: uppercase i is İ. Lowercase I is ı.</p>
... | <p>For MSSQL see this thread: <a href="http://bytes.com/forum/thread483570.html" rel="nofollow noreferrer">http://bytes.com/forum/thread483570.html</a> .</p>
<p>For Oracle, it depends on your Oracle version, as Oracle 10 now supports regex(p) like queries: <a href="http://www.psoug.org/reference/regexp.html" rel="nofo... | 18,405 |
<p>I am working with:</p>
<pre><code>#top ul li.corner span.right-corner:hover
{
background-image:url("images/corner-right-over.gif");
width:4px;
height:15px;
float:left;
}
#top ul li.corner span.left-corner:hover
{
background-image:url("images/corner-left-over.gif");
float:left;
width:4px... | <p>I believe the problem is that SPAN elements display inline by default - meaning they have no height and width. Try explicitly making them block level elements by adding:</p>
<pre><code>#top ul li.corner span.right-corner, #top ul li.corner span.left-corner
{
display: block;
}
</code></pre>
| <p>As the commenter noted, "top" is not a valid selector. It should be "#top" or ".top"</p>
| 42,294 |
<p>Is it possible to encode an assignment into an expression tree?</p>
| <p>No, I don't believe so.</p>
<p>Certainly the C# compiler disallows it when converting a lambda expression:</p>
<pre><code>int x;
Expression<Func<int,int>> foo = (x=y); // Assign to x and return value
</code></pre>
<p>This yields the error:</p>
<pre><code>CS0832: An expression tree may not contain an ... | <p>You could probably work around it by nexting expression trees. Call a lambda function, where an argument is the value of the assignee.</p>
| 25,635 |
<p>I currently have a list view which has several rows of data and I have a contextmenustrip in C# .NET.</p>
<p>What I am having problems with is when you click on the menu strip item I want to know which row has been selected.</p>
| <p>To get selected rows as sindre says you do like this:</p>
<pre><code>foreach (ListViewItem item in lvFiles.SelectedItems)
{
....................................
}
</code></pre>
<p>lvFiles is the ListView.</p>
| <p>I really don't know what you mean here. Can you please explain your problem further or provide a code example?</p>
<p>To get the selected row in a ListView you use the ListView.SelectedItems property. ListView.SelectedItems[0] will give you the first seleted item (as there can be more than one item selected)</p>
| 42,111 |
<p>Would it be useful to be able to mark objects where the value ofString.valueOf() would included in any stack trace. In my example below I used "trace". Variables that aren't declared at the point of the stack trace would just be ingored.
It would make debugging much easier and make it much easier to write programs ... | <p>this might be useful, but i think it clutters the code - presumably when the code is working you would want to remove the 'trace' keywords; perhaps some form of metadata would be more appropriate</p>
<p>then there's always print statements...</p>
| <p>Yes, it can be quite useful. I often do this kind of thing myself, but I only have it compile into non-production code, usually.</p>
| 12,450 |
<p>The problem is quite basic. I have a JTable showing cached data from a database. If a user clicks in a cell for editing, I want to attempt a lock on that row in the database. If the lock does not succeed, I want to prevent editing.</p>
<p>But I can't seem to find any clean way to accomplish this. Am I missing somet... | <p>Before editing/setting value the table model is asked via TableModel.isCellEditable(row,col) whether this cell is editable. Here you can implement your lock. and after TableModel.setValue(row,col,val) you should unlock this. BUT. The lock operation should take a lot of time and makes your UI un-responsible. And it ... | <p>Instead, you could wait until the user actually changes something, then override JTable.editingStopped to do the work there (you could even check to see if the value changed)</p>
<p>That way no locking is done until the user actually changes something.</p>
| 30,578 |
<p>Is there a tool to migrate an <a href="http://en.wikipedia.org/wiki/SQLite" rel="noreferrer">SQLite</a> database to <a href="http://en.wikipedia.org/wiki/Microsoft_SQL_Server" rel="noreferrer">SQL Server</a> (both the structure and data)?</p>
| <p><a href="http://en.wikipedia.org/wiki/SQLite" rel="noreferrer">SQLite</a> does have a .dump option to run at the command line. Though I prefer to use the <a href="http://sqlitebrowser.sourceforge.net/" rel="noreferrer">SQLite Database Browser</a> application for managing SQLite databases. You can export the structur... | <p>A idea is do some thing like this:
- View squema in sql lite and get the CREATE TABLE command.
- Execute, parsing sql, in SQL SERVER
- Travel data creating a INSERT statment for each row. (parsing sql too)</p>
<p>This code is beta, because no detect type data, and no use @parameter and command object, but run.</p>
... | 19,720 |
<p>In general, what kinds of design decisions help an application scale well?</p>
<p>(Note: Having just learned about <a href="http://en.wikipedia.org/wiki/Big_O_notation" rel="nofollow noreferrer">Big O Notation</a>, I'm looking to gather more principles of programming here. I've attempted to explain Big O Notation b... | <p>The only thing I would say is write your application so that it can be deployed on a cluster from the very start. Anything above that is a premature optimisation. Your first job should be getting enough users to have a scaling problem. </p>
<p>Build the code as simple as you can first, then profile the system secon... | <p>One good idea is to determine how much work each additional task creates. This can depend on how the algorithm is structured.</p>
<p>For example, imagine you have some virtual cars in a city. At any moment, you want each car to have a map showing where all the cars are.</p>
<p>One way to approach this would be:</p... | 6,265 |
<p>I'm writing an utility (<a href="http://reg2run.sf.net" rel="nofollow noreferrer">http://reg2run.sf.net</a>) which in case execution without arguments works as windows application (shows OpenFileDialog, etc), otherwise - as console application.</p>
<p>So, in first case I don't want to show a console window, that's ... | <p>There are several approaches for applications that need to choose whether to act as console or GUI applications, depending on context, on Windows:</p>
<ol>
<li>Have two separate applications, and have one conditionally start the other.</li>
<li>A variant of the above strategy, have two applications, one called 'app... | <p>You can always the following P/Invoke method:</p>
<pre><code>[DllImport("kernel32.dll")]
static extern bool AttachConsole(int dwProcessId);
const int ATTACH_PARENT_PROCESS = -1;
</code></pre>
| 49,493 |
<p>Given two 3D vectors A and B, I need to derive a rotation matrix which rotates from A to B.</p>
<p>This is what I came up with:</p>
<ol>
<li>Derive cosine from <strike>acos</strike>(A . B)</li>
<li>Derive sine from <strike>asin</strike>(|A x B| / (|A| * |B|))</li>
<li>Use A x B as axis of rotation</li>
<li>Use mat... | <p>No, you're pretty much doing it the best way possible. I don't think there is a built-in DirectX function that does what you want. For step 4, you can use <a href="http://msdn.microsoft.com/en-us/library/bb205357(VS.85).aspx" rel="nofollow noreferrer"><code>D3DXMatrixRotationAxis()</code></a>. Just be careful abo... | <p>Maybe you can use D3DXMatrixLookAtLH ?</p>
| 36,377 |
<p>I'm looking at building a Rails application which will have some pretty
large tables with upwards of 500 million rows. To keep things snappy
I'm currently looking into how a large table can be split to more
manageable chunks. I see that as of MySQL 5.1 there is a partitioning
option and that's a possible option b... | <p>Partition columns in MySQL are not limited to primary keys. In fact, a partition column does not have to be a key at all (though one will be created for it transparently). You can partition by RANGE, HASH, KEY and LIST (which is similar to RANGE only that it is a set of discrete values). Read the MySQL manual for <a... | <p>If you want to split your datas by time, the following solution may fit to your need. You can probably use <a href="http://dev.mysql.com/doc/refman/5.0/en/merge-storage-engine.html" rel="nofollow noreferrer" title="MERGE">MERGE</a> tables;</p>
<p>Let's assume your table is called MyTable and that you need one table... | 41,967 |
<p>What I want to do is the following:</p>
<ol>
<li>read in multiple line input from <code>stdin</code> into variable <code>A</code></li>
<li>make various operations on <code>A</code></li>
<li>pipe <code>A</code> without losing delimiter symbols (<code>\n</code>,<code>\r</code>,<code>\t</code>,etc) to another command<... | <p>This is working for me:</p>
<pre><code>myvar=`cat`
echo "$myvar"
</code></pre>
<p>The quotes around <code>$myvar</code> are important.</p>
| <p>Read can also be used setting option -d [DELIMITER], in which `input' DELIMITER is one character long. If you set <code>-read d ''</code> then it reads until null or all input.</p>
<p>Just remember Bash cannot hold null bytes in variables, anyways.</p>
<pre class="lang-sh prettyprint-override"><code>read -d'' myvar
... | 26,172 |
<p>I have a trivial console application in .NET. It's just a test part of a larger application. I'd like to specify the "exit code" of my console application. How do I do this?</p>
| <p>Three options:</p>
<ul>
<li>You can return it from <code>Main</code> if you declare your <code>Main</code> method to return <code>int</code>.</li>
<li>You can call <a href="https://learn.microsoft.com/en-us/dotnet/api/system.environment.exit" rel="noreferrer"><code>Environment.Exit(code)</code></a>.</li>
<li>You can... | <p>Just another way:</p>
<pre><code>public static class ApplicationExitCodes
{
public static readonly int Failure = 1;
public static readonly int Success = 0;
}
</code></pre>
| 18,826 |
<p>I have a large ADO.Net dataset and two database schemas (Oracle) with different constraints. The dataset will work with either schema, but I want to be able to tell the dataset which schema to use (via connection string) at runtime.</p>
<p>Is that even possible?</p>
| <p>In the .Net 2.0 world, you can change your connection string on your table adapters at run-time. You just have to be sure the Connnection property is public, which can be set from the dataset designer.</p>
| <p>Datasets don't know what database they're pointing to -- they're just containers for data. If the dataset is filled with a data adapter, then as @Austin Salonen pointed out, you change that on the adapter side. </p>
| 14,761 |
<p>I need a collection that </p>
<ul>
<li>contains a set of objects linked to a double.</li>
<li>The sequence of these pairs should be arbitrary set by me (based on an int I get from the database) and be static throughout the lifecycle.</li>
<li>The number of entries will be small (0 ~ 20) but varying.</li>
<li>The co... | <p>It sounds like you may just want an equivalent of <code>KeyValuePair</code>, but mutable. Given that you're only using it as a pair of values rather than a key-value pair, you could just do:</p>
<pre><code>public class MutablePair<TFirst, TSecond>
{
public TFirst First { get; set; }
public TSecond Sec... | <p>Well, KeyValuePair is immutable (which is a good thing), so you'll have to replace the entire value of KeyValuePair, not just the part of it:</p>
<pre><code>yourDict[10] = new KeyValuePair<TheType, Double>(yourDict[10].Key, newValue);
</code></pre>
<p>... or think like <a href="https://stackoverflow.com/user... | 39,728 |
<p>F# declared namespace is not available in the c# project or visible through the object browser.</p>
<p>I have built a normal F# library project, but even after i build the project and reference it to my C# project, I am unable to access the desired namespace.</p>
<p>I am also unable to see it in the object browser... | <p>What if you reference the produced DLL directly (i.e., not via a project reference, but via a file reference)?</p>
| <p>Maybe IntelliSense is just messed up? What compiler error do you get when you try to use it in C#? When you say "the object browser is unable to read it" what does that mean? </p>
<p>For what it's worth, I added this to a F# library project, referenced it (project) from a C# console app, and was able to use it. Int... | 25,506 |
<pre><code>INSERT INTO tblExcel (ename, position, phone, email) VALUES ('Burton, Andrew', 'Web Developer / Network Assistant', '876-9259', 'aburton@wccs.edu')
</code></pre>
<p>I've got an Access table that has five fields: id, ename, position, phone, and email...each one is plain text field with 50 characters, save fo... | <p>I beleive "position" is a reserved word.</p>
<p>Try...</p>
<p>INSERT into tblExcel (ename, [position], phone, email) VALUES (...</p>
<p><a href="http://office.microsoft.com/en-us/access/HP010322491033.aspx" rel="nofollow noreferrer">Reserved Words</a></p>
| <p>The spacing of "Web Developer / Network Assistant" looks a little wonky, maybe there is a hidden character in there (carriage return?)</p>
<p>I'd try taking the slash out, and see if the insert works, if not try taking all punctuation out. Then add it back and maybe you will be able to identify the bug.</p>
| 6,907 |
<blockquote>
<p>What's the best way to make an element of 100% minimum height across a
wide range of browsers ?</p>
</blockquote>
<p>In particular if you have a layout with a <code>header</code> and <code>footer</code> of fixed <code>height</code>,</p>
<p>how do you make the middle content part fill <code>100%</c... | <p>I am using the following one: <a href="http://www.xs4all.nl/~peterned/examples/csslayout1.html" rel="noreferrer">CSS Layout - 100 % height</a></p>
<blockquote>
<p><strong>Min-height</strong></p>
<p>The #container element of this page has a min-height of 100%. That
way, if the content requires more height t... | <p>just share what i've been used, and works nicely</p>
<pre><code>#content{
height: auto;
min-height:350px;
}
</code></pre>
| 4,486 |
<p>I have some markup for a popup menu that works in firefox but not IE. The problem is that the popup pops under other elements and is impervious to the z-index value. A complete runnable example is below.</p>
<p>Now, I know that one fix is not to position the divs as relative, but I can't do that because, in the r... | <p>The z-index is scoped to within the parent if the parent has position: relative or position: absolute.</p>
<p>The solution for your example is to add style="z-index: 2;" to the first "mydiv" and z-index: 1; to the second.</p>
| <p>If you move the TABLEs outside of the DIVs it works. Hopefully this satisfies your needs? I think I would get confused too if I was a DIV and you asked me to Z-order something I am containing above me.</p>
| 40,342 |
<p>I am writing an application where all the request to the internet should go from it like in firewall. so that i can block the request for a particular website. In my case the program will be running on the same machine. I have tried the promiscous method but using that we can only capture all the packets comming and... | <p>You have to insert your code in the TCP/IP stack, which, if I understand correctly, requires a windows driver.</p>
<p>C# cannot compile native windows drivers, so you'll need to use a library or DLL to implement at least part of your functionality. Look for solutions using C++.</p>
<p>-Adam</p>
| <p>You have to insert your code in the TCP/IP stack, which, if I understand correctly, requires a windows driver.</p>
<p>C# cannot compile native windows drivers, so you'll need to use a library or DLL to implement at least part of your functionality. Look for solutions using C++.</p>
<p>-Adam</p>
| 40,875 |
<p><em>This is a shameless information gathering exercise for my own book.</em></p>
<p>One of the talks I give in the community is an introduction to web site vulnerabilities. Usually during the talk I can see at least two members of the audience go very pale; and this is basic stuff, Cross Site Scripting, SQL Injecti... | <p>First, I would point out the insecurities of the web in a way that makes them accesible to people for whom developing with security in mind may (unfortunately) be a new concept. For example, show them how to intercept an HTTP header and implement an XSS attack. The reason you want to show them the attacks is so th... | <p><a href="http://poignantguide.net/ruby/chapter-3.html" rel="nofollow noreferrer">Foxes</a></p>
| 13,458 |
<p>I need to cache a single page. I've used ActionController's caches_page for this. But now, I'd like to expire AND regenerate it once in every 10 minutes. What are my options?</p>
<p>later: I'd like to not use any external tools for this, like cron. The important point is <strong>interval-based</strong> expiry of th... | <p>You can also use <a href="http://code.google.com/p/timedcachedfragment/" rel="nofollow noreferrer">this</a> if you want to have fragments timeout.</p>
| <p>AFAIK rails page caching compares the cache time on request and regenerates if necessary. If you need to forcibly flush that cache check out Sweepers.
<a href="http://www.railsenvy.com/2007/2/28/rails-caching-tutorial#sweepers" rel="nofollow noreferrer">http://www.railsenvy.com/2007/2/28/rails-caching-tutorial#sweep... | 13,614 |
<p>Using the SharePoint API, how can I modify an extended webapp web.config file?</p>
<p>I have to do some changes in this file to specify the connection string, membershipprovider, etc... for using Forms Authentication.</p>
<p>Currently, I can change the "master" webapplication web.config file, but not the e... | <p>I got an answer form a blog.</p>
<blockquote>
<p>In your case , you need to write a Web Application scoped feature which after you provision your site using your C# app, it is deployed to the newly-provisioned site and in the receiver of the feature you inject the required web.config settings because in that cont... | <p>Quick answer: look into the SPWebConfigModification class. I am assuming you're using SharePoint 2007. The best way to learn about this is to dig into open source projects:</p>
<p>Google code search: <a href="http://www.google.com/codesearch?q=spwebconfigmodification&hl=en&btnG=Search+Code" rel="nofollow no... | 22,279 |
<p>Is there any C#/F# performance comparison available on web to show proper usage of new F# language?</p>
| <p>Natural F# code (e.g. functional/immutable) is slower than natural (imperative/mutable object-oriented) C# code. However, this kind of F# is much shorter than usual C# code.
Obviously, there is a trade-off.</p>
<p>On the other hand, you can, in most cases, achieve performance of F# code equal to performance of C# ... | <p>Here are a few links on (or related to) this topic:</p>
<ul>
<li><a href="http://cs.hubfs.net/forums/thread/3207.aspx" rel="noreferrer">http://cs.hubfs.net/forums/thread/3207.aspx</a></li>
<li><a href="http://strangelights.com/blog/archive/2007/06/17/1588.aspx" rel="noreferrer">http://strangelights.com/blog/archive... | 17,396 |
<p>sorry but I do not have the actual code with me, but I will try to explain:</p>
<p>I have a servlet mapped to the following: </p>
<pre><code>/admin/*
</code></pre>
<p>So, this goes to a servlet: </p>
<pre><code>public class AdminController extends MainController {
public void doPost(HttpServletRequest reque... | <p>The <a href="http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpServlet.html#service(javax.servlet.http.HttpServletRequest,%20javax.servlet.http.HttpServletResponse)" rel="noreferrer">HttpServlet.service</a> method gets called for all request types and what you are seeing is a HEAD request and t... | <p>Had the same issue, and I tried anything mentioned above and on other posts, but the issue was only on local.</p>
<p>If nothing works for you too, try a deploy :)</p>
| 41,765 |
<p>I was thinking along the lines of using <code>typeid()</code> but I don't know how to ask if that type is a subclass of another class (which, by the way, is abstract)</p>
| <p>You really shouldn't. If your program needs to know what class an object is, that usually indicates a design flaw. See if you can get the behavior you want using virtual functions. Also, more information about what you are trying to do would help.</p>
<p>I am assuming you have a situation like this:</p>
<pre><c... | <p>In c# you can simply say:</p>
<pre><code>if (myObj is Car) {
}
</code></pre>
| 39,624 |
<p>Once a user starts a session (or logs in, for a registered user, to associate over multiple sessions), their specific page views are followed. The data can then be used in a number of ways from targeted advertisements to email updates to often-visited sections of the site.</p>
<p>Would this be wrong, as long as thi... | <p>There are certainly legal and moral ways to do something like this. However, I think that the biggest issue with something like this is more of a marketing issue. </p>
<p>There's a fine but important line between something like Google's targeted text ads (which I don't find intrusive) and things like popups, anim... | <p>By tracking page views, you're only recording information they could reasonably expect you to anyway (it's in the weblogs anyway). What you do with that information, how you protect it, and whether you choose to anonymise it in some way are all more subjective questions, and should be clearly answered in your privac... | 23,419 |
<p>My Cocoa app needs some small dynamically generated windows. How can I programmatically create Cocoa windows at runtime?</p>
<p>This is my non-working attempt so far. I see no result whatsoever.</p>
<pre><code>NSRect frame = NSMakeRect(0, 0, 200, 200);
NSUInteger styleMask = NSBorderlessWindowMask;
NSRect rect ... | <p>The problem is that you don't want to call <code>display</code>, you want to call either <code>makeKeyAndOrderFront</code> or <code>orderFront</code> depending on whether or not you want the window to become the key window. You should also probably use <code>NSBackingStoreBuffered</code>.</p>
<p>This code will crea... | <p>This is what I've come up with myself:</p>
<pre><code>NSRect frame = NSMakeRect(100, 100, 200, 200);
NSUInteger styleMask = NSBorderlessWindowMask;
NSRect rect = [NSWindow contentRectForFrameRect:frame styleMask:styleMask];
NSWindow * window = [[NSWindow alloc] initWithContentRect:rect styleMask:styleMask backi... | 40,536 |
<p>I have some code that looks like:</p>
<pre><code>template<unsigned int A, unsigned int B>
int foo() {
int v = 1;
const int x = A - B;
if (x > 0) {
v = v << x;
}
bar(v);
}
</code></pre>
<p>gcc will complain about x being negative for certain instantiations of A, B; however, I do perfor... | <p>Since A and B are known at compile time, not only can you get rid of your warning, but you can also get rid of a runtime <code>if</code>, without any casts, like this:</p>
<pre><code>#include <iostream>
using namespace std;
template< unsigned int A, unsigned int B >
struct my
{
template< bool P ... | <p>Would this work?</p>
<pre><code>const short unsigned int x = A - B;
</code></pre>
<p>It's cutting off a lot more bits than need to be cut off, but if your values of A - B are small enough...</p>
| 33,518 |
<p>I'm looking for pseudocode, or sample code, to convert higher bit ascii characters (like, Ü which is extended ascii 154) into U (which is ascii 85).</p>
<p>My initial guess is that since there are only about 25 ascii characters that are similar to 7bit ascii characters, a translation array would have to be used.</p... | <p>For .NET users the <a href="http://www.codeproject.com/Articles/13503/Stripping-Accents-from-Latin-Characters-A-Foray-in" rel="noreferrer">article in CodeProject</a> (thanks to <a href="https://stackoverflow.com/a/183540/562906">GvS's tip</a>) does indeed answer the question more correctly than any other I've seen s... | <p>Try the <a href="http://billposer.org/Software/uni2ascii.html" rel="nofollow noreferrer">uni2ascii</a> program.</p>
| 16,981 |
<p>In one of the answers to <a href="https://stackoverflow.com/questions/31572/broadcast-like-udp-with-the-reliability-of-tcp#31629">Broadcast like UDP with the Reliability of TCP</a>, a user mentions the <a href="http://spread.org" rel="noreferrer">Spread</a> messaging API. I've also run across one called <a href="ht... | <p>MPI was deisgned tightly-coupled compute clusters with fast, reliable networks. Spread and ØMQ are designed for large distributed systems. If you're designing a parallel scientific application, go with MPI, but if you are designing a persistent distributed system that needs to be resilient to faults and network in... | <p>You're addressing very different APIs here, with different notions about the kind of services provided and infrastructure for each of them. I don't know enough about MPI and Spread to answer for them, but I can help a little more with ZeroMQ.</p>
<p>ZeroMQ is a simple messaging communication library. It does noth... | 5,598 |
<p>What is the proper way for an MFC application to cleanly close itself?</p>
| <p>Programatically Terminate an MFC Application</p>
<pre><code> void ExitMFCApp()
{
// same as double-clicking on main window close box
ASSERT(AfxGetMainWnd() != NULL);
AfxGetMainWnd()->SendMessage(WM_CLOSE);
}
</code></pre>
<p><a href="http://support.microsoft.com/kb/117320">http://s... | <p>If it is a dialog based application you can do it by calling EndDialog() function.</p>
<p>If it is an SDI/MDI based application you can call DestroyWindow. But before which you will need to do the cleanup yourself (closing documents, deallocating memory and resources, destroying any additional windows created etc).... | 3,530 |
<p>Was just wondering if there was a way to edit the CPU registers (i.e. EAX, EBX, ECX, etc) or flags (OV, UP, erc) from within the Visual Studio IDE. I know you can <strong>view</strong> them using the Registers pane (ctrl-shift-G) and you can cycle through them with TAB or ENTER, but I don't seem to be able to chang... | <p>yes, you can....</p>
<p>from the help (you know...the f1 key)</p>
<p>To change the value of a register </p>
<ul>
<li>In the Registers window, use the TAB key or the mouse to move the insertion point to the value you want to change. When you start to type, the cursor must be located in front of the value you want... | <p>No you can't. That awful thing doesn't work in managed mode or mixed mode.</p>
| 30,387 |
<p>In VB6, I have a DTPicker control on a form. (The DTPicker is the calendar date/time selector, included in Microsoft Windows Common Controls-2 6.0, available from the Components dialog.)</p>
<p>While there are many properties to affect the colors of the calendar when it's dropped down, there is no property that all... | <p>Pipes aren't a particular security risk in Windows. If you're worried about security, make sure you set the security descriptor on the pipe to an appropriate DACL. If your usage requires that the pipe is open for anyone to connect to, then you have to treat the incoming data as suspicious, just like any file or netw... | <p>If you are concerned about network sniffing, I suppose they could be since I don't think that pipes between systems are encrypted. I don't know exactly how they are implemented in Windows, but I would expect that pipes between processes/threads on the same machine would be implemented with shared memory and not let... | 28,992 |
<p>I am trying to use reflector.InvokeMethod to invoke a function with an optional parameter.
The function looks like this: </p>
<pre><code>Private Function DoSomeStuff(ByVal blah1 as string, ByVal blah2 as string, Optional ByVal blah3 as string = "45") as boolean
'stuff
end function
</code></pre>
<p>and I'm Invoking... | <p>The Visual Basic compiler actually substitutes the optional parameter values into the calling code. So if your actual code was:</p>
<pre><code>DoSomeStuff(blah1, blah2)</code></pre>
<p>Visual Basic would have emitted IL code equivalent to:</p>
<pre><code>DoSomeStuff(blah1, blah2, "45")</code></pre>
<p>To know w... | <p>I would overload the <strong>DoSomeStuff</strong> method rather than use an optional parameter...</p>
<pre><code>Private Overloads Function DoSomeStuff(ByVal blah1 As String, ByVal blah2 As String) As Boolean
Return DoSomeStuff(blah1, blah2, "45")
End Function
Private Overloads Function DoSomeStuff(ByVal blah1... | 31,433 |
<p>We're trying to track down some .Net assembly dependency problems.</p>
<p>On Windows XP, does the .Net 3.5 installer include 3.0 SP2 automatically?</p>
| <p>.NET 3.5 contains .NET 3.0 SP1</p>
<p>.NET 3.5 SP1 contains .NET 3.0 SP2</p>
| <p>I'm not sure but I believe that Microsoft is building on top of each version of .NET. This leads me to <em>believe</em> the answer to your question is '<strong>Yes</strong>'. Hopefully someone can confirm this.</p>
| 37,122 |
<p>I created an <code>ObjectInputSteam</code> and <code>ObjectOutputStream</code> on a blocking <code>SocketChannel</code> and am trying to read and write concurrently. My code is something like this:</p>
<pre><code>socketChannel = SocketChannel.open(destNode);
objectOutputStream = new ObjectOutputStream(Channels.new... | <p>This seems to be a bug in <code>java.nio.channels.Channels</code> (thanks to Tom Hawtin; post it as an answer next time). A good description and workaround are described <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4774871" rel="noreferrer">here</a> (actually a duplicate of the bug Tom listed):</p>
... | <p>Interesting bug! You say though that you can't use FileChannel#transferTo. How about wrapping the I/O streams of the non-NIO socket into channels using Channesl#newChannel before passing to FileChannel#transferTo?</p>
| 21,069 |
<p>This is probably a no brainer but... </p>
<p>I've just opened a solution in VS2008 and for some reason the compiler doesn't recognised previously compiled errors.</p>
<p>I hit build and I get 100s of errors :</p>
<p><code>Name 'IIf' is not declared.<br>
Name 'IsNumeric' is not declared.<br>
Name HttpUtility is n... | <p>Check your references. Sometimes they seem to break if you have been messing around at all.</p>
| <p>Those appear to be in the VisualBasic namespace.</p>
<p>Right Click on Project Choose Properties-->References Try adding the import Microsoft.VisualBasic.</p>
| 33,315 |
<p>I know that -applicationWillResignActive gets called upon an incoming call, but is there a standard method that gets called if the user hits the "exit" button (the only button on the front of the iPhone)? </p>
| <p><code>- (void)applicationWillTerminate:(UIApplication *)application</code>, in UIApplicationDelegate protocol.</p>
| <p>I made some try and i'm using iPhone SDK 4, and when you press the "exit" button the app called two methods:</p>
<pre><code>(void)applicationWillResignActive:(UIApplication *)application
(void)applicationDidEnterBackground:(UIApplication *)application
</code></pre>
| 47,590 |
<p>I have some really complicated legacy code I've been working on that crashes when collecting big chunks of data. I've been unable to find the exact reason for the crashes and am trying different ways to solve it or at least recover nicely. The last thing I did was enclose the crashing code in a</p>
<pre><code>try
... | <p>"Very low address" probably means that somebody tried to call a virtual method on an object that was not really there (i.e. was 'nil'). For example:</p>
<p>TStringList(nil).Clear;</p>
<p>The first part is very mysterious, though. I have no idea how that can happen.</p>
<p>I think you should try to catch that exce... | <p>Is this perhaps a DLL or a COM object? If so, it is possible that the FPUExcpetion mask is being set by the host application to something different than Delphi is used to. An overflow, by default in Delphi produces an exception, but the FPUExcpetionmask can be set so that it doesn't, and the value is set to NAN. See... | 22,600 |
<p>I really like Entity Framework, but there are some key pieces that are a challenge to me. Can anyone tell me how to filter an EntityDataSource on an Association column? EF hides the FK values and instead has an Association property. Given an Entity, Person, with a PersonType association, I would have expected someth... | <p>I think the answer you're looking for involves using the Include method, such as:</p>
<pre><code>entities.it.Include("PersonType").Where(a => a.PersonType.PersonTypeID = '1');
</code></pre>
| <p>Have you tried applying the filter in memory using LINQ? (or Perhaps against the database?)</p>
<pre><code>var personType = new PersonType { Id = 1 };
var query = PersonDataSource.Where(p => p.PersonType.Equals(personType));
// use this query as the DataSource for your GridView
</code></pre>
<p>I must admit I h... | 26,311 |
<p>My printer stopped printing during a few prints, and i found that the extruder had stopped heating, and the motors had stopped running. I checked the code, and nothing was wrong. My 5A fuse though, was extremely hot. I wanted to verify whether it was my fuse that had turned bad or there was some kind of short in my ... | <p>As @Mikhail Z commented, it does sound like the fuse may be bad.</p>
<p>The first thing to do is put an ohmmeter across the fuse (with power off!) -- if you get high resistance the fuse is definitely bad. However, if you get low resistance that does not prove the fuse is good -- see @Tom's comments below re. polyfu... | <p>Its very likely the polyfuse is bad. In an ideal printer, given the heater cores and great deal of power, polyfuses are some of the worst things you can use. Polyfuses have a tendency to fail in "interesting" ways, especially around their trigger amperage. Fire is one of those failure modes.</p>
<p>Not only that, b... | 676 |
<p>Duplicate Of : <a href="https://stackoverflow.com/questions/2527/c-treeview-context-menus">Find node clicked under context menu</a></p>
<p>I've got a context menu on a Treeview, when the user right clicks it supposed to change based on the currently right clicked node's tag object.</p>
<p>Currently I'm updating th... | <p>By far the easiest solution is to manually tag your links with Google Analytics campaign tracking parameters (utm_source, utm_campaign, utm_medium, etc.) and then pull out that data. </p>
<p>The gclid is dependent on more than just the adwords account/campaign/etc. If you click on the same adwords ad twice, it coul... | <p>I agree with Ophir and Chris. My feeling is that it is purely a serial number / unique click ID, which only opens up its secrets when the Analytics and Adwords systems talk to each other behind the scenes.</p>
<p>Knowing this, I'd recommend looking at the referring URL and pulling as much as possible from this to u... | 47,766 |
<p>I have the following problem:</p>
<p>I have an HTML textbox (<code><input type="text"></code>) whose contents are modified by a script I cannot touch (it is my page, but i'm using external components).</p>
<p>I want to be notified in my script every time the value of that textbox changes, so I can react to i... | <p>As you've implied, change (and other events) only fire when the user takes some action. A script modifying things won't fire any events. Your only solution is to find some hook into the control that you can hook up to your listener.</p>
<p>Here is how I would do it:</p>
<pre><code>basicDatePicker.selectDate = bas... | <p>Aside from getting around the problem like how noah explained, you could also just create a timer that checks the value every few hundred milliseconds.</p>
| 17,688 |
<p>So for the second day in a row, someone has wiped out an entire table of data as opposed to the one row they were trying to delete because they didn't have the qualified where clause.</p>
<p>I've been all up and down the mgmt studio options, but can't find a confirm option. I know other tools for other databases h... | <p>Under Tools>Options>Query Execution>SQL Server>ANSI, you can enable the Implicit Transactions option which means that you don't need to explicitly include the Begin Transaction command.</p>
<p>The obvious downside of this is that you might forget to add a Commit (or Rollback) at the end, or worse still, your collea... | <p>Isn't there a way to give users the results they need without providing raw access to SQL? If you at least had a separate entry box for "WHERE", you could default it to "WHERE 1 = 0" or something.</p>
<p>I think there must be a way to back these out of the transaction journaling, too. But probably not without rolli... | 35,592 |
<p>I've been thinking of ways of providing syntactic sugar for a framework I have been working on. I want to deal with Immitable objects exclusively.</p>
<h3>Say I have an immutable object and wish to create a modified version of it. Would, in your view, a non-instantiable class with a single static factory method brea... | <p>I don't think it's a good idea to create one class per method. You could instead create a static only methods class, named e.g StringUtils and implement the methods. This way you would call:</p>
<p>String lowerCaseString = StringUtils.lowercase( targetString );</p>
<p>This would also offer you intellisense help wh... | <p>Usually on immutable objects, I would have a method returning a modified version of the object. So if you have some immutable collection, it can have a sort() method, that returns a new collection that is sorted. However, in your String example this is not possible, since you cannot touch the String class.</p>
<p>Y... | 35,502 |
<p>I see in richfaces that there is a single slider, wondering if anyone has created a dual slider like in Scriptaculous for it.</p>
<p>Is there any concerns in mixing JSF, Richfaces and Scriptaculous in an application?</p>
| <p>I can't answer your question with precision, but here's what I know.</p>
<blockquote>
<p>Is there any concerns in mixing JSF,
Richfaces and Scriptaculous in an
application?</p>
</blockquote>
<p>Yes. About 50% of the problems people have with JSF are because they try to treat it like a another taglib library ... | <p>The code contains four tabs with 4 images ( you can include images, pages, etc., ) with sliding default time is 5 sec for every image change and tab clicking is provided for user. Slide begins whenever the user click on anyone of 4 tabs.</p>
<pre><code><%@ page language="java" import="java.util.*" pageEncoding="... | 46,269 |
<p>In the course of your software development lifecycle, what essential design artifacts do you produce? What makes them essential to your practice?</p>
<p>The project I'm currently on has been in production for 8+ years. This web application has been actively enhanced and maintained over that time. While we have CMMI... | <p>Having worked on a lot of waterfall projects in the past and a lot of adhoc and agile projects more recently, there's a number of design artifacts I like to create although I can't state enough that it really depends on the details of the project (methodology/team structure/timescale/tools etc).</p>
<p>For a generi... | <p>I don't think anything can take the place of a good old fashioned design spec for the following reasons: </p>
<ul>
<li>It serves as a means of communicating how you will build an application to others. </li>
<li>It lets you get ideas out of your head so you don't worry about tracking a million things at the same ... | 6,667 |
<p>I'm writing a config file and I need to define if the process expects a windows format file or a unix format file. I've got a copy of the expected file - is there a way I can check if it uses \n or \r\n without exiting emacs?</p>
| <p>If it says (DOS) on the modeline when you open the file on Unix, the line endings are Windows-style. If it says (Unix) when you open the file on Windows, the line endings are Unix-style.</p>
<p>From the Emacs 22.2 manual (Node: Mode Line):</p>
<blockquote>
<p>If the buffer's file uses
carriage-return linefeed,... | <p>Open the file in emacs using find-file-literally. If lines have ^M symbols at the end, it expects a windows format text file.</p>
| 29,023 |
<p>The most common method for corrupting compressed files is to inadvertently do an ASCII-mode FTP transfer, which causes a many-to-one trashing of CR and/or LF characters.</p>
<p>Obviously, there is information loss, and the best way to fix this problem is to transfer again, in FTP binary mode.</p>
<p>However, if th... | <p>From <a href="http://wayback.archive.org/web/jsp/Interstitial.jsp?seconds=5&date=1195189396000&url=http%3A%2F%2Fwww.bukys.com%2Fservices%2Frecovery%2Fexamples%2F&target=http%3A%2F%2Fweb.archive.org%2Fweb%2F20071116050316%2Fhttp%3A%2F%2Fwww.bukys.com%2Fservices%2Frecovery%2Fexamples%2F" rel="nofollow nore... | <p>You could try writing a little script to replace all of the CRs with CRLFs (assuming the direction of trashing was CRLF to CR), swapping them randomly per block until you had the correct crc. Assuming that the data wasn't particularly large, I guess that might not use all of your CPU until the heat death of the uni... | 8,442 |
<p>We use SAX to parse XML because it does not require the entire XML document to be read into memory in order to parse a single value. I read many articles that insisted SAX can only be used to parse/decode XML and not create it. Is this true?</p>
| <p>No, it isn't true, you can encode XML to any Writer in Java using something similar to:</p>
<pre><code>char[] ch;
AttributesImpl atts = new AttributesImpl();
Writer writer = new StringWriter();
StreamResult streamResult = new StreamResult(writer);
SAXTransformerFactory tf = (SAXTransformerFactory) TransformerFactor... | <p>The SAX handler interfaces were designed to be easy to implement. It's easy to write a class with similar (perhaps wrapping a SAX interface) to make it easy to call - chaining, remembering which element to close, easier attributes, etc.</p>
| 9,915 |
<p>I'd like to use two view engines in my asp.net mvc web application.
The first one is the Brail view engine from MVCContrib project, and another one is my custom view engine for generating javascript code.
However, I can't configure the application to use both engines. I'd like to use view file extension to discern w... | <p>I believe you can change your view engine in the controller. So I would extend your controller to select a view engine by extension.</p>
| <p>I believe you can change your view engine in the controller. So I would extend your controller to select a view engine by extension.</p>
| 46,534 |
<p>I have one thread that writes results into a Queue.</p>
<p>In another thread (GUI), I periodically (in the IDLE event) check if there are results in the queue, like this:</p>
<pre><code>def queue_get_all(q):
items = []
while 1:
try:
items.append(q.get_nowait())
except Empty, e:
... | <p>If you're always pulling all available items off the queue, is there any real point in using a queue, rather than just a list with a lock? ie:</p>
<pre><code>from __future__ import with_statement
import threading
class ItemStore(object):
def __init__(self):
self.lock = threading.Lock()
self.it... | <p>I see you are using get_nowait() which according to the documentation, "return[s] an item if one is immediately available, else raise the Empty exception"</p>
<p>Now, you happen to break out of the loop when an Empty exception is thrown. Thus, if there is no result immediately available in the queue, your function ... | 18,913 |
<p>How flexible should a programmer be if a client requests requirements that is not in the project scope?</p>
| <p>General perspective:</p>
<p>You need to earn a living; the client needs a computing solution: the client has the right to make sure that the solution you will supply fits his needs. Changes and additions after and agreement has been reached, reflects on your ability to analyze the user's requirements into a system ... | <p>This question cannot be given a blanket answer. It depends project to project.</p>
<p>Examples:</p>
<p>Client has money to burn, long timeline, no other projects on the go, I am very flexible.</p>
<p>Client is tight with $$, short timeline, other projects on the go, I am hardly flexible at all.</p>
<p>Other fact... | 23,570 |
<p><a href="http://en.wikipedia.org/wiki/Progressive_enhancement" rel="nofollow noreferrer">Progressive Enhancement</a> is a web development methodology that not only allows greater portability and accessibility but in my opinion, makes the development process easier.</p>
<p>What I want is to know what the rest of the... | <p>If it remains usable in a text-only browser (without CSS and Javascript, of course) and also in a screen-reader, you're on the right track. But these are about the highest standards that you'll find :)</p>
| <p>So "Progressive Enhancement" is just another term for "Graceful Degradation"?</p>
<p>In which case, it's the way all websites <em>should</em> be done.</p>
<p>Web Apps should be built in HTML (4 or later), semantically and against the standards.</p>
<p>All CSS should be optional - content & forms should work w... | 12,495 |
<p>Is there a way to select which TestMethods you want to execute in Visual Studio 2008 Unit Test project while debugging? I want to debug one particular test without having my other TestMethods execute during each debug session.</p>
| <p>Click on a test method name, then press Ctrl+R, Ctrl+T. (Or go to Test / Debug / Tests in Current Context.)</p>
| <p>If you want to debug while running your tests under an ASP.NET solution, check out the MSDN article "How to: Debug while Running a Test in an ASP.NET Solution" at <a href="http://msdn.microsoft.com/en-us/library/ms243172.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms243172.aspx</a>.</p>
... | 33,439 |
<p>1) I have a ReportViewer control on a page that's linked to a ServerReport (I'm using ASP.NET 2.0). The report displays fine, but the 'Export' link is present but disabled and the 'Select a format' drop down list (that's normally visible when you view the report in Reporting Services) isn't there. Any ideas? The Sho... | <p><a href="http://commons.apache.org/cli/" rel="nofollow noreferrer">Commons CLI</a></p>
| <p><a href="https://github.com/kohsuke/args4j" rel="nofollow noreferrer">https://github.com/kohsuke/args4j</a> -- has pretty good features PLUS MIT license</p>
| 25,475 |
<p>In several cases I want to add a toolbar to the top of the iPhone keyboard (as in iPhone Safari when you're navigating form elements, for example). </p>
<p>Currently I am specifying the toolbar's rectangle with constants but because other elements of the interface are in flux - toolbars and nav bars at the top of ... | <p>As of iOS 3.2 there's a new way to achieve this effect:</p>
<p><code>UITextFields</code> and <code>UITextViews</code> have an <code>inputAccessoryView</code> property, which you can set to any view, that is automatically displayed above and animated with the keyboard.</p>
<p>Note that the view you use should neith... | <p>There's no way (AFAIK) to get the dimensions of the keyboard view. It is however constant, at least in every iPhone version so far.</p>
<p>If you calculate the toolbar position as an offset from the BOTTOM of your view, and take the size of your view into account, then you should not have to worry whether a navbar ... | 19,183 |
<p>In C# Is there a way of getting a finer granularity with SQL exceptions?</p>
<p>I'm aware that an aweful lot can go wrong but I want to deal with certain cases differently and parsing the Error message doesn't seem to be very elegant.</p>
<p>Also Are the error messages created by the framework or are they db speci... | <p>If you are catching a <a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlexception.aspx" rel="nofollow noreferrer"><code>SqlException</code></a>, you should have access to <a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlexception.number.aspx" rel="nofollow noreferrer"... | <p>In SQL Server you can use various error functions which returns various information about the errors encountered from sys.messages</p>
<p>You can retrieve more information from <a href="http://msdn.microsoft.com/en-us/library/ms179495(SQL.90).aspx" rel="nofollow noreferrer">BOL</a>.</p>
| 32,720 |
<p>I have three models:</p>
<pre><code>class ReleaseItem < ActiveRecord::Base
has_many :pack_release_items
has_one :pack, :through => :pack_release_items
end
class Pack < ActiveRecord::Base
has_many :pack_release_items
has_many :release_items, :through=>:pack_release_items
end
class PackReleaseIt... | <p>It appears that your usage of has_one :through is correct. The problem you're seeing has to do with saving objects. For an association to work, the object that is being referenced needs to have an id to populate the <code>model_id</code> field for the object. In this case, <code>PackReleaseItems</code> have a <co... | <p>You want to save or create (instead of new) the item and pack. Otherwise, the database has not assigned id's for the association.</p>
| 11,535 |
<p>i'm using jdbc to work with my db.
I want to store a HashMap directly in the db, oracle.
i figure i need to serialize the Map, and its contents, which are only String.
Map already implements Serializeable, but my question is how do i put the Map in the SQL using jdbc?
for instance, i have a jdbcTemplate.update("inse... | <p>You need a table with key/value columns, and if you're storing multiple maps, an identity column (or a foreign key to another table holding data that the hashmap is a member of).</p>
<p>Then in JDBC, create a prepared statement (insert into myhashmap (id, foreign_id, key, val) values (?, ?, ?, ?)) ONCE, and then lo... | <p>The way I have done it in the past is to create one column in a table to store your serialized objects. The datatype should be "blob" or equivalent in Oracle.</p>
<p>It can then be written/retrieved using ResultSet.setBytes() and ResultSet.getBytes()</p>
| 48,317 |
<p>I'm looking for a way to create an "it will look cool" effect for a full screen WPF application I'm working on - a "screen glint" effect that animates or moves across the whole screen to give off a shiny display experience. I'm thinking of creating a large rectangle with a highlighted-gradient and transparent backgr... | <p>I came up with a solution that looks pretty good. Some sample XAML that I chalked up in Blend 2.0 SP1 looks like this:</p>
<pre><code><Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ScreenGlintApplication.Window... | <p>You can put a transparent panel on top like LBugnion said, but don't forget there are many ways you can do this:</p>
<ol>
<li>Change the visibility of the panel to Hidden. </li>
<li>Change the opacity to 0.</li>
<li>Change the Alpha of the color to 0.</li>
</ol>
<p>If you only change the Alpha it still is <em>clic... | 23,181 |
<p>Greetings,</p>
<p>I'm trying to use pylucene in Python 2.6. Since there's no windows build for 2.6, I try to build the source code.</p>
<p>First of all, I build JCC (windows, using cygwin)</p>
<pre><code>python setup.py build
running build
running build_py
[...]
building 'jcc' extension
error: None
python setup... | <p>try:</p>
<blockquote>
<p>/cygdrive/f/Python26//python.exe setup.py build</p>
</blockquote>
<p>and</p>
<blockquote>
<p>/cygdrive/f/Python26//python.exe setup.py build setup.py install</p>
</blockquote>
<p>I believe you are using python from cygwin for instaling jcc and python from windows for running...</p>
| <p>that just can build jcc and install,</p>
<p>top full code.</p>
<p>13998bytes</p>
<p>when import,report error.</p>
<pre><code>>>> import jcc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Python26\lib\site-packages\jcc-2.5.1-py2.6-win32.egg\jcc\__init__.py... | 40,270 |
<pre><code>[hannel,192.168.0.46:40014] 15:08:03,642 - ERROR - org.jgroups.protocols.UDP - failed sending message to null (61 bytes)
java.lang.Exception: dest=/225.1.2.46:30446 (64 bytes)
at org.jgroups.protocols.UDP._send(UDP.java:333)
at org.jgroups.protocols.UDP.sendToAllMembers(UDP.java:283)
at org.jgrou... | <p>In response to matt b, the "failed sending message to null" message is misleading. The true problem is the InterruptedIOException. This means that someone called interrupt() on the Thread that was sending UDP. Most likely, the interrupt is generated within JGroups. (Unless you started, and then stopped the JGrou... | <p>Is it possible you are getting an error because you are sending a message to "null"?</p>
<blockquote>
<p>ERROR - org.jgroups.protocols.UDP - failed sending message to null </p>
</blockquote>
<p>Otherwise this is probably pretty hard for anyone else to help you out with without code samples, information on your n... | 48,732 |
<p>In Eclipse, in the menu, I can go to Window -> Preferences -> Keys and set the Scheme to "Emacs." I can also click "Export" at the bottom-right hand side of the dialog to export a .CSV file containing a listing of my keyboard mappings.</p>
<p>How do I re-import this configuration into a different installation of Ec... | <p>You could try exporting and importing all of your preferences</p>
<p><strong>Export</strong>
File->Export...->General->Preferences</p>
<p><strong>Import</strong>
File->Import...->General->Preferences</p>
| <p>Something that should work is to export all preferences and then import them in the other install. But I know no way to do that for the keyboard prefs alone.</p>
<p>I agree that it would make sense. I suggest you open a bug report against Eclipse. Maybe it really is a missing feature (or the solution is too simple ... | 47,531 |
<p>I have been using PHP and JavaScript for building my dad's website. He wants to incorporate a login system into his website, and I have the design for the system using PHP. My problem is how do I show buttons if the person is logged in?... | <p>Regarding security, <strong>you cannot trust what comes from the client</strong>:</p>
<ul>
<li>The visitor can see all your code (HTML and Javascript, not PHP) and try stuff</li>
<li>The visitor may not even use a browser; it's trivially easy to send a request with a script</li>
</ul>
<p>This means hiding the butt... | <p>Basically where you have your menu in html, say as a list <code><ul> <li>Home</li> </ul></code> you add php after <code></li></code> of the last item:</p>
<pre><code><?php
if($session-logged_in) {
?>
<li>My Account</li>
<?php
}
?>
</code></pre>
| 2,868 |
<p>I'm launching a Weblogic application inside Eclipse via the BEA Weblogic Server v9.2 runtime environment. If this were running straight from the command-line, I'd do a ctrl-BREAK to force a thread dump. Is there a way to do it in Eclipse?</p>
| <p>Indeed (thanks VonC to point to the SO thread), Dustin, in a comment to his message, points to <a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jstack.html" rel="noreferrer" title="jstack - Stack Trace">jstack</a>.</p>
<p>I have run a little Java application (with GUI) in Eclipse, I can see the related j... | <p>Did you try to launch your eclipse with java.exe instead of javaw.exe (in your <a href="https://stackoverflow.com/questions/142357/what-are-the-best-eclipse-34-jvm-settings#144349">eclipse.ini</a>) ?</p>
<p>That might give you the console you need, as described in <a href="https://bugs.eclipse.org/bugs/show_bug.cgi... | 30,142 |
<p>I have a series of Eclipse projects containing a number of plugins and features that are checked into CVS. I now need to run an automated build of these plugins. Ideally I'd like to do it without having to hardcode large numbers of Eclipse library locations by hand, which has been the problem with the automatically ... | <p>There are a few options for you to look at, depending on which build scripting language you're using:</p>
<ul>
<li>For <a href="http://books.sonatype.com/maven-book/reference/multimodule.html" rel="nofollow noreferrer">Maven2</a>, the way forward seems to be Spring Dynamic Modules. Other options are <a href="http:/... | <p>You could write some sort of a script that finds those libraries for you and puts them into a format understandable by Ant.</p>
<p>For example, it could build a eclipse.lirbaries.properties file, then you could read in that file using:</p>
<pre><code><property file="eclipse.libraries.properties" />
</code></... | 39,336 |
<p>I printed a G1/8 thread in PLA where I can connect a compressor to have a small pressure container. Even though all measurements are correct and it screws in fine, it still leaks air.</p>
<p>Is there a way to make 3D prints airtight?</p>
| <p>Yes.</p>
<p>The issue is, that there are small gaps between the layers. But you can coat the print in an airtight material. While epoxy and similar materials work very well, they are somewhat too viscous and take a long time to cure.</p>
<p>My special recipe for coating PLA prints with a fast-curing airtight thin la... | <p>Yes.</p>
<p>The issue is, that there are small gaps between the layers. But you can coat the print in an airtight material. While epoxy and similar materials work very well, they are somewhat too viscous and take a long time to cure.</p>
<p>My special recipe for coating PLA prints with a fast-curing airtight thin la... | 2,165 |
<p>We have a database that we are using to store test results for an embedded device. There's a table with columns for different types of failures (details not relevant), along with a primary key 'keynum' and a 'NUM_FAILURES' column that lists the number of failures. We store passes and failures, so a pass has a '0' ... | <p>The reason you want to remove these entries is to keep the database growing too big and not to keep it in some special state. For that i would really not use triggers and instead setup a job to run at some interval cleaning up the table.</p>
| <p>So far, I have ended up using a View combined with a Trigger, but I'm not sure it's going to work for other reasons.</p>
<pre><code>CREATE VIEW tablename_view AS SELECT keynum FROM tablename WHERE NUM_FAILURES!='0'
ORDER BY keynum DESC LIMIT 50;
CREATE TRIGGER tablename_trig
AFTER INSERT ON tablename WHEN ((... | 19,030 |
<p>Does anyone know a method to programmatically close the CD tray on Windows 2000 or higher?
Open CD tray exists, but I can't seem to make it close especially under W2k. </p>
<p>I am especially looking for a method to do this from a batch file, if possible, but API calls would be OK.</p>
| <p>Here is an easy way using the Win32 API:</p>
<pre><code>
[DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi)]
protected static extern int mciSendString(string lpstrCommand,StringBuilder lpstrReturnString,int uReturnLength,IntPtr hwndCallback);
public void OpenCloseCD(bool Open)
... | <p>To close the drive tray do as described <a href="https://stackoverflow.com/a/30512979/3969362">here</a> but instead of using DeviceIoControl with IOCTL_STORAGE_EJECT_MEDIA you need to call DeviceIoControl with IOCTL_STORAGE_LOAD_MEDIA.</p>
| 8,308 |
<p>How would one draw an oval in JS?</p>
| <p><a href="http://www.w3.org/Graphics/SVG/" rel="nofollow noreferrer">SVG</a> .. or tiny divs and <a href="http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm" rel="nofollow noreferrer">bresenham</a> .. or check the <a href="http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm" rel="nofollow noreferrer">Javascr... | <p>More-or-less crossplatform way to do vector graphics is to use <a href="http://docs.dojocampus.org/dojox/gfx" rel="nofollow noreferrer">Dojo GFX</a> (<a href="http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/gfx/tests/" rel="nofollow noreferrer">tests</a>, <a href="http://archive.dojotoolkit.org/nightly/dojo... | 44,827 |
<p>I use the <code>:e</code> and <code>:w</code> commands to edit and to write a file. I am not sure if there is "close" command to close the current file without leaving Vim?</p>
<p>I know that the <code>:q</code> command can be used to close a file, but if it is the last file, Vim is closed as well; Actually on Mac ... | <p>This deletes the buffer (which translates to close the file)</p>
<pre><code>:bd
</code></pre>
| <p>I have the same issue so I made the plugin.
This plugin replace :q and other commands and then prevent the window closed.</p>
<p>if you still have issue, please try to use following plugin.
<a href="https://github.com/taka-vagyok/prevent-win-closed.vim" rel="nofollow">https://github.com/taka-vagyok/prevent-win-clo... | 31,968 |
<p>In a C# Windows Forms application I want to detect if another instance of the application is already running.
If so, activate the main form of the running instance and exit this instance.</p>
<p>What is the best way to achieve this?</p>
| <p>Scott Hanselman <a href="http://www.hanselman.com/blog/TheWeeklySourceCode31SingleInstanceWinFormsAndMicrosoftVisualBasicdll.aspx" rel="noreferrer">answers</a> on you question in details.</p>
| <p>Aku, that is a good resource. I answered a question similar to this one a while back. You can check my <a href="https://stackoverflow.com/questions/19147/what-is-the-correct-way-to-create-a-single-instance-application#19326">answer here</a>. Even though this was for WPF, you can use the same logic in WinForms.</p... | 7,512 |
<p>One of the PDC2008 presentations showed off the new VS2010 UI (not the same as the current beta) that was built with WPF. Some of the new code effects looked fairly nice (comment xml parsed and styled within the code editor).</p>
<p>It got me wondering if Microsoft would ever change the VS UI to the Ribbon; like O... | <p>It all depends on how it would be implemented.<br>It could be a good thing, but just in case I would like it to be optional:)</p>
| <p>I'm a huge fan of the ribbon, but it would be horrible if they implemented a ribbon-like UI on VS if it hogged too much screen real estate and kept me from seeing my code.</p>
| 32,232 |
<p>I need to create a midnight DateTime</p>
<p>I've just done this:</p>
<pre><code>DateTime endTime = DateTime.Now;
endTime.Subtract(endTime.TimeOfDay);
</code></pre>
<p>Haven't test it yet, I'm assuming it works but is there a better/cleaner way?</p>
| <p>Just use <code>foo.Date</code>, or <a href="https://learn.microsoft.com/en-us/dotnet/api/system.datetime.today" rel="noreferrer"><code>DateTime.Today</code></a> for today's date</p>
| <pre><code> private bool IsServiceDatabaseProcessReadyToStart()
{
bool isGoodParms = true;
DateTime currentTime = DateTime.Now;
//24 Hour Clock
string[] timeSpan = currentTime.ToString("HH:mm:ss").Split(':');
//Default to Noon
int hr = 12;
int mn = 0;
... | 30,553 |
<p>i've got a site with a lot of referenced .js-Files; those are rather small files, but I want to keep my methods separated by topic/functionality.</p>
<p>Is it better to keep all the methods in one .js-File or is it no problem to have many (~ 20 - 30) small files all including only some lines?</p>
| <p>By all means keep them separate for development, but you should consider bundling them together into one file for production.</p>
<p>There is a nice discussion at <a href="http://www.sitepoint.com/blogs/2007/04/10/faster-page-loads-bundle-your-css-and-javascript/" rel="nofollow noreferrer">sitepoint.com</a></p>
<b... | <p>Does anyone have a clever nant script which can do this for you? I've written a custom nant task which uses the YUI compressor to minify my css and js, but it would be useful to add combining to it. How do you guys handle this?</p>
| 40,934 |
<p>I'm new in the 3D priting and I bought a BIQU B1 printer :-)</p>
<p>I printed the Pokemon with the white filament that come as a sample with the printer (PLA) and after that I bought the Inland PLA+ and PETG+ from Microcenter.
The first thing that my son asked me to print is the toaster.
Well, I tried to print three... | <blockquote>
<p>What is this called</p>
</blockquote>
<p>This is called <strong>warping</strong>.</p>
<p>Warping of prints occurs frequently when you use a filament that shrinks. If the model would shrink uniformly, it will become smaller, like in a scaled version (unfortunately, the print is attached somewhere, which ... | <p>You are getting warping. It's unusual in this case, as your overall model is relatively low profile. It's the taller stuff that likes to warp.</p>
<p>Consider to edit your post to include the layer heights and also the filament type and filament and bed temperatures. My first instinct is that your bed temperature is... | 2,206 |
<p>I have a win form (c#) with a datagridview. I set the grid's datasource to a datatable.</p>
<p>The user wants to check if some data in the datatable exists in another source, so we loop through the table comparing rows to the other source and set the rowerror on the datatable to a short message. The datagridview ... | <p>Check that <code>AutoSizeRowsMode</code> is set to <code>DataGridViewAutoSizeRowsMode.None</code>. I have found that the row <code>Errortext</code> preview icon is not displayed when <code>AutoSizeRowsMode</code> is not set to the default of none.</p>
<pre><code>DataGridView1.AutoSizeRowsMode = DataGridViewAutoSize... | <p>I believe that the errors will only show on editing. What you could do is add a bool column to your DataTable, which drives the display of an image/custom column in the DataGridView, reflecting whether there is an error or not.</p>
| 37,174 |
<p>I'm trying:</p>
<pre><code>import commands
print commands.getoutput("ps -u 0")
</code></pre>
<p>But it doesn't work on os x.
os instead of commands gives the same output:
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND</p>
<p>nothing more</p>
| <p>This works on Mac OS X 10.5.5. Note the capital <strong>-U</strong> option. Perhaps that's been your problem.</p>
<pre><code>import subprocess
ps = subprocess.Popen("ps -U 0", shell=True, stdout=subprocess.PIPE)
print ps.stdout.read()
ps.stdout.close()
ps.wait()
</code></pre>
<p>Here's the Python version</p>
<p... | <p>It works if you use os instead of commands:</p>
<pre><code>import os
print os.system("ps -u 0")
</code></pre>
| 19,379 |
<p>I am trying to set the disabled font characteristics for a Label Control. I can set all of the Font characteristics (size, bold, etc), but the color is overridden by the default windows behavior which seems to be one of these two colors:</p>
<ul>
<li>If background color is transparent then ForeColor is same as Tex... | <p>Have you tried implementing the EnabledChanged event? Or are you looking for more of a "styles" property on the control (as far as I know, they don't exist)?</p>
| <p>Why is this an issue?</p>
<p>I would personally let windows handle it. People are used to disabled items looking a certain way, so if you start trying to change every aspect of the way they look, you might start confusing your users.</p>
| 16,477 |
<p>Today our virtual W2003 server storing our SVN repository (too) became very-very busy. It turned out that it had only 88KB free space left on the C: drive. Not that good. Due to access problems, the only way we could reboot it by killing the busy processes from task manager (McAffee, SqlServer, services.exe) and the... | <p>Editing is implemented as a method on your UITableView’s delegate object. In your table controller, have whatever control activates editing call this:</p>
<pre><code>[tableView setEditing: YES animated: YES];
</code></pre>
<p>Then, make sure that your delegate object implements this:</p>
<pre><code>- (void)tableV... | <p>I would implement a subclass of UITableViewCell and handle touch events in there. You would likely have to do all the animation stuff yourself, but I think it's probably the easiest solution. There's not a "Supported" method for changing the delete button, I don't think</p>
| 46,983 |
<p>I'm trying to determine the reason for a stalled process on Linux. It's a telecom application, running under fairly heavy load. There is a separate process for each of 8 T1 spans. Every so often, one of the processes will get very unresponsive - up to maybe 50 seconds before an event is noted in the normally very... | <p>If you are able to spot this "moment of unresponsiveness", then you might use strace to attach to the process in question during that time and try to figure out where it "sleeps":</p>
<pre><code>strace -f -o LOG -p <pid>
</code></pre>
<p>More lightweight, but less reliable method:</p>
<ol>
<li><p>When proce... | <p>Thanks - strace sounds useful. Catching the process at the right time will be part of the fun. I came up with a scheme to periodically write a time stamp into shared memory, then monitor with another process. Sending a SIGSTOP would then let me at least examine the application stack with gdb. I don't know if str... | 27,577 |
<p>Last week I implemented a date validation in our front end, a combination of ASP.NET and heavily dependent on lots of JavaScript code to avoid server round-trips until a form is actually saved. I felt it clumsy that this rule check is not done on the server, but our current architecture and performance requirements... | <p>ASP.NET's Validation Controls can do this.</p>
<blockquote>
<p>ASP.NET validation controls also provide two ways of validation: Server-side or Client-side. The nice thing about these Validation controls is that it will preform client-side validation when it detects the browser is able (unless client-side validati... | <p>I think a simple rule engine is your best option. Depending on the validation you want to perform it needn't be too complex.</p>
<p>Anything else will involve additional round trips to the server (to perform all validation in C#) or getting the server to execute the JavaScript (which is much harder, I believe, than... | 33,254 |
<p>We have developers with knowledge of these languages - Ruby , Python, .Net or Java. We are developing an application which will mainly handle XML documents. Most of the work is to convert predefined XML files into database tables, providing mapping between XML documents through database, creating reports from databa... | <p>A dynamic language rules for this. Why? The mappings are easy to code and change. You don't have to recompile and rebuild.</p>
<p>Indeed, with a little cleverness, you can have your "XML XPATH to a Tag -> DB table-field" mappings as disjoint blocks of Python code that your main application imports.</p>
<p>The b... | <p>If you are well versed in Java, you can try out <a href="https://vtd-xml.sourceforge.io/" rel="nofollow noreferrer">VTD</a> XML Parser for parsing large volumes of XML data.</p>
| 38,684 |
<p>Is there any free software tool or combination that allows me to identify the pitch of a recorded singing session?</p>
<p>The idea is to display some kind of graph with the current pitch in a time line along with markers for the standard notes (C3, C#3, D, etc). I don't need pitch correction and I don't need it to ... | <p>Checkout <a href="http://audacity.sourceforge.net/" rel="nofollow noreferrer">Audacity</a>. It came out of a project to do musical pitch analysis. </p>
| <p>Not exactly what you are looking for, but the Singstar lookalike Ultrastar-NG at least does something like this.
<a href="http://ultrastar-ng.sourceforge.net/" rel="nofollow noreferrer">http://ultrastar-ng.sourceforge.net/</a></p>
| 19,262 |
<p><a href="https://stackoverflow.com/questions/106597/why-are-fixnums-in-emacs-only-29-bits">The fixnum question</a> brought my mind to an other question I've wondered for a long time.</p>
<p>Many online material about garbage collection does not tell about how runtime type information can be implemented. Therefore I... | <p>Basically to achieve accurate marking you need meta-data indicating which words are used as pointers and which are not.</p>
<p>This meta-data could be stored per reference, as emacs does. If for your language/implementation you don't care much about memory use, you could even make references bigger than words (perh... | <p>In Squeak (also Scheme and many others dynamic languages I guess) you have <code>SmallInteger</code>, the class of signed 31-bit integers, and classes for arbitrarily big integers, e.g. <code>LargePositiveInteger</code>. There could very well be other representations, 64-something-bit integers either as full objects... | 27,397 |
<p>We need to interface to 3rd party app, but company behind the app doesn't disclose message protocol and provides only Windows DLL to interface to.</p>
<p>Our application is Linux-based so I cannot directly communicate with DLL. I couldn't find any existing solution so I'm considering writing socket-based bridge betw... | <p>Any solution is going to need a TCP/IP-based "remoting" layer between the DLL which is running in a "windows-like" environment, and your linux app. </p>
<p>You'll need to write a simple PC app to expose the DLL functions, either using a homebrew protocol, or maybe XML-RPC, SOAP or JSON protocols. The <a href="http:... | <p>IMO, the best bet is to use Sockets. I have done this previously and it works like a charm. </p>
| 48,931 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.