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
85,036
85,191
How can I quickly identify most recently modified stored procedures in SQL Server
I need to manually migrate modified stored procedures from a DEV SQL Server 2005 database instance to a TEST instance. Except for the changes I'm migrating, the databases have the same schemas. How can I quickly identify which stored procedures have been modified in the DEV database for migration to the TEST instance? ...
instead of using sysobjects which is not recommended anymore use sys.procedures select name,create_date,modify_date from sys.procedures order by modify_date desc you can do the where clause yourself but this will list it in order of modification date descending
How can I quickly identify most recently modified stored procedures in SQL Server I need to manually migrate modified stored procedures from a DEV SQL Server 2005 database instance to a TEST instance. Except for the changes I'm migrating, the databases have the same schemas. How can I quickly identify which stored proc...
TITLE: How can I quickly identify most recently modified stored procedures in SQL Server QUESTION: I need to manually migrate modified stored procedures from a DEV SQL Server 2005 database instance to a TEST instance. Except for the changes I'm migrating, the databases have the same schemas. How can I quickly identify...
[ "sql-server", "stored-procedures", "migration" ]
30
74
95,748
7
0
2008-09-17T16:29:01.180000
2008-09-17T16:44:35.387000
85,046
105,380
Editable JTable Tutorial
Are there any good books or website that go over creating a JTable? I want to make one column editable. I would like to actually put a inherited JCheckBox component (that we created here) into one of the table columns instead of just having the table put JCheckBox in based on it being an editable boolean field. I have ...
To make a column editable you have to override the isCellEditable method in the TableModel. Creating a TableModel is fairly easy if you inherit AbstractTableModel and I'd recommend it for all but the most simple JTable s. However, adapting the TableModel is only part of what you need to do. To actually get a custom com...
Editable JTable Tutorial Are there any good books or website that go over creating a JTable? I want to make one column editable. I would like to actually put a inherited JCheckBox component (that we created here) into one of the table columns instead of just having the table put JCheckBox in based on it being an editab...
TITLE: Editable JTable Tutorial QUESTION: Are there any good books or website that go over creating a JTable? I want to make one column editable. I would like to actually put a inherited JCheckBox component (that we created here) into one of the table columns instead of just having the table put JCheckBox in based on ...
[ "java", "swing", "jtable" ]
12
31
34,058
6
0
2008-09-17T16:29:39.540000
2008-09-19T20:35:33.527000
85,051
107,744
Git over Email?
Assuming network access is sporadic with no central server, what would be the best way to use git to keep three or more branches in sync? Is there a way to extract just my deltas, email those, and merge them on the other end?
While "git format-patch" and "git am" are great ways to manage patches from non-git sources, for git repositories you should investigate "git bundle". "git bundle" and the subcommands "create" and "unbundle" can be used to create and use a binary blob of incremental commits that can be used to transfer branch history a...
Git over Email? Assuming network access is sporadic with no central server, what would be the best way to use git to keep three or more branches in sync? Is there a way to extract just my deltas, email those, and merge them on the other end?
TITLE: Git over Email? QUESTION: Assuming network access is sporadic with no central server, what would be the best way to use git to keep three or more branches in sync? Is there a way to extract just my deltas, email those, and merge them on the other end? ANSWER: While "git format-patch" and "git am" are great way...
[ "git", "version-control" ]
14
27
6,466
3
0
2008-09-17T16:30:20.023000
2008-09-20T09:39:05.157000
85,058
86,201
Why do we need other JVM languages
I see here that there are a load of languages aside from Java that run on the JVM. I'm a bit confused about the whole concept of other languages running in the JVM. So: What is the advantage in having other languages for the JVM? What is required (in high level terms) to write a language/compiler for the JVM? How do yo...
To address your three questions separately: What is the advantage in having other languages for the JVM? There are two factors here. (1) Why have a language other than Java for the JVM, and (2) why have another language run on the JVM, instead of a different runtime? Other languages can satisfy other needs. For example...
Why do we need other JVM languages I see here that there are a load of languages aside from Java that run on the JVM. I'm a bit confused about the whole concept of other languages running in the JVM. So: What is the advantage in having other languages for the JVM? What is required (in high level terms) to write a langu...
TITLE: Why do we need other JVM languages QUESTION: I see here that there are a load of languages aside from Java that run on the JVM. I'm a bit confused about the whole concept of other languages running in the JVM. So: What is the advantage in having other languages for the JVM? What is required (in high level terms...
[ "jvm", "compatibility" ]
24
33
5,097
17
0
2008-09-17T16:30:50.770000
2008-09-17T18:35:31.453000
85,083
85,170
.NET Remoting Server Only processes One request
I am using.NET Remoting. My server/hoster is a Windows Service. It will sometimes work just fine and other times it will process one request and then it does not process any more (until I restart it). It is running as a Windows service Here is the code from the Windows Service: using System; using System.Collections.Ge...
as a SingleCall type, your SampleObject will be created for every call the client makes. This suggests to me that your object is at fault, and you don't show what it does. You need to look at any dependancies it has on shared resources orlocks. Try writing some debug out in the SampleObject's constructor to see how far...
.NET Remoting Server Only processes One request I am using.NET Remoting. My server/hoster is a Windows Service. It will sometimes work just fine and other times it will process one request and then it does not process any more (until I restart it). It is running as a Windows service Here is the code from the Windows Se...
TITLE: .NET Remoting Server Only processes One request QUESTION: I am using.NET Remoting. My server/hoster is a Windows Service. It will sometimes work just fine and other times it will process one request and then it does not process any more (until I restart it). It is running as a Windows service Here is the code f...
[ "c#", ".net", "remoting" ]
0
1
414
1
0
2008-09-17T16:33:18.470000
2008-09-17T16:42:45.813000
85,085
86,301
Pass by reference not returning in RMI for ArrayList
I've got an RMI call defined as: public void remoteGetCustomerNameNumbers(ArrayList customerNumberList, ArrayList customerNameList) throws java.rmi.RemoteException; The function does a database lookup and populates the two ArrayLists. The calling function gets nothing. I believe this works with Vector types. Do I need ...
As Tom mentions, you can pass remote objects. You'd have to create a class to hold your list that implements Remote. Anytime you pass something that implements Remote as an argument, whenever the receiving side uses it, it turns around and makes a remote call back to the caller to work with that object.
Pass by reference not returning in RMI for ArrayList I've got an RMI call defined as: public void remoteGetCustomerNameNumbers(ArrayList customerNumberList, ArrayList customerNameList) throws java.rmi.RemoteException; The function does a database lookup and populates the two ArrayLists. The calling function gets nothin...
TITLE: Pass by reference not returning in RMI for ArrayList QUESTION: I've got an RMI call defined as: public void remoteGetCustomerNameNumbers(ArrayList customerNumberList, ArrayList customerNameList) throws java.rmi.RemoteException; The function does a database lookup and populates the two ArrayLists. The calling fu...
[ "java", "arraylist", "rmi" ]
0
1
4,241
4
0
2008-09-17T16:33:37.660000
2008-09-17T18:47:26.777000
85,091
156,933
Error BC30002 - Type XXX is not defined
OK, this begins to drive me crazy. I have an asp.net webapp. Pretty straightforward, most of the code in the.aspx.vb, and a few classes in App_Code. The problem, which has begun to occur only today (even though most of the code was already written), is that once in a while, I have this error message: Error BC30002: Typ...
I think I found the problem. My code was like that: Imports CMS Sub Whatever() Dim a as new Arbo.MyObject() ' Arbo is a namespace inside CMS Dim b as new Util.MyOtherObject() ' Util is a namespace inside Util End Sub I'm not sure why I wrote it like that, but it turns out the fact I was calling classes without either ...
Error BC30002 - Type XXX is not defined OK, this begins to drive me crazy. I have an asp.net webapp. Pretty straightforward, most of the code in the.aspx.vb, and a few classes in App_Code. The problem, which has begun to occur only today (even though most of the code was already written), is that once in a while, I hav...
TITLE: Error BC30002 - Type XXX is not defined QUESTION: OK, this begins to drive me crazy. I have an asp.net webapp. Pretty straightforward, most of the code in the.aspx.vb, and a few classes in App_Code. The problem, which has begun to occur only today (even though most of the code was already written), is that once...
[ "asp.net", "vb.net", "compiler-errors" ]
15
8
116,964
6
0
2008-09-17T16:33:58.440000
2008-10-01T10:01:10.243000
85,114
85,561
How do you structure a development sprint?
So I have a backlog of features and we are about to get started on a sizable project. I am working on defining the structure of our sprints and I'm interested in the communities feedback. What I'm thinking is: One day sprint planning Fill the backlog and figure out what each dev will go after this sprint Three weeks of...
I'd consider experimenting with sprints that are shorter then one month. Personally I find one-two week iterations more effective at getting effective feedback quickly. It also prevents any issues that may be causing problems at the iteration level building up to levels that become harder to manage. Even for the 30 day...
How do you structure a development sprint? So I have a backlog of features and we are about to get started on a sizable project. I am working on defining the structure of our sprints and I'm interested in the communities feedback. What I'm thinking is: One day sprint planning Fill the backlog and figure out what each d...
TITLE: How do you structure a development sprint? QUESTION: So I have a backlog of features and we are about to get started on a sizable project. I am working on defining the structure of our sprints and I'm interested in the communities feedback. What I'm thinking is: One day sprint planning Fill the backlog and figu...
[ "agile" ]
6
5
4,834
7
0
2008-09-17T16:36:57.043000
2008-09-17T17:21:29.667000
85,116
86,533
Display date/time in user's locale format and time offset
I want the server to always serve dates in UTC in the HTML, and have JavaScript on the client site convert it to the user's local timezone. Bonus if I can output in the user's locale date format.
Seems the most foolproof way to start with a UTC date is to create a new Date object and use the setUTC… methods to set it to the date/time you want. Then the various toLocale…String methods will provide localized output. Example: // This would come from the server. // Also, this whole block could probably be made int...
Display date/time in user's locale format and time offset I want the server to always serve dates in UTC in the HTML, and have JavaScript on the client site convert it to the user's local timezone. Bonus if I can output in the user's locale date format.
TITLE: Display date/time in user's locale format and time offset QUESTION: I want the server to always serve dates in UTC in the HTML, and have JavaScript on the client site convert it to the user's local timezone. Bonus if I can output in the user's locale date format. ANSWER: Seems the most foolproof way to start w...
[ "javascript", "datetime", "timezone" ]
219
220
538,281
18
0
2008-09-17T16:37:12.113000
2008-09-17T19:12:54.720000
85,119
85,134
Running multiple sites from a single Python web framework
I know you can do redirection based on the domain or path to rewrite the URI to point at a site-specific location and I've also seen some brutish if and elif statements for every site as shown in the following code, which I would like to avoid. if site == 'site1':... elif site == 'site2:... What are some good and cleve...
Django has this built in. See the sites framework. As a general technique, include a 'host' column in your database schema attached to the data you want to be host-specific, then include the Host HTTP header in the query when you are retrieving data.
Running multiple sites from a single Python web framework I know you can do redirection based on the domain or path to rewrite the URI to point at a site-specific location and I've also seen some brutish if and elif statements for every site as shown in the following code, which I would like to avoid. if site == 'site1...
TITLE: Running multiple sites from a single Python web framework QUESTION: I know you can do redirection based on the domain or path to rewrite the URI to point at a site-specific location and I've also seen some brutish if and elif statements for every site as shown in the following code, which I would like to avoid....
[ "python", "frameworks" ]
6
11
1,222
4
0
2008-09-17T16:37:23.720000
2008-09-17T16:39:06.960000
85,129
85,327
Best way to set up CruiseControl for IIS 5.1 dev box and IIS6 server
Can anyone point me in the right direction on this. From reading the FAQs at cruisecontrol, it appears that you should develop in the same environment as you produce. But i have Windows XP (which only runs IIS 5.1) on my dev machine and the server is 2003.
We have a similar setup that we have been using successfully over a year now. Our CC.Net server is on a Windows 2003 server and all development happens on Windows XP/Vista machines. Code checked into SVN is pulled down onto the Windows 2003 server, built and pushed onto our hosting boxes.
Best way to set up CruiseControl for IIS 5.1 dev box and IIS6 server Can anyone point me in the right direction on this. From reading the FAQs at cruisecontrol, it appears that you should develop in the same environment as you produce. But i have Windows XP (which only runs IIS 5.1) on my dev machine and the server is ...
TITLE: Best way to set up CruiseControl for IIS 5.1 dev box and IIS6 server QUESTION: Can anyone point me in the right direction on this. From reading the FAQs at cruisecontrol, it appears that you should develop in the same environment as you produce. But i have Windows XP (which only runs IIS 5.1) on my dev machine ...
[ ".net", "svn", "iis", "cruisecontrol.net" ]
0
1
505
1
0
2008-09-17T16:38:15.963000
2008-09-17T16:57:30.143000
85,137
85,188
How to add an event to a class
Say I have a class named Frog, it looks like: public class Frog { public int Location { get; set; } public int JumpCount { get; set; } public void OnJump() { JumpCount++; } } I need help with 2 things: I want to create an event named Jump in the class definition. I want to create an instance of the Frog class, and th...
public event EventHandler Jump; public void OnJump() { EventHandler handler = Jump; if (null!= handler) handler(this, EventArgs.Empty); } then Frog frog = new Frog(); frog.Jump += new EventHandler(yourMethod); private void yourMethod(object s, EventArgs e) { Console.WriteLine("Frog has Jumped!"); }
How to add an event to a class Say I have a class named Frog, it looks like: public class Frog { public int Location { get; set; } public int JumpCount { get; set; } public void OnJump() { JumpCount++; } } I need help with 2 things: I want to create an event named Jump in the class definition. I want to create an ins...
TITLE: How to add an event to a class QUESTION: Say I have a class named Frog, it looks like: public class Frog { public int Location { get; set; } public int JumpCount { get; set; } public void OnJump() { JumpCount++; } } I need help with 2 things: I want to create an event named Jump in the class definition. I wan...
[ "c#", "class", "events" ]
54
84
61,624
2
0
2008-09-17T16:39:25.320000
2008-09-17T16:44:28.727000
85,139
85,819
C# Code Formatter for Linux and/or MonoDevelop
MonoDevelop 1.0 doesn't appear to have a code-formatter like Eclipse does for Java. Is there a preferred shell script (or MonoDevelop add-in?) that you've found to work well?
At the moment, source code formatting in MonoDevelop is marked as a future enhancement: https://bugzilla.novell.com/show_bug.cgi?id=321946 In the meantime, you may want to check out Artistic Style for C# formatting: http://astyle.sourceforge.net/ I'm planning to see how this might be wired up as an external tool within...
C# Code Formatter for Linux and/or MonoDevelop MonoDevelop 1.0 doesn't appear to have a code-formatter like Eclipse does for Java. Is there a preferred shell script (or MonoDevelop add-in?) that you've found to work well?
TITLE: C# Code Formatter for Linux and/or MonoDevelop QUESTION: MonoDevelop 1.0 doesn't appear to have a code-formatter like Eclipse does for Java. Is there a preferred shell script (or MonoDevelop add-in?) that you've found to work well? ANSWER: At the moment, source code formatting in MonoDevelop is marked as a fut...
[ "c#", "formatting", "mono" ]
3
7
2,031
3
0
2008-09-17T16:39:35.897000
2008-09-17T17:51:17.130000
85,147
85,317
Best resource for learning .NET generics?
I've never used any of the.NET generics in my work, but I understand that they are fairly popular. Does anyone have any good links or book suggestions for learning them? As a bonus; I only vaguely understand what.NET generic collections are and what they do...does anyone have any practical examples of how they might be...
http://www.informit.com/articles/article.aspx?p=605369 http://www.codeproject.com/KB/cs/genericcache.aspx
Best resource for learning .NET generics? I've never used any of the.NET generics in my work, but I understand that they are fairly popular. Does anyone have any good links or book suggestions for learning them? As a bonus; I only vaguely understand what.NET generic collections are and what they do...does anyone have a...
TITLE: Best resource for learning .NET generics? QUESTION: I've never used any of the.NET generics in my work, but I understand that they are fairly popular. Does anyone have any good links or book suggestions for learning them? As a bonus; I only vaguely understand what.NET generic collections are and what they do......
[ "c#", ".net", "generics" ]
13
6
6,813
8
0
2008-09-17T16:40:04.507000
2008-09-17T16:56:57.307000
85,159
91,775
Time Parsing in Flex
Is there any way to parse a string in the format HH:MM into a Date (or other) object using the standard libraries? I know that I can parse something like "9/17/2008 10:30" into a Date object using var date:Date = new Date(Date.parse("9/17/2008 10:30"); But I want to parse just 10:30 by itself. The following code will n...
To answer your specific question: no, there's no library function to do what you want to do, but then there's no library function for parsing dates on the ISO format, on the German format, on the Swedish format, dates where the years are in roman numerals etc. Why not use regular expressions? That's what they are for.
Time Parsing in Flex Is there any way to parse a string in the format HH:MM into a Date (or other) object using the standard libraries? I know that I can parse something like "9/17/2008 10:30" into a Date object using var date:Date = new Date(Date.parse("9/17/2008 10:30"); But I want to parse just 10:30 by itself. The ...
TITLE: Time Parsing in Flex QUESTION: Is there any way to parse a string in the format HH:MM into a Date (or other) object using the standard libraries? I know that I can parse something like "9/17/2008 10:30" into a Date object using var date:Date = new Date(Date.parse("9/17/2008 10:30"); But I want to parse just 10:...
[ "apache-flex", "parsing", "time", "date" ]
3
0
6,164
4
0
2008-09-17T16:41:39.760000
2008-09-18T11:33:11.897000
85,179
86,658
Fix argument handling in SQL Server 2005 Mgmt Studio custom Keyboard Accelerator shortcuts?
I've long been a fan of Stored Procedure Keyboard Accelerators, as described in this article. When we moved from SQL 2000 to 2005, though, and from Query Analyzer to Management Studio, the handling of the arguments changed. In QA, comma-separated arguments were automatically read as two separate arguments. In SSMS -- a...
Tim's suggestion didn't solve my problem on my development PC, but it did convince me to try again from a different PC. When using a different PC's SSMS to log into the development PC's database and trying exactly what Tim describes, I'm having the same behavior Tim describes. I was also able to re-replicate the argume...
Fix argument handling in SQL Server 2005 Mgmt Studio custom Keyboard Accelerator shortcuts? I've long been a fan of Stored Procedure Keyboard Accelerators, as described in this article. When we moved from SQL 2000 to 2005, though, and from Query Analyzer to Management Studio, the handling of the arguments changed. In Q...
TITLE: Fix argument handling in SQL Server 2005 Mgmt Studio custom Keyboard Accelerator shortcuts? QUESTION: I've long been a fan of Stored Procedure Keyboard Accelerators, as described in this article. When we moved from SQL 2000 to 2005, though, and from Query Analyzer to Management Studio, the handling of the argum...
[ "sql-server", "customization" ]
0
0
262
4
0
2008-09-17T16:43:50.147000
2008-09-17T19:25:43.267000
85,181
85,341
I traced a Stored Procedure as shown in the SQL Server 2005 Profiler. It's not found but works. Why?
This is pretty weird. I have my Profiler open and it obviously shows that a stored procedure is called. I open the database and the SP list, but the SP doesn't exist. However, there's another SP whose name is the same except it has a prefix 'x' Is SQL Server 2005 mapping the SP name to a different one for security purp...
In general, when you know an object exists because it's been used in a query, and you can't find it in the object tree in Management Studio, you can do this to find it. select * from sys.objects where name = 'THE_NAME_YOU_WANT' I just checked, and it works with Synonyms.
I traced a Stored Procedure as shown in the SQL Server 2005 Profiler. It's not found but works. Why? This is pretty weird. I have my Profiler open and it obviously shows that a stored procedure is called. I open the database and the SP list, but the SP doesn't exist. However, there's another SP whose name is the same e...
TITLE: I traced a Stored Procedure as shown in the SQL Server 2005 Profiler. It's not found but works. Why? QUESTION: This is pretty weird. I have my Profiler open and it obviously shows that a stored procedure is called. I open the database and the SP list, but the SP doesn't exist. However, there's another SP whose ...
[ "sql", "sql-server", "sql-server-2005", "stored-procedures" ]
2
5
695
5
0
2008-09-17T16:44:10.427000
2008-09-17T16:58:23.497000
85,183
166,485
Windsor Container: How to force dispose of an object?
I have an object that implements IDisposable that is registered with the Windsor Container and I would like to dispose of it so it's Dispose method is called and next time Resolve is called it fetches a new instance. Does container.Release(obj); automatically call Dispose() immediately? Or do I need to do obj.Dispose()...
This is something I think people aren't really aware of when working with the Windsor container - especially the often surprising behavior that disposable transient components are held onto by the container for the lifetime of the kernel until it's disposed unless you release them yourself - though it is documented - t...
Windsor Container: How to force dispose of an object? I have an object that implements IDisposable that is registered with the Windsor Container and I would like to dispose of it so it's Dispose method is called and next time Resolve is called it fetches a new instance. Does container.Release(obj); automatically call D...
TITLE: Windsor Container: How to force dispose of an object? QUESTION: I have an object that implements IDisposable that is registered with the Windsor Container and I would like to dispose of it so it's Dispose method is called and next time Resolve is called it fetches a new instance. Does container.Release(obj); au...
[ ".net", "inversion-of-control", "castle-windsor" ]
11
14
10,076
3
0
2008-09-17T16:44:14.717000
2008-10-03T11:55:47.120000
85,190
85,206
In detail, how does the 'for each' loop work in Java?
Consider: List someList = new ArrayList<>(); // add "monkey", "donkey", "skeleton key" to someList for (String item: someList) { System.out.println(item); } What would the equivalent for loop look like without using the for each syntax? People new to Java commonly encounter issues when trying to modify the original dat...
for (Iterator i = someIterable.iterator(); i.hasNext();) { String item = i.next(); System.out.println(item); } Note that if you need to use i.remove(); in your loop, or access the actual iterator in some way, you cannot use the for (: ) idiom, since the actual iterator is merely inferred. As was noted by Denis Bueno, t...
In detail, how does the 'for each' loop work in Java? Consider: List someList = new ArrayList<>(); // add "monkey", "donkey", "skeleton key" to someList for (String item: someList) { System.out.println(item); } What would the equivalent for loop look like without using the for each syntax? People new to Java commonly e...
TITLE: In detail, how does the 'for each' loop work in Java? QUESTION: Consider: List someList = new ArrayList<>(); // add "monkey", "donkey", "skeleton key" to someList for (String item: someList) { System.out.println(item); } What would the equivalent for loop look like without using the for each syntax? People new ...
[ "java", "foreach", "syntactic-sugar" ]
1,723
1,310
2,927,174
29
0
2008-09-17T16:44:32.360000
2008-09-17T16:46:28.283000
85,223
85,413
How to manually parse a floating point number from a string
Of course most languages have library functions for this, but suppose I want to do it myself. Suppose that the float is given like in a C or Java program (except for the 'f' or 'd' suffix), for example " 4.2e1 ", ".42e2 " or simply " 42 ". In general, we have the "integer part" before the decimal point, the "fractional...
I would directly assemble the floating point number using its binary representation. Read in the number one character after another and first find all digits. Do that in integer arithmetic. Also keep track of the decimal point and the exponent. This one will be important later. Now you can assemble your floating point ...
How to manually parse a floating point number from a string Of course most languages have library functions for this, but suppose I want to do it myself. Suppose that the float is given like in a C or Java program (except for the 'f' or 'd' suffix), for example " 4.2e1 ", ".42e2 " or simply " 42 ". In general, we have ...
TITLE: How to manually parse a floating point number from a string QUESTION: Of course most languages have library functions for this, but suppose I want to do it myself. Suppose that the float is given like in a C or Java program (except for the 'f' or 'd' suffix), for example " 4.2e1 ", ".42e2 " or simply " 42 ". In...
[ "parsing", "floating-point", "precision" ]
37
10
21,005
11
0
2008-09-17T16:48:24.287000
2008-09-17T17:05:11.780000
85,230
85,338
Which language is useful to create a report for a valid C program
Can anyone suggest me a helpful programming language which can be used to create a tool which will analyse the given C program and generate a txt report or html report containing information about the given program (function list, variable list etc). The program I intend to build is similar to doxygen but i want it for...
Both Python and Perl have excellent string processing capabilities. I'd suggest using something like ctags to parse the program, and just create a script to read the ctags file and output in txt/html. The file format used by ctags is well-defined so that other programs can read it. See http://ctags.sourceforge.net for ...
Which language is useful to create a report for a valid C program Can anyone suggest me a helpful programming language which can be used to create a tool which will analyse the given C program and generate a txt report or html report containing information about the given program (function list, variable list etc). The...
TITLE: Which language is useful to create a report for a valid C program QUESTION: Can anyone suggest me a helpful programming language which can be used to create a tool which will analyse the given C program and generate a txt report or html report containing information about the given program (function list, varia...
[ "c", "report", "parsing" ]
2
3
473
8
0
2008-09-17T16:48:59.433000
2008-09-17T16:57:59.863000
85,254
85,285
JConsole Config
in JBoss' run.bat, add: set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote - Dcom.sun.management.jmxremote.port=9987 - Dcom.sun.management.jmxremote.ssl=false - Dcom.sun.management.jmxremote.authenticate=false To start jconsole: JDK/bin>jconsole localhost:9987
Yes, that should work. If it doesn't, then use 'ps' (or your platform's equivalent) to check whether those arguments are making it on the JVM's command line. Was that the question?
JConsole Config in JBoss' run.bat, add: set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote - Dcom.sun.management.jmxremote.port=9987 - Dcom.sun.management.jmxremote.ssl=false - Dcom.sun.management.jmxremote.authenticate=false To start jconsole: JDK/bin>jconsole localhost:9987
TITLE: JConsole Config QUESTION: in JBoss' run.bat, add: set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote - Dcom.sun.management.jmxremote.port=9987 - Dcom.sun.management.jmxremote.ssl=false - Dcom.sun.management.jmxremote.authenticate=false To start jconsole: JDK/bin>jconsole localhost:9987 ANSWER: Yes, that ...
[ "jconsole" ]
1
1
1,195
1
0
2008-09-17T16:51:14.887000
2008-09-17T16:54:19.700000
85,272
85,337
How do you know when to use design patterns?
Anyone can read the GoF book to learn what design patterns are and how to use them, but what is the process for figuring out when a design pattern solves a problem? Does the knowledge of the pattern drive the design, or is there a way to figure out how a pattern can be used to change a design? In other words, are there...
Design patterns are supposed to provide a structure in which problems can be solved. When solving a real problem, you have to consider many tiny variations of a solution to that problem to see whether any fits a design pattern. In particular, you will probably need to generalise your problem, or its solution, in order ...
How do you know when to use design patterns? Anyone can read the GoF book to learn what design patterns are and how to use them, but what is the process for figuring out when a design pattern solves a problem? Does the knowledge of the pattern drive the design, or is there a way to figure out how a pattern can be used ...
TITLE: How do you know when to use design patterns? QUESTION: Anyone can read the GoF book to learn what design patterns are and how to use them, but what is the process for figuring out when a design pattern solves a problem? Does the knowledge of the pattern drive the design, or is there a way to figure out how a pa...
[ "design-patterns", "oop" ]
72
51
51,208
14
0
2008-09-17T16:53:05.070000
2008-09-17T16:57:54.713000
85,275
85,359
How do I derive a Voronoi diagram given its point set and its Delaunay triangulation?
I'm working on a game where I create a random map of provinces (a la Risk or Diplomacy). To create that map, I'm first generating a series of semi-random points, then figuring the Delaunay triangulations of those points. With that done, I am now looking to create a Voronoi diagram of the points to serve as a starting p...
The Voronoi diagram is just the dual graph of the Delaunay triangulation. So, the edges of the Voronoi diagram are along the perpendicular bisectors of the edges of the Delaunay triangulation, so compute those lines. Then, compute the vertices of the Voronoi diagram by finding the intersections of adjacent edges. Final...
How do I derive a Voronoi diagram given its point set and its Delaunay triangulation? I'm working on a game where I create a random map of provinces (a la Risk or Diplomacy). To create that map, I'm first generating a series of semi-random points, then figuring the Delaunay triangulations of those points. With that don...
TITLE: How do I derive a Voronoi diagram given its point set and its Delaunay triangulation? QUESTION: I'm working on a game where I create a random map of provinces (a la Risk or Diplomacy). To create that map, I'm first generating a series of semi-random points, then figuring the Delaunay triangulations of those poi...
[ "geometry", "computational-geometry", "voronoi", "delaunay" ]
32
23
31,462
5
0
2008-09-17T16:53:40.637000
2008-09-17T16:59:59
85,277
85,435
How do I enable more than 8-bit colors in Terminal.app?
In the Vim and Emacs terminal apps, the color schemes look horrid. How do I enable the colors to be as vibrant as the GUI version (or more than 8 colors for that matter)? Should I just give up, and move over to their respective GUI applications? And if so, which?
You can't have more colors in the terminal, because there are only ANSI codes for 8 colors (16 if you count bold/light). If you want to customize the colors, you can use the TerminalColours plugin from http://ciaranwal.sh/2007/11/01/customising-colours-in-leopard-terminal Personally, I prefer to use the so-called Carbo...
How do I enable more than 8-bit colors in Terminal.app? In the Vim and Emacs terminal apps, the color schemes look horrid. How do I enable the colors to be as vibrant as the GUI version (or more than 8 colors for that matter)? Should I just give up, and move over to their respective GUI applications? And if so, which?
TITLE: How do I enable more than 8-bit colors in Terminal.app? QUESTION: In the Vim and Emacs terminal apps, the color schemes look horrid. How do I enable the colors to be as vibrant as the GUI version (or more than 8 colors for that matter)? Should I just give up, and move over to their respective GUI applications? ...
[ "macos" ]
1
3
1,133
4
0
2008-09-17T16:53:43.757000
2008-09-17T17:07:54.580000
85,282
85,315
What is the value of an anonymous unattached block in C#?
In C# you can make a block inside of a method that is not attached to any other statement. public void TestMethod() { { string x = "test"; string y = x; { int z = 42; int zz = z; } } } This code compiles and runs just as if the braces inside the main method weren't there. Also notice the block inside of a block. Is th...
Scope and garbage collection: When you leave the unattached block, any variables declared in it go out of scope. That lets the garbage collector clean up those objects. Ray Hayes points out that the.NET garbage collector will not immediately collect the out-of-scope objects, so scoping is the main benefit.
What is the value of an anonymous unattached block in C#? In C# you can make a block inside of a method that is not attached to any other statement. public void TestMethod() { { string x = "test"; string y = x; { int z = 42; int zz = z; } } } This code compiles and runs just as if the braces inside the main method wer...
TITLE: What is the value of an anonymous unattached block in C#? QUESTION: In C# you can make a block inside of a method that is not attached to any other statement. public void TestMethod() { { string x = "test"; string y = x; { int z = 42; int zz = z; } } } This code compiles and runs just as if the braces inside t...
[ "c#" ]
11
10
799
10
0
2008-09-17T16:54:04.723000
2008-09-17T16:56:48.400000
85,283
85,319
How to avoid garbage collection in real time .NET application?
I'm writting a financial C# application which receive messages from the network, translate them into different object according to the message type and finaly apply the application business logic on them. The point is that after the business logic is applied, I'm very sure I will never need this instance again. Rather ...
Don't delete them right away. Calling the garbage collector for each object is a bad idea. Normally you really don't want to mess with the garbage collector at all, and even time critical processes are just race conditions waiting to happen if they're that sensitive. But if you know you'll have busy vs light load perio...
How to avoid garbage collection in real time .NET application? I'm writting a financial C# application which receive messages from the network, translate them into different object according to the message type and finaly apply the application business logic on them. The point is that after the business logic is applie...
TITLE: How to avoid garbage collection in real time .NET application? QUESTION: I'm writting a financial C# application which receive messages from the network, translate them into different object according to the message type and finaly apply the application business logic on them. The point is that after the busine...
[ "c#", ".net", "garbage-collection", "real-time", "finance" ]
13
23
28,566
13
0
2008-09-17T16:54:11.387000
2008-09-17T16:57:07.213000
85,307
85,383
Handling and storing elapsed time
I'm having problems deciding on what is the best way is to handle and store time measurements. I have an app that has a textbox that allows the users to input time in either hh:mm:ss or mm:ss format. So I was planning on parsing this string, tokenizing it on the colons and creating TimeSpan (or using TimeSpan.Parse() a...
TimeSpan has an Int64 Ticks property that you can store instead, and a constructor that takes a Ticks value.
Handling and storing elapsed time I'm having problems deciding on what is the best way is to handle and store time measurements. I have an app that has a textbox that allows the users to input time in either hh:mm:ss or mm:ss format. So I was planning on parsing this string, tokenizing it on the colons and creating Tim...
TITLE: Handling and storing elapsed time QUESTION: I'm having problems deciding on what is the best way is to handle and store time measurements. I have an app that has a textbox that allows the users to input time in either hh:mm:ss or mm:ss format. So I was planning on parsing this string, tokenizing it on the colon...
[ "c#", "database", "datetime", "timespan" ]
8
9
4,412
8
0
2008-09-17T16:56:08.573000
2008-09-17T17:01:48.043000
85,336
85,394
Customizing Search Results Display in Sharepoint Services 3.0 Wiki
I'm looking at using a Windows SharePoint Services 3.0 wiki as a metadata repository. We basically want a community-driven dictionary and for various reasons we're using Sharepoint instead of say MediaWiki. What can I do to customize or completely replace searchresults.aspx? Features I'd add if I knew how: Automaticall...
Yes, everything is possible but you will need to customize it a little bit. I would recommend you to build a custom web part to display your results. Here is a nice article to start with: http://msdn.microsoft.com/en-us/library/ms584220.aspx
Customizing Search Results Display in Sharepoint Services 3.0 Wiki I'm looking at using a Windows SharePoint Services 3.0 wiki as a metadata repository. We basically want a community-driven dictionary and for various reasons we're using Sharepoint instead of say MediaWiki. What can I do to customize or completely repla...
TITLE: Customizing Search Results Display in Sharepoint Services 3.0 Wiki QUESTION: I'm looking at using a Windows SharePoint Services 3.0 wiki as a metadata repository. We basically want a community-driven dictionary and for various reasons we're using Sharepoint instead of say MediaWiki. What can I do to customize o...
[ "sharepoint", "search", "metadata", "wiki" ]
1
2
3,188
1
0
2008-09-17T16:57:52.203000
2008-09-17T17:02:28.447000
85,353
85,377
Best general SVN Ignore Pattern?
What is the best (or as good as possible) general SVN ignore pattern to use? There are a number of different IDE, editor, compiler, plug-in, platform, etc. specific files and some file types that "overlap" (i.e. desirable for some types projects and not for others). There are however, a large number of file types that ...
I'll add my own two cents to this question: I use the following SVN ignore pattern with TortoiseSVN and Subversion CLI for native C++, C#/VB.NET, and PERL projects on both Windows and Linux platforms. It works well for me! Formatted for copy and paste: *.o *.lo *.la #*#.*.rej *.rej.*~ *~.#*.DS_Store thumbs.db Thumbs.db...
Best general SVN Ignore Pattern? What is the best (or as good as possible) general SVN ignore pattern to use? There are a number of different IDE, editor, compiler, plug-in, platform, etc. specific files and some file types that "overlap" (i.e. desirable for some types projects and not for others). There are however, a...
TITLE: Best general SVN Ignore Pattern? QUESTION: What is the best (or as good as possible) general SVN ignore pattern to use? There are a number of different IDE, editor, compiler, plug-in, platform, etc. specific files and some file types that "overlap" (i.e. desirable for some types projects and not for others). Th...
[ "svn", "language-agnostic", "version-control", "development-environment", "environment" ]
179
196
73,158
17
0
2008-09-17T16:59:23.947000
2008-09-17T17:01:30.870000
85,373
85,379
Floor a date in SQL server
In SQL Server, how do I "floor" a DATETIME to the second/minute/hour/day/year? Let's say that I have a date of 2008-09-17 12:56:53.430, then the output of flooring should be: Year: 2008-01-01 00:00:00.000 Month: 2008-09-01 00:00:00.000 Day: 2008-09-17 00:00:00.000 Hour: 2008-09-17 12:00:00.000 Minute: 2008-09-17 12:56:...
The key is to use DATEADD and DATEDIFF along with the appropriate SQL timespan enumeration. declare @datetime datetime; set @datetime = getdate(); select @datetime; select dateadd(year,datediff(year,0,@datetime),0); select dateadd(month,datediff(month,0,@datetime),0); select dateadd(day,datediff(day,0,@datetime),0); se...
Floor a date in SQL server In SQL Server, how do I "floor" a DATETIME to the second/minute/hour/day/year? Let's say that I have a date of 2008-09-17 12:56:53.430, then the output of flooring should be: Year: 2008-01-01 00:00:00.000 Month: 2008-09-01 00:00:00.000 Day: 2008-09-17 00:00:00.000 Hour: 2008-09-17 12:00:00.00...
TITLE: Floor a date in SQL server QUESTION: In SQL Server, how do I "floor" a DATETIME to the second/minute/hour/day/year? Let's say that I have a date of 2008-09-17 12:56:53.430, then the output of flooring should be: Year: 2008-01-01 00:00:00.000 Month: 2008-09-01 00:00:00.000 Day: 2008-09-17 00:00:00.000 Hour: 2008...
[ "sql-server", "t-sql" ]
77
115
84,352
10
0
2008-09-17T17:01:25.423000
2008-09-17T17:01:36.500000
85,392
86,350
SharePoint - How do insert new items using the list web service?
I have a list with 2 text fields, and a choice field. How do I use the Lists.asmx web service to insert a new item? I can make a web reference to the lists.asmx service, so you can assume that this is known. I would like a complete example including code and the XML for the CAML query. Ideally the sample would use C#.
Using the Lists web service to insert item into a SharePoint list can indeed be tricky. Since this method is of the form: XML in, XML out, it can be hard to get the parameters right. First you should take a look at the list definition. It can be retrieved with the method GetList(), as shown below: XmlNode listXml = sha...
SharePoint - How do insert new items using the list web service? I have a list with 2 text fields, and a choice field. How do I use the Lists.asmx web service to insert a new item? I can make a web reference to the lists.asmx service, so you can assume that this is known. I would like a complete example including code ...
TITLE: SharePoint - How do insert new items using the list web service? QUESTION: I have a list with 2 text fields, and a choice field. How do I use the Lists.asmx web service to insert a new item? I can make a web reference to the lists.asmx service, so you can assume that this is known. I would like a complete examp...
[ "c#", "xml", "sharepoint", "service" ]
6
16
16,505
1
0
2008-09-17T17:02:25.470000
2008-09-17T18:53:06.810000
85,403
85,408
how to change default delete date in lotus notes for emails?
I am using Lotus Notes as my email client, and how to change the defailt email delete date to something new so my older emails don't get deleted after pre-defined date?
go to TOOLS -> Change Delete Date, you can put any number of days to change the default delete date of selected email.
how to change default delete date in lotus notes for emails? I am using Lotus Notes as my email client, and how to change the defailt email delete date to something new so my older emails don't get deleted after pre-defined date?
TITLE: how to change default delete date in lotus notes for emails? QUESTION: I am using Lotus Notes as my email client, and how to change the defailt email delete date to something new so my older emails don't get deleted after pre-defined date? ANSWER: go to TOOLS -> Change Delete Date, you can put any number of da...
[ "lotus-notes" ]
1
2
12,092
2
0
2008-09-17T17:03:59.193000
2008-09-17T17:04:20.097000
85,414
85,436
How do you port a virtual machine from VMWare to VirtualBox?
I've been using VMWare for a while and am very happy with it, but I would like to compare it with VirtualBox. Apparently the disk images are compatible, and I have successfully booted my Fedora based VM created by VMWare in VirtualBox... but the network is completely unavailable. How do you port a virtual machine from ...
have you tried going into the options in virtual box and changing the network adapter to the VB one? VB is a bit different in it's virtual adapters, you might have to create a new one attached to the nic and then specify that one as the primary nic.
How do you port a virtual machine from VMWare to VirtualBox? I've been using VMWare for a while and am very happy with it, but I would like to compare it with VirtualBox. Apparently the disk images are compatible, and I have successfully booted my Fedora based VM created by VMWare in VirtualBox... but the network is co...
TITLE: How do you port a virtual machine from VMWare to VirtualBox? QUESTION: I've been using VMWare for a while and am very happy with it, but I would like to compare it with VirtualBox. Apparently the disk images are compatible, and I have successfully booted my Fedora based VM created by VMWare in VirtualBox... but...
[ "vmware", "virtualbox" ]
3
1
6,055
3
0
2008-09-17T17:05:16.163000
2008-09-17T17:07:58.777000
85,427
85,505
Rich Edit Control in raw Win32
Is the documentation for Rich Edit Controls really as bad (wrong?) as it seems to be? Right now I'm manually calling LoadLibrary("riched20.dll") in order to get a Rich Edit Control to show up. The documentation for Rich Edit poorly demonstrates this in the first code sample for using Rich Edit controls. It talks about ...
Using MFC, RichEdit controls just work. Loading with InitCommonControlsEx() - ICC_USEREX_CLASSES doesn't load RichEdit AFAIK, you don't need it as it only does the 'standard' common controls, which don't include richedit. Apparently you only need to call this to enable 'visual styles' in Windows, not to get RichEdits w...
Rich Edit Control in raw Win32 Is the documentation for Rich Edit Controls really as bad (wrong?) as it seems to be? Right now I'm manually calling LoadLibrary("riched20.dll") in order to get a Rich Edit Control to show up. The documentation for Rich Edit poorly demonstrates this in the first code sample for using Rich...
TITLE: Rich Edit Control in raw Win32 QUESTION: Is the documentation for Rich Edit Controls really as bad (wrong?) as it seems to be? Right now I'm manually calling LoadLibrary("riched20.dll") in order to get a Rich Edit Control to show up. The documentation for Rich Edit poorly demonstrates this in the first code sam...
[ "windows", "winapi", "richedit" ]
5
3
9,704
4
0
2008-09-17T17:07:02.417000
2008-09-17T17:15:38.883000
85,434
85,472
Code Outlining, Classic ASP and Visual Studio 2005
Is there a way to enable code outlining for Classic ASP in Visual Studio 2005? It outlines the HTML code pretty well and I get a big outline between <% and %>, but nothing for the code itself.
Visual Studio 2008 SP1 has re-added support for classic ASP, but I don't believe either version supports the type of outlining you're looking for.
Code Outlining, Classic ASP and Visual Studio 2005 Is there a way to enable code outlining for Classic ASP in Visual Studio 2005? It outlines the HTML code pretty well and I get a big outline between <% and %>, but nothing for the code itself.
TITLE: Code Outlining, Classic ASP and Visual Studio 2005 QUESTION: Is there a way to enable code outlining for Classic ASP in Visual Studio 2005? It outlines the HTML code pretty well and I get a big outline between <% and %>, but nothing for the code itself. ANSWER: Visual Studio 2008 SP1 has re-added support for c...
[ "visual-studio", "asp-classic" ]
1
0
675
1
0
2008-09-17T17:07:53.053000
2008-09-17T17:11:54.853000
85,444
87,479
Sharepoint Item Level Access & performance
i have created a workflow activity that do give the item creater of a specific list full control on the item and set everyone else to read only access (permission) someone told me that doing it this way (if i have a lot of users) the performance will go down dramatically is that correct?!! if yes what is the best solut...
Performance degradation will happen when you use large ACLs for each list item. Just make sure that item-level permissions basically have the minimum entries. For example: The user that has permissions to edit that item A single security group that contains all the users with only Reader permissions. So, can Sharepoint...
Sharepoint Item Level Access & performance i have created a workflow activity that do give the item creater of a specific list full control on the item and set everyone else to read only access (permission) someone told me that doing it this way (if i have a lot of users) the performance will go down dramatically is th...
TITLE: Sharepoint Item Level Access & performance QUESTION: i have created a workflow activity that do give the item creater of a specific list full control on the item and set everyone else to read only access (permission) someone told me that doing it this way (if i have a lot of users) the performance will go down ...
[ "sharepoint", "permissions", "list", "data-access" ]
0
2
3,263
4
0
2008-09-17T17:08:47.327000
2008-09-17T20:44:40.643000
85,457
85,989
Limiting results of System.Data.Linq.Table<T>
I am trying to inherit from my generated datacontext in LinqToSQL - something like this public class myContext: dbDataContext { public System.Data.Linq.Table () Users { return (from x in base.Users() where x.DeletedOn.HasValue == false select x); } } But my Linq statement returns IQueryable which cannot cast to Table -...
Another approach would to be use views.. CREATE VIEW ActiveUsers as SELECT * FROM Users WHERE IsDeleted = 0 As far as linq to sql is concerned, that is just the same as a table. For any table that you needed the DeletedOn filtering, just create a view that uses the filter and use that in place of the table in your data...
Limiting results of System.Data.Linq.Table<T> I am trying to inherit from my generated datacontext in LinqToSQL - something like this public class myContext: dbDataContext { public System.Data.Linq.Table () Users { return (from x in base.Users() where x.DeletedOn.HasValue == false select x); } } But my Linq statement r...
TITLE: Limiting results of System.Data.Linq.Table<T> QUESTION: I am trying to inherit from my generated datacontext in LinqToSQL - something like this public class myContext: dbDataContext { public System.Data.Linq.Table () Users { return (from x in base.Users() where x.DeletedOn.HasValue == false select x); } } But m...
[ "linq-to-sql" ]
3
2
2,445
8
0
2008-09-17T17:09:57.090000
2008-09-17T18:09:58.770000
85,459
85,618
Is it possible to combine a series of PDFs into one using Ruby?
I have a series of PDFs named sequentially like so: 01_foo.pdf 02_bar.pdf 03_baz.pdf etc. Using Ruby, is it possible to combine these into one big PDF while keeping them in sequence? I don't mind installing any necessary gems to do the job. If this isn't possible in Ruby, how about another language? No commercial compo...
A Ruby-Talk post suggests using the pdftk toolkit to merge the PDFs. It should be relatively straightforward to call pdftk as an external process and have it handle the merging. PDF::Writer may be overkill because all you're looking to accomplish is a simple append.
Is it possible to combine a series of PDFs into one using Ruby? I have a series of PDFs named sequentially like so: 01_foo.pdf 02_bar.pdf 03_baz.pdf etc. Using Ruby, is it possible to combine these into one big PDF while keeping them in sequence? I don't mind installing any necessary gems to do the job. If this isn't p...
TITLE: Is it possible to combine a series of PDFs into one using Ruby? QUESTION: I have a series of PDFs named sequentially like so: 01_foo.pdf 02_bar.pdf 03_baz.pdf etc. Using Ruby, is it possible to combine these into one big PDF while keeping them in sequence? I don't mind installing any necessary gems to do the jo...
[ "ruby", "pdf" ]
10
14
3,580
7
0
2008-09-17T17:10:02.110000
2008-09-17T17:28:59.197000
85,470
85,857
MVC C# custom MvcRouteHandler - How to?
Does anyone have experiences in providing a custom MvcRouteHandler? In my application I'd like to implement a globalization-pattern like http://mydomain/en/about or http://mydomain/de/about. As for persistance, I'd like to have a cookie read as soon as a request arrives and if there is a language setting in this cookie...
I don't believe a custom route handler is required for what you are doing. For your "globalized" URIs, a regular MVC route, with a constraint that the "locale" parameter must be equal to "en", "de", etc., will do. The constraint will prevent non-globalized URIs from matching the route. For a "non-globalized" URI, make ...
MVC C# custom MvcRouteHandler - How to? Does anyone have experiences in providing a custom MvcRouteHandler? In my application I'd like to implement a globalization-pattern like http://mydomain/en/about or http://mydomain/de/about. As for persistance, I'd like to have a cookie read as soon as a request arrives and if th...
TITLE: MVC C# custom MvcRouteHandler - How to? QUESTION: Does anyone have experiences in providing a custom MvcRouteHandler? In my application I'd like to implement a globalization-pattern like http://mydomain/en/about or http://mydomain/de/about. As for persistance, I'd like to have a cookie read as soon as a request...
[ "c#", "asp.net-mvc", "mvcroutehandler" ]
4
2
2,277
2
0
2008-09-17T17:11:28.443000
2008-09-17T17:55:42.143000
85,479
85,572
C# Unsafe/Fixed Code
Can someone give an example of a good time to actually use "unsafe" and "fixed" in C# code? I've played with it before, but never actually found a good use for it. Consider this code... fixed (byte* pSrc = src, pDst = dst) { //Code that copies the bytes in a loop } compared to simply using... Array.Copy(source, target,...
It's useful for interop with unmanaged code. Any pointers passed to unmanaged functions need to be fixed (aka. pinned) to prevent the garbage collector from relocating the underlying memory. If you are using P/Invoke, then the default marshaller will pin objects for you. Sometimes it's necessary to perform custom marsh...
C# Unsafe/Fixed Code Can someone give an example of a good time to actually use "unsafe" and "fixed" in C# code? I've played with it before, but never actually found a good use for it. Consider this code... fixed (byte* pSrc = src, pDst = dst) { //Code that copies the bytes in a loop } compared to simply using... Array...
TITLE: C# Unsafe/Fixed Code QUESTION: Can someone give an example of a good time to actually use "unsafe" and "fixed" in C# code? I've played with it before, but never actually found a good use for it. Consider this code... fixed (byte* pSrc = src, pDst = dst) { //Code that copies the bytes in a loop } compared to sim...
[ "c#", ".net", "unsafe", "fixed" ]
34
32
19,302
7
0
2008-09-17T17:12:25.553000
2008-09-17T17:22:49.087000
85,487
85,510
Reverse DNS lookup in perl
How do I perform a reverse DNS lookup, that is how do I resolve an IP address to its DNS hostname in Perl?
gethostbyaddr and similar calls. See http://perldoc.perl.org/functions/gethostbyaddr.html
Reverse DNS lookup in perl How do I perform a reverse DNS lookup, that is how do I resolve an IP address to its DNS hostname in Perl?
TITLE: Reverse DNS lookup in perl QUESTION: How do I perform a reverse DNS lookup, that is how do I resolve an IP address to its DNS hostname in Perl? ANSWER: gethostbyaddr and similar calls. See http://perldoc.perl.org/functions/gethostbyaddr.html
[ "perl", "ip", "lookup", "nslookup", "reverse-dns" ]
13
20
30,376
8
0
2008-09-17T17:14:01.120000
2008-09-17T17:15:58.370000
85,500
86,520
AJAX - How to Pass value back to server
First time working with UpdatePanels in.NET. I have an updatepanel with a trigger pointed to an event on a FormView control. The UpdatePanel holds a ListView with related data from a separate database. When the UpdatePanel refreshes, it needs values from the FormView control so that on the server it can use them to que...
make a javascript function that will collect the pieces of form data, and then sends that data to an ASHX handler. the ASHX handler will do some work, and can reply with a response. This is an example I made that calls a database to populate a grid using AJAX calls. There are better libraries for doing AJAX (prototype,...
AJAX - How to Pass value back to server First time working with UpdatePanels in.NET. I have an updatepanel with a trigger pointed to an event on a FormView control. The UpdatePanel holds a ListView with related data from a separate database. When the UpdatePanel refreshes, it needs values from the FormView control so t...
TITLE: AJAX - How to Pass value back to server QUESTION: First time working with UpdatePanels in.NET. I have an updatepanel with a trigger pointed to an event on a FormView control. The UpdatePanel holds a ListView with related data from a separate database. When the UpdatePanel refreshes, it needs values from the For...
[ "asp.net-ajax", "asynchronous" ]
5
4
6,675
3
0
2008-09-17T17:15:26.497000
2008-09-17T19:10:57.687000
85,513
85,597
What does the option "convert to web application" do if I select it in visual studio?
What does the option “convert to web application” do if I select it in visual studio? If I do convert my site to a web application what are the advantages? Can I go back?
Well, it converts your web site to a web application project. As for the advantages, here is some further reading: MSDN comparison -- Comparing Web Site Projects and Web Application Projects Webcast on ASP.NET -- Web Application Projects vs. Web Site Projects in Visual Studio 2008 "In this webcast, by request, we exami...
What does the option "convert to web application" do if I select it in visual studio? What does the option “convert to web application” do if I select it in visual studio? If I do convert my site to a web application what are the advantages? Can I go back?
TITLE: What does the option "convert to web application" do if I select it in visual studio? QUESTION: What does the option “convert to web application” do if I select it in visual studio? If I do convert my site to a web application what are the advantages? Can I go back? ANSWER: Well, it converts your web site to a...
[ "c#", "asp.net", "visual-studio" ]
23
11
32,117
3
0
2008-09-17T17:16:02.317000
2008-09-17T17:26:17.283000
85,517
876,430
TileBrush for SIlverlight 2?
As you may know, Silverlight does not have the TileBrush found in WPF. Is there a workaround to do tiling?
According to contributor at Silverlight forum TileBrush in Silverlight (2 and 3) is only a placeholder class ready for future expansion and for WPF compatibility A PixelShader workaround is proposed for now, which description you can find here Someone please edit my post!:-)
TileBrush for SIlverlight 2? As you may know, Silverlight does not have the TileBrush found in WPF. Is there a workaround to do tiling?
TITLE: TileBrush for SIlverlight 2? QUESTION: As you may know, Silverlight does not have the TileBrush found in WPF. Is there a workaround to do tiling? ANSWER: According to contributor at Silverlight forum TileBrush in Silverlight (2 and 3) is only a placeholder class ready for future expansion and for WPF compatibi...
[ "silverlight" ]
4
3
773
2
0
2008-09-17T17:16:16.777000
2009-05-18T06:08:38.320000
85,520
85,563
PHP DOMDocument stripping HTML tags
I'm working on a small templating engine, and I'm using DOMDocument to parse the pages. My test page so far looks like this: '?> Main column of content And part of my class looks like this: private function parse($tag, $attr = 'name') { $strict = 0; /*** the array to return ***/ $out = array(); if($this->totalBlocks() ...
Nothing: nodeValue is the concatenation of the value portion of the tree, and will never have tags. What I would do to make an HTML fragment of the tree under $node is this: $doc = new DOMDocument(); foreach($node->childNodes as $child) { $doc->appendChild($doc->importNode($child, true)); } return $doc->saveHTML(); HTM...
PHP DOMDocument stripping HTML tags I'm working on a small templating engine, and I'm using DOMDocument to parse the pages. My test page so far looks like this: '?> Main column of content And part of my class looks like this: private function parse($tag, $attr = 'name') { $strict = 0; /*** the array to return ***/ $out...
TITLE: PHP DOMDocument stripping HTML tags QUESTION: I'm working on a small templating engine, and I'm using DOMDocument to parse the pages. My test page so far looks like this: '?> Main column of content And part of my class looks like this: private function parse($tag, $attr = 'name') { $strict = 0; /*** the array t...
[ "php" ]
5
9
6,946
1
0
2008-09-17T17:16:45.030000
2008-09-17T17:21:54.127000
85,522
91,103
Migrating from MySQL to arbitrary standards-compliant SQL2003 server
Is there an incantation of mysqldump or a similar tool that will produce a piece of SQL2003 code to create and fill the same databases in an arbitrary SQL2003 compliant RDBMS? (The one I'm trying right now is MonetDB)
DDL statements are inherently database-vendor specific. Although they have the same basic structure, each vendor has their own take on how to define types, indexes, constraints, etc. DML statements on the other hand are fairly portable. Therefore I suggest: Dump the database without any data (mysqldump --no-data) to ge...
Migrating from MySQL to arbitrary standards-compliant SQL2003 server Is there an incantation of mysqldump or a similar tool that will produce a piece of SQL2003 code to create and fill the same databases in an arbitrary SQL2003 compliant RDBMS? (The one I'm trying right now is MonetDB)
TITLE: Migrating from MySQL to arbitrary standards-compliant SQL2003 server QUESTION: Is there an incantation of mysqldump or a similar tool that will produce a piece of SQL2003 code to create and fill the same databases in an arbitrary SQL2003 compliant RDBMS? (The one I'm trying right now is MonetDB) ANSWER: DDL st...
[ "sql", "mysql" ]
2
3
334
4
0
2008-09-17T17:16:51.813000
2008-09-18T09:10:26.547000
85,532
122,177
Faces Servlet threw exception java.lang.StackOverflowError
Ok, I've run across my first StackOverflowError since joining this site, I figured this is a must post:-). My environment is Seam 2.0.1.GA, JBoss 4.2.2.GA and I'm using JSF. I am in the process of converting from a facelets view to JSP to take advantage of some existing JSP tags used on our existing site. I changed the...
I was able to figure out this problem. Apparently you can not configure web.xml to have the same param-value of.jsp for Javax.faces.DEFAULT_SUFFIX as the Faces Servlet url-pattern (*.jsp). If you change your url-pattern to.jspx or to /whateverdirnameyouwant/ the application starts up with no stack overflow errors. (not...
Faces Servlet threw exception java.lang.StackOverflowError Ok, I've run across my first StackOverflowError since joining this site, I figured this is a must post:-). My environment is Seam 2.0.1.GA, JBoss 4.2.2.GA and I'm using JSF. I am in the process of converting from a facelets view to JSP to take advantage of some...
TITLE: Faces Servlet threw exception java.lang.StackOverflowError QUESTION: Ok, I've run across my first StackOverflowError since joining this site, I figured this is a must post:-). My environment is Seam 2.0.1.GA, JBoss 4.2.2.GA and I'm using JSF. I am in the process of converting from a facelets view to JSP to take...
[ "configuration", "jboss", "seam", "web-applications" ]
7
9
36,356
3
0
2008-09-17T17:18:13.607000
2008-09-23T16:37:29.760000
85,548
85,589
How to make Swing scroll with "ensureIndexIsVisible"?
When I run this code the selected item is not visible. I've already tried to run it in a separate thread with no luck. import javax.swing.JFrame; import java.awt.Container; import javax.swing.JList; import javax.swing.ListSelectionModel; import javax.swing.JScrollPane; import java.awt.Dimension; public class ScrollLis...
I figured it out!! This is the code: import javax.swing.JFrame; import java.awt.Container; import javax.swing.JList; import javax.swing.ListSelectionModel; import javax.swing.JScrollPane; import java.awt.Dimension; public class ScrollList extends JFrame { final int defaultValue = 20; ScrollList() { setDefaultCloseOpe...
How to make Swing scroll with "ensureIndexIsVisible"? When I run this code the selected item is not visible. I've already tried to run it in a separate thread with no luck. import javax.swing.JFrame; import java.awt.Container; import javax.swing.JList; import javax.swing.ListSelectionModel; import javax.swing.JScrollPa...
TITLE: How to make Swing scroll with "ensureIndexIsVisible"? QUESTION: When I run this code the selected item is not visible. I've already tried to run it in a separate thread with no luck. import javax.swing.JFrame; import java.awt.Container; import javax.swing.JList; import javax.swing.ListSelectionModel; import jav...
[ "java", "swing" ]
1
1
2,907
1
0
2008-09-17T17:20:16.173000
2008-09-17T17:25:01.733000
85,553
85,656
When should I use a struct instead of a class?
MSDN says that you should use structs when you need lightweight objects. Are there any other scenarios when a struct is preferable over a class? Some people might have forgotten that: structs can have methods. structs cannot be inherited. I understand the technical differences between structs and classes, I just don't ...
MSDN has the answer: Choosing Between Classes and Structures. Basically, that page gives you a 4-item checklist and says to use a class unless your type meets all of the criteria. Do not define a structure unless the type has all of the following characteristics: It logically represents a single value, similar to primi...
When should I use a struct instead of a class? MSDN says that you should use structs when you need lightweight objects. Are there any other scenarios when a struct is preferable over a class? Some people might have forgotten that: structs can have methods. structs cannot be inherited. I understand the technical differe...
TITLE: When should I use a struct instead of a class? QUESTION: MSDN says that you should use structs when you need lightweight objects. Are there any other scenarios when a struct is preferable over a class? Some people might have forgotten that: structs can have methods. structs cannot be inherited. I understand the...
[ ".net", "oop" ]
338
320
117,361
16
0
2008-09-17T17:20:49.293000
2008-09-17T17:34:03.567000
85,559
85,612
VB.NET 2005 problems with Designer not being able to process a code line
I have a problem in my project with the.designer which as everyone know is autogenerated and I ahvent changed at all. One day I was working fine, I did a back up and next day boom! the project suddenly stops working and sends a message that the designer cant procees a code line... and due to this I get more errores (2 ...
I would back up the designer.cs file associated with it (like copy it to the desktop), then edit the designer.cs file and remove the offending lines (keeping track of what they do) and then I'd try to redo those lines via the design mode of that form.
VB.NET 2005 problems with Designer not being able to process a code line I have a problem in my project with the.designer which as everyone know is autogenerated and I ahvent changed at all. One day I was working fine, I did a back up and next day boom! the project suddenly stops working and sends a message that the de...
TITLE: VB.NET 2005 problems with Designer not being able to process a code line QUESTION: I have a problem in my project with the.designer which as everyone know is autogenerated and I ahvent changed at all. One day I was working fine, I did a back up and next day boom! the project suddenly stops working and sends a m...
[ "vb.net", "visual-studio-2005", "crystal-reports", "designer" ]
0
1
3,142
4
0
2008-09-17T17:21:27.607000
2008-09-17T17:28:17.467000
85,569
172,117
.Net (dotNet) wrappers for OpenCV?
I've seen there are a few of them. opencvdotnet, SharperCV, EmguCV, One on Code Project. Does anyone have any experience with any of these? I played around with the one on Code Project for a bit, but as soon as I tried to do anything complicated I got some nasty uncatchable exceptions (i.e. Msgbox exceptions). Cross pl...
I started out with opencvdotnet but it's not really actively developed any more. Further, support for the feature I needed (facedetection) was patchy. I'm using EmguCV now: It wraps a much greater part of the API and the guy behind it is very responsive to suggestions and requests. The code is a joy to look at and is k...
.Net (dotNet) wrappers for OpenCV? I've seen there are a few of them. opencvdotnet, SharperCV, EmguCV, One on Code Project. Does anyone have any experience with any of these? I played around with the one on Code Project for a bit, but as soon as I tried to do anything complicated I got some nasty uncatchable exceptions...
TITLE: .Net (dotNet) wrappers for OpenCV? QUESTION: I've seen there are a few of them. opencvdotnet, SharperCV, EmguCV, One on Code Project. Does anyone have any experience with any of these? I played around with the one on Code Project for a bit, but as soon as I tried to do anything complicated I got some nasty unca...
[ "c#", ".net", "opencv", "mono", "cross-platform" ]
75
72
61,652
8
0
2008-09-17T17:22:15.750000
2008-10-05T15:10:53.993000
85,577
85,613
Search for host with MAC-address using Python
I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas?
You need ARP. Python's standard library doesn't include any code for that, so you either need to call an external program (your OS may have an 'arp' utility) or you need to build the packets yourself (possibly with a tool like Scapy.
Search for host with MAC-address using Python I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas?
TITLE: Search for host with MAC-address using Python QUESTION: I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas? ANSWER: You need ARP. Python's s...
[ "python", "network-programming" ]
9
13
17,130
8
0
2008-09-17T17:23:23.030000
2008-09-17T17:28:21.520000
85,588
87,024
FindControl() method throws ArithmeticException?
I have a line of C# in my ASP.NET code behind that looks like this: DropDownList ddlStates = (DropDownList)fvAccountSummary.FindControl("ddlStates"); The DropDownList control is explicitly declared in the markup on the page, not dynamically created. It is inside of a FormView control. When my code hits this line, I am ...
If that's the stacktrace, its comingn from databinding, not from the line you posted. Is it possible that you have some really large data set? I've seen a 6000-page GridView overflow an Int16, although it seems pretty unlikely you'd actually overflow an Int32... Check to make sure you're passing in sane data into, say,...
FindControl() method throws ArithmeticException? I have a line of C# in my ASP.NET code behind that looks like this: DropDownList ddlStates = (DropDownList)fvAccountSummary.FindControl("ddlStates"); The DropDownList control is explicitly declared in the markup on the page, not dynamically created. It is inside of a For...
TITLE: FindControl() method throws ArithmeticException? QUESTION: I have a line of C# in my ASP.NET code behind that looks like this: DropDownList ddlStates = (DropDownList)fvAccountSummary.FindControl("ddlStates"); The DropDownList control is explicitly declared in the markup on the page, not dynamically created. It ...
[ "c#", "asp.net" ]
0
3
721
3
0
2008-09-17T17:24:49.410000
2008-09-17T20:02:08.127000
85,614
447,772
How do I install modperl under OS X Leopard's default Apache 2?
My attempts to install modperl under the default vanilla Leopard Apache 2 have failed and all I can find online are variations on this: I would like if possible not to rely on MacPorts or Fink, though if they can be made to work with the default Apache 2 install that would probably be ok.
Get the latest mod_perl and set the following var: export ARCHFLAGS="-arch x86_64" Compile/install as usual. Taken from this post, "Building mod_perl2 on Leopard" which also links to further details on how to get Apache2::Request (libapreq) working as well. - (Not that I've been able to test it since I'm personally bac...
How do I install modperl under OS X Leopard's default Apache 2? My attempts to install modperl under the default vanilla Leopard Apache 2 have failed and all I can find online are variations on this: I would like if possible not to rely on MacPorts or Fink, though if they can be made to work with the default Apache 2 i...
TITLE: How do I install modperl under OS X Leopard's default Apache 2? QUESTION: My attempts to install modperl under the default vanilla Leopard Apache 2 have failed and all I can find online are variations on this: I would like if possible not to rely on MacPorts or Fink, though if they can be made to work with the ...
[ "macos", "apache2", "installation", "osx-leopard", "mod-perl" ]
1
1
2,268
6
0
2008-09-17T17:28:32.100000
2009-01-15T17:52:10.733000
85,622
100,607
How to compile Cairo for Visual C++ 2008 (Express edition)
Most precompiled Windows binaries are made with the MSYS+gcc toolchain. It uses MSVCRT runtime, which is incompatible with Visual C++ 2005/2008. So, how to go about and compile Cairo 1.6.4 (or later) for Visual C++ only. Including dependencies (png,zlib,pixman).
Here are instructions for building Cairo/Cairomm with Visual C++. Required: Visual C++ 2008 Express SP1 (now includes SDK) MSYS 1.0 To use VC++ command line tools, a batch file 'vcvars32.bat' needs to be run. C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vcvars32.bat ZLib Download (and extract) zlib123.zip...
How to compile Cairo for Visual C++ 2008 (Express edition) Most precompiled Windows binaries are made with the MSYS+gcc toolchain. It uses MSVCRT runtime, which is incompatible with Visual C++ 2005/2008. So, how to go about and compile Cairo 1.6.4 (or later) for Visual C++ only. Including dependencies (png,zlib,pixman)...
TITLE: How to compile Cairo for Visual C++ 2008 (Express edition) QUESTION: Most precompiled Windows binaries are made with the MSYS+gcc toolchain. It uses MSVCRT runtime, which is incompatible with Visual C++ 2005/2008. So, how to go about and compile Cairo 1.6.4 (or later) for Visual C++ only. Including dependencies...
[ "visual-studio-2008", "visual-c++", "open-source", "graphics" ]
11
18
12,387
7
0
2008-09-17T17:29:46.573000
2008-09-19T08:58:22.120000
85,624
483,343
Component to view and annotate PDF documents
Can anyone recommend a good Windows form component for displaying PDF documents and allowing users to add real annotation (by which I mean identical to that created by Adobe Reader). Update: I've tried the AxAcroPDF component which Abobe installs alongside Reader, but this doesn't support annotation. I basically want A...
If anyone's interested, it looks like we'll end up using jPDFNotes, from Qoppa Software. To quote from the web site: jPDFNotes is a Java™ bean that integrates into your application to display PDF documents and forms and allow your users to annotate the documents and fill the forms. After editing documents, the library ...
Component to view and annotate PDF documents Can anyone recommend a good Windows form component for displaying PDF documents and allowing users to add real annotation (by which I mean identical to that created by Adobe Reader). Update: I've tried the AxAcroPDF component which Abobe installs alongside Reader, but this d...
TITLE: Component to view and annotate PDF documents QUESTION: Can anyone recommend a good Windows form component for displaying PDF documents and allowing users to add real annotation (by which I mean identical to that created by Adobe Reader). Update: I've tried the AxAcroPDF component which Abobe installs alongside ...
[ "pdf", "annotations", "components", "markup" ]
5
0
5,243
4
0
2008-09-17T17:29:53.123000
2009-01-27T13:11:45.560000
85,649
85,694
Safely remove a USB drive using the Win32 API?
How do I remove a USB drive using the Win32 API? I do a lot of work on embedded systems and on one of these I have to copy my programs on a USB stick and insert it into the target hardware. Since I mostly work on the console I don't like to use the mouse and click on the small task-bar icon hundred times a day. I'd lov...
You can use the CM_Request_Device_Eject() function as well as some other possibilities. Consult the following projects and articles: DevEject: Straightforward. http://www.withopf.com/tools/deveject/ A useful CodeProject article: http://www.codeproject.com/KB/system/RemoveDriveByLetter.aspx
Safely remove a USB drive using the Win32 API? How do I remove a USB drive using the Win32 API? I do a lot of work on embedded systems and on one of these I have to copy my programs on a USB stick and insert it into the target hardware. Since I mostly work on the console I don't like to use the mouse and click on the s...
TITLE: Safely remove a USB drive using the Win32 API? QUESTION: How do I remove a USB drive using the Win32 API? I do a lot of work on embedded systems and on one of these I have to copy my programs on a USB stick and insert it into the target hardware. Since I mostly work on the console I don't like to use the mouse ...
[ "c", "windows", "winapi", "usb" ]
32
20
40,448
3
0
2008-09-17T17:33:07.500000
2008-09-17T17:37:15.633000
85,675
85,730
How do I compare two CLOB values in Oracle
I have two tables I would like to complare. One of the columns is type CLOB. I would like to do something like this: select key, clob_value source_table minus select key, clob_value target_table Unfortunately, Oracle can't perform minus operations on clobs. How can I do this?
The format is this: dbms_lob.compare( lob_1 IN BLOB, lob_2 IN BLOB, amount IN INTEGER:= 18446744073709551615, offset_1 IN INTEGER:= 1, offset_2 IN INTEGER:= 1) RETURN INTEGER; If dbms_lob.compare(lob1, lob2) = 0, they are identical. Here's an example query based on your example: Select key, glob_value From source_table...
How do I compare two CLOB values in Oracle I have two tables I would like to complare. One of the columns is type CLOB. I would like to do something like this: select key, clob_value source_table minus select key, clob_value target_table Unfortunately, Oracle can't perform minus operations on clobs. How can I do this?
TITLE: How do I compare two CLOB values in Oracle QUESTION: I have two tables I would like to complare. One of the columns is type CLOB. I would like to do something like this: select key, clob_value source_table minus select key, clob_value target_table Unfortunately, Oracle can't perform minus operations on clobs. H...
[ "sql", "oracle" ]
8
17
25,278
2
0
2008-09-17T17:35:42.423000
2008-09-17T17:41:29.180000
85,699
85,759
What's the best way to model recurring events in a calendar application?
I'm building a group calendar application that needs to support recurring events, but all the solutions I've come up with to handle these events seem like a hack. I can limit how far ahead one can look, and then generate all the events at once. Or I can store the events as repeating and dynamically display them when on...
I would use a 'link' concept for all future recurring events. They are dynamically displayed in the calendar and link back to a single reference object. When events have taken place the link is broken and the event becomes a standalone instance. If you attempt to edit a recurring event then prompt to change all future ...
What's the best way to model recurring events in a calendar application? I'm building a group calendar application that needs to support recurring events, but all the solutions I've come up with to handle these events seem like a hack. I can limit how far ahead one can look, and then generate all the events at once. Or...
TITLE: What's the best way to model recurring events in a calendar application? QUESTION: I'm building a group calendar application that needs to support recurring events, but all the solutions I've come up with to handle these events seem like a hack. I can limit how far ahead one can look, and then generate all the ...
[ "ruby", "algorithm", "calendar", "data-modeling", "recurrence" ]
252
108
76,170
17
0
2008-09-17T17:37:44.417000
2008-09-17T17:45:23.977000
85,702
85,706
How can I make a ComboBox non-editable in .NET?
I want to have a "select-only" ComboBox that provides a list of items for the user to select from. Typing should be disabled in the text portion of the ComboBox control. My initial googling of this turned up an overly complex, misguided suggestion to capture the KeyPress event.
To make the text portion of a ComboBox non-editable, set the DropDownStyle property to "DropDownList". The ComboBox is now essentially select-only for the user. You can do this in the Visual Studio designer, or in C# like this: stateComboBox.DropDownStyle = ComboBoxStyle.DropDownList; Link to the documentation for the ...
How can I make a ComboBox non-editable in .NET? I want to have a "select-only" ComboBox that provides a list of items for the user to select from. Typing should be disabled in the text portion of the ComboBox control. My initial googling of this turned up an overly complex, misguided suggestion to capture the KeyPress ...
TITLE: How can I make a ComboBox non-editable in .NET? QUESTION: I want to have a "select-only" ComboBox that provides a list of items for the user to select from. Typing should be disabled in the text portion of the ComboBox control. My initial googling of this turned up an overly complex, misguided suggestion to cap...
[ "c#", ".net", "winforms", "combobox" ]
230
427
246,257
7
0
2008-09-17T17:37:52.200000
2008-09-17T17:38:14.650000
85,724
85,949
Monitoring group membership in Active Directory more efficiently (C# .NET)
I've got an Active Directory synchronization tool (.NET 2.0 / C#) written as a Windows Service that I've been working on for a while and have recently been tasked with adding the ability to drive events based on changes in group membership. The basic scenario is that users are synchronized with a security database and,...
I'd say it depends on how many active directory objects you need to keep track of. If it's a small number (less than 1000 users) you can probably serialize your state data to disk with little noticable performance hit. If you're dealing with a very large number of objects it might be more efficient to create a simple p...
Monitoring group membership in Active Directory more efficiently (C# .NET) I've got an Active Directory synchronization tool (.NET 2.0 / C#) written as a Windows Service that I've been working on for a while and have recently been tasked with adding the ability to drive events based on changes in group membership. The ...
TITLE: Monitoring group membership in Active Directory more efficiently (C# .NET) QUESTION: I've got an Active Directory synchronization tool (.NET 2.0 / C#) written as a Windows Service that I've been working on for a while and have recently been tasked with adding the ability to drive events based on changes in grou...
[ "c#", ".net", "active-directory" ]
4
1
4,599
3
0
2008-09-17T17:40:44.597000
2008-09-17T18:06:13.740000
85,761
2,767,036
How do you switch on a string in XQuery?
I have an external variable coming in as a string and I would like to do a switch/case on it. How do I do that in xquery?
Starting with XQuery 1.1, use switch: http://www.w3.org/TR/xquery-11/#id-switch switch ($animal) case "Cow" return "Moo" case "Cat" return "Meow" case "Duck" return "Quack" default return "What's that odd noise?"
How do you switch on a string in XQuery? I have an external variable coming in as a string and I would like to do a switch/case on it. How do I do that in xquery?
TITLE: How do you switch on a string in XQuery? QUESTION: I have an external variable coming in as a string and I would like to do a switch/case on it. How do I do that in xquery? ANSWER: Starting with XQuery 1.1, use switch: http://www.w3.org/TR/xquery-11/#id-switch switch ($animal) case "Cow" return "Moo" case "Cat...
[ "xml", "switch-statement", "xquery", "case" ]
13
25
21,589
5
0
2008-09-17T17:45:31.293000
2010-05-04T16:19:41.650000
85,770
85,792
How to sort an array by keys in an ascending direction?
here is the input i am getting from my flash file process.php?Q2=898&Aa=Grade1&Tim=0%3A0%3A12&Q1=908&Bb=lkj&Q4=jhj&Q3=08&Cc=North%20America&Q0=1 and in php i use this code foreach ($_GET as $field => $label) { $datarray[]=$_GET[$field]; echo "$field:"; echo $_GET[$field];; echo " "; i get this out put Q2:898 Aa:Grade1 ...
ksort($_GET); This should ksort the $_GET array by it's keys. krsort for reverse order.
How to sort an array by keys in an ascending direction? here is the input i am getting from my flash file process.php?Q2=898&Aa=Grade1&Tim=0%3A0%3A12&Q1=908&Bb=lkj&Q4=jhj&Q3=08&Cc=North%20America&Q0=1 and in php i use this code foreach ($_GET as $field => $label) { $datarray[]=$_GET[$field]; echo "$field:"; echo $_GET[...
TITLE: How to sort an array by keys in an ascending direction? QUESTION: here is the input i am getting from my flash file process.php?Q2=898&Aa=Grade1&Tim=0%3A0%3A12&Q1=908&Bb=lkj&Q4=jhj&Q3=08&Cc=North%20America&Q0=1 and in php i use this code foreach ($_GET as $field => $label) { $datarray[]=$_GET[$field]; echo "$fi...
[ "php", "arrays", "sorting", "query-string" ]
1
6
1,975
3
0
2008-09-17T17:46:33.147000
2008-09-17T17:48:40.397000
85,773
85,902
How should I write code with unique sections for different versions of .NET
My source code needs to support both.NET version 1.1 and 2.0... how do I test for the different versions & what is the best way to deal with this situation. I'm wondering if I should have the two sections of code inline, in separate classes, methods etc. What do you think?
If you want to do something like this you will need to use preprocessor commands and conditional compilation symbols. I would use symbols that clearly indicate the version of.NET you are targeting (say NET11 and NET20) and then wrap the relevant code like this: #if NET11 //.NET 1.1 code #elif NET20 //.NET 2.0 code #end...
How should I write code with unique sections for different versions of .NET My source code needs to support both.NET version 1.1 and 2.0... how do I test for the different versions & what is the best way to deal with this situation. I'm wondering if I should have the two sections of code inline, in separate classes, me...
TITLE: How should I write code with unique sections for different versions of .NET QUESTION: My source code needs to support both.NET version 1.1 and 2.0... how do I test for the different versions & what is the best way to deal with this situation. I'm wondering if I should have the two sections of code inline, in se...
[ "c#", ".net", "c-preprocessor" ]
1
1
297
4
0
2008-09-17T17:46:54.177000
2008-09-17T18:00:11.367000
85,804
86,739
Dropping a connected user from an Oracle 10g database schema
Is there a better way to forcefully disconnect all users from an Oracle 10g database schema than restarting the Oracle database services? We have several developers using SQL Developer connecting to the same schema on a single Oracle 10g server. The problem is that when we want to drop the schema to rebuild it, inevita...
To find the sessions, as a DBA use select sid,serial# from v$session where username = ' ' If you want to be sure only to get the sessions that use SQL Developer, you can add and program = 'SQL Developer'. If you only want to kill sessions belonging to a specific developer, you can add a restriction on os_user Then kill...
Dropping a connected user from an Oracle 10g database schema Is there a better way to forcefully disconnect all users from an Oracle 10g database schema than restarting the Oracle database services? We have several developers using SQL Developer connecting to the same schema on a single Oracle 10g server. The problem i...
TITLE: Dropping a connected user from an Oracle 10g database schema QUESTION: Is there a better way to forcefully disconnect all users from an Oracle 10g database schema than restarting the Oracle database services? We have several developers using SQL Developer connecting to the same schema on a single Oracle 10g ser...
[ "oracle" ]
71
121
159,470
6
0
2008-09-17T17:49:32.890000
2008-09-17T19:33:17.913000
85,866
85,915
C# component do not refresh when source code updated
I have a solution with many projects. One project contain few custom components. One of these components is used to display a title on an image. We can change the color of the background and many other things. The problem is IF I decide to change the default color of the background of the component or change the positi...
This is most likely due to references. Your other projects probably copy in a reference to your component project. You'll have to rebuild these other projects for them to re-copy in the referenced component project, if it has changed. It is only updated at build time. You can somewhat get around this by having them par...
C# component do not refresh when source code updated I have a solution with many projects. One project contain few custom components. One of these components is used to display a title on an image. We can change the color of the background and many other things. The problem is IF I decide to change the default color of...
TITLE: C# component do not refresh when source code updated QUESTION: I have a solution with many projects. One project contain few custom components. One of these components is used to display a title on an image. We can change the color of the background and many other things. The problem is IF I decide to change th...
[ "c#", ".net", "custom-component" ]
1
1
3,661
5
0
2008-09-17T17:56:14.543000
2008-09-17T18:01:38.290000
85,880
85,903
Determine if a function exists in bash
Currently I'm doing some unit tests which are executed from bash. Unit tests are initialized, executed and cleaned up in a bash script. This script usualy contains an init(), execute() and cleanup() functions. But they are not mandatory. I'd like to test if they are or are not defined. I did this previously by greping ...
Like this: [[ $(type -t foo) == function ]] && echo "Foo exists" The built-in type command will tell you whether something is a function, built-in function, external command, or just not defined. Additional examples: $ LC_ALL=C type foo bash: type: foo: not found $ LC_ALL=C type ls ls is aliased to `ls --color=auto' ...
Determine if a function exists in bash Currently I'm doing some unit tests which are executed from bash. Unit tests are initialized, executed and cleaned up in a bash script. This script usualy contains an init(), execute() and cleanup() functions. But they are not mandatory. I'd like to test if they are or are not def...
TITLE: Determine if a function exists in bash QUESTION: Currently I'm doing some unit tests which are executed from bash. Unit tests are initialized, executed and cleaned up in a bash script. This script usualy contains an init(), execute() and cleanup() functions. But they are not mandatory. I'd like to test if they ...
[ "bash", "function", "testing", "scripting" ]
253
269
102,596
15
0
2008-09-17T17:57:38.300000
2008-09-17T18:00:15.283000
85,887
85,945
How can I reimplement external pop-up jQuery code in Prototype?
I have this code in jQuery, that I want to reimplement with the prototype library. // make external links open in popups // this will apply a window.open() behaviour to all anchor links // the not() functions filter iteratively filter out http://www.foo.com // and http://foo.com so they don't trigger off the pop-ups j...
The filtering can be done using the reject method like so: $$('a').reject(function(element) { return element.getAttribute("href").match(/http:\/\/(www.|)foo.com/); }).invoke("addClassName", "external");
How can I reimplement external pop-up jQuery code in Prototype? I have this code in jQuery, that I want to reimplement with the prototype library. // make external links open in popups // this will apply a window.open() behaviour to all anchor links // the not() functions filter iteratively filter out http://www.foo.co...
TITLE: How can I reimplement external pop-up jQuery code in Prototype? QUESTION: I have this code in jQuery, that I want to reimplement with the prototype library. // make external links open in popups // this will apply a window.open() behaviour to all anchor links // the not() functions filter iteratively filter out...
[ "javascript", "jquery", "popup", "prototypejs" ]
1
4
1,347
1
0
2008-09-17T17:58:15.163000
2008-09-17T18:05:22.353000
85,892
85,914
Collection initialization syntax in Visual Basic 2008?
I'm trying to determine if there's a way in Visual Basic 2008 (Express edition if that matters) to do inline collection initialization, a la JavaScript or Python: Dim oMapping As Dictionary(Of Integer, String) = {{1,"First"}, {2, "Second"}} I know Visual Basic 2008 supports array initialization like this, but I can't s...
Visual Basic 9.0 doesn't support this yet. However, Visual Basic 10.0 will.
Collection initialization syntax in Visual Basic 2008? I'm trying to determine if there's a way in Visual Basic 2008 (Express edition if that matters) to do inline collection initialization, a la JavaScript or Python: Dim oMapping As Dictionary(Of Integer, String) = {{1,"First"}, {2, "Second"}} I know Visual Basic 2008...
TITLE: Collection initialization syntax in Visual Basic 2008? QUESTION: I'm trying to determine if there's a way in Visual Basic 2008 (Express edition if that matters) to do inline collection initialization, a la JavaScript or Python: Dim oMapping As Dictionary(Of Integer, String) = {{1,"First"}, {2, "Second"}} I know...
[ "vb.net", "visual-studio-2008", "collections", "initialization" ]
24
19
6,902
2
0
2008-09-17T17:58:36.130000
2008-09-17T18:01:26.637000
85,916
486,371
Is there a tutorial that teaches common Ruby programming idioms used by experienced programmers, but may not be obvious to newcomers?
I'm looking for a Ruby's equivalent of Code Like a Pythonista: Idiomatic Python Desirable features: easy to read single document which covers all topics: tips, tricks, guidelines, caveats, and pitfalls size less than a book idioms should work out of the box for the standard distribution ( % sudo apt-get install ruby ir...
Ruby Idioms (originally from RubyGarden) is my usual reference for idioms. It's clearly organized and fairly complete. As the author says, these are from RubyGarden, which used to be really cool (thanks Wayback Machine ). But now seems to be offline.
Is there a tutorial that teaches common Ruby programming idioms used by experienced programmers, but may not be obvious to newcomers? I'm looking for a Ruby's equivalent of Code Like a Pythonista: Idiomatic Python Desirable features: easy to read single document which covers all topics: tips, tricks, guidelines, caveat...
TITLE: Is there a tutorial that teaches common Ruby programming idioms used by experienced programmers, but may not be obvious to newcomers? QUESTION: I'm looking for a Ruby's equivalent of Code Like a Pythonista: Idiomatic Python Desirable features: easy to read single document which covers all topics: tips, tricks, ...
[ "ruby", "idioms" ]
30
12
1,840
8
0
2008-09-17T18:01:42.860000
2009-01-28T03:21:49.197000
85,923
94,988
XML Notepad 2007 breaks MS Access 2007 Help
I tried scouring the web for help on this issue, but there are so many generic words in there, that I couldn't find much of anything that was relevant. I have MS Office 2007 installed on Vista and later installed XML Notepad 2007 (also a Microsoft product). It seems that the MS Access help system is using some sort of ...
Okay, I found the answer and I'm a little embarrassed by it. In fact, my question was pretty much off the mark. First, there is no involvement in this problem with XML Notepad 2007. It didn't hijack a file extension or make a registry entry or anything else like that. It's a great little program if you just want to ope...
XML Notepad 2007 breaks MS Access 2007 Help I tried scouring the web for help on this issue, but there are so many generic words in there, that I couldn't find much of anything that was relevant. I have MS Office 2007 installed on Vista and later installed XML Notepad 2007 (also a Microsoft product). It seems that the ...
TITLE: XML Notepad 2007 breaks MS Access 2007 Help QUESTION: I tried scouring the web for help on this issue, but there are so many generic words in there, that I couldn't find much of anything that was relevant. I have MS Office 2007 installed on Vista and later installed XML Notepad 2007 (also a Microsoft product). ...
[ "xml", "ms-office" ]
0
2
950
2
0
2008-09-17T18:02:48.023000
2008-09-18T17:57:54.670000
85,925
86,291
Multiple Forms and a Single Update,Will it work?
I need to make an application in.NET CF with different/single forms with a lot of drawing/animation on each forms.I would prefer to have a single update[my own for state management and so on] function so that i can manage the different states, so that my [J2ME Gaming Code] will work without much changes.I have came to ...
If its a game then i'd drop most of the forms and work with the bare essentials, work off a bitmap if possible and render that by either overriding the main form's paint method or a control that resides within it (perhaps a panel). That will give you better performance. The main issue is that the compact framework isn'...
Multiple Forms and a Single Update,Will it work? I need to make an application in.NET CF with different/single forms with a lot of drawing/animation on each forms.I would prefer to have a single update[my own for state management and so on] function so that i can manage the different states, so that my [J2ME Gaming Cod...
TITLE: Multiple Forms and a Single Update,Will it work? QUESTION: I need to make an application in.NET CF with different/single forms with a lot of drawing/animation on each forms.I would prefer to have a single update[my own for state management and so on] function so that i can manage the different states, so that m...
[ "c#", ".net", "compact-framework" ]
0
1
472
1
0
2008-09-17T18:02:56.727000
2008-09-17T18:46:27.310000
85,928
85,971
How to Autogenerate multiple getters/setters or accessors in Visual Studio
Before I start, I know there is this post and it doesn't answer my question: How to generate getters and setters in Visual Studio? In Visual Studio 2008 there is the ability to auto generate getters and setters (accessors) by right clicking on a private variable -> Refactor -> Encapsulate Field... This is great for a c...
Sorry, you really need to install Resharper to get approximately the same amount of refactoring support as you are used to in Eclipse. However, Resharper gives you a dialog very similar to the one you are used to in Eclipse:
How to Autogenerate multiple getters/setters or accessors in Visual Studio Before I start, I know there is this post and it doesn't answer my question: How to generate getters and setters in Visual Studio? In Visual Studio 2008 there is the ability to auto generate getters and setters (accessors) by right clicking on a...
TITLE: How to Autogenerate multiple getters/setters or accessors in Visual Studio QUESTION: Before I start, I know there is this post and it doesn't answer my question: How to generate getters and setters in Visual Studio? In Visual Studio 2008 there is the ability to auto generate getters and setters (accessors) by r...
[ "visual-studio", "visual-studio-2008", "ide", "code-generation" ]
5
10
25,565
4
0
2008-09-17T18:03:18.567000
2008-09-17T18:08:15.497000
85,935
85,970
How do I export styles from a Microsoft Word 2003 .dot file?
I have an old.dot file with a few dozen styles in it. I need to place them into another.dot file that I received. Is there a better way to get them in there than manually recreating each style?
There is a 'Style Organizer' tool within Word which will let you copy styles from one document to another if they are both open at once. In Word 2007: Open the styles dialog (Home tab -> Styles -> Bottom Right button). Click the 'manage styles' button. Click 'Import/Export...' I can't remember what the option is in Wor...
How do I export styles from a Microsoft Word 2003 .dot file? I have an old.dot file with a few dozen styles in it. I need to place them into another.dot file that I received. Is there a better way to get them in there than manually recreating each style?
TITLE: How do I export styles from a Microsoft Word 2003 .dot file? QUESTION: I have an old.dot file with a few dozen styles in it. I need to place them into another.dot file that I received. Is there a better way to get them in there than manually recreating each style? ANSWER: There is a 'Style Organizer' tool with...
[ "ms-word" ]
7
5
9,849
5
0
2008-09-17T18:04:24.773000
2008-09-17T18:08:02.597000
85,941
85,956
ASPNET user does not have write access to Temporary ASP.NET Files
I get the following error when running my Visual Studio 2008 ASP.NET project (start without Debugging) on my XP Professional box: System.Web.HttpException: The current identity (machinename\ASPNET) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'. How can I resolve t...
Have you tried, the aspnet_regiis exe in the framework folder?
ASPNET user does not have write access to Temporary ASP.NET Files I get the following error when running my Visual Studio 2008 ASP.NET project (start without Debugging) on my XP Professional box: System.Web.HttpException: The current identity (machinename\ASPNET) does not have write access to 'C:\WINDOWS\Microsoft.NET\...
TITLE: ASPNET user does not have write access to Temporary ASP.NET Files QUESTION: I get the following error when running my Visual Studio 2008 ASP.NET project (start without Debugging) on my XP Professional box: System.Web.HttpException: The current identity (machinename\ASPNET) does not have write access to 'C:\WIND...
[ "asp.net", "visual-studio-2008", "iis-5" ]
8
15
51,063
8
0
2008-09-17T18:04:56.427000
2008-09-17T18:06:34.177000
85,974
86,004
how to sort a flex datagrid according to multiple columns?
I have a datagrid, populated as shown below. When the user clicks on a column header, I would like to sort the rows using a lexicographic sort in which the selected column is used first, then the remaining columns are used in left-to-right order to break any ties. How can I code this? (I have one answer, which I'll pos...
The best answer I've found so far is to capture the headerRelease event when the user clicks: The event handler can then apply a sort order to the data: private var lastIndex:int = -1; private var desc:Boolean = false; public function onHeaderRelease(evt:DataGridEvent):void { evt.preventDefault(); var srt:Sort = new ...
how to sort a flex datagrid according to multiple columns? I have a datagrid, populated as shown below. When the user clicks on a column header, I would like to sort the rows using a lexicographic sort in which the selected column is used first, then the remaining columns are used in left-to-right order to break any ti...
TITLE: how to sort a flex datagrid according to multiple columns? QUESTION: I have a datagrid, populated as shown below. When the user clicks on a column header, I would like to sort the rows using a lexicographic sort in which the selected column is used first, then the remaining columns are used in left-to-right ord...
[ "apache-flex", "actionscript-3", "datagrid" ]
8
12
11,937
1
0
2008-09-17T18:08:42.203000
2008-09-17T18:11:21.997000
85,978
86,104
Query a Table's Foreign Key relationships
For a given table 'foo', I need a query to generate a set of tables that have foreign keys that point to foo. I'm using Oracle 10G.
This should work (or something close): select table_name from all_constraints where constraint_type='R' and r_constraint_name in (select constraint_name from all_constraints where constraint_type in ('P','U') and table_name=' ');
Query a Table's Foreign Key relationships For a given table 'foo', I need a query to generate a set of tables that have foreign keys that point to foo. I'm using Oracle 10G.
TITLE: Query a Table's Foreign Key relationships QUESTION: For a given table 'foo', I need a query to generate a set of tables that have foreign keys that point to foo. I'm using Oracle 10G. ANSWER: This should work (or something close): select table_name from all_constraints where constraint_type='R' and r_constrain...
[ "sql", "database", "oracle", "oracle10g" ]
26
46
65,468
10
0
2008-09-17T18:09:05.497000
2008-09-17T18:21:55.323000
85,985
86,050
How to best implement simple crash / error reporting?
What would be the best way to implement a simple crash / error reporting mechanism? Details: my app is cross-platform (mac/windows/linux) and written in Python, so I just need something that will send me a small amount of text, e.g. just a timestamp and a traceback (which I already generate and show in my error dialog)...
The web service is the best way, but there are some caveats: You should always ask the user if it is ok to send error feedback information. You should be prepared to fail gracefully if there are network errors. Don't let a failure to report a crash impede recovery! You should avoid including user identifying or sensiti...
How to best implement simple crash / error reporting? What would be the best way to implement a simple crash / error reporting mechanism? Details: my app is cross-platform (mac/windows/linux) and written in Python, so I just need something that will send me a small amount of text, e.g. just a timestamp and a traceback ...
TITLE: How to best implement simple crash / error reporting? QUESTION: What would be the best way to implement a simple crash / error reporting mechanism? Details: my app is cross-platform (mac/windows/linux) and written in Python, so I just need something that will send me a small amount of text, e.g. just a timestam...
[ "python", "cross-platform", "error-reporting" ]
8
6
1,595
6
0
2008-09-17T18:09:32.937000
2008-09-17T18:16:02.343000
85,992
86,014
How do I enumerate the properties of a JavaScript object?
How do I enumerate the properties of a JavaScript object? I actually want to list all the defined variables and their values, but I've learned that defining a variable actually creates a property of the window object.
Simple enough: for(var propertyName in myObject) { // propertyName is what you want // you can get the value like this: myObject[propertyName] } Now, you will not get private variables this way because they are not available. EDIT: @bitwiseplatypus is correct that unless you use the hasOwnProperty() method, you will ge...
How do I enumerate the properties of a JavaScript object? How do I enumerate the properties of a JavaScript object? I actually want to list all the defined variables and their values, but I've learned that defining a variable actually creates a property of the window object.
TITLE: How do I enumerate the properties of a JavaScript object? QUESTION: How do I enumerate the properties of a JavaScript object? I actually want to list all the defined variables and their values, but I've learned that defining a variable actually creates a property of the window object. ANSWER: Simple enough: fo...
[ "javascript", "properties" ]
725
897
625,991
14
0
2008-09-17T18:10:18.380000
2008-09-17T18:12:21.650000
85,994
86,038
How do you keep a personal wiki (TiddlyWiki) current and in sync in multiple locations?
If one were to use TiddlyWiki as a personal database for notes and code snippets, how would you go about keeping it in sync between multiple machines. Would a svn/cvs etc work. How would you handle merges?
These options are all good, but I would just put it on a USB key.
How do you keep a personal wiki (TiddlyWiki) current and in sync in multiple locations? If one were to use TiddlyWiki as a personal database for notes and code snippets, how would you go about keeping it in sync between multiple machines. Would a svn/cvs etc work. How would you handle merges?
TITLE: How do you keep a personal wiki (TiddlyWiki) current and in sync in multiple locations? QUESTION: If one were to use TiddlyWiki as a personal database for notes and code snippets, how would you go about keeping it in sync between multiple machines. Would a svn/cvs etc work. How would you handle merges? ANSWER:...
[ "project-management", "development-environment", "wiki", "tiddlywiki" ]
20
3
15,226
13
0
2008-09-17T18:10:23.980000
2008-09-17T18:14:22.720000
85,996
86,016
How do I create a folder in VB if it doesn't exist?
I wrote myself a little downloading application so that I could easily grab a set of files from my server and put them all onto a new pc with a clean install of Windows, without actually going on the net. Unfortunately I'm having problems creating the folder I want to put them in and am unsure how to go about it. I wan...
If Not System.IO.Directory.Exists(YourPath) Then System.IO.Directory.CreateDirectory(YourPath) End If
How do I create a folder in VB if it doesn't exist? I wrote myself a little downloading application so that I could easily grab a set of files from my server and put them all onto a new pc with a clean install of Windows, without actually going on the net. Unfortunately I'm having problems creating the folder I want to...
TITLE: How do I create a folder in VB if it doesn't exist? QUESTION: I wrote myself a little downloading application so that I could easily grab a set of files from my server and put them all onto a new pc with a clean install of Windows, without actually going on the net. Unfortunately I'm having problems creating th...
[ "vb.net", "installation", "directory" ]
68
193
332,309
12
0
2008-09-17T18:10:25.570000
2008-09-17T18:12:41.243000
86,002
87,306
In Delphi, how can you have currency data types shown in different currencies in different forms?
I need to write a Delphi application that pulls entries up from various tables in a database, and different entries will be in different currencies. Thus, I need to show a different number of decimal places and a different currency character for every Currency data type ($, Pounds, Euros, etc) depending on the currency...
Even with the same currency, you may have to display values with a different format (separators for instance), so I would recommend that you associate a LOCALE instead of the currency only with your values. You can use a simple Integer to hold the LCID (locale ID). See the list here: http://msdn.microsoft.com/en-us/lib...
In Delphi, how can you have currency data types shown in different currencies in different forms? I need to write a Delphi application that pulls entries up from various tables in a database, and different entries will be in different currencies. Thus, I need to show a different number of decimal places and a different...
TITLE: In Delphi, how can you have currency data types shown in different currencies in different forms? QUESTION: I need to write a Delphi application that pulls entries up from various tables in a database, and different entries will be in different currencies. Thus, I need to show a different number of decimal plac...
[ "delphi", "finance" ]
7
7
3,157
2
0
2008-09-17T18:10:52.200000
2008-09-17T20:31:42.860000
86,008
86,156
Measure Total Network Transfer Time from Servlets
How do i measure how long a client has to wait for a request. On the server side it is easy, through a filter for example. But if we want to take into accout the total time including latency and data transfer, it gets diffcult. is it possible to access the underlying socket to see when the request is finished? or is it...
There's no way you can know how long the client had to wait purely from the server side. You'll need some JavaScript. You don't want to synchronize the client and server clocks, that's overkill. Just measure the time between when the client makes the request, and when it finishes displaying its response. If the client ...
Measure Total Network Transfer Time from Servlets How do i measure how long a client has to wait for a request. On the server side it is easy, through a filter for example. But if we want to take into accout the total time including latency and data transfer, it gets diffcult. is it possible to access the underlying so...
TITLE: Measure Total Network Transfer Time from Servlets QUESTION: How do i measure how long a client has to wait for a request. On the server side it is easy, through a filter for example. But if we want to take into accout the total time including latency and data transfer, it gets diffcult. is it possible to access...
[ "java", "tomcat", "servlets", "time", "sockets" ]
3
3
2,325
6
0
2008-09-17T18:11:54.770000
2008-09-17T18:28:51.640000
86,018
86,457
What is the best method for storing SASS generated CSS in your application and source control?
If you are using HAML and SASS in your Rails application, then any templates you define in public/stylesheet/*.sass will be compiled into *.css stylesheets. From your code, you use stylesheet_link_tag to pull in the asset by name without having to worry about the extension. Many people dislike storing generated code or...
I always version all stylesheets in "public/stylesheets/sass/*.sass" and set up an exclude filter for compiled ones: /public/stylesheets/*.css
What is the best method for storing SASS generated CSS in your application and source control? If you are using HAML and SASS in your Rails application, then any templates you define in public/stylesheet/*.sass will be compiled into *.css stylesheets. From your code, you use stylesheet_link_tag to pull in the asset by ...
TITLE: What is the best method for storing SASS generated CSS in your application and source control? QUESTION: If you are using HAML and SASS in your Rails application, then any templates you define in public/stylesheet/*.sass will be compiled into *.css stylesheets. From your code, you use stylesheet_link_tag to pul...
[ "ruby-on-rails", "haml", "sass" ]
21
11
3,062
5
0
2008-09-17T18:12:51.603000
2008-09-17T19:02:45.477000
86,027
91,093
How can I use classes from VisualBasic-Express in VBA for Excel or Access projects?
I saved my VB-Express code as.dll and registered it with regasm and made a.tlb file. But when I try to run a function from it in an Excel-modul I get: Run-time error ‘453’: Can’t find DLL entry point RegisterServiceProcess in kernel32 What step did I miss?
See http://richnewman.wordpress.com/2007/04/15/a-beginner ’s-guide-to-calling-a-net-library-from-excel/ or better still try out ExcelDNA ( http://groups.google.com/group/ExcelDna )
How can I use classes from VisualBasic-Express in VBA for Excel or Access projects? I saved my VB-Express code as.dll and registered it with regasm and made a.tlb file. But when I try to run a function from it in an Excel-modul I get: Run-time error ‘453’: Can’t find DLL entry point RegisterServiceProcess in kernel32 W...
TITLE: How can I use classes from VisualBasic-Express in VBA for Excel or Access projects? QUESTION: I saved my VB-Express code as.dll and registered it with regasm and made a.tlb file. But when I try to run a function from it in an Excel-modul I get: Run-time error ‘453’: Can’t find DLL entry point RegisterServicePro...
[ "excel", "dll", "com-interop", "vba" ]
1
2
1,122
4
0
2008-09-17T18:13:22.943000
2008-09-18T09:08:25.117000
86,030
90,910
How much success is there working on ASP.NET decompiled by Reflector?
I just finished a small project where changes were required to a pre-compiled, but no longer supported, ASP.NET web site. The code was ugly, but it was ugly before it was even compiled, and I'm quite impressed that everything still seems to work fine. It took some editing, e.g. to remove control declarations, as they g...
Will: Due to all the compiler sugar that exists in the.NET platform Fortunately this particular application was incredibly simple, but I don't expect to decompile into the original code, just into code works like the original, or maybe even provides an insight into how the original works, to allow 'splicing' in of new ...
How much success is there working on ASP.NET decompiled by Reflector? I just finished a small project where changes were required to a pre-compiled, but no longer supported, ASP.NET web site. The code was ugly, but it was ugly before it was even compiled, and I'm quite impressed that everything still seems to work fine...
TITLE: How much success is there working on ASP.NET decompiled by Reflector? QUESTION: I just finished a small project where changes were required to a pre-compiled, but no longer supported, ASP.NET web site. The code was ugly, but it was ugly before it was even compiled, and I'm quite impressed that everything still ...
[ "asp.net", "decompiling", "reflector" ]
0
1
1,022
4
0
2008-09-17T18:13:42.380000
2008-09-18T08:21:59.110000
86,033
86,159
How do I make a Microsoft Word document “read only” within a SharePoint document library?
How do I make open “read only” the only option within a SharePoint document library? When using either Word 2003 or 2007 and saving the document as a template or modifying the file properties as “read only” doesn’t prevent modification of the file in a SharePoint document library. Modifying the document library permiss...
I don't know if you can force read only to be the only option, but you can implement your own event handler to override the ItemUpdating event. Just cancel the update and any changes will be discarded. Sahil shows a very basic event handler that performs the cancel here.
How do I make a Microsoft Word document “read only” within a SharePoint document library? How do I make open “read only” the only option within a SharePoint document library? When using either Word 2003 or 2007 and saving the document as a template or modifying the file properties as “read only” doesn’t prevent modific...
TITLE: How do I make a Microsoft Word document “read only” within a SharePoint document library? QUESTION: How do I make open “read only” the only option within a SharePoint document library? When using either Word 2003 or 2007 and saving the document as a template or modifying the file properties as “read only” doesn...
[ "asp.net", "visual-studio-2008", "sharepoint" ]
1
2
9,579
2
0
2008-09-17T18:13:49.180000
2008-09-17T18:29:17.460000
86,046
86,146
Best way to start a thread as a member of a C++ class?
I'm wondering the best way to start a pthread that is a member of a C++ class? My own approach follows as an answer...
I usually use a static member function of the class, and use a pointer to the class as the void * parameter. That function can then either perform thread processing, or call another non-static member function with the class reference. That function can then reference all class members without awkward syntax.
Best way to start a thread as a member of a C++ class? I'm wondering the best way to start a pthread that is a member of a C++ class? My own approach follows as an answer...
TITLE: Best way to start a thread as a member of a C++ class? QUESTION: I'm wondering the best way to start a pthread that is a member of a C++ class? My own approach follows as an answer... ANSWER: I usually use a static member function of the class, and use a pointer to the class as the void * parameter. That funct...
[ "c++", "pthreads" ]
16
15
20,095
5
0
2008-09-17T18:15:37.290000
2008-09-17T18:27:15.017000
86,047
88,676
Why does Imake interpret certain words in a Imakefile to numerical values?
I've found it very difficult to find any existing documentation on this. What I'm trying to find out is why Imake would interpret a word such as unix, linux or i386 to a number 1 in the produced Make-file? I'm sure it is a function of indicating whether or not your on that system or not. I've not been able to find that...
imake produces Makefiles by running cpp, the C preprocessor, which usually has a variety of builtin definitions. You can get a list by running gcc -E -dM emptyfile.c
Why does Imake interpret certain words in a Imakefile to numerical values? I've found it very difficult to find any existing documentation on this. What I'm trying to find out is why Imake would interpret a word such as unix, linux or i386 to a number 1 in the produced Make-file? I'm sure it is a function of indicating...
TITLE: Why does Imake interpret certain words in a Imakefile to numerical values? QUESTION: I've found it very difficult to find any existing documentation on this. What I'm trying to find out is why Imake would interpret a word such as unix, linux or i386 to a number 1 in the produced Make-file? I'm sure it is a func...
[ "linux", "unix", "makefile" ]
1
2
199
1
0
2008-09-17T18:15:42.937000
2008-09-17T23:27:38.693000
86,049
86,052
How do I ignore files in Subversion?
How do I ignore files in Subversion? Also, how do I find files which are not under version control?
(This answer has been updated to match SVN 1.8 and 1.9's behaviour) You have 2 questions: Marking files as ignored: By "ignored file" I mean the file won't appear in lists even as "unversioned": your SVN client will pretend the file doesn't exist at all in the filesystem. Ignored files are specified by a "file pattern"...
How do I ignore files in Subversion? How do I ignore files in Subversion? Also, how do I find files which are not under version control?
TITLE: How do I ignore files in Subversion? QUESTION: How do I ignore files in Subversion? Also, how do I find files which are not under version control? ANSWER: (This answer has been updated to match SVN 1.8 and 1.9's behaviour) You have 2 questions: Marking files as ignored: By "ignored file" I mean the file won't ...
[ "svn", "command" ]
717
804
686,555
18
0
2008-09-17T18:15:55.807000
2008-09-17T18:16:07.227000
86,090
86,198
OpenID providers - what stops malicious providers?
So I like the OpenID idea. I support it on my site, and use it wherever it's possible (like here!). But I am not clear about one thing. A site that supports OpenID basically accepts any OpenID provider out there, right? How does that work with sites that want to reduce bot-signups? What's to stop a malicious OpenID pro...
You have confused two different things - identification and authorization. Just because you know who somebody is, it doesn't mean you have to automatically give them permission to do anything. Simon Willison covers this nicely in An OpenID is not an account! More discussion on whitelisting is available in Social whitel...
OpenID providers - what stops malicious providers? So I like the OpenID idea. I support it on my site, and use it wherever it's possible (like here!). But I am not clear about one thing. A site that supports OpenID basically accepts any OpenID provider out there, right? How does that work with sites that want to reduce...
TITLE: OpenID providers - what stops malicious providers? QUESTION: So I like the OpenID idea. I support it on my site, and use it wherever it's possible (like here!). But I am not clear about one thing. A site that supports OpenID basically accepts any OpenID provider out there, right? How does that work with sites t...
[ "security", "openid" ]
16
13
949
6
0
2008-09-17T18:19:55.237000
2008-09-17T18:35:13.403000
86,096
86,108
How do I disable a button cell in a WinForms DataGrid?
I have a WinForms application with a DataGridView control and a column of DataGridViewButtonCell cells within that. When I click on one of these buttons, it starts a background task, and I'd like to disable the buttons until that task completes. I can disable the DataGridView control, but it gives no visual indication ...
Here's the best solution I've found so far. This MSDN article gives the source code for a cell class that adds an Enabled property. It works reasonably well, but there are two gotchas: You have to invalidate the grid after setting the Enabled property on any cells. It shows that in the sample code, but I missed it. It'...
How do I disable a button cell in a WinForms DataGrid? I have a WinForms application with a DataGridView control and a column of DataGridViewButtonCell cells within that. When I click on one of these buttons, it starts a background task, and I'd like to disable the buttons until that task completes. I can disable the D...
TITLE: How do I disable a button cell in a WinForms DataGrid? QUESTION: I have a WinForms application with a DataGridView control and a column of DataGridViewButtonCell cells within that. When I click on one of these buttons, it starts a background task, and I'd like to disable the buttons until that task completes. I...
[ "c#", "winforms", "user-interface" ]
2
3
11,637
2
0
2008-09-17T18:20:30.303000
2008-09-17T18:22:18.413000
86,105
90,811
How can I suppress the browser's authentication dialog?
My web application has a login page that submits authentication credentials via an AJAX call. If the user enters the correct username and password, everything is fine, but if not, the following happens: The web server determines that although the request included a well-formed Authorization header, the credentials in t...
I don't think this is possible -- if you use the browser's HTTP client implementation, it will always pop up that dialog. Two hacks come to mind: Maybe Flash handles this differently (I haven't tried yet), so having a flash movie make the request might help. You can set up a 'proxie' for the service that you're accessi...
How can I suppress the browser's authentication dialog? My web application has a login page that submits authentication credentials via an AJAX call. If the user enters the correct username and password, everything is fine, but if not, the following happens: The web server determines that although the request included ...
TITLE: How can I suppress the browser's authentication dialog? QUESTION: My web application has a login page that submits authentication credentials via an AJAX call. If the user enters the correct username and password, everything is fine, but if not, the following happens: The web server determines that although the...
[ "javascript", "ajax", "http-authentication" ]
94
17
72,028
12
0
2008-09-17T18:22:03.467000
2008-09-18T07:55:54.493000
86,129
86,937
VB6/Microsoft Access/DAO to VB.NET/SQL Server... Got Advice?
I can make a DAO recordset in VB6/Access do anything - add data, clean data, move data, get data dressed in the morning and take it to school. But I don't even know where to start in.NET. I'm not having any problems retrieving data from the database, but what do real people do when they need to edit data and put it bac...
The DataSet class is the place to start. As the linked article says, the steps for creating a DataSet, modifying it, then updating the database are typically: Build and fill each DataTable in a DataSet with data from a data source using a DataAdapter. Change the data in individual DataTable objects by adding, updating,...
VB6/Microsoft Access/DAO to VB.NET/SQL Server... Got Advice? I can make a DAO recordset in VB6/Access do anything - add data, clean data, move data, get data dressed in the morning and take it to school. But I don't even know where to start in.NET. I'm not having any problems retrieving data from the database, but what...
TITLE: VB6/Microsoft Access/DAO to VB.NET/SQL Server... Got Advice? QUESTION: I can make a DAO recordset in VB6/Access do anything - add data, clean data, move data, get data dressed in the morning and take it to school. But I don't even know where to start in.NET. I'm not having any problems retrieving data from the ...
[ "sql-server", "vb.net", "vb6", "dao", "vb6-migration" ]
0
0
3,321
4
0
2008-09-17T18:24:59.280000
2008-09-17T19:51:36.560000
86,138
86,185
What's the best way to get the default printer in .NET
I need to get the default printer name. I'll be using C# but I suspect this is more of a framework question and isn't language specific.
The easiest way I found is to create a new PrinterSettings object. It starts with all default values, so you can check its Name property to get the name of the default printer. PrinterSettings is in System.Drawing.dll in the namespace System.Drawing.Printing. PrinterSettings settings = new PrinterSettings(); Console.Wr...
What's the best way to get the default printer in .NET I need to get the default printer name. I'll be using C# but I suspect this is more of a framework question and isn't language specific.
TITLE: What's the best way to get the default printer in .NET QUESTION: I need to get the default printer name. I'll be using C# but I suspect this is more of a framework question and isn't language specific. ANSWER: The easiest way I found is to create a new PrinterSettings object. It starts with all default values,...
[ ".net" ]
94
154
115,066
7
0
2008-09-17T18:25:41.760000
2008-09-17T18:32:56.343000
86,143
86,168
Help getting .Net WinForms apps to support Vista Aero Glass
There are a couple of tricks for getting glass support for.Net forms. I think the original source for this method is here: http://blogs.msdn.com/tims/archive/2006/04/18/578637.aspx Basically: //reference Desktop Windows Manager (DWM API) [DllImport( "dwmapi.dll" )] static extern void DwmIsCompositionEnabled( ref bool p...
There really isn't an easier way to do this. These APIs are not exposed by the.NET Framework (yet), so the only way to do it is through some kind of interop (or WPF). As for working with both Windows versions, the code you have should be fine, since the runtime does not go looking for the entry point to the DLL until y...
Help getting .Net WinForms apps to support Vista Aero Glass There are a couple of tricks for getting glass support for.Net forms. I think the original source for this method is here: http://blogs.msdn.com/tims/archive/2006/04/18/578637.aspx Basically: //reference Desktop Windows Manager (DWM API) [DllImport( "dwmapi.dl...
TITLE: Help getting .Net WinForms apps to support Vista Aero Glass QUESTION: There are a couple of tricks for getting glass support for.Net forms. I think the original source for this method is here: http://blogs.msdn.com/tims/archive/2006/04/18/578637.aspx Basically: //reference Desktop Windows Manager (DWM API) [Dll...
[ ".net", "winforms", "windows-vista", "aero" ]
4
3
1,949
5
0
2008-09-17T18:26:40.493000
2008-09-17T18:30:30.857000
86,163
101,798
Why do I need a flickr api key?
Reading through the Flickr API documentation it keeps stating I require an API key to use their REST protocols. I am only building a photo viewer, gathering information available from Flickr's public photo feed (For instance, I am not planning on writing an upload script, where a API key would be required). Is there an...
We set up an account and got an API key. The answer to the question is, yes there is advanced functionality with an API key when creating something like a simple photo viewer. The flickr.photos.search command has many more features for reciving an rss feed of images than the Public photo feed, such as only retrieving n...
Why do I need a flickr api key? Reading through the Flickr API documentation it keeps stating I require an API key to use their REST protocols. I am only building a photo viewer, gathering information available from Flickr's public photo feed (For instance, I am not planning on writing an upload script, where a API key...
TITLE: Why do I need a flickr api key? QUESTION: Reading through the Flickr API documentation it keeps stating I require an API key to use their REST protocols. I am only building a photo viewer, gathering information available from Flickr's public photo feed (For instance, I am not planning on writing an upload scrip...
[ "flickr" ]
15
10
14,610
5
0
2008-09-17T18:29:52.670000
2008-09-19T13:27:47.673000
86,171
340,818
How can I improve the performance of the RichFaces ScrollableDataTable control?
First, a little background: I'm displaying a data set with 288 rows and 8 columns (2304 records) using a ScrollableDataTable and the performance leaves a lot to be desired. An AJAX request that rerenders the control takes nearly 20 seconds to complete, compared to 7 seconds when rendering the same data using a DataTabl...
The bottleneck is most likely in the "Render Response" phase of the JSF lifecycle. It's trying to render too many components for the view at one time. My suggestion is to use pagination. It should significantly increase your performance because it's rendering smaller portions of the view at a time. Be sure that your ri...
How can I improve the performance of the RichFaces ScrollableDataTable control? First, a little background: I'm displaying a data set with 288 rows and 8 columns (2304 records) using a ScrollableDataTable and the performance leaves a lot to be desired. An AJAX request that rerenders the control takes nearly 20 seconds ...
TITLE: How can I improve the performance of the RichFaces ScrollableDataTable control? QUESTION: First, a little background: I'm displaying a data set with 288 rows and 8 columns (2304 records) using a ScrollableDataTable and the performance leaves a lot to be desired. An AJAX request that rerenders the control takes ...
[ "jsf", "richfaces" ]
5
1
9,074
3
0
2008-09-17T18:30:40.997000
2008-12-04T14:48:39.727000
86,175
86,874
Where does CGI.pm normally create temporary files?
On all my Windows servers, except for one machine, when I execute the following code to allocate a temporary files folder: use CGI; my $tmpfile = new CGITempFile(1); print "tmpfile='", $tmpfile->as_string(), "'\n"; The variable $tmpfile is assigned the value '.\CGItemp1' and this is what I want. But on one of my server...
The name of the temporary directory is held in $CGITempFile::TMPDIRECTORY and initialised in the find_tempdir function in CGI.pm. The algorithm for choosing the temporary directory is described in the CGI.pm documentation (search for -private_tempfiles ). IIUC, if a C:\Temp folder exists on the server, CGI.pm will use ...
Where does CGI.pm normally create temporary files? On all my Windows servers, except for one machine, when I execute the following code to allocate a temporary files folder: use CGI; my $tmpfile = new CGITempFile(1); print "tmpfile='", $tmpfile->as_string(), "'\n"; The variable $tmpfile is assigned the value '.\CGItemp...
TITLE: Where does CGI.pm normally create temporary files? QUESTION: On all my Windows servers, except for one machine, when I execute the following code to allocate a temporary files folder: use CGI; my $tmpfile = new CGITempFile(1); print "tmpfile='", $tmpfile->as_string(), "'\n"; The variable $tmpfile is assigned th...
[ "perl", "cgi", "activestate" ]
2
8
4,626
3
0
2008-09-17T18:31:38.250000
2008-09-17T19:45:16.887000