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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
698 | 08/03/2008 14:22:28 | 173 | 08/03/2008 01:04:00 | 10 | 4 | Is there an IDE that provides code completion for Python | I am quite fond of the Intellisense code completion baked into Microsoft Visual Studio. I find that I only type 2 to 4 characters of any given keyword which drasticaly speeds up my coding. Now that I have been spending time writing some Python code I find myself reaching for ctrl+space.
Are there any IDEs that support code completion in Python? I do my python development on a Mac so an OS x tool would be preferable. It seems like the doc string property of Python methods is a perfect match for inline API discovery. | python | ide | codecompletion | null | null | null | open | Is there an IDE that provides code completion for Python
===
I am quite fond of the Intellisense code completion baked into Microsoft Visual Studio. I find that I only type 2 to 4 characters of any given keyword which drasticaly speeds up my coding. Now that I have been spending time writing some Python code I find myself reaching for ctrl+space.
Are there any IDEs that support code completion in Python? I do my python development on a Mac so an OS x tool would be preferable. It seems like the doc string property of Python methods is a perfect match for inline API discovery. | 0 |
705 | 08/03/2008 14:41:43 | 91 | 08/01/2008 17:55:22 | 214 | 20 | Embedded Database for .net that can run off a network | I was (and still am) looking for an embedded database to be used in a .net (c#) application. The caveat: The Application (or at least the database) is stored on a Network drive, but only used by 1 user at a time.
Now, my first idea was [SQL Server Compact edition][1]. That is really nicely integreated, but it can not run off a network.
[Firebird][2] seems to have the same issue, but the .net Integration seems to be not really first-class and is largely undocumented.
[Blackfish SQL][3] looks interesting, but there is no trial of the .net Version. Pricing is also OK.
Any other suggestions of something that works well with .net **and** runs off a network without the need of actually installing a server software?
[1]: http://www.microsoft.com/sql/editions/compact/default.mspx
[2]: http://www.firebirdsql.org/dotnetfirebird/
[3]: http://www.codegear.com/products/blackfish | .net | database | embedded | null | null | null | open | Embedded Database for .net that can run off a network
===
I was (and still am) looking for an embedded database to be used in a .net (c#) application. The caveat: The Application (or at least the database) is stored on a Network drive, but only used by 1 user at a time.
Now, my first idea was [SQL Server Compact edition][1]. That is really nicely integreated, but it can not run off a network.
[Firebird][2] seems to have the same issue, but the .net Integration seems to be not really first-class and is largely undocumented.
[Blackfish SQL][3] looks interesting, but there is no trial of the .net Version. Pricing is also OK.
Any other suggestions of something that works well with .net **and** runs off a network without the need of actually installing a server software?
[1]: http://www.microsoft.com/sql/editions/compact/default.mspx
[2]: http://www.firebirdsql.org/dotnetfirebird/
[3]: http://www.codegear.com/products/blackfish | 0 |
709 | 08/03/2008 14:53:53 | 111 | 08/02/2008 03:35:55 | 56 | 5 | .NET Testing Framework Advice | I'm looking to introduce a unit testing framework into the mix at my job. We're using Visual Studio 2005 (though we may be moving to 2008 within the next 6 months) and work primarily in C#. If the framework has some kind of IDE integration that would be best, but I'm open to frameworks that don't have integration but are still relatively simple to get set up. I'm going to get resistance to it one way or another, so if I can make sure what I'm pushing isn't a pain in the neck, that would help my case.
The obvious choice from the research I've done so far points to nUnit, but I'd like to get the impressions of someone who's actually used it before recommending it to my team.
Has anyone out there used nUnit? If so, are there any pitfalls or limitations of which I should be aware? Are there other good options out there? If so, if you've used both nUnit at that, I'd greatly appreciate an idea of the strengths and weaknesses of them.
Eric Sipple | c# | .net | visual-studio | unit-testing | null | null | open | .NET Testing Framework Advice
===
I'm looking to introduce a unit testing framework into the mix at my job. We're using Visual Studio 2005 (though we may be moving to 2008 within the next 6 months) and work primarily in C#. If the framework has some kind of IDE integration that would be best, but I'm open to frameworks that don't have integration but are still relatively simple to get set up. I'm going to get resistance to it one way or another, so if I can make sure what I'm pushing isn't a pain in the neck, that would help my case.
The obvious choice from the research I've done so far points to nUnit, but I'd like to get the impressions of someone who's actually used it before recommending it to my team.
Has anyone out there used nUnit? If so, are there any pitfalls or limitations of which I should be aware? Are there other good options out there? If so, if you've used both nUnit at that, I'd greatly appreciate an idea of the strengths and weaknesses of them.
Eric Sipple | 0 |
728 | 08/03/2008 15:32:56 | 205 | 08/03/2008 13:31:27 | 11 | 1 | Decent, simple, GIS/mapping component for ASP.NET? | I need to display a map of the U.S. with states shown in different colors according to underlying data. I'd also like to have this map contain some facility for subscribing to hover/click events on each state in javascript, presumably using an imagemap.
The data won't be changing in any kind of AJAX-y way, so ideally this component would generate a static image that would be cacheable.
Any suggestions? | asp.net | gis | mapping | null | null | null | open | Decent, simple, GIS/mapping component for ASP.NET?
===
I need to display a map of the U.S. with states shown in different colors according to underlying data. I'd also like to have this map contain some facility for subscribing to hover/click events on each state in javascript, presumably using an imagemap.
The data won't be changing in any kind of AJAX-y way, so ideally this component would generate a static image that would be cacheable.
Any suggestions? | 0 |
742 | 08/03/2008 15:55:28 | 189 | 08/03/2008 09:23:42 | 21 | 1 | Class views in Django | [Django][1] view points to a function, which can be a problem if you want to change only a bit of functionality. Yes, I could have million keyword arguments and even more if statements in the function, but I was thinking more of an object oriented approach.
For example, I have a page that displays a user. This page is very similar to page that displays a group, but it's still not so similar to just use another data model. Group also has members etc...
One way would be to point views to class methods and then extend that class. Has anyone tried this approach or has any other idea?
[1]: http://www.djangoproject.com/ | python | django | view | oop | null | null | open | Class views in Django
===
[Django][1] view points to a function, which can be a problem if you want to change only a bit of functionality. Yes, I could have million keyword arguments and even more if statements in the function, but I was thinking more of an object oriented approach.
For example, I have a page that displays a user. This page is very similar to page that displays a group, but it's still not so similar to just use another data model. Group also has members etc...
One way would be to point views to class methods and then extend that class. Has anyone tried this approach or has any other idea?
[1]: http://www.djangoproject.com/ | 0 |
746 | 08/03/2008 16:03:48 | 192 | 08/03/2008 10:15:38 | 16 | 1 | Format string to title case | How do I format a string to title case? | language-agnostic | string | format | title-case | null | null | open | Format string to title case
===
How do I format a string to title case? | 0 |
752 | 08/03/2008 16:29:03 | 192 | 08/03/2008 10:15:38 | 31 | 2 | Get a new object instance from a Type in C# | One may not always know the Type of an object at compile-time, but may need to create an instance of the Type. How do you get a new object instance from a Type? | c# | .net | reflection | null | null | null | open | Get a new object instance from a Type in C#
===
One may not always know the Type of an object at compile-time, but may need to create an instance of the Type. How do you get a new object instance from a Type? | 0 |
761 | 08/03/2008 17:30:20 | 214 | 08/03/2008 15:12:30 | 1 | 1 | Localising date format descriptors | What is the best way to localise a date format descriptor?
As anyone from a culture which does not use the mm/dd/yyyy format knows, it is annoying to have to enter dates in this format. The .NET framework provides some very good localisation support, so it's trivial to parse dates according to the users culture, but you often want to also display a helpful hint as to the format required (especially to distinguish between yy and yyyy which is interchangeable in most cultures).
What is the best way to do this with results that make sense to most users (i.e. dd/M/yyy is confusing because of the change in case and the switching between two and one letters). | internationalization | .net | c# | vb.net | asp.net | null | open | Localising date format descriptors
===
What is the best way to localise a date format descriptor?
As anyone from a culture which does not use the mm/dd/yyyy format knows, it is annoying to have to enter dates in this format. The .NET framework provides some very good localisation support, so it's trivial to parse dates according to the users culture, but you often want to also display a helpful hint as to the format required (especially to distinguish between yy and yyyy which is interchangeable in most cultures).
What is the best way to do this with results that make sense to most users (i.e. dd/M/yyy is confusing because of the change in case and the switching between two and one letters). | 0 |
766 | 08/03/2008 17:44:07 | 1,384,652 | 08/01/2008 12:01:23 | 13 | 1 | Python and MySQL | I can get Python to work with Postgresql but I cannot get it to work with MySQL. The main problem is that on the shared hosting account I have I do not have the ability to install things such as Django or PySQL, I generally fail when installing them on my computer so maybe it's good I can't install on the host.
I found [bpgsql][1] really good because it does not require an install, it's a single file that I can look at, read and then call the functions of. Does anybody know of something like this for MySQL?
[1]: http://barryp.org/software/bpgsql/ | python | mysql | postgresql | null | null | null | open | Python and MySQL
===
I can get Python to work with Postgresql but I cannot get it to work with MySQL. The main problem is that on the shared hosting account I have I do not have the ability to install things such as Django or PySQL, I generally fail when installing them on my computer so maybe it's good I can't install on the host.
I found [bpgsql][1] really good because it does not require an install, it's a single file that I can look at, read and then call the functions of. Does anybody know of something like this for MySQL?
[1]: http://barryp.org/software/bpgsql/ | 0 |
769 | 08/03/2008 18:14:24 | 79 | 08/01/2008 16:05:09 | 1 | 0 | Solving a linear equation | I need to programmatically solve a system of linear equations in C, Objective C, or (if needed) C++.
Here's an example of the equations:
-44.3940 = a * 50.0 + b * 37.0 + tx
-45.3049 = a * 43.0 + b * 39.0 + tx
-44.9594 = a * 52.0 + b * 41.0 + tx
From this, I'd like to get the best approximation for a, b, and tx. | math | linear | solving | null | null | null | open | Solving a linear equation
===
I need to programmatically solve a system of linear equations in C, Objective C, or (if needed) C++.
Here's an example of the equations:
-44.3940 = a * 50.0 + b * 37.0 + tx
-45.3049 = a * 43.0 + b * 39.0 + tx
-44.9594 = a * 52.0 + b * 41.0 + tx
From this, I'd like to get the best approximation for a, b, and tx. | 0 |
773 | 08/03/2008 18:27:09 | 207 | 08/03/2008 13:51:13 | 11 | 1 | How do I use Python's itertools.groupby()? | I haven't been able to find an understandable explanation of how to actually use Python's itertools.groupby() function. What I'm trying to do is this: take a list - in this case, the children of an objectified lxml element - divide it into groups based on some criteria, and then later iterate over each of these groups separately.
I've reviewed the documentation (<http://docs.python.org/lib/itertools-functions.html>), and the examples, (<http://docs.python.org/lib/itertools-example.html>), but I've had trouble trying to apply them beyond a simple list of numbers.
So, how do I use of itertools.groupby()? Is there another technique I should be using? Pointers to good "prerequisite" reading would also be appreciated. | python | iteration | null | null | null | null | open | How do I use Python's itertools.groupby()?
===
I haven't been able to find an understandable explanation of how to actually use Python's itertools.groupby() function. What I'm trying to do is this: take a list - in this case, the children of an objectified lxml element - divide it into groups based on some criteria, and then later iterate over each of these groups separately.
I've reviewed the documentation (<http://docs.python.org/lib/itertools-functions.html>), and the examples, (<http://docs.python.org/lib/itertools-example.html>), but I've had trouble trying to apply them beyond a simple list of numbers.
So, how do I use of itertools.groupby()? Is there another technique I should be using? Pointers to good "prerequisite" reading would also be appreciated. | 0 |
800 | 08/03/2008 19:47:05 | 230 | 08/03/2008 19:32:46 | 1 | 1 | Object Orientated vs Relational Databases | Objects orientated databases seem like a really cool idea to me, no need to worry about mapping you domain model to your database model, no messing around with sql or ORM tools. The way I understand it, relational DBs offer some advantages when there is massive amounts of data, and searching an indexing need to be done. To my mind 99% of websites are not massive, and enterprise issues never need to be thought about, so why arn't OO DBs more widely used? | databases | null | null | null | null | null | open | Object Orientated vs Relational Databases
===
Objects orientated databases seem like a really cool idea to me, no need to worry about mapping you domain model to your database model, no messing around with sql or ORM tools. The way I understand it, relational DBs offer some advantages when there is massive amounts of data, and searching an indexing need to be done. To my mind 99% of websites are not massive, and enterprise issues never need to be thought about, so why arn't OO DBs more widely used? | 0 |
805 | 08/03/2008 20:11:26 | 232 | 08/03/2008 20:02:07 | 1 | 0 | ASP, need to use SFTP | This is ASP classic, not .Net. We have to get a way to SFTP into a server to upload and download a couple of files, kicked off by a user.
What have other people used to do SFTP in ASP classic? Not necessarily opposed to purchasing a control.
Thanks for any help! | asp | sftp | ftp | null | null | null | open | ASP, need to use SFTP
===
This is ASP classic, not .Net. We have to get a way to SFTP into a server to upload and download a couple of files, kicked off by a user.
What have other people used to do SFTP in ASP classic? Not necessarily opposed to purchasing a control.
Thanks for any help! | 0 |
810 | 08/03/2008 20:35:01 | 233 | 08/03/2008 20:19:32 | 1 | 0 | Visual Studio Setup Project - Per User Registry Settings | I'm trying to maintain a Setup Project in Visual Studio 2003 (yes, it's a legacy application). The problem we have at the moment is that we need to write registry entries to HKCU for every user on the computer. They need to be in the HKCU rather than HKLM because they are the default user settings, and do change per user. My feeling is that
1. This isn't possible
2. This isn't something the installer should be doing, but something the application should be doing (after all what happens when a user profile is created after the install?).
With that in mind, I still want to change as little as possible in the application, so my question is, **is possible to add registry entries for every user in a Visual Studio 2003 setup project?**
And, at the moment the project lists five registry root keys (HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, and User/Machine Hive), I don't really know anything about the Users root key, and haven't seen User/Machine Hive. Can anyone enlighten me on what they are? Perhapes they could solve my problem above. | visual-studio | registry | setup | null | null | null | open | Visual Studio Setup Project - Per User Registry Settings
===
I'm trying to maintain a Setup Project in Visual Studio 2003 (yes, it's a legacy application). The problem we have at the moment is that we need to write registry entries to HKCU for every user on the computer. They need to be in the HKCU rather than HKLM because they are the default user settings, and do change per user. My feeling is that
1. This isn't possible
2. This isn't something the installer should be doing, but something the application should be doing (after all what happens when a user profile is created after the install?).
With that in mind, I still want to change as little as possible in the application, so my question is, **is possible to add registry entries for every user in a Visual Studio 2003 setup project?**
And, at the moment the project lists five registry root keys (HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, and User/Machine Hive), I don't really know anything about the Users root key, and haven't seen User/Machine Hive. Can anyone enlighten me on what they are? Perhapes they could solve my problem above. | 0 |
826 | 08/03/2008 21:08:54 | 101 | 08/01/2008 20:47:39 | 56 | 4 | Efficiently get sorted sums of a sorted list | You have an ascending list of numbers, what is the most efficient algorithm you can think of to get the list of sums of every two numbers in that list. Duplicates in the resulting list are irrelevant, you can remove them or avoid them if you like. | algorithm | language-agnostic | null | null | null | null | open | Efficiently get sorted sums of a sorted list
===
You have an ascending list of numbers, what is the most efficient algorithm you can think of to get the list of sums of every two numbers in that list. Duplicates in the resulting list are irrelevant, you can remove them or avoid them if you like. | 0 |
832 | 08/03/2008 21:22:52 | 224 | 08/03/2008 17:17:37 | 1 | 0 | How do I most elegantly express left join with aggregate SQL as LINQ query | SQL:
select
u.id,
u.name,
isnull(MAX(h.dateCol), '1900-01-01') dateColWithDefault
from universe u
left join history h
on u.id=h.id
and h.dateCol<GETDATE()-1
group by u.Id, u.name | linq | c# | null | null | null | null | open | How do I most elegantly express left join with aggregate SQL as LINQ query
===
SQL:
select
u.id,
u.name,
isnull(MAX(h.dateCol), '1900-01-01') dateColWithDefault
from universe u
left join history h
on u.id=h.id
and h.dateCol<GETDATE()-1
group by u.Id, u.name | 0 |
833 | 08/03/2008 21:23:41 | 186 | 08/03/2008 06:30:23 | 1 | 0 | Editing database records by multiple users | I have designed database tables (normalised, on an MS SQL server) and created a standalone windows front end for an application that will be used by a handful of users to add and edit information. We will add a web interface to allow searching accross our production area at a later date.
I am concerned that if two users start editing the same record then the last to commit the update would be the 'winner' and important information may be lost. A number of solutions come to mind but I'm not sure if I am going to create a bigger headache.
1. Do nothing and hope that two users are never going to be editing the same record at the same time. *- Might never happed but what if it does?*
2. Editing routine could store a copy of the original data as well as the updates and then compare when the user has finished editing. If they differ show user and comfirm update *- Would require two copies of data to be stored.*
3. Add last updated DATETIME column and check it matches when we update, if not then show differences. *- requires new column in each of the relevant tables.*
4. Create an editing table that registers when users start editing a record that will be checked and prevent other users from editing same record. *- would require carful thought of program flow to prevent deadlocks and records becoming locked if a user crashes out of the program.*
Are there any better solutions or should I go for one of these? | mssql | database | databases | null | null | null | open | Editing database records by multiple users
===
I have designed database tables (normalised, on an MS SQL server) and created a standalone windows front end for an application that will be used by a handful of users to add and edit information. We will add a web interface to allow searching accross our production area at a later date.
I am concerned that if two users start editing the same record then the last to commit the update would be the 'winner' and important information may be lost. A number of solutions come to mind but I'm not sure if I am going to create a bigger headache.
1. Do nothing and hope that two users are never going to be editing the same record at the same time. *- Might never happed but what if it does?*
2. Editing routine could store a copy of the original data as well as the updates and then compare when the user has finished editing. If they differ show user and comfirm update *- Would require two copies of data to be stored.*
3. Add last updated DATETIME column and check it matches when we update, if not then show differences. *- requires new column in each of the relevant tables.*
4. Create an editing table that registers when users start editing a record that will be checked and prevent other users from editing same record. *- would require carful thought of program flow to prevent deadlocks and records becoming locked if a user crashes out of the program.*
Are there any better solutions or should I go for one of these? | 0 |
835 | 08/03/2008 21:25:09 | 91 | 08/01/2008 17:55:22 | 371 | 29 | CruiseControl.net, msbuild, /p:OutputPatth and CCNetArtifactDirectory | I'm trying to setup CruiseControl.net at the moment. So far it works nice, but I have a Problem with the MSBuild Task.
According to the [Documentation][1], it passes CCNetArtifactDirectory to MSBuild. But how do I use it?
I tried this:
<buildArgs>/noconsolelogger /p:OutputPath=$(CCNetArtifactDirectory)\test</buildArgs>
But that does not work. In fact, it kills the service with this error:
> ThoughtWorks.CruiseControl.Core.Config.Preprocessor.EvaluationException: Reference to unknown symbol CCNetArtifactDirectory
Documentation is rather sparse und mainly deals with modifying the .sln Project file, which is what I want to avoid in order to be able to manually build this project later.
[1]: http://confluence.public.thoughtworks.org/display/CCNET/MsBuild+Task | cruisecontrol.net | msbuild | null | null | null | null | open | CruiseControl.net, msbuild, /p:OutputPatth and CCNetArtifactDirectory
===
I'm trying to setup CruiseControl.net at the moment. So far it works nice, but I have a Problem with the MSBuild Task.
According to the [Documentation][1], it passes CCNetArtifactDirectory to MSBuild. But how do I use it?
I tried this:
<buildArgs>/noconsolelogger /p:OutputPath=$(CCNetArtifactDirectory)\test</buildArgs>
But that does not work. In fact, it kills the service with this error:
> ThoughtWorks.CruiseControl.Core.Config.Preprocessor.EvaluationException: Reference to unknown symbol CCNetArtifactDirectory
Documentation is rather sparse und mainly deals with modifying the .sln Project file, which is what I want to avoid in order to be able to manually build this project later.
[1]: http://confluence.public.thoughtworks.org/display/CCNET/MsBuild+Task | 0 |
842 | 08/03/2008 21:37:13 | 40 | 08/01/2008 12:48:12 | 139 | 22 | Best way to implement unit testing in PHP | I'd really like to start implementing Unit Testing in my projects. I don't know how viable this is to do in PHP. If anyone has done this, how was it implemented? Did it increase productivity? | php | unit-testing | null | null | null | 06/19/2012 17:52:00 | not constructive | Best way to implement unit testing in PHP
===
I'd really like to start implementing Unit Testing in my projects. I don't know how viable this is to do in PHP. If anyone has done this, how was it implemented? Did it increase productivity? | 4 |
845 | 08/03/2008 21:42:37 | 238 | 08/03/2008 21:42:37 | 1 | 0 | Detecting font in javascript | Suppose I have the following css rule in my html
<pre>body { font-family:Calibri,Trebuchet MS,Helvetica,sans-serif; }</pre>
How can I detect which one of the defined fonts was used in the user's browser? | javascript | css | null | null | null | null | open | Detecting font in javascript
===
Suppose I have the following css rule in my html
<pre>body { font-family:Calibri,Trebuchet MS,Helvetica,sans-serif; }</pre>
How can I detect which one of the defined fonts was used in the user's browser? | 0 |
855 | 08/03/2008 22:03:37 | 93 | 08/01/2008 18:23:58 | 116 | 2 | .Net XML comment into API Documentation | Is there an easy way to produce MSDN-style documentation from the Visual Studio XML output? I'm not patient enough to set up a good xslt for it because I know I'm not the first person to cross this bridge. Also, I tried setting up sandcastle recently, but it really made my eyes cross. Either I was missing something important in the process or it is just way too involved.
I know somebody out there has a really nice dead-simple solution. | visual-studio | documentation | xslt | sandcastle | null | null | open | .Net XML comment into API Documentation
===
Is there an easy way to produce MSDN-style documentation from the Visual Studio XML output? I'm not patient enough to set up a good xslt for it because I know I'm not the first person to cross this bridge. Also, I tried setting up sandcastle recently, but it really made my eyes cross. Either I was missing something important in the process or it is just way too involved.
I know somebody out there has a really nice dead-simple solution. | 0 |
871 | 08/03/2008 22:38:29 | 203 | 08/03/2008 13:26:47 | 1 | 1 | Why is git better than Subversion? | I've been using Subversion for a few years and after using SourceSafe, I just love Subversion. Combined with TortoiseSVN, I can't really imagine how it could be any better. Yet there's a growing number of developers claiming that Subversion has problems and that we should be moving to the new breed of distributed version control systems, such as [Git][1]. Can anyone explain how Git improves upon Subversion?
[1]: http://git.or.cz/ "Git Distributed Version Control System" | subversion | git | null | null | null | null | open | Why is git better than Subversion?
===
I've been using Subversion for a few years and after using SourceSafe, I just love Subversion. Combined with TortoiseSVN, I can't really imagine how it could be any better. Yet there's a growing number of developers claiming that Subversion has problems and that we should be moving to the new breed of distributed version control systems, such as [Git][1]. Can anyone explain how Git improves upon Subversion?
[1]: http://git.or.cz/ "Git Distributed Version Control System" | 0 |
879 | 08/03/2008 22:51:41 | 58 | 08/01/2008 13:56:33 | 461 | 22 | PHP Variables passed by value or by reference? | I had a Java developer new to PHP ask me this question the other day, so I thought I'd document the answer here.
Question: are PHP variables passed by value or by reference? | php | variables | byreference | byvalue | null | null | open | PHP Variables passed by value or by reference?
===
I had a Java developer new to PHP ask me this question the other day, so I thought I'd document the answer here.
Question: are PHP variables passed by value or by reference? | 0 |
888 | 08/03/2008 23:18:21 | 131 | 08/02/2008 08:58:50 | 1 | 0 | How do you debug PHP scripts? | How do you debug your PHP script?
I am aware of basic debugging such as using the Error Reporting. The breakpoint debugging in PHPEclipse is also quite useful. Any other good/better techniques out there? | php | debugging | null | null | null | null | open | How do you debug PHP scripts?
===
How do you debug your PHP script?
I am aware of basic debugging such as using the Error Reporting. The breakpoint debugging in PHPEclipse is also quite useful. Any other good/better techniques out there? | 0 |
898 | 08/04/2008 00:08:51 | 200 | 08/03/2008 12:55:49 | 84 | 8 | Internationalization in your projects | How have you implement Internationalization (18n) in actual projects you've worked on? I took an interest in making software cross-cultural after I read the famous post by Joel, [The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)][1]. However I have yet to able to take advantage of this in a real project besides making sure I used Unicode strings where possible. But making all your strings Unicode and ensuring you understand what encoding everything you work with is in is just the tip of the i18n iceberg.
Everything I have worked on to date has been for use by a controlled set of US English speaking people or i18n just wasn't someone we had time to work on before pushing the project live. So I am looking for any tips or war stories people have about making software more localized in real world projects.
[1]: http://www.joelonsoftware.com/articles/Unicode.html | language-agnostic | unicode | internationalization | null | null | null | open | Internationalization in your projects
===
How have you implement Internationalization (18n) in actual projects you've worked on? I took an interest in making software cross-cultural after I read the famous post by Joel, [The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)][1]. However I have yet to able to take advantage of this in a real project besides making sure I used Unicode strings where possible. But making all your strings Unicode and ensuring you understand what encoding everything you work with is in is just the tip of the i18n iceberg.
Everything I have worked on to date has been for use by a controlled set of US English speaking people or i18n just wasn't someone we had time to work on before pushing the project live. So I am looking for any tips or war stories people have about making software more localized in real world projects.
[1]: http://www.joelonsoftware.com/articles/Unicode.html | 0 |
899 | 08/04/2008 00:09:39 | 137 | 08/02/2008 10:46:12 | 94 | 12 | Best subversion client for Mac OS | On Windows, Tortoise SVN is the daddy, no question. On the Mac there is nothing as simple and integrated, but there is a fair choice of tools. Which GUI clients are worth checking out and why? | subversion | null | null | null | null | 10/13/2011 15:58:20 | not constructive | Best subversion client for Mac OS
===
On Windows, Tortoise SVN is the daddy, no question. On the Mac there is nothing as simple and integrated, but there is a fair choice of tools. Which GUI clients are worth checking out and why? | 4 |
904 | 08/04/2008 00:17:34 | 34 | 08/01/2008 12:39:52 | 807 | 41 | In HTML, how to word-break on a dash? | give a relatively simple css:
<div style="width:150px;">
12333-2333-233-23339392-332332323
</div>
How do I make it so that the string stays constrained to the width of 150, and simply wraps to a newline on the hyphen? | html | css | null | null | null | null | open | In HTML, how to word-break on a dash?
===
give a relatively simple css:
<div style="width:150px;">
12333-2333-233-23339392-332332323
</div>
How do I make it so that the string stays constrained to the width of 150, and simply wraps to a newline on the hyphen? | 0 |
905 | 08/04/2008 00:17:55 | 204 | 08/03/2008 13:27:56 | 55 | 4 | Client collation and SQL Server 2005 | We're upgrading an existing program from Win2k/SQL Server 2k to Windows 2003 and SQL Server 2005 as well as purchasing a new program that also uses 2k3/2k5. The vendor says that for us to host both databases we need to get the Enterprise version because the softwares clients use different collation for the connections and only Enterprise supports this.
I cannot find anything on MS's site to support this and, honestly, don't want to pay the extra for Enterprise if the Standard edition works. Am I missing some not talked about feature of SQL Server or is this, as I suspect, a vendor trying to upsell me? | sql-server | mssql | windows-server-2003 | null | null | null | open | Client collation and SQL Server 2005
===
We're upgrading an existing program from Win2k/SQL Server 2k to Windows 2003 and SQL Server 2005 as well as purchasing a new program that also uses 2k3/2k5. The vendor says that for us to host both databases we need to get the Enterprise version because the softwares clients use different collation for the connections and only Enterprise supports this.
I cannot find anything on MS's site to support this and, honestly, don't want to pay the extra for Enterprise if the Standard edition works. Am I missing some not talked about feature of SQL Server or is this, as I suspect, a vendor trying to upsell me? | 0 |
918 | 08/04/2008 00:33:54 | 243 | 08/03/2008 23:49:51 | 11 | 2 | How to learn Python: Good Example Code? | I have been dabbling in Python for a couple months now, read the online docs/tutorial and started playing with Django a bit as well... and I feel like I am starting to leave my formative toddler years and ready for some more serious code. Most everything I see is generally encapsulated in a single script or so large and unwieldy I don't know where to start.
I would really like to see an excellent example of some proper Python code, style, organization etc. and ideally a WHY associated with some of those decisions. Any ideas for where I should look next? I would prefer a simple console app with at most just a few extra .py files (maybe one package for good measure)...
Oh, and one more thing: The reason this is coming up is I have quite a bit of experience in Java and .NET where it is generally preferred to have one class definition per source file. That rarely seems to be the case in the python world (at least in my very limited exposure) and it just doesn't smell right to me. So maybe this is more Enterprise Python that hobbyist python or something. | python | null | null | null | null | 05/14/2012 17:06:07 | not constructive | How to learn Python: Good Example Code?
===
I have been dabbling in Python for a couple months now, read the online docs/tutorial and started playing with Django a bit as well... and I feel like I am starting to leave my formative toddler years and ready for some more serious code. Most everything I see is generally encapsulated in a single script or so large and unwieldy I don't know where to start.
I would really like to see an excellent example of some proper Python code, style, organization etc. and ideally a WHY associated with some of those decisions. Any ideas for where I should look next? I would prefer a simple console app with at most just a few extra .py files (maybe one package for good measure)...
Oh, and one more thing: The reason this is coming up is I have quite a bit of experience in Java and .NET where it is generally preferred to have one class definition per source file. That rarely seems to be the case in the python world (at least in my very limited exposure) and it just doesn't smell right to me. So maybe this is more Enterprise Python that hobbyist python or something. | 4 |
930 | 08/04/2008 00:47:25 | 245 | 08/04/2008 00:38:47 | 1 | 0 | How do I connect to a database and loop over a recordset in C#? | What's the simplest way to connect and query a database for a set of records in C#? | database | connection | null | null | null | null | open | How do I connect to a database and loop over a recordset in C#?
===
What's the simplest way to connect and query a database for a set of records in C#? | 0 |
935 | 08/04/2008 01:00:24 | 246 | 08/04/2008 00:47:32 | 1 | 0 | String literals and escape characters in postgresql | Attempting to insert an escape character into a table results in a warning and the string being truncated at the escape character. For example:
create table EscapeTest (text varchar(50));
insert into EscapeTest (text) values ('This will be inserted \n This will not be');
Produces the warning:
WARNING: nonstandard use of escape in a string literal
(Using PSQL 8.2)
Anyone know how to get around this? | postgresql | null | null | null | null | null | open | String literals and escape characters in postgresql
===
Attempting to insert an escape character into a table results in a warning and the string being truncated at the escape character. For example:
create table EscapeTest (text varchar(50));
insert into EscapeTest (text) values ('This will be inserted \n This will not be');
Produces the warning:
WARNING: nonstandard use of escape in a string literal
(Using PSQL 8.2)
Anyone know how to get around this? | 0 |
944 | 08/04/2008 01:15:38 | 233 | 08/03/2008 20:19:32 | 3 | 2 | Unhandled Exception Handler in .NET 1.1 | I'm maintaining a .NET 1.1 application, and one of the things I've been tasked with is making sure the user doesn't see any unfriendly error notifications.
I've added handlers to Application.ThreadException and AppDomain.CurrentDomain.UnhandledException, which do get called. My problem is that the standard CLR is still displayed (before the exception handler is called).
Jeff talks about this problem on his blog [here][1] and [here][2]. But there's no solution. So what is the standard way in .NET 1.1 to handle uncaught exceptions and display a friendly dialog box?
[1]: http://www.codinghorror.com/blog/archives/000201.html
[2]: http://www.codinghorror.com/blog/archives/000216.html | .net | .net1.1 | exception | c# | null | null | open | Unhandled Exception Handler in .NET 1.1
===
I'm maintaining a .NET 1.1 application, and one of the things I've been tasked with is making sure the user doesn't see any unfriendly error notifications.
I've added handlers to Application.ThreadException and AppDomain.CurrentDomain.UnhandledException, which do get called. My problem is that the standard CLR is still displayed (before the exception handler is called).
Jeff talks about this problem on his blog [here][1] and [here][2]. But there's no solution. So what is the standard way in .NET 1.1 to handle uncaught exceptions and display a friendly dialog box?
[1]: http://www.codinghorror.com/blog/archives/000201.html
[2]: http://www.codinghorror.com/blog/archives/000216.html | 0 |
947 | 08/04/2008 01:22:49 | 243 | 08/03/2008 23:49:51 | 41 | 5 | How to use a mutex in Visual Basic | OK - I have imported the kernel32 library so I have the createMutex function available, but I am not quite sure of the various parameters and return values. This is classic Visual Basic, not Visual Basic.NET - but I can probably work with either code set in the form of an answer. | visualbasic | vb | null | null | null | null | open | How to use a mutex in Visual Basic
===
OK - I have imported the kernel32 library so I have the createMutex function available, but I am not quite sure of the various parameters and return values. This is classic Visual Basic, not Visual Basic.NET - but I can probably work with either code set in the form of an answer. | 0 |
959 | 08/04/2008 01:55:02 | 203 | 08/03/2008 13:26:47 | 15 | 1 | Are IT conferences useful? | I’ve had the opportunity to attend several conferences. Some were OK, but most of time, I feel like I could have learned a lot more from reading a book or 2. The worst example was VSLive. It cost my company several thousand dollars to send me and I feel like I came away with virtually no new information. At a recent Visual Studio "launch event", one of the speakers did a quick poll and determined that most people were attending for the free software (we got a copy of Visual Studio) or to get a day off work. Are IT conferences useful or a waste of time? | conferences | null | null | null | null | 06/29/2010 14:09:01 | not constructive | Are IT conferences useful?
===
I’ve had the opportunity to attend several conferences. Some were OK, but most of time, I feel like I could have learned a lot more from reading a book or 2. The worst example was VSLive. It cost my company several thousand dollars to send me and I feel like I came away with virtually no new information. At a recent Visual Studio "launch event", one of the speakers did a quick poll and determined that most people were attending for the free software (we got a copy of Visual Studio) or to get a day off work. Are IT conferences useful or a waste of time? | 4 |
972 | 08/04/2008 02:17:51 | 145 | 08/02/2008 14:40:17 | 24 | 5 | Adding a Method to an Existing Object | I've read that it is possible to add a method to an existing object (e.g. not in the class definition) in **python**, I think this is called Monkey Patching (or in some cases Duck Punching). I understand that it's not always a good decision to do so. But, how might one do this?
And if you don't know python, can your language of choice do this? If so, how? | python | oop | null | null | null | null | open | Adding a Method to an Existing Object
===
I've read that it is possible to add a method to an existing object (e.g. not in the class definition) in **python**, I think this is called Monkey Patching (or in some cases Duck Punching). I understand that it's not always a good decision to do so. But, how might one do this?
And if you don't know python, can your language of choice do this? If so, how? | 0 |
1,005 | 08/04/2008 03:34:02 | 85 | 08/01/2008 16:38:08 | 1 | 0 | get root permissions on a file inside of vi? | Often while editing config files, I'll open one with vi and then when I go to save it realize that I didn't type
sudo vi filename
Is there any way to give vi sudo privileges to save the file? I seem to recall seeing something about this while looking up some stuff about vi a while ago, but now I can't find it. | linux | unix | vi | null | null | null | open | get root permissions on a file inside of vi?
===
Often while editing config files, I'll open one with vi and then when I go to save it realize that I didn't type
sudo vi filename
Is there any way to give vi sudo privileges to save the file? I seem to recall seeing something about this while looking up some stuff about vi a while ago, but now I can't find it. | 0 |
1,010 | 08/04/2008 03:59:42 | 67 | 08/01/2008 14:49:18 | 1 | 0 | How to get the value of built, encoded ViewState? | I need to grab the base64-encoded representation of the ViewState. Obviously this would not be available until fairly late in the request lifecycle, which is OK.
For example, if the output of the page includes:
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJODU0Njc5MD...==" />
I need a way on the server side to get the value "/wEPDwUJODU0Njc5MD...==" | c# | asp.net | null | null | null | null | open | How to get the value of built, encoded ViewState?
===
I need to grab the base64-encoded representation of the ViewState. Obviously this would not be available until fairly late in the request lifecycle, which is OK.
For example, if the output of the page includes:
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJODU0Njc5MD...==" />
I need a way on the server side to get the value "/wEPDwUJODU0Njc5MD...==" | 0 |
1,024 | 08/04/2008 04:48:38 | 234 | 08/03/2008 20:25:38 | 68 | 9 | How do I fix 'Unprocessed view path found' error with ExceptionNotifier plugin in rails 2.1? | After upgrading a rails 1.2 website to 2.1, the [ExceptionNotifier plugin](http://agilewebdevelopment.com/plugins/exception_notifier) no longer works, complaining about this error:
ActionView::TemplateFinder::InvalidViewPath:
Unprocessed view path found: "/path/to/appname/vendor/plugins/exception_notification/lib/../views". Set your view paths with #append_view_path, #prepend_view_path, or #view_paths=.
What causes it and how do I fix it? | ruby | ruby-on-rails | exception | rubyonrails | plug-ins | null | open | How do I fix 'Unprocessed view path found' error with ExceptionNotifier plugin in rails 2.1?
===
After upgrading a rails 1.2 website to 2.1, the [ExceptionNotifier plugin](http://agilewebdevelopment.com/plugins/exception_notifier) no longer works, complaining about this error:
ActionView::TemplateFinder::InvalidViewPath:
Unprocessed view path found: "/path/to/appname/vendor/plugins/exception_notification/lib/../views". Set your view paths with #append_view_path, #prepend_view_path, or #view_paths=.
What causes it and how do I fix it? | 0 |
1,033 | 08/04/2008 05:15:35 | 87 | 08/01/2008 16:59:16 | 6 | 1 | IP to Country? | Does anyone know of a simple way to retrieve the country for a given IP Address? Preferably in ISO_3166-1 format? | ip | lookup | country | iso-3166-1-alpha-2 | null | null | open | IP to Country?
===
Does anyone know of a simple way to retrieve the country for a given IP Address? Preferably in ISO_3166-1 format? | 0 |
1,037 | 08/04/2008 05:35:52 | 231 | 08/03/2008 19:35:19 | 1 | 1 | Displaying Flash content in a C# WinForms application | What is the best way to display Flash content in a C# WinForms application? I would like to create a user control (similar to the current PictureBox) that will be able to display images and flash content.
It would be great to be able to load the flash content from a stream of sorts rather than a file on disk. | c# | flash | winforms | null | null | null | open | Displaying Flash content in a C# WinForms application
===
What is the best way to display Flash content in a C# WinForms application? I would like to create a user control (similar to the current PictureBox) that will be able to display images and flash content.
It would be great to be able to load the flash content from a stream of sorts rather than a file on disk. | 0 |
1,040 | 08/04/2008 05:45:22 | 254 | 08/04/2008 05:45:21 | 1 | 0 | How do I delete a file which is locked by another process in c#? | I'm looking for a way to delete a file which is locked by another process using C#. I suspect the method must be able to find which process is locking the file (perhaps by tracking the handles, although im not sure how to do this in c#) then close that process before been able to complete the file delete using File.Delete()
Many thanks | c# | filesystems | delete | null | null | null | open | How do I delete a file which is locked by another process in c#?
===
I'm looking for a way to delete a file which is locked by another process using C#. I suspect the method must be able to find which process is locking the file (perhaps by tracking the handles, although im not sure how to do this in c#) then close that process before been able to complete the file delete using File.Delete()
Many thanks | 0 |
1,041 | 08/04/2008 05:50:00 | 90 | 08/01/2008 17:44:12 | 50 | 6 | Easy-to-Use Regular Expression Support in C++? | I'm looking for a robust, easy-to-use, regular expression evaluator for native C++, either platform-independent or Windows-specific.
Requirements:
- Can't use Boost or ACE regex libraries (unfortunately)
- Can't use .NET Regex (or any managed code)
The main requirement is that it should be standalone and open.
ANY help is appreciated.
Thanks! | windows | c++ | regex | regularexpression | null | null | open | Easy-to-Use Regular Expression Support in C++?
===
I'm looking for a robust, easy-to-use, regular expression evaluator for native C++, either platform-independent or Windows-specific.
Requirements:
- Can't use Boost or ACE regex libraries (unfortunately)
- Can't use .NET Regex (or any managed code)
The main requirement is that it should be standalone and open.
ANY help is appreciated.
Thanks! | 0 |
1,042 | 08/04/2008 05:51:56 | 2 | 07/31/2008 14:22:31 | 216 | 2 | Why doesn't SQL Full Text Indexing return results for words containing #? | For instance, my query is like the following using SQL Server 2005:
SELECT * FROM Table WHERE FREETEXT(SearchField, 'c#')
I have a full text index defined to use the column SearchField which returns results when using:
SELECT * FROM Table WHERE SearchField LIKE '%c#%'
I believe # is a special letter, so how do I allow FREETEXT to work correctly for the query above? | mssql | indexing | query | null | null | null | open | Why doesn't SQL Full Text Indexing return results for words containing #?
===
For instance, my query is like the following using SQL Server 2005:
SELECT * FROM Table WHERE FREETEXT(SearchField, 'c#')
I have a full text index defined to use the column SearchField which returns results when using:
SELECT * FROM Table WHERE SearchField LIKE '%c#%'
I believe # is a special letter, so how do I allow FREETEXT to work correctly for the query above? | 0 |
1,053 | 08/04/2008 06:21:38 | 13 | 08/01/2008 04:18:04 | 384 | 18 | A little diversion into floating point (im)precision, part 1 | Most mathematicians agree that e ** (πi) + 1 = 0. However, most floating point implementations disagree. How well can we settle this dispute?
I'm keen to hear about different languages and implementations, and various methods to make the result as close to zero as possible. Be creative! | language-agnostic | math | floating-point | fun | challenge | null | open | A little diversion into floating point (im)precision, part 1
===
Most mathematicians agree that e ** (πi) + 1 = 0. However, most floating point implementations disagree. How well can we settle this dispute?
I'm keen to hear about different languages and implementations, and various methods to make the result as close to zero as possible. Be creative! | 0 |
1,064 | 08/04/2008 06:51:20 | 90 | 08/01/2008 17:44:12 | 65 | 8 | How To Display 100 Floating Cubes Using DirectX OR OpenGL? | I'd like to display ~100 floating cubes using DirectX or OpenGL.
I'm looking for either some sample source code, or a description of the technique. I know this kind of thing is easy for you accomplished 3D gurus out there but I have enough trouble getting even one cube to display correctly.
I've combed the net for a good series of tutorials and although they talk about how to do 3D primitives, what I can't find is information on how to do large numbers of 3D primitives - cubes, spheres, pyramids, and so forth.
Thanks! Any help is appreciated. | language-agnostic | opengl | 3d | directx | null | null | open | How To Display 100 Floating Cubes Using DirectX OR OpenGL?
===
I'd like to display ~100 floating cubes using DirectX or OpenGL.
I'm looking for either some sample source code, or a description of the technique. I know this kind of thing is easy for you accomplished 3D gurus out there but I have enough trouble getting even one cube to display correctly.
I've combed the net for a good series of tutorials and although they talk about how to do 3D primitives, what I can't find is information on how to do large numbers of 3D primitives - cubes, spheres, pyramids, and so forth.
Thanks! Any help is appreciated. | 0 |
1,069 | 08/04/2008 07:30:01 | 257 | 08/04/2008 07:30:01 | 1 | 0 | Heap corruption under Win32; how to locate? | I'm working on a **multithreaded** C++ application that is corrupting the heap. The usual tools to locate this corruption seem to be inapplicable. Old builds (18 months old) of the source code exhibit the same behaviour as the most recent release, so this has been around for a long time and just wasn't noticed; on the downside, source deltas can't be used to identify
The prompt for crashing behaviuor is to generate throughput in this system - socket transfer of data which is munged into an internal representation. I have a set of test data that will periodically cause the app to exception (various places, various causes - including heap alloc failing, thus: heap corruption).
The behaviour seems related to CPU power or memory bandwidth; the more of each the machine has, the easier it is to crash. Disabling a hyper-threading core or a dual-core core reduces the rate of (but does not eliminate) corruption. This suggests a timing related issue.
Now here's the rub:
When it's run under a lightweight debug environment (say Visual Studio 98 / AKA MSVC6) the heap corruption is reasonably easy to reproduce - ten or fifteen minutes pass before something fails horrendously and exceptions, like an alloc; when running under a sophisticated debug environment (Rational Purify, VS2008/MSVC9 or even Microsoft Application Verifier) the system becomes memory-speed bound and doesn't crash (Memory-bound: CPU is not getting above 50%, disk light is not on, the program's going as fast it can, box consuming 1.3G of 2G of RAM). So, **I've got a choice between being able to reproduce the problem (but not identify the cause) or being able to idenify the cause or a problem I can't reproduce.**
My current best guesses as to where to next is:
1. Get an insanely grunty box (to replace the current dev box: 2Gb RAM in an E6550 Core2 Duo); this will make it possible to repro the crash causing mis-behaviour when running under a powerful debug environment; or
2. Rewrite operators new and delete to use VirtualAlloc and VirtualProtect to mark memory as read-only as soon as it's done with. Run under MSVC6 and have the OS catch the bad-guy who's writing to freed memory. Yes, this is a sign of desperation: who the hell rewrites new and delete?! I wonder if this is going to make it as slow as under Purify et al.
And, no: Shipping with Purify instrumentation built in is not an option.
A collegue just walked past and asked "Stack Overflow? Are we getting stack overflows now?!?"
And now, the question: **How do I locate the heap corruptor?** | c++ | debugging | heap | windows | purify | null | open | Heap corruption under Win32; how to locate?
===
I'm working on a **multithreaded** C++ application that is corrupting the heap. The usual tools to locate this corruption seem to be inapplicable. Old builds (18 months old) of the source code exhibit the same behaviour as the most recent release, so this has been around for a long time and just wasn't noticed; on the downside, source deltas can't be used to identify
The prompt for crashing behaviuor is to generate throughput in this system - socket transfer of data which is munged into an internal representation. I have a set of test data that will periodically cause the app to exception (various places, various causes - including heap alloc failing, thus: heap corruption).
The behaviour seems related to CPU power or memory bandwidth; the more of each the machine has, the easier it is to crash. Disabling a hyper-threading core or a dual-core core reduces the rate of (but does not eliminate) corruption. This suggests a timing related issue.
Now here's the rub:
When it's run under a lightweight debug environment (say Visual Studio 98 / AKA MSVC6) the heap corruption is reasonably easy to reproduce - ten or fifteen minutes pass before something fails horrendously and exceptions, like an alloc; when running under a sophisticated debug environment (Rational Purify, VS2008/MSVC9 or even Microsoft Application Verifier) the system becomes memory-speed bound and doesn't crash (Memory-bound: CPU is not getting above 50%, disk light is not on, the program's going as fast it can, box consuming 1.3G of 2G of RAM). So, **I've got a choice between being able to reproduce the problem (but not identify the cause) or being able to idenify the cause or a problem I can't reproduce.**
My current best guesses as to where to next is:
1. Get an insanely grunty box (to replace the current dev box: 2Gb RAM in an E6550 Core2 Duo); this will make it possible to repro the crash causing mis-behaviour when running under a powerful debug environment; or
2. Rewrite operators new and delete to use VirtualAlloc and VirtualProtect to mark memory as read-only as soon as it's done with. Run under MSVC6 and have the OS catch the bad-guy who's writing to freed memory. Yes, this is a sign of desperation: who the hell rewrites new and delete?! I wonder if this is going to make it as slow as under Purify et al.
And, no: Shipping with Purify instrumentation built in is not an option.
A collegue just walked past and asked "Stack Overflow? Are we getting stack overflows now?!?"
And now, the question: **How do I locate the heap corruptor?** | 0 |
1,070 | 08/04/2008 07:34:44 | 236 | 08/03/2008 20:50:07 | 1 | 2 | Process size on UNIX | What is the correct way to get the process size on Solaris, HP-UX and AIX? Should we use top or ps -o vsz or something else? | unix | size | null | null | null | null | open | Process size on UNIX
===
What is the correct way to get the process size on Solaris, HP-UX and AIX? Should we use top or ps -o vsz or something else? | 0 |
1,083 | 08/04/2008 08:21:42 | 260 | 08/04/2008 08:21:41 | 1 | 0 | Bayesian filtering for spam | I was wondering if there is any good and clean oo implementation of bayesian filtering for spam and text classification? | spam | ai | null | null | null | null | open | Bayesian filtering for spam
===
I was wondering if there is any good and clean oo implementation of bayesian filtering for spam and text classification? | 0 |
1,085 | 08/04/2008 08:24:46 | 214 | 08/03/2008 15:12:30 | 1 | 4 | Free OCR library | Does anyone know of a good free or cheap (under £100/$200) OCR library? It needs to run on Windows and preferably be a .NET library, though a COM interface is fine. | .net | ocr | null | null | null | 06/05/2012 23:22:07 | not constructive | Free OCR library
===
Does anyone know of a good free or cheap (under £100/$200) OCR library? It needs to run on Windows and preferably be a .NET library, though a COM interface is fine. | 4 |
1,104 | 08/04/2008 10:01:37 | 236 | 08/03/2008 20:50:07 | 6 | 2 | Exceptions in C++ | <p>Exceptions in C++ don't need to be catched (no compile time errors) by the calling function. So its up to developer's judgment whether to catch it using try/catch (unlike in Java). </p>
<p>Is there a way one can ensure that the exceptions thrown are always caught using try/catch by the calling function?</p> | c++ | exception | null | null | null | null | open | Exceptions in C++
===
<p>Exceptions in C++ don't need to be catched (no compile time errors) by the calling function. So its up to developer's judgment whether to catch it using try/catch (unlike in Java). </p>
<p>Is there a way one can ensure that the exceptions thrown are always caught using try/catch by the calling function?</p> | 0 |
1,108 | 08/04/2008 10:07:12 | 264 | 08/04/2008 09:58:18 | 1 | 0 | How does database indexing work? | **Why is it needed?**
When data is stored on disk based storage devices, it is stored as blocks of data. These blocks are accessed in their entirety, making them the atomic disk access operation. Disk blocks are structured in much the same way as linked lists; both contain a section for data, a pointer to the location of the next node (or block), and both need not be stored contiguously.
Due to the fact that a number of records can only be sorted on one field, we can state that searching on a field that isn’t sorted requires a Linear Search which requires N/2 block accesses, where N is the number of blocks that the table spans. If that field is a non-key field (i.e. doesn’t contain unique entries) then the entire table space must be searched at N block accesses.
Whereas with a sorted field, a Binary Search may be used, this has log2 N block accesses. Also since the data is sorted given a non-key field, the rest of the table doesn’t need to be searched for duplicate values, once a higher value is found. Thus the performance increase is substantial.
**What is indexing?**
Indexing is a way of sorting a number of records on multiple fields. Creating an index on a field in a table creates another data structure which holds the field value, and pointer to the record it relates to. This index structure is then sorted, allowing Binary Searches to be performed on it.
The downside to indexing is that these indexes require additional space on the disk, since the indexes are stored together in a MyISAM database, this file can quickly reach the size limits of the underlying file system if many fields within the same table are indexed.
**How does it work?**
Firstly, let’s outline a sample database table schema;
<pre>
Field name Data type Size on disk
id (Primary key) Unsigned INT 4 bytes
firstName Char(50) 50 bytes
lastName Char(50) 50 bytes
emailAddress Char(100) 100 bytes
Note: char was used in place of varchar to allow for an accurate size on disk value.
This sample database contains five million rows, and is unindexed. The performance of several queries will now be analyzed. These are a query using the id (a sorted key field) and one using the firstName (a non-key unsorted field).
</pre>
***Example 1***
Given our sample database of r = 5,000,000 records of a fixed size giving a record length of R = 204 bytes and they are stored in a MyISAM database which is using the default block size B = 1,024 bytes. The blocking factor of the table would be bfr = (B/R) = 1024/204 = 5 records per disk block. The total number of blocks required to hold the table is N = (r/bfr) = 5000000/5 = 1,000,000 blocks.
A linear search on the id field would require an average of N/2 = 500,000 block accesses to find a value given that the id field is a key field. But since the id field is also sorted a binary search can be conducted requiring an average of log2 1000000 = 19.93 = 20 block accesses. Instantly we can see this is a drastic improvement.
Now the firstName field is neither sorted, so a binary search is impossible, nor are the values unique, and thus the table will require searching to the end for an exact N = 1,000,000 block accesses. It is this situation that indexing aims to correct.
Given that an index record contains only the indexed field and a pointer to the original record, it stands to reason that it will be smaller than the multi-field record that it points to. So the index itself requires fewer disk blocks that the original table, which therefore requires fewer block accesses to iterate through. The schema for an index on the firstName field is outlined below;
<pre>
Field name Data type Size on disk
firstName Char(50) 50 bytes
(record pointer) Special 4 bytes
Note: Pointers in MySQL are 2, 3, 4 or 5 bytes in length depending on the size of the table.
</pre>
***Example 2***
Given our sample database of r = 5,000,000 records with an index record length of R = 54 bytes and using the default block size B = 1,024 bytes. The blocking factor of the index would be bfr = (B/R) = 1024/54 = 18 records per disk block. The total number of blocks required to hold the table is N = (r/bfr) = 5000000/18 = 277,778 blocks.
Now a search using the firstName field can utilise the index to increase performance. This allows for a binary search of the index with an average of log2 277778 = 18.08 = 19 block accesses. To find the address of the actual record, which requires a further block access to read, bringing the total to 19 + 1 = 20 block accesses, a far cry from the 1,000,000 block accesses required by the non-indexed table.
**When should it be used?**
Given that creating an index requires additional disk space (277,778 blocks extra from the above example), and that too many indexes can cause issues arising from the file systems size limits, careful thought must be used to select the correct fields to index.
Since indexes are only used to speed up the searching for a matching field within the records, it stands to reason that indexing fields used only for output would be simply a waste of disk space and processing time when doing an insert or delete operation, and thus should be avoided. Also given the nature of a binary search, the cardinality or uniqueness of the data is important. Indexing on a field with a cardinality of 2 would split the data in half, whereas a cardinality of 1,000 would return approximately 1,000 records. With such a low cardinality the effectiveness is reduced to a linear sort, and the query optimizer will avoid using the index if the cardinality is greater than 30% of the record number, effectively making the index a waste of space. | databases | indexing | article | null | null | null | open | How does database indexing work?
===
**Why is it needed?**
When data is stored on disk based storage devices, it is stored as blocks of data. These blocks are accessed in their entirety, making them the atomic disk access operation. Disk blocks are structured in much the same way as linked lists; both contain a section for data, a pointer to the location of the next node (or block), and both need not be stored contiguously.
Due to the fact that a number of records can only be sorted on one field, we can state that searching on a field that isn’t sorted requires a Linear Search which requires N/2 block accesses, where N is the number of blocks that the table spans. If that field is a non-key field (i.e. doesn’t contain unique entries) then the entire table space must be searched at N block accesses.
Whereas with a sorted field, a Binary Search may be used, this has log2 N block accesses. Also since the data is sorted given a non-key field, the rest of the table doesn’t need to be searched for duplicate values, once a higher value is found. Thus the performance increase is substantial.
**What is indexing?**
Indexing is a way of sorting a number of records on multiple fields. Creating an index on a field in a table creates another data structure which holds the field value, and pointer to the record it relates to. This index structure is then sorted, allowing Binary Searches to be performed on it.
The downside to indexing is that these indexes require additional space on the disk, since the indexes are stored together in a MyISAM database, this file can quickly reach the size limits of the underlying file system if many fields within the same table are indexed.
**How does it work?**
Firstly, let’s outline a sample database table schema;
<pre>
Field name Data type Size on disk
id (Primary key) Unsigned INT 4 bytes
firstName Char(50) 50 bytes
lastName Char(50) 50 bytes
emailAddress Char(100) 100 bytes
Note: char was used in place of varchar to allow for an accurate size on disk value.
This sample database contains five million rows, and is unindexed. The performance of several queries will now be analyzed. These are a query using the id (a sorted key field) and one using the firstName (a non-key unsorted field).
</pre>
***Example 1***
Given our sample database of r = 5,000,000 records of a fixed size giving a record length of R = 204 bytes and they are stored in a MyISAM database which is using the default block size B = 1,024 bytes. The blocking factor of the table would be bfr = (B/R) = 1024/204 = 5 records per disk block. The total number of blocks required to hold the table is N = (r/bfr) = 5000000/5 = 1,000,000 blocks.
A linear search on the id field would require an average of N/2 = 500,000 block accesses to find a value given that the id field is a key field. But since the id field is also sorted a binary search can be conducted requiring an average of log2 1000000 = 19.93 = 20 block accesses. Instantly we can see this is a drastic improvement.
Now the firstName field is neither sorted, so a binary search is impossible, nor are the values unique, and thus the table will require searching to the end for an exact N = 1,000,000 block accesses. It is this situation that indexing aims to correct.
Given that an index record contains only the indexed field and a pointer to the original record, it stands to reason that it will be smaller than the multi-field record that it points to. So the index itself requires fewer disk blocks that the original table, which therefore requires fewer block accesses to iterate through. The schema for an index on the firstName field is outlined below;
<pre>
Field name Data type Size on disk
firstName Char(50) 50 bytes
(record pointer) Special 4 bytes
Note: Pointers in MySQL are 2, 3, 4 or 5 bytes in length depending on the size of the table.
</pre>
***Example 2***
Given our sample database of r = 5,000,000 records with an index record length of R = 54 bytes and using the default block size B = 1,024 bytes. The blocking factor of the index would be bfr = (B/R) = 1024/54 = 18 records per disk block. The total number of blocks required to hold the table is N = (r/bfr) = 5000000/18 = 277,778 blocks.
Now a search using the firstName field can utilise the index to increase performance. This allows for a binary search of the index with an average of log2 277778 = 18.08 = 19 block accesses. To find the address of the actual record, which requires a further block access to read, bringing the total to 19 + 1 = 20 block accesses, a far cry from the 1,000,000 block accesses required by the non-indexed table.
**When should it be used?**
Given that creating an index requires additional disk space (277,778 blocks extra from the above example), and that too many indexes can cause issues arising from the file systems size limits, careful thought must be used to select the correct fields to index.
Since indexes are only used to speed up the searching for a matching field within the records, it stands to reason that indexing fields used only for output would be simply a waste of disk space and processing time when doing an insert or delete operation, and thus should be avoided. Also given the nature of a binary search, the cardinality or uniqueness of the data is important. Indexing on a field with a cardinality of 2 would split the data in half, whereas a cardinality of 1,000 would return approximately 1,000 records. With such a low cardinality the effectiveness is reduced to a linear sort, and the query optimizer will avoid using the index if the cardinality is greater than 30% of the record number, effectively making the index a waste of space. | 0 |
1,131 | 08/04/2008 10:43:05 | 91 | 08/01/2008 17:55:22 | 683 | 49 | Windows Help files - what are the options? | <p>Back in the old days, Help was not trivial but possible: Generate some funky .rtf file with Special Tags, run it through a compiler, and you got a WinHelp file (.hlp) that actually works really well.</p>
<p>Then, Microsoft decided that WinHelp was not hip and cool anymore and switched to CHM, up to the point they actually axed WinHelp from Vista.</p>
<p>Now, CHM maybe nice, but everyone that tried op open a .chm file on the Network will know the nice "Navigation to the webpage was canceled" screen that is caused by security restrictions.</p>
<p>While there are ways to make CHM work off the network, this is hardly a good choice, because when a user presses the Help Button he wants help and not have to make some funky settings.</p>
<p>Bottom Line: I find CHM absolutely unusable. But with WinHelp not being an option anymore either, I wonder what the alternatives are, especially when it comes to integrate with my Application (i.e. for WinHelp and CHM there are functions that allow you to directly jump to a topic)?</p>
<p>PDF has the disadvantage of requiring the Adobe Reader. I could live with that seeing as this is kinda standard nowadays, but can you tell it reliably to jump to a given page/anchor?</p>
<p>HTML Files seem to be the best choice, you then just have to deal with different browsers (CSS and stuff)</p> | windows | language-agnostic | chm | rant | null | null | open | Windows Help files - what are the options?
===
<p>Back in the old days, Help was not trivial but possible: Generate some funky .rtf file with Special Tags, run it through a compiler, and you got a WinHelp file (.hlp) that actually works really well.</p>
<p>Then, Microsoft decided that WinHelp was not hip and cool anymore and switched to CHM, up to the point they actually axed WinHelp from Vista.</p>
<p>Now, CHM maybe nice, but everyone that tried op open a .chm file on the Network will know the nice "Navigation to the webpage was canceled" screen that is caused by security restrictions.</p>
<p>While there are ways to make CHM work off the network, this is hardly a good choice, because when a user presses the Help Button he wants help and not have to make some funky settings.</p>
<p>Bottom Line: I find CHM absolutely unusable. But with WinHelp not being an option anymore either, I wonder what the alternatives are, especially when it comes to integrate with my Application (i.e. for WinHelp and CHM there are functions that allow you to directly jump to a topic)?</p>
<p>PDF has the disadvantage of requiring the Adobe Reader. I could live with that seeing as this is kinda standard nowadays, but can you tell it reliably to jump to a given page/anchor?</p>
<p>HTML Files seem to be the best choice, you then just have to deal with different browsers (CSS and stuff)</p> | 0 |
1,145 | 08/04/2008 11:06:00 | 188 | 08/03/2008 08:34:56 | 36 | 3 | Why am I getting a malloc: double free error with realloc()? | I've tried to write a string replace function in C, which works on a char * which has been allocated using malloc(). It's a little different in that it will find and replace strings, rather than characters in the starting string.
It's trivial to do if the search and replace strings are the same length (or the replace string is shorter than the search string), since I have enough space allocated. If I try to use realloc(), I get an error that tells me I am doing a double free - which I don't see how I am, since I am only using realloc().
Perhaps a little code will help:
void strrep(char *input, char *search, char *replace) {
int searchLen = strlen(search);
int replaceLen = strlen(replace);
int delta = replaceLen - searchLen;
char *find = input;
while (find = strstr(find, search)) {
if (delta > 0) {
realloc(input, strlen(input) + delta);
find = strstr(input, search);
}
memmove(find + replaceLen, find + searchLen, strlen(input) - (find - input));
memmove(find, replace, replaceLen);
}
}
The program works, until I try to realloc() in an instance where the replaced string will be longer than the initial string. (It still kind of works, it just spits out errors as well as the result).
If it helps, the calling code looks liks:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void strrep(char *input, char *search, char *replace);
int main(void) {
char *input = malloc(81);
while ((fgets(input, 81, stdin)) != NULL) {
strrep(input, "Noel", "Christmas");
}
} | c | malloc | null | null | null | null | open | Why am I getting a malloc: double free error with realloc()?
===
I've tried to write a string replace function in C, which works on a char * which has been allocated using malloc(). It's a little different in that it will find and replace strings, rather than characters in the starting string.
It's trivial to do if the search and replace strings are the same length (or the replace string is shorter than the search string), since I have enough space allocated. If I try to use realloc(), I get an error that tells me I am doing a double free - which I don't see how I am, since I am only using realloc().
Perhaps a little code will help:
void strrep(char *input, char *search, char *replace) {
int searchLen = strlen(search);
int replaceLen = strlen(replace);
int delta = replaceLen - searchLen;
char *find = input;
while (find = strstr(find, search)) {
if (delta > 0) {
realloc(input, strlen(input) + delta);
find = strstr(input, search);
}
memmove(find + replaceLen, find + searchLen, strlen(input) - (find - input));
memmove(find, replace, replaceLen);
}
}
The program works, until I try to realloc() in an instance where the replaced string will be longer than the initial string. (It still kind of works, it just spits out errors as well as the result).
If it helps, the calling code looks liks:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void strrep(char *input, char *search, char *replace);
int main(void) {
char *input = malloc(81);
while ((fgets(input, 81, stdin)) != NULL) {
strrep(input, "Noel", "Christmas");
}
} | 0 |
1,156 | 08/04/2008 11:21:26 | 264 | 08/04/2008 09:58:18 | 106 | 5 | How do I index a database field | Hopefully, I can get answers for each database server.
For an outline of how indexing works check out: <http://stackoverflow.com/questions/1108/how-does-database-indexing-work> | sql | database | indexing | null | null | null | open | How do I index a database field
===
Hopefully, I can get answers for each database server.
For an outline of how indexing works check out: <http://stackoverflow.com/questions/1108/how-does-database-indexing-work> | 0 |
1,160 | 08/04/2008 11:37:24 | 120 | 08/02/2008 06:23:02 | 1 | 1 | Use SVN Revision to label build in CCNET | I am using CCNET on a sample project with SVN as my source control. CCNET is configured to create a build on every check in. CCNET uses MSBuild to build the source code.
I would like to use the latest revision number to generate AssemblyInfo.cs while compiling.
How can I retrieve the latest revision from subversion and use the value in CCNET? | cruisecontrol.net | svn | msbuild | null | null | null | open | Use SVN Revision to label build in CCNET
===
I am using CCNET on a sample project with SVN as my source control. CCNET is configured to create a build on every check in. CCNET uses MSBuild to build the source code.
I would like to use the latest revision number to generate AssemblyInfo.cs while compiling.
How can I retrieve the latest revision from subversion and use the value in CCNET? | 0 |
1,171 | 08/04/2008 12:00:57 | 280 | 08/04/2008 11:49:45 | 1 | 0 | What is the most efficient graph data structure in Python? | I need to be able to manipulate a large (10^7 nodes) graph in python. The data corresponding to each node/edge is minimal, say, a small number of strings. What is the most efficient, in terms of ***memory and speed***, way of doing this?
A dict of dicts is more flexible and simpler to implement, but I intuitively expect a list of lists to be faster. The list option would also require that I keep the data separate from the structure, while dicts would allow for something of the sort:
graph[I][J]["Property"]="value"
What would you suggest? | python | datastructure | performance | graph | null | null | open | What is the most efficient graph data structure in Python?
===
I need to be able to manipulate a large (10^7 nodes) graph in python. The data corresponding to each node/edge is minimal, say, a small number of strings. What is the most efficient, in terms of ***memory and speed***, way of doing this?
A dict of dicts is more flexible and simpler to implement, but I intuitively expect a list of lists to be faster. The list option would also require that I keep the data separate from the structure, while dicts would allow for something of the sort:
graph[I][J]["Property"]="value"
What would you suggest? | 0 |
1,176 | 08/04/2008 12:11:55 | 25 | 08/01/2008 12:15:23 | 29 | 4 | Open Source Ruby Projects | I have just recently started to study Ruby, and in lieu of Jeff's advice over the weekend...
1. Stop theorizing.
2. Write lots of software.
3. Learn from your mistakes.
...I was interested in honing my skills while helping out the Open Source Community the process so I thought I'd ask if anyone have any suggestions for cool/interesting Open Source Projects written in Ruby that you know of or are involved in. | ruby | opensource | null | null | null | null | open | Open Source Ruby Projects
===
I have just recently started to study Ruby, and in lieu of Jeff's advice over the weekend...
1. Stop theorizing.
2. Write lots of software.
3. Learn from your mistakes.
...I was interested in honing my skills while helping out the Open Source Community the process so I thought I'd ask if anyone have any suggestions for cool/interesting Open Source Projects written in Ruby that you know of or are involved in. | 0 |
1,180 | 08/04/2008 12:22:07 | 281 | 08/04/2008 12:13:17 | 1 | 1 | How to make subdomain user accounts in a webapp | I am looking to allow users to control of subdomain of an app I am toying with, much like Basecamp where it is 'customusername.seework.com'.
What is required on the DNS end to allow these to be created dynamically and be available instantly.
And how do you recommend dealing with this in the logic of the site? Htaccess rule to lookup the subdomain in the DB?
thanks | web-applications | dns | user | account | subdomain | null | open | How to make subdomain user accounts in a webapp
===
I am looking to allow users to control of subdomain of an app I am toying with, much like Basecamp where it is 'customusername.seework.com'.
What is required on the DNS end to allow these to be created dynamically and be available instantly.
And how do you recommend dealing with this in the logic of the site? Htaccess rule to lookup the subdomain in the DB?
thanks | 0 |
1,189 | 08/04/2008 12:38:21 | 258 | 08/04/2008 07:59:04 | 1 | 0 | Viewstate invalid when using Safari | Hey guys, just had a bug submitted for a site I maintain which heavily uses the viewstate (not my code). However on certain pages when the viewstate is extra bloated Safari is throwhing the usual "Validation of viewstate MAC failed" error.
Any ideas?? Only happens in Safari, Firefox, IE, Opera all fine. | c# | .net | safari | viewstate | null | null | open | Viewstate invalid when using Safari
===
Hey guys, just had a bug submitted for a site I maintain which heavily uses the viewstate (not my code). However on certain pages when the viewstate is extra bloated Safari is throwhing the usual "Validation of viewstate MAC failed" error.
Any ideas?? Only happens in Safari, Firefox, IE, Opera all fine. | 0 |
1,234 | 08/04/2008 13:40:35 | 296 | 08/04/2008 13:26:48 | 1 | 0 | CSLA Master Class | As anyone ever assisted the CSLA Master Class from Rockford Lhotka? ([www][1]).
<br /><br />
It seems a good way to enforce my OO knowledge in the asp.net field, but since I have to consider the flight to Atlanta and the course's price ($ 2.500), I'm not convinced yet. <br />
<br />
Also, I could barrely find any feedback on the web.<br /><br />
Could anyone share some experience or comments?<br /><br />
Thanks a lot.
[1]: http://www.dunntraining.com/training/cslamasterclass.htm | csla | null | null | null | null | null | open | CSLA Master Class
===
As anyone ever assisted the CSLA Master Class from Rockford Lhotka? ([www][1]).
<br /><br />
It seems a good way to enforce my OO knowledge in the asp.net field, but since I have to consider the flight to Atlanta and the course's price ($ 2.500), I'm not convinced yet. <br />
<br />
Also, I could barrely find any feedback on the web.<br /><br />
Could anyone share some experience or comments?<br /><br />
Thanks a lot.
[1]: http://www.dunntraining.com/training/cslamasterclass.htm | 0 |
1,237 | 08/04/2008 13:47:10 | 230 | 08/03/2008 19:32:46 | 24 | 1 | Regex to pull out a section of text from a file | If i have a file like the following:
> Data Data
> Data
> [Start]
> Data i want
> [End]
> Data
Whats the regex to pull out the data between the [start] and [end] tags | regex | null | null | null | null | null | open | Regex to pull out a section of text from a file
===
If i have a file like the following:
> Data Data
> Data
> [Start]
> Data i want
> [End]
> Data
Whats the regex to pull out the data between the [start] and [end] tags | 0 |
1,241 | 08/04/2008 13:52:25 | 194 | 08/03/2008 10:56:49 | 1 | 0 | Asynchronous multi-direction server-client communication over the same open socket? | I have a client-server app where the client is on a Windows Wobile 6 device, written in C++ and the server is on full Windows and written in C#. Originally, I only needed it to send messages from the client to the server, with the server only ever sending back an acknowledgment that it received the message. Now, I would like to update it so that the server can actually send a message to the client to request data. As I currently have it set up so the client is only in receive mode after it sends data to the server, this doesn't allow for the server to send a request at any time. I would have to wait for client data. My first thought would be to create another thread on the client with a separate open socket, listening for server requests...just like the server already has in respect the the client. Is there a way, within the same thread and using the same socket, to all the server to send requests at any time?
Can you use something to the affect of WaitForMultipleObjects() and pass it a recieve buffer and an event that tells it there is data to be sent? | c# | c++ | sockets | null | null | null | open | Asynchronous multi-direction server-client communication over the same open socket?
===
I have a client-server app where the client is on a Windows Wobile 6 device, written in C++ and the server is on full Windows and written in C#. Originally, I only needed it to send messages from the client to the server, with the server only ever sending back an acknowledgment that it received the message. Now, I would like to update it so that the server can actually send a message to the client to request data. As I currently have it set up so the client is only in receive mode after it sends data to the server, this doesn't allow for the server to send a request at any time. I would have to wait for client data. My first thought would be to create another thread on the client with a separate open socket, listening for server requests...just like the server already has in respect the the client. Is there a way, within the same thread and using the same socket, to all the server to send requests at any time?
Can you use something to the affect of WaitForMultipleObjects() and pass it a recieve buffer and an event that tells it there is data to be sent? | 0 |
1,261 | 08/04/2008 14:06:48 | 292 | 08/04/2008 13:14:31 | 1 | 1 | What are the advantages of using SVN over CVS? | My company currently uses CVS as our defacto standard for source control. I've heard many people say SVN is better, and know that its newer, but other than that am not sure of the benefits. I should note we use primarily java and eclipse if that matters. I guess what I'm looking for a good, succinct comparison of the 2 noting advantages and disadvantes of using both in a java eclipse dev environment? | cvs | svn | subversion | versioncontrol | null | null | open | What are the advantages of using SVN over CVS?
===
My company currently uses CVS as our defacto standard for source control. I've heard many people say SVN is better, and know that its newer, but other than that am not sure of the benefits. I should note we use primarily java and eclipse if that matters. I guess what I'm looking for a good, succinct comparison of the 2 noting advantages and disadvantes of using both in a java eclipse dev environment? | 0 |
1,276 | 08/04/2008 14:31:11 | 30 | 08/01/2008 12:25:44 | 72 | 6 | How big can a MySQL database get before performance starts to degrade. | At what point does a MySQL database start to loose performance?
- Does physical database size matter?
- Do number of records matter?
- Is any performance degradation linear or exponential?
Ive got (what I believe to be) a large database, almost 2GB and about 15M records. Should I be cleaning this out, or am I OK for another few years? | database | mysql | null | null | null | null | open | How big can a MySQL database get before performance starts to degrade.
===
At what point does a MySQL database start to loose performance?
- Does physical database size matter?
- Do number of records matter?
- Is any performance degradation linear or exponential?
Ive got (what I believe to be) a large database, almost 2GB and about 15M records. Should I be cleaning this out, or am I OK for another few years? | 0 |
1,292 | 08/04/2008 14:47:10 | 192 | 08/03/2008 10:15:38 | 101 | 5 | Limit size of Queue<T> in .NET? | I have a Queue<T> object that I have initialised to a capacity of 2, but obviously that is just the capacity and it keeps expanding as I add items. Is there already an object that automatically dequeues an item when the limit is reached, or is the best solution to create my own inherited class? | .net | collections | queue | null | null | null | open | Limit size of Queue<T> in .NET?
===
I have a Queue<T> object that I have initialised to a capacity of 2, but obviously that is just the capacity and it keeps expanding as I add items. Is there already an object that automatically dequeues an item when the limit is reached, or is the best solution to create my own inherited class? | 0 |
1,300 | 08/04/2008 14:55:04 | 91 | 08/01/2008 17:55:22 | 861 | 60 | Is nAnt still supported and suitable for .net 3.5/VS2008? | I am using MSBuild to build my stuff. I want to use CruiseControl.net as by Build Server.
Now, CCNET refers nAnt a lot, but it looks as if ccnet can do most of the stuff nant could do through the project configuration and msbuild. Also, nAnt seems a bit unsupported, with a Beta release that is almost a year old now.
In short: I am actually quite happy with MSBuild (especially since it's the "official" compiler front end) and a bit uncomfortable with nAnt, but I do not want to judge prematurely.
What would be reasons to use nAnt over MSBuild? Especially with ccnet, which seems to overlap a bit with nant in terms of features (and adding the automated build related stuff) | .net | msbuild | nant | null | null | null | open | Is nAnt still supported and suitable for .net 3.5/VS2008?
===
I am using MSBuild to build my stuff. I want to use CruiseControl.net as by Build Server.
Now, CCNET refers nAnt a lot, but it looks as if ccnet can do most of the stuff nant could do through the project configuration and msbuild. Also, nAnt seems a bit unsupported, with a Beta release that is almost a year old now.
In short: I am actually quite happy with MSBuild (especially since it's the "official" compiler front end) and a bit uncomfortable with nAnt, but I do not want to judge prematurely.
What would be reasons to use nAnt over MSBuild? Especially with ccnet, which seems to overlap a bit with nant in terms of features (and adding the automated build related stuff) | 0 |
1,304 | 08/04/2008 14:56:57 | 121 | 08/02/2008 07:34:46 | 1 | 0 | Checking For File Lock in C# | Is there any way to check whether a file is locked without using a try catch block? Right now, the only way I know of is to just open the file and catch any System.IO.IOException. | c# | .net | io | null | null | null | open | Checking For File Lock in C#
===
Is there any way to check whether a file is locked without using a try catch block? Right now, the only way I know of is to just open the file and catch any System.IO.IOException. | 0 |
1,306 | 08/04/2008 14:57:59 | 302 | 08/04/2008 13:39:41 | 20 | 1 | How do I use (n)curses in Ruby? | I'd like to create a progress bar to indicate the status of an a batch job in Ruby. I've read some [tutorials][1] / [libraries][2] on using ncurses, none of which were particularly helpful in explaining how create an "animated" progress bar in the terminal or using curses with Ruby. I'm already aware of using a separate thread to monitor the progress of a given job, I'm just not sure how to proceed with drawing a progress bar.
[1]: http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/ "NCURSES Programming HOWTO"
[2]: http://ncurses-ruby.berlios.de/ "ncurses-ruby" | ruby | unix | curses | null | null | null | open | How do I use (n)curses in Ruby?
===
I'd like to create a progress bar to indicate the status of an a batch job in Ruby. I've read some [tutorials][1] / [libraries][2] on using ncurses, none of which were particularly helpful in explaining how create an "animated" progress bar in the terminal or using curses with Ruby. I'm already aware of using a separate thread to monitor the progress of a given job, I'm just not sure how to proceed with drawing a progress bar.
[1]: http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/ "NCURSES Programming HOWTO"
[2]: http://ncurses-ruby.berlios.de/ "ncurses-ruby" | 0 |
1,311 | 08/04/2008 15:02:41 | 306 | 08/04/2008 14:09:03 | 11 | 1 | Rockbox audio format | How do you specify a callback for rb->pcm_play_data()? | c | audio | rockbox | null | null | null | open | Rockbox audio format
===
How do you specify a callback for rb->pcm_play_data()? | 0 |
1,313 | 08/04/2008 15:08:13 | 65 | 08/01/2008 14:39:27 | 90 | 3 | Followup: Finding an accurate "distance" between colors | [Original Question](http://stackoverflow.com/questions/180/function-for-creating-color-wheels)
I am looking for a function that attempts to quantify how "distant" (or distinct) two colors are. This question is really in two parts:
1. What color space best represents human vision?
2. What distance metric in that space best represents human vision (euclidean?) | language-agnostic | colors | null | null | null | null | open | Followup: Finding an accurate "distance" between colors
===
[Original Question](http://stackoverflow.com/questions/180/function-for-creating-color-wheels)
I am looking for a function that attempts to quantify how "distant" (or distinct) two colors are. This question is really in two parts:
1. What color space best represents human vision?
2. What distance metric in that space best represents human vision (euclidean?) | 0 |
1,314 | 08/04/2008 15:09:07 | 312 | 08/04/2008 15:01:41 | 1 | 0 | Using MSTest with CruseControl.NET | We have been using CrusiseControl for quite a while with NUnit and NAnt. For a recent project we decided to use the testing framework that comes with Visual Studio, which so far has been adequate.
I'm attempting to get the solution running in Cruise Control. I've finally got the build itself to work; however, I have been unable to get any tests to show up in the CruiseControl interface despite adding custom build tasks and components designed to do just that. Does anyone have a definitive link out there to instructions on getting this set up? | cruisecontrol.net | buildprocess | msbuild | null | null | null | open | Using MSTest with CruseControl.NET
===
We have been using CrusiseControl for quite a while with NUnit and NAnt. For a recent project we decided to use the testing framework that comes with Visual Studio, which so far has been adequate.
I'm attempting to get the solution running in Cruise Control. I've finally got the build itself to work; however, I have been unable to get any tests to show up in the CruiseControl interface despite adding custom build tasks and components designed to do just that. Does anyone have a definitive link out there to instructions on getting this set up? | 0 |
1,323 | 08/04/2008 15:14:47 | 65 | 08/01/2008 14:39:27 | 90 | 3 | Followup: "Sorting" colors by distinctiveness | [Original Question](http://stackoverflow.com/questions/180/function-for-creating-color-wheels)
If you are given N maximally distant colors (and some associated distance metric), can you come up with a way to sort those colors into some order such that the first M are also reasonably close to being a maximally distinct set?
In other words, given a bunch of distinct colors, come up with an ordering so I can use as many colors as I need starting at the beginning and be reasonably assured that they are all distinct and that nearby colors are also very distinct (e.g., bluish red isn't next to reddish blue).
Randomizing is OK but certainly not optimal. | colors | language-agnostic | algorithm | null | null | null | open | Followup: "Sorting" colors by distinctiveness
===
[Original Question](http://stackoverflow.com/questions/180/function-for-creating-color-wheels)
If you are given N maximally distant colors (and some associated distance metric), can you come up with a way to sort those colors into some order such that the first M are also reasonably close to being a maximally distinct set?
In other words, given a bunch of distinct colors, come up with an ordering so I can use as many colors as I need starting at the beginning and be reasonably assured that they are all distinct and that nearby colors are also very distinct (e.g., bluish red isn't next to reddish blue).
Randomizing is OK but certainly not optimal. | 0 |
1,329 | 08/04/2008 15:20:42 | 83 | 08/01/2008 16:31:56 | 93 | 13 | What's a better file copy alternative than the Windows default? | I need to copy hundreds of gigs of random files around on my computer and am pretty leery of using the vanilla file copy built into Windows XP.
I don't want it to hang on a "Are you sure?", "Are you really sure?", "Even zip files?", "Surely not read-only files too!" loop as soon as I step away.
I don't want it to work for hours and then stop unexpectedly: "Someone once opened this file and so I won't copy it!" and then cancel the whole copy or just quit with no indication of what was done and what work remains.
What file management programs do you have experience with? Which do you recommend?
This question is related to my other question: [How can I use an old PATA hard disk drive on my newer SATA-only computer?][1]
[1]: http://stackoverflow.com/questions/225/how-can-i-use-an-old-pata-hard-disk-drive-on-my-newer-sata-only-computer | windows | filemanagment | filesystems | file | null | 03/23/2011 14:35:27 | off topic | What's a better file copy alternative than the Windows default?
===
I need to copy hundreds of gigs of random files around on my computer and am pretty leery of using the vanilla file copy built into Windows XP.
I don't want it to hang on a "Are you sure?", "Are you really sure?", "Even zip files?", "Surely not read-only files too!" loop as soon as I step away.
I don't want it to work for hours and then stop unexpectedly: "Someone once opened this file and so I won't copy it!" and then cancel the whole copy or just quit with no indication of what was done and what work remains.
What file management programs do you have experience with? Which do you recommend?
This question is related to my other question: [How can I use an old PATA hard disk drive on my newer SATA-only computer?][1]
[1]: http://stackoverflow.com/questions/225/how-can-i-use-an-old-pata-hard-disk-drive-on-my-newer-sata-only-computer | 2 |
1,376 | 08/04/2008 16:05:29 | 26 | 08/01/2008 12:18:14 | 21 | 5 | Get the current logged in OS user in Adobe Air | I need the name of the current logged in user in my Air/Flex application. The application will only be deployed on Windows machines. I think I could attain this by regexing the User directory, but am open to other ways. | flex | air | null | null | null | null | open | Get the current logged in OS user in Adobe Air
===
I need the name of the current logged in user in my Air/Flex application. The application will only be deployed on Windows machines. I think I could attain this by regexing the User directory, but am open to other ways. | 0 |
1,383 | 08/04/2008 16:27:39 | 314 | 08/04/2008 15:25:23 | 11 | 2 | What is unit testing? | Saw many questions asking 'how' to unittest in a specific language, but no question asking 'what', 'why', and 'when'
* What is it?
* What does it do for me?
* Why should I use it?
* When should I use it (also when not)?
* Common pitfalls/misconceptions | unit-testing | null | null | null | null | null | open | What is unit testing?
===
Saw many questions asking 'how' to unittest in a specific language, but no question asking 'what', 'why', and 'when'
* What is it?
* What does it do for me?
* Why should I use it?
* When should I use it (also when not)?
* Common pitfalls/misconceptions | 0 |
1,384 | 08/04/2008 16:29:23 | 230 | 08/03/2008 19:32:46 | 31 | 1 | Subsonic Vs NHibernate | What is the concensus on when to use one of these tools adversed to the other? I find Subsonic very useful in terms of getting things done quickly, but on large projects it tends not to scale, and its ties your domain model to your database model. That is where Nhibernate comes in as it gives you lightweight POCOs that are unrelated to your database model, but the setup time is much longer. | nhibernate | subsonic | null | null | null | null | open | Subsonic Vs NHibernate
===
What is the concensus on when to use one of these tools adversed to the other? I find Subsonic very useful in terms of getting things done quickly, but on large projects it tends not to scale, and its ties your domain model to your database model. That is where Nhibernate comes in as it gives you lightweight POCOs that are unrelated to your database model, but the setup time is much longer. | 0 |
1,390 | 08/04/2008 16:33:36 | 60 | 08/01/2008 14:04:09 | 170 | 16 | Is Windows Server 2008 "Server Core" appropriate for a MSSQL server? | I'm setting up a dedicated SQL Server 2005 box on Windows Server 2008 this week, and would like to pare it down to be as barebones as possible while still being fully functional.
To that end, the "Server Core" option sounds appealing, but I'm not clear about whether or not I can run SQL Server on that SKU. Several services are addressed on the [Microsoft website][1], but I don't see any indication about SQL Server.
Does anyone know definitively?
[1]: http://www.microsoft.com/windowsserver2008/en/us/compare-core-installation.aspx | mssql | windows-2008 | null | null | null | null | open | Is Windows Server 2008 "Server Core" appropriate for a MSSQL server?
===
I'm setting up a dedicated SQL Server 2005 box on Windows Server 2008 this week, and would like to pare it down to be as barebones as possible while still being fully functional.
To that end, the "Server Core" option sounds appealing, but I'm not clear about whether or not I can run SQL Server on that SKU. Several services are addressed on the [Microsoft website][1], but I don't see any indication about SQL Server.
Does anyone know definitively?
[1]: http://www.microsoft.com/windowsserver2008/en/us/compare-core-installation.aspx | 0 |
1,401 | 08/04/2008 16:44:25 | 149 | 08/02/2008 15:03:56 | 41 | 5 | ASP .Net Custom Client-Side Validation | I have a custom validation function in JavaScript in a user control on a .Net 2.0 web site which checks to see that the fee paid is not in excess of the fee amount due.
I've placed the validator code in the ascx file, and I have also tried using Page.ClientScript.RegisterClientScriptBlock() and in both cases the validation fires, but cannot find the JavaScript function.
The output in Firefox's error console is "feeAmountCheck is not defined". Here is the function (this was taken directly from firefox->view source)
<script type="text/javascript">
function feeAmountCheck(source, arguments)
{
var amountDue = document.getElementById('ctl00_footerContentHolder_Fees1_FeeDue');
var amountPaid = document.getElementById('ctl00_footerContentHolder_Fees1_FeePaid');
if (amountDue.value > 0 && amountDue >= amountPaid)
{
arguments.IsValid = true;
}
else
{
arguments.IsValid = false;
}
return arguments;
}
</script>
Any ideas as to why the function isn't being found? How can I remedy this without having to add the function to my master page or consuming page?
Thanks in advance. | asp.net | javascript | validation | null | null | null | open | ASP .Net Custom Client-Side Validation
===
I have a custom validation function in JavaScript in a user control on a .Net 2.0 web site which checks to see that the fee paid is not in excess of the fee amount due.
I've placed the validator code in the ascx file, and I have also tried using Page.ClientScript.RegisterClientScriptBlock() and in both cases the validation fires, but cannot find the JavaScript function.
The output in Firefox's error console is "feeAmountCheck is not defined". Here is the function (this was taken directly from firefox->view source)
<script type="text/javascript">
function feeAmountCheck(source, arguments)
{
var amountDue = document.getElementById('ctl00_footerContentHolder_Fees1_FeeDue');
var amountPaid = document.getElementById('ctl00_footerContentHolder_Fees1_FeePaid');
if (amountDue.value > 0 && amountDue >= amountPaid)
{
arguments.IsValid = true;
}
else
{
arguments.IsValid = false;
}
return arguments;
}
</script>
Any ideas as to why the function isn't being found? How can I remedy this without having to add the function to my master page or consuming page?
Thanks in advance. | 0 |
1,408 | 08/04/2008 16:54:49 | 58 | 08/01/2008 13:56:33 | 747 | 33 | Make XAMPP serve file outside of htdocs | Is it possible to configure [xampp][1] to serve up a file outside of the htdocs directory?
For instance, say I have a file:
C:\projects\transitCalculator\trunk\TransitCalculator.php
and my xampp files are normally served out of:
C:\xampp\htdocs\
(because that's how it's configured by default) Is there some way to make Apache recognize and serve up my TransitCalculator.php file without moving it under htdocs? Preferably I'd like apache to serve up/have access to the entire contents of the projects directory, and I don't want to move the projects directory under htdocs.
[1]: http://www.apachefriends.org/en/xampp.html | xampp | apache | php | serverconfiguration | null | null | open | Make XAMPP serve file outside of htdocs
===
Is it possible to configure [xampp][1] to serve up a file outside of the htdocs directory?
For instance, say I have a file:
C:\projects\transitCalculator\trunk\TransitCalculator.php
and my xampp files are normally served out of:
C:\xampp\htdocs\
(because that's how it's configured by default) Is there some way to make Apache recognize and serve up my TransitCalculator.php file without moving it under htdocs? Preferably I'd like apache to serve up/have access to the entire contents of the projects directory, and I don't want to move the projects directory under htdocs.
[1]: http://www.apachefriends.org/en/xampp.html | 0 |
1,409 | 08/04/2008 16:55:31 | 26 | 08/01/2008 12:18:14 | 21 | 7 | Bandwith throttling in IIS 6 by IP Address | I am writing an application that downloads large files in the background. All clients are logged in locally, or through a VPN. When they are logged in locally, I do not want to throttle downloads. However, I would like to limit downloads to 10 KBps when the user is connected via VPN. I can differentiate between these users by IP Address range.
Since this is an AIR Application, I figure I will throttle via server-side since I can do it from either the server itself (IIS 6) or the web service (asp.net / C#).
Throttling through IIS 6 seems to work fine, but it seems like it has to be done across the entire web site. Is there anyway to do this via IP? Or will I have to rig this up in .NET?
Thanks in advance... | iis | asp.net | null | null | null | null | open | Bandwith throttling in IIS 6 by IP Address
===
I am writing an application that downloads large files in the background. All clients are logged in locally, or through a VPN. When they are logged in locally, I do not want to throttle downloads. However, I would like to limit downloads to 10 KBps when the user is connected via VPN. I can differentiate between these users by IP Address range.
Since this is an AIR Application, I figure I will throttle via server-side since I can do it from either the server itself (IIS 6) or the web service (asp.net / C#).
Throttling through IIS 6 seems to work fine, but it seems like it has to be done across the entire web site. Is there anyway to do this via IP? Or will I have to rig this up in .NET?
Thanks in advance... | 0 |
1,417 | 08/04/2008 17:02:31 | 287 | 08/04/2008 12:43:38 | 1 | 0 | How can I get the authenticated user name under Apache using plain HTTP authentication and PHP? | First, let's get the security considerations out of the way. I'm using simple authentication under Apache for a one-off, internal use only, non-internet connected lan, php web app.
How can get I the HTTP authenticated user name in PHP? | php | apache | authentication | null | null | null | open | How can I get the authenticated user name under Apache using plain HTTP authentication and PHP?
===
First, let's get the security considerations out of the way. I'm using simple authentication under Apache for a one-off, internal use only, non-internet connected lan, php web app.
How can get I the HTTP authenticated user name in PHP? | 0 |
1,451 | 08/04/2008 17:46:28 | 106 | 08/02/2008 00:12:12 | 43 | 10 | What is the best way to handle multiple permission types? | I often encounter the following scenario where I need to offer many different types of permissions. I primarily use ASP.NET / VB.NET with SQL Server 2000.
**Scenario**
I want to offer a dynamic permission system that can work on different parameters. Let's say that I want to give either a department or just a specific person access to an application. And pretend that we have a number of applications that keeps growing.
In the past, I have chosen one of the following two ways that I know to do this.
1. Use a single permission table with special columns that are used for determining a how to apply the parameters. The special columns in this example are TypeID and TypeAuxID. The SQL would look something like this.
> SELECT COUNT(PermissionID)
> FROM application_permissions
> WHERE
> (TypeID = 1 AND TypeAuxID = @UserID) OR
> (TypeID = 2 AND TypeAuxID = @DepartmentID)
> AND ApplicationID = 1
2. Use a mapping table for each type of permission, then joining them all together.
> SELECT COUNT(perm.PermissionID)
> FROM application_permissions perm
> LEFT JOIN application_UserPermissions emp ON perm.ApplicationID = emp.ApplicationID
> LEFT JOIN application_DepartmentPermissions dept ON perm.ApplicationID = dept.ApplicationID
> WHERE q.SectionID=@SectionID
> AND (emp.UserID=@UserID OR dept.DeptID=@DeptID OR (emp.UserID IS NULL AND dept.DeptID IS NULL))
> AND ApplicationID = 1
> ORDER BY q.QID ASC
**My Thoughts**
I hope that the examples make sense. I cobbled them together.
The first example requires less work, but neither of them feel like the best answer. Is there a better way to handle this? | sql | permissions | null | null | null | null | open | What is the best way to handle multiple permission types?
===
I often encounter the following scenario where I need to offer many different types of permissions. I primarily use ASP.NET / VB.NET with SQL Server 2000.
**Scenario**
I want to offer a dynamic permission system that can work on different parameters. Let's say that I want to give either a department or just a specific person access to an application. And pretend that we have a number of applications that keeps growing.
In the past, I have chosen one of the following two ways that I know to do this.
1. Use a single permission table with special columns that are used for determining a how to apply the parameters. The special columns in this example are TypeID and TypeAuxID. The SQL would look something like this.
> SELECT COUNT(PermissionID)
> FROM application_permissions
> WHERE
> (TypeID = 1 AND TypeAuxID = @UserID) OR
> (TypeID = 2 AND TypeAuxID = @DepartmentID)
> AND ApplicationID = 1
2. Use a mapping table for each type of permission, then joining them all together.
> SELECT COUNT(perm.PermissionID)
> FROM application_permissions perm
> LEFT JOIN application_UserPermissions emp ON perm.ApplicationID = emp.ApplicationID
> LEFT JOIN application_DepartmentPermissions dept ON perm.ApplicationID = dept.ApplicationID
> WHERE q.SectionID=@SectionID
> AND (emp.UserID=@UserID OR dept.DeptID=@DeptID OR (emp.UserID IS NULL AND dept.DeptID IS NULL))
> AND ApplicationID = 1
> ORDER BY q.QID ASC
**My Thoughts**
I hope that the examples make sense. I cobbled them together.
The first example requires less work, but neither of them feel like the best answer. Is there a better way to handle this? | 0 |
1,453 | 08/04/2008 17:51:13 | 58 | 08/01/2008 13:56:33 | 831 | 35 | Using object property as default for method property | I'm trying to do this (which produces an unexpected T_VARIABLE error):
public function createShipment($startZip, $endZip, $weight = $this->getDefaultWeight()){}
I don't want to put a magic number in there for weight, since the object I am using has a "defaultWeight" parameter that all new shipments get if you don't specify a weight. I can't put the defaultWeight in the shipment itself, because it changes from shipment group to shipment group. Is there a better way to do it than the following?
public function createShipment($startZip, $endZip, weight = 0){
if($weight <= 0){
$weight = $this->getDefaultWeight();
}
} | php | oo | parameters | methods | methoddefaults | null | open | Using object property as default for method property
===
I'm trying to do this (which produces an unexpected T_VARIABLE error):
public function createShipment($startZip, $endZip, $weight = $this->getDefaultWeight()){}
I don't want to put a magic number in there for weight, since the object I am using has a "defaultWeight" parameter that all new shipments get if you don't specify a weight. I can't put the defaultWeight in the shipment itself, because it changes from shipment group to shipment group. Is there a better way to do it than the following?
public function createShipment($startZip, $endZip, weight = 0){
if($weight <= 0){
$weight = $this->getDefaultWeight();
}
} | 0 |
1,457 | 08/04/2008 17:53:32 | 331 | 08/04/2008 17:50:48 | 1 | 0 | Modify Address Bar URL in AJAX App to Match Current State | I'm writing an AJAX app, but as the user moves through the app, I'd like the URL in the address bar to update despite the lack of page reloads. Basically, I'd like for them to be able to bookmark at any point and thereby return to the current state.
How are people handling maintaining RESTfulness in AJAX apps? Thanks in advance. | ajax | rest | url | address-bar | null | null | open | Modify Address Bar URL in AJAX App to Match Current State
===
I'm writing an AJAX app, but as the user moves through the app, I'd like the URL in the address bar to update despite the lack of page reloads. Basically, I'd like for them to be able to bookmark at any point and thereby return to the current state.
How are people handling maintaining RESTfulness in AJAX apps? Thanks in advance. | 0 |
1,476 | 08/04/2008 18:20:36 | 92 | 08/01/2008 17:55:41 | 81 | 2 | How do you express binary literals in python? | How do you express an integer as a binary number with python literals?
I was easily able to find the answer for hex:
>>> 0x12AF
4783
>>> 0x100
256
and, octal:
>>> 01267
695
>>> 0100
64
**How do you use literals to express binary in python?** | python | syntax | binary | null | null | null | open | How do you express binary literals in python?
===
How do you express an integer as a binary number with python literals?
I was easily able to find the answer for hex:
>>> 0x12AF
4783
>>> 0x100
256
and, octal:
>>> 01267
695
>>> 0100
64
**How do you use literals to express binary in python?** | 0 |
1,496 | 08/04/2008 18:51:38 | 136 | 08/02/2008 10:21:53 | 475 | 17 | What are the preferred versions of Vim and Emacs on OSX? | For those of us that like to use the graphical version of Vim or Emacs, instead of the console version, which version do you recommend?
For Vim, there's [Mac OSX Vim](http://sourceforge.net/projects/macosxvim/), [MacVim](http://code.google.com/p/macvim/), [Vim-Cocoa](http://code.google.com/p/vim-cocoa/).
For Emacs, [CarbonEmacs](http://www.apple.com/downloads/macosx/unix_open_source/carbonemacspackage.html), [XEmacs](http://www.xemacs.org/), and [Aquamacs](http://aquamacs.org/).
Are there more? Which of these are ready for prime-time? If it's a tough call, what are the trade-offs? Are all of these still being maintained?
No discussion of Vim vs. Emacs, if you don't mind, or comparisons with other editors. | mac | osx | editor | emacs | vim | null | open | What are the preferred versions of Vim and Emacs on OSX?
===
For those of us that like to use the graphical version of Vim or Emacs, instead of the console version, which version do you recommend?
For Vim, there's [Mac OSX Vim](http://sourceforge.net/projects/macosxvim/), [MacVim](http://code.google.com/p/macvim/), [Vim-Cocoa](http://code.google.com/p/vim-cocoa/).
For Emacs, [CarbonEmacs](http://www.apple.com/downloads/macosx/unix_open_source/carbonemacspackage.html), [XEmacs](http://www.xemacs.org/), and [Aquamacs](http://aquamacs.org/).
Are there more? Which of these are ready for prime-time? If it's a tough call, what are the trade-offs? Are all of these still being maintained?
No discussion of Vim vs. Emacs, if you don't mind, or comparisons with other editors. | 0 |
1,503 | 08/04/2008 19:01:14 | 27 | 08/01/2008 12:21:40 | 41 | 3 | Integrating Visual Studio Test Project with Cruise Control | I'm looking into using Visual Studio 2008's built in unit test projects instead of NUnit and I was wondering if anyone has any experience in trying to integrate this type of unit test project with Cruise Control.Net. | visual-studio | unit-testing | cruisecontrol.net | continuous-integration | null | null | open | Integrating Visual Studio Test Project with Cruise Control
===
I'm looking into using Visual Studio 2008's built in unit test projects instead of NUnit and I was wondering if anyone has any experience in trying to integrate this type of unit test project with Cruise Control.Net. | 0 |
1,505 | 08/04/2008 19:02:36 | 83 | 08/01/2008 16:31:56 | 124 | 16 | How do I give my web sites an icon for iPhone? | How do I set the icon that appears on the iPhone for the web sites I create? | html | favicon | iphone | null | null | null | open | How do I give my web sites an icon for iPhone?
===
How do I set the icon that appears on the iPhone for the web sites I create? | 0 |
1,508 | 08/04/2008 19:04:47 | 149 | 08/02/2008 15:03:56 | 59 | 8 | Different Distributed Version Control Systems working together | My office has a central Source Safe 2005 install that we use for source control. I can't change what the office uses on the server.
I develop on a laptop and would like to have a different local source control repository that can sync with the central server (when available) regardless of the what that central provider is. The reason for the request is so I can maintain a local stable branch/build for client presentations while continuing to develop without having to jumo through flaming hoops.
Can any of the existing distributed source control clients handle that? | distributedsourceco | null | null | null | null | null | open | Different Distributed Version Control Systems working together
===
My office has a central Source Safe 2005 install that we use for source control. I can't change what the office uses on the server.
I develop on a laptop and would like to have a different local source control repository that can sync with the central server (when available) regardless of the what that central provider is. The reason for the request is so I can maintain a local stable branch/build for client presentations while continuing to develop without having to jumo through flaming hoops.
Can any of the existing distributed source control clients handle that? | 0 |
1,528 | 08/04/2008 19:13:54 | 93 | 08/01/2008 18:23:58 | 167 | 3 | Hiding inherited members in C# | I'm looking for some way to effectively hide inherited members. I have a library of classes which inherit from common base classes. Some of the more recent descendant classes inherit dependency properties which have become vestigial and can be a little confusing when using intellisense or using the classes in a visual designer.
These classes are all controls that are written to be compiled for either WPF or Silverlight 2.0. I know about `ICustomTypeDescriptor` and `ICustomPropertyProvider`, but I'm pretty certain those can't be used in Silverlight.
It's not as much a functional issue as a usability issue. What should I do? | c# | polymorphism | silverlight | dependencyproperties | wpf | null | open | Hiding inherited members in C#
===
I'm looking for some way to effectively hide inherited members. I have a library of classes which inherit from common base classes. Some of the more recent descendant classes inherit dependency properties which have become vestigial and can be a little confusing when using intellisense or using the classes in a visual designer.
These classes are all controls that are written to be compiled for either WPF or Silverlight 2.0. I know about `ICustomTypeDescriptor` and `ICustomPropertyProvider`, but I'm pretty certain those can't be used in Silverlight.
It's not as much a functional issue as a usability issue. What should I do? | 0 |
1,535 | 08/04/2008 19:21:48 | 332 | 08/04/2008 17:51:58 | 1 | 2 | Reducing duplicate error handling code in C#? | I've never been completely happy with the way exception handling works, there's a lot exceptions and try/catch brings to the table (stack unwinding, etc.), but it seems to break a lot of the OO model in the process.
Anyway, here's the problem:
Let's say you have some class which wraps or includes networked file IO operations (e.g. reading and writing to some file at some particular UNC path somewhere). For various reasons you don't want those IO operations to fail, so if you detect that they fail you retry them and you keep retrying them until they succeed or you reach a timeout. I already have a convenient RetryTimer class which I can instantiate and use to sleep the current thread between retries and determine when the timeout period has elapsed, etc.
The problem is that you have a bunch of IO operations in several methods of this class, and you need to wrap each of them in try-catch / retry logic.
Here's an example code snippet:
RetryTimer fileIORetryTimer = new RetryTimer(TimeSpan.FromHours(10));
bool success = false;
while (!success)
{
try
{
// do some file IO which may succeed or fail
success = true;
}
catch (IOException e)
{
if (fileIORetryTimer.HasExceededRetryTimeout)
{
throw e;
}
fileIORetryTimer.SleepUntilNextRetry();
}
}
So, how do you avoid duplicating most of this code for every file IO operation throughout the class? My solution was to use anonymous delegate blocks and a single method in the class which executed the delegate block passed to it. This allowed me to do things like this in other methods:
this.RetryFileIO( delegate()
{
// some code block
} );
I like this somewhat, but it leaves a lot to be desired. I'd like to hear how other people would solve this sort of problem. | c# | exception | error-handling | null | null | null | open | Reducing duplicate error handling code in C#?
===
I've never been completely happy with the way exception handling works, there's a lot exceptions and try/catch brings to the table (stack unwinding, etc.), but it seems to break a lot of the OO model in the process.
Anyway, here's the problem:
Let's say you have some class which wraps or includes networked file IO operations (e.g. reading and writing to some file at some particular UNC path somewhere). For various reasons you don't want those IO operations to fail, so if you detect that they fail you retry them and you keep retrying them until they succeed or you reach a timeout. I already have a convenient RetryTimer class which I can instantiate and use to sleep the current thread between retries and determine when the timeout period has elapsed, etc.
The problem is that you have a bunch of IO operations in several methods of this class, and you need to wrap each of them in try-catch / retry logic.
Here's an example code snippet:
RetryTimer fileIORetryTimer = new RetryTimer(TimeSpan.FromHours(10));
bool success = false;
while (!success)
{
try
{
// do some file IO which may succeed or fail
success = true;
}
catch (IOException e)
{
if (fileIORetryTimer.HasExceededRetryTimeout)
{
throw e;
}
fileIORetryTimer.SleepUntilNextRetry();
}
}
So, how do you avoid duplicating most of this code for every file IO operation throughout the class? My solution was to use anonymous delegate blocks and a single method in the class which executed the delegate block passed to it. This allowed me to do things like this in other methods:
this.RetryFileIO( delegate()
{
// some code block
} );
I like this somewhat, but it leaves a lot to be desired. I'd like to hear how other people would solve this sort of problem. | 0 |
1,537 | 08/04/2008 19:28:23 | 290 | 08/04/2008 12:57:50 | 31 | 2 | What is software engineering? | Sounds like Stack Overflow has a software engineering bent. So, how's software engineering being defined here?
What is software engineering? | softwareengineering | null | null | null | null | null | open | What is software engineering?
===
Sounds like Stack Overflow has a software engineering bent. So, how's software engineering being defined here?
What is software engineering? | 0 |
1,542 | 08/04/2008 19:38:03 | 58 | 08/01/2008 13:56:33 | 866 | 38 | Online Peer Code Review? | For people who work on very small teams, or by themselves, or on teams where they are by far the best developer and have a need to learn from someone better than them, are there any online resources/methods for doing some sort of peer code review?
I used to be pretty active in the online art community (specifically drawing anime) and there were all sorts of sites where you could just post pictures for critiques and comments. I've never seen anything like that for programmers. I'm thinking of somewhere where you could post Object Architecture plans, DB design plans, or even just straight code for others to look at, learn from, and critique and comment on. Anyone know of anything like that anywhere (preferably focused towards PHP, but anything will do, and even a non-free site would be ok)?
Thanks!
note: yes, I am aware that this could have security implications, but security by obscurity is the worst security, and posting your code would actually help flush out potential security issues... | codereview | peerreview | communities | null | null | 12/20/2011 17:51:25 | not constructive | Online Peer Code Review?
===
For people who work on very small teams, or by themselves, or on teams where they are by far the best developer and have a need to learn from someone better than them, are there any online resources/methods for doing some sort of peer code review?
I used to be pretty active in the online art community (specifically drawing anime) and there were all sorts of sites where you could just post pictures for critiques and comments. I've never seen anything like that for programmers. I'm thinking of somewhere where you could post Object Architecture plans, DB design plans, or even just straight code for others to look at, learn from, and critique and comment on. Anyone know of anything like that anywhere (preferably focused towards PHP, but anything will do, and even a non-free site would be ok)?
Thanks!
note: yes, I am aware that this could have security implications, but security by obscurity is the worst security, and posting your code would actually help flush out potential security issues... | 4 |
1,551 | 08/04/2008 19:56:05 | 307 | 08/04/2008 14:26:05 | 1 | 2 | How to Think in OO | What is the best book/resource for the transition from procedural to object-oriented programming? Is there a good online Dojo, [Kata][1], or a book you can recommend?
[1]: http://en.wikipedia.org/wiki/Kata | oop | books | null | null | null | 01/24/2012 18:31:29 | off topic | How to Think in OO
===
What is the best book/resource for the transition from procedural to object-oriented programming? Is there a good online Dojo, [Kata][1], or a book you can recommend?
[1]: http://en.wikipedia.org/wiki/Kata | 2 |
1,576 | 08/04/2008 20:54:29 | 117 | 08/02/2008 05:54:20 | 174 | 16 | What should a longtime Windows user know when starting to use Linux? | We've finally moved our websites to a decent [host][1], and for the first time we have Shell Access.
I know very little about using linux, I can navigate through the file system, read files with vim and I'm aware of the man command, and I have been able to workout solutions problems as they show up (eventually), but I know I'm unaware of alot.
So my questions:
- What are the essential commands that every Linux user should know about?
- What are the most useful commands that I should look into?
[1]: http://www.simplehelix.com/ | bash | shell-access | unix | nix | null | null | open | What should a longtime Windows user know when starting to use Linux?
===
We've finally moved our websites to a decent [host][1], and for the first time we have Shell Access.
I know very little about using linux, I can navigate through the file system, read files with vim and I'm aware of the man command, and I have been able to workout solutions problems as they show up (eventually), but I know I'm unaware of alot.
So my questions:
- What are the essential commands that every Linux user should know about?
- What are the most useful commands that I should look into?
[1]: http://www.simplehelix.com/ | 0 |
1,584 | 08/04/2008 21:04:06 | 40 | 08/01/2008 12:48:12 | 360 | 43 | Linux shell equivalent on IIS | As a LAMP developer considering moving to a .Net IIS platform, one of my concerns is the loss of productivity due to lack of shell... Has anyone else had this experience? Is there possibly a Linux shell equivalent for Windows? | windows | linux | iis | shell | terminal | null | open | Linux shell equivalent on IIS
===
As a LAMP developer considering moving to a .Net IIS platform, one of my concerns is the loss of productivity due to lack of shell... Has anyone else had this experience? Is there possibly a Linux shell equivalent for Windows? | 0 |
1,598 | 08/04/2008 21:17:51 | 83 | 08/01/2008 16:31:56 | 186 | 21 | What are the correct pixel dimensions for an apple-touch-icon? | I'm not sure what the correct size should be.
Many sites seem to repeat that the apple-touch-icon should be 57x57 pixels but site a broken link as their source.
[Hanselman][1]'s and [playgroundblues][2]'s comments suggest different sizes including 163x163 and 60x60.
Apple's own [apple.com icon][3] is 129x129!
See my related question:
[How do I give my web sites an icon for iPhone?][4]
[1]: http://www.hanselman.com/blog/MakeYourWebsiteMobileAndIPhoneFriendlyAddHomeScreenIPhoneIconsAndAdjustTheViewPort.aspx
[2]: http://playgroundblues.com/posts/2008/jan/15/iphone-bookmark-iconage/
[3]: http://www.apple.com/apple-touch-icon.png
[4]: http://stackoverflow.com/questions/1505/how-do-i-give-my-web-sites-an-icon-for-iphone | iphone | favicon | apple-touch-icon | null | null | null | open | What are the correct pixel dimensions for an apple-touch-icon?
===
I'm not sure what the correct size should be.
Many sites seem to repeat that the apple-touch-icon should be 57x57 pixels but site a broken link as their source.
[Hanselman][1]'s and [playgroundblues][2]'s comments suggest different sizes including 163x163 and 60x60.
Apple's own [apple.com icon][3] is 129x129!
See my related question:
[How do I give my web sites an icon for iPhone?][4]
[1]: http://www.hanselman.com/blog/MakeYourWebsiteMobileAndIPhoneFriendlyAddHomeScreenIPhoneIconsAndAdjustTheViewPort.aspx
[2]: http://playgroundblues.com/posts/2008/jan/15/iphone-bookmark-iconage/
[3]: http://www.apple.com/apple-touch-icon.png
[4]: http://stackoverflow.com/questions/1505/how-do-i-give-my-web-sites-an-icon-for-iphone | 0 |
1,600 | 08/04/2008 21:27:53 | 230 | 08/03/2008 19:32:46 | 34 | 1 | Best way to copy a database in SQL Server 2005/8? | I always create a new empty database and then do a backup and restore of the existing database into it, but is this really the best way? As it seems very error prone and over complicated to me. | sql-server | null | null | null | null | null | open | Best way to copy a database in SQL Server 2005/8?
===
I always create a new empty database and then do a backup and restore of the existing database into it, but is this really the best way? As it seems very error prone and over complicated to me. | 0 |
1,607 | 08/04/2008 21:31:40 | 72 | 08/01/2008 15:09:58 | 124 | 5 | Mechanisms for tracking DB schema changes | What are the best methods for tracking and/or automating DB schema changes? Our team uses Subversion for version control and we've been able to automate some of our tasks this way (pushing builds up to a staging server, deploying tested code to a production server) but we're still doing database updates manually. I would like to find or create a solution that allows us to work efficiently across servers with different environments while continuing to use Subversion as a backend through which code and DB updates are pushed around to various servers.
Many popular software packages include auto-update scripts which detect DB version and apply the necessary changes. Is this the best way to do this even on a larger scale (across multiple projects and sometimes multiple environments and languages)? If so, is there any existing code out there that simplifies the process or is it best just to roll our own solution? Has anyone implemented something similar before and integrated it into Subversion post-commit hooks, or is this a bad idea?
While a solution that supports multiple platforms would be preferable, we definitely need to support the Linux/Apache/MySQL/PHP stack as the majority of our work is on that platform. | database | php | mysql | subversion | null | 05/03/2012 12:25:33 | not constructive | Mechanisms for tracking DB schema changes
===
What are the best methods for tracking and/or automating DB schema changes? Our team uses Subversion for version control and we've been able to automate some of our tasks this way (pushing builds up to a staging server, deploying tested code to a production server) but we're still doing database updates manually. I would like to find or create a solution that allows us to work efficiently across servers with different environments while continuing to use Subversion as a backend through which code and DB updates are pushed around to various servers.
Many popular software packages include auto-update scripts which detect DB version and apply the necessary changes. Is this the best way to do this even on a larger scale (across multiple projects and sometimes multiple environments and languages)? If so, is there any existing code out there that simplifies the process or is it best just to roll our own solution? Has anyone implemented something similar before and integrated it into Subversion post-commit hooks, or is this a bad idea?
While a solution that supports multiple platforms would be preferable, we definitely need to support the Linux/Apache/MySQL/PHP stack as the majority of our work is on that platform. | 4 |
1,610 | 08/04/2008 21:37:31 | 328 | 08/04/2008 17:20:23 | 1 | 0 | Can I logically reorder columns in a table? | If I'm adding a column to a table in Microsoft SQL Server, can I control where the column is displayed logically in queries?
I don't want to mess with the physical layout of columns on disk, but I would like to logically group columns together when possible so that tools like SQL Server Management Studio list the contents of the table in a convenient way.
I know that I can do this through SQL Management Studio by going into their "design" mode for tables and dragging the order of columns around, but I'd like to be able to do it in raw SQL so that I can perform the ordering scripted from the command line. | mssql | null | null | null | null | null | open | Can I logically reorder columns in a table?
===
If I'm adding a column to a table in Microsoft SQL Server, can I control where the column is displayed logically in queries?
I don't want to mess with the physical layout of columns on disk, but I would like to logically group columns together when possible so that tools like SQL Server Management Studio list the contents of the table in a convenient way.
I know that I can do this through SQL Management Studio by going into their "design" mode for tables and dragging the order of columns around, but I'd like to be able to do it in raw SQL so that I can perform the ordering scripted from the command line. | 0 |