input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Compare two structs' values in C# <p>I'm not looking for a comparison of two structs that returns bool, I am wondering if there is a way to get which fields of two structs (the same structure, but maybe different values) are different. Basically I want a simpler way to do the following:</p>
<pre><code>public class Di... | <p>It can be done using Reflection. Check for <a href="http://msdn.microsoft.com/en-us/library/system.reflection.fieldinfo.aspx" rel="nofollow">FieldInfo</a> and <a href="http://msdn.microsoft.com/en-us/library/system.reflection.propertyinfo.aspx" rel="nofollow">PropertyInfo</a> examples.</p>
<p>MSDN example (modified... |
C++ formatted input: how to 'skip' tokens? <p>Suppose I have an input file in this format:</p>
<pre><code>VAL1 VAL2 VAL3
VAL1 VAL2 VAL3
</code></pre>
<p>I'm writing a program that would be interested only in VAL1 and VAL3. In C, if i wanted to 'skip' the second value, I'd do as follows:</p>
<pre><code>char VAL1[LENG... | <p>The <a href="http://www.partow.net/programming/strtk/index.html">C++ String Toolkit Library (StrTk)</a> has the following solution to your problem:</p>
<pre><code>#include <string>
#include <deque>
#include "strtk.hpp"
int main()
{
struct line_type
{
std::string val1;
std::string val3... |
Best practices for applying changes to a SharePoint application <p>I feel like I need a better defined framework for updating my SharePoint (MOSS 2007) application with custom code changes. I am creating wsp solution files with features and new types and such, but once those get tested and deployed, I feel like it's a... | <p>I feel your pain... Application Developyment Lifecycle with SharePoint 2007 leaves me with a bitter taste in my mouth.</p>
<p>To answer your question. We built our own deployment utility that does a few things for us.</p>
<ol>
<li><p>Checks state of key Timer Jobs (too many times we would do a deployment to find ... |
Why will this timer not start in a .net service application? <p>I have this code for a Windows service I am writing in .NET....However the TICK function never gets executed regardless of what interval I put in the tmrRun properties. What am I missing? I am sure its something stupid I am not seeing.</p>
<p>Thank You<... | <p>If you are using System.Windows.Forms.Timer that won't work in a service. Look into the other two times you can use in .NET.</p>
|
How can I use VIM to do .Net Development <p>Visual Studio is the defacto editor, but what are our other options that avoid a heavy UI while still integrating with a C# build chain?</p>
<p>Looking for options which preferably use <code>vi</code> or <code>vim</code> directly, and those which emulate some or all of the f... | <p>Here is a <a href="http://kevin-berridge.blogspot.com/2008/09/vim-c-compiling.html">guide on Vim C# compiling</a>.</p>
<p><hr /></p>
<p>In response to the comments -</p>
<p>It sounds like your goal is to have a fully functional IDE that works cross platform for C# development, not necessarily to use VIM. If that... |
What should my new coding language be? <p>I have become very proficient in Java, and am pretty good at C++. What should my next language be? I'm looking to learn something that will be useful in the workplace, when i get out of college, or something that is easy and fun to tinker with. I know we all have our little ... | <p>Python. It's a dynamic scripting language, implemented via C, and boy is it powerful. I often use it to supplement other code, automate simple tasks, and develop mock-ups of more elaborate solutions which I would develop in another language, because it allows you to code a lot with very little.</p>
<p>Eric S Raymon... |
Python 3 doesn't read unicode file on a new server <p>My webpages are served by a script that dynamically imports a bunch of files with</p>
<pre><code>try:
with open (filename, 'r') as f:
exec(f.read())
except IOError: pass
</code></pre>
<p>(actually, can you suggest a better method of importing a file? I... | <p>Use <code>open(filename, 'r', encoding='utf8')</code>.
See <a href="http://docs.python.org/3.0/library/functions.html#open">Python 3 docs for open</a>.</p>
|
Calling the DescendantNodes without repeating each node <p>I have an xml that I would like to get all of its elements. I tried getting those elements by Descendants() or DescendantNodes(), but both of them returned me repeated nodes </p>
<p>For example, here is my xml:</p>
<pre><code><Root xmlns:xsi="http://www.w3... | <p>Well do you actually <em>want</em> all the descendants or just the top-level elements? If you only want the top level ones, then use the <a href="http://msdn.microsoft.com/en-us/library/bb342765.aspx"><code>Elements()</code></a> method - that returns all the elements directly under the current node.</p>
<p>The prob... |
Editing multiple entries in Jabref <p>Is there a way to edit multiple Jabref entries? E.g. add the same data to an empty field, like "keywords", of multiple files?</p>
| <p>Yes, there is. Select the entries you want to edit, then choose "Tools">"Set/clear fields" in the menu bar. This will bring up a dialog prompting what field and what value (also with a "clear" option). There's also a checkbox allowing you to set only the empty field to a certain value.</p>
|
Rails for ecommerce site <p>I was planning on using RoR for an upcoming e-commerce site but keep reading
comments that give the impression that this framework is not yet fit for this type of a commercial application.</p>
<p>What is the state of it? May it be used for large scale online stores etc?
Is compatibility an... | <p>Late answer... but I feel I should share some of the latest stuff available.</p>
<blockquote>
<p>Is compatibility and the frequently
changing framework an issue to worry
about?</p>
</blockquote>
<p>No. But it sounds like you are a beginner with Rails -- anyone starting a big e-commerce project should conside... |
Configuring one ear to call remote ejb3 on another ear in JBoss <p>I am new to EJB3 and am missing something when it comes to accessing a @Remote @Stateless bean deployed as an ejb module inside an ear file. I want to access a remote bean in lima.ear from soup.ear.</p>
<p>Here is what I am doing now (somewhat abbrevi... | <p>It looks like the JNDI properties need to be set as if it were a remote client outside of the app server because of the ear isolation we have setup.</p>
<pre><code> properties.put(Context.PROVIDER_URL, url);
InitialContext ctx = new InitialContext(properties);
</code></pre>
<p>Just specify the URL for the Initial... |
JQuery Autocomplete textbox on selected events <p>How do I fire another event after I have completed the selection on the textbox that has autocomplete. I want to show a valid div area based on the selected value.</p>
| <p>Assuming you're talking about jQuery UI autocomplete, then like this:</p>
<pre><code>$('#autocomplete').result(function(event, data, formatted) {
alert('Someone picked a suggestion from the drop-down');
});
</code></pre>
<p>That is to say, the "result" method fires.</p>
<p>See <a href="http://docs.jquery.com... |
C# Strategy Design Pattern by Delegate vs OOP <p>I wonder what's the pros/cons of using delegate vs OOP when implementing strategy design pattern?</p>
<p>Which one do you recommend to use? or what kind of problem does delegate solve? and why should we use OOP if OOP is better?</p>
<p>Thanks!</p>
<p>-tep</p>
| <p>Both techniques can be powerful and valuable - here are some of my opinions about when to use which.</p>
<p>Use an Interface/Implementation approach when the strategy:</p>
<ol>
<li>maintains state</li>
<li>needs configuration</li>
<li>uses dependency injection</li>
<li>needs to be configured by an IoC container (t... |
LINQ to SQL and DataPager <p>I'm using LINQ to SQL to search a fairly large database and am unsure of the best approach to perform paging with a DataPager. I am aware of the Skip() and Take() methods and have those working properly. However, I'm unable to use the count of the results for the datapager, as they will a... | <p>In situations like this I sometimes return the total record count as a field in my result set from the db.</p>
<p>Basically you only have the two options, write another query specifically for the count, or return it as column in the results.</p>
|
Simple databinding to gridview columns <p>I have a GridView that I use to show my users the result of a search. I want to allow them to choose which columns are shown on the GridView when performing their search. Simple enough, yes? I wanted to try doing this using <em>just databinding</em>, no events. Unfortunately, m... | <p>Probably because every time the grid is bound to the data, the column & settings are recreated (with-out your changes).</p>
|
C#: is calling an event handler explicitly really "a good thing to do"? <p>This question is related to C#, but may be applicable to other languages as well. I have a reservation against using code such as the following:</p>
<pre><code>using System.Windows.Forms;
class MyForm : Form
{
private Timer myTimer;
pr... | <p>This is definitely not a "personal preference". There is a clear, well-understood approach of how to write code that is well-structured, maintainable, reusable, and understandable. Each method in your code should encapsulate a single piece of reusable functionality. The structure of your code should be:</p>
<pre><c... |
Scrolling table overlaps section header <p>How can you have a <code>UITableView</code> where the header view remains stationary, but the rows don't overlap the section header? With my table, when scrolling the rows, the header is stationary, but when scrolling, the rows slide under the section name. Is it possible to... | <p>I updated the viewForHeaderInSection method to set the background color of the view to gray. Previously, it was clear, so the rows appeared to scroll underneath the section header. With the color change, the header remains in place and the rows don't show through. </p>
|
What could cause Shape.Cut to fail in Excel VBA? <p>I have a method in my macro that executes the following code:</p>
<pre><code>Set myDocument = Worksheets("sheet1")
For each sh in myDocument.Shapes
If sh.Name = "square" Then
sh.Cut
End If
Next
</code></pre>
<p>My problem is that the code causes an e... | <p>There's only two reasons to ever use the Select method. 1) You want to select something. 2) You're working with shapes and getting weird errors. It doesn't make sense, but try</p>
<pre><code>sh.Select
sh.Cut</code></pre>
<p>and I'll bet it will work every time.</p>
|
tracking daily changes, as a peon, in a clearcase shop <p>I am struggling with a perceived conflict between tracking all my changes so I can figure out where I broke the code yesterday, and having a controlled (high overhead) code review process that keeps things sane. <p>
I work in a very traditional ClearCase shop.... | <blockquote>
<p>All checkins require code review and I lack the authority to create private branches.</p>
</blockquote>
<p>We are using ClearCase too and have development branch (<em>not</em> a branch per developer!, but a branch for a "<strong><a href="http://stackoverflow.com/questions/16142#114384">development ef... |
iPhone OS Testing Best Practices <p>Not so long ago iPhone development was quite simple, only a few OS versions and even less devices. </p>
<p>Now however, there are 2 major OS versions and 5 different devices to consider.</p>
<p>As a company about to release several applications testing has been become more and more... | <p>In my experience, you won't have much compatibility trouble between iPod/iPhone. There are other gotchas to be aware of:</p>
<ul>
<li><strong>The devices run at different speeds.</strong> iPhone v1 and iPhone 3G run at 412MHz; iPod Touch runs at 532MHz, and the new 3GS runs at 600MHz. This can have a big impact ... |
Django : Timestamp string custom field <p>I'm trying to create a custom timestamp field.</p>
<pre><code>class TimestampKey(models.CharField):
__metaclass__ = models.SubfieldBase
def __init__(self, *args, **kwargs):
import time
kwargs['unique'] = True
kwargs['max_length'] = 20
kwargs['auto... | <p>Is it wise to use a timestamp as your primary key? If your database uses ISO 8601 or really any time format in which second is the smallest time interval... Well, anyway, my point is that you have no guarantee, especially if this is going to be a web-facing application that two entries are going to resolve within ... |
What is my script src URL? <p>Is there a simple and reliable way to determine the URL of the currently-executing JavaScript file (inside a web page)?</p>
<p>My only thought on this is to scan the DOM for all the script <code>src</code> attributes to find how the current file was referenced and then figure out the abso... | <p>Put this in the js file that needs to know it's own url.</p>
<p><strong>Fully Qualified</strong> (eg <code>http://www.example.com/js/main.js</code>):</p>
<pre><code>var scriptSource = (function(scripts) {
var scripts = document.getElementsByTagName('script'),
script = scripts[scripts.length - 1];
... |
Is this the correct way to call a textarea in jquery? <p>This syntax for some reason isn't working and I'm wondering why. When I alert the values in the page, I can see everything but the textarea value. I'm not even getting an undefined.</p>
<pre><code>var report = $("textarea#report").val();
</code></pre>
<p><hr /... | <p><strong>EDIT</strong></p>
<pre><code>var report = $("textarea#report").val();
</code></pre>
<p>should be working, however, if you're referencing it by id, then you don't need to use <code>textarea</code> as well</p>
<pre><code>var report = $("#report").val();
</code></pre>
<p>would be equivalent</p>
<p>Also, ... |
Encoding key-value pairs in an RSS feed's URL <p>I've noticed that most websites don't set up their RSS feed URLs to make use of encoded key-value pairs that let one create specific queries, like the following fictional example:</p>
<pre><code>http://stackoverflow.com/feeds?tag=python&lang=en&minvotes=2
</code... | <p>There is no technical reason. My company does this now with our news feeds.</p>
<p>I'd post a link, but it requires registration to see the feeds. We have urls like <code>.../feed.php?type=news</code>, etc.</p>
|
Setting the Time Zone with Compact Framework on Windows Mobile 6 <p>First, background: I have a .Net application that runs in kiosk mode on Windows Mobile 6 devices (IPAQ 210s). Our software actually tracks the user's time zone independently of the operating system, so we calculate the displayed time based on their ti... | <p>For whatever reason, the CF actually caches timezone info at startup (I think the full framework does too). So when you make changes to the timezone, the CF is unaware of those changes. If you use the GetSystem/LocalTime APIs, you'll get the right time but DateTime.Now will not reflect those changes.</p>
<p><a hr... |
sharepoint web service Maximum request length exceeded even if the file is inside the max file size <p>I have configured the web.config to allow 50 MB <code><httpRuntime maxRequestLength="51200" /></code>
but when I try to add an Atachment of 40MB to a sharepoint list it fails.
But it works if I increase the ma... | <p>A file that is uploaded via WSS 3.0 Web Services is actually put in the XML message itself. In order for that to happen it becomes <a href="http://msdn.microsoft.com/en-us/library/copy.copy.copyintoitems.aspx">Base64 encoded</a>. This will then increase the file size by 33% due to the nature of that <a href="http:/... |
What is the difference between WCF and the RIA Services Domain Service Class? <p>I'm just introducing myself to the basic differences between Silverlight 3 and it's predecessor. Looking at Domain Service Class within RIA services, the execution seems quite a bit simplified. Can someone explain the basic differences b... | <p>I recommend you read <a href="http://blogs.msdn.com/brada/archive/2009/03/19/what-is-net-ria-services.aspx" rel="nofollow">this blog article</a> which mentions that:</p>
<blockquote>
<p>Our thinking on the RIA Services work really grow out of the LINQ project a few years ago. LINQ integrates query semantics into... |
Difference in SHA hashes between ruby and C# <p>I'm developing an application, that makes use of some REST web services.
It's technical documentation says that I should pass SHA256 hash of some string in the request.</p>
<p>In an example request (in the documentation) a string:</p>
<blockquote>
<p>hn-Rw2ZHYwllUYkkl... | <p>Based on the document <a href="http://www.ooyala.com/api/OoyalaPartnerAPI.pdf" rel="nofollow">here</a>, you are missing a - (that is a dash) in your string. Seems that Acrobat helpfully removes it in a copy paste from the document...</p>
<p>Here is some code that I splatted together that gets the same value as the... |
Which method do I better use, when I need error reporting display control? <p>I want to manage error message display control,</p>
<p>and I Googled for a while,</p>
<p>and I found that there are several ways
to do it.</p>
<p>which method do I have to choose?</p>
<p>The thing I want to do is that</p>
<p>I don't want... | <p>It's best to log all errors to a file:</p>
<pre><code>error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 0);
ini_set('log_errors', 1);
ini_set('error_log', '/tmp/php_errors.log');
</code></pre>
<p>On unix, you can watch errors using this command:</p>
<pre><code>bash$ tail -f /tmp/php_errors.log
</code><... |
Access 2007: Filtering a report's results using a drop-down box <p>My question is twofold. </p>
<ul>
<li>I have around twenty assorted tables in a database. The table layouts are diverse; the one common thread is that all of them have a 'County' field. </li>
</ul>
<p>I need to set up a series of reports which allow a... | <p>You seem to be asking two questions, the last of which is clear to me, but the first is not. The second one is in regard to how to cascade the filter to the subforms. You can do this in one of two ways:</p>
<ol>
<li><p>put the form control reference as criterion in the recordsource of each subreport, OR</p></li>
<l... |
Are specific programming language skills and experience important in a job candidate? <p>This kind of relates back to the <a href="http://stackoverflow.com/questions/661088/">Specialist vs. Generalist questions</a>, which I know that <strong><a href="http://stackoverflow.com/questions/17903/18092#18092">Both</a></stron... | <p>Generally speaking, the fantastic generalist is more likely to gain specific domain knowledge quickly and have a better change of becoming a domain expert than a niche developer is in becoming a fantastic generalist. Also, it is not that the generalist will be better at thinking outside the box, but that the box wi... |
How to load subview from the main view? <p>I am very new to Obj-C and learning iphone development.
My question is how to add subview from app delegate.
Lets say I added subview called "MainView" from "applicationDidFinishLaunching" method.</p>
<pre><code>- (void)applicationDidFinishLaunching:(UIApplication *)applicati... | <p>well, you have to remove the original view first, before inserting the new subview, do it this way</p>
<pre><code>- (IBAction)showChildView:(id)sender {
if (self.childViewController == nil) {
ChildViewController *childController = [[ChildViewController alloc] initWithNibName:@"ChildView" bundle:nil];
... |
Easiest way to obtain database metadata in Java? <p>I'm familiar with the <code>java.sql.DatabaseMetaData</code> interface, but I find it quite clunky to use. For example, in order to find out the table names, you have to call <code>getTables</code> and loop through the returned <code>ResultSet</code>, using well-known... | <p>It's easily done using <a href="http://db.apache.org/ddlutils/">DdlUtils</a>:</p>
<pre><code>import javax.sql.DataSource;
import org.apache.ddlutils.Platform;
import org.apache.ddlutils.PlatformFactory;
import org.apache.ddlutils.model.Database;
import org.apache.ddlutils.platform.hsqldb.HsqlDbPlatform;
public voi... |
Java bytecode generation with generic signature information from reflect.Method <p>I am trying to bytecode generate a method signature from a java.lang.reflect.Method. The signature(generic type) part of it is tricky as the reflection api to get the type information and transform it into what asm needs is NOT straightf... | <p>I am not aware of a tool that does this automatically. I would probably use the <a href="http://asm.ow2.org/doc/faq.html#Q10" rel="nofollow">org.objectweb.asm.util.ASMifierClassVisitor</a> class to figure out the relationship between the signatures and the ASM API calls.</p>
<p>For a class containing this code:</p>... |
iPhone button images <p>I use fotolio.com for images in my iPhone apps. However, button images are always lacking in the SDK. Are there any good resources for iPhone button images? These are different from the large number of iPhone app icon images that are available everywhere.</p>
| <p>you mean like <a href="http://www.glyphish.com" rel="nofollow">www.glyphish.com</a> ?</p>
|
Best-practice for naming a WCF endpoint for an iis hosted service? <p>What is best practice for naming & hosting a WCF service endpoint in IIS?</p>
<p>Assuming an example scenario of:</p>
<ul>
<li>A service dealing with customer entities</li>
<li>A solution namespace of <code>Company.Entities.Customer</code></li>... | <p>I definitely prefer your cleaner suggestion, #2. It gives you shorter URL's, still has all the relevant info (which customer you're dealing with).</p>
<p>Suggestion #1 is okay because it's very clear and leaves no doubt about what you're dealing with, but it seems overly complicated, too long and gives you too much... |
Can I call an overloaded constructor from another constructor of the same class in C#? <p>Can I call an overloaded constructor from another constructor of the same class in C#?</p>
| <p>No, You can't do that, the only place you can call the constructor from another constructor in C# is immediately after ":" after the constructor.
for example</p>
<pre><code>class foo
{
public foo(){}
public foo(string s ) { }
public foo (string s1, string s2) : this(s1) {....}
}
</code></pre>
|
WCF: how to generate a single WSDL document, without WSDL:import? <p>I'm troubling into an issue...
I'm trying to find a way to generate a single wsdl document from my WCF service, i.e. without any link to external documents.
I've used <a href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/0e947743-2d0f-4a8d... | <p>You can now do this natively in .net 4.5 (beta). There is an option (?singleWsdl instead of ?wsdl) for telling the service to output everything in a single wsdl document. More info on the new stuff here: <a href="http://msdn.microsoft.com/en-us/library/dd456789(v=vs.110).aspx">http://msdn.microsoft.com/en-us/library... |
Add values to web.config in webservice <p>I Need add custom values to AppSettings in a webservice</p>
<p>i have this code, but nothing happens. </p>
<pre><code>procedure TWebService1.AddStrConn(KeyConn, ValueConn: String);
var
config : System.Configuration.Configuration;
begin
config:=ConfigurationManager.OpenExeCon... | <p>You are using OpenExeConfiguration, which is intended for *.exe.config. To open web.config, try something like </p>
<pre><code>Configuration cfg = WebConfigurationManager.OpenWebConfiguration("~");
</code></pre>
<p>It should allow you to save, provided your service has the privileges to do so.</p>
|
How can I get a change in resources to propagate throughout the application, including in ValueConverters? <p>I have an application that allows the user to change color schemes based on an external xaml file. When the user clicks on a MenuItem that contains the name of a theme, the following code executes:</p>
<pre><... | <p>It's hard to say without seeing all your code, but checking the <code>Resources</code> property does not automatically check merged dictionaries. Also, if you're merging the theme resources at the <code>Window</code> level then they won't be at the application level at all. For consistency sake, you're best off havi... |
Implementing a history feature à la Wikipedia <p>I am writing a Web application that has a user interface for editing documents. What is the best way to implement a history feature like Wikipedia's where edits to a document can be viewed?</p>
| <p>Well you will have to store the current document and archive changes to compare. Typically the main document is the one in the database then older versions on save are saved to another archive database or service.</p>
<p>Then you can pull the latest and the latest archived version and compare it with a diff algori... |
What technologies are suitable for building Queue Management Systems? <p>I figure out some technologies that can help me to build Queue Management Systems. Each terminal will send multicast to others. All the terminals get messaging in sync in real time. I'm not sure that do I really need a database server as backend o... | <p>I would say not. After all a database is just a store of data, you can achieve much the same using a binary datafile.</p>
<p>Still the technology that you use will depend on:</p>
<ol>
<li><p>Operating system</p></li>
<li><p>Network connection and type.</p></li>
<li><p>Terminal architecture e.g. local storage.</p><... |
How to create a DIV style switcher in JavaScript? <p>I want to make a CSS style switcher in JavaScript, same as digg.com does here: <a href="http://digg.com/add-digg" rel="nofollow">http://digg.com/add-digg</a></p>
<p>I am having a div, in which I want to change the style of the div box on the basis of theme selection... | <p>Inspecting the source code and how it changes as you change themes, it is really quite simple. Digg is harnessing the awesomeness of CSS to drastically change content by simply changing the class of an element. All you have to do is this:</p>
<pre><code><div id="theme_viewer">
<!-- HTML code for your widge... |
XML parsing Jquery <p>I have an XML file which has four <code><resultGroups></code> tag:</p>
<pre><code><resultGroups>
<subGroups>
<results> </results>
<results> </results>
</subGroups>
<name> </name>
</resultGroups>
</code>... | <pre><code>$xml = $(xmlString);
$('resultGroups', $xml).each(function() {
$('subGroups', this).each(function() {
var count = $('results', this).length;
// do whatever
});
});
</code></pre>
|
Best way to disable client caching <p>I'm using a simple servlet filter that forces the browser to skip caching for some server resources:</p>
<pre>
Cache-Control: private
Pragma:
</pre>
<p>This works fine in Internet Explorer but it doesn't works well with Firefox 3.0.10. I ended to write this code: </p>
<... | <p><a href="http://drupal.org/">Drupal</a> 6 does this (which works in every browser known by me):</p>
<ul>
<li><strong>Expires</strong>: Sun, 19 Nov 1978 05:00:00 GMT</li>
<li><strong>Last-Modified</strong>: Fri, 12 Jun 2009 08:01:46 GMT (the actual modification date)</li>
<li><strong>Cache-Control</strong>: store, n... |
Will setInterval drift? <p>This is a pretty simple question really. If I use <code>setInterval(something, 1000)</code>, can I be completely sure that after, say, 31 days it will have triggered "something" exactly <code>60*60*24*31</code> times? Or is there any risk for so called drifting?</p>
| <p>Short answer: No, you can't be sure. Yes, it can drift.</p>
<p>Long answer: John Resig on the <a href="http://ejohn.org/blog/accuracy-of-javascript-time/">Accuracy of JavaScript Time</a> and <a href="http://ejohn.org/blog/how-javascript-timers-work/">How JavaScript Timers Work</a>.</p>
<p>From the second article:<... |
Does CachedRowSet work with all ResultSet implementations? <p>I'm trying to implement a database paging solution (forward only required) using a <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/sql/rowset/CachedRowSet.html" rel="nofollow"><code>CachedRowSet</code></a> to page an <a href="http://publib.boulder.ibm... | <p>It sounds like your driver may not be JDBC 3.0 compliant, which is when rowsets were introduced to the API. The AbstractMethodError supports this.</p>
<p>Check your driver documentation to see which JDBC version it claims to support.</p>
|
Databound combo SelectedItem doesn't seem to work <p>I'm attempting to bind a combo to a collection of objects:</p>
<pre><code> Dim t As New TradeOrderStatus()
Dim ts As List(Of TradeOrderStatus) = t.GetStatuses
With Me.cboTradeStatus
.DataSource = ts
.SelectedItem = Nothing
End With
</... | <blockquote>
<p>Trade.TradeStatus is an instance of the class TradeOrderStatus</p>
</blockquote>
<p>You mention it is a class; is it the <strong>same</strong> instance as one of those in the data-bound list? It needs to find an equality match. Alternatively, you can override <code>Equals</code> (and <code>GetHashCod... |
How to dock the speedbar in Emacs? <p>Is there a way to dock the speedbar in Emacs?</p>
<p>Thanks.</p>
| <p>You could try SrSpeedbar: <a href="http://www.emacswiki.org/emacs/SrSpeedbar">http://www.emacswiki.org/emacs/SrSpeedbar</a></p>
|
Template in Django <p>Inline template</p>
<p>In my template can I use a <a href> tag? I want that if there is a field named 'id' it should give a href link over there. I have tried following options:</p>
<p>1){% ifequal field.field.label "Id" %}</p>
<pre><code><a href =../../{{field.field}}>click here &l... | <p>Use <code>{% url %}</code> instead of composing your own <code>href</code> values.</p>
|
How do I encrypt a string and get a equal length encrypted string? <p>My problem is the following:</p>
<p>In an existing database I want to encrypt data in a couple of columns.
The columns contains strings of different lengths.</p>
<p>I don't want to change the size of the columns so the encryption need to produce an... | <p>Within your constrants, I would use AES in <a href="http://en.wikipedia.org/wiki/Block%5Fcipher%5Fmodes%5Fof%5Foperation">CFB</a> mode, which turns it into a stream cipher and the output length will be the same as the input length. Unless you're storing the strings in blobs, you'll need to hex or base64 encode the o... |
OpenSocial and its usages <p>I have looked for some explanation on the exact usages for the set of standards known as OpenSocial.</p>
<p>I need some clarification if I can use OpenSocial like the following.</p>
<p>I would like to create one library used to community with an OpenSocial api for use in my website that w... | <p>Many OpenSocial containers (social networking sites) support REST and/or RPC methods which can be used to access friend lists, post activities, etc. Several client libraries have been written to work with these APIs (<a href="http://wiki.opensocial.org/index.php?title=Client%5FLibraries" rel="nofollow">http://wiki.... |
gitignore directory pattern ignores folder with same suffix, but I want to include it <p>I have the following directory structure:</p>
<pre>
src/
out/
cout/
...
</pre>
<p>and I want to ignore <code>out/</code> but not <code>cout/</code>.</p>
<p>I've tried putting <code>^out/</code>, but that doesn't seem to work. I... | <p>Exclamation mark(!) should precede a match which should not be ignored.</p>
<p>The <code>.gitignore</code> file should look like:</p>
<pre><code>out/
!cout/
</code></pre>
|
TFS MSBuild: $(ProjectDir) blank or random <p>I have a vcproj file that includes a simple pre-build event along the lines of:</p>
<pre><code>Helpertask.exe $(ProjectDir)
</code></pre>
<p>This works fine on developer PCs, but when the solution is built on our TFS 2008 build server under MSBuild, $(ProjectDir) is eithe... | <p>$(MSBuildProjectDirectory) worked for me</p>
|
Alternative to the visitor pattern? <p>I am looking for an alternative to the visitor pattern. Let me just focus on a couple of pertinent aspects of the pattern, while skipping over unimportant details. I'll use a Shape example (sorry!):</p>
<ol>
<li>You have a hierarchy of objects that implement the IShape interface<... | <p>You might want to have a look at the <a href="http://en.wikipedia.org/wiki/Strategy%5FPattern">Strategy pattern</a>. This still gives you a separation of concerns while still being able to add new functionality without having to change each class in your hierarchy.</p>
<pre><code>class AbstractShape
{
IXmlWrite... |
Removing the Apache TomCat runtime from a project in Eclipse? <p>I've got a project I've been building on Eclipse Ganymede targetted at tomcat 6.0, I've imported it into Europa and I need it to run on apache Tomcat 5.5</p>
<p>I can't find the reference to where the runtime is set to 6.0 to remove it. I've tried going ... | <p>When Eclipse is up and running, choose preferences from the window menu. Choose from the bar on the left: Server, Runtime Environments.</p>
<p>Click the button Add, choose the version you want.</p>
<p>To remove the 6.0 reference, goto the libraries tab.</p>
|
maven-war-plugin vs. "Unexpected end of ZLIB input stream" <p>im using maven-war-plugin and sometimes i get Unexpected end of ZLIB input stream when deploying to jboss, its because file is made in jboss directory and not moved/copied there, is there any way to fix it(using maven)?</p>
<p>my configuration:
<pre><code>
... | <p>Most likely what you have said is correct.</p>
<p>Maven is probably still building the war when jboss starts to deploy it, so as jboss is reading it, it sees an invalid zip format. You could try using the exploded option, or deploy separately after everything is built.</p>
|
Maven attempts to use wrong snapshot version <p>I'm trying to deploy the snapshot version of a 3rd party library to our local repo (for legacy reasons this is and old version which is no longer hosted at any online repo, and for the time being I can't replace it, hence I have to host it locally). </p>
<p>Now, I think ... | <p>The use case you have is fine. I believe the best practice recommended by the Maven folks is that once you are uploading a SNAPSHOT version of a jar to a shared repository, you should stop treating it as a SNAPSHOT, and instead as a release.</p>
<p>This makes sense because you want people to depend on <strong><em>t... |
Conditional Table Creation in MS-Access <p>Sqlite has the useful "create table if not exists" syntax.</p>
<p>Is there an equivalent in Access, or (as it looks) do I need to build a separate way of checking first?</p>
| <p>I think your question has already been answered here:
<a href="http://stackoverflow.com/questions/909371/access-create-table-if-it-does-not-exist">http://stackoverflow.com/questions/909371/access-create-table-if-it-does-not-exist</a></p>
|
creating multiple objects of UIImagePickerController <p>I want to give zoom effect to the iPhone camera image while capturing the photo. The zoom effect should be for particular part of the current image. This effect should be before capturing the image.</p>
<p>For the sample I create the two objects of UIImagePickerC... | <p>Since you only have one camera, I would expect only one UIImagePickerController to work in this case.</p>
|
Help with file upload in Java/J2EE <p>I need to upload a file using Apache fileupload with ProgressListener but alongwith that I also need to show the progressbar for the upload status.</p>
<p>Actual requirement is I just need to parse a local XML file parse the xml into appropriate objects and put them in Database. D... | <p>If you have access to the server side, I advise to debug the upload process. The exception suggests that you want to open the file on the server based on the uploaded file name. On your local machine this works, because it runs on the same file system. On the server side, the Apache FileUpload receives binary data, ... |
In jQuery, how do I select an element by its name attribute? <p>I have 3 radio buttons in my web page, like below:</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><label for="theme-grey">
<input t... | <p>This should do it, all of this is in the <a href="http://docs.jquery.com/Selectors/attributeEquals#attributevalue">documentation</a>, which has a very similar example to this:</p>
<pre><code>$("input:radio[name=theme]").click(function() {
var value = $(this).val();
});
</code></pre>
<p>I should also note you h... |
How can I determine which exceptions can be thrown by a given method? <p>My question is really the same as this one <a href="http://stackoverflow.com/questions/264747/finding-out-what-exceptions-a-method-might-throw-in-c">"Finding out what exceptions a method might throw in C#"</a>. However, I would really like to know... | <p>Following up to my previous answer, I've managed to create a basic exception finder. It utilises a reflection-based <code>ILReader</code> class, available <a href="http://blogs.msdn.com/haibo%5Fluo/archive/2006/11/06/system-reflection-based-ilreader.aspx">here</a> on Haibo Luo's MSDN blog. (Just add a reference to t... |
undefined reference to the shared library function <p>I have implemented a shared library in Linux and try to test it, but I get an error "undefined reference to `CEDD(char*)'".</p>
<p>I use Eclipse with following parameters:</p>
<ul>
<li>Path to include files (here is
everything ok) </li>
<li>Path to the library
and... | <p>It's a linker error (although I don't think it usually includes the 'char*' bit), so it seems that it either cannot find your library or the library does not contain the function. The latter might also mean that it does contain the actual function, but with a different name; make sure both projects a compiled as C a... |
AudioQueueOfflineRender questions <p>I have a few questions about this after reading the iPhone documentation on it:</p>
<ol>
<li>Does this take the audio being played and save it to a buffer so it can be written to a file?</li>
<li>If so does the audio being played have to be played using a playback audio queue or ca... | <ol>
<li>Yes</li>
<li>Pretty sure you need to use a/the playback audio queue.</li>
<li><a href="http://developer.apple.com/iphone/library/qa/qa2009/qa1562.html" rel="nofollow">This</a> Apple QA points to a file called aqrender.cpp which implements point 1.</li>
</ol>
|
calling jquery from ajax page <p>I'm having trouble using jQuery with child page</p>
<p>parent.html loads child.html like so: ie user clicks </p>
<pre><code><a href="#" id="n-email">
</code></pre>
<p>JQuery</p>
<pre><code>$('a#n-email').click(function() {
$.ajax({
type: "GET",
url: "/scripts/conta... | <p>First, you need to put a callback function in the jQuery ajax using the success property.
Second, you cant just put javascript en a html element. That just doenst work. You could try using eval.
Try this code as a start:</p>
<pre><code>$('a #n-email').click(function() {
$.ajax({
type: "GET",
... |
why IExtenderProvider Properties are lost in Designer in C# window appliaction? <p>I have created a IExtenderProvider (Extender) for Controls.using Extender ,I am Iterating the collection of controls and validate it.It works fine.but, some time while changing some designs,or when designer refreshed (while removing some... | <p>This sometimes happens when there is an exception in the Extender. If this happens, you will need to debug your extender in design-time. I had to do this several times today. Check out <a href="http://msdn.microsoft.com/en-us/library/ms996457.aspx" rel="nofollow">Debugging Design-Time Controls</a>, it should get you... |
Use a conditional value in a Reporting Services dataset for debugging <p>In the SQL queries for my reporting services datasets, I'd like to be able to use the following pattern:</p>
<pre><code>-- Used to enable/disable diagnostic statements
declare @DEBUG bit
set @DEBUG = 0
-- Get current date/time.
declare @now date... | <p>Does the column set vary with @debug?</p>
<p>If the database is SQL Server, you might try the fmtonly kludge:</p>
<pre><code>declare @fmtonlyon bit
select @fmtonlyon = 0
if 1 = 0 select @fmtonlyon = 1
if @fmtonlyon = 1 set fmtonly off
/* query body */
if @fmtonlyon = 1 set fmtonly on
</code></pre>
<p>It forces ... |
C++ - How can I extract a valid string within a string? <p><strong>The Problem:</strong> I am trying to extract a valid game mode for Defense of the Ancients (DotA) from a game name using C++.</p>
<p><strong>Details:</strong></p>
<ul>
<li>Game names can be, at most, 31 characters long</li>
<li>There are three game mo... | <p>Create bool arrays which replicate the tables you've put into comments. Except instead of an "X" or blank put "true" or "false" (so "true" means the combination of modes is valid and "false" means invalid).</p>
<p>Use this table to lookup whether the combination is valid:</p>
<pre><code> bool IsSecondaryValidWithP... |
consecutive <li> classes <p>I have trouble finding an expression to automatically generate a new 'class' like the following:</p>
<pre><code><ul>
<li class="img1">link</li>
<li class="img2">link</li>
<li class="img3">link etc...</li>
</ul>
</code></pre>
<p>This is nested... | <p>If it's numbered would you not use an ordered list? <code><ol></code>.</p>
<p>Or maybe I'm missing a point here. Are you using a higher level language to create this html? or tool?</p>
|
Do you really need a Text attribute in an ASP.NET Label? <p>What is the difference between the following? </p>
<pre><code><asp:Label runat="server">Hello World</asp:Label>
<asp:Label runat="server" Text="Hello World"></asp:Label>
</code></pre>
<p><hr /></p>
<p><strong>UPDATED:</strong></p... | <p>They will render the same in your final HTML. However the <code>Text</code> attribute is useful for programmatically setting the displayed text in your code behind.</p>
|
How do I attach a process to the debugger in Visual Studio? <p>I know I can start a process in code with <code>Process.Start()</code>.
Is it also possible to attach the debugger to that process? </p>
<p>Not from code <em>per se</em> , but just a way to do it?</p>
| <p>You can <a href="http://msdn.microsoft.com/en-us/library/ms228818.aspx">attach to a running process</a> using <code>Tools | Attach to Process</code>. If it's a Web Application, you can attach to it by attaching to <code>aspnet_wp.exe</code> or <code>w3wp.exe</code>.</p>
<p>To answer your question on how to attach ... |
Language to write a Windows application that doesn't take up a lot of space <p>I need to write a Windows XP/Vista application, main requirements:</p>
<ul>
<li>Just one .exe file, without extra runtime, like Air, .Net; posstibly a couple of dlls.</li>
<li><strong>Very small file size</strong>.</li>
</ul>
<p>The applic... | <p>You can try: C++ w/ MFC. That's really going to be the only way you can seriously control the 'size' of your application (though why is that a constraint?).</p>
<p>If you want even lighterweight, you can try the <a href="http://en.wikipedia.org/wiki/Windows%5FTemplate%5FLibrary" rel="nofollow">Windows Template Lib... |
How to extract the embedded attachment name from this email? <p>My regex skill is... bad. I have this email body.</p>
<pre><code>Hello World
[cid:image002.png@01C9DEDD.67C237D0]
Hello World
[cid:image002.png@01C9DEDD.67C237D0] [cid:image002.png@01C9DEDD.67C237D0]
Hello World
</code></pre>
<p>And what I need is an... | <p>I think you can just change the expression to this:</p>
<pre><code>"/\[cid:(.*?)\@/"
</code></pre>
<p>To make the match non-greedy.</p>
<p>Here are a couple of tools you can use to test your expressions:</p>
<ul>
<li><a href="http://gskinner.com/RegExr/">http://gskinner.com/RegExr/</a></li>
<li><a href="http://w... |
Using pysmbc to read files over samba <p>I am using the python-smbc library on Ubuntu to access a samba share. I can access the directory structure fine, I am however not sure how to access actual files and their content. The webpage (https://fedorahosted.org/pysmbc/) doesn't mention any thing, the code is in C/C++, wi... | <p>I also have had trouble using smbfs (random system lockdowns and reboots) and needed a quick answer.</p>
<p>I've also tried the <code>smbc</code> module but couldn't get any data with it. I went just as far as accessing the directory structure, just like you.</p>
<p>Time was up and I had to deliver the code, so I ... |
Unity/Spring or System.Configuration for configuration? <p>If you are already using Unity as a part of your project, is there any sense in bothering with writing traditional configuration classes?</p>
<p>Doing so seems like it's extra work, but the positives would be more domain specific XML tag names and more concise... | <p>It depends. Of course. :-)</p>
<p>What is the purpose of your configuration file, and more importantly, who is the intended audience? Who will be reading or editing the configuration file later?</p>
<p>If the main purpose is to wire up the application, and it's aimed at developers, and your types are reasonably we... |
How to place a form in help-requested mode? <p>A .NET Windows form can have a help button on the title bar when the HelpButton property is set to true (and you are not displaying minimize/maximize buttons). When this help button is clicked, the form goes into a help mode where the cursor changes and clicking elsewhere... | <p>Found it.</p>
<pre><code>[DllImport("user32.dll")] private static extern int SendMessage(IntPtr hwnd, int msg, IntPtr wp, IntPtr lp);
private const int WM_SYSCOMMAND = 0x112;
private const int SC_CONTEXTHELP = 0xf180;
private void button1_Click(object sender, EventArgs e) {
button1.Capture = false;
SendMessage... |
How to change image permission mode to 777 using Java code? <p>I want to give permissions mode value "777" to image file using Java code. How can I give that using Java? Because I can't delete the image with default permission mode "664". </p>
| <p>You can use the 'exec' method to run an external command to do the chmod.</p>
<pre><code>Runtime.getRuntime().exec( "chmod 777 myfile" );
</code></pre>
|
Flex: How do you import a .zip project? <p>Whenever you view a flex app and go to view source you can download a zip of the flex app. Once you do that how do you import it? I went to flex>import and I get to options import archive file I pointed that to the zip and it says its not a valid archive file. so I tried the o... | <p><a href="http://joelhooks.com/examples/pipemachine/srcview/" rel="nofollow">Here is one of my recent projects</a> that imports directly. It really depends on how the author exported it. If it isn't exported properly, then you will need to do the extra work to get it into Flex/Flash Builder. </p>
<p>If the project w... |
Rails Exception notifier is not working <p>I installed the exception notification plugin from <a href="http://github.com/rails/exception_notification/tree/master" rel="nofollow">http://github.com/rails/exception_notification/tree/master</a></p>
<p>I can confirm that my ActionMailer is working as I received emails from... | <p>The problem been addressed, <a href="http://groups.google.com/group/rubyonrails-core/browse_thread/thread/eaf210a7d099ad57" rel="nofollow">http://groups.google.com/group/rubyonrails-core/browse_thread/thread/eaf210a7d099ad57</a></p>
<p>I just copied the plugin from a old project, and it works fine straightaway.</p>... |
PHP fseek() equivalent for variables? <p>What I need is an equivalent for PHP's <code>fseek()</code> function. The function works on files, but I have a variable that contains binary data and I want to work on it. I know I could use <code>substr()</code>, but that would be lame - it's used for strings, not for binary d... | <p>Kai:</p>
<p>You have almost answered yourself here. Streams are the answer. The following manual entry will be enlightening: <a href="http://us.php.net/manual/en/wrappers.data.php">http://us.php.net/manual/en/wrappers.data.php</a></p>
<p>It essentially allows you to pass arbitrary data to PHP's file handling fun... |
Cross platform patching <p>I have a program that I intend to install on Linux and Windows machines. I have it cross-compiling fine (with autotools), but at some point I would like the program to be able to update its binaries. The only ways I can think of doing this are:</p>
<ul>
<li>Give users write access to "C:\Pro... | <p>You need to give us more details on what you are trying to do - I don't understsand the link between cross platform, patching and your question.</p>
<p>If you need to be able to auto update the program, on linux at least, the best solution is to provide a binary package (rpm, deb, whatever, depending on your target... |
how to pass string array from C/C++ dll to vba (Excel) <p>how to pass string array from C/C++ dll to vba (Excel)</p>
<p>dll in Visual Studio</p>
<p>dll is not managed, ATL, etc.</p>
<p>regards
Andy</p>
| <p>Microsoft wrote a whitepaper many years ago detailing some best practices for writing DLLs to use with VB5/VB6, which of course would also apply to VBA. It is reprinted with permission, and available in the original Word form, here:</p>
<p>Microsoft: Developing DLLs for VB5
<a href="http://vb.mvps.org/tips/vb5dll.... |
array of events in C#? <p>basically:</p>
<pre><code>public delegate void RecvCommandHandler (ChatApplication sender, byte[] content);
event RecvCommandHandler[] commands = new RecvCommandHandler[255];
</code></pre>
<p>I want to activate a different method/function for each command number, but I am really uncertain of... | <p>There's really no concept of an array of events - it's like talking about an array of properties. Events are really just methods which let you subscribe and unsubscribe handlers. If you need to be able to do this by index, I suggest you just have a pair of methods. (<code>AddCommandHandler(int, RecvCommandHandler)</... |
Correct way to alloc/init instance variables in Objective-C? <p>I was looking at some sample code on Jeff LaMarche's excellent <a href="http://iphonedevelopment.blogspot.com/" rel="nofollow">blog</a> when I came across the following:</p>
<pre>
- (void)applicationDidFinishLaunching:(UIApplication*)application
{
CGR... | <p>Does he create a custom setter for the <code>controller</code> instance variable?</p>
<p>If so, there may be code which is called when the <code>controller</code> variable is changed through the setter. Merely setting the <code>controller</code> variable with:</p>
<pre><code>controller = [[GLViewController alloc] ... |
Adding rspec test for library module doesn't seem to pickup Expectations and Matchers <p>I'm adding more rspec testing to my app and would like to test a ScoringMethods module, which is in /lib/scoring_methods.rb. So I added a /spec/lib directory and added scoring_methods_spec.rb there. I required spec_helper and set... | <p>You should include your test block in an "it" block. For example:</p>
<pre><code>require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe ScoringMethods do
describe "should have scorePublicContest method" do
it "should have a scorePublicContest method" do
methods = ScoringMethods... |
UpdateSourceTrigger=PropertyChanged and Converter <p>I have a simple <code>Converter</code> that adds a "+" symbol to a positive number that is entered in a <code>TextBox</code>. When the number is entered I want to initiate some action, but I don't want to wait until the <code>TextBox</code> loses focus: I want to upd... | <p>Agree w/Kent B, you need to post your Converter code.</p>
<p>I've been able to get part 1 to work with a simple converter (I'm binding a second unconverted TextBlock to show that the value is indeed getting updated).</p>
<p>However, if I understand your part 2, you're trying to get the <strong>TextBox</strong>'s t... |
How do I call a RemoteObject method from ActionScript? <p>What's the ActionScript equivalent of this MXML?</p>
<pre><code><mx:RemoteObject id="Server" destination="Server" source="gb.informaticasystems.Server" fault="handler_backendCommunicationFails(event)" >
<mx:method name="executeQuery" result="handler_... | <p>You just need to call:</p>
<pre><code>Server.executeQuery(...);
</code></pre>
<p>After it executes, you handle the result in your handler, which you specified as:</p>
<pre><code>private function handler_fetchDataRequestSuccess(event:ResultEvent);
</code></pre>
<p>EDIT: Let me translate the MXML:</p>
<pre><code>... |
How can I have a CSS style different for IE6? <p>I want to have a particular CSS style different for IE6. Basically I am using CSS sprites with a PNG file. But for IE6 I want to use the .gif version.</p>
<p>I dont want to use the <code><!-- if lte IE6</code> statement. I want to include it within my CSS file itself... | <p>If you don't want to use conditional comments, then you can use the * html hack:</p>
<pre><code>h1 {
color: green;
}
* html h1 {
color: red; /* this will only be applied by IE 6, 5.5, 5, and 4 */
}
</code></pre>
|
jQuery round corner code for IE8 in standards mode? <p>I need a solution for round corners using javascript with or without jQuery in IE8 standards mode.</p>
| <p>This seems to <a href="http://roundcorners.avinoam.info/#Home">work</a> in ie8 :</p>
<p>try it...</p>
<p>Update 11-10-2010:
You can also try to include PIE.HTC and call that from your stylesheet. for more information see the <a href="http://css3pie.com/">CSS3PIE</a> website. It is a much better solution!</p>
|
Need advice on using Grails and Ajax to append to a div like in Rails <p>I'm just starting out in Grails and need some advice on using Ajax. I want to append some html to the bottom of a div inside a form. This is basically what I have:</p>
<pre>
-form-
-div id="listOfchildren"-
childrow 1 input fields
childr... | <p>First, you need to add prototype.js to your header of the page, or if applicable to the header in your layout template:</p>
<pre><code><g:javascript library="prototype" />
</code></pre>
<p>Then instead of the a link use the remoteLink tag that comes with Grails:</p>
<pre><code><g:remoteLink action="ajaxy... |
Why is jQuery not inserting new html based on attribute selectors? <p>This is embarrassing, but here goes. Here's the page that I'm working on: <a href="http://www.mchenry.edu/administration/BoardSchedule.asp" rel="nofollow">www.mchenry.edu/administration/BoardSchedule.asp</a></p>
<p>I'm using jQuery ver. 1.3.1 and I'... | <p>I think that what you want to do is...</p>
<pre><code>$(function(){
$('table a[href$=.pdf]').after('<span class="FileInfo">PDF</span>');
});
</code></pre>
<p>Btw, why not to use just CSS instead?</p>
<pre><code>table .pdf:after, table [href$=.pdf]:after {
content: " PDF";
}
</code></pre>
|
How to iterate over a date range in PL/SQL <p>I need to write a report that generates summary totals against a table with date ranges for each record.</p>
<pre><code>table data:
option start_date end_date
opt1 6/12/2009 6/19/2009
opt1 6/3/2009 6/13/2009
opt2 6/5/2009 6/6/2009
</code></pre>
... | <p>You will need some sort of calendar to loop through a range of date. I have built one using the <a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11%5FQUESTION%5FID:40476301944675">connect by level</a> trick. You can then join the calendar with your data (cross join since you want a row even when there i... |
How do I get the markup of an element, including itself using jQuery? <p>I know I can wrap it's .html() in a tag, but the element itself has a dynamically set id, class, etc. How do I get jQuery to return the element's markup including itself?</p>
| <p>This will work well:</p>
<pre><code>jQuery.fn.outer = function() {
return $($('<div></div>').html(this.clone())).html();
}
</code></pre>
|
Dynamically Change User Control in ASP.Net <p>I'm trying to create a web page that will display an appropriate user control based on the selected value of a drop down list.</p>
<p>Basically the page layout is this:</p>
<p><strong>Drop Down Selection</strong><br />
<strong><</strong> <em>User Control created based ... | <p>What you need to do is keep the last known value of the DropDownList in the Session. Then:</p>
<p><strong>OnInit:</strong></p>
<ul>
<li>Create whatever control is indicated by the saved value in the session</li>
</ul>
<p><strong>SelectionChanged Event</strong></p>
<ul>
<li>Remove whatever you created during OnI... |
WCF-The document was understood, but it could not be processed <p>I have a WCF service which i deployed on my test server. Trying to use it on my test project and I added a reference and I get this error</p>
<pre><code> The document was understood, but it could not be processed.
- The WSDL document contains links... | <p>Answer is here:
<a href="http://stackoverflow.com/questions/6673495/wcf-iis-server-configuration">WCF IIS server configuration</a></p>
<p>in short...
The problem was with WCF identity permissions. The identity that is used for the application pool that hosts the WCF service must have full NTFS permissions on the %W... |
Django, mod-wsgi, and daemon mode; problem "bash:fork:cannot allocate memory" <p>I would appreciate if someone can provide feedback or point me in the correct direction. I am unable to execute any terminal commands on a remote server when three django sites are running in daemon mode. I do not have a problem when I use... | <p>Well, running a server without a swap space (swap is usually not a file, but a hard disk partition on Linux) is a recipe for a disaster. Adding one would almost certainly fix your problem.</p>
<p>Basically, it's not uncommon for what ever you have running on your server to allocate all the RAM available. To have yo... |
Is it possible to keep Visual Studio source control binding (to VSS2005) information in solution file (.sln) only and out of project files? <p>Basically, what I want to achieve, is to be able to have 2 separate solutions containing the same set of projects, but 1st solution needs to be bound to source control, 2nd - no... | <p>No.</p>
<p>It couldn't be the <strong>same</strong> set of projects - the files in a project are either source controlled or not, but you could have a non-source-controlled <strong>copy</strong> of a version retrieved from source control.</p>
<p>You could probably automate the process of removing source control bi... |
Visual similarity search algorithm <p>I'm trying to build a utility like this <a href="http://labs.ideeinc.com/multicolr">http://labs.ideeinc.com/multicolr</a>,
but I don't know which algorithm they are using, Does anyone know?</p>
| <p>All they are doing is matching histograms. </p>
<p>So build a histogram for your images. Normalize the histograms by size of image. A <strong>histogram</strong> is a vector with as many elements as colors. You don't need 32,24, and maybe not even 16 bits of accuracy and this will just slow you down. For perform... |
Should I invest in GraniteDS for Flex + Java development? <p>I'm new to Flex development, and RIAs in general. I've got a CRUD-style Java + Spring + Hibernate service on top of which I'm writing a Flex UI. Currently I'm using BlazeDS. This is an internal application running on a local network.</p>
<p>It's become ap... | <p>If you're committed to Spring and don't want to introduce Seam then I don't think that Granite DS will give you much beyond Blaze DS. There is a useful utility that ensures only a single instance of any one entity exists in the client at any one time but it's actually pretty easy to do that with a few instances of ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.