PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
78,717
09/17/2008 00:43:53
14,528
09/17/2008 00:43:52
1
0
"foreach values" macro in gcc & cpp
I have a 'foreach' macro I use frequently in C++ that works for most STL containers: <pre> #define foreach(var, container) for (typeof((container).begin()) var = (container).begin(); var != (container).end(); ++var) </pre> It is used like this: <pre> std::vector< Blorgus > blorgi = ...; foreach(blorgus, blorgi) { blorgus->draw(); } </pre> I would like to make something similar that iterates over a map's values. Call it "foreach_value", perhaps. So instead of writing <pre> foreach(pair, mymap) { pair->second->foo(); } </pre> I would write <pre> foreach_value(v, mymap) { v.foo(); } </pre> I can't come up with a macro that will do this, because it requires declaring two variables: the iterator and the value variable ('v', above). I don't know how to do that in the initializer of a for loop, even using gcc extensions. I could declare it just before the foreach_value call, but then it will conflict with other instances of the foreach_value macro in the same scope. If I could suffix the current line number to the iterator variable name, it would work, but I don't know how to do that.
c++
cpp
null
null
null
null
open
"foreach values" macro in gcc & cpp === I have a 'foreach' macro I use frequently in C++ that works for most STL containers: <pre> #define foreach(var, container) for (typeof((container).begin()) var = (container).begin(); var != (container).end(); ++var) </pre> It is used like this: <pre> std::vector< Blorgus > blorgi = ...; foreach(blorgus, blorgi) { blorgus->draw(); } </pre> I would like to make something similar that iterates over a map's values. Call it "foreach_value", perhaps. So instead of writing <pre> foreach(pair, mymap) { pair->second->foo(); } </pre> I would write <pre> foreach_value(v, mymap) { v.foo(); } </pre> I can't come up with a macro that will do this, because it requires declaring two variables: the iterator and the value variable ('v', above). I don't know how to do that in the initializer of a for loop, even using gcc extensions. I could declare it just before the foreach_value call, but then it will conflict with other instances of the foreach_value macro in the same scope. If I could suffix the current line number to the iterator variable name, it would work, but I don't know how to do that.
0
78,723
09/17/2008 00:45:22
14,535
09/17/2008 00:45:22
1
0
How to test function call order
Considering such code: class ToBeTested { public: void doForEach() { for (vector<Contained>::iterator it = m_contained.begin(); it != m_contained.end(); it++) { doOnce(*it); doTwice(*it); doTwice(*it); } } void doOnce(Contained & c) { // do something } void doTwice(Contained & c) { // do something } // other methods private: vector<Contained> m_contained; } I want to test that if I fill vector with 3 values my functions will be called in proper order and quantity. For example my test can look something like this: tobeTested.AddContained(one); tobeTested.AddContained(two); tobeTested.AddContained(three); BEGIN_PROC_TEST() SHOULD_BE_CALLED(doOnce, 1) SHOULD_BE_CALLED(doTwice, 2) SHOULD_BE_CALLED(doTwice, 2) SHOULD_BE_CALLED(doOnce, 1) SHOULD_BE_CALLED(doTwice, 2) SHOULD_BE_CALLED(doTwice, 2) SHOULD_BE_CALLED(doOnce, 1) SHOULD_BE_CALLED(doTwice, 2) SHOULD_BE_CALLED(doTwice, 2) tobeTested.doForEach() END_PROC_TEST() How do you recommend to test this? Are there any means to do this with CppUnit or GoogleTest frameworks? Maybe some other unit test framework allow to perform such tests? I understand that probably this is impossible without calling any debug functions from these functions, but at least can it be done automatically in some test framework. I don't like to scan trace logs and check their correctness.
tdd
unit-testing
c++
null
null
null
open
How to test function call order === Considering such code: class ToBeTested { public: void doForEach() { for (vector<Contained>::iterator it = m_contained.begin(); it != m_contained.end(); it++) { doOnce(*it); doTwice(*it); doTwice(*it); } } void doOnce(Contained & c) { // do something } void doTwice(Contained & c) { // do something } // other methods private: vector<Contained> m_contained; } I want to test that if I fill vector with 3 values my functions will be called in proper order and quantity. For example my test can look something like this: tobeTested.AddContained(one); tobeTested.AddContained(two); tobeTested.AddContained(three); BEGIN_PROC_TEST() SHOULD_BE_CALLED(doOnce, 1) SHOULD_BE_CALLED(doTwice, 2) SHOULD_BE_CALLED(doTwice, 2) SHOULD_BE_CALLED(doOnce, 1) SHOULD_BE_CALLED(doTwice, 2) SHOULD_BE_CALLED(doTwice, 2) SHOULD_BE_CALLED(doOnce, 1) SHOULD_BE_CALLED(doTwice, 2) SHOULD_BE_CALLED(doTwice, 2) tobeTested.doForEach() END_PROC_TEST() How do you recommend to test this? Are there any means to do this with CppUnit or GoogleTest frameworks? Maybe some other unit test framework allow to perform such tests? I understand that probably this is impossible without calling any debug functions from these functions, but at least can it be done automatically in some test framework. I don't like to scan trace logs and check their correctness.
0
78,731
09/17/2008 00:47:07
2,669
08/24/2008 09:07:31
15
0
SQL Server Express 64 bit prerequisite to include in setup deployment project.
Where can I obtain the SQL Server Express 64 bit prerequisite to include in a Visual Studio 2008 setup deployment project. The prerequisite that comes with Visual Studio 2008 is 32 bit only.
sql-server
null
null
null
null
null
open
SQL Server Express 64 bit prerequisite to include in setup deployment project. === Where can I obtain the SQL Server Express 64 bit prerequisite to include in a Visual Studio 2008 setup deployment project. The prerequisite that comes with Visual Studio 2008 is 32 bit only.
0
78,744
09/17/2008 00:50:22
13,913
09/16/2008 21:17:03
41
7
How to start programming microcontroller?
I have developped software in C++, Java, PHP, .Net and now I am interesting to learn to program material thing. I would like to program system that could interact with IR, LCD and to be able to resuse old printer motor to use it, etc. My problem is where to start? I have searched the web and have found an open source board called Arduino but how to get other electric component together? What book or tutorial should I do to be able to create small project?
c
hobby
microcontroller
electronics
arduino
04/30/2012 03:18:42
not constructive
How to start programming microcontroller? === I have developped software in C++, Java, PHP, .Net and now I am interesting to learn to program material thing. I would like to program system that could interact with IR, LCD and to be able to resuse old printer motor to use it, etc. My problem is where to start? I have searched the web and have found an open source board called Arduino but how to get other electric component together? What book or tutorial should I do to be able to create small project?
4
78,752
09/17/2008 00:52:53
14,396
09/16/2008 23:42:38
1
1
What are some techniques for stored database keys in URL
I have read that using database keys in a URL is a bad thing to do. For instance, My table has 3 fields: ID:int, Title:nvarchar(5), Description:Text I want to create a page that displays a record. Something like ... http://server/viewitem.aspx?id=1234 1) First off, could someone elaborate on why this is a bad thing to do? 2) and secondly, what are some ways to work around using primary keys in a url?
database
webdesign
null
null
null
null
open
What are some techniques for stored database keys in URL === I have read that using database keys in a URL is a bad thing to do. For instance, My table has 3 fields: ID:int, Title:nvarchar(5), Description:Text I want to create a page that displays a record. Something like ... http://server/viewitem.aspx?id=1234 1) First off, could someone elaborate on why this is a bad thing to do? 2) and secondly, what are some ways to work around using primary keys in a url?
0
78,757
09/17/2008 00:55:01
3,155
08/27/2008 02:59:03
1
2
How to programmatically make a Query in MS Access default to landscape when printed
How can I programmatically make a Query in MS Access default to landscape when printed? I'm currently attempting this in MS Access 2003, but would like to see a solution for any version.
vba
ms-access
query
database
properties
null
open
How to programmatically make a Query in MS Access default to landscape when printed === How can I programmatically make a Query in MS Access default to landscape when printed? I'm currently attempting this in MS Access 2003, but would like to see a solution for any version.
0
78,799
09/17/2008 01:02:31
10,708
09/16/2008 01:12:33
11
5
Is there a benefit to defining a class inside another class in Python?
So what i'm talking about here are nested classes. So essentially I have two classes that I'm modeling. I have a DownloadManager class and a DownloadThread class. The obvious OOP concept here is composition. However, composition doesn't necessarily mean nesting, right? So I have code that looks something like this: class DownloadThread: def foo(self): class DownloadManager(): def __init__(self): dwld_threads = [] def create_new_thread(): dwld_threads.append(DownloadThread()) But now I'm wondering if there's a situation where nesting would be better. Something like: class DownloadManager(): class DownloadThread: def foo(self): def __init__(self): dwld_threads = [] def create_new_thread(): dwld_threads.append(DownloadManager.DownloadThread())
python
oop
null
null
null
null
open
Is there a benefit to defining a class inside another class in Python? === So what i'm talking about here are nested classes. So essentially I have two classes that I'm modeling. I have a DownloadManager class and a DownloadThread class. The obvious OOP concept here is composition. However, composition doesn't necessarily mean nesting, right? So I have code that looks something like this: class DownloadThread: def foo(self): class DownloadManager(): def __init__(self): dwld_threads = [] def create_new_thread(): dwld_threads.append(DownloadThread()) But now I'm wondering if there's a situation where nesting would be better. Something like: class DownloadManager(): class DownloadThread: def foo(self): def __init__(self): dwld_threads = [] def create_new_thread(): dwld_threads.append(DownloadManager.DownloadThread())
0
78,801
09/17/2008 01:02:39
14,559
09/17/2008 01:00:54
1
0
SQLite3::BusyException
Running a rails site right now using SQLite3. About once every 500 requests or so, I get a ActiveRecord::StatementInvalid (SQLite3::BusyException: database is locked:... What's the way to fix this that would be minimally invasive to my code?
ruby
ruby-on-rails
rubyonrails
sqlite
database
null
open
SQLite3::BusyException === Running a rails site right now using SQLite3. About once every 500 requests or so, I get a ActiveRecord::StatementInvalid (SQLite3::BusyException: database is locked:... What's the way to fix this that would be minimally invasive to my code?
0
78,806
09/17/2008 01:03:41
1,260,685
09/16/2008 01:08:57
13
2
Refactor Mercilessly or Build One To Throw Away?
> Where a new system concept or new technology is used, one has to build a > system to throw away, for even the best planning is not so omniscient as > to get it right the first time. Hence **plan to throw one away; you will, anyhow.** > > -- Fred Brooks, [_The Mythical Man-Month_][1] [Emphasis mine] Build one to throw away. That's what they told me. Then they told me that we're all [agile][2] now, so we should [Refactor Mercilessly][3]. What gives? Is it **always** better to refactor my way out of trouble? If not, can anyone suggest a rule-of-thumb to help me decide when to stick with it, and when to give up and start over? [1]: http://en.wikipedia.org/wiki/The_Mythical_Man-Month [2]: http://agilemanifesto.org/ [3]: http://c2.com/cgi/wiki?RefactorMercilessly
refactoring
throw-away
null
null
null
null
open
Refactor Mercilessly or Build One To Throw Away? === > Where a new system concept or new technology is used, one has to build a > system to throw away, for even the best planning is not so omniscient as > to get it right the first time. Hence **plan to throw one away; you will, anyhow.** > > -- Fred Brooks, [_The Mythical Man-Month_][1] [Emphasis mine] Build one to throw away. That's what they told me. Then they told me that we're all [agile][2] now, so we should [Refactor Mercilessly][3]. What gives? Is it **always** better to refactor my way out of trouble? If not, can anyone suggest a rule-of-thumb to help me decide when to stick with it, and when to give up and start over? [1]: http://en.wikipedia.org/wiki/The_Mythical_Man-Month [2]: http://agilemanifesto.org/ [3]: http://c2.com/cgi/wiki?RefactorMercilessly
0
78,816
09/17/2008 01:05:03
6,335
09/14/2008 08:56:41
1
0
Generate LINQ query from multiple controls
I have recently written an application(vb.net) that stores and allows searching for old council plans. Now while the application works well, the other day I was having a look at the routine that I use to generate the SQL string to pass the database and frankly, it was bad. I was just posting a question here to see if anyone else has a better way of doing this. What I have is a form with a bunch of controls ranging from text boxes to radio buttons, each of these controls are like database filters and when the user hits search button, a SQL string(I would really like it to be a LINQ query because I have changed to LINQ to SQL) gets generated from the completed controls and run. The problem that I am having is matching each one of these controls to a field in the database and generating a LINQ query efficiently without doing a bunch of "if ...then...else." statements. In the past I have just used the tag property on the control to link to control to a field name in the database(don't flame I was still only a noob at that time) I'm sorry if this is a bit confusing, its a bit hard to describe. Just throwing it out there to see if anyone has any ideas. Thanks Nathan
sql
linq
null
null
null
null
open
Generate LINQ query from multiple controls === I have recently written an application(vb.net) that stores and allows searching for old council plans. Now while the application works well, the other day I was having a look at the routine that I use to generate the SQL string to pass the database and frankly, it was bad. I was just posting a question here to see if anyone else has a better way of doing this. What I have is a form with a bunch of controls ranging from text boxes to radio buttons, each of these controls are like database filters and when the user hits search button, a SQL string(I would really like it to be a LINQ query because I have changed to LINQ to SQL) gets generated from the completed controls and run. The problem that I am having is matching each one of these controls to a field in the database and generating a LINQ query efficiently without doing a bunch of "if ...then...else." statements. In the past I have just used the tag property on the control to link to control to a field name in the database(don't flame I was still only a noob at that time) I'm sorry if this is a bit confusing, its a bit hard to describe. Just throwing it out there to see if anyone has any ideas. Thanks Nathan
0
78,823
09/17/2008 01:06:17
5,897
09/11/2008 15:33:36
130
7
Best way to differentiate MVC Controllers based on HTTP headers
## Problem ## My current project requires me to do different things based on different HTTP request headers for nearly every action. Currently, I have one massive Controller, and every action method has an ActionName attribute (so that I can have multiple versions of the same action that takes the same parameters, but does different things) and a custom FilterAttribute that checks if certain headers have certain values. I would really like to push the code into separate Controllers, and have the RouteTable select between them based on the headers, but can't think of the cleanest way to do this. ## Example ## For example, say I have a list of files. The service must process the request in one of two ways: 1. The client wants a zip file, and passes "accept: application/zip" as a header, I take the list of files, pack them into a zip file, and send it back to the client. 2. The client wants an html page, so it passes "accept: text/html", the site sends back a table-formatted html page listing the files.
asp.net-mvc
routing
asp.net
.net
null
null
open
Best way to differentiate MVC Controllers based on HTTP headers === ## Problem ## My current project requires me to do different things based on different HTTP request headers for nearly every action. Currently, I have one massive Controller, and every action method has an ActionName attribute (so that I can have multiple versions of the same action that takes the same parameters, but does different things) and a custom FilterAttribute that checks if certain headers have certain values. I would really like to push the code into separate Controllers, and have the RouteTable select between them based on the headers, but can't think of the cleanest way to do this. ## Example ## For example, say I have a list of files. The service must process the request in one of two ways: 1. The client wants a zip file, and passes "accept: application/zip" as a header, I take the list of files, pack them into a zip file, and send it back to the client. 2. The client wants an html page, so it passes "accept: text/html", the site sends back a table-formatted html page listing the files.
0
78,826
09/17/2008 01:06:59
10,432
09/15/2008 23:06:13
1
1
Erlang Multicast
How do you use gen_udp in Erlang to do multicasting? I know its in the code, there is just no documentation behind it.
networking
multicast
erlang
null
null
null
open
Erlang Multicast === How do you use gen_udp in Erlang to do multicasting? I know its in the code, there is just no documentation behind it.
0
78,847
09/17/2008 01:10:50
710
08/08/2008 06:30:40
1
0
How to retrieve a changed value of databound textbox within datagrid
ASP.NET 1.1 - I have a datagrid on an aspx page that is databound and displays a value within a textbox. The user is able to change this value, then click on a button where the code behind basically iterates through each DataGridItem in the grid, does a FindControl for the ID of the textbox then assigns the .Text value to a variable which is then used to update the database. The datagrid is rebound with the new values. The issue I'm having is that when assigning the .Text value to the variable, the value being retrieved is the original databound value and not the newly entered user value. Any ideas as to what may be causing this behaviour? Code sample: foreach(DataGridItem dgi in exGrid.Items) { TextBox Text1 = (TextBox)dgi.FindControl("TextID"); string exValue = Text1.Text; //This is retrieving the original bound value not the newly entered value // do stuff with the new value } Thanks
c#
asp.net
textbox
datagrid
null
null
open
How to retrieve a changed value of databound textbox within datagrid === ASP.NET 1.1 - I have a datagrid on an aspx page that is databound and displays a value within a textbox. The user is able to change this value, then click on a button where the code behind basically iterates through each DataGridItem in the grid, does a FindControl for the ID of the textbox then assigns the .Text value to a variable which is then used to update the database. The datagrid is rebound with the new values. The issue I'm having is that when assigning the .Text value to the variable, the value being retrieved is the original databound value and not the newly entered user value. Any ideas as to what may be causing this behaviour? Code sample: foreach(DataGridItem dgi in exGrid.Items) { TextBox Text1 = (TextBox)dgi.FindControl("TextID"); string exValue = Text1.Text; //This is retrieving the original bound value not the newly entered value // do stuff with the new value } Thanks
0
78,849
09/17/2008 01:11:08
8,656
09/15/2008 16:33:06
1
1
Best way to get the color where a mouse was clicked in AS3
I have an image (mx) and i want to get the uint of the pixel that was clicked. Any ideas?
flex
actionscript
3
as3
flash
null
open
Best way to get the color where a mouse was clicked in AS3 === I have an image (mx) and i want to get the uint of the pixel that was clicked. Any ideas?
0
78,850
09/17/2008 01:11:16
2,066
08/20/2008 03:59:13
398
31
Publishing vs Copying
What is the difference between publishing a website with visual studio and just copying the files over to the server? Is the only difference that the publish files are pre-compiled?
asp.net
visual-studio
null
null
null
null
open
Publishing vs Copying === What is the difference between publishing a website with visual studio and just copying the files over to the server? Is the only difference that the publish files are pre-compiled?
0
78,852
09/17/2008 01:11:21
924,607
09/17/2008 00:56:34
1
0
Mapping a collection of enums with NHibernate
Mapping a collection of enums with NHibernate Specifically, using Attributes for the mappings. Currently I have this working mapping the collection as type Int32 and NH seems to take care of it, but it's not exactly ideal. The error I receive is "Unable to determine type" when trying to map the collection as of the type of the enum I am trying to map. I found a post that said to define a class as public class CEnumType : EnumStringType { public CEnumType() : base(MyEnum) { } } and then map the enum as CEnumType, but this gives "CEnumType is not mapped" or something similar. So has anyone got experience doing this? So anyway, just a simple reference code snippet to give an example with [NHibernate.Mapping.Attributes.Class(Table = "OurClass")] public class CClass : CBaseObject { public enum EAction { do_action, do_other_action }; private IList<EAction> m_class_actions = new List<EAction>(); [NHibernate.Mapping.Attributes.Bag(0, Table = "ClassActions", Cascade="all", Fetch = CollectionFetchMode.Select, Lazy = false)] [NHibernate.Mapping.Attributes.Key(1, Column = "Class_ID")] [NHibernate.Mapping.Attributes.Element(2, Column = "EAction", Type = "Int32")] public virtual IList<EAction> Actions { get { return m_class_actions; } set { m_class_actions = value;} } } So, anyone got the correct attributes for me to map this collection of enums as actual enums? It would be really nice if they were stored in the db as strings instead of ints too but it's not completely necessary.
.net
nhibernate
collections
enums
null
null
open
Mapping a collection of enums with NHibernate === Mapping a collection of enums with NHibernate Specifically, using Attributes for the mappings. Currently I have this working mapping the collection as type Int32 and NH seems to take care of it, but it's not exactly ideal. The error I receive is "Unable to determine type" when trying to map the collection as of the type of the enum I am trying to map. I found a post that said to define a class as public class CEnumType : EnumStringType { public CEnumType() : base(MyEnum) { } } and then map the enum as CEnumType, but this gives "CEnumType is not mapped" or something similar. So has anyone got experience doing this? So anyway, just a simple reference code snippet to give an example with [NHibernate.Mapping.Attributes.Class(Table = "OurClass")] public class CClass : CBaseObject { public enum EAction { do_action, do_other_action }; private IList<EAction> m_class_actions = new List<EAction>(); [NHibernate.Mapping.Attributes.Bag(0, Table = "ClassActions", Cascade="all", Fetch = CollectionFetchMode.Select, Lazy = false)] [NHibernate.Mapping.Attributes.Key(1, Column = "Class_ID")] [NHibernate.Mapping.Attributes.Element(2, Column = "EAction", Type = "Int32")] public virtual IList<EAction> Actions { get { return m_class_actions; } set { m_class_actions = value;} } } So, anyone got the correct attributes for me to map this collection of enums as actual enums? It would be really nice if they were stored in the db as strings instead of ints too but it's not completely necessary.
0
78,859
09/17/2008 01:13:06
8,305
09/15/2008 15:40:28
1
3
Which IDE should I use for developing custom code for InfoPath Forms, VSTA or VSTO?
I am new to developing for Office Forms Server / MOSS 2007. I have to choose between designing my web-based forms and writing code for them in Visual Studio Tools for Applications (aka VSTA) or Visual Studio Tools for Office (aka VSTO). VSTA is included free as part of the license for InfoPath 2007; VSTO, also free, requires Visual Studio 2005 / 2008. I have licenses for both of the products and cannot easily decide what the pros and cons of each IDE might be.
microsoftoffice
vsto
infopath
vsta
null
null
open
Which IDE should I use for developing custom code for InfoPath Forms, VSTA or VSTO? === I am new to developing for Office Forms Server / MOSS 2007. I have to choose between designing my web-based forms and writing code for them in Visual Studio Tools for Applications (aka VSTA) or Visual Studio Tools for Office (aka VSTO). VSTA is included free as part of the license for InfoPath 2007; VSTO, also free, requires Visual Studio 2005 / 2008. I have licenses for both of the products and cannot easily decide what the pros and cons of each IDE might be.
0
78,869
09/17/2008 01:14:48
14,569
09/17/2008 01:09:07
1
1
Java Code Signing Certificates...same as SSL Certificate?
I'm looking around for a Java Code Signing certificate so my Java applets don't throw up such scary security warnings. However all the places I've found offering them charge (in my opinion) way too much, like over $200 per year. While doing research, a code signing certificate seems almost exactly the same as a SSL certificate. The main question I have: is it possible to buy a SSL certificate, but use it to sign Java applets?
java
ssl
certificate
code-signing
null
null
open
Java Code Signing Certificates...same as SSL Certificate? === I'm looking around for a Java Code Signing certificate so my Java applets don't throw up such scary security warnings. However all the places I've found offering them charge (in my opinion) way too much, like over $200 per year. While doing research, a code signing certificate seems almost exactly the same as a SSL certificate. The main question I have: is it possible to buy a SSL certificate, but use it to sign Java applets?
0
78,874
09/17/2008 01:16:10
13,676
09/16/2008 20:29:25
10
3
how to embed a true type font within a postscript file
I have a cross platform app and for my Linux and Mac versions it generates a postscript file for printing reports and then prints them with CUPS. It works for simple characters and images but I would like to have the ability to embed a true type font directly into the postscript file. Does anyone know how to do this?? Also I can encode simple ascii characters but I'm not sure how to encode any characters beyond the usual a-z 0-9, things like foreign characters with accents.
fonts
true
types
cups
postscript
null
open
how to embed a true type font within a postscript file === I have a cross platform app and for my Linux and Mac versions it generates a postscript file for printing reports and then prints them with CUPS. It works for simple characters and images but I would like to have the ability to embed a true type font directly into the postscript file. Does anyone know how to do this?? Also I can encode simple ascii characters but I'm not sure how to encode any characters beyond the usual a-z 0-9, things like foreign characters with accents.
0
78,884
09/17/2008 01:18:24
5,989
09/11/2008 21:22:11
176
7
How do I format text in between xsl:text tags?
I have an xslt sheet with some text similar to below: <code> &lt;xsl:text&gt;I am some text, and I want to be bold&lt;xsl:text&gt; </code> I would like some text to be bold, but this doesn't work. <code> &lt;xsl:text&gt;I am some text, and I want to be &lt;strong&gt;bold&lt;strong&gt; &lt;/xsl:text&gt; </code> The deprecated b tag doesn't work either. How do I format text within an xsl:text tag?
xslt
formatting
null
null
null
null
open
How do I format text in between xsl:text tags? === I have an xslt sheet with some text similar to below: <code> &lt;xsl:text&gt;I am some text, and I want to be bold&lt;xsl:text&gt; </code> I would like some text to be bold, but this doesn't work. <code> &lt;xsl:text&gt;I am some text, and I want to be &lt;strong&gt;bold&lt;strong&gt; &lt;/xsl:text&gt; </code> The deprecated b tag doesn't work either. How do I format text within an xsl:text tag?
0
78,900
09/17/2008 01:22:56
11,886
09/16/2008 12:03:35
16
3
How to check for memory leaks in Guile extension modules?
I develop an extension module for Guile, written in C. Since this extension module invokes the Python interpreter, I need to verify that it properly manages the memory occupied by Python objects.
guile
memory-leaks
extension
python
valgrind
null
open
How to check for memory leaks in Guile extension modules? === I develop an extension module for Guile, written in C. Since this extension module invokes the Python interpreter, I need to verify that it properly manages the memory occupied by Python objects.
0
78,905
09/17/2008 01:23:40
131
08/02/2008 08:58:50
153
5
How do I make a component in Joomla display as an article?
More specifically I am trying to make the mailto component show within my template; the same way as an article does. By default the mailto component opens in a new window. So far I changed the code so it opens on the same window, but that way the whole template is gone. Any suggestions?
joomla
article
components
mailto
null
null
open
How do I make a component in Joomla display as an article? === More specifically I am trying to make the mailto component show within my template; the same way as an article does. By default the mailto component opens in a new window. So far I changed the code so it opens on the same window, but that way the whole template is gone. Any suggestions?
0
78,909
09/17/2008 01:24:17
14,563
09/17/2008 01:04:52
31
3
JScript debugging
I have a few scripts on a site I recently started maintaining. I get those Object Not Found errors in IE6 (which Firefox fails to report in its Error Console?). What's the best way to debug these- any good cross-browser-compatible IDEs, or javascript debugging libraries of some sort?
javascript
null
null
null
null
null
open
JScript debugging === I have a few scripts on a site I recently started maintaining. I get those Object Not Found errors in IE6 (which Firefox fails to report in its Error Console?). What's the best way to debug these- any good cross-browser-compatible IDEs, or javascript debugging libraries of some sort?
0
78,913
09/17/2008 01:25:10
3,836
08/31/2008 08:07:03
484
18
Single most effective practice to prevent arithmetic overflow and underflow
What is the single most effective practice to prevent [arithmetic overflow][1] and [underflow][2]? Some examples that come to mind are: * testing based on valid input ranges * validation using formal methods * use of invariants * detection at runtime using language features or libraries (this does not prevent it) [1]: http://en.wikipedia.org/wiki/Arithmetic_overflow [2]: http://en.wikipedia.org/wiki/Arithmetic_underflow
language-agnostic
numbers
null
null
null
null
open
Single most effective practice to prevent arithmetic overflow and underflow === What is the single most effective practice to prevent [arithmetic overflow][1] and [underflow][2]? Some examples that come to mind are: * testing based on valid input ranges * validation using formal methods * use of invariants * detection at runtime using language features or libraries (this does not prevent it) [1]: http://en.wikipedia.org/wiki/Arithmetic_overflow [2]: http://en.wikipedia.org/wiki/Arithmetic_underflow
0
78,932
09/17/2008 01:28:04
6,340
09/14/2008 11:20:26
21
2
How do I programatically set the value of an select box element using javascript?
I have the following HTML select element: <select id="leaveCode" name="leaveCode"> <option value="10">Annual Leave</option> <option value="11">Medical Leave</option> <option value="14">Long Service</option> <option value="17">Leave Without Pay</option> </select> Using a javascript function with the leave code number as a parameter, how do I select the appropriate option in the list?
javascript
html
dom
null
null
null
open
How do I programatically set the value of an select box element using javascript? === I have the following HTML select element: <select id="leaveCode" name="leaveCode"> <option value="10">Annual Leave</option> <option value="11">Medical Leave</option> <option value="14">Long Service</option> <option value="17">Leave Without Pay</option> </select> Using a javascript function with the leave code number as a parameter, how do I select the appropriate option in the list?
0
78,952
09/17/2008 01:32:49
747
08/08/2008 14:15:00
30
3
Oracle ASP.net Provider-model objects performance
Oracle 11g version of ODP.Net introduces the provider model objects (session state provider, identity provider etc) which lets the application to store these information in an oracle DB without writing custom provider implementation. Has anyone has done any performance benchmarking on these objects? how do they compare in performance to the sql server implementations provided with .net? I am particularly interested in the performance of the sessionstate provider.
asp.net
oracle
provider
11g
null
null
open
Oracle ASP.net Provider-model objects performance === Oracle 11g version of ODP.Net introduces the provider model objects (session state provider, identity provider etc) which lets the application to store these information in an oracle DB without writing custom provider implementation. Has anyone has done any performance benchmarking on these objects? how do they compare in performance to the sql server implementations provided with .net? I am particularly interested in the performance of the sessionstate provider.
0
78,974
09/17/2008 01:35:20
2,975
08/26/2008 09:40:04
1,206
51
How to set the output cache directive on user controls with no code in front
I've written a control that inherits from the `System.Web.UI.WebControls.DropDownList` and so I don't have any code in front for this control, but I still want to set the OutputCache directive. I there any way to set this in the C# code, say with an attribute or something like that?
c#
asp.net
caching
outputcache
null
null
open
How to set the output cache directive on user controls with no code in front === I've written a control that inherits from the `System.Web.UI.WebControls.DropDownList` and so I don't have any code in front for this control, but I still want to set the OutputCache directive. I there any way to set this in the C# code, say with an attribute or something like that?
0
78,978
09/17/2008 01:35:40
27,870
09/15/2008 12:11:54
8
4
Regex for Specific Tag
Greetings! I'm working on a regular expression to get a specific tag. I would like to match the entire DIV tag and its contents: <html> <head><title>Test</title></head> <body> <p>This is a paragraph - nothing special here.</p> <div id="super_special"> <p>Anything could go in here...doesn't matter. Let's get it all</p> </div> </body> </html> I want to match this: <div id="super_special"> <p>Anything could go in here...doesn't matter. Let's get it all</p> </div> I thought . was supposed to get all characters, but it seems to having trouble with the cariage returns. What is my regex missing? (<div id="super_special">.*?</div>) Thanks.
regularexpression
null
null
null
null
null
open
Regex for Specific Tag === Greetings! I'm working on a regular expression to get a specific tag. I would like to match the entire DIV tag and its contents: <html> <head><title>Test</title></head> <body> <p>This is a paragraph - nothing special here.</p> <div id="super_special"> <p>Anything could go in here...doesn't matter. Let's get it all</p> </div> </body> </html> I want to match this: <div id="super_special"> <p>Anything could go in here...doesn't matter. Let's get it all</p> </div> I thought . was supposed to get all characters, but it seems to having trouble with the cariage returns. What is my regex missing? (<div id="super_special">.*?</div>) Thanks.
0
78,983
09/17/2008 01:37:05
13,753
09/16/2008 20:45:25
1
4
What are the best practices for moving between version control systems?
There are about 200 projects in cvs and at least 100 projects in vss. Some are inactive code in maintenance mode. Some are legacy apps. Some are old apps no longer in use. About 10% are in active development. The plan is to move everything to perforce my end of year 2009. Has anyone done a large migration like this? Has anyone come across best practices for moving from cvs to perforce? Or a similar migration. Any gotchas to look out for?
cvs
perforce
version-control
null
null
null
open
What are the best practices for moving between version control systems? === There are about 200 projects in cvs and at least 100 projects in vss. Some are inactive code in maintenance mode. Some are legacy apps. Some are old apps no longer in use. About 10% are in active development. The plan is to move everything to perforce my end of year 2009. Has anyone done a large migration like this? Has anyone come across best practices for moving from cvs to perforce? Or a similar migration. Any gotchas to look out for?
0
78,984
09/17/2008 01:37:09
11,523
09/16/2008 08:52:30
1
0
Database Authentication for Intranet Applications
I am looking for a best practice for End to End Authentication for internal Web Applications to the Database layer. The most common scenario I have seen is to use a single sql account with the permissions set to what is required by the application. This account is used by all application calls. Then when people require access over the database via query tools or such a seperate Group is created with the query access and people are given access to that group. The other scenario I have seen is to use complete Windows Authentication End to End. So the users themselves are added to groups which have all the permissions set so the user is able to update and change outside the parameters of the application. This normally involves securing people down to the appropiate stored procedures so they aren't updating the tables directly. The first scenario seems relatively easily to maintain but raises concerns if there is a security hole in the application then the whole database is compromised. The second scenario seems more secure but has the opposite concern of having to much business logic in stored procedures on the database. This seems to limit the use of the some really cool technologies like Nhibernate and LINQ. However in this day and age where people can use data in so many different ways we don't forsee e.g. mashups etc is this the best approach.
asp.net
sql
nhibernate
null
null
null
open
Database Authentication for Intranet Applications === I am looking for a best practice for End to End Authentication for internal Web Applications to the Database layer. The most common scenario I have seen is to use a single sql account with the permissions set to what is required by the application. This account is used by all application calls. Then when people require access over the database via query tools or such a seperate Group is created with the query access and people are given access to that group. The other scenario I have seen is to use complete Windows Authentication End to End. So the users themselves are added to groups which have all the permissions set so the user is able to update and change outside the parameters of the application. This normally involves securing people down to the appropiate stored procedures so they aren't updating the tables directly. The first scenario seems relatively easily to maintain but raises concerns if there is a security hole in the application then the whole database is compromised. The second scenario seems more secure but has the opposite concern of having to much business logic in stored procedures on the database. This seems to limit the use of the some really cool technologies like Nhibernate and LINQ. However in this day and age where people can use data in so many different ways we don't forsee e.g. mashups etc is this the best approach.
0
78,991
09/17/2008 01:38:24
14,468
09/17/2008 00:13:33
1
0
Why is Github more popular than Gitorious?
[Gitorious][1] has been around longer and the two sites seem to cover the same ground, yet a quick [Google Fight][2] shows [Github][3] almost two orders of magnitude higher. Is there a larger distinction that I'm not aware of? [1]: http://gitorious.org/ [2]: http://www.googlefight.com/index.php?lang=en_GB&word1=github&word2=gitorious [3]: http://github.com/
git
github
gitorious
null
null
02/09/2011 10:37:52
not constructive
Why is Github more popular than Gitorious? === [Gitorious][1] has been around longer and the two sites seem to cover the same ground, yet a quick [Google Fight][2] shows [Github][3] almost two orders of magnitude higher. Is there a larger distinction that I'm not aware of? [1]: http://gitorious.org/ [2]: http://www.googlefight.com/index.php?lang=en_GB&word1=github&word2=gitorious [3]: http://github.com/
4
79,002
09/17/2008 01:39:30
8,020
09/15/2008 14:56:06
76
6
What Java versions does Griffon support?
I want to write a Swing application in Griffon but I am not sure what versions of Java I can support.
swing
groovy
griffon
null
null
null
open
What Java versions does Griffon support? === I want to write a Swing application in Griffon but I am not sure what versions of Java I can support.
0
79,023
09/17/2008 01:42:57
14,266
09/16/2008 22:50:30
36
2
C++ gdb GUI
Briefly: Does anyone know of a GUI for gdb that brings it on par or close to the feature set you get in the more recent version of Visual C++? In detail: As someone who has spent a lot of time programming in Windows, one of the larger stumbling blocks I've found whenever I have to code C++ in Linux is that debugging anything using commandline gdb takes me several times longer than it does in Visual Studio, and it does not seem to be getting better with practice. Some things are just easier or faster to express graphically. Specifically, I'm looking for a GUI that: - Handles all the basics like stepping over & into code, watch variables and breakpoints - Understands and can display the contents of complex & nested C++ data types - Doesn't get confused by and preferably can intelligently step through templated code and data structures while displaying relevant information such as the parameter types - Can handle threaded applications and switch between different threads to step through or view the state of - Can handle attaching to an already-started process or reading a core dump, in addition to starting the program up in gdb If such a program does not exist, then I'd like to hear about experiences people have had with programs that meet at least some of the bullet points. Does anyone have any recommendations?
gdb
c++
linux
debugging
null
null
open
C++ gdb GUI === Briefly: Does anyone know of a GUI for gdb that brings it on par or close to the feature set you get in the more recent version of Visual C++? In detail: As someone who has spent a lot of time programming in Windows, one of the larger stumbling blocks I've found whenever I have to code C++ in Linux is that debugging anything using commandline gdb takes me several times longer than it does in Visual Studio, and it does not seem to be getting better with practice. Some things are just easier or faster to express graphically. Specifically, I'm looking for a GUI that: - Handles all the basics like stepping over & into code, watch variables and breakpoints - Understands and can display the contents of complex & nested C++ data types - Doesn't get confused by and preferably can intelligently step through templated code and data structures while displaying relevant information such as the parameter types - Can handle threaded applications and switch between different threads to step through or view the state of - Can handle attaching to an already-started process or reading a core dump, in addition to starting the program up in gdb If such a program does not exist, then I'd like to hear about experiences people have had with programs that meet at least some of the bullet points. Does anyone have any recommendations?
0
79,064
09/17/2008 01:48:04
13,116
09/16/2008 17:09:07
1
0
Cryprography algorithm.
Im making a simple licensing system for my apps.<br> I don't know about cryptography, but i know that i need a algorithm that consists in 2 keys.<br> A private key and a public key.<br> I need to encrypt some data (expiration date and customer email) using my private key, and then my app will decrypt the data using the public key to compare expiration date.<br> Anyone knows if there is a known algorithm that does what i need?<br> Sorry about my english.
cryptography
licensing
public
private
key
null
open
Cryprography algorithm. === Im making a simple licensing system for my apps.<br> I don't know about cryptography, but i know that i need a algorithm that consists in 2 keys.<br> A private key and a public key.<br> I need to encrypt some data (expiration date and customer email) using my private key, and then my app will decrypt the data using the public key to compare expiration date.<br> Anyone knows if there is a known algorithm that does what i need?<br> Sorry about my english.
0
79,093
09/17/2008 01:52:49
3,137
08/26/2008 23:31:53
112
18
Frameworks simplify coding as the cost of speed and obfuscation of the OS. With the passing of Moore's law do you thing that there might be a shift away from Frameworks?
Frameworks simplify coding as the cost of speed and obfuscation of the OS. With the passing of Moore's law do you thing that there might be a shift away from Frameworks? I suspect that one of the reasons for Vista not being an outstanding success was that it ran much slower than XP, and, because computers had not improved as greatly in speed as in the past, this change seemed like a step backwards. For years CPU speed outstripped the speed of software so new frameworks that adding layers of OS obfuscation and bloat did little harm. Just imagine how fast Windows 95 would run on todays hardware (given a few memory tweaks). Win2K then WinXP were great improvements, and we could live with them being slower because of faster computers. However, even years ago, I noticed that programs written say in MS foundation classes didn't seem quite as crisp as code doing the same thing written directly to the API. Since the proliferation of these frameworks like .Net and others can only have made this situation worse, is it possible that we might discover that being above to write code in 'C' directly to the Win32 API (or the equivalent in other OS's) will become a strong competitive advantage, even if it does take longer to write? Or will the trade off in longer development time just not ever be worth it?
c
winapi
.net
future
null
null
open
Frameworks simplify coding as the cost of speed and obfuscation of the OS. With the passing of Moore's law do you thing that there might be a shift away from Frameworks? === Frameworks simplify coding as the cost of speed and obfuscation of the OS. With the passing of Moore's law do you thing that there might be a shift away from Frameworks? I suspect that one of the reasons for Vista not being an outstanding success was that it ran much slower than XP, and, because computers had not improved as greatly in speed as in the past, this change seemed like a step backwards. For years CPU speed outstripped the speed of software so new frameworks that adding layers of OS obfuscation and bloat did little harm. Just imagine how fast Windows 95 would run on todays hardware (given a few memory tweaks). Win2K then WinXP were great improvements, and we could live with them being slower because of faster computers. However, even years ago, I noticed that programs written say in MS foundation classes didn't seem quite as crisp as code doing the same thing written directly to the API. Since the proliferation of these frameworks like .Net and others can only have made this situation worse, is it possible that we might discover that being above to write code in 'C' directly to the Win32 API (or the equivalent in other OS's) will become a strong competitive advantage, even if it does take longer to write? Or will the trade off in longer development time just not ever be worth it?
0
79,111
09/17/2008 01:54:52
14,656
09/17/2008 01:47:59
1
0
.NET (C#): Getting child windows when you only have a process handle or PID?
Kind of a special case problem: - I start a process with System.Diagnostics.Process.Start(..) - The process opens a splash screen -- this splash screen becomes the main window. - The splash screen closes and the 'real' UI is shown. The main window (splash screen) is now invalid. - I still have the Process object, and I can query its handle, module, etc. But the main window handle is now invalid. I need to get the process's UI (or UI handle) at this point. Assume I cannot change the behavior of the process to make this any easier (or saner). I have looked around online but I'll admit I didn't look for more than an hour. Seemed like it should be somewhat trivial :-( Thanks
c#
.net
windows
gui
null
null
open
.NET (C#): Getting child windows when you only have a process handle or PID? === Kind of a special case problem: - I start a process with System.Diagnostics.Process.Start(..) - The process opens a splash screen -- this splash screen becomes the main window. - The splash screen closes and the 'real' UI is shown. The main window (splash screen) is now invalid. - I still have the Process object, and I can query its handle, module, etc. But the main window handle is now invalid. I need to get the process's UI (or UI handle) at this point. Assume I cannot change the behavior of the process to make this any easier (or saner). I have looked around online but I'll admit I didn't look for more than an hour. Seemed like it should be somewhat trivial :-( Thanks
0
79,121
09/17/2008 01:55:53
14,621
09/17/2008 01:33:32
1
1
CUDA global (as in C) dynamic arrays allocated to device memory
So, im trying to write some code that utilizes Nvidia's CUDA architecture. I noticed that copying to and from the device was really hurting my overall performance, so now I am trying to move a large amount of data onto the device. As this data is used in numerous functions, I would like it to be global. Yes, I can pass pointers around, but I would really like to know how to work with globals in this instance. So, I have device functions that want to access a device allocated array. Ideally, I could do something like: __device__ float* global_data; main() { cudaMalloc(global_data); kernel1<<<blah>>>(blah); //access global data kernel2<<<blah>>>(blah); //access global data again } However, I havent figured out how to create a dynamic array. I figured out a work around by declaring the array as follows: __device__ float global_data[REALLY_LARGE_NUMBER]; And while that doesn't require a cudaMalloc call, I would prefer the dynamic allocation approach.
cuda
nvidia
null
null
null
null
open
CUDA global (as in C) dynamic arrays allocated to device memory === So, im trying to write some code that utilizes Nvidia's CUDA architecture. I noticed that copying to and from the device was really hurting my overall performance, so now I am trying to move a large amount of data onto the device. As this data is used in numerous functions, I would like it to be global. Yes, I can pass pointers around, but I would really like to know how to work with globals in this instance. So, I have device functions that want to access a device allocated array. Ideally, I could do something like: __device__ float* global_data; main() { cudaMalloc(global_data); kernel1<<<blah>>>(blah); //access global data kernel2<<<blah>>>(blah); //access global data again } However, I havent figured out how to create a dynamic array. I figured out a work around by declaring the array as follows: __device__ float global_data[REALLY_LARGE_NUMBER]; And while that doesn't require a cudaMalloc call, I would prefer the dynamic allocation approach.
0
79,126
09/17/2008 01:56:19
5,302
09/08/2008 22:49:47
193
16
Create Generic method constraining T to an Enum
I'm building a function to extend the Enum.Parse concept that - allows a default value to be parsed in case that an Enum value is not found - Is case insensitive So I wrote the following public static T GetEnumFromString<T>(string value, T defaultValue) where T : Enum { if (string.IsNullOrEmpty(value)) return defaultValue; foreach (T item in Enum.GetValues(typeof(T))) { if (item.ToString().ToLower().Equals(value.Trim().ToLower())) return item; } return defaultValue; } I am getting a Error Constraint cannot be special class 'System.Enum' Fair enough, but is there a workaround to allow a Generic Enum, or am I going to have to mimic the Parse function and pass a type as an attribute, which forces the ugly boxing requirement to your code.
c#
generics
enums
null
null
null
open
Create Generic method constraining T to an Enum === I'm building a function to extend the Enum.Parse concept that - allows a default value to be parsed in case that an Enum value is not found - Is case insensitive So I wrote the following public static T GetEnumFromString<T>(string value, T defaultValue) where T : Enum { if (string.IsNullOrEmpty(value)) return defaultValue; foreach (T item in Enum.GetValues(typeof(T))) { if (item.ToString().ToLower().Equals(value.Trim().ToLower())) return item; } return defaultValue; } I am getting a Error Constraint cannot be special class 'System.Enum' Fair enough, but is there a workaround to allow a Generic Enum, or am I going to have to mimic the Parse function and pass a type as an attribute, which forces the ugly boxing requirement to your code.
0
79,129
09/17/2008 01:56:37
10,792
09/16/2008 01:56:15
69
5
Implementing Profile Provider in ASP.NET MVC
For the life of me, I cannot get the SqlProfileProvider to work in an MVC project that I'm working on. The first interesting thing that I realized is that Visual Studio does not automatically generate the ProfileCommon proxy class for you. That's not a big deal since it's simpy a matter of extending the ProfileBase class. After creating a ProfileCommon class, I wrote the following Action method for creating the user profile. <pre><code>[AcceptVerbs("POST")] public ActionResult CreateProfile(string company, string phone, string fax, string city, string state, string zip) { MembershipUser user = Membership.GetUser(); ProfileCommon profile = (ProfileCommon)ProfileCommon.Create(user.UserName, user.IsApproved) as ProfileCommon; profile.Company = company; profile.Phone = phone; profile.Fax = fax; profile.City = city; profile.State = state; profile.Zip = zip; profile.Save(); return RedirectToAction("Index", "Account"); }</code></pre> The problem that I'm having is that the call to ProfileCommon.Create() cannot cast to type ProfileCommon, so I'm not able to get back my profile object, which obviously causes the next line to fail since profile is null. Following is a snippet of my web.config: <pre><code>&lt;profile defaultProvider="AspNetSqlProfileProvider" automaticSaveEnabled="false" enabled="true"&gt; &lt;providers&gt; &lt;clear/&gt; &lt;add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ApplicationServices" applicationName="/" /&gt; &lt;/providers&gt; &lt;properties&gt; &lt;add name="FirstName" type="string" /&gt; &lt;add name="LastName" type="string" /&gt; &lt;add name="Company" type="string" /&gt; &lt;add name="Phone" type="string" /&gt; &lt;add name="Fax" type="string" /&gt; &lt;add name="City" type="string" /&gt; &lt;add name="State" type="string" /&gt; &lt;add name="Zip" type="string" /&gt; &lt;add name="Email" type="string" &gt; &lt;/properties&gt; &lt;/profile&gt;</pre></code> The MembershipProvider is working without a hitch, so I know that the connection string is good. Any thoughts on what I might be doing wrong? Thank you in advance...
asp.net-mvc
profile
provider
null
null
null
open
Implementing Profile Provider in ASP.NET MVC === For the life of me, I cannot get the SqlProfileProvider to work in an MVC project that I'm working on. The first interesting thing that I realized is that Visual Studio does not automatically generate the ProfileCommon proxy class for you. That's not a big deal since it's simpy a matter of extending the ProfileBase class. After creating a ProfileCommon class, I wrote the following Action method for creating the user profile. <pre><code>[AcceptVerbs("POST")] public ActionResult CreateProfile(string company, string phone, string fax, string city, string state, string zip) { MembershipUser user = Membership.GetUser(); ProfileCommon profile = (ProfileCommon)ProfileCommon.Create(user.UserName, user.IsApproved) as ProfileCommon; profile.Company = company; profile.Phone = phone; profile.Fax = fax; profile.City = city; profile.State = state; profile.Zip = zip; profile.Save(); return RedirectToAction("Index", "Account"); }</code></pre> The problem that I'm having is that the call to ProfileCommon.Create() cannot cast to type ProfileCommon, so I'm not able to get back my profile object, which obviously causes the next line to fail since profile is null. Following is a snippet of my web.config: <pre><code>&lt;profile defaultProvider="AspNetSqlProfileProvider" automaticSaveEnabled="false" enabled="true"&gt; &lt;providers&gt; &lt;clear/&gt; &lt;add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ApplicationServices" applicationName="/" /&gt; &lt;/providers&gt; &lt;properties&gt; &lt;add name="FirstName" type="string" /&gt; &lt;add name="LastName" type="string" /&gt; &lt;add name="Company" type="string" /&gt; &lt;add name="Phone" type="string" /&gt; &lt;add name="Fax" type="string" /&gt; &lt;add name="City" type="string" /&gt; &lt;add name="State" type="string" /&gt; &lt;add name="Zip" type="string" /&gt; &lt;add name="Email" type="string" &gt; &lt;/properties&gt; &lt;/profile&gt;</pre></code> The MembershipProvider is working without a hitch, so I know that the connection string is good. Any thoughts on what I might be doing wrong? Thank you in advance...
0
79,133
09/17/2008 01:57:15
4,676
09/05/2008 05:25:58
11
2
What is the best way to log out another user from their session on Mac OS X Leopard?
In other words: 1. Log on as Bert (who is an administrator) 2. Using fast user switching, log on as Ernie (Bert remains logged on) 3. Switch back to Bert 4. Bert logs Ernie off What is the best way to achieve step 4?
osx
sysadmin
osx-leopard
null
null
null
open
What is the best way to log out another user from their session on Mac OS X Leopard? === In other words: 1. Log on as Bert (who is an administrator) 2. Using fast user switching, log on as Ernie (Bert remains logged on) 3. Switch back to Bert 4. Bert logs Ernie off What is the best way to achieve step 4?
0
79,136
09/17/2008 01:57:53
10,472
09/15/2008 23:22:18
8
0
How do I create a container file?
I would like to create a file format for my app like Quake, OO, and MS Office 07 have. Basically a uncompressed zip folder, or tar file. I need this to be cross platform (mac and windows). Can I do something via command prompt and bash?
windows
osx
null
null
null
null
open
How do I create a container file? === I would like to create a file format for my app like Quake, OO, and MS Office 07 have. Basically a uncompressed zip folder, or tar file. I need this to be cross platform (mac and windows). Can I do something via command prompt and bash?
0
79,165
09/17/2008 02:04:20
14,690
09/17/2008 02:04:20
1
0
How to migrate SVN with history to a new Git repository?
I read git manual, FAQ, Git - SVN crash course, etc. and they all explain this and that, but nowhere can you find a simple instruction like: SVN repository in: svn://myserver/path/to/svn/repos Git repository in: git://myserver/path/to/git/repos git-do-the-magic-svn-import-with-history svn://myserver/path/to/svn/repos git://myserver/path/to/git/repos I don't expect it to be that simple, and I don't expect it to be a single command. But I do expect it not to try to explain anything - just to say what steps to take given this example.
git
svn
version-control
null
null
null
open
How to migrate SVN with history to a new Git repository? === I read git manual, FAQ, Git - SVN crash course, etc. and they all explain this and that, but nowhere can you find a simple instruction like: SVN repository in: svn://myserver/path/to/svn/repos Git repository in: git://myserver/path/to/git/repos git-do-the-magic-svn-import-with-history svn://myserver/path/to/svn/repos git://myserver/path/to/git/repos I don't expect it to be that simple, and I don't expect it to be a single command. But I do expect it not to try to explain anything - just to say what steps to take given this example.
0
79,197
09/17/2008 02:13:22
1,133
08/12/2008 17:34:48
199
14
Combining two SyndicationFeeds
What's a simple way to combine **feed** and **feed2**? I want the items from **feed2** to be added to **feed**. Also I want to avoid duplicates as **feed** might already have items when a question is tagged with both WPF and Silverlight. Uri feedUri = new Uri("http://stackoverflow.com/feeds/tag/silverlight"); XmlReader reader = XmlReader.Create(feedUri.AbsoluteUri); SyndicationFeed feed = SyndicationFeed.Load(reader); Uri feed2Uri = new Uri("http://stackoverflow.com/feeds/tag/wpf"); XmlReader reader2 = XmlReader.Create(feed2Uri.AbsoluteUri); SyndicationFeed feed2 = SyndicationFeed.Load(reader2);
c#
.net-3.5
null
null
null
null
open
Combining two SyndicationFeeds === What's a simple way to combine **feed** and **feed2**? I want the items from **feed2** to be added to **feed**. Also I want to avoid duplicates as **feed** might already have items when a question is tagged with both WPF and Silverlight. Uri feedUri = new Uri("http://stackoverflow.com/feeds/tag/silverlight"); XmlReader reader = XmlReader.Create(feedUri.AbsoluteUri); SyndicationFeed feed = SyndicationFeed.Load(reader); Uri feed2Uri = new Uri("http://stackoverflow.com/feeds/tag/wpf"); XmlReader reader2 = XmlReader.Create(feed2Uri.AbsoluteUri); SyndicationFeed feed2 = SyndicationFeed.Load(reader2);
0
79,210
09/17/2008 02:17:08
14,717
09/17/2008 02:17:08
1
0
Best C++ IDE for *nix
What is the best C++ IDE for a *nix envirnoment? I have heard the C/C++ module of Eclipse is decent as well as Notepad++ but beyond these two I have no real idea. Any thoughts or comments?
c++
ide
null
null
null
09/15/2011 07:18:02
not constructive
Best C++ IDE for *nix === What is the best C++ IDE for a *nix envirnoment? I have heard the C/C++ module of Eclipse is decent as well as Notepad++ but beyond these two I have no real idea. Any thoughts or comments?
4
79,215
09/17/2008 02:18:06
10,941
09/16/2008 03:09:46
1
0
How do you reference .js files located within the View folders from a Page using Asp.net MVC
For example, if I have a page located in Views/Home/Index.aspx and a javascript file located in Views/Home/Index.js, how do you reference this on the aspx page? The example below doesn't work even though the compiler says the path is correct <script src="Index.js" type="text/javascript"></script> The exact same issue has been posted here in more detail: http://forums.asp.net/p/1319380/2619991.aspx If this is not currently possible, will it be in the future? If not, how is everyone managing their javascript resources for large Asp.net MVC projects? Do you just create a folder structure in the Content folder that mirrors your View folder structure? YUCK!
c#
asp.net
javascript
mvc
null
null
open
How do you reference .js files located within the View folders from a Page using Asp.net MVC === For example, if I have a page located in Views/Home/Index.aspx and a javascript file located in Views/Home/Index.js, how do you reference this on the aspx page? The example below doesn't work even though the compiler says the path is correct <script src="Index.js" type="text/javascript"></script> The exact same issue has been posted here in more detail: http://forums.asp.net/p/1319380/2619991.aspx If this is not currently possible, will it be in the future? If not, how is everyone managing their javascript resources for large Asp.net MVC projects? Do you just create a folder structure in the Content folder that mirrors your View folder structure? YUCK!
0
79,231
09/17/2008 02:21:11
2,147
08/20/2008 15:14:13
1,499
85
Why don't they teach these things in school?
Over the summer, I was fortunate enough to get into Google Summer of Code. I learned a lot (probably more than I've learned in the sum of all my university coursework). I'm really wondering why they don't teach a few of the things I learned sooner in school though. To name a few: - unit testing - version control - agile development It seems to me that they spend a significant amount of time teaching other things like data structures and algorithms up front. While I still think those are very important to learn early on, why don't they teach more of these three before them? Or is it just my school that doesn't teach much of this stuff? Don't get me wrong, I don't think it's desirable for universities to always teach the trendiest programming fads, but shouldn't my professors be teaching me something other than "draw a diagram before you start coding?"
unit-testing
version-control
agile
university
null
null
open
Why don't they teach these things in school? === Over the summer, I was fortunate enough to get into Google Summer of Code. I learned a lot (probably more than I've learned in the sum of all my university coursework). I'm really wondering why they don't teach a few of the things I learned sooner in school though. To name a few: - unit testing - version control - agile development It seems to me that they spend a significant amount of time teaching other things like data structures and algorithms up front. While I still think those are very important to learn early on, why don't they teach more of these three before them? Or is it just my school that doesn't teach much of this stuff? Don't get me wrong, I don't think it's desirable for universities to always teach the trendiest programming fads, but shouldn't my professors be teaching me something other than "draw a diagram before you start coding?"
0
79,241
09/17/2008 02:22:41
290
08/04/2008 12:57:50
1,036
57
How do you know what a good index is?
When working with tables in Oracle, how do you know when you are setting up a good index versus a bad index?
oracle
database
indexes
null
null
null
open
How do you know what a good index is? === When working with tables in Oracle, how do you know when you are setting up a good index versus a bad index?
0
79,244
09/17/2008 02:22:54
14,385
09/16/2008 23:37:43
1
0
How to enforce all children to override the parent's Clone() method?
How to make sure that all derived C++/CLI classes will override the Clone() method of the base class? Do you think I should worry about this? Or this is not a responsibility of the base class' writer?
c++-cli
.net
null
null
null
null
open
How to enforce all children to override the parent's Clone() method? === How to make sure that all derived C++/CLI classes will override the Clone() method of the base class? Do you think I should worry about this? Or this is not a responsibility of the base class' writer?
0
79,248
09/17/2008 02:23:47
10,703
09/16/2008 01:08:24
225
11
What is a multitasking operating system?
What are the characteristics of a multitasking operating system? What makes it multitasking? Are there non-multitasking operating systems?
operating-system
computer-science
null
null
null
07/09/2012 02:18:24
not constructive
What is a multitasking operating system? === What are the characteristics of a multitasking operating system? What makes it multitasking? Are there non-multitasking operating systems?
4
79,258
09/17/2008 02:25:08
4,640
09/04/2008 23:18:56
13
0
Find style references that don't exist
Is there a tool that will find for me all the css classes that I am referencing in my HTML that don't actually exist? ie. if I have &lt;ul class="topnav" /&gt; in my HTML and the topnav class doesn't exist in any of the referenced CSS files.
css
null
null
null
null
null
open
Find style references that don't exist === Is there a tool that will find for me all the css classes that I am referencing in my HTML that don't actually exist? ie. if I have &lt;ul class="topnav" /&gt; in my HTML and the topnav class doesn't exist in any of the referenced CSS files.
0
79,264
09/17/2008 02:26:09
2,581
08/23/2008 04:37:51
181
10
API for interacting with Windows Vista Complete PC Backup?
Is there a program or API I can code against to extract individual files from a Windows Vista Complete PC Backup image? I like the idea of having a complete image to restore from, but hate the idea that I have to make two backups, one for restoring individual files, and one for restoring my computer in the event of a catastrophic failure.
windows
windows-vista
api
backup
null
null
open
API for interacting with Windows Vista Complete PC Backup? === Is there a program or API I can code against to extract individual files from a Windows Vista Complete PC Backup image? I like the idea of having a complete image to restore from, but hate the idea that I have to make two backups, one for restoring individual files, and one for restoring my computer in the event of a catastrophic failure.
0
79,266
09/17/2008 02:26:18
290
08/04/2008 12:57:50
1,036
57
How do you interpret a query's explain plan?
When attempting to understand how a SQL statement is executing, it is sometimes recommended to look at the explain plan. What is the process one should go through in interpreting (making sense) of an explain plan? What should stand out as, "Oh, this is working splendidly?" versus "Oh no, that's not right."
sql
database
oracle
explain-plan
null
null
open
How do you interpret a query's explain plan? === When attempting to understand how a SQL statement is executing, it is sometimes recommended to look at the explain plan. What is the process one should go through in interpreting (making sense) of an explain plan? What should stand out as, "Oh, this is working splendidly?" versus "Oh no, that's not right."
0
79,275
09/17/2008 02:27:20
14,690
09/17/2008 02:04:20
3
1
How to skip fields using javascript?
I have a form like this: &lt;form name="mine"&gt;<br> &lt;input type=text name=one&gt;<br> &lt;input type=text name=two&gt;<br> &lt;input type=text name=three&gt;<br> &lt;/form&gt; When user types a value in 'one', I sometimes want to skip the field 'two', depending on what he typed. For example, if user types '123' and uses Tab to move to next field, I want to skip it and go to field three. I tried to use OnBlur and OnEnter, without success. Try 1: &lt;form name="mine"&gt;<br> &lt;input type=text name=one onBlur="if (document.mine.one.value='123') document.three.focus();&gt;<br> &lt;input type=text name=two&gt;<br> &lt;input type=text name=three&gt;<br> &lt;/form&gt; Try 2: &lt;form name="mine"&gt;<br> &lt;input type=text name=one&gt;<br> &lt;input type=text name=two onEnter="if (document.mine.one.value='123') document.three.focus();&gt;<br> &lt;input type=text name=three&gt;<br> &lt;/form&gt; but none of these works. Looks like the browser doesn't allow you to mess with focus while the focus is changing. BTW, all this tried with Firefox on Linux.
javascript
firefox
focus
skip
null
null
open
How to skip fields using javascript? === I have a form like this: &lt;form name="mine"&gt;<br> &lt;input type=text name=one&gt;<br> &lt;input type=text name=two&gt;<br> &lt;input type=text name=three&gt;<br> &lt;/form&gt; When user types a value in 'one', I sometimes want to skip the field 'two', depending on what he typed. For example, if user types '123' and uses Tab to move to next field, I want to skip it and go to field three. I tried to use OnBlur and OnEnter, without success. Try 1: &lt;form name="mine"&gt;<br> &lt;input type=text name=one onBlur="if (document.mine.one.value='123') document.three.focus();&gt;<br> &lt;input type=text name=two&gt;<br> &lt;input type=text name=three&gt;<br> &lt;/form&gt; Try 2: &lt;form name="mine"&gt;<br> &lt;input type=text name=one&gt;<br> &lt;input type=text name=two onEnter="if (document.mine.one.value='123') document.three.focus();&gt;<br> &lt;input type=text name=three&gt;<br> &lt;/form&gt; but none of these works. Looks like the browser doesn't allow you to mess with focus while the focus is changing. BTW, all this tried with Firefox on Linux.
0
79,292
09/17/2008 02:29:45
14,701
09/17/2008 02:10:38
1
0
database math
Can databases (MySQL in particular, any SQL--MS, Oracle, Postgres--in general) do mass updates, and figure out on their own what the new value should be? Say for example I've got a database with information about a bunch of computers, and all of these computers have drives of various sizes--anywhere from 20 to 250 GB. Then one day we upgrade every single computer by adding a 120 GB hard drive. Is there a way to say something like `update computers set total_disk_space = (whatever that row's current total_disk_space is plus 120)`?
sql
math
databases
null
null
null
open
database math === Can databases (MySQL in particular, any SQL--MS, Oracle, Postgres--in general) do mass updates, and figure out on their own what the new value should be? Say for example I've got a database with information about a bunch of computers, and all of these computers have drives of various sizes--anywhere from 20 to 250 GB. Then one day we upgrade every single computer by adding a 120 GB hard drive. Is there a way to say something like `update computers set total_disk_space = (whatever that row's current total_disk_space is plus 120)`?
0
79,307
09/17/2008 02:31:09
2,828
08/25/2008 12:29:56
121
4
Best web hosting/CMS for my non-technical friend
I have a friend who knows nothing about programming or design who runs a small business. She has an ancient web site built in 1997 that has slowly been modified over the years using MS Word until it has become all but unmanageable. It is only a few static pages with a lot of images and links that change on a semi-regular basis, but I don't have time to build it for her, and I certainly don't want to make changes for her later. So my question is, what is the best option for her available? What is the best combination of hosting and CMS available. Ideally, she should never have to write code, edit code, use ftp, or deal with complicated installations.
content-management-system
web-hosting
null
null
null
null
open
Best web hosting/CMS for my non-technical friend === I have a friend who knows nothing about programming or design who runs a small business. She has an ancient web site built in 1997 that has slowly been modified over the years using MS Word until it has become all but unmanageable. It is only a few static pages with a lot of images and links that change on a semi-regular basis, but I don't have time to build it for her, and I certainly don't want to make changes for her later. So my question is, what is the best option for her available? What is the best combination of hosting and CMS available. Ideally, she should never have to write code, edit code, use ftp, or deal with complicated installations.
0
79,322
09/17/2008 02:33:21
11,289
09/16/2008 06:52:29
11
3
Is there a really good web resource on moving to Moose?
The documentation with the module itself is pretty thin, and just tends to point to MOPS.
perl
perl6
null
null
null
null
open
Is there a really good web resource on moving to Moose? === The documentation with the module itself is pretty thin, and just tends to point to MOPS.
0
79,352
09/17/2008 02:38:02
1,486
08/15/2008 20:42:23
133
7
How can I turn a single object into something that is Enumerable in ruby.
I have a method that can return either a single object or a collection of objects. I want to be able to run object.collect on the result of that method whether or not it is a single object or a collection already. How can i do this? profiles = ProfileResource.search(params) output = profiles.collect do | profile | profile.to_hash end If profiles is a single object, I get a NoMethodError exception when I try to execute collect on that object.
ruby
null
null
null
null
null
open
How can I turn a single object into something that is Enumerable in ruby. === I have a method that can return either a single object or a collection of objects. I want to be able to run object.collect on the result of that method whether or not it is a single object or a collection already. How can i do this? profiles = ProfileResource.search(params) output = profiles.collect do | profile | profile.to_hash end If profiles is a single object, I get a NoMethodError exception when I try to execute collect on that object.
0
79,356
09/17/2008 02:38:22
14,753
09/17/2008 02:35:49
1
0
What is best for desktop widgets (small footprint and pretty graphics)?
If I were to want to create a nice looking widget to stay running in the background with a small memory footprint, where would I start building the windows application. It's goal is to keep an updated list of items off of a web service. Similar to an RSS reader. note: The data layer will be connecting through REST, which I already have a C# dll, that I assume will not affect the footprint too much. Obviously i would like to use a nice WPF project, but the ~60,000k initial size is too big. *C# Forms application is about ~20,000k *C++ Forms ~16,000k *CLR or MFC much smaller, under 5 Is there a way to strip down the WPF or Forms? and if im stuck using CLR or MFC what would be the easiest way to make it pretty. (my experience with MFC is making very award forms)
c++
wfp
.net-3.5
.net
null
null
open
What is best for desktop widgets (small footprint and pretty graphics)? === If I were to want to create a nice looking widget to stay running in the background with a small memory footprint, where would I start building the windows application. It's goal is to keep an updated list of items off of a web service. Similar to an RSS reader. note: The data layer will be connecting through REST, which I already have a C# dll, that I assume will not affect the footprint too much. Obviously i would like to use a nice WPF project, but the ~60,000k initial size is too big. *C# Forms application is about ~20,000k *C++ Forms ~16,000k *CLR or MFC much smaller, under 5 Is there a way to strip down the WPF or Forms? and if im stuck using CLR or MFC what would be the easiest way to make it pretty. (my experience with MFC is making very award forms)
0
79,360
09/17/2008 02:38:41
9,859
09/15/2008 20:13:55
1
0
How can I prevent deformation when rotating about the line-of-sight in OpenGL?
I've drawn an ellipse in the XZ plane, and set my perspective slightly up on the Y-axis and back on the Z, looking at the center of ellipse from a 45-degree angle, using gluPerspective() to set my viewing frustrum. <a href="http://www.flickr.com/photos/rampion/2863703051/" title="ellipse by rampion, on Flickr"><img src="http://farm4.static.flickr.com/3153/2863703051_a768ed86a9_m.jpg" width="240" height="187" alt="ellipse" /></a> Unrotated, the major axis of the ellipse spans the width of my viewport. When I rotate 90-degrees about my line-of-sight, the major axis of the ellipse now spans the height of my viewport, thus deforming the ellipse (in this case, making it appear less eccentric). <a href="http://www.flickr.com/photos/rampion/2863703073/" title="rotated ellipse by rampion, on Flickr"><img src="http://farm4.static.flickr.com/3187/2863703073_24c6549d4b_m.jpg" width="240" height="187" alt="rotated ellipse" /></a> What do I need to do to prevent this deformation (or at least account for it), so rotation about the line-of-sight preserves the perceived major axis of the ellipse (in this case, causing it to go beyond the viewport)?
c
opengl
null
null
null
null
open
How can I prevent deformation when rotating about the line-of-sight in OpenGL? === I've drawn an ellipse in the XZ plane, and set my perspective slightly up on the Y-axis and back on the Z, looking at the center of ellipse from a 45-degree angle, using gluPerspective() to set my viewing frustrum. <a href="http://www.flickr.com/photos/rampion/2863703051/" title="ellipse by rampion, on Flickr"><img src="http://farm4.static.flickr.com/3153/2863703051_a768ed86a9_m.jpg" width="240" height="187" alt="ellipse" /></a> Unrotated, the major axis of the ellipse spans the width of my viewport. When I rotate 90-degrees about my line-of-sight, the major axis of the ellipse now spans the height of my viewport, thus deforming the ellipse (in this case, making it appear less eccentric). <a href="http://www.flickr.com/photos/rampion/2863703073/" title="rotated ellipse by rampion, on Flickr"><img src="http://farm4.static.flickr.com/3187/2863703073_24c6549d4b_m.jpg" width="240" height="187" alt="rotated ellipse" /></a> What do I need to do to prevent this deformation (or at least account for it), so rotation about the line-of-sight preserves the perceived major axis of the ellipse (in this case, causing it to go beyond the viewport)?
0
79,381
09/17/2008 02:41:53
14,769
09/17/2008 02:41:53
1
0
Accessing Websites through a Different Port?
Greetings, I am wanting to access a website from a different port than 80 or 8080. Is this possible? I just want to view the website but through a different port. I do not have a router. I know this can be done because I have a browser that accessing websites through different ports, Called XB Browser by Xero Bank... Any help is greatly appreciated. Sincerely, -Marcus
browser
ports
null
null
null
10/07/2011 00:38:15
off topic
Accessing Websites through a Different Port? === Greetings, I am wanting to access a website from a different port than 80 or 8080. Is this possible? I just want to view the website but through a different port. I do not have a router. I know this can be done because I have a browser that accessing websites through different ports, Called XB Browser by Xero Bank... Any help is greatly appreciated. Sincerely, -Marcus
2
79,389
09/17/2008 02:43:34
10,703
09/16/2008 01:08:24
235
12
What is round-robin scheduling?
In a multitasking operating system context, sometimes you hear the term round-robin scheduling. What does it refer to? What other kind of scheduling is there?
computer-science
homework
operating-system
null
null
null
open
What is round-robin scheduling? === In a multitasking operating system context, sometimes you hear the term round-robin scheduling. What does it refer to? What other kind of scheduling is there?
0
79,415
09/17/2008 02:45:41
9,345
09/15/2008 18:29:52
101
19
What are the minimum requirements for an application monitoring system?
What, at a minimum, should an application-monitoring system do for you (the developer) and/or your boss (the IT Manager)?
application
monitoring
null
null
null
null
open
What are the minimum requirements for an application monitoring system? === What, at a minimum, should an application-monitoring system do for you (the developer) and/or your boss (the IT Manager)?
0
79,434
09/17/2008 02:48:42
7,104
09/15/2008 13:10:33
13
1
Visual Studio 2005: Please stop opening my CS files in "Design Mode"!
I think it's associating my Web Service's CS files with the related ASMX files. But whatever's happening, I can't double-click to open the CS files - I have to "view Code" or it opens in the designer. Anyone know how to turn off this automatic behavior? I just want to edit the code!
visual-studio
designer
null
null
null
null
open
Visual Studio 2005: Please stop opening my CS files in "Design Mode"! === I think it's associating my Web Service's CS files with the related ASMX files. But whatever's happening, I can't double-click to open the CS files - I have to "view Code" or it opens in the designer. Anyone know how to turn off this automatic behavior? I just want to edit the code!
0
79,438
09/17/2008 02:49:47
14,787
09/17/2008 02:49:47
1
0
Which Rails plug in is best for role based permissions? (Please provide one nomination per answer)
I need to add role based permissions to my Rails application, and am wondering what the best plugins out there are to look into.
ruby-on-rails
null
null
null
null
null
open
Which Rails plug in is best for role based permissions? (Please provide one nomination per answer) === I need to add role based permissions to my Rails application, and am wondering what the best plugins out there are to look into.
0
79,445
09/17/2008 02:51:13
14,758
09/17/2008 02:37:42
1
1
Beats per minute from real-time audio input
I'd like to write a simple C# application to monitor the line-in audio and give me the current (well, the rolling average) beats per minute. I've seen the gamedev article, and that was absolutely no help. I went through and tried to implement what he was doing but it just wasn't working. I know there have to be tons of solutions for this, because lots of DJ software does it, but I'm not having any luck in finding any open-source library or instructions on doing it myself.
c#
algorithm
audio
null
null
null
open
Beats per minute from real-time audio input === I'd like to write a simple C# application to monitor the line-in audio and give me the current (well, the rolling average) beats per minute. I've seen the gamedev article, and that was absolutely no help. I went through and tried to implement what he was doing but it just wasn't working. I know there have to be tons of solutions for this, because lots of DJ software does it, but I'm not having any luck in finding any open-source library or instructions on doing it myself.
0
79,451
09/17/2008 02:51:44
14,790
09/17/2008 02:51:44
1
0
.NET 3.5 SP1 changes for ASP.NET
I would like to test out the new SP1 in my development server and then install it for my production server. But I wonder what it had enhance to the ASP.NET portion specifically as that is where my concerns are. I read the docs found in the SP1 Download page but it seens a bit too general to me, not much on the ASP.NE portion. Anyone have any clues on this? Thanks in advance.
.net3.5
sp1
null
null
null
null
open
.NET 3.5 SP1 changes for ASP.NET === I would like to test out the new SP1 in my development server and then install it for my production server. But I wonder what it had enhance to the ASP.NET portion specifically as that is where my concerns are. I read the docs found in the SP1 Download page but it seens a bit too general to me, not much on the ASP.NE portion. Anyone have any clues on this? Thanks in advance.
0
79,454
09/17/2008 02:52:58
10,840
09/16/2008 02:16:02
61
1
Testing GUI code: should I use a mocking library?
Recently I've been experimenting with TDD while developing a GUI application in Python. I find it very reassuring to have tests that verify the functionality of my code, but it's been tricky to follow some of the recommened practices of TDD. Namely, writing tests first has been hard. And I'm finding it difficult to make my tests readable (due to extensive use of a mocking library). I chose a mocking library called [mocker](http://labix.org/mocker). I use it a lot since much of the code I'm testing makes calls to (a) other methods in my application that depend on system state or (b) ObjC/Cocoa objects that cannot exist without an event loop, etc. Anyway, I've got a lot of tests that look like this: def test_current_window_controller(): def test(config): ac = AppController() m = Mocker() ac.iter_window_controllers = iwc = m.replace(ac.iter_window_controllers) expect(iwc()).result(iter(config)) with m: result = ac.current_window_controller() assert result == (config[0] if config else None) yield test, [] yield test, [0] yield test, [1, 0] Notice that the code this is actually three tests; all use the same parameterized test function. Here's the code that is being tested: def current_window_controller(self): try: # iter_window_controllers() iterates in z-order starting # with the controller of the top-most window # assumption: the top-most window is the "current" one wc = self.iter_window_controllers().next() except StopIteration: return None return wc One of the things I've noticed with using mocker is that it's easier to write the application code first and then go back and write the tests second, since most of the time I'm mocking many method calls and the syntax to write the mocked calls is much more verbose (thus harder to write) than the application code. It's easier to write the app code and then model the test code off of that. I find that with this testing method (and a bit of discipline) I can easily write code with 100% test coverage. I'm wondering if these tests are good tests? Will I regret doing it this way down the road when I finally discover the secret to writing good tests? Am I violating the core principles of TDD so much that my testing is in vain?
python
unit-testing
gui
null
null
null
open
Testing GUI code: should I use a mocking library? === Recently I've been experimenting with TDD while developing a GUI application in Python. I find it very reassuring to have tests that verify the functionality of my code, but it's been tricky to follow some of the recommened practices of TDD. Namely, writing tests first has been hard. And I'm finding it difficult to make my tests readable (due to extensive use of a mocking library). I chose a mocking library called [mocker](http://labix.org/mocker). I use it a lot since much of the code I'm testing makes calls to (a) other methods in my application that depend on system state or (b) ObjC/Cocoa objects that cannot exist without an event loop, etc. Anyway, I've got a lot of tests that look like this: def test_current_window_controller(): def test(config): ac = AppController() m = Mocker() ac.iter_window_controllers = iwc = m.replace(ac.iter_window_controllers) expect(iwc()).result(iter(config)) with m: result = ac.current_window_controller() assert result == (config[0] if config else None) yield test, [] yield test, [0] yield test, [1, 0] Notice that the code this is actually three tests; all use the same parameterized test function. Here's the code that is being tested: def current_window_controller(self): try: # iter_window_controllers() iterates in z-order starting # with the controller of the top-most window # assumption: the top-most window is the "current" one wc = self.iter_window_controllers().next() except StopIteration: return None return wc One of the things I've noticed with using mocker is that it's easier to write the application code first and then go back and write the tests second, since most of the time I'm mocking many method calls and the syntax to write the mocked calls is much more verbose (thus harder to write) than the application code. It's easier to write the app code and then model the test code off of that. I find that with this testing method (and a bit of discipline) I can easily write code with 100% test coverage. I'm wondering if these tests are good tests? Will I regret doing it this way down the road when I finally discover the secret to writing good tests? Am I violating the core principles of TDD so much that my testing is in vain?
0
79,455
09/17/2008 02:53:06
9,021
09/15/2008 17:31:26
989
29
How to select consecutive elements that match a filter
Given this example: <img class="a" /> <img /> <img class="a" /> <img class="a" id="active" /> <img class="a" /> <img class="a" /> <img /> <img class="a" /> _(I've just used img tags as an example, that's not what it is in my code)_ Using jQuery, how would you select the img tags with class "a" that are adjacent to #active (the middle four, in this example)? You could do it fairly easily by looping over all the following and preceding elements, stopping when the filter condition fails, but I was wondering if jQuery could it natively?
javascript
jquery
null
null
null
null
open
How to select consecutive elements that match a filter === Given this example: <img class="a" /> <img /> <img class="a" /> <img class="a" id="active" /> <img class="a" /> <img class="a" /> <img /> <img class="a" /> _(I've just used img tags as an example, that's not what it is in my code)_ Using jQuery, how would you select the img tags with class "a" that are adjacent to #active (the middle four, in this example)? You could do it fairly easily by looping over all the following and preceding elements, stopping when the filter condition fails, but I was wondering if jQuery could it natively?
0
79,466
09/17/2008 02:54:33
14,796
09/17/2008 02:54:33
1
0
Why don't modules always honor 'require' in ruby?
I have this in ruby: require 'size_specification' module SomeModule def self.sizes YAML.load_file(File.dirname(__FILE__) + '/size_specification_data.yml') end end class SizeSpecification def fits? end end Then if I call SomeModule.sizes.first.fits? I get an error that the function fits? doesn't exist unless I additionally put a require 'size_specification' in the file calling SomeModule.sizes. Is this a problem with modules or some funkiness with the class loader? Thanks in advance.
ruby
null
null
null
null
null
open
Why don't modules always honor 'require' in ruby? === I have this in ruby: require 'size_specification' module SomeModule def self.sizes YAML.load_file(File.dirname(__FILE__) + '/size_specification_data.yml') end end class SizeSpecification def fits? end end Then if I call SomeModule.sizes.first.fits? I get an error that the function fits? doesn't exist unless I additionally put a require 'size_specification' in the file calling SomeModule.sizes. Is this a problem with modules or some funkiness with the class loader? Thanks in advance.
0
79,468
09/17/2008 02:54:48
14,752
09/17/2008 02:35:39
1
0
backup data for reporting
What is the best method to transfer data from sales table to sales history table in sql server 2005. sales history table will be used for reporting.
database
null
null
null
null
null
open
backup data for reporting === What is the best method to transfer data from sales table to sales history table in sql server 2005. sales history table will be used for reporting.
0
79,474
09/17/2008 02:56:14
11,687
09/16/2008 10:13:33
204
12
Setting environment variables for Phusion Passenger applications
I've set up Passenger in development (Mac OS X) and it works flawlessly. The only problem came later: now I have a custom `GEM_HOME` path and ImageMagick binaries installed in `"/usr/local"`. I can put them in one of the shell rc files that get sourced and this solves the environment variables for processes spawned from the console; but what about Passenger? The same application cannot find my gems when run this way.
ruby
ruby-on-rails
passenger
env
null
null
open
Setting environment variables for Phusion Passenger applications === I've set up Passenger in development (Mac OS X) and it works flawlessly. The only problem came later: now I have a custom `GEM_HOME` path and ImageMagick binaries installed in `"/usr/local"`. I can put them in one of the shell rc files that get sourced and this solves the environment variables for processes spawned from the console; but what about Passenger? The same application cannot find my gems when run this way.
0
79,476
09/17/2008 02:56:28
14,799
09/17/2008 02:56:28
1
0
What's the correct term for "number of std deviations" away from a mean
I've computed the mean & variance of a set of values, and I want to pass along the value that represents the # of std deviations away from mean for each number in the set. Is there a better term for this, or should I just call it num_of_std_devs_from_mean ...
statistics
null
null
null
null
null
open
What's the correct term for "number of std deviations" away from a mean === I've computed the mean & variance of a set of values, and I want to pass along the value that represents the # of std deviations away from mean for each number in the set. Is there a better term for this, or should I just call it num_of_std_devs_from_mean ...
0
79,482
09/17/2008 02:57:59
10,478
09/15/2008 23:23:35
11
2
How do I use transactions with Stomp and ActiveMQ (and Perl)?
I'm trying to replace some bespoke message queues with ActiveMQ, and I need to talk to them (a lot) from Perl. ActiveMQ provides a Stomp interface and Perl has Net::Stomp, so this seems like it should be fine, but it's not. Even if I send a BEGIN command over Stomp, messages sent with SEND are immediately published, and if I ABORT the transaction, nothing happens. I can't find any clear answers suggesting that suggest it's not possible, that is is possible, or that there's a relevant bit of configuration. Also, Stomp doesn't seem to be a great protocol for checking for error responses from the server. Am I out of luck?
perl
activemq
stomp
null
null
null
open
How do I use transactions with Stomp and ActiveMQ (and Perl)? === I'm trying to replace some bespoke message queues with ActiveMQ, and I need to talk to them (a lot) from Perl. ActiveMQ provides a Stomp interface and Perl has Net::Stomp, so this seems like it should be fine, but it's not. Even if I send a BEGIN command over Stomp, messages sent with SEND are immediately published, and if I ABORT the transaction, nothing happens. I can't find any clear answers suggesting that suggest it's not possible, that is is possible, or that there's a relevant bit of configuration. Also, Stomp doesn't seem to be a great protocol for checking for error responses from the server. Am I out of luck?
0
79,490
09/17/2008 02:59:11
777
08/08/2008 19:35:20
43
10
linux uptime history
How can I get a history of uptimes for my debian box? After a reboot, I dont see an option for the uptime command to print a history of uptimes. If it matters, I would like to use these uptimes for graphing a page in php to show my webservers uptime lengths between boots.
linux
null
null
null
null
null
open
linux uptime history === How can I get a history of uptimes for my debian box? After a reboot, I dont see an option for the uptime command to print a history of uptimes. If it matters, I would like to use these uptimes for graphing a page in php to show my webservers uptime lengths between boots.
0
79,493
09/17/2008 02:59:27
14,783
09/17/2008 02:47:54
1
0
How do I use a vendor Apache with a self-compiled Perl and mod_perl?
I want to use Apple's or RedHat's built-in Apache but I want to use Perl 5.10 and mod\_perl. What's the least intrusive way to accomplish this? I want the advantage of free security patching for the vendor's Apache, dav, php, etc., but I care a lot about which version of Perl I use and what's in my @INC path. I don't mind compiling my own mod_perl.
perl
apache
mod-perl
null
null
null
open
How do I use a vendor Apache with a self-compiled Perl and mod_perl? === I want to use Apple's or RedHat's built-in Apache but I want to use Perl 5.10 and mod\_perl. What's the least intrusive way to accomplish this? I want the advantage of free security patching for the vendor's Apache, dav, php, etc., but I care a lot about which version of Perl I use and what's in my @INC path. I don't mind compiling my own mod_perl.
0
79,496
09/17/2008 02:59:59
11,196
09/16/2008 06:05:32
1
0
How do I import facebook friends from another website
I am looking for a way to connect to facebook by allowing the user to enter in their username and password and have our app connect to their account and get their contacts so that they can invite them to join their group on our site. I have written a facebook app before, but this is not an app as much as it is a connector so that they can invite all their friends or just some to the site we are working on. I have seen several other sites do this and also connect to Yahoo, Gmail and Hotmail contacts. I dont think they are using Facebook Connect to do this since it is so new, but they may be. Any solution in any language is fine as I can port whatever example to use C#. I cannot find anything specifically on Google or Facebook to address this specific problem. Any help is appreciated.
facebook
null
null
null
null
null
open
How do I import facebook friends from another website === I am looking for a way to connect to facebook by allowing the user to enter in their username and password and have our app connect to their account and get their contacts so that they can invite them to join their group on our site. I have written a facebook app before, but this is not an app as much as it is a connector so that they can invite all their friends or just some to the site we are working on. I have seen several other sites do this and also connect to Yahoo, Gmail and Hotmail contacts. I dont think they are using Facebook Connect to do this since it is so new, but they may be. Any solution in any language is fine as I can port whatever example to use C#. I cannot find anything specifically on Google or Facebook to address this specific problem. Any help is appreciated.
0
79,498
09/17/2008 03:00:04
2,755
08/24/2008 21:39:28
28
2
Unable to receive JSON from JQuery ajax call
I have determined that my JSON, coming from the server, is valid (making the ajax call manually), but I would really like to use JQuery. I have also determined that the "post" url, being sent to the server, is correct, using firebug. However, the error callback is still being triggered (parsererror). I also tried datatype: text. Are there other options that I should include? $(function() { $("#submit").bind("click", function() { $.ajax({ type: "post", url: "http://myServer/cgi-bin/broker" , datatype: "json", data: {'start' : start,'end' : end}, error: function(request,error){ alert(error) ; }, success: function(request) { alert(myResult.length) ; } }); // End ajax }); // End bind }); // End eventlistener
jquery
ajax
json
null
null
null
open
Unable to receive JSON from JQuery ajax call === I have determined that my JSON, coming from the server, is valid (making the ajax call manually), but I would really like to use JQuery. I have also determined that the "post" url, being sent to the server, is correct, using firebug. However, the error callback is still being triggered (parsererror). I also tried datatype: text. Are there other options that I should include? $(function() { $("#submit").bind("click", function() { $.ajax({ type: "post", url: "http://myServer/cgi-bin/broker" , datatype: "json", data: {'start' : start,'end' : end}, error: function(request,error){ alert(error) ; }, success: function(request) { alert(myResult.length) ; } }); // End ajax }); // End bind }); // End eventlistener
0
79,533
09/17/2008 03:04:28
14,808
09/17/2008 02:59:30
1
0
Architecture for real-time system?
I would like to ask some advices or experiences from architecture or technology for building real-time system. Before I have some experience on developing "Queuing Management System", I have done by sending TcpServer and TcpClient message to all operators when a operator changed the queue number. But I think this strategy a lot complicated and issues. Could anyone guide me some ideas or frameworks?
c#
.net
architecture
frameworks
synchronization
null
open
Architecture for real-time system? === I would like to ask some advices or experiences from architecture or technology for building real-time system. Before I have some experience on developing "Queuing Management System", I have done by sending TcpServer and TcpClient message to all operators when a operator changed the queue number. But I think this strategy a lot complicated and issues. Could anyone guide me some ideas or frameworks?
0
79,536
09/17/2008 03:04:37
13,594
09/16/2008 20:05:50
41
0
What are the full-text search tools you can use in SQL Server?
Besides full-text indexing and using LIKE keyword, what are other tools to build search functionality on top of MS SQL? This question is particularly for searching records, not files.
sql-server
full-text-search
indexing
null
null
null
open
What are the full-text search tools you can use in SQL Server? === Besides full-text indexing and using LIKE keyword, what are other tools to build search functionality on top of MS SQL? This question is particularly for searching records, not files.
0
79,538
09/17/2008 03:05:13
97,220
09/17/2008 03:05:13
1
0
Scanner cannot be resolved to a type
I just installed Ubuntu 8.04 and I'm taking a course in Java so I figured why not install a IDE while I am installing it. So I pick my IDE of choice, Eclipse, and I make a very simple program, Hello World, to make sure everything is running smoothly. When I go to use Scanner for user input I get a very odd error: <b>My code:</b><pre>import java.util.Scanner; class test { public static void main (String [] args) { Scanner sc = new Scanner(System.in); System.out.println("hi"); } }</pre> <b>The output:</b> <pre> Exception in thread "main" java.lang.Error: Unresolved compilation problems: Scanner cannot be resolved to a type Scanner cannot be resolved to a type at test.main(test.java:5) </pre>
java
eclipse
ubuntu
null
null
null
open
Scanner cannot be resolved to a type === I just installed Ubuntu 8.04 and I'm taking a course in Java so I figured why not install a IDE while I am installing it. So I pick my IDE of choice, Eclipse, and I make a very simple program, Hello World, to make sure everything is running smoothly. When I go to use Scanner for user input I get a very odd error: <b>My code:</b><pre>import java.util.Scanner; class test { public static void main (String [] args) { Scanner sc = new Scanner(System.in); System.out.println("hi"); } }</pre> <b>The output:</b> <pre> Exception in thread "main" java.lang.Error: Unresolved compilation problems: Scanner cannot be resolved to a type Scanner cannot be resolved to a type at test.main(test.java:5) </pre>
0
79,541
09/17/2008 03:06:19
12,529
09/16/2008 14:40:00
78
7
forms and jquery
I'm creating a simple form for a site I manage. I use JQuery for my javascript. I noticed a large amount of plugins for JQuery and forms. Does anybody have any favorites that they find especially useful? In particular, plugins to help with validation would be the most useful.
jquery
webforms
null
null
null
null
open
forms and jquery === I'm creating a simple form for a site I manage. I use JQuery for my javascript. I noticed a large amount of plugins for JQuery and forms. Does anybody have any favorites that they find especially useful? In particular, plugins to help with validation would be the most useful.
0
79,542
09/17/2008 03:06:22
10,696
09/16/2008 01:06:21
1
1
scriptResourceHandler
Does anyone know much about the Asp.Net webconfig element [<scriptResourceHandler>][1]? I'm looking at it because I'm implementing an MS Ajax updatepanel in an existing site, and after doing some looking around, on the web I'm not finding a lot of info about it. And to avoid the flood of replies telling me how inefficient the update panel is, and that it's not actually providing any benefit etc. etc. I know! Let's say I've got my reasons for using it and leave it at that. I guess my main question is;, will setting enableCompression="true" and enableCaching="true" help the perormace of my update panel in any way? [1]: http://msdn.microsoft.com/en-us/library/bb513840.aspx
asp.net
ajax
asp.net-ajax
null
null
null
open
scriptResourceHandler === Does anyone know much about the Asp.Net webconfig element [<scriptResourceHandler>][1]? I'm looking at it because I'm implementing an MS Ajax updatepanel in an existing site, and after doing some looking around, on the web I'm not finding a lot of info about it. And to avoid the flood of replies telling me how inefficient the update panel is, and that it's not actually providing any benefit etc. etc. I know! Let's say I've got my reasons for using it and leave it at that. I guess my main question is;, will setting enableCompression="true" and enableCaching="true" help the perormace of my update panel in any way? [1]: http://msdn.microsoft.com/en-us/library/bb513840.aspx
0
79,582
09/17/2008 03:15:16
14,429
09/16/2008 23:55:27
1
0
Best win32 compiled scripting language?
What is the best compilable scripting language for Win32? I prefer .EXE's because I don't want to install the runtime on the servers first (my company administrates many via remote), but I need to be able to do things like NTFS permissions and (if possible) APIs over the network. There was a small Perl which appeared to be able to do most of this, but it does not seem to have been updated/developed in quite a while. I have wondered about Lua, but I don't know if it has everything I need yet (and don't want to hunt through fifty library sites trying to find out). Any thoughts?
scripting
script
win32
windows
compilable
09/19/2011 12:28:21
not constructive
Best win32 compiled scripting language? === What is the best compilable scripting language for Win32? I prefer .EXE's because I don't want to install the runtime on the servers first (my company administrates many via remote), but I need to be able to do things like NTFS permissions and (if possible) APIs over the network. There was a small Perl which appeared to be able to do most of this, but it does not seem to have been updated/developed in quite a while. I have wondered about Lua, but I don't know if it has everything I need yet (and don't want to hunt through fifty library sites trying to find out). Any thoughts?
4
79,584
09/17/2008 03:15:37
14,706
09/17/2008 02:12:12
1
1
Are there any Parsing Expression Grammar (PEG) libraries for Javascript or PHP?
I find myself drawn to the Parsing Expression Grammar formalism for describing domain specific languages, but so far the implementation code I've found has been written in languages like Java and Haskell that aren't web server friendly in the shared hosting environment that my organization has to live with. Does anyone know of any PEG libraries or PackRat Parser Generators for Javascript or PHP? Of course code generators in any languages that can produce Javascript or PHP source code would do the trick.
javascript
php
parsing
generative-programming
null
null
open
Are there any Parsing Expression Grammar (PEG) libraries for Javascript or PHP? === I find myself drawn to the Parsing Expression Grammar formalism for describing domain specific languages, but so far the implementation code I've found has been written in languages like Java and Haskell that aren't web server friendly in the shared hosting environment that my organization has to live with. Does anyone know of any PEG libraries or PackRat Parser Generators for Javascript or PHP? Of course code generators in any languages that can produce Javascript or PHP source code would do the trick.
0
79,592
09/17/2008 03:16:52
12,293
09/16/2008 13:54:51
1
0
how can you parse an excel (.xls) file stored in a varbinary in MS SQL 2005?
**problem** how to best parse/access/extract "excel file" data stored as binary data in an SQL 2005 field? (so all the data can ultimately be stored in other fields of other tables.) **given** - a standard excel (".xls") file (native format, not comma or tab separated) - file is stored raw in a <code>varbinary(max)</code> SQL 2005 field - excel file data may not necessarily be "uniform" between rows -- i.e., we can't just assume one column is all the same data type (e.g., there may be row headers, column headers, empty cells, different "formats", ...) **requirements** - code completely within SQL 2005 (stored procedures, SSIS?) - be able to access values on any worksheet (tab) - be able to access values in any cell (no formula data or dereferencing needed) - cell values must not be assumed to be "uniform" between rows -- i.e., we can't just assume one column is all the same data type (e.g., there may be row headers, column headers, empty cells, formulas, different "formats", ...) **preferences** - no filesystem access (no writing temporary .xls files) - retrieve values in defined format (e.g., actual date value instead of a raw number like 39876)
sql
excel
xls
etl
stored-procedures
null
open
how can you parse an excel (.xls) file stored in a varbinary in MS SQL 2005? === **problem** how to best parse/access/extract "excel file" data stored as binary data in an SQL 2005 field? (so all the data can ultimately be stored in other fields of other tables.) **given** - a standard excel (".xls") file (native format, not comma or tab separated) - file is stored raw in a <code>varbinary(max)</code> SQL 2005 field - excel file data may not necessarily be "uniform" between rows -- i.e., we can't just assume one column is all the same data type (e.g., there may be row headers, column headers, empty cells, different "formats", ...) **requirements** - code completely within SQL 2005 (stored procedures, SSIS?) - be able to access values on any worksheet (tab) - be able to access values in any cell (no formula data or dereferencing needed) - cell values must not be assumed to be "uniform" between rows -- i.e., we can't just assume one column is all the same data type (e.g., there may be row headers, column headers, empty cells, formulas, different "formats", ...) **preferences** - no filesystem access (no writing temporary .xls files) - retrieve values in defined format (e.g., actual date value instead of a raw number like 39876)
0
79,594
09/17/2008 03:17:33
14,836
09/17/2008 03:17:32
1
0
We're manually mapping our internal data elements to external vendors' xml schema. there's gotta be a better way...
I'm considering Altova MapForce (or something similar) to produce either XSLT and/or a Java or C# class to do the translation. Today, we pull data right out of the database and manually build an XML string that we post to a webservice. Should it be db -> (internal)XML -> XSLT -> (External)XML? What do you folks do out there in the wide world?
c#
xml
xslt
mapping
coldfusion
null
open
We're manually mapping our internal data elements to external vendors' xml schema. there's gotta be a better way... === I'm considering Altova MapForce (or something similar) to produce either XSLT and/or a Java or C# class to do the translation. Today, we pull data right out of the database and manually build an XML string that we post to a webservice. Should it be db -> (internal)XML -> XSLT -> (External)XML? What do you folks do out there in the wide world?
0
79,612
09/17/2008 03:21:33
13,320
09/16/2008 18:17:53
3
5
how to save a public html page with all media and preserve structure
Looking for a linux application (or firefox extension) that will allow me to scrape an html mockup and keep the page's integrity. Firefox does an almost perfect job but doesn't grab images referenced in the css. The Scrabbook extension for Firefox gets everything, but flattens the directory structure. I wouldn't terribly mind if all folders became children of the index page.
css
screen
directory-structure
screen-scraping
null
null
open
how to save a public html page with all media and preserve structure === Looking for a linux application (or firefox extension) that will allow me to scrape an html mockup and keep the page's integrity. Firefox does an almost perfect job but doesn't grab images referenced in the css. The Scrabbook extension for Firefox gets everything, but flattens the directory structure. I wouldn't terribly mind if all folders became children of the index page.
0
79,632
09/17/2008 03:25:18
4,322
09/02/2008 20:31:47
32
5
Ruby/Rails Collection to Collecti
I have a two tables joined with a join table - this is just pseudo code: Library Book LibraryBooks What I need to do is if i have the id of a library, i want to get all the libraries that all the books that this library has are in. So if i have Library 1, and Library 1 has books A and B in them, and books A and B are in Libraries 1, 2, and 3, is there an elegant (one line) way todo this in rails? I was thinking: l = Library.find(1) allLibraries = l.books.libraries But that doesn't seem to work. Suggestions?
ruby
ruby-on-rails
rubyonrails
null
null
null
open
Ruby/Rails Collection to Collecti === I have a two tables joined with a join table - this is just pseudo code: Library Book LibraryBooks What I need to do is if i have the id of a library, i want to get all the libraries that all the books that this library has are in. So if i have Library 1, and Library 1 has books A and B in them, and books A and B are in Libraries 1, 2, and 3, is there an elegant (one line) way todo this in rails? I was thinking: l = Library.find(1) allLibraries = l.books.libraries But that doesn't seem to work. Suggestions?
0
79,660
09/17/2008 03:28:22
14,811
09/17/2008 03:00:23
1
1
Suggestion needed to learn Machile Learning and Information Retrieval
I want lo learn about Information Retrieval and Machine Learning. Which books do you recommend and in what order do you think is better to read them? The idea is to reach a good understanding of recommendation systems. Thanks! Jonathan
books
information-retrieval
machine-learning
recommendation-system
null
null
open
Suggestion needed to learn Machile Learning and Information Retrieval === I want lo learn about Information Retrieval and Machine Learning. Which books do you recommend and in what order do you think is better to read them? The idea is to reach a good understanding of recommendation systems. Thanks! Jonathan
0
79,662
09/17/2008 03:29:03
14,544
09/17/2008 00:51:36
1
0
Java JFormattedTextField for typing dates
I've been having trouble to make a JFormattedTextField to use dates with the format dd/MM/yyyy. Specifically, as the user types, the cursor should "jump" the slashes, and get directly to the next number position. Also, the JFormattedTextField must verify if the date entered is valid, and reject it somehow if the date is invalid, or "correct it" to a valid date, such as if the user input "13" as month, set it as "01" and add +1 to the year. I tried using a mask ("##/##/####") with the validate() method of JFormattedTextField to check if the date is valid, but it appears that those two don't work well together (or I'm too green on Java to know how... :), and then the user can type anything on the field. Any help is really appreciated! Thanks!
java
date
validate
mask
null
null
open
Java JFormattedTextField for typing dates === I've been having trouble to make a JFormattedTextField to use dates with the format dd/MM/yyyy. Specifically, as the user types, the cursor should "jump" the slashes, and get directly to the next number position. Also, the JFormattedTextField must verify if the date entered is valid, and reject it somehow if the date is invalid, or "correct it" to a valid date, such as if the user input "13" as month, set it as "01" and add +1 to the year. I tried using a mask ("##/##/####") with the validate() method of JFormattedTextField to check if the date is valid, but it appears that those two don't work well together (or I'm too green on Java to know how... :), and then the user can type anything on the field. Any help is really appreciated! Thanks!
0
79,669
09/17/2008 03:30:37
13,728
09/16/2008 20:39:42
1
0
How best to copy entire databases in MS SQL Server?
I need to copy about 40 databases from one server to another. The new databases should have new names, but all the same tables, data and indexes as the original databases. So far I've been: 1) creating each destination database 2) using the "[Tasks->Export Data][1]" command to create and populate tables for each database individually 3) rebuilding all of the indexes for each database with a SQL script Only three steps per database, but I'll bet there's an easier way. Do any MS SQL Server experts out there have any advice? [1]: http://msdn.microsoft.com/en-us/library/ms140052.aspx
sql-server
database
null
null
null
null
open
How best to copy entire databases in MS SQL Server? === I need to copy about 40 databases from one server to another. The new databases should have new names, but all the same tables, data and indexes as the original databases. So far I've been: 1) creating each destination database 2) using the "[Tasks->Export Data][1]" command to create and populate tables for each database individually 3) rebuilding all of the indexes for each database with a SQL script Only three steps per database, but I'll bet there's an easier way. Do any MS SQL Server experts out there have any advice? [1]: http://msdn.microsoft.com/en-us/library/ms140052.aspx
0
79,688
09/17/2008 03:34:25
3,420
08/28/2008 14:19:36
210
5
Calculating percentile rankings in MS SQL
What's the best way to calculate percentile rankings (e.g. the 90th percentile or the median score) in MSSQL 2005? I'd like to be able to select the 10th, 25th, median, 75th, and 90th percentiles for a single column of scores (preferably in a single record so I can combine with average, max, and min).
mssql
sql
math
null
null
null
open
Calculating percentile rankings in MS SQL === What's the best way to calculate percentile rankings (e.g. the 90th percentile or the median score) in MSSQL 2005? I'd like to be able to select the 10th, 25th, median, 75th, and 90th percentiles for a single column of scores (preferably in a single record so I can combine with average, max, and min).
0
79,727
09/17/2008 03:41:33
10,703
09/16/2008 01:08:24
240
12
How are the vxWorks "kernel shell" and "host shell" different?
In the vxWorks RTOS, there is a shell that allows you to issue command to your embedded system. The documentation refers to kernel shell, host shell and target shell. What is the difference between the three?
embedded
vxworks
rtos
null
null
null
open
How are the vxWorks "kernel shell" and "host shell" different? === In the vxWorks RTOS, there is a shell that allows you to issue command to your embedded system. The documentation refers to kernel shell, host shell and target shell. What is the difference between the three?
0
79,733
09/17/2008 03:42:24
10,433
09/15/2008 23:06:36
64
7
Best automated testing tool for web applications?
Having repeatable automated tests of web applications lets one detect regression with very little ongoing labour cost (the main cost being writing the test scripts up front). However there seems to be a bewildering array of such tools available. We used [eValid][1] in the past but now use [Sahi][2]. Ideally we'd like a tool for which IT-literate but non-development staff can write and maintain the scripts. What product do you recommend, and how much experience of that product is your recommendation based on? [1]: http://www.soft.com/eValid/ [2]: http://sahi.co.in/w/
automated-tests
regression-test
null
null
null
null
open
Best automated testing tool for web applications? === Having repeatable automated tests of web applications lets one detect regression with very little ongoing labour cost (the main cost being writing the test scripts up front). However there seems to be a bewildering array of such tools available. We used [eValid][1] in the past but now use [Sahi][2]. Ideally we'd like a tool for which IT-literate but non-development staff can write and maintain the scripts. What product do you recommend, and how much experience of that product is your recommendation based on? [1]: http://www.soft.com/eValid/ [2]: http://sahi.co.in/w/
0
79,736
09/17/2008 03:42:58
7,644
09/15/2008 14:07:54
18
1
.Net Gridview alpha sorting, it needs to be numberically sorting
This is my first real question of need for any of thsoe Gridview experts out there in the .NET world. I an creating a Gridview from codebehind and I am holding a bunch of numerical data in the columns. Although, I do add the comma in the number fields from codebehind. When I load it to the Gridview, I have the sorting ability turned on, BUT the girdview chooses to ALPHA sort rather than sorting numerically because I add in those commas. So I need help. Anyone willing to give this one a shot? I need to change some of my columns in the gridview to numerical sort rather than the alpha sort it is using.
.net
c#
gridview
null
null
null
open
.Net Gridview alpha sorting, it needs to be numberically sorting === This is my first real question of need for any of thsoe Gridview experts out there in the .NET world. I an creating a Gridview from codebehind and I am holding a bunch of numerical data in the columns. Although, I do add the comma in the number fields from codebehind. When I load it to the Gridview, I have the sorting ability turned on, BUT the girdview chooses to ALPHA sort rather than sorting numerically because I add in those commas. So I need help. Anyone willing to give this one a shot? I need to change some of my columns in the gridview to numerical sort rather than the alpha sort it is using.
0
79,737
09/17/2008 03:43:01
3,048
08/26/2008 13:36:49
1
2
What's the best way to export bug tracking data from hosted HP Quality Center?
This question may be too product specifc but I'd like to know if anyone is exporting bug track data from HP Quality Center. HP Quality Center (QC) has an old school COM API but I'd rather use a web service or maybe even screen scraper to export the data into an excel spreadsheet. In any case, what's the best way to export bug tracking data from hosted HP Quality Center?
excel
bug-tracking
qualitycenter
null
null
null
open
What's the best way to export bug tracking data from hosted HP Quality Center? === This question may be too product specifc but I'd like to know if anyone is exporting bug track data from HP Quality Center. HP Quality Center (QC) has an old school COM API but I'd rather use a web service or maybe even screen scraper to export the data into an excel spreadsheet. In any case, what's the best way to export bug tracking data from hosted HP Quality Center?
0
79,745
09/17/2008 03:44:27
5,022
09/07/2008 12:16:34
176
12
How to determine which version of Direct3D is installed?
We have an application which needs to use Direct3D. Specifically, it needs at least DirectX 9.0c version 4.09.0000.0904. While this should be present on all newer XP machines it might not be installed on older XP machines. How can I programmatically (using C++) determine if it is installed? I want to be able to give an information message to the user that Direct3D will not be available.
c++
windows
direct3d
null
null
null
open
How to determine which version of Direct3D is installed? === We have an application which needs to use Direct3D. Specifically, it needs at least DirectX 9.0c version 4.09.0000.0904. While this should be present on all newer XP machines it might not be installed on older XP machines. How can I programmatically (using C++) determine if it is installed? I want to be able to give an information message to the user that Direct3D will not be available.
0
79,753
09/17/2008 03:46:47
14,855
09/17/2008 03:34:22
1
0
Recommended reading list for a (relative)newbie?
What literature(written or otherwise) would you recommend for someone new to the world of coding? I would prefer something about C, but if you have any other suggestions, what are they?
c
programming-languages
neophyte
null
null
01/22/2012 07:35:37
not constructive
Recommended reading list for a (relative)newbie? === What literature(written or otherwise) would you recommend for someone new to the world of coding? I would prefer something about C, but if you have any other suggestions, what are they?
4
79,754
09/17/2008 03:46:55
3,176
08/27/2008 07:10:07
193
10
Unittest causing sys.exit()
No matter what I do sys.exit() is called by unittest, even the most trivial examples. I can't tell if my install is messed up or what is going on. IDLE 1.2.2 ==== No Subprocess ==== >>> import unittest >>> >>> class Test(unittest.TestCase): def testA(self): a = 1 self.assertEqual(a,1) >>> unittest.main() option -n not recognized Usage: idle.pyw [options] [test] [...] Options: -h, --help Show this message -v, --verbose Verbose output -q, --quiet Minimal output Examples: idle.pyw - run default set of tests idle.pyw MyTestSuite - run suite 'MyTestSuite' idle.pyw MyTestCase.testSomething - run MyTestCase.testSomething idle.pyw MyTestCase - run all 'test*' test methods in MyTestCase Traceback (most recent call last): File "<pyshell#7>", line 1, in <module> unittest.main() File "E:\Python25\lib\unittest.py", line 767, in __init__ self.parseArgs(argv) File "E:\Python25\lib\unittest.py", line 796, in parseArgs self.usageExit(msg) File "E:\Python25\lib\unittest.py", line 773, in usageExit sys.exit(2) SystemExit: 2 >>>
python
unittest
null
null
null
null
open
Unittest causing sys.exit() === No matter what I do sys.exit() is called by unittest, even the most trivial examples. I can't tell if my install is messed up or what is going on. IDLE 1.2.2 ==== No Subprocess ==== >>> import unittest >>> >>> class Test(unittest.TestCase): def testA(self): a = 1 self.assertEqual(a,1) >>> unittest.main() option -n not recognized Usage: idle.pyw [options] [test] [...] Options: -h, --help Show this message -v, --verbose Verbose output -q, --quiet Minimal output Examples: idle.pyw - run default set of tests idle.pyw MyTestSuite - run suite 'MyTestSuite' idle.pyw MyTestCase.testSomething - run MyTestCase.testSomething idle.pyw MyTestCase - run all 'test*' test methods in MyTestCase Traceback (most recent call last): File "<pyshell#7>", line 1, in <module> unittest.main() File "E:\Python25\lib\unittest.py", line 767, in __init__ self.parseArgs(argv) File "E:\Python25\lib\unittest.py", line 796, in parseArgs self.usageExit(msg) File "E:\Python25\lib\unittest.py", line 773, in usageExit sys.exit(2) SystemExit: 2 >>>
0
79,764
09/17/2008 03:48:10
14,891
09/17/2008 03:48:10
1
0
Wildcard Subdomains
I know there have been a few threads on this before, but I have tried absolutely everything suggested (that I could find) and nothing has worked for me thus far... With that in mind, here is what I'm trying to do: First, I want to allow users to publish pages and give them each a subdomain of their choice (ex: user.mysite.com). From what I can gather, the best way to do this is to map user.mysite.com to mysite.com/user with mod_rewrite and .htaccess - is that correct? If that is correct, can somebody give me explicit instructions on how to do this? Also, I am doing all of my development locally, using MAMP, so if somebody could tell me how to set up my local environment to work in the same manner (I've read this is more difficult), I would greatly appreciate it. Honestly, I have been trying a everything to no avail, and since this is my first time doing something like this, I am completely lost. Thanks so much for any help!
subdomain
mamp
localhost
wildcard
wildcard-subdomain
null
open
Wildcard Subdomains === I know there have been a few threads on this before, but I have tried absolutely everything suggested (that I could find) and nothing has worked for me thus far... With that in mind, here is what I'm trying to do: First, I want to allow users to publish pages and give them each a subdomain of their choice (ex: user.mysite.com). From what I can gather, the best way to do this is to map user.mysite.com to mysite.com/user with mod_rewrite and .htaccess - is that correct? If that is correct, can somebody give me explicit instructions on how to do this? Also, I am doing all of my development locally, using MAMP, so if somebody could tell me how to set up my local environment to work in the same manner (I've read this is more difficult), I would greatly appreciate it. Honestly, I have been trying a everything to no avail, and since this is my first time doing something like this, I am completely lost. Thanks so much for any help!
0