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
179,868
179,884
Trace vs Debug in .NET BCL
It seems that the System.Diagnostics.Debug, and System.Diagnostics.Trace are largely the same, with the notable exception that Debug usage is compiled out in a release configuration. When would you use one and not the other? The only answer to this I've dug up so far is just that you use the Debug class to generate out...
The main difference is the one you indicate: Debug is not included in release, while Trace is. The intended difference, as I understand it, is that development teams might use Debug to emit rich, descriptive messages that might prove too detailed (or revealing) for the consumer(s) of a product, while Trace is intended ...
Trace vs Debug in .NET BCL It seems that the System.Diagnostics.Debug, and System.Diagnostics.Trace are largely the same, with the notable exception that Debug usage is compiled out in a release configuration. When would you use one and not the other? The only answer to this I've dug up so far is just that you use the ...
TITLE: Trace vs Debug in .NET BCL QUESTION: It seems that the System.Diagnostics.Debug, and System.Diagnostics.Trace are largely the same, with the notable exception that Debug usage is compiled out in a release configuration. When would you use one and not the other? The only answer to this I've dug up so far is just...
[ "c#", ".net", "debugging", "instrumentation" ]
69
72
36,370
7
0
2008-10-07T19:00:50.940000
2008-10-07T19:07:01.083000
179,872
179,888
Excel SheetSelectionChange event example needed
I have a problem I'm trying to solve involving interfaceing a C++ program with Excel (an import interface, specifically). The SheetSelectionChange sounds like it will get me most of the way to where I need to be, but I can't find any good documentation or examples on registering the event, using its Range parameter whe...
You need to implement the Excel events interface, and then advise on the Excel connection point. Look at Office Automation Using VC++, more specifically point 7. You can also look at Handle Events for Excel using Visual C++.Net
Excel SheetSelectionChange event example needed I have a problem I'm trying to solve involving interfaceing a C++ program with Excel (an import interface, specifically). The SheetSelectionChange sounds like it will get me most of the way to where I need to be, but I can't find any good documentation or examples on regi...
TITLE: Excel SheetSelectionChange event example needed QUESTION: I have a problem I'm trying to solve involving interfaceing a C++ program with Excel (an import interface, specifically). The SheetSelectionChange sounds like it will get me most of the way to where I need to be, but I can't find any good documentation o...
[ "windows", "excel", "visual-c++", "com" ]
0
0
999
1
0
2008-10-07T19:02:40.937000
2008-10-07T19:07:52.907000
179,904
180,341
What is MATLAB good for? Why is it so used by universities? When is it better than Python?
I've been recently asked to learn some MATLAB basics for a class. What does make it so cool for researchers and people that works in university? I saw it's cool to work with matrices and plotting things... (things that can be done easily in Python using some libraries). Writing a function or parsing a file is just pain...
Adam is only partially right. Many, if not most, mathematicians will never touch it. If there is a computer tool used at all, it's going to be something like Mathematica or Maple. Engineering departments, on the other hand, often rely on it and there are definitely useful things for some applied mathematicians. It's al...
What is MATLAB good for? Why is it so used by universities? When is it better than Python? I've been recently asked to learn some MATLAB basics for a class. What does make it so cool for researchers and people that works in university? I saw it's cool to work with matrices and plotting things... (things that can be don...
TITLE: What is MATLAB good for? Why is it so used by universities? When is it better than Python? QUESTION: I've been recently asked to learn some MATLAB basics for a class. What does make it so cool for researchers and people that works in university? I saw it's cool to work with matrices and plotting things... (thin...
[ "python", "matlab" ]
53
77
210,071
21
0
2008-10-07T19:11:46.427000
2008-10-07T20:47:37.370000
179,907
179,926
How do I work with Multiple Recordsets in C++ ODBC
I am trying to streamline a complex process of storing information in multiple tables and them linking them to a central table. The linking occurs using IDENTITY values generated in each table to provide the unique linking. I know I can use a combination of SET NOCOUNT ON and SELECT @@identity to get each identity, but...
Use the SQLMoreResults() call as the analog to the NextRecordSet() function. However you probably don't need that if you are willing to make your executes consist of INSERT...; SELECT @@IDENTITY Since the only result returned from this statement is the identity, you don't need to bother with the SQLMoreResults().
How do I work with Multiple Recordsets in C++ ODBC I am trying to streamline a complex process of storing information in multiple tables and them linking them to a central table. The linking occurs using IDENTITY values generated in each table to provide the unique linking. I know I can use a combination of SET NOCOUNT...
TITLE: How do I work with Multiple Recordsets in C++ ODBC QUESTION: I am trying to streamline a complex process of storing information in multiple tables and them linking them to a central table. The linking occurs using IDENTITY values generated in each table to provide the unique linking. I know I can use a combinat...
[ "c++", "sql-server", "odbc" ]
0
0
1,434
1
0
2008-10-07T19:12:34.303000
2008-10-07T19:19:37.017000
179,911
179,917
Where can I get the missing figures from the freely available, classic "Programming Ruby" e-book?
I am studying the content of "Programming Ruby- The Pragmatic Programmer's Guide" but the HTML version does not include the Figures. Are the figures available anywhere online?
Unfortunately, the HTML version applies to an older version of Ruby and is no longer maintained. If you want to learn Ruby via the Programming Ruby book, you should buy the latest edition.
Where can I get the missing figures from the freely available, classic "Programming Ruby" e-book? I am studying the content of "Programming Ruby- The Pragmatic Programmer's Guide" but the HTML version does not include the Figures. Are the figures available anywhere online?
TITLE: Where can I get the missing figures from the freely available, classic "Programming Ruby" e-book? QUESTION: I am studying the content of "Programming Ruby- The Pragmatic Programmer's Guide" but the HTML version does not include the Figures. Are the figures available anywhere online? ANSWER: Unfortunately, the ...
[ "ruby" ]
0
3
203
1
0
2008-10-07T19:13:10.697000
2008-10-07T19:16:47.740000
179,915
180,016
ASP.NET MVC + ORM
I am in the start up of a project using ASP.NET MVC and have started creating my models. Since I know some Ruby On Rails and would like to use a system as similar to Rails Active Record as possible. Have anyone used Castle Projects Active Record in a ASP.NET MVC application (or any application that is relevant) and hav...
I have used Castle Active Record with ASP.NET MVC. I highly encourage this model, as ActiveRecord/NHibernate are much more mature that LINQ to SQL or the Entity Framework. I think that ASP.NET MVC has a bright future and would recommend it over Monorail for new projects. However, as I said, ActiveRecord is (in my view)...
ASP.NET MVC + ORM I am in the start up of a project using ASP.NET MVC and have started creating my models. Since I know some Ruby On Rails and would like to use a system as similar to Rails Active Record as possible. Have anyone used Castle Projects Active Record in a ASP.NET MVC application (or any application that is...
TITLE: ASP.NET MVC + ORM QUESTION: I am in the start up of a project using ASP.NET MVC and have started creating my models. Since I know some Ruby On Rails and would like to use a system as similar to Rails Active Record as possible. Have anyone used Castle Projects Active Record in a ASP.NET MVC application (or any a...
[ "asp.net-mvc", "activerecord" ]
3
5
4,655
7
0
2008-10-07T19:15:37.150000
2008-10-07T19:40:45.570000
179,927
464,620
How to resolve "Could not find schema information for the element/attribute <xxx>"?
In visual studio, I have an asp.net 3.5 project that is using MS Enterprise Library 4.0 application blocks. When I have my web config file open, my Error list fills up with 99 messages with things like Could not find schema information for the element 'dataConfiguration'. Could not find schema information for the attri...
I configured the app.config with the tool for EntLib configuration and set up my LoggingConfiguration block. Then I copied this into the DotNetConfig.xsd. Of course, it does not cover all attributes, only the ones I added but it does not display those annoying info messages anymore.
How to resolve "Could not find schema information for the element/attribute <xxx>"? In visual studio, I have an asp.net 3.5 project that is using MS Enterprise Library 4.0 application blocks. When I have my web config file open, my Error list fills up with 99 messages with things like Could not find schema information ...
TITLE: How to resolve "Could not find schema information for the element/attribute <xxx>"? QUESTION: In visual studio, I have an asp.net 3.5 project that is using MS Enterprise Library 4.0 application blocks. When I have my web config file open, my Error list fills up with 99 messages with things like Could not find s...
[ ".net", "xml", "xsd", "enterprise-library" ]
47
11
153,441
6
0
2008-10-07T19:19:41.403000
2009-01-21T09:45:10.950000
179,938
180,307
ASP.NET: How to access repeater generated form input elements?
i'm want to have a repeater generate a bunch of checkboxes, e.g.: stackoverflow.com microsoft.com gmail.com youporn.com fantasti.cc Question 1: How do i individually reference each checkbox when the repeater is running so i can set the unique value? Do i data-bind it with something like: <%# ((Item)Container.DataItem)....
Use the server control instead of making an input control runat=server When you set the value in your ItemDataBound, you use FindControl CheckBox checkBox = (CheckBox)e.Item.FindControl("whatever"); checkBox.Checked = true; When you get the items, you also use FindControl from the item in a foreach construct. Also, dep...
ASP.NET: How to access repeater generated form input elements? i'm want to have a repeater generate a bunch of checkboxes, e.g.: stackoverflow.com microsoft.com gmail.com youporn.com fantasti.cc Question 1: How do i individually reference each checkbox when the repeater is running so i can set the unique value? Do i da...
TITLE: ASP.NET: How to access repeater generated form input elements? QUESTION: i'm want to have a repeater generate a bunch of checkboxes, e.g.: stackoverflow.com microsoft.com gmail.com youporn.com fantasti.cc Question 1: How do i individually reference each checkbox when the repeater is running so i can set the uni...
[ "asp.net", "datarepeater" ]
11
14
28,083
4
0
2008-10-07T19:22:56.123000
2008-10-07T20:40:46.120000
179,951
180,026
Utility to get the latest version of a windows forms app from a network share
Is there any utility that will copy the "official" build of a windows forms app from a central network share and launch it (from a client desktop)? I want to make sure users get the latest version when I update the binaries on the central network share. ClickOnce is user un-friendly so I'm looking for something else...
I've done this before by the following method: 1 - Keep the "official" build at a specific network location 2 - User launches program from their local machine 3 - At launch, program compares its' own file version # to the one on the server. 4 - If the two versions are different, copy the new version down from the serve...
Utility to get the latest version of a windows forms app from a network share Is there any utility that will copy the "official" build of a windows forms app from a central network share and launch it (from a client desktop)? I want to make sure users get the latest version when I update the binaries on the central net...
TITLE: Utility to get the latest version of a windows forms app from a network share QUESTION: Is there any utility that will copy the "official" build of a windows forms app from a central network share and launch it (from a client desktop)? I want to make sure users get the latest version when I update the binaries ...
[ "winforms", "deployment", "synchronization" ]
0
0
204
4
0
2008-10-07T19:27:16.177000
2008-10-07T19:42:40.373000
179,955
179,971
How do you enable anti aliasing in arbitrary Java apps?
Many Java Apps don't use anti-aliased fonts by default, despite the capability of Swing to provide them. How can you coerce an arbitrary java application to use AA fonts? (both for applications I'm running, and applications I'm developing)
If you have access to the source, you can do this in the main method: // enable anti-aliased text: System.setProperty("awt.useSystemAAFontSettings","on"); or, (and if you do not have access to the source, or if this is easier) you can simply pass the system properties above into the jvm by adding these options to the c...
How do you enable anti aliasing in arbitrary Java apps? Many Java Apps don't use anti-aliased fonts by default, despite the capability of Swing to provide them. How can you coerce an arbitrary java application to use AA fonts? (both for applications I'm running, and applications I'm developing)
TITLE: How do you enable anti aliasing in arbitrary Java apps? QUESTION: Many Java Apps don't use anti-aliased fonts by default, despite the capability of Swing to provide them. How can you coerce an arbitrary java application to use AA fonts? (both for applications I'm running, and applications I'm developing) ANSWE...
[ "java", "antialiasing" ]
52
81
37,330
3
0
2008-10-07T19:28:26.703000
2008-10-07T19:31:02.457000
179,969
211,554
Test Reporting
We are migrating our test report data (unit, regression, integration, etc..) from an XML format to a database format for better analysis. Right now the majority of our test analysis is done using the CruiseControl.NET dashboard, but this is limited to primarily the most recent test data. Older test data can be accessed...
You could always just use SQL Server Reporting Services and Report Builder (MS's web based designer) or Report Designer (component of Visual studio). It's pretty easy to get this set up too. Report Builder: http://msdn.microsoft.com/en-us/library/ms155933.aspx Report Designer: http://msdn.microsoft.com/en-us/library/ms...
Test Reporting We are migrating our test report data (unit, regression, integration, etc..) from an XML format to a database format for better analysis. Right now the majority of our test analysis is done using the CruiseControl.NET dashboard, but this is limited to primarily the most recent test data. Older test data ...
TITLE: Test Reporting QUESTION: We are migrating our test report data (unit, regression, integration, etc..) from an XML format to a database format for better analysis. Right now the majority of our test analysis is done using the CruiseControl.NET dashboard, but this is limited to primarily the most recent test data...
[ "reporting", "analysis", "business-intelligence", "pentaho" ]
7
1
632
3
0
2008-10-07T19:30:45.840000
2008-10-17T09:37:17.427000
179,985
180,009
Python class factory ... or?
We have a database library in C# that we can use like this: DatabaseConnection conn = DatabaseConnection.FromConnectionString("..."); This library hides many of the differences between different database engines, like SQL function names, parameter names and specifications, etc. Internally, the DatabaseConnection class ...
This is possible in Python, but is probably not the best way to do it. The class factory pattern is essentially a workaround for languages that don't have first class classes. Since Python does have first class classes, you can store a class in a variable, and use that class directly to create instances. To change what...
Python class factory ... or? We have a database library in C# that we can use like this: DatabaseConnection conn = DatabaseConnection.FromConnectionString("..."); This library hides many of the differences between different database engines, like SQL function names, parameter names and specifications, etc. Internally, ...
TITLE: Python class factory ... or? QUESTION: We have a database library in C# that we can use like this: DatabaseConnection conn = DatabaseConnection.FromConnectionString("..."); This library hides many of the differences between different database engines, like SQL function names, parameter names and specifications,...
[ "c#", "python" ]
2
5
2,601
3
0
2008-10-07T19:34:13.853000
2008-10-07T19:39:32.377000
179,987
180,022
SQL Server - script to update database columns from varchar to nvarchar if not already nvarchar
I am in a situation where I must update an existing database structure from varchar to nvarchar using a script. Since this script is run everytime a configuration application is run, I would rather determine if a column has already been changed to nvarchar and not perform an alter on the table. The databases which I mu...
The following query should get you what you need: IF EXISTS (SELECT * FROM sysobjects syo JOIN syscolumns syc ON syc.id = syo.id JOIN systypes syt ON syt.xtype = syc.xtype WHERE syt.name = 'nvarchar' AND syo.name = 'MY TABLE NAME' AND syc.name = 'MY COLUMN NAME') BEGIN ALTER... END
SQL Server - script to update database columns from varchar to nvarchar if not already nvarchar I am in a situation where I must update an existing database structure from varchar to nvarchar using a script. Since this script is run everytime a configuration application is run, I would rather determine if a column has ...
TITLE: SQL Server - script to update database columns from varchar to nvarchar if not already nvarchar QUESTION: I am in a situation where I must update an existing database structure from varchar to nvarchar using a script. Since this script is run everytime a configuration application is run, I would rather determin...
[ "sql-server", "alter-table" ]
9
2
18,961
5
0
2008-10-07T19:34:54.040000
2008-10-07T19:41:37.630000
179,988
180,701
Winforms - best directory / project structure
Wanted to see peoples thoughts on best way to organize directory and project structure on a project / solution for a winforms C# app. Most people agree its best to seperate view, business logic, data objects, interfaces but wanted to see how different people tackle this. In addition, isolate third party dependencies in...
For me it depends on the model I'm following. If I'm using MVC it would be Project -Models -Controllers -Views Or for MVP it would be Project -Models -Presenters -Views Under the views I seperate them into namespaces relevant to the controllers, i.e. if I have a controller to handle inventory transactions I might have ...
Winforms - best directory / project structure Wanted to see peoples thoughts on best way to organize directory and project structure on a project / solution for a winforms C# app. Most people agree its best to seperate view, business logic, data objects, interfaces but wanted to see how different people tackle this. In...
TITLE: Winforms - best directory / project structure QUESTION: Wanted to see peoples thoughts on best way to organize directory and project structure on a project / solution for a winforms C# app. Most people agree its best to seperate view, business logic, data objects, interfaces but wanted to see how different peop...
[ "c#", "winforms" ]
9
8
10,975
3
0
2008-10-07T19:34:59.920000
2008-10-07T22:30:06.230000
180,003
180,065
Change today's date, advancing one month and setting the systemtime
I would like a code sample for a function that takes a tDateTime and an integer as input and sets the system time using setlocaltime after advancing that tDateTime by (int) months. The time should stay the same. pseudo code example SetNewTime(NOW,2); The issues I'm running into are rather frustrating. I cannot use incm...
Below is a complete command-line program that works for me. Tested in Delphi 5 and 2007. Why do you say IncMonth does not work for TDateTime? program OneMonth; {$APPTYPE CONSOLE} uses SysUtils, Windows, Messages; procedure SetLocalSystemTime(settotime: TDateTime); var SystemTime: TSystemTime; begin DateTimeToSystemT...
Change today's date, advancing one month and setting the systemtime I would like a code sample for a function that takes a tDateTime and an integer as input and sets the system time using setlocaltime after advancing that tDateTime by (int) months. The time should stay the same. pseudo code example SetNewTime(NOW,2); T...
TITLE: Change today's date, advancing one month and setting the systemtime QUESTION: I would like a code sample for a function that takes a tDateTime and an integer as input and sets the system time using setlocaltime after advancing that tDateTime by (int) months. The time should stay the same. pseudo code example Se...
[ "delphi", "datetime" ]
5
5
5,077
5
0
2008-10-07T19:38:45.467000
2008-10-07T19:48:45.400000
180,005
180,188
Why is LINQ to SQL converting my string parameter to a column name?
This Linq to SQL query... Return (From t In Db.Concessions Where t.Country = "ga" Select t.ConcessionID, t.Title, t.Country)... is generating this SQL: SELECT [t0].[ConcessionID], [t0].[Title], [t0].[Country] FROM [dbo].[Concessions] AS [t0] WHERE [t0].[Country] = ga... when what I want is WHERE [t0].[Country] = 'ga' A...
Answer The Country field was a char(2); I changed it to nvarchar(50), and that fixed the problem. Is this a bug in Linq to SQL?
Why is LINQ to SQL converting my string parameter to a column name? This Linq to SQL query... Return (From t In Db.Concessions Where t.Country = "ga" Select t.ConcessionID, t.Title, t.Country)... is generating this SQL: SELECT [t0].[ConcessionID], [t0].[Title], [t0].[Country] FROM [dbo].[Concessions] AS [t0] WHERE [t0]...
TITLE: Why is LINQ to SQL converting my string parameter to a column name? QUESTION: This Linq to SQL query... Return (From t In Db.Concessions Where t.Country = "ga" Select t.ConcessionID, t.Title, t.Country)... is generating this SQL: SELECT [t0].[ConcessionID], [t0].[Title], [t0].[Country] FROM [dbo].[Concessions] ...
[ "asp.net", "sql", "vb.net", "linq-to-sql" ]
0
0
608
5
0
2008-10-07T19:38:56.357000
2008-10-07T20:15:34.893000
180,007
180,086
How do configure optional or "extraneous" URLs?
How would you configure/handle extraneous/optional URLs entities (aliases, maybe)? SO is a good example: stackoverflow.com/questions/99999999/ stackoverflow.com/questions/99999999/ question-goes-here (bad example, but I couldn't think of better) Amazon URLs are even more confusing (e.g., the Kindle ) amazon.com/gp/prod...
This technique is commonly known as url rewriting. If you are looking out for a solution in IIS, you can use ISAPI rewrite, which is quite similar to mod_rewrite for apache. Or else, you can go for ASP.Net MVC routing mechanism.
How do configure optional or "extraneous" URLs? How would you configure/handle extraneous/optional URLs entities (aliases, maybe)? SO is a good example: stackoverflow.com/questions/99999999/ stackoverflow.com/questions/99999999/ question-goes-here (bad example, but I couldn't think of better) Amazon URLs are even more ...
TITLE: How do configure optional or "extraneous" URLs? QUESTION: How would you configure/handle extraneous/optional URLs entities (aliases, maybe)? SO is a good example: stackoverflow.com/questions/99999999/ stackoverflow.com/questions/99999999/ question-goes-here (bad example, but I couldn't think of better) Amazon U...
[ "url", "configuration", "url-rewriting" ]
1
2
220
5
0
2008-10-07T19:39:14.903000
2008-10-07T19:52:29.637000
180,018
180,061
XML Serialization, No Whitespace
I have the following serialization method: Private Function SerializeData(ByVal data As cData) As String If data IsNot Nothing Then Dim xml_stream As New MemoryStream() Dim sr As StreamReader Dim xs As New XmlSerializer(GetType(cData)) xml_stream = New MemoryStream() Try xs.Serialize(xml_stream, data) xml_stream.Posit...
Use the Serialize override that accepts an XmlWriter parameter. Create the XmlWriter using XmlWriter::Create, passing in an XmlWriterSettings object with the Indent property set to false.
XML Serialization, No Whitespace I have the following serialization method: Private Function SerializeData(ByVal data As cData) As String If data IsNot Nothing Then Dim xml_stream As New MemoryStream() Dim sr As StreamReader Dim xs As New XmlSerializer(GetType(cData)) xml_stream = New MemoryStream() Try xs.Serialize(x...
TITLE: XML Serialization, No Whitespace QUESTION: I have the following serialization method: Private Function SerializeData(ByVal data As cData) As String If data IsNot Nothing Then Dim xml_stream As New MemoryStream() Dim sr As StreamReader Dim xs As New XmlSerializer(GetType(cData)) xml_stream = New MemoryStream() ...
[ ".net", "xml", "vb.net", "xml-serialization" ]
7
10
3,638
1
0
2008-10-07T19:41:11.810000
2008-10-07T19:48:19.987000
180,032
180,060
How can I combine multiple rows into a comma-delimited list in SQL Server 2005?
Right now, I have a SQL Query like this one: SELECT X, Y FROM POINTS It returns results like so: X Y ---------- 12 3 15 2 18 12 20 29 I'd like to return results all in one row, like this (suitable for using in an HTML tag): XYLIST ---------- 12,3,15,2,18,12,20,29 Is there a way to do this using just SQL?
DECLARE @XYList varchar(MAX) SET @XYList = '' SELECT @XYList = @XYList + CONVERT(varchar, X) + ',' + CONVERT(varchar, Y) + ',' FROM POINTS -- Remove last comma SELECT LEFT(@XYList, LEN(@XYList) - 1)
How can I combine multiple rows into a comma-delimited list in SQL Server 2005? Right now, I have a SQL Query like this one: SELECT X, Y FROM POINTS It returns results like so: X Y ---------- 12 3 15 2 18 12 20 29 I'd like to return results all in one row, like this (suitable for using in an HTML tag): XYLIST ---------...
TITLE: How can I combine multiple rows into a comma-delimited list in SQL Server 2005? QUESTION: Right now, I have a SQL Query like this one: SELECT X, Y FROM POINTS It returns results like so: X Y ---------- 12 3 15 2 18 12 20 29 I'd like to return results all in one row, like this (suitable for using in an HTML tag)...
[ "sql", "sql-server", "list", "function", "concatenation" ]
58
31
98,834
5
0
2008-10-07T19:43:14.693000
2008-10-07T19:48:10.470000
180,039
180,099
Groovy parsing JSON vs XML
Using groovy, would you expect better performance in terms of speed and memory overhead to read and query JSON vs XML?
JSON is smaller and simpler than XML. I'd bet that JSON is faster to parse. YAML would be faster still.
Groovy parsing JSON vs XML Using groovy, would you expect better performance in terms of speed and memory overhead to read and query JSON vs XML?
TITLE: Groovy parsing JSON vs XML QUESTION: Using groovy, would you expect better performance in terms of speed and memory overhead to read and query JSON vs XML? ANSWER: JSON is smaller and simpler than XML. I'd bet that JSON is faster to parse. YAML would be faster still.
[ "xml", "json", "serialization", "grails", "groovy" ]
5
6
6,482
5
0
2008-10-07T19:44:46.280000
2008-10-07T19:54:34.450000
180,052
2,303,645
Checkout subdirectories in Git?
Is it possible to check out subdirectories of a repository in Git? Imagine I am setting up a new WordPress installation. I will create two new directories for my plugin and theme customization: wordpress/wp-content/plugins/myplugins/ wordpress/wp-content/themes/mytheme/ I want to maintain these directories via Git. In ...
Sparse checkouts are now in Git 1.7. Also see the question “ Is it possible to do a sparse checkout without checking out the whole repository first? ”. Note that sparse checkouts still require you to download the whole repository, even though some of the files Git downloads won't end up in your working tree.
Checkout subdirectories in Git? Is it possible to check out subdirectories of a repository in Git? Imagine I am setting up a new WordPress installation. I will create two new directories for my plugin and theme customization: wordpress/wp-content/plugins/myplugins/ wordpress/wp-content/themes/mytheme/ I want to maintai...
TITLE: Checkout subdirectories in Git? QUESTION: Is it possible to check out subdirectories of a repository in Git? Imagine I am setting up a new WordPress installation. I will create two new directories for my plugin and theme customization: wordpress/wp-content/plugins/myplugins/ wordpress/wp-content/themes/mytheme/...
[ "git", "sparse-checkout" ]
185
136
172,847
10
0
2008-10-07T19:47:14.450000
2010-02-20T20:40:42.140000
180,064
180,229
Fatal Git error when switching branch
Error message: fatal: git checkout: updating paths is incompatible with switching branches/forcing How to get past this Git checkout error?
By explicitly specifying “ git checkout HEAD $blah ” instead of just saying “ git checkout $blah ”, assuming you did want to check out a file. You don’t say what you were trying nor what you typed, however, so no one can give you anything but a blind guess.
Fatal Git error when switching branch Error message: fatal: git checkout: updating paths is incompatible with switching branches/forcing How to get past this Git checkout error?
TITLE: Fatal Git error when switching branch QUESTION: Error message: fatal: git checkout: updating paths is incompatible with switching branches/forcing How to get past this Git checkout error? ANSWER: By explicitly specifying “ git checkout HEAD $blah ” instead of just saying “ git checkout $blah ”, assuming you di...
[ "git" ]
3
2
6,103
2
0
2008-10-07T19:48:38.597000
2008-10-07T20:22:22.697000
180,075
180,162
Executing a stored procedure inside BEGIN/END TRANSACTION
If I create a Stored Procedure in SQL and call it ( EXEC spStoredProcedure ) within the BEGIN/END TRANSACTION, does this stored procedure also fall into the transaction? I didn't know if it worked like try/catches in C#.
Yes, everything that you do between the Begin Transaction and Commit (or Rollback) is part of the transaction.
Executing a stored procedure inside BEGIN/END TRANSACTION If I create a Stored Procedure in SQL and call it ( EXEC spStoredProcedure ) within the BEGIN/END TRANSACTION, does this stored procedure also fall into the transaction? I didn't know if it worked like try/catches in C#.
TITLE: Executing a stored procedure inside BEGIN/END TRANSACTION QUESTION: If I create a Stored Procedure in SQL and call it ( EXEC spStoredProcedure ) within the BEGIN/END TRANSACTION, does this stored procedure also fall into the transaction? I didn't know if it worked like try/catches in C#. ANSWER: Yes, everythin...
[ "sql", "sql-server", "stored-procedures", "rollback", "sqltransaction" ]
54
56
93,681
7
0
2008-10-07T19:50:58.313000
2008-10-07T20:11:08.053000
180,081
180,155
What is the best 3rd party GUI framework for application development in C#?
Examples could be Infragistics or DevExpress. But I'm also looking for your opinions on other frameworks. It could even be WPF if that is your favorite.
Infragistics is very good. I think they have a better product for windows than the web. However, I get very upset using their products sometimes. I just want to find some hidden property, and it is impossible to find. They have way to many properties. Sure, you can do anything with their grid, but it should be easier. ...
What is the best 3rd party GUI framework for application development in C#? Examples could be Infragistics or DevExpress. But I'm also looking for your opinions on other frameworks. It could even be WPF if that is your favorite.
TITLE: What is the best 3rd party GUI framework for application development in C#? QUESTION: Examples could be Infragistics or DevExpress. But I'm also looking for your opinions on other frameworks. It could even be WPF if that is your favorite. ANSWER: Infragistics is very good. I think they have a better product fo...
[ "c#", ".net", "user-interface" ]
1
3
1,994
9
0
2008-10-07T19:51:22.803000
2008-10-07T20:09:09.367000
180,095
180,152
How to handle a broken pipe (SIGPIPE) in python?
I've written a simple multi-threaded game server in python that creates a new thread for each client connection. I'm finding that every now and then, the server will crash because of a broken-pipe/SIGPIPE error. I'm pretty sure it is happening when the program tries to send a response back to a client that is no longer...
Read up on the try: statement. try: # do something except socket.error, e: # A socket error except IOError, e: if e.errno == errno.EPIPE: # EPIPE error else: # Other error
How to handle a broken pipe (SIGPIPE) in python? I've written a simple multi-threaded game server in python that creates a new thread for each client connection. I'm finding that every now and then, the server will crash because of a broken-pipe/SIGPIPE error. I'm pretty sure it is happening when the program tries to s...
TITLE: How to handle a broken pipe (SIGPIPE) in python? QUESTION: I've written a simple multi-threaded game server in python that creates a new thread for each client connection. I'm finding that every now and then, the server will crash because of a broken-pipe/SIGPIPE error. I'm pretty sure it is happening when the ...
[ "python", "python-2.x", "broken-pipe" ]
57
41
103,939
5
0
2008-10-07T19:53:53.097000
2008-10-07T20:07:27.263000
180,097
180,169
Dynamically find the class that represents a primitive Java type
I need to make some reflective method calls in Java. Those calls will include methods that have arguments that are primitive types (int, double, etc.). The way to specify such types when looking up the method reflectively is int.class, double.class, etc. The challenge is that I am accepting input from an outside source...
The Spring framework contains a utility class ClassUtils which contains the static method forName. This method can be used for the exact purpose you described. In case you don’t like to have a dependency on Spring: the source code of the method can be found e. g. here on their public repository. The class source code i...
Dynamically find the class that represents a primitive Java type I need to make some reflective method calls in Java. Those calls will include methods that have arguments that are primitive types (int, double, etc.). The way to specify such types when looking up the method reflectively is int.class, double.class, etc. ...
TITLE: Dynamically find the class that represents a primitive Java type QUESTION: I need to make some reflective method calls in Java. Those calls will include methods that have arguments that are primitive types (int, double, etc.). The way to specify such types when looking up the method reflectively is int.class, d...
[ "java", "reflection", "types", "primitive" ]
54
22
62,998
8
0
2008-10-07T19:54:25.967000
2008-10-07T20:12:30.127000
180,103
180,129
How can I change the title of the document during .ready()?
I am using some nested layouts in Ruby on Rails, and in one of the layouts i have a need to read in a string from a div and set that as the title of the document. What is correct way (if any) to set the title of the document?
The following should work but it wouldn't be SEO compatible. It's best to put the title in the title tag.
How can I change the title of the document during .ready()? I am using some nested layouts in Ruby on Rails, and in one of the layouts i have a need to read in a string from a div and set that as the title of the document. What is correct way (if any) to set the title of the document?
TITLE: How can I change the title of the document during .ready()? QUESTION: I am using some nested layouts in Ruby on Rails, and in one of the layouts i have a need to read in a string from a div and set that as the title of the document. What is correct way (if any) to set the title of the document? ANSWER: The fol...
[ "javascript", "jquery", "ruby-on-rails" ]
150
321
285,414
8
0
2008-10-07T19:55:10.770000
2008-10-07T20:00:05.487000
180,133
180,217
Generating a Reporting Services 2005 PDF report and storing it on disk
Is there an easy way to generate a PDF report from an RDL that's been uploaded to Report Manager and put that file somewhere on the server's disk? I already have a location on disk to put the file, I just need to know how to programmatically generate the PDF. This is for SQL Server 2005 Reporting Services. Code in eith...
This article will show you how you can generate PDF report from reporting service, without using report viewer. Only change you have to do is to write the result byte array into a file stream instead of sending it to response stream as shown in that example. The above mentioned example is using the web services provide...
Generating a Reporting Services 2005 PDF report and storing it on disk Is there an easy way to generate a PDF report from an RDL that's been uploaded to Report Manager and put that file somewhere on the server's disk? I already have a location on disk to put the file, I just need to know how to programmatically generat...
TITLE: Generating a Reporting Services 2005 PDF report and storing it on disk QUESTION: Is there an easy way to generate a PDF report from an RDL that's been uploaded to Report Manager and put that file somewhere on the server's disk? I already have a location on disk to put the file, I just need to know how to progra...
[ "c#", "asp.net", "sql-server", "pdf", "reporting-services" ]
1
4
4,315
2
0
2008-10-07T20:00:46.670000
2008-10-07T20:20:29.813000
180,158
180,191
How do I time a method's execution in Java?
How do I get a method's execution time? Is there a Timer utility class for things like timing how long a task takes, etc? Most of the searches on Google return results for timers that schedule threads and tasks, which is not what I want.
There is always the old-fashioned way: long startTime = System.nanoTime(); methodToTime(); long endTime = System.nanoTime(); long duration = (endTime - startTime); //divide by 1000000 to get milliseconds.
How do I time a method's execution in Java? How do I get a method's execution time? Is there a Timer utility class for things like timing how long a task takes, etc? Most of the searches on Google return results for timers that schedule threads and tasks, which is not what I want.
TITLE: How do I time a method's execution in Java? QUESTION: How do I get a method's execution time? Is there a Timer utility class for things like timing how long a task takes, etc? Most of the searches on Google return results for timers that schedule threads and tasks, which is not what I want. ANSWER: There is al...
[ "java", "timing", "execution-time" ]
1,025
1,457
957,789
42
0
2008-10-07T20:10:25.200000
2008-10-07T20:16:16.373000
180,167
180,491
How can I expose a C ODBC connection to a JVM using JNI?
I'm embedding a JRE in an existing C application using the invocation API, and I'd like to be able to use JDBC to work with the database in that code. This application is a transaction processing application, and the database transaction is managed by code in the C portion of the application, and the java code must run...
Don't know whether this'll work, but... I had a quick look at the decompiled source code of Sun's JDBC-ODBC bridge. Seems like you could subclass the JdbcOdbcConnection so that it initializes itself with a known connection handle and an already-opened state. This assumes that the connection handles on the Java side are...
How can I expose a C ODBC connection to a JVM using JNI? I'm embedding a JRE in an existing C application using the invocation API, and I'd like to be able to use JDBC to work with the database in that code. This application is a transaction processing application, and the database transaction is managed by code in the...
TITLE: How can I expose a C ODBC connection to a JVM using JNI? QUESTION: I'm embedding a JRE in an existing C application using the invocation API, and I'd like to be able to use JDBC to work with the database in that code. This application is a transaction processing application, and the database transaction is mana...
[ "java", "jdbc", "odbc", "java-native-interface" ]
2
1
889
2
0
2008-10-07T20:12:10.110000
2008-10-07T21:22:06.413000
180,172
181,463
Why can't the default constructor be called with empty brackets?
Is there any good reason that an empty set of round brackets (parentheses) isn't valid for calling the default constructor in C++? MyObject object; // ok - default ctor MyObject object(blah); // ok MyObject object(); // error I seem to type "()" automatically everytime. Is there a good reason this isn't allowed?
Most vexing parse This is related to what is known as "C++'s most vexing parse". Basically, anything that can be interpreted by the compiler as a function declaration will be interpreted as a function declaration. Another instance of the same problem: std::ifstream ifs("file.txt"); std::vector v(std::istream_iterator (...
Why can't the default constructor be called with empty brackets? Is there any good reason that an empty set of round brackets (parentheses) isn't valid for calling the default constructor in C++? MyObject object; // ok - default ctor MyObject object(blah); // ok MyObject object(); // error I seem to type "()" automati...
TITLE: Why can't the default constructor be called with empty brackets? QUESTION: Is there any good reason that an empty set of round brackets (parentheses) isn't valid for calling the default constructor in C++? MyObject object; // ok - default ctor MyObject object(blah); // ok MyObject object(); // error I seem to ...
[ "c++", "constructor", "default-constructor", "c++-faq", "most-vexing-parse" ]
229
194
40,768
9
0
2008-10-07T20:13:10.967000
2008-10-08T05:30:31.543000
180,211
180,278
jQuery DIV click, with anchors
To make click-able divs, I do: blah blah and then $("div.clickable").click( function() { window.location = $(this).attr("url"); }); I don't know if this is the best way, but it works perfectly with me, except for one issue: If the div contains a click-able element, such as, and the user clicks on the hyperlink, both th...
If you return "false" from your function it'll stop the event bubbling, so only your first event handler will get triggered (ie. your anchor will not see the click). $("div.clickable").click( function() { window.location = $(this).attr("url"); return false; }); See event.preventDefault() vs. return false for details on...
jQuery DIV click, with anchors To make click-able divs, I do: blah blah and then $("div.clickable").click( function() { window.location = $(this).attr("url"); }); I don't know if this is the best way, but it works perfectly with me, except for one issue: If the div contains a click-able element, such as, and the user c...
TITLE: jQuery DIV click, with anchors QUESTION: To make click-able divs, I do: blah blah and then $("div.clickable").click( function() { window.location = $(this).attr("url"); }); I don't know if this is the best way, but it works perfectly with me, except for one issue: If the div contains a click-able element, such ...
[ "javascript", "jquery" ]
29
35
109,904
5
0
2008-10-07T20:19:40.487000
2008-10-07T20:31:39.087000
180,215
180,254
Multi-site login ala Google
Not sure if the title is quite right for the question but I can't think of any other way to put it.. Suppose you wanted to create multiple different web apps, but you wanted a user who was logged into one app to be able to go straight to your other app without re-logging in (assuming they have perms to look at the othe...
What you're looking for is called Single Sign On. If you follow the link you'll find several implementations. Open ID as others have mentioned is not such a scheme as it requires a seperate login for each site. Open ID is merely a shared authentication system.
Multi-site login ala Google Not sure if the title is quite right for the question but I can't think of any other way to put it.. Suppose you wanted to create multiple different web apps, but you wanted a user who was logged into one app to be able to go straight to your other app without re-logging in (assuming they ha...
TITLE: Multi-site login ala Google QUESTION: Not sure if the title is quite right for the question but I can't think of any other way to put it.. Suppose you wanted to create multiple different web apps, but you wanted a user who was logged into one app to be able to go straight to your other app without re-logging in...
[ "language-agnostic" ]
4
6
785
5
0
2008-10-07T20:20:08.817000
2008-10-07T20:26:17.867000
180,242
180,282
How can I copy a mySQL Database in ruby on rails?
We are making a Ruby On Rails webapp where every customer gets their own database. The database needs to be created after they fill out a form on our website. We have a template database that has all of the tables and columns that we need to copy. How can I do this in programatically from ruby on rails?
From any controller, you can define the following method. def copy_template_database template_name = "customerdb1" # Database to copy from new_name = "temp" #database to create & copy to #connect to template database to copy. Note that this will override any previous #connections for all Models that inherit from Activ...
How can I copy a mySQL Database in ruby on rails? We are making a Ruby On Rails webapp where every customer gets their own database. The database needs to be created after they fill out a form on our website. We have a template database that has all of the tables and columns that we need to copy. How can I do this in p...
TITLE: How can I copy a mySQL Database in ruby on rails? QUESTION: We are making a Ruby On Rails webapp where every customer gets their own database. The database needs to be created after they fill out a form on our website. We have a template database that has all of the tables and columns that we need to copy. How ...
[ "mysql", "ruby-on-rails", "ruby", "database" ]
8
7
9,019
4
0
2008-10-07T20:24:21.287000
2008-10-07T20:32:38.883000
180,245
180,253
Where are the DataValueField values for a CheckBoxList stored?
I have this CheckBoxList on a page: I'd like to loop through the checkbox elements on the client using Javascript and grab the value of each checked checkbox, but the values don't appear to be available on the client side. The HTML output looks like this: Democratic Republic of the Congo Central African Republic Congo ...
Stored in ViewState, you cannot access them on the client without some hacking.
Where are the DataValueField values for a CheckBoxList stored? I have this CheckBoxList on a page: I'd like to loop through the checkbox elements on the client using Javascript and grab the value of each checked checkbox, but the values don't appear to be available on the client side. The HTML output looks like this: D...
TITLE: Where are the DataValueField values for a CheckBoxList stored? QUESTION: I have this CheckBoxList on a page: I'd like to loop through the checkbox elements on the client using Javascript and grab the value of each checked checkbox, but the values don't appear to be available on the client side. The HTML output ...
[ "asp.net", "javascript" ]
5
2
15,120
9
0
2008-10-07T20:24:33.003000
2008-10-07T20:25:58.710000
180,266
180,296
Proper naming of enum values for C#
How do you think, is it a good idea to have such an enum: enum AvailableSpace { Percent10, Percent20, SqF500, SqF600 } The question is about the semantics of the values names, i.e. both percentage and square feet. I really believe that it's not a good idea, but I could not find and guidelines, etc. in support of this. ...
The answer: No, it is not a good idea to use enums for representing values. Especially values in two semantically distinct scales. You should not use enums for values. The reason: What's the relation between the enum values from the two scales, like Percent10 and SqF600? How do you expand the list of values you can rep...
Proper naming of enum values for C# How do you think, is it a good idea to have such an enum: enum AvailableSpace { Percent10, Percent20, SqF500, SqF600 } The question is about the semantics of the values names, i.e. both percentage and square feet. I really believe that it's not a good idea, but I could not find and g...
TITLE: Proper naming of enum values for C# QUESTION: How do you think, is it a good idea to have such an enum: enum AvailableSpace { Percent10, Percent20, SqF500, SqF600 } The question is about the semantics of the values names, i.e. both percentage and square feet. I really believe that it's not a good idea, but I co...
[ "c#", "enums", "naming" ]
3
8
2,611
2
0
2008-10-07T20:29:29.547000
2008-10-07T20:37:50.730000
180,270
180,342
Visual Designer errors, when there are no errors
I get errors when viewing forms and there are not any. I can close VS and reopen and it is fine. What cases this? Can it be fixed without closing?
Verify none of your custom user controls has any code errors. Also try starting up Visual Studios using devenv /resetskippkgs from the command prompt. It will reset packages if there is an error in loading.
Visual Designer errors, when there are no errors I get errors when viewing forms and there are not any. I can close VS and reopen and it is fine. What cases this? Can it be fixed without closing?
TITLE: Visual Designer errors, when there are no errors QUESTION: I get errors when viewing forms and there are not any. I can close VS and reopen and it is fine. What cases this? Can it be fixed without closing? ANSWER: Verify none of your custom user controls has any code errors. Also try starting up Visual Studios...
[ "visual-studio", "custom-controls", "designer" ]
0
1
122
1
0
2008-10-07T20:29:51.370000
2008-10-07T20:48:30.350000
180,272
180,368
How to preview git-pull?
Is it even possible? Basically, there's a remote repository from which I pull using just: git pull Now, I'd like to preview what this pull would change (a diff) without touching anything on my side. The reason is that thing I'm pulling might not be "good" and I want someone else to fix it before making my repository "d...
After doing a git fetch, do a git log HEAD..origin/master to show the log entries between your last common commit and the origin's master branch. To show the diffs, use either git log -p HEAD..origin/master to show each patch, or git diff HEAD...origin/master (three dots not two) to show a single diff. There normally i...
How to preview git-pull? Is it even possible? Basically, there's a remote repository from which I pull using just: git pull Now, I'd like to preview what this pull would change (a diff) without touching anything on my side. The reason is that thing I'm pulling might not be "good" and I want someone else to fix it befor...
TITLE: How to preview git-pull? QUESTION: Is it even possible? Basically, there's a remote repository from which I pull using just: git pull Now, I'd like to preview what this pull would change (a diff) without touching anything on my side. The reason is that thing I'm pulling might not be "good" and I want someone el...
[ "git", "version-control" ]
254
296
159,821
10
0
2008-10-07T20:30:30.777000
2008-10-07T20:53:18.810000
180,277
184,228
Change Windows Mobile 6.1 Theme Programmatically
I am trying to figure out the proper procedure for applying a new tsk based theme file in windows mobile 6.1. I have tried working off of the page http://www.pocketpcdn.com/articles/changetodaytheme.html But this only changes the background, not the system colors for things such as the top and bottom bars on the screen...
I ended up finding a solution, I don't think it is a universal solution though. Calling "\Windows\cusTSK.exe \Windows\ThemeName.tsk" changes the top and bottom bars, but does not change all apsects of the theme... so calling wceload.exe and then calling cuTSK.exe in that order seems to be able to change the theme using...
Change Windows Mobile 6.1 Theme Programmatically I am trying to figure out the proper procedure for applying a new tsk based theme file in windows mobile 6.1. I have tried working off of the page http://www.pocketpcdn.com/articles/changetodaytheme.html But this only changes the background, not the system colors for thi...
TITLE: Change Windows Mobile 6.1 Theme Programmatically QUESTION: I am trying to figure out the proper procedure for applying a new tsk based theme file in windows mobile 6.1. I have tried working off of the page http://www.pocketpcdn.com/articles/changetodaytheme.html But this only changes the background, not the sys...
[ "c++", "windows-mobile", "mfc" ]
2
1
4,905
1
0
2008-10-07T20:31:37.763000
2008-10-08T18:41:55.767000
180,290
181,085
What are the limits of ruby on rails?
I have a memory of talking to people who have got so far in using Ruby on Rails and then had to abandon it when they have hit limits, or found it was ultimately too rigid. I forget the details but it may have had to do with using more than one database. So what I'd like is to know is what features/requirements fall out...
Rails (not ruby itself) is proud to be "Opinionated Software". What this means in practice is that the authors of rails have a certain target audience in mind (themselves basically) and aim rails specifically at that. If X feature isn't needed for that target audience, it doesn't get added. Off the top of my head, thin...
What are the limits of ruby on rails? I have a memory of talking to people who have got so far in using Ruby on Rails and then had to abandon it when they have hit limits, or found it was ultimately too rigid. I forget the details but it may have had to do with using more than one database. So what I'd like is to know ...
TITLE: What are the limits of ruby on rails? QUESTION: I have a memory of talking to people who have got so far in using Ruby on Rails and then had to abandon it when they have hit limits, or found it was ultimately too rigid. I forget the details but it may have had to do with using more than one database. So what I'...
[ "ruby-on-rails", "ruby" ]
9
12
6,104
6
0
2008-10-07T20:35:32.340000
2008-10-08T01:36:54.667000
180,295
180,302
Get the Primary Key of a new Entry
I have a number of child tables that have a foreign key to a parent table. How do I add an entry in the parent table and get the primary key of that entry, so that I can then enter rows in the child tables that point to the entry in the parent table? I'm doing this in a MS Access Database from a C# application.
Microsoft Access 2000 or later does support the @@IDENTITY property to retrieve the value of an Autonumber field after an INSERT. ( msdn ) Edit: This is the link to a similar article for.NET 3.5
Get the Primary Key of a new Entry I have a number of child tables that have a foreign key to a parent table. How do I add an entry in the parent table and get the primary key of that entry, so that I can then enter rows in the child tables that point to the entry in the parent table? I'm doing this in a MS Access Data...
TITLE: Get the Primary Key of a new Entry QUESTION: I have a number of child tables that have a foreign key to a parent table. How do I add an entry in the parent table and get the primary key of that entry, so that I can then enter rows in the child tables that point to the entry in the parent table? I'm doing this i...
[ "c#", ".net", "database", "ms-access", "primary-key" ]
6
5
964
4
0
2008-10-07T20:36:27.567000
2008-10-07T20:39:49.367000
180,299
180,340
Can Delphi 2009 in English and in French coexist on the same machine?
Does anyone know (like in tried and succeeded) if I can have D2009 both in English and in French? It's not so much to generate French or English applications but to have the IDE available in either language to take screen shots and make demos in French or in English. What would be involved: complementary install plus s...
Install one version in a virtual machine. I hear VMWare works really good.
Can Delphi 2009 in English and in French coexist on the same machine? Does anyone know (like in tried and succeeded) if I can have D2009 both in English and in French? It's not so much to generate French or English applications but to have the IDE available in either language to take screen shots and make demos in Fren...
TITLE: Can Delphi 2009 in English and in French coexist on the same machine? QUESTION: Does anyone know (like in tried and succeeded) if I can have D2009 both in English and in French? It's not so much to generate French or English applications but to have the IDE available in either language to take screen shots and ...
[ "delphi", "delphi-2009" ]
2
5
202
3
0
2008-10-07T20:38:49.807000
2008-10-07T20:47:21.083000
180,327
180,845
Equation Solvers for linear mathematical equations
I need to solve a few mathematical equations in my application. Here's a typical example of such an equation: a + b * c - d / e = a Additional rules: b % 10 = 0 b >= 0 b <= 100 Each number must be integer... I would like to get the possible solution sets for a, b, c, d and e. Are there any libraries out there, either o...
Solving linear systems can generally be solved using linear programming. I'd recommend taking a look at Boost uBLAS for starters - it has a simple triangular solver. Then you might checkout libraries targeting more domain specific approaches, perhaps QSopt.
Equation Solvers for linear mathematical equations I need to solve a few mathematical equations in my application. Here's a typical example of such an equation: a + b * c - d / e = a Additional rules: b % 10 = 0 b >= 0 b <= 100 Each number must be integer... I would like to get the possible solution sets for a, b, c, d...
TITLE: Equation Solvers for linear mathematical equations QUESTION: I need to solve a few mathematical equations in my application. Here's a typical example of such an equation: a + b * c - d / e = a Additional rules: b % 10 = 0 b >= 0 b <= 100 Each number must be integer... I would like to get the possible solution s...
[ "c++", "equation", "algebra", "solver" ]
3
3
11,783
10
0
2008-10-07T20:45:16.160000
2008-10-07T23:37:31.473000
180,328
180,344
Updateable (and persistable) dataset based on a join - possible with ADO.Net?
So lets say I have a dataset based on: SELECT TopicLink.*, Topic.Name AS FromTopicName, Topic_1.Name AS ToTopicName FROM TopicLink INNER JOIN Topic ON TopicLink.FromTopicId = Topic.TopicId INNER JOIN Topic AS Topic_1 ON TopicLink.ToTopicId = Topic_1.TopicId With old school ADO, using a Recordset, I could modify columns...
I think you can achive this by providing your own update command for the ADO.net DataAdaptor. Check out the sample provided here.
Updateable (and persistable) dataset based on a join - possible with ADO.Net? So lets say I have a dataset based on: SELECT TopicLink.*, Topic.Name AS FromTopicName, Topic_1.Name AS ToTopicName FROM TopicLink INNER JOIN Topic ON TopicLink.FromTopicId = Topic.TopicId INNER JOIN Topic AS Topic_1 ON TopicLink.ToTopicId = ...
TITLE: Updateable (and persistable) dataset based on a join - possible with ADO.Net? QUESTION: So lets say I have a dataset based on: SELECT TopicLink.*, Topic.Name AS FromTopicName, Topic_1.Name AS ToTopicName FROM TopicLink INNER JOIN Topic ON TopicLink.FromTopicId = Topic.TopicId INNER JOIN Topic AS Topic_1 ON Topi...
[ ".net", "ado.net" ]
0
1
506
2
0
2008-10-07T20:45:25.333000
2008-10-07T20:48:46.573000
180,330
180,332
Obtain file path of C# save dialog box
I've got a save dialog box which pops up when i press a button. However i dont want to save a file at that point, i want to take the name and place it in the text box next to the button, for the name to be used later. Can anybody tell me how to obtain the file path from the save dialog box to use it later?
Here is a sample code I just wrote very fast... instead of Console.Write you can simply store the path in a variable and use it later. SaveFileDialog saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.InitialDirectory = Convert.ToString(Environment.SpecialFolder.MyDocuments); saveFileDialog1.Filter = "Your extensi...
Obtain file path of C# save dialog box I've got a save dialog box which pops up when i press a button. However i dont want to save a file at that point, i want to take the name and place it in the text box next to the button, for the name to be used later. Can anybody tell me how to obtain the file path from the save d...
TITLE: Obtain file path of C# save dialog box QUESTION: I've got a save dialog box which pops up when i press a button. However i dont want to save a file at that point, i want to take the name and place it in the text box next to the button, for the name to be used later. Can anybody tell me how to obtain the file pa...
[ "c#", "dialog" ]
17
47
65,294
4
0
2008-10-07T20:45:47.080000
2008-10-07T20:46:18.823000
180,349
180,391
How can I dynamically change the Active Record database for all models in Ruby on Rails?
In our program, each customer gets their own database. We e-mail them a link that connects them to their database. The link contains a GUID that lets the program know which database to connect to. How do I dynamically and programatically connect ActiveRecord to the right db?
You can also do this easily without hardcoding anything and run migrations automatically: customer = CustomerModel.find(id) spec = CustomerModel.configurations[RAILS_ENV] new_spec = spec.clone new_spec["database"] = customer.database_name ActiveRecord::Base.establish_connection(new_spec) ActiveRecord::Migrator.migrate(...
How can I dynamically change the Active Record database for all models in Ruby on Rails? In our program, each customer gets their own database. We e-mail them a link that connects them to their database. The link contains a GUID that lets the program know which database to connect to. How do I dynamically and programat...
TITLE: How can I dynamically change the Active Record database for all models in Ruby on Rails? QUESTION: In our program, each customer gets their own database. We e-mail them a link that connects them to their database. The link contains a GUID that lets the program know which database to connect to. How do I dynamic...
[ "ruby-on-rails", "database", "activerecord" ]
30
41
24,708
4
0
2008-10-07T20:49:14.700000
2008-10-07T20:59:47.127000
180,358
193,869
Delphi versus C++ Builder - Which is Better Choice for a Java Programmer Doing Win32
I'm a pretty experienced Java programmer that's been doing quite a bit of Win32 stuff in the last couple of years. Mainly I've been using VB6, but I really need to move to something better. I've spent a month or so playing with Delphi 2009. I like the VCL GUI stuff, Delphi seems more suited to Windows API calls than VB...
Delphi or C++ Builder - it's a difficult choice! As you're aware, they're basically very similar, from the IDE and RAD point of view. The pros and cons of each - irrespective of background - are a bit like this. Both share a great 2-way RAD form designer and framework (VCL) that are ideal for native Windows development...
Delphi versus C++ Builder - Which is Better Choice for a Java Programmer Doing Win32 I'm a pretty experienced Java programmer that's been doing quite a bit of Win32 stuff in the last couple of years. Mainly I've been using VB6, but I really need to move to something better. I've spent a month or so playing with Delphi ...
TITLE: Delphi versus C++ Builder - Which is Better Choice for a Java Programmer Doing Win32 QUESTION: I'm a pretty experienced Java programmer that's been doing quite a bit of Win32 stuff in the last couple of years. Mainly I've been using VB6, but I really need to move to something better. I've spent a month or so pl...
[ "java", "c++", "delphi", "winapi", "c++builder" ]
17
25
16,444
12
0
2008-10-07T20:51:12.077000
2008-10-11T08:48:25.780000
180,366
180,641
Losing Button.Click events after first partial postback in UpdatePanel
I have a Page that has a single instance of a UserControl that itself has a single UpdatePanel. Inside the UpdatePanel are several Button controls. The Click event for these controls are wired up in the code-behind, in the Init event of the UserControl. I get the Click event for the first button I push, every time, no ...
It seems that adding UseSubmitBehavior="false" to the button definitions has solved my problem. Still don't know why that first button click worked at all.
Losing Button.Click events after first partial postback in UpdatePanel I have a Page that has a single instance of a UserControl that itself has a single UpdatePanel. Inside the UpdatePanel are several Button controls. The Click event for these controls are wired up in the code-behind, in the Init event of the UserCont...
TITLE: Losing Button.Click events after first partial postback in UpdatePanel QUESTION: I have a Page that has a single instance of a UserControl that itself has a single UpdatePanel. Inside the UpdatePanel are several Button controls. The Click event for these controls are wired up in the code-behind, in the Init eve...
[ "asp.net", "asp.net-ajax", "user-controls", "postback" ]
4
4
11,905
3
0
2008-10-07T20:52:55.333000
2008-10-07T22:03:45.097000
180,371
180,379
Enforce the use of the "this" and "base" at compile-time in Visual Studio/C#
When extending classes, I find it very descriptive to use the base ( MyBase in VB) keyword when accessing methods in the base-class. And the this ( Me in VB) keyword when accessing functions in the class extending the base-class. That goes for a "flat" structure with no inheritance as well. I find it easier to read thi...
Have a look at StyleCop. http://code.msdn.microsoft.com/sourceanalysis There are some rules in there that should do what you want. You can configure it to show any style violations as warnings or errors.
Enforce the use of the "this" and "base" at compile-time in Visual Studio/C# When extending classes, I find it very descriptive to use the base ( MyBase in VB) keyword when accessing methods in the base-class. And the this ( Me in VB) keyword when accessing functions in the class extending the base-class. That goes for...
TITLE: Enforce the use of the "this" and "base" at compile-time in Visual Studio/C# QUESTION: When extending classes, I find it very descriptive to use the base ( MyBase in VB) keyword when accessing methods in the base-class. And the this ( Me in VB) keyword when accessing functions in the class extending the base-cl...
[ "c#", "visual-studio", "compiler-construction" ]
2
4
279
2
0
2008-10-07T20:53:46.127000
2008-10-07T20:55:49.337000
180,373
204,347
Is there any way instead of a JS hack where I can post from an iframe to another page outside the iframe?
Is there any way instead of a JS hack where I can post from an iframe to another page outside the iframe? the iframe is posting data to a 3rd party and then just responding back with a URL which is the redirection URl thus we cannot set the form target. We are PCI compliant and thus we cannot use window.parent.location...
What it boils down to, it seems, is this: 1. You get a text url from a 3rd party in the iframe. 2. You want to change your page's location to that url. 3. Unless you have control over that 3rd party, all you are going to get is that text url. Now, the only way to change your page's location automatically is with window...
Is there any way instead of a JS hack where I can post from an iframe to another page outside the iframe? Is there any way instead of a JS hack where I can post from an iframe to another page outside the iframe? the iframe is posting data to a 3rd party and then just responding back with a URL which is the redirection ...
TITLE: Is there any way instead of a JS hack where I can post from an iframe to another page outside the iframe? QUESTION: Is there any way instead of a JS hack where I can post from an iframe to another page outside the iframe? the iframe is posting data to a 3rd party and then just responding back with a URL which i...
[ "javascript", "iframe", "post", "parent", "pci-dss" ]
1
1
635
4
0
2008-10-07T20:53:54.240000
2008-10-15T11:10:44.697000
180,397
180,429
C# Abstract class, using anonymous instead of declaring concrete class?
I have an abstract class and I would like to use it quickly by NOT create a concrete class that inherit the abstract class. Well, to define the abstract method anonymously. Something like that: Command c = new Command(myObject){ public override void Do() { } }; Is it possible in C#.net 2.0?
You could create a type that wraps an action providing an implementation as such: class ActionCommand { private readonly Action _action; public ActionCommand(Action action) { _action = action; } public override void Do() { _action(); } }; This then can be used as so: Command c = new Command((Action)delegate() { // in...
C# Abstract class, using anonymous instead of declaring concrete class? I have an abstract class and I would like to use it quickly by NOT create a concrete class that inherit the abstract class. Well, to define the abstract method anonymously. Something like that: Command c = new Command(myObject){ public override voi...
TITLE: C# Abstract class, using anonymous instead of declaring concrete class? QUESTION: I have an abstract class and I would like to use it quickly by NOT create a concrete class that inherit the abstract class. Well, to define the abstract method anonymously. Something like that: Command c = new Command(myObject){ p...
[ "c#", ".net", ".net-2.0", "abstract-class", "anonymous-methods" ]
2
1
2,073
1
0
2008-10-07T21:02:16.233000
2008-10-07T21:07:36.020000
180,398
181,165
Can I make JUnit more verbose?
I'd like to have it yell hooray whenever an assert statement succeeds, or at the very least have it display the number of successful assert statements that were encountered. I'm using JUnit4. Any suggestions?
If you want to see some output for each successful assertion, another simple approach which requires no external dependencies or source code, would be to define your own Assert class which delegates all methods to the standard JUnit Assert class, as well as logging successful assertions (failed assertions will be repor...
Can I make JUnit more verbose? I'd like to have it yell hooray whenever an assert statement succeeds, or at the very least have it display the number of successful assert statements that were encountered. I'm using JUnit4. Any suggestions?
TITLE: Can I make JUnit more verbose? QUESTION: I'd like to have it yell hooray whenever an assert statement succeeds, or at the very least have it display the number of successful assert statements that were encountered. I'm using JUnit4. Any suggestions? ANSWER: If you want to see some output for each successful as...
[ "java", "junit" ]
27
14
14,931
11
0
2008-10-07T21:02:22.177000
2008-10-08T02:46:47.117000
180,401
180,409
Placement of the asterisk in pointer declarations
I've recently decided that I just have to finally learn C/C++, and there is one thing I do not really understand about pointers or more precisely, their definition. How about these examples: int* test; int *test; int * test; int* test,test2; int *test,test2; int * test,test2; Now, to my understanding, the first three c...
4, 5, and 6 are the same thing, only test is a pointer. If you want two pointers, you should use: int *test, *test2; Or, even better (to make everything clear): int* test; int* test2;
Placement of the asterisk in pointer declarations I've recently decided that I just have to finally learn C/C++, and there is one thing I do not really understand about pointers or more precisely, their definition. How about these examples: int* test; int *test; int * test; int* test,test2; int *test,test2; int * test,...
TITLE: Placement of the asterisk in pointer declarations QUESTION: I've recently decided that I just have to finally learn C/C++, and there is one thing I do not really understand about pointers or more precisely, their definition. How about these examples: int* test; int *test; int * test; int* test,test2; int *test,...
[ "c++", "c", "pointers", "declaration" ]
140
159
50,029
15
0
2008-10-07T21:02:43.300000
2008-10-07T21:04:33.343000
180,405
180,475
How do you add dynamic 'where' clauses to a linq query?
I've got a User table with a bitmask that contains the user's roles. The linq query below returns all the users whose roles include 1, 4 or 16. var users = from u in dc.Users where ((u.UserRolesBitmask & 1) == 1) || ((u.UserRolesBitmask & 4) == 4) || ((u.UserRolesBitmask & 16) == 16) select u; I'd like to rewrite this ...
You can use the PredicateBuilder class. PredicateBuilder has been released in the LINQKit NuGet package LINQKit is a free set of extensions for LINQ to SQL and Entity Framework power users.
How do you add dynamic 'where' clauses to a linq query? I've got a User table with a bitmask that contains the user's roles. The linq query below returns all the users whose roles include 1, 4 or 16. var users = from u in dc.Users where ((u.UserRolesBitmask & 1) == 1) || ((u.UserRolesBitmask & 4) == 4) || ((u.UserRoles...
TITLE: How do you add dynamic 'where' clauses to a linq query? QUESTION: I've got a User table with a bitmask that contains the user's roles. The linq query below returns all the users whose roles include 1, 4 or 16. var users = from u in dc.Users where ((u.UserRolesBitmask & 1) == 1) || ((u.UserRolesBitmask & 4) == 4...
[ "c#", "linq", "dynamic" ]
25
32
68,376
6
0
2008-10-07T21:03:50.490000
2008-10-07T21:18:04.440000
180,413
180,553
Mocks or real classes?
Classes that use other classes (as members, or as arguments to methods) need instances that behave properly for unit test. If you have these classes available and they introduce no additional dependencies, isn't it better to use the real thing instead of a mock?
I say use real classes whenever you can. I'm a big believer in expanding the boundaries of "unit" tests as much as possible. At this point they aren't really unit tests in the traditional sense, but rather just an automated regression suite for your application. I still practice TDD and write all my tests first, but my...
Mocks or real classes? Classes that use other classes (as members, or as arguments to methods) need instances that behave properly for unit test. If you have these classes available and they introduce no additional dependencies, isn't it better to use the real thing instead of a mock?
TITLE: Mocks or real classes? QUESTION: Classes that use other classes (as members, or as arguments to methods) need instances that behave properly for unit test. If you have these classes available and they introduce no additional dependencies, isn't it better to use the real thing instead of a mock? ANSWER: I say u...
[ "unit-testing", "mocking" ]
13
22
3,349
11
0
2008-10-07T21:04:49.753000
2008-10-07T21:38:39.873000
180,415
181,538
Sharepoint InputFormSection control look-a-like
I'm looking for a similar control to the InputFormSection control in Sharepoint that I want to use in a regular web page that doesn't run in the context of Sharepoint. Here's how the inputformsection looks like: http://graegert.com/wp-content/uploads/2008/01/moss_adminarea_page_structure1.png
So do I understand your question correctly? You want to have a control that looks and behave like the InputFormSection control of SharePoint, but it should be able to run outside the context of a SharePoint site? If so, one approach that you could take is to rip out the generated HTML and use it in your own user contro...
Sharepoint InputFormSection control look-a-like I'm looking for a similar control to the InputFormSection control in Sharepoint that I want to use in a regular web page that doesn't run in the context of Sharepoint. Here's how the inputformsection looks like: http://graegert.com/wp-content/uploads/2008/01/moss_adminare...
TITLE: Sharepoint InputFormSection control look-a-like QUESTION: I'm looking for a similar control to the InputFormSection control in Sharepoint that I want to use in a regular web page that doesn't run in the context of Sharepoint. Here's how the inputformsection looks like: http://graegert.com/wp-content/uploads/200...
[ "asp.net", "sharepoint", "controls" ]
0
1
1,047
2
0
2008-10-07T21:05:00.767000
2008-10-08T06:24:37.643000
180,422
180,706
LINQ inner join betwenn Enumerable and DB Table
I'm trying to determine which records to delete from a database when a user submits a form. The page has two CheckBoxList one representing the records before modification and one after. I can easily get the selected values that need to be deleted like this... //get the items not selected that were selected before var o...
Local collections can be used in LINQ to SQL with the Contains() method. You can try changing the join clause into a where with Contains(): var itemsToDelete = from specialNeed in db.SpecialNeeds where oldSelectedItems.Contains(specialNeed.SpecialNeedsTypeCd) && specialNeed.CustomerId == customerId select...;
LINQ inner join betwenn Enumerable and DB Table I'm trying to determine which records to delete from a database when a user submits a form. The page has two CheckBoxList one representing the records before modification and one after. I can easily get the selected values that need to be deleted like this... //get the it...
TITLE: LINQ inner join betwenn Enumerable and DB Table QUESTION: I'm trying to determine which records to delete from a database when a user submits a form. The page has two CheckBoxList one representing the records before modification and one after. I can easily get the selected values that need to be deleted like th...
[ ".net", "linq", "inner-join", "enumerable", "dbtable" ]
1
4
2,058
2
0
2008-10-07T21:06:18.037000
2008-10-07T22:36:19.883000
180,428
180,442
Create Generic List from a subclass
Option Explicit On Option Strict On Public Class Class1 Dim l As List(Of A) Public Sub New() l = New List(Of B) End Sub End Class Public Class A End Class Public Class B Inherits A End Class I've run into this problem. I have a list declared of a Generic Type 'A' I want to define the list as a Generic Type 'B', w...
It's a matter of variance, which C# doesn't support for generics. See Rick Byer's post on the subject.
Create Generic List from a subclass Option Explicit On Option Strict On Public Class Class1 Dim l As List(Of A) Public Sub New() l = New List(Of B) End Sub End Class Public Class A End Class Public Class B Inherits A End Class I've run into this problem. I have a list declared of a Generic Type 'A' I want to defi...
TITLE: Create Generic List from a subclass QUESTION: Option Explicit On Option Strict On Public Class Class1 Dim l As List(Of A) Public Sub New() l = New List(Of B) End Sub End Class Public Class A End Class Public Class B Inherits A End Class I've run into this problem. I have a list declared of a Generic Type ...
[ "c#", "vb.net", "generics", "reflection" ]
0
1
1,675
3
0
2008-10-07T21:07:34.960000
2008-10-07T21:09:55.377000
180,430
180,507
Mixed syntax for control structures generating syntax errors
I'm refactoring some PHP code and discovered that certain nested combinations of if (): and if () { generate syntax errors. Not that I would normally mix the two, but I like to do frequent syntax checks as I'm writing code and I kept getting a syntax error because of this. Example - generates syntax error: if ( $test =...
This is a wild guess since I am not familiar with the grammar of PHP. But here goes: The problem is the second else. The parser can't see if this else is belonging to the first or the second if (counting from the beginning). In your second example there is an endif making the second if -block be terminated so there it ...
Mixed syntax for control structures generating syntax errors I'm refactoring some PHP code and discovered that certain nested combinations of if (): and if () { generate syntax errors. Not that I would normally mix the two, but I like to do frequent syntax checks as I'm writing code and I kept getting a syntax error be...
TITLE: Mixed syntax for control structures generating syntax errors QUESTION: I'm refactoring some PHP code and discovered that certain nested combinations of if (): and if () { generate syntax errors. Not that I would normally mix the two, but I like to do frequent syntax checks as I'm writing code and I kept getting...
[ "php", "syntax" ]
0
2
374
5
0
2008-10-07T21:07:41.433000
2008-10-07T21:25:41.227000
180,435
180,446
Graphical open source text editor for large text files (> 200 MBytes)
Is there an open source alternative (similar to ultraedit) to handle files with filesize >200 MBytes?
vim or gvim (graphical vim) should handle that with pleasure.
Graphical open source text editor for large text files (> 200 MBytes) Is there an open source alternative (similar to ultraedit) to handle files with filesize >200 MBytes?
TITLE: Graphical open source text editor for large text files (> 200 MBytes) QUESTION: Is there an open source alternative (similar to ultraedit) to handle files with filesize >200 MBytes? ANSWER: vim or gvim (graphical vim) should handle that with pleasure.
[ "open-source", "editor", "text-editor", "large-files" ]
2
8
15,687
12
0
2008-10-07T21:08:45.627000
2008-10-07T21:11:01.193000
180,451
180,926
Using javascript and jquery, to populate related select boxes with array structure
Using answers to this question, I have been able to populate a select box based on the selection of another select box. ( I posted my answer here ) Pulling the data from an array structure built server-side, stored in a.js file and referenced in the html page. Now I would like to add a third select box. If I had 3 sets...
I prefer data structure like this: var carMakers = [ { name: 'Honda', models: [ { name: 'Accord', features: ['2dr', '4dr'] }, { name: 'CRV', features: ['2dr', 'Hatchback'] }, { name: 'Pilot', features: ['base', 'superDuper'] } ]}, { name: 'Toyota', models: [ { name: 'Prius', features: ['green', 'superGreen'] }, { name...
Using javascript and jquery, to populate related select boxes with array structure Using answers to this question, I have been able to populate a select box based on the selection of another select box. ( I posted my answer here ) Pulling the data from an array structure built server-side, stored in a.js file and refer...
TITLE: Using javascript and jquery, to populate related select boxes with array structure QUESTION: Using answers to this question, I have been able to populate a select box based on the selection of another select box. ( I posted my answer here ) Pulling the data from an array structure built server-side, stored in a...
[ "javascript", "jquery" ]
24
46
57,207
4
0
2008-10-07T21:12:41.253000
2008-10-08T00:16:05.687000
180,452
180,558
How do I set a click event for a form?
I have a c# form (let's call it MainForm) with a number of custom controls on it. I'd like to have the MainForm.OnClick() method fire anytime someone clicks on the form regardless of whether the click happened on the form or if the click was on one of the custom controls. I'm looking for behavior similar to the KeyPrev...
In the form's ControlAdded event, add a MouseClick handler to the control, with the Address of the form's click event. I haven't tested this, but it might work. Private Sub Example_ControlAdded(ByVal sender As Object, ByVal e As System.Windows.Forms.ControlEventArgs) Handles Me.ControlAdded AddHandler e.Control.MouseC...
How do I set a click event for a form? I have a c# form (let's call it MainForm) with a number of custom controls on it. I'd like to have the MainForm.OnClick() method fire anytime someone clicks on the form regardless of whether the click happened on the form or if the click was on one of the custom controls. I'm look...
TITLE: How do I set a click event for a form? QUESTION: I have a c# form (let's call it MainForm) with a number of custom controls on it. I'd like to have the MainForm.OnClick() method fire anytime someone clicks on the form regardless of whether the click happened on the form or if the click was on one of the custom ...
[ "c#", "winforms" ]
8
3
29,019
6
0
2008-10-07T21:12:52.813000
2008-10-07T21:40:21.273000
180,464
180,495
What's the proper use of php.ini's session.save_path?
I'm running PHP on Windows/IIS. My session variables don't seem to be preserved from page-to-page. This code… //echos out the session variables in a nice format for inspection echo " "; print_r($_SESSION); echo " "; …outputs blank values, like this… Array ( [s_firstvar] => [s_var2] => [s_third] => [s_numberfour] => [s_...
Oops. I found that I was not using the correct syntax when assigning values: Does not work: $_SESSION['$s_firstvar'] = 3; Does work: $_SESSION['s_firstvar'] = 3;
What's the proper use of php.ini's session.save_path? I'm running PHP on Windows/IIS. My session variables don't seem to be preserved from page-to-page. This code… //echos out the session variables in a nice format for inspection echo " "; print_r($_SESSION); echo " "; …outputs blank values, like this… Array ( [s_first...
TITLE: What's the proper use of php.ini's session.save_path? QUESTION: I'm running PHP on Windows/IIS. My session variables don't seem to be preserved from page-to-page. This code… //echos out the session variables in a nice format for inspection echo " "; print_r($_SESSION); echo " "; …outputs blank values, like this...
[ "php", "iis", "session", "session-variables" ]
1
0
1,958
2
0
2008-10-07T21:14:21.780000
2008-10-07T21:22:44.413000
180,510
180,600
Is there a master list of the Big-O notation for everything?
Is there a master list of the Big-O notation for everything? Data structures, algorithms, operations performed on each, average-case, worst-case, etc.
Dictionary of Algorithms and Data Structures is a fairly comprehensive list, and includes complexity (Big-O) in the algorithms' descriptions. If you need more information, it'll be in one of the linked references, and there's always Wikipedia as a fallback.
Is there a master list of the Big-O notation for everything? Is there a master list of the Big-O notation for everything? Data structures, algorithms, operations performed on each, average-case, worst-case, etc.
TITLE: Is there a master list of the Big-O notation for everything? QUESTION: Is there a master list of the Big-O notation for everything? Data structures, algorithms, operations performed on each, average-case, worst-case, etc. ANSWER: Dictionary of Algorithms and Data Structures is a fairly comprehensive list, and ...
[ "algorithm", "data-structures", "big-o" ]
17
8
4,695
6
0
2008-10-07T21:28:01.457000
2008-10-07T21:49:41.287000
180,516
180,616
How to filter items from a std::map?
I have roughly the following code. Could this be made nicer or more efficient? Perhaps using std::remove_if? Can you remove items from the map while traversing it? Can we avoid using the temporary map? typedef std::map Actions; static Actions _actions; bool expired(const Actions::value_type &action) { return; } void ...
You could use erase(), but I don't know how BOOST_FOREACH will handle the invalidated iterator. The documentation for map::erase states that only the erased iterator will be invalidated, the others should be OK. Here's how I would restructure the inner loop: Actions::iterator it = _actions.begin(); while (it!= _actions...
How to filter items from a std::map? I have roughly the following code. Could this be made nicer or more efficient? Perhaps using std::remove_if? Can you remove items from the map while traversing it? Can we avoid using the temporary map? typedef std::map Actions; static Actions _actions; bool expired(const Actions::v...
TITLE: How to filter items from a std::map? QUESTION: I have roughly the following code. Could this be made nicer or more efficient? Perhaps using std::remove_if? Can you remove items from the map while traversing it? Can we avoid using the temporary map? typedef std::map Actions; static Actions _actions; bool expire...
[ "c++", "boost", "stl" ]
29
31
24,595
4
0
2008-10-07T21:29:44.853000
2008-10-07T21:54:39.233000
180,518
180,588
Single-row subqueries in Oracle -- what is the join plan?
I've just discovered that Oracle lets you do the following: SELECT foo.a, (SELECT c FROM bar WHERE foo.a = bar.a) from foo As long as only one row in bar matches any row in foo. The explain plan I get from PL/SQL developer is this: SELECT STATEMENT, GOAL = ALL_ROWS TABLE ACCESS FULL BAR TABLE ACCESS FULL FOO This doesn...
The plan you have there does not provide much information at all. Use SQL*Plus and use dbms_xplan to get a more detailed plan. Look for a script called utlxpls.sql. This gives a bit more information:- -------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cos...
Single-row subqueries in Oracle -- what is the join plan? I've just discovered that Oracle lets you do the following: SELECT foo.a, (SELECT c FROM bar WHERE foo.a = bar.a) from foo As long as only one row in bar matches any row in foo. The explain plan I get from PL/SQL developer is this: SELECT STATEMENT, GOAL = ALL_R...
TITLE: Single-row subqueries in Oracle -- what is the join plan? QUESTION: I've just discovered that Oracle lets you do the following: SELECT foo.a, (SELECT c FROM bar WHERE foo.a = bar.a) from foo As long as only one row in bar matches any row in foo. The explain plan I get from PL/SQL developer is this: SELECT STATE...
[ "sql", "database", "oracle" ]
0
4
2,184
2
0
2008-10-07T21:30:06.677000
2008-10-07T21:47:12.853000
180,537
180,596
SQL Express for production?
Is using SQL Express in a production environment a reasonable choice? I looked at Microsoft's comparison chart: https://www.microsoft.com/en-us/sql-server/sql-server-2019-comparison I would be using SQL Express with a small to mid-sized web site. I don't believe I would exceed the 4GB database size limit. Is SQL Expres...
I know many people using SQL Express for production and it works well, the biggest limiting factor is the absence of SQL Agent for automated backups. To automate backups you have to either take a VM image (if on a VPS) or use windows scheduler or some other technology. The only other major limiting factor is the ram li...
SQL Express for production? Is using SQL Express in a production environment a reasonable choice? I looked at Microsoft's comparison chart: https://www.microsoft.com/en-us/sql-server/sql-server-2019-comparison I would be using SQL Express with a small to mid-sized web site. I don't believe I would exceed the 4GB databa...
TITLE: SQL Express for production? QUESTION: Is using SQL Express in a production environment a reasonable choice? I looked at Microsoft's comparison chart: https://www.microsoft.com/en-us/sql-server/sql-server-2019-comparison I would be using SQL Express with a small to mid-sized web site. I don't believe I would exc...
[ "sql-server", "sql-server-express" ]
44
27
29,373
5
0
2008-10-07T21:34:21.363000
2008-10-07T21:48:21.647000
180,549
180,832
Learn C first before learning Objective-C
Being an aspiring Apple developer, I want to get the opinions of the community if it is better to learn C first before moving into Objective-C and ultimately the Cocoa Framework? My gut says learn C, which will give me a good foundation.
I would learn C first. I learned C (and did a lot in C) before moving to Obj-C. I have many colleagues who never were real C programmers, they started with Obj-C and learned only as much C as necessary. Every now and then I see how they solve a problem entirely in Obj-C, sometimes resulting in a very clumsy solutions. ...
Learn C first before learning Objective-C Being an aspiring Apple developer, I want to get the opinions of the community if it is better to learn C first before moving into Objective-C and ultimately the Cocoa Framework? My gut says learn C, which will give me a good foundation.
TITLE: Learn C first before learning Objective-C QUESTION: Being an aspiring Apple developer, I want to get the opinions of the community if it is better to learn C first before moving into Objective-C and ultimately the Cocoa Framework? My gut says learn C, which will give me a good foundation. ANSWER: I would learn...
[ "c", "objective-c", "cocoa" ]
108
165
68,700
23
0
2008-10-07T21:37:27.490000
2008-10-07T23:32:34.340000
180,572
184,512
What is the best practice in defining a soap service (generic vs. specific operation)?
My situation is as follows: I have a normalized database, in which I hold geographic information about airports. The structure is: airport --is in--> city --is in--> country --is in--> continent Now I want to let users administrate this data, without giving them direct access to the database. We need to offer this admi...
Presumably you are writing a protocol layer that will understand your different message types. You will also need an application layer to parse the contents of the message. The different approaches you mention will shift the burden of parsing between these two layers. So for example: Solution A: The protocol layer does...
What is the best practice in defining a soap service (generic vs. specific operation)? My situation is as follows: I have a normalized database, in which I hold geographic information about airports. The structure is: airport --is in--> city --is in--> country --is in--> continent Now I want to let users administrate t...
TITLE: What is the best practice in defining a soap service (generic vs. specific operation)? QUESTION: My situation is as follows: I have a normalized database, in which I hold geographic information about airports. The structure is: airport --is in--> city --is in--> country --is in--> continent Now I want to let us...
[ "web-services", "soap", "wsdl" ]
7
5
1,851
2
0
2008-10-07T21:43:49.707000
2008-10-08T19:42:06.737000
180,586
180,795
Does anyone have experience with ZFS?
I am considering to adopt ZFS and I would be happy to know your experience in both production and testing environment.
I am not using ZFS in production - had no chance yet. Well, basically we have no need for giant storage currently and also we did not run any 7.0 up until recently. At home I have a FreeBSD system (7.0-ish) which is more bleeding edge. I have been using ZFS for almost eight months now. I currently have a 1.2 TB in my t...
Does anyone have experience with ZFS? I am considering to adopt ZFS and I would be happy to know your experience in both production and testing environment.
TITLE: Does anyone have experience with ZFS? QUESTION: I am considering to adopt ZFS and I would be happy to know your experience in both production and testing environment. ANSWER: I am not using ZFS in production - had no chance yet. Well, basically we have no need for giant storage currently and also we did not ru...
[ "filesystems", "zfs" ]
8
8
1,272
5
0
2008-10-07T21:46:58.890000
2008-10-07T23:14:58.493000
180,601
180,633
Using "super" in C++
My style of coding includes the following idiom: class Derived: public Base { public: typedef Base super; // note that it could be hidden in // protected/private section, instead // Etc. }; This enables me to use "super" as an alias to Base, for example, in constructors: Derived(int i, int j): super(i), J(j) { } Or ev...
Bjarne Stroustrup mentions in Design and Evolution of C++ that super as a keyword was considered by the ISO C++ Standards committee the first time C++ was standardized. Dag Bruck proposed this extension, calling the base class "inherited." The proposal mentioned the multiple inheritance issue, and would have flagged am...
Using "super" in C++ My style of coding includes the following idiom: class Derived: public Base { public: typedef Base super; // note that it could be hidden in // protected/private section, instead // Etc. }; This enables me to use "super" as an alias to Base, for example, in constructors: Derived(int i, int j): sup...
TITLE: Using "super" in C++ QUESTION: My style of coding includes the following idiom: class Derived: public Base { public: typedef Base super; // note that it could be hidden in // protected/private section, instead // Etc. }; This enables me to use "super" as an alias to Base, for example, in constructors: Derived(...
[ "c++", "coding-style" ]
231
180
229,612
19
0
2008-10-07T21:49:42.770000
2008-10-07T22:00:31.997000
180,606
180,615
How do I convert a list of ascii values to a string in python?
I've got a list in a Python program that contains a series of numbers, which are themselves ASCII values. How do I convert this into a "regular" string that I can echo to the screen?
You are probably looking for 'chr()': >>> L = [104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100] >>> ''.join(chr(i) for i in L) 'hello, world'
How do I convert a list of ascii values to a string in python? I've got a list in a Python program that contains a series of numbers, which are themselves ASCII values. How do I convert this into a "regular" string that I can echo to the screen?
TITLE: How do I convert a list of ascii values to a string in python? QUESTION: I've got a list in a Python program that contains a series of numbers, which are themselves ASCII values. How do I convert this into a "regular" string that I can echo to the screen? ANSWER: You are probably looking for 'chr()': >>> L = [...
[ "python", "string", "ascii" ]
92
164
219,859
9
0
2008-10-07T21:51:01.610000
2008-10-07T21:54:33.040000
180,624
180,640
How can I delete (not disable) ActiveX add-ons in Internet Explorer (7 and 8 Beta 2)?
I'm developing a solution which uses an ActiveX control (a commercial one which we bought and that I did not develop). I need to develop the proper installation pages to simulate what happens when a user who has never visited the site and does not have the add-on installed comes to the page. I've found the "Manage Add-...
You could unregister the control with regsvr32 /u badboy.ocx at the command line. Though i would suggest testing these things in a vmware.
How can I delete (not disable) ActiveX add-ons in Internet Explorer (7 and 8 Beta 2)? I'm developing a solution which uses an ActiveX control (a commercial one which we bought and that I did not develop). I need to develop the proper installation pages to simulate what happens when a user who has never visited the site...
TITLE: How can I delete (not disable) ActiveX add-ons in Internet Explorer (7 and 8 Beta 2)? QUESTION: I'm developing a solution which uses an ActiveX control (a commercial one which we bought and that I did not develop). I need to develop the proper installation pages to simulate what happens when a user who has neve...
[ "internet-explorer", "activex" ]
13
9
141,120
8
0
2008-10-07T21:57:49.053000
2008-10-07T22:02:53.413000
180,626
180,739
How do I initialize a Service Object when Self-Hosting in WCF
I am hosting a service within a Windows Service. The following snippet instantiates the ServiceHost object: Host = new ServiceHost(typeof(Services.DocumentInfoService)); The DocumentInfoService class implements a contract interface that has methods that invoke business objects requiring initialization (actually a conne...
ServiceHost will create the service instances based on the binding and behaviors configured for the endpoint. There's no particular point in time, where you can rely there is a service instance. Hence, ServiceHost does not expose the service instances. What you could do is add code to your service object constructor to...
How do I initialize a Service Object when Self-Hosting in WCF I am hosting a service within a Windows Service. The following snippet instantiates the ServiceHost object: Host = new ServiceHost(typeof(Services.DocumentInfoService)); The DocumentInfoService class implements a contract interface that has methods that invo...
TITLE: How do I initialize a Service Object when Self-Hosting in WCF QUESTION: I am hosting a service within a Windows Service. The following snippet instantiates the ServiceHost object: Host = new ServiceHost(typeof(Services.DocumentInfoService)); The DocumentInfoService class implements a contract interface that has...
[ "wcf" ]
4
4
5,878
2
0
2008-10-07T21:58:29.413000
2008-10-07T22:48:51.293000
180,629
180,969
Remove Last Row Databound DataGridView C#
I am using VS 2008/C# and binding a local List of helper classes as the DataSource for a DataGridView control. Calling the Remove() method on my List of helper classes fires the CellFormatting event of the DataGridView, which makes sense (a bit). When removing whatever happens to be the DataBoundItem of the last row in...
I've had this problem in the past, and if I remember correctly there's one of two things you can do. When you remove the record from the collection, set the datasource property on your datagridview to null, and then rebind it to your list. That should do the trick. Alternatively, you can handle the DataError event on y...
Remove Last Row Databound DataGridView C# I am using VS 2008/C# and binding a local List of helper classes as the DataSource for a DataGridView control. Calling the Remove() method on my List of helper classes fires the CellFormatting event of the DataGridView, which makes sense (a bit). When removing whatever happens ...
TITLE: Remove Last Row Databound DataGridView C# QUESTION: I am using VS 2008/C# and binding a local List of helper classes as the DataSource for a DataGridView control. Calling the Remove() method on my List of helper classes fires the CellFormatting event of the DataGridView, which makes sense (a bit). When removing...
[ "c#", "datagridview" ]
6
13
36,987
6
0
2008-10-07T21:59:54.667000
2008-10-08T00:39:37.917000
180,638
180,904
Determine Time Zone Offset in T-SQL
My database application is going to be deployed at multiple sites in different time zones. I need a T-SQL function that will determine the UTC timestamp of midnight on January 1 of the current year for YTD calculations. All of the data is stored in UTC timestamps. For example, Chicago is UTC-6 with Daylight Savings Tim...
Check out this previous question and answer for related information: Effectively Converting dates between UTC and Local (ie. PST) time in SQL 2005 (To summarize, you do need to build time zone and DST tables in Sql Server 2005. In the next version of Sql Server we get some help with time zones.)
Determine Time Zone Offset in T-SQL My database application is going to be deployed at multiple sites in different time zones. I need a T-SQL function that will determine the UTC timestamp of midnight on January 1 of the current year for YTD calculations. All of the data is stored in UTC timestamps. For example, Chicag...
TITLE: Determine Time Zone Offset in T-SQL QUESTION: My database application is going to be deployed at multiple sites in different time zones. I need a T-SQL function that will determine the UTC timestamp of midnight on January 1 of the current year for YTD calculations. All of the data is stored in UTC timestamps. F...
[ "sql", "sql-server", "sql-server-2005", "timezone" ]
5
2
47,551
3
0
2008-10-07T22:02:38.763000
2008-10-08T00:05:47.143000
180,646
180,683
Can anyone recommend an efficient UDP messaging framework for Java?
I need to be able to send compact messages (ideally small enough to fit into a single UDP packet) from Java. It needs to be as efficient as possible - can anyone give me any pointers (other than constructing them manually)?
Mina -- http://mina.apache.org/udp-tutorial.html -- very good tool
Can anyone recommend an efficient UDP messaging framework for Java? I need to be able to send compact messages (ideally small enough to fit into a single UDP packet) from Java. It needs to be as efficient as possible - can anyone give me any pointers (other than constructing them manually)?
TITLE: Can anyone recommend an efficient UDP messaging framework for Java? QUESTION: I need to be able to send compact messages (ideally small enough to fit into a single UDP packet) from Java. It needs to be as efficient as possible - can anyone give me any pointers (other than constructing them manually)? ANSWER: M...
[ "java", "messaging" ]
3
5
1,252
1
0
2008-10-07T22:06:10.910000
2008-10-07T22:21:04.670000
180,647
181,523
How to line up HTML input elements?
I am hoping to find a resource for lining up input elements in a HTML page. I find it difficult to get a select element and a text box to be the same width even when using the width style attribute, and it is even more difficult across browsers. Finally, file inputs seem impossible to get to the same width cross browse...
I tested this out in Internet Explorer 7, Firefox 3 and Safari/Google Chrome. I definitely see the problem with and. My findings showed that if you styled all the inputs at the same width, the would be about 5 pixels shorter in all browsers. Using the Eric Meyer CSS reset script does not help this issue, however if you...
How to line up HTML input elements? I am hoping to find a resource for lining up input elements in a HTML page. I find it difficult to get a select element and a text box to be the same width even when using the width style attribute, and it is even more difficult across browsers. Finally, file inputs seem impossible t...
TITLE: How to line up HTML input elements? QUESTION: I am hoping to find a resource for lining up input elements in a HTML page. I find it difficult to get a select element and a text box to be the same width even when using the width style attribute, and it is even more difficult across browsers. Finally, file inputs...
[ "html", "css", "css-reset" ]
24
17
36,721
9
0
2008-10-07T22:06:17.540000
2008-10-08T06:16:18.097000
180,670
180,691
Using Office Ribbon in a Word Processor
I heard Microsoft allows use of commercially available Office UI controls, with the exception of competing products, such as a word processor or spreadsheet app, etc. How true is that? Also, if it is not true, do you know of any free Ribbon controls?
You should look at Jensen Harris' blog entry about licensing the Office user interface which explains it in great detail. However I believe the relevant point here is: There's only one limitation: if you are building a program which directly competes with Word, Excel, PowerPoint, Outlook, or Access (the Microsoft appli...
Using Office Ribbon in a Word Processor I heard Microsoft allows use of commercially available Office UI controls, with the exception of competing products, such as a word processor or spreadsheet app, etc. How true is that? Also, if it is not true, do you know of any free Ribbon controls?
TITLE: Using Office Ribbon in a Word Processor QUESTION: I heard Microsoft allows use of commercially available Office UI controls, with the exception of competing products, such as a word processor or spreadsheet app, etc. How true is that? Also, if it is not true, do you know of any free Ribbon controls? ANSWER: Yo...
[ "user-interface", "ms-office", "ribbon" ]
3
5
852
2
0
2008-10-07T22:15:00.800000
2008-10-07T22:24:03.167000
180,684
180,690
Map *.domain.com to a single address
I´m not sure if this is really a programming question, but it's related to what I'm doing which is... I'm developing a web site that will have a lot of.domain.com, and based on what contain, the web site will show diffrent content. Anyone knows how to do that? Maybe it requires changes in the DNS server.
You need a wildcard DNS entry to point all of those subdomains to the same IP (the one your web server uses). Then sort it out in your application code which site to show based on the host header.
Map *.domain.com to a single address I´m not sure if this is really a programming question, but it's related to what I'm doing which is... I'm developing a web site that will have a lot of.domain.com, and based on what contain, the web site will show diffrent content. Anyone knows how to do that? Maybe it requires chan...
TITLE: Map *.domain.com to a single address QUESTION: I´m not sure if this is really a programming question, but it's related to what I'm doing which is... I'm developing a web site that will have a lot of.domain.com, and based on what contain, the web site will show diffrent content. Anyone knows how to do that? Mayb...
[ "dns", "subdomain" ]
1
2
403
3
0
2008-10-07T22:22:12.093000
2008-10-07T22:24:01.013000
180,704
180,738
How does pubsub work in OpenSocial?
I'm trying to design an application based on the OpenSocial API, and I'm uncertain of how the pubsub apparatus will work. This appears to be analogous to a Unix pipe, or perhaps an RSS feed. Is a channel persistent across browsers / computers? That is, can I subscribe to channel "x" on browser A and publish to "x" on b...
Pubsub is an API feature that allows different OpenSocial gadgets to talk to one another while being on the same page in an OpenSocial container. That means the connection is not persistent, but if for example you have a map gadget, and a gadget with a list of restaurants which both appear in a page, this mechanism can...
How does pubsub work in OpenSocial? I'm trying to design an application based on the OpenSocial API, and I'm uncertain of how the pubsub apparatus will work. This appears to be analogous to a Unix pipe, or perhaps an RSS feed. Is a channel persistent across browsers / computers? That is, can I subscribe to channel "x" ...
TITLE: How does pubsub work in OpenSocial? QUESTION: I'm trying to design an application based on the OpenSocial API, and I'm uncertain of how the pubsub apparatus will work. This appears to be analogous to a Unix pipe, or perhaps an RSS feed. Is a channel persistent across browsers / computers? That is, can I subscri...
[ "opensocial", "publish-subscribe" ]
0
2
1,158
1
0
2008-10-07T22:33:38.687000
2008-10-07T22:47:23.527000
180,710
180,728
Doesn't the ability to cast defeat the purpose of typed variables?
So, I'm working under the assumption that we have typed languages because we make a lot of mistakes... so typing is one way to have the compiler do a lot of checks for us and help us out a bit (please let me know if it is my assumptions that's incorrect). However, if we introduce casting to a typed language, don't we r...
The bottom line is that strong typing lets the compiler check things for you and casting lets you override the strong typing when necessary.
Doesn't the ability to cast defeat the purpose of typed variables? So, I'm working under the assumption that we have typed languages because we make a lot of mistakes... so typing is one way to have the compiler do a lot of checks for us and help us out a bit (please let me know if it is my assumptions that's incorrect...
TITLE: Doesn't the ability to cast defeat the purpose of typed variables? QUESTION: So, I'm working under the assumption that we have typed languages because we make a lot of mistakes... so typing is one way to have the compiler do a lot of checks for us and help us out a bit (please let me know if it is my assumption...
[ "language-agnostic", "programming-languages", "strong-typing" ]
1
13
300
8
0
2008-10-07T22:37:24.997000
2008-10-07T22:43:17.887000
180,713
195,346
How do you determine if a JDBC Connection was retrieved from a JTA enabled DataSource or straight JDBC?
I'm using a vendor API to obtain a JDBC connection to the application's database. The API works when running in the application server or when running in a stand-alone mode. I want to run a series of SQL statements in a single transaction. I'm fine with them occurring in the context of the JTA transaction if it exists....
Even if it's straight JDBC, you can have a JTA transaction enabled. Checking the autoCommit flag will NOT help in this regard. You can be in a transaction, distributed or otherwise, with autoCommit set to false. autoCommit set to true would tell you you're not in a distributed transaction but a value of false just mean...
How do you determine if a JDBC Connection was retrieved from a JTA enabled DataSource or straight JDBC? I'm using a vendor API to obtain a JDBC connection to the application's database. The API works when running in the application server or when running in a stand-alone mode. I want to run a series of SQL statements i...
TITLE: How do you determine if a JDBC Connection was retrieved from a JTA enabled DataSource or straight JDBC? QUESTION: I'm using a vendor API to obtain a JDBC connection to the application's database. The API works when running in the application server or when running in a stand-alone mode. I want to run a series o...
[ "java", "jdbc", "transactions", "jta" ]
4
4
2,921
3
0
2008-10-07T22:39:07.270000
2008-10-12T11:03:16.367000
180,741
180,749
How to do something to each file in a directory with a batch script
How do you iterate over each file in a directory with a.bat or.cmd file? For simplicity please provide an answer that just echoes the filename or file path.
Command line usage: for /f %f in ('dir /b c:\') do echo %f Batch file usage: for /f %%f in ('dir /b c:\') do echo %%f Update: if the directory contains files with space in the names, you need to change the delimiter the for /f command is using. for example, you can use the pipe char. for /f "delims=|" %%f in ('dir /b c...
How to do something to each file in a directory with a batch script How do you iterate over each file in a directory with a.bat or.cmd file? For simplicity please provide an answer that just echoes the filename or file path.
TITLE: How to do something to each file in a directory with a batch script QUESTION: How do you iterate over each file in a directory with a.bat or.cmd file? For simplicity please provide an answer that just echoes the filename or file path. ANSWER: Command line usage: for /f %f in ('dir /b c:\') do echo %f Batch fil...
[ "windows", "file", "loops", "batch-file", "cmd" ]
307
395
449,360
6
0
2008-10-07T22:49:33.180000
2008-10-07T22:51:57.213000
180,746
182,644
What's the best approach to printing/reporting from WPF?
I have an upcoming project which will have to be able to print simple reports from its data. It'll be WPF-based, and I'm wondering which way to go. I know that WPF introduces its own printing technology (based on XPS) which looks quite easy to use. However, part of me wonders whether it would just be easier to use the ...
We had this same issue, and ended up using RDLC/ReportViewer for now. There's no native WPF reporting tool (that I know of) and RDLC is pretty simple to use, and is free. The runtime overhead for it is small (around 2Mb) but you must remember to distribute it as it isn't part of the.NET Framework.
What's the best approach to printing/reporting from WPF? I have an upcoming project which will have to be able to print simple reports from its data. It'll be WPF-based, and I'm wondering which way to go. I know that WPF introduces its own printing technology (based on XPS) which looks quite easy to use. However, part ...
TITLE: What's the best approach to printing/reporting from WPF? QUESTION: I have an upcoming project which will have to be able to print simple reports from its data. It'll be WPF-based, and I'm wondering which way to go. I know that WPF introduces its own printing technology (based on XPS) which looks quite easy to u...
[ "wpf", "printing", "reporting" ]
72
24
52,181
8
0
2008-10-07T22:51:33.457000
2008-10-08T13:08:40.743000
180,750
180,766
string symbol manipulation in batch files?
Is there a way to take substrings of a string with.bat/.cmd files? For example given the string "hello.txt" is there a way to strip the.txt? EDIT: Also is there a more general way to do this, not under the assumption that it is a file name or file path?
If this is a file passed as a parameter, you can use %~n1, like this: test.bat ---------- echo %~n1 %~n2 c:\> test.bat myfile.txt my.long.file.bat myfile my.long.file If you know the length of the string you can use the substring operator: echo %variable:0,4% => "test.txt" => "test" And to get everything EXCEPT the la...
string symbol manipulation in batch files? Is there a way to take substrings of a string with.bat/.cmd files? For example given the string "hello.txt" is there a way to strip the.txt? EDIT: Also is there a more general way to do this, not under the assumption that it is a file name or file path?
TITLE: string symbol manipulation in batch files? QUESTION: Is there a way to take substrings of a string with.bat/.cmd files? For example given the string "hello.txt" is there a way to strip the.txt? EDIT: Also is there a more general way to do this, not under the assumption that it is a file name or file path? ANSW...
[ "build-automation", "batch-file", "automated-tests", "dos" ]
2
8
19,776
7
0
2008-10-07T22:52:04.297000
2008-10-07T22:59:38.167000
180,754
180,767
Best free resource for learning advanced batch-file usage?
What are the best free resources for learning advanced batch-file usage?
It's not free, but it's probably the best. "Windows NT Shell Scripting" by Tim Hill. That said, whenever I try to do something 'advanced' in cmd batch files, I always end up regretting it. Always. edit: some explanation of the shortcomings of batch files: math capabilities are pathetic quoting support is an afterthough...
Best free resource for learning advanced batch-file usage? What are the best free resources for learning advanced batch-file usage?
TITLE: Best free resource for learning advanced batch-file usage? QUESTION: What are the best free resources for learning advanced batch-file usage? ANSWER: It's not free, but it's probably the best. "Windows NT Shell Scripting" by Tim Hill. That said, whenever I try to do something 'advanced' in cmd batch files, I a...
[ "build-automation", "batch-file", "automated-tests", "dos" ]
8
23
7,620
6
0
2008-10-07T22:54:19.660000
2008-10-07T22:59:43.017000
180,760
180,818
Makefile If-Then Else and Loops
Can someone explain how to use if-then statements and for loops in Makefiles? I can't seem to find any good documentation with examples.
Conditional Forms Simple conditional-directive text-if-true endif Moderately Complex conditional-directive text-if-true else text-if-false endif More Complex conditional-directive text-if-one-is-true else conditional-directive text-if-true else text-if-false endif endif Conditional Directives If Equal Syntax ifeq (arg1...
Makefile If-Then Else and Loops Can someone explain how to use if-then statements and for loops in Makefiles? I can't seem to find any good documentation with examples.
TITLE: Makefile If-Then Else and Loops QUESTION: Can someone explain how to use if-then statements and for loops in Makefiles? I can't seem to find any good documentation with examples. ANSWER: Conditional Forms Simple conditional-directive text-if-true endif Moderately Complex conditional-directive text-if-true else...
[ "makefile" ]
60
69
116,487
4
0
2008-10-07T22:57:50.150000
2008-10-07T23:28:12.943000
180,765
180,776
What's a good online reference for manipulating Office documents via ActiveX?
I am looking for a reference that covers using ActiveX to open and manipulate Excel (and possibly Word) documents. I'd prefer an online reference but book suggestions are helpful too.
Am I missing something? The references are available on MSDN: Excel Object Model Reference Word Object Model Reference
What's a good online reference for manipulating Office documents via ActiveX? I am looking for a reference that covers using ActiveX to open and manipulate Excel (and possibly Word) documents. I'd prefer an online reference but book suggestions are helpful too.
TITLE: What's a good online reference for manipulating Office documents via ActiveX? QUESTION: I am looking for a reference that covers using ActiveX to open and manipulate Excel (and possibly Word) documents. I'd prefer an online reference but book suggestions are helpful too. ANSWER: Am I missing something? The ref...
[ "reference", "activex", "ms-office" ]
2
3
115
1
0
2008-10-07T22:58:54.423000
2008-10-07T23:02:25.650000
180,778
181,248
Is there a free implementation of Ada?
I looked at the AdaCore site, as well as for A# (which now appears to be owned by AdaCore) and neither appear to be free (although I could have misread something). Any recommendations?
GNAT is available for download here: https://libre.adacore.com/ Look for "GNAT GPL Edition". Not sure why it is so well hidden on that little known site.
Is there a free implementation of Ada? I looked at the AdaCore site, as well as for A# (which now appears to be owned by AdaCore) and neither appear to be free (although I could have misread something). Any recommendations?
TITLE: Is there a free implementation of Ada? QUESTION: I looked at the AdaCore site, as well as for A# (which now appears to be owned by AdaCore) and neither appear to be free (although I could have misread something). Any recommendations? ANSWER: GNAT is available for download here: https://libre.adacore.com/ Look ...
[ "ada" ]
17
19
2,451
5
0
2008-10-07T23:04:02.353000
2008-10-08T03:40:21.907000
180,781
180,792
How to use the tar -I option
I'm trying to tar up all the *.class files only on a Solaris box under a certain directory. Reading the man pages for tar made it seem like the -I option is what I wanted. This is what I've tried from the dir in question: find. -name "*.class" >> ~/includes.txt tar cvf ~/classfiles.tar -I ~/includes.txt From that I get...
Check which tar you are running. That message about removing the leading slash is a gtar (GNU tar) message, and the -I option you are trying to use is a Sun tar option (which lives in /bin/tar). (at least the above is all true on my Solaris machine)
How to use the tar -I option I'm trying to tar up all the *.class files only on a Solaris box under a certain directory. Reading the man pages for tar made it seem like the -I option is what I wanted. This is what I've tried from the dir in question: find. -name "*.class" >> ~/includes.txt tar cvf ~/classfiles.tar -I ~...
TITLE: How to use the tar -I option QUESTION: I'm trying to tar up all the *.class files only on a Solaris box under a certain directory. Reading the man pages for tar made it seem like the -I option is what I wanted. This is what I've tried from the dir in question: find. -name "*.class" >> ~/includes.txt tar cvf ~/c...
[ "solaris", "tar" ]
0
5
3,041
1
0
2008-10-07T23:05:04.833000
2008-10-07T23:13:32.740000
180,784
181,052
What's the best/easiest way to manipulate ActiveX objects in Java?
I want to open and manipulate Excel files with ActiveX. I've had success with Python's Win32 Extensions and Groovy's Scriptom libraries on other projects but need to do this is pure Java this time if possible. I've tried the Jacob Java COM Bridge but that doesn't seem as straightforward or simple to use, and I couldn't...
Jacob is really the tool for the job here. I recommend that you take the time to learn a bit about how COM and ActiveX work, and I think you'll find that it's easier to use. COM is quite an accomplishment, but it's hard. Wrappers like VB make it seem easy (For the limited use that they work for), but it is not at all e...
What's the best/easiest way to manipulate ActiveX objects in Java? I want to open and manipulate Excel files with ActiveX. I've had success with Python's Win32 Extensions and Groovy's Scriptom libraries on other projects but need to do this is pure Java this time if possible. I've tried the Jacob Java COM Bridge but th...
TITLE: What's the best/easiest way to manipulate ActiveX objects in Java? QUESTION: I want to open and manipulate Excel files with ActiveX. I've had success with Python's Win32 Extensions and Groovy's Scriptom libraries on other projects but need to do this is pure Java this time if possible. I've tried the Jacob Java...
[ "java", "com", "activex" ]
1
4
1,439
4
0
2008-10-07T23:07:39.100000
2008-10-08T01:19:05.297000
180,793
181,181
Replace patterns that are inside delimiters using a regular expression call
I need to clip out all the occurances of the pattern '--' that are inside single quotes in long string (leaving intact the ones that are outside single quotes). Is there a RegEx way of doing this? (using it with an iterator from the language is OK). For example, starting with "xxxx rt / $ 'dfdf--fggh-dfgdfg' ghgh- dddd...
I found another way to do this from an answer by Greg Hewgill at Qn138522 It is based on using this regex (adapted to contain the pattern I was looking for): --(?=[^\']*'([^']|'[^']*')*$) Greg explains: "What this does is use the non-capturing match (?=...) to check that the character x is within a quoted string. It lo...
Replace patterns that are inside delimiters using a regular expression call I need to clip out all the occurances of the pattern '--' that are inside single quotes in long string (leaving intact the ones that are outside single quotes). Is there a RegEx way of doing this? (using it with an iterator from the language is...
TITLE: Replace patterns that are inside delimiters using a regular expression call QUESTION: I need to clip out all the occurances of the pattern '--' that are inside single quotes in long string (leaving intact the ones that are outside single quotes). Is there a RegEx way of doing this? (using it with an iterator fr...
[ "regex" ]
2
2
6,873
5
0
2008-10-07T23:13:46.140000
2008-10-08T03:01:39.003000
180,809
180,816
In the Django admin interface, is there a way to duplicate an item?
Just wondering if there is an easy way to add the functionality to duplicate an existing listing in the admin interface? In data entry we have run into a situation where a lot of items share generic data with another item, and to save time it would be very nice to quickly duplicate an existing listing and only alter th...
You can save as by just enabling adding this to your ModelAdmin: save_as = True This replaces the "Save and add another" button with a "Save as" button. "Save as" means the object will be saved as a new object (with a new ID), rather than the old object.
In the Django admin interface, is there a way to duplicate an item? Just wondering if there is an easy way to add the functionality to duplicate an existing listing in the admin interface? In data entry we have run into a situation where a lot of items share generic data with another item, and to save time it would be ...
TITLE: In the Django admin interface, is there a way to duplicate an item? QUESTION: Just wondering if there is an easy way to add the functionality to duplicate an existing listing in the admin interface? In data entry we have run into a situation where a lot of items share generic data with another item, and to save...
[ "python", "django", "django-models", "django-admin" ]
83
150
25,747
3
0
2008-10-07T23:23:11.067000
2008-10-07T23:26:15.867000
180,810
180,859
asp.net output data from DB without any html markup
I'm new to jquery and asp.net so please forgive if this is an obvious question. I'm using a jquery autocomplete plugin which requires that the page it looks up asynchronously for data is in this format as pure text only: product1|price1 product2|price2 product3|price3 WITHOUT ANY OTHER HTML MARKUP. Any other html tags ...
If you have a bare page with no master page referenced a repeater shouldn't produce any html. Make sure in the HTML view you only have: - your template here An alternative would be to add a new Handler to your project which is a class that implements the IHttpHandler interface. This would allow you to output your code ...
asp.net output data from DB without any html markup I'm new to jquery and asp.net so please forgive if this is an obvious question. I'm using a jquery autocomplete plugin which requires that the page it looks up asynchronously for data is in this format as pure text only: product1|price1 product2|price2 product3|price3...
TITLE: asp.net output data from DB without any html markup QUESTION: I'm new to jquery and asp.net so please forgive if this is an obvious question. I'm using a jquery autocomplete plugin which requires that the page it looks up asynchronously for data is in this format as pure text only: product1|price1 product2|pric...
[ "asp.net", "jquery", "ajax" ]
1
2
280
1
0
2008-10-07T23:23:13.657000
2008-10-07T23:43:40.013000
180,822
180,906
Is there an equivalent to Java's HashSet in vbscript?
I have to write something in vbscript that need to use a unique set. I am looking for something akin to Java's HashSet, is this already in vbscript or do I have to write my own?
It's not identical, but VBScript has a Dictionary object which behaves like Java's Map or Hashtable. You can use this almost like a HashSet, by just looking up the item as a key in the dictionary and finding if there is any value there. When you want to put something into the set, simply set its value to 1 or anything ...
Is there an equivalent to Java's HashSet in vbscript? I have to write something in vbscript that need to use a unique set. I am looking for something akin to Java's HashSet, is this already in vbscript or do I have to write my own?
TITLE: Is there an equivalent to Java's HashSet in vbscript? QUESTION: I have to write something in vbscript that need to use a unique set. I am looking for something akin to Java's HashSet, is this already in vbscript or do I have to write my own? ANSWER: It's not identical, but VBScript has a Dictionary object whic...
[ "vbscript" ]
1
6
1,419
1
0
2008-10-07T23:29:54.737000
2008-10-08T00:06:21.573000
180,827
180,846
Unobtrusive Javascript rich text editor?
We've used the no-longer-supported RichTextBox control as part of our (ASP.NET-based) CMS for a long time, and we'd like to replace it with something lighter-weight and with better cross-browser support. We were originally looking at various ASP.NET components, but I'm wondering if we'd be better off just using an open...
I've used TinyMCE. Great across browsers; easy to configure to be extremely light weight and allows you to control what your user can do. Some of the plug-ins (such as the image manager) are great and easy to implement. Nice that it also support the Google Spellchecker so you don't need any libraries installed on your ...
Unobtrusive Javascript rich text editor? We've used the no-longer-supported RichTextBox control as part of our (ASP.NET-based) CMS for a long time, and we'd like to replace it with something lighter-weight and with better cross-browser support. We were originally looking at various ASP.NET components, but I'm wondering...
TITLE: Unobtrusive Javascript rich text editor? QUESTION: We've used the no-longer-supported RichTextBox control as part of our (ASP.NET-based) CMS for a long time, and we'd like to replace it with something lighter-weight and with better cross-browser support. We were originally looking at various ASP.NET components,...
[ "asp.net", "javascript", "jquery" ]
27
9
12,225
9
0
2008-10-07T23:31:46.807000
2008-10-07T23:37:50.117000
180,828
180,895
How can I debug a VB6 project that has a .net interop project which uses an app.config file?
I have a.net interop project that uses an app.config file. When I am running the VB6 project that is using the interop control in Debug mode, the ConfigurationManager cannot find the app.config file. When I make the VB6 project into an exe and rename the app.config file to (VB6 binary name).exe.config, the Configuratio...
A dirty hack is to place the app.config file into the VB6 folder and rename it to vb6.exe.config
How can I debug a VB6 project that has a .net interop project which uses an app.config file? I have a.net interop project that uses an app.config file. When I am running the VB6 project that is using the interop control in Debug mode, the ConfigurationManager cannot find the app.config file. When I make the VB6 project...
TITLE: How can I debug a VB6 project that has a .net interop project which uses an app.config file? QUESTION: I have a.net interop project that uses an app.config file. When I am running the VB6 project that is using the interop control in Debug mode, the ConfigurationManager cannot find the app.config file. When I ma...
[ ".net", "vb6", "interop", "app-config" ]
10
17
3,667
1
0
2008-10-07T23:31:50.580000
2008-10-07T23:58:49.513000
180,844
180,968
Referencing a javascript object literal array
How would you reference the models (Accord, CRV, Prius, etc) in this structure? Is this a bad structure to be able to extract the makes...then use a make to get the models...then use the model to get the options? var cars = [ { "makes": "Honda", "models": [ {'Accord': ["2dr","4dr"]}, {'CRV': ["2dr","Hatchback"]}, {'Pil...
The structure: var cars = [ { name: 'Honda', models: [ { name: 'Accord', features: ['2dr', '4dr'] }, { name: 'CRV', features: ['2dr', 'Hatchback'] }, { name: 'Pilot', features: ['base', 'superDuper'] } ]}, { name: 'Toyota', models: [ { name: 'Prius', features: ['green', 'superGreen'] }, { name: 'Camry', features: ['sp...
Referencing a javascript object literal array How would you reference the models (Accord, CRV, Prius, etc) in this structure? Is this a bad structure to be able to extract the makes...then use a make to get the models...then use the model to get the options? var cars = [ { "makes": "Honda", "models": [ {'Accord': ["2dr...
TITLE: Referencing a javascript object literal array QUESTION: How would you reference the models (Accord, CRV, Prius, etc) in this structure? Is this a bad structure to be able to extract the makes...then use a make to get the models...then use the model to get the options? var cars = [ { "makes": "Honda", "models": ...
[ "javascript", "data-structures" ]
8
8
20,040
5
0
2008-10-07T23:36:35.783000
2008-10-08T00:39:33.363000
180,853
184,484
CEdit control maximum length? (in characters it can display)
What is the maximum length for the text string contained in a CEdit control in MFC? I get a beep when trying to add a character after the character 30001 is this documented anywhere? Can I display longer texts in a CEdit? Should I use another control? As "Windows programmer" says down below, the text length limit is no...
I found the documentation is wrong when mentioning the default size for a single line CEdit control in vista. I ran this code: CWnd* pWnd = dlg.GetDlgItem(nItemId); CEdit *edit = static_cast (pWnd); //dynamic_cast does not work if(edit!= 0) { UINT limit = edit->GetLimitText(); //The current text limit, in bytes, for th...
CEdit control maximum length? (in characters it can display) What is the maximum length for the text string contained in a CEdit control in MFC? I get a beep when trying to add a character after the character 30001 is this documented anywhere? Can I display longer texts in a CEdit? Should I use another control? As "Win...
TITLE: CEdit control maximum length? (in characters it can display) QUESTION: What is the maximum length for the text string contained in a CEdit control in MFC? I get a beep when trying to add a character after the character 30001 is this documented anywhere? Can I display longer texts in a CEdit? Should I use anothe...
[ "mfc", "string", "character", "cedit" ]
12
21
34,366
3
0
2008-10-07T23:40:37.210000
2008-10-08T19:35:29.903000