input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Watch a Database column to determine what is modifying <p>How do I find out what application or SP is modifing the values in a config table? I thought I had isolated the app that was responsible but these particular values keep chnging back to true when I keep modifying them to be false. </p>
| <p>First, create a logging table:</p>
<pre><code>CREATE TABLE modlog(
datestamp smalldatetime,
username varchar(255) NOT NULL DEFAULT SYSTEM_USER
);
</code></pre>
<p>Then create an UPDATE trigger on your table:</p>
<pre><code>CREATE TRIGGER mytable_mods ON mytable FOR UPDATE AS
INSERT INTO modlog(smallda... |
Uploading a file in a popup window <p>I'm using <strong>WatiN</strong> automation tool. I've got a scenario where I need to click on a button, which opens a pup-up from which I need to upload a file. I tried using <code>Fileupload</code> but it is not working, because the file selection window appears and closes immedi... | <p>Why don't you just set the field (that hold the path) without showing the pop-up, or clicking any buttons? All you need is get the text field Id & do something like:</p>
<pre><code>ie.TextField("Upload_File_Path_Field_ID")).Text = "D:\vinay\watin.zip";
</code></pre>
|
Postfix virtual: parent domain matches subdomains - I don't want it <p>I have my /etc/postfix/virtual file:</p>
<pre><code>sub.domain.com DOMAIN
@sub.domain.com user2
domain.com DOMAIN
@domain.com user1
</code></pre>
<p>The mail for @sub.domain.com still goes to user1 and that's not what I want.
Here's my /etc/postf... | <p>The right hand side of your virtual_alias_maps table is an unqualified username.</p>
<p>Postfix appends $myorigin to unqualified usernames, making it effectively</p>
<p>@sub.example.com user2@example.com
@example.com user1@example.com</p>
<p>Now user2@example.com is caught by the catchall for @example.com.<... |
Where is the best place to sanitize user input that will be output on a webpage? <p>In the MVC way of doing things, where is the best place to run, for example <code>htmlspecialchars()</code> on any input? Should it happen in the view (it sort of makes sense to do it here, as I should be dealing with the raw input thro... | <p>Well, that depends, doesn't it? You should sanitize everything you OUTPUT in the view. First, because sanitization depends on the format of your output. A JSON sanitized output is different than an HTML sanitized output, right? Second, because you never want to trust the data you have. It might have been compromised... |
How to add an onchange event to select tag in rails <p>How do I add an onchange event here?</p>
<p>Framework: rails<br>
Database: MySQL</p>
<p>I am populating the options from the database and that made me use <code>options_from_collection_for_select</code></p>
<pre><code>select_tag(:variable,options_from_collection... | <p><a href="http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M001698"><code>select_tag</code></a> takes an <code>options</code> hash as its final parameter, in which you can add any HTML attributes for the select. So to add an <code>onchange</code> attribute:</p>
<pre><code>select_tag :variable... |
InTime and OutTime for the modified date? <p>Using SQL Server 2000
Table</p>
<pre><code>CARDNO CARDEVENTDATE CARDEVENTDATE CARDEVENTTIME
ADJUSTED
0121 20090611 20090610 025050
0121 20090611 20090611 040000
0121 ... | <p>OK, I know it's going to be uggly, but you can do...</p>
<pre><code>SELECT CARDNO,
Min(CardEvenDateAdjusted),
Max(CardEvenDateAdjusted)
FROM (
SELECT CARDNO,
CARDEVENTDATE,
(1000000 * CAST (CARDEVENTDATE AS BIGINT) +
CAST (CARDEVENT... |
C# LINQ: What is the difference between a Pull model and a Push model? <p>I am currently reading Albahari's <a href="http://www.albahari.com/nutshell/" rel="nofollow">C# 3.0 in a Nutshell</a> book and on <a href="http://books.google.com.mt/books?id=%5FY0rWd-Q2xkC&pg=PA292&lpg=PA292&dq=c%23%2B3.0%2Bin%2Ba%2B... | <p>I am the client, I need something, <strong>pull</strong> it from the server.</p>
<p>I am the server, I have something, <strong>push</strong> it to the client.</p>
|
Point not in Rect but CGRectContainsPoint says yes <p>If I have a UIImageView and want to know if a user has tapped the image. In touchesBegan, I do the following but always end up in the first conditional. The window is in portrait mode and the image is at the bottom. I can tap in the upper right of the window and ... | <p>First, you get the touch with:</p>
<pre><code>UITouch *touch = [[event allTouches] anyObject];
</code></pre>
<p>Next, you want to be checking for the locationInView relative to your image view.</p>
<pre><code>CGPoint location = [touch locationInView:self]; // or possibly myimage instead of self.
</code></pre>
<p... |
mock problem <p>//IsExist always false,is it a bug?</p>
<pre><code> [TestMethod]
public void IsExist()
{
private Mock<IRepository> repository = new Mock<IRepository>();
Foo f = new Foo();
repository.Expect(s => s.IsExist(foo)).Returns(true);
var... | <p>Firstly, which mocking library are you using (the answer may change based on that)?</p>
<p>I know if you were using Rhino Mocks, the problem would be that your expectation is set up to return true when it receives that specific instance of <code>foo</code> that you create at the top. This is a different instance to... |
Why doesn't interceptor's onLoad() work? <p>We have a jboss based system</p>
<p>persistance.xml looks like a following:</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLoc... | <p>onLoad is only called if the object is being retrieved from the database and not the cache. if the object is already managed, then the onLoad is not called. You can test this by implementing PrepareStatement and seeing what its doing. What I do is implement all the methods and log them all when writing an intercep... |
Background image for navigation view <p>I am having problems with properly displaying background image of navigation view.
Here is the pic:</p>
<p><img src="http://i239.photobucket.com/albums/ff175/mlakilud/Picture3.jpg" alt="alt text"></p>
<p>Here is the code:</p>
<pre><code>- (id)initWithStyle:(UITableViewStyle)s... | <p>I do exactly this in my app. Within AppDelegate I have this code:</p>
<pre><code>@implementation UINavigationBar (CustomImage)
- (void)drawRect:(CGRect)rect
{
UIImage *image = [UIImage imageNamed: @"custom_nav_bar.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
... |
using Mysql Query Profiler to know the execution time of the queries and the performance in php script <p>I would like to use mysql query profiler in the php script. So that after i execute any queries it need to display the execution time of the query.</p>
<p>Suggest the best way to use this also share any other scri... | <h2>Before:</h2>
<p>You need to set the <code>profiling</code> to <code>1</code> before you execute your query in order to get access to the profiling information.</p>
<pre><code>mysql_query("SET profiling = 1");
</code></pre>
<h2>After:</h2>
<p>After you've executed the query you want to test you need to execute t... |
ASP.NET: Bind a value to a custom user control inside a repeater <p>I have an ASP.NET control that binds data to a repeater. Inside that repeater, I have another custom user control. I want to pass a value to this second control based on the current binding item.</p>
<pre><code><asp:Repeater runat="server" ID="Prod... | <p>I did a small test and I got it working if the ProductID is a string. After I changed it to and int in the usercontrol I got kind of the same problems.
I did a int.Parse in the datasource to the repeater and got it working again.
Check to see that the ProductId that you pass into the repeaters datasource is of type... |
Which is more efficient Cstr(value) or value.ToString() <p>I am wondering which is more efficient, using CStr() or object.toString().
The reason I ask this is because I though all that CStr() done was to invoke the .ToString() method on the object it was dealing with.</p>
<p>But when recently using a generic method wi... | <p>From <a href="http://www.techtalkz.com/vb-net/130907-cstr-vs-tostring-best-use.html">here</a> (couldn't say it any better):</p>
<blockquote>
<p>CStr is a keyword, whereas ToString is
a function (method). CStr is compiled
inline and it creates code depending
on the type of the passed object. It's
mainly th... |
kerberos from Java - getting a Subject for the currently authenticated user <p>We have a kerberos domain at my company and I'm running a few of the Java/Kerberos <a href="http://java.sun.com/javase/6/docs/technotes/guides/security/jgss/lab/part2.html">examples</a>. The question I have is around the login mechanism from... | <p>OK. So this turns out to be <strong>extremely easy</strong> assuming you know that the <code>keytab</code> file can be used instead of authentication. This is outlined a bit in the <a href="http://java.sun.com/j2se/1.4.2/docs/guide/security/jaas/spec/com/sun/security/auth/module/Krb5LoginModule.html">JavaDoc for Krb... |
Format an array of tuples in a nice "table" <p>Say I have an array of tuples which look like that:</p>
<pre><code>[('url#id1', 'url#predicate1', 'value1'),
('url#id1', 'url#predicate2', 'value2'),
('url#id1', 'url#predicate3', 'value3'),
('url#id2', 'url#predicate1', 'value4'),
('url#id2', 'url#predicate2', 'value5')]... | <p>Your dict of dict is probably on the right track. While you create that dict of dict, you could also maintain a list of ids and a list of predicates. That way, you can remember the ordering and build the table by looping through those lists.</p>
<p>using the <code>zip</code> function on your initial array wil give ... |
How to preserve Empty XML Tags after XSLT - prevent collapsing them from <B></B> to <B/> <p>Say I have a very simple XML with an empty tag 'B':</p>
<pre><code><Root>
<A>foo</A>
<B></B>
<C>bar</C>
</Root>
</code></pre>
<p>I'm currently using XSLT to remove a few ta... | <p>Ok, so here what worked for me:</p>
<pre><code><xsl:output method="html">
</code></pre>
|
Sharepoint: Image field with a link <p>I would like to add a field to a list with displays an Image, but acts as a hyperlink. In other words like the "Hyperlink or Picture" column, but "Hyperlink AND Picture" instead.</p>
<p>Where the two fields you input would be the URL to the image to display, and the URL of the hy... | <p>This can be done but you would need to develop a <a href="http://msdn.microsoft.com/en-us/library/ms446361.aspx" rel="nofollow">custom field type</a>. As you have found, SharePoint's default rendering for pictures is without the hyperlink. You need to change how the rendering behaves in Display mode in your own cust... |
Jquery and javascript height different to div <p>I have a container div around all the content in the site that dynamically stretches, have also got several other divs that stretch (all using the same method as 20 other sites I have).</p>
<p>Not matter what method is use with jQuery or JavaScript to get the height of ... | <p>What do you define as "height"? Are you wanting the borders and padding to be included in the calculation? Just padding? Borders, padding, <em>and</em> margins? </p>
<p>From what it sounds like, my hunch is saying you should be using the <code>innerHeight()</code> function:</p>
<pre><code>$(element).innerHeight();... |
Google indexed my test folders on my website :( How do I restrict the web crawlers! <p>Help Help! Google indexed a test folder on my website which no one save I was supposed to know about :(! How do I restrict google from indexing links and certain folders.</p>
| <p>Use a <a href="http://www.robotstxt.org/" rel="nofollow">robot exclusion file</a>, or better yet password protect your test areas! Using a robots.txt file to "protect" areas you don't want others to see is a little like hanging a sign on your back door saying <em>"I've left this open but please don't come in"</em> :... |
Finding control within WPF itemscontrol <p>Hi i have few a single textbox within the the datatemplate for itemscontrol. When i bind the itemcontrols to a observable collection i get two text boxes. But i need to do some manipulations based on each of the text boxes for which i want to find each textbox seperatly using ... | <p>Using the ItemContainerGenerator you can obtain the generated container for an item and traverse the visual tree downwards to find your TextBox. In the case of an ItemsControl it will be a ContentPresenter, but a ListBox will return a ListBoxItem, ListView a ListViewItem, etc.</p>
<pre><code>ContentPresenter cp = i... |
How to deploy my asp.net project in IIS? <p>I have windows 2003 server , and a asp.net project developed in VS2008 developer edition</p>
<p>how to deploy this website in the server?</p>
| <p>Would it not be easier to just use the Publish Website option in Visual Studio? Its under the Build Menu.</p>
<p>Ensure you have installed IIS and you can copy via Visual Studio all the relevant files associated with your site.</p>
<p>James.</p>
|
How to create a lightweight C code sandbox? <p>I'd like to build a C pre-processor / compiler that allows functions to be collected from local and online sources. ie:</p>
<pre><code>#fetch MP3FileBuilder http://scripts.com/MP3Builder.gz
#fetch IpodDeviceReader http://apple.com/modules/MP3Builder.gz
void mymodule_main... | <p>Since the C standard is much too broad to be allowed, you would need to go the other way around: specify the minimum subset of C which you need, and try to implement that. Even ANSI C is already too complicated and allows unwanted behaviour.</p>
<p>The aspect of C which is most problematic are the pointers: the C l... |
Is it true that the paragraph in Tree Menu of MSDN library is store in the database? <p>I was assigned to develop a website looks similar to <a href="http://msdn.microsoft.com/en-us/library/default.aspx" rel="nofollow">MSDN Library</a>. </p>
<p>According to MSDN Library, I have sense that their tree menu is updated in... | <p>It is sort of true, the following is from <a href="http://www.hanselman.com/blog/LowBandwidthViewAndOtherHiddenAndFutureFeaturesOfMSDN.aspx" rel="nofollow">Scott Hanselman's blog discussing msdn</a>:</p>
<blockquote>
<p>I figured there can't just be the
(loband) "switch" and I mentioned I
thought that having ... |
How to resolve the errror: "The underlying connection was closed"? <p>Does anyone know this problem:</p>
<blockquote>
<p>"The underlying connection was closed: An unexpected error occurred on
a receive."?</p>
</blockquote>
<p>How can we resolve this problem?</p>
| <p>yes, "the underlying connection was closed", or more precisely the browser was closed before the page loaded.</p>
<p>There's always the chance it's a real network level error (ie, bad proxy) but you don't provide enough detail.</p>
|
Possible core-data bug: attributes named 'updated' don't work correctly? <p>I have a Core Data entity called <code>Post</code>. One of it's attributes is called <code>updated</code> and it is a date. The stored XML looks like this:</p>
<pre><code><attribute name="updated" type="date">266164481.000000000000000000... | <p><code>NSManagedObject</code> already has a property called <a href="http://developer.apple.com/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSManagedObject%5FClass/Reference/NSManagedObject.html#//apple%5Fref/doc/uid/TP30001171-BBCHECJE"><code>isUpdated</code></a>, which is set to <code>YES</code> when th... |
Which of the following allows more than one statement to appear on a single text Line? <p>Which of the following allows more than one statement to appear on a single text
Line?</p>
<ul>
<li>a) Colon ( : ) </li>
<li>b) Semicolon ( ; ) </li>
<li>c) Space + Underscore ( _ ) </li>
<li>d) Underscore + space ( _ )</li>
</ul... | <p>The <a href="http://msdn.microsoft.com/en-us/library/aa712050%28VS.71%29.aspx" rel="nofollow">Visual Basic .NET Language Specification</a> shows that a <a href="http://msdn.microsoft.com/en-us/library/aa711981%28VS.71%29.aspx" rel="nofollow"><code>StatementTerminator</code></a> is either a <a href="http://msdn.micro... |
Finding the Uptime of a server programatically <p>Does anyone know of a way to programatically find the uptime of a server running Windows 2000? We have a service running on the machine written in VB.NET, that reports back to our server via a webservice.</p>
| <p>Another way is to use the performance counters from .NET e.g.</p>
<pre><code>Dim pc As PerformanceCounter = New PerformanceCounter("System", "System Up Time")
pc.NextValue() ' This returns zero for a reason I don't know
' This call to NextValue gets the correct value
Dim ts As TimeSpan = TimeSpan.FromSeconds(pc.N... |
Consistent hashcodes for dictionaries in c# <p>You would think that if two dictionaries contained the same keys and values they would return the same hash code? but they don't - how do i get two dictionaires to return the same hash code if they contains the same keys and values?</p>
<p>Thanks. Code sameple below - has... | <p>For reference types, hashcodes are defined based on the reference, not the object itself. The hadhcodes will only be the same if the two dictionaries point to the same object.</p>
<p>You could override the GetHashCode method in your own class, and re-code it to build a custom hash code based on the contents of the ... |
Update app.config system.net setting at runtime <p>I need to update a setting in the system.net SectionGroup of a .Net exe app.config file at runtime. I don't have write access to the original config file at runtime (I am developing a .Net dll add-in which is hosted in an exe provided by the app which I have no control... | <p>I did not understand from your question if you don't have access to the app.config file because of your own design implementation or you just weren't able to save the config file, so here is a piece of code that allows you to modify and save appSettings section in the config file at runtime:</p>
<pre><code>Configur... |
Creating a transparent corner PNG in .net <p>As part of a UI .net library I need to create corner PNG images to align to the corners of a DIV in order to give it rounded corners.</p>
<p>I thought I could create a dynamic corner by doing the following:</p>
<ul>
<li>Create a bitmap (Let's say 25 x 25)</li>
<li>Fill the... | <p>This works:</p>
<pre><code>Dim bmp As New Bitmap(25, 25)
Using g As Graphics = Graphics.FromImage(bmp)
g.Clear(Color.Transparent) 'This is the key point'
g.FillEllipse(Brushes.Red, New Rectangle(0, 0, 50, 50))
g.DrawEllipse(Pens.Black, New Rectangle(0, 0, 50, 50))
End Using
bmp.Save("C:\a\out.png", I... |
Is it possilbe to use attributes to automatically raise an event on a property change <p>I find myself writing this code a lot:</p>
<pre><code> private int _operationalPlan;
public int OperationalPlan
{
get
{
return _operationalPlan;
}
set
{
_o... | <p>To do that, you would need an AOP framework for .NET, like <a href="https://www.postsharp.net/aop.net" rel="nofollow">PostSharp</a> or <a href="http://sourceforge.net/projects/aopnet" rel="nofollow">AOP.NET</a></p>
|
How can I get the selected category id after 1st page in pagination? <pre><code><?php
include "includes/connection.php";
//$id=$_REQUEST['category'];
//$catid=mysql_escape_string($id);
$catid = isset($_GET['category']) ? (int)$_GET['category'] : 0;
$recordsPerPage =4;
# 0
// //default startup page... | <p>Do you pass though <code>category</code> in the request? You haven't given us that information (what is the value of <code>qstr</code> in the javascript?), but I'd guess not.</p>
<p>You're also passing it straight into an SQL query, which leaves you open to injection.<br />
You should use <a href="http://www.php.n... |
Silverlight DataGrid - Adding columns at runtime <p>I would like to be able to add / remove columns to my datagrid, based on UI inputs from the user.</p>
<p>Is this possible? Any good articles on this?</p>
<p>Thanks,
Mark</p>
| <p>Yes it is possible:</p>
<pre><code>// Candidates is the DataGrid
var newColumn = new DataGridTextColumn() { Header="New Column"};
Candidates.Columns.Add(newColumn);
Candidates.Columns.Remove(newColumn);
</code></pre>
|
How does jQuery affect CSS structure <p>Just re-entering heavy duty js and CSS world after a couple years working only in Flash and coming up to speed on jQuery. I'm designing some CSS/DIV-based layouts and will be depending on jQuery and AJAX for interactions.</p>
<p>As regards the CSS coding conventions and structur... | <p>Here's some <a href="http://www.artzstudio.com/2009/04/jquery-performance-rules/" rel="nofollow">jQuery performance rules</a> that gives some tips on how to set up ids and classes.</p>
|
Silverlight WebClient Progressive Download <p>I'm trying to progressively download an array of serialised data. The goal is to send a single large block from the server, and partially process it on the client whilst it downloads.</p>
<p>I'm using the System.Net.WebClient class and setting it's AllowReadStreamBuffering... | <p>Are you on IE and downloading <a href="http://bence-bmc.blogspot.com/2008/09/creating-http-streaming-client-in.html" rel="nofollow">less than 4kb of data</a>? IE won't give you the data until you have more than 4kb of it. After 4kb, you have all the granularity you need. Possible solutions:</p>
<ul>
<li>Send gar... |
Query two tables from different schema <p>I have two different schemas in Oracle (say S1, S2) and two tables in those schemas (say S1.Table1, S2.Table2). I want to query these two tables from schema S1.</p>
<p>Both S1 and S2 are in different databases. From DB1 - Schema S1, I want to do something like this,</p>
<pre>... | <p>You won't need a database link if the two schemas are in the same database.</p>
<p>Your query should work from schema S1, provided S1 has been granted the SELECT privilege on S2.table2 (from a dba account or from the S2 schema: <code>GRANT SELECT ON S2.Table2 TO S1</code>).</p>
|
Most effective way to decrypt data when encryption method is unknown? <p>I have a large amount of data that was encrypted by a third party tool before it was backed up, now we no longer have access to the tool and I <strong><em>NEED</em></strong> the data what is the most effective way to try and determine how the data... | <p>You <strong><em>NEED</em></strong> to get hold of the third-party tool that was originally used to encrypt the data.</p>
<p>If you can't get hold of the tool then you <strong><em>NEED</em></strong> information regarding the algorithms, keys etc that were used, preferably from the vendor.</p>
|
Circle Problem <p>I want to move circle in a circular path like knob tune.......
How could i do this?
can any one help me?...Thanks in advance</p>
| <pre><code>xcord = centerX+(radius*cos(theta))
ycord = centerY+(radius*cos(theta))
put the circle in (xcord,ycord)
increment theta by a small radian value.......
</code></pre>
|
How can I pass variables from JavaScript to PHP? <p>I am using jQuery to calculate prices. Here is a small snippet of my JavaScript:</p>
<pre><code>// Prices: radio
var curLam = "gloss";
$("input[name=lamination]").click(function(){
var gloss = 5;
var matt = 6;
if ($(this).val() == 'gloss' && curLam != 'glo... | <p>Generally speaking, you shouldn't return the selected price to the server. HTML forms can be easily faked. It is far safer to send the user's <strong>choice</strong> back to the server, which also knows how much it should cost.</p>
<p>Basically Javascript validation (which this essentially is) is convenient but sho... |
Why does compacting a Access 2000 db changes the order of records in a table? <p>As the question says. The table has no primary key defined. Other tables in the database do not change after compacting, and have as well no primary key defined.</p>
| <p>"If a primary key exists in the table, compacting re-stores table records into their Primary Key order. This provides the equivalent of Non-maintained Clustered Indexes, and makes the read-ahead capabilities of the Microsoft Jet database engine much more efficient."</p>
<p><a href="http://support.microsoft.com/kb/2... |
What the best Language to use when creating Windows Shell Context Menu? <p>I'm writing a app which integrates with windows shell and adds an additional context menu.
And am considering a couple of languages to write it in:</p>
<ol>
<li>MS .NET - I'd rather not use managed code for this type of app</li>
<li>win32asm - ... | <p>You want shell context applications to have small footprints. This rules out managed code at least for now. This may speak somewhat in favour of win32asm, although the C++ libraries aren't really all that large compared to the .NET runtime (less than a MB, all told, isn't that big these days)! </p>
<p>You want she... |
Where are memory management algorithms used? <p>There are a set of memory management algorithms used in operating system construction, like pagination, segmentation, paged segmentation (paginación segmentada), segment pagination (segmentación paginada) and others.</p>
<p>Do you know if they are used besides that are... | <p>These algoritms are for translating the program memory addresses onto the physical memory addresses. You will very rarely ever have to think of it in an application. In some extreme cases of applications working on very large datasets you may have to create a driver-like module to tune memory translation, but all th... |
How do I configure group policies using C#? <p>How can I manipulate group policy based restriction for the controlpanel and the taskmanager in C#?</p>
| <p>Have a look at WMI. Here is a link to an article on WMI Group policy objects: <a href="http://msdn.microsoft.com/en-us/library/aa375082%28VS.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa375082(VS.85).aspx</a> </p>
<p>This tool will generate example c# code for you:<br />
<a href="http://ww... |
How to force line wrapping in listings package? <p>I have a problem concerning the listings package in latex. I need to embed a source code of the following XML document <a href="http://www.sparxsystems.com.au/downloads/profiles/EP_Extensions.xml">http://www.sparxsystems.com.au/downloads/profiles/EP_Extensions.xml</a> ... | <p>I just had this problem...</p>
<p><code>breaklines</code> worked for me, though you do need to set it to true - the default is false:</p>
<pre><code>\lstinputlisting[style=Python,
caption=My Class,
label={mine.py},
breaklines=true,
]{../python/mine.py}
</code></pre>
<p>is pretty much what I used</p>... |
overlay a jpeg image with rich text using cute editor and GDI+ <p>I am attempting to create and store a jpeg image on the fly with dynamic rich text. The rich text is comes from user input into the cute editor for asp.net. This particular editor can output either xHTML or rtf and some others. I'm using GDI+ to open ... | <p>Use <a href="http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawstring.aspx" rel="nofollow">Graphics.DrawString()</a>?</p>
|
WPF Data virtualizing ListView <p>In our current WinForms app, we are displaying millions of records in ListView, using virtualization. Rows are loaded from DB as they are requested. This works well, with good performance. </p>
<p>This is a showstopper for migrating to WPF for us. We need data virtualization in a List... | <p>The article <a href="http://www.codeproject.com/KB/WPF/WpfDataVirtualization.aspx" rel="nofollow">WPF Data Virtualization</a> should be exactly what you are looking for, I just implemented it quite easily, and it works.</p>
|
ModalPopUpExtender with checkbox validation <p>I have an AJAX Application that I have been working on. At this point in the development - I have a modalpopupextender with a warning message and an OK and Cancel button. I have just been tasked with changing this to be three checkboxes and having the OK button disabled ... | <p>Three checkboxs would seem to work quite well if you ask me.. you can have each check box run the same validation function to check on the other 2. Also, i have found that using 'this.disable=true' would work quite well for what you are trying to accomplish. This way everything is handled under JS and there is no ne... |
A link isn't working in IE6 <p>I'm working on the following page: <a href="http://jlecologia.com/index.php" rel="nofollow">http://jlecologia.com/index.php</a></p>
<p>I want the <em>whole</em> block at the left to be clickable. In Firefox it's fine, but in IE6 the cursor doesn't even change to a hand. Any ideas?</p>
| <p>I'd recommend that you move the block styling (like you're doing with the LI) to the actual link itself. So for example (copied from your stylesheet)...</p>
<pre><code>#left ul li {
float: left;
list-style-type: none;
}
#left ul li a {
width: 100%; /* You might not need this */
margin-top: 40px;
... |
What are the differences between WCF and traditional ASP.NET Web <p>I am new to WCF and Web Services in general. What are the improvements that WCF brings to the table? Can anyone give a side-by-side example of a traditional web service and the same one written using WCF and point out the differences and advantages?<... | <p><strong>EDIT</strong>: Think i found the answer you where looking for a side-by-side code based comparison and even better it's from MSDN: <a href="http://msdn.microsoft.com/en-us/library/aa738737.aspx">Comparing ASP.NET Web Services to WCF Based on Development</a></p>
<p>There are several related questions:</p>
<... |
Can Windows drivers be written in Python? <p>Can Windows drivers be written in Python?</p>
| <p>Yes. You cannot create the "classic" kernel-mode drivers. However, starting with XP, Windows offers a <a href="http://www.microsoft.com/whdc/driver/wdf/UMDF.mspx">User-Mode Driver Framework</a>. They can't do everything, obviously - any driver used in booting the OS obviously has to be kernel-mode. But with UMDF, yo... |
Accessing ASP.NET membership stored procedures from classic ASP page <p>I have a classic asp site that requires login functionality. There is an ASP.NET administrative site where logins will get set up. I'm thinking about using ASP.NET Membership to manage/store the login information, and on my ASP site access the da... | <p>The ASP.NET membership provider already builds the Stored procedures for you. If you can access the DB where the membership is setup, you can directly access those stored procedures.</p>
<p>EDIT: Found the articles I used when I did this.</p>
<p><a href="http://forums.asp.net/p/1197121/2080025.aspx#2080025" rel=... |
WinForm designer and right snapline for controls in container when resizing it <p>Using Visual Studio 2008 WinForm designer, I have a container (form, panel, groupbox, whatever) and some controls in it.</p>
<p>The container is set to not automatically resize or dock in any way. When placing a control in the container ... | <p>The designer will only show the snap lines when moving a child control within a container. You can demonstrate it by moving a GroupBox around a Form and see that it shows snap lines when the GroupBox gets close to the edge of the Form, but if you were to resize the Form you won't see the snap lines appear.</p>
<p>I... |
Instantiate an object with a runtime-determined type <p>I'm in a situation where I'd like to instantiate an object of a type that will be determined at runtime. I also need to perform an explicit cast to that type.</p>
<p>Something like this:</p>
<pre><code>static void castTest(myEnum val)
{
//Call a native func... | <p>There are several ways you can create an object of a certain type on the fly, one is:</p>
<pre><code>// determine type here
var type = typeof(MyClass);
// create an object of the type
var obj = (MyClass)Activator.CreateInstance(type);
</code></pre>
<p>And you'll get an instance of MyClass in obj.</p>
<p>Another ... |
What happens if a throw; statement is executed outside of catch block? <p>In C++ <code>throw;</code> when executed inside a catch block rethrows the currently caught exception outside the block.</p>
<p>In <a href="http://stackoverflow.com/questions/980149/several-catch-blocks-or-one-with-dynamiccast/980347#980347">thi... | <p>From the Standard, 15.1/8</p>
<blockquote>
<p>If no exception is presently being handled, executing a <em>throw-expression</em> with no operand calls <code>std::terminate</code>().</p>
</blockquote>
|
Use currently logged-in user in query <p>I am using VisualWebDeveloperExpress2008 with Access as the membership provider.</p>
<p>I have some cases where I want users to edit their own data. This would involve a query where the UserId should equal the UserID of the user who is using the site.</p>
<p>I am expecting to... | <p><strong>User.Identity.Name</strong> should provide you the username of the logged in user.</p>
<p>Now, to get the UserID you will need to check it in the database using the username. Or you can make it so that the select statement uses the username instead.</p>
|
Visual Studio 2008 SignTool.exe not found <p>I can't publish in 2008, I was previously using 2005 and it published just fine.</p>
<p>Error 2 An error occurred while signing: SignTool.exe not found.</p>
<p>I know there are tons of hits for a search on signtool.exe on google. The ones I've found involve copying the f... | <p>This may help some one else....
I got round this problem by going to the signing tab and unchecking the Sign The ClickOnce Manifests option and now it works...</p>
<p>I guess that doesn't FIX the problem..but it gets around it allowing you to publish your application with out the Signtool.exe File.</p>
|
Setting Label and StaticText Color property problem - Delphi 2009 <p>When I set the <strong>Label</strong>'s color e.g. on value <strong>clRed</strong>, the red on it only blink for a while. The color property still has clRed value, but in fact it has default <strong>clBtnFace</strong> color.</p>
<p><a href="http://im... | <p>Do you mean a <code>TLabel</code> or a <code>TPanel</code>? Your screenshot shows a label, but it should work for both components.</p>
<p>Make sure that the <code>ParentColor</code> property is set to <code>false</code>.</p>
|
Declaring Known Types for data contracts in different assemblies <p>I have a method in a WCF service which returns a complex type (myComplexResult), which includes as one of its members a List (Of Common.myBaseClass). I want this list to hold items which can variously be of type Foo.myClass1 and Bar.myClass2, both of ... | <p>My fault. I've re-tried and both of the solutions I posted above actually do work. I think this is a case of simply not updating the service reference on my test project before running the test - whoops!!!</p>
|
C#: No implict conversion from Class<Child> to Class<Base> <p>Following snippet wouldn't compile. With following error:</p>
<blockquote>
<p>Cannot implicitly convert type 'Container<ChildClass>' to 'Container<BaseClass>'</p>
</blockquote>
<pre><code>class BaseClass {}
class ChildClass : BaseClass {}
cla... | <p>(made wiki, in case of dups)</p>
<p>C# (3.0) doesn't support covariance of lists etc. C# 4.0 will support <strong>limited</strong> [co|contra]variance, but <a href="http://marcgravell.blogspot.com/2009/02/what-c-40-covariance-doesn-do.html" rel="nofollow">still not lists</a>.</p>
<p>The problem is that with:</p>
... |
Having trouble rendering xhtml to page <p>I am trying to render xhtml from cute editor output to display rich text in my page. I'm trying this but it doesn't seem to be working for me.</p>
<pre><code>//ce_Document is my instance of cute editor
public void btn_SaveMessage_Click(object sender, EventArgs e)
{
XhtmlT... | <p>Looks like you're rendering your text directly to the recycle bin (TextWriter.Null)</p>
<p>You should write to the output stream of the response you're generating. Try this (don't know if it compiles)</p>
<pre><code>XhtmlTextWriter xtw = XhtmlTextWriter(new TextWriter(Response.OutputStream));
</code></pre>
|
Windows Workflow: "singleton"-style workflow? <p>I have a workflow that will watch certain databases and kick off other workflows when it notices a trigger. I only want one instance of this "observer" workflow to be going at any point in time; otherwise, if two or more were running, they'd both notice the change and bo... | <p>I'm considering this problem as well for a project I'm currently working. However it seems to me that the function of monitoring the DB is not the responsibilty of the workflow.</p>
<p>We're going to create a Service to add to the runtime. This service will raise events that the workflow listens for in the Handle... |
TouchXML parsing XML attributes <p>How do I use touchXML to parse this XML? I want to store all the attributes as key/value pairs in a dictionary.</p>
<p></p>
<pre><code><Player PlayerName="Padraig HARRINGTON" CurrentPosition="1" CurrentRank="1"
Country="IRL" NumberOfHolesPlayed="18" ParRelativeScore="+3">
... | <p>For more information <a href="http://sugartin.info/2011/12/16/multilevel-parsing-using-dom-parser-touchxml/">visit this post </a>. I have given complete brief about it.</p>
<p>Yep ! solved your problem.</p>
<p>see, following code. Hope you understand.
It's working for your requirement. I also have added - NSLog - ... |
Read from console process <p>I have a process, i can start, and hide working fine, but i want to read from the console program, when i runs, not after, i tried to run a timer, anbd read at the tick, but my program just crashes and when it not do, i get nothing at all.</p>
<pre><code> startInfo= new ProcessStartInfo(... | <p>The problem is that you're running on one thread and trying to write using another. When you created your background thread using the Timer's tick event, it can't have frontend user input.</p>
<p>Perhaps if you explained the big picture of what you're trying to accomplish, we can better help you.</p>
<p>In the me... |
Is it useful in C# to apply DeMorgan's theorem to manually optimize boolean expressions in conditional statements (e.g. if conditions) <p>Back in the day when I did most of my work in C and C++, as a matter of course, I would manually apply <a href="http://en.wikipedia.org/wiki/De%5FMorgan%5Ftheorem">deMorgan's theorem... | <p>On processors this fast, it's virtually impossible for rearranging boolean expressions to make any actual difference in speed. And the C# compiler is very smart, it will optimize it as well. Optimize for readability and clarity!</p>
|
Versions of libraries included in the JDK <p>I just ran into a problem with the version of JAX-WS in JDK 1.6.0 being different than the one in JDK 1.6.0_14.</p>
<p>I've been searching around for a list of the various libraries that are packaged in the JDK that shows the versions of the library included in the version ... | <p>Usually this information can be found by digging around in the JavaDocs for the release (not the API docs, but the release notes and spec notes (e.g. for <a href="http://java.sun.com/javase/6/docs/" rel="nofollow">Java 6</a> ). It's in there somewhere, but sometimes that kind of info is tricky to find.</p>
|
How to manage the game state in face of the EDT? <p>I'm developing a real time strategy game clone on the Java platform and I have some conceptional questions about where to put and how to manage the game state. The game uses Swing/Java2D as rendering. In the current development phase, no simulation and no AI is presen... | <p>This sounds like it could benefit from a client/server approach:</p>
<p>The player is a client - interactivity and rendering happen on that end. So the player presses a button, the request goes to the server. The reply from the server comes back, and the player's state is updated. At any point between these thin... |
Firefox throwing a exception with HTML Canvas putImageData <p>So I was working on this little javascript experiment and I needed a widget to track the FPS of it. I ported a widget I've been using with Actionscript 3 to Javascript and it seems to be working fine with Chrome/Safari but on Firefox is throwing an exception... | <p>It's a bug in Firefox. Mozilla <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=564332">knows about it</a>. Here's the workaround:</p>
<ol>
<li><p>Make a new in-memory canvas:</p>
<pre><code>var spriteCanvas = document.createElement('canvas');
</code></pre></li>
<li><p>Set the height/width of the canvas to th... |
JavaFX component that emulates JTable <p>I have a large dataset that needs to be displayed for users and looking for Swing's <code>JTable</code> like component in <code>JavaFX</code>.</p>
| <p>I recommend you read Amy Fowler's recent blog post (especially point 6):</p>
<p><em>Any Swing component can be embedded in a JavaFX scene graph using the SwingComponent wrap() function. This conveniently allows you to directly leverage those Swing components which you've already configured, customized, and hooked t... |
Programmatic databinding <p>How how do you do this in c#?</p>
<pre><code> <TextBlock Text={Binding MyProperty}/>
</code></pre>
<p>Assume the DataContext is set to a class of Type MyClass</p>
| <p>Assuming your <code>TextBlock</code> is called <code>_textBlock</code>:</p>
<pre><code>var binding = new Binding("MyProperty");
BindingOperations.SetBinding(_textBlock, TextBlock.TextProperty, binding);
</code></pre>
|
How do I access the digital signature of an InfoPath form from a workflow created with SharePoint Designer? <p>I would like to create a workflow with SharePoint Designer that will run whenever an item in an InfoPath form library is modified that will check to see if the form has been signed.</p>
<p>The form is a trave... | <p>In the Workflow Designer (In SharePoint Designer 2007) you can select a condition <strong>If Signature equals Yes</strong>. That should give you what you want.</p>
|
Converting document encoding when reading with dom4j <p>Is there any way I can convert a document being parsed by dom4j's SAXReader from the ISO-8859-2 encoding to UTF-8? I need that to happen while parsing, so that the objects created by dom4j are already Unicode/UTF-8 and running code such as:</p>
<pre><code>"some t... | <p>This is done automatically by dom4j. All <code>String</code> instances in Java are in a common, decoded form; once a <code>String</code> is created, it isn't possible to tell what the original character encoding was (or even if the string was created from encoded bytes).</p>
<p>Just make sure that the XML document ... |
Determine if site is running HTTPS <p>What would be the easiest way to see if the site is in HTTPS?</p>
<p>I am using c#</p>
| <p>You can use:</p>
<pre><code>HttpContext.Current.Request.IsSecureConnection
</code></pre>
|
Show all children in Superfish jquery menu <p>I'm using the Superfish jquery menu system and have a requirement to show all children regardless of level. The menu only shows the children of the selected item. Perhaps someone can help me figure how to modify the code to make it work this way.</p>
<p><a href="http://u... | <p>You could try something with CSS to make the subitems always visible. When hovering, the current item gets the class 'sfHover'.</p>
<p>Perhaphs you can add a CSS style to your site something like this:</p>
<pre><code>li.sub.sfHover ul {
display: block !important;
visibility: visible !important;
}
</code></pre>... |
Determining the best initial buffer size for decompressing streamed compressed data <p>I am trying to calculate an initial buffer size to use when decompressing data of an unknown size. I have a bunch of data points from existing compression streams but don't know the best way to analyze them.</p>
<p>Data points are t... | <p>Given that you have a lot of data points of how your compression works, I'd recommend analyzing your compression data, to get a mean compression standard and a standard deviation. Then, I'd recommend setting your buffer size initially to your original size * your compression size at 2 standard deviations above the ... |
Obfuscate strings in Python <p>I have a password string that must be passed to a method. Everything works fine but I don't feel comfortable storing the password in clear text. Is there a way to obfuscate the string or to truly encrypt it? I'm aware that obfuscation can be reverse engineered, but I think I should at lea... | <p>If you just want to prevent casually glancing at a password, you may want to consider encoding/decoding the password to/from <a href="http://docs.python.org/library/base64.html">base64</a>. It's not secure in the least, but the password won't be casually human/robot readable.</p>
<pre><code>import base64
# Encode p... |
JQuery - Set Background Image to Image object <p>I new to JQuery and I am trying to do a proof-of-concept with it. I am trying to use JQuery to: 1) Download a large (>500kb) image file 2) Set the image as the background of an element when downloaded 3) fade it in (basically the way that Bing.com does it). The StackOver... | <p>Put additional div (with <code>width: 100%; height: 100%</code>) in <code>#loader</code>: <code><div id="loader"><div class="image"></div></div></code>.</p>
<p>Then, instead of <code>$("#loader").append(this);</code> you should to something like <code>$("#loader div.image").css("background",... |
ThreadLocal + java.sql.Connection + servlet filter = 2009? <p>I am writing some servlets with plain old mostly-JDBC patterns. I realized that I have several objects that would like to share a single transaction, and I'd like to enforce that one HTTP transaction = one database transaction.</p>
<p>I think I can do this ... | <p><a href="http://www.springframework.org" rel="nofollow">Spring</a> transaction management does exactly what you describe, it might be a little over whelming at first glance but all you will be needing (for the simplest case) is:</p>
<p><a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframe... |
event.pageX - Use JQuery Event in a function not bound through JQuery? <p>I have a table, and when the user clicks on each cell, some details should appear in a small popup div that appears where the user clicked. I'm using JQuery, but not to bind the function to the onclick event.</p>
<pre><code>function detailPopup(... | <pre><code>e = jQuery.event.fix(e); //you should rename your event parameter to "e"
</code></pre>
<p>I found the <code>fix</code> function by searching through the jQuery source code.</p>
<p>Alternatively, you could use this to get the mouse coordinates <em>without</em> jQuery...</p>
<pre><code>var posx = 0;
var po... |
How to show headings in GridView with no results <p>What is the best way to still show column headings on a GridView that doesn't get any records when using LINQDataSource?</p>
| <p><a href="http://mattberseth.com/blog/2007/07/how%5Fto%5Fshow%5Fheader%5Fand%5Ffooter.html" rel="nofollow">Matt Berseth</a> has an article in which he subclasses GridView and implements this behavior.</p>
|
Regex Extract html Body <p>How would I use Regex to extract the body from a html doc,
taking into account that the html and body tags might be in uppercase, lowercase or might not exist?</p>
| <p>Don't use a regular expression for this - use something like the <a href="http://www.codeplex.com/htmlagilitypack">Html Agility Pack</a>.</p>
<blockquote>
<p>This is an agile HTML parser that
builds a read/write DOM and supports
plain XPATH or XSLT (you actually
don't HAVE to understand XPATH nor
XSLT to ... |
.NET Xslt Transformation, is this really streamed? <p>I have an XML that I need remove empty elements from, I am trying to avoid using DOM and trying to do this as streams. I have this code, but I am not entirely sure how correct and optimized this is.</p>
<pre><code>StringBuilder xslt = new StringBuilder();
xslt.Appe... | <p>Yes you are using streams, but you are losing one of the benefits of streams: not loading the whole XML input and output in memory at once.</p>
<p>This is perfectly fine for very small XML documents, but can lead to very high memory usage for large documents.</p>
<p>A solution would be to avoid StringReader/String... |
Width of PowerShell Output in the Visual Studio Output Window <p>I have a powershell script that runs fxcopcmd in the output window. Turns out that when I output results it limits the output to 80 Chars, is there a way to get it to be wider in the visual studio output window</p>
| <p>I've found the <a href="http://technet.microsoft.com/en-us/library/dd347585.aspx" rel="nofollow">"solution"</a>:</p>
<blockquote>
<p>To get output that does not force line
wraps to match the screen width, you
can use the Width parameter to specify
line width. Because Width is a 32-bit
integer parameter, t... |
Force Entity Framework to ignore all foreign keys during class generation <p>I am using the Entity Framework just to create classes that can be mapped to database tables. We have our own data access layer that I need to go through, which is why I'm only using the generated classes.</p>
<p>I would like the entity frame... | <p>You can check a box in the EF wizard "Include foreign key columns in the modelâ which generates both a navigation link and properties for foreign keys.</p>
|
AsUnit verses FlexUnit â which is "better"? <p>I'm learning ActionScript/Flex at the moment, and it's come time for me to start unit testing. My reading shows that there are two main frameworks out there: FlexUnit and AsUnit.</p>
<p>Is there any reason to learn one over the other? Is one, in some way, "better"?</p>... | <p>I think it depends on the kind of ActionScript development you're doing. AsUnit has a wider set a supported versions.</p>
<p>FlexUnit looks as though it has a better backing through Adobe. If you're focusing on Flex development (or strictly AS3), I'd probably go with FlexUnit.</p>
|
Weird IE7 js issue in Drupal <p>In IE 7 when I click on any javascript link for example</p>
<pre><code><a href="#" onclick="toggleGroup(); return false;" id="slick-toggle">View Classrooms</a>
</code></pre>
<p>the page will refresh. This is occuring in a drupal project I inherited. This problem doesn't hap... | <p>The problem was this line inside my body tag. </p>
<p>onresize="window.location=window.location;" </p>
<p>Took it out and every thing works now!</p>
|
How can I use namespaces in a SQL XML query with the "nodes" command? <p>I'm trying to query fields from the following XML query, (which is really a web service call):</p>
<pre><code><soap:Envelope xmlns:xsi="[schema]" xmlns:xsd="[shema]" xmlns:soap="[schema]">
<soap:Body>
<RunPackage xmlns="http:... | <p>Found the issue thanks for Mark! Namespaces must be explicitly declared.</p>
<p>New WORKING query:</p>
<pre><code>WITH XMLNAMESPACES('[URI1]' AS ns, '[URI2]' AS soap)
SELECT TransactionID,
T2.Loc.query('data(ns:SubscriberCode)') as 'SubscriberCode',
FROM TempWorksRequest
CROSS APPLY RequestXML.nodes('soap:E... |
LINQ to SQL associations? <p>I have a Posts class and that post can have one file and that file can have many tags</p>
<p>I want to iterate through the files in a post and show all the files tags</p>
<pre><code>foreach(File f in Post.Files)
{
f.Tags
}
</code></pre>
<p>What do I need in this foreach to get the to... | <p>To get the first tag for a file, use this:</p>
<pre><code>f.Tags.First()
</code></pre>
<p>If you have one file per post and multiple tags per file though, something like this might be more appropriate:</p>
<pre><code>foreach( Tag t in Post.Files.First().Tags ) {
// Do something with t
}
</code></pre>
|
Weird program behaviour in Python <p>When running the following code, which is an easy problem, the Python interpreter works weirdly:</p>
<pre><code>n = input()
for i in range(n):
testcase = raw_input()
#print i
print testcase[2:(int(testcase[0])+1)]+testcase[(int(testcase[0])+2):]
</code></pre>
<p>The pr... | <p>Are you sure that the problem is the print i statement? The code works as
expected when I uncomment that statement and run it. However, if I forget to
enter a value for the first input() call, and just enter "4 PYTHON" right off
the bat, then I get:</p>
<pre><code>"SyntaxError: unexpected EOF while parsing"
</cod... |
C#: How to effectively filter (hide) ListView Items while in virtual mode? <p>C#: How to effectively filter (hide) ListView Items while in virtual mode?</p>
<p>I am looking for a way to filter (hide/show) items in ListView in Virtual Mode. I have my items cached in an array of listview items, how could I effectively m... | <p>You'll need to map your list of visible rows, so that when RetrieveVirtualItem requests an item, it requests into your filtered list that only contains visible items. </p>
<p>If you're using CacheVirtualItems to store ListViewItems, you'll need to update that cache when the filtering is applied, removing all non-vi... |
Type Checking: typeof, GetType, or is? <p>I've seen many people use the following code:</p>
<pre><code>Type t = typeof(obj1);
if (t == typeof(int))
// Some code here
</code></pre>
<p>But I know you could also do this:</p>
<pre><code>if (obj1.GetType() == typeof(int))
// Some code here
</code></pre>
<p>Or th... | <p>All are different.</p>
<ul>
<li><code>typeof</code> takes a type name (which you specify at compile time).</li>
<li><code>GetType</code> gets the runtime type of an instance.</li>
<li><code>is</code> returns true if an instance is in the inheritance tree.</li>
</ul>
<h3>Example</h3>
<pre><code>class Animal { }
c... |
Javascript - Nice way to create an array from an object array <p>I have a javascript object array:</p>
<pre><code>array = [ {x:'x1', y:'y1'}, {x:'x2', y:'y2'}, ... {x:'xn', y:'yn'} ]
</code></pre>
<p>I want to create a new array of just the <code>x</code> values:</p>
<pre><code>[ 'x1', 'x2', ..., 'xn' ]
</code></pre... | <p>You can do this with <a href="http://docs.jquery.com/Utilities/jQuery.map">map</a>:</p>
<pre><code>var newarray = jQuery.map(array, function (item) { return item.x; });
</code></pre>
|
jquery, ajax and getting a complete html structure back <p>I'm new to jquery and to some extent javascript programming. I've successfully started to use jquery for my ajax calls however I'm stumped and I'm sure this is a newbie question but here goes.</p>
<p>I'm trying to return in an ajax call a complete html struct... | <p>The simplest way is just to return your raw HTML and use the <code>html</code> method of jQuery.</p>
<p>Your result: </p>
<pre><code><table id="test"><tr>test</tr></table>
</code></pre>
<p>Your Javascript call:</p>
<pre><code>$.post(url, params, function(data){ $('#queryresultsblock').htm... |
Different results from .mdb vs .odb, why? <p>I use the following query to retrieve data from a .mdb file through JDBC, however when I try it on an .odb file it goes does not throw any exceptions but there are no results at all. I am wondering is .odb case sensitive where .mdb is not or is there something else I am miss... | <p>They would be differnt because they are two differnt products written by two differnt companies and the programmers made different choices as to how to handle things.</p>
<p>Have you tried using a column alias you specify, perhaps something more descriptive than Expr1000?</p>
<pre><code>SELECT DISTINCT column-one ... |
Stress Testing AJAX <p>My web application is almost exclusively AJAX-based, where data is fetched via a web service and returned via JSON.</p>
<p>I'm using WAST to stress test, but I'm sure there are better tools out there for this job.</p>
<p>Does anyone have recommendations?</p>
<p>Thanks</p>
| <p>Ryan recommended Selenium, which isn't traditionally a load testing tool. He is correct that of all the recommendations so far, it's by far the best at handling AJAX. The reason is that Selenium drives a real web browser and can be programmed to "wait" for AJAX events to occur, such as a "DIV" element popping up or ... |
Calling a method from another method in the same class in C++ <p>I wrote a method (that works fine) for <code>a()</code> in a class. I want to write another method in that class that calls the first method so:</p>
<pre><code>void A::a() {
do_stuff;
}
void A::b() {
a();
do_stuff;
}
</code></pre>
<p>I suppose I... | <p>What you have should work fine. You can use "this" if you want to:</p>
<pre><code>void A::b() {
this->a();
do_stuff;
}
</code></pre>
<p>or</p>
<pre><code>void A::b() {
this->A::a();
do_stuff;
}
</code></pre>
<p>or</p>
<pre><code>void A::b() {
A::a();
do_stuff;
}
</code></pre>
<p>but what you... |
Windows.Form ComboBox Cannot set the SelectedValue Property of Unbound Control <p>I cannot set the default combobox selected value for an unbound combobox. Here is my code:</p>
<pre>
System.Console.WriteLine("Current Tag Org Id = " + CurrentTag.Org.OrgId);
ddlRUC.SelectedValue = CurrentTag.Org.OrgId;... | <p>A combobox (like a Listbox) has 2 mechanisms for dealing with the selection. Either:</p>
<ol>
<li><p>You assign a List to the DataSource
property and set the ValueMember and
DisplayMember to the names of
properties of items of that list. Or,</p></li>
<li><p>You fill the Items property with
objects of your choice, t... |
How can I load and display images directly from a mysql blob field using php without saving them as files? <p>I have images stored in mysql as mediablobs, and I'd like to load (show) them directly from the database without having to save them as files first.</p>
<p>I need to load multiple images into a table (thumbs),... | <p>You create a script named getimage.php. The thumbs in the table should be something like this:</p>
<pre><code><img src='<path>/getimage.php?id=<image_id>' />
</code></pre>
<p>The scipt getimage.php does the database lookup and then outputs something like:</p>
<pre><code>...
header('Content-Type:... |
Pros and Cons of Product Line Software Development <p>Has anybody here implemented a software product line approach, as defined by the <a href="http://www.sei.cmu.edu/productlines/" rel="nofollow">SEI</a>? How do you manage changes? How do you test? What problems have you had to deal with?</p>
<p>For years we've basic... | <p>A <a href="http://se-radio.net/podcast/2009-10/episode-146-interesting-patterns-europlop-2009" rel="nofollow">recent SE Radio podcast</a> had a small section discussing product line development. I believe it was the very first section.</p>
<p>There are also three other SE Radio podcasts that might be of interest - ... |
what does unauthenticated user mean in MYSQL? <pre><code>mysql> show full processlist;
+-----+----------------------+--------------------+------+---------+------+----------------------------------+-----------------------+
| Id | User | Host | db | Command | Time | State ... | <p>A connection with "unauthenticated user" in the User column has initiated a connection but hasn't sent his/her credentials yet, so the server doesn't know who exactly is connecting.</p>
<p>If such connections only showed up in the list when they were authenticated, it could potentially run the server out of availab... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.