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
87,458
87,516
Can you specify filenames using wildcards or regexes in the subversion mv command?
I want to do this so that I can say something like, svn mv *.php php-folder/, but it does not seem to be working. Is it even possible? No mention of it is made on the relevant page in the svn book. Example output of svn mv *.php php-folder/: svn: Client error in parsing arguments Being able to move a whole file system ...
Not sure about svn itself, but either your shell should be able to expand that wildcard and svn can take multiple source arguments, or you can use something like for file in *.php; do svn mv $file php-folder/; done in a bash shell, for example.
Can you specify filenames using wildcards or regexes in the subversion mv command? I want to do this so that I can say something like, svn mv *.php php-folder/, but it does not seem to be working. Is it even possible? No mention of it is made on the relevant page in the svn book. Example output of svn mv *.php php-fold...
TITLE: Can you specify filenames using wildcards or regexes in the subversion mv command? QUESTION: I want to do this so that I can say something like, svn mv *.php php-folder/, but it does not seem to be working. Is it even possible? No mention of it is made on the relevant page in the svn book. Example output of svn...
[ "svn" ]
6
10
16,405
4
0
2008-09-17T20:43:04.360000
2008-09-17T20:48:00.823000
87,468
87,533
How might I pass variables through to cached content in PHP?
Essentially I have a PHP page that calls out some other HTML to be rendered through an object's method. It looks like this: MY PHP PAGE: // some content... renderSomeHTML();?> // some content... renderSomeHTML();?> The first method call is cached, but I need renderSomeHTML() to display slightly different based upon it...
Obviously, you cannot. The whole point of caching is that the 'thing' you cache is not going to change. So you either: provide a parameter aviod caching invalidate the cache when you set a different parameter Or, you rewrite the cache mechanism yourself - to support some dynamic binding.
How might I pass variables through to cached content in PHP? Essentially I have a PHP page that calls out some other HTML to be rendered through an object's method. It looks like this: MY PHP PAGE: // some content... renderSomeHTML();?> // some content... renderSomeHTML();?> The first method call is cached, but I need...
TITLE: How might I pass variables through to cached content in PHP? QUESTION: Essentially I have a PHP page that calls out some other HTML to be rendered through an object's method. It looks like this: MY PHP PAGE: // some content... renderSomeHTML();?> // some content... renderSomeHTML();?> The first method call is ...
[ "php", "caching", "variables" ]
0
3
527
3
0
2008-09-17T20:43:45.017000
2008-09-17T20:49:59.930000
87,514
87,538
How many DataTable objects should I use in my C# app?
I'm an experienced programmer in a legacy (yet object oriented) development tool and making the switch to C#/.Net. I'm writing a small single user app using SQL server CE 3.5. I've read the conceptual DataSet and related doc and my code works. Now I want to make sure that I'm doing it "right", get some feedback from ex...
For CE, it's probably a non issue. If you were pushing this app to thousands of users and they were all hitting a centralized DB, you might want to spend some time on optimization. In a single-user instance DB like CE, unless you've got data that says you need to optimize, I wouldn't spend any time worrying about it. P...
How many DataTable objects should I use in my C# app? I'm an experienced programmer in a legacy (yet object oriented) development tool and making the switch to C#/.Net. I'm writing a small single user app using SQL server CE 3.5. I've read the conceptual DataSet and related doc and my code works. Now I want to make sur...
TITLE: How many DataTable objects should I use in my C# app? QUESTION: I'm an experienced programmer in a legacy (yet object oriented) development tool and making the switch to C#/.Net. I'm writing a small single user app using SQL server CE 3.5. I've read the conceptual DataSet and related doc and my code works. Now ...
[ "c#", ".net", "sql-server", "datatable", "dataset" ]
2
3
1,092
4
0
2008-09-17T20:47:56.533000
2008-09-17T20:50:33.267000
87,522
89,434
If it is decided that our system needs an overhaul, what is the best way to go about it?
We are mainting a web application that is built on Classic ASP using VBScript as the primary language. We are in agreement that our backend (framework if you will) is out dated and doesn't provide us with the proper tools to move forward in a quick manner. We have pretty much embraced the current webMVC pattern that is...
Don't throw away your code! It's the single worst mistake you can make (on a large codebase). See Things You Should Never Do, Part 1. You've invested a lot of effort into that old code and worked out many bugs. Throwing it away is a classic developer mistake (and one I've done many times). It makes you feel "better", l...
If it is decided that our system needs an overhaul, what is the best way to go about it? We are mainting a web application that is built on Classic ASP using VBScript as the primary language. We are in agreement that our backend (framework if you will) is out dated and doesn't provide us with the proper tools to move f...
TITLE: If it is decided that our system needs an overhaul, what is the best way to go about it? QUESTION: We are mainting a web application that is built on Classic ASP using VBScript as the primary language. We are in agreement that our backend (framework if you will) is out dated and doesn't provide us with the prop...
[ "python", "asp-classic", "vbscript" ]
3
7
433
9
0
2008-09-17T20:48:45.610000
2008-09-18T02:19:51.713000
87,541
87,619
Excel column names
What column names cannot be used when creating an Excel spreadsheet with ADO. I have a statement that creates a page in a spreadsheet: CREATE TABLE [TableName] (Column string, Column2 string); I have found that using a column name of Date or Container will generate an error when the statement is executed. Does anyone h...
You can use brackets for any fieldname, e.g.: CREATE TABLE [TableName] ([Date] string, [Container] string) Full example: using (OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\temp\\test.xls;Extended Properties='Excel 8.0;HDR=Yes'")) { conn.Open(); OleDbCommand cmd = new Ole...
Excel column names What column names cannot be used when creating an Excel spreadsheet with ADO. I have a statement that creates a page in a spreadsheet: CREATE TABLE [TableName] (Column string, Column2 string); I have found that using a column name of Date or Container will generate an error when the statement is exec...
TITLE: Excel column names QUESTION: What column names cannot be used when creating an Excel spreadsheet with ADO. I have a statement that creates a page in a spreadsheet: CREATE TABLE [TableName] (Column string, Column2 string); I have found that using a column name of Date or Container will generate an error when the...
[ "excel", "ado.net" ]
0
0
1,425
3
0
2008-09-17T20:50:49.303000
2008-09-17T21:00:02.993000
87,542
100,052
Making WCF easier to configure
I have a set of WCF web services connected to dynamically by a desktop application. My problem is the really detailed config settings that WCF requires to work. Getting SSL to work involves custom settings. Getting MTOM or anything else to work requires more. You want compression? Here we go again... WCF is really powe...
All information about the endpoint is available in metadata of a service, you can write a client what will explore the meta data of the service and will configure the client. For a code example you can look into this excellent Mex Explorer from Juval Lowy.
Making WCF easier to configure I have a set of WCF web services connected to dynamically by a desktop application. My problem is the really detailed config settings that WCF requires to work. Getting SSL to work involves custom settings. Getting MTOM or anything else to work requires more. You want compression? Here we...
TITLE: Making WCF easier to configure QUESTION: I have a set of WCF web services connected to dynamically by a desktop application. My problem is the really detailed config settings that WCF requires to work. Getting SSL to work involves custom settings. Getting MTOM or anything else to work requires more. You want co...
[ ".net", "wcf", "configuration" ]
14
9
11,578
3
0
2008-09-17T20:50:49.600000
2008-09-19T06:30:49.650000
87,557
87,596
In Flex/AS3, how do I get a class definition of an embedded asset with getDefinitionByName
I have a class with many embedded assets. Within the class, I would like to get the class definition of an asset by name. I have tried using getDefinitionByName(), and also ApplicationDomain.currentDomain.getDefinition() but neither work. Example: public class MyClass { [Embed(source="images/image1.png")] private stati...
This doesn't answer your question, but it may solve your problem. I believe doing something like this should work: public class MyClass { [Embed(source="images/image1.png")] private static var Image1Class:Class; [Embed(source="images/image2.png")] private static var Image2Class:Class; [Embed(source="images/image3.png")...
In Flex/AS3, how do I get a class definition of an embedded asset with getDefinitionByName I have a class with many embedded assets. Within the class, I would like to get the class definition of an asset by name. I have tried using getDefinitionByName(), and also ApplicationDomain.currentDomain.getDefinition() but neit...
TITLE: In Flex/AS3, how do I get a class definition of an embedded asset with getDefinitionByName QUESTION: I have a class with many embedded assets. Within the class, I would like to get the class definition of an asset by name. I have tried using getDefinitionByName(), and also ApplicationDomain.currentDomain.getDef...
[ "apache-flex", "flash", "actionscript-3", "actionscript", "embed" ]
5
8
9,260
4
0
2008-09-17T20:52:53.933000
2008-09-17T20:57:33.703000
87,561
87,646
What is your preferred way to produce charts in a Ruby on Rails web application?
I'd like to add some pie, bar and scatter charts to my Ruby on Rails web application. I want want them to be atractive, easy to add and not introduce much overhead. What charting solution would you recommend? What are its drawbacks (requires Javascript, Flash, expensive, etc)?
Google Charts is an excellent choice if you don't want to use Flash. It's pretty easy to use on its own, but for Rails, it's even easier with the gchartrb gem. An example: GoogleChart::PieChart.new('320x200', "Things I Like To Eat", false) do |pc| pc.data "Broccoli", 30 pc.data "Pizza", 20 pc.data "PB&J", 40 pc.data "T...
What is your preferred way to produce charts in a Ruby on Rails web application? I'd like to add some pie, bar and scatter charts to my Ruby on Rails web application. I want want them to be atractive, easy to add and not introduce much overhead. What charting solution would you recommend? What are its drawbacks (requir...
TITLE: What is your preferred way to produce charts in a Ruby on Rails web application? QUESTION: I'd like to add some pie, bar and scatter charts to my Ruby on Rails web application. I want want them to be atractive, easy to add and not introduce much overhead. What charting solution would you recommend? What are its...
[ "ruby-on-rails", "ruby", "charts" ]
76
59
22,577
31
0
2008-09-17T20:53:41.917000
2008-09-17T21:03:57.620000
87,576
90,833
Does anyone have a good example of controlling multiple Excel instances from a .Net app?
We have an Excel 2002/XP based application that interacts with SQL 2000/5 to process fairly complex actuarial calculations. The application performs its function well, but it's difficult to manage. We're trying to create a "controller" application or service that can manage and monitor these various instances of Excel ...
Don't do it! We tried for weeks to get something like that to work and it simply does not behave as advertised. Don't even start - give up immediately! The only options that you really have is a heavy server-side MOSS based implementation - Excel (Web) services (they call it something like that). Windows based COM Exce...
Does anyone have a good example of controlling multiple Excel instances from a .Net app? We have an Excel 2002/XP based application that interacts with SQL 2000/5 to process fairly complex actuarial calculations. The application performs its function well, but it's difficult to manage. We're trying to create a "control...
TITLE: Does anyone have a good example of controlling multiple Excel instances from a .Net app? QUESTION: We have an Excel 2002/XP based application that interacts with SQL 2000/5 to process fairly complex actuarial calculations. The application performs its function well, but it's difficult to manage. We're trying to...
[ "c#", ".net", "vb.net", "excel" ]
2
3
2,765
4
0
2008-09-17T20:55:47.077000
2008-09-18T08:01:33.403000
87,587
210,374
Silverlight DataGrid Control - How do I stop the sorting on a column?
Continuing my problem from yesterday, the Silverlight datagrid I have from this issue is now causing Stack Overflow errors when sorting a column with a large amount of data (Like the text column that contains a where clause for a SQL statment). When you sort, it'll fire the SelectedIndexChanged event for the datagrid a...
I'm only familiar with the WPF version of this datagrid, but try this: Add the CanUserSort="False" attribute on each column you don't want sorted.
Silverlight DataGrid Control - How do I stop the sorting on a column? Continuing my problem from yesterday, the Silverlight datagrid I have from this issue is now causing Stack Overflow errors when sorting a column with a large amount of data (Like the text column that contains a where clause for a SQL statment). When ...
TITLE: Silverlight DataGrid Control - How do I stop the sorting on a column? QUESTION: Continuing my problem from yesterday, the Silverlight datagrid I have from this issue is now causing Stack Overflow errors when sorting a column with a large amount of data (Like the text column that contains a where clause for a SQ...
[ "vb.net", "silverlight", "web-services", "xaml", "datagrid" ]
3
2
1,682
3
0
2008-09-17T20:56:37.573000
2008-10-16T21:26:35.217000
87,603
87,941
What is the equivalent of Oracle's REF CURSOR in Postgresql when using JDBC?
In Oracle I can declare a reference cursor... TYPE t_spool IS REF CURSOR RETURN spool%ROWTYPE;...and use it to pass a cursor as the return value... FUNCTION end_spool RETURN t_spool AS v_spool t_spool; BEGIN COMMIT; OPEN v_spool FOR SELECT * FROM spool WHERE key = g_spool_key ORDER BY seq; RETURN v_spool; END end_spool...
Maybe this will help: http://jdbc.postgresql.org/documentation/83/callproc.html#callproc-resultset-setof I haven't really messed with that before:P
What is the equivalent of Oracle's REF CURSOR in Postgresql when using JDBC? In Oracle I can declare a reference cursor... TYPE t_spool IS REF CURSOR RETURN spool%ROWTYPE;...and use it to pass a cursor as the return value... FUNCTION end_spool RETURN t_spool AS v_spool t_spool; BEGIN COMMIT; OPEN v_spool FOR SELECT * F...
TITLE: What is the equivalent of Oracle's REF CURSOR in Postgresql when using JDBC? QUESTION: In Oracle I can declare a reference cursor... TYPE t_spool IS REF CURSOR RETURN spool%ROWTYPE;...and use it to pass a cursor as the return value... FUNCTION end_spool RETURN t_spool AS v_spool t_spool; BEGIN COMMIT; OPEN v_sp...
[ "java", "oracle", "postgresql", "jdbc", "plsql" ]
1
4
5,373
1
0
2008-09-17T20:58:09.257000
2008-09-17T21:37:50.063000
87,610
87,882
Automated integration testing a C++ app with a database
I am introducing automated integration testing to a mature application that until now has only been manually tested. The app is Windows based and talks to a MySQL database. What is the best way (including details of any tools recommended) to keep tests independent of each other in terms of the database transactions tha...
How are you verifying the results? If you need to query the DB (and it sounds like you probably do) for results then I agree with Kris K, except I would endeavor to rebuild the DB after every test case, not just every suite. This helps avoid dangerous interacting tests As for tools, I would recommend CppUnit. You aren'...
Automated integration testing a C++ app with a database I am introducing automated integration testing to a mature application that until now has only been manually tested. The app is Windows based and talks to a MySQL database. What is the best way (including details of any tools recommended) to keep tests independent...
TITLE: Automated integration testing a C++ app with a database QUESTION: I am introducing automated integration testing to a mature application that until now has only been manually tested. The app is Windows based and talks to a MySQL database. What is the best way (including details of any tools recommended) to keep...
[ "c++", "database", "automated-tests", "integration-testing" ]
8
3
3,280
6
0
2008-09-17T20:59:09.690000
2008-09-17T21:30:44.637000
87,621
87,641
How do I map XML to C# objects
I have an XML that I want to load to objects, manipulate those objects (set values, read values) and then save those XMLs back. It is important for me to have the XML in the structure (xsd) that I created. One way to do that is to write my own serializer, but is there a built in support for it or open source in C# that...
You can generate serializable C# classes from a schema (xsd) using xsd.exe: xsd.exe dependency1.xsd dependency2.xsd schema.xsd /out:outputDir If the schema has dependencies (included/imported schemas), they must all be included on the same command line.
How do I map XML to C# objects I have an XML that I want to load to objects, manipulate those objects (set values, read values) and then save those XMLs back. It is important for me to have the XML in the structure (xsd) that I created. One way to do that is to write my own serializer, but is there a built in support f...
TITLE: How do I map XML to C# objects QUESTION: I have an XML that I want to load to objects, manipulate those objects (set values, read values) and then save those XMLs back. It is important for me to have the XML in the structure (xsd) that I created. One way to do that is to write my own serializer, but is there a ...
[ "c#", "xml", "serialization", "xml-serialization" ]
29
29
68,117
9
0
2008-09-17T21:00:32.103000
2008-09-17T21:03:24.187000
87,676
87,751
What's the best way to manipulate Dates and Timestamps in Java?
Every time I need to work with date and/or timstamps in Java I always feel like I'm doing something wrong and spend endless hours trying to find a better way of working with the APIs without having to code my own Date and Time utility classes. Here's a couple of annoying things I just ran into: 0-based months. I realiz...
This post has a good discussion on comparing the Java Date/Time API vs JODA. I personally just use Gregorian Calendar and SimpleDateFormat any time I need to manipulate dates/times in Java. I've never really had any problems in using the Java API and find it quite easy to use, so have not really looked into any alterna...
What's the best way to manipulate Dates and Timestamps in Java? Every time I need to work with date and/or timstamps in Java I always feel like I'm doing something wrong and spend endless hours trying to find a better way of working with the APIs without having to code my own Date and Time utility classes. Here's a cou...
TITLE: What's the best way to manipulate Dates and Timestamps in Java? QUESTION: Every time I need to work with date and/or timstamps in Java I always feel like I'm doing something wrong and spend endless hours trying to find a better way of working with the APIs without having to code my own Date and Time utility cla...
[ "java", "datetime" ]
22
11
24,497
10
0
2008-09-17T21:07:44.630000
2008-09-17T21:16:00.820000
87,679
92,776
Advice on handling large data volumes
So I have a "large" number of "very large" ASCII files of numerical data (gigabytes altogether), and my program will need to process the entirety of it sequentially at least once. Any advice on storing/loading the data? I've thought of converting the files to binary to make them smaller and for faster loading. Should I...
So then what if the processing requires jumping around in the data for multiple files and multiple buffers? Is constant opening and closing of binary files going to become expensive? I'm a big fan of 'memory mapped i/o', aka 'direct byte buffers'. In Java they are called Mapped Byte Buffers are are part of java.nio. (B...
Advice on handling large data volumes So I have a "large" number of "very large" ASCII files of numerical data (gigabytes altogether), and my program will need to process the entirety of it sequentially at least once. Any advice on storing/loading the data? I've thought of converting the files to binary to make them sm...
TITLE: Advice on handling large data volumes QUESTION: So I have a "large" number of "very large" ASCII files of numerical data (gigabytes altogether), and my program will need to process the entirety of it sequentially at least once. Any advice on storing/loading the data? I've thought of converting the files to bina...
[ "java", "loading", "large-files", "large-data-volumes" ]
7
8
10,858
11
0
2008-09-17T21:08:12.367000
2008-09-18T13:59:08.973000
87,689
92,462
Testing running condition of a Windows app
I have several applications that are part of a suite of tools that various developers at our studio use. these applications are mainly command line apps that open a DOS cmd shell. These apps in turn start up a GUI application that tracks output and status (via sockets) of these command line apps. The command line apps ...
I found the programmatic answer that I was looking for. It has to do with stations. Apparently anything running on the desktop will run on a station with a particular name. Anything that isn't on the desktop (i.e. a process started by the task manager when logged off or on a locked workstation) will get started with a ...
Testing running condition of a Windows app I have several applications that are part of a suite of tools that various developers at our studio use. these applications are mainly command line apps that open a DOS cmd shell. These apps in turn start up a GUI application that tracks output and status (via sockets) of thes...
TITLE: Testing running condition of a Windows app QUESTION: I have several applications that are part of a suite of tools that various developers at our studio use. these applications are mainly command line apps that open a DOS cmd shell. These apps in turn start up a GUI application that tracks output and status (vi...
[ "c++", "windows", "command-line" ]
2
3
1,809
3
0
2008-09-17T21:09:20.150000
2008-09-18T13:20:22.700000
87,692
87,895
How to enter Javascript into a wiki page?
How can I, as the wiki admin, enter scripting (Javascript) into a Sharepoint wiki page? I would like to enter a title and, when clicking on that, having displayed under it a small explanation. I usually have done that with javascript, any other idea?
Assuming you're the administrator of the wiki and are willing display this on mouseover instead of on click, you don't need javascript at all -- you can use straight CSS. Here's an example of the styles and markup: Test Here is the title! Here is a little explanation Here is some page content With some more involved st...
How to enter Javascript into a wiki page? How can I, as the wiki admin, enter scripting (Javascript) into a Sharepoint wiki page? I would like to enter a title and, when clicking on that, having displayed under it a small explanation. I usually have done that with javascript, any other idea?
TITLE: How to enter Javascript into a wiki page? QUESTION: How can I, as the wiki admin, enter scripting (Javascript) into a Sharepoint wiki page? I would like to enter a title and, when clicking on that, having displayed under it a small explanation. I usually have done that with javascript, any other idea? ANSWER: ...
[ "javascript", "html", "sharepoint", "wiki" ]
7
4
18,473
10
0
2008-09-17T21:09:26.717000
2008-09-17T21:32:39.187000
87,695
90,593
Programmatically stream audio in Cocoa on the Mac
How do I go about programmatically creating audio streams using Cocoa on the Mac. To make, say a white-noise generator using core frameworks on Mac OSX in Cocoa apps?
One way is using the CoreAudio DefaultOutputUnit. You can configure it with parameters such as output sampling rate, resolution, and output sample format. Then you can programmatically create a raw sound wave and provide this to the output unit. Take a look at this example on your machine at /Developer/Examples/CoreAud...
Programmatically stream audio in Cocoa on the Mac How do I go about programmatically creating audio streams using Cocoa on the Mac. To make, say a white-noise generator using core frameworks on Mac OSX in Cocoa apps?
TITLE: Programmatically stream audio in Cocoa on the Mac QUESTION: How do I go about programmatically creating audio streams using Cocoa on the Mac. To make, say a white-noise generator using core frameworks on Mac OSX in Cocoa apps? ANSWER: One way is using the CoreAudio DefaultOutputUnit. You can configure it with ...
[ "cocoa", "macos", "audio", "stream" ]
3
4
3,885
2
0
2008-09-17T21:09:48.150000
2008-09-18T06:52:47.547000
87,712
87,901
How do you deal with NULL values in columns of type boolean in MS Access?
I was wondering if there is a better way to cope with MS-Access' inability to handle NULL for boolean-values other than change the column-data-type to integer.
I think you must use a number, and so, it seems does Allen Browne, Access MVP.
How do you deal with NULL values in columns of type boolean in MS Access? I was wondering if there is a better way to cope with MS-Access' inability to handle NULL for boolean-values other than change the column-data-type to integer.
TITLE: How do you deal with NULL values in columns of type boolean in MS Access? QUESTION: I was wondering if there is a better way to cope with MS-Access' inability to handle NULL for boolean-values other than change the column-data-type to integer. ANSWER: I think you must use a number, and so, it seems does Allen ...
[ "database", "ms-access", "null", "odbc", "boolean" ]
1
2
3,754
3
0
2008-09-17T21:11:18.770000
2008-09-17T21:33:16.473000
87,734
88,020
How do you calculate the axis-aligned bounding box of an ellipse?
If the major axis of the ellipse is vertical or horizontal, it's easy to calculate the bounding box, but what about when the ellipse is rotated? The only way I can think of so far is to calculate all the points around the perimeter and find the max/min x and y values. It seems like there should be a simpler way. If the...
You could try using the parametrized equations for an ellipse rotated at an arbitrary angle: x = h + a*cos(t)*cos(phi) - b*sin(t)*sin(phi) [1] y = k + b*sin(t)*cos(phi) + a*cos(t)*sin(phi) [2]...where ellipse has centre (h,k) semimajor axis a and semiminor axis b, and is rotated through angle phi. You can then differen...
How do you calculate the axis-aligned bounding box of an ellipse? If the major axis of the ellipse is vertical or horizontal, it's easy to calculate the bounding box, but what about when the ellipse is rotated? The only way I can think of so far is to calculate all the points around the perimeter and find the max/min x...
TITLE: How do you calculate the axis-aligned bounding box of an ellipse? QUESTION: If the major axis of the ellipse is vertical or horizontal, it's easy to calculate the bounding box, but what about when the ellipse is rotated? The only way I can think of so far is to calculate all the points around the perimeter and ...
[ "math", "graphics", "geometry" ]
38
45
28,211
13
0
2008-09-17T21:13:51.573000
2008-09-17T21:47:13.287000
87,735
87,759
How do you transfer or export SQL Server 2005 data to Excel
I have a simple SQL 'Select' query, and I'd like to dump the results into an Excel file. I'm only able to save as.csv and converting to.xls creates some super ugly output. In any case, as far as I can tell (using Google) this doesn't seem to be so straight forward. Any help would be greatly appreciated.
Use "External data" from Excel. It can use ODBC connection to fetch data from external source: Data/Get External Data/New Database Query That way, even if the data in the database changes, you can easily refresh.
How do you transfer or export SQL Server 2005 data to Excel I have a simple SQL 'Select' query, and I'd like to dump the results into an Excel file. I'm only able to save as.csv and converting to.xls creates some super ugly output. In any case, as far as I can tell (using Google) this doesn't seem to be so straight for...
TITLE: How do you transfer or export SQL Server 2005 data to Excel QUESTION: I have a simple SQL 'Select' query, and I'd like to dump the results into an Excel file. I'm only able to save as.csv and converting to.xls creates some super ugly output. In any case, as far as I can tell (using Google) this doesn't seem to ...
[ "sql", "sql-server" ]
47
41
260,258
14
0
2008-09-17T21:14:24.083000
2008-09-17T21:16:38.570000
87,747
87,993
How do you determine what SQL Tables have an identity column programmatically
I want to create a list of columns in SQL Server 2005 that have identity columns and their corresponding table in T-SQL. Results would be something like: TableName, ColumnName
Another potential way to do this for SQL Server, which has less reliance on the system tables (which are subject to change, version to version) is to use the INFORMATION_SCHEMA views: select COLUMN_NAME, TABLE_NAME from INFORMATION_SCHEMA.COLUMNS where COLUMNPROPERTY(object_id(TABLE_SCHEMA+'.'+TABLE_NAME), COLUMN_NAME,...
How do you determine what SQL Tables have an identity column programmatically I want to create a list of columns in SQL Server 2005 that have identity columns and their corresponding table in T-SQL. Results would be something like: TableName, ColumnName
TITLE: How do you determine what SQL Tables have an identity column programmatically QUESTION: I want to create a list of columns in SQL Server 2005 that have identity columns and their corresponding table in T-SQL. Results would be something like: TableName, ColumnName ANSWER: Another potential way to do this for SQ...
[ "sql-server", "t-sql", "metadata", "identity-column" ]
113
189
148,569
14
0
2008-09-17T21:15:36.763000
2008-09-17T21:44:11.173000
87,760
239,656
Why do some conversions from wmv to flv with ffmpeg fail?
Ive been smashing my head with this for a while. I have 2 completely identical.wmv files encoded with wmv3 codec. I put them both through ffmpeg with the following command: /usr/bin/ffmpeg -i file.wmv -ar 44100 -ab 64k -qscale 9 -s 512x384 -f flv file.flv One file converts just fine, and gives me the following output: ...
It is in fact the audio format, which causes trouble. Audio formats are identified by its TwoCC (0x0162 here). You can look up the different TwoCCs here: http://wiki.multimedia.cx/index.php?title=TwoCC and you'll find: 0x0162 Windows Media Audio Professional V9 This codec isn't supported yet by ffmpeg and mencoder as f...
Why do some conversions from wmv to flv with ffmpeg fail? Ive been smashing my head with this for a while. I have 2 completely identical.wmv files encoded with wmv3 codec. I put them both through ffmpeg with the following command: /usr/bin/ffmpeg -i file.wmv -ar 44100 -ab 64k -qscale 9 -s 512x384 -f flv file.flv One fi...
TITLE: Why do some conversions from wmv to flv with ffmpeg fail? QUESTION: Ive been smashing my head with this for a while. I have 2 completely identical.wmv files encoded with wmv3 codec. I put them both through ffmpeg with the following command: /usr/bin/ffmpeg -i file.wmv -ar 44100 -ab 64k -qscale 9 -s 512x384 -f f...
[ "video", "ffmpeg" ]
3
5
6,051
3
0
2008-09-17T21:16:40.397000
2008-10-27T11:53:59.773000
87,771
87,842
How can I multiply two 64-bit numbers using x86 assembly language?
How would I go about... multiplying two 64-bit numbers multiplying two 16-digit hexadecimal numbers...using Assembly Language. I'm only allowed to use registers %eax, %ebx, %ecx, %edx, and the stack. EDIT: Oh, I'm using ATT Syntax on the x86 EDIT2: Not allowed to decompile into assembly...
Use what should probably be your course textbook, Randall Hyde's "The Art of Assembly Language". See 4.2.4 - Extended Precision Multiplication Although an 8x8, 16x16, or 32x32 multiply is usually sufficient, there are times when you may want to multiply larger values together. You will use the x86 single operand MUL an...
How can I multiply two 64-bit numbers using x86 assembly language? How would I go about... multiplying two 64-bit numbers multiplying two 16-digit hexadecimal numbers...using Assembly Language. I'm only allowed to use registers %eax, %ebx, %ecx, %edx, and the stack. EDIT: Oh, I'm using ATT Syntax on the x86 EDIT2: Not ...
TITLE: How can I multiply two 64-bit numbers using x86 assembly language? QUESTION: How would I go about... multiplying two 64-bit numbers multiplying two 16-digit hexadecimal numbers...using Assembly Language. I'm only allowed to use registers %eax, %ebx, %ecx, %edx, and the stack. EDIT: Oh, I'm using ATT Syntax on t...
[ "assembly", "x86", "bigint", "extended-precision" ]
12
16
39,309
11
0
2008-09-17T21:17:59.147000
2008-09-17T21:26:53.447000
87,794
92,750
C++ unit testing framework
I use the Boost Test framework for my C++ code but there are two problems with it that are probably common to all C++ test frameworks: There is no way to create automatic test stubs (by extracting public functions from selected classes for example). You cannot run a single test - you have to run the entire 'suite' of t...
I just responded to a very similar question. I ended up using Noel Llopis' UnitTest++. I liked it more than boost::test because it didn't insist on implementing the main program of the test harness with a macro - it can plug into whatever executable you create. It does suffer from the same encumbrance of boost::test in...
C++ unit testing framework I use the Boost Test framework for my C++ code but there are two problems with it that are probably common to all C++ test frameworks: There is no way to create automatic test stubs (by extracting public functions from selected classes for example). You cannot run a single test - you have to ...
TITLE: C++ unit testing framework QUESTION: I use the Boost Test framework for my C++ code but there are two problems with it that are probably common to all C++ test frameworks: There is no way to create automatic test stubs (by extracting public functions from selected classes for example). You cannot run a single t...
[ "c++", "unit-testing" ]
61
20
56,108
18
0
2008-09-17T21:21:32.007000
2008-09-18T13:56:26.187000
87,795
162,770
How to prevent flickering in ListView when updating a single ListViewItem's text?
All I want is to update an ListViewItem's text whithout seeing any flickering. This is my code for updating (called several times): listView.BeginUpdate(); listViewItem.SubItems[0].Text = state.ToString(); // update the state listViewItem.SubItems[1].Text = progress.ToString(); // update the progress listView.EndUpdate...
To end this question, here is a helper class that should be called when the form is loading for each ListView or any other ListView's derived control in your form. Thanks to "Brian Gillespie" for giving the solution. public enum ListViewExtendedStyles { /// /// LVS_EX_GRIDLINES /// GridLines = 0x00000001, /// /// LVS_E...
How to prevent flickering in ListView when updating a single ListViewItem's text? All I want is to update an ListViewItem's text whithout seeing any flickering. This is my code for updating (called several times): listView.BeginUpdate(); listViewItem.SubItems[0].Text = state.ToString(); // update the state listViewItem...
TITLE: How to prevent flickering in ListView when updating a single ListViewItem's text? QUESTION: All I want is to update an ListViewItem's text whithout seeing any flickering. This is my code for updating (called several times): listView.BeginUpdate(); listViewItem.SubItems[0].Text = state.ToString(); // update the ...
[ "c#", ".net", "winforms", "listview" ]
51
52
47,894
10
0
2008-09-17T21:21:47.030000
2008-10-02T14:55:18.077000
87,802
304,753
Why does Rails cache view files when hosted on VM and codebase on Samba share
I have the following setup: Code on my local machine (OS X) shared as a Samba share A Ubuntu VM running within Parallels, mounts the share Running Rails 2.1 (either via Mongrel, WEBrick or passenger) in development mode, if I make changes to my views they don't update without me having to kick the server. I've tried sw...
I had the exact same problem while developing on andLinux. My andLinux's clock was about three hours ahead of the host Windows, and setting the correct time (actually, a minute or so behind) has solved the problem.
Why does Rails cache view files when hosted on VM and codebase on Samba share I have the following setup: Code on my local machine (OS X) shared as a Samba share A Ubuntu VM running within Parallels, mounts the share Running Rails 2.1 (either via Mongrel, WEBrick or passenger) in development mode, if I make changes to ...
TITLE: Why does Rails cache view files when hosted on VM and codebase on Samba share QUESTION: I have the following setup: Code on my local machine (OS X) shared as a Samba share A Ubuntu VM running within Parallels, mounts the share Running Rails 2.1 (either via Mongrel, WEBrick or passenger) in development mode, if ...
[ "ruby-on-rails", "caching" ]
2
2
518
2
0
2008-09-17T21:22:20.447000
2008-11-20T09:21:24.697000
87,812
93,337
Castle Windsor: How to specify a constructor parameter from code?
Say I have the following class MyComponent: IMyComponent { public MyComponent(int start_at) {...} } I can register an instance of it with castle windsor via xml as follows 1 How would I go about doing the exact same thing but in code? (Notice, the constructor parameter)
Edit: Used the answers below code with the Fluent Interface:) namespace WindsorSample { using Castle.MicroKernel.Registration; using Castle.Windsor; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; public class MyComponent: IMyComponent { public MyComponent(int start_at) { this.Value = start_at; } public i...
Castle Windsor: How to specify a constructor parameter from code? Say I have the following class MyComponent: IMyComponent { public MyComponent(int start_at) {...} } I can register an instance of it with castle windsor via xml as follows 1 How would I go about doing the exact same thing but in code? (Notice, the constr...
TITLE: Castle Windsor: How to specify a constructor parameter from code? QUESTION: Say I have the following class MyComponent: IMyComponent { public MyComponent(int start_at) {...} } I can register an instance of it with castle windsor via xml as follows 1 How would I go about doing the exact same thing but in code? (...
[ ".net", "castle-windsor" ]
11
16
15,370
6
0
2008-09-17T21:23:27.073000
2008-09-18T14:59:08.923000
87,821
87,839
SQL: IF clause within WHERE clause
Is it possible to use an IF clause within a WHERE clause in MS SQL? Example: WHERE IF IsNumeric(@OrderNumber) = 1 OrderNumber = @OrderNumber ELSE OrderNumber LIKE '%' + @OrderNumber + '%'
Use a CASE statement UPDATE: The previous syntax (as pointed out by a few people) doesn't work. You can use CASE as follows: WHERE OrderNumber LIKE CASE WHEN IsNumeric(@OrderNumber) = 1 THEN @OrderNumber ELSE '%' + @OrderNumber END Or you can use an IF statement like @ N. J. Reed points out.
SQL: IF clause within WHERE clause Is it possible to use an IF clause within a WHERE clause in MS SQL? Example: WHERE IF IsNumeric(@OrderNumber) = 1 OrderNumber = @OrderNumber ELSE OrderNumber LIKE '%' + @OrderNumber + '%'
TITLE: SQL: IF clause within WHERE clause QUESTION: Is it possible to use an IF clause within a WHERE clause in MS SQL? Example: WHERE IF IsNumeric(@OrderNumber) = 1 OrderNumber = @OrderNumber ELSE OrderNumber LIKE '%' + @OrderNumber + '%' ANSWER: Use a CASE statement UPDATE: The previous syntax (as pointed out by a ...
[ "sql", "sql-server", "t-sql" ]
251
266
1,179,619
16
0
2008-09-17T21:24:49.380000
2008-09-17T21:26:39.967000
87,831
87,948
How do I use my own compiler with Nant?
Nant seems very compiler-centric - which is guess is because it's considered a.NET development system. But I know it can be done! I've seen it. The platform we're building on has its own compiler and doesn't use 'cl.exe' for c++. We're building a C++ app on a different platform and would like to override with our own c...
Here is one I did for Delphi. Each 'arg' is a separate param with a value defined elsewhere. The target is called with the params set up before calling it.
How do I use my own compiler with Nant? Nant seems very compiler-centric - which is guess is because it's considered a.NET development system. But I know it can be done! I've seen it. The platform we're building on has its own compiler and doesn't use 'cl.exe' for c++. We're building a C++ app on a different platform a...
TITLE: How do I use my own compiler with Nant? QUESTION: Nant seems very compiler-centric - which is guess is because it's considered a.NET development system. But I know it can be done! I've seen it. The platform we're building on has its own compiler and doesn't use 'cl.exe' for c++. We're building a C++ app on a di...
[ "c++", "build", "cross-platform", "makefile", "nant" ]
2
5
448
4
0
2008-09-17T21:25:33.370000
2008-09-17T21:38:33.527000
87,849
87,866
SVN checkout question
I am about to move to SVN as my RCS of choice (after many years using CVS) and have a basic question... I have a number of shared projects - code that I want to use with lots of different projects. Is it possible to 'link' these shared folders to the projects that need them, so checking out a project will also checkout...
SVN Externals are what you want to do. The SVN book explains it in great detail here. That's one thing I love about SVN, the wonderful documentation.
SVN checkout question I am about to move to SVN as my RCS of choice (after many years using CVS) and have a basic question... I have a number of shared projects - code that I want to use with lots of different projects. Is it possible to 'link' these shared folders to the projects that need them, so checking out a proj...
TITLE: SVN checkout question QUESTION: I am about to move to SVN as my RCS of choice (after many years using CVS) and have a basic question... I have a number of shared projects - code that I want to use with lots of different projects. Is it possible to 'link' these shared folders to the projects that need them, so c...
[ "svn" ]
3
11
718
6
0
2008-09-17T21:28:09.807000
2008-09-17T21:29:50.100000
87,871
88,248
How best to make the selected date of an ASP.NET Calendar control available to JavaScript?
How best to make the selected date of an ASP.NET Calendar control available to JavaScript? Most controls are pretty simple, but the calendar requires more than just a simple document.getElementById().value.
When you click on a date with the calendar, ASP does a postback, you could always put the SelectedDate value of the calendar control into a hidden field on the page during the OnLoad event of the page or the SelectionChanged event of the Calendar control.
How best to make the selected date of an ASP.NET Calendar control available to JavaScript? How best to make the selected date of an ASP.NET Calendar control available to JavaScript? Most controls are pretty simple, but the calendar requires more than just a simple document.getElementById().value.
TITLE: How best to make the selected date of an ASP.NET Calendar control available to JavaScript? QUESTION: How best to make the selected date of an ASP.NET Calendar control available to JavaScript? Most controls are pretty simple, but the calendar requires more than just a simple document.getElementById().value. ANS...
[ "asp.net", "javascript", "calendar" ]
0
1
4,513
4
0
2008-09-17T21:29:56.947000
2008-09-17T22:15:16.590000
87,877
88,388
Building a Table Dependency Graph With A Recursive Query
I am trying to build a dependency graph of tables based on the foreign keys between them. This graph needs to start with an arbitrary table name as its root. I could, given a table name look up the tables that reference it using the all_constraints view, then look up the tables that reference them, and so on, but this ...
select parent, child, level from ( select parent_table.table_name parent, child_table.table_name child from user_tables parent_table, user_constraints parent_constraint, user_constraints child_constraint, user_tables child_table where parent_table.table_name = parent_constraint.table_name and parent_constraint.constrai...
Building a Table Dependency Graph With A Recursive Query I am trying to build a dependency graph of tables based on the foreign keys between them. This graph needs to start with an arbitrary table name as its root. I could, given a table name look up the tables that reference it using the all_constraints view, then loo...
TITLE: Building a Table Dependency Graph With A Recursive Query QUESTION: I am trying to build a dependency graph of tables based on the foreign keys between them. This graph needs to start with an arbitrary table name as its root. I could, given a table name look up the tables that reference it using the all_constrai...
[ "sql", "oracle", "recursion", "recursive-query" ]
7
9
12,624
2
0
2008-09-17T21:30:18.727000
2008-09-17T22:34:58.850000
87,885
165,830
Java jdb remote debugging command line tool
anyone have any experience using this? if so, is it worth while?
I just used jdb for the first time yesterday and am really pleased with the results. You see, I program in Eclipse on my laptop, then deploy to a VM to make sure the whole shebang still works. Very occasionaly, I'll have to work on something that gets executed standalone, as a commandline. These things sometimes need d...
Java jdb remote debugging command line tool anyone have any experience using this? if so, is it worth while?
TITLE: Java jdb remote debugging command line tool QUESTION: anyone have any experience using this? if so, is it worth while? ANSWER: I just used jdb for the first time yesterday and am really pleased with the results. You see, I program in Eclipse on my laptop, then deploy to a VM to make sure the whole shebang stil...
[ "java", "jdb" ]
10
8
18,024
3
0
2008-09-17T21:31:21.110000
2008-10-03T05:51:01.967000
87,889
88,183
Game Engine Scripting Languages
I am trying to build out a useful 3d game engine out of the Ogre3d rendering engine for mocking up some of the ideas i have come up with and have come to a bit of a crossroads. There are a number of scripting languages that are available and i was wondering if there were one or two that were vetted and had a proper fol...
The Python/C API manual is longer than the whole Lua manual (including the Lua/C API). Another reason for Lua is the built-in support for coroutines (co-operative multitasking within the one OS thread). It allows one to have like 1000's of seemingly individual scripts running very fast alongside each other. Like one sc...
Game Engine Scripting Languages I am trying to build out a useful 3d game engine out of the Ogre3d rendering engine for mocking up some of the ideas i have come up with and have come to a bit of a crossroads. There are a number of scripting languages that are available and i was wondering if there were one or two that ...
TITLE: Game Engine Scripting Languages QUESTION: I am trying to build out a useful 3d game engine out of the Ogre3d rendering engine for mocking up some of the ideas i have come up with and have come to a bit of a crossroads. There are a number of scripting languages that are available and i was wondering if there wer...
[ "lua", "scripting-language", "ogre3d", "squirrel" ]
5
5
4,624
9
0
2008-09-17T21:32:00.813000
2008-09-17T22:04:00.080000
87,892
88,607
What is the status of POSIX asynchronous I/O (AIO)?
There are pages scattered around the web that describe POSIX AIO facilities in varying amounts of detail. None of them are terribly recent. It's not clear what, exactly, they're describing. For example, the "official" (?) web site for Linux kernel asynchronous I/O support here says that sockets don't work, but the "aio...
Network I/O is not a priority for AIO because everyone writing POSIX network servers uses an event based, non-blocking approach. The old-style Java "billions of blocking threads" approach sucks horribly. Disk write I/O is already buffered and disk read I/O can be prefetched into buffer using functions like posix_fadvis...
What is the status of POSIX asynchronous I/O (AIO)? There are pages scattered around the web that describe POSIX AIO facilities in varying amounts of detail. None of them are terribly recent. It's not clear what, exactly, they're describing. For example, the "official" (?) web site for Linux kernel asynchronous I/O sup...
TITLE: What is the status of POSIX asynchronous I/O (AIO)? QUESTION: There are pages scattered around the web that describe POSIX AIO facilities in varying amounts of detail. None of them are terribly recent. It's not clear what, exactly, they're describing. For example, the "official" (?) web site for Linux kernel as...
[ "linux", "asynchronous", "posix", "bsd", "aio" ]
102
29
28,116
4
0
2008-09-17T21:32:25.490000
2008-09-17T23:15:51.280000
87,904
88,551
ColdFusion Template Request count optimization
In ColdFusion, under Request Tuning in the administrator, how do I determine what is an optimal number (or at least a good guess) for the Maximum Number of Simultaneous Template Requests? Environment: CF8 Standard IIS 6 Win2k3 SQL2k5 on a separate box
The way of finding the right number of requests is load testing. That is, measuring changes in throughput under load when you vary the request number. Any significant change would require retesting. But I suspect most folks are going to baulk at that amount of work. I think a good rule of thumb is about 8 threads per C...
ColdFusion Template Request count optimization In ColdFusion, under Request Tuning in the administrator, how do I determine what is an optimal number (or at least a good guess) for the Maximum Number of Simultaneous Template Requests? Environment: CF8 Standard IIS 6 Win2k3 SQL2k5 on a separate box
TITLE: ColdFusion Template Request count optimization QUESTION: In ColdFusion, under Request Tuning in the administrator, how do I determine what is an optimal number (or at least a good guess) for the Maximum Number of Simultaneous Template Requests? Environment: CF8 Standard IIS 6 Win2k3 SQL2k5 on a separate box AN...
[ "coldfusion", "administration" ]
5
6
3,283
2
0
2008-09-17T21:33:37.033000
2008-09-17T23:05:35.550000
87,911
87,964
Tool/framework for automated web app testing in Google Chrome browser?
Is an opensource/commercial tool/framework, available for automated web app testing in Google Chrome browser on Windows XP / Vista? ( An alpha/beta Tool is also OK) Thanks
Selenium supports Chrome pretty much out of the box because it works by injecting javascript in the web page. http://selenium-rc.openqa.org/ Webdriver has an early version of Chrome driver. http://code.google.com/p/webdriver/ Both are open source and works on Windows.
Tool/framework for automated web app testing in Google Chrome browser? Is an opensource/commercial tool/framework, available for automated web app testing in Google Chrome browser on Windows XP / Vista? ( An alpha/beta Tool is also OK) Thanks
TITLE: Tool/framework for automated web app testing in Google Chrome browser? QUESTION: Is an opensource/commercial tool/framework, available for automated web app testing in Google Chrome browser on Windows XP / Vista? ( An alpha/beta Tool is also OK) Thanks ANSWER: Selenium supports Chrome pretty much out of the bo...
[ "google-chrome", "testing", "browser" ]
7
8
8,969
3
0
2008-09-17T21:34:50.057000
2008-09-17T21:41:05.890000
87,932
88,215
Attribute & Reflection libraries for C++?
Most mature C++ projects seem to have an own reflection and attribute system, i.e for defining attributes which can be accessed by string and are automatically serializable. At least many C++ projects I participated in seemed to reinvent the wheel. Do you know any good open source libraries for C++ which support reflec...
You could have a look at the two tools below. I've never used either of them, so I can't tell you how (im)practical they are. XRTTI: Xrtti is a tool and accompanying C++ library which extends the standard runtime type system of C++ to provide a much richer set of reflection information about classes and methods to mani...
Attribute & Reflection libraries for C++? Most mature C++ projects seem to have an own reflection and attribute system, i.e for defining attributes which can be accessed by string and are automatically serializable. At least many C++ projects I participated in seemed to reinvent the wheel. Do you know any good open sou...
TITLE: Attribute & Reflection libraries for C++? QUESTION: Most mature C++ projects seem to have an own reflection and attribute system, i.e for defining attributes which can be accessed by string and are automatically serializable. At least many C++ projects I participated in seemed to reinvent the wheel. Do you know...
[ "c++", "reflection", "attributes" ]
19
6
11,240
8
0
2008-09-17T21:36:58.960000
2008-09-17T22:11:01.560000
87,934
87,958
JavaScript and why capital letters sometimes work and sometimes don't
In Notepad++, I was writing a JavaScript file and something didn't work: an alert had to be shown when a button was clicked, but it wasn't working. I has used the auto-complete plugin provided with Notepad++, which presented me with onClick. When I changed the capital C to a small c, it did work. So first of all, when ...
Javascript is ALWAYS case-sensitive, html is not. It sounds as thought you are talking about whether html attributes (e.g. onclick) are or are not case-sensitive. The answer is that the attributes are not case sensitive, but the way that we access them through the DOM is. So, you can do this: Say Yo // Upper-case 'C' o...
JavaScript and why capital letters sometimes work and sometimes don't In Notepad++, I was writing a JavaScript file and something didn't work: an alert had to be shown when a button was clicked, but it wasn't working. I has used the auto-complete plugin provided with Notepad++, which presented me with onClick. When I c...
TITLE: JavaScript and why capital letters sometimes work and sometimes don't QUESTION: In Notepad++, I was writing a JavaScript file and something didn't work: an alert had to be shown when a button was clicked, but it wasn't working. I has used the auto-complete plugin provided with Notepad++, which presented me with...
[ "javascript", "html", "dom", "case-sensitive" ]
7
30
7,495
4
0
2008-09-17T21:37:09.067000
2008-09-17T21:39:47.627000
87,950
88,079
How do you overcome the svn 'out of date' error?
I've been attempting move a directory structure from one location to another in Subversion, but I get an Item '*' is out of date commit error. I have the latest version checked out (so far as I can tell). svn st -u turns up no differences other than the mv commands.
I sometimes get this with TortoiseSVN on windows. The solution for me is to svn update the directory, even though there are no revisions to download or update. It does something to the metadata, which magically fixes it.
How do you overcome the svn 'out of date' error? I've been attempting move a directory structure from one location to another in Subversion, but I get an Item '*' is out of date commit error. I have the latest version checked out (so far as I can tell). svn st -u turns up no differences other than the mv commands.
TITLE: How do you overcome the svn 'out of date' error? QUESTION: I've been attempting move a directory structure from one location to another in Subversion, but I get an Item '*' is out of date commit error. I have the latest version checked out (so far as I can tell). svn st -u turns up no differences other than the...
[ "svn" ]
349
669
335,459
31
0
2008-09-17T21:38:50.937000
2008-09-17T21:52:50.433000
87,957
88,345
If you could recommend only one blog on software testing, which one would it be?
I found a question here about blogs on software development, but I would like to know which blogs on software testing this community reads. If you just have to recommend more than one blog, post each one in separate answer, so others can vote on specific blog.:) Thanks! Edit: I am not interested in sites that aggregate...
My blog, of course, is quite interesting - but will not be to everyone. TestingReflections is nice because it aggregates a bunch of random test blogs, but the problem is that it aggregates the bad with the good. Many of the posts that make it to the site don't have much use. It also depends on what you're looking for -...
If you could recommend only one blog on software testing, which one would it be? I found a question here about blogs on software development, but I would like to know which blogs on software testing this community reads. If you just have to recommend more than one blog, post each one in separate answer, so others can v...
TITLE: If you could recommend only one blog on software testing, which one would it be? QUESTION: I found a question here about blogs on software development, but I would like to know which blogs on software testing this community reads. If you just have to recommend more than one blog, post each one in separate answe...
[ "testing", "blogs" ]
10
3
571
5
0
2008-09-17T21:39:31.217000
2008-09-17T22:29:32.047000
87,970
88,017
C#: Is Implicit Arraylist assignment possible?
I'd like to populate an arraylist by specifying a list of values just like I would an integer array, but am unsure of how to do so without repeated calls to the "add" method. For example, I want to assign { 1, 2, 3, "string1", "string2" } to an arraylist. I know for other arrays you can make the assignment like: int[] ...
Array list has ctor which accepts ICollection, which is implemented by the Array class. object[] myArray = new object[] {1,2,3,"string1","string2"}; ArrayList myArrayList = new ArrayList(myArray);
C#: Is Implicit Arraylist assignment possible? I'd like to populate an arraylist by specifying a list of values just like I would an integer array, but am unsure of how to do so without repeated calls to the "add" method. For example, I want to assign { 1, 2, 3, "string1", "string2" } to an arraylist. I know for other ...
TITLE: C#: Is Implicit Arraylist assignment possible? QUESTION: I'd like to populate an arraylist by specifying a list of values just like I would an integer array, but am unsure of how to do so without repeated calls to the "add" method. For example, I want to assign { 1, 2, 3, "string1", "string2" } to an arraylist....
[ "c#", "arraylist" ]
3
8
11,006
5
0
2008-09-17T21:41:28.853000
2008-09-17T21:47:00.840000
87,979
89,219
Xcode 3.1.1 and static libraries
I'm an experienced VS.NET user and trying to get up and running on Xcode 3.1.1. Here's what I'm trying to accomplish: I'd like a static library ("Lib") to have its own xcodeproj file. I'd an executable application ("App") that makes use of Lib to reference Lib's xcodeproj file so that changes to Lib cause App to relink...
You're correct that making target A depend upon target B (whether within the same project or across projects) does not cause target A to link against target B. You need to specify them distinctly; this is because they're separate concepts, and you might have dependencies between targets that you don't want to link to e...
Xcode 3.1.1 and static libraries I'm an experienced VS.NET user and trying to get up and running on Xcode 3.1.1. Here's what I'm trying to accomplish: I'd like a static library ("Lib") to have its own xcodeproj file. I'd an executable application ("App") that makes use of Lib to reference Lib's xcodeproj file so that c...
TITLE: Xcode 3.1.1 and static libraries QUESTION: I'm an experienced VS.NET user and trying to get up and running on Xcode 3.1.1. Here's what I'm trying to accomplish: I'd like a static library ("Lib") to have its own xcodeproj file. I'd an executable application ("App") that makes use of Lib to reference Lib's xcodep...
[ "xcode", "macos" ]
4
9
12,600
4
0
2008-09-17T21:42:38.430000
2008-09-18T01:33:52.557000
87,999
350,542
Voice Recognition Software For Developers
Well the docs finally said it, I need to take it easy on my wrist for a few months. Being that I'm a.NET Developer this could end my livelihood for a little while, something I'm not anxious to do. That said, are there any good handsfree options for developers? Anyone had success using any of the speech recognition soft...
It's out there, and it works... There are quite a few speech recognition programs out there, of which Dragon NaturallySpeaking is, I think, one of the most widely used ones. I've used it myself, and have been impressed with its quality. That being a couple of years ago, I guess things have improved even further by now....
Voice Recognition Software For Developers Well the docs finally said it, I need to take it easy on my wrist for a few months. Being that I'm a.NET Developer this could end my livelihood for a little while, something I'm not anxious to do. That said, are there any good handsfree options for developers? Anyone had succes...
TITLE: Voice Recognition Software For Developers QUESTION: Well the docs finally said it, I need to take it easy on my wrist for a few months. Being that I'm a.NET Developer this could end my livelihood for a little while, something I'm not anxious to do. That said, are there any good handsfree options for developers?...
[ "speech-recognition", "voice", "ergonomics", "speech", "code-by-voice" ]
47
28
20,828
16
0
2008-09-17T21:45:09.330000
2008-12-08T19:15:28.903000
88,007
88,110
Unit testing a method that can have random behaviour
I ran across this situation this afternoon, so I thought I'd ask what you guys do. We have a randomized password generator for user password resets and while fixing a problem with it, I decided to move the routine into my (slowly growing) test harness. I want to test that passwords generated conform to the rules we've ...
A unit test should do the same thing every time that it runs, otherwise you may run into a situation where the unit test only fails occasionally, and that could be a real pain to debug. Try seeding your pseudo-randomizer with the same seed every time (in the test, that is--not in production code). That way your test wi...
Unit testing a method that can have random behaviour I ran across this situation this afternoon, so I thought I'd ask what you guys do. We have a randomized password generator for user password resets and while fixing a problem with it, I decided to move the routine into my (slowly growing) test harness. I want to test...
TITLE: Unit testing a method that can have random behaviour QUESTION: I ran across this situation this afternoon, so I thought I'd ask what you guys do. We have a randomized password generator for user password resets and while fixing a problem with it, I decided to move the routine into my (slowly growing) test harne...
[ "unit-testing", "random" ]
5
8
1,898
11
0
2008-09-17T21:46:18.377000
2008-09-17T21:56:08.400000
88,011
88,044
Make apache automatically strip off the www.?
For various reasons, such as cookies, SEO, and to keep things simple, I would like to make apache automatically redirect any requests for http://www.foobar.com/anything to http://foobar.com/anything. The best I could come up with is a mod_rewrite-based monstrosity, is there some easy simple way to tell it "Redirect all...
It's as easy as: ServerName www.example.com Redirect permanent / http://example.com/ Adapt host names and IPs as needed:)
Make apache automatically strip off the www.? For various reasons, such as cookies, SEO, and to keep things simple, I would like to make apache automatically redirect any requests for http://www.foobar.com/anything to http://foobar.com/anything. The best I could come up with is a mod_rewrite-based monstrosity, is there...
TITLE: Make apache automatically strip off the www.? QUESTION: For various reasons, such as cookies, SEO, and to keep things simple, I would like to make apache automatically redirect any requests for http://www.foobar.com/anything to http://foobar.com/anything. The best I could come up with is a mod_rewrite-based mon...
[ "apache", "redirect" ]
4
9
1,979
6
0
2008-09-17T21:46:39.590000
2008-09-17T21:49:59.583000
88,036
88,097
Does the unmodifiable wrapper for java collections make them thread safe?
I need to make an ArrayList of ArrayLists thread safe. I also cannot have the client making changes to the collection. Will the unmodifiable wrapper make it thread safe or do I need two wrappers on the collection?
It depends. The wrapper will only prevent changes to the collection it wraps, not to the objects in the collection. If you have an ArrayList of ArrayLists, the global List as well as each of its element Lists need to be wrapped separately, and you may also have to do something for the contents of those lists. Finally, ...
Does the unmodifiable wrapper for java collections make them thread safe? I need to make an ArrayList of ArrayLists thread safe. I also cannot have the client making changes to the collection. Will the unmodifiable wrapper make it thread safe or do I need two wrappers on the collection?
TITLE: Does the unmodifiable wrapper for java collections make them thread safe? QUESTION: I need to make an ArrayList of ArrayLists thread safe. I also cannot have the client making changes to the collection. Will the unmodifiable wrapper make it thread safe or do I need two wrappers on the collection? ANSWER: It de...
[ "java", "multithreading", "collections", "unmodifiable" ]
19
10
7,462
9
0
2008-09-17T21:49:09.320000
2008-09-17T21:54:55.327000
88,078
559,407
Can a .msi file install itself (presumably via a Custom Action)?
I wand to construct an MSI which, in its installation process, will deploy itself along with its contained Files/Components, to the TargetDir. So MyApp.msi contains MyApp.exe and MyAppBootstrapperEmpty.exe (with no resources) in its File Table. The user launches a MyAppBootstrapperPackaged.exe (containing MyApp.msi as ...
Add an uncompressed medium to your wxs like this: And then create a component with a File element like this: This will make the installer look for a file called "myinstaller.msi" on the installation medium, in the same folder as the msi that is being installed. The source path above should point to a dummy file, it is ...
Can a .msi file install itself (presumably via a Custom Action)? I wand to construct an MSI which, in its installation process, will deploy itself along with its contained Files/Components, to the TargetDir. So MyApp.msi contains MyApp.exe and MyAppBootstrapperEmpty.exe (with no resources) in its File Table. The user l...
TITLE: Can a .msi file install itself (presumably via a Custom Action)? QUESTION: I wand to construct an MSI which, in its installation process, will deploy itself along with its contained Files/Components, to the TargetDir. So MyApp.msi contains MyApp.exe and MyAppBootstrapperEmpty.exe (with no resources) in its File...
[ "wix", "windows-installer" ]
9
9
9,222
6
0
2008-09-17T21:52:40.420000
2009-02-18T00:52:54.280000
88,087
88,700
MOSS 2007 SSL error when configuring Search Settings
We’re getting the following error message when we click on “Search Settings” for a Shared Services Provider: “Authentication failed because the remote party has closed the transport stream.” This is a new server environment with two web front ends, one database server, and one index server, all running Windows 2003 x64...
I guess you find this exception in the index server, right? Are you able to browse to ' https://mushni-sptwb04q:56738/Shared%20Services%20Portal/Search/SearchAdmin.asmx ' from the index server? It seems like SSL is not properly provisioned on the front-end servers. This might solve your issue: Remove the SSL certificat...
MOSS 2007 SSL error when configuring Search Settings We’re getting the following error message when we click on “Search Settings” for a Shared Services Provider: “Authentication failed because the remote party has closed the transport stream.” This is a new server environment with two web front ends, one database serve...
TITLE: MOSS 2007 SSL error when configuring Search Settings QUESTION: We’re getting the following error message when we click on “Search Settings” for a Shared Services Provider: “Authentication failed because the remote party has closed the transport stream.” This is a new server environment with two web front ends, ...
[ "sharepoint", "moss", "64-bit" ]
1
2
4,739
6
0
2008-09-17T21:53:37.390000
2008-09-17T23:32:39.570000
88,094
88,124
How do you guarantee the ASPNET user gets assigned the correct default directory rights?
I seem to make this mistake every time I set up a new development box. Is there a way to make sure you don't have to manually assign rights for the ASPNET user? I usually install.Net then IIS, then Visual Studio but it seems I still have to manually assign rights to the ASPNET user to get everything running correctly. ...
Install IIS, then.NET. The.NET installation will automatically register the needed things with IIS. If you install.NET first, run this: %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i to run the registration parts, and %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -ga userA to set up th...
How do you guarantee the ASPNET user gets assigned the correct default directory rights? I seem to make this mistake every time I set up a new development box. Is there a way to make sure you don't have to manually assign rights for the ASPNET user? I usually install.Net then IIS, then Visual Studio but it seems I stil...
TITLE: How do you guarantee the ASPNET user gets assigned the correct default directory rights? QUESTION: I seem to make this mistake every time I set up a new development box. Is there a way to make sure you don't have to manually assign rights for the ASPNET user? I usually install.Net then IIS, then Visual Studio b...
[ ".net", "asp.net", "visual-studio" ]
1
2
165
2
0
2008-09-17T21:54:24.173000
2008-09-17T21:57:26.803000
88,136
88,242
Will a VS2008 setup project update Net 3.5 SP1?
I just started using the WPF WebBrowser that is included in Net 3.5 SP1. I built my setup project (which I have been using prior to moving to 3.5 SP1) and installed it on a test machine but the WebBrowser was not available. What must I do to be sure that the setup.exe/msi combination checks for and installs SP1?
Open the properties of the Setup Project, then click on the Prerequesites button. Then check the prerequisites to install. Then you can define how the user gets the pre-reqs. Here is a link to framework version information and an excerpt from Scott Hanselman's blog: Online/Download Experience The best way to get a user...
Will a VS2008 setup project update Net 3.5 SP1? I just started using the WPF WebBrowser that is included in Net 3.5 SP1. I built my setup project (which I have been using prior to moving to 3.5 SP1) and installed it on a test machine but the WebBrowser was not available. What must I do to be sure that the setup.exe/msi...
TITLE: Will a VS2008 setup project update Net 3.5 SP1? QUESTION: I just started using the WPF WebBrowser that is included in Net 3.5 SP1. I built my setup project (which I have been using prior to moving to 3.5 SP1) and installed it on a test machine but the WebBrowser was not available. What must I do to be sure that...
[ "visual-studio-2008", "setup-project", ".net-3.5" ]
2
3
2,225
3
0
2008-09-17T21:58:34.210000
2008-09-17T22:14:38.277000
88,194
88,209
Setting Environment Variables for Mercurial Hook
I am trying to call a shell script that sets a bunch of environment variables on our server from a mercurial hook. The shell script gets called fine when a new changegroup comes in, but the environment variables aren't carrying over past the call to the shell script. My hgrc file on the respository looks like this: [ho...
Shell scripts can't modify their enviroment. http://tldp.org/LDP/abs/html/gotchas.html A script may not export variables back to its parent process, the shell, or to the environment. Just as we learned in biology, a child process can inherit from a parent, but not vice versa $ cat > eg.sh export FOO="bar"; ^D $ bash eg...
Setting Environment Variables for Mercurial Hook I am trying to call a shell script that sets a bunch of environment variables on our server from a mercurial hook. The shell script gets called fine when a new changegroup comes in, but the environment variables aren't carrying over past the call to the shell script. My ...
TITLE: Setting Environment Variables for Mercurial Hook QUESTION: I am trying to call a shell script that sets a bunch of environment variables on our server from a mercurial hook. The shell script gets called fine when a new changegroup comes in, but the environment variables aren't carrying over past the call to the...
[ "python", "shell", "mercurial", "mercurial-hook" ]
1
2
1,704
1
0
2008-09-17T22:05:56.470000
2008-09-17T22:09:08.617000
88,211
88,249
How do you convert your office to build automation?
The title should say it all, then I can solidify 2 more ticks on the Joel test. I've implemented build automation using a makefile and a python script already and I understand the basics and the options. But how can I, the new guy who reads the blogs, convince my cohort of its inherent efficacy?
Ask for forgiveness, instead of permission. Get it working in private (which it looks like you have) and then demonstrate its advantages. One thing that always gets people is using CruiseControl's Tray utility - people love it when they can see, through their system tray, that the build succeeded. (this is assuming you...
How do you convert your office to build automation? The title should say it all, then I can solidify 2 more ticks on the Joel test. I've implemented build automation using a makefile and a python script already and I understand the basics and the options. But how can I, the new guy who reads the blogs, convince my coho...
TITLE: How do you convert your office to build automation? QUESTION: The title should say it all, then I can solidify 2 more ticks on the Joel test. I've implemented build automation using a makefile and a python script already and I understand the basics and the options. But how can I, the new guy who reads the blogs...
[ "version-control", "build-automation", "visual-sourcesafe" ]
2
6
403
9
0
2008-09-17T22:09:49.643000
2008-09-17T22:15:18.960000
88,216
88,233
Finding differences between versions of a Java class file
I am working with a large Java web application from a commercial vendor. I've received a patch from the vendor in the form of a new.class file that is supposed to resolve an issue we're having with the software. In the past, applying patches from this vendor have caused new and completely unrelated problems to arise, s...
It's possible that they just compiled it with a new version of the java compiler, or with different optimization settings etc, so that the functionality is the same, and the code is the same, but the output bytecode is slightly different.
Finding differences between versions of a Java class file I am working with a large Java web application from a commercial vendor. I've received a patch from the vendor in the form of a new.class file that is supposed to resolve an issue we're having with the software. In the past, applying patches from this vendor hav...
TITLE: Finding differences between versions of a Java class file QUESTION: I am working with a large Java web application from a commercial vendor. I've received a patch from the vendor in the form of a new.class file that is supposed to resolve an issue we're having with the software. In the past, applying patches fr...
[ "java", "decompiling" ]
8
7
15,840
4
0
2008-09-17T22:11:03.807000
2008-09-17T22:13:10.277000
88,222
88,310
Stored Procs - Best way to pass messages back to user application
I'd like know what people think about using RAISERROR in stored procedures to pass back user messages (i.e. business related messages, not error messages) to the application. Some of the senior developers in my firm have been using this method and catching the SqlException in our C# code to pick up the messages and dis...
I've done this, but it was usually to pass along business "error" messages, essentially a data configuration had to be in place that couldn't be enforced with standard FK constraints for whatever reason. If they are actually "errors", I don't have much of a problem with it. If it's inserting a record and using RAISERRO...
Stored Procs - Best way to pass messages back to user application I'd like know what people think about using RAISERROR in stored procedures to pass back user messages (i.e. business related messages, not error messages) to the application. Some of the senior developers in my firm have been using this method and catchi...
TITLE: Stored Procs - Best way to pass messages back to user application QUESTION: I'd like know what people think about using RAISERROR in stored procedures to pass back user messages (i.e. business related messages, not error messages) to the application. Some of the senior developers in my firm have been using this...
[ "sql", "sql-server", "t-sql", "raiserror" ]
6
6
5,400
14
0
2008-09-17T22:12:27.470000
2008-09-17T22:24:15.383000
88,231
88,353
Page index is not working
Help me..my page index is not working in visual studio. my page load is as follows: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CustomerView.DataSource = Customer.GetAll(); CustomerView.DataBind(); } } protected void CustomerView_PageIndexChanging(object sender, System.Web.UI.WebCont...
Try this. I think you have to set the GridView's PageIndex property manually. protected void CustomerView_PageIndexChanging(object sender, System.Web.UI.WebControls.GridViewPageEventArgs e) { CustomerView.PageIndex = e.NewPageIndex; CustomerView.DataSource = Customer.GetAll(); CustomerView.DataBind(); }
Page index is not working Help me..my page index is not working in visual studio. my page load is as follows: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CustomerView.DataSource = Customer.GetAll(); CustomerView.DataBind(); } } protected void CustomerView_PageIndexChanging(object sen...
TITLE: Page index is not working QUESTION: Help me..my page index is not working in visual studio. my page load is as follows: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CustomerView.DataSource = Customer.GetAll(); CustomerView.DataBind(); } } protected void CustomerView_PageIndexC...
[ "c#" ]
0
0
260
1
0
2008-09-17T22:13:03.740000
2008-09-17T22:30:00.377000
88,235
88,262
Dealing with "java.lang.OutOfMemoryError: PermGen space" error
Recently I ran into this error in my web application: java.lang.OutOfMemoryError: PermGen space It's a typical Hibernate/JPA + IceFaces/JSF application running on Tomcat 6 and JDK 1.6. Apparently this can occur after redeploying an application a few times. What causes it and what can be done to avoid it? How do I fix t...
The solution was to add these flags to JVM command line when Tomcat is started: -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled You can do that by shutting down the tomcat service, then going into the Tomcat/bin directory and running tomcat6w.exe. Under the "Java" tab, add the arguments to the "Java Option...
Dealing with "java.lang.OutOfMemoryError: PermGen space" error Recently I ran into this error in my web application: java.lang.OutOfMemoryError: PermGen space It's a typical Hibernate/JPA + IceFaces/JSF application running on Tomcat 6 and JDK 1.6. Apparently this can occur after redeploying an application a few times. ...
TITLE: Dealing with "java.lang.OutOfMemoryError: PermGen space" error QUESTION: Recently I ran into this error in my web application: java.lang.OutOfMemoryError: PermGen space It's a typical Hibernate/JPA + IceFaces/JSF application running on Tomcat 6 and JDK 1.6. Apparently this can occur after redeploying an applica...
[ "exception", "memory-leaks", "out-of-memory", "java-6", "permgen" ]
1,242
572
1,064,042
34
0
2008-09-17T22:13:48.277000
2008-09-17T22:17:16.973000
88,274
88,360
In ColdFusion 8, can you declare a function as private using cfscript?
Normally you create a function using cfscript like: function foo() { return "bar"; } Is there a way to declare this as a private function, available only to other methods inside the same cfc? I know you can do it with tags: But I don't want to have to rewrite this large function thats already written in cfscript.
Not in ColdFusion 8. It was added in CF9, though. You don't need to rewrite the whole function, you can do this: return "bar"; If you have access to CF9, the new syntax is: private string function foo() output="false" { return "bar"; }
In ColdFusion 8, can you declare a function as private using cfscript? Normally you create a function using cfscript like: function foo() { return "bar"; } Is there a way to declare this as a private function, available only to other methods inside the same cfc? I know you can do it with tags: But I don't want to have ...
TITLE: In ColdFusion 8, can you declare a function as private using cfscript? QUESTION: Normally you create a function using cfscript like: function foo() { return "bar"; } Is there a way to declare this as a private function, available only to other methods inside the same cfc? I know you can do it with tags: But I d...
[ "coldfusion", "coldfusion-8" ]
4
15
1,992
1
0
2008-09-17T22:19:12.337000
2008-09-17T22:30:36.367000
88,302
88,328
macro support in F#
After reading Practical Common Lisp I finally understood what the big deal about macros was, and I have been looking for a language for the.NET platform that supports this. There are a few lisp dialects for.NET but from what I have been able to gather all are either very beta or abandoned. Recently my interest has been...
Well, F# is based on OCaml and OCaml has a rather extensive macro system. Given the syntactic and semantic similarities of F# and OCaml you may be able to port over the Ocaml macro system to F#. Other than stealing Ocaml's macro system I'm unaware of a canned macro system for F#.
macro support in F# After reading Practical Common Lisp I finally understood what the big deal about macros was, and I have been looking for a language for the.NET platform that supports this. There are a few lisp dialects for.NET but from what I have been able to gather all are either very beta or abandoned. Recently ...
TITLE: macro support in F# QUESTION: After reading Practical Common Lisp I finally understood what the big deal about macros was, and I have been looking for a language for the.NET platform that supports this. There are a few lisp dialects for.NET but from what I have been able to gather all are either very beta or ab...
[ ".net", "f#", "functional-programming", "lisp", "clojure" ]
24
13
7,736
11
0
2008-09-17T22:22:28.087000
2008-09-17T22:26:48.747000
88,306
90,695
How can I add cookies to Seaside responses without redirecting?
I'm making a small web application in Seaside. I have a login component, and after the user logs in I want to send along a cookie when the next component renders itself. Is there a way to get at the object handling the response so I can add something to the headers it will output? I'm trying to avoid using WASession>>r...
There is currently no built-in way to add cookies during the action/callback phase of request processing. This is most likely a defect and is noted in this issue: http://code.google.com/p/seaside/issues/detail?id=48 This is currently slated to be fixed for Seaside 2.9 but I don't know if it will even be backported to 2...
How can I add cookies to Seaside responses without redirecting? I'm making a small web application in Seaside. I have a login component, and after the user logs in I want to send along a cookie when the next component renders itself. Is there a way to get at the object handling the response so I can add something to th...
TITLE: How can I add cookies to Seaside responses without redirecting? QUESTION: I'm making a small web application in Seaside. I have a login component, and after the user logs in I want to send along a cookie when the next component renders itself. Is there a way to get at the object handling the response so I can a...
[ "http", "cookies", "seaside", "redirectwithcookies" ]
5
5
677
2
0
2008-09-17T22:23:22.123000
2008-09-18T07:20:58.587000
88,311
88,341
How to generate a random string in Ruby
I'm currently generating an 8-character pseudo-random uppercase string for "A".. "Z": value = ""; 8.times{value << (65 + rand(25)).chr} but it doesn't look clean, and it can't be passed as an argument since it isn't a single statement. To get a mixed-case string "a".. "z" plus "A".. "Z", I changed it to: value = ""; 8....
(0...8).map { (65 + rand(26)).chr }.join I spend too much time golfing. (0...50).map { ('a'..'z').to_a[rand(26)] }.join And a last one that's even more confusing, but more flexible and wastes fewer cycles: o = [('a'..'z'), ('A'..'Z')].map(&:to_a).flatten string = (0...50).map { o[rand(o.length)] }.join If you want to g...
How to generate a random string in Ruby I'm currently generating an 8-character pseudo-random uppercase string for "A".. "Z": value = ""; 8.times{value << (65 + rand(25)).chr} but it doesn't look clean, and it can't be passed as an argument since it isn't a single statement. To get a mixed-case string "a".. "z" plus "A...
TITLE: How to generate a random string in Ruby QUESTION: I'm currently generating an 8-character pseudo-random uppercase string for "A".. "Z": value = ""; 8.times{value << (65 + rand(25)).chr} but it doesn't look clean, and it can't be passed as an argument since it isn't a single statement. To get a mixed-case string...
[ "ruby", "random", "passwords" ]
829
1,042
519,834
46
0
2008-09-17T22:24:44.803000
2008-09-17T22:29:05.073000
88,325
88,346
How do I unit test an __init__() method of a python class with assertRaises()?
I have a class: class MyClass: def __init__(self, foo): if foo!= 1: raise Error("foo is not equal to 1!") and a unit test that is supposed to make sure the incorrect arg passed to the constructor properly raises an error: def testInsufficientArgs(self): foo = 0 self.assertRaises((Error), myClass = MyClass(Error, foo)) ...
'Error' in this example could be any exception object. I think perhaps you have read a code example that used it as a metasyntatic placeholder to mean, "The Appropriate Exception Class". The baseclass of all exceptions is called 'Exception', and most of its subclasses are descriptive names of the type of error involved...
How do I unit test an __init__() method of a python class with assertRaises()? I have a class: class MyClass: def __init__(self, foo): if foo!= 1: raise Error("foo is not equal to 1!") and a unit test that is supposed to make sure the incorrect arg passed to the constructor properly raises an error: def testInsufficien...
TITLE: How do I unit test an __init__() method of a python class with assertRaises()? QUESTION: I have a class: class MyClass: def __init__(self, foo): if foo!= 1: raise Error("foo is not equal to 1!") and a unit test that is supposed to make sure the incorrect arg passed to the constructor properly raises an error: d...
[ "python", "unit-testing", "exception" ]
35
35
40,459
3
0
2008-09-17T22:26:37.467000
2008-09-17T22:29:33.013000
88,343
228,474
How to get Intellisense on error-marked code in Visual Studio 2005?
When I try to compile code on VS 2005 and it fails, the line which causes the error gets underlined blue, and mouse-hovering over it displays the error message. Fine, but you can't see object types or whatever, because Intellisense will show the error message, and not object info. In this image, I wanted to see what ty...
Select "Build|Clean Solution" - this cleans up intermediate files and other things. More importantly, it also clears the list of error messages, restoring normal behaviour of Intellisense.
How to get Intellisense on error-marked code in Visual Studio 2005? When I try to compile code on VS 2005 and it fails, the line which causes the error gets underlined blue, and mouse-hovering over it displays the error message. Fine, but you can't see object types or whatever, because Intellisense will show the error ...
TITLE: How to get Intellisense on error-marked code in Visual Studio 2005? QUESTION: When I try to compile code on VS 2005 and it fails, the line which causes the error gets underlined blue, and mouse-hovering over it displays the error message. Fine, but you can't see object types or whatever, because Intellisense wi...
[ "visual-studio", "visual-studio-2005" ]
0
1
262
5
0
2008-09-17T22:29:17.103000
2008-10-23T03:45:44.793000
88,359
88,392
What is the best C# to VB.net converter?
While searching the interweb for a solution for my VB.net problems I often find helpful articles on a specific topic, but the code is C#. That is no big problem but it cost some time to convert it to VB manually. There are some sites that offer code converters from C# to VB and vice versa, but to fix all the flaws afte...
If you cannot find a good converter, you could always compile the c# code and use the dissasembler in Reflector to see Visual Basic code. Some of the variable names will change.
What is the best C# to VB.net converter? While searching the interweb for a solution for my VB.net problems I often find helpful articles on a specific topic, but the code is C#. That is no big problem but it cost some time to convert it to VB manually. There are some sites that offer code converters from C# to VB and ...
TITLE: What is the best C# to VB.net converter? QUESTION: While searching the interweb for a solution for my VB.net problems I often find helpful articles on a specific topic, but the code is C#. That is no big problem but it cost some time to convert it to VB manually. There are some sites that offer code converters ...
[ "c#", "vb.net", "converters" ]
44
18
98,535
13
0
2008-09-17T22:30:34.230000
2008-09-17T22:35:33.437000
88,361
88,407
Is there an elegant way to compare a checkbox and a textbox using ASP.NET validators?
I have an Asp.Net repeater, which contains a textbox and a checkbox. I need to add client-side validation that verifies that when the checkbox is checked, the textbox can only accept a value of zero or blank. I would like to use one or more of Asp.Net's validator controls to accomplish this, to provide a consistent dis...
I think the best way would be to inherit BaseValidator in a new class, and pass those IDs to your control as attributes. You should be able to resolve the IDs within your validator, without knowing the full client side ID that is generated at runtime. You should get the data validating on the server first, and on the c...
Is there an elegant way to compare a checkbox and a textbox using ASP.NET validators? I have an Asp.Net repeater, which contains a textbox and a checkbox. I need to add client-side validation that verifies that when the checkbox is checked, the textbox can only accept a value of zero or blank. I would like to use one o...
TITLE: Is there an elegant way to compare a checkbox and a textbox using ASP.NET validators? QUESTION: I have an Asp.Net repeater, which contains a textbox and a checkbox. I need to add client-side validation that verifies that when the checkbox is checked, the textbox can only accept a value of zero or blank. I would...
[ "c#", ".net", "asp.net", "validation" ]
4
2
1,474
2
0
2008-09-17T22:30:56.973000
2008-09-17T22:38:54.303000
88,399
88,737
How do I duplicate a whole line in Emacs?
I saw this same question for VIM and it has been something that I myself wanted to know how to do for Emacs. In ReSharper I use CTRL-D for this action. What is the least number of commands to perform this in Emacs?
I use C-a C-SPACE C-n M-w C-y which breaks down to C-a: move cursor to start of line C-SPACE: begin a selection ("set mark") C-n: move cursor to next line M-w: copy region C-y: paste ("yank") The aforementioned C-a C-k C-k C-y C-y amounts to the same thing (TMTOWTDI) C-a: move cursor to start of line C-k: cut ("kill") ...
How do I duplicate a whole line in Emacs? I saw this same question for VIM and it has been something that I myself wanted to know how to do for Emacs. In ReSharper I use CTRL-D for this action. What is the least number of commands to perform this in Emacs?
TITLE: How do I duplicate a whole line in Emacs? QUESTION: I saw this same question for VIM and it has been something that I myself wanted to know how to do for Emacs. In ReSharper I use CTRL-D for this action. What is the least number of commands to perform this in Emacs? ANSWER: I use C-a C-SPACE C-n M-w C-y which ...
[ "emacs", "text", "editor", "editing", "command" ]
176
160
87,362
35
0
2008-09-17T22:36:33.030000
2008-09-17T23:42:30.577000
88,403
88,426
ISS error CS0433: name collision
In our application we've run into an error numerous times where we get error CS0433, which complains about a name collison in two separate dlls. This is an ASP.NET app developed in C# using webforms. It always complained about A TimeLog page. Anyone have advice for resolving this error?
I found a link in the MSDN that describes this error. To summarize, a naming conflict can happen between the file name of a page (TimeLogTab.aspx) and the class in the code behind (public class TimeLogTab). The link recommends renaming one of them. I changed my class to Time_LogTab and the error went away.
ISS error CS0433: name collision In our application we've run into an error numerous times where we get error CS0433, which complains about a name collison in two separate dlls. This is an ASP.NET app developed in C# using webforms. It always complained about A TimeLog page. Anyone have advice for resolving this error?
TITLE: ISS error CS0433: name collision QUESTION: In our application we've run into an error numerous times where we get error CS0433, which complains about a name collison in two separate dlls. This is an ASP.NET app developed in C# using webforms. It always complained about A TimeLog page. Anyone have advice for res...
[ "c#", "asp.net", "iis-6" ]
0
2
769
2
0
2008-09-17T22:38:04.507000
2008-09-17T22:40:51.940000
88,417
90,857
In AIML, what's the XSD-valid way to use the element <set name="it">?
In file Atomic.aiml, part of the annotated ALICE AIML files, there are a lot of categories like this: ANSWER MY QUESTION This code isn't valid according to the AIML XSD; the validator says that No character data is allowed in content model (regarding the your question character data inside the set element). If I delete...
Which Validator are you using because the following complete file validates according to Xerces? ANSWER MY QUESTION
In AIML, what's the XSD-valid way to use the element <set name="it">? In file Atomic.aiml, part of the annotated ALICE AIML files, there are a lot of categories like this: ANSWER MY QUESTION This code isn't valid according to the AIML XSD; the validator says that No character data is allowed in content model (regarding...
TITLE: In AIML, what's the XSD-valid way to use the element <set name="it">? QUESTION: In file Atomic.aiml, part of the annotated ALICE AIML files, there are a lot of categories like this: ANSWER MY QUESTION This code isn't valid according to the AIML XSD; the validator says that No character data is allowed in conten...
[ "xml", "validation", "xsd", "aiml" ]
1
0
529
1
0
2008-09-17T22:40:14.860000
2008-09-18T08:07:57.023000
88,434
88,456
How can I detect if caps lock is toggled in Swing?
I'm trying to build a better username/password field for my workplace and would like to be able to complain when they have their caps lock on. Is this possible? And if so I'd like to have it detected before the client types their first letter. Is there a non-platform specific way to do this?
Try this, from java.awt.Toolkit, returns a boolean: Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)
How can I detect if caps lock is toggled in Swing? I'm trying to build a better username/password field for my workplace and would like to be able to complain when they have their caps lock on. Is this possible? And if so I'd like to have it detected before the client types their first letter. Is there a non-platform s...
TITLE: How can I detect if caps lock is toggled in Swing? QUESTION: I'm trying to build a better username/password field for my workplace and would like to be able to complain when they have their caps lock on. Is this possible? And if so I'd like to have it detected before the client types their first letter. Is ther...
[ "java", "swing" ]
17
27
6,290
3
0
2008-09-17T22:42:25.103000
2008-09-17T22:45:48.670000
88,438
88,450
Project in Ruby
I've been coding alot of web-stuff all my life, rails lately. And i can always find a website to code, but i'm kind of bored with it. Been taking alot of courses of Java and C lately so i've become a bit interested in desktop application programming. Problem: I can't for the life of me think of a thing to code for desk...
I would say you should roam through github or some other open source site and find an existing young or old project that you can contribute to. Maybe there is something that is barely off the ground, or maybe there is a mature project that could use some improvement.
Project in Ruby I've been coding alot of web-stuff all my life, rails lately. And i can always find a website to code, but i'm kind of bored with it. Been taking alot of courses of Java and C lately so i've become a bit interested in desktop application programming. Problem: I can't for the life of me think of a thing ...
TITLE: Project in Ruby QUESTION: I've been coding alot of web-stuff all my life, rails lately. And i can always find a website to code, but i'm kind of bored with it. Been taking alot of courses of Java and C lately so i've become a bit interested in desktop application programming. Problem: I can't for the life of me...
[ "ruby", "desktop-application" ]
0
2
353
5
0
2008-09-17T22:42:44.963000
2008-09-17T22:44:24.023000
88,454
88,809
Is There Any Advantage in Passing a UI wrapper to a view
Most of the MVC samples I have seen pass an instance of the view to the controller like this public class View { Controller controller = new Controller(this); } Is there any advantage to passing a class which provides access to just the the properties and events the controller is interested in, like this: public class ...
It depends on your architecture. If you're all on the same tier, then you can go without the wrapper, though I'd probably pass an interface that View implements to Controller. Functionally, and from a coupling perspective, the interface approach and the wrapper approach are equivalent. However, if UI is on one tier and...
Is There Any Advantage in Passing a UI wrapper to a view Most of the MVC samples I have seen pass an instance of the view to the controller like this public class View { Controller controller = new Controller(this); } Is there any advantage to passing a class which provides access to just the the properties and events ...
TITLE: Is There Any Advantage in Passing a UI wrapper to a view QUESTION: Most of the MVC samples I have seen pass an instance of the view to the controller like this public class View { Controller controller = new Controller(this); } Is there any advantage to passing a class which provides access to just the the prop...
[ "design-patterns", "oop" ]
2
1
224
2
0
2008-09-17T22:45:33.617000
2008-09-18T00:01:42.123000
88,460
90,689
KVM/QEMU network TAP problems with libvirt
I'm trying to use libvirt with virsh to manage my kvm/qemu vms. The problem I have is with getting it to work with public IPs. The server is running ubuntu 8.04. libvirt keeps trying to run it as: /usr/bin/kvm -M pc -m 256 -smp 3 -monitor pty -no-acpi \ -drive file=/opt/virtual-machines/calculon/root.qcow2,if=ide,boot=...
I followed the bridged networking guide at https://help.ubuntu.com/community/KVM and have the following in /etc/network/interfaces: auto eth0 iface eth0 inet manual auto br0 iface br0 inet static address 192.168.0.10 network 192.168.0.0 netmask 255.255.255.0 broadcast 192.168.0.255 gateway 192.168.0.1 bridge_ports eth...
KVM/QEMU network TAP problems with libvirt I'm trying to use libvirt with virsh to manage my kvm/qemu vms. The problem I have is with getting it to work with public IPs. The server is running ubuntu 8.04. libvirt keeps trying to run it as: /usr/bin/kvm -M pc -m 256 -smp 3 -monitor pty -no-acpi \ -drive file=/opt/virtua...
TITLE: KVM/QEMU network TAP problems with libvirt QUESTION: I'm trying to use libvirt with virsh to manage my kvm/qemu vms. The problem I have is with getting it to work with public IPs. The server is running ubuntu 8.04. libvirt keeps trying to run it as: /usr/bin/kvm -M pc -m 256 -smp 3 -monitor pty -no-acpi \ -driv...
[ "kvm", "qemu", "libvirt" ]
6
6
10,918
2
0
2008-09-17T22:46:14.487000
2008-09-18T07:20:17.433000
88,473
89,769
How to do a "where in values" in LINQ-to-Entities 3.5
Does anybody know how to apply a "where in values" type condition using LINQ-to-Entities? I've tried the following but it doesn't work: var values = new[] { "String1", "String2" }; // some string values var foo = model.entitySet.Where(e => values.Contains(e.Name)); I believe this works in LINQ-to-SQL though? Any thoug...
It is somewhat of a shame that Contains is not supported in Linq to Entities. IN and JOIN are not the same operator (Filtering by IN never changes the cardinality of the query).
How to do a "where in values" in LINQ-to-Entities 3.5 Does anybody know how to apply a "where in values" type condition using LINQ-to-Entities? I've tried the following but it doesn't work: var values = new[] { "String1", "String2" }; // some string values var foo = model.entitySet.Where(e => values.Contains(e.Name));...
TITLE: How to do a "where in values" in LINQ-to-Entities 3.5 QUESTION: Does anybody know how to apply a "where in values" type condition using LINQ-to-Entities? I've tried the following but it doesn't work: var values = new[] { "String1", "String2" }; // some string values var foo = model.entitySet.Where(e => values....
[ "linq", "linq-to-entities" ]
20
1
21,441
7
0
2008-09-17T22:50:23.103000
2008-09-18T03:34:30.630000
88,476
88,562
Trying to load files from github through a firewall is impossibly slow. Any suggestions for workarounds?
I'm a little hesitant to post this, as I'm not completely sure what I'm doing. Any help would be wonderful. I'm on a computer with a firewall/filter on it. I can download files without any difficulty. When I try to clone files from Github, though, the computer just hangs. Nothing happens. It creates a git file in the f...
Github supports cloning using both the git protocol over port 9418 and HTTP over port 80. Using the later is very slow ( Reference ). You should open port 9418 on your firewall or use HTTP cloning otherwise.
Trying to load files from github through a firewall is impossibly slow. Any suggestions for workarounds? I'm a little hesitant to post this, as I'm not completely sure what I'm doing. Any help would be wonderful. I'm on a computer with a firewall/filter on it. I can download files without any difficulty. When I try to ...
TITLE: Trying to load files from github through a firewall is impossibly slow. Any suggestions for workarounds? QUESTION: I'm a little hesitant to post this, as I'm not completely sure what I'm doing. Any help would be wonderful. I'm on a computer with a firewall/filter on it. I can download files without any difficul...
[ "git", "github", "firewall" ]
22
25
28,258
6
0
2008-09-17T22:50:45.320000
2008-09-17T23:07:41.503000
88,485
88,523
Tell if a Javascript function is defined by looking at self[name] - is this a good way?
This is a follow up question to This Question. I like (and understand) the solution there. However, in the code I am working in, another way to solve the same problem is used: function exist(sFN) { if(self[sFN]) return true; return false; } It seems to work fine, although I don't understand how. Does it work? How? What...
Your condition is checking the existence of the "sFN" property in the "self" object. Anything that isn't null, undefined, 0, and "" will evaluate to true. As others have said, you can use typeof, or instanceof to see if it's actually a function. Looking at your linked example, you should read up on the difference betwe...
Tell if a Javascript function is defined by looking at self[name] - is this a good way? This is a follow up question to This Question. I like (and understand) the solution there. However, in the code I am working in, another way to solve the same problem is used: function exist(sFN) { if(self[sFN]) return true; return ...
TITLE: Tell if a Javascript function is defined by looking at self[name] - is this a good way? QUESTION: This is a follow up question to This Question. I like (and understand) the solution there. However, in the code I am working in, another way to solve the same problem is used: function exist(sFN) { if(self[sFN]) re...
[ "javascript" ]
4
6
4,781
7
0
2008-09-17T22:52:35.377000
2008-09-17T23:00:13.987000
88,488
117,275
Getting a DrawingContext for a wpf WriteableBitmap
Is there a way to get a DrawingContext (or something similar) for a WriteableBitmap? I.e. something to allow you to call simple DrawLine / DrawRectangle /etc kinds of methods, rather than manipulate the raw pixels directly.
It appears the word is no. For future reference, we plan to use a port of the Writeable Bitmap Extensions for WPF. For a solution using purely existing code, any of the other suggestions mentioned below will work.
Getting a DrawingContext for a wpf WriteableBitmap Is there a way to get a DrawingContext (or something similar) for a WriteableBitmap? I.e. something to allow you to call simple DrawLine / DrawRectangle /etc kinds of methods, rather than manipulate the raw pixels directly.
TITLE: Getting a DrawingContext for a wpf WriteableBitmap QUESTION: Is there a way to get a DrawingContext (or something similar) for a WriteableBitmap? I.e. something to allow you to call simple DrawLine / DrawRectangle /etc kinds of methods, rather than manipulate the raw pixels directly. ANSWER: It appears the wor...
[ "wpf", "bitmap", "drawing" ]
23
4
30,366
5
0
2008-09-17T22:53:25.453000
2008-09-22T20:09:47.213000
88,489
88,538
When is a browser considered "dead"?
Keep in mind that I'm not looking for a list of current browsers to support, I'm looking for logical ways to make that list, backed by some kind of hard statistics. Since it's been a while since my last web job, I decided to do this latest site up from scratch. Now I have to decide again what to support in terms of bro...
Browsers don't die out completely for about a decade. The first thing you must realise is that you will have some visitors that are using a browser you don't support. The question is not which browsers are not dead, but which browsers are worth supporting (the benefit) relative to the work it takes to do so (the cost)....
When is a browser considered "dead"? Keep in mind that I'm not looking for a list of current browsers to support, I'm looking for logical ways to make that list, backed by some kind of hard statistics. Since it's been a while since my last web job, I decided to do this latest site up from scratch. Now I have to decide ...
TITLE: When is a browser considered "dead"? QUESTION: Keep in mind that I'm not looking for a list of current browsers to support, I'm looking for logical ways to make that list, backed by some kind of hard statistics. Since it's been a while since my last web job, I decided to do this latest site up from scratch. Now...
[ "browser" ]
20
26
2,319
20
0
2008-09-17T22:54:25.653000
2008-09-17T23:04:06.240000
88,490
88,502
Throwing exceptions in ASP.NET C#
Is there a difference between just saying throw; and throw ex; assuming ex is the exception you're catching?
throw ex; will erase your stacktrace. Don't do this unless you mean to clear the stacktrace. Just use throw;
Throwing exceptions in ASP.NET C# Is there a difference between just saying throw; and throw ex; assuming ex is the exception you're catching?
TITLE: Throwing exceptions in ASP.NET C# QUESTION: Is there a difference between just saying throw; and throw ex; assuming ex is the exception you're catching? ANSWER: throw ex; will erase your stacktrace. Don't do this unless you mean to clear the stacktrace. Just use throw;
[ "c#", ".net", "exception" ]
25
44
37,331
3
0
2008-09-17T22:54:32.533000
2008-09-17T22:55:37.443000
88,518
88,544
How to replace $*=1 with an alternative now $* is no longer supported
I'm a complete perl novice, am running a perl script using perl 5.10 and getting this warning: $* is no longer supported at migrate.pl line 380. Can anyone describe what $* did and what the recommended replacement of it is now? Alternatively if you could point me to documentation that describes this that would be great...
From perlvar: Use of $* is deprecated in modern Perl, supplanted by the /s and /m modifiers on pattern matching. If you have access to the place where it's being matched just add it to the end: $haystack =~ m/.../sm; If you only have access to the string, you can surround the expression with qr/(?ms-ix:$expr)/; Or in y...
How to replace $*=1 with an alternative now $* is no longer supported I'm a complete perl novice, am running a perl script using perl 5.10 and getting this warning: $* is no longer supported at migrate.pl line 380. Can anyone describe what $* did and what the recommended replacement of it is now? Alternatively if you c...
TITLE: How to replace $*=1 with an alternative now $* is no longer supported QUESTION: I'm a complete perl novice, am running a perl script using perl 5.10 and getting this warning: $* is no longer supported at migrate.pl line 380. Can anyone describe what $* did and what the recommended replacement of it is now? Alte...
[ "perl", "migrate" ]
9
14
4,350
5
0
2008-09-17T22:58:36.907000
2008-09-17T23:04:49.590000
88,522
91,463
Best way to convert a decimal value to a currency string for display in HTML
I wanting to show prices for my products in my online store. I'm currently doing: <%=GetPrice().ToString("C")%> Where GetPrice() returns a decimal. So this currently returns a value e.g. "£12.00" I think the correct HTML for an output of "£12.00" is " £12.00 ", so although this is rendering fine in most browsers, some ...
The £ symbol (U+00A3), and the html entities & #163; and & pound; should all render the same in a browser. If the browser doesn't recognise £, it probably won't recognise the entity versions. It's in ISO 8859-1 (Latin-1), so I'd be surprised if a Mozilla browser can't render it (my FF certainly can). If you see a $ sig...
Best way to convert a decimal value to a currency string for display in HTML I wanting to show prices for my products in my online store. I'm currently doing: <%=GetPrice().ToString("C")%> Where GetPrice() returns a decimal. So this currently returns a value e.g. "£12.00" I think the correct HTML for an output of "£12....
TITLE: Best way to convert a decimal value to a currency string for display in HTML QUESTION: I wanting to show prices for my products in my online store. I'm currently doing: <%=GetPrice().ToString("C")%> Where GetPrice() returns a decimal. So this currently returns a value e.g. "£12.00" I think the correct HTML for ...
[ "asp.net", "browser", "localization", "currency" ]
2
2
8,617
6
0
2008-09-17T22:59:54.377000
2008-09-18T10:23:18.557000
88,566
88,876
How do I create a node from a cron job in drupal?
In a custom module for drupal 4.7 I hacked together a node object and passed it to node_save($node) to create nodes. This hack appears to no longer work in drupal 6. While I'm sure this hack could be fixed I'm curious if there is a standard solution to create nodes without a form. In this case the data is pulled in fro...
I don't know of a standard API for creating a node pragmatically. But this is what I've gleaned from building a module that does what you're trying to do. Make sure the important fields are set: uid, name, type, language, title, body, filter (see node_add() and node_form() ) Pass the node through node_object_prepare() ...
How do I create a node from a cron job in drupal? In a custom module for drupal 4.7 I hacked together a node object and passed it to node_save($node) to create nodes. This hack appears to no longer work in drupal 6. While I'm sure this hack could be fixed I'm curious if there is a standard solution to create nodes with...
TITLE: How do I create a node from a cron job in drupal? QUESTION: In a custom module for drupal 4.7 I hacked together a node object and passed it to node_save($node) to create nodes. This hack appears to no longer work in drupal 6. While I'm sure this hack could be fixed I'm curious if there is a standard solution to...
[ "php", "drupal", "drupal-6" ]
7
6
7,952
5
0
2008-09-17T23:08:32
2008-09-18T00:19:55.730000
88,570
91,535
Can regex capture and substitution be used with an Apache DirectoryMatch directive?
Does anyone know if it's possible to use regex capture within Apache's DirectoryMatch directive? I'd like to do something like the following: AuthType Basic AuthName $1 AuthUserFile /etc/apache2/svn.passwd Require group $1 admin but so far I've had no success. Specifically, I'm trying to create a group-based HTTP Auth ...
You could tackle the problem from a completely different angle: enable the perl module and you can include a little perl script in your httpd.conf. You could then do something like this: my @groups = qw/ foo bar baz /; foreach ( @groups ) { push @PerlConfig, qq| blah |; } That way, you could even read your groups and o...
Can regex capture and substitution be used with an Apache DirectoryMatch directive? Does anyone know if it's possible to use regex capture within Apache's DirectoryMatch directive? I'd like to do something like the following: AuthType Basic AuthName $1 AuthUserFile /etc/apache2/svn.passwd Require group $1 admin but so ...
TITLE: Can regex capture and substitution be used with an Apache DirectoryMatch directive? QUESTION: Does anyone know if it's possible to use regex capture within Apache's DirectoryMatch directive? I'd like to do something like the following: AuthType Basic AuthName $1 AuthUserFile /etc/apache2/svn.passwd Require grou...
[ "regex", "apache" ]
5
3
1,917
2
0
2008-09-17T23:09:47.707000
2008-09-18T10:43:08.617000
88,571
88,597
Any problems running SharpDevelop 3.0 and Visual Studio 2008 side by side?
I have been asked to lend a hand on a hobby project that a couple friends are working on, they are using SharpDevelop 3.0 (Beta 2 I think, but it might be Beta 1) is there any hassle for me to install and use this IDE given that I have Visual Studio 2008 installed?
I've had no problems at all, in fact some of the tools in sharpdevelop (like the vb.net -> c# converter) are very nice to have. In addition, there are some good libraries included with sharpdevelop that are also handy (like sharpziplib for zip files) I actually have VS2005, VS2008, SharpDevelop and VisualStudio 6 insta...
Any problems running SharpDevelop 3.0 and Visual Studio 2008 side by side? I have been asked to lend a hand on a hobby project that a couple friends are working on, they are using SharpDevelop 3.0 (Beta 2 I think, but it might be Beta 1) is there any hassle for me to install and use this IDE given that I have Visual St...
TITLE: Any problems running SharpDevelop 3.0 and Visual Studio 2008 side by side? QUESTION: I have been asked to lend a hand on a hobby project that a couple friends are working on, they are using SharpDevelop 3.0 (Beta 2 I think, but it might be Beta 1) is there any hassle for me to install and use this IDE given tha...
[ "c#", "visual-studio", "sharpdevelop" ]
2
3
949
3
0
2008-09-17T23:10:14.447000
2008-09-17T23:13:27.527000
88,573
88,905
Should I use an exception specifier in C++?
In C++, you can specify that a function may or may not throw an exception by using an exception specifier. For example: void foo() throw(); // guaranteed not to throw an exception void bar() throw(int); // may throw an exception of type int void baz() throw(...); // may throw an exception of some unspecified type I'm d...
No. Here are several examples why: Template code is impossible to write with exception specifications, template void f( T k ) { T x( k ); x.x(); } The copies might throw, the parameter passing might throw, and x() might throw some unknown exception. Exception-specifications tend to prohibit extensibility. virtual void ...
Should I use an exception specifier in C++? In C++, you can specify that a function may or may not throw an exception by using an exception specifier. For example: void foo() throw(); // guaranteed not to throw an exception void bar() throw(int); // may throw an exception of type int void baz() throw(...); // may throw...
TITLE: Should I use an exception specifier in C++? QUESTION: In C++, you can specify that a function may or may not throw an exception by using an exception specifier. For example: void foo() throw(); // guaranteed not to throw an exception void bar() throw(int); // may throw an exception of type int void baz() throw(...
[ "c++", "function", "exception", "throw", "specifier" ]
137
107
30,016
14
0
2008-09-17T23:10:25.147000
2008-09-18T00:26:36.477000
88,582
88,595
Structure of a PDF file?
For a small project I have to parse pdf files and take a specific part of them (a simple chain of characters). I'd like to use python to do this and I've found several libraries that are capable of doing what I want in some ways. But now after a few researches, I'm wondering what is the real structure of a pdf file, do...
Here is a link to Adobe's reference material http://www.adobe.com/devnet/pdf/pdf_reference.html You should know though that PDF is only about presentation, not structure. Parsing will not come easy.
Structure of a PDF file? For a small project I have to parse pdf files and take a specific part of them (a simple chain of characters). I'd like to use python to do this and I've found several libraries that are capable of doing what I want in some ways. But now after a few researches, I'm wondering what is the real st...
TITLE: Structure of a PDF file? QUESTION: For a small project I have to parse pdf files and take a specific part of them (a simple chain of characters). I'd like to use python to do this and I've found several libraries that are capable of doing what I want in some ways. But now after a few researches, I'm wondering w...
[ "pdf" ]
83
50
121,938
12
0
2008-09-17T23:11:33.757000
2008-09-17T23:13:19.867000
88,615
88,765
What algorithm can you use to find duplicate phrases in a string?
Given an arbitrary string, what is an efficient method of finding duplicate phrases? We can say that phrases must be longer than a certain length to be included. Ideally, you would end up with the number of occurrences for each phrase.
Like the earlier folks mention that suffix tree is the best tool for the job. My favorite site for suffix trees is http://www.allisons.org/ll/AlgDS/Tree/Suffix/. It enumerates all the nifty uses of suffix trees on one page and has a test js applicaton embedded to test strings and work through examples.
What algorithm can you use to find duplicate phrases in a string? Given an arbitrary string, what is an efficient method of finding duplicate phrases? We can say that phrases must be longer than a certain length to be included. Ideally, you would end up with the number of occurrences for each phrase.
TITLE: What algorithm can you use to find duplicate phrases in a string? QUESTION: Given an arbitrary string, what is an efficient method of finding duplicate phrases? We can say that phrases must be longer than a certain length to be included. Ideally, you would end up with the number of occurrences for each phrase. ...
[ "algorithm", "language-agnostic", "parsing" ]
10
4
8,794
5
0
2008-09-17T23:18:08.827000
2008-09-17T23:49:14.413000
88,618
88,657
How do you include a JavaScript file from within a SharePoint WebPart?
We have a medium sized.js file that we include in our web framework that I am porting over to SharePoint. However, I'm not sure how to go about this or what the best practice is. This is for a framework solution that will be used by other client projects, so it's best for it to be self contained and deploy-able, rather...
Embeded resource is the best way and you don't need to use the ScriptManager to render it out (as AJAX is not configured OoB on SharePoint), you can just render it as any other client script resource (through the ClientScriptManager). Best idea is the have an if ContainsScriptManager else UsClientScriptManager style. T...
How do you include a JavaScript file from within a SharePoint WebPart? We have a medium sized.js file that we include in our web framework that I am porting over to SharePoint. However, I'm not sure how to go about this or what the best practice is. This is for a framework solution that will be used by other client pro...
TITLE: How do you include a JavaScript file from within a SharePoint WebPart? QUESTION: We have a medium sized.js file that we include in our web framework that I am porting over to SharePoint. However, I'm not sure how to go about this or what the best practice is. This is for a framework solution that will be used b...
[ "sharepoint", "web-parts" ]
0
2
5,294
3
0
2008-09-17T23:18:22.727000
2008-09-17T23:25:14.470000
88,626
88,677
Best platform for learning embedded programming?
I'm looking to learn about embedded programming (in C mainly, but I hope to brush up on my ASM as well) and I was wondering what the best platform would be. I have some experience in using Atmel AVR's and programming them with the stk500 and found that to be relatively easy. I especially like AVR Studio and the debugge...
"embedded programming" is a very broad term. AVR is pretty well in that category, but it's a step below ARM, in that it's both simpler to use, as well as less powerful. If you just want to play around with ARM, buy a Nintendo DS or a Gameboy Advance. These are very cheap compared to the hardware inside (wonders of mass...
Best platform for learning embedded programming? I'm looking to learn about embedded programming (in C mainly, but I hope to brush up on my ASM as well) and I was wondering what the best platform would be. I have some experience in using Atmel AVR's and programming them with the stk500 and found that to be relatively e...
TITLE: Best platform for learning embedded programming? QUESTION: I'm looking to learn about embedded programming (in C mainly, but I hope to brush up on my ASM as well) and I was wondering what the best platform would be. I have some experience in using Atmel AVR's and programming them with the stk500 and found that ...
[ "embedded", "arm", "avr" ]
24
25
13,053
21
0
2008-09-17T23:19:25.873000
2008-09-17T23:27:53.060000
88,629
88,687
How do you do performance testing in Ruby webapps?
I've been looking at ways people test their apps in order decide where to do caching or apply some extra engineering effort, and so far httperf and a simple sesslog have been quite helpful. What tools and tricks did you apply on your projects?
I use httperf for a high level view of performance. Rails has a performance script built in, that uses the ruby-prof gem to analyse calls deep within the Rails stack. There is an awesome Railscast on Request Profiling using this technique. NewRelic have some seriously cool analysis tools that give near real-time data. ...
How do you do performance testing in Ruby webapps? I've been looking at ways people test their apps in order decide where to do caching or apply some extra engineering effort, and so far httperf and a simple sesslog have been quite helpful. What tools and tricks did you apply on your projects?
TITLE: How do you do performance testing in Ruby webapps? QUESTION: I've been looking at ways people test their apps in order decide where to do caching or apply some extra engineering effort, and so far httperf and a simple sesslog have been quite helpful. What tools and tricks did you apply on your projects? ANSWER...
[ "ruby", "performance", "testing" ]
7
9
1,707
5
0
2008-09-17T23:19:39.273000
2008-09-17T23:29:31.810000
88,651
239,482
Best way of getting notifications in SQL Server Reporting Services using Notification Services
Is it possible to get notifications using SQL Server Reporting Services? Say for example I have a report that I want by mail if has for example suddenly shows more than 10 rows or if a specific value drop below 100 000. Do I need to tie Notification Services into it and how do I do that? Please provide as much technica...
I'd agree with Simon re Notification Services Also, data driven SSRS Subscriptions are not available unless you use Enterprise Edition (and isn't available if you use SharePoint Integrated Mode). An alternate way would be to create an Agent job that runs a proc. The proc could check the conditions you require and kick ...
Best way of getting notifications in SQL Server Reporting Services using Notification Services Is it possible to get notifications using SQL Server Reporting Services? Say for example I have a report that I want by mail if has for example suddenly shows more than 10 rows or if a specific value drop below 100 000. Do I ...
TITLE: Best way of getting notifications in SQL Server Reporting Services using Notification Services QUESTION: Is it possible to get notifications using SQL Server Reporting Services? Say for example I have a report that I want by mail if has for example suddenly shows more than 10 rows or if a specific value drop be...
[ "sql-server", "reporting-services", "notificationservices" ]
2
4
9,895
5
0
2008-09-17T23:24:41.710000
2008-10-27T10:10:04.413000
88,682
88,899
What's the best way to serialize a HashTable for SOAP/XML?
What's the best way to serialize a HashTable (or a data best navigated through a string indexer) with SOAP/XML? Let's say I have a Foo that has an property Bar[] Bars. A Bar object has a key and a value. By default, this serializes to the following XML:... For JSON, this serializes to: {"Foo":["Bars":[{"Key":"key0","Va...
I really don't think that what you want reflects the structure better. To define a schema (think XSD) for this you would have to know all of the potential keys in advance since you indicate that you want each one to be a separate custom type. Conceptually Bars would be an array of objects holding objects of type Key0, ...
What's the best way to serialize a HashTable for SOAP/XML? What's the best way to serialize a HashTable (or a data best navigated through a string indexer) with SOAP/XML? Let's say I have a Foo that has an property Bar[] Bars. A Bar object has a key and a value. By default, this serializes to the following XML:... For ...
TITLE: What's the best way to serialize a HashTable for SOAP/XML? QUESTION: What's the best way to serialize a HashTable (or a data best navigated through a string indexer) with SOAP/XML? Let's say I have a Foo that has an property Bar[] Bars. A Bar object has a key and a value. By default, this serializes to the foll...
[ "c#", ".net", "xml", "serialization" ]
1
1
2,305
4
0
2008-09-17T23:28:57.257000
2008-09-18T00:25:39.803000
88,703
89,850
How Does Relational Theory Apply in Ways I can Care About while Learning it?
So I'm taking the Discrete Math course from MIT's OpenCourseWare and I'm wondering... I see the connection between relations and graphs but not enough to "own" it. I've implemented a simple state machine in SQL as well so I grok graphs pretty well, just not the more rigorous study of how relations and sets compeltely a...
wow, 4 hours and no answer; i had a similar experience in school but just learned the stuff and figured out what it was good for later. it turns out to be very useful, so let's see if this helps - a database is formally defined as a set of relations, but it is also a graph; each table is a node, each column is a node c...
How Does Relational Theory Apply in Ways I can Care About while Learning it? So I'm taking the Discrete Math course from MIT's OpenCourseWare and I'm wondering... I see the connection between relations and graphs but not enough to "own" it. I've implemented a simple state machine in SQL as well so I grok graphs pretty ...
TITLE: How Does Relational Theory Apply in Ways I can Care About while Learning it? QUESTION: So I'm taking the Discrete Math course from MIT's OpenCourseWare and I'm wondering... I see the connection between relations and graphs but not enough to "own" it. I've implemented a simple state machine in SQL as well so I g...
[ "graph-theory", "relational", "finite-automata", "discrete-mathematics" ]
2
3
270
1
0
2008-09-17T23:33:37.587000
2008-09-18T03:52:29.477000
88,710
91,077
Reporting Services Deployment
I need to create a repeatable process for deploying SQL Server Reporting Services reports. I am not in favor of using Visual Studio and or Business Development Studio to do this. The rs.exe method of scripting deployments also seems rather clunky. Does anyone have a very elegant way that they have been able to deploy r...
We use rs.exe, once we developed the script we have not needed to touch it anymore, it just works. Here is the source (I slightly modified it by hand to remove sensitive data without a chance to test it, hope I did not brake anything), it deploys reports and associated images from subdirectories for various languages. ...
Reporting Services Deployment I need to create a repeatable process for deploying SQL Server Reporting Services reports. I am not in favor of using Visual Studio and or Business Development Studio to do this. The rs.exe method of scripting deployments also seems rather clunky. Does anyone have a very elegant way that t...
TITLE: Reporting Services Deployment QUESTION: I need to create a repeatable process for deploying SQL Server Reporting Services reports. I am not in favor of using Visual Studio and or Business Development Studio to do this. The rs.exe method of scripting deployments also seems rather clunky. Does anyone have a very ...
[ "deployment", "reporting-services" ]
33
33
17,572
7
0
2008-09-17T23:35:07.223000
2008-09-18T09:04:57.777000
88,711
88,720
How to concatenate icons into a single image with ImageMagick?
I want to use CSS sprites on a web site instead of separate image files, for a large collection of small icons that are all the same size. How can I concatenate (tile) them into one big image using ImageMagick?
From the page you linked, 'montage' is the tool you want. It'll take a bunch of images and concatenate/tile them into a single output. Here's an example image I've made before using the tool: (source: davr.org )
How to concatenate icons into a single image with ImageMagick? I want to use CSS sprites on a web site instead of separate image files, for a large collection of small icons that are all the same size. How can I concatenate (tile) them into one big image using ImageMagick?
TITLE: How to concatenate icons into a single image with ImageMagick? QUESTION: I want to use CSS sprites on a web site instead of separate image files, for a large collection of small icons that are all the same size. How can I concatenate (tile) them into one big image using ImageMagick? ANSWER: From the page you l...
[ "graphics", "bitmap", "imagemagick", "css-sprites" ]
44
31
21,831
4
0
2008-09-17T23:35:10.143000
2008-09-17T23:37:28.530000
88,717
93,045
Loading DLLs into a separate AppDomain
I want to load one or more DLLs dynamically so that they run with a different security or basepath than my main application. How do I load these DLLs into a separate AppDomain and instantiate objects from them?
More specifically AppDomain domain = AppDomain.CreateDomain("New domain name"); //Do other things to the domain like set the security policy string pathToDll = @"C:\myDll.dll"; //Full path to dll you want to load Type t = typeof(TypeIWantToLoad); TypeIWantToLoad myObject = (TypeIWantToLoad)domain.CreateInstanceFromAnd...
Loading DLLs into a separate AppDomain I want to load one or more DLLs dynamically so that they run with a different security or basepath than my main application. How do I load these DLLs into a separate AppDomain and instantiate objects from them?
TITLE: Loading DLLs into a separate AppDomain QUESTION: I want to load one or more DLLs dynamically so that they run with a different security or basepath than my main application. How do I load these DLLs into a separate AppDomain and instantiate objects from them? ANSWER: More specifically AppDomain domain = AppDom...
[ "c#", ".net", "appdomain" ]
33
35
39,127
5
0
2008-09-17T23:36:42.137000
2008-09-18T14:29:27.043000
88,736
88,880
CPAN/gem-like repository for Objective-C and Cocoa?
Is there any centralized repository of useful Objective-C / Cocoa libraries as there is for Perl, Ruby, Python, etc.? In building my first iPhone app, I'm finding myself implementing some very basic functions that would be just a quick "gem install" away in Ruby.
Unfortunately not:( There are some very useful sites however. I find one of the best is cocoadev.com as it contains lots of useful information about many of the more obscure classes usually including snippets of code to do some really cool things:) Maybe we (the cocoa community) should look into building something like...
CPAN/gem-like repository for Objective-C and Cocoa? Is there any centralized repository of useful Objective-C / Cocoa libraries as there is for Perl, Ruby, Python, etc.? In building my first iPhone app, I'm finding myself implementing some very basic functions that would be just a quick "gem install" away in Ruby.
TITLE: CPAN/gem-like repository for Objective-C and Cocoa? QUESTION: Is there any centralized repository of useful Objective-C / Cocoa libraries as there is for Perl, Ruby, Python, etc.? In building my first iPhone app, I'm finding myself implementing some very basic functions that would be just a quick "gem install" ...
[ "ios", "objective-c", "macos", "cocoa" ]
8
3
958
9
0
2008-09-17T23:41:47.147000
2008-09-18T00:20:08.397000
88,743
90,136
Using jmockit expectations with matchers and primitive types
I'm using jmockit for unit testing (with TestNG), and I'm having trouble using the Expectations class to mock out a method that takes a primitive type (boolean) as a parameter, using a matcher. Here's some sample code that illustrates the problem. /******************************************************/ import static o...
So the problem appears to be in Expectations.with(): protected final T with(Matcher argumentMatcher) { argMatchers.add(argumentMatcher); TypeVariable typeVariable = argumentMatcher.getClass().getTypeParameters()[0]; return (T) Utilities.defaultValueForType(typeVariable.getClass()); } The call to typeVariable.getClass...
Using jmockit expectations with matchers and primitive types I'm using jmockit for unit testing (with TestNG), and I'm having trouble using the Expectations class to mock out a method that takes a primitive type (boolean) as a parameter, using a matcher. Here's some sample code that illustrates the problem. /**********...
TITLE: Using jmockit expectations with matchers and primitive types QUESTION: I'm using jmockit for unit testing (with TestNG), and I'm having trouble using the Expectations class to mock out a method that takes a primitive type (boolean) as a parameter, using a matcher. Here's some sample code that illustrates the pr...
[ "java", "unit-testing", "mocking", "jmockit" ]
5
2
4,243
3
0
2008-09-17T23:43:39.683000
2008-09-18T04:52:00.053000
88,763
88,789
What Is ASP.Net MVC?
When I first heard about StackOverflow, and heard that it was being built in ASP.Net MVC, I was a little confused. I thought ASP.Net was always an example of an MVC architecture. You have the.aspx page that provides the view, the.aspx.vb page that provides the controller, and you can create another class to be the mode...
.aspx doesn't fulfill the MVC pattern because the aspx page (the 'view') is called before the code behind (the 'controller'). This means that the controller has a 'hard dependency' on the view, which is very much against MVC principles. One of the core benefits of MVC is that it allows you to test your controller (whic...
What Is ASP.Net MVC? When I first heard about StackOverflow, and heard that it was being built in ASP.Net MVC, I was a little confused. I thought ASP.Net was always an example of an MVC architecture. You have the.aspx page that provides the view, the.aspx.vb page that provides the controller, and you can create another...
TITLE: What Is ASP.Net MVC? QUESTION: When I first heard about StackOverflow, and heard that it was being built in ASP.Net MVC, I was a little confused. I thought ASP.Net was always an example of an MVC architecture. You have the.aspx page that provides the view, the.aspx.vb page that provides the controller, and you ...
[ "asp.net-mvc", "model-view-controller" ]
15
14
3,384
7
0
2008-09-17T23:49:04.680000
2008-09-17T23:56:12.090000
88,773
88,875
Flatten XML to HTML table
There must be a generic way to transform some hierachical XML such as:... into the flattened XML (html) picking up selected attributes along the way and providing different labels for the attributes that become column headers. A_Label D_Label E_Label F_Label AValue DValue EValue1 FValue1 AValue DValue EValue2 FValue2 O...
I'm not 100% sure of what you are trying to do but this solution may work if your element1, element2 and element3 are nested consistently.
Flatten XML to HTML table There must be a generic way to transform some hierachical XML such as:... into the flattened XML (html) picking up selected attributes along the way and providing different labels for the attributes that become column headers. A_Label D_Label E_Label F_Label AValue DValue EValue1 FValue1 AValu...
TITLE: Flatten XML to HTML table QUESTION: There must be a generic way to transform some hierachical XML such as:... into the flattened XML (html) picking up selected attributes along the way and providing different labels for the attributes that become column headers. A_Label D_Label E_Label F_Label AValue DValue EVa...
[ "xml", "xslt", "xpath" ]
6
5
7,357
5
0
2008-09-17T23:51:53.487000
2008-09-18T00:19:31.657000