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
126,976
126,994
Is there a good description of the "system call" mechanism used in OSes?
I am looking for a good primer or technical description of the System Call mechanism that is used by operating systems to transition from user space to the kernel to invoke functions such as "open", "read", "write", etc... Is there anything other than the Wikipedia entry? Websites, pdfs, books, source code, all are wel...
Well for source code, there are plenty of open source kernels to dive into. As for books, Robert Love's book on the Linux kernel is very informative.
Is there a good description of the "system call" mechanism used in OSes? I am looking for a good primer or technical description of the System Call mechanism that is used by operating systems to transition from user space to the kernel to invoke functions such as "open", "read", "write", etc... Is there anything other ...
TITLE: Is there a good description of the "system call" mechanism used in OSes? QUESTION: I am looking for a good primer or technical description of the System Call mechanism that is used by operating systems to transition from user space to the kernel to invoke functions such as "open", "read", "write", etc... Is the...
[ "documentation", "operating-system", "kernel" ]
0
1
422
6
0
2008-09-24T13:01:02.437000
2008-09-24T13:04:01.650000
126,978
307,139
ORM: Handwritten schema or auto-generated?
Should I use a hand-written schema for my projected developed in a high-level language (such as Python, Ruby) or should I let my ORM solution auto-generate it? Eventually I will need to migrate without destroying all the data. It's okay to be tied to a specific RDBMS but it would be nice if features such as constraints...
I never go with ORM-generated schema. I find that the ways in which the ORM wants to generate the schema are often at total odds with how I want my database to be structured. Also, and I know this is trivial, the nomenclature scheme is usually poor. Database structure has its own constraints, that I find that usually t...
ORM: Handwritten schema or auto-generated? Should I use a hand-written schema for my projected developed in a high-level language (such as Python, Ruby) or should I let my ORM solution auto-generate it? Eventually I will need to migrate without destroying all the data. It's okay to be tied to a specific RDBMS but it wo...
TITLE: ORM: Handwritten schema or auto-generated? QUESTION: Should I use a hand-written schema for my projected developed in a high-level language (such as Python, Ruby) or should I let my ORM solution auto-generate it? Eventually I will need to migrate without destroying all the data. It's okay to be tied to a specif...
[ "orm", "schema", "rdbms" ]
5
3
905
4
0
2008-09-24T13:01:29.770000
2008-11-20T22:35:25.950000
126,979
127,307
XML vs Text for Non-web development applications
I do alot of systems programming where my apps have no chance of being used to communicate over the web or viewed through a browser. But, there has been some push by management to use XML. For example, if I want to keep a time log I could use a text file like this: command date time project in 2008/09/23 08:00:00 PROJ1...
There's absolutely nothing wrong with using text-based data formatting. It has been the de-facto standard for decades. Big huge mainframe financial systems still use it today. The benefits are that it's trivial to produce, trivial to consume and incredibly lightweight. And how about log files? Do you know any productio...
XML vs Text for Non-web development applications I do alot of systems programming where my apps have no chance of being used to communicate over the web or viewed through a browser. But, there has been some push by management to use XML. For example, if I want to keep a time log I could use a text file like this: comma...
TITLE: XML vs Text for Non-web development applications QUESTION: I do alot of systems programming where my apps have no chance of being used to communicate over the web or viewed through a browser. But, there has been some push by management to use XML. For example, if I want to keep a time log I could use a text fil...
[ "xml", "regex", "text" ]
1
2
952
11
0
2008-09-24T13:01:47.040000
2008-09-24T14:00:01.737000
126,987
127,019
Spring.net + Nhibernate Integration Tests Pass When They Should Not
I'm using Spring.net with NHiberante (HibernateTemplate) to implement my DAO's. I also have some integration tests, that extend from 'AbstractTransactionalDbProviderSpringContextTests '. DI is working fine, and all test pass BUT sometimes they pass even when they shouldn't. For example if my hbm.xml files have an error...
If you have a syntax error in your mapping, then NHibernate will fail on config.BuildSessionFactory() But for mispelled/non-existence database objects, the only way for NHibernate to know is to actually run a query... So you might employ some integration tests to test insert/select on a single entity, to make sure it w...
Spring.net + Nhibernate Integration Tests Pass When They Should Not I'm using Spring.net with NHiberante (HibernateTemplate) to implement my DAO's. I also have some integration tests, that extend from 'AbstractTransactionalDbProviderSpringContextTests '. DI is working fine, and all test pass BUT sometimes they pass eve...
TITLE: Spring.net + Nhibernate Integration Tests Pass When They Should Not QUESTION: I'm using Spring.net with NHiberante (HibernateTemplate) to implement my DAO's. I also have some integration tests, that extend from 'AbstractTransactionalDbProviderSpringContextTests '. DI is working fine, and all test pass BUT somet...
[ "nhibernate", "integration-testing", "spring.net" ]
0
1
990
2
0
2008-09-24T13:02:37.443000
2008-09-24T13:09:18.270000
127,001
127,011
What's a good compression library for Java?
I need to compress portions of our application's network traffic for performance. I presume this means I need to stay away from some of the newer algorithms like bzip2, which I think I have heard is slower.
You can use Deflater / Inflater which is built into the JDK. There are also GZIPInputStream and GZIPOutputStream, but it really depends on your exact use. Edit: Reading further comments it looks like the network taffic is HTTP. Depending on the server, it probably has support for compression (especially with deflate/gz...
What's a good compression library for Java? I need to compress portions of our application's network traffic for performance. I presume this means I need to stay away from some of the newer algorithms like bzip2, which I think I have heard is slower.
TITLE: What's a good compression library for Java? QUESTION: I need to compress portions of our application's network traffic for performance. I presume this means I need to stay away from some of the newer algorithms like bzip2, which I think I have heard is slower. ANSWER: You can use Deflater / Inflater which is b...
[ "java", "compression" ]
5
11
14,906
3
0
2008-09-24T13:05:39.400000
2008-09-24T13:07:50.440000
127,027
127,062
How can I check my byte flag, verifying that a specific bit is at 1 or 0?
I use a byte to store some flag like 10101010, and I would like to know how to verify that a specific bit is at 1 or 0.
Here's a function that can be used to test any bit: bool is_bit_set(unsigned value, unsigned bitindex) { return (value & (1 << bitindex))!= 0; } Explanation: The left shift operator << creates a bitmask. To illustrate: (1 << 0) equals 00000001 (1 << 1) equals 00000010 (1 << 3) equals 00001000 So a shift of 0 tests the ...
How can I check my byte flag, verifying that a specific bit is at 1 or 0? I use a byte to store some flag like 10101010, and I would like to know how to verify that a specific bit is at 1 or 0.
TITLE: How can I check my byte flag, verifying that a specific bit is at 1 or 0? QUESTION: I use a byte to store some flag like 10101010, and I would like to know how to verify that a specific bit is at 1 or 0. ANSWER: Here's a function that can be used to test any bit: bool is_bit_set(unsigned value, unsigned bitind...
[ "c", "math", "binary", "bit-manipulation" ]
29
57
39,155
10
0
2008-09-24T13:11:06.813000
2008-09-24T13:16:29.360000
127,029
129,090
Comparing cold-start to warm start
Our application takes significantly more time to launch after a reboot (cold start) than if it was already opened once (warm start). Most (if not all) the difference seems to come from loading DLLs, when the DLLs' are in cached memory pages they load much faster. We tried using ClearMem to simulate rebooting (since its...
How did you profile your code? Not all profiling methods are equal and some find hotspots better than others. Are you loading lots of files? If so, disk fragmentation and seek time might come into play. Maybe even sticking basic timing information into the code, writing out to a log file and examining the files on cold...
Comparing cold-start to warm start Our application takes significantly more time to launch after a reboot (cold start) than if it was already opened once (warm start). Most (if not all) the difference seems to come from loading DLLs, when the DLLs' are in cached memory pages they load much faster. We tried using ClearM...
TITLE: Comparing cold-start to warm start QUESTION: Our application takes significantly more time to launch after a reboot (cold start) than if it was already opened once (warm start). Most (if not all) the difference seems to come from loading DLLs, when the DLLs' are in cached memory pages they load much faster. We ...
[ "windows", "performance", "reboot" ]
13
3
10,976
10
0
2008-09-24T13:11:34.050000
2008-09-24T18:53:32.123000
127,038
127,050
Why is it not a good idea to use SOAP for communicating with the front end (ie web browser)?
Why is it not a good idea to use SOAP for communicating with the front end? For example, a web browser using JavaScript.
Because it's bloated Because JSON is natively understandable by the JavaScript Because XML isn't fast to manipulate with JavaScript.
Why is it not a good idea to use SOAP for communicating with the front end (ie web browser)? Why is it not a good idea to use SOAP for communicating with the front end? For example, a web browser using JavaScript.
TITLE: Why is it not a good idea to use SOAP for communicating with the front end (ie web browser)? QUESTION: Why is it not a good idea to use SOAP for communicating with the front end? For example, a web browser using JavaScript. ANSWER: Because it's bloated Because JSON is natively understandable by the JavaScript ...
[ "javascript", "soap" ]
25
42
4,507
4
0
2008-09-24T13:12:47.310000
2008-09-24T13:14:33.123000
127,073
127,112
Does .NET Framework 3.5 SP1 require restart?
We have a production machine and are trying to slowly introduce some 3.0 and up features on our web application. 3.5 is installed but I would like to upgrade to SP1, I would just like to know if it requires a restart of the machine in the end so I can schedule some down time. Thanks! EDIT: so it did require the restart...
He he. I installed it on about 4 machines...two required a restart, two did not. The configuration was similar between them, so there was no obvious way to determine why some needed a restart and others didn't. The best theory I have currently is that the ones which needed restarts tended to be the ones which were more...
Does .NET Framework 3.5 SP1 require restart? We have a production machine and are trying to slowly introduce some 3.0 and up features on our web application. 3.5 is installed but I would like to upgrade to SP1, I would just like to know if it requires a restart of the machine in the end so I can schedule some down time...
TITLE: Does .NET Framework 3.5 SP1 require restart? QUESTION: We have a production machine and are trying to slowly introduce some 3.0 and up features on our web application. 3.5 is installed but I would like to upgrade to SP1, I would just like to know if it requires a restart of the machine in the end so I can sched...
[ ".net-3.5" ]
13
9
27,325
5
0
2008-09-24T13:18:48.793000
2008-09-24T13:27:05.793000
127,076
127,265
GridView Row to Object Type
In ASP.NET, if I databind a gridview with a array of objects lets say, how can I retrieve and use foo(index) when the user selects the row? i.e. dim fooArr() as foo; gv1.datasource = fooArr; gv1.databind(); On Row Select Private Sub gv1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCom...
If you can be sure the order of items in your data source has not changed, you can use the CommandArgument property of the CommandEventArgs. A more robust method, however,is to use the DataKeys/SelectedDataKey properties of the GridView. The only caveat is that your command must be of type "Select" (so, by default RowC...
GridView Row to Object Type In ASP.NET, if I databind a gridview with a array of objects lets say, how can I retrieve and use foo(index) when the user selects the row? i.e. dim fooArr() as foo; gv1.datasource = fooArr; gv1.databind(); On Row Select Private Sub gv1_RowCommand(ByVal sender As Object, ByVal e As System.We...
TITLE: GridView Row to Object Type QUESTION: In ASP.NET, if I databind a gridview with a array of objects lets say, how can I retrieve and use foo(index) when the user selects the row? i.e. dim fooArr() as foo; gv1.datasource = fooArr; gv1.databind(); On Row Select Private Sub gv1_RowCommand(ByVal sender As Object, By...
[ "asp.net", "vb.net" ]
2
2
3,457
3
0
2008-09-24T13:19:12.817000
2008-09-24T13:52:34.217000
127,095
127,106
What is the preferred method of commenting JavaScript objects and methods?
I'm used to Atlas where the preferred (from what I know) method is to use XML comments such as: /// /// Method to calculate distance between two points /// /// /// First point /// Second point /// function calculatePointDistance(pointA, pointB) {... } Recently I've been looking into other third-party JavaScript librari...
There's JSDoc /** * Shape is an abstract base class. It is defined simply * to have something to inherit from for geometric * subclasses * @constructor */ function Shape(color){ this.color = color; }
What is the preferred method of commenting JavaScript objects and methods? I'm used to Atlas where the preferred (from what I know) method is to use XML comments such as: /// /// Method to calculate distance between two points /// /// /// First point /// Second point /// function calculatePointDistance(pointA, pointB) ...
TITLE: What is the preferred method of commenting JavaScript objects and methods? QUESTION: I'm used to Atlas where the preferred (from what I know) method is to use XML comments such as: /// /// Method to calculate distance between two points /// /// /// First point /// Second point /// function calculatePointDistanc...
[ "javascript", "comments" ]
73
105
84,715
5
0
2008-09-24T13:23:09
2008-09-24T13:26:00.117000
127,107
127,237
So, who should daemonize? The script or the caller?
I'm always wondering who should do it. In Ruby, we have the Daemons library which allows Ruby scripts to daemonize themselves. And then, looking at God (a process monitoring tool, similar to monit ) page, I see that God can daemonize processes. Any definitive answer out there?
You probably cannot get a definitive answer, as we generally end up with both: the process has the ability to daemonize itself, and the process monitor has the ability to daemonize its children. Personally I prefer to have the process monitor or script do it, for a few reasons: 1. if the process monitor wishes to close...
So, who should daemonize? The script or the caller? I'm always wondering who should do it. In Ruby, we have the Daemons library which allows Ruby scripts to daemonize themselves. And then, looking at God (a process monitoring tool, similar to monit ) page, I see that God can daemonize processes. Any definitive answer o...
TITLE: So, who should daemonize? The script or the caller? QUESTION: I'm always wondering who should do it. In Ruby, we have the Daemons library which allows Ruby scripts to daemonize themselves. And then, looking at God (a process monitoring tool, similar to monit ) page, I see that God can daemonize processes. Any d...
[ "daemon", "process-monitoring" ]
1
2
513
2
0
2008-09-24T13:26:03.970000
2008-09-24T13:47:56.913000
127,116
127,371
SQL Server Convert integer to binary string
I was wondering if there was an easy way in SQL to convert an integer to its binary representation and then store it as a varchar. For example 5 would be converted to "101" and stored as a varchar.
Following could be coded into a function. You would need to trim off leading zeros to meet requirements of your question. declare @intvalue int set @intvalue=5 declare @vsresult varchar(64) declare @inti int select @inti = 64, @vsresult = '' while @inti>0 begin select @vsresult=convert(char(1), @intvalue % 2)+@vsresul...
SQL Server Convert integer to binary string I was wondering if there was an easy way in SQL to convert an integer to its binary representation and then store it as a varchar. For example 5 would be converted to "101" and stored as a varchar.
TITLE: SQL Server Convert integer to binary string QUESTION: I was wondering if there was an easy way in SQL to convert an integer to its binary representation and then store it as a varchar. For example 5 would be converted to "101" and stored as a varchar. ANSWER: Following could be coded into a function. You would...
[ "sql", "sql-server" ]
31
20
107,326
18
0
2008-09-24T13:27:46.087000
2008-09-24T14:10:26.173000
127,118
127,146
How to test for object existence in Firebird SQL?
I need to test whether various types of database objects exist in a given database, and I don't know how to formulate these tests in Firebird SQL. Each test has the form "Does object of type X with name Y exist?". For example, I need to test whether a table with a given name exists. The object types I need to test are:...
I think a lot of what you are asking can be found at this forum post. If you want to dive a little deeper, this site seems to have a graphical representation of the tables.
How to test for object existence in Firebird SQL? I need to test whether various types of database objects exist in a given database, and I don't know how to formulate these tests in Firebird SQL. Each test has the form "Does object of type X with name Y exist?". For example, I need to test whether a table with a given...
TITLE: How to test for object existence in Firebird SQL? QUESTION: I need to test whether various types of database objects exist in a given database, and I don't know how to formulate these tests in Firebird SQL. Each test has the form "Does object of type X with name Y exist?". For example, I need to test whether a ...
[ "firebird" ]
8
11
7,191
3
0
2008-09-24T13:28:07.693000
2008-09-24T13:33:32.250000
127,124
132,048
Resolve Windows device path to drive letter
How do you resolve an NT style device path, e.g. \Device\CdRom0, to its logical drive letter, e.g. G:\? Edit: A Volume Name isn't the same as a Device Path so unfortunately GetVolumePathNamesForVolumeName() won't work.
Hopefully the following piece of code will give you enough to solve this - after you've initialised it, you just need to iterate through the collection to find your match. You may want to convert everything to upper/lower case before you insert into the collection to help with lookup performance. typedef basic_string t...
Resolve Windows device path to drive letter How do you resolve an NT style device path, e.g. \Device\CdRom0, to its logical drive letter, e.g. G:\? Edit: A Volume Name isn't the same as a Device Path so unfortunately GetVolumePathNamesForVolumeName() won't work.
TITLE: Resolve Windows device path to drive letter QUESTION: How do you resolve an NT style device path, e.g. \Device\CdRom0, to its logical drive letter, e.g. G:\? Edit: A Volume Name isn't the same as a Device Path so unfortunately GetVolumePathNamesForVolumeName() won't work. ANSWER: Hopefully the following piece ...
[ "windows", "path", "device" ]
14
6
9,445
5
0
2008-09-24T13:28:51.013000
2008-09-25T08:02:45.797000
127,137
314,391
Sample Code for R?
Does anyone know a good online resource for example of R code? The programs do not have to be written for illustrative purposes, I am really just looking for some places where a bunch of R code has been written to give me a sense of the syntax and capabilities of the language? Edit: I have read the basic documentation ...
I just found this question and thought I would add a few resources to it. I really like the Quick-R site: http://www.statmethods.net/ Muenchen has written a book about using R if you come from SAS or SPSS. Originally it was an 80 page online doc that Springer encouraged him to make a 400+ page book out of. The original...
Sample Code for R? Does anyone know a good online resource for example of R code? The programs do not have to be written for illustrative purposes, I am really just looking for some places where a bunch of R code has been written to give me a sense of the syntax and capabilities of the language? Edit: I have read the b...
TITLE: Sample Code for R? QUESTION: Does anyone know a good online resource for example of R code? The programs do not have to be written for illustrative purposes, I am really just looking for some places where a bunch of R code has been written to give me a sense of the syntax and capabilities of the language? Edit:...
[ "r" ]
24
19
25,223
15
0
2008-09-24T13:31:07.500000
2008-11-24T15:01:37.363000
127,144
127,303
Is it possible to create INTERNATIONAL permalinks?
i was wondering how you deal with permalinks on international sites. By permalink i mean some link which is unique and human readable. E.g. for english phrases its no problem e.g. /product/some-title/ but what do you do if the product title is in e.g chinese language?? how do you deal with this problem? i am implementi...
How about some scheme like /productid/{product-id-number}/some-title/ where the site looks at the {number} and ignores the 'some-title' part entirely. You can put that into whatever language or encoding you like, because it's not being used.
Is it possible to create INTERNATIONAL permalinks? i was wondering how you deal with permalinks on international sites. By permalink i mean some link which is unique and human readable. E.g. for english phrases its no problem e.g. /product/some-title/ but what do you do if the product title is in e.g chinese language??...
TITLE: Is it possible to create INTERNATIONAL permalinks? QUESTION: i was wondering how you deal with permalinks on international sites. By permalink i mean some link which is unique and human readable. E.g. for english phrases its no problem e.g. /product/some-title/ but what do you do if the product title is in e.g ...
[ "internationalization", "permalinks" ]
3
1
501
6
0
2008-09-24T13:33:19.630000
2008-09-24T13:58:47.557000
127,151
127,227
How to determine differences in two lists of data
This is an exercise for the CS guys to shine with the theory. Imagine you have 2 containers with elements. Folders, URLs, Files, Strings, it really doesn't matter. What is AN algorithm to calculate the added and the removed? Notice: If there are many ways to solve this problem, please post one per answer so it can be a...
Assuming you have two lists of unique items, and the ordering doesn't matter, you can think of them both as sets rather than lists If you think of a venn diagram, with list A as one circle and list B as the other, then the intersection of these two is the constant pool. Remove all the elements in this intersection from...
How to determine differences in two lists of data This is an exercise for the CS guys to shine with the theory. Imagine you have 2 containers with elements. Folders, URLs, Files, Strings, it really doesn't matter. What is AN algorithm to calculate the added and the removed? Notice: If there are many ways to solve this ...
TITLE: How to determine differences in two lists of data QUESTION: This is an exercise for the CS guys to shine with the theory. Imagine you have 2 containers with elements. Folders, URLs, Files, Strings, it really doesn't matter. What is AN algorithm to calculate the added and the removed? Notice: If there are many w...
[ "algorithm", "list", "diff", "edit-distance" ]
4
5
4,185
5
0
2008-09-24T13:34:44.667000
2008-09-24T13:46:33.187000
127,152
127,602
How to change slow parametrized inserts into fast bulk copy (even from memory)
I had someting like this in my code (.Net 2.0, MS SQL) SqlConnection connection = new SqlConnection(@"Data Source=localhost;Initial Catalog=DataBase;Integrated Security=True"); connection.Open(); SqlCommand cmdInsert = connection.CreateCommand(); SqlTransaction sqlTran = connection.BeginTransaction(); cmdInsert.Transa...
Instead of inserting each record individually, Try using the SqlBulkCopy class to bulk insert all the records at once. Create a DataTable and add all your records to the DataTable, and then use SqlBulkCopy. WriteToServer to bulk insert all the data at once.
How to change slow parametrized inserts into fast bulk copy (even from memory) I had someting like this in my code (.Net 2.0, MS SQL) SqlConnection connection = new SqlConnection(@"Data Source=localhost;Initial Catalog=DataBase;Integrated Security=True"); connection.Open(); SqlCommand cmdInsert = connection.CreateComm...
TITLE: How to change slow parametrized inserts into fast bulk copy (even from memory) QUESTION: I had someting like this in my code (.Net 2.0, MS SQL) SqlConnection connection = new SqlConnection(@"Data Source=localhost;Initial Catalog=DataBase;Integrated Security=True"); connection.Open(); SqlCommand cmdInsert = con...
[ "sql-server-2005", "insert", "copy", "performance", "bulk" ]
3
9
2,785
12
0
2008-09-24T13:34:44.977000
2008-09-24T14:43:56.123000
127,156
127,157
How to check if an index exists on a table field in MySQL
How do I check if an index exists on a table field in MySQL? I've needed to Google this multiple times, so I'm sharing my Q/A.
Use SHOW INDEX like so: SHOW INDEX FROM [tablename] Docs: https://dev.mysql.com/doc/refman/5.0/en/show-index.html
How to check if an index exists on a table field in MySQL How do I check if an index exists on a table field in MySQL? I've needed to Google this multiple times, so I'm sharing my Q/A.
TITLE: How to check if an index exists on a table field in MySQL QUESTION: How do I check if an index exists on a table field in MySQL? I've needed to Google this multiple times, so I'm sharing my Q/A. ANSWER: Use SHOW INDEX like so: SHOW INDEX FROM [tablename] Docs: https://dev.mysql.com/doc/refman/5.0/en/show-index...
[ "mysql", "indexing" ]
127
162
127,457
11
0
2008-09-24T13:35:13.963000
2008-09-24T13:35:35.960000
127,188
127,240
Could you explain STA and MTA?
Can you explain STA and MTA in your own words? Also, what are apartment threads and do they pertain only to COM? If so, why?
The COM threading model is called an "apartment" model, where the execution context of initialized COM objects is associated with either a single thread (Single Thread Apartment) or many threads (Multi Thread Apartment). In this model, a COM object, once initialized in an apartment, is part of that apartment for the du...
Could you explain STA and MTA? Can you explain STA and MTA in your own words? Also, what are apartment threads and do they pertain only to COM? If so, why?
TITLE: Could you explain STA and MTA? QUESTION: Can you explain STA and MTA in your own words? Also, what are apartment threads and do they pertain only to COM? If so, why? ANSWER: The COM threading model is called an "apartment" model, where the execution context of initialized COM objects is associated with either ...
[ ".net", "multithreading", "com", "apartments" ]
416
378
164,359
9
0
2008-09-24T13:40:23.250000
2008-09-24T13:48:48.097000
127,190
2,096,144
Good Haskell coding style of if/else control block?
I'm learning Haskell in the hope that it will help me get closer to functional programming. Previously, I've mostly used languages with C-like syntax, like C, Java, and D. I have a little question about the coding style of an if / else control block used by the tutorial on Wikibooks. The code looks like the following: ...
Haskell style is functional, not imperative! Rather than "do this then that," think about combining functions and describing what your program will do, not how. In the game, your program asks the user for a guess. A correct guess is a winner. Otherwise, the user tries again. The game continues until the user guesses co...
Good Haskell coding style of if/else control block? I'm learning Haskell in the hope that it will help me get closer to functional programming. Previously, I've mostly used languages with C-like syntax, like C, Java, and D. I have a little question about the coding style of an if / else control block used by the tutori...
TITLE: Good Haskell coding style of if/else control block? QUESTION: I'm learning Haskell in the hope that it will help me get closer to functional programming. Previously, I've mostly used languages with C-like syntax, like C, Java, and D. I have a little question about the coding style of an if / else control block ...
[ "haskell", "coding-style" ]
30
28
14,402
8
0
2008-09-24T13:40:35.743000
2010-01-19T18:52:21.287000
127,205
127,220
Using 'this' as a parameter to a method call in a constructor
I have a constructor like as follows: public Agent(){ this.name = "John"; this.id = 9; this.setTopWorldAgent(this, "Top_World_Agent", true); } I'm getting a null pointer exception here in the method call. It appears to be because I'm using 'this' as an argument in the setTopWorldAgent method. By removing this method ...
You can pass this to methods, but setTopWorldAgent() cannot be abstract. You can't make a virtual call in the constructor. In the constructor of an object, you can call methods defined in that object or base classes, but you cannot expect to call something that will be provided by a derived class, because parts of the ...
Using 'this' as a parameter to a method call in a constructor I have a constructor like as follows: public Agent(){ this.name = "John"; this.id = 9; this.setTopWorldAgent(this, "Top_World_Agent", true); } I'm getting a null pointer exception here in the method call. It appears to be because I'm using 'this' as an arg...
TITLE: Using 'this' as a parameter to a method call in a constructor QUESTION: I have a constructor like as follows: public Agent(){ this.name = "John"; this.id = 9; this.setTopWorldAgent(this, "Top_World_Agent", true); } I'm getting a null pointer exception here in the method call. It appears to be because I'm usin...
[ "java", "constructor", "methods", "call", "this" ]
6
8
10,401
11
0
2008-09-24T13:42:47.097000
2008-09-24T13:45:45.513000
127,233
127,254
Does Class need to implement IEnumerable to use Foreach
This is in C#, I have a class that I am using from some else's DLL. It does not implement IEnumerable but has 2 methods that pass back a IEnumerator. Is there a way I can use a foreach loop on these. The class I am using is sealed.
foreach does not require IEnumerable, contrary to popular belief. All it requires is a method GetEnumerator that returns any object that has the method MoveNext and the get-property Current with the appropriate signatures. /EDIT: In your case, however, you're out of luck. You can trivially wrap your object, however, to...
Does Class need to implement IEnumerable to use Foreach This is in C#, I have a class that I am using from some else's DLL. It does not implement IEnumerable but has 2 methods that pass back a IEnumerator. Is there a way I can use a foreach loop on these. The class I am using is sealed.
TITLE: Does Class need to implement IEnumerable to use Foreach QUESTION: This is in C#, I have a class that I am using from some else's DLL. It does not implement IEnumerable but has 2 methods that pass back a IEnumerator. Is there a way I can use a foreach loop on these. The class I am using is sealed. ANSWER: forea...
[ "c#", "foreach", "ienumerable" ]
17
17
12,714
11
0
2008-09-24T13:47:17.803000
2008-09-24T13:50:47.107000
127,238
127,503
Contextual Natural Language Resources, Where Do I Start?
Where can i find some.Net or conceptual resources to start working with Natural Language where I can pull context and subjects from text. I wish not to work with word frequency algorithms.
To find resources in part of speech tagging (a natural language processing task) look at this: Natural Language Toolkit PoS tagger in perl SVM Tool NLP Group at Stanford Hope it helps.
Contextual Natural Language Resources, Where Do I Start? Where can i find some.Net or conceptual resources to start working with Natural Language where I can pull context and subjects from text. I wish not to work with word frequency algorithms.
TITLE: Contextual Natural Language Resources, Where Do I Start? QUESTION: Where can i find some.Net or conceptual resources to start working with Natural Language where I can pull context and subjects from text. I wish not to work with word frequency algorithms. ANSWER: To find resources in part of speech tagging (a ...
[ ".net", "nlp" ]
2
4
309
4
0
2008-09-24T13:48:24.103000
2008-09-24T14:24:59.553000
127,241
127,338
.NET client app: how to reach Web Services in case of proxy?
We are developing a.NET 2.0 winform application. The application needs to access Web Services. Yet, we are encountering issues with users behind proxies. Popular windows backup applications (think Mozy ) are providing a moderately complex dialog window dedicated the proxy settings. Yet, re-implementing yet-another prox...
Put this in your application's config file: and your application will use the proxy settings from IE. If you can see your web service in IE using the proxy server, you should be able to "see" it from your application.
.NET client app: how to reach Web Services in case of proxy? We are developing a.NET 2.0 winform application. The application needs to access Web Services. Yet, we are encountering issues with users behind proxies. Popular windows backup applications (think Mozy ) are providing a moderately complex dialog window dedica...
TITLE: .NET client app: how to reach Web Services in case of proxy? QUESTION: We are developing a.NET 2.0 winform application. The application needs to access Web Services. Yet, we are encountering issues with users behind proxies. Popular windows backup applications (think Mozy ) are providing a moderately complex di...
[ ".net", "winforms", "proxy" ]
4
10
2,761
7
0
2008-09-24T13:48:48.330000
2008-09-24T14:04:19.713000
127,246
127,659
How to bind extenders to controls on clientside
I have some dynamically created inputs which are not server-side controls. I want to relate them to some CalendarExtender and MaskedEditExtender on the clientside. Is there a way to do that?
Yes I think it may be possible here is how: On the server side set the BehaviourID attribute of the Ajax control to a known value: _calendarExtender.BehaviorID = "_behaviour_id" This allows you then in your javascript to get hold of the underlying CalendarBehaviour object with the $find function: var calBehaviour = $fi...
How to bind extenders to controls on clientside I have some dynamically created inputs which are not server-side controls. I want to relate them to some CalendarExtender and MaskedEditExtender on the clientside. Is there a way to do that?
TITLE: How to bind extenders to controls on clientside QUESTION: I have some dynamically created inputs which are not server-side controls. I want to relate them to some CalendarExtender and MaskedEditExtender on the clientside. Is there a way to do that? ANSWER: Yes I think it may be possible here is how: On the ser...
[ "asp.net", "calendarextender", "maskededitextender" ]
1
1
1,007
1
0
2008-09-24T13:49:36.847000
2008-09-24T14:55:30.540000
127,258
127,317
LINQ to XML Newbie Question: Returning More Than One Result
Greetings! I'm working on wrapping my head around LINQ. If I had some XML such as this loaded into an XDocument object: I'd like to get the attribute values of all of the Item child elements of a Group element. Here's what my query looks like: var results = from thegroup in l_theDoc.Elements("Root").Elements(groupName)...
XElement e = XElement.Parse(testStr); string groupName = "GroupB"; var items = from g in e.Elements(groupName) from i in g.Elements("Item") select new { attr1 = (string)i.Attribute("attrib1"), attr2 = (string)i.Attribute("attrib2") }; foreach (var item in items) { Console.WriteLine(item.attr1 + ":" + item.attr2); }
LINQ to XML Newbie Question: Returning More Than One Result Greetings! I'm working on wrapping my head around LINQ. If I had some XML such as this loaded into an XDocument object: I'd like to get the attribute values of all of the Item child elements of a Group element. Here's what my query looks like: var results = fr...
TITLE: LINQ to XML Newbie Question: Returning More Than One Result QUESTION: Greetings! I'm working on wrapping my head around LINQ. If I had some XML such as this loaded into an XDocument object: I'd like to get the attribute values of all of the Item child elements of a Group element. Here's what my query looks like...
[ "c#", "linq-to-xml" ]
4
6
1,406
4
0
2008-09-24T13:51:29.167000
2008-09-24T14:01:33.743000
127,288
127,339
Can't select Primary Output as target of shortcut in Visual Studio 2005 setup project
I've Added a setup project to my solution (didn't use the wizard) I then added the primary output of the Windows Application I have coded to the Applcation Folder node (Right click the setup project in Solution-Explorer and select View -> File System). I Right clicked the User's Desktop node and selected 'Create Shortc...
I think you've created a shortcut to the desktop, on the desktop. Try clicking on User's Desktop, then right-clicking in the right hand pane, and selecting "Create new shortcut" from there.
Can't select Primary Output as target of shortcut in Visual Studio 2005 setup project I've Added a setup project to my solution (didn't use the wizard) I then added the primary output of the Windows Application I have coded to the Applcation Folder node (Right click the setup project in Solution-Explorer and select Vie...
TITLE: Can't select Primary Output as target of shortcut in Visual Studio 2005 setup project QUESTION: I've Added a setup project to my solution (didn't use the wizard) I then added the primary output of the Windows Application I have coded to the Applcation Folder node (Right click the setup project in Solution-Explo...
[ "deployment", "visual-studio-2005", "installation" ]
2
1
2,956
2
0
2008-09-24T13:56:51.650000
2008-09-24T14:04:52.847000
127,290
128,221
Is it possible to subclass a C struct in C++ and use pointers to the struct in C code?
Is there a side effect in doing this: C code: struct foo { int k; }; int ret_foo(const struct foo* f){ return f.k; } C++ code: class bar: public foo { int my_bar() { return ret_foo( (foo)this ); } }; There's an extern "C" around the C++ code and each code is inside its own compilation unit. Is this portable across c...
This is entirely legal. In C++, classes and structs are identical concepts, with the exception that all struct members are public by default. That's the only difference. So asking whether you can extend a struct is no different than asking if you can extend a class. There is one caveat here. There is no guarantee of la...
Is it possible to subclass a C struct in C++ and use pointers to the struct in C code? Is there a side effect in doing this: C code: struct foo { int k; }; int ret_foo(const struct foo* f){ return f.k; } C++ code: class bar: public foo { int my_bar() { return ret_foo( (foo)this ); } }; There's an extern "C" around t...
TITLE: Is it possible to subclass a C struct in C++ and use pointers to the struct in C code? QUESTION: Is there a side effect in doing this: C code: struct foo { int k; }; int ret_foo(const struct foo* f){ return f.k; } C++ code: class bar: public foo { int my_bar() { return ret_foo( (foo)this ); } }; There's an e...
[ "c++", "c", "gcc", "extern-c" ]
25
30
13,504
10
0
2008-09-24T13:56:53.023000
2008-09-24T16:30:06.163000
127,299
127,783
Is there any way, in java, to check on the status of a windows service?
I am looking for a library that will allow me to look up the status of a windows service to verify that the service is started and running. I looked into the Sigar library, but it is GPL and therefor I cannot use it. A Commercial or BSD(ish) license is required as this will be bundled into commercial software.
If nothing else helps, try to think of a slightly different approach (if you can, of course), e.g.: There is a plenty of free/non-free software which does monitoring, including Windows service monitoring (e.g. nagios, Zabbix, etc.). These monitors typically have open API where your Java app could integrate into in a nu...
Is there any way, in java, to check on the status of a windows service? I am looking for a library that will allow me to look up the status of a windows service to verify that the service is started and running. I looked into the Sigar library, but it is GPL and therefor I cannot use it. A Commercial or BSD(ish) licens...
TITLE: Is there any way, in java, to check on the status of a windows service? QUESTION: I am looking for a library that will allow me to look up the status of a windows service to verify that the service is started and running. I looked into the Sigar library, but it is GPL and therefor I cannot use it. A Commercial ...
[ "java", "windows-services", "system-monitoring", "system-status" ]
6
5
8,337
3
0
2008-09-24T13:57:52.800000
2008-09-24T15:15:09.293000
127,305
128,922
Are there any all-in-one packages that help install wamp on a production server?
I need to install amp on a windows2003 production server. I'd like, if possible, an integrated install/management tool so I don't have to install/integrate the components of amp separately. Those that I've found are 'development' servers. Are there any packages out there that install amp in a production ready (locked d...
There doesn't appear to be any all-in one packages that are up to date and 'designed' for production. You just can't trust the default installs to be secure on whats out there. I ended up just doing this manually. It wasn't painful though. Each component's install procedure was documented reasonably well. Took me about...
Are there any all-in-one packages that help install wamp on a production server? I need to install amp on a windows2003 production server. I'd like, if possible, an integrated install/management tool so I don't have to install/integrate the components of amp separately. Those that I've found are 'development' servers. ...
TITLE: Are there any all-in-one packages that help install wamp on a production server? QUESTION: I need to install amp on a windows2003 production server. I'd like, if possible, an integrated install/management tool so I don't have to install/integrate the components of amp separately. Those that I've found are 'deve...
[ "networking", "wamp" ]
1
0
1,167
5
0
2008-09-24T13:59:10.770000
2008-09-24T18:28:53.337000
127,316
127,334
Problem Exporting DataGrid to Excel
I first got an error usign the code below, explaining that "DataGridLinkButton' must be placed inside a form tag with runat=server." Now I've tried setting AllowSorting to false, as well as removing the sort expression from each column, with the same error. Then I tried creating a new, plain, DataGrid, with the same da...
Add the following empty method to your code. That should fix it. public override void VerifyRenderingInServerForm(Control control) { }
Problem Exporting DataGrid to Excel I first got an error usign the code below, explaining that "DataGridLinkButton' must be placed inside a form tag with runat=server." Now I've tried setting AllowSorting to false, as well as removing the sort expression from each column, with the same error. Then I tried creating a ne...
TITLE: Problem Exporting DataGrid to Excel QUESTION: I first got an error usign the code below, explaining that "DataGridLinkButton' must be placed inside a form tag with runat=server." Now I've tried setting AllowSorting to false, as well as removing the sort expression from each column, with the same error. Then I t...
[ "asp.net" ]
0
1
506
2
0
2008-09-24T14:01:25.383000
2008-09-24T14:03:39.510000
127,318
6,028,937
Is there any sed like utility for cmd.exe?
I want to programmatically edit file content using windows command line ( cmd.exe ). In *nix there is sed for this tasks. Are there any useful native equivalents (cmd or ps) in windows?
Today powershell saved me. For grep there is: get-content somefile.txt | where { $_ -match "expression"} or select-string somefile.txt -pattern "expression" and for sed there is: get-content somefile.txt | %{$_ -replace "expression","replace"} For more detail about replace PowerShell function see this Microsoft article...
Is there any sed like utility for cmd.exe? I want to programmatically edit file content using windows command line ( cmd.exe ). In *nix there is sed for this tasks. Are there any useful native equivalents (cmd or ps) in windows?
TITLE: Is there any sed like utility for cmd.exe? QUESTION: I want to programmatically edit file content using windows command line ( cmd.exe ). In *nix there is sed for this tasks. Are there any useful native equivalents (cmd or ps) in windows? ANSWER: Today powershell saved me. For grep there is: get-content somefi...
[ "windows", "sed", "cmd" ]
194
169
313,877
16
0
2008-09-24T14:01:42.277000
2011-05-17T09:35:12.447000
127,324
979,208
gss_acquire_cred returning Key table entry not found error
I have been trying to follow the guidelines in this Microsoft article to authenticate against Apache with Kerberos and AD. I have successfully tested the communication between the apache server and the AD server with kinit. However when I attempt to access a restricted page on the server with IE I get an Internal serve...
Ok. Keytabs are supposed to contain the Service principal name, in this case "HTTP/srvnfssol1.dev.local@DEV.LOCAL" and the encryption key. I see where the MS docs say just to echo that to a file, but I don't think that's right. You'll need to use the ktpass utility to create the keytab. The MS docs are here. In particu...
gss_acquire_cred returning Key table entry not found error I have been trying to follow the guidelines in this Microsoft article to authenticate against Apache with Kerberos and AD. I have successfully tested the communication between the apache server and the AD server with kinit. However when I attempt to access a re...
TITLE: gss_acquire_cred returning Key table entry not found error QUESTION: I have been trying to follow the guidelines in this Microsoft article to authenticate against Apache with Kerberos and AD. I have successfully tested the communication between the apache server and the AD server with kinit. However when I atte...
[ "apache", "authentication", "kerberos" ]
2
5
8,091
1
0
2008-09-24T14:02:25.113000
2009-06-11T03:41:21.807000
127,377
128,300
Programming Languages and Design Patterns
different programming languages have different features or lack certain features. Design patterns are a way to work around those shortcomings. I have seen the books and lists about design patterns in static, object oriented languages (Java, C++), but also the Videos about design patterns in Python. I'm interested in to...
Design patterns are sometimes called "idioms". In non-OO languages (C, Forth, COBOL, etc.) they're just "the usual ways of doing things". Sometimes, they're called "algorithms". Every language (indeed, every discipline) has patterns of designing solutions. If you've seen something two or three times, you've seen a patt...
Programming Languages and Design Patterns different programming languages have different features or lack certain features. Design patterns are a way to work around those shortcomings. I have seen the books and lists about design patterns in static, object oriented languages (Java, C++), but also the Videos about desig...
TITLE: Programming Languages and Design Patterns QUESTION: different programming languages have different features or lack certain features. Design patterns are a way to work around those shortcomings. I have seen the books and lists about design patterns in static, object oriented languages (Java, C++), but also the ...
[ "design-patterns", "programming-languages" ]
3
9
5,524
5
0
2008-09-24T14:11:04.517000
2008-09-24T16:47:09.960000
127,386
127,404
What are the debug memory fill patterns in Visual Studio C++ and Windows?
In Visual Studio, we've all had "baadf00d", have seen seen "CC" and "CD" when inspecting variables in the debugger in C++ during run-time. From what I understand, "CC" is in DEBUG mode only to indicate when a memory has been new() or alloc() and unitilialized. While "CD" represents delete'd or free'd memory. I've only ...
This link has more information: https://en.wikipedia.org/wiki/Magic_number_(programming)#Debug_values * 0xABABABAB: Used by Microsoft's HeapAlloc() to mark "no man's land" guard bytes after allocated heap memory * 0xABADCAFE: A startup to this value to initialize all free memory to catch errant pointers * 0xBAADF00D: U...
What are the debug memory fill patterns in Visual Studio C++ and Windows? In Visual Studio, we've all had "baadf00d", have seen seen "CC" and "CD" when inspecting variables in the debugger in C++ during run-time. From what I understand, "CC" is in DEBUG mode only to indicate when a memory has been new() or alloc() and ...
TITLE: What are the debug memory fill patterns in Visual Studio C++ and Windows? QUESTION: In Visual Studio, we've all had "baadf00d", have seen seen "CC" and "CD" when inspecting variables in the debugger in C++ during run-time. From what I understand, "CC" is in DEBUG mode only to indicate when a memory has been new...
[ "debugging", "visual-c++" ]
243
358
124,032
3
0
2008-09-24T14:11:46.277000
2008-09-24T14:14:34.710000
127,389
144,192
Route-problem regarding Url-encoded Umlauts (using the Zend-framework)
Today I stumbled about a Problem which seems to be a bug in the Zend-Framework. Given the following route: citytest/:city result test.+ and three Urls: mysite.local/citytest/Berlin mysite.local/citytest/Hamburg mysite.local/citytest/M%FCnchen the last Url does not match and thus the correct controller is not called. An...
The problem is the following: Using the /u pattern modifier prevents words from being mangled but instead PCRE skips strings of characters with code values greater than 127. Therefore, \w will not match a multibyte (non-lower ascii) word at all (but also won’t return portions of it). From the pcrepattern man page; In U...
Route-problem regarding Url-encoded Umlauts (using the Zend-framework) Today I stumbled about a Problem which seems to be a bug in the Zend-Framework. Given the following route: citytest/:city result test.+ and three Urls: mysite.local/citytest/Berlin mysite.local/citytest/Hamburg mysite.local/citytest/M%FCnchen the la...
TITLE: Route-problem regarding Url-encoded Umlauts (using the Zend-framework) QUESTION: Today I stumbled about a Problem which seems to be a bug in the Zend-Framework. Given the following route: citytest/:city result test.+ and three Urls: mysite.local/citytest/Berlin mysite.local/citytest/Hamburg mysite.local/citytes...
[ "php", "zend-framework" ]
2
1
2,035
3
0
2008-09-24T14:12:05.777000
2008-09-27T18:25:27.770000
127,391
127,421
Finding the name of a variable in C
I was asked a question in C last night and I did not know the answer since I have not used C much since college so I thought maybe I could find the answer here instead of just forgetting about it. If a person has a define such as: #define count 1 Can that person find the variable name count using the 1 that is inside i...
The simple answer is no they can't. #Defines like that are dealt with by the preprocessor, and they only point in one direction. Of course the other problem is that even the compiler wouldn't know - as a "1" could point to anything - multiple variables can have the same value at the same time.
Finding the name of a variable in C I was asked a question in C last night and I did not know the answer since I have not used C much since college so I thought maybe I could find the answer here instead of just forgetting about it. If a person has a define such as: #define count 1 Can that person find the variable nam...
TITLE: Finding the name of a variable in C QUESTION: I was asked a question in C last night and I did not know the answer since I have not used C much since college so I thought maybe I could find the answer here instead of just forgetting about it. If a person has a define such as: #define count 1 Can that person fin...
[ "c", "constants", "c-preprocessor" ]
3
7
899
18
0
2008-09-24T14:12:50.567000
2008-09-24T14:16:06.207000
127,395
143,118
.NET SOAP Common types
Is there a way when creating web services to specify the types to use? Specifically, I want to be able to use the same type on both the client and server to reduce duplication of code. Over simplified example: public class Name { public string FirstName {get; set;} public string Surname { get; set; } public override s...
Okay, I see know that this has been an explicit design decision on the part of SOAP so you're not actually supposed to do this. I found the following page that explains why: Services share schema and contract, not class. Services interact solely on their expression of structures through schemas and behaviors through co...
.NET SOAP Common types Is there a way when creating web services to specify the types to use? Specifically, I want to be able to use the same type on both the client and server to reduce duplication of code. Over simplified example: public class Name { public string FirstName {get; set;} public string Surname { get; se...
TITLE: .NET SOAP Common types QUESTION: Is there a way when creating web services to specify the types to use? Specifically, I want to be able to use the same type on both the client and server to reduce duplication of code. Over simplified example: public class Name { public string FirstName {get; set;} public string...
[ ".net", "soap", "types" ]
2
3
1,127
2
0
2008-09-24T14:13:29.753000
2008-09-27T06:26:50.790000
127,413
127,438
Controls do not appear on dynamically created user control
I have user control named DateTimeUC which has two textboxes on its markup: I am dynamically creating this control in another user control: Controls.Add(GenerateDateTime(parameter)); private DateTimeUC GenerateDateTime(SomeParameter parameter) { DateTimeUC uc = new DateTimeUC(); uc.ID = parameter.Name; return uc; } But...
You must use the LoadControl( "your_user_control_app_relative_path.ascx" ) method instead of "DateTimeUC uc = new DateTimeUC();"
Controls do not appear on dynamically created user control I have user control named DateTimeUC which has two textboxes on its markup: I am dynamically creating this control in another user control: Controls.Add(GenerateDateTime(parameter)); private DateTimeUC GenerateDateTime(SomeParameter parameter) { DateTimeUC uc =...
TITLE: Controls do not appear on dynamically created user control QUESTION: I have user control named DateTimeUC which has two textboxes on its markup: I am dynamically creating this control in another user control: Controls.Add(GenerateDateTime(parameter)); private DateTimeUC GenerateDateTime(SomeParameter parameter)...
[ "asp.net", "user-controls", "dynamic-controls" ]
5
9
1,879
3
0
2008-09-24T14:15:36.830000
2008-09-24T14:17:27.293000
127,423
127,528
History not visible in VSS, now what?
I've been tasked with "fixing" an old VSS database. At this point in time, we are considering migrating to TFS, but for the time being, if we could get VSS back to a stable condition, it would provide some peace of mind. We're starting to get worried that VSS is going to die on us, because when we try to view the histo...
Is this the issue? http://support.microsoft.com/kb/910793/en-us?spid=10433&sid=global
History not visible in VSS, now what? I've been tasked with "fixing" an old VSS database. At this point in time, we are considering migrating to TFS, but for the time being, if we could get VSS back to a stable condition, it would provide some peace of mind. We're starting to get worried that VSS is going to die on us,...
TITLE: History not visible in VSS, now what? QUESTION: I've been tasked with "fixing" an old VSS database. At this point in time, we are considering migrating to TFS, but for the time being, if we could get VSS back to a stable condition, it would provide some peace of mind. We're starting to get worried that VSS is g...
[ "visual-sourcesafe" ]
1
2
349
1
0
2008-09-24T14:16:16.703000
2008-09-24T14:29:57.030000
127,426
127,516
GNU compiler warning "class has virtual functions but non-virtual destructor"
I have defined an interface in C++, i.e. a class containing only pure virtual functions. I want to explicitly forbid users of the interface to delete the object through a pointer to the interface, so I declared a protected and non-virtual destructor for the interface, something like: class ITest{ public: virtual void d...
It's more or less a bug in the compiler. Note that in more recent versions of the compiler this warning does not get thrown (at least in 4.3 it doesn't). Having the destructor be protected and non-virtual is completely legitimate in your case. See here for an excellent article by Herb Sutter on the subject. From the ar...
GNU compiler warning "class has virtual functions but non-virtual destructor" I have defined an interface in C++, i.e. a class containing only pure virtual functions. I want to explicitly forbid users of the interface to delete the object through a pointer to the interface, so I declared a protected and non-virtual des...
TITLE: GNU compiler warning "class has virtual functions but non-virtual destructor" QUESTION: I have defined an interface in C++, i.e. a class containing only pure virtual functions. I want to explicitly forbid users of the interface to delete the object through a pointer to the interface, so I declared a protected a...
[ "c++", "gcc" ]
59
66
55,974
7
0
2008-09-24T14:16:22.290000
2008-09-24T14:26:09.317000
127,427
127,444
What are the naming conventions that you use while coding?
What are the naming conventions that you use while coding?
I hope we will not discuss prefixes for field names and brace styles here:) Here is my bible for.NET: Also MSDN gives solid guidelines. Another useful source is MS Internal Coding Guidelines
What are the naming conventions that you use while coding? What are the naming conventions that you use while coding?
TITLE: What are the naming conventions that you use while coding? QUESTION: What are the naming conventions that you use while coding? ANSWER: I hope we will not discuss prefixes for field names and brace styles here:) Here is my bible for.NET: Also MSDN gives solid guidelines. Another useful source is MS Internal Co...
[ ".net", "naming-conventions" ]
2
9
1,070
7
0
2008-09-24T14:16:22.867000
2008-09-24T14:17:58.183000
127,440
130,388
How to write a class library for OLE Automation?
I have Excel add-in which I add so many class modules that it is now very bulky. I want to convert it into a type library or a COM package so that I can re-use it for the other apps in the MS Office suite. I ported the add-in to Visual Studio as a class library project but Excel Automation doesn't recognize the classes...
I am assuming since you used the phrase manifest, you are assembling this DLL using a.net development platform VS2003, VS2005 or VS2008 as compared to a VS 6.0 This link provides a detailed set of steps required to register a.NET assembly for use as COM component. The one thing the article doesn't mention that I routin...
How to write a class library for OLE Automation? I have Excel add-in which I add so many class modules that it is now very bulky. I want to convert it into a type library or a COM package so that I can re-use it for the other apps in the MS Office suite. I ported the add-in to Visual Studio as a class library project b...
TITLE: How to write a class library for OLE Automation? QUESTION: I have Excel add-in which I add so many class modules that it is now very bulky. I want to convert it into a type library or a COM package so that I can re-use it for the other apps in the MS Office suite. I ported the add-in to Visual Studio as a class...
[ "com", "activex", "typelib", "ole-automation" ]
0
1
799
2
0
2008-09-24T14:17:29.617000
2008-09-24T22:42:52.913000
127,454
127,601
Contributing to Python
I'm a pretty inexperienced programmer (can make tk apps, text processing, sort of understand oop), but Python is so awesome that I would like to help the community. What's the best way for a beginner to contribute?
Add to the docs. it is downright crappy Help out other users on the dev and user mailing lists. TEST PYTHON. bugs in programming languages are real bad. And I have seen someone discover atleast 1 bug in python Frequent the #python channel on irc.freenode.net
Contributing to Python I'm a pretty inexperienced programmer (can make tk apps, text processing, sort of understand oop), but Python is so awesome that I would like to help the community. What's the best way for a beginner to contribute?
TITLE: Contributing to Python QUESTION: I'm a pretty inexperienced programmer (can make tk apps, text processing, sort of understand oop), but Python is so awesome that I would like to help the community. What's the best way for a beginner to contribute? ANSWER: Add to the docs. it is downright crappy Help out other ...
[ "python" ]
13
7
1,203
7
0
2008-09-24T14:20:06.163000
2008-09-24T14:43:35.827000
127,461
127,473
SQL Server Management Studio won't start
A coworker of mine has this problem, apparently after installing Re#, which seems totally irrelevant. But perhaps it isn't. Could not load file or assembly "SqlManagerUi, Version=9.0.242.0..." or one of its dependencies. The module was expected to contain an assembly manifest. (mscorlib). Why is this? Thanks
Management studio requires the.Net framework. Try removing/reinstalling it.
SQL Server Management Studio won't start A coworker of mine has this problem, apparently after installing Re#, which seems totally irrelevant. But perhaps it isn't. Could not load file or assembly "SqlManagerUi, Version=9.0.242.0..." or one of its dependencies. The module was expected to contain an assembly manifest. (...
TITLE: SQL Server Management Studio won't start QUESTION: A coworker of mine has this problem, apparently after installing Re#, which seems totally irrelevant. But perhaps it isn't. Could not load file or assembly "SqlManagerUi, Version=9.0.242.0..." or one of its dependencies. The module was expected to contain an as...
[ "sql-server" ]
1
0
20,981
4
0
2008-09-24T14:20:42.060000
2008-09-24T14:21:57.627000
127,474
127,755
looking for simulated annealing implementation in VB
Is anyone aware of a reasonably well documented example of simulated annealing in Visual Basic that I can examine and adapt?
This project looks pretty well documented: http://www.codeproject.com/KB/recipes/simulatedAnnealingTSP.aspx. It's C# but contains only one important source file (TravellingSalesmanProblem.cs) so it's pretty easy to run it through a converter. Maybe: http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx? MSDN maga...
looking for simulated annealing implementation in VB Is anyone aware of a reasonably well documented example of simulated annealing in Visual Basic that I can examine and adapt?
TITLE: looking for simulated annealing implementation in VB QUESTION: Is anyone aware of a reasonably well documented example of simulated annealing in Visual Basic that I can examine and adapt? ANSWER: This project looks pretty well documented: http://www.codeproject.com/KB/recipes/simulatedAnnealingTSP.aspx. It's C...
[ "vb.net", "algorithm", "vb6", "simulated-annealing" ]
3
3
3,593
2
0
2008-09-24T14:22:04.677000
2008-09-24T15:11:37.633000
127,477
4,650,392
Detecting WPF Validation Errors
In WPF you can setup validation based on errors thrown in your Data Layer during Data Binding using the ExceptionValidationRule or DataErrorValidationRule. Suppose you had a bunch of controls set up this way and you had a Save button. When the user clicks the Save button, you need to make sure there are no validation e...
This post was extremely helpful. Thanks to all who contributed. Here is a LINQ version that you will either love or hate. private void CanExecute(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = IsValid(sender as DependencyObject); } private bool IsValid(DependencyObject obj) { // The dependency object is ...
Detecting WPF Validation Errors In WPF you can setup validation based on errors thrown in your Data Layer during Data Binding using the ExceptionValidationRule or DataErrorValidationRule. Suppose you had a bunch of controls set up this way and you had a Save button. When the user clicks the Save button, you need to mak...
TITLE: Detecting WPF Validation Errors QUESTION: In WPF you can setup validation based on errors thrown in your Data Layer during Data Binding using the ExceptionValidationRule or DataErrorValidationRule. Suppose you had a bunch of controls set up this way and you had a Save button. When the user clicks the Save butto...
[ "wpf", "validation", "data-binding" ]
123
147
71,052
11
0
2008-09-24T14:22:10.700000
2011-01-10T18:59:56.813000
127,514
127,520
Resizing Controls in MFC
I am writing a program which has two panes (via CSplitter ), however I am having problems figuring out out to resize the controls in each frame. For simplicity, can someone tell me how I would do it for a basic frame with a single CEdit control? I'm fairly sure it is to do with the CEdit::OnSize() function... But I'm n...
When your frame receives an OnSize message it will give you the new width and height - you can simply call the CEdit SetWindowPos method passing it these values. Assume CMyPane is your splitter pane and it contains a CEdit you created in OnCreate called m_wndEdit: void CMyPane::OnSize(UINT nType, int cx, int cy) { m_wn...
Resizing Controls in MFC I am writing a program which has two panes (via CSplitter ), however I am having problems figuring out out to resize the controls in each frame. For simplicity, can someone tell me how I would do it for a basic frame with a single CEdit control? I'm fairly sure it is to do with the CEdit::OnSiz...
TITLE: Resizing Controls in MFC QUESTION: I am writing a program which has two panes (via CSplitter ), however I am having problems figuring out out to resize the controls in each frame. For simplicity, can someone tell me how I would do it for a basic frame with a single CEdit control? I'm fairly sure it is to do wit...
[ "c++", "mfc" ]
14
10
45,442
8
0
2008-09-24T14:25:58.240000
2008-09-24T14:28:10.200000
127,530
127,859
How do I reorder the fields/columns in a SharePoint view?
I'm adding a new field to a list and view. To add the field to the view, I'm using this code: view.ViewFields.Add("My New Field"); However this just tacks it on to the end of the view. How do I add the field to a particular column, or rearrange the field order? view.ViewFields is an SPViewFieldCollection object that in...
I've found removing all items from the list and readding them in the order that I'd like works well (although a little drastic). Here is the code I'm using: string[] fieldNames = new string[] { "Title", "My New Field", "Modified", "Created" }; SPViewFieldCollection viewFields = view.ViewFields; viewFields.DeleteAll(); ...
How do I reorder the fields/columns in a SharePoint view? I'm adding a new field to a list and view. To add the field to the view, I'm using this code: view.ViewFields.Add("My New Field"); However this just tacks it on to the end of the view. How do I add the field to a particular column, or rearrange the field order? ...
TITLE: How do I reorder the fields/columns in a SharePoint view? QUESTION: I'm adding a new field to a list and view. To add the field to the view, I'm using this code: view.ViewFields.Add("My New Field"); However this just tacks it on to the end of the view. How do I add the field to a particular column, or rearrange...
[ "sharepoint" ]
4
3
9,110
4
0
2008-09-24T14:30:59.367000
2008-09-24T15:25:25.897000
127,534
127,562
Should I allow 'allow_url_fopen' in PHP?
We have a couple of developers asking for allow_url_fopen to be enabled on our server. What's the norm these days and if libcurl is enabled is there really any good reason to allow? Environment is: Windows 2003, PHP 5.2.6, FastCGI
You definitely want allow_url_include set to Off, which mitigates many of the risks of allow_url_fopen as well. But because not all versions of PHP have allow_url_include, best practice for many is to turn off fopen. Like with all features, the reality is that if you don't need it for your application, disable it. If y...
Should I allow 'allow_url_fopen' in PHP? We have a couple of developers asking for allow_url_fopen to be enabled on our server. What's the norm these days and if libcurl is enabled is there really any good reason to allow? Environment is: Windows 2003, PHP 5.2.6, FastCGI
TITLE: Should I allow 'allow_url_fopen' in PHP? QUESTION: We have a couple of developers asking for allow_url_fopen to be enabled on our server. What's the norm these days and if libcurl is enabled is there really any good reason to allow? Environment is: Windows 2003, PHP 5.2.6, FastCGI ANSWER: You definitely want a...
[ "php", "configuration" ]
36
20
101,098
5
0
2008-09-24T14:31:18.447000
2008-09-24T14:37:31.800000
127,556
127,589
WPF ListBoxItem selection problem
I have a listbox where the items contain checkboxes: The problem I'm having is that when I click on the checkbox or its content, the parent ListBoxItem does not get selected. If I click on the white space next to the checkbox, the ListBoxItem does get selected. The behavior that I'm trying to get is to be able to selec...
To begin with, put the content outside the CheckBox: After that, you will need to ensure that pressing space on a ListBoxItem results in the CheckBox being checked. There are a number of ways of doing this, including a simple event handler on the ListBoxItem. Or you could specify a handler for UIElement.KeyUp or whatev...
WPF ListBoxItem selection problem I have a listbox where the items contain checkboxes: The problem I'm having is that when I click on the checkbox or its content, the parent ListBoxItem does not get selected. If I click on the white space next to the checkbox, the ListBoxItem does get selected. The behavior that I'm tr...
TITLE: WPF ListBoxItem selection problem QUESTION: I have a listbox where the items contain checkboxes: The problem I'm having is that when I click on the checkbox or its content, the parent ListBoxItem does not get selected. If I click on the white space next to the checkbox, the ListBoxItem does get selected. The be...
[ "wpf", "listbox" ]
19
10
21,469
4
0
2008-09-24T14:36:58.433000
2008-09-24T14:42:04.303000
127,563
127,622
Does Cache activity prevent IIS from unloading an ASP.NET app?
I want to add a scheduled task to a client's ASP.NET app. These posts cover the idea well: https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/ What is the Best Practice to Kick-off Maintenance Process on ASP.NET "Out of Band" Processing Techiniques for asp.net applications My question has two parts:...
Unfortunately, outside the range of changing timeout configuration (which I believe to be possible in Web.config, though I don't know what is and isn't allowed on hosting providers, most of which use Medium Trust) I don't believe there is any other method to keep the application from ending beyond web requests. One thi...
Does Cache activity prevent IIS from unloading an ASP.NET app? I want to add a scheduled task to a client's ASP.NET app. These posts cover the idea well: https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/ What is the Best Practice to Kick-off Maintenance Process on ASP.NET "Out of Band" Processing ...
TITLE: Does Cache activity prevent IIS from unloading an ASP.NET app? QUESTION: I want to add a scheduled task to a client's ASP.NET app. These posts cover the idea well: https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/ What is the Best Practice to Kick-off Maintenance Process on ASP.NET "Out of...
[ "asp.net" ]
2
4
728
1
0
2008-09-24T14:37:34.967000
2008-09-24T14:47:59.560000
127,572
127,632
How do I programmatically close an InfoPath form in C#?
Is it possible to close an InfoPath form programmatically? I know that it can be configured as a form rule / action but I want to close the form via code.
Use the ApplicationClass.XDocuments.Close method and pass it your document object: using System; using Microsoft.Office.Interop.InfoPath; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var app = new ApplicationClass(); var uri = @".\form1.xml"; var doc = app.XDocuments.Open(uri, 0); ...
How do I programmatically close an InfoPath form in C#? Is it possible to close an InfoPath form programmatically? I know that it can be configured as a form rule / action but I want to close the form via code.
TITLE: How do I programmatically close an InfoPath form in C#? QUESTION: Is it possible to close an InfoPath form programmatically? I know that it can be configured as a form rule / action but I want to close the form via code. ANSWER: Use the ApplicationClass.XDocuments.Close method and pass it your document object:...
[ "c#", "infopath" ]
3
2
7,221
1
0
2008-09-24T14:38:31.563000
2008-09-24T14:50:15.250000
127,592
128,004
How to make an International Soundex?
E.g. the Soundex algorithm is optimized for English. Is there a more universal algorithm that would apply across large families of languages?
SOUNDEX is indeed English-oriented. Two others that take a wider variety of phonetic differences into account are: Double Metaphone and NYSIIS. They produce encodings into a much larger possible space than SOUNDEX does. Double Metaphone, specifically, includes reductions with the express purpose of handling alternate p...
How to make an International Soundex? E.g. the Soundex algorithm is optimized for English. Is there a more universal algorithm that would apply across large families of languages?
TITLE: How to make an International Soundex? QUESTION: E.g. the Soundex algorithm is optimized for English. Is there a more universal algorithm that would apply across large families of languages? ANSWER: SOUNDEX is indeed English-oriented. Two others that take a wider variety of phonetic differences into account are...
[ "soundex" ]
18
16
1,694
1
0
2008-09-24T14:42:26.343000
2008-09-24T15:51:59.097000
127,598
132,670
Flex: Loading assets into externally loaded modules
So, I have Flex project that loads a Module using the ModuleManager - not the module loader. The problem that I'm having is that to load an external asset (like a video or image) the path to load that asset has to be relative to the Module swf...not relative to the swf that loaded the module. The question is - How can ...
You can import mx.core.Application and then use Application.application.url to get the path of the host application in your module and use that as the basis for building the URLs. For help in dealing with URLs, see the URLUtil class in the standard Flex libraries and the URI class in the as3corelib project.
Flex: Loading assets into externally loaded modules So, I have Flex project that loads a Module using the ModuleManager - not the module loader. The problem that I'm having is that to load an external asset (like a video or image) the path to load that asset has to be relative to the Module swf...not relative to the sw...
TITLE: Flex: Loading assets into externally loaded modules QUESTION: So, I have Flex project that loads a Module using the ModuleManager - not the module loader. The problem that I'm having is that to load an external asset (like a video or image) the path to load that asset has to be relative to the Module swf...not ...
[ "apache-flex", "flash", "actionscript-3" ]
3
2
2,780
2
0
2008-09-24T14:43:11.053000
2008-09-25T11:14:42.997000
127,599
128,773
Transferring extended ascii characters with unknown encoding to a Twisted XMLRPC from C#
Basically I want to pass a string which contains Spanish text that could be in one of several encodings (Latin-1, CP-1252, or UTF-8 to name a few). Once it gets to the XMLRPC I can detect the encoding, but I won't know it before then. C#, by default seems to be killing any characters outside of ASCII. I've gotten aroun...
I don't think there is really a better way then base64 encoding. As long as you do not know the encoding, you have no other possibility as to handle it as a byte array. The only change I would suggest is to make this explicit by using a byte[] parameter instead of a string and letting the XmlRpc library to take care of...
Transferring extended ascii characters with unknown encoding to a Twisted XMLRPC from C# Basically I want to pass a string which contains Spanish text that could be in one of several encodings (Latin-1, CP-1252, or UTF-8 to name a few). Once it gets to the XMLRPC I can detect the encoding, but I won't know it before th...
TITLE: Transferring extended ascii characters with unknown encoding to a Twisted XMLRPC from C# QUESTION: Basically I want to pass a string which contains Spanish text that could be in one of several encodings (Latin-1, CP-1252, or UTF-8 to name a few). Once it gets to the XMLRPC I can detect the encoding, but I won't...
[ "c#", "encoding", "twisted", "xml-rpc" ]
1
2
1,150
1
0
2008-09-24T14:43:22.240000
2008-09-24T18:02:33.307000
127,606
128,023
Editing XML as a dictionary in python?
I'm trying to generate customized xml files from a template xml file in python. Conceptually, I want to read in the template xml, remove some elements, change some text attributes, and write the new xml out to a file. I wanted it to work something like this: conf_base = ConvertXmlToDict('config-template.xml') conf_base...
For easy manipulation of XML in python, I like the Beautiful Soup library. It works something like this: Sample XML File: leaf1 leaf2 Python code: from BeautifulSoup import BeautifulStoneSoup, Tag, NavigableString soup = BeautifulStoneSoup('config-template.xml') # get the parser for the xml file soup.contents[0].name ...
Editing XML as a dictionary in python? I'm trying to generate customized xml files from a template xml file in python. Conceptually, I want to read in the template xml, remove some elements, change some text attributes, and write the new xml out to a file. I wanted it to work something like this: conf_base = ConvertXml...
TITLE: Editing XML as a dictionary in python? QUESTION: I'm trying to generate customized xml files from a template xml file in python. Conceptually, I want to read in the template xml, remove some elements, change some text attributes, and write the new xml out to a file. I wanted it to work something like this: conf...
[ "python", "xml", "dictionary" ]
8
8
14,347
8
0
2008-09-24T14:44:45.777000
2008-09-24T15:56:06.323000
127,608
276,671
What are the access restrictions on accessing a DSN
We are running part of our app as a windows service and it needs to b able to access DSNs in order to import through ODBC. However there seem to be a lot of restrictions found through trial and error on what DSNs it can access. For example it seems that it cannot 1. access a system DSN unless the account that is runnin...
This is somewhere between your #1 and #2: sometimes correct file permissions are also necessary. I once had troubles on a Vista machine connecting to a DB2 DSN because, for whatever reason (maybe to write out temp files; although I don't know why it would do such a thing in this location instead of a user-specific one)...
What are the access restrictions on accessing a DSN We are running part of our app as a windows service and it needs to b able to access DSNs in order to import through ODBC. However there seem to be a lot of restrictions found through trial and error on what DSNs it can access. For example it seems that it cannot 1. a...
TITLE: What are the access restrictions on accessing a DSN QUESTION: We are running part of our app as a windows service and it needs to b able to access DSNs in order to import through ODBC. However there seem to be a lot of restrictions found through trial and error on what DSNs it can access. For example it seems t...
[ "c++", "windows-services", "odbc", "dsn" ]
0
1
1,382
3
0
2008-09-24T14:44:52.377000
2008-11-09T23:30:54.133000
127,610
127,843
How to programmatically change the work flow between SSIS control flow tasks?
I have an SSIS package, which depending on a boolean variable, should either go to a Script Task or an Email task.(Note: the paths are coming from a Script Task) I recall in the old dts designer there was a way to do this via code. What is the proper way to accomplish this in SSIS?
Isn't a Conditional Split a data flow task, which takes a row of data and pushes it in one of two directions according to some property of the data??? Oops, that is correct. I found this blog entry which explains how to do proper control flow conditional branching based on boolean values.
How to programmatically change the work flow between SSIS control flow tasks? I have an SSIS package, which depending on a boolean variable, should either go to a Script Task or an Email task.(Note: the paths are coming from a Script Task) I recall in the old dts designer there was a way to do this via code. What is th...
TITLE: How to programmatically change the work flow between SSIS control flow tasks? QUESTION: I have an SSIS package, which depending on a boolean variable, should either go to a Script Task or an Email task.(Note: the paths are coming from a Script Task) I recall in the old dts designer there was a way to do this vi...
[ "sql-server", "ssis" ]
3
5
8,688
3
0
2008-09-24T14:44:54.200000
2008-09-24T15:21:36.017000
127,615
127,660
WinForms in Excel (2002) and add-ons
Good morning, I am about to start writing an Excel add-in for Excel 2002. The add-in needs to call a form. Obviously, I can write the form within VBA. My question is -- is there an easy/good way of calling a.NET (I am using 3.5) from Excel, and have the form be able to write stuff back to Excel the same way a native Ex...
Office XP... yes, functionally you can manipulate excel from add-in or the other way around, but obviously it requires more coding compared to VBA. Most powerful solution is to use OLE automation, but it is not the easiest one to code and support. If you really need it and have this option - get something like http://w...
WinForms in Excel (2002) and add-ons Good morning, I am about to start writing an Excel add-in for Excel 2002. The add-in needs to call a form. Obviously, I can write the form within VBA. My question is -- is there an easy/good way of calling a.NET (I am using 3.5) from Excel, and have the form be able to write stuff b...
TITLE: WinForms in Excel (2002) and add-ons QUESTION: Good morning, I am about to start writing an Excel add-in for Excel 2002. The add-in needs to call a form. Obviously, I can write the form within VBA. My question is -- is there an easy/good way of calling a.NET (I am using 3.5) from Excel, and have the form be abl...
[ ".net", "forms", "excel", "add-on" ]
3
2
216
1
0
2008-09-24T14:46:01.953000
2008-09-24T14:56:03.957000
127,625
127,744
Which design is better for a class that simply runs a self-contained computation?
I'm currently working on a class that calculates the difference between two objects. I'm trying to decide what the best design for this class would be. I see two options: 1) Single-use class instance. Takes the objects to diff in the constructor and calculates the diff for that. public class MyObjDiffer { public MyObjD...
Use Object-Oriented Programming Use option 2, but do not make it static. The Strategy Pattern This way, an instance MyObjDiffer can be passed to anyone that needs a Strategy for computing the difference between objects. If, down the road, you find that different rules are used for computation in different contexts, you...
Which design is better for a class that simply runs a self-contained computation? I'm currently working on a class that calculates the difference between two objects. I'm trying to decide what the best design for this class would be. I see two options: 1) Single-use class instance. Takes the objects to diff in the cons...
TITLE: Which design is better for a class that simply runs a self-contained computation? QUESTION: I'm currently working on a class that calculates the difference between two objects. I'm trying to decide what the best design for this class would be. I see two options: 1) Single-use class instance. Takes the objects t...
[ "language-agnostic", "oop" ]
0
3
231
8
0
2008-09-24T14:48:28.857000
2008-09-24T15:09:51.833000
127,630
141,163
Is there a good tool for MySQL that will help me optimise my queries and index settings?
I use MySQL in a fairly complex web site (PHP driven). Ideally, there would be a tool I could use that would help me test the SQL queries I am using and suggest better table indexes that will improve performance and avoid table scans. Failing that, something that will tell me exactly what each query is up to, so I can ...
Here's some info about EXPLAIN (referenced from the High Performance MySQL book from O'Reilly): When you run an EXPLAIN on a query, it tells you everything MySQL knows about that query in the form of reports for each table involved in the query. Each of these reports will tell you... the ID of the table (in the query) ...
Is there a good tool for MySQL that will help me optimise my queries and index settings? I use MySQL in a fairly complex web site (PHP driven). Ideally, there would be a tool I could use that would help me test the SQL queries I am using and suggest better table indexes that will improve performance and avoid table sca...
TITLE: Is there a good tool for MySQL that will help me optimise my queries and index settings? QUESTION: I use MySQL in a fairly complex web site (PHP driven). Ideally, there would be a tool I could use that would help me test the SQL queries I am using and suggest better table indexes that will improve performance a...
[ "mysql", "optimization" ]
10
21
15,524
6
0
2008-09-24T14:50:04.440000
2008-09-26T18:34:23.733000
127,638
127,658
prevent mime faking on php uploads
Is there a way to prevent someone from faking a mime type on a file upload and then running a php/exe/etc... I have to make the file upload directory writeable and executable so that the files can be stored, but this allows anyone to run a script after. One thing I can do is add random data to the file name so they can...
The file upload directory should not be accessible to the web browser. I.e. don't allow somebody to upload a file, say " remove_all_my_files.php ", and then execute it on your system by giving the url to it, say " http://xample.com/uploads/remove_all_my_files.php ".
prevent mime faking on php uploads Is there a way to prevent someone from faking a mime type on a file upload and then running a php/exe/etc... I have to make the file upload directory writeable and executable so that the files can be stored, but this allows anyone to run a script after. One thing I can do is add rando...
TITLE: prevent mime faking on php uploads QUESTION: Is there a way to prevent someone from faking a mime type on a file upload and then running a php/exe/etc... I have to make the file upload directory writeable and executable so that the files can be stored, but this allows anyone to run a script after. One thing I c...
[ "php", "security" ]
0
2
616
4
0
2008-09-24T14:51:52.047000
2008-09-24T14:55:29.760000
127,645
127,770
Is it possible to retrieve the call stack programmatically in VB6?
When an error occurs in a function, I'd like to know the sequence of events that lead up to it, especially when that function is called from a dozen different places. Is there any way to retrieve the call stack in VB6, or do I have to do it the hard way (e.g., log entries in every function and error handler, etc.)?
I'm pretty sure you have to do it the hard way. At a previous job of mine, we had a very elegant error handling process for VB6 with DCOM components. However, it was a lot redundant code that had to be added to every method, so much that we had home-grown tools to insert it all for you. I can't provide too much insight...
Is it possible to retrieve the call stack programmatically in VB6? When an error occurs in a function, I'd like to know the sequence of events that lead up to it, especially when that function is called from a dozen different places. Is there any way to retrieve the call stack in VB6, or do I have to do it the hard way...
TITLE: Is it possible to retrieve the call stack programmatically in VB6? QUESTION: When an error occurs in a function, I'd like to know the sequence of events that lead up to it, especially when that function is called from a dozen different places. Is there any way to retrieve the call stack in VB6, or do I have to ...
[ "vb6", "runtime", "callstack" ]
14
9
17,323
5
0
2008-09-24T14:53:15.990000
2008-09-24T15:13:31.497000
127,692
131,070
SVN performance after many revisions
My project is currently using a svn repository which gains several hundred new revisions per day. The repository resides on a Win2k3-server and is served through Apache/mod_dav_svn. I now fear that over time the performance will degrade due to too many revisions. Is this fear reasonable? We are already planning to upgr...
What type of repo do you have? FSFS or BDB? (Let's assume FSFS for now, since that's the default.) In the case of FSFS, each revision is stored as a diff against the previous. So, you would think that yes, after many revisions, it would be very slow. However, this isn't the case. FSFS uses what are called "skip deltas"...
SVN performance after many revisions My project is currently using a svn repository which gains several hundred new revisions per day. The repository resides on a Win2k3-server and is served through Apache/mod_dav_svn. I now fear that over time the performance will degrade due to too many revisions. Is this fear reason...
TITLE: SVN performance after many revisions QUESTION: My project is currently using a svn repository which gains several hundred new revisions per day. The repository resides on a Win2k3-server and is served through Apache/mod_dav_svn. I now fear that over time the performance will degrade due to too many revisions. I...
[ "performance", "svn", "repository", "fsfs" ]
50
60
34,845
9
0
2008-09-24T15:00:32.637000
2008-09-25T01:54:19.350000
127,693
146,820
Firefox XPCOM component - Permission denied to call method UnnamedClass
Can a firefox XPCOM component read and write page content across multiple pages? Scenario: A bunch of local HTML and javascript files. A "Main.html" file opens a window "pluginWindow", and creates a plugin using: netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); var obj = Components.classes[cid]...
First, is your C++ code really a plugin or an XPCOM component, possibly installed as part of an extension? Sounds like it's the later. If so, it's not usable from untrusted JS code - any web page or a local HTML file. It's fully usable from privileged code, the most common type of which is the extension code. You're wo...
Firefox XPCOM component - Permission denied to call method UnnamedClass Can a firefox XPCOM component read and write page content across multiple pages? Scenario: A bunch of local HTML and javascript files. A "Main.html" file opens a window "pluginWindow", and creates a plugin using: netscape.security.PrivilegeManager....
TITLE: Firefox XPCOM component - Permission denied to call method UnnamedClass QUESTION: Can a firefox XPCOM component read and write page content across multiple pages? Scenario: A bunch of local HTML and javascript files. A "Main.html" file opens a window "pluginWindow", and creates a plugin using: netscape.security...
[ "firefox", "xpcom", "firefox-3" ]
2
1
3,910
2
0
2008-09-24T15:00:37.300000
2008-09-28T21:44:37.690000
127,696
130,380
What can you do with SharePoint on Intranet?
We have had SharePoint where I work for a little while now, but we've not done a lot with it. We have an intranet with hundreds of ASP/ASP.Net applications and I'm wondering what kind of things can be done to integrate with SharePoint to make a more seamless environment? We put documentation and production move request...
A great idea for you would be move your most used asp.net apps to run within the SharePoint site. Each app can be added either as a control directly on a pagelayout or integrated into a webpart (use the webpart to load child controls). This would allow you to use the flexible moss interface to move the asp.net app into...
What can you do with SharePoint on Intranet? We have had SharePoint where I work for a little while now, but we've not done a lot with it. We have an intranet with hundreds of ASP/ASP.Net applications and I'm wondering what kind of things can be done to integrate with SharePoint to make a more seamless environment? We ...
TITLE: What can you do with SharePoint on Intranet? QUESTION: We have had SharePoint where I work for a little while now, but we've not done a lot with it. We have an intranet with hundreds of ASP/ASP.Net applications and I'm wondering what kind of things can be done to integrate with SharePoint to make a more seamles...
[ "sharepoint", "integration", "intranet" ]
2
2
6,663
9
0
2008-09-24T15:00:45.473000
2008-09-24T22:41:29.063000
127,704
127,856
Algorithm to return all combinations of k elements from n
I want to write a function that takes an array of letters as an argument and a number of those letters to select. Say you provide an array of 8 letters and want to select 3 letters from that. Then you should get: 8! / ((8 - 3)! * 3!) = 56 Arrays (or words) in return consisting of 3 letters each.
Art of Computer Programming Volume 4: Fascicle 3 has a ton of these that might fit your particular situation better than how I describe. Gray Codes An issue that you will come across is of course memory and pretty quickly, you'll have problems by 20 elements in your set -- 20 C 3 = 1140. And if you want to iterate over...
Algorithm to return all combinations of k elements from n I want to write a function that takes an array of letters as an argument and a number of those letters to select. Say you provide an array of 8 letters and want to select 3 letters from that. Then you should get: 8! / ((8 - 3)! * 3!) = 56 Arrays (or words) in re...
TITLE: Algorithm to return all combinations of k elements from n QUESTION: I want to write a function that takes an array of letters as an argument and a number of those letters to select. Say you provide an array of 8 letters and want to select 3 letters from that. Then you should get: 8! / ((8 - 3)! * 3!) = 56 Array...
[ "algorithm", "combinations" ]
645
456
559,455
77
0
2008-09-24T15:02:24.957000
2008-09-24T15:24:50.300000
127,708
127,733
Catching Exceptions in a Spawned Process
I'm using VS2008 to debug an application that starts a new process. I believe that the spawned process is suffering (and handling) some kind of CLR exception during its start-up, but it is not being caught by turning on CLR Exception Notification in Debug -> Exceptions. Any suggestions on how I can see where the except...
You can add a call to Debugger.Launch() in your process startup code. This will launch a debugger (typically giving you the choice of using the running copy of VS2008 or a new copy) attached to the process. The same trick is handy for debugging Service startup issues.
Catching Exceptions in a Spawned Process I'm using VS2008 to debug an application that starts a new process. I believe that the spawned process is suffering (and handling) some kind of CLR exception during its start-up, but it is not being caught by turning on CLR Exception Notification in Debug -> Exceptions. Any sugg...
TITLE: Catching Exceptions in a Spawned Process QUESTION: I'm using VS2008 to debug an application that starts a new process. I believe that the spawned process is suffering (and handling) some kind of CLR exception during its start-up, but it is not being caught by turning on CLR Exception Notification in Debug -> Ex...
[ "visual-studio-2008", "debugging", "exception" ]
2
5
293
5
0
2008-09-24T15:02:48.853000
2008-09-24T15:08:08.233000
127,713
127,729
Why does "piping" a CharBuffer hang?
Why does the following method hang? public void pipe(Reader in, Writer out) { CharBuffer buf = CharBuffer.allocate(DEFAULT_BUFFER_SIZE); while( in.read(buf) >= 0 ) { out.append(buf.flip()); } }
Answering my own question: you have to call buf.clear() between read s. Presumably, read is hanging because the buffer is full. The correct code is public void pipe(Reader in, Writer out) { CharBuffer buf = CharBuffer.allocate(DEFAULT_BUFFER_SIZE); while( in.read(buf) >= 0 ) { out.append(buf.flip()); buf.clear(); } }
Why does "piping" a CharBuffer hang? Why does the following method hang? public void pipe(Reader in, Writer out) { CharBuffer buf = CharBuffer.allocate(DEFAULT_BUFFER_SIZE); while( in.read(buf) >= 0 ) { out.append(buf.flip()); } }
TITLE: Why does "piping" a CharBuffer hang? QUESTION: Why does the following method hang? public void pipe(Reader in, Writer out) { CharBuffer buf = CharBuffer.allocate(DEFAULT_BUFFER_SIZE); while( in.read(buf) >= 0 ) { out.append(buf.flip()); } } ANSWER: Answering my own question: you have to call buf.clear() betwee...
[ "java", "io", "pipe" ]
0
1
274
3
0
2008-09-24T15:03:58.837000
2008-09-24T15:07:41.370000
127,736
219,303
How to implement a Decorator with non-local equality?
Greetings, currently I am refactoring one of my programs, and I found an interesting problem. I have Transitions in an automata. Transitions always have a start-state and an end-state. Some Transitions have a label, which encodes a certain Action that must be performed upon traversal. No label means no action. Some tra...
I think its clear that nobody really understands your question. I would suggest putting it in context and making it shorter. As an example, here's one possible implementation of the state pattern in python, please study it to get an idea. class State(object): def __init__(self, name): self.name = name def __repr__(sel...
How to implement a Decorator with non-local equality? Greetings, currently I am refactoring one of my programs, and I found an interesting problem. I have Transitions in an automata. Transitions always have a start-state and an end-state. Some Transitions have a label, which encodes a certain Action that must be perfor...
TITLE: How to implement a Decorator with non-local equality? QUESTION: Greetings, currently I am refactoring one of my programs, and I found an interesting problem. I have Transitions in an automata. Transitions always have a start-state and an end-state. Some Transitions have a label, which encodes a certain Action t...
[ "python", "decorator", "multiple-inheritance" ]
2
2
609
2
0
2008-09-24T15:08:50.213000
2008-10-20T17:53:19.683000
127,739
127,775
Can anyone explain this PHP code using json_encode and json_decode?
$a = '{ "tag": " " }'; echo json_encode( json_decode($a) ); This outputs: {"tag":" <\/b>"} when you would think it would output exactly the input. For some reason json_encode adds an extra slash.
Because it's part of the JSON standard http://json.org/ char any-Unicode-character- except-"-or-\-or- control-character \" \\ \/ <---- see here? \b \f \n \r \t \u four-hex-digits
Can anyone explain this PHP code using json_encode and json_decode? $a = '{ "tag": " " }'; echo json_encode( json_decode($a) ); This outputs: {"tag":" <\/b>"} when you would think it would output exactly the input. For some reason json_encode adds an extra slash.
TITLE: Can anyone explain this PHP code using json_encode and json_decode? QUESTION: $a = '{ "tag": " " }'; echo json_encode( json_decode($a) ); This outputs: {"tag":" <\/b>"} when you would think it would output exactly the input. For some reason json_encode adds an extra slash. ANSWER: Because it's part of the JSON...
[ "php", "json" ]
2
18
2,614
4
0
2008-09-24T15:09:20.460000
2008-09-24T15:14:27.673000
127,753
331,854
Java idiom for "piping"
Is there a more concise/standard idiom (e.g., a JDK method) for "piping" an input to an output in Java than the following? public void pipe(Reader in, Writer out) { CharBuffer buf = CharBuffer.allocate(DEFAULT_BUFFER_SIZE); while (in.read(buf) >= 0 ) { out.append(buf.flip()); buf.clear(); } } [EDIT] Please note the Rea...
IOUtils from the Apache Commons project has a number of utilily methods that do exactly what you need. IOUtils.copy(in, out) will perform a buffered copy of all input to the output. If there is more than one spot in your codebase that requires Stream or Reader / Writer handling, using IOUtils could be a good idea.
Java idiom for "piping" Is there a more concise/standard idiom (e.g., a JDK method) for "piping" an input to an output in Java than the following? public void pipe(Reader in, Writer out) { CharBuffer buf = CharBuffer.allocate(DEFAULT_BUFFER_SIZE); while (in.read(buf) >= 0 ) { out.append(buf.flip()); buf.clear(); } } [E...
TITLE: Java idiom for "piping" QUESTION: Is there a more concise/standard idiom (e.g., a JDK method) for "piping" an input to an output in Java than the following? public void pipe(Reader in, Writer out) { CharBuffer buf = CharBuffer.allocate(DEFAULT_BUFFER_SIZE); while (in.read(buf) >= 0 ) { out.append(buf.flip()); b...
[ "java", "io", "pipe" ]
9
10
2,470
3
0
2008-09-24T15:11:16.650000
2008-12-01T19:10:48.607000
127,761
131,722
Php debugging with Aptana Studio and Xdebug or Zend debugger on OS X
Have you managed to get Aptana Studio debugging to work? I tried following this, but I don't see Windows -> Preferences -> Aptana -> Editors -> PHP -> PHP Interpreters in my menu (I have PHP plugin installed) and any attempt to set up the servers menu gives me "socket error" when I try to debug. Xdebug is installed, co...
I've been using ZendDebugger with Eclipse (on OS X) for a while now and it works great! Here's the recipe that's worked well for me. install Eclipse PDT via "All in one" package at: http://www.zend.com/en/community/pdt install ZendDebugger.so ( http://www.zend.com/en/community/pdt ) configure your php.ini w/ the ZendDe...
Php debugging with Aptana Studio and Xdebug or Zend debugger on OS X Have you managed to get Aptana Studio debugging to work? I tried following this, but I don't see Windows -> Preferences -> Aptana -> Editors -> PHP -> PHP Interpreters in my menu (I have PHP plugin installed) and any attempt to set up the servers menu...
TITLE: Php debugging with Aptana Studio and Xdebug or Zend debugger on OS X QUESTION: Have you managed to get Aptana Studio debugging to work? I tried following this, but I don't see Windows -> Preferences -> Aptana -> Editors -> PHP -> PHP Interpreters in my menu (I have PHP plugin installed) and any attempt to set u...
[ "php", "debugging", "macos", "aptana", "xdebug" ]
3
3
23,885
3
0
2008-09-24T15:12:24.697000
2008-09-25T06:29:04.213000
127,771
142,600
How do you pre allocate memory to a process in solaris?
My problem is: I have a perl script which uses lot of memory (expected behaviour because of caching). But, I noticed that the more I do caching, slower it gets and the process spends most of the time in sleep mode. I thought pre-allocating memory to the process might speed up the performance. Does someone have any idea...
What I gathered from your posting and comments is this: Your program gets slow when memory use rises Your pogram increasingly spends time sleeping, not computing. Most likely eplanation: Sleeping means waiting for a resource to become available. In this case the resource most likely is memory. Use the vmstat 1 command ...
How do you pre allocate memory to a process in solaris? My problem is: I have a perl script which uses lot of memory (expected behaviour because of caching). But, I noticed that the more I do caching, slower it gets and the process spends most of the time in sleep mode. I thought pre-allocating memory to the process mi...
TITLE: How do you pre allocate memory to a process in solaris? QUESTION: My problem is: I have a perl script which uses lot of memory (expected behaviour because of caching). But, I noticed that the more I do caching, slower it gets and the process spends most of the time in sleep mode. I thought pre-allocating memory...
[ "unix", "memory", "solaris" ]
1
4
3,959
10
0
2008-09-24T15:13:57.547000
2008-09-27T00:25:00.020000
127,776
127,820
Where can you find the C# Language Specifications?
Where can I find the specifications for the various C# languages? (EDIT: it appears people voted down because you could 'google' this, however, my original intent was to put an answer with information not found on google. I've accepted the answer with the best google results, as they are relevant to people who haven't ...
Microsoft's version (probably what you want) The formal standardised versions (via ECMA, created just so they could say it was "standardised" by some external body. Even though ECMA "standards" are effectively "Insert cash, vend standard"). Further ECMA standards
Where can you find the C# Language Specifications? Where can I find the specifications for the various C# languages? (EDIT: it appears people voted down because you could 'google' this, however, my original intent was to put an answer with information not found on google. I've accepted the answer with the best google r...
TITLE: Where can you find the C# Language Specifications? QUESTION: Where can I find the specifications for the various C# languages? (EDIT: it appears people voted down because you could 'google' this, however, my original intent was to put an answer with information not found on google. I've accepted the answer with...
[ "c#", "visual-studio" ]
12
12
2,496
5
0
2008-09-24T15:14:35.673000
2008-09-24T15:19:06.163000
127,780
127,800
Is every DDL SQL command reversible? [database version control]
I want to setup a mechanism for tracking DB schema changes, such the one described in this answer: For every change you make to the database, you write a new migration. Migrations typically have two methods: an "up" method in which the changes are applied and a "down" method in which the changes are undone. A single co...
in sql server every DDL command that i know of is an up/down pair.
Is every DDL SQL command reversible? [database version control] I want to setup a mechanism for tracking DB schema changes, such the one described in this answer: For every change you make to the database, you write a new migration. Migrations typically have two methods: an "up" method in which the changes are applied ...
TITLE: Is every DDL SQL command reversible? [database version control] QUESTION: I want to setup a mechanism for tracking DB schema changes, such the one described in this answer: For every change you make to the database, you write a new migration. Migrations typically have two methods: an "up" method in which the ch...
[ "sql", "version-control", "migration", "ddl" ]
3
4
1,192
3
0
2008-09-24T15:14:58.373000
2008-09-24T15:16:28.307000
127,794
133,412
Child Control Initialization in Custom Composite in ASP.NET
Part of the series of controls I am working on obviously involves me lumping some of them together in to composites. I am rapidly starting to learn that this takes consideration (this is all new to me!):) I basically have a StyledWindow control, which is essentially a glorified Panel with ability to do other bits (like...
Solved! Right, I was determined to get this cracked today! Here were my thoughts: I thought the use of Panel was a bit of a hack, so I should remove it and find out how it is really done. I didn't want to have to do something like MyCtl.Controls[0].Controls to access the controls added to the composite. I wanted the da...
Child Control Initialization in Custom Composite in ASP.NET Part of the series of controls I am working on obviously involves me lumping some of them together in to composites. I am rapidly starting to learn that this takes consideration (this is all new to me!):) I basically have a StyledWindow control, which is essen...
TITLE: Child Control Initialization in Custom Composite in ASP.NET QUESTION: Part of the series of controls I am working on obviously involves me lumping some of them together in to composites. I am rapidly starting to learn that this takes consideration (this is all new to me!):) I basically have a StyledWindow contr...
[ "asp.net", "controls", "custom-server-controls" ]
4
1
3,483
4
0
2008-09-24T15:16:11.910000
2008-09-25T13:41:47.590000
127,807
127,854
What does a scrum master do all day?
To quote wikipedia: Scrum is facilitated by a ScrumMaster, whose primary job is to remove impediments to the ability of the team to deliver the sprint goal. The ScrumMaster is not the leader of the team (as they are self-organizing) but acts as a buffer between the team and any distracting influences. The ScrumMaster e...
Please note: this question and answer is over twelve years old. The consensus understanding of the role of scrum master has moved on massively since then and so I no longer view this as a valid answer to the question, let alone one worthy of being the accepted answer. By all means downvote it. Beyond that, pay it no he...
What does a scrum master do all day? To quote wikipedia: Scrum is facilitated by a ScrumMaster, whose primary job is to remove impediments to the ability of the team to deliver the sprint goal. The ScrumMaster is not the leader of the team (as they are self-organizing) but acts as a buffer between the team and any dist...
TITLE: What does a scrum master do all day? QUESTION: To quote wikipedia: Scrum is facilitated by a ScrumMaster, whose primary job is to remove impediments to the ability of the team to deliver the sprint goal. The ScrumMaster is not the leader of the team (as they are self-organizing) but acts as a buffer between the...
[ "scrum", "methodology" ]
62
8
73,615
17
0
2008-09-24T15:17:36.930000
2008-09-24T15:24:34.637000
127,817
127,840
C# 3.0 - Object initializer
I'm having a little problem and I don't see why, it's easy to go around it, but still I want to understand. I have the following class: public class AccountStatement: IAccountStatement { public IList StatementCharges { get; set; } public AccountStatement() { new AccountStatement(new Period(new NullDate().DateTime,newN...
This code: public AccountStatement() { new AccountStatement(new Period(new NullDate().DateTime,newNullDate().DateTime), 0); } is undoubtedly not what you wanted. That makes a second instance of AccountStatement and does nothing with it. I think what you meant was this instead: public AccountStatement(): this(new Period...
C# 3.0 - Object initializer I'm having a little problem and I don't see why, it's easy to go around it, but still I want to understand. I have the following class: public class AccountStatement: IAccountStatement { public IList StatementCharges { get; set; } public AccountStatement() { new AccountStatement(new Period(...
TITLE: C# 3.0 - Object initializer QUESTION: I'm having a little problem and I don't see why, it's easy to go around it, but still I want to understand. I have the following class: public class AccountStatement: IAccountStatement { public IList StatementCharges { get; set; } public AccountStatement() { new AccountSta...
[ "c#", ".net-3.5" ]
2
18
638
4
0
2008-09-24T15:19:03.027000
2008-09-24T15:21:23.973000
127,832
146,026
How do I bind an ASP.net ajax AccordionPane to an XMLDatasource?
I've got an angry boss that will beat me down if I waste another day on this:-P Many karma points to the ajax guru who can solve my dilemma. But more detail: I want to have an AccordionPane that grabs a bunch of links from an XML source and populate itself from said source.
There might be a sexier way, but this works. Populate your data source however you wish. This was just for demo purposes. Ditto for PrettyTitle() Key is to remember there are two item types in the accordion. Accordion Binding And codebehind is: Using System; using System.Web.UI.WebControls; using System.Xml; namespace...
How do I bind an ASP.net ajax AccordionPane to an XMLDatasource? I've got an angry boss that will beat me down if I waste another day on this:-P Many karma points to the ajax guru who can solve my dilemma. But more detail: I want to have an AccordionPane that grabs a bunch of links from an XML source and populate itsel...
TITLE: How do I bind an ASP.net ajax AccordionPane to an XMLDatasource? QUESTION: I've got an angry boss that will beat me down if I waste another day on this:-P Many karma points to the ajax guru who can solve my dilemma. But more detail: I want to have an AccordionPane that grabs a bunch of links from an XML source ...
[ "asp.net", "data-binding", "asp.net-ajax", "accordionpane" ]
0
0
5,239
1
0
2008-09-24T15:20:02.323000
2008-09-28T14:55:21.933000
127,842
131,533
ASP.NET Ajax - Asynch request has separate session?
We are writing a search application that saves the search criteria to session state and executes the search inside of an asp.net updatepanel. Sometimes when we execute multiple searches successively the 2nd or 3rd search will sometimes return results from the first set of search criteria. Example: our first search we d...
There are not multiple sessions between normal ASP.NET page loads, postbacks, and ASP.NET AJAX partial postbacks. I can tell you that with certainty. Rather than storing the search string in the session, how about just using the search TextBox's contents directly? I can't think of any reason why you'd need to shuffle i...
ASP.NET Ajax - Asynch request has separate session? We are writing a search application that saves the search criteria to session state and executes the search inside of an asp.net updatepanel. Sometimes when we execute multiple searches successively the 2nd or 3rd search will sometimes return results from the first se...
TITLE: ASP.NET Ajax - Asynch request has separate session? QUESTION: We are writing a search application that saves the search criteria to session state and executes the search inside of an asp.net updatepanel. Sometimes when we execute multiple searches successively the 2nd or 3rd search will sometimes return results...
[ "asp.net", "ajax", "session", "asp.net-ajax" ]
5
4
5,119
4
0
2008-09-24T15:21:29.887000
2008-09-25T04:52:46.723000
127,869
128,031
SAX vs XmlTextReader - SAX in C#
I am attempting to read a large XML document and I wanted to do it in chunks vs XmlDocument 's way of reading the entire file into memory. I know I can use XmlTextReader to do this but I was wondering if anyone has used SAX for.NET? I know Java developers swear by it and I was wondering if it is worth giving it a try a...
If you're talking about SAX for.NET, the project doesn't appear to be maintained. The last release was more than 2 years ago. Maybe they got it perfect on the last release, but I wouldn't bet on it. The author, Karl Waclawek, seems to have disappeared off the net. As for SAX under Java? You bet, it's great. Unfortunate...
SAX vs XmlTextReader - SAX in C# I am attempting to read a large XML document and I wanted to do it in chunks vs XmlDocument 's way of reading the entire file into memory. I know I can use XmlTextReader to do this but I was wondering if anyone has used SAX for.NET? I know Java developers swear by it and I was wondering...
TITLE: SAX vs XmlTextReader - SAX in C# QUESTION: I am attempting to read a large XML document and I wanted to do it in chunks vs XmlDocument 's way of reading the entire file into memory. I know I can use XmlTextReader to do this but I was wondering if anyone has used SAX for.NET? I know Java developers swear by it a...
[ "c#", "java", "xml", "sax" ]
12
8
13,286
4
0
2008-09-24T15:26:43.663000
2008-09-24T15:58:09.017000
127,878
127,948
Source Safe 6.0d and Visual Studio 2005 project tree problems
Whenever I try to add a new project to my SourceSafe repository it creates 3 folders with the same name nested within each other. There is only one folder on my drive yet in Sourcesafe there are 3?? Can anyone suggest what may be causing this? Thanks
If you drag and rop a new project folder into VSS and do a recursive add then that's just how it works. Otherwise you have to create your own root project folder in VSS and add each file one at a time to VSS by hand.
Source Safe 6.0d and Visual Studio 2005 project tree problems Whenever I try to add a new project to my SourceSafe repository it creates 3 folders with the same name nested within each other. There is only one folder on my drive yet in Sourcesafe there are 3?? Can anyone suggest what may be causing this? Thanks
TITLE: Source Safe 6.0d and Visual Studio 2005 project tree problems QUESTION: Whenever I try to add a new project to my SourceSafe repository it creates 3 folders with the same name nested within each other. There is only one folder on my drive yet in Sourcesafe there are 3?? Can anyone suggest what may be causing th...
[ "visual-studio-2005", "visual-sourcesafe" ]
2
1
979
3
0
2008-09-24T15:28:49.713000
2008-09-24T15:40:17.673000
127,884
128,237
How to add Announcement list/webpart to Publishing Portal
I have a Publishing Portal site and I need to add some announcements to some of the pages. I've read an article which says that i have to create an announcement list to be able add an announcement web part but i can't seem to find any resources on how i can add an announcement list. Any help will be greatly appreciated...
From the home page of your site (or from any page really) you should see a "View All Site Content" link on the top of the navigation menu. View All Site Content http://friendfeed.s3.amazonaws.com/86fed07f0809beefaeeaee0013ee2b952079bc09 Click on that link and it will show you a dashboard listing all of the SharePoint l...
How to add Announcement list/webpart to Publishing Portal I have a Publishing Portal site and I need to add some announcements to some of the pages. I've read an article which says that i have to create an announcement list to be able add an announcement web part but i can't seem to find any resources on how i can add ...
TITLE: How to add Announcement list/webpart to Publishing Portal QUESTION: I have a Publishing Portal site and I need to add some announcements to some of the pages. I've read an article which says that i have to create an announcement list to be able add an announcement web part but i can't seem to find any resources...
[ "list", "sharepoint" ]
4
3
34,358
3
0
2008-09-24T15:29:48.337000
2008-09-24T16:34:14.580000
127,886
128,045
What should the view file/directory structure be in ASP.NET MVC?
I'm confused with how views are organized, and it is important to understand this as ASP.NET MVC uses conventions to get everything working right. Under the views directory, there are subdirectories. Inside these subdirectories are views. I'm assuming that the subdirectories map to controllers, and the controllers act ...
View directory naming and file naming are important, because the ASP.NET MVC framework makes certain assumptions about them. If you do not conform to these assumptions, then you must write code to let the framework know what you are doing. Generally speaking, you should conform to these assumptions unless you have a go...
What should the view file/directory structure be in ASP.NET MVC? I'm confused with how views are organized, and it is important to understand this as ASP.NET MVC uses conventions to get everything working right. Under the views directory, there are subdirectories. Inside these subdirectories are views. I'm assuming tha...
TITLE: What should the view file/directory structure be in ASP.NET MVC? QUESTION: I'm confused with how views are organized, and it is important to understand this as ASP.NET MVC uses conventions to get everything working right. Under the views directory, there are subdirectories. Inside these subdirectories are views...
[ "asp.net-mvc", "directory-structure" ]
8
7
2,168
2
0
2008-09-24T15:30:21.317000
2008-09-24T16:00:42.960000
127,912
219,121
How to use win32api from IronPython
Writing some test scripts in IronPython, I want to verify whether a window is displayed or not. I have the pid of the main app's process, and want to get a list of window titles that are related to the pid. I was trying to avoid using win32api calls, such as FindWindowEx, since (to my knowledge) you cannot access win32...
The article below shows how to access the win32api indirectly from IronPython. It uses CSharpCodeProvider CompileAssemblyFromSource method to compile an assembly in memory from the supplied C# source code string. IronPython can then import the assembly. Dynamically compiling C# from IronPython
How to use win32api from IronPython Writing some test scripts in IronPython, I want to verify whether a window is displayed or not. I have the pid of the main app's process, and want to get a list of window titles that are related to the pid. I was trying to avoid using win32api calls, such as FindWindowEx, since (to m...
TITLE: How to use win32api from IronPython QUESTION: Writing some test scripts in IronPython, I want to verify whether a window is displayed or not. I have the pid of the main app's process, and want to get a list of window titles that are related to the pid. I was trying to avoid using win32api calls, such as FindWin...
[ "c#", "winapi", "ironpython" ]
3
2
5,091
3
0
2008-09-24T15:34:49.900000
2008-10-20T16:48:41.187000
127,918
127,975
ASP .Net server control events order
Which are the events of an ASP.Net server control and how does their order relate to the containing page's events? The concrete problem is that I am looking for an event inside the server control that fires before the Page_Load event of the containing page.
With regards to how they relate to Page events, at least for Init and Load: "Although both Init and Load recursively occur on each control, they happen in reverse order. The Init event (and also the Unload event) for each child control occur before the corresponding event is raised for its container (bottom-up). Howeve...
ASP .Net server control events order Which are the events of an ASP.Net server control and how does their order relate to the containing page's events? The concrete problem is that I am looking for an event inside the server control that fires before the Page_Load event of the containing page.
TITLE: ASP .Net server control events order QUESTION: Which are the events of an ASP.Net server control and how does their order relate to the containing page's events? The concrete problem is that I am looking for an event inside the server control that fires before the Page_Load event of the containing page. ANSWER...
[ ".net", "asp.net", "events" ]
3
5
3,115
5
0
2008-09-24T15:35:22.410000
2008-09-24T15:45:19.003000
127,929
128,408
Why Aren't All My WinForm Controls and Forms Localizing?
Greetings all, I'm trying to localize a.NET/C# project. I'm using string resource files and setting the "Localizable" property on all my forms to 'True'. The assembly culture is empty. The resx/resource files are successfully passed through Lingobit, resgen, and al. When running the localized executables, some of my fo...
When you open the form in Visual Studio, if you change the Language property of the Form to the language you are localizing to, does the same problem exist there? Could it be possible that the non-localized forms/buttons still have the English text set even in the localized resources?
Why Aren't All My WinForm Controls and Forms Localizing? Greetings all, I'm trying to localize a.NET/C# project. I'm using string resource files and setting the "Localizable" property on all my forms to 'True'. The assembly culture is empty. The resx/resource files are successfully passed through Lingobit, resgen, and ...
TITLE: Why Aren't All My WinForm Controls and Forms Localizing? QUESTION: Greetings all, I'm trying to localize a.NET/C# project. I'm using string resource files and setting the "Localizable" property on all my forms to 'True'. The assembly culture is empty. The resx/resource files are successfully passed through Ling...
[ "c#", ".net", "localization" ]
1
2
1,212
3
0
2008-09-24T15:37:14.857000
2008-09-24T17:07:29.477000
127,932
127,980
Working copy XXX locked and cleanup failed in SVN
I get this error when I do an svn update: Working copy XXXXXXXX locked Please execute "Cleanup" command When I run cleanup, I get Cleanup failed to process the following paths: XXXXXXXX How do I get out of this loop?
One approach would be to: Copy edited items to another location. Delete the folder containing the problem path. Update the containing folder through Subversion. Copy your files back or merge changes as needed. Commit Another option would be to delete the top level folder and check out again. Hopefully it doesn't come t...
Working copy XXX locked and cleanup failed in SVN I get this error when I do an svn update: Working copy XXXXXXXX locked Please execute "Cleanup" command When I run cleanup, I get Cleanup failed to process the following paths: XXXXXXXX How do I get out of this loop?
TITLE: Working copy XXX locked and cleanup failed in SVN QUESTION: I get this error when I do an svn update: Working copy XXXXXXXX locked Please execute "Cleanup" command When I run cleanup, I get Cleanup failed to process the following paths: XXXXXXXX How do I get out of this loop? ANSWER: One approach would be to: ...
[ "svn", "tortoisesvn" ]
602
525
938,481
50
0
2008-09-24T15:37:37.943000
2008-09-24T15:47:13.240000
127,936
128,704
Deleting Custom Event Log Source Without Using Code
I have an application that has created a number of custom event log sources to help filter its output. How can I delete the custom sources from the machine WITHOUT writing any code as running a quick program using System.Diagnostics.EventLog.Delete is not possible. I've tried using RegEdit to remove the custom sources ...
I also think you're in the right place... it's stored in the registry, under the name of the event log. I have a custom event log, under which are multiple event sources. HKLM\System\CurrentControlSet\Services\Eventlog\LOGNAME\LOGSOURCE1 HKLM\System\CurrentControlSet\Services\Eventlog\LOGNAME\LOGSOURCE2 Those sources h...
Deleting Custom Event Log Source Without Using Code I have an application that has created a number of custom event log sources to help filter its output. How can I delete the custom sources from the machine WITHOUT writing any code as running a quick program using System.Diagnostics.EventLog.Delete is not possible. I'...
TITLE: Deleting Custom Event Log Source Without Using Code QUESTION: I have an application that has created a number of custom event log sources to help filter its output. How can I delete the custom sources from the machine WITHOUT writing any code as running a quick program using System.Diagnostics.EventLog.Delete i...
[ "c#", "windows", "event-log" ]
49
51
49,585
4
0
2008-09-24T15:38:26.477000
2008-09-24T17:55:19.003000
127,974
128,020
Nested SELECT Statement
SQL is not my forte, but I'm working on it - thank you for the replies. I am working on a report that will return the completion percent of services for indiviudals in our contracts. There is a master table "Contracts," each individual Contract can have multiple services from the "services" table, each service has mult...
I'm not sure if I understand the problem, if the result is ok for a service_contract you canContract Service SELECT con.ContractId, con.Contract, conSer.Contract_ServiceID, conSer.Service, (SUM(CompletionPercentage)/COUNT(CompletionPercentage)) * 100 as "Percent Complete" FROM dbo.Standard sta WITH (NOLOCK) INNER JOIN ...
Nested SELECT Statement SQL is not my forte, but I'm working on it - thank you for the replies. I am working on a report that will return the completion percent of services for indiviudals in our contracts. There is a master table "Contracts," each individual Contract can have multiple services from the "services" tabl...
TITLE: Nested SELECT Statement QUESTION: SQL is not my forte, but I'm working on it - thank you for the replies. I am working on a report that will return the completion percent of services for indiviudals in our contracts. There is a master table "Contracts," each individual Contract can have multiple services from t...
[ "sql", "sql-server", "t-sql" ]
3
1
2,099
6
0
2008-09-24T15:45:14.277000
2008-09-24T15:55:46.467000
128,008
128,032
When using a HashMap are values and keys guaranteed to be in the same order when iterating?
When I iterate over the values or keys are they going to correlate? Will the second key map to the second value?
No, not necessarily. You should really use the entrySet().iterator() for this purpose. With this iterator, you will be walking through all Map.Entry objects in the Map and can access each key and associated value.
When using a HashMap are values and keys guaranteed to be in the same order when iterating? When I iterate over the values or keys are they going to correlate? Will the second key map to the second value?
TITLE: When using a HashMap are values and keys guaranteed to be in the same order when iterating? QUESTION: When I iterate over the values or keys are they going to correlate? Will the second key map to the second value? ANSWER: No, not necessarily. You should really use the entrySet().iterator() for this purpose. W...
[ "java", "collections", "hashmap" ]
9
14
11,229
9
0
2008-09-24T15:53:45.970000
2008-09-24T15:58:14.960000
128,011
128,033
Add dismiss control to session-flash() output in CakePHP
In a CakePHP 1.2 app, I'm using flash();?> to output messages like "Record edited". It's working great. However, I want to add a link called "Dismiss" that will fade out the message. I know how to construct the link, but I don't know how to insert into the output of the flass message. The flash message wraps itself in ...
Figured this out: Create a new layout in your layouts folder: layouts/message.ctp In that layout, include the call to output the content: Then when you set the flash message, specify the layout to use: $this->Session->setFlash('Your record has been created! Wicked!','message');
Add dismiss control to session-flash() output in CakePHP In a CakePHP 1.2 app, I'm using flash();?> to output messages like "Record edited". It's working great. However, I want to add a link called "Dismiss" that will fade out the message. I know how to construct the link, but I don't know how to insert into the output...
TITLE: Add dismiss control to session-flash() output in CakePHP QUESTION: In a CakePHP 1.2 app, I'm using flash();?> to output messages like "Record edited". It's working great. However, I want to add a link called "Dismiss" that will fade out the message. I know how to construct the link, but I don't know how to inse...
[ "php", "cakephp", "cakephp-1.2" ]
0
1
1,502
4
0
2008-09-24T15:54:11.633000
2008-09-24T15:58:22.607000
128,012
128,329
Variable UITableCellView height with subview
I want to create a UITableView with varying row heights, and I'm trying to accomplish this by creating UILabels inside the UITableViewCells. Here's my code so far: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *MyIdentifier = @"EntryCell"; UITab...
The UITableViewDelegate defines an optional method heightForRowAtIndexPath, which will get you started. You then need to use sizeWithFont. There is some discussion of your precise problem here: http://www.v2ex.com/2008/09/18/how-to-make-uitableviewcell-have-variable-height/ Text sizing was also discussed in this thread
Variable UITableCellView height with subview I want to create a UITableView with varying row heights, and I'm trying to accomplish this by creating UILabels inside the UITableViewCells. Here's my code so far: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static...
TITLE: Variable UITableCellView height with subview QUESTION: I want to create a UITableView with varying row heights, and I'm trying to accomplish this by creating UILabels inside the UITableViewCells. Here's my code so far: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)...
[ "iphone", "cocoa-touch", "uitableview", "user-interface" ]
8
11
7,709
3
0
2008-09-24T15:54:26.390000
2008-09-24T16:53:06.297000
128,016
128,040
Java, Swing: how do I set the maximum width of a JTextField?
I'm writing a custom file selection component. In my UI, first the user clicks a button, which pops a JFileChooser; when it is closed, the absolute path of the selected file is written to a JTextField. The problem is, absolute paths are usually long, which causes the text field to enlarge, making its container too wide...
It may depend on the layout manager your text field is in. Some layout managers expand and some do not. Some expand only in some cases, others always. I'm assuming you're doing filedNameTextField = new JTextField(80); // 80 == columns If so, for most reasonable layouts, the field should not change size (at least, it sh...
Java, Swing: how do I set the maximum width of a JTextField? I'm writing a custom file selection component. In my UI, first the user clicks a button, which pops a JFileChooser; when it is closed, the absolute path of the selected file is written to a JTextField. The problem is, absolute paths are usually long, which ca...
TITLE: Java, Swing: how do I set the maximum width of a JTextField? QUESTION: I'm writing a custom file selection component. In my UI, first the user clicks a button, which pops a JFileChooser; when it is closed, the absolute path of the selected file is written to a JTextField. The problem is, absolute paths are usua...
[ "java", "swing", "jtextfield" ]
9
13
41,722
3
0
2008-09-24T15:55:16.530000
2008-09-24T16:00:00.840000
128,028
128,703
Best way to safely read query string parameters?
We have a project that generates a code snippet that can be used on various other projects. The purpose of the code is to read two parameters from the query string and assign them to the "src" attribute of an iframe. For example, the page at the URL http://oursite/Page.aspx?a=1&b=2 would have JavaScript in it to read t...
Upadte Sep 2022: Most JS runtimes now have a URL type which exposes query parameters via the searchParams property. You need to supply a base URL even if you just want to get URL parameters from a relative URL, but it's better than rolling your own. let searchParams/*: URLSearchParams*/ = new URL( myUrl, // Supply a ba...
Best way to safely read query string parameters? We have a project that generates a code snippet that can be used on various other projects. The purpose of the code is to read two parameters from the query string and assign them to the "src" attribute of an iframe. For example, the page at the URL http://oursite/Page.a...
TITLE: Best way to safely read query string parameters? QUESTION: We have a project that generates a code snippet that can be used on various other projects. The purpose of the code is to read two parameters from the query string and assign them to the "src" attribute of an iframe. For example, the page at the URL htt...
[ "javascript", "security", "parameters" ]
5
12
7,514
5
0
2008-09-24T15:57:33.497000
2008-09-24T17:55:18.517000
128,034
128,400
Why should I use Flex?
In a recent conversation, I mentioned that I was using JavaScript for a web application. That comment prompted a response: "You should use Flex instead. It will cut your development time down and JavaScript is too hard to debug and maintain. You need to use the right tool for the right job." Now, I don't know too much ...
I would push you towards standard web development technologies in most cases. Javascript is no longer a great challenge to debug or maintain with good libs like jQuery/Prototype to iron out some of the browser inconsistencies and tools like Firebug and the MS script debugger to help with debugging. There are cases when...
Why should I use Flex? In a recent conversation, I mentioned that I was using JavaScript for a web application. That comment prompted a response: "You should use Flex instead. It will cut your development time down and JavaScript is too hard to debug and maintain. You need to use the right tool for the right job." Now,...
TITLE: Why should I use Flex? QUESTION: In a recent conversation, I mentioned that I was using JavaScript for a web application. That comment prompted a response: "You should use Flex instead. It will cut your development time down and JavaScript is too hard to debug and maintain. You need to use the right tool for th...
[ "javascript", "apache-flex" ]
14
12
3,465
11
0
2008-09-24T15:58:23.057000
2008-09-24T17:05:44.487000