question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
201,320
201,430
Is it possible to host a TCP endpoint in an IIS6 hosted service?
I created a wcf service based on ServiceHostFactory, and i'm hosting it in IIS6. If i use a HTTP endpoint everything works just fine, but when i try to switch to TCP it goes bad. Is it even possible to do this in II6? I have a more specific question posted here, that asks for a solution, but i would be happy with (for ...
IIS 5.1 and IIS 6 can only host HTTP bindings. IIS7 has WAS (Windows Activation Service) which allows hosting of endpoints bound to any transport protocol... so it would be capable of TCP. If you must host with IIS 6, then you're stuck with the HTTP bindings. If not, consider self-hosting in a Windows Service.
Is it possible to host a TCP endpoint in an IIS6 hosted service? I created a wcf service based on ServiceHostFactory, and i'm hosting it in IIS6. If i use a HTTP endpoint everything works just fine, but when i try to switch to TCP it goes bad. Is it even possible to do this in II6? I have a more specific question poste...
TITLE: Is it possible to host a TCP endpoint in an IIS6 hosted service? QUESTION: I created a wcf service based on ServiceHostFactory, and i'm hosting it in IIS6. If i use a HTTP endpoint everything works just fine, but when i try to switch to TCP it goes bad. Is it even possible to do this in II6? I have a more speci...
[ "wcf", "iis-6" ]
6
11
3,751
1
0
2008-10-14T14:14:11.377000
2008-10-14T14:37:07.133000
201,323
201,378
How can I validate an email address using a regular expression?
Over the years I have slowly developed a regular expression that validates most email addresses correctly, assuming they don't use an IP address as the server part. I use it in several PHP programs, and it works most of the time. However, from time to time I get contacted by someone that is having trouble with a site t...
The fully RFC 822 compliant regex is inefficient and obscure because of its length. Fortunately, RFC 822 was superseded twice and the current specification for email addresses is RFC 5322. RFC 5322 leads to a regex that can be understood if studied for a few minutes and is efficient enough for actual use. One RFC 5322 ...
How can I validate an email address using a regular expression? Over the years I have slowly developed a regular expression that validates most email addresses correctly, assuming they don't use an IP address as the server part. I use it in several PHP programs, and it works most of the time. However, from time to time...
TITLE: How can I validate an email address using a regular expression? QUESTION: Over the years I have slowly developed a regular expression that validates most email addresses correctly, assuming they don't use an IP address as the server part. I use it in several PHP programs, and it works most of the time. However,...
[ "regex" ]
4,168
3,386
2,532,323
77
0
2008-10-14T14:14:34.980000
2008-10-14T14:26:43.723000
201,327
201,335
MSTest run fails because source assembly is not trusted
I just added xUnit to our test project (for the Asserts, we're still using MSTest as the framework) and immediately the test runs refused to execute any of the tests. This is the error message: Failed to queue test run '{.... }' Test run deployment issue: The location of the file or directory '...xUnit.dll' is not trus...
It took me a few tries to find the answer in Google, so I'm putting it here in case anyone else runs into the same problem. A detailed description can be found at this blog posting. Basically, the fix invovles right-clicking on the dll file (xunit.dll for example) in Windows Explorer, going to Properties, and clicking ...
MSTest run fails because source assembly is not trusted I just added xUnit to our test project (for the Asserts, we're still using MSTest as the framework) and immediately the test runs refused to execute any of the tests. This is the error message: Failed to queue test run '{.... }' Test run deployment issue: The loca...
TITLE: MSTest run fails because source assembly is not trusted QUESTION: I just added xUnit to our test project (for the Asserts, we're still using MSTest as the framework) and immediately the test runs refused to execute any of the tests. This is the error message: Failed to queue test run '{.... }' Test run deployme...
[ "mstest" ]
62
98
16,651
10
0
2008-10-14T14:15:50.407000
2008-10-14T14:17:43.943000
201,354
201,399
Is log4net much slower than System.Diagnostics.Trace?
I'm investigating the differences between using log4net and System.Diagnostics.Trace for logging, and I'm curious about the performance differences I've observed. I created a test application to compare the performance of both logging methods in several scenarios, and I'm finding that log4net is significantly slower th...
yes log4xxx is slower than trace, since trace is normally a near kernel tool, while log4xxx is a much more powerful tool. Personally I prefer log4xxx because of it's fexibility, but if you want something that doesn't impact as much, and you don't really need logs for production,say in debug only trace should be enough....
Is log4net much slower than System.Diagnostics.Trace? I'm investigating the differences between using log4net and System.Diagnostics.Trace for logging, and I'm curious about the performance differences I've observed. I created a test application to compare the performance of both logging methods in several scenarios, a...
TITLE: Is log4net much slower than System.Diagnostics.Trace? QUESTION: I'm investigating the differences between using log4net and System.Diagnostics.Trace for logging, and I'm curious about the performance differences I've observed. I created a test application to compare the performance of both logging methods in se...
[ "performance", "logging", "log4net" ]
18
12
7,150
5
0
2008-10-14T14:22:44.137000
2008-10-14T14:31:26.913000
201,355
495,387
How can I stop Excel 2003 from hanging after opening a spreadsheet in IE?
I have a web application which provides Excel files via IE 7. It requests the files with an HTTP GET from a URL which returns the data with a content type of 'application/vnd.ms-excel'. It then opens the spreadsheets in an IFrame. This all works fine unless Excel is already open when a spreadsheet is downloaded. In thi...
Further to Robert's answer, the following line of (Java) code fixes this problem, in that it prevents Excel from hanging: response.setHeader("Content-Disposition", "attachment; filename=\"" + filename + "\""); [NB 'response' is an HttpServletResponse] However, it forces the spreadsheet to be loaded into an Excel window...
How can I stop Excel 2003 from hanging after opening a spreadsheet in IE? I have a web application which provides Excel files via IE 7. It requests the files with an HTTP GET from a URL which returns the data with a content type of 'application/vnd.ms-excel'. It then opens the spreadsheets in an IFrame. This all works ...
TITLE: How can I stop Excel 2003 from hanging after opening a spreadsheet in IE? QUESTION: I have a web application which provides Excel files via IE 7. It requests the files with an HTTP GET from a URL which returns the data with a content type of 'application/vnd.ms-excel'. It then opens the spreadsheets in an IFram...
[ "excel", "internet-explorer", "internet-explorer-7" ]
1
1
2,077
5
0
2008-10-14T14:23:01.937000
2009-01-30T12:38:28.040000
201,374
201,387
Project Euler Question 3 Help
I'm trying to work through Project Euler and I'm hitting a barrier on problem 03. I have an algorithm that works for smaller numbers, but problem 3 uses a very, very large number. Problem 03: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143? Here is my solution...
For starters, instead of beginning your search at n / 2, start it at the square root of n. You'll get half of the factors, the other half being their complement. eg: n = 27 start at floor(sqrt(27)) = 5 is 5 a factor? no is 4 a factor? no is 3 a factor? yes. 27 / 3 = 9. 9 is also a factor. is 2 a factor? no. factors are...
Project Euler Question 3 Help I'm trying to work through Project Euler and I'm hitting a barrier on problem 03. I have an algorithm that works for smaller numbers, but problem 3 uses a very, very large number. Problem 03: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600...
TITLE: Project Euler Question 3 Help QUESTION: I'm trying to work through Project Euler and I'm hitting a barrier on problem 03. I have an algorithm that works for smaller numbers, but problem 3 uses a very, very large number. Problem 03: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor...
[ "c#", "algorithm", "language-agnostic", "primes" ]
17
15
15,712
16
0
2008-10-14T14:26:06.080000
2008-10-14T14:28:28.820000
201,377
201,390
What's the best way to get aggregate results from NHibernate?
For example, I am trying to get a min date, a max date, and a sum in different instances. I am trying to avoid hard coding a SQL string or looping through an IList to get these values.
You can run straight queries through NHibernate. Or add additional order by info so the resulting objects are in order via the parameter you're interested in. Order descending and your 0th element is what you want for max and mins. etc etc. There's more than one way to skin the hibernating cat.
What's the best way to get aggregate results from NHibernate? For example, I am trying to get a min date, a max date, and a sum in different instances. I am trying to avoid hard coding a SQL string or looping through an IList to get these values.
TITLE: What's the best way to get aggregate results from NHibernate? QUESTION: For example, I am trying to get a min date, a max date, and a sum in different instances. I am trying to avoid hard coding a SQL string or looping through an IList to get these values. ANSWER: You can run straight queries through NHibernat...
[ "nhibernate" ]
2
2
1,908
2
0
2008-10-14T14:26:17.267000
2008-10-14T14:29:48.460000
201,386
203,686
What exactly is Intentional Programming
On my reading spree, I stumbled upon something called Intentional Programming. I understood it somewhat, but I not fully. If anyone can explain it in better detail, please do. Is it being used in any real application?
You got me started on this one... Looks like C. Simonyi wanted to step to the next level of abstraction from High level languages. Reduce the dependency of customers on developers to make every change.. in code (cryptic for people not in development). So he invents this new product called IP, which has a WYSIWYG type G...
What exactly is Intentional Programming On my reading spree, I stumbled upon something called Intentional Programming. I understood it somewhat, but I not fully. If anyone can explain it in better detail, please do. Is it being used in any real application?
TITLE: What exactly is Intentional Programming QUESTION: On my reading spree, I stumbled upon something called Intentional Programming. I understood it somewhat, but I not fully. If anyone can explain it in better detail, please do. Is it being used in any real application? ANSWER: You got me started on this one... L...
[ "programming-languages", "intentional-programming" ]
18
11
5,709
7
0
2008-10-14T14:28:24.703000
2008-10-15T03:58:21.277000
201,392
201,409
How can I recover files from a corrupted .tar.gz archive?
I have a large number of files in a.tar.gz archive. Checking the file type with the command file SMS.tar.gz gives the response gzip compressed data - deflate method, max compression When I try to extract the archive with gunzip, after a delay I receive the message gunzip: SMS.tar.gz: unexpected end of file Is there any...
Are you sure that it is a gzip file? I would first run 'file SMS.tar.gz' to validate that. Then I would read the The gzip Recovery Toolkit page.
How can I recover files from a corrupted .tar.gz archive? I have a large number of files in a.tar.gz archive. Checking the file type with the command file SMS.tar.gz gives the response gzip compressed data - deflate method, max compression When I try to extract the archive with gunzip, after a delay I receive the messa...
TITLE: How can I recover files from a corrupted .tar.gz archive? QUESTION: I have a large number of files in a.tar.gz archive. Checking the file type with the command file SMS.tar.gz gives the response gzip compressed data - deflate method, max compression When I try to extract the archive with gunzip, after a delay I...
[ "gzip", "archive", "corrupt", "recover" ]
31
20
80,069
3
0
2008-10-14T14:30:03.560000
2008-10-14T14:32:54.490000
201,401
201,557
ASP.NET Masterpages and viewstate
I am looking to improve the performance of my site, not because it is performing badly but just as a general exercise. The usual suggestion for asp.net sites is to remove viewstate wherever possible. I believe this can be done by each control on a page separately or for the whole page. My question is if I disable the p...
Yes, the page is the originator of the page flow. Thus, disabling viewstate for the page takes the viewstate rendering out of the OnInit process. A better question would be why does disabling the viewstate for the master page do the same?
ASP.NET Masterpages and viewstate I am looking to improve the performance of my site, not because it is performing badly but just as a general exercise. The usual suggestion for asp.net sites is to remove viewstate wherever possible. I believe this can be done by each control on a page separately or for the whole page....
TITLE: ASP.NET Masterpages and viewstate QUESTION: I am looking to improve the performance of my site, not because it is performing badly but just as a general exercise. The usual suggestion for asp.net sites is to remove viewstate wherever possible. I believe this can be done by each control on a page separately or f...
[ "asp.net", "master-pages", "viewstate" ]
3
1
3,008
3
0
2008-10-14T14:31:31.123000
2008-10-14T15:06:17.730000
201,403
201,417
on a system with multiple monitors, how to list monitors and maximize a form into one of them?
I am working on a.NET application that displays multiple charts. My users would like an easy way to say "take chart #3 and maximize it on my fourth monitor". How can I determine the number of monitors so I can give them a selection of "monitor #1, monitor #2, etc"? (Not every user has the same number of monitors.) And ...
The Screen class helps you a lot by finding the available screens. When you "maximize" a form, the form will automatically maximize to the size of the Screen the form is in. You can position it yourself, or let Windows take care of it, by just placing the form on the right "Screen", and maximizing it. Or use the Workin...
on a system with multiple monitors, how to list monitors and maximize a form into one of them? I am working on a.NET application that displays multiple charts. My users would like an easy way to say "take chart #3 and maximize it on my fourth monitor". How can I determine the number of monitors so I can give them a sel...
TITLE: on a system with multiple monitors, how to list monitors and maximize a form into one of them? QUESTION: I am working on a.NET application that displays multiple charts. My users would like an easy way to say "take chart #3 and maximize it on my fourth monitor". How can I determine the number of monitors so I c...
[ ".net", "multiple-monitors" ]
1
3
2,121
3
0
2008-10-14T14:32:07.207000
2008-10-14T14:34:53.223000
201,413
201,483
C Analog To STL
Just because I'm curious--is there any C analog to the functionality of the STL in C++? I've seen mention of a GTK+ library called glib that a few people consider fills the bill but are there other libraries that would provide STL functionality in C?
Yes, glib is a pretty good choice: it includes a lot of utilities for manipulating containers like linked lists, arrays, hash tables, etc. And there is also an object-oriented framework called GObject that you can use to make objects with signals and slots in C (albeit with rather verbose function call names like gobje...
C Analog To STL Just because I'm curious--is there any C analog to the functionality of the STL in C++? I've seen mention of a GTK+ library called glib that a few people consider fills the bill but are there other libraries that would provide STL functionality in C?
TITLE: C Analog To STL QUESTION: Just because I'm curious--is there any C analog to the functionality of the STL in C++? I've seen mention of a GTK+ library called glib that a few people consider fills the bill but are there other libraries that would provide STL functionality in C? ANSWER: Yes, glib is a pretty good...
[ "c", "stl" ]
31
28
7,882
4
0
2008-10-14T14:33:55.457000
2008-10-14T14:52:19.787000
201,426
201,516
VS2005 + cant select windows service as project type
i was just about to finish up my project and install it as a windows service. I have the installer, etc. - everything i need. When i went to choose Application Type, Windows service does not appear as an option. Here is the kicker. When I dev in VB.NET, i have that option. The project mentioned above is in c#. Also, if...
You need an installer class in your project, then you need a Setup project which will incorporate the output of the project's build. See here: http://msdn.microsoft.com/en-us/library/aa984464(VS.71).aspx for a great walkthrough.
VS2005 + cant select windows service as project type i was just about to finish up my project and install it as a windows service. I have the installer, etc. - everything i need. When i went to choose Application Type, Windows service does not appear as an option. Here is the kicker. When I dev in VB.NET, i have that o...
TITLE: VS2005 + cant select windows service as project type QUESTION: i was just about to finish up my project and install it as a windows service. I have the installer, etc. - everything i need. When i went to choose Application Type, Windows service does not appear as an option. Here is the kicker. When I dev in VB....
[ "c#", ".net", "visual-studio" ]
1
2
392
3
0
2008-10-14T14:36:11.350000
2008-10-14T14:57:47.233000
201,436
201,847
C# FTP with CD Disabled
I'm trying to get the following code working: string url = String.Format(@"SOMEURL"); string user = "SOMEUSER"; string password = "SOMEPASSWORD"; FtpWebRequest ftpclientRequest = (FtpWebRequest)WebRequest.Create(new Uri(url)); ftpclientRequest.Method = WebRequestMethods.Ftp.ListDirectory; ftpclientRequest.UsePassive =...
I just tested this on one of our dev servers and indeed there is a CWD issued by the.NET FtpWebRequest: new connection from 172.16.3.210 on 172.16.3.210:21 (Explicit SSL) hostname resolved: devpc sending welcome message. 220 Gene6 FTP Server v3.10.0 (Build 2) ready... USER testuser testuser, 331 Password required for t...
C# FTP with CD Disabled I'm trying to get the following code working: string url = String.Format(@"SOMEURL"); string user = "SOMEUSER"; string password = "SOMEPASSWORD"; FtpWebRequest ftpclientRequest = (FtpWebRequest)WebRequest.Create(new Uri(url)); ftpclientRequest.Method = WebRequestMethods.Ftp.ListDirectory; ftpcl...
TITLE: C# FTP with CD Disabled QUESTION: I'm trying to get the following code working: string url = String.Format(@"SOMEURL"); string user = "SOMEUSER"; string password = "SOMEPASSWORD"; FtpWebRequest ftpclientRequest = (FtpWebRequest)WebRequest.Create(new Uri(url)); ftpclientRequest.Method = WebRequestMethods.Ftp.Li...
[ "c#", "ftp" ]
6
11
5,678
5
0
2008-10-14T14:38:21.797000
2008-10-14T16:17:25.810000
201,443
201,472
Refreshing LinQ2SQL Model in Designer without losing all Properties
so I'm using LinQ2SQL quite heavily in my current application, and although I have most stuff in partial classes, some things have to be adjusted in the VS Designer (like Accessors for fields I wrap). Then, sometimes I like to name Fields differently in the Model than they do in the DB. So, my problem now is. When goin...
See this question. Basically this isn't implemented in VS2008. Don't ask me why, maybe the guys at MS were so occupied that they completely forgot about this important feature.
Refreshing LinQ2SQL Model in Designer without losing all Properties so I'm using LinQ2SQL quite heavily in my current application, and although I have most stuff in partial classes, some things have to be adjusted in the VS Designer (like Accessors for fields I wrap). Then, sometimes I like to name Fields differently i...
TITLE: Refreshing LinQ2SQL Model in Designer without losing all Properties QUESTION: so I'm using LinQ2SQL quite heavily in my current application, and although I have most stuff in partial classes, some things have to be adjusted in the VS Designer (like Accessors for fields I wrap). Then, sometimes I like to name Fi...
[ "visual-studio-2008", "linq-to-sql", "dbml" ]
1
2
327
1
0
2008-10-14T14:40:28.923000
2008-10-14T14:48:49.780000
201,446
202,105
How do I obtain the id of a workflow created in Sharepoint Designer?
I've written an event receiver that programmatically kicks off a workflow, but it needs the id (guid) of the workflow to start. How do I go about obtaining the id of the workflow(s) I just created in Sharepoint Designer?
Since you created the workflow in SPD, you should know the list that the workflow is associated with and also the name of the workflow. Armed with that information, this should work: Guid workflowGuid = list.WorkflowAssociations.GetAssociationByName(WORKFLOW_NAME, CULTURE_INFO).Id; If you don't know or don't want to de...
How do I obtain the id of a workflow created in Sharepoint Designer? I've written an event receiver that programmatically kicks off a workflow, but it needs the id (guid) of the workflow to start. How do I go about obtaining the id of the workflow(s) I just created in Sharepoint Designer?
TITLE: How do I obtain the id of a workflow created in Sharepoint Designer? QUESTION: I've written an event receiver that programmatically kicks off a workflow, but it needs the id (guid) of the workflow to start. How do I go about obtaining the id of the workflow(s) I just created in Sharepoint Designer? ANSWER: Sin...
[ "sharepoint", "moss", "workflow" ]
1
2
5,221
1
0
2008-10-14T14:41:15.037000
2008-10-14T17:37:39.750000
201,450
1,367,758
Visual Studio debugger tips & tricks for .NET
I've been working for years with VS's debugger, but every now and then I come across a feature I have never noticed before, and think "Damn! How could I have missed that? It's so useful!" [Disclaimer: These tips work in VS 2005 on a C# project, no guarantees for older incarnations of VS or other languages] Keep track o...
Two in-code tricks: I really like the System.Diagnostics.DebuggerStepThrough attribute; you can attach it to a class, method or property to make VS not enter the code by default when debugging. I prefer it over the DebuggerHidden attribute as it will still allow you to put breakpoints in the ignored code if you really ...
Visual Studio debugger tips & tricks for .NET I've been working for years with VS's debugger, but every now and then I come across a feature I have never noticed before, and think "Damn! How could I have missed that? It's so useful!" [Disclaimer: These tips work in VS 2005 on a C# project, no guarantees for older incar...
TITLE: Visual Studio debugger tips & tricks for .NET QUESTION: I've been working for years with VS's debugger, but every now and then I come across a feature I have never noticed before, and think "Damn! How could I have missed that? It's so useful!" [Disclaimer: These tips work in VS 2005 on a C# project, no guarante...
[ ".net", "visual-studio", "debugging" ]
70
7
9,072
14
0
2008-10-14T14:43:12.973000
2009-09-02T13:41:55.603000
201,453
201,463
Can I make my Applet end more gracefully?
I have a JApplet which I contains various Swing components. It also starts a couple of extra threads in the init() and generally does other pretty standard applet-y things. If I close the browser window containing the Applet, the JRE doesn't die (the icon remains in the system tray) until all the browser's windows have...
I believe the JRE is loaded as a plugin to the browser, and the icon is supposed to remain in the system tray until the browser ends. The reasoning behind this is that if you load one applet, leaving the JRE running will accelerate future applets' loading times.
Can I make my Applet end more gracefully? I have a JApplet which I contains various Swing components. It also starts a couple of extra threads in the init() and generally does other pretty standard applet-y things. If I close the browser window containing the Applet, the JRE doesn't die (the icon remains in the system ...
TITLE: Can I make my Applet end more gracefully? QUESTION: I have a JApplet which I contains various Swing components. It also starts a couple of extra threads in the init() and generally does other pretty standard applet-y things. If I close the browser window containing the Applet, the JRE doesn't die (the icon rema...
[ "java", "applet" ]
1
4
774
1
0
2008-10-14T14:43:31.287000
2008-10-14T14:46:29.707000
201,461
201,771
Shortest Sudoku Solver in Python - How does it work?
I was playing around with my own Sudoku solver and was looking for some pointers to good and fast design when I came across this: def r(a):i=a.find('0');~i or exit(a);[m in[(i-j)%9*(i/9^j/9)*(i/27^j/27|i%9/3^j%9/3)or a[j]for j in range(81)]or r(a[:i]+m+a[i+1:])for m in'%d'%5**18] from sys import*;r(argv[1]) My own impl...
Well, you can make things a little easier by fixing up the syntax: def r(a): i = a.find('0') ~i or exit(a) [m in[(i-j)%9*(i/9^j/9)*(i/27^j/27|i%9/3^j%9/3)or a[j]for j in range(81)] or r(a[:i]+m+a[i+1:])for m in'%d'%5**18] from sys import * r(argv[1]) Cleaning up a little: from sys import exit, argv def r(a): i = a.find...
Shortest Sudoku Solver in Python - How does it work? I was playing around with my own Sudoku solver and was looking for some pointers to good and fast design when I came across this: def r(a):i=a.find('0');~i or exit(a);[m in[(i-j)%9*(i/9^j/9)*(i/27^j/27|i%9/3^j%9/3)or a[j]for j in range(81)]or r(a[:i]+m+a[i+1:])for m ...
TITLE: Shortest Sudoku Solver in Python - How does it work? QUESTION: I was playing around with my own Sudoku solver and was looking for some pointers to good and fast design when I came across this: def r(a):i=a.find('0');~i or exit(a);[m in[(i-j)%9*(i/9^j/9)*(i/27^j/27|i%9/3^j%9/3)or a[j]for j in range(81)]or r(a[:i...
[ "python", "algorithm" ]
83
224
80,822
4
0
2008-10-14T14:46:15.603000
2008-10-14T16:00:21.413000
201,468
201,639
Are Dynamic Prepared Statements Bad? (with php + mysqli)
I like the flexibility of Dynamic SQL and I like the security + improved performance of Prepared Statements. So what I really want is Dynamic Prepared Statements, which is troublesome to make because bind_param and bind_result accept "fixed" number of arguments. So I made use of an eval() statement to get around this p...
I think it is dangerous to use eval() here. Try this: iterate the params array to build the SQL string with question marks "SELECT * FROM t1 WHERE p1 =? AND p2 =?" call prepare() on that use call_user_func_array() to make the call to bind_param(), passing in the dynamic params array. The code: call_user_func_array(arra...
Are Dynamic Prepared Statements Bad? (with php + mysqli) I like the flexibility of Dynamic SQL and I like the security + improved performance of Prepared Statements. So what I really want is Dynamic Prepared Statements, which is troublesome to make because bind_param and bind_result accept "fixed" number of arguments. ...
TITLE: Are Dynamic Prepared Statements Bad? (with php + mysqli) QUESTION: I like the flexibility of Dynamic SQL and I like the security + improved performance of Prepared Statements. So what I really want is Dynamic Prepared Statements, which is troublesome to make because bind_param and bind_result accept "fixed" num...
[ "php", "sql", "dynamic", "eval", "prepared-statement" ]
7
14
6,854
3
0
2008-10-14T14:48:13.900000
2008-10-14T15:23:22.830000
201,473
212,700
SQL Reporting Services DataConnection Update
Is it possible to change the connection string of a published sql reporting services report? I can see the binary field called DataSource in the ReportServer database, but since it's stored as binary I don't think it's easily updatable. Do I need to republish the report with the correct data source? I'm hoping not sinc...
SQL Reporting Services 2000 has a [web service]( http://msdn.microsoft.com/en-us/library/aa274396(SQL.80).aspx) that you can use to change the data source. Given that, the following, allows for changing of a data source to a shared data source. This was [adapted from MSDN]( http://msdn.microsoft.com/en-us/library/aa225...
SQL Reporting Services DataConnection Update Is it possible to change the connection string of a published sql reporting services report? I can see the binary field called DataSource in the ReportServer database, but since it's stored as binary I don't think it's easily updatable. Do I need to republish the report with...
TITLE: SQL Reporting Services DataConnection Update QUESTION: Is it possible to change the connection string of a published sql reporting services report? I can see the binary field called DataSource in the ReportServer database, but since it's stored as binary I don't think it's easily updatable. Do I need to republi...
[ "sql-server", "reporting-services", "connection-string", "datasource", "publish" ]
2
1
1,318
1
0
2008-10-14T14:48:59.247000
2008-10-17T15:42:44.007000
201,476
201,508
Simple java client code for Web Service - something to do with QName?
I am getting the following error when I get to the line that invokes a REALLY BASIC web service I have running on Tomcat/Axis. Element or attribute do not match QName production: QName::=(NCName':')?NCName Have I got something wrong with QName?- I can't even find any useful information about it. My client code is below...
As the exception says, you call the QName constructor incorrectly: new QName("http://testPackage.fc.com/, doBasicStuff") is incorrect. I think you have to pass two strings, one containing the namespace, one the localname. The documentation will typically contain a description on how to use that class.
Simple java client code for Web Service - something to do with QName? I am getting the following error when I get to the line that invokes a REALLY BASIC web service I have running on Tomcat/Axis. Element or attribute do not match QName production: QName::=(NCName':')?NCName Have I got something wrong with QName?- I ca...
TITLE: Simple java client code for Web Service - something to do with QName? QUESTION: I am getting the following error when I get to the line that invokes a REALLY BASIC web service I have running on Tomcat/Axis. Element or attribute do not match QName production: QName::=(NCName':')?NCName Have I got something wrong...
[ "java", "web-services", "client", "rpc" ]
2
7
56,717
5
0
2008-10-14T14:50:10.103000
2008-10-14T14:56:02.993000
201,479
201,510
What is base 64 encoding used for?
I've heard people talking about "base 64 encoding" here and there. What is it used for?
When you have some binary data that you want to ship across a network, you generally don't do it by just streaming the bits and bytes over the wire in a raw format. Why? because some media are made for streaming text. You never know -- some protocols may interpret your binary data as control characters (like a modem), ...
What is base 64 encoding used for? I've heard people talking about "base 64 encoding" here and there. What is it used for?
TITLE: What is base 64 encoding used for? QUESTION: I've heard people talking about "base 64 encoding" here and there. What is it used for? ANSWER: When you have some binary data that you want to ship across a network, you generally don't do it by just streaming the bits and bytes over the wire in a raw format. Why? ...
[ "encoding", "base64", "encode" ]
1,037
1,235
542,023
19
0
2008-10-14T14:50:52.350000
2008-10-14T14:56:19.063000
201,501
201,645
Where is my Object being disposed?
I have a strange issue: I am using SPContext.Current.Web in a.aspx page, but at the end, I get a "Trying to use an SPWeb object that has been closed or disposed and is no longer valid." error message. From what I see, SPContext.Current.Web is Disposed by someone, but I have no idea where. I just wonder: With Visual Stu...
Check if this helps: Add a new breakpoint using Debug > New Breakpoint > Break at Function... (Ctrl+B). Enter Microsoft.SharePoint.SPWeb.Dispose in the Function edit box. Dismiss the dialog box that says that Intellisense could not find the specified location. Run under the debugger. When the breakpoint is hit you can ...
Where is my Object being disposed? I have a strange issue: I am using SPContext.Current.Web in a.aspx page, but at the end, I get a "Trying to use an SPWeb object that has been closed or disposed and is no longer valid." error message. From what I see, SPContext.Current.Web is Disposed by someone, but I have no idea wh...
TITLE: Where is my Object being disposed? QUESTION: I have a strange issue: I am using SPContext.Current.Web in a.aspx page, but at the end, I get a "Trying to use an SPWeb object that has been closed or disposed and is no longer valid." error message. From what I see, SPContext.Current.Web is Disposed by someone, but...
[ "c#", ".net", "sharepoint" ]
3
6
2,664
3
0
2008-10-14T14:54:48.643000
2008-10-14T15:24:36.010000
201,504
201,551
Is it possible to communicate with the Visual Studio debugger programmatically while debugging?
I would like to control options on the debugger without using the debugging GUI's, preferably from inside the code being debugged. I would think that would be quite difficult, but maybe my debugged code can request a service from independent code that will communicate with the debugger. This relates to another question...
You can write Visual Studio macros that can do anything the GUI can, but they can get rather involved. See the MSDN documentation on Automation and Extensibility for Visual Studio Doing this from the code being debugged would be tricky, you would definitely need some new form of communication with VS, maybe a custom ad...
Is it possible to communicate with the Visual Studio debugger programmatically while debugging? I would like to control options on the debugger without using the debugging GUI's, preferably from inside the code being debugged. I would think that would be quite difficult, but maybe my debugged code can request a service...
TITLE: Is it possible to communicate with the Visual Studio debugger programmatically while debugging? QUESTION: I would like to control options on the debugger without using the debugging GUI's, preferably from inside the code being debugged. I would think that would be quite difficult, but maybe my debugged code can...
[ "visual-studio", "debugging" ]
4
3
4,618
2
0
2008-10-14T14:55:20.327000
2008-10-14T15:05:40.697000
201,515
201,737
urllib.urlopen works but urllib2.urlopen doesn't
I have a simple website I'm testing. It's running on localhost and I can access it in my web browser. The index page is simply the word "running". urllib.urlopen will successfully read the page but urllib2.urlopen will not. Here's a script which demonstrates the problem (this is the actual script and not a simplificati...
Sounds like you have proxy settings defined that urllib2 is picking up on. When it tries to proxy "127.0.0.01/", the proxy gives up and returns a 504 error. From Obscure python urllib2 proxy gotcha: proxy_support = urllib2.ProxyHandler({}) opener = urllib2.build_opener(proxy_support) print opener.open("http://127.0.0.1...
urllib.urlopen works but urllib2.urlopen doesn't I have a simple website I'm testing. It's running on localhost and I can access it in my web browser. The index page is simply the word "running". urllib.urlopen will successfully read the page but urllib2.urlopen will not. Here's a script which demonstrates the problem ...
TITLE: urllib.urlopen works but urllib2.urlopen doesn't QUESTION: I have a simple website I'm testing. It's running on localhost and I can access it in my web browser. The index page is simply the word "running". urllib.urlopen will successfully read the page but urllib2.urlopen will not. Here's a script which demonst...
[ "python", "urllib2", "urllib" ]
11
16
11,509
4
0
2008-10-14T14:57:41.213000
2008-10-14T15:49:47.223000
201,518
203,613
Removing CSS Class Attribute From Tag in a Custom Server Control
Greetings! I've created a custom button class to render the following: However, it renders like this instead (note the extraneous "class" attribute in the INPUT tag): My custom button class looks like this: [ToolboxData(@"<{0}:MyButton runat=server> ")] public class MyButton: Button { public override void RenderBeginTa...
You can do this: private string _heldCssClass = null; public override void RenderBeginTag(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Class, this.CssClass); writer.RenderBeginTag("span"); _heldCssClass = this.CssClass; this.CssClass = String.Empty; base.RenderBeginTag(writer); } public overrid...
Removing CSS Class Attribute From Tag in a Custom Server Control Greetings! I've created a custom button class to render the following: However, it renders like this instead (note the extraneous "class" attribute in the INPUT tag): My custom button class looks like this: [ToolboxData(@"<{0}:MyButton runat=server> ")] p...
TITLE: Removing CSS Class Attribute From Tag in a Custom Server Control QUESTION: Greetings! I've created a custom button class to render the following: However, it renders like this instead (note the extraneous "class" attribute in the INPUT tag): My custom button class looks like this: [ToolboxData(@"<{0}:MyButton r...
[ "c#", "asp.net", "custom-server-controls" ]
0
1
3,379
3
0
2008-10-14T14:58:03.067000
2008-10-15T03:22:28.883000
201,524
201,554
How to undo a delete operation in SQL Server 2005?
Our Test DB is suddenly missing rows. We want them back. Is there a way to sift through everything that has happened to the database today? Each SQL statement? I presume this kind of stuff is in the transaction log, but am not sure how to view it. Is there a way to undo delete operations? BTW: Yes, we do have a backup,...
You can do this with some of Red Gate 's tools, but it costs. Take a look at SQL Log Rescue. Otherwise, I'd be tempted to do a restore.
How to undo a delete operation in SQL Server 2005? Our Test DB is suddenly missing rows. We want them back. Is there a way to sift through everything that has happened to the database today? Each SQL statement? I presume this kind of stuff is in the transaction log, but am not sure how to view it. Is there a way to und...
TITLE: How to undo a delete operation in SQL Server 2005? QUESTION: Our Test DB is suddenly missing rows. We want them back. Is there a way to sift through everything that has happened to the database today? Each SQL statement? I presume this kind of stuff is in the transaction log, but am not sure how to view it. Is ...
[ "sql-server-2005", "transaction-log" ]
2
1
16,426
5
0
2008-10-14T15:00:32.393000
2008-10-14T15:05:54.080000
201,525
201,592
What is the proper order for installing Microsoft software on a developer workstation?
I've done this a million times... setting up a developer work station. Is there a best practices, or installation checklist for installing Microsoft development software on a work station? What about applying updates and/or service packs? Is there a specific order for doing this, in hopes of minimizing any install issu...
I would use the following and this order IS KEY if you want to do ASP.NET Development without issue. Operating System IIS for the OS <- If not done before VS, issues can be had OS Updates Office Office Updates SQL Server and tools SQL Server Updates VS 2003 VS 2003 Updates VS 2005 (DON'T install SQL Express) VS 2005 Up...
What is the proper order for installing Microsoft software on a developer workstation? I've done this a million times... setting up a developer work station. Is there a best practices, or installation checklist for installing Microsoft development software on a work station? What about applying updates and/or service p...
TITLE: What is the proper order for installing Microsoft software on a developer workstation? QUESTION: I've done this a million times... setting up a developer work station. Is there a best practices, or installation checklist for installing Microsoft development software on a work station? What about applying update...
[ "installation" ]
28
33
5,231
8
0
2008-10-14T15:00:49.037000
2008-10-14T15:14:03.300000
201,527
302,311
Best design for a changelog / auditing database table?
I need to create a database table to store different changelog/auditing (when something was added, deleted, modified, etc). I don't need to store particularly detailed info, so I was thinking something along the lines of: id (for the event) user that triggered it event name event description timestamp of the event Am I...
In the project I'm working on, audit log also started from the very minimalistic design, like the one you described: event ID event date/time event type user ID description The idea was the same: to keep things simple. However, it quickly became obvious that this minimalistic design was not sufficient. The typical audi...
Best design for a changelog / auditing database table? I need to create a database table to store different changelog/auditing (when something was added, deleted, modified, etc). I don't need to store particularly detailed info, so I was thinking something along the lines of: id (for the event) user that triggered it e...
TITLE: Best design for a changelog / auditing database table? QUESTION: I need to create a database table to store different changelog/auditing (when something was added, deleted, modified, etc). I don't need to store particularly detailed info, so I was thinking something along the lines of: id (for the event) user t...
[ "database", "database-design", "audit" ]
125
91
133,684
8
0
2008-10-14T15:00:56.137000
2008-11-19T15:41:02.870000
201,529
201,598
Any way to make "find references" work for web methods?
I'm looking for a way to find references to a web method in other code that may use it. Right-click and choose find references doesn't make it through the wsdl interface to other classes in my solution that reference those web methods. This is part of a clean-up effort - I'm trying to remove outdated/old/unused methods...
No, there is no way to do this from the web service implementation, but you can go to the generated proxy (you may have to "show all files" from within the solution explorer to see the.cs file) and do a find references from there.
Any way to make "find references" work for web methods? I'm looking for a way to find references to a web method in other code that may use it. Right-click and choose find references doesn't make it through the wsdl interface to other classes in my solution that reference those web methods. This is part of a clean-up e...
TITLE: Any way to make "find references" work for web methods? QUESTION: I'm looking for a way to find references to a web method in other code that may use it. Right-click and choose find references doesn't make it through the wsdl interface to other classes in my solution that reference those web methods. This is pa...
[ "c#", "web-services", "asmx" ]
1
2
333
1
0
2008-10-14T15:01:52.467000
2008-10-14T15:14:48.167000
201,530
201,661
How should I add multiple identical elements to a div with jQuery
I need to add multiple empty divs to a container element using jQuery. At the moment I am generating a string containing the empty html using a loop divstr = '... '; and then injecting that into my container: $('#container').html(divstr); Is there a more elegant way to insert multiple, identical elements? I'm hoping to...
If you want IE to be fast - or generally consider speed, then you'll want to build up a DOM fragment first before inserting it. John Resig explains the technique and includes a performance benchmark: http://ejohn.org/blog/dom-documentfragments/ var i = 10, fragment = document.createDocumentFragment(), div = document.cr...
How should I add multiple identical elements to a div with jQuery I need to add multiple empty divs to a container element using jQuery. At the moment I am generating a string containing the empty html using a loop divstr = '... '; and then injecting that into my container: $('#container').html(divstr); Is there a more...
TITLE: How should I add multiple identical elements to a div with jQuery QUESTION: I need to add multiple empty divs to a container element using jQuery. At the moment I am generating a string containing the empty html using a loop divstr = '... '; and then injecting that into my container: $('#container').html(divstr...
[ "javascript", "jquery", "dom" ]
12
19
18,922
4
0
2008-10-14T15:02:10.250000
2008-10-14T15:30:54.267000
201,532
201,605
How do you set ASP.NET Development Web Server to not cache any content?
I use the ASP.NET Development Web server (also known as the Visual Studio Development Web server) to do local web site debugging and testing. I've pretty much found exact functionality with IIS with the dev web server. However - where can you manage the settings of the dev web server - specifically regarding never cach...
It's not so much the server you need to worry about doing caching. It's your browser. With that in mind, the shift-key is your friend. Just hold down the shift key while clicking refresh for a page and your browser will clear any cached content for the page.
How do you set ASP.NET Development Web Server to not cache any content? I use the ASP.NET Development Web server (also known as the Visual Studio Development Web server) to do local web site debugging and testing. I've pretty much found exact functionality with IIS with the dev web server. However - where can you manag...
TITLE: How do you set ASP.NET Development Web Server to not cache any content? QUESTION: I use the ASP.NET Development Web server (also known as the Visual Studio Development Web server) to do local web site debugging and testing. I've pretty much found exact functionality with IIS with the dev web server. However - w...
[ "asp.net", "visual-studio", "caching" ]
1
2
2,700
3
0
2008-10-14T15:02:36.210000
2008-10-14T15:15:28.290000
201,534
201,573
Dynamic Table Data disappearing upon ImageButton Click
I have a form that searches all rows in a single table (TServices) that occurred between the date range and then populates a dynamic table below the form. Now I'm adding a delete ImageButton next to each listing in the table. Here's my C# code-behind for adding the ImageButtons to the table cell: ImageButton btnRemoveS...
Your error is due to the fact that you must add dynamically created controls to the page on EVERY load. If you re-add them inside the page_init method they will exist for viewstate to load and for the click events to fire successfully. It is all related to the ASP.NET Page Load process
Dynamic Table Data disappearing upon ImageButton Click I have a form that searches all rows in a single table (TServices) that occurred between the date range and then populates a dynamic table below the form. Now I'm adding a delete ImageButton next to each listing in the table. Here's my C# code-behind for adding the...
TITLE: Dynamic Table Data disappearing upon ImageButton Click QUESTION: I have a form that searches all rows in a single table (TServices) that occurred between the date range and then populates a dynamic table below the form. Now I'm adding a delete ImageButton next to each listing in the table. Here's my C# code-beh...
[ ".net", "dynamic-tables" ]
1
1
825
1
0
2008-10-14T15:02:41.887000
2008-10-14T15:08:41.207000
201,553
201,641
.NET inheritance with generic interfaces
Hallo i am currently playing around with castle projects ActiveRecord and the remoting facility. my current problem is that i need the find a way the implement the save sub from IBaseRepository in my address class and i dont know how. here is my current code, VS tells me on the line "implements IAddress" that i have to...
Public Class Address Inherits BaseRepository(Of Address) Implements IAddress Public Overrides Sub Save(ByVal obj As Address) MyBase.Save(obj) End Sub Public Overloads Sub Save(ByVal obj As IAddress) _ Implements IBaseRepository(Of IAddress).Save End Sub ' ' Some other stuff... ' End Class
.NET inheritance with generic interfaces Hallo i am currently playing around with castle projects ActiveRecord and the remoting facility. my current problem is that i need the find a way the implement the save sub from IBaseRepository in my address class and i dont know how. here is my current code, VS tells me on the ...
TITLE: .NET inheritance with generic interfaces QUESTION: Hallo i am currently playing around with castle projects ActiveRecord and the remoting facility. my current problem is that i need the find a way the implement the save sub from IBaseRepository in my address class and i dont know how. here is my current code, V...
[ ".net", "vb.net", "generics", "inheritance", "interface" ]
2
2
4,590
1
0
2008-10-14T15:05:45.987000
2008-10-14T15:23:52.033000
201,563
201,575
finding largest increasing subset of an array (non-contiguous)
How can I find the largest increasing (non-contiguous) subset of an array? For example, if A= array(50,1,4,9,2,18,6,3,7,10) the largest increasing non-contiguous subset is either (1,4,6,7,10) or (1,2,6,7,10). I can intuitively see how to find the subset, but I don't know how to design the algorithm.
Wikipedia has pseudo-code for an efficient algorithm: http://en.wikipedia.org/wiki/Longest_increasing_subsequence_problem
finding largest increasing subset of an array (non-contiguous) How can I find the largest increasing (non-contiguous) subset of an array? For example, if A= array(50,1,4,9,2,18,6,3,7,10) the largest increasing non-contiguous subset is either (1,4,6,7,10) or (1,2,6,7,10). I can intuitively see how to find the subset, bu...
TITLE: finding largest increasing subset of an array (non-contiguous) QUESTION: How can I find the largest increasing (non-contiguous) subset of an array? For example, if A= array(50,1,4,9,2,18,6,3,7,10) the largest increasing non-contiguous subset is either (1,4,6,7,10) or (1,2,6,7,10). I can intuitively see how to f...
[ "arrays", "algorithm" ]
2
2
1,963
1
0
2008-10-14T15:07:01.223000
2008-10-14T15:09:27.943000
201,568
201,594
When would I use XML instead of SQL?
I've been working on database-driven web applications for a few years now and recently took on a project involving a CMS that is XML-capable. This has led me to think about the usage of XML/XSLT in general and in what situations it would be more useful than the approach I've always used, which is storing all of my data...
To quote This Book (Effective XML: 50 Specific Ways to Improve Your XML): “XML is not a database. It was never meant to be a database. It is never going to be a database. Relational databases are proven technology with more than 20 years of implementation experience. They are solid, stable, useful products. They are no...
When would I use XML instead of SQL? I've been working on database-driven web applications for a few years now and recently took on a project involving a CMS that is XML-capable. This has led me to think about the usage of XML/XSLT in general and in what situations it would be more useful than the approach I've always ...
TITLE: When would I use XML instead of SQL? QUESTION: I've been working on database-driven web applications for a few years now and recently took on a project involving a CMS that is XML-capable. This has led me to think about the usage of XML/XSLT in general and in what situations it would be more useful than the app...
[ "sql", "xml" ]
107
107
95,277
13
0
2008-10-14T15:07:28.820000
2008-10-14T15:14:07.327000
201,590
202,633
Identifying COM components in a .NET application
I've inherited a.NET application that pulls together about 100 dlls built by two teams or purchased from vendors. I would like to quickly identify whether a given dll is a.NET assembly or a COM component. I realize that I could just invoke ildasm on each dll individually and make a note if the dll does not have a valid...
If you want to approach from the COM side, testing for COM objects in a DLL boils down to looking for an export named "DllGetClassObject". This is because an in-proc COM object is accessed by the COM runtime by calling DllGetClassObject() on that DLL. You could do this from a batch file using DUMPBIN.EXE which comes wi...
Identifying COM components in a .NET application I've inherited a.NET application that pulls together about 100 dlls built by two teams or purchased from vendors. I would like to quickly identify whether a given dll is a.NET assembly or a COM component. I realize that I could just invoke ildasm on each dll individually...
TITLE: Identifying COM components in a .NET application QUESTION: I've inherited a.NET application that pulls together about 100 dlls built by two teams or purchased from vendors. I would like to quickly identify whether a given dll is a.NET assembly or a COM component. I realize that I could just invoke ildasm on eac...
[ ".net", "windows" ]
1
3
330
3
0
2008-10-14T15:13:12.303000
2008-10-14T20:18:48.413000
201,593
201,795
Is there a simple way to convert C++ enum to string?
Suppose we have some named enums: enum MyEnum { FOO, BAR = 0x50 }; What I googled for is a script (any language) that scans all the headers in my project and generates a header with one function per enum. char* enum_to_string(MyEnum t); And a implementation with something like this: char* enum_to_string(MyEnum t){ swit...
You may want to check out GCCXML. Running GCCXML on your sample code produces: You could use any language you prefer to pull out the Enumeration and EnumValue tags and generate your desired code.
Is there a simple way to convert C++ enum to string? Suppose we have some named enums: enum MyEnum { FOO, BAR = 0x50 }; What I googled for is a script (any language) that scans all the headers in my project and generates a header with one function per enum. char* enum_to_string(MyEnum t); And a implementation with some...
TITLE: Is there a simple way to convert C++ enum to string? QUESTION: Suppose we have some named enums: enum MyEnum { FOO, BAR = 0x50 }; What I googled for is a script (any language) that scans all the headers in my project and generates a header with one function per enum. char* enum_to_string(MyEnum t); And a implem...
[ "c++", "string", "enums", "scripting" ]
140
50
161,026
35
0
2008-10-14T15:14:04.813000
2008-10-14T16:03:32.313000
201,602
201,693
How can I fix my .htaccess to resolve URLs that don't end in slashes
I am using wordpress and use custom permalink structure: /%category%/%postname%/ My problem is that a decent number of people link to the site without including the trailing slash in the URL, so users get a 404 page. I'm using the default.htaccess file that comes with wordpress because no solution I've tried has worked...
A very good reference for all things.htaccess is PerishablePress.com http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
How can I fix my .htaccess to resolve URLs that don't end in slashes I am using wordpress and use custom permalink structure: /%category%/%postname%/ My problem is that a decent number of people link to the site without including the trailing slash in the URL, so users get a 404 page. I'm using the default.htaccess fil...
TITLE: How can I fix my .htaccess to resolve URLs that don't end in slashes QUESTION: I am using wordpress and use custom permalink structure: /%category%/%postname%/ My problem is that a decent number of people link to the site without including the trailing slash in the URL, so users get a 404 page. I'm using the de...
[ "wordpress", ".htaccess", "http-status-code-404" ]
2
3
2,069
3
0
2008-10-14T15:15:22.410000
2008-10-14T15:40:20.097000
201,606
201,623
Are there any Ant conventions similar to Maven2 conventions?
For the past 2 years-(ish) I've been using Maven2 for my build/continuous integration solution. I used Ant a bit before that but really didn't get a lot of experience with it. Now I've taken a new job and the team I'm on now uses Ant. What I'm wondering about is this: In Maven we had directory conventions for seperatin...
My experience with ant -- which is our primary build tool for Java source, so make of this what you will -- is that there are no such formal conventions. Many source projects I've seen organize things in a similar manner; JBoss uses /src/main for sources, etc... Ant just uses whatever conventions you want, which makes ...
Are there any Ant conventions similar to Maven2 conventions? For the past 2 years-(ish) I've been using Maven2 for my build/continuous integration solution. I used Ant a bit before that but really didn't get a lot of experience with it. Now I've taken a new job and the team I'm on now uses Ant. What I'm wondering about...
TITLE: Are there any Ant conventions similar to Maven2 conventions? QUESTION: For the past 2 years-(ish) I've been using Maven2 for my build/continuous integration solution. I used Ant a bit before that but really didn't get a lot of experience with it. Now I've taken a new job and the team I'm on now uses Ant. What I...
[ "java", "ant", "automated-tests", "conventions" ]
3
7
610
3
0
2008-10-14T15:15:49.380000
2008-10-14T15:19:37.393000
201,607
201,633
Is there an equivalent to String.Split that returns a generic list?
I'd like to do something like this: Dim Foo as String = "a,b,c,d,e" Dim Boo as List(of String) = Foo.Split(","c) Of course Foo.Split returns a one-dimensional array of String, not a generic List. Is there a way to do this without iterating through the array to turn it into a generic List?
If you don't want to use LINQ, you can do: Dim foo As String = "a,b,c,d,e" Dim boo As New List(Of String)(foo.Split(","c))
Is there an equivalent to String.Split that returns a generic list? I'd like to do something like this: Dim Foo as String = "a,b,c,d,e" Dim Boo as List(of String) = Foo.Split(","c) Of course Foo.Split returns a one-dimensional array of String, not a generic List. Is there a way to do this without iterating through the ...
TITLE: Is there an equivalent to String.Split that returns a generic list? QUESTION: I'd like to do something like this: Dim Foo as String = "a,b,c,d,e" Dim Boo as List(of String) = Foo.Split(","c) Of course Foo.Split returns a one-dimensional array of String, not a generic List. Is there a way to do this without iter...
[ "vb.net", "generics" ]
14
35
29,863
8
0
2008-10-14T15:16:40.800000
2008-10-14T15:21:50.243000
201,614
201,704
What could cause a .NET WinForms app to close suddently without a dialog?
Our WinForms application has been reported to occasionally just close on its own. It neither shows our own crash error submit dialog nor Windows' error submit dialog, it just closes and is gone, often when the person was afk and not doing anything with the application. It seems to be a semi-rare occurrence, maybe like ...
Stack overflows due to infinite recursion are a big cause of apps quitting with no warning. Unless you've done something deliberate to cause a silent exit, then unhandled exceptions (other than stack overflow) will normally display some kind of UI before the app quits. Stack overflow is the most common exception (oops,...
What could cause a .NET WinForms app to close suddently without a dialog? Our WinForms application has been reported to occasionally just close on its own. It neither shows our own crash error submit dialog nor Windows' error submit dialog, it just closes and is gone, often when the person was afk and not doing anythin...
TITLE: What could cause a .NET WinForms app to close suddently without a dialog? QUESTION: Our WinForms application has been reported to occasionally just close on its own. It neither shows our own crash error submit dialog nor Windows' error submit dialog, it just closes and is gone, often when the person was afk and...
[ ".net", "crash" ]
3
4
1,923
3
0
2008-10-14T15:17:43.527000
2008-10-14T15:43:20.560000
201,615
203,848
syslog output for log4r example
Can some one post an example of using syslog outputter for log4r, I am currently using stdout but want to log to syslog. mylog = Logger.new 'mylog' mylog.outputters = Outputter.stdout mylog.info "Starting up." raj Thanks also to the following blog posts. Angrez's blog: Log4r - Usage and Examples ProgrammingStuff: Log4r
Kind of lame answering my own question, but I found answer to this and adding it for later searches. For some reason I need to require log4r/outputter/syslogoutputter explicitly other wise SyslogOutputter would cause "uninitialized constant SyslogOutputter (NameError)" error. Other outputters do not seem to have this p...
syslog output for log4r example Can some one post an example of using syslog outputter for log4r, I am currently using stdout but want to log to syslog. mylog = Logger.new 'mylog' mylog.outputters = Outputter.stdout mylog.info "Starting up." raj Thanks also to the following blog posts. Angrez's blog: Log4r - Usage and ...
TITLE: syslog output for log4r example QUESTION: Can some one post an example of using syslog outputter for log4r, I am currently using stdout but want to log to syslog. mylog = Logger.new 'mylog' mylog.outputters = Outputter.stdout mylog.info "Starting up." raj Thanks also to the following blog posts. Angrez's blog: ...
[ "ruby", "log4r" ]
3
9
3,731
2
0
2008-10-14T15:17:49.470000
2008-10-15T06:16:26.927000
201,616
201,630
How to capture console output from a service C#?
We have a C# service that is deployed to a remote customer system. The application writes a substantial amount of "diagnostic" information to the console (i.e. Console.WriteLine()). The service isn't "doing what it should." How can we capture the console output from the service in another application? A WinForm version...
Are you able to change the service code at all? If so, using Console.SetOut to write to a file instead would be the most obvious first port of call. Then change to using a proper logging library for the next release:)
How to capture console output from a service C#? We have a C# service that is deployed to a remote customer system. The application writes a substantial amount of "diagnostic" information to the console (i.e. Console.WriteLine()). The service isn't "doing what it should." How can we capture the console output from the ...
TITLE: How to capture console output from a service C#? QUESTION: We have a C# service that is deployed to a remote customer system. The application writes a substantial amount of "diagnostic" information to the console (i.e. Console.WriteLine()). The service isn't "doing what it should." How can we capture the consol...
[ "c#", "service", "console" ]
20
31
26,414
7
0
2008-10-14T15:18:03.760000
2008-10-14T15:21:10.027000
201,621
201,678
How do I see all foreign keys to a table or column?
In MySQL, how do I get a list of all foreign key constraints pointing to a particular table? a particular column? This is the same thing as this Oracle question, but for MySQL.
For a Table: SELECT TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = (SELECT DATABASE()) AND REFERENCED_TABLE_NAME = ' ' \G For a Column: SELECT TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFE...
How do I see all foreign keys to a table or column? In MySQL, how do I get a list of all foreign key constraints pointing to a particular table? a particular column? This is the same thing as this Oracle question, but for MySQL.
TITLE: How do I see all foreign keys to a table or column? QUESTION: In MySQL, how do I get a list of all foreign key constraints pointing to a particular table? a particular column? This is the same thing as this Oracle question, but for MySQL. ANSWER: For a Table: SELECT TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFE...
[ "mysql", "foreign-keys", "innodb" ]
782
1,093
663,062
16
0
2008-10-14T15:18:49.127000
2008-10-14T15:35:13.617000
201,636
231,817
Linq To SQL - how to have property not from table but from DB
We are using Linq To SQL with our own data context logic that executes the one linq query across multiple databases. When we get the results back, we need the database for each of the rows. So... I want to have a property on my class that will return the database name (SQL Server, so DB_NAME()). How can I do this in Li...
In the DBML XML file, you can set the Expression attribute of a Column element to this:
Linq To SQL - how to have property not from table but from DB We are using Linq To SQL with our own data context logic that executes the one linq query across multiple databases. When we get the results back, we need the database for each of the rows. So... I want to have a property on my class that will return the dat...
TITLE: Linq To SQL - how to have property not from table but from DB QUESTION: We are using Linq To SQL with our own data context logic that executes the one linq query across multiple databases. When we get the results back, we need the database for each of the rows. So... I want to have a property on my class that w...
[ "linq-to-sql" ]
1
2
390
2
0
2008-10-14T15:22:39.383000
2008-10-23T22:32:05.360000
201,654
442,705
What is the WIN32 API WM_REFLECT message for?
I can't find documentation for it, even on MSDN...
It's not Win32; it's MFC. Ordinarily, a Win32 control raises events by sending a message to its parent window. However, if you've got your own class derived from one of MFC's wrappers (e.g. you've wrapped CTreeCtrl with CMyFunkyTreeCtrl), you might want to handle these events in the derived class. MFC uses these reflec...
What is the WIN32 API WM_REFLECT message for? I can't find documentation for it, even on MSDN...
TITLE: What is the WIN32 API WM_REFLECT message for? QUESTION: I can't find documentation for it, even on MSDN... ANSWER: It's not Win32; it's MFC. Ordinarily, a Win32 control raises events by sending a message to its parent window. However, if you've got your own class derived from one of MFC's wrappers (e.g. you've...
[ "winapi" ]
6
6
4,343
2
0
2008-10-14T15:28:26.547000
2009-01-14T11:59:16.280000
201,656
202,145
Is there a .NET Tool/Add-in available which allows you to easily rearrange the order of Regions, Subs, Functions, and Member Variables in a Class?
I'm looking for a.NET Add-in that reads in the contents of the Current Document window, lists the header declaration of all Regions, Subs, Functions, and Module Level Variables, and provides a simple Move Up/Move Down buttons to rearrange their order.
I find that the "File Structure Window" provided by the Resharper add-in provides most of the features you are looking for. However, it is part of a comprehensive refactoring add-in and this may not suit you.
Is there a .NET Tool/Add-in available which allows you to easily rearrange the order of Regions, Subs, Functions, and Member Variables in a Class? I'm looking for a.NET Add-in that reads in the contents of the Current Document window, lists the header declaration of all Regions, Subs, Functions, and Module Level Variab...
TITLE: Is there a .NET Tool/Add-in available which allows you to easily rearrange the order of Regions, Subs, Functions, and Member Variables in a Class? QUESTION: I'm looking for a.NET Add-in that reads in the contents of the Current Document window, lists the header declaration of all Regions, Subs, Functions, and M...
[ "c#", "asp.net", "vb.net", "visual-studio", "add-in" ]
0
4
389
3
0
2008-10-14T15:29:01.103000
2008-10-14T17:51:27.710000
201,660
205,962
How do I un-escape XML entities easily in .NET
I have some code which returns InnerXML for a XMLNode. The node can contain just some text (with HTML) or XML. For example: Here is some <strong>HTML</strong> or Here is some content if I get the InnerXML for the HTML tags are returned as XML entities. I cannot use InnerText because I need to be able to get the XML con...
I think Tomalak is on the right track, but I'd write the code a little differently: XmlNode xn = document.SelectSingleNode("/content[@id=1]/data"); if (xn.ChildNodes.Count!= 1) { throw new InvalidOperationException("I don't know what to do if there's not exactly one child node."); } XmlNode child = xn.ChildNodes[0]; sw...
How do I un-escape XML entities easily in .NET I have some code which returns InnerXML for a XMLNode. The node can contain just some text (with HTML) or XML. For example: Here is some <strong>HTML</strong> or Here is some content if I get the InnerXML for the HTML tags are returned as XML entities. I cannot use InnerTe...
TITLE: How do I un-escape XML entities easily in .NET QUESTION: I have some code which returns InnerXML for a XMLNode. The node can contain just some text (with HTML) or XML. For example: Here is some <strong>HTML</strong> or Here is some content if I get the InnerXML for the HTML tags are returned as XML entities. I ...
[ ".net", "asp.net", "xml" ]
2
1
2,474
3
0
2008-10-14T15:30:26.280000
2008-10-15T18:56:14.740000
201,663
201,682
Is it possible to load two versions of the .NET runtime in the same process?
There are two scenarios I need to clarify: An executable compiled with.NET 3.5 needs to use a library compiled with.NET 1.1 and the library must run on the 1.1 runtime. An executable compiled with.NET 1.1 needs to use a library compiled with.NET 3.5. I cannot find a reliable source stating that it is not possible to lo...
No -- you can't load the CLR into the same process twice. See the documentation for CLR Hosting As with earlier versions of the runtime, the CorBindToRuntimeEx function initializes the runtime. You can choose which version of the runtime to load, but a process can host only one version.
Is it possible to load two versions of the .NET runtime in the same process? There are two scenarios I need to clarify: An executable compiled with.NET 3.5 needs to use a library compiled with.NET 1.1 and the library must run on the 1.1 runtime. An executable compiled with.NET 1.1 needs to use a library compiled with.N...
TITLE: Is it possible to load two versions of the .NET runtime in the same process? QUESTION: There are two scenarios I need to clarify: An executable compiled with.NET 3.5 needs to use a library compiled with.NET 1.1 and the library must run on the 1.1 runtime. An executable compiled with.NET 1.1 needs to use a libra...
[ ".net", "runtime", "versioning", "clr-hosting" ]
5
7
824
3
0
2008-10-14T15:32:01.877000
2008-10-14T15:36:32.227000
201,684
201,701
Best jQuery Status Message Plugin?
What is the best jQuery status message plugin? I like jGrowl and Purr, but jGrowl doesn't have the feature to remain sticky (not close automatially) and Purr doesn't seem to work right in IE 6. I would like to show messages like... the site is about to go down for maintenance, your such and such job has completed, and ...
jGrowl does look to have sticky - see sample 2 in the demo page: https://github.com/stanlemon/jGrowl...ah - or did you mean after the page has reloaded? I would then handle this on the server side - i.e. include a sitedown.js that triggers the growl notice each time any page is visited.
Best jQuery Status Message Plugin? What is the best jQuery status message plugin? I like jGrowl and Purr, but jGrowl doesn't have the feature to remain sticky (not close automatially) and Purr doesn't seem to work right in IE 6. I would like to show messages like... the site is about to go down for maintenance, your su...
TITLE: Best jQuery Status Message Plugin? QUESTION: What is the best jQuery status message plugin? I like jGrowl and Purr, but jGrowl doesn't have the feature to remain sticky (not close automatially) and Purr doesn't seem to work right in IE 6. I would like to show messages like... the site is about to go down for ma...
[ "javascript", "jquery", "plugins", "jquery-plugins", "user-interface" ]
42
18
36,521
9
0
2008-10-14T15:37:00.993000
2008-10-14T15:42:51.027000
201,686
201,702
Linq to SQL: select optimization
On large tables in MSSQL; selecting specific columns results in greater speed of the query. Does the same apply to Linq to SQL? Would this: var person = from p in [DataContextObject].Persons where p.PersonsID == 1 select new { p.PersonsID, p.PersonsAdress, p.PersonsZipcode }; be faster than this: var person = from p in...
I highly recommend LinqPad. It is free and lets you run LINQ queries dynamically. When you can also look at the SQL that is generated. What you will see is that the LINQ query will translate the first query into selecting only those columns. So it is faster.
Linq to SQL: select optimization On large tables in MSSQL; selecting specific columns results in greater speed of the query. Does the same apply to Linq to SQL? Would this: var person = from p in [DataContextObject].Persons where p.PersonsID == 1 select new { p.PersonsID, p.PersonsAdress, p.PersonsZipcode }; be faster ...
TITLE: Linq to SQL: select optimization QUESTION: On large tables in MSSQL; selecting specific columns results in greater speed of the query. Does the same apply to Linq to SQL? Would this: var person = from p in [DataContextObject].Persons where p.PersonsID == 1 select new { p.PersonsID, p.PersonsAdress, p.PersonsZip...
[ "sql", "performance", "linq-to-sql" ]
6
6
5,668
6
0
2008-10-14T15:38:18.883000
2008-10-14T15:43:00.917000
201,696
201,765
How to audit when a user leaves an ASP.NET app
In ASP.NET, I'm looking for a way to audit a user leaving my application. To be specific, I'd like to insert a 'logout' record in an audit table in SQL Server when the user's session is abandoned/destroyed for any reason (not necessarily because of a call to session.abandon) I have a 'SessionHelper' class that manages ...
The Session_End event is only fired if you have InProc sessions. SQL or state server session management will not fire this event. If you can, get back to InProc sessions and use this event. Apart from that, you won't get very good solutions. ASP.NET doesn't offer a way to look at the current list of sessions on the ser...
How to audit when a user leaves an ASP.NET app In ASP.NET, I'm looking for a way to audit a user leaving my application. To be specific, I'd like to insert a 'logout' record in an audit table in SQL Server when the user's session is abandoned/destroyed for any reason (not necessarily because of a call to session.abando...
TITLE: How to audit when a user leaves an ASP.NET app QUESTION: In ASP.NET, I'm looking for a way to audit a user leaving my application. To be specific, I'd like to insert a 'logout' record in an audit table in SQL Server when the user's session is abandoned/destroyed for any reason (not necessarily because of a call...
[ "asp.net", "events", "audit" ]
2
2
1,519
3
0
2008-10-14T15:41:35.507000
2008-10-14T15:59:26.517000
201,700
201,824
How do I create a named log in $TOMCAT_HOME/logs for my servlet?
I'm currently logging via the simplest of methods within my servlet using Tomcat. I use the ServletConfig.getServletContext().log to record activity. This writes to the localhost.YYYY-MM-DD.log in $TOMCAT_HOME/logs. I don't want to get away from the simplicity of this logging mechanism unless absolutely necessary. But ...
For Tomcat 6.x, you can change the logging configuration in conf/logging.properties. But I prefer a separate configuration with Log4j...
How do I create a named log in $TOMCAT_HOME/logs for my servlet? I'm currently logging via the simplest of methods within my servlet using Tomcat. I use the ServletConfig.getServletContext().log to record activity. This writes to the localhost.YYYY-MM-DD.log in $TOMCAT_HOME/logs. I don't want to get away from the simpl...
TITLE: How do I create a named log in $TOMCAT_HOME/logs for my servlet? QUESTION: I'm currently logging via the simplest of methods within my servlet using Tomcat. I use the ServletConfig.getServletContext().log to record activity. This writes to the localhost.YYYY-MM-DD.log in $TOMCAT_HOME/logs. I don't want to get a...
[ "java", "tomcat", "logging", "servlets" ]
1
0
1,075
2
0
2008-10-14T15:42:50.170000
2008-10-14T16:10:42.780000
201,705
288,519
How many random elements before MD5 produces collisions?
I've got an image library on Amazon S3. For each image, I md5 the source URL on my server plus a timestamp to get a unique filename. Since S3 can't have subdirectories, I need to store all of these images in a single flat folder. Do I need to worry about collisions in the MD5 hash value that gets produced? Bonus: How m...
Probability of just two hashes accidentally colliding is 1/2 128 which is 1 in 340 undecillion 282 decillion 366 nonillion 920 octillion 938 septillion 463 sextillion 463 quintillion 374 quadrillion 607 trillion 431 billion 768 million 211 thousand 456. However if you keep all the hashes then the probability is a bit h...
How many random elements before MD5 produces collisions? I've got an image library on Amazon S3. For each image, I md5 the source URL on my server plus a timestamp to get a unique filename. Since S3 can't have subdirectories, I need to store all of these images in a single flat folder. Do I need to worry about collisio...
TITLE: How many random elements before MD5 produces collisions? QUESTION: I've got an image library on Amazon S3. For each image, I md5 the source URL on my server plus a timestamp to get a unique filename. Since S3 can't have subdirectories, I need to store all of these images in a single flat folder. Do I need to wo...
[ "random", "md5", "hash" ]
168
317
111,590
8
0
2008-10-14T15:43:27.827000
2008-11-13T22:06:41.253000
201,706
206,710
How do I ensure Linq to Sql doesn't override or violate non-nullable DB default values?
I have an SQL Server DB with a table with these fields: A bit with the default value 1, NOT NULL. A smalldatetime with the default value gettime(), NOT NULL. An int with no default value, IDENTITY, NOT NULL. When I generate Linq to SQL for this table, the following happens: The bit is given no special treatment. The sm...
Linq-To-Sql generated classes do not pick up the Default Value Constriants. Maybe in the future, but the issue is constraints aren't always simple values, they can also be scalar functions like GetDate(), so linq would somehow have to know how to translate those. In short, it doesn't even try. It's also a very database...
How do I ensure Linq to Sql doesn't override or violate non-nullable DB default values? I have an SQL Server DB with a table with these fields: A bit with the default value 1, NOT NULL. A smalldatetime with the default value gettime(), NOT NULL. An int with no default value, IDENTITY, NOT NULL. When I generate Linq to ...
TITLE: How do I ensure Linq to Sql doesn't override or violate non-nullable DB default values? QUESTION: I have an SQL Server DB with a table with these fields: A bit with the default value 1, NOT NULL. A smalldatetime with the default value gettime(), NOT NULL. An int with no default value, IDENTITY, NOT NULL. When I...
[ "c#", "sql", "linq", "sql-server-2005", "linq-to-sql" ]
14
5
3,102
4
0
2008-10-14T15:44:37.187000
2008-10-15T22:07:31.577000
201,724
201,733
Easy way to turn JavaScript array into comma-separated list?
I have a one-dimensional array of strings in JavaScript that I'd like to turn into a comma-separated list. Is there a simple way in garden-variety JavaScript (or jQuery) to turn that into a comma-separated list? (I know how to iterate through the array and build the string myself by concatenation if that's the only way...
The Array.prototype.join() method: var arr = ["Zero", "One", "Two"]; document.write(arr.join(", "));
Easy way to turn JavaScript array into comma-separated list? I have a one-dimensional array of strings in JavaScript that I'd like to turn into a comma-separated list. Is there a simple way in garden-variety JavaScript (or jQuery) to turn that into a comma-separated list? (I know how to iterate through the array and bu...
TITLE: Easy way to turn JavaScript array into comma-separated list? QUESTION: I have a one-dimensional array of strings in JavaScript that I'd like to turn into a comma-separated list. Is there a simple way in garden-variety JavaScript (or jQuery) to turn that into a comma-separated list? (I know how to iterate throug...
[ "javascript" ]
546
985
639,924
22
0
2008-10-14T15:47:17.337000
2008-10-14T15:48:48.317000
201,734
201,759
What is the simplest way to call an HttpHandler file in .NET?
I have an HttpHandler on my webserver that takes a URL in the form of " https://servername/myhandler?op=get&k=Internal&m=jdahug1 ". I need to call this URL from my.NET app and capture whatever the output is. Does anyone know how I can do that? I want it to be simple so that I just get back a string with the output, and...
we have used the following in the backend of our product (this is just the core code, not with timeout errorhandling etc.) using System.Net; using System.IO; HttpWebRequest req = (HttpWebRequest) WebRequest.Create(WebPageUrl); WebResponse resp = req.GetResponse(); Stream stream = resp.GetResponseStream(); StreamRe...
What is the simplest way to call an HttpHandler file in .NET? I have an HttpHandler on my webserver that takes a URL in the form of " https://servername/myhandler?op=get&k=Internal&m=jdahug1 ". I need to call this URL from my.NET app and capture whatever the output is. Does anyone know how I can do that? I want it to b...
TITLE: What is the simplest way to call an HttpHandler file in .NET? QUESTION: I have an HttpHandler on my webserver that takes a URL in the form of " https://servername/myhandler?op=get&k=Internal&m=jdahug1 ". I need to call this URL from my.NET app and capture whatever the output is. Does anyone know how I can do th...
[ ".net", "asp.net", "http" ]
2
1
4,436
4
0
2008-10-14T15:49:01.373000
2008-10-14T15:56:00.720000
201,760
201,779
Where can I find examples of element heavy web forms?
I would like to look at some examples of some good form layouts (web-based) that have a lot of input fields. I do a lot of web application development and a lot of my forms are input element heavy so I am always looking for good ideas on how to display my forms. For example I have a few list boxes and a lot of text box...
I always like visiting Wufoo whenever I need some form inspiration.
Where can I find examples of element heavy web forms? I would like to look at some examples of some good form layouts (web-based) that have a lot of input fields. I do a lot of web application development and a lot of my forms are input element heavy so I am always looking for good ideas on how to display my forms. For...
TITLE: Where can I find examples of element heavy web forms? QUESTION: I would like to look at some examples of some good form layouts (web-based) that have a lot of input fields. I do a lot of web application development and a lot of my forms are input element heavy so I am always looking for good ideas on how to dis...
[ "css", "layout", "webforms" ]
8
6
1,066
3
0
2008-10-14T15:58:04.693000
2008-10-14T16:01:10.320000
201,768
201,811
Mixing jQuery and YUI together in an app, is it easily possible?
I have to preface this with the fact that I love jQuery as a JavaScript language extension and YUI as a rich set of free controls. So here is my question, is there going to be any problems down the line if I mix jQuery and YUI together in an MVC app I am working on. I want to use jQuery for the heavy lifting on the DOM...
Speaking from some experience in developing a small tool myself, I've used YUI's rich control set with Prototype for DOM manipulation in the past and experienced no issues. Admittedly, this was a small tool that didn't use a wide array of the controls. Even so, I'm always hesitant to use multiple frameworks on my web p...
Mixing jQuery and YUI together in an app, is it easily possible? I have to preface this with the fact that I love jQuery as a JavaScript language extension and YUI as a rich set of free controls. So here is my question, is there going to be any problems down the line if I mix jQuery and YUI together in an MVC app I am ...
TITLE: Mixing jQuery and YUI together in an app, is it easily possible? QUESTION: I have to preface this with the fact that I love jQuery as a JavaScript language extension and YUI as a rich set of free controls. So here is my question, is there going to be any problems down the line if I mix jQuery and YUI together i...
[ "jquery", "asp.net-mvc", "yui" ]
18
13
15,930
5
0
2008-10-14T16:00:00.930000
2008-10-14T16:07:46.717000
201,776
201,889
Submit Login control button when I hit Enter
I have an ASP.NET web page with a Login control on it. When I hit Enter, the Login button doesn't fire; instead the page submits, doing nothing. The standard solution to this that I've found online is to enclose the Login control in a Panel, then set the Panel default button. But apparently that doesn't work so well if...
This should be helpful: http://weblogs.asp.net/jgalloway/archive/2007/10/03/asp-net-setting-the-defaultbutton-for-a-login-control.aspx You can use the following to reference the button within the Login control template: DefaultButton="Login$LoginButton" Basically, you can define a DefaultButton not just on the Form lev...
Submit Login control button when I hit Enter I have an ASP.NET web page with a Login control on it. When I hit Enter, the Login button doesn't fire; instead the page submits, doing nothing. The standard solution to this that I've found online is to enclose the Login control in a Panel, then set the Panel default button...
TITLE: Submit Login control button when I hit Enter QUESTION: I have an ASP.NET web page with a Login control on it. When I hit Enter, the Login button doesn't fire; instead the page submits, doing nothing. The standard solution to this that I've found online is to enclose the Login control in a Panel, then set the Pa...
[ "c#", "asp.net", ".net", "login-control", "defaultbutton" ]
23
34
41,653
9
0
2008-10-14T16:00:41.817000
2008-10-14T16:30:01.120000
201,777
201,801
SQL Server 2005 auto growth by size
I have been looking at the new database server we are setting up for a client and note the database files are set to grow by 1 meg everytime the file is full and the initial size is 100 MB. I have been considering this breifly and it doesn't sound right. I've checked a few sites on DB considerations and they didn't pro...
What you've suggested is pretty much spot on. You want the autogrowth to be based on what you expect to see. A database that has autogrowth of 1Mb everytime it is full will experience huge performance issues, as every time the database is full, whatever transaction is in progress will have to pause until it has grown. ...
SQL Server 2005 auto growth by size I have been looking at the new database server we are setting up for a client and note the database files are set to grow by 1 meg everytime the file is full and the initial size is 100 MB. I have been considering this breifly and it doesn't sound right. I've checked a few sites on D...
TITLE: SQL Server 2005 auto growth by size QUESTION: I have been looking at the new database server we are setting up for a client and note the database files are set to grow by 1 meg everytime the file is full and the initial size is 100 MB. I have been considering this breifly and it doesn't sound right. I've checke...
[ "sql-server", "sql-server-2005" ]
3
3
9,726
7
0
2008-10-14T16:01:00.540000
2008-10-14T16:04:50.360000
201,780
201,804
Do you know of any IDEs that are localized to Spanish?
I have a buddy that's having a hard time with the language barrier. I tried to think of any IDEs that are also available in Spanish, but couldn't think of any. Any ideas?
Microsoft Visual Studio is avaible in spanish http://en.wikipedia.org/wiki/Microsoft_Visual_Studio http://msdn.microsoft.com/en-gb/vstudio/default.aspx Spanish version of the msdn page: http://msdn.microsoft.com/es-es/vstudio/default.aspx
Do you know of any IDEs that are localized to Spanish? I have a buddy that's having a hard time with the language barrier. I tried to think of any IDEs that are also available in Spanish, but couldn't think of any. Any ideas?
TITLE: Do you know of any IDEs that are localized to Spanish? QUESTION: I have a buddy that's having a hard time with the language barrier. I tried to think of any IDEs that are also available in Spanish, but couldn't think of any. Any ideas? ANSWER: Microsoft Visual Studio is avaible in spanish http://en.wikipedia.o...
[ "localization", "ide" ]
1
5
169
4
0
2008-10-14T16:01:54.343000
2008-10-14T16:05:02.403000
201,782
201,856
Can you use a trailing comma in a JSON object?
When manually generating a JSON object or array, it's often easier to leave a trailing comma on the last item in the object or array. For example, code to output from an array of strings might look like (in a C++ like pseudocode): s.append("["); for (i = 0; i < 5; ++i) { s.appendF("\"%d\",", i); } s.append("]"); giving...
Unfortunately the JSON specification does not allow a trailing comma. There are a few browsers that will allow it, but generally you need to worry about all browsers. In general I try turn the problem around, and add the comma before the actual value, so you end up with code that looks like this: s.append("["); for (i ...
Can you use a trailing comma in a JSON object? When manually generating a JSON object or array, it's often easier to leave a trailing comma on the last item in the object or array. For example, code to output from an array of strings might look like (in a C++ like pseudocode): s.append("["); for (i = 0; i < 5; ++i) { s...
TITLE: Can you use a trailing comma in a JSON object? QUESTION: When manually generating a JSON object or array, it's often easier to leave a trailing comma on the last item in the object or array. For example, code to output from an array of strings might look like (in a C++ like pseudocode): s.append("["); for (i = ...
[ "json", "syntax", "delimiter" ]
481
320
181,283
21
0
2008-10-14T16:02:15.823000
2008-10-14T16:19:55.650000
201,791
201,805
Data Access Layer: Exposing List<>: bad idea?
I am currently coding a simple Data Access Layer, and I was wondering which type I should expose to the other layers. I am going to internally implement the Data as a List<>, but I remember reading something about not exposing the List type to the consumers if not needed. public List GetAllUsers() // non C# users: that...
Usually it's best to expose the least powerful interface that the user can still meaningfully work with. If the user just needs some enumerable data, return IEnumerable. If that's not enough because the user needs to be able to modify the list (attention! shouldn't often be the case), return an IList. /EDIT: Joel asks ...
Data Access Layer: Exposing List<>: bad idea? I am currently coding a simple Data Access Layer, and I was wondering which type I should expose to the other layers. I am going to internally implement the Data as a List<>, but I remember reading something about not exposing the List type to the consumers if not needed. p...
TITLE: Data Access Layer: Exposing List<>: bad idea? QUESTION: I am currently coding a simple Data Access Layer, and I was wondering which type I should expose to the other layers. I am going to internally implement the Data as a List<>, but I remember reading something about not exposing the List type to the consumer...
[ "architecture", "list", "ienumerable", "data-access-layer", "ilist" ]
3
6
957
3
0
2008-10-14T16:03:01.050000
2008-10-14T16:05:08.050000
201,796
212,276
Unsecure posting back from an asp.net control on a secure page while avoiding authentication
We are using standard asp.net forms authentication. Certain pages require a user to be logged in; and least some of these pages are delivered by https. There is a search control at the top of each page. When this is used, we don't care whether the user's session has expired, even if the current page requires a log in. ...
As suggested in other answers the most correct way to do this would be to have the search input control in a separate form which has a method of get and an action of searchresults.aspx. However this is difficult with aspx as you can only have one server-side form on a page. In the end the solution I came to, which work...
Unsecure posting back from an asp.net control on a secure page while avoiding authentication We are using standard asp.net forms authentication. Certain pages require a user to be logged in; and least some of these pages are delivered by https. There is a search control at the top of each page. When this is used, we do...
TITLE: Unsecure posting back from an asp.net control on a secure page while avoiding authentication QUESTION: We are using standard asp.net forms authentication. Certain pages require a user to be logged in; and least some of these pages are delivered by https. There is a search control at the top of each page. When t...
[ "asp.net", "security", "asp.net-2.0" ]
3
0
677
3
0
2008-10-14T16:03:44.697000
2008-10-17T14:05:29.223000
201,816
201,969
How to set a long Java classpath in Windows?
I'm trying to run a particular JUnit test by hand on a Windows XP command line, which has an unusually high number of elements in the class path. I've tried several variations, such as: set CLASS_PATH=C:\path\a\b\c;C:\path\e\f\g;.... set CLASS_PATH=%CLASS_PATH%;C:\path2\a\b\c;C:\path2\e\f\g;....... C:\apps\jdk1.6.0_07\...
The Windows command line is very limiting in this regard. A workaround is to create a "pathing jar". This is a jar containing only a Manifest.mf file, whose Class-Path specifies the disk paths of your long list of jars, etc. Now just add this pathing jar to your command line classpath. This is usually more convenient t...
How to set a long Java classpath in Windows? I'm trying to run a particular JUnit test by hand on a Windows XP command line, which has an unusually high number of elements in the class path. I've tried several variations, such as: set CLASS_PATH=C:\path\a\b\c;C:\path\e\f\g;.... set CLASS_PATH=%CLASS_PATH%;C:\path2\a\b\...
TITLE: How to set a long Java classpath in Windows? QUESTION: I'm trying to run a particular JUnit test by hand on a Windows XP command line, which has an unusually high number of elements in the class path. I've tried several variations, such as: set CLASS_PATH=C:\path\a\b\c;C:\path\e\f\g;.... set CLASS_PATH=%CLASS_P...
[ "java", "junit", "classpath" ]
54
62
80,720
13
0
2008-10-14T16:08:53.627000
2008-10-14T16:52:51.930000
201,826
201,842
C# (ASP.Net) Linking selection values to constants in Codebehind
ASPX Code > Developer dev.test.com staging.test.com ASPX.CS - Codebehind const string ServerDeveloper = "developer"; ASPX Error: Code blocks are not supported in this context. Question: So what is the correct way to tie an dropdown/radio buttion/... ASPX value to a constant that is shared with the CodeBehind code? I kn...
Would it be: rbServer.Items.Add(ServerDeveloper) Ok, so since you want to do it from presentation...It is possible, but horribly ugly: <% rbServer.Items.Add(new ListItem("Dev", ServerDeveloper)); %> Blah Note that the code block has to be above the markup - if you put it below, it doesn't seem to work. Note also that t...
C# (ASP.Net) Linking selection values to constants in Codebehind ASPX Code > Developer dev.test.com staging.test.com ASPX.CS - Codebehind const string ServerDeveloper = "developer"; ASPX Error: Code blocks are not supported in this context. Question: So what is the correct way to tie an dropdown/radio buttion/... ASPX ...
TITLE: C# (ASP.Net) Linking selection values to constants in Codebehind QUESTION: ASPX Code > Developer dev.test.com staging.test.com ASPX.CS - Codebehind const string ServerDeveloper = "developer"; ASPX Error: Code blocks are not supported in this context. Question: So what is the correct way to tie an dropdown/radio...
[ "c#", "asp.net" ]
4
3
2,339
4
0
2008-10-14T16:11:40.673000
2008-10-14T16:16:36.920000
201,827
201,980
Target IIS Worker Processes on Request
Ok, strange setup, strange question. We've got a Client and an Admin web application for our SaaS app, running on asp.net-2.0/iis-6. The Admin application can change options displayed on the Client application. When those options are saved in the Admin we call a Webservice on the Client, from the Admin, to flush our ca...
I'm making some assumptions here for this answer.... I'm assuming the client app is using one of the.NET caching classes to store your application's options? When you say 'flush' do you mean flush them back to a configuration file or db table? Because the cache objects and data won't be shared between processes you nee...
Target IIS Worker Processes on Request Ok, strange setup, strange question. We've got a Client and an Admin web application for our SaaS app, running on asp.net-2.0/iis-6. The Admin application can change options displayed on the Client application. When those options are saved in the Admin we call a Webservice on the ...
TITLE: Target IIS Worker Processes on Request QUESTION: Ok, strange setup, strange question. We've got a Client and an Admin web application for our SaaS app, running on asp.net-2.0/iis-6. The Admin application can change options displayed on the Client application. When those options are saved in the Admin we call a ...
[ "web-services", "caching", "iis-6", "asp.net-2.0", "worker-process" ]
3
0
892
2
0
2008-10-14T16:12:05.023000
2008-10-14T16:57:31.610000
201,830
202,026
Linq to SQL: .FirstOrDefault() not applicable to select new { ... }
I just asked this question. Which lead me to a new question:) Up until this point, I have used the following pattern of selecting stuff with Linq to SQL, with the purpose of being able to handle 0 "rows" returned by the query: var person = (from p in [DataContextObject].Persons where p.PersonsID == 1 select new p).Firs...
Regarding your UPDATE: you have to either create your own type, change this._user to be int, or select the whole object, not only specific columns.
Linq to SQL: .FirstOrDefault() not applicable to select new { ... } I just asked this question. Which lead me to a new question:) Up until this point, I have used the following pattern of selecting stuff with Linq to SQL, with the purpose of being able to handle 0 "rows" returned by the query: var person = (from p in [...
TITLE: Linq to SQL: .FirstOrDefault() not applicable to select new { ... } QUESTION: I just asked this question. Which lead me to a new question:) Up until this point, I have used the following pattern of selecting stuff with Linq to SQL, with the purpose of being able to handle 0 "rows" returned by the query: var per...
[ "linq", "linq-to-sql" ]
5
1
22,831
5
0
2008-10-14T16:12:46.257000
2008-10-14T17:11:06.810000
201,832
202,004
Assigning values to a list of global variables in JavaScript
Hey right now I'm using jQuery and I have some global variables to hold a bit of preloaded ajax stuff (preloaded to make pages come up nice and fast): $.get("content.py?pageName=viewer", function(data) {viewer = data;}); $.get("content.py?pageName=artists", function(data) {artists = data;}); $.get("content.py?pageName=...
You don't need eval() or Function() for this. An array, as you suspected, will do the job nicely: (function() // keep outer scope clean { // pages to load. Each name is used both for the request and the name // of the property to store the result in (so keep them valid identifiers // unless you want to use window['my f...
Assigning values to a list of global variables in JavaScript Hey right now I'm using jQuery and I have some global variables to hold a bit of preloaded ajax stuff (preloaded to make pages come up nice and fast): $.get("content.py?pageName=viewer", function(data) {viewer = data;}); $.get("content.py?pageName=artists", f...
TITLE: Assigning values to a list of global variables in JavaScript QUESTION: Hey right now I'm using jQuery and I have some global variables to hold a bit of preloaded ajax stuff (preloaded to make pages come up nice and fast): $.get("content.py?pageName=viewer", function(data) {viewer = data;}); $.get("content.py?pa...
[ "javascript", "jquery", "dry" ]
1
5
2,377
6
0
2008-10-14T16:13:11.327000
2008-10-14T17:06:02.077000
201,834
201,836
MSMQ Generic Messaging
I'm thinking of creating a generic message queue to handle various inter-process messages. (WCF is not an option at this point.) So, rather than have 10-15 different queues for specific messages I'd have 1 queue that is a 'catch-all'. Obviously sending messages to this queue is a not a problem. Each recipient would lis...
Use System.Messaging.Message.AppSpecific (Integer) to specify a recipient.
MSMQ Generic Messaging I'm thinking of creating a generic message queue to handle various inter-process messages. (WCF is not an option at this point.) So, rather than have 10-15 different queues for specific messages I'd have 1 queue that is a 'catch-all'. Obviously sending messages to this queue is a not a problem. E...
TITLE: MSMQ Generic Messaging QUESTION: I'm thinking of creating a generic message queue to handle various inter-process messages. (WCF is not an option at this point.) So, rather than have 10-15 different queues for specific messages I'd have 1 queue that is a 'catch-all'. Obviously sending messages to this queue is ...
[ ".net-2.0", "msmq" ]
1
2
455
1
0
2008-10-14T16:13:49.903000
2008-10-14T16:14:25.550000
201,838
201,892
Using a backslash (%5c) in a REST WCF URL
I am building a REST service on WCF, and one of the methods I am writing is GetProfile, which will return the profile for a given username. The username will include the user's domain, and so will have the following format: "DOMAIN\username". I therefore have a service called Profiles.svc, which has the following endpo...
I suspect that they are simply not allowed in that part of the url. They are fine in the query string as long as they are encoded. As a general rule i wouldn't put anything in the path part of the url that is invalid in filename (i.e.?). Perhaps you could use a different character to deliminate th domain from the usern...
Using a backslash (%5c) in a REST WCF URL I am building a REST service on WCF, and one of the methods I am writing is GetProfile, which will return the profile for a given username. The username will include the user's domain, and so will have the following format: "DOMAIN\username". I therefore have a service called P...
TITLE: Using a backslash (%5c) in a REST WCF URL QUESTION: I am building a REST service on WCF, and one of the methods I am writing is GetProfile, which will return the profile for a given username. The username will include the user's domain, and so will have the following format: "DOMAIN\username". I therefore have ...
[ "wcf", "url", "rest" ]
2
5
6,673
1
0
2008-10-14T16:15:06.533000
2008-10-14T16:31:00.337000
201,841
660,502
How do I configure email notification on new case comment in salesforce.com?
In salesforce.com, I have a workflow that triggers when a new case comment is added via the self-service portal. The workflow rule updates the Case.Status field, which fires another workflow rule on the Case object itself. The end result is an email to the case owner that is notified that a new case comment has been ad...
I know I'm stumbling across this way after the fact, but the answer is... {!Case.Last_Case_Comment}
How do I configure email notification on new case comment in salesforce.com? In salesforce.com, I have a workflow that triggers when a new case comment is added via the self-service portal. The workflow rule updates the Case.Status field, which fires another workflow rule on the Case object itself. The end result is an...
TITLE: How do I configure email notification on new case comment in salesforce.com? QUESTION: In salesforce.com, I have a workflow that triggers when a new case comment is added via the self-service portal. The workflow rule updates the Case.Status field, which fires another workflow rule on the Case object itself. Th...
[ "email", "templates", "salesforce" ]
2
4
15,877
2
0
2008-10-14T16:15:45.750000
2009-03-18T23:34:36.483000
201,846
201,891
python name a file same as a lib
i have the following script import getopt, sys opts, args = getopt.getopt(sys.argv[1:], "h:s") for key,value in opts: print key, "=>", value if i name this getopt.py and run it doesn't work as it tries to import itself is there a way around this, so i can keep this filename but specify on import that i want the standar...
You shouldn't name your scripts like existing modules. Especially if standard. That said, you can touch sys.path to modify the library loading order ~# cat getopt.py print "HI" ~# python Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or...
python name a file same as a lib i have the following script import getopt, sys opts, args = getopt.getopt(sys.argv[1:], "h:s") for key,value in opts: print key, "=>", value if i name this getopt.py and run it doesn't work as it tries to import itself is there a way around this, so i can keep this filename but specify ...
TITLE: python name a file same as a lib QUESTION: i have the following script import getopt, sys opts, args = getopt.getopt(sys.argv[1:], "h:s") for key,value in opts: print key, "=>", value if i name this getopt.py and run it doesn't work as it tries to import itself is there a way around this, so i can keep this fil...
[ "python" ]
2
7
372
5
0
2008-10-14T16:17:23.017000
2008-10-14T16:30:44.800000
201,848
201,939
Outlook automation - Change Sender Account
I'm automating Outlook and I need to control who the email appears to be from. The users will have two or more Accounts set up in Outlook and I need to be able to select which account to send the email from. Any ideas? Needs to be supported on Outlook 2003 and above. I'm using Delphi 2006 to code this, but that doesn't...
A person named Sue Mosher wrote up a pretty summary on this issue in microsoft.public.office.developer.outlook.vba. In short, it boils down to either of this: use MailItem.SentOnBehalfOfName, which only works in Exchange enviromnents (I suppose that is the case for you) - when the user has "Send As" permissions for the...
Outlook automation - Change Sender Account I'm automating Outlook and I need to control who the email appears to be from. The users will have two or more Accounts set up in Outlook and I need to be able to select which account to send the email from. Any ideas? Needs to be supported on Outlook 2003 and above. I'm using...
TITLE: Outlook automation - Change Sender Account QUESTION: I'm automating Outlook and I need to control who the email appears to be from. The users will have two or more Accounts set up in Outlook and I need to be able to select which account to send the email from. Any ideas? Needs to be supported on Outlook 2003 an...
[ "outlook", "automation" ]
3
2
6,856
2
0
2008-10-14T16:17:33.703000
2008-10-14T16:46:03.163000
201,865
201,885
What is the best Agile methodology for a class project?
The project is poorly defined: we are to write educational software for CS 111 Computer Programming I students focusing on functions. We have 6 student developers with various backgrounds working in Flex. The project has a duration of about 7 weeks. We have very limited face time (30 min per week) and very limited work...
What makes you think any methodology would be successful under these circumstances -- little communication, more requirements than time, and lack of access to customers? That being said, I would focus on incremental delivery (each iteration should have some few working features), unit testing (all tests pass before che...
What is the best Agile methodology for a class project? The project is poorly defined: we are to write educational software for CS 111 Computer Programming I students focusing on functions. We have 6 student developers with various backgrounds working in Flex. The project has a duration of about 7 weeks. We have very l...
TITLE: What is the best Agile methodology for a class project? QUESTION: The project is poorly defined: we are to write educational software for CS 111 Computer Programming I students focusing on functions. We have 6 student developers with various backgrounds working in Flex. The project has a duration of about 7 wee...
[ "agile", "methodology" ]
2
6
711
2
0
2008-10-14T16:22:01.900000
2008-10-14T16:28:49.703000
201,875
201,911
DocumentViewer toolbar and context menu
How to hide the default toolbar and to disallow the default context menu of the DocumentViewer control?
You can prevent the default context menu from appearing by handling the ContextMenuOpening event, and setting ContextMenuEventArgs.Handled to true. As for the toolbar, I'm not sure - maybe you could somehow change the default style of the DocumentView to not include the toolbar? I haven't ever done much with styles, bu...
DocumentViewer toolbar and context menu How to hide the default toolbar and to disallow the default context menu of the DocumentViewer control?
TITLE: DocumentViewer toolbar and context menu QUESTION: How to hide the default toolbar and to disallow the default context menu of the DocumentViewer control? ANSWER: You can prevent the default context menu from appearing by handling the ContextMenuOpening event, and setting ContextMenuEventArgs.Handled to true. A...
[ ".net", "wpf", "controls", "customization" ]
8
1
4,119
3
0
2008-10-14T16:24:36.060000
2008-10-14T16:38:04.100000
201,883
454,773
How can you get a ComboBox child of a DataGridView to process all keys, including "."?
I have the same problem as described in the posts listed below. That is, certain keys don't work at all when I type them into my combobox until I first hit the spacebar. One of the keys is ".", but another is the letter "Q", and there are others: "$", "%". http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=659716&Si...
By any chance, have you already solved your problem? I have the same problem as yours, my custom control for DataGridView cannot receive letter Q, period, dollar, single quote, percent, etc. I was able to solve the problem by changing the "switch.. default: return false" to "switch.. default: return!dataGridViewWantsIn...
How can you get a ComboBox child of a DataGridView to process all keys, including "."? I have the same problem as described in the posts listed below. That is, certain keys don't work at all when I type them into my combobox until I first hit the spacebar. One of the keys is ".", but another is the letter "Q", and ther...
TITLE: How can you get a ComboBox child of a DataGridView to process all keys, including "."? QUESTION: I have the same problem as described in the posts listed below. That is, certain keys don't work at all when I type them into my combobox until I first hit the spacebar. One of the keys is ".", but another is the le...
[ "c#", ".net", "winforms", "datagridview" ]
1
1
1,776
2
0
2008-10-14T16:28:14.837000
2009-01-18T07:25:08.243000
201,887
202,533
Primary key from inserted row jdbc?
Is there a cross database platform way to get the primary key of the record you have just inserted? I noted that this answer says that you can get it by Calling SELECT LAST_INSERT_ID() and I think that you can call SELECT @@IDENTITY AS 'Identity'; is there a common way to do this accross databases in jdbc? If not how w...
Copied from my code: pInsertOid = connection.prepareStatement(INSERT_OID_SQL, Statement.RETURN_GENERATED_KEYS); where pInsertOid is a prepared statement. you can then obtain the key: // fill in the prepared statement and pInsertOid.executeUpdate(); ResultSet rs = pInsertOid.getGeneratedKeys(); if (rs.next()) { int newI...
Primary key from inserted row jdbc? Is there a cross database platform way to get the primary key of the record you have just inserted? I noted that this answer says that you can get it by Calling SELECT LAST_INSERT_ID() and I think that you can call SELECT @@IDENTITY AS 'Identity'; is there a common way to do this acc...
TITLE: Primary key from inserted row jdbc? QUESTION: Is there a cross database platform way to get the primary key of the record you have just inserted? I noted that this answer says that you can get it by Calling SELECT LAST_INSERT_ID() and I think that you can call SELECT @@IDENTITY AS 'Identity'; is there a common ...
[ "java", "jdbc", "identity" ]
45
65
49,018
7
0
2008-10-14T16:29:27.157000
2008-10-14T19:40:32.297000
201,888
210,142
Spring initialization order
Suppose I have a couple of spring beans: "B" exposes a remote service that doesn't need "A". Assume that "A" takes a non-negligble time to load. What this means is that during a restart cycle, the application hangs the remote client, which can actually connect to the server but waits for a response until the spring con...
Don't refer to bean "A" directly. Instead, refer to a bean which is a FACTORY for bean "A"; in this way, the Factory bean can be created without taking the initialization hit for instantiating "A". You'll need to refactor your classes which refer to an "A" to retrieve an "A" first, of course. Or, you could create a bea...
Spring initialization order Suppose I have a couple of spring beans: "B" exposes a remote service that doesn't need "A". Assume that "A" takes a non-negligble time to load. What this means is that during a restart cycle, the application hangs the remote client, which can actually connect to the server but waits for a r...
TITLE: Spring initialization order QUESTION: Suppose I have a couple of spring beans: "B" exposes a remote service that doesn't need "A". Assume that "A" takes a non-negligble time to load. What this means is that during a restart cycle, the application hangs the remote client, which can actually connect to the server...
[ "java", "spring" ]
2
4
7,441
2
0
2008-10-14T16:29:50.323000
2008-10-16T20:24:23.110000
201,893
217,729
WARNING: UNPROTECTED PRIVATE KEY FILE! when trying to SSH into Amazon EC2 Instance
I'm working to set up Panda on an Amazon EC2 instance. I set up my account and tools last night and had no problem using SSH to interact with my own personal instance, but right now I'm not being allowed permission into Panda's EC2 instance. Getting Started with Panda I'm getting the following error: @ WARNING: UNPROTE...
I've chmoded my keypair to 600 in order to get into my personal instance last night, And this is the way it is supposed to be. From the EC2 documentation we have "If you're using OpenSSH (or any reasonably paranoid SSH client) then you'll probably need to set the permissions of this file so that it's only readable by y...
WARNING: UNPROTECTED PRIVATE KEY FILE! when trying to SSH into Amazon EC2 Instance I'm working to set up Panda on an Amazon EC2 instance. I set up my account and tools last night and had no problem using SSH to interact with my own personal instance, but right now I'm not being allowed permission into Panda's EC2 insta...
TITLE: WARNING: UNPROTECTED PRIVATE KEY FILE! when trying to SSH into Amazon EC2 Instance QUESTION: I'm working to set up Panda on an Amazon EC2 instance. I set up my account and tools last night and had no problem using SSH to interact with my own personal instance, but right now I'm not being allowed permission into...
[ "ssh", "amazon-web-services", "amazon-ec2", "chmod" ]
259
254
256,592
14
0
2008-10-14T16:31:01.350000
2008-10-20T07:41:32.883000
201,896
201,902
Is there a class or method in Java that will check if a string is a SQL Server keyword?
I want something that can check if a string is "SELECT", "INSERT", etc. I'm just curious if this exists.
Easy enough to add: HashSet sqlKeywords = new HashSet (Arrays.asList( new String[] {... cut and paste a list of sql keywords here.. }));
Is there a class or method in Java that will check if a string is a SQL Server keyword? I want something that can check if a string is "SELECT", "INSERT", etc. I'm just curious if this exists.
TITLE: Is there a class or method in Java that will check if a string is a SQL Server keyword? QUESTION: I want something that can check if a string is "SELECT", "INSERT", etc. I'm just curious if this exists. ANSWER: Easy enough to add: HashSet sqlKeywords = new HashSet (Arrays.asList( new String[] {... cut and past...
[ "java", "sql-server" ]
2
4
1,179
4
0
2008-10-14T16:32:03.907000
2008-10-14T16:34:46.727000
201,906
202,300
When does a Windows process run out of memory?
Under Windows Server 2003, Enterprise Edition, SP2 (/3GB switch not enabled) As I understand it, and I may be wrong, the maximum addressable memory for a process is 4GB. Is that 2GB of private bytes and 2GB of virtual bytes? Do you get "out of memory" errors when the private byte limit or virtual byte limit is reached?
It is correct that the maximum address space of a process is 4GB, in a sense. Half of the address space is, for each process, taken up by the operating system. This can be changed with the 3GB switch but it might cause system instability. So, we are left with 2GB of addressable memory for the process to use on its own....
When does a Windows process run out of memory? Under Windows Server 2003, Enterprise Edition, SP2 (/3GB switch not enabled) As I understand it, and I may be wrong, the maximum addressable memory for a process is 4GB. Is that 2GB of private bytes and 2GB of virtual bytes? Do you get "out of memory" errors when the priva...
TITLE: When does a Windows process run out of memory? QUESTION: Under Windows Server 2003, Enterprise Edition, SP2 (/3GB switch not enabled) As I understand it, and I may be wrong, the maximum addressable memory for a process is 4GB. Is that 2GB of private bytes and 2GB of virtual bytes? Do you get "out of memory" err...
[ "memory", "windows-server-2003" ]
2
4
9,686
5
0
2008-10-14T16:36:24.273000
2008-10-14T18:36:31.503000
201,909
202,326
How to prevent Visual Studio 2008 from checking references in .aspx files?
There was a registry fix for Visual Studio 2005 to prevent it from checking references in.aspx files, but it does not seem to work for 2008. With variable renames, finding all references in an ASP.NET project is extremely slow. Is there a way to prevent this in VS2008?
This is one thing I have given up hope for ever working right in Visual Studio. This is also one of the primary reasons I started using ReSharper in the first place. Other than some 3rd party plugin, I have no other suggestions for you.
How to prevent Visual Studio 2008 from checking references in .aspx files? There was a registry fix for Visual Studio 2005 to prevent it from checking references in.aspx files, but it does not seem to work for 2008. With variable renames, finding all references in an ASP.NET project is extremely slow. Is there a way to...
TITLE: How to prevent Visual Studio 2008 from checking references in .aspx files? QUESTION: There was a registry fix for Visual Studio 2005 to prevent it from checking references in.aspx files, but it does not seem to work for 2008. With variable renames, finding all references in an ASP.NET project is extremely slow....
[ "asp.net", "visual-studio-2008" ]
0
0
172
1
0
2008-10-14T16:37:38.467000
2008-10-14T18:43:06.950000
201,919
202,667
What might cause ThreadAbortException when using HttpWebRequest.GetResponse()
I'm living in nightmares because of this situation, I have a HttpWebRequest.GetResponse that keeps on giving me a ThreadAbortException, that causes the whole app to go down. How can I avoid that, or at least handle it, would using Thread.ResetAbort() be useful in such a case? To explain more here is a rough code sample...
From what you say it seems you are making an outgoing WebRequest to an external resource from within the processing of an incoming request to an ASP.NET application. There are (at least) two timeouts that are relevant here: WebRequest.Timeout (default 100000ms = 100s) specifies the timeout for execution of the outgoing...
What might cause ThreadAbortException when using HttpWebRequest.GetResponse() I'm living in nightmares because of this situation, I have a HttpWebRequest.GetResponse that keeps on giving me a ThreadAbortException, that causes the whole app to go down. How can I avoid that, or at least handle it, would using Thread.Rese...
TITLE: What might cause ThreadAbortException when using HttpWebRequest.GetResponse() QUESTION: I'm living in nightmares because of this situation, I have a HttpWebRequest.GetResponse that keeps on giving me a ThreadAbortException, that causes the whole app to go down. How can I avoid that, or at least handle it, would...
[ ".net" ]
13
12
7,194
4
0
2008-10-14T16:41:44.670000
2008-10-14T20:27:02.607000
201,933
202,150
Why is calling a web service slower from a web page?
We have a DLL used as the middle layer between our website front end and our back end ticketing system. The method of insertion into the ticketing system is a bit complicated to explain, but the short version is that it's slow. The best case scenario I've gotten is a 9 second submission time. The real problem though, i...
Are you running both on the same machine? Is the middle-layer that you are calling located on a remote machine? The time durations you mentioned vaguely feels like a DNS timeout issue, when opening a connection incurs the penalty for the first (down/misaddressed) DNS response to timeout. Are you sure that whatever conf...
Why is calling a web service slower from a web page? We have a DLL used as the middle layer between our website front end and our back end ticketing system. The method of insertion into the ticketing system is a bit complicated to explain, but the short version is that it's slow. The best case scenario I've gotten is a...
TITLE: Why is calling a web service slower from a web page? QUESTION: We have a DLL used as the middle layer between our website front end and our back end ticketing system. The method of insertion into the ticketing system is a bit complicated to explain, but the short version is that it's slow. The best case scenari...
[ "asp.net", "web-services" ]
1
1
394
3
0
2008-10-14T16:44:29.250000
2008-10-14T17:52:22.687000
201,936
201,946
How to know which files an application is trying to access?
How do I know which files and registry keys an application is trying to access?
Process Monitor is your lord and savior. Or FileMon & RegMon if you're running an older windows OS.
How to know which files an application is trying to access? How do I know which files and registry keys an application is trying to access?
TITLE: How to know which files an application is trying to access? QUESTION: How do I know which files and registry keys an application is trying to access? ANSWER: Process Monitor is your lord and savior. Or FileMon & RegMon if you're running an older windows OS.
[ "file-io" ]
1
13
1,405
1
0
2008-10-14T16:45:33.647000
2008-10-14T16:48:32.797000
201,940
201,998
can realloc Array, then Why use pointers?
This was an job placement interview I faced. They asked whether we can realloc Array, I told yes. Then They asked - then why we need pointers as most of the people give reason that it wastes memory space. I could not able to give satisfactory answer. If any body can give any satisfactory answer, I'll be obliged. Please...
You can only reallocate an array that was allocated dynamically. If it was allocated statically, it cannot be reallocated [safely].* Pointers hold addresses of data in memory. They can be allocated, deallocated, and reallocated dynamically using the new/delete operators in C++ and malloc/free in C. I would strongly sug...
can realloc Array, then Why use pointers? This was an job placement interview I faced. They asked whether we can realloc Array, I told yes. Then They asked - then why we need pointers as most of the people give reason that it wastes memory space. I could not able to give satisfactory answer. If any body can give any sa...
TITLE: can realloc Array, then Why use pointers? QUESTION: This was an job placement interview I faced. They asked whether we can realloc Array, I told yes. Then They asked - then why we need pointers as most of the people give reason that it wastes memory space. I could not able to give satisfactory answer. If any bo...
[ "c++", "c", "pointers", "data-structures" ]
3
8
3,378
4
0
2008-10-14T16:46:09.603000
2008-10-14T17:02:21.973000
201,956
202,050
IS it OK to use an int for the key in a KeyedCollection
Often times I need a collection of non-sequential objects with numeric identifiers. I like using the KeyedCollection for this, but I think there's a serious drawback. If you use an int for the key, you can no longer access members of the collection by their index (collection[index] is now really collection[key]). Is th...
Basically you need to decide if users of the class are likely to be confused by the fact that they can't, for example, do: for(int i=0; i=< myCollection.Count; i++) {... myCollection[i]... } though they can of course use foreach, or use a cast: for(int i=0; i=< myCollection.Count; i++) {... ((Collection )myCollection)[...
IS it OK to use an int for the key in a KeyedCollection Often times I need a collection of non-sequential objects with numeric identifiers. I like using the KeyedCollection for this, but I think there's a serious drawback. If you use an int for the key, you can no longer access members of the collection by their index ...
TITLE: IS it OK to use an int for the key in a KeyedCollection QUESTION: Often times I need a collection of non-sequential objects with numeric identifiers. I like using the KeyedCollection for this, but I think there's a serious drawback. If you use an int for the key, you can no longer access members of the collecti...
[ "c#", ".net", "generics", "collections" ]
11
7
2,088
4
0
2008-10-14T16:49:38.163000
2008-10-14T17:18:21.630000
201,959
201,986
Limits on number of Rows in a SQL Server Table
Are there any hard limits on the number of rows in a table in a sql server table? I am under the impression the only limit is based around physical storage. At what point does performance significantly degrade, if at all, on tables with and without an index. Are there any common practicies for very large tables? To giv...
You are correct that the number of rows is limited by your available storage. It is hard to give any numbers as it very much depends on your server hardware, configuration, and how efficient your queries are. For example, a simple select statement will run faster and show less degradation than a Full Text or Proximity ...
Limits on number of Rows in a SQL Server Table Are there any hard limits on the number of rows in a table in a sql server table? I am under the impression the only limit is based around physical storage. At what point does performance significantly degrade, if at all, on tables with and without an index. Are there any ...
TITLE: Limits on number of Rows in a SQL Server Table QUESTION: Are there any hard limits on the number of rows in a table in a sql server table? I am under the impression the only limit is based around physical storage. At what point does performance significantly degrade, if at all, on tables with and without an ind...
[ "sql-server" ]
4
2
1,309
4
0
2008-10-14T16:50:39.003000
2008-10-14T16:58:33.167000
201,978
201,982
Explore containing folder instead of open containing folder
I use Visual Studio to do a lot of my coding. I find the open containing folder feature quite helpful. But I don't want the folder to be "opened" by the windows explorer, instead I want to "explore" the folder -- you know, get the nice little frame showing me all the other folders on the left hand side. Does anyone kno...
When invoking ShellExecute(), use the explore verb instead of the open verb: http://msdn.microsoft.com/en-us/library/bb762153%28VS.85%29.aspx. Edit: If you don't mean programmatically, open Windows Explorer, go to Tools -> Folder Options, select the File Types tab, locate the Folder entry in the list (not File Folder!)...
Explore containing folder instead of open containing folder I use Visual Studio to do a lot of my coding. I find the open containing folder feature quite helpful. But I don't want the folder to be "opened" by the windows explorer, instead I want to "explore" the folder -- you know, get the nice little frame showing me ...
TITLE: Explore containing folder instead of open containing folder QUESTION: I use Visual Studio to do a lot of my coding. I find the open containing folder feature quite helpful. But I don't want the folder to be "opened" by the windows explorer, instead I want to "explore" the folder -- you know, get the nice little...
[ "windows", "visual-studio-2005", "windows-explorer" ]
1
1
2,071
2
0
2008-10-14T16:56:23.967000
2008-10-14T16:57:50.627000
201,988
224,129
"Communication with the underlying transaction manager has failed" error message
A client of our has recently upgraded a ASP.NET 1.1 web application to ASP.NET that uses COM+ transaction processing and received the following exception while trying to process a transaction: Exception Type: System.Transactions.TransactionManagerCommunicationException Message: Communication with the underlying transac...
You'll need to have network DTC access enabled on both your XP workstation and your windows 2003 machine. Also, if your application is only published internally, you can turn off incoming caller authentication and set it to "no authentication".
"Communication with the underlying transaction manager has failed" error message A client of our has recently upgraded a ASP.NET 1.1 web application to ASP.NET that uses COM+ transaction processing and received the following exception while trying to process a transaction: Exception Type: System.Transactions.Transactio...
TITLE: "Communication with the underlying transaction manager has failed" error message QUESTION: A client of our has recently upgraded a ASP.NET 1.1 web application to ASP.NET that uses COM+ transaction processing and received the following exception while trying to process a transaction: Exception Type: System.Trans...
[ "asp.net", "transactions" ]
9
14
37,875
5
0
2008-10-14T16:59:11.483000
2008-10-22T00:59:37.077000
201,990
202,059
How can I determine the last time any record changed in a specific Sql Server 2000 database?
I have a SQL Server 2000 database instance that is rarely updated. I also have a database table which has no columns holding each row's created date or modified date. Is there any way that I can determine the last time an update or insert was performed on the database as a whole, so that I can at least put a bound on w...
The database's log file may have some information that is useful to your quest. AFAIK, the database itself doesn't store a "last updated" date.
How can I determine the last time any record changed in a specific Sql Server 2000 database? I have a SQL Server 2000 database instance that is rarely updated. I also have a database table which has no columns holding each row's created date or modified date. Is there any way that I can determine the last time an updat...
TITLE: How can I determine the last time any record changed in a specific Sql Server 2000 database? QUESTION: I have a SQL Server 2000 database instance that is rarely updated. I also have a database table which has no columns holding each row's created date or modified date. Is there any way that I can determine the ...
[ "sql", "sql-server-2000" ]
0
1
762
2
0
2008-10-14T16:59:42.200000
2008-10-14T17:22:27.770000
201,993
202,293
How would you make an RSS-feeds entries available longer than they're accessible from the source?
My computer at home is set up to automatically download some stuff from RSS feeds (mostly torrents and podcasts). However, I don't always keep this computer on. The sites I subscribe to have a relatively large throughput, so when I turn the computer back on it has no idea what it missed between the the time it was turn...
I use Google Reader for my podiobooks.com subscriptions. I add all of the feeds to a tag, in this case podiobooks.com, that I share (but don't share the URL). I then add the RSS feed to iTunes. Example here.
How would you make an RSS-feeds entries available longer than they're accessible from the source? My computer at home is set up to automatically download some stuff from RSS feeds (mostly torrents and podcasts). However, I don't always keep this computer on. The sites I subscribe to have a relatively large throughput, ...
TITLE: How would you make an RSS-feeds entries available longer than they're accessible from the source? QUESTION: My computer at home is set up to automatically download some stuff from RSS feeds (mostly torrents and podcasts). However, I don't always keep this computer on. The sites I subscribe to have a relatively ...
[ "caching", "rss", "offline", "podcast" ]
1
1
286
4
0
2008-10-14T17:01:08.077000
2008-10-14T18:34:43.973000
201,994
202,030
Complete list of Google Gears enabled sites
Is there a complete list of Google Gears enabled sites? I'm aware of rememberthemilk.com, google docs and google calendar
MySpace's message system is one of the biggest outside of Google. At least so I thought according to this article. Other sites are: Wordpress MindMeister PassPack ZohoWriter BuxFer SomeThings
Complete list of Google Gears enabled sites Is there a complete list of Google Gears enabled sites? I'm aware of rememberthemilk.com, google docs and google calendar
TITLE: Complete list of Google Gears enabled sites QUESTION: Is there a complete list of Google Gears enabled sites? I'm aware of rememberthemilk.com, google docs and google calendar ANSWER: MySpace's message system is one of the biggest outside of Google. At least so I thought according to this article. Other sites ...
[ "google-gears" ]
7
6
2,872
5
0
2008-10-14T17:01:23.770000
2008-10-14T17:13:06.320000
202,002
202,880
How do I open a file in C# and change its properties?
I need to open a Microsoft Word 2003 file and change its file properties. Such as changing the Subject in the Summary Tab.
Microsoft provides a very useful little assembly called DSOFile. With a reference to it in your project, you can modify Office document properties. It won't necessarily let you open the actual Office file's properties dialog, but you could certainly simulate it. According to Microsoft: The Dsofile.dll files lets you ed...
How do I open a file in C# and change its properties? I need to open a Microsoft Word 2003 file and change its file properties. Such as changing the Subject in the Summary Tab.
TITLE: How do I open a file in C# and change its properties? QUESTION: I need to open a Microsoft Word 2003 file and change its file properties. Such as changing the Subject in the Summary Tab. ANSWER: Microsoft provides a very useful little assembly called DSOFile. With a reference to it in your project, you can mod...
[ "c#", "ms-word" ]
3
8
2,675
2
0
2008-10-14T17:04:10.067000
2008-10-14T21:14:17.457000
202,007
581,579
Creating Docking Panes in CView instead of CMainFrame
When creating an MDI Application with "Visual Studio" style using the AppWizard of VS2008 (plus Feature Pack), the CMainFrame class gets a method CreateDockingWindows(). Since I don't want all panes to be always visible but display them depending on the type of the active document, I made those windows to members of my...
The following solution turned out to work pretty well for me. The MainFrame still owns all the panes thus keeping all the existing framework-functionality. I derive the panes from a class which implements the "CView-like" behavior I need: /** * \brief Mimics some of the behavior of a CView * * CDockablePane derived cla...
Creating Docking Panes in CView instead of CMainFrame When creating an MDI Application with "Visual Studio" style using the AppWizard of VS2008 (plus Feature Pack), the CMainFrame class gets a method CreateDockingWindows(). Since I don't want all panes to be always visible but display them depending on the type of the ...
TITLE: Creating Docking Panes in CView instead of CMainFrame QUESTION: When creating an MDI Application with "Visual Studio" style using the AppWizard of VS2008 (plus Feature Pack), the CMainFrame class gets a method CreateDockingWindows(). Since I don't want all panes to be always visible but display them depending o...
[ "c++", "visual-studio-2008", "mfc", "mfc-feature-pack", "docking" ]
2
1
4,522
1
0
2008-10-14T17:06:59.500000
2009-02-24T12:31:16.333000
202,009
204,590
How to detect the language version of Windows
Required is the true language version of the OS, not the user interface language or the current locale settings. Use case: software installation which has to apply security settings and user account creation. The scripts have to know certain system properties like user group names in the original language of the OS. (S...
To detect the operating system language use GetSystemDefaultUILanguage. However, there are more straightforward ways to find things such as a known group name in Windows. For example, to get the name for the Users group call CreateWellKnownSid with WellKnownSidType = 27 (WinBuiltinUsersSid) and then LookupAccountSid. T...
How to detect the language version of Windows Required is the true language version of the OS, not the user interface language or the current locale settings. Use case: software installation which has to apply security settings and user account creation. The scripts have to know certain system properties like user grou...
TITLE: How to detect the language version of Windows QUESTION: Required is the true language version of the OS, not the user interface language or the current locale settings. Use case: software installation which has to apply security settings and user account creation. The scripts have to know certain system propert...
[ "windows", "windows-xp", "windows-server-2003" ]
3
4
8,789
3
0
2008-10-14T17:07:17.473000
2008-10-15T12:55:22.863000