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
182,600
182,620
Should one use < or <= in a for loop
If you had to iterate through a loop 7 times, would you use: for (int i = 0; i < 7; i++) or: for (int i = 0; i <= 6; i++) There are two considerations: performance readability For performance I'm assuming Java or C#. Does it matter if "less than" or "less than or equal to" is used? If you have insight for a different l...
The first is more idiomatic. In particular, it indicates (in a 0-based sense) the number of iterations. When using something 1-based (e.g. JDBC, IIRC) I might be tempted to use <=. So: for (int i=0; i < count; i++) // For 0-based APIs for (int i=1; i <= count; i++) // For 1-based APIs I would expect the performance di...
Should one use < or <= in a for loop If you had to iterate through a loop 7 times, would you use: for (int i = 0; i < 7; i++) or: for (int i = 0; i <= 6; i++) There are two considerations: performance readability For performance I'm assuming Java or C#. Does it matter if "less than" or "less than or equal to" is used? ...
TITLE: Should one use < or <= in a for loop QUESTION: If you had to iterate through a loop 7 times, would you use: for (int i = 0; i < 7; i++) or: for (int i = 0; i <= 6; i++) There are two considerations: performance readability For performance I'm assuming Java or C#. Does it matter if "less than" or "less than or e...
[ "performance", "conventions", "readability" ]
128
294
51,895
39
0
2008-10-08T12:59:56.817000
2008-10-08T13:03:44.750000
182,602
183,374
How do I trigger a BulletedList in LinkButton-mode with javascript?
I have a BulletedList in asp.net that is set to DisplayMode="LinkButton". I would like to trigger the first "bullet" from a javascript, can this be done? And if so, how?
Say you have the BulletedList as... then you can fire the "onclick" event like this (cross-browser): var links = document.getElementById('<%= MyLovelyBulletedList.ClientID %>').getElementsByTagName('a'); var targetLink = links[0]; if (targetLink.fireEvent) { // IE targetLink.fireEvent("onclick"); } else if (targetLin...
How do I trigger a BulletedList in LinkButton-mode with javascript? I have a BulletedList in asp.net that is set to DisplayMode="LinkButton". I would like to trigger the first "bullet" from a javascript, can this be done? And if so, how?
TITLE: How do I trigger a BulletedList in LinkButton-mode with javascript? QUESTION: I have a BulletedList in asp.net that is set to DisplayMode="LinkButton". I would like to trigger the first "bullet" from a javascript, can this be done? And if so, how? ANSWER: Say you have the BulletedList as... then you can fire t...
[ "c#", "asp.net", "javascript", "bulletedlist" ]
2
3
2,284
3
0
2008-10-08T13:00:35.253000
2008-10-08T15:25:50.390000
182,615
182,646
Why does my RSS feed duplicate some entries?
When reading my RSS feed with the Thunderbird feed reader, some entries are duplicated. Google Reader does not have the same problem. Here is the faulty feed: http://plcoder.net/rss.php?rss=Blog There is a problem, but where? I added a GUID, but the problem remains. Other feeds do not duplicate like mine, so I will do ...
Try adding a tag to each item, giving it a permalink. i.e.: http://plcoder.net/?doc=2134&amp;titre=mon-pc-se-la-pete http://plcoder.net/?doc=2134&amp;titre=mon-pc-se-la-pete... Without a GUID, if any of the content in the post changes, your RSS aggregator might think that it is a new post. With the GUID, even if the co...
Why does my RSS feed duplicate some entries? When reading my RSS feed with the Thunderbird feed reader, some entries are duplicated. Google Reader does not have the same problem. Here is the faulty feed: http://plcoder.net/rss.php?rss=Blog There is a problem, but where? I added a GUID, but the problem remains. Other fe...
TITLE: Why does my RSS feed duplicate some entries? QUESTION: When reading my RSS feed with the Thunderbird feed reader, some entries are duplicated. Google Reader does not have the same problem. Here is the faulty feed: http://plcoder.net/rss.php?rss=Blog There is a problem, but where? I added a GUID, but the problem...
[ "syntax", "rss", "feed" ]
4
7
8,583
4
0
2008-10-08T13:02:54.283000
2008-10-08T13:08:59.700000
182,622
182,878
Exceptions Thrown (Errors Encountered) After Program Termination
I have an application that seems to throw exceptions only after the program has been closed. And it is very inconsistent. (We all know how fun inconsistent bugs are...) My guess is there is an error during the clean up process. But these memory read/write errors seem to indicate something wrong in my "unsafe" code usag...
If your app is multi-threaded you could be getting errors from worker threads which aren't properly terminating and trying to access disposed objects.
Exceptions Thrown (Errors Encountered) After Program Termination I have an application that seems to throw exceptions only after the program has been closed. And it is very inconsistent. (We all know how fun inconsistent bugs are...) My guess is there is an error during the clean up process. But these memory read/write...
TITLE: Exceptions Thrown (Errors Encountered) After Program Termination QUESTION: I have an application that seems to throw exceptions only after the program has been closed. And it is very inconsistent. (We all know how fun inconsistent bugs are...) My guess is there is an error during the clean up process. But these...
[ "c#", "vb.net", "unsafe" ]
5
4
9,506
6
0
2008-10-08T13:03:50.303000
2008-10-08T13:54:01.777000
182,636
182,672
How to determine the class of a generic type?
I'm creating a generic class and in one of the methods I need to know the Class of the generic type currently in use. The reason is that one of the method's I call expects this as an argument. Example: public class MyGenericClass { public void doSomething() { // Snip... // Call to a 3rd party lib T bean = (T)someObject...
Still the same problems: Generic informations are erased at runtime, it cannot be recovered. A workaround is to pass the class T in parameter of a static method: public class MyGenericClass { private final Class clazz; public static MyGenericClass createMyGeneric(Class clazz) { return new MyGenericClass (clazz); } p...
How to determine the class of a generic type? I'm creating a generic class and in one of the methods I need to know the Class of the generic type currently in use. The reason is that one of the method's I call expects this as an argument. Example: public class MyGenericClass { public void doSomething() { // Snip... // ...
TITLE: How to determine the class of a generic type? QUESTION: I'm creating a generic class and in one of the methods I need to know the Class of the generic type currently in use. The reason is that one of the method's I call expects this as an argument. Example: public class MyGenericClass { public void doSomething(...
[ "java", "generics" ]
61
49
73,951
6
0
2008-10-08T13:07:34.040000
2008-10-08T13:12:35.713000
182,637
182,664
How should I install Linux on Windows Vista PC?
I am doing.net programming in addition to c and c++ development and want more flexibility on my home machine. I want to be able to have both Linux (probably Ubuntu) and Windows Vista on my home computer. Is there a way I can install both and on boot be prompted for which one to start? Is there a way to set Windows to d...
The latest versions of Ubuntu include an installer called Wubi, which installs Ubuntu as a windows application (ie: it can be uninstalled from Add/Remove programs) and sets up the dual boot for you! It's great for those who want to give Linux a try without a system overhaul!
How should I install Linux on Windows Vista PC? I am doing.net programming in addition to c and c++ development and want more flexibility on my home machine. I want to be able to have both Linux (probably Ubuntu) and Windows Vista on my home computer. Is there a way I can install both and on boot be prompted for which ...
TITLE: How should I install Linux on Windows Vista PC? QUESTION: I am doing.net programming in addition to c and c++ development and want more flexibility on my home machine. I want to be able to have both Linux (probably Ubuntu) and Windows Vista on my home computer. Is there a way I can install both and on boot be p...
[ "windows", "linux", "ubuntu", "windows-vista" ]
8
26
6,349
16
0
2008-10-08T13:07:40.420000
2008-10-08T13:11:29.163000
182,641
182,674
How do I display the first letter as uppercase?
I have fname and lname in my database, and a name could be stored as JOHN DOE or john DOE or JoHN dOE, but ultimately I want to display it as John Doe fname being John and lname being Doe
seeing it is tagged PHP: either string ucfirst ( string $str ); to uppercase first letter of the first word or string ucwords ( string $str ); to uppercase the first letter of every word you might want to use those in combination with string strtolower ( string $str ); to normalize all names to lower case first.
How do I display the first letter as uppercase? I have fname and lname in my database, and a name could be stored as JOHN DOE or john DOE or JoHN dOE, but ultimately I want to display it as John Doe fname being John and lname being Doe
TITLE: How do I display the first letter as uppercase? QUESTION: I have fname and lname in my database, and a name could be stored as JOHN DOE or john DOE or JoHN dOE, but ultimately I want to display it as John Doe fname being John and lname being Doe ANSWER: seeing it is tagged PHP: either string ucfirst ( string $...
[ "php", "mysql" ]
6
14
3,262
7
0
2008-10-08T13:08:27.190000
2008-10-08T13:12:41.190000
182,670
182,693
Visual Print Design for .NET
I have a project that I'm working on and I need to be able to print out ID cards from the program. Are there any products out there that are reasonably priced so I can design a document for print and use it in.NET? I'm trying to avoid using System.Drawing from having to do it manually because when the company I work fo...
You could use Adobe Acrobat and one of the libraries out there for writing PDFs. That would let you design the document template in Adobe Acrobat, fill it out in code, and print it in code. There are some open source PDF writers and some commercial ones. The differences lie in the feature sets. I've used PDFWriter in t...
Visual Print Design for .NET I have a project that I'm working on and I need to be able to print out ID cards from the program. Are there any products out there that are reasonably priced so I can design a document for print and use it in.NET? I'm trying to avoid using System.Drawing from having to do it manually becau...
TITLE: Visual Print Design for .NET QUESTION: I have a project that I'm working on and I need to be able to print out ID cards from the program. Are there any products out there that are reasonably priced so I can design a document for print and use it in.NET? I'm trying to avoid using System.Drawing from having to do...
[ "c#", ".net", "vb.net", "printing" ]
2
1
4,990
3
0
2008-10-08T13:12:25.887000
2008-10-08T13:15:25.600000
182,675
182,705
Why are some PHP errors not written in the PHP log?
On a server I have to take care of, errors from a vhost do not go to the standard PHP error log. In the php.ini we have log = /var/log/file and phpinfo() does not show any difference between the vhost and the whole server. But the callback function set up by set_error_handler() catches errors which are not in the php l...
Perhaps the errors that aren't logged aren't supposed to be logged? The error reporting settings have no effect when set_error_handler is used, hence you see more errors than are in the logfile.
Why are some PHP errors not written in the PHP log? On a server I have to take care of, errors from a vhost do not go to the standard PHP error log. In the php.ini we have log = /var/log/file and phpinfo() does not show any difference between the vhost and the whole server. But the callback function set up by set_error...
TITLE: Why are some PHP errors not written in the PHP log? QUESTION: On a server I have to take care of, errors from a vhost do not go to the standard PHP error log. In the php.ini we have log = /var/log/file and phpinfo() does not show any difference between the vhost and the whole server. But the callback function s...
[ "php", "logging", "error-handling" ]
1
4
894
2
0
2008-10-08T13:12:46.180000
2008-10-08T13:19:02.330000
182,683
182,696
LinqToSql referenced entities will throw NullReferenceException
I have a very interesting problem on my LinqToSql model. On some of my tables i have a references to other tables and in LinqToSql this is represented by a EnitiyRef class, when you are trying to access the references table LinqToSql will load the reference from the database. On my development machine everything worked...
Have you turned the context logging on and compared the results on your dev box to those on your production box?
LinqToSql referenced entities will throw NullReferenceException I have a very interesting problem on my LinqToSql model. On some of my tables i have a references to other tables and in LinqToSql this is represented by a EnitiyRef class, when you are trying to access the references table LinqToSql will load the referenc...
TITLE: LinqToSql referenced entities will throw NullReferenceException QUESTION: I have a very interesting problem on my LinqToSql model. On some of my tables i have a references to other tables and in LinqToSql this is represented by a EnitiyRef class, when you are trying to access the references table LinqToSql will...
[ "c#", ".net", "sql", "database", "linq" ]
1
2
642
5
0
2008-10-08T13:14:27.050000
2008-10-08T13:16:27.203000
182,691
183,819
VS2008 Start Page replacement
I really don't like the VS2008 Start Page. I don't need the RSS reader, Getting started or Headlines. The only thing useful is "Recent Projects" Is there a way to customize it or replace with a better one? It will be nice that the page contains Favorites Projects and Recent projects. P.S. I know that I can disabled it ...
Here's an article with a lot of detail on how to precisely customize the start page. Unfortunately, it looks to be a rather arduous process. But hey, if you have the time... Customizing the Visual Studio.NET 2003 Start Page
VS2008 Start Page replacement I really don't like the VS2008 Start Page. I don't need the RSS reader, Getting started or Headlines. The only thing useful is "Recent Projects" Is there a way to customize it or replace with a better one? It will be nice that the page contains Favorites Projects and Recent projects. P.S. ...
TITLE: VS2008 Start Page replacement QUESTION: I really don't like the VS2008 Start Page. I don't need the RSS reader, Getting started or Headlines. The only thing useful is "Recent Projects" Is there a way to customize it or replace with a better one? It will be nice that the page contains Favorites Projects and Rece...
[ "visual-studio", "visual-studio-2008" ]
9
1
1,605
5
0
2008-10-08T13:15:13.883000
2008-10-08T17:07:57.033000
182,711
182,762
Odd exception thrown in .NET
Exception Thrown: "System.ComponentModel.ReflectPropertyDescriptor is not marked as Serializable" Does this mean I missed marking something as serializable myself, or is this something beyond my control?
It is in your control. Most likely the problem is the same as this: http://www.codeplex.com/SharedCache/Thread/View.aspx?ThreadId=19759
Odd exception thrown in .NET Exception Thrown: "System.ComponentModel.ReflectPropertyDescriptor is not marked as Serializable" Does this mean I missed marking something as serializable myself, or is this something beyond my control?
TITLE: Odd exception thrown in .NET QUESTION: Exception Thrown: "System.ComponentModel.ReflectPropertyDescriptor is not marked as Serializable" Does this mean I missed marking something as serializable myself, or is this something beyond my control? ANSWER: It is in your control. Most likely the problem is the same a...
[ ".net", "vb.net", "exception" ]
4
1
748
3
0
2008-10-08T13:20:05.213000
2008-10-08T13:31:44.147000
182,714
182,937
Does Twitter Help You Become a Better Developer or Distract You?
Since I've joined twitter I have found it very helpful to keep my finger on the pulse of technology and where it is going. I follow many of the top Microsoft developers and find it interesting to see their struggles, opinions, and influences... codinghorror / Jeff Atwood shanselman / Scott Hanselman haacked / Phil Haac...
It's definitely a distraction, but I find that an amusing distraction here and there is good for me. I get more done in shorter amounts of time when my morale is high, and connecting to the outside world helps with that. I follow my wife, our cat (yep, has a twitter), several friends, a few ColdFusion & Flex evangelist...
Does Twitter Help You Become a Better Developer or Distract You? Since I've joined twitter I have found it very helpful to keep my finger on the pulse of technology and where it is going. I follow many of the top Microsoft developers and find it interesting to see their struggles, opinions, and influences... codinghorr...
TITLE: Does Twitter Help You Become a Better Developer or Distract You? QUESTION: Since I've joined twitter I have found it very helpful to keep my finger on the pulse of technology and where it is going. I follow many of the top Microsoft developers and find it interesting to see their struggles, opinions, and influe...
[ "twitter" ]
4
7
765
9
0
2008-10-08T13:21:17.333000
2008-10-08T14:03:17.467000
182,721
183,682
Spring + Hibernate: how to have a configurable PK generator?
We use Spring + Hibernate for a Webapp. This Webapp will be deployed on two unrelated production sites. These two production sites will use the Webapp to generate and use Person data in parallel. What I need to do, is to make sure that the Persons generated on these two unrelated production sites all have distinct PKs,...
You could use sequences on both production systems, but define them differently: Production System 1: CREATE SEQUENCE sequence_name START WITH 1 INCREMENT BY 2; Production System 2: CREATE SEQUENCE sequence_name START WITH 2 INCREMENT BY 2; The first sequence will generate only odd numbers, the second only even numbers...
Spring + Hibernate: how to have a configurable PK generator? We use Spring + Hibernate for a Webapp. This Webapp will be deployed on two unrelated production sites. These two production sites will use the Webapp to generate and use Person data in parallel. What I need to do, is to make sure that the Persons generated o...
TITLE: Spring + Hibernate: how to have a configurable PK generator? QUESTION: We use Spring + Hibernate for a Webapp. This Webapp will be deployed on two unrelated production sites. These two production sites will use the Webapp to generate and use Person data in parallel. What I need to do, is to make sure that the P...
[ "java", "hibernate", "spring", "sequences" ]
2
2
1,495
2
0
2008-10-08T13:23:36.237000
2008-10-08T16:33:28.867000
182,739
182,798
Is it possible to enumerate the wxFrame children in wxWidgets?
I'm using the wxGlade designer to generate the GUI for a small application. It generates a class, inherited from wxFrame, which is the main application window. In order to facilitate the maintenance, I'd like to avoid writing additional code in this generated class. But all the widgets created with the wxGlade are actu...
All classes inherited from wxWindow (wxFrame being one of them) have a function " GetChildren ", which returns a list of child windows that you can then enumerate over. If you are looking for a specific field by name then use the " FindWindow " function.
Is it possible to enumerate the wxFrame children in wxWidgets? I'm using the wxGlade designer to generate the GUI for a small application. It generates a class, inherited from wxFrame, which is the main application window. In order to facilitate the maintenance, I'd like to avoid writing additional code in this generat...
TITLE: Is it possible to enumerate the wxFrame children in wxWidgets? QUESTION: I'm using the wxGlade designer to generate the GUI for a small application. It generates a class, inherited from wxFrame, which is the main application window. In order to facilitate the maintenance, I'd like to avoid writing additional co...
[ "c++", "user-interface", "wxwidgets", "wxglade" ]
2
3
2,926
3
0
2008-10-08T13:27:19.427000
2008-10-08T13:39:35.440000
182,742
182,776
How do I calculate the last day of the month in SQL?
Specifically MSSQL 2005.
Here's a solution that gives you the last second of the current month. You can extract the date part or modify it to return just the day. I tested this on SQL Server 2005. select dateadd( s, -1, dateadd( mm, datediff( m, 0, getdate() ) + 1, 0 ) ); To understand how it works we have to look at the dateadd() and datediff...
How do I calculate the last day of the month in SQL? Specifically MSSQL 2005.
TITLE: How do I calculate the last day of the month in SQL? QUESTION: Specifically MSSQL 2005. ANSWER: Here's a solution that gives you the last second of the current month. You can extract the date part or modify it to return just the day. I tested this on SQL Server 2005. select dateadd( s, -1, dateadd( mm, datedif...
[ "sql", "sql-server", "t-sql", "date" ]
6
18
28,365
9
0
2008-10-08T13:27:49.257000
2008-10-08T13:34:37.493000
182,748
182,761
.NET IExtenderProvider (C#)
I'm trying to extend the TextBox, ComboBox and Panel controls using IExtenderProvider but I cannot get it to work properly. I'm starting to believe that I haven't understood the concept completely. Does anybody know any good resources on the web (with examples) on how IExtenderProvider is used?
http://www.codeproject.com/aspnet/FixingIExtenderProvider.asp http://www.codeproject.com/aspnet/ExtenderProviderComponent.asp
.NET IExtenderProvider (C#) I'm trying to extend the TextBox, ComboBox and Panel controls using IExtenderProvider but I cannot get it to work properly. I'm starting to believe that I haven't understood the concept completely. Does anybody know any good resources on the web (with examples) on how IExtenderProvider is us...
TITLE: .NET IExtenderProvider (C#) QUESTION: I'm trying to extend the TextBox, ComboBox and Panel controls using IExtenderProvider but I cannot get it to work properly. I'm starting to believe that I haven't understood the concept completely. Does anybody know any good resources on the web (with examples) on how IExte...
[ "c#", ".net", "iextenderprovider" ]
2
2
1,552
1
0
2008-10-08T13:29:03.340000
2008-10-08T13:31:32.353000
182,749
182,767
Do you change the way you think when moving between Java and C#
This is a question for anyone who has the pleasure to work in both Java and C#. Do you find that you have to make a mental context switch of some kind when you move from one to the other? I'm working in both at the moment and because the syntax and libraries are so similar and yet subtly different I'm finding it frustr...
Yes, I have to make a mental context switch - because LINQ isn't available in Java:( Beyond that, there are little things like foreach (X x in y) vs for (X x: y) which often trip me up, but not a huge amount otherwise. As for a tip to make your brain work differently: don't give into the temptation to use the naming co...
Do you change the way you think when moving between Java and C# This is a question for anyone who has the pleasure to work in both Java and C#. Do you find that you have to make a mental context switch of some kind when you move from one to the other? I'm working in both at the moment and because the syntax and librari...
TITLE: Do you change the way you think when moving between Java and C# QUESTION: This is a question for anyone who has the pleasure to work in both Java and C#. Do you find that you have to make a mental context switch of some kind when you move from one to the other? I'm working in both at the moment and because the ...
[ "c#", "java" ]
6
6
372
5
0
2008-10-08T13:29:32.623000
2008-10-08T13:32:34.363000
182,750
182,846
Map a network drive to be used by a service
Suppose some Windows service uses code that wants mapped network drives and no UNC paths. How can I make the drive mapping available to the service's session when the service is started? Logging in as the service user and creating a persistent mapping will not establish the mapping in the context of the actual service.
You'll either need to modify the service, or wrap it inside a helper process: apart from session/drive access issues, persistent drive mappings are only restored on an interactive logon, which services typically don't perform. The helper process approach can be pretty simple: just create a new service that maps the dri...
Map a network drive to be used by a service Suppose some Windows service uses code that wants mapped network drives and no UNC paths. How can I make the drive mapping available to the service's session when the service is started? Logging in as the service user and creating a persistent mapping will not establish the m...
TITLE: Map a network drive to be used by a service QUESTION: Suppose some Windows service uses code that wants mapped network drives and no UNC paths. How can I make the drive mapping available to the service's session when the service is started? Logging in as the service user and creating a persistent mapping will n...
[ "windows", "windows-services", "unc", "system-administration", "mapped-drive" ]
240
50
453,897
13
0
2008-10-08T13:29:49.080000
2008-10-08T13:48:29.540000
182,858
185,300
ASP.Net error: "Cannot use a leading .. to exit above the top directory"
I'm seeing this error several times an hour on my production site and am not quite sure how to fix it. I've grepped the source code and I am not using "../" anywhere in my code to generate a path. My application is running on IIS6 on Win2003 Server. It's using URLRewriter.Net to allow the site to have friendly URLs, an...
It's probably due to using "~/something", probably on a Hyperlink control. When the physical file is at a different directory level from the friendly URL, ASP.NET uses too many../'s in the relative URL that it generates, giving this error. If you can't just use an absolute URL instead, I believe that you can use Page.R...
ASP.Net error: "Cannot use a leading .. to exit above the top directory" I'm seeing this error several times an hour on my production site and am not quite sure how to fix it. I've grepped the source code and I am not using "../" anywhere in my code to generate a path. My application is running on IIS6 on Win2003 Serve...
TITLE: ASP.Net error: "Cannot use a leading .. to exit above the top directory" QUESTION: I'm seeing this error several times an hour on my production site and am not quite sure how to fix it. I've grepped the source code and I am not using "../" anywhere in my code to generate a path. My application is running on IIS...
[ "asp.net", "iis-6", "directory", "windows-server-2003" ]
4
3
3,332
6
0
2008-10-08T13:51:32.593000
2008-10-08T23:10:38.923000
182,872
405,594
How to test whether method return type matches List<String>
What is the easiest way to test (using reflection), whether given method (i.e. java.lang.Method instance) has a return type, which can be safely casted to List? Consider this snippet: public static class StringList extends ArrayList {} public List method1(); public ArrayList method2(); public StringList method3(); All...
Solving this in general is really not easy to do yourself using only the tools provided by Java itself. There are a lot of special cases (nested classes, type parameter bounds,...) to take care of. That's why I wrote a library to make generic type reflection easier: gentyref. I added sample code (in the form of a JUnit...
How to test whether method return type matches List<String> What is the easiest way to test (using reflection), whether given method (i.e. java.lang.Method instance) has a return type, which can be safely casted to List? Consider this snippet: public static class StringList extends ArrayList {} public List method1(); ...
TITLE: How to test whether method return type matches List<String> QUESTION: What is the easiest way to test (using reflection), whether given method (i.e. java.lang.Method instance) has a return type, which can be safely casted to List? Consider this snippet: public static class StringList extends ArrayList {} publi...
[ "java", "generics", "reflection" ]
16
4
16,122
4
0
2008-10-08T13:53:20.703000
2009-01-01T22:41:48.880000
182,873
183,149
Serializable Inheritance
If something inherits from a Serializable class, is the child class still Serializable?
It depends what you mean be serializable. If you mean the CLI marker (i.e. the [Serializable] attribute), then this is not inherited (proof below). You must explicitly mark each derived class as [Serializable]. If, however, you mean the ISerializable interface, then yes: interface implementations are inherited, but you...
Serializable Inheritance If something inherits from a Serializable class, is the child class still Serializable?
TITLE: Serializable Inheritance QUESTION: If something inherits from a Serializable class, is the child class still Serializable? ANSWER: It depends what you mean be serializable. If you mean the CLI marker (i.e. the [Serializable] attribute), then this is not inherited (proof below). You must explicitly mark each de...
[ "c#", ".net", "vb.net" ]
51
90
26,299
1
0
2008-10-08T13:53:22.450000
2008-10-08T14:46:07.087000
182,874
183,233
Sharepoint disaster recovery
What are your disaster recovery plans for Windows Sharepoint Services 3.0? Currently we are backuping all databases (1 content, admin, search and config) using sql backup tools, and backuping the front end server via dataprotector. To test our backups, we use another server farm, restore the content database (following...
You can't really backup / restore both config database and search database: restoring config database only work if your new farm have exactly the same server names when you restore the search database, the fulltext index is not synchronize. however, this is not a problem as you can just reindex. As a result, I would sa...
Sharepoint disaster recovery What are your disaster recovery plans for Windows Sharepoint Services 3.0? Currently we are backuping all databases (1 content, admin, search and config) using sql backup tools, and backuping the front end server via dataprotector. To test our backups, we use another server farm, restore th...
TITLE: Sharepoint disaster recovery QUESTION: What are your disaster recovery plans for Windows Sharepoint Services 3.0? Currently we are backuping all databases (1 content, admin, search and config) using sql backup tools, and backuping the front end server via dataprotector. To test our backups, we use another serve...
[ "sharepoint", "backup", "restore" ]
1
3
768
4
0
2008-10-08T13:53:39.517000
2008-10-08T14:58:56.967000
182,875
182,884
Free tool to Create/Edit PNG Images?
Is there any free tool available for creating and editing PNG Images?
Paint.NET will create and edit PNGs with gusto. It's an excellent program in many respects. It's free as in beer and speech.
Free tool to Create/Edit PNG Images? Is there any free tool available for creating and editing PNG Images?
TITLE: Free tool to Create/Edit PNG Images? QUESTION: Is there any free tool available for creating and editing PNG Images? ANSWER: Paint.NET will create and edit PNGs with gusto. It's an excellent program in many respects. It's free as in beer and speech.
[ "image", "png" ]
67
80
320,524
5
0
2008-10-08T13:53:46.987000
2008-10-08T13:54:43.927000
182,876
183,082
IBM Websphere OutOfMemoryException
Often, I found OutOfMemoryException on IBM Websphere Application Server. I think this exception occur because my application retrieve Huge data from database. So, I limit all query don't retreive data more than 1000 records and set JVM of WAS follow + Verbose garbage collection + Maximum Heap size = 1024 (RAM on my ser...
The answer to this is dependent on the message associated with the OutOfMemoryException. You can also try -XX:MaxPermSize=... and set it to something larger like 256m. Also, if you have a recursive function somewhere, that may be causing a stack overflow. If you can, please post the message associated with the exceptio...
IBM Websphere OutOfMemoryException Often, I found OutOfMemoryException on IBM Websphere Application Server. I think this exception occur because my application retrieve Huge data from database. So, I limit all query don't retreive data more than 1000 records and set JVM of WAS follow + Verbose garbage collection + Maxi...
TITLE: IBM Websphere OutOfMemoryException QUESTION: Often, I found OutOfMemoryException on IBM Websphere Application Server. I think this exception occur because my application retrieve Huge data from database. So, I limit all query don't retreive data more than 1000 records and set JVM of WAS follow + Verbose garbage...
[ "java", "web-services", "jakarta-ee", "websphere" ]
4
1
8,416
6
0
2008-10-08T13:53:53.027000
2008-10-08T14:34:40.073000
182,891
203,485
Render App.config/Web.config files via XSLT
Does anyone have an XSLT that will take the app.config and render it into a non-techie palatable format? The purpose being mainly informational, but with the nice side-effect of validating the XML (if it's been made invalid, it won't render)
First draft at a solution to show Connection Strings App Settings Whack this in the app.config: And this is the contents of display-config.xslt: Settings Connection Strings Name Connection String Settings Key Value
Render App.config/Web.config files via XSLT Does anyone have an XSLT that will take the app.config and render it into a non-techie palatable format? The purpose being mainly informational, but with the nice side-effect of validating the XML (if it's been made invalid, it won't render)
TITLE: Render App.config/Web.config files via XSLT QUESTION: Does anyone have an XSLT that will take the app.config and render it into a non-techie palatable format? The purpose being mainly informational, but with the nice side-effect of validating the XML (if it's been made invalid, it won't render) ANSWER: First d...
[ ".net", "xslt", "app-config" ]
1
2
2,648
2
0
2008-10-08T13:55:48.217000
2008-10-15T01:59:19.223000
182,901
182,918
Quickest way to implement a searchable, browsable image gallery - flickr integration?
I have a friend who is need of a web page. He does interior construction, and would like to have a gallery of his work. I'll probably go for a php host, and was thinking about the best way to implement the image gallery for him. I came up with: Use flickr to host the images. They can be tagged, added to sets, and I can...
It sounds like a difficult way to do things - have you considered Gallery (No points on creativity for the name!). Unless you're really wanting to save on bandwidth, I think you'd get much better results from installing some pre-built gallery.
Quickest way to implement a searchable, browsable image gallery - flickr integration? I have a friend who is need of a web page. He does interior construction, and would like to have a gallery of his work. I'll probably go for a php host, and was thinking about the best way to implement the image gallery for him. I cam...
TITLE: Quickest way to implement a searchable, browsable image gallery - flickr integration? QUESTION: I have a friend who is need of a web page. He does interior construction, and would like to have a gallery of his work. I'll probably go for a php host, and was thinking about the best way to implement the image gall...
[ "php", "flickr", "image-gallery" ]
2
3
5,801
6
0
2008-10-08T13:57:11.270000
2008-10-08T14:00:21.233000
182,910
182,935
Determine highest .NET Framework version
I need to determine the highest.NET framework version installed on a desktop machine from C\C++ code. Looks like I can iterate the folders under %systemroot%\Microsoft.NET\Framework, but that seems kind of error prone. Is there a better way? Perhaps a registry key I can inspect? Thanks.
Use the Windows Registry location HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP.
Determine highest .NET Framework version I need to determine the highest.NET framework version installed on a desktop machine from C\C++ code. Looks like I can iterate the folders under %systemroot%\Microsoft.NET\Framework, but that seems kind of error prone. Is there a better way? Perhaps a registry key I can inspect?...
TITLE: Determine highest .NET Framework version QUESTION: I need to determine the highest.NET framework version installed on a desktop machine from C\C++ code. Looks like I can iterate the folders under %systemroot%\Microsoft.NET\Framework, but that seems kind of error prone. Is there a better way? Perhaps a registry ...
[ ".net", "c++", "c", "version-detection" ]
12
10
9,744
4
0
2008-10-08T13:58:50.690000
2008-10-08T14:02:46.517000
182,925
182,947
Winforms toolbar of buttons wrapping .
I am dynamically added a bunch of buttons to a toolbar. I want the ability to programatically make it wrap onto a second row if the number of buttons exceeds the horizontal space in the current form. I dont want users to have to click the dropdown button to view more buttons as i need to ensure that all buttons are vie...
You need just four lines. First, disable docking: Me.ToolStrip1.Dock = System.Windows.Forms.DockStyle.None Then turn off auto-sizing: Me.ToolStrip1.AutoSize = False Now set the layout to "Flow" Me.ToolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow Then then change the size to double the height of a...
Winforms toolbar of buttons wrapping . I am dynamically added a bunch of buttons to a toolbar. I want the ability to programatically make it wrap onto a second row if the number of buttons exceeds the horizontal space in the current form. I dont want users to have to click the dropdown button to view more buttons as i ...
TITLE: Winforms toolbar of buttons wrapping . QUESTION: I am dynamically added a bunch of buttons to a toolbar. I want the ability to programatically make it wrap onto a second row if the number of buttons exceeds the horizontal space in the current form. I dont want users to have to click the dropdown button to view ...
[ "c#", "winforms", "toolbar", "button" ]
1
1
1,885
1
0
2008-10-08T14:01:37.033000
2008-10-08T14:04:31.397000
182,931
203,353
In an Oracle cluster will sysdate always return a consistent answer?
In an Oracle cluster (more than one machine co-operating to serve one database) will the "sysdate" function always return a consistent answer? Even if the servers' Operating System clock reports inconsistent values?
I would strongly suspect that SYSDATE is OS-linked too. Be very watchful of the reason why you need to use it. If have any logic which implements incremental tracking of events (e.g. you're doing incremental exports) and you must ensure no items left out as well as no duplication, base the tracking on sequential IDs ra...
In an Oracle cluster will sysdate always return a consistent answer? In an Oracle cluster (more than one machine co-operating to serve one database) will the "sysdate" function always return a consistent answer? Even if the servers' Operating System clock reports inconsistent values?
TITLE: In an Oracle cluster will sysdate always return a consistent answer? QUESTION: In an Oracle cluster (more than one machine co-operating to serve one database) will the "sysdate" function always return a consistent answer? Even if the servers' Operating System clock reports inconsistent values? ANSWER: I would ...
[ "oracle", "function", "plsql", "cluster-computing", "oracleinternals" ]
1
1
1,774
4
0
2008-10-08T14:02:10.683000
2008-10-15T00:42:11.500000
182,945
182,966
How to see what will be updated from repository before issuing "svn update" command?
I've committed changes in numerous files to a SVN repository from Eclipse. I then go to website directory on the linux box where I want to update these changes from the repository to the directory there. I want to say "svn update project100" which will update the directories under "project100" with all my added and cha...
Try: svn status --show-updates or (the same but shorter): svn status -u
How to see what will be updated from repository before issuing "svn update" command? I've committed changes in numerous files to a SVN repository from Eclipse. I then go to website directory on the linux box where I want to update these changes from the repository to the directory there. I want to say "svn update proje...
TITLE: How to see what will be updated from repository before issuing "svn update" command? QUESTION: I've committed changes in numerous files to a SVN repository from Eclipse. I then go to website directory on the linux box where I want to update these changes from the repository to the directory there. I want to say...
[ "svn" ]
124
173
82,389
7
0
2008-10-08T14:04:27.730000
2008-10-08T14:08:35.007000
182,957
182,973
Position in Vector using STL
im trying to locate the position of the minimum value in a vector, using STL find algorithm (and the min_element algorithm), but instead of returning the postion, its just giving me the value. E.g, if the minimum value is it, is position will be returned as 8 etc. What am I doing wrong here? int value = *min_element(v2...
min_element already gives you the iterator, no need to invoke find (additionally, it's inefficient because it's twice the work). Use distance or the - operator: cout << "min value at " << min_element(v2.begin(), v2.end()) - v2.begin();
Position in Vector using STL im trying to locate the position of the minimum value in a vector, using STL find algorithm (and the min_element algorithm), but instead of returning the postion, its just giving me the value. E.g, if the minimum value is it, is position will be returned as 8 etc. What am I doing wrong here...
TITLE: Position in Vector using STL QUESTION: im trying to locate the position of the minimum value in a vector, using STL find algorithm (and the min_element algorithm), but instead of returning the postion, its just giving me the value. E.g, if the minimum value is it, is position will be returned as 8 etc. What am ...
[ "c++", "stl" ]
17
34
18,521
3
0
2008-10-08T14:06:55.200000
2008-10-08T14:09:42.480000
182,976
184,466
What is more efficient for parsing Xml, XPath with XmlDocuments, XSLT or Linq?
I have parsed XML using both of the following two methods... Parsing the XmlDocument using the object model and XPath queries. XSL/T But I have never used... The Linq Xml object model that was new to.Net 3.5 Can anyone tell me the comparative efficiency between the three alternatives? I realise that the particular usag...
The absolute fastest way to query an XML document is the hardest: write a method that uses an XmlReader to process the input stream, and have it process nodes as it reads them. This is the way to combine parsing and querying into a single operation. (Simply using XPath doesn't do this; both XmlDocument and XPathDocumen...
What is more efficient for parsing Xml, XPath with XmlDocuments, XSLT or Linq? I have parsed XML using both of the following two methods... Parsing the XmlDocument using the object model and XPath queries. XSL/T But I have never used... The Linq Xml object model that was new to.Net 3.5 Can anyone tell me the comparativ...
TITLE: What is more efficient for parsing Xml, XPath with XmlDocuments, XSLT or Linq? QUESTION: I have parsed XML using both of the following two methods... Parsing the XmlDocument using the object model and XPath queries. XSL/T But I have never used... The Linq Xml object model that was new to.Net 3.5 Can anyone tell...
[ ".net", "xml", "linq", "xslt", "xpath" ]
28
45
15,982
4
0
2008-10-08T14:10:05.160000
2008-10-08T19:32:38.037000
182,984
182,992
ASP.NET- Instantiate a Web User Control in App_Code class
Files: Website\Controls\map.ascx Website\App_Code\map.cs I'd like to create a strongly typed instance of map.ascx in map.cs Normally, in an aspx, you would add a <%Register... tag to be able to instantiate in codebehind. Is this possible in an app_code class? I'm using.NET 3.5/Visual Studio 2008 Thanks!
Normally, I'd do something like this (assuming your type is "Map" and that you have the appropriate "Inherits" declaration in your.ascx file): Map map = (Map)LoadControl("~/Controls/map.ascx");
ASP.NET- Instantiate a Web User Control in App_Code class Files: Website\Controls\map.ascx Website\App_Code\map.cs I'd like to create a strongly typed instance of map.ascx in map.cs Normally, in an aspx, you would add a <%Register... tag to be able to instantiate in codebehind. Is this possible in an app_code class? I'...
TITLE: ASP.NET- Instantiate a Web User Control in App_Code class QUESTION: Files: Website\Controls\map.ascx Website\App_Code\map.cs I'd like to create a strongly typed instance of map.ascx in map.cs Normally, in an aspx, you would add a <%Register... tag to be able to instantiate in codebehind. Is this possible in an ...
[ "asp.net" ]
5
4
6,143
2
0
2008-10-08T14:11:34.847000
2008-10-08T14:14:06.400000
182,993
237,830
ASP.NET MVC in a virtual directory
I have the following in my Global.asax.cs routes.MapRoute( "Arrival", "{partnerID}", new { controller = "Search", action = "Index", partnerID="1000" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); My SearchController looks like this public class ...
IIS 5.1 interprets your url such that its looking for a folder named 1000 under the folder named Test. Why is that so? This happens because IIS 6 only invokes ASP.NET when it sees a “filename extension” in the URL that’s mapped to aspnet_isapi.dll (which is a C/C++ ISAPI filter responsible for invoking ASP.NET). Since ...
ASP.NET MVC in a virtual directory I have the following in my Global.asax.cs routes.MapRoute( "Arrival", "{partnerID}", new { controller = "Search", action = "Index", partnerID="1000" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); My SearchContr...
TITLE: ASP.NET MVC in a virtual directory QUESTION: I have the following in my Global.asax.cs routes.MapRoute( "Arrival", "{partnerID}", new { controller = "Search", action = "Index", partnerID="1000" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" }...
[ "c#", "asp.net-mvc", "model-view-controller", "iis-5" ]
10
4
11,465
4
0
2008-10-08T14:14:17.133000
2008-10-26T10:26:09.937000
183,001
183,058
Build C project automaticly
I'm working on a free software (bsd license) project with others. We're searching for a system that check out our source code (svn) and build it also as test it (unit tests with Check / other tools). It should have a webbased interface and generate reports. I hope we don't have to write such a system from null by ourse...
You surely do not have to code this yourself - there are a lot of continuous integration systems which are able to check out source code from systems such as SVN and they are generally easy to extend with your own tasks, so running custom test scripts/programs should not be a problem. While these CI systems are probabl...
Build C project automaticly I'm working on a free software (bsd license) project with others. We're searching for a system that check out our source code (svn) and build it also as test it (unit tests with Check / other tools). It should have a webbased interface and generate reports. I hope we don't have to write such...
TITLE: Build C project automaticly QUESTION: I'm working on a free software (bsd license) project with others. We're searching for a system that check out our source code (svn) and build it also as test it (unit tests with Check / other tools). It should have a webbased interface and generate reports. I hope we don't ...
[ "c", "unit-testing", "build-process", "build-system" ]
2
4
403
4
0
2008-10-08T14:16:17.910000
2008-10-08T14:30:10.957000
183,002
183,172
Protect Excel Worksheet for format and size and allow only for entry
I am creating an XLS worksheet that would be used to collect data from the users. I have restricted the user input using validations. In order to easily be able to print the worksheet i have set the lenghts of the columns. Have made the relevant columns wrap. However i would like to protect the worksheet such that User...
The key is after you protect the sheet to use the interface exposed in "Allow Users To Edit Ranges". I'm going to assume you are using Office 2003 since you didn't specify, so you find it in Tools -> Protection -> Allow Users to Edit Ranges. From there it should be pretty obvious - you create named ranges and give edit...
Protect Excel Worksheet for format and size and allow only for entry I am creating an XLS worksheet that would be used to collect data from the users. I have restricted the user input using validations. In order to easily be able to print the worksheet i have set the lenghts of the columns. Have made the relevant colum...
TITLE: Protect Excel Worksheet for format and size and allow only for entry QUESTION: I am creating an XLS worksheet that would be used to collect data from the users. I have restricted the user input using validations. In order to easily be able to print the worksheet i have set the lenghts of the columns. Have made ...
[ "excel" ]
5
3
38,409
2
0
2008-10-08T14:16:42.060000
2008-10-08T14:48:34.117000
183,009
468,860
C# Google Earth Error
A friend of mine has embedded a google earth plugin into a C# user control. All works fine but when you close the window we recieve and "Unspecified Error" with the option to continue running the scripts or not. From our tracking it down it appears this is being cause by a script that google is dropping onto the page. ...
Here is an example, by me, of c#/Google Earth API integration that covers the problem you are having (see the comments) http://fraserchapman.blogspot.com/2008/08/google-earth-plug-in-and-c.html Also, here is another of my projects that uses COM Google Earth Plugin Type Library (plugin_ax.dll) converted into the equival...
C# Google Earth Error A friend of mine has embedded a google earth plugin into a C# user control. All works fine but when you close the window we recieve and "Unspecified Error" with the option to continue running the scripts or not. From our tracking it down it appears this is being cause by a script that google is dr...
TITLE: C# Google Earth Error QUESTION: A friend of mine has embedded a google earth plugin into a C# user control. All works fine but when you close the window we recieve and "Unspecified Error" with the option to continue running the scripts or not. From our tracking it down it appears this is being cause by a script...
[ "c#", "controls", "google-earth-plugin" ]
2
2
4,223
4
0
2008-10-08T14:18:14.503000
2009-01-22T12:01:14.467000
183,013
186,561
Hibernate: comparing current & previous record
I want to compare the current value of an in-memory Hibernate entity with the value in the database: HibernateSession sess = HibernateSessionFactory.getSession(); MyEntity newEntity = (MyEntity)sess.load(MyEntity.class, id); newEntity.setProperty("new value"); MyEntity oldEntity = (MyEntity)sess.load(MyEntity.class, id...
Two easy options spring to mind: Evict oldEntity before saving newEntity Use session.merge() on oldEntity to replace the version in the session cache (newEntity) with the original (oldEntity) EDIT: to elaborate a little, the problem here is that Hibernate keeps a persistence context, which is the objects being monitore...
Hibernate: comparing current & previous record I want to compare the current value of an in-memory Hibernate entity with the value in the database: HibernateSession sess = HibernateSessionFactory.getSession(); MyEntity newEntity = (MyEntity)sess.load(MyEntity.class, id); newEntity.setProperty("new value"); MyEntity old...
TITLE: Hibernate: comparing current & previous record QUESTION: I want to compare the current value of an in-memory Hibernate entity with the value in the database: HibernateSession sess = HibernateSessionFactory.getSession(); MyEntity newEntity = (MyEntity)sess.load(MyEntity.class, id); newEntity.setProperty("new val...
[ "hibernate", "jpa", "session", "diff" ]
7
9
11,780
2
0
2008-10-08T14:18:43.757000
2008-10-09T09:42:23.967000
183,016
183,544
Using top clause in Access sub report
I'm making a report in Access 2003 that contains a sub report of related records. Within the sub report, I want the top two records only. When I add "TOP 2" to the sub report's query, it seems to select the top two records before it filters on the link fields. How do I get the top two records of only those records that...
I've got two suggestions: 1) Pass your master field (on the parent form) to the query as a parameter (you could reference a field on the parent form directly as well) 2) You could fake out rownumbers in Access and limit them to only rownum <= 2. E.g., SELECT o1.order_number, o1.order_date, (SELECT COUNT(*) FROM orders ...
Using top clause in Access sub report I'm making a report in Access 2003 that contains a sub report of related records. Within the sub report, I want the top two records only. When I add "TOP 2" to the sub report's query, it seems to select the top two records before it filters on the link fields. How do I get the top ...
TITLE: Using top clause in Access sub report QUESTION: I'm making a report in Access 2003 that contains a sub report of related records. Within the sub report, I want the top two records only. When I add "TOP 2" to the sub report's query, it seems to select the top two records before it filters on the link fields. How...
[ "sql", "ms-access" ]
2
1
2,232
2
0
2008-10-08T14:19:51.570000
2008-10-08T16:03:48.520000
183,017
185,396
Removing Cache Busting in Rails Production
When i deploy a rails application in production mode, it appends a date-time string as a query param to the end of all the static asset urls. This is to prevent browsers using old-out of date cahed copies of the assets after I redeploy the application. Is there a way to make rails use the old time stamps for the assets...
I think you can use ENV['RAILS_ASSET_ID'] to alter the cache-busting asset ID. Unfortunately, this is for all assets. But if it's not set, it uses the asset's source modification time. If that file hasn't been modified since the last time you used it, it shouldn't be a problem. If the asset ID is changing when they hav...
Removing Cache Busting in Rails Production When i deploy a rails application in production mode, it appends a date-time string as a query param to the end of all the static asset urls. This is to prevent browsers using old-out of date cahed copies of the assets after I redeploy the application. Is there a way to make r...
TITLE: Removing Cache Busting in Rails Production QUESTION: When i deploy a rails application in production mode, it appends a date-time string as a query param to the end of all the static asset urls. This is to prevent browsers using old-out of date cahed copies of the assets after I redeploy the application. Is the...
[ "ruby-on-rails", "deployment", "caching" ]
9
6
5,961
3
0
2008-10-08T14:19:53.330000
2008-10-08T23:48:43.107000
183,024
183,044
Drop-shadows text: CSS or graphic?
I have an internal web app with an image at the top of the page, currently containing some english text with drop shadows. I now need to provide localized versions of this page for various languages. My main choices are: Have a different graphic per supported language, containing the localized text. Use CSS to position...
Personally I'm a big fan of CSS techniques for visual effects like this. The big benefit is that you are offloading the processing of the effect to the client side, saving you bandwith and content creation time (custom text images for each locale is a big order!), and making the page download faster for the user. The o...
Drop-shadows text: CSS or graphic? I have an internal web app with an image at the top of the page, currently containing some english text with drop shadows. I now need to provide localized versions of this page for various languages. My main choices are: Have a different graphic per supported language, containing the ...
TITLE: Drop-shadows text: CSS or graphic? QUESTION: I have an internal web app with an image at the top of the page, currently containing some english text with drop shadows. I now need to provide localized versions of this page for various languages. My main choices are: Have a different graphic per supported languag...
[ "css", "localization" ]
3
9
1,639
4
0
2008-10-08T14:21:07.760000
2008-10-08T14:26:45.503000
183,035
697,518
WPF ComboBox doesn't stay open when used in a Task Pane
I have a strange bug with WPF Interop and an Excel Addin. I'm using.Net 3.5 SP1. I'm using Add-in Express to create a Custom Task Pane for Excel 2003. Within that taskpane I'm using ElementHost to host a WPF UserControl. The UserControl simply contains a Grid with a TextBox and ComboBox. My problem is that whilst every...
Add-in Express looked into this for me, and it turns out to have something to do with the Window style of the Task Pane that gets added to Excel. If you turn off the WS_CHILD flag in the Windows CreateParams then Combo Boxes and other popups work as expected. They gave me this snippet of code to add to my ADXExcelTaskP...
WPF ComboBox doesn't stay open when used in a Task Pane I have a strange bug with WPF Interop and an Excel Addin. I'm using.Net 3.5 SP1. I'm using Add-in Express to create a Custom Task Pane for Excel 2003. Within that taskpane I'm using ElementHost to host a WPF UserControl. The UserControl simply contains a Grid with...
TITLE: WPF ComboBox doesn't stay open when used in a Task Pane QUESTION: I have a strange bug with WPF Interop and an Excel Addin. I'm using.Net 3.5 SP1. I'm using Add-in Express to create a Custom Task Pane for Excel 2003. Within that taskpane I'm using ElementHost to host a WPF UserControl. The UserControl simply co...
[ "wpf", "excel", "interop" ]
2
4
1,835
2
0
2008-10-08T14:23:31.063000
2009-03-30T14:44:43.980000
183,039
183,067
Current Cursor Position when Using the Prawn Ruby Library
I'm using the Prawn Ruby library ( http://prawn.majesticseacreature.com/ ) to generate some pdf documents. I draw a table without any problem. Next, I want to insert some lines after the table for various people's signatures. Before I draw the lines, I would like to see if there is enough remaining room on the page to ...
Of course, after entering the question, I immediately figure it out. The 'y' and 'y=' methods in the Document class allow you to get and set the current y position, which is all that is necessary.
Current Cursor Position when Using the Prawn Ruby Library I'm using the Prawn Ruby library ( http://prawn.majesticseacreature.com/ ) to generate some pdf documents. I draw a table without any problem. Next, I want to insert some lines after the table for various people's signatures. Before I draw the lines, I would lik...
TITLE: Current Cursor Position when Using the Prawn Ruby Library QUESTION: I'm using the Prawn Ruby library ( http://prawn.majesticseacreature.com/ ) to generate some pdf documents. I draw a table without any problem. Next, I want to insert some lines after the table for various people's signatures. Before I draw the ...
[ "ruby", "prawn" ]
11
13
7,265
1
0
2008-10-08T14:25:45.597000
2008-10-08T14:31:16.053000
183,041
183,059
Graphing/Crystal Reports with ASP.Net MVC
I would like to add graphing to my User Controls in ASP.NET MVC. I am hoping for some ideas or a guide on how to approach this issue. I have searched around and found no helpful answers to resolve this issue. I was thinking of doing crystal reports but they don't boat over well in ASP.NET from my previous experience. I...
You could go with google charts for free, or something like Dundas (which is EXCELLENT) if you are willing to pay. I hope I've understood your question.
Graphing/Crystal Reports with ASP.Net MVC I would like to add graphing to my User Controls in ASP.NET MVC. I am hoping for some ideas or a guide on how to approach this issue. I have searched around and found no helpful answers to resolve this issue. I was thinking of doing crystal reports but they don't boat over well...
TITLE: Graphing/Crystal Reports with ASP.Net MVC QUESTION: I would like to add graphing to my User Controls in ASP.NET MVC. I am hoping for some ideas or a guide on how to approach this issue. I have searched around and found no helpful answers to resolve this issue. I was thinking of doing crystal reports but they do...
[ "asp.net-mvc", "model-view-controller", "crystal-reports", "graph" ]
1
3
4,342
4
0
2008-10-08T14:26:05.037000
2008-10-08T14:30:16.540000
183,062
300,736
CSS 'schema' how-to
How does one go about establishing a CSS 'schema', or hierarchy, of general element styles, nested element styles, and classed element styles. For a rank novice like me, the amount of information in stylesheets I view is completely overwhelming. What process does one follow in creating a well factored stylesheet or she...
I'm a big fan of naming my CSS classes by their contents or content types, for example a containing navigational "tabs" would have class="tabs". A header containing a date could be class="date" or an ordered list containing a top 10 list could have class="chart". Similarly, for IDs, one could give the page footer id="f...
CSS 'schema' how-to How does one go about establishing a CSS 'schema', or hierarchy, of general element styles, nested element styles, and classed element styles. For a rank novice like me, the amount of information in stylesheets I view is completely overwhelming. What process does one follow in creating a well factor...
TITLE: CSS 'schema' how-to QUESTION: How does one go about establishing a CSS 'schema', or hierarchy, of general element styles, nested element styles, and classed element styles. For a rank novice like me, the amount of information in stylesheets I view is completely overwhelming. What process does one follow in crea...
[ "css", "styling" ]
8
6
5,005
8
0
2008-10-08T14:30:27.273000
2008-11-19T01:08:34.817000
183,075
183,514
Is there a hotkey to speed up the repetitive commits in Eclipse (or a general windows GUI macro tool)?
I am making numerous, minute changes to.php files in Eclipse PDT then committing them and testing on the server. The repetitive six-step commit process is getting tedious: right-click team Commit... click "choose previously selected comment" select in list click OK Does anyone know of a hotkey or other process to exped...
The best I've been able to do is create a key binding for 'Commit' (under Preferences... General->Keys). Then you just need to click on the project and hit a key combination, which saves the whole right-click->Team->Commit... process. If you just want to check in the file you are editing, you don't have to click anywhe...
Is there a hotkey to speed up the repetitive commits in Eclipse (or a general windows GUI macro tool)? I am making numerous, minute changes to.php files in Eclipse PDT then committing them and testing on the server. The repetitive six-step commit process is getting tedious: right-click team Commit... click "choose prev...
TITLE: Is there a hotkey to speed up the repetitive commits in Eclipse (or a general windows GUI macro tool)? QUESTION: I am making numerous, minute changes to.php files in Eclipse PDT then committing them and testing on the server. The repetitive six-step commit process is getting tedious: right-click team Commit... ...
[ "windows", "eclipse", "macros", "eclipse-pdt" ]
1
3
910
4
0
2008-10-08T14:33:27.687000
2008-10-08T15:56:55.133000
183,083
188,700
Need help writing a custom BuildListener
I would like to add a BuildListener to my headless build process, which is building an Eclipse product. The docs on how to do this are, shall we say, a bit scanty. I think I need to put my custom jar in a plugin and then use the org.eclipse.ant.core.extraClasspathEntries extension point to make that jar visible to Ant....
I had this problem when I had two plugins providing an ant.jar. Make sure you use the org.apache.ant plugin and that there is no other plugin providing another ant.jar. Another thing I just stumbled upon: The jar containing your contribution must not be in the plugins classpath (Runtime -> Classpath). See Eclipse Bug 3...
Need help writing a custom BuildListener I would like to add a BuildListener to my headless build process, which is building an Eclipse product. The docs on how to do this are, shall we say, a bit scanty. I think I need to put my custom jar in a plugin and then use the org.eclipse.ant.core.extraClasspathEntries extensi...
TITLE: Need help writing a custom BuildListener QUESTION: I would like to add a BuildListener to my headless build process, which is building an Eclipse product. The docs on how to do this are, shall we say, a bit scanty. I think I need to put my custom jar in a plugin and then use the org.eclipse.ant.core.extraClassp...
[ "eclipse", "ant", "eclipse-plugin" ]
1
1
870
2
0
2008-10-08T14:35:10.960000
2008-10-09T19:02:41.590000
183,091
183,290
Capistrano for Java?
I'm a big fan of Capistrano but I need to develop an automated deployment script for a Java-only shop. I've looked at Ant and Maven and they don't seem to be well geared towards remote administration the way Capistrano is - they seem much more focused on simply building and packaging applications. Is there a better too...
I don't think there is a Capistrano-like application for Java Web Applications, but that shouldn't really keep you from using it (or alternatives like Fabric) to deploy your applications. As you've already said, Ant is more a replacement for GNU Make while Maven is primary a buildout/dependency-management application. ...
Capistrano for Java? I'm a big fan of Capistrano but I need to develop an automated deployment script for a Java-only shop. I've looked at Ant and Maven and they don't seem to be well geared towards remote administration the way Capistrano is - they seem much more focused on simply building and packaging applications. ...
TITLE: Capistrano for Java? QUESTION: I'm a big fan of Capistrano but I need to develop an automated deployment script for a Java-only shop. I've looked at Ant and Maven and they don't seem to be well geared towards remote administration the way Capistrano is - they seem much more focused on simply building and packag...
[ "java", "deployment", "capistrano" ]
15
14
15,209
6
0
2008-10-08T14:38:49.113000
2008-10-08T15:08:45.307000
183,093
183,262
Vb6 "Tag" property equivalent in ASP.Net?
I'm looking for ideas and opinions here, not a "real answer", I guess... Back in the old VB6 days, there was this property called "Tag" in all controls, that was a useful way to store custom information related to a control. Every single control had it, and all was bliss... Now, in.Net (at least for WebForms), it's not...
No, there's no direct equivalent, but if you're using v3.5 of the Framework, you can add this functionality quite easily using an extension method. For example: Imports System.Runtime.CompilerServices Public Module Extensions _ Public Sub SetTag(ByVal ctl As Control, ByVal tagValue As String) If SessionTagDictionary.C...
Vb6 "Tag" property equivalent in ASP.Net? I'm looking for ideas and opinions here, not a "real answer", I guess... Back in the old VB6 days, there was this property called "Tag" in all controls, that was a useful way to store custom information related to a control. Every single control had it, and all was bliss... Now...
TITLE: Vb6 "Tag" property equivalent in ASP.Net? QUESTION: I'm looking for ideas and opinions here, not a "real answer", I guess... Back in the old VB6 days, there was this property called "Tag" in all controls, that was a useful way to store custom information related to a control. Every single control had it, and al...
[ "asp.net", "controls", "webforms", "tag-property" ]
7
5
4,289
8
0
2008-10-08T14:39:01.890000
2008-10-08T15:03:00.047000
183,108
183,235
Is object code generated for unused template class methods?
I have a C++ template class that gets instantiated with 3 different type parameters. There's a method that the class needs to have for only one of those types and that isn't ever called with the two other types. Will object code for that method be generated thrice (for all types for which the template is instantiated),...
Virtual member functions are instantiated when a class template is instantiated, but non-virtual member functions are instantiated only if they are called. This is covered in [temp.inst] in the C++ standard (In C++11, this is §14.7.1/10. In C++14, it is §14.7.1/11, and in C++17 it is §17.7.1/9. Excerpt from C++17 below...
Is object code generated for unused template class methods? I have a C++ template class that gets instantiated with 3 different type parameters. There's a method that the class needs to have for only one of those types and that isn't ever called with the two other types. Will object code for that method be generated th...
TITLE: Is object code generated for unused template class methods? QUESTION: I have a C++ template class that gets instantiated with 3 different type parameters. There's a method that the class needs to have for only one of those types and that isn't ever called with the two other types. Will object code for that meth...
[ "c++", "templates", "footprint" ]
14
25
2,489
3
0
2008-10-08T14:41:16.737000
2008-10-08T14:59:05.560000
183,115
183,188
How to disable all apache virtual hosts?
I'm writing a shell script to do some web server configuration. I need to disable all currently active virtual hosts. a2dissite doesn't accept multiple arguments, so I can't do a2dissite `ls /etc/apache2/sites-enabled` Should I use find? Is it safe to manually delete the symlinks in /etc/apache2/sites-enabled?
Is your script Debian only? If so, you can safely delete all the symlinks in sites-enabled, that will work as long as all sites have been written correctly, in the sites-available directory. For example: find /etc/apache2/sites-enabled/ -type l -exec rm -i "{}" \; will protect you against someone who has actually writt...
How to disable all apache virtual hosts? I'm writing a shell script to do some web server configuration. I need to disable all currently active virtual hosts. a2dissite doesn't accept multiple arguments, so I can't do a2dissite `ls /etc/apache2/sites-enabled` Should I use find? Is it safe to manually delete the symlink...
TITLE: How to disable all apache virtual hosts? QUESTION: I'm writing a shell script to do some web server configuration. I need to disable all currently active virtual hosts. a2dissite doesn't accept multiple arguments, so I can't do a2dissite `ls /etc/apache2/sites-enabled` Should I use find? Is it safe to manually ...
[ "apache", "virtualhost" ]
18
13
57,002
9
0
2008-10-08T14:42:39.480000
2008-10-08T14:51:14.703000
183,118
186,255
Windows Forms: Screen capture when running non-graphically (i.e. screensaver is active)
I've got an application that is very graphics intensive and built on DirectX and Windows Forms. It has an automation and replay framework around which is built an automated testing system. Unfortunately, when the tests run unattended during a nightly build, the display is inactive or tied up with the screensaver, and o...
Since you're mentioned rendering pipeline, so I'm assuming you're using Direct3d, if so, you can save the backbuffer of the frame. I did that when I was still using VB.Net + MDX Dim tempSurface As Direct3D.Surface tempSurface = device.GetBackBuffer(0, 0, Direct3D.BackBufferType.Mono) Direct3D.SurfaceLoader.Save(tempFil...
Windows Forms: Screen capture when running non-graphically (i.e. screensaver is active) I've got an application that is very graphics intensive and built on DirectX and Windows Forms. It has an automation and replay framework around which is built an automated testing system. Unfortunately, when the tests run unattende...
TITLE: Windows Forms: Screen capture when running non-graphically (i.e. screensaver is active) QUESTION: I've got an application that is very graphics intensive and built on DirectX and Windows Forms. It has an automation and replay framework around which is built an automated testing system. Unfortunately, when the t...
[ "winforms", "testing", "directx" ]
1
2
1,058
4
0
2008-10-08T14:42:53.207000
2008-10-09T07:28:42.880000
183,124
183,183
Multiple random values in SQL Server 2005
I need to generate multiple random values under SQL Server 2005 and somehow this simply won't work with Random(Value) as ( select rand() Value union all select rand() from Random )select top 10 * from Random What's the preferred workaround?
have you tries something like this (found at http://weblogs.sqlteam.com ): CREATE VIEW vRandNumber AS SELECT RAND() as RandNumber GO create a function CREATE FUNCTION RandNumber() RETURNS float AS BEGIN RETURN (SELECT RandNumber FROM vRandNumber) END GO then you can call it in your selects as normal Select dbo.RandNumb...
Multiple random values in SQL Server 2005 I need to generate multiple random values under SQL Server 2005 and somehow this simply won't work with Random(Value) as ( select rand() Value union all select rand() from Random )select top 10 * from Random What's the preferred workaround?
TITLE: Multiple random values in SQL Server 2005 QUESTION: I need to generate multiple random values under SQL Server 2005 and somehow this simply won't work with Random(Value) as ( select rand() Value union all select rand() from Random )select top 10 * from Random What's the preferred workaround? ANSWER: have you ...
[ "sql", "sql-server", "random" ]
2
3
1,584
2
0
2008-10-08T14:43:40.257000
2008-10-08T14:50:59.400000
183,131
183,621
How do you decide if something goes in the view or the controller? (Zend Framework)
How do you decide if something goes in the view or the controller? Here are some specific examples: Zend_Captcha: Does the controller generate the captcha and pass it to the view or does the view generate it? Zend_Alc: Does the view decide if a segment of the view should be displayed to the user or do you have multiple...
Generally speaking, this question can apply to any MVC framework. Here are the guidelines I use: Skinny controllers. If possible, have your controllers do little more than invoke business logic on your models and pass results to your views. Views do nothing but View Logic. Do anything related to interacting with the us...
How do you decide if something goes in the view or the controller? (Zend Framework) How do you decide if something goes in the view or the controller? Here are some specific examples: Zend_Captcha: Does the controller generate the captcha and pass it to the view or does the view generate it? Zend_Alc: Does the view dec...
TITLE: How do you decide if something goes in the view or the controller? (Zend Framework) QUESTION: How do you decide if something goes in the view or the controller? Here are some specific examples: Zend_Captcha: Does the controller generate the captcha and pass it to the view or does the view generate it? Zend_Alc:...
[ "php", "model-view-controller", "zend-framework", "separation-of-concerns" ]
1
11
582
2
0
2008-10-08T14:44:19.943000
2008-10-08T16:21:47.640000
183,148
183,218
Stored Procedure Versioning
How do you manage revisions of stored procedures? We have a BI solution on SQL Server 2005 with hundreds of stored procedures. What would be a good way to get these into Subversion? What are your recommended tools to script stored procedures to files?
There are doubtless a bunch of off-the-shelf products you could buy (I think a few RedGate tools might come in handy here), as well as Visual Studio Team Suite - Database Edition. In light of purchasing something, why not consider using SQL Management Objects (SMO)? I've written a couple of utilities which generate T-S...
Stored Procedure Versioning How do you manage revisions of stored procedures? We have a BI solution on SQL Server 2005 with hundreds of stored procedures. What would be a good way to get these into Subversion? What are your recommended tools to script stored procedures to files?
TITLE: Stored Procedure Versioning QUESTION: How do you manage revisions of stored procedures? We have a BI solution on SQL Server 2005 with hundreds of stored procedures. What would be a good way to get these into Subversion? What are your recommended tools to script stored procedures to files? ANSWER: There are dou...
[ "sql-server", "svn", "stored-procedures" ]
7
7
12,162
4
0
2008-10-08T14:46:01.530000
2008-10-08T14:57:07
183,161
183,197
What's the best way to break from nested loops in JavaScript?
What's the best way to break from nested loops in Javascript? //Write the links to the page. for (var x = 0; x < Args.length; x++) { for (var Heading in Navigation.Headings) { for (var Item in Navigation.Headings[Heading]) { if (Args[x] == Navigation.Headings[Heading][Item].Name) { document.write(" " + Navigation.Headi...
Just like Perl, loop1: for (var i in set1) { loop2: for (var j in set2) { loop3: for (var k in set3) { break loop2; // breaks out of loop3 and loop2 } } } as defined in EMCA-262 section 12.12. [MDN Docs] Unlike C, these labels can only be used for continue and break, as Javascript does not have goto.
What's the best way to break from nested loops in JavaScript? What's the best way to break from nested loops in Javascript? //Write the links to the page. for (var x = 0; x < Args.length; x++) { for (var Heading in Navigation.Headings) { for (var Item in Navigation.Headings[Heading]) { if (Args[x] == Navigation.Heading...
TITLE: What's the best way to break from nested loops in JavaScript? QUESTION: What's the best way to break from nested loops in Javascript? //Write the links to the page. for (var x = 0; x < Args.length; x++) { for (var Heading in Navigation.Headings) { for (var Item in Navigation.Headings[Heading]) { if (Args[x] == ...
[ "javascript", "loops", "nested-loops", "break" ]
643
1,474
402,755
18
0
2008-10-08T14:47:25.100000
2008-10-08T14:53:40.720000
183,179
194,181
How do I fade a row out before postback
I have a table that is created in a DataList in ASP.Net. This table has three fields of text, then a field with an edit button, and a field with a delete button. When a person clicks the delete button, it posts back, deletes the items, and then binds the DataList again. The DataList is in an UpdatePanel so the item smo...
You can use page methods in asp.net to send a request to the server without doing a postback. They are very simple to use and you can do whatever effect you like when the ajax call is completed (you get a function called on success). If you want to stick with the post back one solution is the following: and in js somet...
How do I fade a row out before postback I have a table that is created in a DataList in ASP.Net. This table has three fields of text, then a field with an edit button, and a field with a delete button. When a person clicks the delete button, it posts back, deletes the items, and then binds the DataList again. The DataL...
TITLE: How do I fade a row out before postback QUESTION: I have a table that is created in a DataList in ASP.Net. This table has three fields of text, then a field with an edit button, and a field with a delete button. When a person clicks the delete button, it posts back, deletes the items, and then binds the DataLis...
[ "asp.net", "ajax", ".net-2.0" ]
0
2
996
4
0
2008-10-08T14:50:10.213000
2008-10-11T15:13:25.457000
183,191
185,362
Ruby rufus scheduler gem
We're thinking about using the rufus-scheduler gem on a Ruby on Rails project to do regular monitoring of a communication queue. Has anyone have experience using this gem on a Rails project? Anyone have strong preferences of an alternative scheduler?
I find cron and script/runner is usually enough, but I don't think you'll really go wrong with rufus-scheduler. Just make sure the scheduled tasks you're running are sufficiently abstracted so that if you decide to change your mind later on about how these tasks are run, it isn't a big problem. I say experiment and run...
Ruby rufus scheduler gem We're thinking about using the rufus-scheduler gem on a Ruby on Rails project to do regular monitoring of a communication queue. Has anyone have experience using this gem on a Rails project? Anyone have strong preferences of an alternative scheduler?
TITLE: Ruby rufus scheduler gem QUESTION: We're thinking about using the rufus-scheduler gem on a Ruby on Rails project to do regular monitoring of a communication queue. Has anyone have experience using this gem on a Rails project? Anyone have strong preferences of an alternative scheduler? ANSWER: I find cron and s...
[ "ruby-on-rails", "ruby", "scheduling" ]
2
4
1,706
1
0
2008-10-08T14:51:27.183000
2008-10-08T23:34:42.993000
183,201
184,241
Should a developer aim for readability or performance first?
Oftentimes a developer will be faced with a choice between two possible ways to solve a problem -- one that is idiomatic and readable, and another that is less intuitive, but may perform better. For example, in C-based languages, there are two ways to multiply a number by 2: int SimpleMultiplyBy2(int x) { return x * 2;...
You missed one. First code for correctness, then for clarity (the two are often connected, of course!). Finally, and only if you have real empirical evidence that you actually need to, you can look at optimizing. Premature optimization really is evil. Optimization almost always costs you time, clarity, maintainability....
Should a developer aim for readability or performance first? Oftentimes a developer will be faced with a choice between two possible ways to solve a problem -- one that is idiomatic and readable, and another that is less intuitive, but may perform better. For example, in C-based languages, there are two ways to multipl...
TITLE: Should a developer aim for readability or performance first? QUESTION: Oftentimes a developer will be faced with a choice between two possible ways to solve a problem -- one that is idiomatic and readable, and another that is less intuitive, but may perform better. For example, in C-based languages, there are t...
[ "performance", "readability" ]
102
128
17,405
35
0
2008-10-08T14:54:32.717000
2008-10-08T18:45:56.010000
183,214
193,853
JavaScript Callback Scope
I'm having some trouble with plain old JavaScript (no frameworks) in referencing my object in a callback function. function foo(id) { this.dom = document.getElementById(id); this.bar = 5; var self = this; this.dom.addEventListener("click", self.onclick, false); } foo.prototype = { onclick: function() { this.bar = 7; }...
(extracted some explanation that was hidden in comments in other answer) The problem lies in the following line: this.dom.addEventListener("click", self.onclick, false); Here, you pass a function object to be used as callback. When the event trigger, the function is called but now it has no association with any object ...
JavaScript Callback Scope I'm having some trouble with plain old JavaScript (no frameworks) in referencing my object in a callback function. function foo(id) { this.dom = document.getElementById(id); this.bar = 5; var self = this; this.dom.addEventListener("click", self.onclick, false); } foo.prototype = { onclick: fu...
TITLE: JavaScript Callback Scope QUESTION: I'm having some trouble with plain old JavaScript (no frameworks) in referencing my object in a callback function. function foo(id) { this.dom = document.getElementById(id); this.bar = 5; var self = this; this.dom.addEventListener("click", self.onclick, false); } foo.prototy...
[ "javascript", "events", "binding", "scope", "callback" ]
58
81
54,588
7
0
2008-10-08T14:56:09.187000
2008-10-11T08:33:30.163000
183,249
860,709
WPF DocumentViewer Find-function and FixedPage documents
.Net contains a nice control called DocumentViewer. it also offers a subcontrol for finding text in the loaded document (that's at least what it is supposed to do). When inserting FixedPage 's objects as document source for the DocumentViewer, the find-functionality just does not find anything. Not even single letters....
I had this same problem with FixedDocuments. If you convert your FixedDocument to an XPS document then it works fine. Example of creating an XPS Document in memory from a FixedDocument then displaying in a DocumentViewer. // Add to xaml: // Add project references to "ReachFramework" and "System.Printing" using System; ...
WPF DocumentViewer Find-function and FixedPage documents .Net contains a nice control called DocumentViewer. it also offers a subcontrol for finding text in the loaded document (that's at least what it is supposed to do). When inserting FixedPage 's objects as document source for the DocumentViewer, the find-functional...
TITLE: WPF DocumentViewer Find-function and FixedPage documents QUESTION: .Net contains a nice control called DocumentViewer. it also offers a subcontrol for finding text in the loaded document (that's at least what it is supposed to do). When inserting FixedPage 's objects as document source for the DocumentViewer, t...
[ "wpf", "xaml", "xps", "documentviewer", "fixedpage" ]
7
9
7,874
2
0
2008-10-08T15:01:08.007000
2009-05-13T22:18:03.177000
183,250
183,260
What is returned when I call ToString() on an uninitialized char object property?
I have a c# object with a property called Gender which is declared as a char. private char _Gender; public char Gender { get{ return _Gender; } set{ _Gender = value; } } What string is returned/created when I call MyObject.Gender.ToString()? I ask because I am calling a webservice (which accepts a string rather than a...
The default value of char is unicode 0, so I'd expect "\u0000" to be returned.
What is returned when I call ToString() on an uninitialized char object property? I have a c# object with a property called Gender which is declared as a char. private char _Gender; public char Gender { get{ return _Gender; } set{ _Gender = value; } } What string is returned/created when I call MyObject.Gender.ToStrin...
TITLE: What is returned when I call ToString() on an uninitialized char object property? QUESTION: I have a c# object with a property called Gender which is declared as a char. private char _Gender; public char Gender { get{ return _Gender; } set{ _Gender = value; } } What string is returned/created when I call MyObj...
[ "c#" ]
3
3
367
3
0
2008-10-08T15:01:14.137000
2008-10-08T15:02:53.917000
183,254
183,481
What is a postback?
I'm making my way into web development and have seen the word postback thrown around. Coming from a non-web based background, what does a new web developer have to know about postbacks? (i.e. what are they and when do they arise?) Any more information you'd like to share to help a newbie in the web world be aware of po...
The following is aimed at beginners to ASP.Net... When does it happen? A postback originates from the client browser. Usually one of the controls on the page will be manipulated by the user (a button clicked or dropdown changed, etc), and this control will initiate a postback. The state of this control, plus all other ...
What is a postback? I'm making my way into web development and have seen the word postback thrown around. Coming from a non-web based background, what does a new web developer have to know about postbacks? (i.e. what are they and when do they arise?) Any more information you'd like to share to help a newbie in the web ...
TITLE: What is a postback? QUESTION: I'm making my way into web development and have seen the word postback thrown around. Coming from a non-web based background, what does a new web developer have to know about postbacks? (i.e. what are they and when do they arise?) Any more information you'd like to share to help a ...
[ "postback" ]
167
199
150,291
11
0
2008-10-08T15:01:20.893000
2008-10-08T15:50:32.277000
183,279
183,305
Please wait dialog & downloading files in asp.net
In my ASP.Net application I have a requirement that when a user clicks on an UI element we generate a PDF for them which they can download. This is currently implemented by doing a form post to an ashx page. This page essentially inspects the form and then executes the correct server side page which either results in H...
The popup can have a client side timer which polls the server for task completion. The long running server task should update the progress in a database table or a server cache object which can be accessed by the polling service. Couple of old articles from MSDN magazine. You should be able to use the same concepts wit...
Please wait dialog & downloading files in asp.net In my ASP.Net application I have a requirement that when a user clicks on an UI element we generate a PDF for them which they can download. This is currently implemented by doing a form post to an ashx page. This page essentially inspects the form and then executes the ...
TITLE: Please wait dialog & downloading files in asp.net QUESTION: In my ASP.Net application I have a requirement that when a user clicks on an UI element we generate a PDF for them which they can download. This is currently implemented by doing a form post to an ashx page. This page essentially inspects the form and ...
[ "asp.net" ]
3
3
3,170
4
0
2008-10-08T15:06:31.757000
2008-10-08T15:10:50.017000
183,292
183,313
Classpath including JAR within a JAR
Is it possible to specify a Java classpath that includes a JAR file contained within another JAR file?
If you're trying to create a single jar that contains your application and its required libraries, there are two ways (that I know of) to do that. The first is One-Jar, which uses a special classloader to allow the nesting of jars. The second is UberJar, (or Shade ), which explodes the included libraries and puts all t...
Classpath including JAR within a JAR Is it possible to specify a Java classpath that includes a JAR file contained within another JAR file?
TITLE: Classpath including JAR within a JAR QUESTION: Is it possible to specify a Java classpath that includes a JAR file contained within another JAR file? ANSWER: If you're trying to create a single jar that contains your application and its required libraries, there are two ways (that I know of) to do that. The fi...
[ "java", "classpath" ]
145
102
167,569
15
0
2008-10-08T15:09:21.110000
2008-10-08T15:12:05.863000
183,310
183,404
How do I Update a GridView from a Page Method from code behind?
How do I update a Gridview on a aspx page from a webmethod? Here is my code. [WebMethod] public static string GetDate() { return DateTime.Now.ToString(); } I can't use the "findcontrol" or the "this" methods so I need some help.
You can dynamically/programmatically build the GridView control. Then in your WebMethod, you can call RenderControl() method to retrieve the HTML content of the rendered GridView control. Return that content from the WebMethod and have the callback JavaScript function inject the HTML content into your placeholder eleme...
How do I Update a GridView from a Page Method from code behind? How do I update a Gridview on a aspx page from a webmethod? Here is my code. [WebMethod] public static string GetDate() { return DateTime.Now.ToString(); } I can't use the "findcontrol" or the "this" methods so I need some help.
TITLE: How do I Update a GridView from a Page Method from code behind? QUESTION: How do I update a Gridview on a aspx page from a webmethod? Here is my code. [WebMethod] public static string GetDate() { return DateTime.Now.ToString(); } I can't use the "findcontrol" or the "this" methods so I need some help. ANSWER:...
[ "jquery", "web-services", "json", "gridview", "asmx" ]
4
5
3,936
1
0
2008-10-08T15:11:33.697000
2008-10-08T15:32:26.850000
183,316
192,371
ASP.NET MVC HandleError
How do I go about the [HandleError] filter in asp.net MVC Preview 5? I set the customErrors in my Web.config file and put [HandleError] above my Controller Class like this: [HandleError] public class DSWebsiteController: Controller { [snip] public ActionResult CrashTest() { throw new Exception("Oh Noes!"); } } Then I l...
[HandleError] When you provide only the HandleError attribute to your class (or to your action method for that matter), then when an unhandled exception occurs MVC will look for a corresponding View named "Error" first in the Controller's View folder. If it can't find it there then it will proceed to look in the Shared...
ASP.NET MVC HandleError How do I go about the [HandleError] filter in asp.net MVC Preview 5? I set the customErrors in my Web.config file and put [HandleError] above my Controller Class like this: [HandleError] public class DSWebsiteController: Controller { [snip] public ActionResult CrashTest() { throw new Exception("...
TITLE: ASP.NET MVC HandleError QUESTION: How do I go about the [HandleError] filter in asp.net MVC Preview 5? I set the customErrors in my Web.config file and put [HandleError] above my Controller Class like this: [HandleError] public class DSWebsiteController: Controller { [snip] public ActionResult CrashTest() { thr...
[ "asp.net-mvc", "custom-error-pages", "handleerror" ]
111
158
102,209
6
0
2008-10-08T15:12:32.617000
2008-10-10T17:29:42.560000
183,323
183,328
MYSQL: REGEXP single quotation matching
I am having a trouble matching a string in a MySQL-query with the following regex: I want it to match to this string: "Rue de l' Harmonie" SELECT id, street_name FROM street_names WHERE street_name REGEXP '^(rue[a-z]+[[:blank:]])((du|de|la|des|d[\']|l[\'])[[:blank:]])*[[:<:]]HARMONIE$' Anybody can give me a hint?
At the beginning: ^(rue[a-z]+ The + requires that there be at least one a-z char directly following rue. You probably want *.
MYSQL: REGEXP single quotation matching I am having a trouble matching a string in a MySQL-query with the following regex: I want it to match to this string: "Rue de l' Harmonie" SELECT id, street_name FROM street_names WHERE street_name REGEXP '^(rue[a-z]+[[:blank:]])((du|de|la|des|d[\']|l[\'])[[:blank:]])*[[:<:]]HARM...
TITLE: MYSQL: REGEXP single quotation matching QUESTION: I am having a trouble matching a string in a MySQL-query with the following regex: I want it to match to this string: "Rue de l' Harmonie" SELECT id, street_name FROM street_names WHERE street_name REGEXP '^(rue[a-z]+[[:blank:]])((du|de|la|des|d[\']|l[\'])[[:bla...
[ "mysql", "sql", "regex", "quotes" ]
1
2
1,134
1
0
2008-10-08T15:14:26.327000
2008-10-08T15:16:11.830000
183,325
183,357
C# - Any reason why this code would not function correctly?
For some reason, Section 1 works but Section 2 does not. When run in the opposite order (2 before 1), Section 1 (Affiliation) is not run at all. All the data is the same. //Section 1 UserService.DsUserAttributes dsAffiliation = us_service.GetUserAttributeDropDown(systemId, "Affiliation"); Affiliation.DataSource = dsAf...
It would certainly seem that either us_service.GetUserAttributeDropDown(systemId, "Country") or dsCountry.tblDropDownValues is throwing an exception. You'll need to walk through with the debugger to see which and why.
C# - Any reason why this code would not function correctly? For some reason, Section 1 works but Section 2 does not. When run in the opposite order (2 before 1), Section 1 (Affiliation) is not run at all. All the data is the same. //Section 1 UserService.DsUserAttributes dsAffiliation = us_service.GetUserAttributeDrop...
TITLE: C# - Any reason why this code would not function correctly? QUESTION: For some reason, Section 1 works but Section 2 does not. When run in the opposite order (2 before 1), Section 1 (Affiliation) is not run at all. All the data is the same. //Section 1 UserService.DsUserAttributes dsAffiliation = us_service.Ge...
[ "c#" ]
0
2
180
2
0
2008-10-08T15:14:50.600000
2008-10-08T15:22:36.183000
183,338
183,464
Monitoring Windows directory size
I'm looking for something that will monitor Windows directories for size and file count over time. I'm talking about a handful of servers and a few thousand folders (millions of files). Requirements: Notification on X increase in size over Y time Notification on X increase in file count over Y time Historical graphing ...
You might want to take a look at PolyMon, which is an open source systems monitoring solution. It allows you to write custom monitors in any.NET language, and allows you to create custom PowerShell monitors. It stores data on a SQL Server back end and provides graphing. For your purpose, you would just need a script th...
Monitoring Windows directory size I'm looking for something that will monitor Windows directories for size and file count over time. I'm talking about a handful of servers and a few thousand folders (millions of files). Requirements: Notification on X increase in size over Y time Notification on X increase in file coun...
TITLE: Monitoring Windows directory size QUESTION: I'm looking for something that will monitor Windows directories for size and file count over time. I'm talking about a handful of servers and a few thousand folders (millions of files). Requirements: Notification on X increase in size over Y time Notification on X inc...
[ "java", "ruby", "perl", "powershell", "groovy" ]
6
3
1,878
4
0
2008-10-08T15:18:58.783000
2008-10-08T15:47:17.367000
183,352
183,393
Groovy execute "cp *" shell command
I want to copy text files and only text files from src/ to dst/ groovy:000> "cp src/*.txt dst/".execute().text ===> groovy:000> You can see the command executes w/out error but the file src/test.txt does not get copied to dst/ This also fails: groovy:000> "cp src/* dst/".execute().text ===> groovy:000> However... "cp s...
Wildcard expansion is performed by the shell, not by cp (or groovy). Your first example is trying to copy a file named *. You could make your command "sh -c 'cp...'"
Groovy execute "cp *" shell command I want to copy text files and only text files from src/ to dst/ groovy:000> "cp src/*.txt dst/".execute().text ===> groovy:000> You can see the command executes w/out error but the file src/test.txt does not get copied to dst/ This also fails: groovy:000> "cp src/* dst/".execute().te...
TITLE: Groovy execute "cp *" shell command QUESTION: I want to copy text files and only text files from src/ to dst/ groovy:000> "cp src/*.txt dst/".execute().text ===> groovy:000> You can see the command executes w/out error but the file src/test.txt does not get copied to dst/ This also fails: groovy:000> "cp src/* ...
[ "groovy" ]
15
7
15,652
2
0
2008-10-08T15:21:57.013000
2008-10-08T15:30:12.380000
183,353
444,810
How do I determine if an array is initialized in VB6?
Passing an undimensioned array to the VB6's Ubound function will cause an error, so I want to check if it has been dimensioned yet before attempting to check its upper bound. How do I do this?
Here's what I went with. This is similar to GSerg's answer, but uses the better documented CopyMemory API function and is entirely self-contained (you can just pass the array rather than ArrPtr(array) to this function). It does use the VarPtr function, which Microsoft warns against, but this is an XP-only app, and it w...
How do I determine if an array is initialized in VB6? Passing an undimensioned array to the VB6's Ubound function will cause an error, so I want to check if it has been dimensioned yet before attempting to check its upper bound. How do I do this?
TITLE: How do I determine if an array is initialized in VB6? QUESTION: Passing an undimensioned array to the VB6's Ubound function will cause an error, so I want to check if it has been dimensioned yet before attempting to check its upper bound. How do I do this? ANSWER: Here's what I went with. This is similar to GS...
[ "arrays", "vb6" ]
63
15
58,870
24
0
2008-10-08T15:22:00.477000
2009-01-14T21:42:04.870000
183,366
183,388
Where (which layer) to put Entity query methods, "persist" methods etc.?
I have a SEAM app with some JPA/Hibernate entities. And I now wonder where to put my query, persistence methods. The default choice seems to put them in a session bean layer with injected @PersistenceContext(...) @Inject EntityManager entityManager; But I think I would rather have the methods on the entities themselves...
I have no experience with SEAM, but from my experience with Java projects, I found it easiest to keep beans clear of persist methods. What we usually do: Have beans for business objects (like "User" and "Setting" for example) Have a DAO layer which can persist and retrieve these beans (simple CRUD) Have a Service Layer...
Where (which layer) to put Entity query methods, "persist" methods etc.? I have a SEAM app with some JPA/Hibernate entities. And I now wonder where to put my query, persistence methods. The default choice seems to put them in a session bean layer with injected @PersistenceContext(...) @Inject EntityManager entityManage...
TITLE: Where (which layer) to put Entity query methods, "persist" methods etc.? QUESTION: I have a SEAM app with some JPA/Hibernate entities. And I now wonder where to put my query, persistence methods. The default choice seems to put them in a session bean layer with injected @PersistenceContext(...) @Inject EntityMa...
[ "java", "hibernate", "jpa", "ejb" ]
1
2
589
2
0
2008-10-08T15:24:44.260000
2008-10-08T15:28:51.867000
183,367
183,408
Unsubscribe anonymous method in C#
Is it possible to unsubscribe an anonymous method from an event? If I subscribe to an event like this: void MyMethod() { Console.WriteLine("I did it!"); } MyEvent += MyMethod; I can un-subscribe like this: MyEvent -= MyMethod; But if I subscribe using an anonymous method: MyEvent += delegate(){Console.WriteLine("I did...
Action myDelegate = delegate(){Console.WriteLine("I did it!");}; MyEvent += myDelegate; //.... later MyEvent -= myDelegate; Just keep a reference to the delegate around.
Unsubscribe anonymous method in C# Is it possible to unsubscribe an anonymous method from an event? If I subscribe to an event like this: void MyMethod() { Console.WriteLine("I did it!"); } MyEvent += MyMethod; I can un-subscribe like this: MyEvent -= MyMethod; But if I subscribe using an anonymous method: MyEvent += ...
TITLE: Unsubscribe anonymous method in C# QUESTION: Is it possible to unsubscribe an anonymous method from an event? If I subscribe to an event like this: void MyMethod() { Console.WriteLine("I did it!"); } MyEvent += MyMethod; I can un-subscribe like this: MyEvent -= MyMethod; But if I subscribe using an anonymous m...
[ "c#", "delegates", "anonymous-methods" ]
256
251
89,934
14
0
2008-10-08T15:24:46.307000
2008-10-08T15:33:38.177000
183,372
187,044
When writing Eclipse JDT plugins, is there a way to track appearace of certain strings in code?
I'm writing an Eclipse plugin for the JDT. I need a functionality that tracks certain strings or regular expressions and possibly creates markers. I know that Eclipse already does that for //TODO comments, for example (creating task markers for them) but I'm not sure if I can use the same mechanism. I can write my own ...
It shouldn't be complicated. Register yourself as either resource listener or as a builder and use AST to parse the modified text files.
When writing Eclipse JDT plugins, is there a way to track appearace of certain strings in code? I'm writing an Eclipse plugin for the JDT. I need a functionality that tracks certain strings or regular expressions and possibly creates markers. I know that Eclipse already does that for //TODO comments, for example (creat...
TITLE: When writing Eclipse JDT plugins, is there a way to track appearace of certain strings in code? QUESTION: I'm writing an Eclipse plugin for the JDT. I need a functionality that tracks certain strings or regular expressions and possibly creates markers. I know that Eclipse already does that for //TODO comments, ...
[ "eclipse", "eclipse-jdt", "markers" ]
1
3
244
1
0
2008-10-08T15:25:36.663000
2008-10-09T12:32:22.707000
183,377
193,967
Does Mono .NET support and compile C++ / CLI?
Does Mono.NET support and compile C++ / CLI? If not, do you know if they have any plans of supporting it?
We don't have a compiler for C++/CLI, it would be a very large undertaking for a very small userbase. Consider also that the C++/CLI spec is inherently flawed and non-portable, so being able to compile it wouldn't help much in the general case. You can compile using the MS.NET compiler and run in mono with these restri...
Does Mono .NET support and compile C++ / CLI? Does Mono.NET support and compile C++ / CLI? If not, do you know if they have any plans of supporting it?
TITLE: Does Mono .NET support and compile C++ / CLI? QUESTION: Does Mono.NET support and compile C++ / CLI? If not, do you know if they have any plans of supporting it? ANSWER: We don't have a compiler for C++/CLI, it would be a very large undertaking for a very small userbase. Consider also that the C++/CLI spec is ...
[ ".net", "mono", "c++-cli" ]
34
26
23,294
7
0
2008-10-08T15:26:37.377000
2008-10-11T11:13:04.490000
183,391
183,403
How do you handle arbitrary namespaces when querying over Linq to XML?
I have a project where I am taking some particularly ugly "live" HTML and forcing it into a formal XML DOM with the HTML Agility Pack. What I would like to be able to do is then query over this with Linq to XML so that I can scrape out the bits I need. I'm using the method described here to parse the HtmlDocument into ...
Using LocalName should be okay. I wouldn't consider it a hack at all if you don't care what namespace it's in. If you know the namespace you want and you want to specify it, you can: var ns = "{http://www.w3.org/1999/xhtml}"; var x = xDoc.Root.Descendants(ns + "div"); ( MSDN reference ) You can also get a list of all t...
How do you handle arbitrary namespaces when querying over Linq to XML? I have a project where I am taking some particularly ugly "live" HTML and forcing it into a formal XML DOM with the HTML Agility Pack. What I would like to be able to do is then query over this with Linq to XML so that I can scrape out the bits I ne...
TITLE: How do you handle arbitrary namespaces when querying over Linq to XML? QUESTION: I have a project where I am taking some particularly ugly "live" HTML and forcing it into a formal XML DOM with the HTML Agility Pack. What I would like to be able to do is then query over this with Linq to XML so that I can scrape...
[ "html", "xml", "linq", "namespaces", "linq-to-xml" ]
19
17
5,139
3
0
2008-10-08T15:29:34.470000
2008-10-08T15:32:10.113000
183,406
183,435
Newline in string attribute
How can I add a line break to text when it is being set as an attribute i.e.: Breaking it out into the exploded format isn't an option for my particular situation. What I need is some way to emulate the following: Stuff on line1 Stuff on line2
You can use any hexadecimally encoded value to represent a literal. In this case, I used the line feed (char 10). If you want to do "classic" vbCrLf, then you can use By the way, note the syntax: It's the ampersand, a pound, the letter x, then the hex value of the character you want, and then finally a semi-colon. ALSO...
Newline in string attribute How can I add a line break to text when it is being set as an attribute i.e.: Breaking it out into the exploded format isn't an option for my particular situation. What I need is some way to emulate the following: Stuff on line1 Stuff on line2
TITLE: Newline in string attribute QUESTION: How can I add a line break to text when it is being set as an attribute i.e.: Breaking it out into the exploded format isn't an option for my particular situation. What I need is some way to emulate the following: Stuff on line1 Stuff on line2 ANSWER: You can use any hexad...
[ "xaml" ]
312
626
190,058
13
0
2008-10-08T15:32:37.833000
2008-10-08T15:39:42.500000
183,409
185,281
HTTP 1.1 Persistent Connections using Sockets in Java
Let's say I have a java program that makes an HTTP request on a server using HTTP 1.1 and doesn't close the connection. I make one request, and read all data returned from the input stream I have bound to the socket. However, upon making a second request, I get no response from the server (or there's a problem with the...
According to your code, the only time you'll even reach the statements dealing with sending the second request is when the server closes the output stream (your input stream) after receiving/responding to the first request. The reason for that is that your code that is supposed to read only the first response while((am...
HTTP 1.1 Persistent Connections using Sockets in Java Let's say I have a java program that makes an HTTP request on a server using HTTP 1.1 and doesn't close the connection. I make one request, and read all data returned from the input stream I have bound to the socket. However, upon making a second request, I get no r...
TITLE: HTTP 1.1 Persistent Connections using Sockets in Java QUESTION: Let's say I have a java program that makes an HTTP request on a server using HTTP 1.1 and doesn't close the connection. I make one request, and read all data returned from the input stream I have bound to the socket. However, upon making a second r...
[ "java", "http", "sockets" ]
4
5
25,574
5
0
2008-10-08T15:33:44.913000
2008-10-08T23:04:29.683000
183,415
183,460
ASP.NET: How to set the css class of a Control during DataBind?
A table row is generated using an asp:Repeater:... Now in the data-bind i want to mark "unread" announcements with a different css class, so that the web-guy can perform whatever styling he wants to differentiate between read and unread announcements: protected void announcementsRepeater_ItemDataBound(object sender, Re...
HtmlControl htmlRow = (HtmlControl)row; htmlRow.Attributes["class"] = htmlRow.Attributes["class"] + " announcementItemUnread";
ASP.NET: How to set the css class of a Control during DataBind? A table row is generated using an asp:Repeater:... Now in the data-bind i want to mark "unread" announcements with a different css class, so that the web-guy can perform whatever styling he wants to differentiate between read and unread announcements: prot...
TITLE: ASP.NET: How to set the css class of a Control during DataBind? QUESTION: A table row is generated using an asp:Repeater:... Now in the data-bind i want to mark "unread" announcements with a different css class, so that the web-guy can perform whatever styling he wants to differentiate between read and unread a...
[ "asp.net", "css" ]
7
8
14,153
4
0
2008-10-08T15:34:29.173000
2008-10-08T15:46:21.987000
183,426
183,890
How to change the height of an NSProgressIndicator?
By default, cocoa progress bars are slightly fat and I want something a little slimmer, like the progress bars seen in the Finder copy dialog. However, Interface Builder locks the NSProgressIndicator control height to 20 pixels and my programmatic attempts to slim down aren't working, as calls to [progressBar setContro...
Those calls should have worked. In Interface Builder, in the Geometry pane (the one whose icon is a ruler), there is an equivalent control size selector that offers "Regular" and "Small" sizes.
How to change the height of an NSProgressIndicator? By default, cocoa progress bars are slightly fat and I want something a little slimmer, like the progress bars seen in the Finder copy dialog. However, Interface Builder locks the NSProgressIndicator control height to 20 pixels and my programmatic attempts to slim dow...
TITLE: How to change the height of an NSProgressIndicator? QUESTION: By default, cocoa progress bars are slightly fat and I want something a little slimmer, like the progress bars seen in the Finder copy dialog. However, Interface Builder locks the NSProgressIndicator control height to 20 pixels and my programmatic at...
[ "cocoa" ]
3
6
2,573
2
0
2008-10-08T15:37:16.983000
2008-10-08T17:26:05.577000
183,434
183,439
what is a good cross-platform css compressor?
i need to compress my css as part of my ant build. i noticed that csstidy does this, but it would not be easy to include this in my ant build because i would need to use a different binary on different platforms. so, is there a java css compressor that people use?
Check out the Yahoo YUI compressor. It compresses CSS as well as Javascript, and it's written in Java. Edit: You should be using some sort of HTTP compression as well, like mod_deflate or mod_gzip.
what is a good cross-platform css compressor? i need to compress my css as part of my ant build. i noticed that csstidy does this, but it would not be easy to include this in my ant build because i would need to use a different binary on different platforms. so, is there a java css compressor that people use?
TITLE: what is a good cross-platform css compressor? QUESTION: i need to compress my css as part of my ant build. i noticed that csstidy does this, but it would not be easy to include this in my ant build because i would need to use a different binary on different platforms. so, is there a java css compressor that peo...
[ "java", "css", "compression", "styling" ]
3
8
2,280
2
0
2008-10-08T15:39:08.227000
2008-10-08T15:41:05.337000
183,446
183,624
MySQL - Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation 'UNION'
How do I fix that error once and for all? I just want to be able to do unions in MySQL. (I'm looking for a shortcut, like an option to make MySQL ignore that issue or take it's best guess, not looking to change collations on 100s of tables... at least not today)
Not sure about mySQL but in MSSQL you can change the collation in the query so for example if you have 2 tables with different collation and you want to join them or as in you situation crate UNION you can do select column1 from tableWithProperCollation union all select column1 COLLATE SQL_Latin1_General_CP1_CI_AS from...
MySQL - Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation 'UNION' How do I fix that error once and for all? I just want to be able to do unions in MySQL. (I'm looking for a shortcut, like an option to make MySQL ignore that issue or take it's best guess, not looking to...
TITLE: MySQL - Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation 'UNION' QUESTION: How do I fix that error once and for all? I just want to be able to do unions in MySQL. (I'm looking for a shortcut, like an option to make MySQL ignore that issue or take it's best gue...
[ "sql", "mysql", "unicode", "union", "collation" ]
13
7
35,195
3
0
2008-10-08T15:42:32.230000
2008-10-08T16:22:09.777000
183,447
187,408
Any way to determine speed of a removable drive in windows?
Is there any way to determine a removable drive speed in Windows without actually reading in a file. And if I do have to read in a file, how much needs to be read to get a semi accurate speed (e.g. determine whether a device is USB2 or USB1)? EDIT: Just to clarify, USB2 and USB1 were an example. These could be Compact ...
WMI - Physical Disks Properties is an article I found which would at least help you figure out what you have connected. I foresee things heading toward tables equating particular manufacturers and models to speeds, which is not as simple a solution as you may have hoped for.
Any way to determine speed of a removable drive in windows? Is there any way to determine a removable drive speed in Windows without actually reading in a file. And if I do have to read in a file, how much needs to be read to get a semi accurate speed (e.g. determine whether a device is USB2 or USB1)? EDIT: Just to cla...
TITLE: Any way to determine speed of a removable drive in windows? QUESTION: Is there any way to determine a removable drive speed in Windows without actually reading in a file. And if I do have to read in a file, how much needs to be read to get a semi accurate speed (e.g. determine whether a device is USB2 or USB1)?...
[ "c++", "windows", "removable-storage" ]
4
2
1,019
7
0
2008-10-08T15:42:51.917000
2008-10-09T14:04:05.623000
183,459
869,346
Is there any kind of file dependency tracer for Asp.Net apps?
I have an Asp.Net 2.0 (VB.Net) app and I'm trying to export a Control (ASCX) to another project. I need to know what other files that the Control needs in order to work. Is there any way - using VS.Net 2005 or an external app - to recursively trace the dependencies of a page or control in a solution? For example, for t...
I've used the Assembly Binding Log Viewer (Fuslogvw.exe) or maybe ProcMon... One of my coworkers suggested this app called Dependency Auditor. I haven't used it though and am not vouching for it necessarily.
Is there any kind of file dependency tracer for Asp.Net apps? I have an Asp.Net 2.0 (VB.Net) app and I'm trying to export a Control (ASCX) to another project. I need to know what other files that the Control needs in order to work. Is there any way - using VS.Net 2005 or an external app - to recursively trace the depen...
TITLE: Is there any kind of file dependency tracer for Asp.Net apps? QUESTION: I have an Asp.Net 2.0 (VB.Net) app and I'm trying to export a Control (ASCX) to another project. I need to know what other files that the Control needs in order to work. Is there any way - using VS.Net 2005 or an external app - to recursive...
[ ".net", "asp.net", "vb.net", "visual-studio-2005", ".net-2.0" ]
8
4
586
6
0
2008-10-08T15:46:02.940000
2009-05-15T15:27:04.483000
183,461
183,470
Showing completion in a progress bar
In this particular situation, there are 9 automated steps in a process that take varying lengths of time. We currently have a number showing percentage in the center of a progress bar, but it suffers from the common stop-and-go problem of racing up to 33%, waiting a long time, racing up to 55%, waiting an even longer t...
If it really takes a long time, AJAX type of animation is probably not a good idea. I'd go with checklist of items.
Showing completion in a progress bar In this particular situation, there are 9 automated steps in a process that take varying lengths of time. We currently have a number showing percentage in the center of a progress bar, but it suffers from the common stop-and-go problem of racing up to 33%, waiting a long time, racin...
TITLE: Showing completion in a progress bar QUESTION: In this particular situation, there are 9 automated steps in a process that take varying lengths of time. We currently have a number showing percentage in the center of a progress bar, but it suffers from the common stop-and-go problem of racing up to 33%, waiting ...
[ "user-interface", "progress-bar" ]
1
3
1,322
5
0
2008-10-08T15:46:40.380000
2008-10-08T15:48:29.033000
183,462
183,584
What does it mean for a programming language to be "on rails"?
I'm currently working with Groovy and Grails. While Groovy is pretty straight-forward since it's basically Java, I can't say I grok Grails. I read that Groovy is to Grails as Ruby is to Ruby on Rails, but what does that mean?
To address your confusion with the metaphor (though it has been answered in other words under your question): Groovy is to Grails as Ruby is to Ruby on Rails, but what does that mean? Grails was a web framework built on/with the Groovy programming language to do the same thing for Groovy that Rails (a web framework for...
What does it mean for a programming language to be "on rails"? I'm currently working with Groovy and Grails. While Groovy is pretty straight-forward since it's basically Java, I can't say I grok Grails. I read that Groovy is to Grails as Ruby is to Ruby on Rails, but what does that mean?
TITLE: What does it mean for a programming language to be "on rails"? QUESTION: I'm currently working with Groovy and Grails. While Groovy is pretty straight-forward since it's basically Java, I can't say I grok Grails. I read that Groovy is to Grails as Ruby is to Ruby on Rails, but what does that mean? ANSWER: To a...
[ "ruby-on-rails", "ruby", "grails", "groovy", "terminology" ]
34
44
10,254
11
0
2008-10-08T15:46:49.817000
2008-10-08T16:13:06.940000
183,479
183,522
Do I need to dispose transient disposable objects?
I have a class that creates several IDisposable objects, all of these objects are then passed to another 'manager' class in a 3rd party library. As I need some of the objects in later calls I kept a local field reference to the created objects so that I could access them at a later time. When I ran FxCop on the class i...
The class that owns the object is the one that should dispose of them... It sounds like your manager is the owner, so he should dispose of the object. If you're trying to avoid the FXCop warning then one option is to have MyClass request the disposable object from the manager each time is needs to use it. This way you ...
Do I need to dispose transient disposable objects? I have a class that creates several IDisposable objects, all of these objects are then passed to another 'manager' class in a 3rd party library. As I need some of the objects in later calls I kept a local field reference to the created objects so that I could access th...
TITLE: Do I need to dispose transient disposable objects? QUESTION: I have a class that creates several IDisposable objects, all of these objects are then passed to another 'manager' class in a 3rd party library. As I need some of the objects in later calls I kept a local field reference to the created objects so that...
[ "c#", ".net" ]
4
2
780
2
0
2008-10-08T15:50:06.333000
2008-10-08T15:59:05.160000
183,480
183,582
Is this the best way to get unique version of filename w/ Python?
Still 'diving in' to Python, and want to make sure I'm not overlooking something. I wrote a script that extracts files from several zip files, and saves the extracted files together in one directory. To prevent duplicate filenames from being over-written, I wrote this little function - and I'm just wondering if there i...
One issue is that there is a race condition in your above code, since there is a gap between testing for existance, and creating the file. There may be security implications to this (think about someone maliciously inserting a symlink to a sensitive file which they wouldn't be able to overwrite, but your program runnin...
Is this the best way to get unique version of filename w/ Python? Still 'diving in' to Python, and want to make sure I'm not overlooking something. I wrote a script that extracts files from several zip files, and saves the extracted files together in one directory. To prevent duplicate filenames from being over-written...
TITLE: Is this the best way to get unique version of filename w/ Python? QUESTION: Still 'diving in' to Python, and want to make sure I'm not overlooking something. I wrote a script that extracts files from several zip files, and saves the extracted files together in one directory. To prevent duplicate filenames from ...
[ "python", "filenames" ]
16
24
8,717
6
0
2008-10-08T15:50:21.557000
2008-10-08T16:13:02.637000
183,485
301,287
Converting punycode with dash character to Unicode
I need to convert the punycode NIATO-OTABD to nñiñatoñ. I found a text converter in JavaScript the other day, but the punycode conversion doesn't work if there's a dash in the middle. Any suggestion to fix the "dash" issue?
I took the time to create the punycode below. It it based on the C code in RFC 3492. To use it with domain names you have to remove/add xn-- from/to the input/output to/from decode/encode. The utf16-class is necessary to convert from JavaScripts internal character representation to unicode and back. There are also ToAS...
Converting punycode with dash character to Unicode I need to convert the punycode NIATO-OTABD to nñiñatoñ. I found a text converter in JavaScript the other day, but the punycode conversion doesn't work if there's a dash in the middle. Any suggestion to fix the "dash" issue?
TITLE: Converting punycode with dash character to Unicode QUESTION: I need to convert the punycode NIATO-OTABD to nñiñatoñ. I found a text converter in JavaScript the other day, but the punycode conversion doesn't work if there's a dash in the middle. Any suggestion to fix the "dash" issue? ANSWER: I took the time to...
[ "javascript", "unicode", "punycode" ]
23
55
22,159
2
0
2008-10-08T15:51:48.233000
2008-11-19T08:13:13.507000
183,488
183,518
What does the SQL Server Error "String Data, Right Truncation" mean and how do I fix it?
We are doing some performance tests on our website and we are getting the following error a lot: *** 'C:\inetpub\foo.plex' log message at: 2008/10/07 13:19:58 DBD::ODBC::st execute failed: [Microsoft][SQL Native Client]String data, right truncation (SQL-22001) at C:\inetpub\foo.plex line 25. Line 25 is the following: S...
Either the parameter supplied for ZIP_CODE is larger (in length) than ZIP_CODE s column width or the parameter supplied for CITY is larger (in length) than CITY s column width. It would be interesting to know the values supplied for the two? placeholders.
What does the SQL Server Error "String Data, Right Truncation" mean and how do I fix it? We are doing some performance tests on our website and we are getting the following error a lot: *** 'C:\inetpub\foo.plex' log message at: 2008/10/07 13:19:58 DBD::ODBC::st execute failed: [Microsoft][SQL Native Client]String data,...
TITLE: What does the SQL Server Error "String Data, Right Truncation" mean and how do I fix it? QUESTION: We are doing some performance tests on our website and we are getting the following error a lot: *** 'C:\inetpub\foo.plex' log message at: 2008/10/07 13:19:58 DBD::ODBC::st execute failed: [Microsoft][SQL Native C...
[ "sql-server", "odbc" ]
37
30
162,823
7
0
2008-10-08T15:52:11.913000
2008-10-08T15:58:02.103000
183,496
183,645
JavaScript style/optimization: String.indexOf() v. Regex.test()
I've recently come across this piece of JavaScript code: if (",>=,<=,<>,".indexOf("," + sCompOp + ",")!= -1) I was intrigued, because to write this test I would have done: if (/(>=|<=|<>)/.test(sCompOp)) Is this just a stylistic difference, or does the author of the other code know something about optimization that I d...
I ran some tests. The first method is slightly faster, but not by enough to make any real difference even under heavy use... except when sCompOp could potentially be a very long string. Because the first method searches a fixed-length string, its execution time is very stable no matter how long sCompOp gets, while the ...
JavaScript style/optimization: String.indexOf() v. Regex.test() I've recently come across this piece of JavaScript code: if (",>=,<=,<>,".indexOf("," + sCompOp + ",")!= -1) I was intrigued, because to write this test I would have done: if (/(>=|<=|<>)/.test(sCompOp)) Is this just a stylistic difference, or does the aut...
TITLE: JavaScript style/optimization: String.indexOf() v. Regex.test() QUESTION: I've recently come across this piece of JavaScript code: if (",>=,<=,<>,".indexOf("," + sCompOp + ",")!= -1) I was intrigued, because to write this test I would have done: if (/(>=|<=|<>)/.test(sCompOp)) Is this just a stylistic differenc...
[ "javascript", "regex", "optimization", "coding-style" ]
9
12
9,351
5
0
2008-10-08T15:52:59.057000
2008-10-08T16:27:19.953000
183,499
183,667
Is there a preference for nested try/catch blocks?
One of the things that always bugs me about using Readers and Streams in Java is that the close() method can throw an exception. Since it's a good idea to put the close method in a finally block, that necessitates a bit of an awkward situation. I usually use this construction: FileReader fr = new FileReader("SomeFile.t...
I would always go for the first example. If close were to throw an exception (in practice that will never happen for a FileReader), wouldn't the standard way of handling that be to throw an exception appropriate to the caller? The close exception almost certainly trumps any problem you had using the resource. The secon...
Is there a preference for nested try/catch blocks? One of the things that always bugs me about using Readers and Streams in Java is that the close() method can throw an exception. Since it's a good idea to put the close method in a finally block, that necessitates a bit of an awkward situation. I usually use this const...
TITLE: Is there a preference for nested try/catch blocks? QUESTION: One of the things that always bugs me about using Readers and Streams in Java is that the close() method can throw an exception. Since it's a good idea to put the close method in a finally block, that necessitates a bit of an awkward situation. I usua...
[ "java", "try-catch" ]
41
7
43,952
11
0
2008-10-08T15:53:32.520000
2008-10-08T16:31:53.457000
183,505
186,006
Storing Crystal Reports Files in Database?
I've got a UI front end which talks to and manipulates a SQL Server database, and one of the things it can do is run reports on the data in the database. This UI can be installed on multiple computers, and so far I've just been keeping the reports in a folder with the install, but this means that any time a new report ...
Great Question! It's kind of coincidental as we've actually just implemented this within the last six months. As you've suggested, we store the rpt file within the database, but do this in Server 2005 as a Image type. It works just fine and as far as the database goes, there really is no caveats that come to mind. Obvi...
Storing Crystal Reports Files in Database? I've got a UI front end which talks to and manipulates a SQL Server database, and one of the things it can do is run reports on the data in the database. This UI can be installed on multiple computers, and so far I've just been keeping the reports in a folder with the install,...
TITLE: Storing Crystal Reports Files in Database? QUESTION: I've got a UI front end which talks to and manipulates a SQL Server database, and one of the things it can do is run reports on the data in the database. This UI can be installed on multiple computers, and so far I've just been keeping the reports in a folder...
[ "sql-server", "crystal-reports", "blob" ]
5
3
6,199
4
0
2008-10-08T15:55:07.210000
2008-10-09T05:28:35.603000
183,524
187,062
Domain Driven Design - Logical Deletes
So, I have a nice domain model built. Repositories handle the data access and what not. A new requirements has popped up that indicates that reasons need to be logged with deletes. Up until now, deletes have been fairly simple => Entity.Children.Remove(child). No internal change tracking was happening as my ORM tool wa...
Ok, this sounds crazy and I'm going to take another shot at this -- even though I might be spanked for bad nHibernate usage. Before you delete, why don't you select the children that are going to be deleted (you already have their ids correct?) and do a transformation into whatever entity your going to be using to log ...
Domain Driven Design - Logical Deletes So, I have a nice domain model built. Repositories handle the data access and what not. A new requirements has popped up that indicates that reasons need to be logged with deletes. Up until now, deletes have been fairly simple => Entity.Children.Remove(child). No internal change t...
TITLE: Domain Driven Design - Logical Deletes QUESTION: So, I have a nice domain model built. Repositories handle the data access and what not. A new requirements has popped up that indicates that reasons need to be logged with deletes. Up until now, deletes have been fairly simple => Entity.Children.Remove(child). No...
[ "c#", ".net", "nhibernate", "domain-driven-design", "ddd-repositories" ]
2
3
713
3
0
2008-10-08T15:59:39.603000
2008-10-09T12:36:58.267000
183,527
221,951
How to fix the DTSX precedence constraint evaluation error while passing variable in command line?
I have a dtsx package with a precedence constraint that evaluates an expression and a constraint. The constraint is "success" and the expression is "@myVariable" == 3. myVariable is an int32, and when set in Visual Studio's design GUI the package executes fine. There are two other paths that check for the value to be 1...
Sorry took me so long to get back to this thread! But (DT_I4)@[User::myVariable] == 3 did the trick. Thanks!
How to fix the DTSX precedence constraint evaluation error while passing variable in command line? I have a dtsx package with a precedence constraint that evaluates an expression and a constraint. The constraint is "success" and the expression is "@myVariable" == 3. myVariable is an int32, and when set in Visual Studio...
TITLE: How to fix the DTSX precedence constraint evaluation error while passing variable in command line? QUESTION: I have a dtsx package with a precedence constraint that evaluates an expression and a constraint. The constraint is "success" and the expression is "@myVariable" == 3. myVariable is an int32, and when se...
[ "variables", "command-line", "ssis" ]
4
3
9,012
5
0
2008-10-08T16:00:48.667000
2008-10-21T13:50:44.090000
183,530
183,741
WCF Endpoint with Priority
I need WCF service with 3 endpoints High Normal Low Most of messages will come through Normal and Low Endpoints. If Message on High will appear it have to be processed asap. Does anyone knows how to do it???
The easiest way I can think of would be to deploy your service twice: one with the low/medium endpoints and then a completely different instance with the high endpoint. As Endian said in his answer (which I voted for BTW), you could physically seperate them, but you could also have them running on the same box is you w...
WCF Endpoint with Priority I need WCF service with 3 endpoints High Normal Low Most of messages will come through Normal and Low Endpoints. If Message on High will appear it have to be processed asap. Does anyone knows how to do it???
TITLE: WCF Endpoint with Priority QUESTION: I need WCF service with 3 endpoints High Normal Low Most of messages will come through Normal and Low Endpoints. If Message on High will appear it have to be processed asap. Does anyone knows how to do it??? ANSWER: The easiest way I can think of would be to deploy your ser...
[ "wcf", "endpoint" ]
3
1
1,709
4
0
2008-10-08T16:01:40.473000
2008-10-08T16:46:58.980000
183,532
183,536
What is the difference between HTML div and span elements?
I would like to ask for some simple examples showing the uses of and. I've seen them both used to mark a section of a page with an id or class, but I'm interested in knowing if there are times when one is preferred over the other.
div is a block element span is an inline element. This means that to use them semantically, divs should be used to wrap sections of a document, while spans should be used to wrap small portions of text, images, etc. For example: This a large main division, with a small bit of spanned text! Note that it is illegal to pl...
What is the difference between HTML div and span elements? I would like to ask for some simple examples showing the uses of and. I've seen them both used to mark a section of a page with an id or class, but I'm interested in knowing if there are times when one is preferred over the other.
TITLE: What is the difference between HTML div and span elements? QUESTION: I would like to ask for some simple examples showing the uses of and. I've seen them both used to mark a section of a page with an id or class, but I'm interested in knowing if there are times when one is preferred over the other. ANSWER: div...
[ "html", "tags" ]
693
722
519,141
13
0
2008-10-08T16:01:44.623000
2008-10-08T16:03:17.943000
183,560
184,929
Forking subprocesses in Perl unit tests stops prove; Test::Harness exiting
I have been trying to use the Perl utility/module "prove" as a test harness for some unit tests. The unit tests are a little more "system" than "unit" as I need to fork off some background processes as part of the test, Using the following... sub SpinupMonitor{ my $base_dir = shift; my $config = shift; my $pid = fork(...
I'm assuming that all your kids have exited before you leave your test? Because otherwise, it may be hanging on to STDERR, which may confuse prove. If you could close STDERR, or at least redirect to a pipe in your parent process, that may be one issue you're having. Besides that, I'd also point out that you don't need ...
Forking subprocesses in Perl unit tests stops prove; Test::Harness exiting I have been trying to use the Perl utility/module "prove" as a test harness for some unit tests. The unit tests are a little more "system" than "unit" as I need to fork off some background processes as part of the test, Using the following... su...
TITLE: Forking subprocesses in Perl unit tests stops prove; Test::Harness exiting QUESTION: I have been trying to use the Perl utility/module "prove" as a test harness for some unit tests. The unit tests are a little more "system" than "unit" as I need to fork off some background processes as part of the test, Using t...
[ "perl", "testing", "fork", "die", "perl-prove" ]
14
8
2,031
2
0
2008-10-08T16:07:34.533000
2008-10-08T21:07:23.947000