input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Group by 'other', where groups with small contribution are included in 'other' field - MySQL <p>I would like to GROUP BY an item in my table, which has an associated monetary value. This I can work out as a percentage, however there are often too many items in the list (too many to be useful, for example in a graph). C... | <p>Looks like a UNION could help, e.g. (depending how your table's organized, of course):</p>
<pre><code>SELECT itemname, SUM(percent) AS pc FROM items
GROUP BY itemtype
HAVING SUM(percent) >= 0.05
UNION
SELECT 'Other', SUM(*) FROM
(SELECT SUM(percent) FROM items
GROUP BY itemtype
HAVING SUM(percent) < 0... |
Can this type of flash dragging, dropping, and animation be done in a javascript library? <p>Sorry. I don't know a good title for this, but please look here: </p>
<p><a href="http://joshblog.net/projects/logic-gate-simulator/Logicly.html" rel="nofollow">http://joshblog.net/projects/logic-gate-simulator/Logicly.html<... | <p>Looks like someone has recently made a <a href="http://knolleary.net/code/logic/" rel="nofollow">Logic Gate Thing</a> that might interest you, though it doesn't quite have the level of animation that the Flash version has. (<a href="http://knolleary.net/2009/03/24/logic-gate-thing/" rel="nofollow">Here</a> is an ex... |
Where can I get great documentation about Exception handling in C# <p>I'm searching for a good website or a books that give great example of Exception Handling in C# 2008 such as SQL exception management and all the other. I'm programming in 3 tiers.</p>
<p>I'm already doing it well in VB .Net 2008 and I'm now moving ... | <p>Did you try looking at the <a href="http://msdn.microsoft.com/en-us/library/cc309505.aspx" rel="nofollow">MSDN Exception Handling Applicaton Block</a> </p>
|
Wrong hour in C++ <p>// Simple program to get the date and time on Windows
// It compiles and works fine but displays the wrong hour!</p>
<pre><code>// Using Visual C++ 2008 Express on XP SP2
#include <Windows.h>
#include <iostream>
using namespace std;
void main()
{
SYSTEMTIME st;
GetSyst... | <p>The time is in UTC according to the docs. Link <strong><a href="http://msdn.microsoft.com/en-us/library/ms724390%28VS.85%29.aspx">HERE</a></strong></p>
<p>For local time you want <strong><a href="http://msdn.microsoft.com/en-us/library/ms724338%28VS.85%29.aspx">GetLocalTime()</a></strong></p>
|
comments compiled into .exe in .net? <p>I know you can use a .net reflector to view code created with .net but if i put something in the comments for my own personal reminder is that compiled in the exe as well.</p>
<p>I don't intend to release the source code for my application and i know the 100% safe bet is to just... | <p>Comments are ignored by the compiler. They will not be put into the output executable.</p>
|
Snapshot website over time <p>I'm a developer for a marketing team and one of the features that often gets requested is: Can we go back to see what our site (or what X page) looked like back in X.</p>
<p>Are there any good solutions for solving for this request? </p>
| <p>Source Control should be able to solve your request in house. Label things appropriately and have an internal server to deploy that label to, and you should have no issue. If you have an automated deployment tool and choose your labels wisely, it should be relatively simple to write an app that will check out your s... |
Get the latest row inserted with the help of CreatedDate field <p>I am trying to get the latest record inserted in a SQL table based on its CreatedDate. For instance, in the table below, I would like to get the third row. </p>
<pre><code>A B C 2009-05-04 19:30:52.847
A B D 2009-05-04 19:30:55.050
A B E 2009-05-0... | <p>you can also write</p>
<pre><code>SELECT top 1 *
FROM TestTable
order by CreatedDate desc
</code></pre>
|
Noise Words SQL SERVER 2005 BackSlash <p>How do I make SQL SERVER 2005 to ignore the backslash in the following search: </p>
<pre><code>select [description] from MyTable where contains([description], '3/4 and bear')
</code></pre>
<p>It is blowing off on "/"!</p>
| <p>try using '"3/4 and bear'" </p>
|
Increasing Windows Mobile 5 Emulator Storage <p>I'm using the Microsoft Sync Framework to synchronize a SQL Server database with a SQL Compact SDF file on the Windows Mobile 5 emulator. We have a 2 gig SD card in the actual device we're deploying on so we'd like to store our database file there. However, when I map a s... | <p>actually you can do this.</p>
<p>First of all open Device Emulator and run the emulator of your choice. In my case i open Windows Mobile 5.0</p>
<p>Then, as it runs, from device emulator, right click the emulator you just run and select Save-As, save it somewhere and then open this file with a text editor.</p>
<p... |
Is this interview question too hard for a php dev. job? <p>We're looking for someone to help us enhance & maintain our high-quality, php-based prototype of a transactional web app. Ideally, who can communicate well, and do both front- and back-end web development (as well as smart/gets things done, etc.). Among oth... | <p>I would consider that much too easy of a question, personally. If someone asked me that question in an interview I'd probably be busy trying to figure out what the "trick" was, because it's so simple.</p>
<p>I think it's fine for weeding out the absolute worst programmers, but make sure that you don't have one part... |
How can I serialize an object that has an interface as a property? <p>I have 2 interfaces IA and IB.</p>
<pre><code>public interface IA
{
IB InterfaceB { get; set; }
}
public interface IB
{
IA InterfaceA { get; set; }
void SetIA(IA value);
}
</code></pre>
<p>Each interfaces references the other. </p>... | <p>You have various bugs in your code, otherwise this would work just fine.</p>
<ol>
<li>In the constructor for <code>ClassA</code>, your are setting an local variable IB, not the object's IB object.</li>
<li>In <code>ClassB</code>, you are casting back to the object concrete class, instead of leaving it alone as the... |
How does Phusion Passenger reuse threads and processes? <p>I am setting up an Apache2 webserver running multiple Ruby on Rails web applications with Phusion Passenger. I know that Passenger spawns Ruby processes for handling requests. I have the following questions:</p>
<ul>
<li>If more than one request has to be hand... | <p>Generally speaking, Passenger spawns new processes by forking an ApplicationSpawner, which has the framework and application code pre-loaded into memory, or a FrameworkSpawner, which just has the framework code.</p>
<p>Passenger, as far as I know, doesn't deal in threads. Instead, as the load increases on an applic... |
How can I detect multiple logins into a Django web application from different locations? <p>I want to only allow one authenticated session at a time for an individual login in my Django application. So if a user is logged into the webpage on a given IP address, and those same user credentials are used to login from a ... | <p>Not sure if this is still needed but thought I would share my solution:</p>
<p>1) Install django-tracking (thankyou for that tip Van Gale Google Maps + GeoIP is amazing!)</p>
<p>2) Add this middleware:</p>
<pre><code>from django.contrib.sessions.models import Session
from tracking.models import Visitor
from datet... |
What's the difference in the Visual Studio integration tools for Qt? <p>Trolltech has released a tool called <a href="http://www.qtsoftware.com/developer/faqs/what-is-the-visual-studio-add-in/view" rel="nofollow" title="Visual Studio add-in">"Visual Studio add-in"</a> for their LGPL and GPL release of Qt. They state t... | <p>The Visual Studio add-in does not work with the Windows Open Source Qt binary installer. To get it to work, you'll have to download the source package and build in manually. The Open Source Windows binary <a href="http://arstechnica.com/open-source/news/2009/03/first-look-qt-45-rocks-for-rapid-cross-platform-devel... |
How can I convert a .Net Datetime to a T-SQL Datetime <pre><code>MyDataSource.SelectParameters["startDate"].DefaultValue =
fromDate.SelectedDate.Date.ToString();
</code></pre>
<p>As you can see I am setting the default value of a parameter in my .Net SqlDataSource. I don't think th... | <p>There's a SqlDateTime struct you can use for this</p>
<pre><code>DateTime DotNetDateTime = new DateTime(2009, 5, 4);
System.Data.SqlTypes.SqlDateTime sqlDateTime = new System.Data.SqlTypes.SqlDateTime(DotNetDateTime);
</code></pre>
<p>Or directly in one line (as the SqlDateTime takes the same args in one of the co... |
How to route sub-domains to account pages? How does domain masking work? <h2>Part 1</h2>
<p>I want to build a PHP Zend Framework application that users can sign up to use. When they register, I would like the application to create a sub-domain that points to their public page, that serves up content specific to that c... | <p>First, you are right. You don't want multiple instances/installs of your app.
Setup multiple Apache virtual hosts to point at the Doc Root.</p>
<pre><code>ServerName www.serverOne.com
DocumentRoot "/htdocs/myapp/public"
SetEnv CONFIG_ENV "serverOne"
ServerName www.serverTwo.com
DocumentRoot "/htdocs/myapp/publ... |
Modify a .txt file in Java <p>I have a text file that I want to edit using Java. It has many thousands of lines. I basically want to iterate through the lines and change/edit/delete some text. This will need to happen quite often.</p>
<p>From the solutions I saw on other sites, the general approach seems to be:</p>... | <p>I haven't done this in Java recently, but writing an entire file into memory seems like a bad idea.</p>
<p>The best idea that I can come up with is open a temporary file in writing mode at the same time, and for each line, read it, modify if necessary, then write into the temporary file. At the end, delete the orig... |
Flex Custom Components Tutorial <p>I'm just getting started out with flex. Are there any easy to follow tutorials that give examples of creating custom components that pass data with custom events?</p>
| <p>Adobe has two:</p>
<p><a href="http://livedocs.adobe.com/flex/1/flex_builder_en/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Using_Flex_Builder&file=brady214.htm" rel="nofollow">http://livedocs.adobe.com/flex/1/flex_builder_en/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Using_Flex_Builder&file=brady214.h... |
Why are backward slashes removed from querystring - ASP.NET & Javascript <p>I am trying to generate a URL that contains a UNC path as one of the query string variables. The URL will open in a pop up window when an ASP.NET button control is clicked by the user. When the clicks the button, the backwards slashes are rem... | <p>You have to URL encode the value that you put in the URL:</p>
<pre><code>string url = "http://www.mysite.com/page.aspx?a=" + Server.UrlEncode(unc);
</code></pre>
<p>Edit:<br>
To safely put the url in the Javascript code, you also have to encode the string for being a literal string:</p>
<pre><code>MyButton.Attrib... |
Importing all MySQL databases <p>I <code>mysqldump --all-databases</code> nightly as a backup. But on importing this dump into a clean installation, I obviously run into a couple issues.</p>
<ol>
<li>I obviously can't (and don't want to) overwrite the new information_schema.</li>
<li>All my users and permissions setti... | <p>you will not have problems with the info schema</p>
<p><a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html</a>
mysqldump does not dump the INFORMATION_SCHEMA database. If you name that database explicitly on the command line, mysqldump... |
Generating fields containing newline with Ruby CSV::Writer <p>I want to make CSV::Writer generate a line break within a quoted string:</p>
<pre><code>A,B,"Line
Line",C
</code></pre>
<p>So that the row would display in Excel as:</p>
<pre><code>A,B,Line,C
Line
</code></pre>
<p>Is it possible to prevent CSV:Writer... | <p>Switching to FasterCSV will work.</p>
<p>From an IRB session:</p>
<pre><code> require 'fastercsv'
FasterCSV.open("./testfile.csv", "w") do |csv|
csv << ["row", "of", "CSV\nCSV", "data"]
end
</code></pre>
|
I need a regex for the href attribute for an mp3 file url in python <p>Based on a previous stack overflow question and contribution by cgoldberg, I came up with this regex using the python re module:</p>
<pre><code>import re
urls = re.finditer('http://(.*?).mp3', htmlcode)
</code></pre>
<p>The variable urls is an ite... | <p>As pointed out by the other answers, using regular expressions to parse HTML = bad, bad idea.</p>
<p>With that in mind, I will add in code of my favorite parser: <a href="http://www.crummy.com/software/BeautifulSoup/" rel="nofollow">BeautifulSoup</a>:</p>
<pre><code>from BeautifulSoup import BeautifulSoup
soup =... |
How can I quickly create aliases with absolute paths? <p>I often make mistakes in making aliases:</p>
<pre><code>ln -S $Personal/Books $Buy/Books (1)
</code></pre>
<p>Instead, I have to write the whole path to get the last command working:</p>
<pre><code>ln -S /Users/user/something/.../Books /Users/user/somethi... | <p>I assume in your example the paths <em>Personal</em> and <em>Buy</em> are both directories in your home directory. Then you can create a relative symlink by typing</p>
<pre><code>cd Buy
ln -s ../Personal/Books Books
</code></pre>
|
Accessing and setting iPhone's alarm / User alert on timed interval <p>Are there any way to access or set iphone's alarm?
Im assuming if this isn't available, the only other way is push notification to alert the user on a timed interval. Any ideas?</p>
| <p>There are no public API's for accessing the calendar or alarms.</p>
|
selenium rc with cruise control - testng error message - could not instantiate 'test' <p>I'm currently trying to set up cruisecontrol to run my selenium test suite. Everything works fine until I run the build, I got the following message:</p>
<p>calling target(s) [execute-test] in build file C:\Project\src\build.xml
<... | <p>You don't have your classes (tests & target classes) on the classpath.</p>
|
How do I select rows that have a column value equal to the value of the known row? <p>There is a table:</p>
<pre><code> create table table1 (
id integer primary key,
user_id varchar(36),
field1 varchar(100))
</code></pre>
<p>How do I select the rows linked to the user, to which the row with... | <p>This is very easy with <a href="http://dev.mysql.com/doc/refman/5.1/en/subqueries.html" rel="nofollow">subqueries</a>, in particular <a href="http://dev.mysql.com/doc/refman/5.1/en/comparisons-using-subqueries.html" rel="nofollow">Comparisons Using Subqueries</a> in the documentation:</p>
<pre><code>SELECT * FROM t... |
Keeping queries out of JSP - how? <p>I'm a big fan of keeping application logic in the servlet, and keeping the JSP as simple as possible. One of the reasons for this is that any good web designer should be able to expand upon his HTML knowledge to build in a few JSTL tags to do simple iteration, access beans, etc. We ... | <p>It sounds like you need better separation between the display and database code. You should have separate classes that just deal with interacting with the database, and know nothing about display.</p>
<p>Then you just create a method that will look up the product by id and return that bean so the display can pull o... |
Simulate a request from a IE Client with WebClient class? <p>I am downloading files with the WebClient class in .NET 3.5. I would like to be sure that on the server side, the files requested appear to be downloaded with a IE client. What do I have to change exactly? </p>
<p>Do I have simply to copy the header informat... | <p>Depending on your needs, just setting the user agent header might be enough. There is an example at <a href="http://msdn.microsoft.com/en-us/library/system.net.webclient" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.net.webclient</a>(VS.80).aspx</p>
|
ReSharper 4.5 <p>Hey, So i have about 4-5 years of background in programming some in C# and some in C++. I recently got an internship and have been using C# daily. I am confident in my work, and don't have any problem remembering syntax or anything like that. So i was wondering what you guys think about getting resharp... | <p>I wouldn't work without it. It duplicates a bunch of the Visual Studio stuff, and adds a whole lot more. It simply improves Visual Studio, and will not impair your learning c# at all.</p>
|
How do I use a Silverlight2 ItemsControl to position a collection of items on a canvas? <p>In WPF, you can create a ListBox with a Canvas as an ItemsPanel and position items on that canvas. The code to do that looks something like this:</p>
<pre><code><ListBox ItemsSource="{Binding}">
<ListBox.ItemTemplat... | <p>I've found <strong>a</strong> solution, but (to me) it smells.</p>
<pre><code><ListBox ItemsSource="{Binding}">
<ListBox.ItemTemplate>
<DataTemplate>
<Canvas Width="200" Height="200">
<TextBlock
Text="{Binding Path=Name}"
... |
Setting up OpenGL with C++ and Visual Studio 2008 <p>Hey I was wondering if there are any good tutorial out there on how to set this up? I have seen the NeHe tutorials from gamedev.net but some of them seem to be out dated... any clues?</p>
<p>thanks</p>
| <p><a href="http://nehe.gamedev.net" rel="nofollow">NeHe</a> may be a little old, but it's certainly not outdated. Unlike DirectX, OpenGL gets updated very seldomly. The tutorials there are still perfectly good for modern OpenGL programming. The Visual C++ code for <a href="http://nehe.gamedev.net/data/lessons/lesso... |
iif equivalent in c# <p>Is there a <code>IIf</code> equivalent in <code>C#</code>? Or similar shortcut?</p>
| <p>C# has the "?" ternary operator, like other C-style languages. However, this is not perfectly equivalent to iif. There are two important differences.</p>
<p>To explain the first, this <code>iif()</code> call would cause a DivideByZero exception even though the expression is true because <code>iif</code> is just a... |
Can't bind to low port number (80) on XP sp3 <p>I've got this code in my socket class:</p>
<pre><code>bool GSocket::Listen(int Port)
{
d->Socket = socket(AF_INET, SOCK_STREAM, 0);
if (d->Socket >= 0)
{
sockaddr Addr;
sockaddr_in *a = (sockaddr_in*) &Addr;
ZeroObj(Addr);
a->sin_family = AF_IN... | <p>Port numbers in the range from 0 through 1023 are <a href="http://en.wikipedia.org/wiki/Well_known_ports" rel="nofollow">well known ports</a> and the operating system can require administrative privileges in order to bind to them. Consequently, any application that attempts to use these ports must be privileged.</p... |
Asp.Net MVC don't show Index action in url <p>I would like that the Index action doesn't appear in the url.</p>
<p>For example, I would like to see </p>
<p>www.mywebsite.com/MyController/1 </p>
<p>instead of </p>
<p>www.mywebsite.com/MyController/Index/1</p>
<p>Is there something special I have to do in the Html.A... | <p>Try this for your routes.</p>
<pre><code>routes.MapRoute(
"Index",
"/{controller}/{id}",
new { controller = "Home", action = "Index" }
);
</code></pre>
<p>It sets the action to the default of "Index"</p>
|
cut string and assign into array in javascript <p>Does anyone know how can I cut a string and then assign into an array with javascript? Example:</p>
<p>var string = "15;24;67;34;56";</p>
<p>I hope tp cut this string into below format and assign into the array:</p>
<p>a[0] = 15
a[1] = 24
a[2] = 67
a[3] = 34
a[3] = 5... | <p><code>var a = string.split(';');</code></p>
|
Elegant, pythonic solution for forcing all keys and values to lower case in nested dictionaries of Unicode strings? <p>I'm curious how the Python Ninjas around here would do the following, elegantly and pythonically:</p>
<p>I've got a data structure that's a dict from unicode strings to dicts from unicode strings to u... | <p>Really simple way, though I'm not sure you'd call it Pythonic:</p>
<pre><code>newDict = eval(repr(myDict).lower())
</code></pre>
<p>Saner way:</p>
<pre><code>newDict = dict((k1.lower(),
dict((k2.lower(),
[s.lower() for s in v2]) for k2, v2 in v1.iteritems()))
f... |
Creating a "loading..." view using iPhone SDK <p>How to create that black/gray modal popup kind of view that many apps use, when some long pending operation is in progress?</p>
<p>Like when using location based services, loading a webpage, the screen goes dim and there is a modal view showing a spinning icon "Please w... | <p>This is actually the undocumented (in 2.2.1 anyway) UIProgressHUD. Create one like this:</p>
<p>In your .h:</p>
<pre><code>@interface UIProgressHUD : NSObject
- (UIProgressHUD *) initWithWindow: (UIView*)aWindow;
- (void) show: (BOOL)aShow;
- (void) setText: (NSString*)aText;
@end
</code></pre>
<p>In your .m:... |
Testing nHibernate mappings <p>I have just started a new project using nHibernate and Fluent for mapping. The architect has sent me a database from which I have generated several hundred entity classes and the corresponding Fluent mapping files. I know this is not the ideal DDD way of doing things but life is rarely id... | <p>Have a look at the <a href="https://github.com/jagregory/fluent-nhibernate/wiki/Persistence-specification-testing" rel="nofollow">PersistenceSpecification</a> in Fluent NHibernate. It's hardly perfect, but it handles a lot of simple cases well.</p>
|
Changing include path using php script <p>I'm looking to include other folders in my include path for PHP. I've seen this question:</p>
<p><a href="http://stackoverflow.com/questions/24622/setting-php-include-path-on-a-per-site-basis">http://stackoverflow.com/questions/24622/setting-php-include-path-on-a-per-site-basi... | <p>I think you are looking for this: <a href="http://www.php.net/set%5Finclude%5Fpath" rel="nofollow"><code>set_include_path</code></a></p>
<p>With it, you can do:</p>
<pre><code>set_include_path(get_include_path() . PATH_SEPARATOR . $otherpath);
</code></pre>
|
Problem in Interfaces (polymorphism) C# <p>i have two classes which have some common methods like
funcA(), funcB()</p>
<p>and some methods are only related to its class...</p>
<p>what i did is made interface of TestInterface</p>
<pre><code>public interface TestInterface
{
void funcA()
void funcB()
}
public c... | <p>If you're asking whether you can do something like:</p>
<pre><code>public static void Main(string[] a)
{
TestInterface test = new ClassA();
test.myFuncA();
}
</code></pre>
<p>the answer is no. You would have to cast it to ClassA first. The fact that you think you need to do this indicates there is probably som... |
How to order a IEnumerable<T> of anonymous type? <p>See the code below, I don't know why my ordering is not working, any ideas?</p>
<pre><code>var orderSample = new { ProductName = "", Qty = 0, UserFullName = "" };
var ordersList = (new[] { orderSample }).ToList();
//loop thru another collection and fill ordersList b... | <pre><code>var sortedList = ordersList.OrderBy(p => p.ProductName).ToList();
</code></pre>
<p><a href="http://msdn.microsoft.com/en-us/library/bb534966.aspx">OrderBy()</a> returns a sorted collection, it does not modify the ordersList.</p>
<p>If you need to modify the ordersList, use Sort instead.</p>
|
DISPhelper Library <p>Has anyone used DISPhelper library? I wanna know if it's really a better way to use this library if you're pretty new to COM technology. I'd appreciate your feedbacks. thanks..</p>
| <p>It is really better for a beginner. It's easy to use and comes along with a bunch of examples. But if you're into serious COM programming, better learn it the conventional way.</p>
|
How do you make a Menu Bar Item display how many rows there are in a table? <p>I have a core data table and would like the Menu Bar item to display how many rows there are in the table. I have already created the menu bar item using this code:</p>
<pre><code> -(void)applicationDidFinishLaunching:(NSNotification *)aNot... | <p>If you don't require live updating you can try this approach:</p>
<p>1) set the delegate of theMenu:</p>
<pre><code>[theMenu setDelegate:self];
</code></pre>
<p>2) and implement the delegate methode:</p>
<pre><code>- (void)menuWillOpen:(NSMenu *)menu {
NSUInteger count = [self.tableView numberOfRows];
[[... |
What is soft coding? (Anti-pattern) <p>I found the <a href="http://en.wikipedia.org/wiki/Softcoding">Wikipedia entry</a> on the soft coding anti-pattern terse and confusing. So what is soft coding? In what settings is it a bad practice (anti-pattern)? Also, when could it be considered beneficial, and if so, how should ... | <p>Short answer: Going to extremes to avoid Hard Coding and ending up with some monster convoluted abstraction layer to maintain that is worse than if the hard coded values had been there from the start. i.e. over engineering.</p>
<p>Like:</p>
<pre><code>SpecialFileClass file = new SpecialFileClass( 200 ); // hard co... |
Global member creation <p>How the global members can be created in vc++ 6.0 mfc project.</p>
<p>If I select globals option in WizardBar(WizardBar C++ class)
then (WizardBar C++ members),it display (No members - Create New Class...).</p>
<p>How to create the members for this globals class?</p>
| <p>If you have any global functions in your project , that will displayed in the combo box.
To see just declare some c style function like this</p>
<p>int sum(int a ,int b) { return a+b;}</p>
<p>Now the combo box will display sum function.</p>
<p>"<em>No members - Create New Class...</em>" displayed in the combo box... |
Is there a way to to create a custom answering machine in android? <p>I'd like to create an app that allow you to filter incomming call to various answering message with :</p>
<ul>
<li>"this number is not available" for black listed phone numbers</li>
<li>A formal message for strangers</li>
<li>A informative message a... | <p>Access to the internal telephony is not possible or planned for future releases of Android:</p>
<p><a href="http://groups.google.com/group/android-developers/browse_thread/thread/e8904c82a2c4a333" rel="nofollow">http://groups.google.com/group/android-developers/browse_thread/thread/e8904c82a2c4a333</a></p>
<p>This... |
How do I query the value of a server option in Sybase? <p>For example, if I wanted to know the current value of the <code>quoted_identifier</code> server option, is there a query that can give me this information?</p>
| <p>sp_dboption can give you a list of settable options or actually set the option:-</p>
<p>List Settable Options</p>
<pre><code>exec sp_dboption
</code></pre>
<p>set an option</p>
<pre><code>sp_dboption pubs2, "unique auto_identity index", true
</code></pre>
<p>If you just want to list the options set on a db, you... |
Javascript Confirm popup Yes, No button instead of OK and Cancel <p>Javascript Confirm popup, I want to show Yes, No button instead of OK and Cancel.</p>
<p>I have used this vbscript code:</p>
<pre><code><script language="javascript">
function window.confirm(str) {
execScript('n = msgbox("' + str + ... | <p>Unfortunately, there is no cross-browser support for opening a confirmation dialog that is not the default OK/Cancel pair. The solution you provided uses VBScript, which is only available in IE.</p>
<p>I would suggest using a Javascript library that can build a DOM-based dialog instead. Try Jquery UI: <a href="ht... |
Is Clearcase recursive labelling more efficient than element by element labelling? <p>I use Clearcase on a project with ~3700 files. While making a release, there are some directories that have to be labeled recursively. The file count here is ~2400. The files in other directories are selectively labelled. I currently ... | <p>ClearCase operations file by file are always... slow!</p>
<p>You need to apply your label recursively if you can (that is if all the files of a given tree need labeling).<br />
It is also recommended to do that operation on a dynamic view, in order to avoid any side effect related to an update status of a snapshot ... |
Upgrading to VS 2008 Professional from Web Developer Edition <p>I currently have VS 2008 Web Developer SP1 installed on my machine and I've purchased the professional edition. I also have 2003 and 2005 Pro installed.</p>
<p>Should I un-install VS 2008 Web Developer before installing the professional edition? If not,... | <p>Web Developer is a separate product to VS2008, and the install shouldn't change it.</p>
<p>As an aside - with the multi-targetting in VS2008, you might want to save some space by uninstalling VS2005? VS2008 can't target 1.1, though (except maybe via MSBEE) - so maybe keep VS2003 if you still maintain 1.1 code. Obvi... |
C#, List<T>.Contains() - too slow? <p>Could anyone explain me why the generics list's Contains() function is so slow?<br />
I have a List with about a million numbers, and the code that is constantly checking if there's a specific number within these numbers.<br />
I tried doing the same thing using Dictionary and the ... | <p>If you are just checking for existance, <code>HashSet<T></code> in .NET 3.5 is your best option - dictionary-like performance, but no key/value pair - just the values:</p>
<pre><code> HashSet<int> data = new HashSet<int>();
for (int i = 0; i < 1000000; i++)
{
data.Add(rand.Ne... |
Must web apps support back button? <p>I did a system test on a new ASP.NET app. I encountered several exceptions when using the BACK button in my browser (IE 7).</p>
<p>I stated in a review-record that the web-app must support the use of a BACK button (or at least handle it gracefully with for example session-time out... | <p>My personal opinion is that any website that doesn't handle the back button reasonably gracefully if not entirely correctly is taking a huge hit in usability terms. People understand the back button. Moreso, they like it.</p>
<p>Pages can be slow to load. I don't want to have to fully load a page each time I open a... |
JavaScript TextNode update <p>If I have a</p>
<pre><code>var t = document.createTextNode(text)
parent.appendChild(t);
</code></pre>
<p>Is it possible to simply update the contents of <code>t</code>?</p>
<p>I would like to change the text inside the <code>parent</code> without using <code>removeChild</code>, <code>cr... | <p>Be aware that adjacent text nodes are collapsed into one (since there is really no way to distinguish two adjacent text nodes).</p>
<p>The contents of a text node can be updated using it's <code>nodeValue</code> property (see <a href="https://developer.mozilla.org/En/DOM/Node.nodeValue">MDC</a>). </p>
<p>Since a t... |
How to Convert VS2003 proj to VS2005 proj <p>Hi I have test project which I need to convert from VS2003 to VS2005 and I am afraid I got lot of errors and warnings.</p>
<p>The error mostly appeared is ** error C2220: warning treated as error - no 'object' file generated**<br>
The same project will get compiled in VS200... | <p>try to create a new 2005 solution and add the header and source files and compile. If you so you can see if the errors occur on the code or the project itself.</p>
|
doing substring in window.location.hash <p>Somehow window.location.hash is being handled differently in different browsers. If I have a url as follows</p>
<pre><code>http://maps-demo.bytecraft.com.my/postdemo/parcel
#parcel/history/1?as=json&desc[]=ctime&desc[]=history_id
</code></pre>
<p>and I am interes... | <p>Try this:</p>
<pre><code>var match = window.location.href.match(/^[^#]+#([^?]*)\??(.*)/);
var hashPath = match[1];
var hashQuery = match[2];
</code></pre>
<p>This matches the following parts of the hash:</p>
<pre><code>â¦#parcel/history/1?as=json&desc[]=ctime&desc[]=history_id
\______________/ \_______... |
Install Pear Extension with PHP Installer <p>I install PHP using the <a href="http://www.php.net/downloads.php" rel="nofollow">PHP installer</a>. And so, the PEAR package <a href="http://forums.codewalkers.com/pear-packages-47/no-go-pear-bat-file-47151.html" rel="nofollow">is not included</a>. The question now is <a hr... | <p>PEAR is just a set of libraries that ship with PHP, but you can also install PEAR manually.</p>
<p>While you solve the issue with your PHP installation, you can follow the instructions available at <a href="http://pear.php.net/manual/en/installation.getting.php" rel="nofollow">http://pear.php.net/manual/en/installa... |
Accurate Sleep for Java on Windows <p>Does anyone know a Library which provides a Thread.sleep() for Java which has an error not higher than 1-2 Millisecond? </p>
<p>I tried a mixture of Sleep, error measurement and BusyWait but I don't get this reliable on different windows machines. </p>
<p>It can be a native imple... | <p>To improve granularity of sleep you can try the following from this <a href="http://www.javamex.com/tutorials/threads/sleep.shtml">Thread.sleep</a> page.</p>
<blockquote>
<p><strong>Bugs with Thread.sleep() under Windows</strong></p>
<p>If timing is crucial to your
application, then an inelegant but
prac... |
How to switch from Web Designer to Front End Developer/ Web Developer? <p>I want to Switch from Web Designer to Front End Developer or web developer PHP, which skill should I get , Is it Easy to switch from Designer to Developer. I have two years Exp. in Web Designing. Please suggest.</p>
<p>Or should i stick to the ... | <p>On the design side you could learn Flash or Silverlight. UX and UI design are hot right now.</p>
<p>On the programming side, are you good at client side programming? JavaScript AJAX etc.</p>
|
Which compilation option should be set for profiling? <p>I need to profile an application compiled with intel's compiler via VC++.
I'm using VTune to profile my code.</p>
<p>My understanding is that in release mode I won't have the debug information
that is necessary for the profiler to profile my code while in debug ... | <p>You should certainly profile with optimisations enabled (compiler option /O3). /Zi is the Intel compiler switch (on Windows) to enabled debugging information.</p>
<p>Because of the optimisations, some functions may be missing from the debugging information due to inlining, but VTune will cope with that.</p>
|
identity to be incremented only if record is inserted <p>sql server 2005 : i have a column empid in employee table with identity on.if there is some error while inserting data into table .identity is incremented .i want identity to be incremented only if record is inserted .like if i have generated emp id from 1 to 5 a... | <p>Why do you want to do that ?</p>
<p>The identity column should only be used as an 'internal administrative value' for the database, and it should have no 'business value', so why does it matter that there are gaps in that sequence ?<br />
If identity is used correctly, then users of your software will never be face... |
disown a process in ksh <p>The "disown" command works in bash, but not in ksh.</p>
<p>If I have started a process in ksh, how can I "disown" it, so I can exit my shell.
(I know about nohup, but the process has already started!)</p>
| <p>ksh93 supports the disown command. Also, some versions of nohup allow you to specify a process id with the -p option, instead of a command.</p>
|
MYSQL 8 Hours Time out Problem <p>I am using MYSQL 5.0 and Tomcat 5.5.
After 8 hours , MYSQL closes by default closes all idle connections and so I am getting an SQL Exception .Any solution to this problem</p>
| <p>Which connection pool are you using? Most allow a heartbeat command to be executed periodically to keep connections from idling out.</p>
<p>EDIT: Looking at the <a href="http://commons.apache.org/dbcp/configuration.html" rel="nofollow">DBCP configuration page</a>, I think you should set an appropriate (cheap) <code... |
Should Entity Framework Context be Put into Using Statement? <p>The Entity Framework context object implements a Dispose() method which "Releases the resources used by the object context". What does it do really? Could it be a bad thing to always put it into a using {} statement? I've seen it being used both with and w... | <p>If you create a context, you must dispose it later. If you should use the <code>using</code> statement depends on the life time of the context.</p>
<ol>
<li><p>If you create the context in a method and use it only within this method, you should really use the <code>using</code> statement because it gives you the ex... |
Query xml from ASP without XSL <p>I have some very simple XML:</p>
<pre><code><properties>
<property>
<name>BobFish</name>
<explaination>Bob is a fish.</explaination>
</property>
<property>
<name>DaveFish</name>
<explaination>Dave is a fish.</exp... | <p>First add a path to your explanation node to get that rather than the whole property node.</p>
<pre><code>Set objNode = objXML.SelectSingleNode("properties/property[name='" & strName & "']/explanation")
</code></pre>
<p>Next return the innertext of the node to get the text you're after </p>
<pre><code>Get... |
User Profile Import - more than on Search Base <p>In AD we have these two OUs:</p>
<ul>
<li>OU=Accounts - Standard User</li>
<li>OU=Accounts - Restricted User</li>
</ul>
<p>The Search base in the connection for our user profile import contains this:</p>
<ul>
<li>OU=Accounts - Standard User,DC=in,DC=company,DC=com</l... | <p>You could move the search base up to the level above both OU's, then change your filter so that it only pulls User AD objects with certain fields set. For instance, this filter will get all user objects with both the first name and last name fields set to something: </p>
<pre><code>(&(objectCategory=Person)(ob... |
ViewState problem in asp.net Wizard control <p>We are using an ASP.NET (2.0) Wizard control where on each wizard step the user fills in a few fields.</p>
<p>We have found that sometimes for some odd reason the value of the fields in previously filled steps is lost when "postbacking" to another step.</p>
<p>This probl... | <p>These kind of things happen when use Update Panel. In that case, U need to update the update panel.</p>
|
ReportViewer Error in ASPX for Remote SSRS <p>I get the following error: </p>
<blockquote>
<p>In remote mode, the Report Viewer control requires session state be
enabled or Report Server connection information specified in the
config file.</p>
</blockquote>
<p><code>Windows 2008 server</code>, <code>IIS 7</code... | <p>Do you have the Report Server connection information setup in the Config file of your webservice?</p>
<p>Take a look at <a href="http://msdn.microsoft.com/en-us/library/ms251661.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms251661.aspx</a></p>
<p>Working in remote mode, you need to specify the rep... |
Saving bidirectional ManyToMany <p>I have two entity classes annotated in the following way</p>
<pre><code>@Entity
class A {
@ManyToMany(mappedBy="A", cascade=CascadeType.ALL)
private List<B> b;
..
}
@Entity
class B {
@ManyToMany(cascade=CascadeType.ALL)
private List<A> a;
..
}
</code></pre>... | <p>The shortest answer seems to be you cannot and it makes sense. In a bidirectional many-to-many association one side must be master and is used to persist changes to the underlying join table. As JPA will not maintain both side of the association, you could end up with a memory situation that could not be reloaded on... |
When should I use Perl CGI instead of PHP (or vice versa)? <p>For hobby purposes, I have a shared space on a hosting server that is providing, as many of them are, both PHP and Perl CGI. I have read on several places that CGI scripts are obsolete now, I think mainly for performance issues (like <a href="http://stackov... | <p>The "obsolete"-ness of CGI is really only a factor if you are doing big, complex sites with lots of page views. </p>
<p>Many people push the idea that CGI is obsolete don't really understand what CGI is. There is a widespread misconception that CGI is an inherently Perl-based technology. Many people attack CGI as... |
Test data generation tool <p>Is there any tool to generate test data based on specific requirements?</p>
<p>e.g. Size, file type </p>
| <p><a href="http://www.webresourcesdepot.com/test-sample-data-generators/" rel="nofollow">http://www.webresourcesdepot.com/test-sample-data-generators/</a></p>
|
Git/gitosis: How to check validity of user name and email? <p>I have installed git and gitosis and I need to add a check that the user name is valid when something is pushed into the repository. </p>
<p>I reckon the pre-receive hook is the correct hook to place this, but I'm unable to find the real user name and email... | <p>Hmm, from what I gather from <a href="http://git-scm.com/docs/githooks"><code>githooks(5)</code></a> the <code>pre-receive</code> hook gets fed the updated refs on <code>stdin</code>.</p>
<pre><code>#!/bin/sh
while read old new name; do
email=$(git log -1 --pretty=format:%ae $new)
# check email
done
</code... |
How can I load an image saved in database to Visual Studio ReportViewer 2008? <p>Does anyone know how can I get ai image saved in database and show it on ReportViewer 2008?</p>
<p>Thanks!!</p>
| <p>I am currently doing this, however, it was not easy to achieve.</p>
<p>I created a class that generates RDLC files in a MemoryStream. The RDLC memory stream is sent to the reportViewer control, which in turn displays the report.</p>
<p>During the generation of the RDLC file, you can create an embedded image. In ... |
Is there a standard resource for the "default action" of HTML elements? <p>I'm wondering if there is a defined standard for what the default action is of various HTML elements. I've looked at the <a href="http://www.w3.org/TR/1999/REC-html401-19991224/cover.html" rel="nofollow">W3C's HTML specification</a> and while t... | <p>The relevant documents are <a href="http://www.w3.org/TR/DOM-Level-3-Events/events.html" rel="nofollow">DOM3 Events</a> and the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/" rel="nofollow">HTML 5 specification</a>.</p>
<p>They might not have all information you need, but should. So if you f... |
Can I determine the ZoneInfo from an IPAddress? <p>is there anyway I could figure out an estimated <a href="http://en.wikipedia.org/wiki/Zoneinfo" rel="nofollow">(Olson) ZoneInfo value</a> (eg. ("America/Los Angeles", "Europe/London", etc.), for a single public IP address ... in .NET?</p>
<p>I already have a full list... | <p>That is call Geolocalization and they are several products around. Mostly this is a paid service.</p>
<p>You can try <a href="http://www.mantistechs.com/blog/2009/04/13/geolocalizacion-por-ip-mediante-javascript-y-json.html" rel="nofollow">this one</a>... its free. :) </p>
|
Running UI automation tests on build server <p>We use UI Automation and Nunit to create tests UI tests for WPF application.
We've created tests that work fine when you run them from a local machine. Those tests never run successfully on our build server (using TeamCity). Build always hang after opening application wind... | <p>You don't have many options. I will list the two I know, the most preferred option first:</p>
<ul>
<li>Set up a <strong>virtual machine</strong> on your build server. Your builds execute in the virtual machine. You can lock the host (aka your buildserver) keeping things secure. </li>
<li>Keep someone logged on all ... |
What is the preferred process for sellling a personal project/product? <p>I have begun work on a personal project that may end up having some real-world applicability. I am beginning to entertain the idea of selling licenses. I am sure some others here have done this before, and I was wondering what successfully proces... | <p>Some tips:</p>
<p>Obfuscation: Be wary of obfuscating everything. An alternative is to obfuscate just the critical bits (licensing, premium features). The problem with obfuscating everything is that stack traces from error reports are ineffective. When an unexpected exception is caught, you'll want to give the user... |
Loading 32bit DLL using Excel 2007 (Vista 64bit version) <p>I discovered that I can NOT load any 32-bit DLLs using my version of Office 2007. Iâm using Vista 64bit and I assume that Office is also in 64-bit mode. Is it possible to start Excel in 32-bit mode
Or
Is there a way to declare a DLL using VB to load a 32-bit... | <p>You have a bad assumption - <a href="http://arstechnica.com/microsoft/news/2009/04/confirmed-office-2010-will-come-in-32-bit-and-64-bit.ars" rel="nofollow">Office</a> is not currently available in 64 bit. The next version of office (Office 2010) is rumored to be shipped with 32 & 64 bit.</p>
|
Is it possible for IIS 6 to serve unprocessed ASP/ASPX pages? <p>The only thing I was able to find on the subject was a posting from 1997
(<a href="http://insecure.org/sploits/microsoft.asp.iis.html" rel="nofollow">http://insecure.org/sploits/microsoft.asp.iis.html</a>), so I was hoping someone on here might have more ... | <p>IIS will serve raw asp or aspx only if those extensions are removed from application mappings for the site, or if you done some other dumb thing to configure it that way.</p>
|
Java methods and classes, how do they fit together? <p>Currently I am writing a program for an introductory Java class. I have two pieces to my puzzle. Hopefully this is a relatively simple to answer question.</p>
<p>Firstly, here is what I am trying to use as my main program:</p>
<pre><code>import java.util.Scanner;... | <p>You should use:</p>
<pre><code>public static void main(String[] args)
</code></pre>
<p>Instead of Main because the JVM calls this method first. It is a convention.</p>
|
How can I disable the Publish button in EPiServer's content editor? <p>I have an EPiServer project which is using the sequential workflow to validate content changes. This works fine, however we have a slight issue where content reviewers are just clicking Publish when they are happy with an editor's work. What they sh... | <p>Actually, I think you may want to revisit your workflow logic.</p>
<p>If a user with publishing rights publishes a page: that should be considered an approval. You could easily hook up to the Published event to see if the page is part of a currently running workflow.</p>
|
nHibernate bag query issue <p>I have the following scenario in nHibernate (sorry for the screwed up XML, but the text editor was "helping me"a little too much while I was trying to copy it in ;-))</p>
<p><code></p>
<pre><code><class name="TestApp.Components.User,TestApp.Components" table="Users">
<id name=... | <p>Try this:</p>
<pre><code>var groupsCrit = items.CreateCriteria("Groups");
var groupIds = Restrictions.Disjunction();
foreach (var groupid in Groups)
{
groupIds.Add(Restrictions.Eq("Id", groupid)); // "Id" should be the name of the Id property on the Group class
}
groupsCrit.Add(groupIds);
</code></pre>
|
How to select all textareas and textboxes using jQuery? <p>How can I select all textboxes and textareas, e.g:</p>
<pre><code><input type='text' />
</code></pre>
<p>and</p>
<pre><code><textarea></textarea>
</code></pre>
<p>on a page and have the property <code>style.width="90%";</code> applied to t... | <pre><code>$('input[type=text], textarea').css({width: '90%'});
</code></pre>
<p>That uses standard CSS selectors, jQuery also has a set of pseudo-selector filters for various form elements, for example:</p>
<pre><code>$(':text').css({width: '90%'});
</code></pre>
<p>will match all <code><input type="text"></c... |
How do I create image roll over nav buttons in Wordpress <p>It's easy enough in Wordpress to create a nav bar based off wp_list_pages and wp_list_categories. But these output text, and you can't effect each output li in a different way.</p>
<p>I know I can manually create the nav bar, but is there a good way to replac... | <p>Just alter your CSS to display the images as backgrounds to the li elements and the anchors as block elements. For best usability, set the text-indent in your anchors to something line -9999px.</p>
<p>To better understand how to select and style the nav list and its elements, read <a href="http://codex.wordpress.or... |
How to add animated gif to a button? <p>Can you tell me how to add an animation gif to a button in c#. Just by adding gif to resources and setting as button image didn't work very well (next frames apear over the previous ones). The problem seems to be in a way how c# is treating transparency but I don't know how to fi... | <p>In order to do this, you need to do the following:</p>
<ol>
<li><p>Set the BackGroundImageLayout property to Center. This property is set to Tile by default.</p></li>
<li><p>Set the Image property of the button to your animated GIF.</p></li>
</ol>
<p>This will work, since I tested it, and it worked for me.</p>
<... |
How do I save/export an OpenGL surface into Quicktime in Cocoa/Objective C? <p>i've modified the quartz composer slideshow sample from xcode to render a high speed slide show using a custom transition.</p>
<p>The sample uses OpenGL (Cocoa) to render the slide show.
I would like to export this slideshow into a video.</... | <p>check the sample-code in /Developer/Examples/Quartz Composer/Applications/QCTV for code that does exactly what you want.</p>
<p>i believe that in previous versions of osx, the sample-code was called Quartz Composer TV</p>
|
TinyMCE inside hidden div are not displayed as enabled when we put the div visible <p>I am having an issue with tinyMCE (WYSIWYG editor). I am actually adding the textarea inside a HTML element like a DIV which is currently having the style attribute "display:none". </p>
<p>When I am changing the DIV display style to ... | <p>Try calling tinyMCE.init(...) after you unhide the containing div.</p>
|
How do I get the name of a Ruby class? <p>How can I get the class name from an ActiveRecord object?</p>
<p>I have:</p>
<pre><code>result = User.find(1)
</code></pre>
<p>I tried:</p>
<pre><code>result.class
# => User(id: integer, name: string ...)
result.to_s
# => #<User:0x3d07cdc>"
</code></pre>
<p>I n... | <p>You want to call <a href="http://www.ruby-doc.org/core/classes/Module.html#M001699">.name</a> on the object's class:</p>
<pre><code>result.class.name
</code></pre>
|
Where do I get more information on Homoiconicity? <p>I have been experimenting with functional programming and I still dont understand the concept. Do you guys know any good books or tutorials or examples that discuss this concept? Or if you could show small snippets about its usage, that would be great.</p>
| <p>Learn lisp or scheme. The language is the datastructure is the language. Lisp code and Lisp data structures have the same syntax rules.</p>
<p>If you learn tcl, you can work with a language that's procedural <strong>and</strong> the data structure syntax rules are the same as the programming language syntax rules... |
Am I using Yfrog's API correctly to make a HTTP request with POST data? <p>I am trying to use YFrog's API. I think I am using it correctly to try and send a HTTP POST request that is of content type XML. However, as the response body, I am always getting a 404 error for some reason. Here is their API: <a href="http://y... | <p>I think that the problem is basically that ImagesHack does not return a binary file when you give the URL posted above. For me, it returns an HTML document.</p>
<p>I think you should try passing a binary file as the "media" parameter. The photo that your trying to get is located at <a href="http://img253.imageshack... |
Inverse String.Replace - Faster way of doing it? <p>I have a method to replace every character except those I specify. For example, </p>
<pre><code>ReplaceNot("test. stop; or, not", ".;/\\".ToCharArray(), '*');
</code></pre>
<p>would return </p>
<pre>
"****.*****;***,****".
</pre>
<p>Now, this is not an instance of... | <p>Can't you use Regex.Replace like so:</p>
<pre><code>Regex regex = new Regex(@"[^.;/\\]");
string s = regex.Replace("test. stop; or, not", "*");
</code></pre>
|
ZipInputStream doesn't report *actual* (i.e. compressed) bytes read <p>Love this website! My issue is as follows:</p>
<p>I'm reading a zip file that's coming over a network from an HTTP "PUT" request. The request header tells me that the Content-Length is (say) 1Mb. The following code creates the ZipInputStream, an... | <pre><code>import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
/**
*
*/
/**
* @author clint
*
*/
public class ByteCountingInputStream extends FilterInputStream {
public int totalRead = 0;
/**
* @param in
*/
protected ByteCountingInputStream(InputStream in) {
... |
How Asynchronous method invocation pattern in c# works and implemented? <p>I am moving lots of code loosely based on <a href="http://en.wikipedia.org/wiki/Asynchronous%5Fmethod%5Finvocation" rel="nofollow">asynchronous method invocation</a>. How is it typically implemented (preferably in production)?</p>
<ul>
<li>How ... | <p>The pattern is usually as follows:</p>
<ul>
<li>You have a <code>BeginXXX</code> method which receives all in and <code>ref</code> arguments plus a <a href="http://msdn.microsoft.com/en-us/library/system.asynccallback.aspx" rel="nofollow"><code>AsyncCallback</code></a> delegate (may be null) and a state object refe... |
uncommittable transaction is detected at the end of batch. the transaction is rolled back <p>We are having problem with the server migration. We have one application that are having
so much transactions It working fine on the one database server. But when transfer same database to another server. We are facing the foll... | <p>This message means one of the other participants in the transaction voted to rollback. After that the transaction must fail.</p>
<p>So this message is a consequence, rather than a cause. Are you receiving any earlier / other error messages?</p>
<p>What happens when you run the query from Management Studio?</p>
|
How can I refresh a ASP.NET MVC UserControl with jQuery? <p>I have a UserControl that binds directly to database, that is, it's not rendered by any Action. It works independly.</p>
<p>But, from times to times I have to refresh it to get new information from database.
I've already worked with refreshing UserControls in... | <p><strong>UPDATE:</strong></p>
<p>You need to call an action that returns the controls view. Example:</p>
<pre><code>public ActionResult GetFooControl()
{
return View("~/Views/Shared/Foo.ascx");
}
</code></pre>
<p>Then use the jQuery's load function to refresh the inner HTML for the control's container.</p>
<pr... |
struts 2 doesnt do division when value is a double? <p>I have a very weird scenario in struts2. </p>
<p>When I do the following: </p>
<pre><code><s:property value="%{4/2}"/>
</code></pre>
<p>I get 2.</p>
<p>But when I do the following:</p>
<pre><code><s:property value="%{2/4}"/>
</code></pre>
<p>I ge... | <p>You're doing integer arithmetic because your inputs are integers, not doubles: two divided by four <strong>is</strong> zero for integers. Try this:</p>
<pre><code><s:property value="%{2.0/4.0}"/>
</code></pre>
<p>instead.</p>
|
Is this proper in .NET? <p>I am beginner in .NET. One of my firsts task is to change the meta tags dynamically for dynamically generated pages.</p>
<p>So, I came up with this, but am not too sure on what is considered the "proper" way to do it in .NET. </p>
<pre><code><head>
<title><%= title %><... | <p>If the header is marked Runat="Server" then the Page.Title property of the page will do the change in title automatically for you.</p>
<p>The second one for the meta tag I do the same thing, because it works.</p>
|
jquery.ui sortable issue <p>I have created a nested list with drag/drop functionality. My issue is that I want each nesting to sort in itself. For example:</p>
<pre>
-first_level
-first_level
-second_level
-second_level
-first_level
</pre>
<p>"First level" should not be able to go into "Second Level" and vice vers... | <p>Try giving the containment option a complex selector like:</p>
<pre><code>$("#sort_list").sortable({
containment: '#sort_list:not(.sub_list)',
axis: 'y',
revert: true,
items: 'li',
opacity: 0.8
});
</code></pre>
<p>That ... |
Why does my program consume 100% CPU under nVidia NView? <p>I was recently working on a windows program that would sometimes become unresponsive when scrolling through a large list of items in a production environment. Of course it works fine on my desktop. The production Environment is:</p>
<ul>
<li>Windows XP based ... | <p>This is interesting because nView is a 3rd party DLL provided by NVidia. Postings on the internet about <code>nview!NVLoadDatabase</code> suggest that there is an unpatched defect in nview. This is supported by the fact that explorer uses 100% CPU, as confirmed by these reports. See: <a href="http://forums.nvidia.co... |
About dynamics CRM performance <p>My boss asked me to do a research on available CMSes on market because cms we are using currently is rather a mess.</p>
<p>For me as a .NET developer it would be great to choose and implement Dynamics CRM because of extensibility and perfect integration with .NET environment and well-... | <p>The Dynamics CRM Product team has published an excellent whitepaper with guidance and benchmarks for 500 concurrent users. You can learn a lot by studying this paper. The link is here: </p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=3bf7ecda-7eaf-4f1c-bbfe-cae19bc8bb78&displaylang=en... |
Grails Duplicate Error Messages <p>I'm new to grails and I have a problem: </p>
<p>I have this snippet of GSP: </p>
<pre><code><g:form url="[controller:'main',action:'login']">
<label for="name">Usuario:</label><br/>
<input type="text" name="name" /><br/>
<label for="pa... | <p>When you inject command objects into controller actions, Grails executes <code>validate()</code> automatically, so there is no need to call it manually. Try</p>
<pre><code>if(!cmd.hasErrors())
</code></pre>
<p>instead of</p>
<pre><code>if(cmd.validate())
</code></pre>
<p>It seems, that every call to <code>valida... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.