input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
How to find two adjacent repeating digits and replace them with a single digit in Java? <p>I need to find two adjacent repeating digits in a string and replace with a single one. How to do this in Java. Some examples:</p>
<p>123345 should be 12345
77433211 should be 74321</p>
| <p>Probably a <code>replaceAll("(\\d)\\1+", "$1")</code></p>
<ul>
<li><code>$</code> plays a special role in a replacing string, designating the first capturing group.</li>
<li><code>+</code> allows for replacing as many identical number as possible <code>(\\d)\\1</code> would only replace them by pair: <code>777xx</c... |
using jython and open office 2.4 to convert docs to pdf <p>I completed a python script using pyuno which successfully converted a document/ xls / rtf etc to a pdf.
Then I needed to update a mssql database, due to open office currently supporting python 2.3, it's ancientness, lacks support for decent database libs. So I... | <p>And so it goes, according to this guy, you need some oil.... and it works like a charm</p>
<p><a href="http://www.oooforum.org/forum/viewtopic.phtml?p=304263#304263" rel="nofollow">http://www.oooforum.org/forum/viewtopic.phtml?p=304263#304263</a></p>
<p>include this lib C:\OpenOffice_24\program\classes\unoil.jar</... |
Sensitive data in Viewstate? <p>I need to store sensitive data across few pages (run over https) per session.</p>
<p>I can't use session object, for the primary reason being that the session store is designed as just as backup store (primarily make service calls and load the session). If the session has been restarted... | <blockquote>
<p>I need to store sensitive data across
few pages (run over https) per
session.</p>
</blockquote>
<p>ViewState is set and maintained on the page level. It cannot be carried across different page requests, only postbacks of the current page. Assuming you really mean you have to carry the data "acr... |
How can I create an editable dropdownlist in HTML? <p>I'd like to create a text field with a dropdown list that lets the user choose some predefined values. The user should also be able to type a new value or select a predefined one from a dropdown list. I know that I can use two widgets for that but in my app it would... | <p>You can accomplish this by using the <code><datalist></code> tag in HTML5.</p>
<pre><code><input type="text" name="product" list="productName"/>
<datalist id="productName">
<option value="Pen">Pen</option>
<option value="Pencil">Pencil</option>
<option value=... |
Best way to automagically migrate tests from JUnit 3 to JUnit 4? <p>I have a bunch of JUnit 3 classes which extend TestCase and would like to automatically migrate them to be JUnit4 tests with annotations such as <code>@Before</code>, <code>@After</code>, <code>@Test</code>, etc.<br>
Any tool out there to do this in a ... | <p>In my opinion, it cannot be that hard. So let's try it:</p>
<h2>0. Imports</h2>
<p>You need to import three annotations:</p>
<pre><code>import org.junit.After;
import org.junit.Before;
import org.junit.Test;`
</code></pre>
<p>After you've made the next few changes, you won't need <code>import junit.framework.Tes... |
gdi+ Graphics::DrawImage really slow~~ <p>I am using a GDI+ Graphic to draw a 4000*3000 image to screen, but it is really slow. It takes about 300ms. I wish it just occupy less than 10ms.</p>
<pre><code>Bitmap *bitmap = Bitmap::FromFile("XXXX",...);
</code></pre>
<p>//--------------------------------------------
// t... | <p>If you're using GDI+, the TextureBrush class is what you need for rendering images fast. I've written a couple of 2d games with it, getting around 30 FPS or so.</p>
<p>I've never written .NET code in C++, so here's a C#-ish example:</p>
<pre><code>Bitmap bmp = new Bitmap(...)
TextureBrush myBrush = new TextureBrus... |
Is it worth switching from Visual Studio 2005 to Visual Studio 2008? <p>As a team we are using Visual Studio 2005 with framework 3.0. I am thinking if it will be nice for us to switch to Visual Studio 2008 with framework 3.5 ? Is it worth it ?</p>
<p>Thanks.</p>
| <p>Yes, it is 100% worth it. Visual Studio 2008 supports 2005 code (.net 2.0) completely. There are also a lot of improvements that you'll enjoy as you use 2008.</p>
|
Count Duplicate URLs, fastest method possible <p>I'm still working with this huge list of URLs, all the help I have received has been great.</p>
<p>At the moment I have the list looking like this (17000 URLs though):</p>
<p><a href="http://www.domain.com/page?CONTENT_ITEM_ID=1" rel="nofollow">http://www.domain.com/pa... | <p>This is probably as fast as you can get without writing code.</p>
<pre>
$ cat foo.txt
http://www.domain.com/page?CONTENT_ITEM_ID=1
http://www.domain.com/page?CONTENT_ITEM_ID=3
http://www.domain.com/page?CONTENT_ITEM_ID=2
http://www.domain.com/page?CONTENT_ITEM_ID=1
http://www.domain.com/page... |
Using Samba for random access without mounting the file system? <p>I am using a machine on which I do not have root access and would like to access files on a Samba server in random access mode. I know I can transfer the files in their entirety using smbclient but the files are very large (>1GB) and I would rather just... | <p>To answer my own question after digging around in the Samba source: there is a client library libsmbclient which includes all the usual file handling stuff: smbc_open, smbc_fstat, smbc_lseek, smbc_read etc. For instance, here is a snippet I just wrote which reads a file backwards (just to check it was doing a true s... |
Have you tried Spring Workflow already? <p><a href="http://www.springsource.org/extensions/se-workflow">Spring Workflow</a> has now been published.</p>
<ul>
<li>Have you tried it yet? For what kind of scenario?</li>
<li>What is your impression? How do you find it stacks up against other workflow libs?</li>
<li>Found a... | <p>OK, ignoring my beliefs shown in my previous post I did try spring workflow, only to find out that I was right. Getting the sources and building is not that hard, they use svn, ant and ivy as repository manager.</p>
<p>Making it work is another story. I took the sample sources, an placed them in a new project. At t... |
Java Video Player <p>I need a java api, that cannot use JMF, to play video interpreted by the SO codecs but i want to retrieve the each frames in java code. Somebody know some?</p>
| <p>Have a look at <a href="http://fmj-sf.net/index.php" rel="nofollow">FMJ</a>. It does <em>not</em> require the <a href="http://java.sun.com/javase/technologies/desktop/media/jmf/" rel="nofollow">Java Media Framework</a> (JMF).</p>
<p>They have an <a href="http://fmj-sf.net/ffmpeg-java/getting_started.php" rel="nofo... |
Remote posting from one application to another application. Security issue? <p>Is there any security issue if let say in one application we do a hidden post to another application to make use of that application functionality?</p>
| <p>Depends. Are you using some sort of authentication and encryption? </p>
<p>There are ways this could cause many security issues. Though you could say that of many implementations. Most anything configured badly can be a security issue. </p>
|
UTF-16 to UTF-8 conversion (for scripting in Windows) <p>what is the best way to convert a UTF-16 files to UTF-8? I need to use this in a cmd script.</p>
| <p>There is a GNU tool <a href="http://www.gnu.org/software/recode/recode.html">recode</a> which you can also use on Windows.
E.g.</p>
<pre><code>recode utf16..utf8 text.txt
</code></pre>
|
Doing a generic <sql:query> in Grails <p>This is a generic way to select data from a table and show the results in an HTML table using JSP taglibs. What is the generic way to do this in Grails? That is, take a few lines of SQL and generate an HTML table from scratch in Grails, including the column names as headers.</... | <p>This question could be rephrased as, how do I write code like a naive ASP.NET developer?
(Not all ASP.NET developers are naive, some can be quite good)</p>
<ol>
<li>Any static method is available to you in a gsp page. You can use any MyDomain.findBy, list(), count you want from page scope.</li>
<li><p>You could a... |
MSV08-C#: How do I stop two groupboxes from auto-parenting themselves when dragged on top of one another? <p>IDE: Microsoft Visual Studio Professional 2008</p>
<p>Language: C#</p>
<p>Background:
I have one form and two groupboxes that are going to be used as preference catagory groupboxes. My problem is that everytim... | <p>You may consider resizing your second GroupBox into position over the first. Drag one side or one corner of the second group box until it covers the first GroupBox and continue to resize the second GroupBox until it is positioned as you desire. </p>
<p>Also available, in the Layout Toolbar, are the alignment and si... |
Best tool for creating a societal model <p>Lets say I wanted to create some software that models a society. People exist, meet, have children, learn, share experiences etc. Which programming language should I use?</p>
<p>I would assume that a dynamic language that enables me to swap out methods and/or implement types ... | <p>In my earlier <a href="http://stackoverflow.com/questions/166661/agent-based-modeling-resources">question</a> I mentioned <a href="http://repast.sourceforge.net/" rel="nofollow">Repast</a>, <a href="http://www.swarm.org/" rel="nofollow">Swarm</a>, and <a href="http://www.aitia.hu/services_and_products/simulation_sy... |
Paths and CreateProcess <p>I have a question regarding a symptom of my misuse of CreateProcess. I'm using the lpcommandline parameter to feed the path to my executable and parameters. My misuse is that I have not surrounded the path to the exe with quotes. </p>
<p>My question is, why does the CreateProcess work just... | <p>As the document Martin York linked to hinted, CreateProcess() has some behaviour for back-compat with pre-long-name programs.</p>
<p>"c:\program files\sub dir\program name arg1 arg2" will look for:</p>
<blockquote>
<pre><code>"c:\program.exe" files\sub dir\program name arg1 arg2
"c:\program files\sub.exe" dir\prog... |
Messaging over HTTPS <p>I'm about to start a project that requires XML messages to be sent between a couple of servers over HTTPS. A brief summary is this: I have an application in use by clients that will send information to a central server. That server will communicate these XML messages to another company's serve... | <p>Are the messages from the foreign server immediate replies to your messages? If not (either side can initiate a message whenever it likes), consider having both ends implement RESTful web services - the XML can be the payload, and https requests are trivially supportable.</p>
<p>Since invoking the web service is ju... |
AspectJ: parameter in a pointcut <p>I'm using AspectJ to advice all the public methods which do have an argument of a chosen class. I tried the following:</p>
<pre><code>pointcut permissionCheckMethods(Session sess) :
(execution(public * *(.., Session)) && args(*, sess));
</code></pre>
<p>This is working... | <p>Oh well... I worked that around with this nasty trick. Still waiting for someone to show up with an "official" pointcut definition.</p>
<pre><code>pointcut permissionCheckMethods(EhealthSession eheSess) :
(execution(public * *(.., EhealthSession)) && args(*, eheSess))
&& !within(it.___.secu... |
What's the best type 4 Oracle JDBC driver? <p>What's the best type 4 Oracle JDBC driver?</p>
<p>What I want:</p>
<ul>
<li>Stable, few bugs and quick fixes</li>
<li>Should warn about the usual JDBC pitfalls (connection leaks, etc)</li>
<li>Must support CLOB</li>
</ul>
<p>[EDIT] My main issues with the "free" Oracle T... | <p>Oracle's type 4 JDBC driver is pretty good. Obviously, as with any software, there are bugs, but they're generally not bad. And the price (free) can't be beat.</p>
<p>If you are looking for third-party commercial drivers, I have always had good experiences with DataDirect products in this realm. I wouldn't norma... |
HTTP Request Timeout <p>In Python 2.6, a new "timeout" parameter was added to the httplib.HTTPConnection class:
<a href="http://docs.python.org/library/httplib.html#httplib.HTTPConnection" rel="nofollow">http://docs.python.org/library/httplib.html#httplib.HTTPConnection</a></p>
<p>However, this is only a timeout for t... | <p>You can set a global socket timeout <sup>(*)</sup>:</p>
<pre><code>import socket
timeout = 10
socket.setdefaulttimeout(timeout)
</code></pre>
<hr>
<p><sup>(*)</sup> <strong>EDIT</strong>: As people in the comments correctly point out: This is technically true, but it only has predictable results for tasks that i... |
XSL parent child problem <p>I have a xml build of</p>
<pre><code><elig>
<subscriber code="1234"/>
<date to="12/30/2004"
from="12/31/2004"/>
<person name="bob"
ID="654321"/>
<dog type="labrador"
color="white"/>
<location name="hawaii... | <p>I modified one typo in your example XML:</p>
<pre><code><elig>
<subscriber code="1234">
<date to="12/30/2004" from="12/31/2004"/>
<person name="bob" ID="654321"/>
<dog type="labrador" color="white"/>
<location name="hawaii" islandCode="01"/>
</subscribe... |
Generating PDFs with PHP <p>I have a PHP application and a need to generate a PDF with the result of query. The easiest way a found to do this was to use the DOMPDF to generate the PDF for me. So a made a function that generates the HTML for me then a pass this to DOMPDF. In the development and testing enviroment every... | <p>I once did a PHP project generating PDF. I used <a href="http://www.fpdf.org/">FPdf</a>.</p>
<p>I never had any memory problems. It's free, it's pure PHP code. You don't have to load any extensions.</p>
<p>I don't know if there's some helpers to auto-generate document from a query, but in the website, you have som... |
How to query range of data in DB2 with highest performance? <p>Usually, I need to retrieve data from a table in some range; for example, a separate page for each search result. In MySQL I use LIMIT keyword but in DB2 I don't know. Now I use this query for retrieve range of data.</p>
<pre><code>SELECT *
FROM(
SELEC... | <p>My requirement have been added into DB2 9.7.2 already.</p>
<p>DB2 9.7.2 adds new syntax for limit query result as illustrate below:</p>
<pre><code>SELECT * FROM TABLE LIMIT 5 OFFSET 20
</code></pre>
<p>the database will retrieve result from row no. 21 - 25 </p>
|
Show new WinForms window unfocused <p>I'm generating and showing a new WinForms window on top of a Main Window. How can I achieve that the original (Main Window) keeps the focus? Setting the focus back after showing the new window does not solve my problem because I need to prevent the Main Window's title bar from flic... | <p>Setting the focus after you show the new form works fine. My taskbar does not flicker.</p>
<pre><code>private void button1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.TopMost = true;
f2.Show();
this.Focus();
}
</code></pre>
<p>Can I ask why you want to set the foc... |
Best way to strip punctuation from a string in Python <p>It seems like there should be a simpler way than:</p>
<pre><code>import string
s = "string. With. Punctuation?" # Sample string
out = s.translate(string.maketrans("",""), string.punctuation)
</code></pre>
<p>Is there?</p>
| <p>From an efficiency perspective, you're not going to beat translate() - it's performing raw string operations in C with a lookup table - there's not much that will beat that but writing your own C code.
If speed isn't a worry, another option though is:</p>
<pre><code>exclude = set(string.punctuation)
s = ''.join(ch ... |
CSS for container divs and falling to the next line <p>I'm more of a programmer than a designer, and I'm trying to embrace <code><div></code>s rather than using tables but am getting stuck.</p>
<p>Here's what I'm trying to do. I am setting up a survey page. I want each question's text to sit at the top of the ... | <p>Don't float anything but the red container, and float it to the right. Make sure the HTML for the red containers is placed before the HTML for the blue containers. Keep the static width on the blue container, and keep your clear:both on the green container.</p>
|
How to set a timeout during remote ejb lookup? <p>I'm trying to access a remote ejb which is not available yet. But the lookup takes 5 min before I get the NameNotFoundException. Is there a way I can set the lookup timeout to a lesser value so that the client application doesn't hang for 5 mins?
Thanks in advance...</... | <p>Do the lookup in another thread, so that the client GUI does not hang. You can use plain Runnable to do this, or try a better option like <a href="https://swingworker.dev.java.net/" rel="nofollow">swingworker</a>.</p>
<p>To customize the JNDI lookup timeout, I am afraid, you will have to hack the internals of an op... |
Can we see the source code for PowerShell cmdlets? <p>I'm learning some PowerShell. Is it possible to see the source code for a built-in cmdlet like <a href="http://technet.microsoft.com/en-us/library/hh849800.aspx">Get-ChildItem</a>?</p>
| <p>Actually, your best bet is to go check out <a href="http://www.codeplex.com/PowerShellCX">PowerShell Community Extensions</a>. This open source software community project is "aimed at providing a widely useful set of additional cmdlets...". The developers on the project are PowerShell MVPs and know their stuff.</p>
... |
2008 MFC and threads? <p>I was reading this thread/post: <a href="http://stackoverflow.com/questions/262298/windows-c-ui-technology">http://stackoverflow.com/questions/262298/windows-c-ui-technology</a></p>
<p>and am also wondering about a non .NET UI framework. Specifically - prior to .NET having support for serial ... | <p>This is not a limitation of MFC - it's the design of Windows. You can't start sending messages to arbitrary controls from random other threads. (Well, you can, sometimes, but you need to know what you're doing.) This is equally true in the .NET world - once a control is visible you need to use a delegate to update i... |
How do I unit test jdbc code in java? <p>I'd like to write some unit tests for some code that connects to a database, runs one or more queries, and then processes the results.
(Without actually using a database)</p>
<p>Another developer here wrote our own DataSource, Connection, Statement, PreparedStatement, and Resul... | <p>You have several options:</p>
<ul>
<li>Mock the database with a Mock library, e.g. <a href="http://www.jmock.org/" rel="nofollow">JMock</a>. The huge drawback of this that your queries and the data will most likely be not tested at all.</li>
<li>Use a light weight database for the tests, such as <a href="http://hsq... |
modern for loop for primitive array <p>Is there any performance difference between the for loops on a primitive array? </p>
<p>Assume:</p>
<pre><code>double[] doubleArray = new double[300000];
for (double var: doubleArray)
someComplexCalculation(var);
</code></pre>
<p>or :</p>
<pre><code>for ( int i = 0, y = ... | <p>My opinion is that you don't know and shouldn't guess. Trying to outsmart compilers these days is fruitless. </p>
<p>There have been times people learned "Patterns" that seemed to optimize some operation, but in the next version of Java those patterns were actually slower.</p>
<p>Always write it as clear as you p... |
System.Collections.Generic List and F# <p>I have a C# class the returns a List, using System.Collections.Generic Lists not F# List</p>
<p>I want to iterate though the list to find a object or not find it. Here is how I would do it in C#. How would I accomplish the similar thing in F#</p>
<pre><code>foreach (AperioC... | <pre><code>match Seq.tryfind ((=) "") caseList with
None -> print_string "didn't find it"
| Some s -> printfn "found it: %s" s
</code></pre>
|
Possible Causes for a Large Number of Sleeping Connections to a MySQL Server? <p>What are possible causes for a large number of sleeping connections to a MySQL Server? I'm using CodeIgniter with persistent connections disabled.</p>
| <p>Even though the app doesn't keep the connection open, the OS lets it hang around. See <a href="http://www.mysqlperformanceblog.com/2006/11/12/are-php-persistent-connections-evil/" rel="nofollow">http://www.mysqlperformanceblog.com/2006/11/12/are-php-persistent-connections-evil/</a></p>
|
Why is a char and a bool the same size in c++? <p>I'm reading <em>The C++ Programming Language.</em> In it Stroustrup states that <code>sizeof(char) == 1</code> and <code>1 <= sizeof(bool)</code>. The specifics depend on the implementation. Why would such a simple value as a boolean take the same space as a char?<... | <p>In modern computer architectures, a byte is the smallest addressable unit of memory. To pack multiple bits into a byte requires applying extra bit-shift operations. At the compiler level, it's a trade off of memory vs. speed requirements (and in high-performance software, those extra bit-shift operations can add up ... |
Why doesn't MSBuild copy as I would expect <p>I'm needing to script my build. I'm using MSBUILD because of it's integration with VS.net. I am trying to copy some files from the build environment to the deployment folder. I'm using the copy task of MSBuild. But instead of copying the directory tree as I would expect. i... | <p>Just a gem we found as we were debugging MSBuild issues around copying:</p>
<p><a href="http://blog.scrappydog.com/2008/06/subtle-msbuild-bug-feature.html">http://blog.scrappydog.com/2008/06/subtle-msbuild-bug-feature.html</a></p>
<p>ItemGroups are parsed before Targets, so any Targets that create new files (e.g. ... |
Most efficient way to close a load() page using the X sign in jquery <p>I'm new to Jquery and I'm trying to use a div container to load a URL, however, I want to give a user an option to close it with an X sign on the top right corner like in Amazon.com. What's the best way to accomplish this?</p>
<p>Here's what I hav... | <p>some html:</p>
<pre><code><div id="popup">
<img src="x.gif" alt="Close" class="img_close" />
<div class="details"></div>
</div>
</code></pre>
<p>some css:</p>
<pre><code>#popup .img_close {
float: right;
}
#details {
clear: right; /* if you want there to be a "titleb... |
Why does Javadoc generate non-compliant XHTML? <p>I just pasted some generated javadoc into an eclipse project, to discover none of the HTML is compliant.</p>
<p>There is even cases of closing tags that were never opened.</p>
<p>Is there some way to fix this? Maybe a "be compliant" option...</p>
| <p>After some googling, I discovered <a href="http://linux.softpedia.com/get/Documentation/XHTML-Doclet-28836.shtml">
XHTML Doclet 0.4</a>.</p>
<blockquote>
<p>XHTML Doclet is a standards-compliant
alternative to the Javadoc standard
HTML doclet. The project revises the
document structure to exclude outdated
... |
What is the "Operation Aborted" error in Internet Explorer? <p>I recently added JQuery's date-picker control to a project. In Internet Exploder, I get the following error message:</p>
<blockquote>
<p>Internet Explorer cannot open the
Internet site</p>
<p><a href="http://localhost/">http://localhost/</a></p>
... | <p><strong>There was a related question earlier today</strong>:</p>
<p><a href="http://stackoverflow.com/questions/266585/operation-aborted-error-in-ie7"><strong>Operation Aborted Error in IE</strong></a></p>
<p>This is a common problem.</p>
<p>It occurs in IE when a script tries to modify the DOM before the page is... |
Visual Studio Solutions Folder as real Folders <p>I have a Visual Studio Solution. Currently, it is an empty solution (=no projects) and I have added a few solution folders.</p>
<p>Solution Folders only seem to be "virtual folders", because they are not really created in the Filesystem and files inside solution folder... | <p>No special setting. I don't think it's supported.</p>
<p>You can create real folders in a "project" within the solution, but not in the solution itself.</p>
|
Equivalent to Windows getch() for Mac/Linux crashes <p>I am using <code>getch()</code> and my app crashes instantly. Including when doing:</p>
<pre><code>int main()
{
getch();
}
</code></pre>
<p>I can't find the link but supposedly the problem is that it needs to turn off buffering or something strange along thos... | <p>Have you looked in <code><curses.h></code> to see what the <code>getch()</code> function does?</p>
<p>Hint: OSX and Linux are not the same as Windows.</p>
<p>Specifically, as a macro in <code><curses.h></code>, we find:</p>
<pre><code>#define getch() wgetch(stdscr)
</code></pre>
<p>Now, there appears... |
UIWebView within a ScrollView does not redraw <p>I have UIWebView within a UIScrollView. Then as I scroll, the web view displays first two pages correctly but does draws only half of the third the page. If I tap on the web view it draws the content or if I call <code>-[UIWebView reload]</code> in <code>-scrollViewDidEn... | <p>UIWebViews cannot be loaded concurrently. You must load one, wait til it finishes, then load the next, and so on.</p>
<p>You can do this on a timer, or wait until when the scrolled UIWebView has the focus before loading the data.</p>
|
What are the best practices on MS-SQL when Windows Authentications is not an option? <p>What is the best option for a windows application that uses SQL server authentication? Should I create a single SQL account and manage the users inside the application (using a users table). Or should I create a SQL server account f... | <p>Depends on whether the username/password for the SQL server would be exposed to the user, and whether that would be a problem. Generally for internal apps (in smaller organisations), one would trust the users not too log in directly to the sql server. If you have a middleware layer (ie webservices) the password can ... |
How do you bind data to multiple columns in a list view? <p>I have a datasource that I want to bind to a listview that has multiple columns. How do I bind my datasource to that listview</p>
<p>Here is some pseudo code that doesn't work to help illustrate what I am trying to do:</p>
<pre><code>MyDataTable dt = GetData... | <p>It seems there is a lacuna in functionality of WinForms ListView control (thought it's possible to <a href="http://msdn.microsoft.com/en-us/library/ms750972.aspx#BindingDatatoaListView" rel="nofollow">databind</a> new WPF ListBox). </p>
<p>This article by Nick Karnik describes how to add databinding capability to c... |
TCL: Two way communication between threads in Windows <p>I need to have two way communication between threads in Tcl and all I can get is one way with parameters passing in as my only master->helper communication channel. Here is what I have:</p>
<pre><code>proc ExecProgram { command } {
if { [catch {open "| $com... | <p>Here is a small example that shows how two processes can communicate. First off the child process (save this as child.tcl):</p>
<pre><code>gets stdin line
puts [string toupper $line]
</code></pre>
<p>and then the parent process that starts the child and comunicates with it:</p>
<pre><code>set fd [open "| tclsh c... |
query: cross product instead of join <p>I have two tables that I would like to join but I am getting an error from MySQL</p>
<pre><code>Table: books
bookTagNum ShelfTagNum
book1 1
book2 2
book3 2
Table: shelf
shelfNum shelfTagNum
1 shelf1
2 shelf2
</code></pre>
<p>I want my results... | <p>I think you want</p>
<pre><code>where `books`.`shelfTagNum`=`shelf`.`shelfNum`
</code></pre>
<p>In order to match rows from the <code>books</code> and <code>shelf</code> tables, you need to have terms from each in your <code>where</code> clause - otherwise, you're just performing a no-operation check on the rows o... |
.Access violation reading location <p>I've met a really strange problem.</p>
<p>The code is as follow:</p>
<pre><code>::boost::shared_ptr<CQImageFileInfo> pInfo=CQUserViewDataManager::GetInstance()->GetImageFileInfo(nIndex);
Image* pImage=pInfo->m_pThumbnail;
if(pImage==NULL)
pImage=m_pStretchedDefau... | <p><code>0xfeeefeee</code> is a fill pattern that the debug version of the Windows heap (not the C runtime heap) uses for uninitialized memory. <code>0xfeeefef2</code> is <code>0xfeeefeee+4</code>. It sounds like you're dereferencing an uninitialized pointer located in (or copied from) a block of memory allocated from ... |
How to create a picture with animated aspects programmatically <p>Background</p>
<p>I have been asked by a client to create a picture of the world which has animated arrows/rays that come from one part of the world to another. </p>
<p>The rays will be randomized, will represent a transaction, will fade out after th... | <blockquote>
<p>The client will present this as a slide in a presentation in a windows machine</p>
</blockquote>
<p>I think this is the key to your answer. Before going to a 3d implementation and writing all the code in the world to create this feature, you need to look at the presentation software. Chances are, yo... |
Java Instance Variable Accessibility <p>What is the difference in the accessibility of the following variables in Java?</p>
<pre><code>public class Joe {
public int a;
protected int b;
private int b;
int c;
}
</code></pre>
<p>I'm most interested in what the last one is doing.</p>
| <ul>
<li>public: read/writable for anyone</li>
<li>protected: read/writable for
instances of subclasses <strong>and from within the enclosing package</strong></li>
<li>private: read/writable for <strong>any</strong> instance of the class
and inner or outer (enclosing) instance</li>
<li>int c :
package-private, read/wri... |
How do I prevent this System.IO.IOException when copying a file? <p>When I run the following code to test copying a directory, I get a System.IO.IOException when fileInfo.CopyTo method is being called. The error message is: "The process cannot access the file 'C:\CopyDirectoryTest1\temp.txt' because it is being used by... | <p><a href="http://msdn.microsoft.com/en-us/library/system.io.file.create.aspx"><code>File.Create</code></a> returns an open <a href="http://msdn.microsoft.com/en-us/library/system.io.filestream.aspx"><code>FileStream</code></a> - you need to close that stream.</p>
<p>Just</p>
<pre><code>using (File.Create(file1)) {}... |
OffTopic: Would you consider HTML + CSS + Webserver to be MVC? <p>these are just my wonderings and I thought I'd share them...</p>
<p>Simply put, MVC is the pattern for separating contents (model) from presentation (view), and having a mechanism in place (controller) defining how to gather both.</p>
<p>If you already... | <p>You can generally find MVC in anything if you look hard enough.</p>
|
java webstart decompiler <p>Is there anyway to decompile java webstart application? </p>
| <p>Start the application, then fetch the JAR(s) from the webstart cache. Proceed to decompile like with any other Java application.</p>
|
To check whether the string value has numeric value or not in C# <p>I am having an string like this</p>
<p>string str = "dfdsfdsf8fdfdfd9dfdfd4"</p>
<p>I need to check whether the string contains number by looping through the array.</p>
| <p>What about a regular expression:</p>
<pre><code>bool val = System.Text.RegularExpressions.Regex.IsMatch(str, @"\d");
</code></pre>
|
ASP.NET user control - can't get client-side (JavaScript) altered value back into control <p>Ok guys and gals, here is my problem:</p>
<p>I've built a custom control that uses a textbox to present data to the user. </p>
<p>When the user interacts with the control the <strong>value of that textbox is altered with clie... | <p>Interesting, I didn't realize readonly TextBox doesn't get updated from viewstate.</p>
<p>When I pull stunts like that in my web sites, I usually setup asp:HiddenFields that I dump data into with javascript (gotta love jQuery), and that I read values from on postbacks.</p>
<p>Keeps things cleaner I find.</p>
|
How do I write a console application in Windows that would minimize to the system tray? <p>I have a written a Visual C++ console application (i.e. subsystem:console) that prints useful diagnositic messages to the console.</p>
<p>However, I would like to keep the application minimized most of the time, and instead of m... | <p>This is going to be an ugly hack.</p>
<p>First, you have to retrieve the <code>hWnd</code> / <code>hInstance</code> of you console application. Right now, I can only come up with one way:</p>
<ul>
<li>Create a Guid with <code>CoCreateGuid()</code></li>
<li>Convert it to a string</li>
<li>Set the title of the conso... |
Really Basic Graphics in C# 2.0 Tutorials <p>I work for a ticketing agency and we print out tickets on our own ticket printer. I have been straight coding the ticket designs and storing the templates in a database. If we need a new field adding to a ticket I manually add it and use the arcane co-ordinate system to esti... | <p>For those of you in need of a guide to this unusual (at least those of us with a BIS background) field I would heartily endorse:</p>
<p><a href="http://www.bobpowell.net/faqmain.htm" rel="nofollow">http://www.bobpowell.net/faqmain.htm</a></p>
<p>I am now happily drawing graphical interfaces and getting them to res... |
Execute a JavaScript function in a C# application <p>Without using a WebBrowser control, how could I execute a JavaScript function, that is decoupled from any browser DOM dependencies, in a C# application? I am investigating implementing validation rules only once, for both server and client validation. See <a href="... | <p>You could use <a href="http://en.wikipedia.org/wiki/JScript_.NET" rel="nofollow">JScript.Net</a></p>
<p>Either that, or investigate <a href="http://projects.nikhilk.net/ScriptSharp/" rel="nofollow">Script#</a></p>
|
What are the differences / similarities between JBI and SCA <p>Could point me to some good links, or share experiences of the differences / similarities between the JBI and SCA specifications?</p>
<p>Many thanks :-)</p>
| <p>This article can provide the beginning of an answer (even though it does not detail the specifications)</p>
<p><a href="http://www.osoa.org/display/Main/Relationship+of+SCA+and+JBI" rel="nofollow">OSOA article</a></p>
<blockquote>
<p>SCA allows multiple technologies to be used to implement services (e.g. Java, B... |
Automatic BizTalk Versioning in My Build Process <p>In all of my other .net apps my build process (a mixture of nant and custom tasks) automatically updates the [AssemblyVersionAttribute] AssemblyInfo.cs with the current build number before the call to msbuild, stamping in the build number in the version number.</p>
<... | <p>I'm sorry to disappoint you but I've been down the exact some road I had to give up. I guess it could be possible to achieve it but it would require a lot of changes to both the binding files and other XML files (as you mentioned and even more if you have published services etc).</p>
<p>Maybe it could be possible t... |
jQuery document.createElement equivalent? <p>I'm refactoring some old JavaScript code and there's a lot of DOM manipulation going on.</p>
<pre><code>var d = document;
var odv = d.createElement("div");
odv.style.display = "none";
this.OuterDiv = odv;
var t = d.createElement("table");
t.cellSpacing = 0;
t.className = "... | <p>here's your example in "one" line.</p>
<pre><code>this.$OuterDiv = $('<div></div>')
.hide()
.append($('<table></table>')
.attr({ cellSpacing : 0 })
.addClass("text")
)
;
</code></pre>
<hr>
<p><em>Update</em>: I thought I'd update this post since it still gets qu... |
Is it OK to return a KeyValuePair from a .NET function? <p>I was just working on a function that I needed to return two values, one being a column name and one being the value of that column for that current row. I am returning KeyValuePair(of String,Object). I was wondering if this is a good idea or does it make it ... | <p>If it genuinely is a key-value pair, then that seems a pretty reasonable thing to do. .NET 4.0 will include a proper <code>Tuple</code> class for cases where there isn't a key-value relationship.</p>
<p>The alternative is to use out/ref parameters, letting the caller decide whether or not to keep the values togethe... |
How can I monitor the active thread count of a process (jvm) on linux? <p>I would like to monitor the number of threads used by a specific jvm process on linux.
Is there an easy way to get this information without impacting the performance of the jvm process.</p>
<p>More specifically I am interested in the number of t... | <p>try</p>
<pre><code>ps huH p <PID_OF_U_PROCESS> | wc -l
</code></pre>
<p>or <a href="http://htop.sourceforge.net/">htop</a></p>
|
Swing: Canvas overlaps menu <p>I have a JFrame with a menu bar and a canvas covering all the remaining surface. When I click on the menu bar, the menu opens <strong>behind</strong> the Canvas and I can't see it. Has anyone experienced this? Other than resizing the Canvas (which I am reluctant to do) is there any soluti... | <p>You're experiencing heavyweight vs. lightweight issues.</p>
<p>The quick fix: </p>
<pre><code>// Call this sometime before you use your menus
JPopupMenu.setDefaultLightWeightPopupEnabled(false)
</code></pre>
<p><a href="http://java.sun.com/products/jfc/tsc/articles/mixing/index.html">Heavyweight vs. Lightweight<... |
Easy way to add a context action to Eclipse <p>I'm trying to add a very simple action to the context menu of Eclipse: clicking with right button over a folder object, this action should call an external tool (configured in the "External Tools") using the path of the folder as the only parameter.</p>
<p>I've found a <a... | <p>If you want to extend Eclipse with functionality such as editing context menu's, the only way to go is by writing a plug-in. However, this can be very light-weight and targeted to your needs, so the tutorial you found might be a good way to do it. </p>
|
Accessing a ColdFusion datasource from Java code <p>I have a servlet that I would like to run within ColdFusion MX 7. I would like to make use of an existing ColdFusion DSN as a javax.sql.DataSource, if possible.</p>
<p>I thought something like </p>
<pre><code>coldfusion.server.ServiceFactory.getDataSourceService().g... | <p>That code will work fine, you just don't have ServiceFactory in your classpath. Ie, Java can't load that class. Try including a dependency on cfusion.jar from C:\CFusionMX7\lib.</p>
|
Besides version control systems, are there any tools that support release management? <p>Most of the time, I've seen release management handled as a defined process with the supporting tool as the version control system (usually via branching and tagging). However, are there any tools dedicated to release management? I... | <p>You can use <a href="http://ant.apache.org/" rel="nofollow">ant</a> or <a href="http://maven.apache.org/" rel="nofollow">maven</a> for automating tasks like generating packages and deploys to remote servers.</p>
|
What is the best way to store and search through object transactions? <p>We have a decent sized object-oriented application. Whenever an object in the app is changed, the object changes are saved back to the DB. However, this has become less than ideal.</p>
<p>Currently, transactions are stored as a transaction and ... | <p>We have taken the following approach:-</p>
<ol>
<li><p>All objects are serialised (using the standard XMLSeriliser) but we have decorated our classes with serialisation attributes so that the resultant XML is much smaller (storing elements as attributes and dropping vowels on field names for example). This could be... |
How can you emulate a mailing list in Django? <p>I'm on a project which is trying to write what amounts to a Mailing List app in Django, and we're running into a couple of problems/questions.</p>
<p>The code we have so far doesn't set various List headers, and re-sets the To header to be the person we're sending it to... | <p>What about <a href="http://labs.freehackers.org/projects/colibri/wiki" rel="nofollow">http://labs.freehackers.org/projects/colibri/wiki</a>
It seems to do what you want: a mailing list manager with a django frontend.</p>
|
Getting directory listing using Flash <p>In flash you can open a file on the user's computer. In flash 9 you can upload and download the file and in flash 10 you can access the contents of the file.</p>
<p>It is secure because the user has to choose the file from a file dialog box to allow flash access to it.</p>
<p>... | <p>It is insecure, unless, perhaps, you ask the user to point to the wanted directory with a folder browse dialog, if we remain in the above logic...<br />
Even them, users can inadvertently give more information than they should with this mean.<br />
Like when they open all the Documents and Settings folder to P2P net... |
Where do you get XML file formats from <p>Looking at questions like <a href="http://stackoverflow.com/questions/77726/xml-or-sqlite-when-to-drop-xml-for-a-database">http://stackoverflow.com/questions/77726/xml-or-sqlite-when-to-drop-xml-for-a-database</a> and <a href="http://stackoverflow.com/questions/44207/what-are-g... | <p>How I handle it:</p>
<ul>
<li>One element wrapping the whole thing (XML standard)</li>
<li>One element within that for each "object".</li>
<li>Attributes on the element for each Property, when they are a reasonable length.</li>
<li>The InnerXml text of that element for a property with lots of text (provided there i... |
Engineer accountability and code review processes <p>In your âenterpriseâ work environment, how are engineers held accountable for performing code inspections and unit testing? What processes do you follow (formal methodology or custom process) to ensure the quality of your software? Do you or have you tried impl... | <p>⢠Our company uses peer code reviews. We conduct them as Over-The-Shoulder reviews and invite the teamâs tester to participate in the meeting to gain a better understanding of the changes. We use Source Control software that requires check-in, code-review rules to be signed off. Nothing big, just another develo... |
BCP out Error in SQL2000: SQLState = 37000, NativeError = 4060 <p>I have created a proc that grabs all the user tables in a local DB on my machine. I want to be able to create a flat file of all my tables using BCP and SQL. Its a dummy database in SQL 2000 connecting through windows authentication. I have set my enviro... | <p>Your brackets are extending over the entire qualified table name - only the individual components should be bracketed:</p>
<pre><code>bcp [HelpDesk-EasyPay].dbo.[customer] out d:\MSSQL\Data\customer.bcp -N -Utest -Ptest -T
</code></pre>
<p>should work, so you want:</p>
<pre><code>SET @bcp = "master..xp_cmdshell '... |
How to determine which Child Page is being displayed from Master Page? <p>I'm writing code on the master page, and I need to know which child (content) page is being displayed. How can I do this programmatically? </p>
| <p>I use this:</p>
<pre><code>string pageName = this.ContentPlaceHolder1.Page.GetType().FullName;
</code></pre>
<p>It retuns the class name in this format "ASP.default_aspx", but I find that easy to parse for most purposes.</p>
<p>Hope that helps!</p>
|
Is there a Python library function which attempts to guess the character-encoding of some bytes? <p>I'm writing some mail-processing software in Python that is encountering strange bytes in header fields. I suspect this is just malformed mail; the message itself claims to be us-ascii, so I don't think there is a true ... | <p>You may be interested in <a href="http://pypi.python.org/pypi/chardet">Universal Encoding Detector</a>.</p>
|
How do you use Ruby/DL? Is this right? <p>I am trying to write an interface between RSPEC (ruby flavoured BDD) and a Windows application. The application itself is written in an obscure language, but it has a C API to provide access. I've gone with Ruby/DL but am having difficulties getting even the most basic call t... | <p>The general consensus is you want to avoid DL as much as possible. The (english) documentation is quite sketchy and the interface is difficult to use for anything but trivial examples.</p>
<p>Ruby native C interface is MUCH easier to program against. Or you could use FFI, which fills a similiar niche to DL, origina... |
.NET Runtime 2.0 Error in a service <p>We have a custom service that writes to a DB (SQL 2005). This is a full 64-bit environment (DB, .NET service). On one of our servers we crash every morning when we have a spike in our volume of data. On another server we run fine. The only differences that I've been able to no... | <p>Have you tried to attache a debugger to the running code before the crash? Maybe you can track down where the problem is.</p>
<p>You could also use adplus to get a dump of the process and then use that dump in windbg to help track down the problem. Something like this should give you the dump file you are looking... |
Access savedThis property in Function <p>When I'm in the flash debugger, and I have some callbacks saved, I can see that the functions have a property named <code>savedThis</code> that is very usefull to know where that callback came from.</p>
<p>I'm trying to access that property from code, but for some reason I can'... | <p>You can get a reference to a calling function by using the '<em>arguments.callee</em>' property.
<br/>For example:<br/></p>
<p><hr /></p>
<pre><code>bar( arguments.callee );
public function bar( caller:Function ) : void { trace( caller ); }
</code></pre>
|
Understanding JDBC internals <p>[1] In JDBC, why should we first load drivers using Class.forName("some driver name").
Why SUN didnt take care of loading driver within the getConnection() method itself.If I pass driver name as a parameter to the getConnection() method. </p>
<p>[2] I want to understand JBDC internals.A... | <p>With JDBC 4, you no longer need to use Class.forName(...) see <a href="http://www.artima.com/lejava/articles/jdbc_four.html" rel="nofollow">here</a> for one article explaining this:</p>
<blockquote>
<p>Connection to a database requires that a suitable JDBC database driver be loaded in the client's VM. In the earl... |
Opening an application inside a form - C# or VB.NET <p>I am writing an application and I would like to be able to display another application inside it. (Think like a windows form with a small box, or a tab that is displaying a totally seperate application.)</p>
<p>Is that something that can be done? If so, can anyon... | <p>You need a hWnd (handle) of window from another application.
Then you need a hWnd of container control in you application (System.Windows.Forms.Control.Handle property).</p>
<p>Then you need use a Win32API function <a href="http://www.pinvoke.net/default.aspx/user32/SetParent.html">SetParent</a>, and that all you n... |
.Net Data Handling Suggestions <p>I am just beginning to write an application. Part of what it needs to do is to run queries on a database of nutritional information. What I have is the USDA's <a href="http://www.ars.usda.gov/Services/docs.htm?docid=17478" rel="nofollow">SR21 Datasets</a> in the form of flat delimited ... | <p>It looks pretty small, so I'd work out an appropriate object model, load the whole lot into memory, and then use LINQ to Objects.</p>
<p>I'm not quite sure what you're asking about in terms of "persistent storage" - aren't you just reading the data? Don't you already have that in the text files? I'm not sure why yo... |
How to validate .NET dialog items when using automatic DialogResult? <p>At the moment I have setup a custom ok cancel dialog with a drop down in c#. The ok and cancel buttons use the DialogResult property so no code behind it. What I now need to do is validate the drop down to check it isn't left empty before posting b... | <p>From <a href="http://www.functionx.com/vcsharp2003/Lesson06.htm" rel="nofollow">here</a></p>
<p>Double-click the Closing field, and implement it as follows:</p>
<pre><code>private void Second_Closing(object sender,
System.ComponentModel.CancelEventArgs e)
{
// When the user attempts to close the form, d... |
How to Fix This MySQL Query So It Works? <p>I have the following query:</p>
<pre><code>UPDATE lessonstatus
INNER JOIN user ON lessonstatus.user_id = user.user_id
SET user_id = (SELECT user_id FROM user WHERE username = 'too_many_accounts')
WHERE last_name = 'stupid'
AND first_name = 'user'
AND username != 'too_many_a... | <p>You can't <code>SELECT</code> from a table (even in a subquery) that you're updating in the same query. That's what the error "can't specify target table" means.</p>
<p>But you can join <code>user</code> and <code>lessonstatus</code> multiple times in the <code>UPDATE</code> statement, and use the join criteria cr... |
Emacs and cygwin <p>How can I change my GNUemacs to open up a cygwin terminal rather then a cmd one with the shell command?</p>
<blockquote>
<p><strong>Closed</strong> as duplicate of <a href="http://stackoverflow.com/questions/235254/how-can-i-run-cygwin-bash-shell-from-within-emacs">How can I run Cygwin Bash Shel... | <p>See question <a href="http://stackoverflow.com/questions/235254/how-can-i-run-cygwin-bash-shell-from-within-emacs">How can I run Cygwin Bash Shell from within Emacs?</a>. </p>
|
Does OCaml have general map()/reduce() functions? <p>In Python map() works on any data that follows the sequence protocol. It does The Right Thing^TM whether I feed it a string or a list or even a tuple.</p>
<p>Can't I have my cake in OCaml too? Do I really have no other choice but to look at the collection type I'm... | <p>The closest you will get to this is the module <a href="http://batteries.forge.ocamlcore.org/doc.preview/batteries-alpha1/batteries/html/api/Data.Mutable.Enum.html"><code>Enum</code></a> in <a href="http://batteries.forge.ocamlcore.org/">OCaml Batteries Included</a> (formerly of <a href="http://ocaml-extlib.googleco... |
Scope of Oracle transactions when used from ADO.NET and involving triggers? <p>I am told by someone that when calling Oracle from ADO.net, when calling multiple inserts in a loop, where each insert causes a trigger to fire that includes within it's PL-Sql a Commit statement, that it is impossible to stop that commit fr... | <p>Your informant is wrong, if he is talking about Oracle database triggers:</p>
<p>1) You <strong>cannot</strong> put a COMMIT in an Oracle trigger that is not autonomous:</p>
<pre><code>SQL> create trigger this_wont_work
2 after insert on emp
3 begin
4 commit;
5 end;
6 /
Trigger created.
SQL&g... |
JavaScript: Ci is not defined <p>I just spent half an one our to find out what caused the Error-Message "Ci is not defined" in my JavaScript code. I finally found the reason:</p>
<p>It should be (jQuery):</p>
<pre><code>$("asd").bla();
</code></pre>
<p>It was:</p>
<pre><code>("asd").bla();
</code></pre>
<p>(Dollar... | <p>I don't know which version of FF you are using, but regardless, the message is probably referring to the fact that <code>bla()</code> is not a function available on the String object. Since you were missing the <code>$</code>, which means you were missing a function, <code>("asd")</code> would evaluate to a string, ... |
Iterate through generic list of unknown type at runtime in VB.Net <p>Does anyone know how to iterate over a generic list if the type of that list isn't known until runtime?</p>
<p>For example, assume <code>obj1</code> is passed into a function as an <code>Object</code>:</p>
<pre><code>Dim t As Type = obj1.GetType
If ... | <p>The method that iterates over your list can specify a generic type:</p>
<pre><code>Public Sub Foo(Of T)(list As List(Of T))
For Each obj As T In list
..do something with obj..
Next
End Sub
</code></pre>
<p>So then you can call:</p>
<pre><code>Dim list As New List(Of String)
Foo(Of String)(list)
</code></... |
Kill Derby DB Network Server on background <p>I'm looking for a good way to run a Apache Derby server in network mode. I'm using the NetworkServerControl to start the server and it's working great.</p>
<p>I start the server like this:</p>
<pre><code>/**
* starts the network server
* @return true if sucessfull
*/
p... | <p>I did a project awhile ago with derby (including running in network mode), and I seem to remember that there is some SQL you can execute on the server which shuts derby down.</p>
<p>So, assuming that's the case (no time to google for it atm sorry) you could, on start up, look for your network instance. If it exists... |
Tests Projects In Solution <p>In .NET should you place unit test projects in with the rest of the solution? Or should there be a test solution that houses all the test projects?</p>
<p>We have all the test projects in with our code base solution...it seems a bit cumbersome. </p>
<p>What do you usually do?</p>
| <p>In our current project we decided to put all unit tests in separate projects. The application code and tests are in the same solution, but at least we can build (and deploy) a version without the unit test code.</p>
<p>The downside of this -so far- has been that sometimes your unit tests can't reach certain members... |
Is it possible to change headers on an S3 object without downloading the entire object? <p>I've uploaded a bunch of images to Amazon S3, and now want to add a Cache-Control header to them. </p>
<p>Can the header be updated without downloading the entire image? If so, how?</p>
| <p>It's beta functionality, but you can specify new meta data when you <a href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?RESTObjectCOPY.html">copy an object</a>. Specify the same source and destination for the copy, and this has the effect of just updating the meta data on your object.</p>
<pre... |
SetSecurityDescriptorSddlForm(string sddlForm) <p>I dont find any usefull website according to this API.</p>
<p>What's the format of the String? The content?</p>
<p>Thanks</p>
| <p>The Security Descriptor String Format is defined <a href="http://msdn.microsoft.com/en-us/library/aa379570(VS.85).aspx" rel="nofollow">here</a></p>
|
Difference between a LinkedList and a Binary Search Tree <p>What are the main differences between a Linked List and a BinarySearchTree? Is BST just a way of maintaining a LinkedList? My instructor talked about LinkedList and then BST but did't compare them or didn't say when to prefer one over another. This is probably... | <p>Linked List:</p>
<pre><code>Item(1) -> Item(2) -> Item(3) -> Item(4) -> Item(5) -> Item(6) -> Item(7)
</code></pre>
<p>Binary tree:</p>
<pre><code> Node(1)
/
Node(2)
/ \
/ Node(3)
RootNode(4)
\ Node(5)
... |
Finding Unique Table/Column Combinations Across SQL Databases <p>I have 4 databases with similar schema's, and I'm trying to create a query to return just the table, column pairs that exist ONLY in database 1 and do not exist in database 2, 3, or 4.</p>
<p>Currently I can return the symmetric difference between databa... | <pre><code>SELECT
D1.table_name,
D1.column_name
FROM
Database1.information_schema.columns D1
LEFT OUTER JOIN Database2.information_schema.columns D2 ON
D2.table_name = D1.table_name AND
D2.column_name = D1.column_name
LEFT OUTER JOIN Database3.information_schema.columns D3 ON
D3.table_name... |
<%# Eval("State") %> or <%# DataBinder.Eval(Container.DataItem, "state")%> <p>What is the difference between having</p>
<pre class="lang-java prettyprint-override"><code><%# Eval("State") %>
</code></pre>
<p>in your <code>aspx</code> page, versus having</p>
<pre class="lang-java prettyprint-override"><code>&... | <p>Eval("State") is a simplified form of the DataBinder.Eval(Container.DataItem, "State") syntax. It only works inside of data-bound template controls.</p>
<p>For more info, see <a href="http://msdn.microsoft.com/en-us/library/ms178366.aspx">the MSDN documentation</a>.</p>
|
Help getting QTP to identify a control <p>We're trying to use QTP (QuickTest Professional) to auto-test a legacy C++ application.</p>
<p>However, the main window for the app is composed of several IDENTICAL panels. Each panel has a unique title.</p>
<p>If I view the window in Spy++ (comes with DevStudio), I see:</p>... | <p>You could use descriptive programming to bypass the object map. QTP will ignore panel objects by default. You could try to get a reference to the panel object dynamically, then search the ChildObjects collection to find the ok button. Another option might be to simply add an ordinal identifier to the ok buttons. ... |
Is there some list of input's IDs or names of Form after the script was sent? <p>Let's imagine I got this:</p>
<p>index.php generates form with unpredictable number of inputs with certain IDs/Names and different values that can be edited by user and saved by script.php</p>
<pre><code><form action="script.php" meth... | <p>i may be missing something in your question, but the <code>$_POST</code> variable will contain all the name => value pairs you're asking for. for example, in your above HTML snippet:</p>
<pre><code>print_r($_POST);
// contains:
array
(
[1] => 1
[24] => 2233
[55] => 231321
)
// example access:
for... |
Lambda Expressions in Delphi Prism/Oxygene <p>I have been experimenting with Lambda expressions in Oxygene. Very simple recursive lambda expression to calculate a fibonacci number :</p>
<pre><code>var fib : Func<int32, int32>;
fib := n -> iif(n > 1, fib(n - 1) + fib(n - 2), n);
fib(3);
</code></pre>
<p>Wh... | <p>You aren't doing anything wrong. If anything, the compiler should warn you about using fib, an unassigned variable, inside the body of the lambda.</p>
<p>However the compiler ought to be capturing fib as a location, so that when the assignment completes and the delegate is later invoked, fib is properly assigned an... |
jquery round corners <p>This probably sounds really stupid but I have noo idea how to implement jquery's rounded corners (<a href="http://www.methvin.com/jquery/jq-corner-demo.html" rel="nofollow">http://www.methvin.com/jquery/jq-corner-demo.html</a>). My javascript-fu is complete fail and I can't seem to get it to wor... | <ol>
<li>This thing does not work in Safari & Google Chrome.</li>
<li><p>You need to include <a href="http://jqueryjs.googlecode.com/files/jquery-1.2.6.js" rel="nofollow">jquery.js</a> in your page. Don't forget to have a separate closing tag.</p>
<p><code><script type="text/javascript" src="jquery.js"></... |
SQL Deletion Cascading Help (Specific Question) <p>I have two tables (renamed/refactored for illustrative purposes) with a Many-To-Many relationship in an HSQL database. I want everything to be wiped out when I delete from one side of a Many-to-Many relationship (without querying the table; this is performance critica... | <p>Create a Store Procedure where you pass the ID, then simply DELETE the proper row in the order you need to.</p>
<p>This way your app isn't tied to the exact order, which might change in the future with DB redesigns. You also gain the added bonus that Stored Procs are faster then sending a bunch of queries.</p>
<p... |
How to encrypt in VBScript using AES? <p>I am looking to encrypt some data using <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard">Rijndael/AES</a> in <a href="http://en.wikipedia.org/wiki/VBScript">VBScript</a> using a specific key and <a href="http://en.wikipedia.org/wiki/Initialization_vector">IV</... | <p>One response suggested wrapping the <code>RijndaelManaged</code> class in COM. You could also wrap some other AES implementation in COM. I just tried <a href="http://code.google.com/p/slowaes" rel="nofollow">SlowAES</a>, which is a JavaScript implementation of AES. Wrapping it in COM via a Windows Script Component ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.